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

cj5_parse:
  305|  7.72k|          cj5_options *options) {
  306|  7.72k|    cj5_result r;
  307|  7.72k|    cj5__parser parser;
  308|  7.72k|    memset(&parser, 0x0, sizeof(parser));
  309|  7.72k|    parser.curr_tok_idx = 0;
  310|  7.72k|    parser.json5 = json5;
  311|  7.72k|    parser.len = len;
  312|  7.72k|    parser.tokens = tokens;
  313|  7.72k|    parser.max_tokens = max_tokens;
  314|       |
  315|  7.72k|    if(options)
  ------------------
  |  Branch (315:8): [True: 7.72k, False: 0]
  ------------------
  316|  7.72k|        parser.stop_early = options->stop_early;
  317|       |
  318|  7.72k|    unsigned short depth = 0; // Nesting depth zero means "outside the root object"
  319|  7.72k|    char nesting[CJ5_MAX_NESTING]; // Contains either '\0', '{' or '[' for the
  320|       |                                   // type of nesting at each depth. '\0'
  321|       |                                   // indicates we are out of the root object.
  322|  7.72k|    char next[CJ5_MAX_NESTING];    // Next content to parse: 'k' (key), ':', 'v'
  323|       |                                   // (value) or ',' (comma).
  324|  7.72k|    next[0] = 'v';  // The root is a "value" (object, array or primitive). If we
  325|       |                    // detect a colon after the first value then everything is
  326|       |                    // wrapped into a "virtual root object" and the parsing is
  327|       |                    // restarted.
  328|  7.72k|    nesting[0] = 0; // Becomes '{' if there is a virtual root object
  329|       |
  330|  7.72k|    cj5_token *token = NULL; // The current token
  331|       |
  332|  9.44k| start_parsing:
  333|  51.6M|    for(; parser.pos < len; parser.pos++) {
  ------------------
  |  Branch (333:11): [True: 51.6M, False: 7.30k]
  ------------------
  334|  51.6M|        char c = json5[parser.pos];
  335|  51.6M|        switch(c) {
  336|   681k|        case '\n': // Skip newline and whitespace
  ------------------
  |  Branch (336:9): [True: 681k, False: 50.9M]
  ------------------
  337|  1.72M|        case '\r':
  ------------------
  |  Branch (337:9): [True: 1.04M, False: 50.5M]
  ------------------
  338|  1.84M|        case '\t':
  ------------------
  |  Branch (338:9): [True: 115k, False: 51.4M]
  ------------------
  339|  2.14M|        case ' ':
  ------------------
  |  Branch (339:9): [True: 297k, False: 51.3M]
  ------------------
  340|  2.14M|            break;
  341|       |
  342|  5.79k|        case '#': // Skip comment
  ------------------
  |  Branch (342:9): [True: 5.79k, False: 51.6M]
  ------------------
  343|  9.62k|        case '/':
  ------------------
  |  Branch (343:9): [True: 3.83k, False: 51.6M]
  ------------------
  344|  9.62k|            cj5__skip_comment(&parser);
  345|  9.62k|            if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (345:16): [True: 3.73k, False: 5.89k]
  ------------------
  346|  3.73k|               parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (346:16): [True: 136, False: 3.60k]
  ------------------
  347|    136|                goto finish;
  348|  9.49k|            break;
  349|       |
  350|   297k|        case '{': // Open an object or array
  ------------------
  |  Branch (350:9): [True: 297k, False: 51.3M]
  ------------------
  351|   305k|        case '[':
  ------------------
  |  Branch (351:9): [True: 8.37k, False: 51.6M]
  ------------------
  352|       |            // Check the nesting depth
  353|   305k|            if(depth + 1 >= CJ5_MAX_NESTING) {
  ------------------
  |  |   52|   305k|#define CJ5_MAX_NESTING 32
  ------------------
  |  Branch (353:16): [True: 3, False: 305k]
  ------------------
  354|      3|                parser.error = CJ5_ERROR_INVALID;
  355|      3|                goto finish;
  356|      3|            }
  357|       |
  358|       |            // Correct next?
  359|   305k|            if(next[depth] != 'v') {
  ------------------
  |  Branch (359:16): [True: 30, False: 305k]
  ------------------
  360|     30|                parser.error = CJ5_ERROR_INVALID;
  361|     30|                goto finish;
  362|     30|            }
  363|       |
  364|   305k|            depth++; // Increase the nesting depth
  365|   305k|            nesting[depth] = c; // Set the nesting type
  366|   305k|            next[depth] = (c == '{') ? 'k' : 'v'; // next is either a key or a value
  ------------------
  |  Branch (366:27): [True: 297k, False: 8.36k]
  ------------------
  367|       |
  368|       |            // Create a token for the object or array
  369|   305k|            token = cj5__alloc_token(&parser);
  370|   305k|            if(token) {
  ------------------
  |  Branch (370:16): [True: 175k, False: 130k]
  ------------------
  371|   175k|                token->parent_id = parser.curr_tok_idx;
  372|   175k|                token->type = (c == '{') ? CJ5_TOKEN_OBJECT : CJ5_TOKEN_ARRAY;
  ------------------
  |  Branch (372:31): [True: 167k, False: 7.88k]
  ------------------
  373|   175k|                token->start = parser.pos;
  374|   175k|                token->size = 0;
  375|   175k|                parser.curr_tok_idx = parser.token_count - 1; // The new curr_tok_idx
  376|       |                                                              // is for this token
  377|   175k|            }
  378|   305k|            break;
  379|       |
  380|   295k|        case '}': // Close an object or array
  ------------------
  |  Branch (380:9): [True: 295k, False: 51.3M]
  ------------------
  381|   302k|        case ']':
  ------------------
  |  Branch (381:9): [True: 7.28k, False: 51.6M]
  ------------------
  382|       |            // Check the nesting depth. Note that a "virtual root object" at
  383|       |            // depth zero must not be closed.
  384|   302k|            if(depth == 0) {
  ------------------
  |  Branch (384:16): [True: 20, False: 302k]
  ------------------
  385|     20|                parser.error = CJ5_ERROR_INVALID;
  386|     20|                goto finish;
  387|     20|            }
  388|       |
  389|       |            // Check and adjust the nesting. Note that ']' - '[' == 2 and '}' -
  390|       |            // '{' == 2. Arrays can always be closed. Objects can only close
  391|       |            // when a key or a comma is expected.
  392|   302k|            if(c - nesting[depth] != 2 ||
  ------------------
  |  Branch (392:16): [True: 8, False: 302k]
  ------------------
  393|   302k|               (c == '}' && next[depth] != 'k' && next[depth] != ',')) {
  ------------------
  |  Branch (393:17): [True: 295k, False: 7.27k]
  |  Branch (393:29): [True: 225k, False: 70.0k]
  |  Branch (393:51): [True: 3, False: 225k]
  ------------------
  394|     11|                parser.error = CJ5_ERROR_INVALID;
  395|     11|                goto finish;
  396|     11|            }
  397|       |
  398|   302k|            if(token) {
  ------------------
  |  Branch (398:16): [True: 171k, False: 131k]
  ------------------
  399|       |                // Finalize the current token
  400|   171k|                token->end = parser.pos;
  401|       |
  402|       |                // Move to the parent and increase the parent size. Omit this
  403|       |                // when we leave the root (parent the same as the current
  404|       |                // token).
  405|   171k|                if(parser.curr_tok_idx != token->parent_id) {
  ------------------
  |  Branch (405:20): [True: 165k, False: 5.48k]
  ------------------
  406|   165k|                    parser.curr_tok_idx = token->parent_id;
  407|   165k|                    token = &tokens[token->parent_id];
  408|   165k|                    token->size++;
  409|   165k|                }
  410|   171k|            }
  411|       |
  412|       |            // Step one level up
  413|   302k|            depth--;
  414|   302k|            next[depth] = (depth == 0) ? 0 : ','; // zero if we step out the root
  ------------------
  |  Branch (414:27): [True: 5.77k, False: 296k]
  ------------------
  415|       |                                                  // object. then we do not look for
  416|       |                                                  // another element.
  417|       |
  418|       |            // The first element was successfully parsed. Stop early or try to
  419|       |            // parse the full input string?
  420|   302k|            if(depth == 0 && parser.stop_early)
  ------------------
  |  Branch (420:16): [True: 5.77k, False: 296k]
  |  Branch (420:30): [True: 0, False: 5.77k]
  ------------------
  421|      0|                goto finish;
  422|       |
  423|   302k|            break;
  424|       |
  425|  2.63M|        case ':': // Colon (between key and value)
  ------------------
  |  Branch (425:9): [True: 2.63M, False: 48.9M]
  ------------------
  426|  2.63M|            if(next[depth] != ':') {
  ------------------
  |  Branch (426:16): [True: 1.34k, False: 2.63M]
  ------------------
  427|  1.34k|                parser.error = CJ5_ERROR_INVALID;
  428|  1.34k|                goto finish;
  429|  1.34k|            }
  430|  2.63M|            next[depth] = 'v';
  431|  2.63M|            break;
  432|       |
  433|  21.8M|        case ',': // Comma
  ------------------
  |  Branch (433:9): [True: 21.8M, False: 29.7M]
  ------------------
  434|  21.8M|            if(next[depth] != ',') {
  ------------------
  |  Branch (434:16): [True: 12, False: 21.8M]
  ------------------
  435|     12|                parser.error = CJ5_ERROR_INVALID;
  436|     12|                goto finish;
  437|     12|            }
  438|  21.8M|            next[depth] = (nesting[depth] == '{') ? 'k' : 'v';
  ------------------
  |  Branch (438:27): [True: 2.40M, False: 19.4M]
  ------------------
  439|  21.8M|            break;
  440|       |
  441|  24.3M|        default: // Value or key
  ------------------
  |  Branch (441:9): [True: 24.3M, False: 27.2M]
  ------------------
  442|  24.3M|            if(next[depth] == 'v') {
  ------------------
  |  Branch (442:16): [True: 21.7M, False: 2.63M]
  ------------------
  443|  21.7M|                cj5__parse_primitive(&parser); // Parse primitive value
  444|  21.7M|                if(nesting[depth] != 0) {
  ------------------
  |  Branch (444:20): [True: 21.7M, False: 1.74k]
  ------------------
  445|       |                    // Parent is object or array
  446|  21.7M|                    if(token)
  ------------------
  |  Branch (446:24): [True: 21.4M, False: 264k]
  ------------------
  447|  21.4M|                        token->size++;
  448|  21.7M|                    next[depth] = ',';
  449|  21.7M|                } else {
  450|       |                    // The current value was the root element. Don't look for
  451|       |                    // any next element.
  452|  1.74k|                    next[depth] = 0;
  453|       |
  454|       |                    // The first element was successfully parsed. Stop early or try to
  455|       |                    // parse the full input string?
  456|  1.74k|                    if(parser.stop_early)
  ------------------
  |  Branch (456:24): [True: 0, False: 1.74k]
  ------------------
  457|      0|                        goto finish;
  458|  1.74k|                }
  459|  21.7M|            } else if(next[depth] == 'k') {
  ------------------
  |  Branch (459:23): [True: 2.63M, False: 272]
  ------------------
  460|  2.63M|                cj5__parse_key(&parser);
  461|  2.63M|                if(token)
  ------------------
  |  Branch (461:20): [True: 2.29M, False: 334k]
  ------------------
  462|  2.29M|                    token->size++; // Keys count towards the length
  463|  2.63M|                next[depth] = ':';
  464|  2.63M|            } else {
  465|    272|                parser.error = CJ5_ERROR_INVALID;
  466|    272|            }
  467|       |
  468|  24.3M|            if(parser.error && parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (468:16): [True: 12.8M, False: 11.5M]
  |  Branch (468:32): [True: 583, False: 12.8M]
  ------------------
  469|    583|                goto finish;
  470|       |
  471|  24.3M|            break;
  472|  51.6M|        }
  473|  51.6M|    }
  474|       |
  475|       |    // Are we back to the initial nesting depth?
  476|  7.30k|    if(depth != 0) {
  ------------------
  |  Branch (476:8): [True: 175, False: 7.12k]
  ------------------
  477|    175|        parser.error = CJ5_ERROR_INCOMPLETE;
  478|    175|        goto finish;
  479|    175|    }
  480|       |
  481|       |    // Close the virtual root object if there is one
  482|  7.12k|    if(nesting[0] == '{' && parser.error != CJ5_ERROR_OVERFLOW) {
  ------------------
  |  Branch (482:8): [True: 1.26k, False: 5.86k]
  |  Branch (482:29): [True: 1.21k, False: 44]
  ------------------
  483|       |        // Check the we end after a complete key-value pair (or dangling comma)
  484|  1.21k|        if(next[0] != 'k' && next[0] != ',')
  ------------------
  |  Branch (484:12): [True: 1.20k, False: 10]
  |  Branch (484:30): [True: 90, False: 1.11k]
  ------------------
  485|     90|            parser.error = CJ5_ERROR_INVALID;
  486|  1.21k|        tokens[0].end = parser.pos - 1;
  487|  1.21k|    }
  488|       |
  489|  9.44k| finish:
  490|       |    // If parsing failed at the initial nesting depth, create a virtual root object
  491|       |    // and restart parsing.
  492|  9.44k|    if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (492:8): [True: 2.92k, False: 6.52k]
  ------------------
  493|  2.92k|       parser.error != CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (493:8): [True: 2.40k, False: 516]
  ------------------
  494|  2.40k|       depth == 0 && nesting[0] != '{') {
  ------------------
  |  Branch (494:8): [True: 2.13k, False: 270]
  |  Branch (494:22): [True: 1.71k, False: 420]
  ------------------
  495|  1.71k|        parser.token_count = 0;
  496|  1.71k|        token = cj5__alloc_token(&parser);
  497|  1.71k|        if(token) {
  ------------------
  |  Branch (497:12): [True: 1.71k, False: 0]
  ------------------
  498|  1.71k|            token->parent_id = 0;
  499|  1.71k|            token->type = CJ5_TOKEN_OBJECT;
  500|  1.71k|            token->start = 0;
  501|  1.71k|            token->size = 0;
  502|       |
  503|  1.71k|            nesting[0] = '{';
  504|  1.71k|            next[0] = 'k';
  505|       |
  506|  1.71k|            parser.curr_tok_idx = 0;
  507|  1.71k|            parser.pos = 0;
  508|  1.71k|            parser.error = CJ5_ERROR_NONE;
  509|  1.71k|            goto start_parsing;
  510|  1.71k|        }
  511|  1.71k|    }
  512|       |
  513|  7.72k|    memset(&r, 0x0, sizeof(r));
  514|  7.72k|    r.error = parser.error;
  515|  7.72k|    r.error_pos = parser.pos;
  516|  7.72k|    r.num_tokens = parser.token_count; // How many tokens (would) have been
  517|       |                                       // consumed by the parser?
  518|       |
  519|       |    // Not a single token was parsed -> return an error
  520|  7.72k|    if(r.num_tokens == 0)
  ------------------
  |  Branch (520:8): [True: 25, False: 7.70k]
  ------------------
  521|     25|        r.error = CJ5_ERROR_INCOMPLETE;
  522|       |
  523|       |    // Set the tokens and original string only if successfully parsed
  524|  7.72k|    if(r.error == CJ5_ERROR_NONE) {
  ------------------
  |  Branch (524:8): [True: 6.49k, False: 1.23k]
  ------------------
  525|  6.49k|        r.tokens = tokens;
  526|  6.49k|        r.json5 = json5;
  527|  6.49k|    }
  528|       |
  529|  7.72k|    return r;
  530|  9.44k|}
cj5_get_str:
  628|   435k|            char *buf, unsigned int *buflen) {
  629|   435k|    const cj5_token *token = &r->tokens[tok_index];
  630|   435k|    if(token->type != CJ5_TOKEN_STRING)
  ------------------
  |  Branch (630:8): [True: 0, False: 435k]
  ------------------
  631|      0|        return CJ5_ERROR_INVALID;
  632|       |
  633|   435k|    const char *pos = &r->json5[token->start];
  634|   435k|    const char *end = &r->json5[token->end + 1];
  635|   435k|    unsigned int outpos = 0;
  636|  30.9M|    for(; pos < end; pos++) {
  ------------------
  |  Branch (636:11): [True: 30.5M, False: 435k]
  ------------------
  637|  30.5M|        uint8_t c = (uint8_t)*pos;
  638|       |        // Unprintable ascii characters must be escaped
  639|  30.5M|        if(c < ' ' || c == 127)
  ------------------
  |  Branch (639:12): [True: 56, False: 30.5M]
  |  Branch (639:23): [True: 6, False: 30.5M]
  ------------------
  640|     62|            return CJ5_ERROR_INVALID;
  641|       |
  642|       |        // Unescaped Ascii character or utf8 byte
  643|  30.5M|        if(c != '\\') {
  ------------------
  |  Branch (643:12): [True: 30.4M, False: 37.2k]
  ------------------
  644|  30.4M|            buf[outpos++] = (char)c;
  645|  30.4M|            continue;
  646|  30.4M|        }
  647|       |
  648|       |        // End of input before the escaped character
  649|  37.2k|        if(pos + 1 >= end)
  ------------------
  |  Branch (649:12): [True: 0, False: 37.2k]
  ------------------
  650|      0|            return CJ5_ERROR_INCOMPLETE;
  651|       |
  652|       |        // Process escaped character
  653|  37.2k|        pos++;
  654|  37.2k|        c = (uint8_t)*pos;
  655|  37.2k|        switch(c) {
  656|    502|        case 'b': buf[outpos++] = '\b'; break;
  ------------------
  |  Branch (656:9): [True: 502, False: 36.7k]
  ------------------
  657|    720|        case 'f': buf[outpos++] = '\f'; break;
  ------------------
  |  Branch (657:9): [True: 720, False: 36.5k]
  ------------------
  658|    282|        case 'r': buf[outpos++] = '\r'; break;
  ------------------
  |  Branch (658:9): [True: 282, False: 36.9k]
  ------------------
  659|  1.33k|        case 'n': buf[outpos++] = '\n'; break;
  ------------------
  |  Branch (659:9): [True: 1.33k, False: 35.9k]
  ------------------
  660|  1.03k|        case 't': buf[outpos++] = '\t'; break;
  ------------------
  |  Branch (660:9): [True: 1.03k, False: 36.2k]
  ------------------
  661|  19.1k|        default:  buf[outpos++] = (char)c; break;
  ------------------
  |  Branch (661:9): [True: 19.1k, False: 18.1k]
  ------------------
  662|  14.2k|        case 'u': {
  ------------------
  |  Branch (662:9): [True: 14.2k, False: 23.0k]
  ------------------
  663|       |            // Parse a unicode code point
  664|  14.2k|            if(pos + 4 >= end)
  ------------------
  |  Branch (664:16): [True: 6, False: 14.2k]
  ------------------
  665|      6|                return CJ5_ERROR_INCOMPLETE;
  666|  14.2k|            pos++;
  667|  14.2k|            uint32_t utf;
  668|  14.2k|            cj5_error_code err = parse_codepoint(pos, &utf);
  669|  14.2k|            if(err != CJ5_ERROR_NONE)
  ------------------
  |  Branch (669:16): [True: 23, False: 14.2k]
  ------------------
  670|     23|                return err;
  671|  14.2k|            pos += 3;
  672|       |
  673|       |            // Parse a surrogate pair
  674|  14.2k|            if(0xd800 <= utf && utf <= 0xdfff) {
  ------------------
  |  Branch (674:16): [True: 3.15k, False: 11.0k]
  |  Branch (674:33): [True: 2.50k, False: 652]
  ------------------
  675|  2.50k|                if(pos + 6 >= end)
  ------------------
  |  Branch (675:20): [True: 15, False: 2.48k]
  ------------------
  676|     15|                    return CJ5_ERROR_INVALID;
  677|  2.48k|                if(pos[1] != '\\' && pos[2] != 'u')
  ------------------
  |  Branch (677:20): [True: 1.20k, False: 1.28k]
  |  Branch (677:38): [True: 14, False: 1.19k]
  ------------------
  678|     14|                    return CJ5_ERROR_INVALID;
  679|  2.47k|                pos += 3;
  680|  2.47k|                uint32_t utf2;
  681|  2.47k|                err = parse_codepoint(pos, &utf2);
  682|  2.47k|                if(err != CJ5_ERROR_NONE)
  ------------------
  |  Branch (682:20): [True: 21, False: 2.45k]
  ------------------
  683|     21|                    return err;
  684|  2.45k|                pos += 3;
  685|       |                // High or low surrogate pair
  686|  2.45k|                utf = (utf <= 0xdbff) ?
  ------------------
  |  Branch (686:23): [True: 1.50k, False: 947]
  ------------------
  687|  1.50k|                    (utf << 10) + utf2 + SURROGATE_OFFSET :
  688|  2.45k|                    (utf2 << 10) + utf + SURROGATE_OFFSET;
  689|  2.45k|            }
  690|       |
  691|       |            // Write the utf8 bytes of the code point
  692|  14.1k|            unsigned len = utf8_from_codepoint((unsigned char*)buf + outpos, utf);
  693|  14.1k|            if(len == 0)
  ------------------
  |  Branch (693:16): [True: 41, False: 14.1k]
  ------------------
  694|     41|                return CJ5_ERROR_INVALID; // Not a utf8 string
  695|  14.1k|            outpos += len;
  696|  14.1k|            break;
  697|  14.1k|        }
  698|  37.2k|        }
  699|  37.2k|    }
  700|       |
  701|       |    // Terminate with \0
  702|   435k|    buf[outpos] = 0;
  703|       |
  704|       |    // Set the output length
  705|   435k|    if(buflen)
  ------------------
  |  Branch (705:8): [True: 435k, False: 0]
  ------------------
  706|   435k|        *buflen = outpos;
  707|   435k|    return CJ5_ERROR_NONE;
  708|   435k|}
cj5.c:cj5__skip_comment:
  260|  9.62k|cj5__skip_comment(cj5__parser* parser) {
  261|  9.62k|    const char* json5 = parser->json5;
  262|       |
  263|       |    // Single-line comment
  264|  9.62k|    if(json5[parser->pos] == '#') {
  ------------------
  |  Branch (264:8): [True: 5.79k, False: 3.83k]
  ------------------
  265|  7.43k|    skip_line:
  266|  3.05M|        while(parser->pos < parser->len) {
  ------------------
  |  Branch (266:15): [True: 3.05M, False: 57]
  ------------------
  267|  3.05M|            if(json5[parser->pos] == '\n') {
  ------------------
  |  Branch (267:16): [True: 7.37k, False: 3.05M]
  ------------------
  268|  7.37k|                parser->pos--; // Reparse the newline in the main parse loop
  269|  7.37k|                return;
  270|  7.37k|            }
  271|  3.05M|            parser->pos++;
  272|  3.05M|        }
  273|     57|        return;
  274|  7.43k|    }
  275|       |
  276|       |    // Comment begins with '/' but not enough space for another character
  277|  3.83k|    if(parser->pos + 1 >= parser->len) {
  ------------------
  |  Branch (277:8): [True: 39, False: 3.80k]
  ------------------
  278|     39|        parser->error = CJ5_ERROR_INVALID;
  279|     39|        return;
  280|     39|    }
  281|  3.80k|    parser->pos++;
  282|       |
  283|       |    // Comment begins with '//' -> single-line comment
  284|  3.80k|    if(json5[parser->pos] == '/')
  ------------------
  |  Branch (284:8): [True: 1.64k, False: 2.15k]
  ------------------
  285|  1.64k|        goto skip_line;
  286|       |
  287|       |    // Multi-line comments begin with '/*' and end with '*/'
  288|  2.15k|    if(json5[parser->pos] == '*') {
  ------------------
  |  Branch (288:8): [True: 2.11k, False: 35]
  ------------------
  289|  2.11k|        parser->pos++;
  290|  2.07M|        for(; parser->pos + 1 < parser->len; parser->pos++) {
  ------------------
  |  Branch (290:15): [True: 2.07M, False: 62]
  ------------------
  291|  2.07M|            if(json5[parser->pos] == '*' && json5[parser->pos + 1] == '/') {
  ------------------
  |  Branch (291:16): [True: 5.10k, False: 2.07M]
  |  Branch (291:45): [True: 2.05k, False: 3.04k]
  ------------------
  292|  2.05k|                parser->pos++;
  293|  2.05k|                return;
  294|  2.05k|            }
  295|  2.07M|        }
  296|  2.11k|    }
  297|       |
  298|       |    // Unknown comment type or the multi-line comment is not terminated
  299|     97|    parser->error = CJ5_ERROR_INCOMPLETE;
  300|     97|}
cj5.c:cj5__alloc_token:
   88|  24.7M|cj5__alloc_token(cj5__parser *parser) {
   89|  24.7M|    cj5_token* token = NULL;
   90|  24.7M|    if(parser->token_count < parser->max_tokens) {
  ------------------
  |  Branch (90:8): [True: 11.7M, False: 12.9M]
  ------------------
   91|  11.7M|        token = &parser->tokens[parser->token_count];
   92|  11.7M|        memset(token, 0x0, sizeof(cj5_token));
   93|  12.9M|    } else {
   94|  12.9M|        parser->error = CJ5_ERROR_OVERFLOW;
   95|  12.9M|    }
   96|       |
   97|       |    // Always increase the index. So we know eventually how many token would be
   98|       |    // required (if there are not enough).
   99|  24.7M|    parser->token_count++;
  100|  24.7M|    return token;
  101|  24.7M|}
cj5.c:cj5__parse_primitive:
  152|  21.7M|cj5__parse_primitive(cj5__parser* parser) {
  153|  21.7M|    const char* json5 = parser->json5;
  154|  21.7M|    unsigned int len = parser->len;
  155|  21.7M|    unsigned int start = parser->pos;
  156|       |
  157|       |    // String value
  158|  21.7M|    if(json5[start] == '\"' ||
  ------------------
  |  Branch (158:8): [True: 841k, False: 20.9M]
  ------------------
  159|  20.9M|       json5[start] == '\'') {
  ------------------
  |  Branch (159:8): [True: 1.11k, False: 20.9M]
  ------------------
  160|   842k|        cj5__parse_string(parser);
  161|   842k|        return;
  162|   842k|    }
  163|       |
  164|       |    // Fast comparison of bool, and null.
  165|       |    // Make the comparison case-insensitive.
  166|  20.9M|    uint32_t fourcc = 0;
  167|  20.9M|    if(start + 3 < len) {
  ------------------
  |  Branch (167:8): [True: 20.9M, False: 804]
  ------------------
  168|  20.9M|        fourcc += (unsigned char)json5[start] | 32U;
  169|  20.9M|        fourcc += ((unsigned char)json5[start+1] | 32U) << 8;
  170|  20.9M|        fourcc += ((unsigned char)json5[start+2] | 32U) << 16;
  171|  20.9M|        fourcc += ((unsigned char)json5[start+3] | 32U) << 24;
  172|  20.9M|    }
  173|       |    
  174|  20.9M|    cj5_token_type type;
  175|  20.9M|    if(fourcc == CJ5__NULL_FOURCC) {
  ------------------
  |  Branch (175:8): [True: 51.6k, False: 20.8M]
  ------------------
  176|  51.6k|        type = CJ5_TOKEN_NULL;
  177|  51.6k|        parser->pos += 3;
  178|  20.8M|    } else if(fourcc == CJ5__TRUE_FOURCC) {
  ------------------
  |  Branch (178:15): [True: 323, False: 20.8M]
  ------------------
  179|    323|        type = CJ5_TOKEN_BOOL;
  180|    323|        parser->pos += 3;
  181|  20.8M|    } else if(fourcc == CJ5__FALSE_FOURCC) {
  ------------------
  |  Branch (181:15): [True: 1.34k, False: 20.8M]
  ------------------
  182|       |        // "false" has five characters
  183|  1.34k|        type = CJ5_TOKEN_BOOL;
  184|  1.34k|        if(start + 4 >= len || (json5[start+4] | 32) != 'e') {
  ------------------
  |  Branch (184:12): [True: 1, False: 1.34k]
  |  Branch (184:32): [True: 25, False: 1.31k]
  ------------------
  185|     26|            parser->error = CJ5_ERROR_INVALID;
  186|     26|            return;
  187|     26|        }
  188|  1.31k|        parser->pos += 4;
  189|  20.8M|    } else {
  190|       |        // Numbers are checked for basic compatibility.
  191|       |        // But they are fully parsed only in the cj5_get_XXX functions.
  192|  20.8M|        type = CJ5_TOKEN_NUMBER;
  193|  69.0M|        for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (193:15): [True: 69.0M, False: 1.19k]
  ------------------
  194|  69.0M|            if(!cj5__isnum(json5[parser->pos]) &&
  ------------------
  |  |   85|   138M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  ------------------
  |  Branch (194:16): [True: 47.2M, False: 21.7M]
  ------------------
  195|  47.2M|               !(json5[parser->pos] == '.') &&
  ------------------
  |  Branch (195:16): [True: 47.2M, False: 6.80k]
  ------------------
  196|  47.2M|               !cj5__islowerchar(json5[parser->pos]) && 
  ------------------
  |  |   84|   116M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  ------------------
  |  Branch (196:16): [True: 23.3M, False: 23.8M]
  ------------------
  197|  23.3M|               !cj5__isupperchar(json5[parser->pos]) &&
  ------------------
  |  |   83|  92.4M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  ------------------
  |  Branch (197:16): [True: 21.6M, False: 1.75M]
  ------------------
  198|  21.6M|               !(json5[parser->pos] == '+') && !(json5[parser->pos] == '-')) {
  ------------------
  |  Branch (198:16): [True: 21.6M, False: 11.4k]
  |  Branch (198:48): [True: 20.8M, False: 767k]
  ------------------
  199|  20.8M|                break;
  200|  20.8M|            }
  201|  69.0M|        }
  202|  20.8M|        parser->pos--; // Point to the last character that is still inside the
  203|       |                       // primitive value
  204|  20.8M|    }
  205|       |
  206|  20.9M|    cj5_token *token = cj5__alloc_token(parser);
  207|  20.9M|    if(token) {
  ------------------
  |  Branch (207:8): [True: 9.76M, False: 11.1M]
  ------------------
  208|  9.76M|        token->type = type;
  209|  9.76M|        token->start = start;
  210|  9.76M|        token->end = parser->pos;
  211|  9.76M|        token->size = parser->pos - start + 1;
  212|  9.76M|        token->parent_id = parser->curr_tok_idx;
  213|  9.76M|    }
  214|  20.9M|}
cj5.c:cj5__parse_string:
  104|  1.71M|cj5__parse_string(cj5__parser *parser) {
  105|  1.71M|    const char *json5 = parser->json5;
  106|  1.71M|    unsigned int len = parser->len;
  107|  1.71M|    unsigned int start = parser->pos;
  108|  1.71M|    char str_open = json5[start];
  109|       |
  110|  1.71M|    parser->pos++;
  111|  88.4M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (111:11): [True: 88.4M, False: 153]
  ------------------
  112|  88.4M|        char c = json5[parser->pos];
  113|       |
  114|       |        // End of string
  115|  88.4M|        if(str_open == c) {
  ------------------
  |  Branch (115:12): [True: 1.71M, False: 86.7M]
  ------------------
  116|  1.71M|            cj5_token *token = cj5__alloc_token(parser);
  117|  1.71M|            if(token) {
  ------------------
  |  Branch (117:16): [True: 853k, False: 858k]
  ------------------
  118|   853k|                token->type = CJ5_TOKEN_STRING;
  119|   853k|                token->start = start + 1;
  120|   853k|                token->end = parser->pos - 1;
  121|   853k|                token->size = token->end - token->start + 1;
  122|   853k|                token->parent_id = parser->curr_tok_idx;
  123|   853k|            } 
  124|  1.71M|            return;
  125|  1.71M|        }
  126|       |
  127|       |        // Unescaped newlines are forbidden
  128|  86.7M|        if(c == '\n') {
  ------------------
  |  Branch (128:12): [True: 6, False: 86.7M]
  ------------------
  129|      6|            parser->error = CJ5_ERROR_INVALID;
  130|      6|            return;
  131|      6|        }
  132|       |
  133|       |        // Skip escape character
  134|  86.7M|        if(c == '\\') {
  ------------------
  |  Branch (134:12): [True: 492k, False: 86.2M]
  ------------------
  135|   492k|            if(parser->pos + 1 >= len) {
  ------------------
  |  Branch (135:16): [True: 3, False: 492k]
  ------------------
  136|      3|                parser->error = CJ5_ERROR_INCOMPLETE;
  137|      3|                return;
  138|      3|            }
  139|   492k|            parser->pos++;
  140|   492k|        }
  141|  86.7M|    }
  142|       |
  143|       |    // The file has ended before the string terminates
  144|    153|    parser->error = CJ5_ERROR_INCOMPLETE;
  145|    153|}
cj5.c:cj5__isrange:
   79|   157M|cj5__isrange(char ch, char from, char to) {
   80|   157M|    return (uint8_t)(ch - from) <= (uint8_t)(to - from);
   81|   157M|}
cj5.c:cj5__parse_key:
  217|  2.63M|cj5__parse_key(cj5__parser* parser) {
  218|  2.63M|    const char* json5 = parser->json5;
  219|  2.63M|    unsigned int start = parser->pos;
  220|  2.63M|    cj5_token* token;
  221|       |
  222|       |    // Key is a a normal string
  223|  2.63M|    if(json5[start] == '\"' || json5[start] == '\'') {
  ------------------
  |  Branch (223:8): [True: 867k, False: 1.76M]
  |  Branch (223:32): [True: 748, False: 1.76M]
  ------------------
  224|   868k|        cj5__parse_string(parser);
  225|   868k|        return;
  226|   868k|    }
  227|       |
  228|       |    // An unquoted key. Must start with a-ZA-Z_$. Can contain numbers later on.
  229|  1.76M|    unsigned int len = parser->len;
  230|  9.57M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (230:11): [True: 9.57M, False: 83]
  ------------------
  231|  9.57M|        if(cj5__islowerchar(json5[parser->pos]) ||
  ------------------
  |  |   84|  19.1M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  |  |  ------------------
  |  |  |  Branch (84:30): [True: 4.46M, False: 5.11M]
  |  |  ------------------
  ------------------
  232|  5.11M|           cj5__isupperchar(json5[parser->pos]) ||
  ------------------
  |  |   83|  14.6M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  |  |  ------------------
  |  |  |  Branch (83:30): [True: 2.37M, False: 2.74M]
  |  |  ------------------
  ------------------
  233|  2.74M|           json5[parser->pos] == '_' || json5[parser->pos] == '$')
  ------------------
  |  Branch (233:12): [True: 8.74k, False: 2.73M]
  |  Branch (233:41): [True: 16.6k, False: 2.71M]
  ------------------
  234|  6.86M|            continue;
  235|  2.71M|        if(cj5__isnum(json5[parser->pos]) && parser->pos != start)
  ------------------
  |  |   85|  5.43M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 954k, False: 1.76M]
  |  |  ------------------
  ------------------
  |  Branch (235:46): [True: 954k, False: 6]
  ------------------
  236|   954k|            continue;
  237|  1.76M|        break;
  238|  2.71M|    }
  239|       |
  240|       |    // An empty key is not allowed
  241|  1.76M|    if(parser->pos <= start) {
  ------------------
  |  Branch (241:8): [True: 123, False: 1.76M]
  ------------------
  242|    123|        parser->error = CJ5_ERROR_INVALID;
  243|    123|        return;
  244|    123|    }
  245|       |
  246|       |    // Move pos to the last character within the unquoted key
  247|  1.76M|    parser->pos--;
  248|       |
  249|  1.76M|    token = cj5__alloc_token(parser);
  250|  1.76M|    if(token) {
  ------------------
  |  Branch (250:8): [True: 918k, False: 845k]
  ------------------
  251|   918k|        token->type = CJ5_TOKEN_STRING;
  252|   918k|        token->start = start;
  253|   918k|        token->end = parser->pos;
  254|   918k|        token->size = parser->pos - start + 1;
  255|   918k|        token->parent_id = parser->curr_tok_idx;
  256|   918k|    }
  257|  1.76M|}
cj5.c:parse_codepoint:
  607|  16.7k|parse_codepoint(const char *pos, uint32_t *out_utf) {
  608|  16.7k|    uint32_t utf = 0;
  609|  83.5k|    for(unsigned int i = 0; i < 4; i++) {
  ------------------
  |  Branch (609:29): [True: 66.8k, False: 16.6k]
  ------------------
  610|  66.8k|        char byte = pos[i];
  611|  66.8k|        if(cj5__isnum(byte)) {
  ------------------
  |  |   85|  66.8k|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 33.1k, False: 33.7k]
  |  |  ------------------
  ------------------
  612|  33.1k|            byte = (char)(byte - '0');
  613|  33.7k|        } else if(cj5__isrange(byte, 'a', 'f')) {
  ------------------
  |  Branch (613:19): [True: 19.4k, False: 14.2k]
  ------------------
  614|  19.4k|            byte = (char)(byte - ('a' - 10));
  615|  19.4k|        } else if(cj5__isrange(byte, 'A', 'F')) {
  ------------------
  |  Branch (615:19): [True: 14.1k, False: 44]
  ------------------
  616|  14.1k|            byte = (char)(byte - ('A' - 10));
  617|  14.1k|        } else {
  618|     44|            return CJ5_ERROR_INVALID;
  619|     44|        }
  620|  66.8k|        utf = (utf << 4) | ((uint8_t)byte & 0xF);
  621|  66.8k|    }
  622|  16.6k|    *out_utf = utf;
  623|  16.6k|    return CJ5_ERROR_NONE;
  624|  16.7k|}

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

parseUInt64:
   30|  3.29M|parseUInt64(const char *str, size_t size, uint64_t *result) {
   31|  3.29M|    size_t i = 0;
   32|  3.29M|    uint64_t n = 0, prev = 0;
   33|       |
   34|       |    /* Hex */
   35|  3.29M|    if(size > 2 && str[0] == '0' && (str[1] | 32) == 'x') {
  ------------------
  |  Branch (35:8): [True: 403k, False: 2.89M]
  |  Branch (35:20): [True: 357k, False: 46.0k]
  |  Branch (35:37): [True: 10.7k, False: 346k]
  ------------------
   36|  10.7k|        i = 2;
   37|  79.8k|        for(; i < size; i++) {
  ------------------
  |  Branch (37:15): [True: 69.5k, False: 10.2k]
  ------------------
   38|  69.5k|            uint8_t c = (uint8_t)str[i] | 32;
   39|  69.5k|            if(c >= '0' && c <= '9')
  ------------------
  |  Branch (39:16): [True: 69.3k, False: 206]
  |  Branch (39:28): [True: 64.2k, False: 5.07k]
  ------------------
   40|  64.2k|                c = (uint8_t)(c - '0');
   41|  5.27k|            else if(c >= 'a' && c <='f')
  ------------------
  |  Branch (41:21): [True: 5.06k, False: 210]
  |  Branch (41:33): [True: 4.82k, False: 245]
  ------------------
   42|  4.82k|                c = (uint8_t)(c - 'a' + 10);
   43|    455|            else if(c >= 'A' && c <='F')
  ------------------
  |  Branch (43:21): [True: 246, False: 209]
  |  Branch (43:33): [True: 0, False: 246]
  ------------------
   44|      0|                c = (uint8_t)(c - 'A' + 10);
   45|    455|            else
   46|    455|                break;
   47|  69.0k|            n = (n << 4) | (c & 0xF);
   48|  69.0k|            if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (48:16): [True: 4, False: 69.0k]
  ------------------
   49|      4|                return 0;
   50|  69.0k|            prev = n;
   51|  69.0k|        }
   52|  10.7k|        *result = n;
   53|  10.7k|        return (i > 2) ? i : 0; /* 2 -> No digit was parsed */
  ------------------
  |  Branch (53:16): [True: 10.7k, False: 26]
  ------------------
   54|  10.7k|    }
   55|       |
   56|       |    /* Decimal */
   57|  10.9M|    for(; i < size; i++) {
  ------------------
  |  Branch (57:11): [True: 7.72M, False: 3.23M]
  ------------------
   58|  7.72M|        if(str[i] < '0' || str[i] > '9')
  ------------------
  |  Branch (58:12): [True: 3.20k, False: 7.71M]
  |  Branch (58:28): [True: 40.7k, False: 7.67M]
  ------------------
   59|  43.9k|            break;
   60|       |        /* Fast multiplication: n*10 == (n*8) + (n*2) */
   61|  7.67M|        n = (n << 3) + (n << 1) + (uint8_t)(str[i] - '0');
   62|  7.67M|        if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (62:12): [True: 13, False: 7.67M]
  ------------------
   63|     13|            return 0;
   64|  7.67M|        prev = n;
   65|  7.67M|    }
   66|  3.28M|    *result = n;
   67|  3.28M|    return i;
   68|  3.28M|}
parseInt64:
   71|  1.88M|parseInt64(const char *str, size_t size, int64_t *result) {
   72|       |    /* Negative value? */
   73|  1.88M|    size_t i = 0;
   74|  1.88M|    bool neg = false;
   75|  1.88M|    if(*str == '-' || *str == '+') {
  ------------------
  |  Branch (75:8): [True: 1.12k, False: 1.88M]
  |  Branch (75:23): [True: 2.97k, False: 1.88M]
  ------------------
   76|  4.09k|        neg = (*str == '-');
   77|  4.09k|        i++;
   78|  4.09k|    }
   79|       |
   80|       |    /* Parse as unsigned */
   81|  1.88M|    uint64_t n = 0;
   82|  1.88M|    size_t len = parseUInt64(&str[i], size - i, &n);
   83|  1.88M|    if(len == 0)
  ------------------
  |  Branch (83:8): [True: 94, False: 1.88M]
  ------------------
   84|     94|        return 0;
   85|       |
   86|       |    /* Check for overflow, adjust and return */
   87|  1.88M|    if(!neg) {
  ------------------
  |  Branch (87:8): [True: 1.88M, False: 1.11k]
  ------------------
   88|  1.88M|        if(n > 9223372036854775807UL)
  ------------------
  |  Branch (88:12): [True: 62, False: 1.88M]
  ------------------
   89|     62|            return 0;
   90|  1.88M|        *result = (int64_t)n;
   91|  1.88M|    } else {
   92|  1.11k|        if(n > 9223372036854775808UL)
  ------------------
  |  Branch (92:12): [True: 3, False: 1.11k]
  ------------------
   93|      3|            return 0;
   94|  1.11k|        *result = -(int64_t)n;
   95|  1.11k|    }
   96|  1.88M|    return len + i;
   97|  1.88M|}
parseDouble:
   99|    779|size_t parseDouble(const char *str, size_t size, double *result) {
  100|    779|    char buf[2000];
  101|    779|    if(size >= 2000)
  ------------------
  |  Branch (101:8): [True: 1, False: 778]
  ------------------
  102|      1|        return 0;
  103|    778|    memcpy(buf, str, size);
  104|    778|    buf[size] = 0;
  105|    778|    errno = 0;
  106|    778|    char *endptr;
  107|    778|    *result = strtod(buf, &endptr);
  108|    778|    if(errno != 0 && errno != ERANGE)
  ------------------
  |  Branch (108:8): [True: 197, False: 581]
  |  Branch (108:22): [True: 0, False: 197]
  ------------------
  109|      0|        return 0;
  110|    778|    return (uintptr_t)endptr - (uintptr_t)buf;
  111|    778|}

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

findEncodingMetaData:
  277|  4.30k|                     UA_UInt16 dsWriterId) {
  278|  4.30k|    if(!eo)
  ------------------
  |  Branch (278:8): [True: 0, False: 4.30k]
  ------------------
  279|      0|        return NULL;
  280|  4.30k|    for(size_t i = 0; i < eo->metaDataSize; i++) {
  ------------------
  |  Branch (280:23): [True: 0, False: 4.30k]
  ------------------
  281|      0|        if(eo->metaData[i].dataSetWriterId == dsWriterId)
  ------------------
  |  Branch (281:12): [True: 0, False: 0]
  ------------------
  282|      0|            return &eo->metaData[i];
  283|      0|    }
  284|  4.30k|    return NULL;
  285|  4.30k|}
UA_NetworkMessage_clear:
 1039|  6.49k|UA_NetworkMessage_clear(UA_NetworkMessage* p) {
 1040|  6.49k|    if(p->promotedFieldsEnabled) {
  ------------------
  |  Branch (1040:8): [True: 0, False: 6.49k]
  ------------------
 1041|      0|        UA_Array_delete(p->promotedFields, p->promotedFieldsSize,
 1042|      0|                        &UA_TYPES[UA_TYPES_VARIANT]);
  ------------------
  |  |  803|      0|#define UA_TYPES_VARIANT 23
  ------------------
 1043|      0|    }
 1044|       |
 1045|  6.49k|    if(p->networkMessageType == UA_NETWORKMESSAGE_DATASET) {
  ------------------
  |  Branch (1045:8): [True: 6.49k, False: 0]
  ------------------
 1046|  6.49k|        if(p->payload.dataSetMessages) {
  ------------------
  |  Branch (1046:12): [True: 5.93k, False: 561]
  ------------------
 1047|  12.0k|            for(size_t i = 0; i < p->messageCount; i++)
  ------------------
  |  Branch (1047:31): [True: 6.07k, False: 5.93k]
  ------------------
 1048|  6.07k|                UA_DataSetMessage_clear(&p->payload.dataSetMessages[i]);
 1049|  5.93k|            UA_free(p->payload.dataSetMessages);
  ------------------
  |  |  351|  5.93k|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1050|  5.93k|        }
 1051|  6.49k|    }
 1052|       |
 1053|  6.49k|    UA_ByteString_clear(&p->securityFooter);
 1054|  6.49k|    UA_String_clear(&p->messageId);
 1055|       |
 1056|  6.49k|    if(p->publisherIdEnabled &&
  ------------------
  |  Branch (1056:8): [True: 4, False: 6.49k]
  ------------------
 1057|      4|       p->publisherId.idType == UA_PUBLISHERIDTYPE_STRING)
  ------------------
  |  Branch (1057:8): [True: 1, False: 3]
  ------------------
 1058|      1|       UA_String_clear(&p->publisherId.id.string);
 1059|       |
 1060|  6.49k|    memset(p, 0, sizeof(UA_NetworkMessage));
 1061|  6.49k|}
UA_DataSetMessage_clear:
 1862|  6.07k|UA_DataSetMessage_clear(UA_DataSetMessage* p) {
 1863|  6.07k|    if(p->header.dataSetMessageType == UA_DATASETMESSAGE_DATAKEYFRAME) {
  ------------------
  |  Branch (1863:8): [True: 6.07k, False: 0]
  ------------------
 1864|  6.07k|        if(p->data.keyFrameFields)
  ------------------
  |  Branch (1864:12): [True: 4.30k, False: 1.76k]
  ------------------
 1865|  4.30k|            UA_Array_delete(p->data.keyFrameFields, p->fieldCount,
 1866|  4.30k|                            &UA_TYPES[UA_TYPES_DATAVALUE]);
  ------------------
  |  |  769|  4.30k|#define UA_TYPES_DATAVALUE 22
  ------------------
 1867|  6.07k|    } else if(p->header.dataSetMessageType == UA_DATASETMESSAGE_DATADELTAFRAME) {
  ------------------
  |  Branch (1867:15): [True: 0, False: 0]
  ------------------
 1868|      0|        if(p->data.deltaFrameFields) {
  ------------------
  |  Branch (1868:12): [True: 0, False: 0]
  ------------------
 1869|      0|            for(UA_UInt16 i = 0; i < p->fieldCount; i++)
  ------------------
  |  Branch (1869:34): [True: 0, False: 0]
  ------------------
 1870|      0|                UA_DataValue_clear(&p->data.deltaFrameFields[i].value);
 1871|      0|            UA_free(p->data.deltaFrameFields);
  ------------------
  |  |  351|      0|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1872|      0|        }
 1873|      0|    }
 1874|       |
 1875|  6.07k|    memset(p, 0, sizeof(UA_DataSetMessage));
 1876|  6.07k|}

UA_NetworkMessage_decodeJson:
  537|  7.22k|                             const UA_DecodeJsonOptions *jo) {
  538|       |    /* Set up the context */
  539|  7.22k|    cj5_token tokens[UA_JSON_MAXTOKENCOUNT];
  540|  7.22k|    PubSubDecodeJsonCtx ctx;
  541|  7.22k|    memset(&ctx, 0, sizeof(PubSubDecodeJsonCtx));
  542|  7.22k|    ctx.ctx.tokens = tokens;
  543|  7.22k|    if(eo)
  ------------------
  |  Branch (543:8): [True: 0, False: 7.22k]
  ------------------
  544|      0|        ctx.eo = *eo;
  545|  7.22k|    if(jo) {
  ------------------
  |  Branch (545:8): [True: 0, False: 7.22k]
  ------------------
  546|      0|        ctx.ctx.namespaceMapping = jo->namespaceMapping;
  547|      0|        ctx.ctx.serverUrisSize = jo->serverUrisSize;
  548|      0|        ctx.ctx.serverUris = jo->serverUris;
  549|      0|        ctx.ctx.customTypes = jo->customTypes;
  550|      0|    }
  551|       |
  552|  7.22k|    status ret = tokenize(&ctx.ctx, src, UA_JSON_MAXTOKENCOUNT, NULL);
  ------------------
  |  |   20|  7.22k|#define UA_JSON_MAXTOKENCOUNT 256
  ------------------
  553|  7.22k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  7.22k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (553:8): [True: 727, False: 6.49k]
  ------------------
  554|    727|        goto cleanup;
  555|       |
  556|  6.49k|    ret = NetworkMessage_decodeJsonInternal(&ctx, dst);
  557|  6.49k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  6.49k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (557:8): [True: 6.48k, False: 10]
  ------------------
  558|  6.48k|        UA_NetworkMessage_clear(dst);
  559|       |
  560|  7.22k| cleanup:
  561|       |    /* Free token array on the heap */
  562|  7.22k|    if(ctx.ctx.tokens != tokens)
  ------------------
  |  Branch (562:8): [True: 516, False: 6.70k]
  ------------------
  563|    516|        UA_free((void*)(uintptr_t)ctx.ctx.tokens);
  ------------------
  |  |  351|    516|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  564|  7.22k|    return ret;
  565|  6.49k|}
ua_pubsub_networkmessage_json.c:NetworkMessage_decodeJsonInternal:
  455|  6.49k|                                  UA_NetworkMessage *dst) {
  456|  6.49k|    memset(dst, 0, sizeof(UA_NetworkMessage));
  457|  6.49k|    dst->chunkMessage = false;
  458|  6.49k|    dst->groupHeaderEnabled = false;
  459|  6.49k|    dst->payloadHeaderEnabled = false;
  460|  6.49k|    dst->picosecondsEnabled = false;
  461|  6.49k|    dst->promotedFieldsEnabled = false;
  462|       |
  463|       |    /* The NetworkMessage must be a JSON object */
  464|  6.49k|    if(currentTokenType(&ctx->ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (464:8): [True: 102, False: 6.39k]
  ------------------
  465|    102|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    102|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  466|       |
  467|       |    /* Is Messages an Array? How big? */
  468|  6.39k|    size_t searchResultMessages = 0;
  469|  6.39k|    status found = lookAheadForKey(&ctx->ctx, UA_DECODEKEY_MESSAGES, &searchResultMessages);
  470|  6.39k|    if(found != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  6.39k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (470:8): [True: 184, False: 6.21k]
  ------------------
  471|    184|        return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  238|    184|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
  472|  6.21k|    const cj5_token *bodyToken = &ctx->ctx.tokens[searchResultMessages];
  473|  6.21k|    size_t messageCount = 1;
  474|  6.21k|    if(bodyToken->type == CJ5_TOKEN_ARRAY)
  ------------------
  |  Branch (474:8): [True: 2.90k, False: 3.30k]
  ------------------
  475|  2.90k|        messageCount = (size_t)bodyToken->size;
  476|       |
  477|       |    /* Too many DataSetMessages */
  478|  6.21k|    if(messageCount > UA_NETWORKMESSAGE_MAXMESSAGECOUNT)
  ------------------
  |  |  136|  6.21k|#define UA_NETWORKMESSAGE_MAXMESSAGECOUNT 32
  ------------------
  |  Branch (478:8): [True: 13, False: 6.19k]
  ------------------
  479|     13|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     13|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  480|       |
  481|       |    /* MessageType */
  482|  6.19k|    UA_Boolean isUaData = true;
  483|  6.19k|    size_t searchResultMessageType = 0;
  484|  6.19k|    found = lookAheadForKey(&ctx->ctx, UA_DECODEKEY_MESSAGETYPE, &searchResultMessageType);
  485|  6.19k|    if(found != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  6.19k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (485:8): [True: 59, False: 6.13k]
  ------------------
  486|     59|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     59|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  487|  6.13k|    size_t size = getTokenLength(&ctx->ctx.tokens[searchResultMessageType]);
  488|  6.13k|    const char* msgType = &ctx->ctx.json5[ctx->ctx.tokens[searchResultMessageType].start];
  489|  6.13k|    if(size == 7) { //ua-data
  ------------------
  |  Branch (489:8): [True: 6.00k, False: 138]
  ------------------
  490|  6.00k|        if(strncmp(msgType, "ua-data", size) != 0)
  ------------------
  |  Branch (490:12): [True: 52, False: 5.94k]
  ------------------
  491|     52|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     52|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  492|  5.94k|        isUaData = true;
  493|  5.94k|    } else if(size == 11) { //ua-metadata
  ------------------
  |  Branch (493:15): [True: 97, False: 41]
  ------------------
  494|     97|        if(strncmp(msgType, "ua-metadata", size) != 0)
  ------------------
  |  Branch (494:12): [True: 96, False: 1]
  ------------------
  495|     96|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     96|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  496|      1|        isUaData = false;
  497|     41|    } else {
  498|     41|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     41|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  499|     41|    }
  500|       |
  501|       |    //TODO: MetaData
  502|  5.94k|    if(!isUaData)
  ------------------
  |  Branch (502:8): [True: 1, False: 5.94k]
  ------------------
  503|      1|        return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  238|      1|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
  504|       |
  505|  5.94k|    dst->payload.dataSetMessages = (UA_DataSetMessage*)
  506|  5.94k|        UA_calloc(messageCount, sizeof(UA_DataSetMessage));
  ------------------
  |  |  352|  5.94k|# define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  507|  5.94k|    if(!dst->payload.dataSetMessages)
  ------------------
  |  Branch (507:8): [True: 13, False: 5.93k]
  ------------------
  508|     13|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|     13|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  509|  5.93k|    dst->messageCount = (UA_Byte)messageCount;
  510|       |
  511|       |    /* Network Message */
  512|  5.93k|    UA_String messageType;
  513|  5.93k|    DecodeEntry entries[5] = {
  514|  5.93k|        {UA_DECODEKEY_MESSAGEID, &dst->messageId, NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  395|  5.93k|#define UA_TYPES_STRING 11
  ------------------
  515|  5.93k|        {UA_DECODEKEY_MESSAGETYPE, &messageType, NULL, false, NULL},
  516|  5.93k|        {UA_DECODEKEY_PUBLISHERID, &dst->publisherId, decodePublisherIdJsonInternal, false, NULL},
  517|  5.93k|        {UA_DECODEKEY_DATASETCLASSID, &dst->dataSetClassId, NULL, false, &UA_TYPES[UA_TYPES_GUID]},
  ------------------
  |  |  463|  5.93k|#define UA_TYPES_GUID 13
  ------------------
  518|  5.93k|        {UA_DECODEKEY_MESSAGES, dst, (decodeJsonSignature)DatasetMessage_Array_decodeJsonInternal, false, NULL}
  519|  5.93k|    };
  520|       |
  521|  5.93k|    status ret = decodeFields(&ctx->ctx, entries, 5);
  522|  5.93k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  5.93k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (522:8): [True: 5.92k, False: 10]
  ------------------
  523|  5.92k|        return ret;
  524|       |
  525|     10|    dst->messageIdEnabled = entries[0].found;
  526|     10|    dst->publisherIdEnabled = entries[2].found;
  527|     10|    dst->dataSetClassIdEnabled = entries[3].found;
  528|     10|    dst->payloadHeaderEnabled = true;
  529|       |
  530|     10|    return ret;
  531|  5.93k|}
ua_pubsub_networkmessage_json.c:decodePublisherIdJsonInternal:
  438|    257|                              const UA_DataType *type) {
  439|    257|    UA_PublisherId *p = (UA_PublisherId*)dst;
  440|    257|    if(currentTokenType(ctx) == CJ5_TOKEN_NUMBER) {
  ------------------
  |  Branch (440:8): [True: 204, False: 53]
  ------------------
  441|       |        /* Store in biggest possible integer. The problem is that with a UInt64
  442|       |         * is that a string is expected for it in JSON. Therefore, the maximum
  443|       |         * value is set to UInt32. */
  444|    204|        p->idType = UA_PUBLISHERIDTYPE_UINT32;
  445|    204|        return decodeJsonJumpTable[UA_DATATYPEKIND_UINT32](ctx, &p->id.uint32, NULL);
  446|    204|    } else if(currentTokenType(ctx) == CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (446:15): [True: 49, False: 4]
  ------------------
  447|     49|        p->idType = UA_PUBLISHERIDTYPE_STRING;
  448|     49|        return decodeJsonJumpTable[UA_DATATYPEKIND_STRING](ctx, &p->id.string, NULL);
  449|     49|    }
  450|      4|    return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  451|    257|}
ua_pubsub_networkmessage_json.c:DatasetMessage_Array_decodeJsonInternal:
  409|  5.53k|                                        const UA_DataType *_) {
  410|       |    /* Array or object */
  411|  5.53k|    size_t length = 1;
  412|  5.53k|    if(currentTokenType(&ctx->ctx) == CJ5_TOKEN_ARRAY) {
  ------------------
  |  Branch (412:8): [True: 2.86k, False: 2.67k]
  ------------------
  413|  2.86k|        length = (size_t)ctx->ctx.tokens[ctx->ctx.index].size;
  414|       |
  415|       |        /* Go to the first array member */
  416|  2.86k|        ctx->ctx.index++;
  417|       |
  418|       |        /* Return early for empty arrays */
  419|  2.86k|        if(length == 0)
  ------------------
  |  Branch (419:12): [True: 12, False: 2.85k]
  ------------------
  420|     12|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     12|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  421|  2.86k|    } else if(currentTokenType(&ctx->ctx) != CJ5_TOKEN_OBJECT) {
  ------------------
  |  Branch (421:15): [True: 351, False: 2.32k]
  ------------------
  422|    351|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    351|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  423|    351|    }
  424|       |
  425|       |    /* Decode array members */
  426|  5.17k|    UA_NetworkMessage *nm = (UA_NetworkMessage*)dst;
  427|  5.17k|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (427:23): [True: 5.17k, False: 0]
  ------------------
  428|  5.17k|        status ret = DatasetMessage_Payload_decodeJsonInternal(ctx, nm, i);
  429|  5.17k|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  5.17k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (429:12): [True: 5.17k, False: 0]
  ------------------
  430|  5.17k|            return ret;
  431|  5.17k|    }
  432|       |
  433|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  434|  5.17k|}
ua_pubsub_networkmessage_json.c:DatasetMessage_Payload_decodeJsonInternal:
  368|  5.17k|                                          size_t dsmIndex) {
  369|  5.17k|    UA_DataSetMessage *dsm = &nm->payload.dataSetMessages[dsmIndex];
  370|  5.17k|    UA_ConfigurationVersionDataType cvd;
  371|  5.17k|    struct PayloadData pd;
  372|  5.17k|    pd.nm = nm;
  373|  5.17k|    pd.dsmIndex = dsmIndex;
  374|       |
  375|  5.17k|    DecodeEntry entries[7] = {
  376|  5.17k|        {UA_DECODEKEY_DATASETWRITERID, &nm->dataSetWriterIds[dsmIndex], NULL, false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  157|  5.17k|#define UA_TYPES_UINT16 4
  ------------------
  377|  5.17k|        {UA_DECODEKEY_SEQUENCENUMBER, &dsm->header.dataSetMessageSequenceNr, NULL, false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  157|  5.17k|#define UA_TYPES_UINT16 4
  ------------------
  378|  5.17k|        {UA_DECODEKEY_METADATAVERSION, &cvd, &MetaDataVersion_decodeJsonInternal, false, NULL},
  379|  5.17k|        {UA_DECODEKEY_TIMESTAMP, &dsm->header.timestamp, NULL, false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  429|  5.17k|#define UA_TYPES_DATETIME 12
  ------------------
  380|  5.17k|        {UA_DECODEKEY_DSM_STATUS, &dsm->header.status, NULL, false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  157|  5.17k|#define UA_TYPES_UINT16 4
  ------------------
  381|  5.17k|        {UA_DECODEKEY_MESSAGETYPE, NULL, NULL, false, NULL},
  382|  5.17k|        {UA_DECODEKEY_PAYLOAD, &pd, (decodeJsonSignature)DataSetPayload_decodeJsonInternal, false, NULL}
  383|  5.17k|    };
  384|  5.17k|    status ret = decodeFields(&ctx->ctx, entries, 7);
  385|       |
  386|       |    /* Error or no DatasetWriterId found or no payload found */
  387|  5.17k|    if(ret != UA_STATUSCODE_GOOD || !entries[0].found || !entries[6].found)
  ------------------
  |  |   16|  10.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (387:8): [True: 3.59k, False: 1.58k]
  |  Branch (387:37): [True: 1.57k, False: 4]
  |  Branch (387:58): [True: 4, False: 0]
  ------------------
  388|  5.17k|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|  5.17k|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  389|       |
  390|       |    /* TODO: Check FieldEncoding1 and FieldEncoding2 to determine the field encoding */
  391|      0|    dsm->header.fieldEncoding = UA_FIELDENCODING_DATAVALUE;
  392|      0|    dsm->header.dataSetMessageSequenceNrEnabled = entries[1].found;
  393|      0|    dsm->header.configVersionMajorVersion = cvd.majorVersion;
  394|      0|    dsm->header.configVersionMinorVersion = cvd.minorVersion;
  395|      0|    dsm->header.configVersionMajorVersionEnabled = entries[2].found;
  396|      0|    dsm->header.configVersionMinorVersionEnabled = entries[2].found;
  397|      0|    dsm->header.timestampEnabled = entries[3].found;
  398|      0|    dsm->header.statusEnabled = entries[4].found;
  399|       |
  400|      0|    dsm->header.dataSetMessageType = UA_DATASETMESSAGE_DATAKEYFRAME;
  401|      0|    dsm->header.picoSecondsIncluded = false;
  402|      0|    dsm->header.dataSetMessageValid = true;
  403|      0|    dsm->header.fieldEncoding = UA_FIELDENCODING_VARIANT;
  404|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  405|  5.17k|}
ua_pubsub_networkmessage_json.c:MetaDataVersion_decodeJsonInternal:
  289|      4|MetaDataVersion_decodeJsonInternal(ParseCtx *ctx, void* cvd, const UA_DataType *_) {
  290|      4|    return decodeJsonJumpTable[UA_DATATYPEKIND_STRUCTURE]
  291|      4|        (ctx, cvd, &UA_TYPES[UA_TYPES_CONFIGURATIONVERSIONDATATYPE]);
  ------------------
  |  | 2146|      4|#define UA_TYPES_CONFIGURATIONVERSIONDATATYPE 57
  ------------------
  292|      4|}
ua_pubsub_networkmessage_json.c:DataSetPayload_decodeJsonInternal:
  312|  4.31k|DataSetPayload_decodeJsonInternal(PubSubDecodeJsonCtx *ctx, void *data, const UA_DataType *_) {
  313|  4.31k|    struct PayloadData *pd = (struct PayloadData*)data;
  314|  4.31k|    UA_NetworkMessage *nm = pd->nm;
  315|  4.31k|    UA_DataSetMessage *dsm = &nm->payload.dataSetMessages[pd->dsmIndex];
  316|       |
  317|  4.31k|    dsm->header.dataSetMessageValid = true;
  318|       |
  319|  4.31k|    if(currentTokenType(&ctx->ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (319:8): [True: 1, False: 4.31k]
  ------------------
  320|      1|        ctx->ctx.index++;
  321|      1|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  322|      1|    }
  323|       |
  324|  4.31k|    if(currentTokenType(&ctx->ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (324:8): [True: 1, False: 4.30k]
  ------------------
  325|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  326|       |
  327|       |    /* The number of key-value pairs */
  328|  4.30k|    UA_assert(ctx->ctx.tokens[ctx->ctx.index].size % 2 == 0);
  ------------------
  |  |  411|  4.30k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (328:5): [True: 4.30k, False: 0]
  ------------------
  329|  4.30k|    size_t length = (size_t)(ctx->ctx.tokens[ctx->ctx.index].size) / 2;
  330|       |
  331|  4.30k|    dsm->data.keyFrameFields = (UA_DataValue *)
  332|  4.30k|        UA_Array_new(length, &UA_TYPES[UA_TYPES_DATAVALUE]);
  ------------------
  |  |  769|  4.30k|#define UA_TYPES_DATAVALUE 22
  ------------------
  333|  4.30k|    if(!dsm->data.keyFrameFields)
  ------------------
  |  Branch (333:8): [True: 5, False: 4.30k]
  ------------------
  334|      5|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      5|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  335|  4.30k|    dsm->fieldCount = (UA_UInt16)length;
  336|       |
  337|  4.30k|    dsm->header.fieldEncoding = UA_FIELDENCODING_DATAVALUE;
  338|       |
  339|  4.30k|    const UA_DataSetMessage_EncodingMetaData *emd =
  340|  4.30k|            findEncodingMetaData(&ctx->eo, nm->dataSetWriterIds[pd->dsmIndex]);
  341|       |
  342|       |    /* Iterate over the key/value pairs in the object. Keys are stored in fieldnames. */
  343|  4.30k|    ctx->ctx.index++; /* Go to the first key */
  344|  4.30k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  4.30k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  345|  88.2k|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (345:23): [True: 87.0k, False: 1.19k]
  ------------------
  346|  87.0k|        UA_assert(currentTokenType(&ctx->ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  411|  87.0k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (346:9): [True: 87.0k, False: 0]
  ------------------
  347|  87.0k|        UA_String fieldName = UA_STRING_NULL;
  348|  87.0k|        ret = decodeJsonJumpTable[UA_DATATYPEKIND_STRING](&ctx->ctx, &fieldName, NULL);
  349|  87.0k|        UA_CHECK_STATUS(ret, return ret);
  ------------------
  |  |  179|  87.0k|    UA_CHECK(isGood(STATUSCODE), EVAL_ON_ERROR)
  |  |  ------------------
  |  |  |  |  172|  87.0k|    do {                                                                                 \
  |  |  |  |  173|  87.0k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  591|  87.0k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (591:25): [True: 1, False: 87.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  174|      1|            EVAL_ON_ERROR;                                                               \
  |  |  |  |  175|      1|        }                                                                                \
  |  |  |  |  176|  87.0k|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (176:13): [Folded, False: 87.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  350|       |
  351|  87.0k|        size_t index = decodingFieldIndex(emd, fieldName, i);
  352|  87.0k|        if(index >= length) {
  ------------------
  |  Branch (352:12): [True: 0, False: 87.0k]
  ------------------
  353|      0|            UA_String_clear(&fieldName);
  354|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  355|      0|        }
  356|  87.0k|        UA_DataValue_clear(&dsm->data.keyFrameFields[index]);
  357|  87.0k|        UA_String_clear(&fieldName);
  358|  87.0k|        ret = decodeJsonJumpTable[UA_DATATYPEKIND_DATAVALUE]
  359|  87.0k|            (&ctx->ctx, &dsm->data.keyFrameFields[index], NULL);
  360|  87.0k|        UA_CHECK_STATUS(ret, return ret);
  ------------------
  |  |  179|  87.0k|    UA_CHECK(isGood(STATUSCODE), EVAL_ON_ERROR)
  |  |  ------------------
  |  |  |  |  172|  87.0k|    do {                                                                                 \
  |  |  |  |  173|  87.0k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  591|  87.0k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (591:25): [True: 3.10k, False: 83.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  174|  3.10k|            EVAL_ON_ERROR;                                                               \
  |  |  |  |  175|  3.10k|        }                                                                                \
  |  |  |  |  176|  87.0k|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (176:13): [Folded, False: 83.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  361|  87.0k|    }
  362|       |
  363|  1.19k|    return ret;
  364|  4.30k|}
ua_pubsub_networkmessage_json.c:decodingFieldIndex:
  296|  87.0k|                   UA_String name, size_t origIndex) {
  297|  87.0k|    if(!emd)
  ------------------
  |  Branch (297:8): [True: 87.0k, False: 0]
  ------------------
  298|  87.0k|        return origIndex;
  299|      0|    for(size_t i = 0; i < emd->fieldsSize; i++) {
  ------------------
  |  Branch (299:23): [True: 0, False: 0]
  ------------------
  300|      0|        if(UA_String_equal(&name, &emd->fields[i].name))
  ------------------
  |  Branch (300:12): [True: 0, False: 0]
  ------------------
  301|      0|            return i;
  302|      0|    }
  303|      0|    return origIndex;
  304|      0|}

UA_findDataTypeWithCustom:
   66|   312k|                          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|  23.6M|    for(size_t i = 0; i < UA_TYPES_COUNT; ++i) {
  ------------------
  |  |   17|  23.6M|#define UA_TYPES_COUNT 388
  ------------------
  |  Branch (72:23): [True: 23.6M, False: 45.7k]
  ------------------
   73|  23.6M|        if(nodeIdOrder(&UA_TYPES[i].typeId, typeId, NULL) == UA_ORDER_EQ)
  ------------------
  |  Branch (73:12): [True: 266k, False: 23.3M]
  ------------------
   74|   266k|            return &UA_TYPES[i];
   75|  23.6M|    }
   76|       |
   77|       |    /* Search in the customTypes */
   78|  45.7k|    while(customTypes) {
  ------------------
  |  Branch (78:11): [True: 0, False: 45.7k]
  ------------------
   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|  45.7k|    return NULL;
   87|  45.7k|}
UA_ByteString_allocBuffer:
  757|  45.4k|UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length) {
  758|  45.4k|    UA_ByteString_init(bs);
  759|  45.4k|    if(length == 0) {
  ------------------
  |  Branch (759:8): [True: 2, False: 45.4k]
  ------------------
  760|      2|        bs->data = (u8*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|      2|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  761|      2|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      2|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  762|      2|    }
  763|  45.4k|    bs->data = (u8*)UA_calloc(1,length);
  ------------------
  |  |  352|  45.4k|# define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  764|  45.4k|    if(UA_UNLIKELY(!bs->data))
  ------------------
  |  |  591|  45.4k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (591:25): [True: 0, False: 45.4k]
  |  |  ------------------
  ------------------
  765|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  766|  45.4k|    bs->length = length;
  767|  45.4k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  45.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  768|  45.4k|}
UA_new:
 1892|   338k|UA_new(const UA_DataType *type) {
 1893|   338k|    void *p = UA_calloc(1, type->memSize);
  ------------------
  |  |  352|   338k|# define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1894|   338k|    return p;
 1895|   338k|}
UA_copy:
 2058|  80.0k|UA_copy(const void *src, void *dst, const UA_DataType *type) {
 2059|  80.0k|    memset(dst, 0, type->memSize); /* init */
 2060|  80.0k|    UA_StatusCode retval = copyJumpTable[type->typeKind](src, dst, type);
 2061|  80.0k|    if(retval != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  80.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2061:8): [True: 4, False: 80.0k]
  ------------------
 2062|      4|        UA_clear(dst, type);
 2063|  80.0k|    return retval;
 2064|  80.0k|}
UA_clear:
 2161|  1.03M|UA_clear(void *p, const UA_DataType *type) {
 2162|  1.03M|    clearJumpTable[type->typeKind](p, type);
 2163|  1.03M|    memset(p, 0, type->memSize); /* init */
 2164|  1.03M|}
UA_delete:
 2167|   266k|UA_delete(void *p, const UA_DataType *type) {
 2168|   266k|    clearJumpTable[type->typeKind](p, type);
 2169|   266k|    UA_free(p);
  ------------------
  |  |  351|   266k|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2170|   266k|}
UA_Array_new:
 2629|  4.30k|UA_Array_new(size_t size, const UA_DataType *type) {
 2630|  4.30k|    if(size > UA_INT32_MAX)
  ------------------
  |  |  100|  4.30k|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (2630:8): [True: 0, False: 4.30k]
  ------------------
 2631|      0|        return NULL;
 2632|  4.30k|    if(size == 0)
  ------------------
  |  Branch (2632:8): [True: 3, False: 4.30k]
  ------------------
 2633|      3|        return UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|      3|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2634|  4.30k|    return UA_calloc(size, type->memSize);
  ------------------
  |  |  352|  4.30k|# define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2635|  4.30k|}
UA_Array_copy:
 2639|  80.0k|              void **dst, const UA_DataType *type) {
 2640|  80.0k|    if(size == 0) {
  ------------------
  |  Branch (2640:8): [True: 2.07k, False: 78.0k]
  ------------------
 2641|  2.07k|        if(src == NULL)
  ------------------
  |  Branch (2641:12): [True: 0, False: 2.07k]
  ------------------
 2642|      0|            *dst = NULL;
 2643|  2.07k|        else
 2644|  2.07k|            *dst= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  2.07k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2645|  2.07k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  2.07k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2646|  2.07k|    }
 2647|       |
 2648|       |    /* Check the array consistency -- defensive programming in case the user
 2649|       |     * manually created an inconsistent array */
 2650|  78.0k|    if(UA_UNLIKELY(!type || !src))
  ------------------
  |  |  591|   156k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (591:25): [True: 0, False: 78.0k]
  |  |  |  Branch (591:43): [True: 0, False: 78.0k]
  |  |  |  Branch (591:43): [True: 0, False: 78.0k]
  |  |  ------------------
  ------------------
 2651|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 2652|       |
 2653|       |    /* calloc, so we don't have to check retval in every iteration of copying */
 2654|  78.0k|    *dst = UA_calloc(size, type->memSize);
  ------------------
  |  |  352|  78.0k|# define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2655|  78.0k|    if(!*dst)
  ------------------
  |  Branch (2655:8): [True: 4, False: 78.0k]
  ------------------
 2656|      4|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      4|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2657|       |
 2658|  78.0k|    if(type->pointerFree) {
  ------------------
  |  Branch (2658:8): [True: 78.0k, False: 0]
  ------------------
 2659|  78.0k|        memcpy(*dst, src, type->memSize * size);
 2660|  78.0k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  78.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2661|  78.0k|    }
 2662|       |
 2663|      0|    uintptr_t ptrs = (uintptr_t)src;
 2664|      0|    uintptr_t ptrd = (uintptr_t)*dst;
 2665|      0|    UA_StatusCode retval = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2666|      0|    for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2666:23): [True: 0, False: 0]
  ------------------
 2667|      0|        retval |= UA_copy((void*)ptrs, (void*)ptrd, type);
 2668|      0|        ptrs += type->memSize;
 2669|      0|        ptrd += type->memSize;
 2670|      0|    }
 2671|      0|    if(retval != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2671:8): [True: 0, False: 0]
  ------------------
 2672|      0|        UA_Array_delete(*dst, size, type);
 2673|       |        *dst = NULL;
 2674|      0|    }
 2675|      0|    return retval;
 2676|  78.0k|}
UA_Array_delete:
 2767|   717k|UA_Array_delete(void *p, size_t size, const UA_DataType *type) {
 2768|   717k|    if(!type->pointerFree) {
  ------------------
  |  Branch (2768:8): [True: 70.7k, False: 647k]
  ------------------
 2769|  70.7k|        uintptr_t ptr = (uintptr_t)p;
 2770|   300k|        for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2770:27): [True: 229k, False: 70.7k]
  ------------------
 2771|   229k|            UA_clear((void*)ptr, type);
 2772|   229k|            ptr += type->memSize;
 2773|   229k|        }
 2774|  70.7k|    }
 2775|   717k|    UA_free((void*)((uintptr_t)p & ~(uintptr_t)UA_EMPTY_ARRAY_SENTINEL));
  ------------------
  |  |  351|   717k|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2776|   717k|}
ua_types.c:Variant_clear:
 1369|   196k|Variant_clear(UA_Variant *p, const UA_DataType *_) {
 1370|       |    /* The content is "borrowed" */
 1371|   196k|    if(p->storageType == UA_VARIANT_DATA_NODELETE)
  ------------------
  |  Branch (1371:8): [True: 0, False: 196k]
  ------------------
 1372|      0|        return;
 1373|       |
 1374|       |    /* Delete the value */
 1375|   196k|    if(p->type && p->data > UA_EMPTY_ARRAY_SENTINEL) {
  ------------------
  |  |  755|  73.4k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1375:8): [True: 73.4k, False: 122k]
  |  Branch (1375:19): [True: 72.5k, False: 889]
  ------------------
 1376|  72.5k|        if(p->arrayLength == 0)
  ------------------
  |  Branch (1376:12): [True: 71.9k, False: 645]
  ------------------
 1377|  71.9k|            p->arrayLength = 1;
 1378|  72.5k|        UA_Array_delete(p->data, p->arrayLength, p->type);
 1379|  72.5k|        p->data = NULL;
 1380|  72.5k|    }
 1381|       |
 1382|       |    /* Delete the array dimensions */
 1383|   196k|    if((void*)p->arrayDimensions > UA_EMPTY_ARRAY_SENTINEL)
  ------------------
  |  |  755|   196k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1383:8): [True: 83, False: 195k]
  ------------------
 1384|     83|        UA_free(p->arrayDimensions);
  ------------------
  |  |  351|     83|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1385|   196k|}
ua_types.c:DataValue_clear:
 1827|   195k|DataValue_clear(UA_DataValue *p, const UA_DataType *_) {
 1828|       |    Variant_clear(&p->value, NULL);
 1829|   195k|}
ua_types.c:String_copy:
  280|  80.0k|String_copy(UA_String const *src, UA_String *dst, const UA_DataType *_) {
  281|  80.0k|    UA_StatusCode res =
  282|  80.0k|        UA_Array_copy(src->data, src->length, (void**)&dst->data,
  283|  80.0k|                      &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|  80.0k|#define UA_TYPES_BYTE 2
  ------------------
  284|  80.0k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  80.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (284:8): [True: 80.0k, False: 4]
  ------------------
  285|  80.0k|        dst->length = src->length;
  286|  80.0k|    return res;
  287|  80.0k|}
ua_types.c:nopClear:
 2123|    482|static void nopClear(void *p, const UA_DataType *type) { }
ua_types.c:String_clear:
  290|   640k|String_clear(UA_String *s, const UA_DataType *_) {
  291|   640k|    UA_Array_delete(s->data, s->length, &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|   640k|#define UA_TYPES_BYTE 2
  ------------------
  292|   640k|}
ua_types.c:NodeId_clear:
  772|   332k|NodeId_clear(UA_NodeId *p, const UA_DataType *_) {
  773|   332k|    switch(p->identifierType) {
  774|  50.4k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (774:5): [True: 50.4k, False: 281k]
  ------------------
  775|  52.4k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (775:5): [True: 1.94k, False: 330k]
  ------------------
  776|  52.4k|        String_clear(&p->identifier.string, NULL);
  777|  52.4k|        break;
  778|   279k|    default: break;
  ------------------
  |  Branch (778:5): [True: 279k, False: 52.4k]
  ------------------
  779|   332k|    }
  780|   332k|}
ua_types.c:ExpandedNodeId_clear:
 1070|  5.60k|ExpandedNodeId_clear(UA_ExpandedNodeId *p, const UA_DataType *_) {
 1071|  5.60k|    NodeId_clear(&p->nodeId, _);
 1072|       |    String_clear(&p->namespaceUri, NULL);
 1073|  5.60k|}
ua_types.c:QualifiedName_clear:
  392|  33.2k|QualifiedName_clear(UA_QualifiedName *p, const UA_DataType *_) {
  393|       |    String_clear(&p->name, NULL);
  394|  33.2k|}
ua_types.c:LocalizedText_clear:
 1812|  20.9k|LocalizedText_clear(UA_LocalizedText *p, const UA_DataType *_) {
 1813|  20.9k|    String_clear(&p->locale, NULL);
 1814|       |    String_clear(&p->text, NULL);
 1815|  20.9k|}
ua_types.c:ExtensionObject_clear:
 1241|   321k|ExtensionObject_clear(UA_ExtensionObject *p, const UA_DataType *_) {
 1242|   321k|    switch(p->encoding) {
 1243|  10.0k|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (1243:5): [True: 10.0k, False: 311k]
  ------------------
 1244|  55.5k|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (1244:5): [True: 45.4k, False: 276k]
  ------------------
 1245|  55.5k|    case UA_EXTENSIONOBJECT_ENCODED_XML:
  ------------------
  |  Branch (1245:5): [True: 1, False: 321k]
  ------------------
 1246|  55.5k|        NodeId_clear(&p->content.encoded.typeId, NULL);
 1247|  55.5k|        String_clear(&p->content.encoded.body, NULL);
 1248|  55.5k|        break;
 1249|   266k|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (1249:5): [True: 266k, False: 55.5k]
  ------------------
 1250|   266k|        if(p->content.decoded.data)
  ------------------
  |  Branch (1250:12): [True: 266k, False: 0]
  ------------------
 1251|   266k|            UA_delete(p->content.decoded.data, p->content.decoded.type);
 1252|   266k|        break;
 1253|      0|    default:
  ------------------
  |  Branch (1253:5): [True: 0, False: 321k]
  ------------------
 1254|      0|        break;
 1255|   321k|    }
 1256|   321k|}
ua_types.c:DiagnosticInfo_clear:
 1855|    629|DiagnosticInfo_clear(UA_DiagnosticInfo *p, const UA_DataType *_) {
 1856|    629|    String_clear(&p->additionalInfo, NULL);
 1857|    629|    if(p->hasInnerDiagnosticInfo && p->innerDiagnosticInfo) {
  ------------------
  |  Branch (1857:8): [True: 0, False: 629]
  |  Branch (1857:37): [True: 0, False: 0]
  ------------------
 1858|      0|        DiagnosticInfo_clear(p->innerDiagnosticInfo, NULL);
 1859|      0|        UA_free(p->innerDiagnosticInfo);
  ------------------
  |  |  351|      0|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1860|      0|    }
 1861|    629|}
ua_types.c:clearStructure:
 2067|    172|clearStructure(void *p, const UA_DataType *type) {
 2068|    172|    uintptr_t ptr = (uintptr_t)p;
 2069|    915|    for(size_t i = 0; i < type->membersSize; ++i) {
  ------------------
  |  Branch (2069:23): [True: 743, False: 172]
  ------------------
 2070|    743|        const UA_DataTypeMember *m = &type->members[i];
 2071|    743|        const UA_DataType *mt = m->memberType;
 2072|    743|        ptr += m->padding;
 2073|    743|        if(!m->isOptional) {
  ------------------
  |  Branch (2073:12): [True: 743, False: 0]
  ------------------
 2074|    743|            if(!m->isArray) {
  ------------------
  |  Branch (2074:16): [True: 670, False: 73]
  ------------------
 2075|    670|                clearJumpTable[mt->typeKind]((void*)ptr, mt);
 2076|    670|                ptr += mt->memSize;
 2077|    670|            } else {
 2078|     73|                size_t length = *(size_t*)ptr;
 2079|     73|                ptr += sizeof(size_t);
 2080|     73|                UA_Array_delete(*(void**)ptr, length, mt);
 2081|     73|                ptr += sizeof(void*);
 2082|     73|            }
 2083|    743|        } else { /* field is optional */
 2084|      0|            if(!m->isArray) {
  ------------------
  |  Branch (2084:16): [True: 0, False: 0]
  ------------------
 2085|       |                /* optional scalar field is contained */
 2086|      0|                if((*(void *const *)ptr != NULL))
  ------------------
  |  Branch (2086:20): [True: 0, False: 0]
  ------------------
 2087|      0|                    UA_Array_delete(*(void **)ptr, 1, mt);
 2088|      0|                ptr += sizeof(void *);
 2089|      0|            } else {
 2090|       |                /* optional array field is contained */
 2091|      0|                if((*(void *const *)(ptr + sizeof(size_t)) != NULL)) {
  ------------------
  |  Branch (2091:20): [True: 0, False: 0]
  ------------------
 2092|      0|                    size_t length = *(size_t *)ptr;
 2093|      0|                    ptr += sizeof(size_t);
 2094|      0|                    UA_Array_delete(*(void **)ptr, length, mt);
 2095|      0|                    ptr += sizeof(void *);
 2096|      0|                } else { /* optional array field not contained */
 2097|      0|                    ptr += sizeof(size_t);
 2098|      0|                    ptr += sizeof(void *);
 2099|      0|                }
 2100|      0|            }
 2101|      0|        }
 2102|    743|    }
 2103|    172|}
ua_types.c:nodeIdOrder:
 2245|  23.6M|nodeIdOrder(const UA_NodeId *p1, const UA_NodeId *p2, const UA_DataType *_) {
 2246|       |    /* Compare namespaceIndex */
 2247|  23.6M|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2247:8): [True: 30.6k, False: 23.5M]
  ------------------
 2248|  30.6k|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2248:16): [True: 30.6k, False: 0]
  ------------------
 2249|       |
 2250|       |    /* Compare identifierType */
 2251|  23.5M|    if(p1->identifierType != p2->identifierType)
  ------------------
  |  Branch (2251:8): [True: 17.5M, False: 6.02M]
  ------------------
 2252|  17.5M|        return (p1->identifierType < p2->identifierType) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2252:16): [True: 17.5M, False: 0]
  ------------------
 2253|       |
 2254|       |    /* Compare the identifier */
 2255|  6.02M|    switch(p1->identifierType) {
 2256|  6.02M|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (2256:5): [True: 6.02M, False: 0]
  ------------------
 2257|  6.02M|    default:
  ------------------
  |  Branch (2257:5): [True: 0, False: 6.02M]
  ------------------
 2258|  6.02M|        if(p1->identifier.numeric != p2->identifier.numeric)
  ------------------
  |  Branch (2258:12): [True: 5.76M, False: 266k]
  ------------------
 2259|  5.76M|            return (p1->identifier.numeric < p2->identifier.numeric) ?
  ------------------
  |  Branch (2259:20): [True: 5.62M, False: 132k]
  ------------------
 2260|  5.62M|                UA_ORDER_LESS : UA_ORDER_MORE;
 2261|   266k|        return UA_ORDER_EQ;
 2262|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (2262:5): [True: 0, False: 6.02M]
  ------------------
 2263|      0|        return guidOrder(&p1->identifier.guid, &p2->identifier.guid, NULL);
 2264|      0|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (2264:5): [True: 0, False: 6.02M]
  ------------------
 2265|      0|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (2265:5): [True: 0, False: 6.02M]
  ------------------
 2266|       |        return stringOrder(&p1->identifier.string, &p2->identifier.string, NULL);
 2267|  6.02M|    }
 2268|  6.02M|}

lookAheadForKey:
 1435|  1.17M|lookAheadForKey(ParseCtx *ctx, const char *key, size_t *resultIndex) {
 1436|       |    /* The current index must point to the beginning of an object.
 1437|       |     * This has to be ensured by the caller. */
 1438|  1.17M|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  411|  1.17M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1438:5): [True: 1.17M, False: 0]
  ------------------
 1439|       |
 1440|  1.17M|    status ret = UA_STATUSCODE_BADNOTFOUND;
  ------------------
  |  |  232|  1.17M|#define UA_STATUSCODE_BADNOTFOUND ((UA_StatusCode) 0x803E0000)
  ------------------
 1441|  1.17M|    size_t oldIndex = ctx->index; /* Save index for later restore */
 1442|  1.17M|    unsigned int end = ctx->tokens[ctx->index].end;
 1443|  1.17M|    ctx->index++; /* Move to the first key */
 1444|  3.17M|    while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1444:11): [True: 3.17M, False: 4.17k]
  ------------------
 1445|  3.17M|          ctx->tokens[ctx->index].start < end) {
  ------------------
  |  Branch (1445:11): [True: 2.45M, False: 720k]
  ------------------
 1446|       |        /* Key must be a string */
 1447|  2.45M|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  411|  2.45M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1447:9): [True: 2.45M, False: 0]
  ------------------
 1448|       |
 1449|       |        /* Move index to the value */
 1450|  2.45M|        ctx->index++;
 1451|       |
 1452|       |        /* Value for the key must exist */
 1453|  2.45M|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  411|  2.45M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1453:9): [True: 2.45M, False: 0]
  ------------------
 1454|       |
 1455|       |        /* Compare the key (previous index) */
 1456|  2.45M|        if(jsoneq(ctx->json5, &ctx->tokens[ctx->index-1], key) == 0) {
  ------------------
  |  Branch (1456:12): [True: 446k, False: 2.00M]
  ------------------
 1457|   446k|            *resultIndex = ctx->index; /* Point result to the current index */
 1458|   446k|            ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   446k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1459|   446k|            break;
 1460|   446k|        }
 1461|       |
 1462|  2.00M|        skipObject(ctx); /* Jump over the value (can also be an array or object) */
 1463|  2.00M|    }
 1464|  1.17M|    ctx->index = oldIndex; /* Restore the old index */
 1465|  1.17M|    return ret;
 1466|  1.17M|}
decodeFields:
 2220|  84.4k|decodeFields(ParseCtx *ctx, DecodeEntry *entries, size_t entryCount) {
 2221|  84.4k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  84.4k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  84.4k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 84.4k]
  |  |  ------------------
  |  | 1038|  84.4k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  84.4k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 84.4k]
  |  |  ------------------
  ------------------
 2222|  84.4k|    CHECK_NULL_SKIP; /* null is treated like an empty object */
  ------------------
  |  | 1061|  84.4k|#define CHECK_NULL_SKIP do {                         \
  |  | 1062|  84.4k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1062:8): [True: 1, False: 84.4k]
  |  |  ------------------
  |  | 1063|      1|        ctx->index++;                                \
  |  | 1064|      1|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1065|  84.4k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1065:14): [Folded, False: 84.4k]
  |  |  ------------------
  ------------------
 2223|       |
 2224|  84.4k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|  84.4k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (2224:8): [True: 0, False: 84.4k]
  ------------------
 2225|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 2226|       |
 2227|       |    /* Keys and values are counted separately */
 2228|  84.4k|    CHECK_OBJECT;
  ------------------
  |  | 1056|  84.4k|#define CHECK_OBJECT do {                                \
  |  | 1057|  84.4k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1057:8): [True: 21, False: 84.4k]
  |  |  ------------------
  |  | 1058|     21|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     21|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1059|  84.4k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1059:14): [Folded, False: 84.4k]
  |  |  ------------------
  ------------------
 2229|  84.4k|    UA_assert(ctx->tokens[ctx->index].size % 2 == 0);
  ------------------
  |  |  411|  84.4k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2229:5): [True: 84.4k, False: 0]
  ------------------
 2230|  84.4k|    size_t keyCount = (size_t)(ctx->tokens[ctx->index].size) / 2;
 2231|       |
 2232|  84.4k|    ctx->index++; /* Go to first key - or jump after the empty object */
 2233|  84.4k|    ctx->depth++;
 2234|       |
 2235|  84.4k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  84.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2236|   198k|    for(size_t key = 0; key < keyCount; key++) {
  ------------------
  |  Branch (2236:25): [True: 123k, False: 74.7k]
  ------------------
 2237|       |        /* Key must be a string */
 2238|   123k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  411|   123k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2238:9): [True: 123k, False: 0]
  ------------------
 2239|   123k|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  411|   123k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2239:9): [True: 123k, False: 0]
  ------------------
 2240|       |
 2241|       |        /* Search for the decoding entry matching the key. Start at the key
 2242|       |         * index to speed-up the case where they key-order is the same as the
 2243|       |         * entry-order. */
 2244|   123k|        DecodeEntry *entry = NULL;
 2245|   203k|        for(size_t i = key; i < key + entryCount; i++) {
  ------------------
  |  Branch (2245:29): [True: 202k, False: 353]
  ------------------
 2246|   202k|            size_t ii = i;
 2247|   206k|            while(ii >= entryCount)
  ------------------
  |  Branch (2247:19): [True: 3.44k, False: 202k]
  ------------------
 2248|  3.44k|                ii -= entryCount;
 2249|       |
 2250|       |            /* Compare the key */
 2251|   202k|            if(jsoneq(ctx->json5, &ctx->tokens[ctx->index],
  ------------------
  |  Branch (2251:16): [True: 79.6k, False: 123k]
  ------------------
 2252|   202k|                      entries[ii].fieldName) != 0)
 2253|  79.6k|                continue;
 2254|       |
 2255|       |            /* Key was already used -> duplicate, abort */
 2256|   123k|            if(entries[ii].found) {
  ------------------
  |  Branch (2256:16): [True: 3, False: 123k]
  ------------------
 2257|      3|                ctx->depth--;
 2258|      3|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2259|      3|            }
 2260|       |
 2261|       |            /* Found the key */
 2262|   123k|            entries[ii].found = true;
 2263|   123k|            entry = &entries[ii];
 2264|   123k|            break;
 2265|   123k|        }
 2266|       |
 2267|       |        /* The key is unknown */
 2268|   123k|        if(!entry) {
  ------------------
  |  Branch (2268:12): [True: 353, False: 123k]
  ------------------
 2269|    353|            ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    353|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2270|    353|            break;
 2271|    353|        }
 2272|       |
 2273|       |        /* Go from key to value */
 2274|   123k|        ctx->index++;
 2275|   123k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  411|   123k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2275:9): [True: 123k, False: 0]
  ------------------
 2276|       |
 2277|       |        /* An entry that was expected but shall not be decoded.
 2278|       |         * Jump over the value. */
 2279|   123k|        if(!entry->function && !entry->type) {
  ------------------
  |  Branch (2279:12): [True: 113k, False: 10.1k]
  |  Branch (2279:32): [True: 111k, False: 1.18k]
  ------------------
 2280|   111k|            skipObject(ctx);
 2281|   111k|            continue;
 2282|   111k|        }
 2283|       |
 2284|       |        /* A null-value, skip the decoding (the value is already initialized) */
 2285|  11.2k|        if(currentTokenType(ctx) == CJ5_TOKEN_NULL && !entry->function) {
  ------------------
  |  Branch (2285:12): [True: 15, False: 11.2k]
  |  Branch (2285:55): [True: 12, False: 3]
  ------------------
 2286|     12|            ctx->index++; /* skip null value */
 2287|     12|            continue;
 2288|     12|        }
 2289|       |
 2290|       |        /* Decode. This also moves to the next key or right after the object for
 2291|       |         * the last value. */
 2292|  11.2k|        decodeJsonSignature decodeFunc = (entry->function) ?
  ------------------
  |  Branch (2292:42): [True: 10.1k, False: 1.17k]
  ------------------
 2293|  10.1k|            entry->function : decodeJsonJumpTable[entry->type->typeKind];
 2294|  11.2k|        ret = decodeFunc(ctx, entry->fieldPointer, entry->type);
 2295|  11.2k|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  11.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2295:12): [True: 9.36k, False: 1.92k]
  ------------------
 2296|  9.36k|            break;
 2297|  11.2k|    }
 2298|       |
 2299|  84.4k|    ctx->depth--;
 2300|  84.4k|    return ret;
 2301|  84.4k|}
tokenize:
 2429|  7.72k|         size_t *decodedLength) {
 2430|       |    /* Tokenize */
 2431|  7.72k|    cj5_options options;
 2432|  7.72k|    options.stop_early = (decodedLength != NULL);
 2433|  7.72k|    cj5_result r = cj5_parse((char*)src->data, (unsigned int)src->length,
 2434|  7.72k|                             ctx->tokens, (unsigned int)tokensSize, &options);
 2435|       |
 2436|       |    /* Handle overflow error by allocating the number of tokens the parser would
 2437|       |     * have needed */
 2438|  7.72k|    if(r.error == CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (2438:8): [True: 516, False: 7.21k]
  ------------------
 2439|    516|       tokensSize != r.num_tokens) {
  ------------------
  |  Branch (2439:8): [True: 516, False: 0]
  ------------------
 2440|    516|        ctx->tokens = (cj5_token*)
 2441|    516|            UA_malloc(sizeof(cj5_token) * r.num_tokens);
  ------------------
  |  |  350|    516|# define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 2442|    516|        if(!ctx->tokens)
  ------------------
  |  Branch (2442:12): [True: 12, False: 504]
  ------------------
 2443|     12|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|     12|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2444|    504|        return tokenize(ctx, src, r.num_tokens, decodedLength);
 2445|    516|    }
 2446|       |
 2447|       |    /* Cannot recover from other errors */
 2448|  7.21k|    if(r.error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (2448:8): [True: 715, False: 6.49k]
  ------------------
 2449|    715|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    715|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2450|       |
 2451|  6.49k|    if(decodedLength)
  ------------------
  |  Branch (2451:8): [True: 0, False: 6.49k]
  ------------------
 2452|      0|        *decodedLength = ctx->tokens[0].end + 1;
 2453|       |
 2454|       |    /* Set up the context */
 2455|  6.49k|    ctx->json5 = (char*)src->data;
 2456|  6.49k|    ctx->depth = 0;
 2457|  6.49k|    ctx->tokensSize = r.num_tokens;
 2458|  6.49k|    ctx->index = 0;
 2459|  6.49k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  6.49k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2460|  7.21k|}
ua_types_encoding_json.c:jsoneq:
 1091|  2.65M|jsoneq(const char *json, const cj5_token *tok, const char *searchKey) {
 1092|       |    /* TODO: necessary?
 1093|       |       if(json == NULL
 1094|       |            || tok == NULL
 1095|       |            || searchKey == NULL) {
 1096|       |        return -1;
 1097|       |    } */
 1098|       |
 1099|  2.65M|    size_t len = getTokenLength(tok);
 1100|  2.65M|    if(tok->type == CJ5_TOKEN_STRING &&
  ------------------
  |  Branch (1100:8): [True: 2.65M, False: 0]
  ------------------
 1101|  2.65M|       strlen(searchKey) ==  len &&
  ------------------
  |  Branch (1101:8): [True: 576k, False: 2.08M]
  ------------------
 1102|   576k|       strncmp(json + tok->start, (const char*)searchKey, len) == 0)
  ------------------
  |  Branch (1102:8): [True: 569k, False: 6.72k]
  ------------------
 1103|   569k|        return 0;
 1104|       |
 1105|  2.08M|    return -1;
 1106|  2.65M|}
ua_types_encoding_json.c:skipObject:
 1076|  2.26M|skipObject(ParseCtx *ctx) {
 1077|  2.26M|    unsigned int end = ctx->tokens[ctx->index].end;
 1078|  33.8M|    do {
 1079|  33.8M|        ctx->index++;
 1080|  33.8M|    } while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1080:13): [True: 33.8M, False: 8.99k]
  ------------------
 1081|  33.8M|            ctx->tokens[ctx->index].start < end);
  ------------------
  |  Branch (1081:13): [True: 31.6M, False: 2.25M]
  ------------------
 1082|  2.26M|}
ua_types_encoding_json.c:DiagnosticInfo_decodeJson:
 2183|    480|DECODE_JSON(DiagnosticInfo) {
 2184|    480|    CHECK_NULL_SKIP; /* Treat a null value as an empty DiagnosticInfo */
  ------------------
  |  | 1061|    480|#define CHECK_NULL_SKIP do {                         \
  |  | 1062|    480|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1062:8): [True: 0, False: 480]
  |  |  ------------------
  |  | 1063|      0|        ctx->index++;                                \
  |  | 1064|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1065|    480|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1065:14): [Folded, False: 480]
  |  |  ------------------
  ------------------
 2185|    480|    CHECK_OBJECT;
  ------------------
  |  | 1056|    480|#define CHECK_OBJECT do {                                \
  |  | 1057|    480|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1057:8): [True: 11, False: 469]
  |  |  ------------------
  |  | 1058|     11|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     11|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1059|    469|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1059:14): [Folded, False: 469]
  |  |  ------------------
  ------------------
 2186|       |
 2187|    469|    DecodeEntry entries[7] = {
 2188|    469|        {UA_JSONKEY_SYMBOLICID, &dst->symbolicId, NULL, false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|    469|#define UA_TYPES_INT32 5
  ------------------
 2189|    469|        {UA_JSONKEY_NAMESPACEURI, &dst->namespaceUri, NULL, false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|    469|#define UA_TYPES_INT32 5
  ------------------
 2190|    469|        {UA_JSONKEY_LOCALIZEDTEXT, &dst->localizedText, NULL, false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|    469|#define UA_TYPES_INT32 5
  ------------------
 2191|    469|        {UA_JSONKEY_LOCALE, &dst->locale, NULL, false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|    469|#define UA_TYPES_INT32 5
  ------------------
 2192|    469|        {UA_JSONKEY_ADDITIONALINFO, &dst->additionalInfo, NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  395|    469|#define UA_TYPES_STRING 11
  ------------------
 2193|    469|        {UA_JSONKEY_INNERSTATUSCODE, &dst->innerStatusCode, NULL, false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  633|    469|#define UA_TYPES_STATUSCODE 18
  ------------------
 2194|    469|        {UA_JSONKEY_INNERDIAGNOSTICINFO, &dst->innerDiagnosticInfo, DiagnosticInfoInner_decodeJson, false, NULL}
 2195|    469|    };
 2196|    469|    status ret = decodeFields(ctx, entries, 7);
 2197|       |
 2198|    469|    dst->hasSymbolicId = entries[0].found;
 2199|    469|    dst->hasNamespaceUri = entries[1].found;
 2200|    469|    dst->hasLocalizedText = entries[2].found;
 2201|    469|    dst->hasLocale = entries[3].found;
 2202|    469|    dst->hasAdditionalInfo = entries[4].found;
 2203|    469|    dst->hasInnerStatusCode = entries[5].found;
 2204|    469|    dst->hasInnerDiagnosticInfo = entries[6].found;
 2205|    469|    return ret;
 2206|    480|}
ua_types_encoding_json.c:Boolean_decodeJson:
 1108|     78|DECODE_JSON(Boolean) {
 1109|     78|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|     78|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|     78|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 78]
  |  |  ------------------
  |  | 1038|     78|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|     78|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 78]
  |  |  ------------------
  ------------------
 1110|     78|    CHECK_BOOL;
  ------------------
  |  | 1046|     78|#define CHECK_BOOL do {                                \
  |  | 1047|     78|    if(currentTokenType(ctx) != CJ5_TOKEN_BOOL) {      \
  |  |  ------------------
  |  |  |  Branch (1047:8): [True: 75, False: 3]
  |  |  ------------------
  |  | 1048|     75|        return UA_STATUSCODE_BADDECODINGERROR;         \
  |  |  ------------------
  |  |  |  |   43|     75|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1049|     75|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1049:14): [Folded, False: 3]
  |  |  ------------------
  ------------------
 1111|      3|    GET_TOKEN;
  ------------------
  |  | 1032|      3|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|      3|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|      3|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 3]
  |  |  ------------------
  ------------------
 1112|       |
 1113|      3|    if(tokenSize == 4 &&
  ------------------
  |  Branch (1113:8): [True: 2, False: 1]
  ------------------
 1114|      2|       (tokenData[0] | 32) == 't' && (tokenData[1] | 32) == 'r' &&
  ------------------
  |  Branch (1114:8): [True: 2, False: 0]
  |  Branch (1114:38): [True: 2, False: 0]
  ------------------
 1115|      2|       (tokenData[2] | 32) == 'u' && (tokenData[3] | 32) == 'e') {
  ------------------
  |  Branch (1115:8): [True: 2, False: 0]
  |  Branch (1115:38): [True: 2, False: 0]
  ------------------
 1116|      2|        *dst = true;
 1117|      2|    } else if(tokenSize == 5 &&
  ------------------
  |  Branch (1117:15): [True: 1, False: 0]
  ------------------
 1118|      1|              (tokenData[0] | 32) == 'f' && (tokenData[1] | 32) == 'a' &&
  ------------------
  |  Branch (1118:15): [True: 1, False: 0]
  |  Branch (1118:45): [True: 1, False: 0]
  ------------------
 1119|      1|              (tokenData[2] | 32) == 'l' && (tokenData[3] | 32) == 's' &&
  ------------------
  |  Branch (1119:15): [True: 1, False: 0]
  |  Branch (1119:45): [True: 1, False: 0]
  ------------------
 1120|      1|              (tokenData[4] | 32) == 'e') {
  ------------------
  |  Branch (1120:15): [True: 1, False: 0]
  ------------------
 1121|      1|        *dst = false;
 1122|      1|    } else {
 1123|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1124|      0|    }
 1125|       |
 1126|      3|    ctx->index++;
 1127|      3|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      3|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1128|      3|}
ua_types_encoding_json.c:SByte_decodeJson:
 1215|   611k|DECODE_JSON(SByte) {
 1216|   611k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|   611k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|   611k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 611k]
  |  |  ------------------
  |  | 1038|   611k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|   611k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 611k]
  |  |  ------------------
  ------------------
 1217|   611k|    CHECK_NUMBER;
  ------------------
  |  | 1041|   611k|#define CHECK_NUMBER do {                                \
  |  | 1042|   611k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1042:8): [True: 11, False: 611k]
  |  |  ------------------
  |  | 1043|     11|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     11|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1044|   611k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1044:14): [Folded, False: 611k]
  |  |  ------------------
  ------------------
 1218|   611k|    GET_TOKEN;
  ------------------
  |  | 1032|   611k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|   611k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|   611k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 611k]
  |  |  ------------------
  ------------------
 1219|       |
 1220|   611k|    UA_Int64 out = 0;
 1221|   611k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1222|   611k|    if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   16|  1.22M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   63|  1.22M|#define UA_SBYTE_MIN (-128)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   64|   611k|#define UA_SBYTE_MAX 127
  ------------------
  |  Branch (1222:8): [True: 64, False: 611k]
  |  Branch (1222:35): [True: 103, False: 611k]
  |  Branch (1222:57): [True: 58, False: 611k]
  ------------------
 1223|    225|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    225|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1224|   611k|    *dst = (UA_SByte)out;
 1225|   611k|    ctx->index++;
 1226|   611k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   611k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1227|   611k|}
ua_types_encoding_json.c:parseSignedInteger:
 1147|  1.88M|parseSignedInteger(const char *tokenData, size_t tokenSize, UA_Int64 *dst) {
 1148|  1.88M|    size_t len = parseInt64(tokenData, tokenSize, dst);
 1149|  1.88M|    if(len == 0)
  ------------------
  |  Branch (1149:8): [True: 120, False: 1.88M]
  ------------------
 1150|    120|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    120|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1151|       |
 1152|       |    /* There must only be whitespace between the end of the parsed number and
 1153|       |     * the end of the token */
 1154|  1.96M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1154:25): [True: 77.9k, False: 1.88M]
  ------------------
 1155|  77.9k|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1155:12): [True: 54.2k, False: 23.7k]
  |  Branch (1155:35): [True: 114, False: 54.1k]
  ------------------
 1156|    114|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    114|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1157|  77.9k|    }
 1158|       |
 1159|  1.88M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.88M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1160|  1.88M|}
ua_types_encoding_json.c:Byte_decodeJson:
 1162|  3.21k|DECODE_JSON(Byte) {
 1163|  3.21k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  3.21k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  3.21k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 3.21k]
  |  |  ------------------
  |  | 1038|  3.21k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  3.21k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 3.21k]
  |  |  ------------------
  ------------------
 1164|  3.21k|    CHECK_NUMBER;
  ------------------
  |  | 1041|  3.21k|#define CHECK_NUMBER do {                                \
  |  | 1042|  3.21k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1042:8): [True: 6, False: 3.20k]
  |  |  ------------------
  |  | 1043|      6|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1044|  3.20k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1044:14): [Folded, False: 3.20k]
  |  |  ------------------
  ------------------
 1165|  3.20k|    GET_TOKEN;
  ------------------
  |  | 1032|  3.20k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|  3.20k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|  3.20k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 3.20k]
  |  |  ------------------
  ------------------
 1166|       |
 1167|  3.20k|    UA_UInt64 out = 0;
 1168|  3.20k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1169|  3.20k|    if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   16|  6.41k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   73|  3.17k|#define UA_BYTE_MAX 255
  ------------------
  |  Branch (1169:8): [True: 28, False: 3.17k]
  |  Branch (1169:35): [True: 109, False: 3.07k]
  ------------------
 1170|    137|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    137|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1171|  3.07k|    *dst = (UA_Byte)out;
 1172|  3.07k|    ctx->index++;
 1173|  3.07k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  3.07k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1174|  3.20k|}
ua_types_encoding_json.c:parseUnsignedInteger:
 1131|  1.32M|parseUnsignedInteger(const char *tokenData, size_t tokenSize, UA_UInt64 *dst) {
 1132|  1.32M|    size_t len = parseUInt64(tokenData, tokenSize, dst);
 1133|  1.32M|    if(len == 0)
  ------------------
  |  Branch (1133:8): [True: 108, False: 1.32M]
  ------------------
 1134|    108|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    108|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1135|       |
 1136|       |    /* There must only be whitespace between the end of the parsed number and
 1137|       |     * the end of the token */
 1138|  1.37M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1138:25): [True: 49.9k, False: 1.32M]
  ------------------
 1139|  49.9k|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1139:12): [True: 10.3k, False: 39.6k]
  |  Branch (1139:35): [True: 124, False: 10.2k]
  ------------------
 1140|    124|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    124|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1141|  49.9k|    }
 1142|       |
 1143|  1.32M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.32M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1144|  1.32M|}
ua_types_encoding_json.c:Int16_decodeJson:
 1229|   523k|DECODE_JSON(Int16) {
 1230|   523k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|   523k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|   523k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 523k]
  |  |  ------------------
  |  | 1038|   523k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|   523k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 523k]
  |  |  ------------------
  ------------------
 1231|   523k|    CHECK_NUMBER;
  ------------------
  |  | 1041|   523k|#define CHECK_NUMBER do {                                \
  |  | 1042|   523k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1042:8): [True: 11, False: 523k]
  |  |  ------------------
  |  | 1043|     11|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     11|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1044|   523k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1044:14): [Folded, False: 523k]
  |  |  ------------------
  ------------------
 1232|   523k|    GET_TOKEN;
  ------------------
  |  | 1032|   523k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|   523k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|   523k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 523k]
  |  |  ------------------
  ------------------
 1233|       |
 1234|   523k|    UA_Int64 out = 0;
 1235|   523k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1236|   523k|    if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   16|  1.04M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   81|  1.04M|#define UA_INT16_MIN (-32768)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   82|   522k|#define UA_INT16_MAX 32767
  ------------------
  |  Branch (1236:8): [True: 63, False: 523k]
  |  Branch (1236:35): [True: 100, False: 522k]
  |  Branch (1236:57): [True: 25, False: 522k]
  ------------------
 1237|    188|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    188|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1238|   522k|    *dst = (UA_Int16)out;
 1239|   522k|    ctx->index++;
 1240|   522k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   522k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1241|   523k|}
ua_types_encoding_json.c:UInt16_decodeJson:
 1176|   176k|DECODE_JSON(UInt16) {
 1177|   176k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|   176k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|   176k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 176k]
  |  |  ------------------
  |  | 1038|   176k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|   176k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 176k]
  |  |  ------------------
  ------------------
 1178|   176k|    CHECK_NUMBER;
  ------------------
  |  | 1041|   176k|#define CHECK_NUMBER do {                                \
  |  | 1042|   176k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1042:8): [True: 7, False: 176k]
  |  |  ------------------
  |  | 1043|      7|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1044|   176k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1044:14): [Folded, False: 176k]
  |  |  ------------------
  ------------------
 1179|   176k|    GET_TOKEN;
  ------------------
  |  | 1032|   176k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|   176k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|   176k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 176k]
  |  |  ------------------
  ------------------
 1180|       |
 1181|   176k|    UA_UInt64 out = 0;
 1182|   176k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1183|   176k|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   16|   352k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   91|   176k|#define UA_UINT16_MAX 65535
  ------------------
  |  Branch (1183:8): [True: 57, False: 176k]
  |  Branch (1183:35): [True: 158, False: 176k]
  ------------------
 1184|    215|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    215|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1185|   176k|    *dst = (UA_UInt16)out;
 1186|   176k|    ctx->index++;
 1187|   176k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   176k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1188|   176k|}
ua_types_encoding_json.c:Int32_decodeJson:
 1243|   291k|DECODE_JSON(Int32) {
 1244|   291k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|   291k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|   291k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 291k]
  |  |  ------------------
  |  | 1038|   291k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|   291k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 291k]
  |  |  ------------------
  ------------------
 1245|   291k|    CHECK_NUMBER;
  ------------------
  |  | 1041|   291k|#define CHECK_NUMBER do {                                \
  |  | 1042|   291k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1042:8): [True: 10, False: 291k]
  |  |  ------------------
  |  | 1043|     10|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     10|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1044|   291k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1044:14): [Folded, False: 291k]
  |  |  ------------------
  ------------------
 1246|   291k|    GET_TOKEN;
  ------------------
  |  | 1032|   291k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|   291k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|   291k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 291k]
  |  |  ------------------
  ------------------
 1247|       |
 1248|   291k|    UA_Int64 out = 0;
 1249|   291k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1250|   291k|    if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   16|   582k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   99|   582k|#define UA_INT32_MIN ((int32_t)-2147483648LL)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |  100|   291k|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (1250:8): [True: 45, False: 291k]
  |  Branch (1250:35): [True: 72, False: 291k]
  |  Branch (1250:57): [True: 5, False: 291k]
  ------------------
 1251|    122|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    122|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1252|   291k|    *dst = (UA_Int32)out;
 1253|   291k|    ctx->index++;
 1254|   291k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   291k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1255|   291k|}
ua_types_encoding_json.c:UInt32_decodeJson:
 1190|   875k|DECODE_JSON(UInt32) {
 1191|   875k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|   875k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|   875k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 875k]
  |  |  ------------------
  |  | 1038|   875k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|   875k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 875k]
  |  |  ------------------
  ------------------
 1192|   875k|    CHECK_NUMBER;
  ------------------
  |  | 1041|   875k|#define CHECK_NUMBER do {                                \
  |  | 1042|   875k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1042:8): [True: 14, False: 875k]
  |  |  ------------------
  |  | 1043|     14|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     14|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1044|   875k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1044:14): [Folded, False: 875k]
  |  |  ------------------
  ------------------
 1193|   875k|    GET_TOKEN;
  ------------------
  |  | 1032|   875k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|   875k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|   875k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 875k]
  |  |  ------------------
  ------------------
 1194|       |
 1195|   875k|    UA_UInt64 out = 0;
 1196|   875k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1197|   875k|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |   16|  1.75M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |  109|   875k|#define UA_UINT32_MAX 4294967295UL
  ------------------
  |  Branch (1197:8): [True: 83, False: 875k]
  |  Branch (1197:35): [True: 86, False: 875k]
  ------------------
 1198|    169|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    169|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1199|   875k|    *dst = (UA_UInt32)out;
 1200|   875k|    ctx->index++;
 1201|   875k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   875k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1202|   875k|}
ua_types_encoding_json.c:Int64_decodeJson:
 1257|   461k|DECODE_JSON(Int64) {
 1258|   461k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|   461k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|   461k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 461k]
  |  |  ------------------
  |  | 1038|   461k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|   461k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 461k]
  |  |  ------------------
  ------------------
 1259|   461k|    GET_TOKEN;
  ------------------
  |  | 1032|   461k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|   461k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|   461k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 461k]
  |  |  ------------------
  ------------------
 1260|       |
 1261|   461k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, dst);
 1262|   461k|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|   461k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1262:8): [True: 62, False: 461k]
  ------------------
 1263|     62|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     62|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1264|   461k|    ctx->index++;
 1265|   461k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   461k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1266|   461k|}
ua_types_encoding_json.c:UInt64_decodeJson:
 1204|   266k|DECODE_JSON(UInt64) {
 1205|   266k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|   266k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|   266k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 266k]
  |  |  ------------------
  |  | 1038|   266k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|   266k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 266k]
  |  |  ------------------
  ------------------
 1206|   266k|    GET_TOKEN;
  ------------------
  |  | 1032|   266k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|   266k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|   266k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 266k]
  |  |  ------------------
  ------------------
 1207|       |
 1208|   266k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, dst);
 1209|   266k|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|   266k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1209:8): [True: 64, False: 266k]
  ------------------
 1210|     64|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     64|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1211|   266k|    ctx->index++;
 1212|   266k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   266k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1213|   266k|}
ua_types_encoding_json.c:Float_decodeJson:
 1328|  1.45k|DECODE_JSON(Float) {
 1329|  1.45k|    UA_Double v = 0.0;
 1330|       |    UA_StatusCode res = Double_decodeJson(ctx, &v, NULL);
 1331|  1.45k|    *dst = (UA_Float)v;
 1332|  1.45k|    return res;
 1333|  1.45k|}
ua_types_encoding_json.c:Double_decodeJson:
 1269|  1.77k|DECODE_JSON(Double) {
 1270|  1.77k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  1.77k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  1.77k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 1.77k]
  |  |  ------------------
  |  | 1038|  1.77k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  1.77k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 1.77k]
  |  |  ------------------
  ------------------
 1271|  1.77k|    GET_TOKEN;
  ------------------
  |  | 1032|  1.77k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|  1.77k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|  1.77k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 1.77k]
  |  |  ------------------
  ------------------
 1272|       |
 1273|       |    /* https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/
 1274|       |     * Maximum digit counts for select IEEE floating-point formats: 1074
 1275|       |     * Sanity check.
 1276|       |     */
 1277|  1.77k|    if(tokenSize > 2000)
  ------------------
  |  Branch (1277:8): [True: 9, False: 1.77k]
  ------------------
 1278|      9|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1279|       |
 1280|  1.77k|    cj5_token_type tokenType = currentTokenType(ctx);
 1281|       |
 1282|       |    /* It could be a String with Nan, Infinity */
 1283|  1.77k|    if(tokenType == CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (1283:8): [True: 985, False: 785]
  ------------------
 1284|    985|        ctx->index++;
 1285|       |
 1286|    985|        if(tokenSize == 8 && memcmp(tokenData, "Infinity", 8) == 0) {
  ------------------
  |  Branch (1286:12): [True: 217, False: 768]
  |  Branch (1286:30): [True: 197, False: 20]
  ------------------
 1287|    197|            *dst = INFINITY;
 1288|    197|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    197|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1289|    197|        }
 1290|       |
 1291|    788|        if(tokenSize == 9 && memcmp(tokenData, "-Infinity", 9) == 0) {
  ------------------
  |  Branch (1291:12): [True: 243, False: 545]
  |  Branch (1291:30): [True: 215, False: 28]
  ------------------
 1292|       |            /* workaround an MSVC 2013 issue */
 1293|    215|            *dst = -INFINITY;
 1294|    215|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    215|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1295|    215|        }
 1296|       |
 1297|    573|        if(tokenSize == 3 && memcmp(tokenData, "NaN", 3) == 0) {
  ------------------
  |  Branch (1297:12): [True: 224, False: 349]
  |  Branch (1297:30): [True: 200, False: 24]
  ------------------
 1298|    200|            *dst = NAN;
 1299|    200|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    200|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1300|    200|        }
 1301|       |
 1302|    373|        if(tokenSize == 4 && memcmp(tokenData, "-NaN", 4) == 0) {
  ------------------
  |  Branch (1302:12): [True: 270, False: 103]
  |  Branch (1302:30): [True: 251, False: 19]
  ------------------
 1303|    251|            *dst = NAN;
 1304|    251|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    251|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1305|    251|        }
 1306|       |
 1307|    122|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    122|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1308|    373|    }
 1309|       |
 1310|    785|    if(tokenType != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1310:8): [True: 6, False: 779]
  ------------------
 1311|      6|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1312|       |
 1313|    779|    size_t len = parseDouble(tokenData, tokenSize, dst);
 1314|    779|    if(len == 0)
  ------------------
  |  Branch (1314:8): [True: 9, False: 770]
  ------------------
 1315|      9|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1316|       |
 1317|       |    /* There must only be whitespace between the end of the parsed number and
 1318|       |     * the end of the token */
 1319|    770|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1319:25): [True: 38, False: 732]
  ------------------
 1320|     38|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1320:12): [True: 38, False: 0]
  |  Branch (1320:35): [True: 38, False: 0]
  ------------------
 1321|     38|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     38|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1322|     38|    }
 1323|       |
 1324|    732|    ctx->index++;
 1325|    732|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    732|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1326|    770|}
ua_types_encoding_json.c:String_decodeJson:
 1346|   436k|DECODE_JSON(String) {
 1347|   436k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|   436k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|   436k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 436k]
  |  |  ------------------
  |  | 1038|   436k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|   436k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 436k]
  |  |  ------------------
  ------------------
 1348|   436k|    CHECK_STRING;
  ------------------
  |  | 1051|   436k|#define CHECK_STRING do {                                \
  |  | 1052|   436k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1052:8): [True: 106, False: 436k]
  |  |  ------------------
  |  | 1053|    106|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|    106|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1054|   436k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1054:14): [Folded, False: 436k]
  |  |  ------------------
  ------------------
 1349|   436k|    GET_TOKEN;
  ------------------
  |  | 1032|   436k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|   436k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|   436k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 436k]
  |  |  ------------------
  ------------------
 1350|   436k|    (void)tokenData;
 1351|       |
 1352|       |    /* Empty string? */
 1353|   436k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1353:8): [True: 967, False: 435k]
  ------------------
 1354|    967|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|    967|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1355|    967|        dst->length = 0;
 1356|    967|        ctx->index++;
 1357|    967|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    967|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1358|    967|    }
 1359|       |
 1360|       |    /* The decoded utf8 is at most of the same length as the source string */
 1361|   435k|    char *outBuf = (char*)UA_malloc(tokenSize+1);
  ------------------
  |  |  350|   435k|# define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 1362|   435k|    if(!outBuf)
  ------------------
  |  Branch (1362:8): [True: 14, False: 435k]
  ------------------
 1363|     14|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|     14|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1364|       |
 1365|       |    /* Decode the string */
 1366|   435k|    cj5_result r;
 1367|   435k|    r.tokens = ctx->tokens;
 1368|   435k|    r.num_tokens = (unsigned int)ctx->tokensSize;
 1369|   435k|    r.json5 = ctx->json5;
 1370|   435k|    unsigned int len = 0;
 1371|   435k|    cj5_error_code err = cj5_get_str(&r, (unsigned int)ctx->index, outBuf, &len);
 1372|   435k|    if(err != CJ5_ERROR_NONE) {
  ------------------
  |  Branch (1372:8): [True: 182, False: 435k]
  ------------------
 1373|    182|        UA_free(outBuf);
  ------------------
  |  |  351|    182|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1374|    182|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    182|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1375|    182|    }
 1376|       |
 1377|       |    /* Set the output */
 1378|   435k|    dst->length = len;
 1379|   435k|    if(dst->length > 0) {
  ------------------
  |  Branch (1379:8): [True: 435k, False: 0]
  ------------------
 1380|   435k|        dst->data = (UA_Byte*)outBuf;
 1381|   435k|    } else {
 1382|      0|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|      0|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1383|      0|        UA_free(outBuf);
  ------------------
  |  |  351|      0|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1384|      0|    }
 1385|       |
 1386|   435k|    ctx->index++;
 1387|   435k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   435k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1388|   435k|}
ua_types_encoding_json.c:DateTime_decodeJson:
 1489|    559|DECODE_JSON(DateTime) {
 1490|    559|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|    559|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|    559|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 559]
  |  |  ------------------
  |  | 1038|    559|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|    559|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 559]
  |  |  ------------------
  ------------------
 1491|    559|    CHECK_STRING;
  ------------------
  |  | 1051|    559|#define CHECK_STRING do {                                \
  |  | 1052|    559|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1052:8): [True: 16, False: 543]
  |  |  ------------------
  |  | 1053|     16|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     16|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1054|    543|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1054:14): [Folded, False: 543]
  |  |  ------------------
  ------------------
 1492|    543|    GET_TOKEN;
  ------------------
  |  | 1032|    543|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|    543|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|    543|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 543]
  |  |  ------------------
  ------------------
 1493|       |
 1494|       |    /* The last character has to be 'Z'. We can omit some length checks later on
 1495|       |     * because we know the atoi functions stop before the 'Z'. */
 1496|    543|    if(tokenSize == 0 || tokenData[tokenSize-1] != 'Z')
  ------------------
  |  Branch (1496:8): [True: 3, False: 540]
  |  Branch (1496:26): [True: 21, False: 519]
  ------------------
 1497|     24|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     24|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1498|       |
 1499|    519|    struct musl_tm dts;
 1500|    519|    memset(&dts, 0, sizeof(dts));
 1501|       |
 1502|    519|    size_t pos = 0;
 1503|    519|    size_t len;
 1504|       |
 1505|       |    /* Parse the year. The ISO standard asks for four digits. But we accept up
 1506|       |     * to five with an optional plus or minus in front due to the range of the
 1507|       |     * DateTime 64bit integer. But in that case we require the year and the
 1508|       |     * month to be separated by a '-'. Otherwise we cannot know where the month
 1509|       |     * starts. */
 1510|    519|    if(tokenData[0] == '-' || tokenData[0] == '+')
  ------------------
  |  Branch (1510:8): [True: 37, False: 482]
  |  Branch (1510:31): [True: 4, False: 478]
  ------------------
 1511|     41|        pos++;
 1512|    519|    UA_Int64 year = 0;
 1513|    519|    len = parseInt64(&tokenData[pos], 5, &year);
 1514|    519|    pos += len;
 1515|    519|    if(len != 4 && tokenData[pos] != '-')
  ------------------
  |  Branch (1515:8): [True: 364, False: 155]
  |  Branch (1515:20): [True: 66, False: 298]
  ------------------
 1516|     66|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     66|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1517|    453|    if(tokenData[0] == '-')
  ------------------
  |  Branch (1517:8): [True: 26, False: 427]
  ------------------
 1518|     26|        year = -year;
 1519|    453|    dts.tm_year = (UA_Int16)year - 1900;
 1520|    453|    if(tokenData[pos] == '-')
  ------------------
  |  Branch (1520:8): [True: 445, False: 8]
  ------------------
 1521|    445|        pos++;
 1522|       |
 1523|       |    /* Parse the month */
 1524|    453|    UA_UInt64 month = 0;
 1525|    453|    len = parseUInt64(&tokenData[pos], 2, &month);
 1526|    453|    pos += len;
 1527|    453|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|    453|    do {                                                                                 \
  |  |  173|    453|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|    453|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 18, False: 435]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|     18|            EVAL_ON_ERROR;                                                               \
  |  |  175|     18|        }                                                                                \
  |  |  176|    453|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 435]
  |  |  ------------------
  ------------------
 1528|    435|    dts.tm_mon = (UA_UInt16)month - 1;
 1529|    435|    if(tokenData[pos] == '-')
  ------------------
  |  Branch (1529:8): [True: 1, False: 434]
  ------------------
 1530|      1|        pos++;
 1531|       |
 1532|       |    /* Parse the day and check the T between date and time */
 1533|    435|    UA_UInt64 day = 0;
 1534|    435|    len = parseUInt64(&tokenData[pos], 2, &day);
 1535|    435|    pos += len;
 1536|    435|    UA_CHECK(len == 2 || tokenData[pos] != 'T',
  ------------------
  |  |  172|    435|    do {                                                                                 \
  |  |  173|    435|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|    804|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 1, False: 434]
  |  |  |  |  |  Branch (591:43): [True: 66, False: 369]
  |  |  |  |  |  Branch (591:43): [True: 368, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      1|            EVAL_ON_ERROR;                                                               \
  |  |  175|      1|        }                                                                                \
  |  |  176|    435|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 434]
  |  |  ------------------
  ------------------
 1537|    435|             return UA_STATUSCODE_BADDECODINGERROR);
 1538|    434|    dts.tm_mday = (UA_UInt16)day;
 1539|    434|    pos++;
 1540|       |
 1541|       |    /* Parse the hour */
 1542|    434|    UA_UInt64 hour = 0;
 1543|    434|    len = parseUInt64(&tokenData[pos], 2, &hour);
 1544|    434|    pos += len;
 1545|    434|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|    434|    do {                                                                                 \
  |  |  173|    434|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|    434|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 20, False: 414]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|     20|            EVAL_ON_ERROR;                                                               \
  |  |  175|     20|        }                                                                                \
  |  |  176|    434|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 414]
  |  |  ------------------
  ------------------
 1546|    414|    dts.tm_hour = (UA_UInt16)hour;
 1547|    414|    if(tokenData[pos] == ':')
  ------------------
  |  Branch (1547:8): [True: 1, False: 413]
  ------------------
 1548|      1|        pos++;
 1549|       |
 1550|       |    /* Parse the minute */
 1551|    414|    UA_UInt64 min = 0;
 1552|    414|    len = parseUInt64(&tokenData[pos], 2, &min);
 1553|    414|    pos += len;
 1554|    414|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|    414|    do {                                                                                 \
  |  |  173|    414|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|    414|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 10, False: 404]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|     10|            EVAL_ON_ERROR;                                                               \
  |  |  175|     10|        }                                                                                \
  |  |  176|    414|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 404]
  |  |  ------------------
  ------------------
 1555|    404|    dts.tm_min = (UA_UInt16)min;
 1556|    404|    if(tokenData[pos] == ':')
  ------------------
  |  Branch (1556:8): [True: 1, False: 403]
  ------------------
 1557|      1|        pos++;
 1558|       |
 1559|       |    /* Parse the second */
 1560|    404|    UA_UInt64 sec = 0;
 1561|    404|    len = parseUInt64(&tokenData[pos], 2, &sec);
 1562|    404|    pos += len;
 1563|    404|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|    404|    do {                                                                                 \
  |  |  173|    404|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|    404|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 5, False: 399]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      5|            EVAL_ON_ERROR;                                                               \
  |  |  175|      5|        }                                                                                \
  |  |  176|    404|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 399]
  |  |  ------------------
  ------------------
 1564|    399|    dts.tm_sec = (UA_UInt16)sec;
 1565|       |
 1566|       |    /* Compute the seconds since the Unix epoch */
 1567|    399|    long long sinceunix = musl_tm_to_secs(&dts);
 1568|       |
 1569|       |    /* Are we within the range that can be represented? */
 1570|    399|    long long sinceunix_min =
 1571|    399|        (long long)(UA_INT64_MIN / UA_DATETIME_SEC) -
  ------------------
  |  |  119|    399|#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
  |  |  ------------------
  |  |  |  |  118|    399|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  |  |  ------------------
  ------------------
                      (long long)(UA_INT64_MIN / UA_DATETIME_SEC) -
  ------------------
  |  |  285|    399|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    399|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    399|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1572|    399|        (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC) -
  ------------------
  |  |  327|    399|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|    399|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|    399|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|    399|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC) -
  ------------------
  |  |  285|    399|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    399|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    399|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1573|    399|        (long long)1; /* manual correction due to rounding */
 1574|    399|    long long sinceunix_max = (long long)
 1575|    399|        ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  118|    399|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  ------------------
                      ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  327|    399|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|    399|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|    399|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|    399|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  285|    399|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    399|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    399|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1576|    399|    if(sinceunix < sinceunix_min || sinceunix > sinceunix_max)
  ------------------
  |  Branch (1576:8): [True: 27, False: 372]
  |  Branch (1576:37): [True: 6, False: 366]
  ------------------
 1577|     33|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     33|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1578|       |
 1579|       |    /* Convert to DateTime. Add or subtract one extra second here to prevent
 1580|       |     * underflow/overflow. This is reverted once the fractional part has been
 1581|       |     * added. */
 1582|    366|    sinceunix -= (sinceunix > 0) ? 1 : -1;
  ------------------
  |  Branch (1582:18): [True: 144, False: 222]
  ------------------
 1583|    366|    UA_DateTime dt = (UA_DateTime)
 1584|    366|        (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  327|    366|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|    366|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|    366|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|    366|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  285|    366|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    366|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    366|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  285|    366|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    366|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    366|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1585|       |
 1586|       |    /* Parse the fraction of the second if defined */
 1587|    366|    if(tokenData[pos] == ',' || tokenData[pos] == '.') {
  ------------------
  |  Branch (1587:8): [True: 20, False: 346]
  |  Branch (1587:33): [True: 38, False: 308]
  ------------------
 1588|     58|        pos++;
 1589|     58|        double frac = 0.0;
 1590|     58|        double denom = 0.1;
 1591|   530k|        while(pos < tokenSize &&
  ------------------
  |  Branch (1591:15): [True: 530k, False: 0]
  ------------------
 1592|   530k|              tokenData[pos] >= '0' && tokenData[pos] <= '9') {
  ------------------
  |  Branch (1592:15): [True: 530k, False: 28]
  |  Branch (1592:40): [True: 530k, False: 30]
  ------------------
 1593|   530k|            frac += denom * (tokenData[pos] - '0');
 1594|   530k|            denom *= 0.1;
 1595|   530k|            pos++;
 1596|   530k|        }
 1597|     58|        frac += 0.00000005; /* Correct rounding when converting to integer */
 1598|     58|        dt += (UA_DateTime)(frac * UA_DATETIME_SEC);
  ------------------
  |  |  285|     58|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|     58|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|     58|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1599|     58|    }
 1600|       |
 1601|       |    /* Remove the underflow/overflow protection (see above) */
 1602|    366|    if(sinceunix > 0) {
  ------------------
  |  Branch (1602:8): [True: 144, False: 222]
  ------------------
 1603|    144|        if(dt > UA_INT64_MAX - UA_DATETIME_SEC)
  ------------------
  |  |  118|    144|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  ------------------
                      if(dt > UA_INT64_MAX - UA_DATETIME_SEC)
  ------------------
  |  |  285|    144|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    144|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    144|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1603:12): [True: 0, False: 144]
  ------------------
 1604|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1605|    144|        dt += UA_DATETIME_SEC;
  ------------------
  |  |  285|    144|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    144|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    144|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1606|    222|    } else {
 1607|    222|        if(dt < UA_INT64_MIN + UA_DATETIME_SEC)
  ------------------
  |  |  119|    222|#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
  |  |  ------------------
  |  |  |  |  118|    222|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  |  |  ------------------
  ------------------
                      if(dt < UA_INT64_MIN + UA_DATETIME_SEC)
  ------------------
  |  |  285|    222|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    222|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    222|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1607:12): [True: 1, False: 221]
  ------------------
 1608|      1|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1609|    221|        dt -= UA_DATETIME_SEC;
  ------------------
  |  |  285|    221|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    221|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    221|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1610|    221|    }
 1611|       |
 1612|       |    /* We must be at the end of the string (ending with 'Z' as checked above) */
 1613|    365|    if(pos != tokenSize - 1)
  ------------------
  |  Branch (1613:8): [True: 56, False: 309]
  ------------------
 1614|     56|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     56|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1615|       |
 1616|    309|    *dst = dt;
 1617|       |
 1618|    309|    ctx->index++;
 1619|    309|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    309|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1620|    365|}
ua_types_encoding_json.c:Guid_decodeJson:
 1335|     74|DECODE_JSON(Guid) {
 1336|     74|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|     74|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|     74|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 74]
  |  |  ------------------
  |  | 1038|     74|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|     74|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 74]
  |  |  ------------------
  ------------------
 1337|     74|    CHECK_STRING;
  ------------------
  |  | 1051|     74|#define CHECK_STRING do {                                \
  |  | 1052|     74|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1052:8): [True: 6, False: 68]
  |  |  ------------------
  |  | 1053|      6|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1054|     68|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1054:14): [Folded, False: 68]
  |  |  ------------------
  ------------------
 1338|     68|    GET_TOKEN;
  ------------------
  |  | 1032|     68|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|     68|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|     68|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 68]
  |  |  ------------------
  ------------------
 1339|       |
 1340|       |    /* Use the existing parsing routine if available */
 1341|     68|    UA_String str = {tokenSize, (UA_Byte*)(uintptr_t)tokenData};
 1342|     68|    ctx->index++;
 1343|     68|    return UA_Guid_parse(dst, str);
 1344|     74|}
ua_types_encoding_json.c:ByteString_decodeJson:
 1390|  1.38k|DECODE_JSON(ByteString) {
 1391|  1.38k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  1.38k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  1.38k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 1.38k]
  |  |  ------------------
  |  | 1038|  1.38k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  1.38k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 1.38k]
  |  |  ------------------
  ------------------
 1392|  1.38k|    CHECK_STRING;
  ------------------
  |  | 1051|  1.38k|#define CHECK_STRING do {                                \
  |  | 1052|  1.38k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1052:8): [True: 11, False: 1.37k]
  |  |  ------------------
  |  | 1053|     11|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     11|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1054|  1.37k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1054:14): [Folded, False: 1.37k]
  |  |  ------------------
  ------------------
 1393|  1.37k|    GET_TOKEN;
  ------------------
  |  | 1032|  1.37k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|  1.37k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|  1.37k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 1.37k]
  |  |  ------------------
  ------------------
 1394|       |
 1395|       |    /* Empty bytestring? */
 1396|  1.37k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1396:8): [True: 243, False: 1.13k]
  ------------------
 1397|    243|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|    243|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1398|    243|        dst->length = 0;
 1399|  1.13k|    } else {
 1400|  1.13k|        size_t flen = 0;
 1401|  1.13k|        unsigned char* unB64 =
 1402|  1.13k|            UA_unbase64((const unsigned char*)tokenData, tokenSize, &flen);
 1403|  1.13k|        if(unB64 == 0)
  ------------------
  |  Branch (1403:12): [True: 69, False: 1.06k]
  ------------------
 1404|     69|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     69|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1405|  1.06k|        dst->data = (u8*)unB64;
 1406|  1.06k|        dst->length = flen;
 1407|  1.06k|    }
 1408|       |
 1409|  1.30k|    ctx->index++;
 1410|  1.30k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.30k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1411|  1.37k|}
ua_types_encoding_json.c:NodeId_decodeJson:
 1468|   315k|DECODE_JSON(NodeId) {
 1469|   315k|    UA_String str;
 1470|   315k|    UA_String_init(&str);
 1471|   315k|    status res = String_decodeJson(ctx, &str, NULL);
 1472|   315k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|   315k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1472:8): [True: 315k, False: 74]
  ------------------
 1473|   315k|        res = UA_NodeId_parseEx(dst, str, ctx->namespaceMapping);
 1474|   315k|    UA_String_clear(&str);
 1475|   315k|    return res;
 1476|   315k|}
ua_types_encoding_json.c:ExpandedNodeId_decodeJson:
 1478|  4.94k|DECODE_JSON(ExpandedNodeId) {
 1479|  4.94k|    UA_String str;
 1480|  4.94k|    UA_String_init(&str);
 1481|  4.94k|    status res = String_decodeJson(ctx, &str, NULL);
 1482|  4.94k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  4.94k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1482:8): [True: 4.92k, False: 20]
  ------------------
 1483|  4.92k|        res = UA_ExpandedNodeId_parseEx(dst, str, ctx->namespaceMapping,
 1484|  4.92k|                                        ctx->serverUrisSize, ctx->serverUris);
 1485|  4.94k|    UA_String_clear(&str);
 1486|  4.94k|    return res;
 1487|  4.94k|}
ua_types_encoding_json.c:StatusCode_decodeJson:
 1622|    232|DECODE_JSON(StatusCode) {
 1623|    232|    CHECK_OBJECT;
  ------------------
  |  | 1056|    232|#define CHECK_OBJECT do {                                \
  |  | 1057|    232|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1057:8): [True: 12, False: 220]
  |  |  ------------------
  |  | 1058|     12|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     12|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1059|    220|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1059:14): [Folded, False: 220]
  |  |  ------------------
  ------------------
 1624|    220|    DecodeEntry entries[2] = {
 1625|    220|        {UA_JSONKEY_CODE, dst, NULL, false, &UA_TYPES[UA_TYPES_UINT32]},
  ------------------
  |  |  225|    220|#define UA_TYPES_UINT32 6
  ------------------
 1626|    220|        {UA_JSONKEY_SYMBOL, NULL, NULL, false, NULL}
 1627|    220|    };
 1628|    220|    return decodeFields(ctx, entries, 2);
 1629|    232|}
ua_types_encoding_json.c:QualifiedName_decodeJson:
 1424|  28.2k|DECODE_JSON(QualifiedName) {
 1425|  28.2k|    UA_String str;
 1426|  28.2k|    UA_String_init(&str);
 1427|  28.2k|    status res = String_decodeJson(ctx, &str, NULL);
 1428|  28.2k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  28.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1428:8): [True: 28.1k, False: 88]
  ------------------
 1429|  28.1k|        res = UA_QualifiedName_parseEx(dst, str, ctx->namespaceMapping);
 1430|  28.2k|    UA_String_clear(&str);
 1431|  28.2k|    return res;
 1432|  28.2k|}
ua_types_encoding_json.c:LocalizedText_decodeJson:
 1413|    447|DECODE_JSON(LocalizedText) {
 1414|    447|    CHECK_OBJECT;
  ------------------
  |  | 1056|    447|#define CHECK_OBJECT do {                                \
  |  | 1057|    447|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1057:8): [True: 11, False: 436]
  |  |  ------------------
  |  | 1058|     11|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     11|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1059|    436|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1059:14): [Folded, False: 436]
  |  |  ------------------
  ------------------
 1415|       |
 1416|    436|    DecodeEntry entries[2] = {
 1417|    436|        {UA_JSONKEY_LOCALE, &dst->locale, NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  395|    436|#define UA_TYPES_STRING 11
  ------------------
 1418|    436|        {UA_JSONKEY_TEXT, &dst->text, NULL, false, &UA_TYPES[UA_TYPES_STRING]}
  ------------------
  |  |  395|    436|#define UA_TYPES_STRING 11
  ------------------
 1419|    436|    };
 1420|       |
 1421|    436|    return decodeFields(ctx, entries, 2);
 1422|    447|}
ua_types_encoding_json.c:ExtensionObject_decodeJson:
 2014|   312k|DECODE_JSON(ExtensionObject) {
 2015|   312k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1061|   312k|#define CHECK_NULL_SKIP do {                         \
  |  | 1062|   312k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1062:8): [True: 0, False: 312k]
  |  |  ------------------
  |  | 1063|      0|        ctx->index++;                                \
  |  | 1064|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1065|   312k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1065:14): [Folded, False: 312k]
  |  |  ------------------
  ------------------
 2016|   312k|    CHECK_OBJECT;
  ------------------
  |  | 1056|   312k|#define CHECK_OBJECT do {                                \
  |  | 1057|   312k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1057:8): [True: 55, False: 312k]
  |  |  ------------------
  |  | 1058|     55|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     55|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1059|   312k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1059:14): [Folded, False: 312k]
  |  |  ------------------
  ------------------
 2017|       |
 2018|       |    /* Empty object -> Null ExtensionObject */
 2019|   312k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (2019:8): [True: 342, False: 312k]
  ------------------
 2020|    342|        ctx->index++; /* Skip the empty ExtensionObject */
 2021|    342|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    342|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2022|    342|    }
 2023|       |
 2024|       |    /* Store the index where the ExtensionObject begins */
 2025|   312k|    size_t beginIndex = ctx->index;
 2026|       |
 2027|       |    /* Search for non-JSON encoding */
 2028|   312k|    UA_UInt64 encoding = 0;
 2029|   312k|    size_t encIndex = 0;
 2030|   312k|    status ret = lookAheadForKey(ctx, UA_JSONKEY_ENCODING, &encIndex);
 2031|   312k|    if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|   312k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2031:8): [True: 8.30k, False: 303k]
  ------------------
 2032|  8.30k|        const char *extObjEncoding = &ctx->json5[ctx->tokens[encIndex].start];
 2033|  8.30k|        size_t len = parseUInt64(extObjEncoding, getTokenLength(&ctx->tokens[encIndex]), &encoding);
 2034|  8.30k|        if(len == 0 || encoding > 2)
  ------------------
  |  Branch (2034:12): [True: 2, False: 8.30k]
  |  Branch (2034:24): [True: 128, False: 8.17k]
  ------------------
 2035|    130|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    130|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2036|  8.30k|    }
 2037|       |
 2038|       |    /* Get the type NodeId index */
 2039|   311k|    size_t typeIdIndex = 0;
 2040|   311k|    ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 2041|   311k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|   311k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2041:8): [True: 16, False: 311k]
  ------------------
 2042|     16|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     16|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2043|       |
 2044|       |    /* Decode the type NodeId */
 2045|   311k|    UA_NodeId typeId;
 2046|   311k|    UA_NodeId_init(&typeId);
 2047|   311k|    ctx->index = (UA_UInt16)typeIdIndex;
 2048|   311k|    ret = NodeId_decodeJson(ctx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|   311k|#define UA_TYPES_NODEID 16
  ------------------
 2049|   311k|    ctx->index = beginIndex;
 2050|   311k|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|   311k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2050:8): [True: 153, False: 311k]
  ------------------
 2051|    153|        UA_NodeId_clear(&typeId); /* We don't have the global cleanup */
 2052|    153|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    153|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2053|    153|    }
 2054|       |
 2055|       |    /* Lookup the type */
 2056|   311k|    type = UA_findDataTypeWithCustom(&typeId, ctx->customTypes);
 2057|       |
 2058|       |    /* Unknown body type */
 2059|   311k|    if(!type) {
  ------------------
  |  Branch (2059:8): [True: 45.4k, False: 266k]
  ------------------
 2060|       |        /* FIXME: We need UA_EXTENSIONOBJECT_ENCODED_JSON when we parse an
 2061|       |         * unknown type in JSON. But it is not defined in the standard. */
 2062|  45.4k|        dst->encoding = (encoding != 2) ?
  ------------------
  |  Branch (2062:25): [True: 45.4k, False: 1]
  ------------------
 2063|  45.4k|            UA_EXTENSIONOBJECT_ENCODED_BYTESTRING :
 2064|  45.4k|            UA_EXTENSIONOBJECT_ENCODED_XML;
 2065|  45.4k|        dst->content.encoded.typeId = typeId;
 2066|       |
 2067|       |        /* Get the body field index */
 2068|  45.4k|        size_t bodyIndex = 0;
 2069|  45.4k|        ret = lookAheadForKey(ctx, UA_JSONKEY_BODY, &bodyIndex);
 2070|  45.4k|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  45.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2070:12): [True: 45.2k, False: 230]
  ------------------
 2071|       |            /* Only JSON structures can be encoded in-situ */
 2072|  45.2k|            if(encoding != 0)
  ------------------
  |  Branch (2072:16): [True: 3, False: 45.2k]
  ------------------
 2073|      3|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2074|       |
 2075|       |            /* Extract the entire ExtensionObject object as the body */
 2076|  45.2k|            size_t parentIndex = ctx->index;
 2077|  45.2k|            ret = tokenToByteString(ctx, &dst->content.encoded.body);
 2078|  45.2k|            if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  45.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2078:16): [True: 0, False: 45.2k]
  ------------------
 2079|      0|                return ret;
 2080|       |
 2081|       |            /* Remove the UaEncoding and UaTypeId field from the encoding.
 2082|       |             * Remove the later field first. */
 2083|  45.2k|            if(encIndex != 0 && encIndex > typeIdIndex)
  ------------------
  |  Branch (2083:16): [True: 8.16k, False: 37.0k]
  |  Branch (2083:33): [True: 8.16k, False: 1]
  ------------------
 2084|  8.16k|                removeFieldFromEncoding(ctx, &dst->content.encoded.body, parentIndex, encIndex);
 2085|  45.2k|            removeFieldFromEncoding(ctx, &dst->content.encoded.body, parentIndex, typeIdIndex);
 2086|  45.2k|            if(encIndex != 0 && encIndex < typeIdIndex)
  ------------------
  |  Branch (2086:16): [True: 8.16k, False: 37.0k]
  |  Branch (2086:33): [True: 1, False: 8.16k]
  ------------------
 2087|      1|                removeFieldFromEncoding(ctx, &dst->content.encoded.body, parentIndex, encIndex);
 2088|       |
 2089|  45.2k|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  45.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2090|  45.2k|        }
 2091|       |
 2092|    230|        ctx->index = bodyIndex;
 2093|    230|        if(encoding != 0) {
  ------------------
  |  Branch (2093:12): [True: 1, False: 229]
  ------------------
 2094|       |            /* Decode the body as a ByteString */
 2095|      1|            ret = ByteString_decodeJson(ctx, &dst->content.encoded.body, NULL);
 2096|    229|        } else {
 2097|       |            /* Use the JSON encoding directly */
 2098|    229|            ret = tokenToByteString(ctx, &dst->content.encoded.body);
 2099|    229|        }
 2100|    230|        ctx->index = beginIndex;
 2101|    230|        skipObject(ctx);
 2102|    230|        return ret;
 2103|  45.4k|    }
 2104|       |
 2105|       |    /* No need to keep the TypeId */
 2106|   266k|    UA_NodeId_clear(&typeId);
 2107|       |
 2108|       |    /* Allocate memory for the decoded data */
 2109|   266k|    dst->content.decoded.data = UA_new(type);
 2110|   266k|    if(!dst->content.decoded.data)
  ------------------
  |  Branch (2110:8): [True: 58, False: 266k]
  ------------------
 2111|     58|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|     58|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2112|   266k|    dst->content.decoded.type = type;
 2113|   266k|    dst->encoding = UA_EXTENSIONOBJECT_DECODED;
 2114|       |
 2115|       |    /* Get the body field index */
 2116|   266k|    size_t bodyIndex = ctx->index;
 2117|   266k|    ret = lookAheadForKey(ctx, UA_JSONKEY_BODY, &bodyIndex); /* Can fail */
 2118|   266k|    if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|   266k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2118:8): [True: 59, False: 266k]
  ------------------
 2119|     59|        ctx->index = bodyIndex;
 2120|     59|        ret = decodeJsonJumpTable[type->typeKind](ctx, dst->content.decoded.data, type);
 2121|     59|        ctx->index = beginIndex;
 2122|     59|        skipObject(ctx);
 2123|     59|        return ret;
 2124|     59|    }
 2125|       |
 2126|   266k|    return decodeJsonJumpTable[type->typeKind](ctx, dst->content.decoded.data, type);
 2127|   266k|}
ua_types_encoding_json.c:tokenToByteString:
 1947|  45.4k|tokenToByteString(ParseCtx *ctx, UA_ByteString *p) {
 1948|  45.4k|    GET_TOKEN;
  ------------------
  |  | 1032|  45.4k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|  45.4k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|  45.4k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 45.4k]
  |  |  ------------------
  ------------------
 1949|  45.4k|    UA_StatusCode res = UA_ByteString_allocBuffer(p, tokenSize);
 1950|  45.4k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  45.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1950:8): [True: 0, False: 45.4k]
  ------------------
 1951|      0|        return res;
 1952|  45.4k|    memcpy(p->data, tokenData, tokenSize);
 1953|  45.4k|    skipObject(ctx);
 1954|  45.4k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  45.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1955|  45.4k|}
ua_types_encoding_json.c:removeFieldFromEncoding:
 1963|  53.4k|                        size_t parentIndex, size_t tokenIndex) {
 1964|       |    /* Which part of the encoding to cut out */
 1965|  53.4k|    unsigned objStart = ctx->tokens[parentIndex].start;
 1966|  53.4k|    unsigned objEnd = ctx->tokens[parentIndex].end;
 1967|  53.4k|    unsigned start = ctx->tokens[tokenIndex-1].start;
 1968|  53.4k|    unsigned end = ctx->tokens[tokenIndex].end + 1; /* One char after */
 1969|       |
 1970|  53.4k|    UA_Boolean haveBefore = (parentIndex < tokenIndex - 2);
 1971|  53.4k|    if(haveBefore) {
  ------------------
  |  Branch (1971:8): [True: 32.0k, False: 21.3k]
  ------------------
 1972|       |        /* Find where the previous token ended. This also removes the comma
 1973|       |         * between the previous and the current element. */
 1974|   229k|        for(size_t i = parentIndex + 2; i < tokenIndex - 1; i++) {
  ------------------
  |  Branch (1974:41): [True: 197k, False: 32.0k]
  ------------------
 1975|   197k|            if(ctx->tokens[i].end + 1 > start)
  ------------------
  |  Branch (1975:16): [True: 0, False: 197k]
  ------------------
 1976|      0|                start = ctx->tokens[i].end + 1;
 1977|   197k|        }
 1978|  32.0k|        if(ctx->json5[start] == '"' || ctx->json5[start] == '\'')
  ------------------
  |  Branch (1978:12): [True: 0, False: 32.0k]
  |  Branch (1978:40): [True: 0, False: 32.0k]
  ------------------
 1979|      0|            start++;
 1980|  32.0k|    } else {
 1981|       |        /* No previous element. Remove the quoation marks of the field name. */
 1982|  21.3k|        start = ctx->tokens[tokenIndex-1].start;
 1983|  21.3k|        if(start > 0 && (ctx->json5[start-1] == '"' || ctx->json5[start-1] == '\''))
  ------------------
  |  Branch (1983:12): [True: 21.3k, False: 0]
  |  Branch (1983:26): [True: 0, False: 21.3k]
  |  Branch (1983:56): [True: 0, False: 21.3k]
  ------------------
 1984|      0|            start--;
 1985|       |
 1986|       |        /* Find the beginning of the next field in the object.
 1987|       |         * This removes the comma after the current field. */
 1988|  21.3k|        size_t oldIndex = ctx->index;
 1989|  21.3k|        ctx->index = tokenIndex;
 1990|  21.3k|        skipObject(ctx);
 1991|  21.3k|        if(ctx->index < ctx->tokensSize && ctx->tokens[ctx->index].start < objEnd) {
  ------------------
  |  Branch (1991:12): [True: 21.3k, False: 0]
  |  Branch (1991:44): [True: 12.4k, False: 8.97k]
  ------------------
 1992|  12.4k|            end = ctx->tokens[ctx->index].start;
 1993|  12.4k|            if(ctx->json5[end-1] == '"' || ctx->json5[end-1] == '\'')
  ------------------
  |  Branch (1993:16): [True: 282, False: 12.1k]
  |  Branch (1993:44): [True: 0, False: 12.1k]
  ------------------
 1994|    282|                end--;
 1995|  12.4k|        }
 1996|  21.3k|        ctx->index = oldIndex;
 1997|  21.3k|    }
 1998|       |
 1999|  53.4k|    UA_assert(end > start);
  ------------------
  |  |  411|  53.4k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1999:5): [True: 53.4k, False: 0]
  ------------------
 2000|  53.4k|    UA_assert(start > objStart);
  ------------------
  |  |  411|  53.4k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2000:5): [True: 53.4k, False: 0]
  ------------------
 2001|       |
 2002|       |    /* Move the offset from ctx->json5 to encoding->data */
 2003|  53.4k|    start -= objStart;
 2004|  53.4k|    end -= objStart;
 2005|       |
 2006|  53.4k|    UA_assert(end <= encoding->length);
  ------------------
  |  |  411|  53.4k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2006:5): [True: 53.4k, False: 0]
  ------------------
 2007|       |
 2008|       |    /* Cut out the field we want to remove */
 2009|  53.4k|    size_t after_len = encoding->length - end;
 2010|  53.4k|    memmove(encoding->data + start, encoding->data + end, after_len);
 2011|  53.4k|    encoding->length -= (end - start);
 2012|  53.4k|}
ua_types_encoding_json.c:DataValue_decodeJson:
 1912|  87.5k|DECODE_JSON(DataValue) {
 1913|  87.5k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1061|  87.5k|#define CHECK_NULL_SKIP do {                         \
  |  | 1062|  87.5k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1062:8): [True: 12.3k, False: 75.2k]
  |  |  ------------------
  |  | 1063|  12.3k|        ctx->index++;                                \
  |  | 1064|  12.3k|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|  12.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1065|  75.2k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1065:14): [Folded, False: 75.2k]
  |  |  ------------------
  ------------------
 1914|  75.2k|    CHECK_OBJECT;
  ------------------
  |  | 1056|  75.2k|#define CHECK_OBJECT do {                                \
  |  | 1057|  75.2k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1057:8): [True: 69, False: 75.1k]
  |  |  ------------------
  |  | 1058|     69|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     69|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1059|  75.1k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1059:14): [Folded, False: 75.1k]
  |  |  ------------------
  ------------------
 1915|       |
 1916|       |    /* Decode the Variant in-situ */
 1917|  75.1k|    size_t beginIndex = ctx->index;
 1918|  75.1k|    status ret = decodeJSONVariant(ctx, &dst->value);
 1919|  75.1k|    ctx->index = beginIndex;
 1920|  75.1k|    dst->hasValue = (dst->value.type != NULL);
 1921|  75.1k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  75.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1921:8): [True: 3.02k, False: 72.1k]
  ------------------
 1922|  3.02k|        return ret;
 1923|       |
 1924|       |    /* Decode the other members (skip the Variant members) */
 1925|  72.1k|    DecodeEntry entries[8] = {
 1926|  72.1k|        {UA_JSONKEY_TYPE, NULL, NULL, false, NULL},
 1927|  72.1k|        {UA_JSONKEY_VALUE, NULL, NULL, false, NULL},
 1928|  72.1k|        {UA_JSONKEY_DIMENSIONS, NULL, NULL, false, NULL},
 1929|  72.1k|        {UA_JSONKEY_STATUS, &dst->status, NULL, false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  633|  72.1k|#define UA_TYPES_STATUSCODE 18
  ------------------
 1930|  72.1k|        {UA_JSONKEY_SOURCETIMESTAMP, &dst->sourceTimestamp, NULL, false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  429|  72.1k|#define UA_TYPES_DATETIME 12
  ------------------
 1931|  72.1k|        {UA_JSONKEY_SOURCEPICOSECONDS, &dst->sourcePicoseconds, NULL, false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  157|  72.1k|#define UA_TYPES_UINT16 4
  ------------------
 1932|  72.1k|        {UA_JSONKEY_SERVERTIMESTAMP, &dst->serverTimestamp, NULL, false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  429|  72.1k|#define UA_TYPES_DATETIME 12
  ------------------
 1933|  72.1k|        {UA_JSONKEY_SERVERPICOSECONDS, &dst->serverPicoseconds, NULL, false, &UA_TYPES[UA_TYPES_UINT16]}
  ------------------
  |  |  157|  72.1k|#define UA_TYPES_UINT16 4
  ------------------
 1934|  72.1k|    };
 1935|       |
 1936|  72.1k|    ret = decodeFields(ctx, entries, 8);
 1937|  72.1k|    dst->hasStatus = entries[3].found;
 1938|  72.1k|    dst->hasSourceTimestamp = entries[4].found;
 1939|  72.1k|    dst->hasSourcePicoseconds = entries[5].found;
 1940|  72.1k|    dst->hasServerTimestamp = entries[6].found;
 1941|  72.1k|    dst->hasServerPicoseconds = entries[7].found;
 1942|  72.1k|    return ret;
 1943|  75.1k|}
ua_types_encoding_json.c:decodeJSONVariant:
 1784|  75.9k|decodeJSONVariant(ParseCtx *ctx, UA_Variant *dst) {
 1785|       |    /* Empty variant == null */
 1786|  75.9k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (1786:8): [True: 1.97k, False: 73.9k]
  ------------------
 1787|  1.97k|        ctx->index++;
 1788|  1.97k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.97k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1789|  1.97k|    }
 1790|       |
 1791|       |    /* Search the value field */
 1792|  73.9k|    size_t valueIndex = 0;
 1793|  73.9k|    lookAheadForKey(ctx, UA_JSONKEY_VALUE, &valueIndex);
 1794|       |
 1795|       |    /* Search for the dimensions field */
 1796|  73.9k|    size_t dimIndex = 0;
 1797|  73.9k|    lookAheadForKey(ctx, UA_JSONKEY_DIMENSIONS, &dimIndex);
 1798|       |
 1799|       |    /* Parse the type kind */
 1800|  73.9k|    size_t typeIndex = 0;
 1801|  73.9k|    lookAheadForKey(ctx, UA_JSONKEY_TYPE, &typeIndex);
 1802|  73.9k|    if(typeIndex == 0 || ctx->tokens[typeIndex].type != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1802:8): [True: 54, False: 73.9k]
  |  Branch (1802:26): [True: 3, False: 73.9k]
  ------------------
 1803|     57|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     57|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1804|  73.9k|    UA_UInt64 typeKind = 0;
 1805|  73.9k|    size_t len = parseUInt64(&ctx->json5[ctx->tokens[typeIndex].start],
 1806|  73.9k|                             getTokenLength(&ctx->tokens[typeIndex]), &typeKind);
 1807|  73.9k|    if(len == 0)
  ------------------
  |  Branch (1807:8): [True: 12, False: 73.9k]
  ------------------
 1808|     12|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     12|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1809|       |
 1810|       |    /* Shift to get the datatype index. The type must be a builtin data type.
 1811|       |     * All not-builtin types are wrapped in an ExtensionObject. */
 1812|  73.9k|    typeKind--;
 1813|  73.9k|    if(typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (1813:8): [True: 139, False: 73.7k]
  ------------------
 1814|    139|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    139|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1815|  73.7k|    const UA_DataType *type = &UA_TYPES[typeKind];
 1816|       |
 1817|       |    /* Value is an array? */
 1818|  73.7k|    UA_Boolean isArray =
 1819|  73.7k|        (valueIndex > 0 && ctx->tokens[valueIndex].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  Branch (1819:10): [True: 38.8k, False: 34.9k]
  |  Branch (1819:28): [True: 1.53k, False: 37.2k]
  ------------------
 1820|       |
 1821|       |    /* Adjust the depth and set the value index as current */
 1822|  73.7k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|  73.7k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (1822:8): [True: 0, False: 73.7k]
  ------------------
 1823|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1824|  73.7k|    size_t beginIndex = ctx->index;
 1825|  73.7k|    ctx->index = valueIndex;
 1826|  73.7k|    ctx->depth++;
 1827|       |
 1828|       |    /* Decode the value */
 1829|  73.7k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  73.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1830|  73.7k|    if(!isArray) {
  ------------------
  |  Branch (1830:8): [True: 72.2k, False: 1.53k]
  ------------------
 1831|       |        /* Scalar with dimensions -> error */
 1832|  72.2k|        if(dimIndex > 0) {
  ------------------
  |  Branch (1832:12): [True: 17, False: 72.2k]
  ------------------
 1833|     17|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     17|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1834|     17|            goto out;
 1835|     17|        }
 1836|       |
 1837|       |        /* A variant cannot contain a variant. But it can contain an array of
 1838|       |         * variants */
 1839|  72.2k|        if(type->typeKind == UA_DATATYPEKIND_VARIANT) {
  ------------------
  |  Branch (1839:12): [True: 1, False: 72.2k]
  ------------------
 1840|      1|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1841|      1|            goto out;
 1842|      1|        }
 1843|       |
 1844|       |        /* Decode a value wrapped in an ExtensionObject */
 1845|  72.2k|        if(valueIndex > 0 && type->typeKind == UA_DATATYPEKIND_EXTENSIONOBJECT) {
  ------------------
  |  Branch (1845:12): [True: 37.2k, False: 34.9k]
  |  Branch (1845:30): [True: 636, False: 36.6k]
  ------------------
 1846|    636|            res = Variant_decodeJsonUnwrapExtensionObject(ctx, dst, NULL);
 1847|    636|            goto out;
 1848|    636|        }
 1849|       |
 1850|       |        /* Allocate memory for the value */
 1851|  71.5k|        dst->data = UA_new(type);
 1852|  71.5k|        if(!dst->data) {
  ------------------
  |  Branch (1852:12): [True: 2, False: 71.5k]
  ------------------
 1853|      2|            res = UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      2|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1854|      2|            goto out;
 1855|      2|        }
 1856|  71.5k|        dst->type = type;
 1857|       |
 1858|       |        /* Decode the value */
 1859|  71.5k|        if(valueIndex > 0 && ctx->tokens[valueIndex].type != CJ5_TOKEN_NULL)
  ------------------
  |  Branch (1859:12): [True: 36.6k, False: 34.9k]
  |  Branch (1859:30): [True: 36.3k, False: 270]
  ------------------
 1860|  36.3k|            res = decodeJsonJumpTable[type->typeKind](ctx, dst->data, type);
 1861|  71.5k|    } else {
 1862|       |        /* Decode an array. Try to unwrap ExtensionObjects in the array. The
 1863|       |         * members must all have the same type. */
 1864|  1.53k|        const UA_DataType *unwrapType = NULL;
 1865|  1.53k|        if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  735|  1.53k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (1865:12): [True: 514, False: 1.02k]
  ------------------
 1866|    514|            unwrapType = getArrayUnwrapType(ctx);
 1867|  1.53k|        if(unwrapType) {
  ------------------
  |  Branch (1867:12): [True: 50, False: 1.48k]
  ------------------
 1868|     50|            dst->type = unwrapType;
 1869|     50|            res = Array_decodeJsonUnwrapExtensionObject(ctx, &dst->data, unwrapType);
 1870|  1.48k|        } else {
 1871|  1.48k|            dst->type = type;
 1872|  1.48k|            res = Array_decodeJson(ctx, &dst->data, type);
 1873|  1.48k|        }
 1874|       |
 1875|       |        /* Decode array dimensions */
 1876|  1.53k|        if(dimIndex > 0) {
  ------------------
  |  Branch (1876:12): [True: 182, False: 1.35k]
  ------------------
 1877|    182|            ctx->index = dimIndex;
 1878|    182|            res |= Array_decodeJson(ctx, (void**)&dst->arrayDimensions, &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  225|    182|#define UA_TYPES_UINT32 6
  ------------------
 1879|       |
 1880|       |            /* Help clang-analyzer */
 1881|    182|            UA_assert(dst->arrayDimensionsSize == 0 || dst->arrayDimensions);
  ------------------
  |  |  411|    182|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1881:13): [True: 54, False: 128]
  |  Branch (1881:13): [True: 128, False: 0]
  ------------------
 1882|       |
 1883|       |            /* Validate the dimensions */
 1884|    182|            size_t total = 1;
 1885|   724k|            for(size_t i = 0; i < dst->arrayDimensionsSize; i++)
  ------------------
  |  Branch (1885:31): [True: 724k, False: 182]
  ------------------
 1886|   724k|                total *= dst->arrayDimensions[i];
 1887|    182|            if(total != dst->arrayLength)
  ------------------
  |  Branch (1887:16): [True: 147, False: 35]
  ------------------
 1888|    147|                res |= UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    147|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1889|       |
 1890|       |            /* Only keep >= 2 dimensions */
 1891|    182|            if(dst->arrayDimensionsSize == 1) {
  ------------------
  |  Branch (1891:16): [True: 45, False: 137]
  ------------------
 1892|     45|                UA_free(dst->arrayDimensions);
  ------------------
  |  |  351|     45|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1893|     45|                dst->arrayDimensions = NULL;
 1894|     45|                dst->arrayDimensionsSize = 0;
 1895|     45|            }
 1896|    182|        }
 1897|  1.53k|    }
 1898|       |
 1899|  73.7k| out:
 1900|  73.7k|    ctx->index = beginIndex;
 1901|  73.7k|    skipObject(ctx);
 1902|  73.7k|    ctx->depth--;
 1903|  73.7k|    return res;
 1904|  73.7k|}
ua_types_encoding_json.c:Variant_decodeJsonUnwrapExtensionObject:
 2130|    636|Variant_decodeJsonUnwrapExtensionObject(ParseCtx *ctx, void *p, const UA_DataType *type) {
 2131|    636|    (void) type;
 2132|    636|    UA_Variant *dst = (UA_Variant*)p;
 2133|       |
 2134|       |    /* ExtensionObject with null body */
 2135|    636|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2135:8): [True: 195, False: 441]
  ------------------
 2136|    195|        dst->data = UA_ExtensionObject_new();
 2137|    195|        dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|    195|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2138|    195|        ctx->index++;
 2139|    195|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    195|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2140|    195|    }
 2141|       |
 2142|       |    /* Decode the ExtensionObject */
 2143|    441|    UA_ExtensionObject eo;
 2144|    441|    UA_ExtensionObject_init(&eo);
 2145|    441|    UA_StatusCode ret = ExtensionObject_decodeJson(ctx, &eo, NULL);
 2146|    441|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|    441|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2146:8): [True: 293, False: 148]
  ------------------
 2147|    293|        UA_ExtensionObject_clear(&eo); /* We don't have the global cleanup */
 2148|    293|        return ret;
 2149|    293|    }
 2150|       |
 2151|       |    /* The content is still encoded, cannot unwrap */
 2152|    148|    if(eo.encoding != UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2152:8): [True: 136, False: 12]
  ------------------
 2153|    136|        goto use_eo;
 2154|       |
 2155|       |    /* The content is a builtin type that could have been directly encoded in
 2156|       |     * the Variant, there was no need to wrap in an ExtensionObject. But this
 2157|       |     * means for us, that somebody made an extra effort to explicitly get an
 2158|       |     * ExtensionObject. So we keep it. As an added advantage we will generate
 2159|       |     * the same JSON again when encoding again. */
 2160|     12|    if(eo.content.decoded.type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (2160:8): [True: 7, False: 5]
  ------------------
 2161|      7|        goto use_eo;
 2162|       |
 2163|       |    /* Unwrap the ExtensionObject */
 2164|      5|    dst->data = eo.content.decoded.data;
 2165|      5|    dst->type = eo.content.decoded.type;
 2166|      5|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      5|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2167|       |
 2168|    143| use_eo:
 2169|       |    /* Don't unwrap */
 2170|    143|    dst->data = UA_new(&UA_TYPES[UA_TYPES_EXTENSIONOBJECT]);
  ------------------
  |  |  735|    143|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2171|    143|    if(!dst->data) {
  ------------------
  |  Branch (2171:8): [True: 0, False: 143]
  ------------------
 2172|      0|        UA_ExtensionObject_clear(&eo);
 2173|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2174|      0|    }
 2175|    143|    dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|    143|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2176|    143|    *(UA_ExtensionObject*)dst->data = eo;
 2177|    143|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    143|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2178|    143|}
ua_types_encoding_json.c:getArrayUnwrapType:
 1666|    514|getArrayUnwrapType(ParseCtx *ctx) {
 1667|    514|    UA_assert(ctx->tokens[ctx->index].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  |  411|    514|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1667:5): [True: 514, False: 0]
  ------------------
 1668|       |
 1669|       |    /* Return early for empty arrays */
 1670|    514|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 1671|    514|    if(length == 0)
  ------------------
  |  Branch (1671:8): [True: 3, False: 511]
  ------------------
 1672|      3|        return NULL;
 1673|       |
 1674|       |    /* Save the original index and go to the first array member */
 1675|    511|    size_t oldIndex = ctx->index;
 1676|    511|    ctx->index++;
 1677|       |
 1678|       |    /* Lookup the type for the first array member */
 1679|    511|    UA_NodeId typeId;
 1680|    511|    UA_NodeId_init(&typeId);
 1681|    511|    const UA_DataType *typeOfBody = getExtensionObjectType(ctx);
 1682|    511|    if(!typeOfBody) {
  ------------------
  |  Branch (1682:8): [True: 375, False: 136]
  ------------------
 1683|    375|        ctx->index = oldIndex; /* Restore the index */
 1684|    375|        return NULL;
 1685|    375|    }
 1686|       |
 1687|       |    /* Get the TypeId encoding for faster comparison below.
 1688|       |     * Cannot fail as getExtensionObjectType already looked this up. */
 1689|    136|    size_t typeIdIndex = 0;
 1690|    136|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 1691|    136|    (void)ret;
 1692|    136|    UA_assert(ret == UA_STATUSCODE_GOOD);
  ------------------
  |  |  411|    136|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1692:5): [True: 136, False: 0]
  ------------------
 1693|    136|    const char* typeIdData = &ctx->json5[ctx->tokens[typeIdIndex].start];
 1694|    136|    size_t typeIdSize = getTokenLength(&ctx->tokens[typeIdIndex]);
 1695|       |
 1696|       |    /* Loop over all members and check whether they can be unwrapped. Don't skip
 1697|       |     * the first member. We still haven't checked the encoding type. */
 1698|    277|    for(size_t i = 0; i < length; i++) {
  ------------------
  |  Branch (1698:23): [True: 227, False: 50]
  ------------------
 1699|       |        /* Array element must be an object */
 1700|    227|        if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {
  ------------------
  |  Branch (1700:12): [True: 24, False: 203]
  ------------------
 1701|     24|            ctx->index = oldIndex; /* Restore the index */
 1702|     24|            return NULL;
 1703|     24|        }
 1704|       |
 1705|       |        /* Check for non-JSON encoding */
 1706|    203|        size_t encIndex = 0;
 1707|    203|        ret = lookAheadForKey(ctx, UA_JSONKEY_ENCODING, &encIndex);
 1708|    203|        if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|    203|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1708:12): [True: 1, False: 202]
  ------------------
 1709|      1|            ctx->index = oldIndex; /* Restore the index */
 1710|      1|            return NULL;
 1711|      1|        }
 1712|       |
 1713|       |        /* Get the type NodeId index */
 1714|    202|        size_t memberTypeIdIndex = 0;
 1715|    202|        ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &memberTypeIdIndex);
 1716|    202|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|    202|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1716:12): [True: 3, False: 199]
  ------------------
 1717|      3|            ctx->index = oldIndex; /* Restore the index */
 1718|      3|            return NULL;
 1719|      3|        }
 1720|       |
 1721|       |        /* Is it the same type? Compare raw NodeId string */
 1722|    199|        const char* memberTypeIdData = &ctx->json5[ctx->tokens[memberTypeIdIndex].start];
 1723|    199|        size_t memberTypeIdSize = getTokenLength(&ctx->tokens[memberTypeIdIndex]);
 1724|    199|        if(typeIdSize != memberTypeIdSize ||
  ------------------
  |  Branch (1724:12): [True: 38, False: 161]
  ------------------
 1725|    161|           memcmp(typeIdData, memberTypeIdData, typeIdSize) != 0) {
  ------------------
  |  Branch (1725:12): [True: 20, False: 141]
  ------------------
 1726|     58|            ctx->index = oldIndex; /* Restore the index */
 1727|     58|            return NULL;
 1728|     58|        }
 1729|       |
 1730|       |        /* Skip to the next array member */
 1731|    141|        skipObject(ctx);
 1732|    141|    }
 1733|       |
 1734|     50|    ctx->index = oldIndex; /* Restore the index */
 1735|     50|    return typeOfBody;
 1736|    136|}
ua_types_encoding_json.c:getExtensionObjectType:
 1634|    511|getExtensionObjectType(ParseCtx *ctx) {
 1635|    511|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (1635:8): [True: 14, False: 497]
  ------------------
 1636|     14|        return NULL;
 1637|       |
 1638|       |    /* Get the type NodeId index */
 1639|    497|    size_t typeIdIndex = 0;
 1640|    497|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 1641|    497|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    497|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1641:8): [True: 25, False: 472]
  ------------------
 1642|     25|        return NULL;
 1643|       |
 1644|    472|    size_t oldIndex = ctx->index;
 1645|    472|    ctx->index = (UA_UInt16)typeIdIndex;
 1646|       |
 1647|       |    /* Decode the type NodeId */
 1648|    472|    UA_NodeId typeId;
 1649|    472|    UA_NodeId_init(&typeId);
 1650|    472|    ret = NodeId_decodeJson(ctx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|    472|#define UA_TYPES_NODEID 16
  ------------------
 1651|    472|    ctx->index = oldIndex;
 1652|    472|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|    472|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1652:8): [True: 97, False: 375]
  ------------------
 1653|     97|        UA_NodeId_clear(&typeId); /* We don't have the global cleanup */
 1654|     97|        return NULL;
 1655|     97|    }
 1656|       |
 1657|       |    /* Lookup an return */
 1658|    375|    const UA_DataType *type = UA_findDataTypeWithCustom(&typeId, ctx->customTypes);
 1659|    375|    UA_NodeId_clear(&typeId);
 1660|    375|    return type;
 1661|    472|}
ua_types_encoding_json.c:Array_decodeJsonUnwrapExtensionObject:
 1739|     50|Array_decodeJsonUnwrapExtensionObject(ParseCtx *ctx, void **dst, const UA_DataType *type) {
 1740|     50|    size_t *size_ptr = (size_t*) dst - 1; /* Save the length pointer of the array */
 1741|     50|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 1742|       |
 1743|       |    /* Known from the previous unwrapping-check */
 1744|     50|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_ARRAY);
  ------------------
  |  |  411|     50|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1744:5): [True: 50, False: 0]
  ------------------
 1745|     50|    UA_assert(length > 0);
  ------------------
  |  |  411|     50|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1745:5): [True: 50, False: 0]
  ------------------
 1746|       |
 1747|     50|    ctx->index++; /* Go to first array member */
 1748|       |
 1749|       |    /* Allocate memory */
 1750|     50|    *dst = UA_calloc(length, type->memSize);
  ------------------
  |  |  352|     50|# define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1751|     50|    if(*dst == NULL)
  ------------------
  |  Branch (1751:8): [True: 0, False: 50]
  ------------------
 1752|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1753|       |
 1754|       |    /* Decode array members */
 1755|     50|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     50|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1756|     50|    uintptr_t ptr = (uintptr_t)*dst;
 1757|     61|    for(size_t i = 0; i < length; i++) {
  ------------------
  |  Branch (1757:23): [True: 50, False: 11]
  ------------------
 1758|     50|        UA_assert(ctx->tokens[ctx->index].type == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  411|     50|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1758:9): [True: 50, False: 0]
  ------------------
 1759|     50|        if(type->typeKind == UA_DATATYPEKIND_STRUCTURE) {
  ------------------
  |  Branch (1759:12): [True: 6, False: 44]
  ------------------
 1760|       |            /* Decode structure in-situ in the ExtensionObject */
 1761|      6|            ret = decodeJsonStructure(ctx, (void*)ptr, type);
 1762|     44|        } else {
 1763|       |            /* Get the body field and decode it */
 1764|     44|            DecodeEntry entries[3] = {
 1765|     44|                {UA_JSONKEY_TYPEID, NULL, NULL, false, NULL},
 1766|     44|                {UA_JSONKEY_BODY, (void*)ptr, NULL, false, type},
 1767|     44|                {UA_JSONKEY_ENCODING, NULL, NULL, false, NULL}
 1768|     44|            };
 1769|     44|            ret = decodeFields(ctx, entries, 3);
 1770|     44|        }
 1771|     50|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|     50|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1771:12): [True: 39, False: 11]
  ------------------
 1772|     39|            UA_Array_delete(*dst, i+1, type);
 1773|     39|            *dst = NULL;
 1774|     39|            return ret;
 1775|     39|        }
 1776|     11|        ptr += type->memSize;
 1777|     11|    }
 1778|       |
 1779|     11|    *size_ptr = length; /* All good, set the size */
 1780|     11|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     11|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1781|     50|}
ua_types_encoding_json.c:Array_decodeJson:
 2304|  1.66k|Array_decodeJson(ParseCtx *ctx, void **dst, const UA_DataType *type) {
 2305|       |    /* Save the length of the array */
 2306|  1.66k|    size_t *size_ptr = (size_t*) dst - 1;
 2307|       |
 2308|  1.66k|    if(currentTokenType(ctx) != CJ5_TOKEN_ARRAY)
  ------------------
  |  Branch (2308:8): [True: 3, False: 1.66k]
  ------------------
 2309|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2310|       |
 2311|  1.66k|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 2312|       |
 2313|  1.66k|    ctx->index++; /* Go to first array member or to the first element after
 2314|       |                   * the array (if empty) */
 2315|       |
 2316|       |    /* Return early for empty arrays */
 2317|  1.66k|    if(length == 0) {
  ------------------
  |  Branch (2317:8): [True: 107, False: 1.55k]
  ------------------
 2318|    107|        *size_ptr = length;
 2319|    107|        *dst = UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|    107|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2320|    107|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    107|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2321|    107|    }
 2322|       |
 2323|       |    /* Allocate memory */
 2324|  1.55k|    *dst = UA_calloc(length, type->memSize);
  ------------------
  |  |  352|  1.55k|# define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2325|  1.55k|    if(*dst == NULL)
  ------------------
  |  Branch (2325:8): [True: 9, False: 1.54k]
  ------------------
 2326|      9|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      9|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2327|       |
 2328|       |    /* Decode array members */
 2329|  1.54k|    uintptr_t ptr = (uintptr_t)*dst;
 2330|  3.26M|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (2330:23): [True: 3.26M, False: 762]
  ------------------
 2331|  3.26M|        if(ctx->tokens[ctx->index].type != CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2331:12): [True: 3.26M, False: 7.83k]
  ------------------
 2332|  3.26M|            status ret = decodeJsonJumpTable[type->typeKind](ctx, (void*)ptr, type);
 2333|  3.26M|            if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  3.26M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2333:16): [True: 785, False: 3.26M]
  ------------------
 2334|    785|                UA_Array_delete(*dst, i+1, type);
 2335|    785|                *dst = NULL;
 2336|    785|                return ret;
 2337|    785|            }
 2338|  3.26M|        } else {
 2339|  7.83k|            ctx->index++;
 2340|  7.83k|        }
 2341|  3.26M|        ptr += type->memSize;
 2342|  3.26M|    }
 2343|       |
 2344|    762|    *size_ptr = length; /* All good, set the size */
 2345|    762|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    762|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2346|  1.54k|}
ua_types_encoding_json.c:Variant_decodeJson:
 1906|    827|DECODE_JSON(Variant) {
 1907|    827|    CHECK_NULL_SKIP; /* Treat null as an empty variant */
  ------------------
  |  | 1061|    827|#define CHECK_NULL_SKIP do {                         \
  |  | 1062|    827|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1062:8): [True: 0, False: 827]
  |  |  ------------------
  |  | 1063|      0|        ctx->index++;                                \
  |  | 1064|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1065|    827|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1065:14): [Folded, False: 827]
  |  |  ------------------
  ------------------
 1908|    827|    CHECK_OBJECT;
  ------------------
  |  | 1056|    827|#define CHECK_OBJECT do {                                \
  |  | 1057|    827|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1057:8): [True: 21, False: 806]
  |  |  ------------------
  |  | 1058|     21|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     21|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1059|    806|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1059:14): [Folded, False: 806]
  |  |  ------------------
  ------------------
 1909|    806|    return decodeJSONVariant(ctx, dst);
 1910|    827|}
ua_types_encoding_json.c:decodeJsonStructure:
 2349|     69|decodeJsonStructure(ParseCtx *ctx, void *dst, const UA_DataType *type) {
 2350|       |    /* Check the recursion limit */
 2351|     69|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|     69|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (2351:8): [True: 0, False: 69]
  ------------------
 2352|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 2353|     69|    ctx->depth++;
 2354|       |
 2355|     69|    uintptr_t ptr = (uintptr_t)dst;
 2356|     69|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     69|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2357|     69|    u8 membersSize = type->membersSize;
 2358|     69|    UA_STACKARRAY(DecodeEntry, entries, membersSize);
  ------------------
  |  |  387|     69|#  define UA_STACKARRAY(TYPE, NAME, SIZE) TYPE NAME[SIZE]
  ------------------
 2359|    456|    for(size_t i = 0; i < membersSize; ++i) {
  ------------------
  |  Branch (2359:23): [True: 387, False: 69]
  ------------------
 2360|    387|        const UA_DataTypeMember *m = &type->members[i];
 2361|    387|        const UA_DataType *mt = m->memberType;
 2362|    387|        entries[i].type = mt;
 2363|    387|        entries[i].fieldName = m->memberName;
 2364|    387|        entries[i].found = false;
 2365|    387|        if(!m->isArray) {
  ------------------
  |  Branch (2365:12): [True: 335, False: 52]
  ------------------
 2366|    335|            ptr += m->padding;
 2367|    335|            entries[i].fieldPointer = (void*)ptr;
 2368|    335|            entries[i].function = NULL;
 2369|    335|            ptr += mt->memSize;
 2370|    335|        } else {
 2371|     52|            ptr += m->padding;
 2372|     52|            ptr += sizeof(size_t);
 2373|     52|            entries[i].fieldPointer = (void*)ptr;
 2374|     52|            entries[i].function = (decodeJsonSignature)Array_decodeJson;
 2375|     52|            ptr += sizeof(void*);
 2376|     52|        }
 2377|    387|    }
 2378|       |
 2379|     69|    ret = decodeFields(ctx, entries, membersSize);
 2380|       |
 2381|     69|    if(ctx->depth == 0)
  ------------------
  |  Branch (2381:8): [True: 0, False: 69]
  ------------------
 2382|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 2383|     69|    ctx->depth--;
 2384|     69|    return ret;
 2385|     69|}

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

UA_Guid_parse:
   84|     68|UA_Guid_parse(UA_Guid *guid, const UA_String str) {
   85|     68|    UA_StatusCode res = parse_guid(guid, str.data, str.data + str.length);
   86|     68|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|     68|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (86:8): [True: 62, False: 6]
  ------------------
   87|     62|        *guid = UA_GUID_NULL;
   88|     68|    return res;
   89|     68|}
UA_NodeId_parseEx:
  319|   315k|                  const UA_NamespaceMapping *nsMapping) {
  320|   315k|    UA_StatusCode res =
  321|   315k|        parse_nodeid(id, str.data, str.data+str.length, UA_ESCAPING_NONE, nsMapping);
  322|   315k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|   315k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (322:8): [True: 356, False: 315k]
  ------------------
  323|    356|        UA_NodeId_clear(id);
  324|   315k|    return res;
  325|   315k|}
UA_ExpandedNodeId_parseEx:
  667|  4.92k|                          size_t serverUrisSize, const UA_String *serverUris) {
  668|  4.92k|    UA_StatusCode res =
  669|  4.92k|        parse_expandednodeid(id, str.data, str.data + str.length, UA_ESCAPING_NONE,
  670|  4.92k|                             nsMapping, serverUrisSize, serverUris);
  671|  4.92k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  4.92k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (671:8): [True: 467, False: 4.45k]
  ------------------
  672|    467|        UA_ExpandedNodeId_clear(id);
  673|  4.92k|    return res;
  674|  4.92k|}
UA_QualifiedName_parseEx:
  823|  28.1k|                         const UA_NamespaceMapping *nsMapping) {
  824|  28.1k|    const u8 *pos = str.data;
  825|  28.1k|    const u8 *end = str.data + str.length;
  826|  28.1k|    UA_StatusCode res = parse_qn(qn, pos, end, UA_ESCAPING_NONE, nsMapping, 0);
  827|  28.1k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  28.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (827:8): [True: 0, False: 28.1k]
  ------------------
  828|      0|        UA_QualifiedName_clear(qn);
  829|  28.1k|    return res;
  830|  28.1k|}
ua_types_lex.c:parse_guid:
   48|     80|parse_guid(UA_Guid *guid, const UA_Byte *s, const UA_Byte *e) {
   49|     80|    size_t len = (size_t)(e - s);
   50|     80|    if(len != 36 || s[8] != '-' || s[13] != '-' || s[23] != '-')
  ------------------
  |  Branch (50:8): [True: 33, False: 47]
  |  Branch (50:21): [True: 3, False: 44]
  |  Branch (50:36): [True: 9, False: 35]
  |  Branch (50:52): [True: 6, False: 29]
  ------------------
   51|     51|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     51|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   52|       |
   53|     29|    UA_UInt32 tmp;
   54|     29|    if(UA_readNumberWithBase(s, 8, &tmp, 16) != 8)
  ------------------
  |  Branch (54:8): [True: 8, False: 21]
  ------------------
   55|      8|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      8|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   56|     21|    guid->data1 = tmp;
   57|       |
   58|     21|    if(UA_readNumberWithBase(&s[9], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (58:8): [True: 3, False: 18]
  ------------------
   59|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   60|     18|    guid->data2 = (UA_UInt16)tmp;
   61|       |
   62|     18|    if(UA_readNumberWithBase(&s[14], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (62:8): [True: 3, False: 15]
  ------------------
   63|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   64|     15|    guid->data3 = (UA_UInt16)tmp;
   65|       |
   66|     15|    if(UA_readNumberWithBase(&s[19], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (66:8): [True: 2, False: 13]
  ------------------
   67|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   68|     13|    guid->data4[0] = (UA_Byte)tmp;
   69|       |
   70|     13|    if(UA_readNumberWithBase(&s[21], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (70:8): [True: 1, False: 12]
  ------------------
   71|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   72|     12|    guid->data4[1] = (UA_Byte)tmp;
   73|       |
   74|     59|    for(size_t pos = 2, spos = 24; pos < 8; pos++, spos += 2) {
  ------------------
  |  Branch (74:36): [True: 53, False: 6]
  ------------------
   75|     53|        if(UA_readNumberWithBase(&s[spos], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (75:12): [True: 6, False: 47]
  ------------------
   76|      6|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   77|     47|        guid->data4[pos] = (UA_Byte)tmp;
   78|     47|    }
   79|       |
   80|      6|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      6|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   81|     12|}
ua_types_lex.c:parse_nodeid:
  144|   315k|             UA_Escaping idEsc, const UA_NamespaceMapping *nsMapping) {
  145|   315k|    *id = UA_NODEID_NULL; /* Reset the NodeId */
  146|   315k|    LexContext context;
  147|   315k|    memset(&context, 0, sizeof(LexContext));
  148|   315k|    UA_Byte *begin = (UA_Byte*)(uintptr_t)pos;
  149|   315k|    const u8 *ns = NULL, *nsu = NULL, *body = NULL;
  150|       |
  151|       |    
  152|   315k|{
  153|   315k|	u8 yych;
  154|   315k|	yych = YYPEEK();
  ------------------
  |  |   31|   315k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   315k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   315k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 315k, False: 4]
  |  |  ------------------
  ------------------
  155|   315k|	switch (yych) {
  156|    697|		case 'b':
  ------------------
  |  Branch (156:3): [True: 697, False: 315k]
  ------------------
  157|    713|		case 'g':
  ------------------
  |  Branch (157:3): [True: 16, False: 315k]
  ------------------
  158|   267k|		case 'i':
  ------------------
  |  Branch (158:3): [True: 267k, False: 48.6k]
  ------------------
  159|   313k|		case 's':
  ------------------
  |  Branch (159:3): [True: 45.4k, False: 270k]
  ------------------
  160|   313k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|   313k|#define YYSTAGN(t) t = NULL
  ------------------
  161|   313k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   37|   313k|#define YYSTAGN(t) t = NULL
  ------------------
  162|   313k|			goto yy3;
  163|  2.48k|		case 'n': goto yy4;
  ------------------
  |  Branch (163:3): [True: 2.48k, False: 313k]
  ------------------
  164|     15|		default: goto yy1;
  ------------------
  |  Branch (164:3): [True: 15, False: 315k]
  ------------------
  165|   315k|	}
  166|     15|yy1:
  167|     15|	YYSKIP();
  ------------------
  |  |   33|     15|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|     15|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  168|    265|yy2:
  169|    265|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   43|    265|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  170|   313k|yy3:
  171|   313k|	YYSKIP();
  ------------------
  |  |   33|   313k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|   313k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  172|   313k|	yych = YYPEEK();
  ------------------
  |  |   31|   313k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   313k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   313k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 313k, False: 12]
  |  |  ------------------
  ------------------
  173|   313k|	switch (yych) {
  174|   313k|		case '=': goto yy5;
  ------------------
  |  Branch (174:3): [True: 313k, False: 58]
  ------------------
  175|     58|		default: goto yy2;
  ------------------
  |  Branch (175:3): [True: 58, False: 313k]
  ------------------
  176|   313k|	}
  177|  2.48k|yy4:
  178|  2.48k|	YYSKIP();
  ------------------
  |  |   33|  2.48k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  2.48k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  179|  2.48k|	YYBACKUP();
  ------------------
  |  |   34|  2.48k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   30|  2.48k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  2.48k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  180|  2.48k|	yych = YYPEEK();
  ------------------
  |  |   31|  2.48k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  2.48k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  2.48k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 2.48k, False: 3]
  |  |  ------------------
  ------------------
  181|  2.48k|	switch (yych) {
  182|  2.47k|		case 's': goto yy6;
  ------------------
  |  Branch (182:3): [True: 2.47k, False: 12]
  ------------------
  183|     12|		default: goto yy2;
  ------------------
  |  Branch (183:3): [True: 12, False: 2.47k]
  ------------------
  184|  2.48k|	}
  185|   315k|yy5:
  186|   315k|	YYSKIP();
  ------------------
  |  |   33|   315k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|   315k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  187|   315k|	nsu = context.yyt2;
  188|   315k|	ns = context.yyt1;
  189|   315k|	YYSTAGP(body);
  ------------------
  |  |   36|   315k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|   315k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  190|   315k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   38|   315k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  191|   315k|	{ goto match; }
  192|  2.47k|yy6:
  193|  2.47k|	YYSKIP();
  ------------------
  |  |   33|  2.47k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  2.47k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  194|  2.47k|	yych = YYPEEK();
  ------------------
  |  |   31|  2.47k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  2.47k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  2.47k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 2.47k, False: 3]
  |  |  ------------------
  ------------------
  195|  2.47k|	switch (yych) {
  196|    553|		case '=': goto yy8;
  ------------------
  |  Branch (196:3): [True: 553, False: 1.92k]
  ------------------
  197|  1.91k|		case 'u': goto yy9;
  ------------------
  |  Branch (197:3): [True: 1.91k, False: 556]
  ------------------
  198|      3|		default: goto yy7;
  ------------------
  |  Branch (198:3): [True: 3, False: 2.47k]
  ------------------
  199|  2.47k|	}
  200|    180|yy7:
  201|    180|	YYRESTORE();
  ------------------
  |  |   35|    180|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   29|    180|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   30|    180|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  202|    180|	goto yy2;
  203|    553|yy8:
  204|    553|	YYSKIP();
  ------------------
  |  |   33|    553|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    553|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  205|    553|	yych = YYPEEK();
  ------------------
  |  |   31|    553|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    553|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    550|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 550, False: 3]
  |  |  ------------------
  ------------------
  206|    553|	switch (yych) {
  207|    202|		case '0':
  ------------------
  |  Branch (207:3): [True: 202, False: 351]
  ------------------
  208|    281|		case '1':
  ------------------
  |  Branch (208:3): [True: 79, False: 474]
  ------------------
  209|    298|		case '2':
  ------------------
  |  Branch (209:3): [True: 17, False: 536]
  ------------------
  210|    325|		case '3':
  ------------------
  |  Branch (210:3): [True: 27, False: 526]
  ------------------
  211|    349|		case '4':
  ------------------
  |  Branch (211:3): [True: 24, False: 529]
  ------------------
  212|    366|		case '5':
  ------------------
  |  Branch (212:3): [True: 17, False: 536]
  ------------------
  213|    523|		case '6':
  ------------------
  |  Branch (213:3): [True: 157, False: 396]
  ------------------
  214|    533|		case '7':
  ------------------
  |  Branch (214:3): [True: 10, False: 543]
  ------------------
  215|    540|		case '8':
  ------------------
  |  Branch (215:3): [True: 7, False: 546]
  ------------------
  216|    547|		case '9':
  ------------------
  |  Branch (216:3): [True: 7, False: 546]
  ------------------
  217|    547|			YYSTAGP(context.yyt1);
  ------------------
  |  |   36|    547|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    547|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  218|    547|			goto yy10;
  219|      6|		default: goto yy7;
  ------------------
  |  Branch (219:3): [True: 6, False: 547]
  ------------------
  220|    553|	}
  221|  1.91k|yy9:
  222|  1.91k|	YYSKIP();
  ------------------
  |  |   33|  1.91k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.91k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  223|  1.91k|	yych = YYPEEK();
  ------------------
  |  |   31|  1.91k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.91k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.91k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.91k, False: 3]
  |  |  ------------------
  ------------------
  224|  1.91k|	switch (yych) {
  225|  1.90k|		case '=': goto yy11;
  ------------------
  |  Branch (225:3): [True: 1.90k, False: 14]
  ------------------
  226|     14|		default: goto yy7;
  ------------------
  |  Branch (226:3): [True: 14, False: 1.90k]
  ------------------
  227|  1.91k|	}
  228|  11.7k|yy10:
  229|  11.7k|	YYSKIP();
  ------------------
  |  |   33|  11.7k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  11.7k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  230|  11.7k|	yych = YYPEEK();
  ------------------
  |  |   31|  11.7k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  11.7k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  11.6k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 11.6k, False: 90]
  |  |  ------------------
  ------------------
  231|  11.7k|	switch (yych) {
  232|  4.45k|		case '0':
  ------------------
  |  Branch (232:3): [True: 4.45k, False: 7.26k]
  ------------------
  233|  5.16k|		case '1':
  ------------------
  |  Branch (233:3): [True: 706, False: 11.0k]
  ------------------
  234|  5.78k|		case '2':
  ------------------
  |  Branch (234:3): [True: 626, False: 11.0k]
  ------------------
  235|  6.47k|		case '3':
  ------------------
  |  Branch (235:3): [True: 689, False: 11.0k]
  ------------------
  236|  7.08k|		case '4':
  ------------------
  |  Branch (236:3): [True: 613, False: 11.1k]
  ------------------
  237|  7.48k|		case '5':
  ------------------
  |  Branch (237:3): [True: 399, False: 11.3k]
  ------------------
  238|  9.08k|		case '6':
  ------------------
  |  Branch (238:3): [True: 1.59k, False: 10.1k]
  ------------------
  239|  9.63k|		case '7':
  ------------------
  |  Branch (239:3): [True: 553, False: 11.1k]
  ------------------
  240|  10.5k|		case '8':
  ------------------
  |  Branch (240:3): [True: 890, False: 10.8k]
  ------------------
  241|  11.1k|		case '9': goto yy10;
  ------------------
  |  Branch (241:3): [True: 651, False: 11.0k]
  ------------------
  242|    446|		case ';':
  ------------------
  |  Branch (242:3): [True: 446, False: 11.2k]
  ------------------
  243|    446|			YYSTAGN(context.yyt2);
  ------------------
  |  |   37|    446|#define YYSTAGN(t) t = NULL
  ------------------
  244|    446|			goto yy12;
  245|    101|		default: goto yy7;
  ------------------
  |  Branch (245:3): [True: 101, False: 11.6k]
  ------------------
  246|  11.7k|	}
  247|  1.90k|yy11:
  248|  1.90k|	YYSKIP();
  ------------------
  |  |   33|  1.90k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.90k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  249|  1.90k|	yych = YYPEEK();
  ------------------
  |  |   31|  1.90k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.90k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.90k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.90k, False: 3]
  |  |  ------------------
  ------------------
  250|  1.90k|	switch (yych) {
  251|      3|		case 0x00: goto yy7;
  ------------------
  |  Branch (251:3): [True: 3, False: 1.90k]
  ------------------
  252|    574|		case ';':
  ------------------
  |  Branch (252:3): [True: 574, False: 1.32k]
  ------------------
  253|    574|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|    574|#define YYSTAGN(t) t = NULL
  ------------------
  254|    574|			YYSTAGP(context.yyt2);
  ------------------
  |  |   36|    574|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    574|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  255|    574|			goto yy12;
  256|  1.32k|		default:
  ------------------
  |  Branch (256:3): [True: 1.32k, False: 577]
  ------------------
  257|  1.32k|			YYSTAGP(context.yyt2);
  ------------------
  |  |   36|  1.32k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  1.32k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  258|  1.32k|			goto yy13;
  259|  1.90k|	}
  260|  2.33k|yy12:
  261|  2.33k|	YYSKIP();
  ------------------
  |  |   33|  2.33k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  2.33k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  262|  2.33k|	yych = YYPEEK();
  ------------------
  |  |   31|  2.33k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  2.33k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  2.32k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 2.32k, False: 11]
  |  |  ------------------
  ------------------
  263|  2.33k|	switch (yych) {
  264|    613|		case 'b':
  ------------------
  |  Branch (264:3): [True: 613, False: 1.71k]
  ------------------
  265|    814|		case 'g':
  ------------------
  |  Branch (265:3): [True: 201, False: 2.13k]
  ------------------
  266|  1.70k|		case 'i':
  ------------------
  |  Branch (266:3): [True: 894, False: 1.43k]
  ------------------
  267|  2.31k|		case 's': goto yy14;
  ------------------
  |  Branch (267:3): [True: 610, False: 1.72k]
  ------------------
  268|     14|		default: goto yy7;
  ------------------
  |  Branch (268:3): [True: 14, False: 2.31k]
  ------------------
  269|  2.33k|	}
  270|   161k|yy13:
  271|   161k|	YYSKIP();
  ------------------
  |  |   33|   161k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|   161k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  272|   161k|	yych = YYPEEK();
  ------------------
  |  |   31|   161k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   161k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   161k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 161k, False: 14]
  |  |  ------------------
  ------------------
  273|   161k|	switch (yych) {
  274|     14|		case 0x00: goto yy7;
  ------------------
  |  Branch (274:3): [True: 14, False: 161k]
  ------------------
  275|  1.31k|		case ';':
  ------------------
  |  Branch (275:3): [True: 1.31k, False: 160k]
  ------------------
  276|  1.31k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|  1.31k|#define YYSTAGN(t) t = NULL
  ------------------
  277|  1.31k|			goto yy12;
  278|   160k|		default: goto yy13;
  ------------------
  |  Branch (278:3): [True: 160k, False: 1.32k]
  ------------------
  279|   161k|	}
  280|  2.31k|yy14:
  281|  2.31k|	YYSKIP();
  ------------------
  |  |   33|  2.31k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  2.31k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  282|  2.31k|	yych = YYPEEK();
  ------------------
  |  |   31|  2.31k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  2.31k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  2.30k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 2.30k, False: 9]
  |  |  ------------------
  ------------------
  283|  2.31k|	switch (yych) {
  284|  2.29k|		case '=': goto yy5;
  ------------------
  |  Branch (284:3): [True: 2.29k, False: 25]
  ------------------
  285|     25|		default: goto yy7;
  ------------------
  |  Branch (285:3): [True: 25, False: 2.29k]
  ------------------
  286|  2.31k|	}
  287|  2.31k|}
  288|       |
  289|       |
  290|   315k| match:
  291|   315k|    if(nsu) {
  ------------------
  |  Branch (291:8): [True: 1.85k, False: 313k]
  ------------------
  292|       |        /* NamespaceUri */
  293|  1.85k|        UA_String nsUri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  294|  1.85k|        UA_StatusCode res = escapedUri2Index(nsUri, &id->namespaceIndex, nsMapping);
  295|  1.85k|        if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  1.85k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (295:12): [True: 1.85k, False: 0]
  ------------------
  296|       |            /* Return the entire NodeId string s=... */
  297|  1.85k|            UA_String total = {(size_t)((const UA_Byte*)end - begin), begin};
  298|  1.85k|            id->identifierType = UA_NODEIDTYPE_STRING;
  299|  1.85k|            return UA_String_copy(&total, &id->identifier.string);
  300|  1.85k|        }
  301|   313k|    } else if(ns) {
  ------------------
  |  Branch (301:15): [True: 436, False: 313k]
  ------------------
  302|       |        /* NamespaceIndex */
  303|    436|        UA_UInt32 tmp;
  304|    436|        size_t len = (size_t)(body - 1 - ns);
  305|    436|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (305:12): [True: 0, False: 436]
  ------------------
  306|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  307|    436|        id->namespaceIndex = (UA_UInt16)tmp;
  308|    436|        if(nsMapping)
  ------------------
  |  Branch (308:12): [True: 0, False: 436]
  ------------------
  309|      0|            id->namespaceIndex =
  310|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->namespaceIndex);
  311|    436|    }
  312|       |
  313|       |    /* From the current position until the end */
  314|   313k|    return parse_nodeid_body(id, body, end, idEsc);
  315|   315k|}
ua_types_lex.c:escapedUri2Index:
   93|  3.29k|                 const UA_NamespaceMapping *nsMapping) {
   94|  3.29k|    if(!nsMapping)
  ------------------
  |  Branch (94:8): [True: 3.29k, False: 0]
  ------------------
   95|  3.29k|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|  3.29k|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   96|      0|    UA_String tmp = uri; 
   97|      0|    status res = UA_String_unescape(&uri, true, UA_ESCAPING_PERCENT);
   98|      0|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (98:8): [True: 0, False: 0]
  ------------------
   99|      0|        return res;
  100|      0|    res = UA_NamespaceMapping_uri2Index(nsMapping, uri, nsIndex);
  101|      0|    if(tmp.data != uri.data)
  ------------------
  |  Branch (101:8): [True: 0, False: 0]
  ------------------
  102|      0|        UA_String_clear(&uri);
  103|      0|    return res;
  104|      0|}
ua_types_lex.c:parse_nodeid_body:
  107|   317k|parse_nodeid_body(UA_NodeId *id, const u8 *body, const u8 *end, UA_Escaping esc) {
  108|   317k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   317k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  109|   317k|    UA_String str = {(size_t)(end - (body+2)), (UA_Byte*)(uintptr_t)body + 2};
  110|   317k|    switch(*body) {
  111|   267k|    case 'i':
  ------------------
  |  Branch (111:5): [True: 267k, False: 49.3k]
  ------------------
  112|   267k|        id->identifierType = UA_NODEIDTYPE_NUMERIC;
  113|   267k|        if(UA_readNumber(str.data, str.length, &id->identifier.numeric) != str.length)
  ------------------
  |  Branch (113:12): [True: 79, False: 267k]
  ------------------
  114|     79|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     79|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  115|   267k|        break;
  116|  47.4k|    case 's':
  ------------------
  |  Branch (116:5): [True: 47.4k, False: 269k]
  ------------------
  117|  47.4k|        id->identifierType = UA_NODEIDTYPE_STRING;
  118|  47.4k|        res |= UA_String_copy(&str, &id->identifier.string);
  119|  47.4k|        res |= UA_String_unescape(&id->identifier.string, false, esc);
  120|  47.4k|        break;
  121|     12|    case 'g':
  ------------------
  |  Branch (121:5): [True: 12, False: 317k]
  ------------------
  122|     12|        id->identifierType = UA_NODEIDTYPE_GUID;
  123|     12|        res = parse_guid(&id->identifier.guid, str.data, end);
  124|     12|        break;
  125|  1.94k|    case 'b':
  ------------------
  |  Branch (125:5): [True: 1.94k, False: 315k]
  ------------------
  126|       |        /* For percent-escaping, base64url bytestring encoding is used. That
  127|       |         * doesn't need to be escaped here. The and-escaping is not applied to
  128|       |         * the NodeId identifier part. */
  129|  1.94k|        id->identifierType = UA_NODEIDTYPE_BYTESTRING;
  130|  1.94k|        id->identifier.byteString.data =
  131|  1.94k|            UA_unbase64(str.data, str.length, &id->identifier.byteString.length);
  132|  1.94k|        if(!id->identifier.byteString.data && str.length > 0)
  ------------------
  |  Branch (132:12): [True: 76, False: 1.86k]
  |  Branch (132:47): [True: 76, False: 0]
  ------------------
  133|     76|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     76|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  134|  1.94k|        break;
  135|      0|    default:
  ------------------
  |  Branch (135:5): [True: 0, False: 317k]
  ------------------
  136|      0|        res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  137|      0|        break;
  138|   317k|    }
  139|   317k|    return res;
  140|   317k|}
ua_types_lex.c:parse_expandednodeid:
  335|  4.92k|                     size_t serverUrisSize, const UA_String *serverUris) {
  336|  4.92k|    *id = UA_EXPANDEDNODEID_NULL; /* Reset the NodeId */
  337|  4.92k|    LexContext context;
  338|  4.92k|    memset(&context, 0, sizeof(LexContext));
  339|  4.92k|    const u8 *svr = NULL, *sve = NULL, *svu = NULL,
  340|  4.92k|        *nsu = NULL, *ns = NULL, *body = NULL, *begin = pos;
  341|       |
  342|       |    
  343|  4.92k|{
  344|  4.92k|	u8 yych;
  345|  4.92k|	yych = YYPEEK();
  ------------------
  |  |   31|  4.92k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  4.92k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  4.92k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 4.92k, False: 1]
  |  |  ------------------
  ------------------
  346|  4.92k|	switch (yych) {
  347|    769|		case 'b':
  ------------------
  |  Branch (347:3): [True: 769, False: 4.15k]
  ------------------
  348|    775|		case 'g':
  ------------------
  |  Branch (348:3): [True: 6, False: 4.91k]
  ------------------
  349|  1.01k|		case 'i':
  ------------------
  |  Branch (349:3): [True: 243, False: 4.67k]
  ------------------
  350|  1.01k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|  1.01k|#define YYSTAGN(t) t = NULL
  ------------------
  351|  1.01k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   37|  1.01k|#define YYSTAGN(t) t = NULL
  ------------------
  352|  1.01k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   37|  1.01k|#define YYSTAGN(t) t = NULL
  ------------------
  353|  1.01k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   37|  1.01k|#define YYSTAGN(t) t = NULL
  ------------------
  354|  1.01k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   37|  1.01k|#define YYSTAGN(t) t = NULL
  ------------------
  355|  1.01k|			goto yy18;
  356|  1.54k|		case 'n':
  ------------------
  |  Branch (356:3): [True: 1.54k, False: 3.38k]
  ------------------
  357|  1.54k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|  1.54k|#define YYSTAGN(t) t = NULL
  ------------------
  358|  1.54k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   37|  1.54k|#define YYSTAGN(t) t = NULL
  ------------------
  359|  1.54k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   37|  1.54k|#define YYSTAGN(t) t = NULL
  ------------------
  360|  1.54k|			goto yy19;
  361|  2.36k|		case 's':
  ------------------
  |  Branch (361:3): [True: 2.36k, False: 2.56k]
  ------------------
  362|  2.36k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|  2.36k|#define YYSTAGN(t) t = NULL
  ------------------
  363|  2.36k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   37|  2.36k|#define YYSTAGN(t) t = NULL
  ------------------
  364|  2.36k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   37|  2.36k|#define YYSTAGN(t) t = NULL
  ------------------
  365|  2.36k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   37|  2.36k|#define YYSTAGN(t) t = NULL
  ------------------
  366|  2.36k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   37|  2.36k|#define YYSTAGN(t) t = NULL
  ------------------
  367|  2.36k|			goto yy20;
  368|      3|		default: goto yy16;
  ------------------
  |  Branch (368:3): [True: 3, False: 4.91k]
  ------------------
  369|  4.92k|	}
  370|      3|yy16:
  371|      3|	YYSKIP();
  ------------------
  |  |   33|      3|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|      3|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  372|    387|yy17:
  373|    387|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   43|    387|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  374|  1.01k|yy18:
  375|  1.01k|	YYSKIP();
  ------------------
  |  |   33|  1.01k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.01k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  376|  1.01k|	yych = YYPEEK();
  ------------------
  |  |   31|  1.01k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.01k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.01k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.01k, False: 4]
  |  |  ------------------
  ------------------
  377|  1.01k|	switch (yych) {
  378|    993|		case '=': goto yy21;
  ------------------
  |  Branch (378:3): [True: 993, False: 25]
  ------------------
  379|     25|		default: goto yy17;
  ------------------
  |  Branch (379:3): [True: 25, False: 993]
  ------------------
  380|  1.01k|	}
  381|  1.54k|yy19:
  382|  1.54k|	YYSKIP();
  ------------------
  |  |   33|  1.54k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.54k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  383|  1.54k|	YYBACKUP();
  ------------------
  |  |   34|  1.54k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   30|  1.54k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  1.54k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  384|  1.54k|	yych = YYPEEK();
  ------------------
  |  |   31|  1.54k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.54k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.53k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.53k, False: 1]
  |  |  ------------------
  ------------------
  385|  1.54k|	switch (yych) {
  386|  1.52k|		case 's': goto yy22;
  ------------------
  |  Branch (386:3): [True: 1.52k, False: 15]
  ------------------
  387|     15|		default: goto yy17;
  ------------------
  |  Branch (387:3): [True: 15, False: 1.52k]
  ------------------
  388|  1.54k|	}
  389|  2.36k|yy20:
  390|  2.36k|	YYSKIP();
  ------------------
  |  |   33|  2.36k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  2.36k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  391|  2.36k|	YYBACKUP();
  ------------------
  |  |   34|  2.36k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   30|  2.36k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  2.36k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  392|  2.36k|	yych = YYPEEK();
  ------------------
  |  |   31|  2.36k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  2.36k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  2.35k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 2.35k, False: 1]
  |  |  ------------------
  ------------------
  393|  2.36k|	switch (yych) {
  394|    476|		case '=': goto yy21;
  ------------------
  |  Branch (394:3): [True: 476, False: 1.88k]
  ------------------
  395|  1.88k|		case 'v': goto yy24;
  ------------------
  |  Branch (395:3): [True: 1.88k, False: 480]
  ------------------
  396|      4|		default: goto yy17;
  ------------------
  |  Branch (396:3): [True: 4, False: 2.35k]
  ------------------
  397|  2.36k|	}
  398|  4.53k|yy21:
  399|  4.53k|	YYSKIP();
  ------------------
  |  |   33|  4.53k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  4.53k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  400|  4.53k|	svr = context.yyt5;
  401|  4.53k|	svu = context.yyt1;
  402|  4.53k|	sve = context.yyt2;
  403|  4.53k|	ns = context.yyt3;
  404|  4.53k|	nsu = context.yyt4;
  405|  4.53k|	YYSTAGP(body);
  ------------------
  |  |   36|  4.53k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  4.53k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  406|  4.53k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   38|  4.53k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  407|  4.53k|	{ goto match; }
  408|  2.05k|yy22:
  409|  2.05k|	YYSKIP();
  ------------------
  |  |   33|  2.05k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  2.05k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  410|  2.05k|	yych = YYPEEK();
  ------------------
  |  |   31|  2.05k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  2.05k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  2.05k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 2.05k, False: 2]
  |  |  ------------------
  ------------------
  411|  2.05k|	switch (yych) {
  412|    335|		case '=': goto yy25;
  ------------------
  |  Branch (412:3): [True: 335, False: 1.71k]
  ------------------
  413|  1.71k|		case 'u': goto yy26;
  ------------------
  |  Branch (413:3): [True: 1.71k, False: 337]
  ------------------
  414|      2|		default: goto yy23;
  ------------------
  |  Branch (414:3): [True: 2, False: 2.05k]
  ------------------
  415|  2.05k|	}
  416|    340|yy23:
  417|    340|	YYRESTORE();
  ------------------
  |  |   35|    340|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   29|    340|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   30|    340|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  418|    340|	goto yy17;
  419|  1.88k|yy24:
  420|  1.88k|	YYSKIP();
  ------------------
  |  |   33|  1.88k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.88k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  421|  1.88k|	yych = YYPEEK();
  ------------------
  |  |   31|  1.88k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.88k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.87k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.87k, False: 1]
  |  |  ------------------
  ------------------
  422|  1.88k|	switch (yych) {
  423|    633|		case 'r': goto yy27;
  ------------------
  |  Branch (423:3): [True: 633, False: 1.24k]
  ------------------
  424|  1.24k|		case 'u': goto yy28;
  ------------------
  |  Branch (424:3): [True: 1.24k, False: 634]
  ------------------
  425|      1|		default: goto yy23;
  ------------------
  |  Branch (425:3): [True: 1, False: 1.87k]
  ------------------
  426|  1.88k|	}
  427|    335|yy25:
  428|    335|	YYSKIP();
  ------------------
  |  |   33|    335|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    335|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  429|    335|	yych = YYPEEK();
  ------------------
  |  |   31|    335|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    335|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    333|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 333, False: 2]
  |  |  ------------------
  ------------------
  430|    335|	switch (yych) {
  431|    169|		case '0':
  ------------------
  |  Branch (431:3): [True: 169, False: 166]
  ------------------
  432|    181|		case '1':
  ------------------
  |  Branch (432:3): [True: 12, False: 323]
  ------------------
  433|    199|		case '2':
  ------------------
  |  Branch (433:3): [True: 18, False: 317]
  ------------------
  434|    240|		case '3':
  ------------------
  |  Branch (434:3): [True: 41, False: 294]
  ------------------
  435|    247|		case '4':
  ------------------
  |  Branch (435:3): [True: 7, False: 328]
  ------------------
  436|    253|		case '5':
  ------------------
  |  Branch (436:3): [True: 6, False: 329]
  ------------------
  437|    308|		case '6':
  ------------------
  |  Branch (437:3): [True: 55, False: 280]
  ------------------
  438|    317|		case '7':
  ------------------
  |  Branch (438:3): [True: 9, False: 326]
  ------------------
  439|    327|		case '8':
  ------------------
  |  Branch (439:3): [True: 10, False: 325]
  ------------------
  440|    327|		case '9':
  ------------------
  |  Branch (440:3): [True: 0, False: 335]
  ------------------
  441|    327|			YYSTAGP(context.yyt3);
  ------------------
  |  |   36|    327|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    327|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  442|    327|			goto yy29;
  443|      8|		default: goto yy23;
  ------------------
  |  Branch (443:3): [True: 8, False: 327]
  ------------------
  444|    335|	}
  445|  1.71k|yy26:
  446|  1.71k|	YYSKIP();
  ------------------
  |  |   33|  1.71k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.71k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  447|  1.71k|	yych = YYPEEK();
  ------------------
  |  |   31|  1.71k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.71k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.71k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.71k, False: 1]
  |  |  ------------------
  ------------------
  448|  1.71k|	switch (yych) {
  449|  1.70k|		case '=': goto yy30;
  ------------------
  |  Branch (449:3): [True: 1.70k, False: 9]
  ------------------
  450|      9|		default: goto yy23;
  ------------------
  |  Branch (450:3): [True: 9, False: 1.70k]
  ------------------
  451|  1.71k|	}
  452|    633|yy27:
  453|    633|	YYSKIP();
  ------------------
  |  |   33|    633|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    633|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  454|    633|	yych = YYPEEK();
  ------------------
  |  |   31|    633|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    633|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    632|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 632, False: 1]
  |  |  ------------------
  ------------------
  455|    633|	switch (yych) {
  456|    621|		case '=': goto yy31;
  ------------------
  |  Branch (456:3): [True: 621, False: 12]
  ------------------
  457|     12|		default: goto yy23;
  ------------------
  |  Branch (457:3): [True: 12, False: 621]
  ------------------
  458|    633|	}
  459|  1.24k|yy28:
  460|  1.24k|	YYSKIP();
  ------------------
  |  |   33|  1.24k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.24k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  461|  1.24k|	yych = YYPEEK();
  ------------------
  |  |   31|  1.24k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.24k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.24k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.24k, False: 1]
  |  |  ------------------
  ------------------
  462|  1.24k|	switch (yych) {
  463|  1.24k|		case '=': goto yy32;
  ------------------
  |  Branch (463:3): [True: 1.24k, False: 1]
  ------------------
  464|      1|		default: goto yy23;
  ------------------
  |  Branch (464:3): [True: 1, False: 1.24k]
  ------------------
  465|  1.24k|	}
  466|  12.8k|yy29:
  467|  12.8k|	YYSKIP();
  ------------------
  |  |   33|  12.8k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  12.8k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  468|  12.8k|	yych = YYPEEK();
  ------------------
  |  |   31|  12.8k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  12.8k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  12.8k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 12.8k, False: 83]
  |  |  ------------------
  ------------------
  469|  12.8k|	switch (yych) {
  470|  3.40k|		case '0':
  ------------------
  |  Branch (470:3): [True: 3.40k, False: 9.48k]
  ------------------
  471|  5.88k|		case '1':
  ------------------
  |  Branch (471:3): [True: 2.47k, False: 10.4k]
  ------------------
  472|  6.52k|		case '2':
  ------------------
  |  Branch (472:3): [True: 641, False: 12.2k]
  ------------------
  473|  7.22k|		case '3':
  ------------------
  |  Branch (473:3): [True: 702, False: 12.1k]
  ------------------
  474|  8.51k|		case '4':
  ------------------
  |  Branch (474:3): [True: 1.29k, False: 11.5k]
  ------------------
  475|  9.32k|		case '5':
  ------------------
  |  Branch (475:3): [True: 804, False: 12.0k]
  ------------------
  476|  10.1k|		case '6':
  ------------------
  |  Branch (476:3): [True: 786, False: 12.1k]
  ------------------
  477|  10.7k|		case '7':
  ------------------
  |  Branch (477:3): [True: 657, False: 12.2k]
  ------------------
  478|  11.2k|		case '8':
  ------------------
  |  Branch (478:3): [True: 445, False: 12.4k]
  ------------------
  479|  12.5k|		case '9': goto yy29;
  ------------------
  |  Branch (479:3): [True: 1.34k, False: 11.5k]
  ------------------
  480|    228|		case ';':
  ------------------
  |  Branch (480:3): [True: 228, False: 12.6k]
  ------------------
  481|    228|			YYSTAGN(context.yyt4);
  ------------------
  |  |   37|    228|#define YYSTAGN(t) t = NULL
  ------------------
  482|    228|			goto yy33;
  483|     99|		default: goto yy23;
  ------------------
  |  Branch (483:3): [True: 99, False: 12.7k]
  ------------------
  484|  12.8k|	}
  485|  1.70k|yy30:
  486|  1.70k|	YYSKIP();
  ------------------
  |  |   33|  1.70k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.70k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  487|  1.70k|	yych = YYPEEK();
  ------------------
  |  |   31|  1.70k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.70k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.70k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.70k, False: 1]
  |  |  ------------------
  ------------------
  488|  1.70k|	switch (yych) {
  489|      1|		case 0x00: goto yy23;
  ------------------
  |  Branch (489:3): [True: 1, False: 1.70k]
  ------------------
  490|    553|		case ';':
  ------------------
  |  Branch (490:3): [True: 553, False: 1.15k]
  ------------------
  491|    553|			YYSTAGN(context.yyt3);
  ------------------
  |  |   37|    553|#define YYSTAGN(t) t = NULL
  ------------------
  492|    553|			YYSTAGP(context.yyt4);
  ------------------
  |  |   36|    553|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    553|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  493|    553|			goto yy33;
  494|  1.15k|		default:
  ------------------
  |  Branch (494:3): [True: 1.15k, False: 554]
  ------------------
  495|  1.15k|			YYSTAGP(context.yyt4);
  ------------------
  |  |   36|  1.15k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  1.15k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  496|  1.15k|			goto yy34;
  497|  1.70k|	}
  498|    621|yy31:
  499|    621|	YYSKIP();
  ------------------
  |  |   33|    621|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    621|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  500|    621|	yych = YYPEEK();
  ------------------
  |  |   31|    621|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    621|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    620|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 620, False: 1]
  |  |  ------------------
  ------------------
  501|    621|	switch (yych) {
  502|    467|		case '0':
  ------------------
  |  Branch (502:3): [True: 467, False: 154]
  ------------------
  503|    502|		case '1':
  ------------------
  |  Branch (503:3): [True: 35, False: 586]
  ------------------
  504|    516|		case '2':
  ------------------
  |  Branch (504:3): [True: 14, False: 607]
  ------------------
  505|    537|		case '3':
  ------------------
  |  Branch (505:3): [True: 21, False: 600]
  ------------------
  506|    549|		case '4':
  ------------------
  |  Branch (506:3): [True: 12, False: 609]
  ------------------
  507|    569|		case '5':
  ------------------
  |  Branch (507:3): [True: 20, False: 601]
  ------------------
  508|    574|		case '6':
  ------------------
  |  Branch (508:3): [True: 5, False: 616]
  ------------------
  509|    586|		case '7':
  ------------------
  |  Branch (509:3): [True: 12, False: 609]
  ------------------
  510|    602|		case '8':
  ------------------
  |  Branch (510:3): [True: 16, False: 605]
  ------------------
  511|    615|		case '9':
  ------------------
  |  Branch (511:3): [True: 13, False: 608]
  ------------------
  512|    615|			YYSTAGP(context.yyt5);
  ------------------
  |  |   36|    615|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    615|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  513|    615|			goto yy35;
  514|      6|		default: goto yy23;
  ------------------
  |  Branch (514:3): [True: 6, False: 615]
  ------------------
  515|    621|	}
  516|  1.24k|yy32:
  517|  1.24k|	YYSKIP();
  ------------------
  |  |   33|  1.24k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.24k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  518|  1.24k|	yych = YYPEEK();
  ------------------
  |  |   31|  1.24k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.24k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.24k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.24k, False: 1]
  |  |  ------------------
  ------------------
  519|  1.24k|	switch (yych) {
  520|      1|		case 0x00: goto yy23;
  ------------------
  |  Branch (520:3): [True: 1, False: 1.24k]
  ------------------
  521|    234|		case ';':
  ------------------
  |  Branch (521:3): [True: 234, False: 1.01k]
  ------------------
  522|    234|			YYSTAGP(context.yyt1);
  ------------------
  |  |   36|    234|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    234|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  523|    234|			YYSTAGP(context.yyt2);
  ------------------
  |  |   36|    234|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    234|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  524|    234|			YYSTAGN(context.yyt5);
  ------------------
  |  |   37|    234|#define YYSTAGN(t) t = NULL
  ------------------
  525|    234|			goto yy37;
  526|  1.01k|		default:
  ------------------
  |  Branch (526:3): [True: 1.01k, False: 235]
  ------------------
  527|  1.01k|			YYSTAGP(context.yyt1);
  ------------------
  |  |   36|  1.01k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  1.01k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  528|  1.01k|			goto yy36;
  529|  1.24k|	}
  530|  1.92k|yy33:
  531|  1.92k|	YYSKIP();
  ------------------
  |  |   33|  1.92k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.92k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  532|  1.92k|	yych = YYPEEK();
  ------------------
  |  |   31|  1.92k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.92k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.91k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.91k, False: 3]
  |  |  ------------------
  ------------------
  533|  1.92k|	switch (yych) {
  534|    362|		case 'b':
  ------------------
  |  Branch (534:3): [True: 362, False: 1.56k]
  ------------------
  535|    558|		case 'g':
  ------------------
  |  Branch (535:3): [True: 196, False: 1.72k]
  ------------------
  536|    895|		case 'i':
  ------------------
  |  Branch (536:3): [True: 337, False: 1.58k]
  ------------------
  537|  1.91k|		case 's': goto yy38;
  ------------------
  |  Branch (537:3): [True: 1.01k, False: 907]
  ------------------
  538|     12|		default: goto yy23;
  ------------------
  |  Branch (538:3): [True: 12, False: 1.91k]
  ------------------
  539|  1.92k|	}
  540|  56.3k|yy34:
  541|  56.3k|	YYSKIP();
  ------------------
  |  |   33|  56.3k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  56.3k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  542|  56.3k|	yych = YYPEEK();
  ------------------
  |  |   31|  56.3k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  56.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  56.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 56.3k, False: 13]
  |  |  ------------------
  ------------------
  543|  56.3k|	switch (yych) {
  544|     13|		case 0x00: goto yy23;
  ------------------
  |  Branch (544:3): [True: 13, False: 56.3k]
  ------------------
  545|  1.14k|		case ';':
  ------------------
  |  Branch (545:3): [True: 1.14k, False: 55.2k]
  ------------------
  546|  1.14k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   37|  1.14k|#define YYSTAGN(t) t = NULL
  ------------------
  547|  1.14k|			goto yy33;
  548|  55.2k|		default: goto yy34;
  ------------------
  |  Branch (548:3): [True: 55.2k, False: 1.15k]
  ------------------
  549|  56.3k|	}
  550|  6.03k|yy35:
  551|  6.03k|	YYSKIP();
  ------------------
  |  |   33|  6.03k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  6.03k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  552|  6.03k|	yych = YYPEEK();
  ------------------
  |  |   31|  6.03k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  6.03k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  5.95k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 5.95k, False: 85]
  |  |  ------------------
  ------------------
  553|  6.03k|	switch (yych) {
  554|  1.03k|		case '0':
  ------------------
  |  Branch (554:3): [True: 1.03k, False: 5.00k]
  ------------------
  555|  1.39k|		case '1':
  ------------------
  |  Branch (555:3): [True: 356, False: 5.68k]
  ------------------
  556|  1.67k|		case '2':
  ------------------
  |  Branch (556:3): [True: 285, False: 5.75k]
  ------------------
  557|  2.14k|		case '3':
  ------------------
  |  Branch (557:3): [True: 472, False: 5.56k]
  ------------------
  558|  2.43k|		case '4':
  ------------------
  |  Branch (558:3): [True: 282, False: 5.75k]
  ------------------
  559|  3.59k|		case '5':
  ------------------
  |  Branch (559:3): [True: 1.16k, False: 4.86k]
  ------------------
  560|  3.85k|		case '6':
  ------------------
  |  Branch (560:3): [True: 254, False: 5.78k]
  ------------------
  561|  4.66k|		case '7':
  ------------------
  |  Branch (561:3): [True: 815, False: 5.22k]
  ------------------
  562|  4.97k|		case '8':
  ------------------
  |  Branch (562:3): [True: 310, False: 5.72k]
  ------------------
  563|  5.42k|		case '9': goto yy35;
  ------------------
  |  Branch (563:3): [True: 443, False: 5.59k]
  ------------------
  564|    506|		case ';':
  ------------------
  |  Branch (564:3): [True: 506, False: 5.53k]
  ------------------
  565|    506|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|    506|#define YYSTAGN(t) t = NULL
  ------------------
  566|    506|			YYSTAGP(context.yyt2);
  ------------------
  |  |   36|    506|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    506|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  567|    506|			goto yy37;
  568|    109|		default: goto yy23;
  ------------------
  |  Branch (568:3): [True: 109, False: 5.92k]
  ------------------
  569|  6.03k|	}
  570|  3.25M|yy36:
  571|  3.25M|	YYSKIP();
  ------------------
  |  |   33|  3.25M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  3.25M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  572|  3.25M|	yych = YYPEEK();
  ------------------
  |  |   31|  3.25M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  3.25M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  3.25M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 3.25M, False: 29]
  |  |  ------------------
  ------------------
  573|  3.25M|	switch (yych) {
  574|     29|		case 0x00: goto yy23;
  ------------------
  |  Branch (574:3): [True: 29, False: 3.25M]
  ------------------
  575|    981|		case ';':
  ------------------
  |  Branch (575:3): [True: 981, False: 3.25M]
  ------------------
  576|    981|			YYSTAGP(context.yyt2);
  ------------------
  |  |   36|    981|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    981|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  577|    981|			YYSTAGN(context.yyt5);
  ------------------
  |  |   37|    981|#define YYSTAGN(t) t = NULL
  ------------------
  578|    981|			goto yy37;
  579|  3.25M|		default: goto yy36;
  ------------------
  |  Branch (579:3): [True: 3.25M, False: 1.01k]
  ------------------
  580|  3.25M|	}
  581|  1.72k|yy37:
  582|  1.72k|	YYSKIP();
  ------------------
  |  |   33|  1.72k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.72k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  583|  1.72k|	yych = YYPEEK();
  ------------------
  |  |   31|  1.72k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.72k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.71k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.71k, False: 3]
  |  |  ------------------
  ------------------
  584|  1.72k|	switch (yych) {
  585|    217|		case 'b':
  ------------------
  |  Branch (585:3): [True: 217, False: 1.50k]
  ------------------
  586|    564|		case 'g':
  ------------------
  |  Branch (586:3): [True: 347, False: 1.37k]
  ------------------
  587|    777|		case 'i':
  ------------------
  |  Branch (587:3): [True: 213, False: 1.50k]
  ------------------
  588|  1.18k|		case 's':
  ------------------
  |  Branch (588:3): [True: 403, False: 1.31k]
  ------------------
  589|  1.18k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   37|  1.18k|#define YYSTAGN(t) t = NULL
  ------------------
  590|  1.18k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   37|  1.18k|#define YYSTAGN(t) t = NULL
  ------------------
  591|  1.18k|			goto yy38;
  592|    536|		case 'n': goto yy39;
  ------------------
  |  Branch (592:3): [True: 536, False: 1.18k]
  ------------------
  593|      5|		default: goto yy23;
  ------------------
  |  Branch (593:3): [True: 5, False: 1.71k]
  ------------------
  594|  1.72k|	}
  595|  3.09k|yy38:
  596|  3.09k|	YYSKIP();
  ------------------
  |  |   33|  3.09k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  3.09k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  597|  3.09k|	yych = YYPEEK();
  ------------------
  |  |   31|  3.09k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  3.09k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  3.07k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 3.07k, False: 11]
  |  |  ------------------
  ------------------
  598|  3.09k|	switch (yych) {
  599|  3.06k|		case '=': goto yy21;
  ------------------
  |  Branch (599:3): [True: 3.06k, False: 25]
  ------------------
  600|     25|		default: goto yy23;
  ------------------
  |  Branch (600:3): [True: 25, False: 3.06k]
  ------------------
  601|  3.09k|	}
  602|    536|yy39:
  603|    536|	YYSKIP();
  ------------------
  |  |   33|    536|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    536|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  604|    536|	yych = YYPEEK();
  ------------------
  |  |   31|    536|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    536|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    535|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 535, False: 1]
  |  |  ------------------
  ------------------
  605|    536|	switch (yych) {
  606|    529|		case 's': goto yy22;
  ------------------
  |  Branch (606:3): [True: 529, False: 7]
  ------------------
  607|      7|		default: goto yy23;
  ------------------
  |  Branch (607:3): [True: 7, False: 529]
  ------------------
  608|    536|	}
  609|    536|}
  610|       |
  611|       |
  612|  4.53k| match:
  613|  4.53k|    if(svu) {
  ------------------
  |  Branch (613:8): [True: 1.19k, False: 3.33k]
  ------------------
  614|       |        /* ServerUri */
  615|  1.19k|        UA_String serverUri = {(size_t)(sve - svu), (UA_Byte*)(uintptr_t)svu};
  616|  1.19k|        size_t i = 0;
  617|  1.19k|        for(; i < serverUrisSize; i++) {
  ------------------
  |  Branch (617:15): [True: 0, False: 1.19k]
  ------------------
  618|      0|            if(UA_String_equal(&serverUri, &serverUris[i]))
  ------------------
  |  Branch (618:16): [True: 0, False: 0]
  ------------------
  619|      0|                break;
  620|      0|        }
  621|  1.19k|        if(i == serverUrisSize) {
  ------------------
  |  Branch (621:12): [True: 1.19k, False: 0]
  ------------------
  622|       |            /* The ServerUri cannot be mapped. Return the entire input as a
  623|       |             * string NodeId. */
  624|  1.19k|            UA_String total = {(size_t)(end - begin), (UA_Byte*)(uintptr_t)begin};
  625|  1.19k|            id->nodeId.identifierType = UA_NODEIDTYPE_STRING;
  626|  1.19k|            return UA_String_copy(&total, &id->nodeId.identifier.string);
  627|  1.19k|        }
  628|      0|        id->serverIndex = (UA_UInt32)i;
  629|  3.33k|    } else if(svr) {
  ------------------
  |  Branch (629:15): [True: 497, False: 2.84k]
  ------------------
  630|       |        /* ServerIndex */
  631|    497|        size_t len = (size_t)(sve - svr);
  632|    497|        if(UA_readNumber((const UA_Byte*)svr, len, &id->serverIndex) != len)
  ------------------
  |  Branch (632:12): [True: 0, False: 497]
  ------------------
  633|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  634|    497|    }
  635|       |
  636|  3.33k|    if(nsu) {
  ------------------
  |  Branch (636:8): [True: 1.47k, False: 1.85k]
  ------------------
  637|       |        /* NamespaceUri */
  638|  1.47k|        UA_String nsuri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  639|  1.47k|        UA_StatusCode res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|  1.47k|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  640|       |        /* Try to map the NamespaceUri to its NamespaceIndex for ServerIndex == 0.
  641|       |         * If this fails, keep the full NamespaceUri. */
  642|  1.47k|        if(id->serverIndex == 0)
  ------------------
  |  Branch (642:12): [True: 1.14k, False: 329]
  ------------------
  643|  1.14k|            res = escapedUri2Index(nsuri, &id->nodeId.namespaceIndex, nsMapping);
  644|  1.47k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  1.47k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (644:12): [True: 1.47k, False: 0]
  ------------------
  645|  1.47k|            res = UA_String_copy(&nsuri, &id->namespaceUri); /* Keep the Uri without mapping */
  646|  1.47k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  1.47k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (646:12): [True: 0, False: 1.47k]
  ------------------
  647|      0|            return res;
  648|  1.85k|    } else if(ns) {
  ------------------
  |  Branch (648:15): [True: 224, False: 1.63k]
  ------------------
  649|       |        /* NamespaceIndex */
  650|    224|        UA_UInt32 tmp;
  651|    224|        size_t len = (size_t)(body - 1 - ns);
  652|    224|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (652:12): [True: 0, False: 224]
  ------------------
  653|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  654|    224|        id->nodeId.namespaceIndex = (UA_UInt16)tmp;
  655|    224|        if(nsMapping)
  ------------------
  |  Branch (655:12): [True: 0, False: 224]
  ------------------
  656|      0|            id->nodeId.namespaceIndex =
  657|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->nodeId.namespaceIndex);
  658|    224|    }
  659|       |
  660|       |    /* From the current position until the end */
  661|  3.33k|    return parse_nodeid_body(&id->nodeId, body, end, idEsc);
  662|  3.33k|}
ua_types_lex.c:parse_qn:
  699|  28.1k|         UA_UInt16 defaultNamespaceIndex) {
  700|  28.1k|    size_t len;
  701|  28.1k|    UA_UInt32 tmp;
  702|  28.1k|    UA_String str;
  703|  28.1k|    UA_StatusCode res;
  704|       |
  705|  28.1k|    LexContext context;
  706|  28.1k|    memset(&context, 0, sizeof(LexContext));
  707|       |
  708|  28.1k|    const u8 *begin = pos;
  709|  28.1k|    UA_QualifiedName_init(qn);
  710|  28.1k|    qn->namespaceIndex = defaultNamespaceIndex;
  711|       |
  712|       |    
  713|  28.1k|{
  714|  28.1k|	u8 yych;
  715|  28.1k|	yych = YYPEEK();
  ------------------
  |  |   31|  28.1k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  28.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  27.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 27.3k, False: 822]
  |  |  ------------------
  ------------------
  716|  28.1k|	switch (yych) {
  717|    822|		case 0x00:
  ------------------
  |  Branch (717:3): [True: 822, False: 27.3k]
  ------------------
  718|  1.15k|		case ';': goto yy41;
  ------------------
  |  Branch (718:3): [True: 328, False: 27.8k]
  ------------------
  719|  1.76k|		case '0':
  ------------------
  |  Branch (719:3): [True: 1.76k, False: 26.3k]
  ------------------
  720|  2.73k|		case '1':
  ------------------
  |  Branch (720:3): [True: 969, False: 27.1k]
  ------------------
  721|  6.79k|		case '2':
  ------------------
  |  Branch (721:3): [True: 4.06k, False: 24.0k]
  ------------------
  722|  7.12k|		case '3':
  ------------------
  |  Branch (722:3): [True: 327, False: 27.8k]
  ------------------
  723|  17.8k|		case '4':
  ------------------
  |  Branch (723:3): [True: 10.6k, False: 17.4k]
  ------------------
  724|  18.3k|		case '5':
  ------------------
  |  Branch (724:3): [True: 512, False: 27.6k]
  ------------------
  725|  18.9k|		case '6':
  ------------------
  |  Branch (725:3): [True: 576, False: 27.5k]
  ------------------
  726|  19.4k|		case '7':
  ------------------
  |  Branch (726:3): [True: 533, False: 27.6k]
  ------------------
  727|  22.8k|		case '8':
  ------------------
  |  Branch (727:3): [True: 3.40k, False: 24.7k]
  ------------------
  728|  24.1k|		case '9': goto yy44;
  ------------------
  |  Branch (728:3): [True: 1.29k, False: 26.8k]
  ------------------
  729|  2.86k|		default: goto yy43;
  ------------------
  |  Branch (729:3): [True: 2.86k, False: 25.2k]
  ------------------
  730|  28.1k|	}
  731|  1.15k|yy41:
  732|  1.15k|	YYSKIP();
  ------------------
  |  |   33|  1.15k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.15k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  733|  26.7k|yy42:
  734|  26.7k|	{ pos = begin; goto match_name; }
  735|  2.86k|yy43:
  736|  2.86k|	YYSKIP();
  ------------------
  |  |   33|  2.86k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  2.86k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  737|  2.86k|	YYBACKUP();
  ------------------
  |  |   34|  2.86k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   30|  2.86k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  2.86k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  738|  2.86k|	yych = YYPEEK();
  ------------------
  |  |   31|  2.86k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  2.86k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  2.37k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 2.37k, False: 491]
  |  |  ------------------
  ------------------
  739|  2.86k|	if (yych <= 0x00) goto yy42;
  ------------------
  |  Branch (739:6): [True: 491, False: 2.37k]
  ------------------
  740|  2.37k|	goto yy46;
  741|  24.1k|yy44:
  742|  24.1k|	YYSKIP();
  ------------------
  |  |   33|  24.1k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  24.1k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  743|  24.1k|	YYBACKUP();
  ------------------
  |  |   34|  24.1k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   30|  24.1k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  24.1k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  744|  24.1k|	yych = YYPEEK();
  ------------------
  |  |   31|  24.1k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  24.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  22.8k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 22.8k, False: 1.24k]
  |  |  ------------------
  ------------------
  745|  24.1k|	switch (yych) {
  746|  1.07k|		case '0':
  ------------------
  |  Branch (746:3): [True: 1.07k, False: 23.0k]
  ------------------
  747|  2.39k|		case '1':
  ------------------
  |  Branch (747:3): [True: 1.32k, False: 22.8k]
  ------------------
  748|  2.50k|		case '2':
  ------------------
  |  Branch (748:3): [True: 109, False: 24.0k]
  ------------------
  749|  3.78k|		case '3':
  ------------------
  |  Branch (749:3): [True: 1.27k, False: 22.8k]
  ------------------
  750|  7.26k|		case '4':
  ------------------
  |  Branch (750:3): [True: 3.48k, False: 20.6k]
  ------------------
  751|  7.75k|		case '5':
  ------------------
  |  Branch (751:3): [True: 488, False: 23.6k]
  ------------------
  752|  7.90k|		case '6':
  ------------------
  |  Branch (752:3): [True: 149, False: 23.9k]
  ------------------
  753|  8.13k|		case '7':
  ------------------
  |  Branch (753:3): [True: 235, False: 23.8k]
  ------------------
  754|  9.97k|		case '8':
  ------------------
  |  Branch (754:3): [True: 1.84k, False: 22.2k]
  ------------------
  755|  10.5k|		case '9':
  ------------------
  |  Branch (755:3): [True: 564, False: 23.5k]
  ------------------
  756|  10.6k|		case ':': goto yy50;
  ------------------
  |  Branch (756:3): [True: 74, False: 24.0k]
  ------------------
  757|  13.5k|		default: goto yy42;
  ------------------
  |  Branch (757:3): [True: 13.5k, False: 10.6k]
  ------------------
  758|  24.1k|	}
  759|   197k|yy45:
  760|   197k|	YYSKIP();
  ------------------
  |  |   33|   197k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|   197k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  761|   197k|	yych = YYPEEK();
  ------------------
  |  |   31|   197k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   197k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   195k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 195k, False: 2.07k]
  |  |  ------------------
  ------------------
  762|   200k|yy46:
  763|   200k|	switch (yych) {
  764|  2.08k|		case 0x00: goto yy47;
  ------------------
  |  Branch (764:3): [True: 2.08k, False: 198k]
  ------------------
  765|    291|		case ';': goto yy48;
  ------------------
  |  Branch (765:3): [True: 291, False: 200k]
  ------------------
  766|   197k|		default: goto yy45;
  ------------------
  |  Branch (766:3): [True: 197k, False: 2.37k]
  ------------------
  767|   200k|	}
  768|  11.5k|yy47:
  769|  11.5k|	YYRESTORE();
  ------------------
  |  |   35|  11.5k|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   29|  11.5k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   30|  11.5k|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  770|  11.5k|	goto yy42;
  771|    291|yy48:
  772|    291|	YYSKIP();
  ------------------
  |  |   33|    291|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    291|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  773|    291|	{ goto match_uri; }
  774|  81.7k|yy49:
  775|  81.7k|	YYSKIP();
  ------------------
  |  |   33|  81.7k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  81.7k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  776|  81.7k|	yych = YYPEEK();
  ------------------
  |  |   31|  81.7k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  81.7k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  79.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 79.3k, False: 2.45k]
  |  |  ------------------
  ------------------
  777|  92.3k|yy50:
  778|  92.3k|	switch (yych) {
  779|  44.7k|		case '0':
  ------------------
  |  Branch (779:3): [True: 44.7k, False: 47.6k]
  ------------------
  780|  58.2k|		case '1':
  ------------------
  |  Branch (780:3): [True: 13.4k, False: 78.9k]
  ------------------
  781|  59.1k|		case '2':
  ------------------
  |  Branch (781:3): [True: 951, False: 91.4k]
  ------------------
  782|  61.3k|		case '3':
  ------------------
  |  Branch (782:3): [True: 2.18k, False: 90.1k]
  ------------------
  783|  68.7k|		case '4':
  ------------------
  |  Branch (783:3): [True: 7.41k, False: 84.9k]
  ------------------
  784|  70.4k|		case '5':
  ------------------
  |  Branch (784:3): [True: 1.64k, False: 90.7k]
  ------------------
  785|  72.7k|		case '6':
  ------------------
  |  Branch (785:3): [True: 2.36k, False: 90.0k]
  ------------------
  786|  73.6k|		case '7':
  ------------------
  |  Branch (786:3): [True: 868, False: 91.5k]
  ------------------
  787|  79.9k|		case '8':
  ------------------
  |  Branch (787:3): [True: 6.33k, False: 86.0k]
  ------------------
  788|  81.7k|		case '9': goto yy49;
  ------------------
  |  Branch (788:3): [True: 1.77k, False: 90.5k]
  ------------------
  789|  1.14k|		case ':': goto yy51;
  ------------------
  |  Branch (789:3): [True: 1.14k, False: 91.2k]
  ------------------
  790|  9.46k|		default: goto yy47;
  ------------------
  |  Branch (790:3): [True: 9.46k, False: 82.9k]
  ------------------
  791|  92.3k|	}
  792|  1.14k|yy51:
  793|  1.14k|	YYSKIP();
  ------------------
  |  |   33|  1.14k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.14k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  794|  1.14k|	{ goto match_index; }
  795|  92.3k|}
  796|       |
  797|       |
  798|  1.14k| match_index:
  799|  1.14k|    len = (size_t)(pos - 1 - begin);
  800|  1.14k|    if(UA_readNumber((const UA_Byte*)begin, len, &tmp) != len)
  ------------------
  |  Branch (800:8): [True: 0, False: 1.14k]
  ------------------
  801|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  802|  1.14k|    qn->namespaceIndex = (UA_UInt16)tmp;
  803|  1.14k|    goto match_name;
  804|       |
  805|    291| match_uri:
  806|    291|    str.length = (size_t)(pos - 1 - begin);
  807|    291|    str.data = (UA_Byte*)(uintptr_t)begin;
  808|    291|    res = escapedUri2Index(str, &qn->namespaceIndex, nsMapping);
  809|    291|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    291|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (809:8): [True: 291, False: 0]
  ------------------
  810|    291|        pos = begin; /* Use the entire string for the name */
  811|       |
  812|  28.1k| match_name:
  813|  28.1k|    str.length = (size_t)(end - pos);
  814|  28.1k|    str.data = (UA_Byte*)(uintptr_t)pos;
  815|  28.1k|    res = UA_String_copy(&str, &qn->name);
  816|  28.1k|    if(UA_LIKELY(res == UA_STATUSCODE_GOOD))
  ------------------
  |  |  590|  28.1k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (590:23): [True: 28.1k, False: 0]
  |  |  ------------------
  ------------------
  817|  28.1k|        res = UA_String_unescape(&qn->name, false, escName);
  818|  28.1k|    return res;
  819|    291|}

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

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

UA_memoryManager_setLimitFromLast4Bytes:
  156|  7.22k|int UA_memoryManager_setLimitFromLast4Bytes(const uint8_t *data, size_t size) {
  157|  7.22k|    UA_mallocSingleton = UA_memoryManager_malloc;
  158|  7.22k|    UA_freeSingleton = UA_memoryManager_free;
  159|  7.22k|    UA_callocSingleton = UA_memoryManager_calloc;
  160|  7.22k|    UA_reallocSingleton = UA_memoryManager_realloc;
  161|  7.22k|    if(size <4)
  ------------------
  |  Branch (161:8): [True: 0, False: 7.22k]
  ------------------
  162|      0|        return 0;
  163|       |    // just cast the last 4 bytes to uint32
  164|  7.22k|    const uint32_t *newLimit = (const uint32_t*)(uintptr_t)&(data[size-4]);
  165|  7.22k|    uint32_t limit;
  166|       |    // use memcopy to avoid asan complaining on misaligned memory
  167|  7.22k|    memcpy(&limit, newLimit, sizeof(uint32_t));
  168|  7.22k|    memoryLimit = limit;
  169|  7.22k|    return 1;
  170|  7.22k|}
custom_memory_manager.c:UA_memoryManager_malloc:
  109|   437k|static void *UA_memoryManager_malloc(size_t size) {
  110|   437k|    if(totalMemorySize + size > memoryLimit)
  ------------------
  |  Branch (110:8): [True: 28, False: 437k]
  ------------------
  111|     28|        return NULL;
  112|   437k|    void *addr = malloc(size);
  113|   437k|    if(!addr)
  ------------------
  |  Branch (113:8): [True: 0, False: 437k]
  ------------------
  114|      0|        return NULL;
  115|   437k|    addToMap(size, addr);
  116|   437k|    return addr;
  117|   437k|}
custom_memory_manager.c:addToMap:
   47|   911k|static int addToMap(size_t size, void *addr) {
   48|   911k|    struct UA_mm_entry *newEntry = (struct UA_mm_entry*)malloc(sizeof(struct UA_mm_entry));
   49|   911k|    if(!newEntry) {
  ------------------
  |  Branch (49:8): [True: 0, False: 911k]
  ------------------
   50|       |        //printf("MemoryManager: Could not allocate memory");
   51|      0|        return 0;
   52|      0|    }
   53|   911k|    newEntry->size = size;
   54|   911k|    newEntry->address = addr;
   55|   911k|    newEntry->next = NULL;
   56|   911k|    pthread_mutex_lock(&mutex);
   57|   911k|    newEntry->prev = address_map_last;
   58|   911k|    if(address_map_last)
  ------------------
  |  Branch (58:8): [True: 910k, False: 281]
  ------------------
   59|   910k|        address_map_last->next = newEntry;
   60|   911k|    address_map_last = newEntry;
   61|   911k|    totalMemorySize += size;
   62|   911k|    if(address_map_first == NULL)
  ------------------
  |  Branch (62:8): [True: 281, False: 910k]
  ------------------
   63|    281|        address_map_first = newEntry;
   64|   911k|    pthread_mutex_unlock(&mutex);
   65|       |    //printf("Total size (malloc): %lld And new address: %p Entry %p\n", totalMemorySize, addr, (void*)newEntry);
   66|       |
   67|   911k|    return 1;
   68|   911k|}
custom_memory_manager.c:UA_memoryManager_free:
  141|   991k|static void UA_memoryManager_free(void* ptr) {
  142|   991k|    removeFromMap(ptr);
  143|   991k|    free(ptr);
  144|   991k|}
custom_memory_manager.c:removeFromMap:
   77|   991k|static int removeFromMap(void *addr) {
   78|   991k|    if(addr == NULL)
  ------------------
  |  Branch (78:8): [True: 80.7k, False: 911k]
  ------------------
   79|  80.7k|        return 1;
   80|       |
   81|   911k|    pthread_mutex_lock(&mutex);
   82|       |
   83|   911k|    struct UA_mm_entry *e = address_map_last;
   84|       |
   85|   802M|    while (e) {
  ------------------
  |  Branch (85:12): [True: 802M, False: 0]
  ------------------
   86|   802M|        if(e->address == addr) {
  ------------------
  |  Branch (86:12): [True: 911k, False: 801M]
  ------------------
   87|   911k|            if(e == address_map_first)
  ------------------
  |  Branch (87:16): [True: 315, False: 910k]
  ------------------
   88|    315|                address_map_first = e->next;
   89|   911k|            if(e == address_map_last)
  ------------------
  |  Branch (89:16): [True: 640k, False: 270k]
  ------------------
   90|   640k|                address_map_last = e->prev;
   91|   911k|            if(e->prev)
  ------------------
  |  Branch (91:16): [True: 910k, False: 315]
  ------------------
   92|   910k|                e->prev->next = e->next;
   93|   911k|            if(e->next)
  ------------------
  |  Branch (93:16): [True: 270k, False: 640k]
  ------------------
   94|   270k|                e->next->prev = e->prev;
   95|   911k|            totalMemorySize -= e->size;
   96|       |
   97|       |            //printf("Total size (free): %lld after addr %p and deleting %p\n", totalMemorySize, addr, (void*)e);
   98|   911k|            free(e);
   99|   911k|            pthread_mutex_unlock(&mutex);
  100|   911k|            return 1;
  101|   911k|        }
  102|   801M|        e = e->prev;
  103|   801M|    }
  104|      0|    pthread_mutex_unlock(&mutex);
  105|       |    //printf("MemoryManager: Entry with address %p not found", addr);
  106|      0|    return 0;
  107|   911k|}
custom_memory_manager.c:UA_memoryManager_calloc:
  119|   473k|static void *UA_memoryManager_calloc(size_t num, size_t size) {
  120|   473k|    if(totalMemorySize + (size * num) > memoryLimit)
  ------------------
  |  Branch (120:8): [True: 91, False: 473k]
  ------------------
  121|     91|        return NULL;
  122|   473k|    void *addr = calloc(num, size);
  123|   473k|    if(!addr)
  ------------------
  |  Branch (123:8): [True: 0, False: 473k]
  ------------------
  124|      0|        return NULL;
  125|   473k|    addToMap(size*num, addr);
  126|   473k|    return addr;
  127|   473k|}

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

ua_types.c:UA_ByteString_init:
  222|  45.4k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_String_copy:
  222|  80.0k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_NodeId_clear:
  222|    356|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_ExpandedNodeId_clear:
  222|    467|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_QualifiedName_init:
  222|  28.1k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_clear:
  222|   349k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_init:
  222|    441|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_init:
  222|   349k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_init:
  222|   312k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_clear:
  222|   266k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_new:
  222|    195|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_clear:
  222|    293|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_json.c:UA_String_clear:
  222|  87.0k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_json.c:UA_DataValue_clear:
  222|  87.0k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_binary.c:UA_ByteString_clear:
  222|  6.49k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_binary.c:UA_String_clear:
  222|  6.49k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl

