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

cj5_parse:
  305|  8.20k|          cj5_options *options) {
  306|  8.20k|    cj5_result r;
  307|  8.20k|    cj5__parser parser;
  308|  8.20k|    memset(&parser, 0x0, sizeof(parser));
  309|  8.20k|    parser.curr_tok_idx = 0;
  310|  8.20k|    parser.json5 = json5;
  311|  8.20k|    parser.len = len;
  312|  8.20k|    parser.tokens = tokens;
  313|  8.20k|    parser.max_tokens = max_tokens;
  314|       |
  315|  8.20k|    if(options)
  ------------------
  |  Branch (315:8): [True: 8.20k, False: 0]
  ------------------
  316|  8.20k|        parser.stop_early = options->stop_early;
  317|       |
  318|  8.20k|    unsigned short depth = 0; // Nesting depth zero means "outside the root object"
  319|  8.20k|    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|  8.20k|    char next[CJ5_MAX_NESTING];    // Next content to parse: 'k' (key), ':', 'v'
  323|       |                                   // (value) or ',' (comma).
  324|  8.20k|    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|  8.20k|    nesting[0] = 0; // Becomes '{' if there is a virtual root object
  329|       |
  330|  8.20k|    cj5_token *token = NULL; // The current token
  331|       |
  332|  9.73k| start_parsing:
  333|  79.2M|    for(; parser.pos < len; parser.pos++) {
  ------------------
  |  Branch (333:11): [True: 79.2M, False: 7.79k]
  ------------------
  334|  79.2M|        char c = json5[parser.pos];
  335|  79.2M|        switch(c) {
  336|   535k|        case '\n': // Skip newline and whitespace
  ------------------
  |  Branch (336:9): [True: 535k, False: 78.7M]
  ------------------
  337|  1.67M|        case '\r':
  ------------------
  |  Branch (337:9): [True: 1.13M, False: 78.1M]
  ------------------
  338|  3.12M|        case '\t':
  ------------------
  |  Branch (338:9): [True: 1.45M, False: 77.8M]
  ------------------
  339|  3.36M|        case ' ':
  ------------------
  |  Branch (339:9): [True: 232k, False: 79.0M]
  ------------------
  340|  3.36M|            break;
  341|       |
  342|  6.04k|        case '#': // Skip comment
  ------------------
  |  Branch (342:9): [True: 6.04k, False: 79.2M]
  ------------------
  343|  10.2k|        case '/':
  ------------------
  |  Branch (343:9): [True: 4.21k, False: 79.2M]
  ------------------
  344|  10.2k|            cj5__skip_comment(&parser);
  345|  10.2k|            if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (345:16): [True: 3.27k, False: 6.98k]
  ------------------
  346|  3.27k|               parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (346:16): [True: 154, False: 3.12k]
  ------------------
  347|    154|                goto finish;
  348|  10.1k|            break;
  349|       |
  350|   158k|        case '{': // Open an object or array
  ------------------
  |  Branch (350:9): [True: 158k, False: 79.1M]
  ------------------
  351|   246k|        case '[':
  ------------------
  |  Branch (351:9): [True: 88.8k, False: 79.1M]
  ------------------
  352|       |            // Check the nesting depth
  353|   246k|            if(depth + 1 >= CJ5_MAX_NESTING) {
  ------------------
  |  |   52|   246k|#define CJ5_MAX_NESTING 32
  ------------------
  |  Branch (353:16): [True: 3, False: 246k]
  ------------------
  354|      3|                parser.error = CJ5_ERROR_INVALID;
  355|      3|                goto finish;
  356|      3|            }
  357|       |
  358|       |            // Correct next?
  359|   246k|            if(next[depth] != 'v') {
  ------------------
  |  Branch (359:16): [True: 28, False: 246k]
  ------------------
  360|     28|                parser.error = CJ5_ERROR_INVALID;
  361|     28|                goto finish;
  362|     28|            }
  363|       |
  364|   246k|            depth++; // Increase the nesting depth
  365|   246k|            nesting[depth] = c; // Set the nesting type
  366|   246k|            next[depth] = (c == '{') ? 'k' : 'v'; // next is either a key or a value
  ------------------
  |  Branch (366:27): [True: 158k, False: 88.8k]
  ------------------
  367|       |
  368|       |            // Create a token for the object or array
  369|   246k|            token = cj5__alloc_token(&parser);
  370|   246k|            if(token) {
  ------------------
  |  Branch (370:16): [True: 154k, False: 92.1k]
  ------------------
  371|   154k|                token->parent_id = parser.curr_tok_idx;
  372|   154k|                token->type = (c == '{') ? CJ5_TOKEN_OBJECT : CJ5_TOKEN_ARRAY;
  ------------------
  |  Branch (372:31): [True: 104k, False: 50.7k]
  ------------------
  373|   154k|                token->start = parser.pos;
  374|   154k|                token->size = 0;
  375|   154k|                parser.curr_tok_idx = parser.token_count - 1; // The new curr_tok_idx
  376|       |                                                              // is for this token
  377|   154k|            }
  378|   246k|            break;
  379|       |
  380|   155k|        case '}': // Close an object or array
  ------------------
  |  Branch (380:9): [True: 155k, False: 79.1M]
  ------------------
  381|   243k|        case ']':
  ------------------
  |  Branch (381:9): [True: 87.5k, False: 79.1M]
  ------------------
  382|       |            // Check the nesting depth. Note that a "virtual root object" at
  383|       |            // depth zero must not be closed.
  384|   243k|            if(depth == 0) {
  ------------------
  |  Branch (384:16): [True: 18, False: 243k]
  ------------------
  385|     18|                parser.error = CJ5_ERROR_INVALID;
  386|     18|                goto finish;
  387|     18|            }
  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|   243k|            if(c - nesting[depth] != 2 ||
  ------------------
  |  Branch (392:16): [True: 9, False: 243k]
  ------------------
  393|   243k|               (c == '}' && next[depth] != 'k' && next[depth] != ',')) {
  ------------------
  |  Branch (393:17): [True: 155k, False: 87.5k]
  |  Branch (393:29): [True: 124k, False: 30.9k]
  |  Branch (393:51): [True: 6, False: 124k]
  ------------------
  394|     15|                parser.error = CJ5_ERROR_INVALID;
  395|     15|                goto finish;
  396|     15|            }
  397|       |
  398|   243k|            if(token) {
  ------------------
  |  Branch (398:16): [True: 149k, False: 94.1k]
  ------------------
  399|       |                // Finalize the current token
  400|   149k|                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|   149k|                if(parser.curr_tok_idx != token->parent_id) {
  ------------------
  |  Branch (405:20): [True: 143k, False: 5.97k]
  ------------------
  406|   143k|                    parser.curr_tok_idx = token->parent_id;
  407|   143k|                    token = &tokens[token->parent_id];
  408|   143k|                    token->size++;
  409|   143k|                }
  410|   149k|            }
  411|       |
  412|       |            // Step one level up
  413|   243k|            depth--;
  414|   243k|            next[depth] = (depth == 0) ? 0 : ','; // zero if we step out the root
  ------------------
  |  Branch (414:27): [True: 6.41k, False: 236k]
  ------------------
  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|   243k|            if(depth == 0 && parser.stop_early)
  ------------------
  |  Branch (420:16): [True: 6.41k, False: 236k]
  |  Branch (420:30): [True: 0, False: 6.41k]
  ------------------
  421|      0|                goto finish;
  422|       |
  423|   243k|            break;
  424|       |
  425|  4.82M|        case ':': // Colon (between key and value)
  ------------------
  |  Branch (425:9): [True: 4.82M, False: 74.4M]
  ------------------
  426|  4.82M|            if(next[depth] != ':') {
  ------------------
  |  Branch (426:16): [True: 1.18k, False: 4.81M]
  ------------------
  427|  1.18k|                parser.error = CJ5_ERROR_INVALID;
  428|  1.18k|                goto finish;
  429|  1.18k|            }
  430|  4.81M|            next[depth] = 'v';
  431|  4.81M|            break;
  432|       |
  433|  32.9M|        case ',': // Comma
  ------------------
  |  Branch (433:9): [True: 32.9M, False: 46.3M]
  ------------------
  434|  32.9M|            if(next[depth] != ',') {
  ------------------
  |  Branch (434:16): [True: 20, False: 32.9M]
  ------------------
  435|     20|                parser.error = CJ5_ERROR_INVALID;
  436|     20|                goto finish;
  437|     20|            }
  438|  32.9M|            next[depth] = (nesting[depth] == '{') ? 'k' : 'v';
  ------------------
  |  Branch (438:27): [True: 4.69M, False: 28.2M]
  ------------------
  439|  32.9M|            break;
  440|       |
  441|  37.6M|        default: // Value or key
  ------------------
  |  Branch (441:9): [True: 37.6M, False: 41.6M]
  ------------------
  442|  37.6M|            if(next[depth] == 'v') {
  ------------------
  |  Branch (442:16): [True: 32.8M, False: 4.81M]
  ------------------
  443|  32.8M|                cj5__parse_primitive(&parser); // Parse primitive value
  444|  32.8M|                if(nesting[depth] != 0) {
  ------------------
  |  Branch (444:20): [True: 32.8M, False: 1.54k]
  ------------------
  445|       |                    // Parent is object or array
  446|  32.8M|                    if(token)
  ------------------
  |  Branch (446:24): [True: 30.3M, False: 2.45M]
  ------------------
  447|  30.3M|                        token->size++;
  448|  32.8M|                    next[depth] = ',';
  449|  32.8M|                } else {
  450|       |                    // The current value was the root element. Don't look for
  451|       |                    // any next element.
  452|  1.54k|                    next[depth] = 0;
  453|       |
  454|       |                    // The first element was successfully parsed. Stop early or try to
  455|       |                    // parse the full input string?
  456|  1.54k|                    if(parser.stop_early)
  ------------------
  |  Branch (456:24): [True: 0, False: 1.54k]
  ------------------
  457|      0|                        goto finish;
  458|  1.54k|                }
  459|  32.8M|            } else if(next[depth] == 'k') {
  ------------------
  |  Branch (459:23): [True: 4.81M, False: 226]
  ------------------
  460|  4.81M|                cj5__parse_key(&parser);
  461|  4.81M|                if(token)
  ------------------
  |  Branch (461:20): [True: 4.54M, False: 271k]
  ------------------
  462|  4.54M|                    token->size++; // Keys count towards the length
  463|  4.81M|                next[depth] = ':';
  464|  4.81M|            } else {
  465|    226|                parser.error = CJ5_ERROR_INVALID;
  466|    226|            }
  467|       |
  468|  37.6M|            if(parser.error && parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (468:16): [True: 19.6M, False: 18.0M]
  |  Branch (468:32): [True: 517, False: 19.6M]
  ------------------
  469|    517|                goto finish;
  470|       |
  471|  37.6M|            break;
  472|  79.2M|        }
  473|  79.2M|    }
  474|       |
  475|       |    // Are we back to the initial nesting depth?
  476|  7.79k|    if(depth != 0) {
  ------------------
  |  Branch (476:8): [True: 200, False: 7.59k]
  ------------------
  477|    200|        parser.error = CJ5_ERROR_INCOMPLETE;
  478|    200|        goto finish;
  479|    200|    }
  480|       |
  481|       |    // Close the virtual root object if there is one
  482|  7.59k|    if(nesting[0] == '{' && parser.error != CJ5_ERROR_OVERFLOW) {
  ------------------
  |  Branch (482:8): [True: 1.09k, False: 6.50k]
  |  Branch (482:29): [True: 1.05k, False: 34]
  ------------------
  483|       |        // Check the we end after a complete key-value pair (or dangling comma)
  484|  1.05k|        if(next[0] != 'k' && next[0] != ',')
  ------------------
  |  Branch (484:12): [True: 1.04k, False: 8]
  |  Branch (484:30): [True: 91, False: 958]
  ------------------
  485|     91|            parser.error = CJ5_ERROR_INVALID;
  486|  1.05k|        tokens[0].end = parser.pos - 1;
  487|  1.05k|    }
  488|       |
  489|  9.73k| finish:
  490|       |    // If parsing failed at the initial nesting depth, create a virtual root object
  491|       |    // and restart parsing.
  492|  9.73k|    if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (492:8): [True: 2.84k, False: 6.88k]
  ------------------
  493|  2.84k|       parser.error != CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (493:8): [True: 2.22k, False: 618]
  ------------------
  494|  2.22k|       depth == 0 && nesting[0] != '{') {
  ------------------
  |  Branch (494:8): [True: 1.93k, False: 289]
  |  Branch (494:22): [True: 1.53k, False: 407]
  ------------------
  495|  1.53k|        parser.token_count = 0;
  496|  1.53k|        token = cj5__alloc_token(&parser);
  497|  1.53k|        if(token) {
  ------------------
  |  Branch (497:12): [True: 1.53k, False: 0]
  ------------------
  498|  1.53k|            token->parent_id = 0;
  499|  1.53k|            token->type = CJ5_TOKEN_OBJECT;
  500|  1.53k|            token->start = 0;
  501|  1.53k|            token->size = 0;
  502|       |
  503|  1.53k|            nesting[0] = '{';
  504|  1.53k|            next[0] = 'k';
  505|       |
  506|  1.53k|            parser.curr_tok_idx = 0;
  507|  1.53k|            parser.pos = 0;
  508|  1.53k|            parser.error = CJ5_ERROR_NONE;
  509|  1.53k|            goto start_parsing;
  510|  1.53k|        }
  511|  1.53k|    }
  512|       |
  513|  8.20k|    memset(&r, 0x0, sizeof(r));
  514|  8.20k|    r.error = parser.error;
  515|  8.20k|    r.error_pos = parser.pos;
  516|  8.20k|    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|  8.20k|    if(r.num_tokens == 0)
  ------------------
  |  Branch (520:8): [True: 30, False: 8.17k]
  ------------------
  521|     30|        r.error = CJ5_ERROR_INCOMPLETE;
  522|       |
  523|       |    // Set the tokens and original string only if successfully parsed
  524|  8.20k|    if(r.error == CJ5_ERROR_NONE) {
  ------------------
  |  Branch (524:8): [True: 6.85k, False: 1.34k]
  ------------------
  525|  6.85k|        r.tokens = tokens;
  526|  6.85k|        r.json5 = json5;
  527|  6.85k|    }
  528|       |
  529|  8.20k|    return r;
  530|  9.73k|}
cj5_get_str:
  628|  68.7k|            char *buf, unsigned int *buflen) {
  629|  68.7k|    const cj5_token *token = &r->tokens[tok_index];
  630|  68.7k|    if(token->type != CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (630:8): [True: 0, False: 68.7k]
  ------------------
  631|      0|        buf[0] = 0;
  632|      0|        if(buflen)
  ------------------
  |  Branch (632:12): [True: 0, False: 0]
  ------------------
  633|      0|            *buflen = 0;
  634|      0|        return CJ5_ERROR_INVALID;
  635|      0|    }
  636|       |
  637|  68.7k|    const char *pos = &r->json5[token->start];
  638|  68.7k|    const char *end = &r->json5[token->end + 1];
  639|  68.7k|    unsigned int outpos = 0;
  640|  68.7k|    cj5_error_code error = CJ5_ERROR_NONE;
  641|  17.6M|    for(; pos < end; pos++) {
  ------------------
  |  Branch (641:11): [True: 17.5M, False: 68.6k]
  ------------------
  642|  17.5M|        uint8_t c = (uint8_t)*pos;
  643|       |        // Unprintable ascii characters must be escaped
  644|  17.5M|        if(c < ' ' || c == 127) {
  ------------------
  |  Branch (644:12): [True: 40, False: 17.5M]
  |  Branch (644:23): [True: 3, False: 17.5M]
  ------------------
  645|     43|            error = CJ5_ERROR_INVALID;
  646|     43|            goto done;
  647|     43|        }
  648|       |
  649|       |        // Unescaped Ascii character or utf8 byte
  650|  17.5M|        if(c != '\\') {
  ------------------
  |  Branch (650:12): [True: 17.5M, False: 13.4k]
  ------------------
  651|  17.5M|            buf[outpos++] = (char)c;
  652|  17.5M|            continue;
  653|  17.5M|        }
  654|       |
  655|       |        // End of input before the escaped character
  656|  13.4k|        if(pos + 1 >= end) {
  ------------------
  |  Branch (656:12): [True: 0, False: 13.4k]
  ------------------
  657|      0|            error = CJ5_ERROR_INCOMPLETE;
  658|      0|            goto done;
  659|      0|        }
  660|       |
  661|       |        // Process escaped character
  662|  13.4k|        pos++;
  663|  13.4k|        c = (uint8_t)*pos;
  664|  13.4k|        switch(c) {
  665|    255|        case 'b': buf[outpos++] = '\b'; break;
  ------------------
  |  Branch (665:9): [True: 255, False: 13.2k]
  ------------------
  666|    581|        case 'f': buf[outpos++] = '\f'; break;
  ------------------
  |  Branch (666:9): [True: 581, False: 12.8k]
  ------------------
  667|    205|        case 'r': buf[outpos++] = '\r'; break;
  ------------------
  |  Branch (667:9): [True: 205, False: 13.2k]
  ------------------
  668|    484|        case 'n': buf[outpos++] = '\n'; break;
  ------------------
  |  Branch (668:9): [True: 484, False: 12.9k]
  ------------------
  669|  1.18k|        case 't': buf[outpos++] = '\t'; break;
  ------------------
  |  Branch (669:9): [True: 1.18k, False: 12.2k]
  ------------------
  670|  6.12k|        default:  buf[outpos++] = (char)c; break;
  ------------------
  |  Branch (670:9): [True: 6.12k, False: 7.34k]
  ------------------
  671|  4.62k|        case 'u': {
  ------------------
  |  Branch (671:9): [True: 4.62k, False: 8.83k]
  ------------------
  672|       |            // Parse a unicode code point
  673|  4.62k|            if(pos + 4 >= end) {
  ------------------
  |  Branch (673:16): [True: 3, False: 4.62k]
  ------------------
  674|      3|                error = CJ5_ERROR_INCOMPLETE;
  675|      3|                goto done;
  676|      3|            }
  677|  4.62k|            pos++;
  678|  4.62k|            uint32_t utf;
  679|  4.62k|            error = parse_codepoint(pos, &utf);
  680|  4.62k|            if(error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (680:16): [True: 20, False: 4.60k]
  ------------------
  681|     20|                goto done;
  682|  4.60k|            pos += 3;
  683|       |
  684|       |            // Parse a surrogate pair
  685|  4.60k|            if(0xd800 <= utf && utf <= 0xdfff) {
  ------------------
  |  Branch (685:16): [True: 2.20k, False: 2.39k]
  |  Branch (685:33): [True: 1.63k, False: 570]
  ------------------
  686|  1.63k|                if(pos + 6 >= end) {
  ------------------
  |  Branch (686:20): [True: 10, False: 1.62k]
  ------------------
  687|     10|                    error = CJ5_ERROR_INVALID;
  688|     10|                    goto done;
  689|     10|                }
  690|  1.62k|                if(pos[1] != '\\' && pos[2] != 'u') {
  ------------------
  |  Branch (690:20): [True: 548, False: 1.08k]
  |  Branch (690:38): [True: 12, False: 536]
  ------------------
  691|     12|                    error = CJ5_ERROR_INVALID;
  692|     12|                    goto done;
  693|     12|                }
  694|  1.61k|                pos += 3;
  695|  1.61k|                uint32_t utf2;
  696|  1.61k|                error = parse_codepoint(pos, &utf2);
  697|  1.61k|                if(error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (697:20): [True: 18, False: 1.59k]
  ------------------
  698|     18|                    goto done;
  699|  1.59k|                pos += 3;
  700|       |                // High or low surrogate pair
  701|  1.59k|                utf = (utf <= 0xdbff) ?
  ------------------
  |  Branch (701:23): [True: 1.21k, False: 384]
  ------------------
  702|  1.21k|                    (utf << 10) + utf2 + SURROGATE_OFFSET :
  703|  1.59k|                    (utf2 << 10) + utf + SURROGATE_OFFSET;
  704|  1.59k|            }
  705|       |
  706|       |            // Write the utf8 bytes of the code point
  707|  4.56k|            unsigned len = utf8_from_codepoint((unsigned char*)buf + outpos, utf);
  708|  4.56k|            if(len == 0) {
  ------------------
  |  Branch (708:16): [True: 40, False: 4.52k]
  ------------------
  709|     40|                error = CJ5_ERROR_INVALID; // Not a utf8 string
  710|     40|                goto done;
  711|     40|            }
  712|  4.52k|            outpos += len;
  713|  4.52k|            break;
  714|  4.56k|        }
  715|  13.4k|        }
  716|  13.4k|    }
  717|       |
  718|  68.7k| done:
  719|       |    // Always leave buf as a valid, NUL-terminated string, even when decoding
  720|       |    // fails midway. Callers still must check the returned error code.
  721|  68.7k|    buf[outpos] = 0;
  722|       |
  723|       |    // Set the output length
  724|  68.7k|    if(buflen)
  ------------------
  |  Branch (724:8): [True: 68.7k, False: 0]
  ------------------
  725|  68.7k|        *buflen = outpos;
  726|  68.7k|    return error;
  727|  68.7k|}
cj5.c:cj5__skip_comment:
  260|  10.2k|cj5__skip_comment(cj5__parser* parser) {
  261|  10.2k|    const char* json5 = parser->json5;
  262|       |
  263|       |    // Single-line comment
  264|  10.2k|    if(json5[parser->pos] == '#') {
  ------------------
  |  Branch (264:8): [True: 6.04k, False: 4.21k]
  ------------------
  265|  6.44k|    skip_line:
  266|  4.31M|        while(parser->pos < parser->len) {
  ------------------
  |  Branch (266:15): [True: 4.31M, False: 54]
  ------------------
  267|  4.31M|            if(json5[parser->pos] == '\n') {
  ------------------
  |  Branch (267:16): [True: 6.38k, False: 4.30M]
  ------------------
  268|  6.38k|                parser->pos--; // Reparse the newline in the main parse loop
  269|  6.38k|                return;
  270|  6.38k|            }
  271|  4.30M|            parser->pos++;
  272|  4.30M|        }
  273|     54|        return;
  274|  6.44k|    }
  275|       |
  276|       |    // Comment begins with '/' but not enough space for another character
  277|  4.21k|    if(parser->pos + 1 >= parser->len) {
  ------------------
  |  Branch (277:8): [True: 31, False: 4.18k]
  ------------------
  278|     31|        parser->error = CJ5_ERROR_INVALID;
  279|     31|        return;
  280|     31|    }
  281|  4.18k|    parser->pos++;
  282|       |
  283|       |    // Comment begins with '//' -> single-line comment
  284|  4.18k|    if(json5[parser->pos] == '/')
  ------------------
  |  Branch (284:8): [True: 397, False: 3.78k]
  ------------------
  285|    397|        goto skip_line;
  286|       |
  287|       |    // Multi-line comments begin with '/*' and end with '*/'
  288|  3.78k|    if(json5[parser->pos] == '*') {
  ------------------
  |  Branch (288:8): [True: 3.74k, False: 35]
  ------------------
  289|  3.74k|        parser->pos++;
  290|  1.48M|        for(; parser->pos + 1 < parser->len; parser->pos++) {
  ------------------
  |  Branch (290:15): [True: 1.48M, False: 88]
  ------------------
  291|  1.48M|            if(json5[parser->pos] == '*' && json5[parser->pos + 1] == '/') {
  ------------------
  |  Branch (291:16): [True: 8.96k, False: 1.47M]
  |  Branch (291:45): [True: 3.66k, False: 5.30k]
  ------------------
  292|  3.66k|                parser->pos++;
  293|  3.66k|                return;
  294|  3.66k|            }
  295|  1.48M|        }
  296|  3.74k|    }
  297|       |
  298|       |    // Unknown comment type or the multi-line comment is not terminated
  299|    123|    parser->error = CJ5_ERROR_INCOMPLETE;
  300|    123|}
cj5.c:cj5__alloc_token:
   88|  37.9M|cj5__alloc_token(cj5__parser *parser) {
   89|  37.9M|    cj5_token* token = NULL;
   90|  37.9M|    if(parser->token_count < parser->max_tokens) {
  ------------------
  |  Branch (90:8): [True: 18.1M, False: 19.7M]
  ------------------
   91|  18.1M|        token = &parser->tokens[parser->token_count];
   92|  18.1M|        memset(token, 0x0, sizeof(cj5_token));
   93|  19.7M|    } else {
   94|  19.7M|        parser->error = CJ5_ERROR_OVERFLOW;
   95|  19.7M|    }
   96|       |
   97|       |    // Always increase the index. So we know eventually how many token would be
   98|       |    // required (if there are not enough).
   99|  37.9M|    parser->token_count++;
  100|  37.9M|    return token;
  101|  37.9M|}
cj5.c:cj5__parse_primitive:
  152|  32.8M|cj5__parse_primitive(cj5__parser* parser) {
  153|  32.8M|    const char* json5 = parser->json5;
  154|  32.8M|    unsigned int len = parser->len;
  155|  32.8M|    unsigned int start = parser->pos;
  156|       |
  157|       |    // String value
  158|  32.8M|    if(json5[start] == '\"' ||
  ------------------
  |  Branch (158:8): [True: 1.45M, False: 31.3M]
  ------------------
  159|  31.3M|       json5[start] == '\'') {
  ------------------
  |  Branch (159:8): [True: 1.34k, False: 31.3M]
  ------------------
  160|  1.45M|        cj5__parse_string(parser);
  161|  1.45M|        return;
  162|  1.45M|    }
  163|       |
  164|       |    // Fast comparison of bool, and null.
  165|       |    // Make the comparison case-insensitive.
  166|  31.3M|    uint32_t fourcc = 0;
  167|  31.3M|    if(start + 3 < len) {
  ------------------
  |  Branch (167:8): [True: 31.3M, False: 652]
  ------------------
  168|  31.3M|        fourcc += (unsigned char)json5[start] | 32U;
  169|  31.3M|        fourcc += ((unsigned char)json5[start+1] | 32U) << 8;
  170|  31.3M|        fourcc += ((unsigned char)json5[start+2] | 32U) << 16;
  171|  31.3M|        fourcc += ((unsigned char)json5[start+3] | 32U) << 24;
  172|  31.3M|    }
  173|       |    
  174|  31.3M|    cj5_token_type type;
  175|  31.3M|    if(fourcc == CJ5__NULL_FOURCC) {
  ------------------
  |  Branch (175:8): [True: 6.71k, False: 31.3M]
  ------------------
  176|  6.71k|        type = CJ5_TOKEN_NULL;
  177|  6.71k|        parser->pos += 3;
  178|  31.3M|    } else if(fourcc == CJ5__TRUE_FOURCC) {
  ------------------
  |  Branch (178:15): [True: 485, False: 31.3M]
  ------------------
  179|    485|        type = CJ5_TOKEN_BOOL;
  180|    485|        parser->pos += 3;
  181|  31.3M|    } else if(fourcc == CJ5__FALSE_FOURCC) {
  ------------------
  |  Branch (181:15): [True: 284, False: 31.3M]
  ------------------
  182|       |        // "false" has five characters
  183|    284|        type = CJ5_TOKEN_BOOL;
  184|    284|        if(start + 4 >= len || (json5[start+4] | 32) != 'e') {
  ------------------
  |  Branch (184:12): [True: 1, False: 283]
  |  Branch (184:32): [True: 18, False: 265]
  ------------------
  185|     19|            parser->error = CJ5_ERROR_INVALID;
  186|     19|            return;
  187|     19|        }
  188|    265|        parser->pos += 4;
  189|  31.3M|    } else {
  190|       |        // Numbers are checked for basic compatibility.
  191|       |        // But they are fully parsed only in the cj5_get_XXX functions.
  192|  31.3M|        type = CJ5_TOKEN_NUMBER;
  193|  79.2M|        for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (193:15): [True: 79.2M, False: 1.04k]
  ------------------
  194|  79.2M|            if(!cj5__isnum(json5[parser->pos]) &&
  ------------------
  |  |   85|   158M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  ------------------
  |  Branch (194:16): [True: 42.0M, False: 37.1M]
  ------------------
  195|  42.0M|               !(json5[parser->pos] == '.') &&
  ------------------
  |  Branch (195:16): [True: 42.0M, False: 674]
  ------------------
  196|  42.0M|               !cj5__islowerchar(json5[parser->pos]) && 
  ------------------
  |  |   84|   121M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  ------------------
  |  Branch (196:16): [True: 35.1M, False: 6.92M]
  ------------------
  197|  35.1M|               !cj5__isupperchar(json5[parser->pos]) &&
  ------------------
  |  |   83|   114M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  ------------------
  |  Branch (197:16): [True: 31.9M, False: 3.25M]
  ------------------
  198|  31.9M|               !(json5[parser->pos] == '+') && !(json5[parser->pos] == '-')) {
  ------------------
  |  Branch (198:16): [True: 31.9M, False: 1.26k]
  |  Branch (198:48): [True: 31.3M, False: 532k]
  ------------------
  199|  31.3M|                break;
  200|  31.3M|            }
  201|  79.2M|        }
  202|  31.3M|        parser->pos--; // Point to the last character that is still inside the
  203|       |                       // primitive value
  204|  31.3M|    }
  205|       |
  206|  31.3M|    cj5_token *token = cj5__alloc_token(parser);
  207|  31.3M|    if(token) {
  ------------------
  |  Branch (207:8): [True: 14.7M, False: 16.5M]
  ------------------
  208|  14.7M|        token->type = type;
  209|  14.7M|        token->start = start;
  210|  14.7M|        token->end = parser->pos;
  211|  14.7M|        token->size = parser->pos - start + 1;
  212|  14.7M|        token->parent_id = parser->curr_tok_idx;
  213|  14.7M|    }
  214|  31.3M|}
cj5.c:cj5__parse_string:
  104|  3.45M|cj5__parse_string(cj5__parser *parser) {
  105|  3.45M|    const char *json5 = parser->json5;
  106|  3.45M|    unsigned int len = parser->len;
  107|  3.45M|    unsigned int start = parser->pos;
  108|  3.45M|    char str_open = json5[start];
  109|       |
  110|  3.45M|    parser->pos++;
  111|  65.1M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (111:11): [True: 65.1M, False: 145]
  ------------------
  112|  65.1M|        char c = json5[parser->pos];
  113|       |
  114|       |        // End of string
  115|  65.1M|        if(str_open == c) {
  ------------------
  |  Branch (115:12): [True: 3.45M, False: 61.6M]
  ------------------
  116|  3.45M|            cj5_token *token = cj5__alloc_token(parser);
  117|  3.45M|            if(token) {
  ------------------
  |  Branch (117:16): [True: 1.74M, False: 1.70M]
  ------------------
  118|  1.74M|                token->type = CJ5_TOKEN_STRING;
  119|  1.74M|                token->start = start + 1;
  120|  1.74M|                token->end = parser->pos - 1;
  121|  1.74M|                token->size = token->end - token->start + 1;
  122|  1.74M|                token->parent_id = parser->curr_tok_idx;
  123|  1.74M|            } 
  124|  3.45M|            return;
  125|  3.45M|        }
  126|       |
  127|       |        // Unescaped newlines are forbidden
  128|  61.6M|        if(c == '\n') {
  ------------------
  |  Branch (128:12): [True: 4, False: 61.6M]
  ------------------
  129|      4|            parser->error = CJ5_ERROR_INVALID;
  130|      4|            return;
  131|      4|        }
  132|       |
  133|       |        // Skip escape character
  134|  61.6M|        if(c == '\\') {
  ------------------
  |  Branch (134:12): [True: 408k, False: 61.2M]
  ------------------
  135|   408k|            if(parser->pos + 1 >= len) {
  ------------------
  |  Branch (135:16): [True: 3, False: 408k]
  ------------------
  136|      3|                parser->error = CJ5_ERROR_INCOMPLETE;
  137|      3|                return;
  138|      3|            }
  139|   408k|            parser->pos++;
  140|   408k|        }
  141|  61.6M|    }
  142|       |
  143|       |    // The file has ended before the string terminates
  144|    145|    parser->error = CJ5_ERROR_INCOMPLETE;
  145|    145|}
cj5.c:cj5__isrange:
   79|   175M|cj5__isrange(char ch, char from, char to) {
   80|   175M|    return (uint8_t)(ch - from) <= (uint8_t)(to - from);
   81|   175M|}
cj5.c:cj5__parse_key:
  217|  4.81M|cj5__parse_key(cj5__parser* parser) {
  218|  4.81M|    const char* json5 = parser->json5;
  219|  4.81M|    unsigned int start = parser->pos;
  220|  4.81M|    cj5_token* token;
  221|       |
  222|       |    // Key is a a normal string
  223|  4.81M|    if(json5[start] == '\"' || json5[start] == '\'') {
  ------------------
  |  Branch (223:8): [True: 1.99M, False: 2.82M]
  |  Branch (223:32): [True: 2.60k, False: 2.82M]
  ------------------
  224|  1.99M|        cj5__parse_string(parser);
  225|  1.99M|        return;
  226|  1.99M|    }
  227|       |
  228|       |    // An unquoted key. Must start with a-ZA-Z_$. Can contain numbers later on.
  229|  2.82M|    unsigned int len = parser->len;
  230|  9.39M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (230:11): [True: 9.39M, False: 97]
  ------------------
  231|  9.39M|        if(cj5__islowerchar(json5[parser->pos]) ||
  ------------------
  |  |   84|  18.7M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  |  |  ------------------
  |  |  |  Branch (84:30): [True: 2.47M, False: 6.91M]
  |  |  ------------------
  ------------------
  232|  6.91M|           cj5__isupperchar(json5[parser->pos]) ||
  ------------------
  |  |   83|  16.3M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  |  |  ------------------
  |  |  |  Branch (83:30): [True: 3.79M, False: 3.12M]
  |  |  ------------------
  ------------------
  233|  3.12M|           json5[parser->pos] == '_' || json5[parser->pos] == '$')
  ------------------
  |  Branch (233:12): [True: 993, False: 3.12M]
  |  Branch (233:41): [True: 4.35k, False: 3.12M]
  ------------------
  234|  6.27M|            continue;
  235|  3.12M|        if(cj5__isnum(json5[parser->pos]) && parser->pos != start)
  ------------------
  |  |   85|  6.24M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 300k, False: 2.82M]
  |  |  ------------------
  ------------------
  |  Branch (235:46): [True: 300k, False: 9]
  ------------------
  236|   300k|            continue;
  237|  2.82M|        break;
  238|  3.12M|    }
  239|       |
  240|       |    // An empty key is not allowed
  241|  2.82M|    if(parser->pos <= start) {
  ------------------
  |  Branch (241:8): [True: 120, False: 2.82M]
  ------------------
  242|    120|        parser->error = CJ5_ERROR_INVALID;
  243|    120|        return;
  244|    120|    }
  245|       |
  246|       |    // Move pos to the last character within the unquoted key
  247|  2.82M|    parser->pos--;
  248|       |
  249|  2.82M|    token = cj5__alloc_token(parser);
  250|  2.82M|    if(token) {
  ------------------
  |  Branch (250:8): [True: 1.47M, False: 1.34M]
  ------------------
  251|  1.47M|        token->type = CJ5_TOKEN_STRING;
  252|  1.47M|        token->start = start;
  253|  1.47M|        token->end = parser->pos;
  254|  1.47M|        token->size = parser->pos - start + 1;
  255|  1.47M|        token->parent_id = parser->curr_tok_idx;
  256|  1.47M|    }
  257|  2.82M|}
cj5.c:parse_codepoint:
  607|  6.24k|parse_codepoint(const char *pos, uint32_t *out_utf) {
  608|  6.24k|    uint32_t utf = 0;
  609|  31.1k|    for(unsigned int i = 0; i < 4; i++) {
  ------------------
  |  Branch (609:29): [True: 24.9k, False: 6.20k]
  ------------------
  610|  24.9k|        char byte = pos[i];
  611|  24.9k|        if(cj5__isnum(byte)) {
  ------------------
  |  |   85|  24.9k|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 7.99k, False: 16.9k]
  |  |  ------------------
  ------------------
  612|  7.99k|            byte = (char)(byte - '0');
  613|  16.9k|        } else if(cj5__isrange(byte, 'a', 'f')) {
  ------------------
  |  Branch (613:19): [True: 11.8k, False: 5.05k]
  ------------------
  614|  11.8k|            byte = (char)(byte - ('a' - 10));
  615|  11.8k|        } else if(cj5__isrange(byte, 'A', 'F')) {
  ------------------
  |  Branch (615:19): [True: 5.01k, False: 38]
  ------------------
  616|  5.01k|            byte = (char)(byte - ('A' - 10));
  617|  5.01k|        } else {
  618|     38|            return CJ5_ERROR_INVALID;
  619|     38|        }
  620|  24.8k|        utf = (utf << 4) | ((uint8_t)byte & 0xF);
  621|  24.8k|    }
  622|  6.20k|    *out_utf = utf;
  623|  6.20k|    return CJ5_ERROR_NONE;
  624|  6.24k|}

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

parseUInt64:
   30|  6.63M|parseUInt64(const char *str, size_t size, uint64_t *result) {
   31|  6.63M|    size_t i = 0;
   32|  6.63M|    uint64_t n = 0, prev = 0;
   33|       |
   34|       |    /* Hex */
   35|  6.63M|    if(size > 2 && str[0] == '0' && (str[1] | 32) == 'x') {
  ------------------
  |  Branch (35:8): [True: 314k, False: 6.31M]
  |  Branch (35:20): [True: 304k, False: 9.84k]
  |  Branch (35:37): [True: 19.0k, False: 285k]
  ------------------
   36|  19.0k|        i = 2;
   37|   816k|        for(; i < size; i++) {
  ------------------
  |  Branch (37:15): [True: 797k, False: 18.4k]
  ------------------
   38|   797k|            uint8_t c = (uint8_t)str[i] | 32;
   39|   797k|            if(c >= '0' && c <= '9')
  ------------------
  |  Branch (39:16): [True: 797k, False: 207]
  |  Branch (39:28): [True: 786k, False: 11.5k]
  ------------------
   40|   786k|                c = (uint8_t)(c - '0');
   41|  11.7k|            else if(c >= 'a' && c <='f')
  ------------------
  |  Branch (41:21): [True: 11.5k, False: 212]
  |  Branch (41:33): [True: 11.2k, False: 311]
  ------------------
   42|  11.2k|                c = (uint8_t)(c - 'a' + 10);
   43|    523|            else if(c >= 'A' && c <='F')
  ------------------
  |  Branch (43:21): [True: 312, False: 211]
  |  Branch (43:33): [True: 0, False: 312]
  ------------------
   44|      0|                c = (uint8_t)(c - 'A' + 10);
   45|    523|            else
   46|    523|                break;
   47|   797k|            n = (n << 4) | (c & 0xF);
   48|   797k|            if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (48:16): [True: 3, False: 797k]
  ------------------
   49|      3|                return 0;
   50|   797k|            prev = n;
   51|   797k|        }
   52|  19.0k|        *result = n;
   53|  19.0k|        return (i > 2) ? i : 0; /* 2 -> No digit was parsed */
  ------------------
  |  Branch (53:16): [True: 18.9k, False: 33]
  ------------------
   54|  19.0k|    }
   55|       |
   56|       |    /* Decimal */
   57|  18.3M|    for(; i < size; i++) {
  ------------------
  |  Branch (57:11): [True: 11.7M, False: 6.60M]
  ------------------
   58|  11.7M|        if(str[i] < '0' || str[i] > '9')
  ------------------
  |  Branch (58:12): [True: 7.87k, False: 11.7M]
  |  Branch (58:28): [True: 2.17k, False: 11.7M]
  ------------------
   59|  10.0k|            break;
   60|       |        /* Fast multiplication: n*10 == (n*8) + (n*2) */
   61|  11.7M|        n = (n << 3) + (n << 1) + (uint8_t)(str[i] - '0');
   62|  11.7M|        if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (62:12): [True: 10, False: 11.7M]
  ------------------
   63|     10|            return 0;
   64|  11.7M|        prev = n;
   65|  11.7M|    }
   66|  6.61M|    *result = n;
   67|  6.61M|    return i;
   68|  6.61M|}
parseInt64:
   71|  1.72M|parseInt64(const char *str, size_t size, int64_t *result) {
   72|       |    /* Negative value? */
   73|  1.72M|    size_t i = 0;
   74|  1.72M|    bool neg = false;
   75|  1.72M|    if(*str == '-' || *str == '+') {
  ------------------
  |  Branch (75:8): [True: 829, False: 1.72M]
  |  Branch (75:23): [True: 299, False: 1.72M]
  ------------------
   76|  1.12k|        neg = (*str == '-');
   77|  1.12k|        i++;
   78|  1.12k|    }
   79|       |
   80|       |    /* Parse as unsigned */
   81|  1.72M|    uint64_t n = 0;
   82|  1.72M|    size_t len = parseUInt64(&str[i], size - i, &n);
   83|  1.72M|    if(len == 0)
  ------------------
  |  Branch (83:8): [True: 103, False: 1.72M]
  ------------------
   84|    103|        return 0;
   85|       |
   86|       |    /* Check for overflow, adjust and return */
   87|  1.72M|    if(!neg) {
  ------------------
  |  Branch (87:8): [True: 1.72M, False: 819]
  ------------------
   88|  1.72M|        if(n > 9223372036854775807UL)
  ------------------
  |  Branch (88:12): [True: 63, False: 1.72M]
  ------------------
   89|     63|            return 0;
   90|  1.72M|        *result = (int64_t)n;
   91|  1.72M|    } else {
   92|       |        /* n is unsigned, so 9223372036854775808UL == 2^63 fits without
   93|       |         * overflow. (int64_t)n would also fit for n in [0, 2^63], but
   94|       |         * the negation -(int64_t)(2^63) is undefined because the result
   95|       |         * (which is +2^63) cannot be represented. Use the unsigned
   96|       |         * representation and reinterpret as int64_t instead. */
   97|    819|        if(n > 9223372036854775808UL)
  ------------------
  |  Branch (97:12): [True: 1, False: 818]
  ------------------
   98|      1|            return 0;
   99|    818|        *result = (n == 9223372036854775808UL)
  ------------------
  |  Branch (99:19): [True: 1, False: 817]
  ------------------
  100|    818|            ? (int64_t)(-9223372036854775807LL - 1)
  101|    818|            : -(int64_t)n;
  102|    818|    }
  103|  1.72M|    return len + i;
  104|  1.72M|}
parseDouble:
  106|   492k|size_t parseDouble(const char *str, size_t size, double *result) {
  107|   492k|    char buf[2000];
  108|   492k|    if(size >= 2000)
  ------------------
  |  Branch (108:8): [True: 1, False: 492k]
  ------------------
  109|      1|        return 0;
  110|   492k|    memcpy(buf, str, size);
  111|   492k|    buf[size] = 0;
  112|   492k|    errno = 0;
  113|   492k|    char *endptr;
  114|   492k|    *result = strtod(buf, &endptr);
  115|   492k|    if(errno != 0 && errno != ERANGE)
  ------------------
  |  Branch (115:8): [True: 197, False: 492k]
  |  Branch (115:22): [True: 0, False: 197]
  ------------------
  116|      0|        return 0;
  117|   492k|    return (uintptr_t)endptr - (uintptr_t)buf;
  118|   492k|}

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

findEncodingMetaData:
  277|  4.75k|                     UA_UInt16 dsWriterId) {
  278|  4.75k|    if(!eo)
  ------------------
  |  Branch (278:8): [True: 0, False: 4.75k]
  ------------------
  279|      0|        return NULL;
  280|  4.75k|    for(size_t i = 0; i < eo->metaDataSize; i++) {
  ------------------
  |  Branch (280:23): [True: 0, False: 4.75k]
  ------------------
  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.75k|    return NULL;
  285|  4.75k|}
UA_NetworkMessage_clear:
 1052|  6.85k|UA_NetworkMessage_clear(UA_NetworkMessage* p) {
 1053|  6.85k|    if(p->promotedFieldsEnabled) {
  ------------------
  |  Branch (1053:8): [True: 0, False: 6.85k]
  ------------------
 1054|      0|        UA_Array_delete(p->promotedFields, p->promotedFieldsSize,
 1055|      0|                        &UA_TYPES[UA_TYPES_VARIANT]);
  ------------------
  |  |  803|      0|#define UA_TYPES_VARIANT 23
  ------------------
 1056|      0|    }
 1057|       |
 1058|  6.85k|    if(p->networkMessageType == UA_NETWORKMESSAGE_DATASET) {
  ------------------
  |  Branch (1058:8): [True: 6.85k, False: 0]
  ------------------
 1059|  6.85k|        if(p->payload.dataSetMessages) {
  ------------------
  |  Branch (1059:12): [True: 6.37k, False: 477]
  ------------------
 1060|  12.8k|            for(size_t i = 0; i < p->messageCount; i++)
  ------------------
  |  Branch (1060:31): [True: 6.50k, False: 6.37k]
  ------------------
 1061|  6.50k|                UA_DataSetMessage_clear(&p->payload.dataSetMessages[i]);
 1062|  6.37k|            UA_free(p->payload.dataSetMessages);
  ------------------
  |  |   19|  6.37k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1063|  6.37k|        }
 1064|  6.85k|    }
 1065|       |
 1066|  6.85k|    UA_ByteString_clear(&p->securityFooter);
 1067|  6.85k|    UA_String_clear(&p->messageId);
 1068|       |
 1069|  6.85k|    if(p->publisherIdEnabled &&
  ------------------
  |  Branch (1069:8): [True: 5, False: 6.85k]
  ------------------
 1070|      5|       p->publisherId.idType == UA_PUBLISHERIDTYPE_STRING)
  ------------------
  |  Branch (1070:8): [True: 1, False: 4]
  ------------------
 1071|      1|       UA_String_clear(&p->publisherId.id.string);
 1072|       |
 1073|  6.85k|    memset(p, 0, sizeof(UA_NetworkMessage));
 1074|  6.85k|}
UA_DataSetMessage_clear:
 1875|  6.50k|UA_DataSetMessage_clear(UA_DataSetMessage* p) {
 1876|  6.50k|    if(p->header.dataSetMessageType == UA_DATASETMESSAGE_DATAKEYFRAME) {
  ------------------
  |  Branch (1876:8): [True: 6.50k, False: 0]
  ------------------
 1877|  6.50k|        if(p->data.keyFrameFields)
  ------------------
  |  Branch (1877:12): [True: 4.75k, False: 1.75k]
  ------------------
 1878|  4.75k|            UA_Array_delete(p->data.keyFrameFields, p->fieldCount,
 1879|  4.75k|                            &UA_TYPES[UA_TYPES_DATAVALUE]);
  ------------------
  |  |  769|  4.75k|#define UA_TYPES_DATAVALUE 22
  ------------------
 1880|  6.50k|    } else if(p->header.dataSetMessageType == UA_DATASETMESSAGE_DATADELTAFRAME) {
  ------------------
  |  Branch (1880:15): [True: 0, False: 0]
  ------------------
 1881|      0|        if(p->data.deltaFrameFields) {
  ------------------
  |  Branch (1881:12): [True: 0, False: 0]
  ------------------
 1882|      0|            for(UA_UInt16 i = 0; i < p->fieldCount; i++)
  ------------------
  |  Branch (1882:34): [True: 0, False: 0]
  ------------------
 1883|      0|                UA_DataValue_clear(&p->data.deltaFrameFields[i].value);
 1884|      0|            UA_free(p->data.deltaFrameFields);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1885|      0|        }
 1886|      0|    }
 1887|       |
 1888|  6.50k|    memset(p, 0, sizeof(UA_DataSetMessage));
 1889|  6.50k|}

UA_NetworkMessage_decodeJson:
  543|  7.59k|                             const UA_DecodeJsonOptions *jo) {
  544|       |    /* Set up the context */
  545|  7.59k|    cj5_token tokens[UA_JSON_MAXTOKENCOUNT];
  546|  7.59k|    PubSubDecodeJsonCtx ctx;
  547|  7.59k|    memset(&ctx, 0, sizeof(PubSubDecodeJsonCtx));
  548|  7.59k|    ctx.ctx.tokens = tokens;
  549|  7.59k|    if(eo)
  ------------------
  |  Branch (549:8): [True: 0, False: 7.59k]
  ------------------
  550|      0|        ctx.eo = *eo;
  551|  7.59k|    if(jo) {
  ------------------
  |  Branch (551:8): [True: 0, False: 7.59k]
  ------------------
  552|      0|        ctx.ctx.namespaceMapping = jo->namespaceMapping;
  553|      0|        ctx.ctx.serverUrisSize = jo->serverUrisSize;
  554|      0|        ctx.ctx.serverUris = jo->serverUris;
  555|      0|        ctx.ctx.customTypes = jo->customTypes;
  556|      0|    }
  557|       |
  558|  7.59k|    status ret = tokenize(&ctx.ctx, src, UA_JSON_MAXTOKENCOUNT, NULL);
  ------------------
  |  |   20|  7.59k|#define UA_JSON_MAXTOKENCOUNT 256
  ------------------
  559|  7.59k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  7.59k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (559:8): [True: 736, False: 6.85k]
  ------------------
  560|    736|        goto cleanup;
  561|       |
  562|  6.85k|    ret = NetworkMessage_decodeJsonInternal(&ctx, dst);
  563|  6.85k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.85k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (563:8): [True: 6.84k, False: 12]
  ------------------
  564|  6.84k|        UA_NetworkMessage_clear(dst);
  565|       |
  566|  7.59k| cleanup:
  567|       |    /* Free token array on the heap */
  568|  7.59k|    if(ctx.ctx.tokens != tokens)
  ------------------
  |  Branch (568:8): [True: 618, False: 6.97k]
  ------------------
  569|    618|        UA_free((void*)(uintptr_t)ctx.ctx.tokens);
  ------------------
  |  |   19|    618|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  570|  7.59k|    return ret;
  571|  6.85k|}
ua_pubsub_networkmessage_json.c:NetworkMessage_decodeJsonInternal:
  461|  6.85k|                                  UA_NetworkMessage *dst) {
  462|  6.85k|    memset(dst, 0, sizeof(UA_NetworkMessage));
  463|  6.85k|    dst->chunkMessage = false;
  464|  6.85k|    dst->groupHeaderEnabled = false;
  465|  6.85k|    dst->payloadHeaderEnabled = false;
  466|  6.85k|    dst->picosecondsEnabled = false;
  467|  6.85k|    dst->promotedFieldsEnabled = false;
  468|       |
  469|       |    /* The NetworkMessage must be a JSON object */
  470|  6.85k|    if(currentTokenType(&ctx->ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (470:8): [True: 101, False: 6.75k]
  ------------------
  471|    101|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    101|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  472|       |
  473|       |    /* Is Messages an Array? How big? */
  474|  6.75k|    size_t searchResultMessages = 0;
  475|  6.75k|    status found = lookAheadForKey(&ctx->ctx, UA_DECODEKEY_MESSAGES, &searchResultMessages);
  476|  6.75k|    if(found != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.75k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (476:8): [True: 143, False: 6.61k]
  ------------------
  477|    143|        return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  239|    143|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
  478|  6.61k|    const cj5_token *bodyToken = &ctx->ctx.tokens[searchResultMessages];
  479|  6.61k|    size_t messageCount = 1;
  480|  6.61k|    if(bodyToken->type == CJ5_TOKEN_ARRAY)
  ------------------
  |  Branch (480:8): [True: 2.51k, False: 4.10k]
  ------------------
  481|  2.51k|        messageCount = (size_t)bodyToken->size;
  482|       |
  483|       |    /* Too many DataSetMessages */
  484|  6.61k|    if(messageCount > UA_NETWORKMESSAGE_MAXMESSAGECOUNT)
  ------------------
  |  |  136|  6.61k|#define UA_NETWORKMESSAGE_MAXMESSAGECOUNT 32
  ------------------
  |  Branch (484:8): [True: 2, False: 6.61k]
  ------------------
  485|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  486|       |
  487|       |    /* MessageType */
  488|  6.61k|    UA_Boolean isUaData = true;
  489|  6.61k|    size_t searchResultMessageType = 0;
  490|  6.61k|    found = lookAheadForKey(&ctx->ctx, UA_DECODEKEY_MESSAGETYPE, &searchResultMessageType);
  491|  6.61k|    if(found != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.61k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (491:8): [True: 45, False: 6.56k]
  ------------------
  492|     45|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     45|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  493|  6.56k|    size_t size = getTokenLength(&ctx->ctx.tokens[searchResultMessageType]);
  494|  6.56k|    const char* msgType = &ctx->ctx.json5[ctx->ctx.tokens[searchResultMessageType].start];
  495|  6.56k|    if(size == 7) { //ua-data
  ------------------
  |  Branch (495:8): [True: 6.45k, False: 113]
  ------------------
  496|  6.45k|        if(strncmp(msgType, "ua-data", size) != 0)
  ------------------
  |  Branch (496:12): [True: 61, False: 6.39k]
  ------------------
  497|     61|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     61|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  498|  6.39k|        isUaData = true;
  499|  6.39k|    } else if(size == 11) { //ua-metadata
  ------------------
  |  Branch (499:15): [True: 80, False: 33]
  ------------------
  500|     80|        if(strncmp(msgType, "ua-metadata", size) != 0)
  ------------------
  |  Branch (500:12): [True: 79, False: 1]
  ------------------
  501|     79|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     79|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  502|      1|        isUaData = false;
  503|     33|    } else {
  504|     33|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     33|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  505|     33|    }
  506|       |
  507|       |    //TODO: MetaData
  508|  6.39k|    if(!isUaData)
  ------------------
  |  Branch (508:8): [True: 1, False: 6.39k]
  ------------------
  509|      1|        return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  239|      1|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
  510|       |
  511|  6.39k|    dst->payload.dataSetMessages = (UA_DataSetMessage*)
  512|  6.39k|        UA_calloc(messageCount, sizeof(UA_DataSetMessage));
  ------------------
  |  |   20|  6.39k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  513|  6.39k|    if(!dst->payload.dataSetMessages)
  ------------------
  |  Branch (513:8): [True: 12, False: 6.37k]
  ------------------
  514|     12|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|     12|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  515|  6.37k|    dst->messageCount = (UA_Byte)messageCount;
  516|       |
  517|       |    /* Network Message */
  518|  6.37k|    UA_String messageType;
  519|  6.37k|    DecodeEntry entries[5] = {
  520|  6.37k|        {UA_DECODEKEY_MESSAGEID, &dst->messageId, NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  395|  6.37k|#define UA_TYPES_STRING 11
  ------------------
  521|  6.37k|        {UA_DECODEKEY_MESSAGETYPE, &messageType, NULL, false, NULL},
  522|  6.37k|        {UA_DECODEKEY_PUBLISHERID, &dst->publisherId, decodePublisherIdJsonInternal, false, NULL},
  523|  6.37k|        {UA_DECODEKEY_DATASETCLASSID, &dst->dataSetClassId, NULL, false, &UA_TYPES[UA_TYPES_GUID]},
  ------------------
  |  |  463|  6.37k|#define UA_TYPES_GUID 13
  ------------------
  524|  6.37k|        {UA_DECODEKEY_MESSAGES, dst, DatasetMessage_Array_decodeJsonInternal, false, NULL}
  525|  6.37k|    };
  526|       |
  527|  6.37k|    status ret = decodeFields(&ctx->ctx, entries, 5);
  528|  6.37k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.37k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (528:8): [True: 6.36k, False: 12]
  ------------------
  529|  6.36k|        return ret;
  530|       |
  531|     12|    dst->messageIdEnabled = entries[0].found;
  532|     12|    dst->publisherIdEnabled = entries[2].found;
  533|     12|    dst->dataSetClassIdEnabled = entries[3].found;
  534|     12|    dst->payloadHeaderEnabled = true;
  535|       |
  536|     12|    return ret;
  537|  6.37k|}
ua_pubsub_networkmessage_json.c:decodePublisherIdJsonInternal:
  444|    204|                              const UA_DataType *type) {
  445|    204|    UA_PublisherId *p = (UA_PublisherId*)dst;
  446|    204|    if(currentTokenType(ctx) == CJ5_TOKEN_NUMBER) {
  ------------------
  |  Branch (446:8): [True: 170, False: 34]
  ------------------
  447|       |        /* Store in biggest possible integer. The problem is that with a UInt64
  448|       |         * is that a string is expected for it in JSON. Therefore, the maximum
  449|       |         * value is set to UInt32. */
  450|    170|        p->idType = UA_PUBLISHERIDTYPE_UINT32;
  451|    170|        return decodeJsonJumpTable[UA_DATATYPEKIND_UINT32](ctx, &p->id.uint32, NULL);
  452|    170|    } else if(currentTokenType(ctx) == CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (452:15): [True: 31, False: 3]
  ------------------
  453|     31|        p->idType = UA_PUBLISHERIDTYPE_STRING;
  454|     31|        return decodeJsonJumpTable[UA_DATATYPEKIND_STRING](ctx, &p->id.string, NULL);
  455|     31|    }
  456|      3|    return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  457|    204|}
ua_pubsub_networkmessage_json.c:DatasetMessage_Array_decodeJsonInternal:
  413|  6.01k|                                        const UA_DataType *_) {
  414|  6.01k|    PubSubDecodeJsonCtx *ctx = (PubSubDecodeJsonCtx*)ctx_;
  415|       |
  416|       |    /* Array or object */
  417|  6.01k|    size_t length = 1;
  418|  6.01k|    if(currentTokenType(&ctx->ctx) == CJ5_TOKEN_ARRAY) {
  ------------------
  |  Branch (418:8): [True: 2.49k, False: 3.52k]
  ------------------
  419|  2.49k|        length = (size_t)ctx->ctx.tokens[ctx->ctx.index].size;
  420|       |
  421|       |        /* Go to the first array member */
  422|  2.49k|        ctx->ctx.index++;
  423|       |
  424|       |        /* Return early for empty arrays */
  425|  2.49k|        if(length == 0)
  ------------------
  |  Branch (425:12): [True: 14, False: 2.47k]
  ------------------
  426|     14|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     14|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  427|  3.52k|    } else if(currentTokenType(&ctx->ctx) != CJ5_TOKEN_OBJECT) {
  ------------------
  |  Branch (427:15): [True: 279, False: 3.24k]
  ------------------
  428|    279|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    279|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  429|    279|    }
  430|       |
  431|       |    /* Decode array members */
  432|  5.72k|    UA_NetworkMessage *nm = (UA_NetworkMessage*)dst;
  433|  5.72k|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (433:23): [True: 5.72k, False: 1]
  ------------------
  434|  5.72k|        status ret = DatasetMessage_Payload_decodeJsonInternal(ctx, nm, i);
  435|  5.72k|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  5.72k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (435:12): [True: 5.72k, False: 1]
  ------------------
  436|  5.72k|            return ret;
  437|  5.72k|    }
  438|       |
  439|      1|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  440|  5.72k|}
ua_pubsub_networkmessage_json.c:DatasetMessage_Payload_decodeJsonInternal:
  372|  5.72k|                                          size_t dsmIndex) {
  373|  5.72k|    UA_DataSetMessage *dsm = &nm->payload.dataSetMessages[dsmIndex];
  374|  5.72k|    UA_ConfigurationVersionDataType cvd;
  375|  5.72k|    struct PayloadData pd;
  376|  5.72k|    pd.nm = nm;
  377|  5.72k|    pd.dsmIndex = dsmIndex;
  378|       |
  379|  5.72k|    DecodeEntry entries[7] = {
  380|  5.72k|        {UA_DECODEKEY_DATASETWRITERID, &nm->dataSetWriterIds[dsmIndex], NULL, false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  157|  5.72k|#define UA_TYPES_UINT16 4
  ------------------
  381|  5.72k|        {UA_DECODEKEY_SEQUENCENUMBER, &dsm->header.dataSetMessageSequenceNr, NULL, false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  157|  5.72k|#define UA_TYPES_UINT16 4
  ------------------
  382|  5.72k|        {UA_DECODEKEY_METADATAVERSION, &cvd, &MetaDataVersion_decodeJsonInternal, false, NULL},
  383|  5.72k|        {UA_DECODEKEY_TIMESTAMP, &dsm->header.timestamp, NULL, false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  429|  5.72k|#define UA_TYPES_DATETIME 12
  ------------------
  384|  5.72k|        {UA_DECODEKEY_DSM_STATUS, &dsm->header.status, NULL, false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  157|  5.72k|#define UA_TYPES_UINT16 4
  ------------------
  385|  5.72k|        {UA_DECODEKEY_MESSAGETYPE, NULL, NULL, false, NULL},
  386|  5.72k|        {UA_DECODEKEY_PAYLOAD, &pd, DataSetPayload_decodeJsonInternal, false, NULL}
  387|  5.72k|    };
  388|  5.72k|    status ret = decodeFields(&ctx->ctx, entries, 7);
  389|       |
  390|       |    /* Error or no DatasetWriterId found or no payload found */
  391|  5.72k|    if(ret != UA_STATUSCODE_GOOD || !entries[0].found || !entries[6].found)
  ------------------
  |  |   17|  11.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (391:8): [True: 3.67k, False: 2.05k]
  |  Branch (391:37): [True: 2.04k, False: 5]
  |  Branch (391:58): [True: 4, False: 1]
  ------------------
  392|  5.72k|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|  5.72k|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  393|       |
  394|       |    /* TODO: Check FieldEncoding1 and FieldEncoding2 to determine the field encoding */
  395|      1|    dsm->header.fieldEncoding = UA_FIELDENCODING_DATAVALUE;
  396|      1|    dsm->header.dataSetMessageSequenceNrEnabled = entries[1].found;
  397|      1|    dsm->header.configVersionMajorVersion = cvd.majorVersion;
  398|      1|    dsm->header.configVersionMinorVersion = cvd.minorVersion;
  399|      1|    dsm->header.configVersionMajorVersionEnabled = entries[2].found;
  400|      1|    dsm->header.configVersionMinorVersionEnabled = entries[2].found;
  401|      1|    dsm->header.timestampEnabled = entries[3].found;
  402|      1|    dsm->header.statusEnabled = entries[4].found;
  403|       |
  404|      1|    dsm->header.dataSetMessageType = UA_DATASETMESSAGE_DATAKEYFRAME;
  405|      1|    dsm->header.picoSecondsIncluded = false;
  406|      1|    dsm->header.dataSetMessageValid = true;
  407|      1|    dsm->header.fieldEncoding = UA_FIELDENCODING_VARIANT;
  408|      1|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  409|  5.72k|}
ua_pubsub_networkmessage_json.c:MetaDataVersion_decodeJsonInternal:
  289|      2|MetaDataVersion_decodeJsonInternal(ParseCtx *ctx, void* cvd, const UA_DataType *_) {
  290|      2|    return decodeJsonJumpTable[UA_DATATYPEKIND_STRUCTURE]
  291|      2|        (ctx, cvd, &UA_TYPES[UA_TYPES_CONFIGURATIONVERSIONDATATYPE]);
  ------------------
  |  | 2146|      2|#define UA_TYPES_CONFIGURATIONVERSIONDATATYPE 57
  ------------------
  292|      2|}
ua_pubsub_networkmessage_json.c:DataSetPayload_decodeJsonInternal:
  312|  4.76k|DataSetPayload_decodeJsonInternal(ParseCtx *ctx_, void *data, const UA_DataType *_) {
  313|  4.76k|    PubSubDecodeJsonCtx *ctx = (PubSubDecodeJsonCtx*)ctx_;
  314|  4.76k|    struct PayloadData *pd = (struct PayloadData*)data;
  315|  4.76k|    UA_NetworkMessage *nm = pd->nm;
  316|  4.76k|    UA_DataSetMessage *dsm = &nm->payload.dataSetMessages[pd->dsmIndex];
  317|       |
  318|  4.76k|    dsm->header.dataSetMessageValid = true;
  319|       |
  320|  4.76k|    if(currentTokenType(&ctx->ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (320:8): [True: 1, False: 4.76k]
  ------------------
  321|      1|        ctx->ctx.index++;
  322|      1|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  323|      1|    }
  324|       |
  325|  4.76k|    if(currentTokenType(&ctx->ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (325:8): [True: 5, False: 4.75k]
  ------------------
  326|      5|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  327|       |
  328|       |    /* The number of key-value pairs */
  329|  4.75k|    UA_assert(ctx->ctx.tokens[ctx->ctx.index].size % 2 == 0);
  ------------------
  |  |  399|  4.75k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (329:5): [True: 4.75k, False: 0]
  ------------------
  330|  4.75k|    size_t length = (size_t)(ctx->ctx.tokens[ctx->ctx.index].size) / 2;
  331|       |
  332|  4.75k|    if(length > UA_UINT16_MAX)
  ------------------
  |  |   91|  4.75k|#define UA_UINT16_MAX 65535
  ------------------
  |  Branch (332:8): [True: 1, False: 4.75k]
  ------------------
  333|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  334|       |
  335|  4.75k|    dsm->data.keyFrameFields = (UA_DataValue *)
  336|  4.75k|        UA_Array_new(length, &UA_TYPES[UA_TYPES_DATAVALUE]);
  ------------------
  |  |  769|  4.75k|#define UA_TYPES_DATAVALUE 22
  ------------------
  337|  4.75k|    if(!dsm->data.keyFrameFields)
  ------------------
  |  Branch (337:8): [True: 1, False: 4.75k]
  ------------------
  338|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  339|  4.75k|    dsm->fieldCount = (UA_UInt16)length;
  340|       |
  341|  4.75k|    dsm->header.fieldEncoding = UA_FIELDENCODING_DATAVALUE;
  342|       |
  343|  4.75k|    const UA_DataSetMessage_EncodingMetaData *emd =
  344|  4.75k|            findEncodingMetaData(&ctx->eo, nm->dataSetWriterIds[pd->dsmIndex]);
  345|       |
  346|       |    /* Iterate over the key/value pairs in the object. Keys are stored in fieldnames. */
  347|  4.75k|    ctx->ctx.index++; /* Go to the first key */
  348|  4.75k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.75k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  349|  25.7k|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (349:23): [True: 24.0k, False: 1.67k]
  ------------------
  350|  24.0k|        UA_assert(currentTokenType(&ctx->ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  399|  24.0k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (350:9): [True: 24.0k, False: 0]
  ------------------
  351|  24.0k|        UA_String fieldName = UA_STRING_NULL;
  352|  24.0k|        ret = decodeJsonJumpTable[UA_DATATYPEKIND_STRING](&ctx->ctx, &fieldName, NULL);
  353|  24.0k|        UA_CHECK_STATUS(ret, return ret);
  ------------------
  |  |  179|  24.0k|    UA_CHECK(isGood(STATUSCODE), EVAL_ON_ERROR)
  |  |  ------------------
  |  |  |  |  172|  24.0k|    do {                                                                                 \
  |  |  |  |  173|  24.0k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  579|  24.0k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (579:25): [True: 1, False: 24.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  174|      1|            EVAL_ON_ERROR;                                                               \
  |  |  |  |  175|      1|        }                                                                                \
  |  |  |  |  176|  24.0k|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (176:13): [Folded, False: 24.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  354|       |
  355|  24.0k|        size_t index = decodingFieldIndex(emd, fieldName, i);
  356|  24.0k|        if(index >= length) {
  ------------------
  |  Branch (356:12): [True: 0, False: 24.0k]
  ------------------
  357|      0|            UA_String_clear(&fieldName);
  358|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  359|      0|        }
  360|  24.0k|        UA_DataValue_clear(&dsm->data.keyFrameFields[index]);
  361|  24.0k|        UA_String_clear(&fieldName);
  362|  24.0k|        ret = decodeJsonJumpTable[UA_DATATYPEKIND_DATAVALUE]
  363|  24.0k|            (&ctx->ctx, &dsm->data.keyFrameFields[index], NULL);
  364|  24.0k|        UA_CHECK_STATUS(ret, return ret);
  ------------------
  |  |  179|  24.0k|    UA_CHECK(isGood(STATUSCODE), EVAL_ON_ERROR)
  |  |  ------------------
  |  |  |  |  172|  24.0k|    do {                                                                                 \
  |  |  |  |  173|  24.0k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |  579|  24.0k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (579:25): [True: 3.07k, False: 20.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  174|  3.07k|            EVAL_ON_ERROR;                                                               \
  |  |  |  |  175|  3.07k|        }                                                                                \
  |  |  |  |  176|  24.0k|    } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (176:13): [Folded, False: 20.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  365|  24.0k|    }
  366|       |
  367|  1.67k|    return ret;
  368|  4.75k|}
ua_pubsub_networkmessage_json.c:decodingFieldIndex:
  296|  24.0k|                   UA_String name, size_t origIndex) {
  297|  24.0k|    if(!emd)
  ------------------
  |  Branch (297:8): [True: 24.0k, False: 0]
  ------------------
  298|  24.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:
   65|  22.3k|                          const UA_DataTypeArray *customTypes) {
   66|       |    /* Always look in built-in types first (may contain data types from all
   67|       |     * namespaces).
   68|       |     *
   69|       |     * TODO: The standard-defined types are ordered. See if binary search is
   70|       |     * more efficient. */
   71|  4.70M|    for(size_t i = 0; i < UA_TYPES_COUNT; ++i) {
  ------------------
  |  |   17|  4.70M|#define UA_TYPES_COUNT 388
  ------------------
  |  Branch (71:23): [True: 4.69M, False: 11.5k]
  ------------------
   72|  4.69M|        if(nodeIdOrder(&UA_TYPES[i].typeId, typeId, NULL) == UA_ORDER_EQ)
  ------------------
  |  Branch (72:12): [True: 10.7k, False: 4.68M]
  ------------------
   73|  10.7k|            return &UA_TYPES[i];
   74|  4.69M|    }
   75|       |
   76|       |    /* Search in the customTypes */
   77|  11.5k|    while(customTypes) {
  ------------------
  |  Branch (77:11): [True: 0, False: 11.5k]
  ------------------
   78|      0|        for(size_t i = 0; i < customTypes->typesSize; ++i) {
  ------------------
  |  Branch (78:27): [True: 0, False: 0]
  ------------------
   79|      0|            if(nodeIdOrder(&customTypes->types[i].typeId, typeId, NULL) == UA_ORDER_EQ)
  ------------------
  |  Branch (79:16): [True: 0, False: 0]
  ------------------
   80|      0|                return &customTypes->types[i];
   81|      0|        }
   82|      0|        customTypes = customTypes->next;
   83|      0|    }
   84|       |
   85|  11.5k|    return NULL;
   86|  11.5k|}
UA_ByteString_allocBuffer:
  756|  9.43k|UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length) {
  757|  9.43k|    UA_ByteString_init(bs);
  758|  9.43k|    if(length == 0) {
  ------------------
  |  Branch (758:8): [True: 423, False: 9.01k]
  ------------------
  759|    423|        bs->data = (u8*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|    423|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  760|    423|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    423|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  761|    423|    }
  762|  9.01k|    bs->data = (u8*)UA_calloc(1,length);
  ------------------
  |  |   20|  9.01k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  763|  9.01k|    if(UA_UNLIKELY(!bs->data))
  ------------------
  |  |  579|  9.01k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (579:25): [True: 1, False: 9.01k]
  |  |  ------------------
  ------------------
  764|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  765|  9.01k|    bs->length = length;
  766|  9.01k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  9.01k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  767|  9.01k|}
UA_new:
 1918|  29.1k|UA_new(const UA_DataType *type) {
 1919|  29.1k|    void *p = UA_calloc(1, type->memSize);
  ------------------
  |  |   20|  29.1k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1920|  29.1k|    return p;
 1921|  29.1k|}
UA_copy:
 2094|  30.2k|UA_copy(const void *src, void *dst, const UA_DataType *type) {
 2095|  30.2k|    memset(dst, 0, type->memSize); /* init */
 2096|  30.2k|    UA_StatusCode retval = copyJumpTable[type->typeKind](src, dst, type);
 2097|  30.2k|    if(retval != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  30.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2097:8): [True: 3, False: 30.2k]
  ------------------
 2098|      3|        UA_clear(dst, type);
 2099|  30.2k|    return retval;
 2100|  30.2k|}
UA_clear:
 2197|  1.38M|UA_clear(void *p, const UA_DataType *type) {
 2198|  1.38M|    clearJumpTable[type->typeKind](p, type);
 2199|  1.38M|    memset(p, 0, type->memSize); /* init */
 2200|  1.38M|}
UA_delete:
 2203|  7.36k|UA_delete(void *p, const UA_DataType *type) {
 2204|  7.36k|    clearJumpTable[type->typeKind](p, type);
 2205|  7.36k|    UA_free(p);
  ------------------
  |  |   19|  7.36k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2206|  7.36k|}
UA_Array_new:
 2684|  4.75k|UA_Array_new(size_t size, const UA_DataType *type) {
 2685|  4.75k|    if(size > UA_INT32_MAX)
  ------------------
  |  |  100|  4.75k|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (2685:8): [True: 0, False: 4.75k]
  ------------------
 2686|      0|        return NULL;
 2687|  4.75k|    if(size == 0)
  ------------------
  |  Branch (2687:8): [True: 4, False: 4.75k]
  ------------------
 2688|      4|        return UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|      4|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2689|  4.75k|    return UA_calloc(size, type->memSize);
  ------------------
  |  |   20|  4.75k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2690|  4.75k|}
UA_Array_copy:
 2694|  30.2k|              void **dst, const UA_DataType *type) {
 2695|  30.2k|    if(size == 0) {
  ------------------
  |  Branch (2695:8): [True: 5.34k, False: 24.8k]
  ------------------
 2696|  5.34k|        if(src == NULL)
  ------------------
  |  Branch (2696:12): [True: 0, False: 5.34k]
  ------------------
 2697|      0|            *dst = NULL;
 2698|  5.34k|        else
 2699|  5.34k|            *dst= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  5.34k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2700|  5.34k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  5.34k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2701|  5.34k|    }
 2702|       |
 2703|       |    /* Check the array consistency -- defensive programming in case the user
 2704|       |     * manually created an inconsistent array */
 2705|  24.8k|    if(UA_UNLIKELY(!type || !src))
  ------------------
  |  |  579|  49.7k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (579:25): [True: 0, False: 24.8k]
  |  |  |  Branch (579:43): [True: 0, False: 24.8k]
  |  |  |  Branch (579:43): [True: 0, False: 24.8k]
  |  |  ------------------
  ------------------
 2706|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 2707|       |
 2708|       |    /* calloc, so we don't have to check retval in every iteration of copying */
 2709|  24.8k|    *dst = UA_calloc(size, type->memSize);
  ------------------
  |  |   20|  24.8k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2710|  24.8k|    if(!*dst)
  ------------------
  |  Branch (2710:8): [True: 3, False: 24.8k]
  ------------------
 2711|      3|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      3|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2712|       |
 2713|  24.8k|    if(type->pointerFree) {
  ------------------
  |  Branch (2713:8): [True: 24.8k, False: 0]
  ------------------
 2714|  24.8k|        memcpy(*dst, src, type->memSize * size);
 2715|  24.8k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  24.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2716|  24.8k|    }
 2717|       |
 2718|      0|    uintptr_t ptrs = (uintptr_t)src;
 2719|      0|    uintptr_t ptrd = (uintptr_t)*dst;
 2720|      0|    UA_StatusCode retval = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2721|      0|    for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2721:23): [True: 0, False: 0]
  ------------------
 2722|      0|        retval |= UA_copy((void*)ptrs, (void*)ptrd, type);
 2723|      0|        ptrs += type->memSize;
 2724|      0|        ptrd += type->memSize;
 2725|      0|    }
 2726|      0|    if(retval != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2726:8): [True: 0, False: 0]
  ------------------
 2727|      0|        UA_Array_delete(*dst, size, type);
 2728|       |        *dst = NULL;
 2729|      0|    }
 2730|      0|    return retval;
 2731|  24.8k|}
UA_Array_delete:
 2822|   177k|UA_Array_delete(void *p, size_t size, const UA_DataType *type) {
 2823|   177k|    if(!type->pointerFree) {
  ------------------
  |  Branch (2823:8): [True: 24.5k, False: 153k]
  ------------------
 2824|  24.5k|        uintptr_t ptr = (uintptr_t)p;
 2825|  1.28M|        for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2825:27): [True: 1.26M, False: 24.5k]
  ------------------
 2826|  1.26M|            UA_clear((void*)ptr, type);
 2827|  1.26M|            ptr += type->memSize;
 2828|  1.26M|        }
 2829|  24.5k|    }
 2830|   177k|    UA_free((void*)((uintptr_t)p & ~(uintptr_t)UA_EMPTY_ARRAY_SENTINEL));
  ------------------
  |  |   19|   177k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2831|   177k|}
ua_types.c:Variant_clear:
 1376|  1.23M|Variant_clear(void *p, const UA_DataType *_) {
 1377|  1.23M|    UA_Variant *v = (UA_Variant *)p;
 1378|       |
 1379|       |    /* The content is "borrowed" */
 1380|  1.23M|    if(v->storageType == UA_VARIANT_DATA_NODELETE)
  ------------------
  |  Branch (1380:8): [True: 0, False: 1.23M]
  ------------------
 1381|      0|        return;
 1382|       |
 1383|       |    /* Delete the value */
 1384|  1.23M|    if(v->type && v->data > UA_EMPTY_ARRAY_SENTINEL) {
  ------------------
  |  |  755|  34.2k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1384:8): [True: 34.2k, False: 1.19M]
  |  Branch (1384:19): [True: 27.2k, False: 7.04k]
  ------------------
 1385|  27.2k|        if(v->arrayLength == 0)
  ------------------
  |  Branch (1385:12): [True: 21.8k, False: 5.40k]
  ------------------
 1386|  21.8k|            v->arrayLength = 1;
 1387|  27.2k|        UA_Array_delete(v->data, v->arrayLength, v->type);
 1388|  27.2k|        v->data = NULL;
 1389|  27.2k|    }
 1390|       |
 1391|       |    /* Delete the array dimensions */
 1392|  1.23M|    if((void*)v->arrayDimensions > UA_EMPTY_ARRAY_SENTINEL)
  ------------------
  |  |  755|  1.23M|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1392:8): [True: 5.47k, False: 1.22M]
  ------------------
 1393|  5.47k|        UA_free(v->arrayDimensions);
  ------------------
  |  |   19|  5.47k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1394|  1.23M|}
ua_types.c:DataValue_clear:
 1848|  1.22M|DataValue_clear(void *p, const UA_DataType *_) {
 1849|  1.22M|    UA_DataValue *dv = (UA_DataValue *)p;
 1850|       |    Variant_clear(&dv->value, NULL);
 1851|  1.22M|}
ua_types.c:String_copy:
  280|  30.2k|String_copy(const void *src, void *dst, const UA_DataType *_) {
  281|  30.2k|    const UA_String *srcS = (const UA_String*)src;
  282|  30.2k|    UA_String *dstS = (UA_String *)dst;
  283|  30.2k|    UA_StatusCode res =
  284|  30.2k|        UA_Array_copy(srcS->data, srcS->length, (void**)&dstS->data,
  285|  30.2k|                      &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|  30.2k|#define UA_TYPES_BYTE 2
  ------------------
  286|  30.2k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  30.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (286:8): [True: 30.2k, False: 3]
  ------------------
  287|  30.2k|        dstS->length = srcS->length;
  288|  30.2k|    return res;
  289|  30.2k|}
ua_types.c:nopClear:
 2159|  8.48k|static void nopClear(void *p, const UA_DataType *type) { }
ua_types.c:String_clear:
  292|   143k|String_clear(void *p, const UA_DataType *_) {
  293|   143k|    UA_String *s = (UA_String*)p;
  294|   143k|    UA_Array_delete(s->data, s->length, &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|   143k|#define UA_TYPES_BYTE 2
  ------------------
  295|   143k|}
ua_types.c:NodeId_clear:
  771|  31.9k|NodeId_clear(void *p, const UA_DataType *_) {
  772|  31.9k|    UA_NodeId *id = (UA_NodeId*)p;
  773|  31.9k|    switch(id->identifierType) {
  774|  9.90k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (774:5): [True: 9.90k, False: 22.0k]
  ------------------
  775|  11.0k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (775:5): [True: 1.12k, False: 30.7k]
  ------------------
  776|  11.0k|        String_clear(&id->identifier.string, NULL);
  777|  11.0k|        break;
  778|  20.8k|    default: break;
  ------------------
  |  Branch (778:5): [True: 20.8k, False: 11.0k]
  ------------------
  779|  31.9k|    }
  780|  31.9k|}
ua_types.c:ExpandedNodeId_clear:
 1072|  4.35k|ExpandedNodeId_clear(void *p, const UA_DataType *_) {
 1073|  4.35k|    UA_ExpandedNodeId *id = (UA_ExpandedNodeId*)p;
 1074|  4.35k|    NodeId_clear(&id->nodeId, NULL);
 1075|       |    String_clear(&id->namespaceUri, NULL);
 1076|  4.35k|}
ua_types.c:QualifiedName_clear:
  396|  19.7k|QualifiedName_clear(void *p, const UA_DataType *_) {
  397|  19.7k|    UA_QualifiedName *qn = (UA_QualifiedName*)p;
  398|       |    String_clear(&qn->name, NULL);
  399|  19.7k|}
ua_types.c:LocalizedText_clear:
 1831|  1.56k|LocalizedText_clear(void *p, const UA_DataType *_) {
 1832|  1.56k|    UA_LocalizedText *lt = (UA_LocalizedText *)p;
 1833|  1.56k|    String_clear(&lt->locale, NULL);
 1834|       |    String_clear(&lt->text, NULL);
 1835|  1.56k|}
ua_types.c:ExtensionObject_clear:
 1245|  21.2k|ExtensionObject_clear(void *p, const UA_DataType *_) {
 1246|  21.2k|    UA_ExtensionObject *eo = (UA_ExtensionObject *)p;
 1247|  21.2k|    switch(eo->encoding) {
 1248|  3.16k|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (1248:5): [True: 3.16k, False: 18.0k]
  ------------------
 1249|  12.9k|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (1249:5): [True: 9.82k, False: 11.4k]
  ------------------
 1250|  13.8k|    case UA_EXTENSIONOBJECT_ENCODED_XML:
  ------------------
  |  Branch (1250:5): [True: 900, False: 20.3k]
  ------------------
 1251|  13.8k|        NodeId_clear(&eo->content.encoded.typeId, NULL);
 1252|  13.8k|        String_clear(&eo->content.encoded.body, NULL);
 1253|  13.8k|        break;
 1254|  7.36k|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (1254:5): [True: 7.36k, False: 13.8k]
  ------------------
 1255|  7.36k|        if(eo->content.decoded.data)
  ------------------
  |  Branch (1255:12): [True: 7.36k, False: 0]
  ------------------
 1256|  7.36k|            UA_delete(eo->content.decoded.data, eo->content.decoded.type);
 1257|  7.36k|        break;
 1258|      0|    default:
  ------------------
  |  Branch (1258:5): [True: 0, False: 21.2k]
  ------------------
 1259|      0|        break;
 1260|  21.2k|    }
 1261|  21.2k|}
ua_types.c:DiagnosticInfo_clear:
 1878|    991|DiagnosticInfo_clear(void *p, const UA_DataType *_) {
 1879|    991|    UA_DiagnosticInfo *di = (UA_DiagnosticInfo *)p;
 1880|       |
 1881|    991|    String_clear(&di->additionalInfo, NULL);
 1882|    991|    if(di->hasInnerDiagnosticInfo && di->innerDiagnosticInfo) {
  ------------------
  |  Branch (1882:8): [True: 2, False: 989]
  |  Branch (1882:38): [True: 1, False: 1]
  ------------------
 1883|      1|        DiagnosticInfo_clear(di->innerDiagnosticInfo, NULL);
 1884|      1|        UA_free(di->innerDiagnosticInfo);
  ------------------
  |  |   19|      1|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1885|      1|    }
 1886|    991|}
ua_types.c:clearStructure:
 2103|  1.24k|clearStructure(void *p, const UA_DataType *type) {
 2104|  1.24k|    uintptr_t ptr = (uintptr_t)p;
 2105|  6.70k|    for(size_t i = 0; i < type->membersSize; ++i) {
  ------------------
  |  Branch (2105:23): [True: 5.46k, False: 1.24k]
  ------------------
 2106|  5.46k|        const UA_DataTypeMember *m = &type->members[i];
 2107|  5.46k|        const UA_DataType *mt = m->memberType;
 2108|  5.46k|        ptr += m->padding;
 2109|  5.46k|        if(!m->isOptional) {
  ------------------
  |  Branch (2109:12): [True: 5.46k, False: 0]
  ------------------
 2110|  5.46k|            if(!m->isArray) {
  ------------------
  |  Branch (2110:16): [True: 4.34k, False: 1.12k]
  ------------------
 2111|  4.34k|                clearJumpTable[mt->typeKind]((void*)ptr, mt);
 2112|  4.34k|                ptr += mt->memSize;
 2113|  4.34k|            } else {
 2114|  1.12k|                size_t length = *(size_t*)ptr;
 2115|  1.12k|                ptr += sizeof(size_t);
 2116|  1.12k|                UA_Array_delete(*(void**)ptr, length, mt);
 2117|  1.12k|                ptr += sizeof(void*);
 2118|  1.12k|            }
 2119|  5.46k|        } else { /* field is optional */
 2120|      0|            if(!m->isArray) {
  ------------------
  |  Branch (2120:16): [True: 0, False: 0]
  ------------------
 2121|       |                /* optional scalar field is contained */
 2122|      0|                if((*(void *const *)ptr != NULL))
  ------------------
  |  Branch (2122:20): [True: 0, False: 0]
  ------------------
 2123|      0|                    UA_Array_delete(*(void **)ptr, 1, mt);
 2124|      0|                ptr += sizeof(void *);
 2125|      0|            } else {
 2126|       |                /* optional array field is contained */
 2127|      0|                if((*(void *const *)(ptr + sizeof(size_t)) != NULL)) {
  ------------------
  |  Branch (2127:20): [True: 0, False: 0]
  ------------------
 2128|      0|                    size_t length = *(size_t *)ptr;
 2129|      0|                    ptr += sizeof(size_t);
 2130|      0|                    UA_Array_delete(*(void **)ptr, length, mt);
 2131|      0|                    ptr += sizeof(void *);
 2132|      0|                } else { /* optional array field not contained */
 2133|      0|                    ptr += sizeof(size_t);
 2134|      0|                    ptr += sizeof(void *);
 2135|      0|                }
 2136|      0|            }
 2137|      0|        }
 2138|  5.46k|    }
 2139|  1.24k|}
ua_types.c:nodeIdOrder:
 2289|  4.69M|nodeIdOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2290|  4.69M|    const UA_NodeId *p1 = (const UA_NodeId*)p1_;
 2291|  4.69M|    const UA_NodeId *p2 = (const UA_NodeId*)p2_;
 2292|       |    /* Compare namespaceIndex */
 2293|  4.69M|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2293:8): [True: 263k, False: 4.42M]
  ------------------
 2294|   263k|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2294:16): [True: 263k, False: 0]
  ------------------
 2295|       |
 2296|       |    /* Compare identifierType */
 2297|  4.42M|    if(p1->identifierType != p2->identifierType)
  ------------------
  |  Branch (2297:8): [True: 2.68M, False: 1.74M]
  ------------------
 2298|  2.68M|        return (p1->identifierType < p2->identifierType) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2298:16): [True: 2.68M, False: 0]
  ------------------
 2299|       |
 2300|       |    /* Compare the identifier */
 2301|  1.74M|    switch(p1->identifierType) {
 2302|  1.74M|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (2302:5): [True: 1.74M, False: 0]
  ------------------
 2303|  1.74M|    default:
  ------------------
  |  Branch (2303:5): [True: 0, False: 1.74M]
  ------------------
 2304|  1.74M|        if(p1->identifier.numeric != p2->identifier.numeric)
  ------------------
  |  Branch (2304:12): [True: 1.72M, False: 10.7k]
  ------------------
 2305|  1.72M|            return (p1->identifier.numeric < p2->identifier.numeric) ?
  ------------------
  |  Branch (2305:20): [True: 173k, False: 1.55M]
  ------------------
 2306|  1.55M|                UA_ORDER_LESS : UA_ORDER_MORE;
 2307|  10.7k|        return UA_ORDER_EQ;
 2308|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (2308:5): [True: 0, False: 1.74M]
  ------------------
 2309|      0|        return guidOrder(&p1->identifier.guid, &p2->identifier.guid, NULL);
 2310|      0|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (2310:5): [True: 0, False: 1.74M]
  ------------------
 2311|      0|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (2311:5): [True: 0, False: 1.74M]
  ------------------
 2312|       |        return stringOrder(&p1->identifier.string, &p2->identifier.string, NULL);
 2313|  1.74M|    }
 2314|  1.74M|}

lookAheadForKey:
 1437|   194k|lookAheadForKey(ParseCtx *ctx, const char *key, size_t *resultIndex) {
 1438|       |    /* The current index must point to the beginning of an object.
 1439|       |     * This has to be ensured by the caller. */
 1440|   194k|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  399|   194k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1440:5): [True: 194k, False: 0]
  ------------------
 1441|       |
 1442|   194k|    status ret = UA_STATUSCODE_BADNOTFOUND;
  ------------------
  |  |  233|   194k|#define UA_STATUSCODE_BADNOTFOUND ((UA_StatusCode) 0x803E0000)
  ------------------
 1443|   194k|    size_t oldIndex = ctx->index; /* Save index for later restore */
 1444|   194k|    unsigned int end = ctx->tokens[ctx->index].end;
 1445|   194k|    ctx->index++; /* Move to the first key */
 1446|  2.42M|    while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1446:11): [True: 2.42M, False: 4.85k]
  ------------------
 1447|  2.42M|          ctx->tokens[ctx->index].start < end) {
  ------------------
  |  Branch (1447:11): [True: 2.36M, False: 57.4k]
  ------------------
 1448|       |        /* Key must be a string */
 1449|  2.36M|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  399|  2.36M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1449:9): [True: 2.36M, False: 0]
  ------------------
 1450|       |
 1451|       |        /* Move index to the value */
 1452|  2.36M|        ctx->index++;
 1453|       |
 1454|       |        /* Value for the key must exist */
 1455|  2.36M|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  399|  2.36M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1455:9): [True: 2.36M, False: 0]
  ------------------
 1456|       |
 1457|       |        /* Compare the key (previous index) */
 1458|  2.36M|        if(jsoneq(ctx->json5, &ctx->tokens[ctx->index-1], key) == 0) {
  ------------------
  |  Branch (1458:12): [True: 132k, False: 2.23M]
  ------------------
 1459|   132k|            *resultIndex = ctx->index; /* Point result to the current index */
 1460|   132k|            ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   132k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1461|   132k|            break;
 1462|   132k|        }
 1463|       |
 1464|  2.23M|        skipObject(ctx); /* Jump over the value (can also be an array or object) */
 1465|  2.23M|    }
 1466|   194k|    ctx->index = oldIndex; /* Restore the old index */
 1467|   194k|    return ret;
 1468|   194k|}
DiagnosticInfoInner_decodeJson:
 2245|      2|DiagnosticInfoInner_decodeJson(ParseCtx* ctx, void* dst, const UA_DataType* type) {
 2246|      2|    UA_DiagnosticInfo *inner = (UA_DiagnosticInfo*)
 2247|      2|        UA_calloc(1, sizeof(UA_DiagnosticInfo));
  ------------------
  |  |   20|      2|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2248|      2|    if(!inner)
  ------------------
  |  Branch (2248:8): [True: 1, False: 1]
  ------------------
 2249|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2250|      1|    UA_DiagnosticInfo **dst2 = (UA_DiagnosticInfo**)dst;
 2251|      1|    *dst2 = inner;  /* Copy new Pointer do dest */
 2252|      1|    return DiagnosticInfo_decodeJson(ctx, inner, type);
 2253|      2|}
decodeFields:
 2256|  44.0k|decodeFields(ParseCtx *ctx, DecodeEntry *entries, size_t entryCount) {
 2257|  44.0k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|  44.0k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|  44.0k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 44.0k]
  |  |  ------------------
  |  | 1034|  44.0k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|  44.0k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 44.0k]
  |  |  ------------------
  ------------------
 2258|  44.0k|    CHECK_NULL_SKIP; /* null is treated like an empty object */
  ------------------
  |  | 1057|  44.0k|#define CHECK_NULL_SKIP do {                         \
  |  | 1058|  44.0k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1058:8): [True: 350, False: 43.7k]
  |  |  ------------------
  |  | 1059|    350|        ctx->index++;                                \
  |  | 1060|    350|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    350|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1061|  43.7k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1061:14): [Folded, False: 43.7k]
  |  |  ------------------
  ------------------
 2259|       |
 2260|  43.7k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|  43.7k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (2260:8): [True: 0, False: 43.7k]
  ------------------
 2261|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 2262|       |
 2263|       |    /* Keys and values are counted separately */
 2264|  43.7k|    CHECK_OBJECT;
  ------------------
  |  | 1052|  43.7k|#define CHECK_OBJECT do {                                \
  |  | 1053|  43.7k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1053:8): [True: 20, False: 43.7k]
  |  |  ------------------
  |  | 1054|     20|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     20|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1055|  43.7k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1055:14): [Folded, False: 43.7k]
  |  |  ------------------
  ------------------
 2265|  43.7k|    UA_assert(ctx->tokens[ctx->index].size % 2 == 0);
  ------------------
  |  |  399|  43.7k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2265:5): [True: 43.7k, False: 0]
  ------------------
 2266|  43.7k|    size_t keyCount = (size_t)(ctx->tokens[ctx->index].size) / 2;
 2267|       |
 2268|  43.7k|    ctx->index++; /* Go to first key - or jump after the empty object */
 2269|  43.7k|    ctx->depth++;
 2270|       |
 2271|  43.7k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  43.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2272|   107k|    for(size_t key = 0; key < keyCount; key++) {
  ------------------
  |  Branch (2272:25): [True: 74.0k, False: 33.4k]
  ------------------
 2273|       |        /* Key must be a string */
 2274|  74.0k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  399|  74.0k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2274:9): [True: 74.0k, False: 0]
  ------------------
 2275|  74.0k|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  399|  74.0k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2275:9): [True: 74.0k, False: 0]
  ------------------
 2276|       |
 2277|       |        /* Search for the decoding entry matching the key. Start at the key
 2278|       |         * index to speed-up the case where they key-order is the same as the
 2279|       |         * entry-order. */
 2280|  74.0k|        DecodeEntry *entry = NULL;
 2281|   194k|        for(size_t i = key; i < key + entryCount; i++) {
  ------------------
  |  Branch (2281:29): [True: 194k, False: 352]
  ------------------
 2282|   194k|            size_t ii = i;
 2283|   202k|            while(ii >= entryCount)
  ------------------
  |  Branch (2283:19): [True: 7.89k, False: 194k]
  ------------------
 2284|  7.89k|                ii -= entryCount;
 2285|       |
 2286|       |            /* Compare the key */
 2287|   194k|            if(jsoneq(ctx->json5, &ctx->tokens[ctx->index],
  ------------------
  |  Branch (2287:16): [True: 120k, False: 73.6k]
  ------------------
 2288|   194k|                      entries[ii].fieldName) != 0)
 2289|   120k|                continue;
 2290|       |
 2291|       |            /* Key was already used -> duplicate, abort */
 2292|  73.6k|            if(entries[ii].found) {
  ------------------
  |  Branch (2292:16): [True: 2, False: 73.6k]
  ------------------
 2293|      2|                ctx->depth--;
 2294|      2|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2295|      2|            }
 2296|       |
 2297|       |            /* Found the key */
 2298|  73.6k|            entries[ii].found = true;
 2299|  73.6k|            entry = &entries[ii];
 2300|  73.6k|            break;
 2301|  73.6k|        }
 2302|       |
 2303|       |        /* The key is unknown */
 2304|  74.0k|        if(!entry) {
  ------------------
  |  Branch (2304:12): [True: 352, False: 73.6k]
  ------------------
 2305|    352|            ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    352|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2306|    352|            break;
 2307|    352|        }
 2308|       |
 2309|       |        /* Go from key to value */
 2310|  73.6k|        ctx->index++;
 2311|  73.6k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  399|  73.6k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2311:9): [True: 73.6k, False: 0]
  ------------------
 2312|       |
 2313|       |        /* An entry that was expected but shall not be decoded.
 2314|       |         * Jump over the value. */
 2315|  73.6k|        if(!entry->function && !entry->type) {
  ------------------
  |  Branch (2315:12): [True: 62.7k, False: 10.9k]
  |  Branch (2315:32): [True: 60.9k, False: 1.73k]
  ------------------
 2316|  60.9k|            skipObject(ctx);
 2317|  60.9k|            continue;
 2318|  60.9k|        }
 2319|       |
 2320|       |        /* A null-value, skip the decoding (the value is already initialized) */
 2321|  12.7k|        if(currentTokenType(ctx) == CJ5_TOKEN_NULL && !entry->function) {
  ------------------
  |  Branch (2321:12): [True: 199, False: 12.5k]
  |  Branch (2321:55): [True: 196, False: 3]
  ------------------
 2322|    196|            ctx->index++; /* skip null value */
 2323|    196|            continue;
 2324|    196|        }
 2325|       |
 2326|       |        /* Decode. This also moves to the next key or right after the object for
 2327|       |         * the last value. */
 2328|  12.5k|        decodeJsonSignature decodeFunc = (entry->function) ?
  ------------------
  |  Branch (2328:42): [True: 10.9k, False: 1.53k]
  ------------------
 2329|  10.9k|            entry->function : decodeJsonJumpTable[entry->type->typeKind];
 2330|  12.5k|        ret = decodeFunc(ctx, entry->fieldPointer, entry->type);
 2331|  12.5k|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  12.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2331:12): [True: 9.87k, False: 2.65k]
  ------------------
 2332|  9.87k|            break;
 2333|  12.5k|    }
 2334|       |
 2335|  43.6k|    ctx->depth--;
 2336|  43.6k|    return ret;
 2337|  43.7k|}
tokenize:
 2470|  8.20k|         size_t *decodedLength) {
 2471|       |    /* Tokenize */
 2472|  8.20k|    cj5_options options;
 2473|  8.20k|    options.stop_early = (decodedLength != NULL);
 2474|  8.20k|    cj5_result r = cj5_parse((char*)src->data, (unsigned int)src->length,
 2475|  8.20k|                             ctx->tokens, (unsigned int)tokensSize, &options);
 2476|       |
 2477|       |    /* Handle overflow error by allocating the number of tokens the parser would
 2478|       |     * have needed */
 2479|  8.20k|    if(r.error == CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (2479:8): [True: 618, False: 7.58k]
  ------------------
 2480|    618|       tokensSize != r.num_tokens) {
  ------------------
  |  Branch (2480:8): [True: 618, False: 0]
  ------------------
 2481|    618|        ctx->tokens = (cj5_token*)
 2482|    618|            UA_malloc(sizeof(cj5_token) * r.num_tokens);
  ------------------
  |  |   18|    618|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 2483|    618|        if(!ctx->tokens)
  ------------------
  |  Branch (2483:12): [True: 10, False: 608]
  ------------------
 2484|     10|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|     10|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2485|    608|        return tokenize(ctx, src, r.num_tokens, decodedLength);
 2486|    618|    }
 2487|       |
 2488|       |    /* Cannot recover from other errors */
 2489|  7.58k|    if(r.error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (2489:8): [True: 726, False: 6.85k]
  ------------------
 2490|    726|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    726|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2491|       |
 2492|  6.85k|    if(decodedLength)
  ------------------
  |  Branch (2492:8): [True: 0, False: 6.85k]
  ------------------
 2493|      0|        *decodedLength = ctx->tokens[0].end + 1;
 2494|       |
 2495|       |    /* Set up the context */
 2496|  6.85k|    ctx->json5 = (char*)src->data;
 2497|  6.85k|    ctx->depth = 0;
 2498|  6.85k|    ctx->tokensSize = r.num_tokens;
 2499|  6.85k|    ctx->index = 0;
 2500|  6.85k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  6.85k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2501|  7.58k|}
ua_types_encoding_json.c:jsoneq:
 1088|  2.56M|jsoneq(const char *json, const cj5_token *tok, const char *searchKey) {
 1089|       |    /* TODO: necessary?
 1090|       |       if(json == NULL
 1091|       |            || tok == NULL
 1092|       |            || searchKey == NULL) {
 1093|       |        return -1;
 1094|       |    } */
 1095|       |
 1096|  2.56M|    size_t len = getTokenLength(tok);
 1097|  2.56M|    if(tok->type == CJ5_TOKEN_STRING &&
  ------------------
  |  Branch (1097:8): [True: 2.56M, False: 0]
  ------------------
 1098|  2.56M|       strlen(searchKey) ==  len &&
  ------------------
  |  Branch (1098:8): [True: 220k, False: 2.33M]
  ------------------
 1099|   220k|       strncmp(json + tok->start, (const char*)searchKey, len) == 0)
  ------------------
  |  Branch (1099:8): [True: 205k, False: 14.9k]
  ------------------
 1100|   205k|        return 0;
 1101|       |
 1102|  2.35M|    return -1;
 1103|  2.56M|}
ua_types_encoding_json.c:skipObject:
 1072|  2.35M|skipObject(ParseCtx *ctx) {
 1073|  2.35M|    unsigned int end = ctx->tokens[ctx->index].end;
 1074|  65.4M|    do {
 1075|  65.4M|        ctx->index++;
 1076|  65.4M|    } while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1076:13): [True: 65.4M, False: 10.9k]
  ------------------
 1077|  65.4M|            ctx->tokens[ctx->index].start < end);
  ------------------
  |  Branch (1077:13): [True: 63.0M, False: 2.34M]
  ------------------
 1078|  2.35M|}
ua_types_encoding_json.c:DiagnosticInfo_decodeJson:
 2211|    631|DECODE_JSON(DiagnosticInfo) {
 2212|    631|    UA_DiagnosticInfo *dst = (UA_DiagnosticInfo*)p;
 2213|    631|    CHECK_NULL_SKIP; /* Treat a null value as an empty DiagnosticInfo */
  ------------------
  |  | 1057|    631|#define CHECK_NULL_SKIP do {                         \
  |  | 1058|    631|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1058:8): [True: 205, False: 426]
  |  |  ------------------
  |  | 1059|    205|        ctx->index++;                                \
  |  | 1060|    205|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    205|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1061|    426|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1061:14): [Folded, False: 426]
  |  |  ------------------
  ------------------
 2214|    426|    CHECK_OBJECT;
  ------------------
  |  | 1052|    426|#define CHECK_OBJECT do {                                \
  |  | 1053|    426|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1053:8): [True: 19, False: 407]
  |  |  ------------------
  |  | 1054|     19|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     19|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1055|    407|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1055:14): [Folded, False: 407]
  |  |  ------------------
  ------------------
 2215|       |
 2216|    407|    DecodeEntry entries[7] = {
 2217|    407|        {UA_JSONKEY_SYMBOLICID, &dst->symbolicId, NULL,
 2218|    407|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|    407|#define UA_TYPES_INT32 5
  ------------------
 2219|    407|        {UA_JSONKEY_NAMESPACEURI, &dst->namespaceUri, NULL,
 2220|    407|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|    407|#define UA_TYPES_INT32 5
  ------------------
 2221|    407|        {UA_JSONKEY_LOCALIZEDTEXT, &dst->localizedText, NULL,
 2222|    407|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|    407|#define UA_TYPES_INT32 5
  ------------------
 2223|    407|        {UA_JSONKEY_LOCALE, &dst->locale, NULL,
 2224|    407|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|    407|#define UA_TYPES_INT32 5
  ------------------
 2225|    407|        {UA_JSONKEY_ADDITIONALINFO, &dst->additionalInfo, NULL,
 2226|    407|         false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  395|    407|#define UA_TYPES_STRING 11
  ------------------
 2227|    407|        {UA_JSONKEY_INNERSTATUSCODE, &dst->innerStatusCode, NULL,
 2228|    407|         false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  633|    407|#define UA_TYPES_STATUSCODE 18
  ------------------
 2229|    407|        {UA_JSONKEY_INNERDIAGNOSTICINFO, &dst->innerDiagnosticInfo,
 2230|    407|         DiagnosticInfoInner_decodeJson, false, NULL}
 2231|    407|    };
 2232|    407|    status ret = decodeFields(ctx, entries, 7);
 2233|       |
 2234|    407|    dst->hasSymbolicId = entries[0].found;
 2235|    407|    dst->hasNamespaceUri = entries[1].found;
 2236|    407|    dst->hasLocalizedText = entries[2].found;
 2237|    407|    dst->hasLocale = entries[3].found;
 2238|    407|    dst->hasAdditionalInfo = entries[4].found;
 2239|    407|    dst->hasInnerStatusCode = entries[5].found;
 2240|    407|    dst->hasInnerDiagnosticInfo = entries[6].found;
 2241|    407|    return ret;
 2242|    426|}
ua_types_encoding_json.c:Boolean_decodeJson:
 1105|    208|DECODE_JSON(Boolean) {
 1106|    208|    UA_Boolean *dst = (UA_Boolean*)p;
 1107|    208|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|    208|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|    208|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 208]
  |  |  ------------------
  |  | 1034|    208|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|    208|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 208]
  |  |  ------------------
  ------------------
 1108|    208|    CHECK_BOOL;
  ------------------
  |  | 1042|    208|#define CHECK_BOOL do {                                \
  |  | 1043|    208|    if(currentTokenType(ctx) != CJ5_TOKEN_BOOL) {      \
  |  |  ------------------
  |  |  |  Branch (1043:8): [True: 68, False: 140]
  |  |  ------------------
  |  | 1044|     68|        return UA_STATUSCODE_BADDECODINGERROR;         \
  |  |  ------------------
  |  |  |  |   44|     68|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1045|    140|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1045:14): [Folded, False: 140]
  |  |  ------------------
  ------------------
 1109|    140|    GET_TOKEN;
  ------------------
  |  | 1028|    140|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|    140|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|    140|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 140]
  |  |  ------------------
  ------------------
 1110|       |
 1111|    140|    if(tokenSize == 4 &&
  ------------------
  |  Branch (1111:8): [True: 74, False: 66]
  ------------------
 1112|     74|       (tokenData[0] | 32) == 't' && (tokenData[1] | 32) == 'r' &&
  ------------------
  |  Branch (1112:8): [True: 74, False: 0]
  |  Branch (1112:38): [True: 74, False: 0]
  ------------------
 1113|     74|       (tokenData[2] | 32) == 'u' && (tokenData[3] | 32) == 'e') {
  ------------------
  |  Branch (1113:8): [True: 74, False: 0]
  |  Branch (1113:38): [True: 74, False: 0]
  ------------------
 1114|     74|        *dst = true;
 1115|     74|    } else if(tokenSize == 5 &&
  ------------------
  |  Branch (1115:15): [True: 66, False: 0]
  ------------------
 1116|     66|              (tokenData[0] | 32) == 'f' && (tokenData[1] | 32) == 'a' &&
  ------------------
  |  Branch (1116:15): [True: 66, False: 0]
  |  Branch (1116:45): [True: 66, False: 0]
  ------------------
 1117|     66|              (tokenData[2] | 32) == 'l' && (tokenData[3] | 32) == 's' &&
  ------------------
  |  Branch (1117:15): [True: 66, False: 0]
  |  Branch (1117:45): [True: 66, False: 0]
  ------------------
 1118|     66|              (tokenData[4] | 32) == 'e') {
  ------------------
  |  Branch (1118:15): [True: 66, False: 0]
  ------------------
 1119|     66|        *dst = false;
 1120|     66|    } else {
 1121|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1122|      0|    }
 1123|       |
 1124|    140|    ctx->index++;
 1125|    140|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    140|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1126|    140|}
ua_types_encoding_json.c:SByte_decodeJson:
 1213|   569k|DECODE_JSON(SByte) {
 1214|   569k|    UA_SByte *dst = (UA_SByte*)p;
 1215|   569k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|   569k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|   569k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 569k]
  |  |  ------------------
  |  | 1034|   569k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|   569k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 569k]
  |  |  ------------------
  ------------------
 1216|   569k|    CHECK_NUMBER;
  ------------------
  |  | 1037|   569k|#define CHECK_NUMBER do {                                \
  |  | 1038|   569k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 28, False: 569k]
  |  |  ------------------
  |  | 1039|     28|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     28|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|   569k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 569k]
  |  |  ------------------
  ------------------
 1217|   569k|    GET_TOKEN;
  ------------------
  |  | 1028|   569k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|   569k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|   569k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 569k]
  |  |  ------------------
  ------------------
 1218|   569k|    UA_Int64 out = 0;
 1219|   569k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1220|   569k|    if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   17|  1.13M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   63|  1.13M|#define UA_SBYTE_MIN (-128)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   64|   569k|#define UA_SBYTE_MAX 127
  ------------------
  |  Branch (1220:8): [True: 81, False: 569k]
  |  Branch (1220:35): [True: 130, False: 569k]
  |  Branch (1220:57): [True: 58, False: 568k]
  ------------------
 1221|    269|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    269|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1222|   568k|    *dst = (UA_SByte)out;
 1223|   568k|    ctx->index++;
 1224|   568k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   568k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1225|   569k|}
ua_types_encoding_json.c:parseSignedInteger:
 1145|  1.72M|parseSignedInteger(const char *tokenData, size_t tokenSize, UA_Int64 *dst) {
 1146|  1.72M|    size_t len = parseInt64(tokenData, tokenSize, dst);
 1147|  1.72M|    if(len == 0)
  ------------------
  |  Branch (1147:8): [True: 128, False: 1.72M]
  ------------------
 1148|    128|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    128|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1149|       |
 1150|       |    /* There must only be whitespace between the end of the parsed number and
 1151|       |     * the end of the token */
 1152|  2.38M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1152:25): [True: 665k, False: 1.72M]
  ------------------
 1153|   665k|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1153:12): [True: 391k, False: 274k]
  |  Branch (1153:35): [True: 91, False: 391k]
  ------------------
 1154|     91|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     91|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1155|   665k|    }
 1156|       |
 1157|  1.72M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.72M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1158|  1.72M|}
ua_types_encoding_json.c:Byte_decodeJson:
 1160|   525k|DECODE_JSON(Byte) {
 1161|   525k|    UA_Byte *dst = (UA_Byte*)p;
 1162|   525k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|   525k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|   525k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 525k]
  |  |  ------------------
  |  | 1034|   525k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|   525k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 525k]
  |  |  ------------------
  ------------------
 1163|   525k|    CHECK_NUMBER;
  ------------------
  |  | 1037|   525k|#define CHECK_NUMBER do {                                \
  |  | 1038|   525k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 15, False: 525k]
  |  |  ------------------
  |  | 1039|     15|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     15|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|   525k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 525k]
  |  |  ------------------
  ------------------
 1164|   525k|    GET_TOKEN;
  ------------------
  |  | 1028|   525k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|   525k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|   525k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 525k]
  |  |  ------------------
  ------------------
 1165|   525k|    UA_UInt64 out = 0;
 1166|   525k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1167|   525k|    if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   17|  1.05M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   73|   525k|#define UA_BYTE_MAX 255
  ------------------
  |  Branch (1167:8): [True: 38, False: 525k]
  |  Branch (1167:35): [True: 108, False: 525k]
  ------------------
 1168|    146|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    146|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1169|   525k|    *dst = (UA_Byte)out;
 1170|   525k|    ctx->index++;
 1171|   525k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   525k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1172|   525k|}
ua_types_encoding_json.c:parseUnsignedInteger:
 1129|  4.86M|parseUnsignedInteger(const char *tokenData, size_t tokenSize, UA_UInt64 *dst) {
 1130|  4.86M|    size_t len = parseUInt64(tokenData, tokenSize, dst);
 1131|  4.86M|    if(len == 0)
  ------------------
  |  Branch (1131:8): [True: 84, False: 4.86M]
  ------------------
 1132|     84|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     84|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1133|       |
 1134|       |    /* There must only be whitespace between the end of the parsed number and
 1135|       |     * the end of the token */
 1136|  5.29M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1136:25): [True: 430k, False: 4.86M]
  ------------------
 1137|   430k|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1137:12): [True: 29.5k, False: 400k]
  |  Branch (1137:35): [True: 141, False: 29.3k]
  ------------------
 1138|    141|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    141|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1139|   430k|    }
 1140|       |
 1141|  4.86M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.86M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1142|  4.86M|}
ua_types_encoding_json.c:Int16_decodeJson:
 1227|  23.4k|DECODE_JSON(Int16) {
 1228|  23.4k|    UA_Int16 *dst = (UA_Int16*)p;
 1229|  23.4k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|  23.4k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|  23.4k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 23.4k]
  |  |  ------------------
  |  | 1034|  23.4k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|  23.4k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 23.4k]
  |  |  ------------------
  ------------------
 1230|  23.4k|    CHECK_NUMBER;
  ------------------
  |  | 1037|  23.4k|#define CHECK_NUMBER do {                                \
  |  | 1038|  23.4k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 15, False: 23.4k]
  |  |  ------------------
  |  | 1039|     15|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     15|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|  23.4k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 23.4k]
  |  |  ------------------
  ------------------
 1231|  23.4k|    GET_TOKEN;
  ------------------
  |  | 1028|  23.4k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|  23.4k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|  23.4k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 23.4k]
  |  |  ------------------
  ------------------
 1232|  23.4k|    UA_Int64 out = 0;
 1233|  23.4k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1234|  23.4k|    if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   17|  46.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   81|  46.8k|#define UA_INT16_MIN (-32768)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   82|  23.3k|#define UA_INT16_MAX 32767
  ------------------
  |  Branch (1234:8): [True: 37, False: 23.3k]
  |  Branch (1234:35): [True: 85, False: 23.3k]
  |  Branch (1234:57): [True: 37, False: 23.2k]
  ------------------
 1235|    159|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    159|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1236|  23.2k|    *dst = (UA_Int16)out;
 1237|  23.2k|    ctx->index++;
 1238|  23.2k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  23.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1239|  23.4k|}
ua_types_encoding_json.c:UInt16_decodeJson:
 1174|  1.01M|DECODE_JSON(UInt16) {
 1175|  1.01M|    UA_UInt16 *dst = (UA_UInt16*)p;
 1176|  1.01M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|  1.01M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|  1.01M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 1.01M]
  |  |  ------------------
  |  | 1034|  1.01M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|  1.01M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 1.01M]
  |  |  ------------------
  ------------------
 1177|  1.01M|    CHECK_NUMBER;
  ------------------
  |  | 1037|  1.01M|#define CHECK_NUMBER do {                                \
  |  | 1038|  1.01M|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 19, False: 1.01M]
  |  |  ------------------
  |  | 1039|     19|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     19|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|  1.01M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 1.01M]
  |  |  ------------------
  ------------------
 1178|  1.01M|    GET_TOKEN;
  ------------------
  |  | 1028|  1.01M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|  1.01M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|  1.01M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 1.01M]
  |  |  ------------------
  ------------------
 1179|  1.01M|    UA_UInt64 out = 0;
 1180|  1.01M|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1181|  1.01M|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   17|  2.03M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   91|  1.01M|#define UA_UINT16_MAX 65535
  ------------------
  |  Branch (1181:8): [True: 67, False: 1.01M]
  |  Branch (1181:35): [True: 226, False: 1.01M]
  ------------------
 1182|    293|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    293|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1183|  1.01M|    *dst = (UA_UInt16)out;
 1184|  1.01M|    ctx->index++;
 1185|  1.01M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.01M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1186|  1.01M|}
ua_types_encoding_json.c:Int32_decodeJson:
 1241|   530k|DECODE_JSON(Int32) {
 1242|   530k|    UA_Int32 *dst = (UA_Int32*)p;
 1243|   530k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|   530k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|   530k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 530k]
  |  |  ------------------
  |  | 1034|   530k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|   530k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 530k]
  |  |  ------------------
  ------------------
 1244|   530k|    CHECK_NUMBER;
  ------------------
  |  | 1037|   530k|#define CHECK_NUMBER do {                                \
  |  | 1038|   530k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 41, False: 530k]
  |  |  ------------------
  |  | 1039|     41|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     41|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|   530k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 530k]
  |  |  ------------------
  ------------------
 1245|   530k|    GET_TOKEN;
  ------------------
  |  | 1028|   530k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|   530k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|   530k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 530k]
  |  |  ------------------
  ------------------
 1246|   530k|    UA_Int64 out = 0;
 1247|   530k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1248|   530k|    if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   17|  1.06M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   99|  1.06M|#define UA_INT32_MIN ((int32_t)-2147483648LL)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |  100|   530k|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (1248:8): [True: 38, False: 530k]
  |  Branch (1248:35): [True: 63, False: 530k]
  |  Branch (1248:57): [True: 9, False: 530k]
  ------------------
 1249|    110|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    110|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1250|   530k|    *dst = (UA_Int32)out;
 1251|   530k|    ctx->index++;
 1252|   530k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   530k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1253|   530k|}
ua_types_encoding_json.c:UInt32_decodeJson:
 1188|  2.80M|DECODE_JSON(UInt32) {
 1189|  2.80M|    UA_UInt32 *dst = (UA_UInt32*)p;
 1190|  2.80M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|  2.80M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|  2.80M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 2.80M]
  |  |  ------------------
  |  | 1034|  2.80M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|  2.80M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 2.80M]
  |  |  ------------------
  ------------------
 1191|  2.80M|    CHECK_NUMBER;
  ------------------
  |  | 1037|  2.80M|#define CHECK_NUMBER do {                                \
  |  | 1038|  2.80M|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 36, False: 2.80M]
  |  |  ------------------
  |  | 1039|     36|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     36|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|  2.80M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 2.80M]
  |  |  ------------------
  ------------------
 1192|  2.80M|    GET_TOKEN;
  ------------------
  |  | 1028|  2.80M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|  2.80M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|  2.80M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 2.80M]
  |  |  ------------------
  ------------------
 1193|  2.80M|    UA_UInt64 out = 0;
 1194|  2.80M|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1195|  2.80M|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |   17|  5.60M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |  109|  2.80M|#define UA_UINT32_MAX 4294967295UL
  ------------------
  |  Branch (1195:8): [True: 75, False: 2.80M]
  |  Branch (1195:35): [True: 78, False: 2.80M]
  ------------------
 1196|    153|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    153|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1197|  2.80M|    *dst = (UA_UInt32)out;
 1198|  2.80M|    ctx->index++;
 1199|  2.80M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  2.80M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1200|  2.80M|}
ua_types_encoding_json.c:Int64_decodeJson:
 1255|   600k|DECODE_JSON(Int64) {
 1256|   600k|    UA_Int64 *dst = (UA_Int64*)p;
 1257|   600k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|   600k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|   600k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 600k]
  |  |  ------------------
  |  | 1034|   600k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|   600k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 600k]
  |  |  ------------------
  ------------------
 1258|   600k|    GET_TOKEN;
  ------------------
  |  | 1028|   600k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|   600k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|   600k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 600k]
  |  |  ------------------
  ------------------
 1259|   600k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, dst);
 1260|   600k|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|   600k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1260:8): [True: 63, False: 600k]
  ------------------
 1261|     63|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     63|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1262|   600k|    ctx->index++;
 1263|   600k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   600k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1264|   600k|}
ua_types_encoding_json.c:UInt64_decodeJson:
 1202|   525k|DECODE_JSON(UInt64) {
 1203|   525k|    UA_UInt64 *dst = (UA_UInt64*)p;
 1204|   525k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|   525k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|   525k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 525k]
  |  |  ------------------
  |  | 1034|   525k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|   525k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 525k]
  |  |  ------------------
  ------------------
 1205|   525k|    GET_TOKEN;
  ------------------
  |  | 1028|   525k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|   525k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|   525k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 525k]
  |  |  ------------------
  ------------------
 1206|   525k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, dst);
 1207|   525k|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|   525k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1207:8): [True: 45, False: 525k]
  ------------------
 1208|     45|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     45|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1209|   525k|    ctx->index++;
 1210|   525k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   525k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1211|   525k|}
ua_types_encoding_json.c:Float_decodeJson:
 1327|   480k|DECODE_JSON(Float) {
 1328|   480k|    UA_Float *dst = (UA_Float*)p;
 1329|   480k|    UA_Double v = 0.0;
 1330|       |    UA_StatusCode res = Double_decodeJson(ctx, &v, NULL);
 1331|   480k|    *dst = (UA_Float)v;
 1332|   480k|    return res;
 1333|   480k|}
ua_types_encoding_json.c:Double_decodeJson:
 1267|   493k|DECODE_JSON(Double) {
 1268|   493k|    UA_Double *dst = (UA_Double*)p;
 1269|   493k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|   493k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|   493k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 493k]
  |  |  ------------------
  |  | 1034|   493k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|   493k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 493k]
  |  |  ------------------
  ------------------
 1270|   493k|    GET_TOKEN;
  ------------------
  |  | 1028|   493k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|   493k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|   493k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 493k]
  |  |  ------------------
  ------------------
 1271|       |
 1272|       |    /* https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/
 1273|       |     * Maximum digit counts for select IEEE floating-point formats: 1074
 1274|       |     * Sanity check.
 1275|       |     */
 1276|   493k|    if(tokenSize > 2000)
  ------------------
  |  Branch (1276:8): [True: 2, False: 493k]
  ------------------
 1277|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1278|       |
 1279|   493k|    cj5_token_type tokenType = currentTokenType(ctx);
 1280|       |
 1281|       |    /* It could be a String with Nan, Infinity */
 1282|   493k|    if(tokenType == CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (1282:8): [True: 1.05k, False: 492k]
  ------------------
 1283|  1.05k|        ctx->index++;
 1284|       |
 1285|  1.05k|        if(tokenSize == 8 && memcmp(tokenData, "Infinity", 8) == 0) {
  ------------------
  |  Branch (1285:12): [True: 221, False: 830]
  |  Branch (1285:30): [True: 197, False: 24]
  ------------------
 1286|    197|            *dst = INFINITY;
 1287|    197|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    197|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1288|    197|        }
 1289|       |
 1290|    854|        if(tokenSize == 9 && memcmp(tokenData, "-Infinity", 9) == 0) {
  ------------------
  |  Branch (1290:12): [True: 306, False: 548]
  |  Branch (1290:30): [True: 271, False: 35]
  ------------------
 1291|       |            /* workaround an MSVC 2013 issue */
 1292|    271|            *dst = -INFINITY;
 1293|    271|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    271|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1294|    271|        }
 1295|       |
 1296|    583|        if(tokenSize == 3 && memcmp(tokenData, "NaN", 3) == 0) {
  ------------------
  |  Branch (1296:12): [True: 253, False: 330]
  |  Branch (1296:30): [True: 220, False: 33]
  ------------------
 1297|    220|            *dst = NAN;
 1298|    220|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    220|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1299|    220|        }
 1300|       |
 1301|    363|        if(tokenSize == 4 && memcmp(tokenData, "-NaN", 4) == 0) {
  ------------------
  |  Branch (1301:12): [True: 230, False: 133]
  |  Branch (1301:30): [True: 210, False: 20]
  ------------------
 1302|    210|            *dst = NAN;
 1303|    210|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    210|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1304|    210|        }
 1305|       |
 1306|    153|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    153|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1307|    363|    }
 1308|       |
 1309|   492k|    if(tokenType != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1309:8): [True: 6, False: 492k]
  ------------------
 1310|      6|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1311|       |
 1312|   492k|    size_t len = parseDouble(tokenData, tokenSize, dst);
 1313|   492k|    if(len == 0)
  ------------------
  |  Branch (1313:8): [True: 3, False: 492k]
  ------------------
 1314|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1315|       |
 1316|       |    /* There must only be whitespace between the end of the parsed number and
 1317|       |     * the end of the token */
 1318|   492k|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1318:25): [True: 8, False: 492k]
  ------------------
 1319|      8|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1319:12): [True: 8, False: 0]
  |  Branch (1319:35): [True: 8, False: 0]
  ------------------
 1320|      8|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      8|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1321|      8|    }
 1322|       |
 1323|   492k|    ctx->index++;
 1324|   492k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   492k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1325|   492k|}
ua_types_encoding_json.c:String_decodeJson:
 1345|  71.0k|DECODE_JSON(String) {
 1346|  71.0k|    UA_String *dst = (UA_String*)p;
 1347|  71.0k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|  71.0k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|  71.0k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 71.0k]
  |  |  ------------------
  |  | 1034|  71.0k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|  71.0k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 71.0k]
  |  |  ------------------
  ------------------
 1348|  71.0k|    CHECK_STRING;
  ------------------
  |  | 1047|  71.0k|#define CHECK_STRING do {                                \
  |  | 1048|  71.0k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1048:8): [True: 48, False: 70.9k]
  |  |  ------------------
  |  | 1049|     48|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     48|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1050|  70.9k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1050:14): [Folded, False: 70.9k]
  |  |  ------------------
  ------------------
 1349|  70.9k|    GET_TOKEN;
  ------------------
  |  | 1028|  70.9k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|  70.9k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|  70.9k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 70.9k]
  |  |  ------------------
  ------------------
 1350|  70.9k|    (void)tokenData;
 1351|       |
 1352|       |    /* Empty string? */
 1353|  70.9k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1353:8): [True: 2.18k, False: 68.7k]
  ------------------
 1354|  2.18k|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  2.18k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1355|  2.18k|        dst->length = 0;
 1356|  2.18k|        ctx->index++;
 1357|  2.18k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  2.18k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1358|  2.18k|    }
 1359|       |
 1360|       |    /* The decoded utf8 is at most of the same length as the source string */
 1361|  68.7k|    char *outBuf = (char*)UA_malloc(tokenSize+1);
  ------------------
  |  |   18|  68.7k|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 1362|  68.7k|    if(!outBuf)
  ------------------
  |  Branch (1362:8): [True: 6, False: 68.7k]
  ------------------
 1363|      6|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      6|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1364|       |
 1365|       |    /* Decode the string */
 1366|  68.7k|    cj5_result r;
 1367|  68.7k|    r.tokens = ctx->tokens;
 1368|  68.7k|    r.num_tokens = (unsigned int)ctx->tokensSize;
 1369|  68.7k|    r.json5 = ctx->json5;
 1370|  68.7k|    unsigned int len = 0;
 1371|  68.7k|    cj5_error_code err = cj5_get_str(&r, (unsigned int)ctx->index, outBuf, &len);
 1372|  68.7k|    if(err != CJ5_ERROR_NONE) {
  ------------------
  |  Branch (1372:8): [True: 146, False: 68.6k]
  ------------------
 1373|    146|        UA_free(outBuf);
  ------------------
  |  |   19|    146|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1374|    146|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    146|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1375|    146|    }
 1376|       |
 1377|       |    /* Set the output */
 1378|  68.6k|    dst->length = len;
 1379|  68.6k|    if(dst->length > 0) {
  ------------------
  |  Branch (1379:8): [True: 68.6k, False: 0]
  ------------------
 1380|  68.6k|        dst->data = (UA_Byte*)outBuf;
 1381|  68.6k|    } 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);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1384|      0|    }
 1385|       |
 1386|  68.6k|    ctx->index++;
 1387|  68.6k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  68.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1388|  68.7k|}
ua_types_encoding_json.c:DateTime_decodeJson:
 1493|    562|DECODE_JSON(DateTime) {
 1494|    562|    UA_DateTime *dst = (UA_DateTime*)p;
 1495|    562|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|    562|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|    562|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 562]
  |  |  ------------------
  |  | 1034|    562|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|    562|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 562]
  |  |  ------------------
  ------------------
 1496|    562|    CHECK_STRING;
  ------------------
  |  | 1047|    562|#define CHECK_STRING do {                                \
  |  | 1048|    562|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1048:8): [True: 16, False: 546]
  |  |  ------------------
  |  | 1049|     16|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     16|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1050|    546|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1050:14): [Folded, False: 546]
  |  |  ------------------
  ------------------
 1497|    546|    GET_TOKEN;
  ------------------
  |  | 1028|    546|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|    546|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|    546|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 546]
  |  |  ------------------
  ------------------
 1498|       |
 1499|       |    /* The last character has to be 'Z'. We can omit some length checks later on
 1500|       |     * because we know the atoi functions stop before the 'Z'. */
 1501|    546|    if(tokenSize == 0 || tokenData[tokenSize-1] != 'Z')
  ------------------
  |  Branch (1501:8): [True: 2, False: 544]
  |  Branch (1501:26): [True: 23, False: 521]
  ------------------
 1502|     25|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     25|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1503|       |
 1504|    521|    struct musl_tm dts;
 1505|    521|    memset(&dts, 0, sizeof(dts));
 1506|       |
 1507|    521|    size_t pos = 0;
 1508|    521|    size_t len;
 1509|       |
 1510|       |    /* Parse the year. The ISO standard asks for four digits. But we accept up
 1511|       |     * to five with an optional plus or minus in front due to the range of the
 1512|       |     * DateTime 64bit integer. But in that case we require the year and the
 1513|       |     * month to be separated by a '-'. Otherwise we cannot know where the month
 1514|       |     * starts. */
 1515|    521|    if(tokenData[0] == '-' || tokenData[0] == '+')
  ------------------
  |  Branch (1515:8): [True: 35, False: 486]
  |  Branch (1515:31): [True: 6, False: 480]
  ------------------
 1516|     41|        pos++;
 1517|    521|    UA_Int64 year = 0;
 1518|    521|    len = parseInt64(&tokenData[pos], 5, &year);
 1519|    521|    pos += len;
 1520|    521|    if(len != 4 && tokenData[pos] != '-')
  ------------------
  |  Branch (1520:8): [True: 367, False: 154]
  |  Branch (1520:20): [True: 73, False: 294]
  ------------------
 1521|     73|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     73|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1522|    448|    if(tokenData[0] == '-')
  ------------------
  |  Branch (1522:8): [True: 26, False: 422]
  ------------------
 1523|     26|        year = -year;
 1524|    448|    dts.tm_year = (UA_Int16)year - 1900;
 1525|    448|    if(tokenData[pos] == '-')
  ------------------
  |  Branch (1525:8): [True: 429, False: 19]
  ------------------
 1526|    429|        pos++;
 1527|       |
 1528|       |    /* Parse the month */
 1529|    448|    UA_UInt64 month = 0;
 1530|    448|    len = parseUInt64(&tokenData[pos], 2, &month);
 1531|    448|    pos += len;
 1532|    448|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|    448|    do {                                                                                 \
  |  |  173|    448|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|    448|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 27, False: 421]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|     27|            EVAL_ON_ERROR;                                                               \
  |  |  175|     27|        }                                                                                \
  |  |  176|    448|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 421]
  |  |  ------------------
  ------------------
 1533|    421|    dts.tm_mon = (UA_UInt16)month - 1;
 1534|    421|    if(tokenData[pos] == '-')
  ------------------
  |  Branch (1534:8): [True: 1, False: 420]
  ------------------
 1535|      1|        pos++;
 1536|       |
 1537|       |    /* Parse the day and check the T between date and time */
 1538|    421|    UA_UInt64 day = 0;
 1539|    421|    len = parseUInt64(&tokenData[pos], 2, &day);
 1540|    421|    pos += len;
 1541|    421|    UA_CHECK(len == 2 || tokenData[pos] != 'T',
  ------------------
  |  |  172|    421|    do {                                                                                 \
  |  |  173|    421|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|    780|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 1, False: 420]
  |  |  |  |  |  Branch (579:43): [True: 62, False: 359]
  |  |  |  |  |  Branch (579:43): [True: 358, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      1|            EVAL_ON_ERROR;                                                               \
  |  |  175|      1|        }                                                                                \
  |  |  176|    421|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 420]
  |  |  ------------------
  ------------------
 1542|    421|             return UA_STATUSCODE_BADDECODINGERROR);
 1543|    420|    dts.tm_mday = (UA_UInt16)day;
 1544|    420|    pos++;
 1545|       |
 1546|       |    /* Parse the hour */
 1547|    420|    UA_UInt64 hour = 0;
 1548|    420|    len = parseUInt64(&tokenData[pos], 2, &hour);
 1549|    420|    pos += len;
 1550|    420|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|    420|    do {                                                                                 \
  |  |  173|    420|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|    420|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 16, False: 404]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|     16|            EVAL_ON_ERROR;                                                               \
  |  |  175|     16|        }                                                                                \
  |  |  176|    420|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 404]
  |  |  ------------------
  ------------------
 1551|    404|    dts.tm_hour = (UA_UInt16)hour;
 1552|    404|    if(tokenData[pos] == ':')
  ------------------
  |  Branch (1552:8): [True: 1, False: 403]
  ------------------
 1553|      1|        pos++;
 1554|       |
 1555|       |    /* Parse the minute */
 1556|    404|    UA_UInt64 min = 0;
 1557|    404|    len = parseUInt64(&tokenData[pos], 2, &min);
 1558|    404|    pos += len;
 1559|    404|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|    404|    do {                                                                                 \
  |  |  173|    404|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|    404|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 10, False: 394]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|     10|            EVAL_ON_ERROR;                                                               \
  |  |  175|     10|        }                                                                                \
  |  |  176|    404|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 394]
  |  |  ------------------
  ------------------
 1560|    394|    dts.tm_min = (UA_UInt16)min;
 1561|    394|    if(tokenData[pos] == ':')
  ------------------
  |  Branch (1561:8): [True: 1, False: 393]
  ------------------
 1562|      1|        pos++;
 1563|       |
 1564|       |    /* Parse the second */
 1565|    394|    UA_UInt64 sec = 0;
 1566|    394|    len = parseUInt64(&tokenData[pos], 2, &sec);
 1567|    394|    pos += len;
 1568|    394|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|    394|    do {                                                                                 \
  |  |  173|    394|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|    394|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 9, False: 385]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      9|            EVAL_ON_ERROR;                                                               \
  |  |  175|      9|        }                                                                                \
  |  |  176|    394|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 385]
  |  |  ------------------
  ------------------
 1569|    385|    dts.tm_sec = (UA_UInt16)sec;
 1570|       |
 1571|       |    /* Compute the seconds since the Unix epoch */
 1572|    385|    long long sinceunix = musl_tm_to_secs(&dts);
 1573|       |
 1574|       |    /* Are we within the range that can be represented? */
 1575|    385|    long long sinceunix_min =
 1576|    385|        (long long)(UA_INT64_MIN / UA_DATETIME_SEC) -
  ------------------
  |  |  119|    385|#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
  |  |  ------------------
  |  |  |  |  118|    385|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  |  |  ------------------
  ------------------
                      (long long)(UA_INT64_MIN / UA_DATETIME_SEC) -
  ------------------
  |  |  285|    385|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    385|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    385|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1577|    385|        (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC) -
  ------------------
  |  |  327|    385|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|    385|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|    385|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|    385|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC) -
  ------------------
  |  |  285|    385|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    385|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    385|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1578|    385|        (long long)1; /* manual correction due to rounding */
 1579|    385|    long long sinceunix_max = (long long)
 1580|    385|        ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  118|    385|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  ------------------
                      ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  327|    385|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|    385|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|    385|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|    385|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  285|    385|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    385|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    385|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1581|    385|    if(sinceunix < sinceunix_min || sinceunix > sinceunix_max)
  ------------------
  |  Branch (1581:8): [True: 39, False: 346]
  |  Branch (1581:37): [True: 6, False: 340]
  ------------------
 1582|     45|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     45|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1583|       |
 1584|       |    /* Convert to DateTime. Add or subtract one extra second here to prevent
 1585|       |     * underflow/overflow. This is reverted once the fractional part has been
 1586|       |     * added. */
 1587|    340|    sinceunix -= (sinceunix > 0) ? 1 : -1;
  ------------------
  |  Branch (1587:18): [True: 129, False: 211]
  ------------------
 1588|    340|    UA_DateTime dt = (UA_DateTime)
 1589|    340|        (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  327|    340|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|    340|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|    340|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|    340|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  285|    340|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    340|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    340|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  285|    340|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    340|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    340|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1590|       |
 1591|       |    /* Parse the fraction of the second if defined */
 1592|    340|    if(tokenData[pos] == ',' || tokenData[pos] == '.') {
  ------------------
  |  Branch (1592:8): [True: 35, False: 305]
  |  Branch (1592:33): [True: 21, False: 284]
  ------------------
 1593|     56|        pos++;
 1594|     56|        double frac = 0.0;
 1595|     56|        double denom = 0.1;
 1596|  54.2k|        while(pos < tokenSize &&
  ------------------
  |  Branch (1596:15): [True: 54.2k, False: 0]
  ------------------
 1597|  54.2k|              tokenData[pos] >= '0' && tokenData[pos] <= '9') {
  ------------------
  |  Branch (1597:15): [True: 54.1k, False: 20]
  |  Branch (1597:40): [True: 54.1k, False: 36]
  ------------------
 1598|  54.1k|            frac += denom * (tokenData[pos] - '0');
 1599|  54.1k|            denom *= 0.1;
 1600|  54.1k|            pos++;
 1601|  54.1k|        }
 1602|     56|        frac += 0.00000005; /* Correct rounding when converting to integer */
 1603|     56|        dt += (UA_DateTime)(frac * UA_DATETIME_SEC);
  ------------------
  |  |  285|     56|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|     56|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|     56|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1604|     56|    }
 1605|       |
 1606|       |    /* Remove the underflow/overflow protection (see above) */
 1607|    340|    if(sinceunix > 0) {
  ------------------
  |  Branch (1607:8): [True: 130, False: 210]
  ------------------
 1608|    130|        if(dt > UA_INT64_MAX - UA_DATETIME_SEC)
  ------------------
  |  |  118|    130|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  ------------------
                      if(dt > UA_INT64_MAX - UA_DATETIME_SEC)
  ------------------
  |  |  285|    130|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    130|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    130|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1608:12): [True: 0, False: 130]
  ------------------
 1609|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1610|    130|        dt += UA_DATETIME_SEC;
  ------------------
  |  |  285|    130|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    130|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    130|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1611|    210|    } else {
 1612|    210|        if(dt < UA_INT64_MIN + UA_DATETIME_SEC)
  ------------------
  |  |  119|    210|#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
  |  |  ------------------
  |  |  |  |  118|    210|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  |  |  ------------------
  ------------------
                      if(dt < UA_INT64_MIN + UA_DATETIME_SEC)
  ------------------
  |  |  285|    210|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    210|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    210|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1612:12): [True: 1, False: 209]
  ------------------
 1613|      1|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1614|    209|        dt -= UA_DATETIME_SEC;
  ------------------
  |  |  285|    209|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    209|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|    209|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1615|    209|    }
 1616|       |
 1617|       |    /* We must be at the end of the string (ending with 'Z' as checked above) */
 1618|    339|    if(pos != tokenSize - 1)
  ------------------
  |  Branch (1618:8): [True: 51, False: 288]
  ------------------
 1619|     51|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     51|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1620|       |
 1621|    288|    *dst = dt;
 1622|       |
 1623|    288|    ctx->index++;
 1624|    288|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    288|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1625|    339|}
ua_types_encoding_json.c:Guid_decodeJson:
 1335|     77|DECODE_JSON(Guid) {
 1336|     77|    UA_Guid *dst = (UA_Guid*)p;
 1337|     77|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|     77|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|     77|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 77]
  |  |  ------------------
  |  | 1034|     77|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|     77|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 77]
  |  |  ------------------
  ------------------
 1338|     77|    CHECK_STRING;
  ------------------
  |  | 1047|     77|#define CHECK_STRING do {                                \
  |  | 1048|     77|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1048:8): [True: 11, False: 66]
  |  |  ------------------
  |  | 1049|     11|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     11|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1050|     66|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1050:14): [Folded, False: 66]
  |  |  ------------------
  ------------------
 1339|     66|    GET_TOKEN;
  ------------------
  |  | 1028|     66|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|     66|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|     66|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 66]
  |  |  ------------------
  ------------------
 1340|     66|    UA_String str = {tokenSize, (UA_Byte*)(uintptr_t)tokenData};
 1341|     66|    ctx->index++;
 1342|     66|    return UA_Guid_parse(dst, str);
 1343|     77|}
ua_types_encoding_json.c:ByteString_decodeJson:
 1390|  6.90k|DECODE_JSON(ByteString) {
 1391|  6.90k|    UA_ByteString *dst = (UA_ByteString*)p;
 1392|  6.90k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|  6.90k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|  6.90k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 6.90k]
  |  |  ------------------
  |  | 1034|  6.90k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|  6.90k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 6.90k]
  |  |  ------------------
  ------------------
 1393|  6.90k|    CHECK_STRING;
  ------------------
  |  | 1047|  6.90k|#define CHECK_STRING do {                                \
  |  | 1048|  6.90k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1048:8): [True: 13, False: 6.89k]
  |  |  ------------------
  |  | 1049|     13|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     13|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1050|  6.89k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1050:14): [Folded, False: 6.89k]
  |  |  ------------------
  ------------------
 1394|  6.89k|    GET_TOKEN;
  ------------------
  |  | 1028|  6.89k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|  6.89k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|  6.89k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 6.89k]
  |  |  ------------------
  ------------------
 1395|       |
 1396|       |    /* Empty bytestring? */
 1397|  6.89k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1397:8): [True: 1.64k, False: 5.24k]
  ------------------
 1398|  1.64k|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  1.64k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1399|  1.64k|        dst->length = 0;
 1400|  5.24k|    } else {
 1401|  5.24k|        size_t flen = 0;
 1402|  5.24k|        unsigned char* unB64 =
 1403|  5.24k|            UA_unbase64((const unsigned char*)tokenData, tokenSize, &flen);
 1404|  5.24k|        if(unB64 == 0)
  ------------------
  |  Branch (1404:12): [True: 48, False: 5.20k]
  ------------------
 1405|     48|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     48|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1406|  5.20k|        dst->data = (u8*)unB64;
 1407|  5.20k|        dst->length = flen;
 1408|  5.20k|    }
 1409|       |
 1410|  6.84k|    ctx->index++;
 1411|  6.84k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  6.84k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1412|  6.89k|}
ua_types_encoding_json.c:NodeId_decodeJson:
 1470|  23.6k|DECODE_JSON(NodeId) {
 1471|  23.6k|    UA_NodeId *dst = (UA_NodeId*)p;
 1472|  23.6k|    UA_String str;
 1473|  23.6k|    UA_String_init(&str);
 1474|  23.6k|    status res = String_decodeJson(ctx, &str, NULL);
 1475|  23.6k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  23.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1475:8): [True: 23.5k, False: 64]
  ------------------
 1476|  23.5k|        res = UA_NodeId_parseEx(dst, str, ctx->namespaceMapping);
 1477|  23.6k|    UA_String_clear(&str);
 1478|  23.6k|    return res;
 1479|  23.6k|}
ua_types_encoding_json.c:ExpandedNodeId_decodeJson:
 1481|  3.66k|DECODE_JSON(ExpandedNodeId) {
 1482|  3.66k|    UA_ExpandedNodeId *dst = (UA_ExpandedNodeId*)p;
 1483|  3.66k|    UA_String str;
 1484|  3.66k|    UA_String_init(&str);
 1485|  3.66k|    status res = String_decodeJson(ctx, &str, NULL);
 1486|  3.66k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  3.66k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1486:8): [True: 3.65k, False: 10]
  ------------------
 1487|  3.65k|        res = UA_ExpandedNodeId_parseEx(dst, str, ctx->namespaceMapping,
 1488|  3.65k|                                        ctx->serverUrisSize, ctx->serverUris);
 1489|  3.66k|    UA_String_clear(&str);
 1490|  3.66k|    return res;
 1491|  3.66k|}
ua_types_encoding_json.c:StatusCode_decodeJson:
 1627|    262|DECODE_JSON(StatusCode) {
 1628|    262|    UA_StatusCode *dst = (UA_StatusCode*)p;
 1629|    262|    CHECK_OBJECT;
  ------------------
  |  | 1052|    262|#define CHECK_OBJECT do {                                \
  |  | 1053|    262|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1053:8): [True: 9, False: 253]
  |  |  ------------------
  |  | 1054|      9|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1055|    253|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1055:14): [Folded, False: 253]
  |  |  ------------------
  ------------------
 1630|    253|    DecodeEntry entries[2] = {
 1631|    253|        {UA_JSONKEY_CODE, dst, NULL, false, &UA_TYPES[UA_TYPES_UINT32]},
  ------------------
  |  |  225|    253|#define UA_TYPES_UINT32 6
  ------------------
 1632|    253|        {UA_JSONKEY_SYMBOL, NULL, NULL, false, NULL}
 1633|    253|    };
 1634|    253|    return decodeFields(ctx, entries, 2);
 1635|    262|}
ua_types_encoding_json.c:QualifiedName_decodeJson:
 1424|  19.4k|DECODE_JSON(QualifiedName) {
 1425|  19.4k|    UA_QualifiedName *dst = (UA_QualifiedName*)p;
 1426|  19.4k|    CHECK_NULL_SKIP;
  ------------------
  |  | 1057|  19.4k|#define CHECK_NULL_SKIP do {                         \
  |  | 1058|  19.4k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1058:8): [True: 68, False: 19.3k]
  |  |  ------------------
  |  | 1059|     68|        ctx->index++;                                \
  |  | 1060|     68|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|     68|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1061|  19.3k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1061:14): [Folded, False: 19.3k]
  |  |  ------------------
  ------------------
 1427|  19.3k|    UA_String str;
 1428|  19.3k|    UA_String_init(&str);
 1429|  19.3k|    status res = String_decodeJson(ctx, &str, NULL);
 1430|  19.3k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  19.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1430:8): [True: 19.3k, False: 13]
  ------------------
 1431|  19.3k|        res = UA_QualifiedName_parseEx(dst, str, ctx->namespaceMapping);
 1432|  19.3k|    UA_String_clear(&str);
 1433|  19.3k|    return res;
 1434|  19.4k|}
ua_types_encoding_json.c:LocalizedText_decodeJson:
 1414|    829|DECODE_JSON(LocalizedText) {
 1415|    829|    UA_LocalizedText *dst = (UA_LocalizedText*)p;
 1416|    829|    CHECK_OBJECT;
  ------------------
  |  | 1052|    829|#define CHECK_OBJECT do {                                \
  |  | 1053|    829|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1053:8): [True: 13, False: 816]
  |  |  ------------------
  |  | 1054|     13|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     13|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1055|    816|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1055:14): [Folded, False: 816]
  |  |  ------------------
  ------------------
 1417|    816|    DecodeEntry entries[2] = {
 1418|    816|        {UA_JSONKEY_LOCALE, &dst->locale, NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  395|    816|#define UA_TYPES_STRING 11
  ------------------
 1419|    816|        {UA_JSONKEY_TEXT, &dst->text, NULL, false, &UA_TYPES[UA_TYPES_STRING]}
  ------------------
  |  |  395|    816|#define UA_TYPES_STRING 11
  ------------------
 1420|    816|    };
 1421|    816|    return decodeFields(ctx, entries, 2);
 1422|    829|}
ua_types_encoding_json.c:ExtensionObject_decodeJson:
 2028|  20.0k|DECODE_JSON(ExtensionObject) {
 2029|  20.0k|    UA_ExtensionObject *dst = (UA_ExtensionObject*)p;
 2030|  20.0k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1057|  20.0k|#define CHECK_NULL_SKIP do {                         \
  |  | 1058|  20.0k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1058:8): [True: 0, False: 20.0k]
  |  |  ------------------
  |  | 1059|      0|        ctx->index++;                                \
  |  | 1060|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1061|  20.0k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1061:14): [Folded, False: 20.0k]
  |  |  ------------------
  ------------------
 2031|  20.0k|    CHECK_OBJECT;
  ------------------
  |  | 1052|  20.0k|#define CHECK_OBJECT do {                                \
  |  | 1053|  20.0k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1053:8): [True: 39, False: 20.0k]
  |  |  ------------------
  |  | 1054|     39|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     39|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1055|  20.0k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1055:14): [Folded, False: 20.0k]
  |  |  ------------------
  ------------------
 2032|       |
 2033|       |    /* Empty object -> Null ExtensionObject */
 2034|  20.0k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (2034:8): [True: 1.52k, False: 18.5k]
  ------------------
 2035|  1.52k|        ctx->index++; /* Skip the empty ExtensionObject */
 2036|  1.52k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.52k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2037|  1.52k|    }
 2038|       |
 2039|       |    /* Store the index where the ExtensionObject begins */
 2040|  18.5k|    size_t beginIndex = ctx->index;
 2041|       |
 2042|       |    /* Search for non-JSON encoding */
 2043|  18.5k|    UA_UInt64 encoding = 0;
 2044|  18.5k|    size_t encIndex = 0;
 2045|  18.5k|    status ret = lookAheadForKey(ctx, UA_JSONKEY_ENCODING, &encIndex);
 2046|  18.5k|    if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  18.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2046:8): [True: 2.92k, False: 15.5k]
  ------------------
 2047|  2.92k|        const char *extObjEncoding = &ctx->json5[ctx->tokens[encIndex].start];
 2048|  2.92k|        size_t len = parseUInt64(extObjEncoding,
 2049|  2.92k|                                 getTokenLength(&ctx->tokens[encIndex]),
 2050|  2.92k|                                 &encoding);
 2051|  2.92k|        if(len == 0 || encoding > 2)
  ------------------
  |  Branch (2051:12): [True: 2, False: 2.92k]
  |  Branch (2051:24): [True: 117, False: 2.80k]
  ------------------
 2052|    119|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    119|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2053|  2.92k|    }
 2054|       |
 2055|       |    /* Get the type NodeId index */
 2056|  18.4k|    size_t typeIdIndex = 0;
 2057|  18.4k|    ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 2058|  18.4k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  18.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2058:8): [True: 58, False: 18.3k]
  ------------------
 2059|     58|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     58|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2060|       |
 2061|       |    /* Decode the type NodeId */
 2062|  18.3k|    UA_NodeId typeId;
 2063|  18.3k|    UA_NodeId_init(&typeId);
 2064|  18.3k|    ctx->index = (UA_UInt16)typeIdIndex;
 2065|  18.3k|    ret = NodeId_decodeJson(ctx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|  18.3k|#define UA_TYPES_NODEID 16
  ------------------
 2066|  18.3k|    ctx->index = beginIndex;
 2067|  18.3k|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  18.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2067:8): [True: 181, False: 18.1k]
  ------------------
 2068|    181|        UA_NodeId_clear(&typeId); /* We don't have the global cleanup */
 2069|    181|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    181|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2070|    181|    }
 2071|       |
 2072|       |    /* Lookup the type */
 2073|  18.1k|    type = UA_findDataTypeWithCustom(&typeId, ctx->customTypes);
 2074|       |
 2075|       |    /* Unknown body type */
 2076|  18.1k|    if(!type) {
  ------------------
  |  Branch (2076:8): [True: 10.7k, False: 7.43k]
  ------------------
 2077|       |        /* FIXME: We need UA_EXTENSIONOBJECT_ENCODED_JSON when we parse an
 2078|       |         * unknown type in JSON. But it is not defined in the standard. */
 2079|  10.7k|        dst->encoding = (encoding != 2) ?
  ------------------
  |  Branch (2079:25): [True: 9.82k, False: 900]
  ------------------
 2080|  9.82k|            UA_EXTENSIONOBJECT_ENCODED_BYTESTRING :
 2081|  10.7k|            UA_EXTENSIONOBJECT_ENCODED_XML;
 2082|  10.7k|        dst->content.encoded.typeId = typeId;
 2083|       |
 2084|       |        /* Get the body field index */
 2085|  10.7k|        size_t bodyIndex = 0;
 2086|  10.7k|        ret = lookAheadForKey(ctx, UA_JSONKEY_BODY, &bodyIndex);
 2087|  10.7k|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  10.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2087:12): [True: 6.62k, False: 4.10k]
  ------------------
 2088|       |            /* Only JSON structures can be encoded in-situ */
 2089|  6.62k|            if(encoding != 0)
  ------------------
  |  Branch (2089:16): [True: 6, False: 6.61k]
  ------------------
 2090|      6|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2091|       |
 2092|       |            /* Extract the entire ExtensionObject object as the body */
 2093|  6.61k|            size_t parentIndex = ctx->index;
 2094|  6.61k|            ret = tokenToByteString(ctx, &dst->content.encoded.body);
 2095|  6.61k|            if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.61k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2095:16): [True: 1, False: 6.61k]
  ------------------
 2096|      1|                return ret;
 2097|       |
 2098|       |            /* Remove the UaEncoding and UaTypeId field from the encoding.
 2099|       |             * Remove the later field first. */
 2100|  6.61k|            if(encIndex != 0 && encIndex > typeIdIndex)
  ------------------
  |  Branch (2100:16): [True: 1.11k, False: 5.49k]
  |  Branch (2100:33): [True: 375, False: 743]
  ------------------
 2101|    375|                removeFieldFromEncoding(ctx, &dst->content.encoded.body,
 2102|    375|                                        parentIndex, encIndex);
 2103|       |
 2104|  6.61k|            removeFieldFromEncoding(ctx, &dst->content.encoded.body,
 2105|  6.61k|                                    parentIndex, typeIdIndex);
 2106|       |
 2107|  6.61k|            if(encIndex != 0 && encIndex < typeIdIndex)
  ------------------
  |  Branch (2107:16): [True: 1.11k, False: 5.49k]
  |  Branch (2107:33): [True: 743, False: 375]
  ------------------
 2108|    743|                removeFieldFromEncoding(ctx, &dst->content.encoded.body,
 2109|    743|                                        parentIndex, encIndex);
 2110|       |
 2111|  6.61k|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  6.61k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2112|  6.61k|        }
 2113|       |
 2114|  4.10k|        ctx->index = bodyIndex;
 2115|  4.10k|        if(encoding != 0) {
  ------------------
  |  Branch (2115:12): [True: 1.28k, False: 2.82k]
  ------------------
 2116|       |            /* Decode the body as a ByteString */
 2117|  1.28k|            ret = ByteString_decodeJson(ctx, &dst->content.encoded.body, NULL);
 2118|  2.82k|        } else {
 2119|       |            /* Use the JSON encoding directly */
 2120|  2.82k|            ret = tokenToByteString(ctx, &dst->content.encoded.body);
 2121|  2.82k|        }
 2122|  4.10k|        ctx->index = beginIndex;
 2123|  4.10k|        skipObject(ctx);
 2124|  4.10k|        return ret;
 2125|  10.7k|    }
 2126|       |
 2127|       |    /* No need to keep the TypeId */
 2128|  7.43k|    UA_NodeId_clear(&typeId);
 2129|       |
 2130|       |    /* Disallow directly nested ExtensionObjects */
 2131|  7.43k|    if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  735|  7.43k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (2131:8): [True: 2, False: 7.43k]
  ------------------
 2132|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2133|       |
 2134|       |    /* Allocate memory for the decoded data */
 2135|  7.43k|    dst->content.decoded.data = UA_new(type);
 2136|  7.43k|    if(!dst->content.decoded.data)
  ------------------
  |  Branch (2136:8): [True: 1, False: 7.43k]
  ------------------
 2137|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2138|  7.43k|    dst->content.decoded.type = type;
 2139|  7.43k|    dst->encoding = UA_EXTENSIONOBJECT_DECODED;
 2140|       |
 2141|       |    /* Get the body field index */
 2142|  7.43k|    decodeJsonSignature decodeType = decodeJsonJumpTable[type->typeKind];
 2143|  7.43k|    size_t bodyIndex = ctx->index;
 2144|  7.43k|    ret = lookAheadForKey(ctx, UA_JSONKEY_BODY, &bodyIndex); /* Can fail */
 2145|  7.43k|    if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  7.43k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2145:8): [True: 7.01k, False: 422]
  ------------------
 2146|  7.01k|        ctx->index = bodyIndex;
 2147|  7.01k|        ret = decodeType(ctx, dst->content.decoded.data, type);
 2148|  7.01k|        ctx->index = beginIndex;
 2149|  7.01k|        skipObject(ctx);
 2150|  7.01k|        return ret;
 2151|  7.01k|    }
 2152|       |
 2153|    422|    return decodeType(ctx, dst->content.decoded.data, type);
 2154|  7.43k|}
ua_types_encoding_json.c:tokenToByteString:
 1961|  9.43k|tokenToByteString(ParseCtx *ctx, UA_ByteString *p) {
 1962|  9.43k|    GET_TOKEN;
  ------------------
  |  | 1028|  9.43k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|  9.43k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|  9.43k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 9.43k]
  |  |  ------------------
  ------------------
 1963|  9.43k|    UA_StatusCode res = UA_ByteString_allocBuffer(p, tokenSize);
 1964|  9.43k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  9.43k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1964:8): [True: 1, False: 9.43k]
  ------------------
 1965|      1|        return res;
 1966|  9.43k|    memcpy(p->data, tokenData, tokenSize);
 1967|  9.43k|    skipObject(ctx);
 1968|  9.43k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  9.43k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1969|  9.43k|}
ua_types_encoding_json.c:removeFieldFromEncoding:
 1977|  7.73k|                        size_t parentIndex, size_t tokenIndex) {
 1978|       |    /* Which part of the encoding to cut out */
 1979|  7.73k|    unsigned objStart = ctx->tokens[parentIndex].start;
 1980|  7.73k|    unsigned objEnd = ctx->tokens[parentIndex].end;
 1981|  7.73k|    unsigned start = ctx->tokens[tokenIndex-1].start;
 1982|  7.73k|    unsigned end = ctx->tokens[tokenIndex].end + 1; /* One char after */
 1983|       |
 1984|  7.73k|    UA_Boolean haveBefore = (parentIndex < tokenIndex - 2);
 1985|  7.73k|    if(haveBefore) {
  ------------------
  |  Branch (1985:8): [True: 3.05k, False: 4.67k]
  ------------------
 1986|       |        /* Find where the previous token ended. This also removes the comma
 1987|       |         * between the previous and the current element. */
 1988|  2.61M|        for(size_t i = parentIndex + 2; i < tokenIndex - 1; i++) {
  ------------------
  |  Branch (1988:41): [True: 2.60M, False: 3.05k]
  ------------------
 1989|  2.60M|            if(ctx->tokens[i].end + 1 > start)
  ------------------
  |  Branch (1989:16): [True: 0, False: 2.60M]
  ------------------
 1990|      0|                start = ctx->tokens[i].end + 1;
 1991|  2.60M|        }
 1992|  3.05k|        if(ctx->json5[start] == '"' || ctx->json5[start] == '\'')
  ------------------
  |  Branch (1992:12): [True: 0, False: 3.05k]
  |  Branch (1992:40): [True: 0, False: 3.05k]
  ------------------
 1993|      0|            start++;
 1994|  4.67k|    } else {
 1995|       |        /* No previous element. Remove the quoation marks of the field name. */
 1996|  4.67k|        start = ctx->tokens[tokenIndex-1].start;
 1997|  4.67k|        if(start > 0 && (ctx->json5[start-1] == '"' || ctx->json5[start-1] == '\''))
  ------------------
  |  Branch (1997:12): [True: 4.67k, False: 0]
  |  Branch (1997:26): [True: 0, False: 4.67k]
  |  Branch (1997:56): [True: 306, False: 4.37k]
  ------------------
 1998|    306|            start--;
 1999|       |
 2000|       |        /* Find the beginning of the next field in the object.
 2001|       |         * This removes the comma after the current field. */
 2002|  4.67k|        size_t oldIndex = ctx->index;
 2003|  4.67k|        ctx->index = tokenIndex;
 2004|  4.67k|        skipObject(ctx);
 2005|  4.67k|        if(ctx->index < ctx->tokensSize && ctx->tokens[ctx->index].start < objEnd) {
  ------------------
  |  Branch (2005:12): [True: 4.67k, False: 0]
  |  Branch (2005:44): [True: 1.30k, False: 3.36k]
  ------------------
 2006|  1.30k|            end = ctx->tokens[ctx->index].start;
 2007|  1.30k|            if(ctx->json5[end-1] == '"' || ctx->json5[end-1] == '\'')
  ------------------
  |  Branch (2007:16): [True: 205, False: 1.10k]
  |  Branch (2007:44): [True: 216, False: 886]
  ------------------
 2008|    421|                end--;
 2009|  1.30k|        }
 2010|  4.67k|        ctx->index = oldIndex;
 2011|  4.67k|    }
 2012|       |
 2013|  7.73k|    UA_assert(end > start);
  ------------------
  |  |  399|  7.73k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2013:5): [True: 7.73k, False: 0]
  ------------------
 2014|  7.73k|    UA_assert(start > objStart);
  ------------------
  |  |  399|  7.73k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2014:5): [True: 7.73k, False: 0]
  ------------------
 2015|       |
 2016|       |    /* Move the offset from ctx->json5 to encoding->data */
 2017|  7.73k|    start -= objStart;
 2018|  7.73k|    end -= objStart;
 2019|       |
 2020|  7.73k|    UA_assert(end <= encoding->length);
  ------------------
  |  |  399|  7.73k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2020:5): [True: 7.73k, False: 0]
  ------------------
 2021|       |
 2022|       |    /* Cut out the field we want to remove */
 2023|  7.73k|    size_t after_len = encoding->length - end;
 2024|  7.73k|    memmove(encoding->data + start, encoding->data + end, after_len);
 2025|  7.73k|    encoding->length -= (end - start);
 2026|  7.73k|}
ua_types_encoding_json.c:DataValue_decodeJson:
 1921|  33.0k|DECODE_JSON(DataValue) {
 1922|  33.0k|    UA_DataValue *dst = (UA_DataValue*)p;
 1923|  33.0k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1057|  33.0k|#define CHECK_NULL_SKIP do {                         \
  |  | 1058|  33.0k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1058:8): [True: 334, False: 32.7k]
  |  |  ------------------
  |  | 1059|    334|        ctx->index++;                                \
  |  | 1060|    334|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    334|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1061|  32.7k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1061:14): [Folded, False: 32.7k]
  |  |  ------------------
  ------------------
 1924|  32.7k|    CHECK_OBJECT;
  ------------------
  |  | 1052|  32.7k|#define CHECK_OBJECT do {                                \
  |  | 1053|  32.7k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1053:8): [True: 68, False: 32.6k]
  |  |  ------------------
  |  | 1054|     68|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     68|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1055|  32.6k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1055:14): [Folded, False: 32.6k]
  |  |  ------------------
  ------------------
 1925|       |
 1926|       |    /* Decode the Variant in-situ */
 1927|  32.6k|    size_t beginIndex = ctx->index;
 1928|  32.6k|    status ret = decodeJSONVariant(ctx, &dst->value);
 1929|  32.6k|    ctx->index = beginIndex;
 1930|  32.6k|    dst->hasValue = (dst->value.type != NULL);
 1931|  32.6k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  32.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1931:8): [True: 3.13k, False: 29.5k]
  ------------------
 1932|  3.13k|        return ret;
 1933|       |
 1934|       |    /* Decode the other members (skip the Variant members) */
 1935|  29.5k|    DecodeEntry entries[8] = {
 1936|  29.5k|        {UA_JSONKEY_TYPE, NULL, NULL, false, NULL},
 1937|  29.5k|        {UA_JSONKEY_VALUE, NULL, NULL, false, NULL},
 1938|  29.5k|        {UA_JSONKEY_DIMENSIONS, NULL, NULL, false, NULL},
 1939|  29.5k|        {UA_JSONKEY_STATUS, &dst->status, NULL, false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  633|  29.5k|#define UA_TYPES_STATUSCODE 18
  ------------------
 1940|  29.5k|        {UA_JSONKEY_SOURCETIMESTAMP, &dst->sourceTimestamp, NULL,
 1941|  29.5k|         false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  429|  29.5k|#define UA_TYPES_DATETIME 12
  ------------------
 1942|  29.5k|        {UA_JSONKEY_SOURCEPICOSECONDS, &dst->sourcePicoseconds, NULL,
 1943|  29.5k|         false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  157|  29.5k|#define UA_TYPES_UINT16 4
  ------------------
 1944|  29.5k|        {UA_JSONKEY_SERVERTIMESTAMP, &dst->serverTimestamp, NULL,
 1945|  29.5k|         false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  429|  29.5k|#define UA_TYPES_DATETIME 12
  ------------------
 1946|  29.5k|        {UA_JSONKEY_SERVERPICOSECONDS, &dst->serverPicoseconds, NULL,
 1947|  29.5k|         false, &UA_TYPES[UA_TYPES_UINT16]}
  ------------------
  |  |  157|  29.5k|#define UA_TYPES_UINT16 4
  ------------------
 1948|  29.5k|    };
 1949|       |
 1950|  29.5k|    ret = decodeFields(ctx, entries, 8);
 1951|  29.5k|    dst->hasStatus = entries[3].found;
 1952|  29.5k|    dst->hasSourceTimestamp = entries[4].found;
 1953|  29.5k|    dst->hasSourcePicoseconds = entries[5].found;
 1954|  29.5k|    dst->hasServerTimestamp = entries[6].found;
 1955|  29.5k|    dst->hasServerPicoseconds = entries[7].found;
 1956|  29.5k|    return ret;
 1957|  32.6k|}
ua_types_encoding_json.c:decodeJSONVariant:
 1791|  39.7k|decodeJSONVariant(ParseCtx *ctx, UA_Variant *dst) {
 1792|       |    /* Empty variant == null */
 1793|  39.7k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (1793:8): [True: 5.00k, False: 34.7k]
  ------------------
 1794|  5.00k|        ctx->index++;
 1795|  5.00k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  5.00k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1796|  5.00k|    }
 1797|       |
 1798|       |    /* Search the value field */
 1799|  34.7k|    size_t valueIndex = 0;
 1800|  34.7k|    lookAheadForKey(ctx, UA_JSONKEY_VALUE, &valueIndex);
 1801|       |
 1802|       |    /* Search for the dimensions field */
 1803|  34.7k|    size_t dimIndex = 0;
 1804|  34.7k|    lookAheadForKey(ctx, UA_JSONKEY_DIMENSIONS, &dimIndex);
 1805|       |
 1806|       |    /* Parse the type kind */
 1807|  34.7k|    size_t typeIndex = 0;
 1808|  34.7k|    lookAheadForKey(ctx, UA_JSONKEY_TYPE, &typeIndex);
 1809|  34.7k|    if(typeIndex == 0 || ctx->tokens[typeIndex].type != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1809:8): [True: 64, False: 34.6k]
  |  Branch (1809:26): [True: 4, False: 34.6k]
  ------------------
 1810|     68|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     68|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1811|  34.6k|    UA_UInt64 typeKind = 0;
 1812|  34.6k|    size_t len = parseUInt64(&ctx->json5[ctx->tokens[typeIndex].start],
 1813|  34.6k|                             getTokenLength(&ctx->tokens[typeIndex]), &typeKind);
 1814|  34.6k|    if(len == 0)
  ------------------
  |  Branch (1814:8): [True: 5, False: 34.6k]
  ------------------
 1815|      5|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1816|       |
 1817|       |    /* Shift to get the datatype index. The type must be a builtin data type.
 1818|       |     * All not-builtin types are wrapped in an ExtensionObject. */
 1819|  34.6k|    typeKind--;
 1820|  34.6k|    if(typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (1820:8): [True: 136, False: 34.5k]
  ------------------
 1821|    136|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    136|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1822|  34.5k|    const UA_DataType *type = &UA_TYPES[typeKind];
 1823|       |
 1824|       |    /* Value is an array? */
 1825|  34.5k|    UA_Boolean isArray =
 1826|  34.5k|        (valueIndex > 0 && ctx->tokens[valueIndex].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  Branch (1826:10): [True: 31.7k, False: 2.80k]
  |  Branch (1826:28): [True: 12.4k, False: 19.2k]
  ------------------
 1827|       |
 1828|       |    /* Adjust the depth and set the value index as current */
 1829|  34.5k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|  34.5k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (1829:8): [True: 0, False: 34.5k]
  ------------------
 1830|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1831|  34.5k|    size_t beginIndex = ctx->index;
 1832|  34.5k|    ctx->index = valueIndex;
 1833|  34.5k|    ctx->depth++;
 1834|       |
 1835|       |    /* Decode the value */
 1836|  34.5k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  34.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1837|  34.5k|    if(!isArray) {
  ------------------
  |  Branch (1837:8): [True: 22.0k, False: 12.4k]
  ------------------
 1838|       |        /* Scalar with dimensions -> error */
 1839|  22.0k|        if(dimIndex > 0) {
  ------------------
  |  Branch (1839:12): [True: 23, False: 22.0k]
  ------------------
 1840|     23|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     23|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1841|     23|            goto out;
 1842|     23|        }
 1843|       |
 1844|       |        /* A variant cannot contain a variant. But it can contain an array of
 1845|       |         * variants */
 1846|  22.0k|        if(type->typeKind == UA_DATATYPEKIND_VARIANT) {
  ------------------
  |  Branch (1846:12): [True: 1, False: 22.0k]
  ------------------
 1847|      1|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1848|      1|            goto out;
 1849|      1|        }
 1850|       |
 1851|       |        /* Decode a value wrapped in an ExtensionObject */
 1852|  22.0k|        if(valueIndex > 0 && type->typeKind == UA_DATATYPEKIND_EXTENSIONOBJECT) {
  ------------------
  |  Branch (1852:12): [True: 19.2k, False: 2.77k]
  |  Branch (1852:30): [True: 898, False: 18.3k]
  ------------------
 1853|    898|            res = Variant_decodeJsonUnwrapExtensionObject(ctx, dst, NULL);
 1854|    898|            goto out;
 1855|    898|        }
 1856|       |
 1857|       |        /* Allocate memory for the value */
 1858|  21.1k|        dst->data = UA_new(type);
 1859|  21.1k|        if(!dst->data) {
  ------------------
  |  Branch (1859:12): [True: 2, False: 21.1k]
  ------------------
 1860|      2|            res = UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      2|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1861|      2|            goto out;
 1862|      2|        }
 1863|  21.1k|        dst->type = type;
 1864|       |
 1865|       |        /* Decode the value */
 1866|  21.1k|        if(valueIndex > 0 && ctx->tokens[valueIndex].type != CJ5_TOKEN_NULL)
  ------------------
  |  Branch (1866:12): [True: 18.3k, False: 2.77k]
  |  Branch (1866:30): [True: 18.1k, False: 205]
  ------------------
 1867|  18.1k|            res = decodeJsonJumpTable[type->typeKind](ctx, dst->data, type);
 1868|  21.1k|    } else {
 1869|       |        /* Decode an array. Try to unwrap ExtensionObjects in the array. The
 1870|       |         * members must all have the same type. */
 1871|  12.4k|        const UA_DataType *unwrapType = NULL;
 1872|  12.4k|        if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  735|  12.4k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (1872:12): [True: 7.92k, False: 4.52k]
  ------------------
 1873|  7.92k|            unwrapType = getArrayUnwrapType(ctx);
 1874|  12.4k|        if(unwrapType) {
  ------------------
  |  Branch (1874:12): [True: 275, False: 12.1k]
  ------------------
 1875|    275|            dst->type = unwrapType;
 1876|    275|            res = Array_decodeJsonUnwrapExtensionObject(ctx, &dst->data, unwrapType);
 1877|  12.1k|        } else {
 1878|  12.1k|            dst->type = type;
 1879|  12.1k|            res = Array_decodeJson(ctx, &dst->data, type);
 1880|  12.1k|        }
 1881|       |
 1882|       |        /* Decode array dimensions */
 1883|  12.4k|        if(dimIndex > 0) {
  ------------------
  |  Branch (1883:12): [True: 6.06k, False: 6.38k]
  ------------------
 1884|  6.06k|            ctx->index = dimIndex;
 1885|  6.06k|            res |= Array_decodeJson(ctx, (void**)&dst->arrayDimensions,
 1886|  6.06k|                                    &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  225|  6.06k|#define UA_TYPES_UINT32 6
  ------------------
 1887|       |
 1888|       |            /* Help clang-analyzer */
 1889|  6.06k|            UA_assert(dst->arrayDimensionsSize == 0 || dst->arrayDimensions);
  ------------------
  |  |  399|  6.06k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1889:13): [True: 257, False: 5.81k]
  |  Branch (1889:13): [True: 5.81k, False: 0]
  ------------------
 1890|       |
 1891|       |            /* Validate the dimensions */
 1892|  6.06k|            size_t total = 1;
 1893|  2.74M|            for(size_t i = 0; i < dst->arrayDimensionsSize; i++)
  ------------------
  |  Branch (1893:31): [True: 2.73M, False: 6.06k]
  ------------------
 1894|  2.73M|                total *= dst->arrayDimensions[i];
 1895|  6.06k|            if(total != dst->arrayLength)
  ------------------
  |  Branch (1895:16): [True: 177, False: 5.89k]
  ------------------
 1896|    177|                res |= UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    177|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1897|       |
 1898|       |            /* Only keep >= 2 dimensions */
 1899|  6.06k|            if(dst->arrayDimensionsSize == 1) {
  ------------------
  |  Branch (1899:16): [True: 332, False: 5.73k]
  ------------------
 1900|    332|                UA_free(dst->arrayDimensions);
  ------------------
  |  |   19|    332|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1901|    332|                dst->arrayDimensions = NULL;
 1902|    332|                dst->arrayDimensionsSize = 0;
 1903|    332|            }
 1904|  6.06k|        }
 1905|  12.4k|    }
 1906|       |
 1907|  34.5k| out:
 1908|  34.5k|    ctx->index = beginIndex;
 1909|  34.5k|    skipObject(ctx);
 1910|  34.5k|    ctx->depth--;
 1911|  34.5k|    return res;
 1912|  34.5k|}
ua_types_encoding_json.c:Variant_decodeJsonUnwrapExtensionObject:
 2158|    898|                                        const UA_DataType *type) {
 2159|    898|    (void) type;
 2160|    898|    UA_Variant *dst = (UA_Variant*)p;
 2161|       |
 2162|       |    /* ExtensionObject with null body */
 2163|    898|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2163:8): [True: 194, False: 704]
  ------------------
 2164|    194|        dst->data = UA_ExtensionObject_new();
 2165|    194|        dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|    194|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2166|    194|        ctx->index++;
 2167|    194|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    194|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2168|    194|    }
 2169|       |
 2170|       |    /* Decode the ExtensionObject */
 2171|    704|    UA_ExtensionObject eo;
 2172|    704|    UA_ExtensionObject_init(&eo);
 2173|    704|    UA_StatusCode ret = ExtensionObject_decodeJson(ctx, &eo, NULL);
 2174|    704|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|    704|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2174:8): [True: 221, False: 483]
  ------------------
 2175|    221|        UA_ExtensionObject_clear(&eo); /* We don't have the global cleanup */
 2176|    221|        return ret;
 2177|    221|    }
 2178|       |
 2179|       |    /* The content is still encoded, cannot unwrap */
 2180|    483|    if(eo.encoding != UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2180:8): [True: 326, False: 157]
  ------------------
 2181|    326|        goto use_eo;
 2182|       |
 2183|       |    /* The content is a builtin type that could have been directly encoded in
 2184|       |     * the Variant, there was no need to wrap in an ExtensionObject. But this
 2185|       |     * means for us, that somebody made an extra effort to explicitly get an
 2186|       |     * ExtensionObject. So we keep it. As an added advantage we will generate
 2187|       |     * the same JSON again when encoding again. */
 2188|    157|    if(eo.content.decoded.type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (2188:8): [True: 82, False: 75]
  ------------------
 2189|     82|        goto use_eo;
 2190|       |
 2191|       |    /* Unwrap the ExtensionObject */
 2192|     75|    dst->data = eo.content.decoded.data;
 2193|     75|    dst->type = eo.content.decoded.type;
 2194|     75|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     75|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2195|       |
 2196|    408| use_eo:
 2197|       |    /* Don't unwrap */
 2198|    408|    dst->data = UA_new(&UA_TYPES[UA_TYPES_EXTENSIONOBJECT]);
  ------------------
  |  |  735|    408|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2199|    408|    if(!dst->data) {
  ------------------
  |  Branch (2199:8): [True: 1, False: 407]
  ------------------
 2200|      1|        UA_ExtensionObject_clear(&eo);
 2201|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2202|      1|    }
 2203|    407|    dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|    407|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2204|    407|    *(UA_ExtensionObject*)dst->data = eo;
 2205|    407|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    407|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2206|    408|}
ua_types_encoding_json.c:getArrayUnwrapType:
 1672|  7.92k|getArrayUnwrapType(ParseCtx *ctx) {
 1673|  7.92k|    UA_assert(ctx->tokens[ctx->index].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  |  399|  7.92k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1673:5): [True: 7.92k, False: 0]
  ------------------
 1674|       |
 1675|       |    /* Return early for empty arrays */
 1676|  7.92k|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 1677|  7.92k|    if(length == 0)
  ------------------
  |  Branch (1677:8): [True: 2.86k, False: 5.05k]
  ------------------
 1678|  2.86k|        return NULL;
 1679|       |
 1680|       |    /* Save the original index and go to the first array member */
 1681|  5.05k|    size_t oldIndex = ctx->index;
 1682|  5.05k|    ctx->index++;
 1683|       |
 1684|       |    /* Lookup the type for the first array member */
 1685|  5.05k|    UA_NodeId typeId;
 1686|  5.05k|    UA_NodeId_init(&typeId);
 1687|  5.05k|    const UA_DataType *typeOfBody = getExtensionObjectType(ctx);
 1688|  5.05k|    if(!typeOfBody) {
  ------------------
  |  Branch (1688:8): [True: 1.72k, False: 3.32k]
  ------------------
 1689|  1.72k|        ctx->index = oldIndex; /* Restore the index */
 1690|  1.72k|        return NULL;
 1691|  1.72k|    }
 1692|       |
 1693|       |    /* Get the TypeId encoding for faster comparison below.
 1694|       |     * Cannot fail as getExtensionObjectType already looked this up. */
 1695|  3.32k|    size_t typeIdIndex = 0;
 1696|  3.32k|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 1697|  3.32k|    (void)ret;
 1698|  3.32k|    UA_assert(ret == UA_STATUSCODE_GOOD);
  ------------------
  |  |  399|  3.32k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1698:5): [True: 3.32k, False: 0]
  ------------------
 1699|  3.32k|    const char* typeIdData = &ctx->json5[ctx->tokens[typeIdIndex].start];
 1700|  3.32k|    size_t typeIdSize = getTokenLength(&ctx->tokens[typeIdIndex]);
 1701|       |
 1702|       |    /* Loop over all members and check whether they can be unwrapped. Don't skip
 1703|       |     * the first member. We still haven't checked the encoding type. */
 1704|  7.20k|    for(size_t i = 0; i < length; i++) {
  ------------------
  |  Branch (1704:23): [True: 6.92k, False: 275]
  ------------------
 1705|       |        /* Array element must be an object */
 1706|  6.92k|        if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {
  ------------------
  |  Branch (1706:12): [True: 14, False: 6.91k]
  ------------------
 1707|     14|            ctx->index = oldIndex; /* Restore the index */
 1708|     14|            return NULL;
 1709|     14|        }
 1710|       |
 1711|       |        /* Check for non-JSON encoding */
 1712|  6.91k|        size_t encIndex = 0;
 1713|  6.91k|        ret = lookAheadForKey(ctx, UA_JSONKEY_ENCODING, &encIndex);
 1714|  6.91k|        if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  6.91k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1714:12): [True: 219, False: 6.69k]
  ------------------
 1715|    219|            ctx->index = oldIndex; /* Restore the index */
 1716|    219|            return NULL;
 1717|    219|        }
 1718|       |
 1719|       |        /* Get the type NodeId index */
 1720|  6.69k|        size_t memberTypeIdIndex = 0;
 1721|  6.69k|        ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &memberTypeIdIndex);
 1722|  6.69k|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  6.69k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1722:12): [True: 450, False: 6.24k]
  ------------------
 1723|    450|            ctx->index = oldIndex; /* Restore the index */
 1724|    450|            return NULL;
 1725|    450|        }
 1726|       |
 1727|       |        /* Is it the same type? Compare raw NodeId string */
 1728|  6.24k|        const char* memberTypeIdData = &ctx->json5[ctx->tokens[memberTypeIdIndex].start];
 1729|  6.24k|        size_t memberTypeIdSize = getTokenLength(&ctx->tokens[memberTypeIdIndex]);
 1730|  6.24k|        if(typeIdSize != memberTypeIdSize ||
  ------------------
  |  Branch (1730:12): [True: 1.19k, False: 5.05k]
  ------------------
 1731|  5.05k|           memcmp(typeIdData, memberTypeIdData, typeIdSize) != 0) {
  ------------------
  |  Branch (1731:12): [True: 1.17k, False: 3.87k]
  ------------------
 1732|  2.36k|            ctx->index = oldIndex; /* Restore the index */
 1733|  2.36k|            return NULL;
 1734|  2.36k|        }
 1735|       |
 1736|       |        /* Skip to the next array member */
 1737|  3.87k|        skipObject(ctx);
 1738|  3.87k|    }
 1739|       |
 1740|    275|    ctx->index = oldIndex; /* Restore the index */
 1741|    275|    return typeOfBody;
 1742|  3.32k|}
ua_types_encoding_json.c:getExtensionObjectType:
 1640|  5.05k|getExtensionObjectType(ParseCtx *ctx) {
 1641|  5.05k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (1641:8): [True: 198, False: 4.85k]
  ------------------
 1642|    198|        return NULL;
 1643|       |
 1644|       |    /* Get the type NodeId index */
 1645|  4.85k|    size_t typeIdIndex = 0;
 1646|  4.85k|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 1647|  4.85k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  4.85k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1647:8): [True: 577, False: 4.27k]
  ------------------
 1648|    577|        return NULL;
 1649|       |
 1650|  4.27k|    size_t oldIndex = ctx->index;
 1651|  4.27k|    ctx->index = (UA_UInt16)typeIdIndex;
 1652|       |
 1653|       |    /* Decode the type NodeId */
 1654|  4.27k|    UA_NodeId typeId;
 1655|  4.27k|    UA_NodeId_init(&typeId);
 1656|  4.27k|    ret = NodeId_decodeJson(ctx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|  4.27k|#define UA_TYPES_NODEID 16
  ------------------
 1657|  4.27k|    ctx->index = oldIndex;
 1658|  4.27k|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  4.27k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1658:8): [True: 131, False: 4.14k]
  ------------------
 1659|    131|        UA_NodeId_clear(&typeId); /* We don't have the global cleanup */
 1660|    131|        return NULL;
 1661|    131|    }
 1662|       |
 1663|       |    /* Lookup an return */
 1664|  4.14k|    const UA_DataType *type = UA_findDataTypeWithCustom(&typeId, ctx->customTypes);
 1665|  4.14k|    UA_NodeId_clear(&typeId);
 1666|  4.14k|    return type;
 1667|  4.27k|}
ua_types_encoding_json.c:Array_decodeJsonUnwrapExtensionObject:
 1746|    275|                                      const UA_DataType *type) {
 1747|    275|    size_t *size_ptr = (size_t*) dst - 1; /* Save the length pointer of the array */
 1748|    275|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 1749|       |
 1750|       |    /* Known from the previous unwrapping-check */
 1751|    275|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_ARRAY);
  ------------------
  |  |  399|    275|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1751:5): [True: 275, False: 0]
  ------------------
 1752|    275|    UA_assert(length > 0);
  ------------------
  |  |  399|    275|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1752:5): [True: 275, False: 0]
  ------------------
 1753|       |
 1754|    275|    ctx->index++; /* Go to first array member */
 1755|       |
 1756|       |    /* Allocate memory */
 1757|    275|    *dst = UA_calloc(length, type->memSize);
  ------------------
  |  |   20|    275|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1758|    275|    if(*dst == NULL)
  ------------------
  |  Branch (1758:8): [True: 1, False: 274]
  ------------------
 1759|      1|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      1|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1760|       |
 1761|       |    /* Decode array members */
 1762|    274|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    274|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1763|    274|    uintptr_t ptr = (uintptr_t)*dst;
 1764|    692|    for(size_t i = 0; i < length; i++) {
  ------------------
  |  Branch (1764:23): [True: 456, False: 236]
  ------------------
 1765|    456|        UA_assert(ctx->tokens[ctx->index].type == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  399|    456|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1765:9): [True: 456, False: 0]
  ------------------
 1766|    456|        if(type->typeKind == UA_DATATYPEKIND_STRUCTURE) {
  ------------------
  |  Branch (1766:12): [True: 9, False: 447]
  ------------------
 1767|       |            /* Decode structure in-situ in the ExtensionObject */
 1768|      9|            ret = decodeJsonStructure(ctx, (void*)ptr, type);
 1769|    447|        } else {
 1770|       |            /* Get the body field and decode it */
 1771|    447|            DecodeEntry entries[3] = {
 1772|    447|                {UA_JSONKEY_TYPEID, NULL, NULL, false, NULL},
 1773|    447|                {UA_JSONKEY_BODY, (void*)ptr, NULL, false, type},
 1774|    447|                {UA_JSONKEY_ENCODING, NULL, NULL, false, NULL}
 1775|    447|            };
 1776|    447|            ret = decodeFields(ctx, entries, 3);
 1777|    447|        }
 1778|    456|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|    456|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1778:12): [True: 38, False: 418]
  ------------------
 1779|     38|            UA_Array_delete(*dst, i+1, type);
 1780|     38|            *dst = NULL;
 1781|     38|            return ret;
 1782|     38|        }
 1783|    418|        ptr += type->memSize;
 1784|    418|    }
 1785|       |
 1786|    236|    *size_ptr = length; /* All good, set the size */
 1787|    236|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    236|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1788|    274|}
ua_types_encoding_json.c:Array_decodeJson:
 2340|  18.2k|Array_decodeJson(ParseCtx *ctx, void *dst_, const UA_DataType *type) {
 2341|  18.2k|    void **dst = (void**)dst_;
 2342|       |
 2343|       |    /* Save the length of the array */
 2344|  18.2k|    size_t *size_ptr = (size_t*) dst - 1;
 2345|       |
 2346|  18.2k|    if(currentTokenType(ctx) != CJ5_TOKEN_ARRAY)
  ------------------
  |  Branch (2346:8): [True: 15, False: 18.2k]
  ------------------
 2347|     15|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     15|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2348|       |
 2349|  18.2k|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 2350|       |
 2351|  18.2k|    ctx->index++; /* Go to first array member or to the first element after
 2352|       |                   * the array (if empty) */
 2353|       |
 2354|       |    /* Return early for empty arrays */
 2355|  18.2k|    if(length == 0) {
  ------------------
  |  Branch (2355:8): [True: 6.20k, False: 12.0k]
  ------------------
 2356|  6.20k|        *size_ptr = length;
 2357|  6.20k|        *dst = UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  6.20k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2358|  6.20k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  6.20k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2359|  6.20k|    }
 2360|       |
 2361|       |    /* Allocate memory */
 2362|  12.0k|    *dst = UA_calloc(length, type->memSize);
  ------------------
  |  |   20|  12.0k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2363|  12.0k|    if(*dst == NULL)
  ------------------
  |  Branch (2363:8): [True: 8, False: 12.0k]
  ------------------
 2364|      8|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      8|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2365|       |
 2366|       |    /* Decode array members */
 2367|  12.0k|    decodeJsonSignature decodeFunc = decodeJsonJumpTable[type->typeKind];
 2368|  12.0k|    uintptr_t ptr = (uintptr_t)*dst;
 2369|  7.13M|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (2369:23): [True: 7.12M, False: 10.9k]
  ------------------
 2370|  7.12M|        if(ctx->tokens[ctx->index].type == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2370:12): [True: 775, False: 7.12M]
  ------------------
 2371|    775|            ptr += type->memSize;
 2372|    775|            ctx->index++;
 2373|    775|            continue;
 2374|    775|        }
 2375|       |
 2376|  7.12M|        status ret = decodeFunc(ctx, (void*)ptr, type);
 2377|  7.12M|        ptr += type->memSize;
 2378|  7.12M|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  7.12M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2378:12): [True: 1.03k, False: 7.12M]
  ------------------
 2379|  1.03k|            UA_Array_delete(*dst, i+1, type);
 2380|  1.03k|            *dst = NULL;
 2381|  1.03k|            return ret;
 2382|  1.03k|        }
 2383|  7.12M|    }
 2384|       |
 2385|  10.9k|    *size_ptr = length; /* All good, set the size */
 2386|  10.9k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  10.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2387|  12.0k|}
ua_types_encoding_json.c:Variant_decodeJson:
 1914|  7.27k|DECODE_JSON(Variant) {
 1915|  7.27k|    UA_Variant *dst = (UA_Variant*)p;
 1916|  7.27k|    CHECK_NULL_SKIP; /* Treat null as an empty variant */
  ------------------
  |  | 1057|  7.27k|#define CHECK_NULL_SKIP do {                         \
  |  | 1058|  7.27k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1058:8): [True: 230, False: 7.04k]
  |  |  ------------------
  |  | 1059|    230|        ctx->index++;                                \
  |  | 1060|    230|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|    230|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1061|  7.04k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1061:14): [Folded, False: 7.04k]
  |  |  ------------------
  ------------------
 1917|  7.04k|    CHECK_OBJECT;
  ------------------
  |  | 1052|  7.04k|#define CHECK_OBJECT do {                                \
  |  | 1053|  7.04k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1053:8): [True: 15, False: 7.02k]
  |  |  ------------------
  |  | 1054|     15|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     15|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1055|  7.02k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1055:14): [Folded, False: 7.02k]
  |  |  ------------------
  ------------------
 1918|  7.02k|    return decodeJSONVariant(ctx, dst);
 1919|  7.04k|}
ua_types_encoding_json.c:decodeJsonStructure:
 2390|    486|decodeJsonStructure(ParseCtx *ctx, void *dst, const UA_DataType *type) {
 2391|       |    /* Check the recursion limit */
 2392|    486|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|    486|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (2392:8): [True: 0, False: 486]
  ------------------
 2393|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 2394|    486|    ctx->depth++;
 2395|       |
 2396|    486|    uintptr_t ptr = (uintptr_t)dst;
 2397|    486|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    486|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2398|    486|    u8 membersSize = type->membersSize;
 2399|    486|    UA_STACKARRAY(DecodeEntry, entries, membersSize);
  ------------------
  |  |  375|    486|#  define UA_STACKARRAY(TYPE, NAME, SIZE) TYPE NAME[SIZE]
  ------------------
 2400|  2.81k|    for(size_t i = 0; i < membersSize; ++i) {
  ------------------
  |  Branch (2400:23): [True: 2.32k, False: 486]
  ------------------
 2401|  2.32k|        const UA_DataTypeMember *m = &type->members[i];
 2402|  2.32k|        const UA_DataType *mt = m->memberType;
 2403|  2.32k|        entries[i].type = mt;
 2404|  2.32k|        entries[i].fieldName = m->memberName;
 2405|  2.32k|        entries[i].found = false;
 2406|  2.32k|        if(!m->isArray) {
  ------------------
  |  Branch (2406:12): [True: 1.53k, False: 788]
  ------------------
 2407|  1.53k|            ptr += m->padding;
 2408|  1.53k|            entries[i].fieldPointer = (void*)ptr;
 2409|  1.53k|            entries[i].function = NULL;
 2410|  1.53k|            ptr += mt->memSize;
 2411|  1.53k|        } else {
 2412|    788|            ptr += m->padding;
 2413|    788|            ptr += sizeof(size_t);
 2414|    788|            entries[i].fieldPointer = (void*)ptr;
 2415|    788|            entries[i].function = Array_decodeJson;
 2416|    788|            ptr += sizeof(void*);
 2417|    788|        }
 2418|  2.32k|    }
 2419|       |
 2420|    486|    ret = decodeFields(ctx, entries, membersSize);
 2421|       |
 2422|    486|    if(ctx->depth == 0)
  ------------------
  |  Branch (2422:8): [True: 0, False: 486]
  ------------------
 2423|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 2424|    486|    ctx->depth--;
 2425|    486|    return ret;
 2426|    486|}

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

UA_Guid_parse:
   86|     66|UA_Guid_parse(UA_Guid *guid, const UA_String str) {
   87|     66|    UA_StatusCode res = parse_guid(guid, str.data, str.data + str.length);
   88|     66|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|     66|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (88:8): [True: 59, False: 7]
  ------------------
   89|     59|        *guid = UA_GUID_NULL;
   90|     66|    return res;
   91|     66|}
UA_NodeId_parseEx:
  323|  23.5k|                  const UA_NamespaceMapping *nsMapping) {
  324|  23.5k|    UA_StatusCode res =
  325|  23.5k|        parse_nodeid(id, str.data, str.data+str.length, UA_ESCAPING_NONE, nsMapping);
  326|  23.5k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  23.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (326:8): [True: 403, False: 23.1k]
  ------------------
  327|    403|        UA_NodeId_clear(id);
  328|  23.5k|    return res;
  329|  23.5k|}
UA_ExpandedNodeId_parseEx:
  671|  3.65k|                          size_t serverUrisSize, const UA_String *serverUris) {
  672|  3.65k|    UA_StatusCode res =
  673|  3.65k|        parse_expandednodeid(id, str.data, str.data + str.length, UA_ESCAPING_NONE,
  674|  3.65k|                             nsMapping, serverUrisSize, serverUris);
  675|  3.65k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  3.65k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (675:8): [True: 493, False: 3.16k]
  ------------------
  676|    493|        UA_ExpandedNodeId_clear(id);
  677|  3.65k|    return res;
  678|  3.65k|}
UA_QualifiedName_parseEx:
  831|  19.3k|                         const UA_NamespaceMapping *nsMapping) {
  832|  19.3k|    const u8 *pos = str.data;
  833|  19.3k|    const u8 *end = str.data + str.length;
  834|  19.3k|    UA_StatusCode res = parse_qn(qn, pos, end, UA_ESCAPING_NONE, nsMapping, 0);
  835|  19.3k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  19.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (835:8): [True: 1, False: 19.3k]
  ------------------
  836|      1|        UA_QualifiedName_clear(qn);
  837|  19.3k|    return res;
  838|  19.3k|}
ua_types_lex.c:parse_guid:
   50|     93|parse_guid(UA_Guid *guid, const UA_Byte *s, const UA_Byte *e) {
   51|     93|    size_t len = (size_t)(e - s);
   52|     93|    if(len != 36 || s[8] != '-' || s[13] != '-' || s[23] != '-')
  ------------------
  |  Branch (52:8): [True: 31, False: 62]
  |  Branch (52:21): [True: 12, False: 50]
  |  Branch (52:36): [True: 3, False: 47]
  |  Branch (52:52): [True: 3, False: 44]
  ------------------
   53|     49|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     49|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   54|       |
   55|     44|    UA_UInt32 tmp;
   56|     44|    if(UA_readNumberWithBase(s, 8, &tmp, 16) != 8)
  ------------------
  |  Branch (56:8): [True: 9, False: 35]
  ------------------
   57|      9|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   58|     35|    guid->data1 = tmp;
   59|       |
   60|     35|    if(UA_readNumberWithBase(&s[9], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (60:8): [True: 5, False: 30]
  ------------------
   61|      5|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   62|     30|    guid->data2 = (UA_UInt16)tmp;
   63|       |
   64|     30|    if(UA_readNumberWithBase(&s[14], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (64:8): [True: 4, False: 26]
  ------------------
   65|      4|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   66|     26|    guid->data3 = (UA_UInt16)tmp;
   67|       |
   68|     26|    if(UA_readNumberWithBase(&s[19], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (68:8): [True: 3, False: 23]
  ------------------
   69|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   70|     23|    guid->data4[0] = (UA_Byte)tmp;
   71|       |
   72|     23|    if(UA_readNumberWithBase(&s[21], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (72:8): [True: 3, False: 20]
  ------------------
   73|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   74|     20|    guid->data4[1] = (UA_Byte)tmp;
   75|       |
   76|     97|    for(size_t pos = 2, spos = 24; pos < 8; pos++, spos += 2) {
  ------------------
  |  Branch (76:36): [True: 88, False: 9]
  ------------------
   77|     88|        if(UA_readNumberWithBase(&s[spos], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (77:12): [True: 11, False: 77]
  ------------------
   78|     11|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     11|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   79|     77|        guid->data4[pos] = (UA_Byte)tmp;
   80|     77|    }
   81|       |
   82|      9|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      9|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   83|     20|}
ua_types_lex.c:parse_nodeid:
  148|  23.5k|             UA_Escaping idEsc, const UA_NamespaceMapping *nsMapping) {
  149|  23.5k|    *id = UA_NODEID_NULL; /* Reset the NodeId */
  150|  23.5k|    LexContext context;
  151|  23.5k|    memset(&context, 0, sizeof(LexContext));
  152|  23.5k|    UA_Byte *begin = (UA_Byte*)(uintptr_t)pos;
  153|  23.5k|    const u8 *ns = NULL, *nsu = NULL, *body = NULL;
  154|       |
  155|       |    
  156|  23.5k|{
  157|  23.5k|	u8 yych;
  158|  23.5k|	yych = YYPEEK();
  ------------------
  |  |   33|  23.5k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  23.5k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  23.5k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 23.5k, False: 10]
  |  |  ------------------
  ------------------
  159|  23.5k|	switch (yych) {
  160|    426|		case 'b':
  ------------------
  |  Branch (160:3): [True: 426, False: 23.1k]
  ------------------
  161|    457|		case 'g':
  ------------------
  |  Branch (161:3): [True: 31, False: 23.5k]
  ------------------
  162|  15.2k|		case 'i':
  ------------------
  |  Branch (162:3): [True: 14.7k, False: 8.78k]
  ------------------
  163|  21.1k|		case 's':
  ------------------
  |  Branch (163:3): [True: 5.91k, False: 17.6k]
  ------------------
  164|  21.1k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  21.1k|#define YYSTAGN(t) t = NULL
  ------------------
  165|  21.1k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  21.1k|#define YYSTAGN(t) t = NULL
  ------------------
  166|  21.1k|			goto yy3;
  167|  2.34k|		case 'n': goto yy4;
  ------------------
  |  Branch (167:3): [True: 2.34k, False: 21.2k]
  ------------------
  168|     73|		default: goto yy1;
  ------------------
  |  Branch (168:3): [True: 73, False: 23.4k]
  ------------------
  169|  23.5k|	}
  170|     73|yy1:
  171|     73|	YYSKIP();
  ------------------
  |  |   35|     73|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|     73|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  172|    319|yy2:
  173|    319|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   44|    319|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  174|  21.1k|yy3:
  175|  21.1k|	YYSKIP();
  ------------------
  |  |   35|  21.1k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  21.1k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  176|  21.1k|	yych = YYPEEK();
  ------------------
  |  |   33|  21.1k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  21.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  21.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 21.1k, False: 12]
  |  |  ------------------
  ------------------
  177|  21.1k|	switch (yych) {
  178|  21.1k|		case '=': goto yy5;
  ------------------
  |  Branch (178:3): [True: 21.1k, False: 26]
  ------------------
  179|     26|		default: goto yy2;
  ------------------
  |  Branch (179:3): [True: 26, False: 21.1k]
  ------------------
  180|  21.1k|	}
  181|  2.34k|yy4:
  182|  2.34k|	YYSKIP();
  ------------------
  |  |   35|  2.34k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.34k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  183|  2.34k|	YYBACKUP();
  ------------------
  |  |   36|  2.34k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  2.34k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  2.34k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  184|  2.34k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.34k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.34k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.33k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.33k, False: 3]
  |  |  ------------------
  ------------------
  185|  2.34k|	switch (yych) {
  186|  2.32k|		case 's': goto yy6;
  ------------------
  |  Branch (186:3): [True: 2.32k, False: 15]
  ------------------
  187|     15|		default: goto yy2;
  ------------------
  |  Branch (187:3): [True: 15, False: 2.32k]
  ------------------
  188|  2.34k|	}
  189|  23.2k|yy5:
  190|  23.2k|	YYSKIP();
  ------------------
  |  |   35|  23.2k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  23.2k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  191|  23.2k|	nsu = context.yyt2;
  192|  23.2k|	ns = context.yyt1;
  193|  23.2k|	YYSTAGP(body);
  ------------------
  |  |   38|  23.2k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  23.2k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  194|  23.2k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  23.2k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  195|  23.2k|	{ goto match; }
  196|  2.32k|yy6:
  197|  2.32k|	YYSKIP();
  ------------------
  |  |   35|  2.32k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.32k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  198|  2.32k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.32k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.32k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.32k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.32k, False: 5]
  |  |  ------------------
  ------------------
  199|  2.32k|	switch (yych) {
  200|  1.16k|		case '=': goto yy8;
  ------------------
  |  Branch (200:3): [True: 1.16k, False: 1.16k]
  ------------------
  201|  1.15k|		case 'u': goto yy9;
  ------------------
  |  Branch (201:3): [True: 1.15k, False: 1.17k]
  ------------------
  202|      6|		default: goto yy7;
  ------------------
  |  Branch (202:3): [True: 6, False: 2.32k]
  ------------------
  203|  2.32k|	}
  204|    205|yy7:
  205|    205|	YYRESTORE();
  ------------------
  |  |   37|    205|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|    205|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|    205|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  206|    205|	goto yy2;
  207|  1.16k|yy8:
  208|  1.16k|	YYSKIP();
  ------------------
  |  |   35|  1.16k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.16k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  209|  1.16k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.16k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.16k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.16k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.16k, False: 5]
  |  |  ------------------
  ------------------
  210|  1.16k|	switch (yych) {
  211|    345|		case '0':
  ------------------
  |  Branch (211:3): [True: 345, False: 821]
  ------------------
  212|    712|		case '1':
  ------------------
  |  Branch (212:3): [True: 367, False: 799]
  ------------------
  213|    858|		case '2':
  ------------------
  |  Branch (213:3): [True: 146, False: 1.02k]
  ------------------
  214|    886|		case '3':
  ------------------
  |  Branch (214:3): [True: 28, False: 1.13k]
  ------------------
  215|    952|		case '4':
  ------------------
  |  Branch (215:3): [True: 66, False: 1.10k]
  ------------------
  216|  1.03k|		case '5':
  ------------------
  |  Branch (216:3): [True: 81, False: 1.08k]
  ------------------
  217|  1.07k|		case '6':
  ------------------
  |  Branch (217:3): [True: 44, False: 1.12k]
  ------------------
  218|  1.09k|		case '7':
  ------------------
  |  Branch (218:3): [True: 21, False: 1.14k]
  ------------------
  219|  1.13k|		case '8':
  ------------------
  |  Branch (219:3): [True: 33, False: 1.13k]
  ------------------
  220|  1.14k|		case '9':
  ------------------
  |  Branch (220:3): [True: 17, False: 1.14k]
  ------------------
  221|  1.14k|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|  1.14k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.14k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  222|  1.14k|			goto yy10;
  223|     18|		default: goto yy7;
  ------------------
  |  Branch (223:3): [True: 18, False: 1.14k]
  ------------------
  224|  1.16k|	}
  225|  1.15k|yy9:
  226|  1.15k|	YYSKIP();
  ------------------
  |  |   35|  1.15k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.15k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  227|  1.15k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.15k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.15k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.15k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.15k, False: 3]
  |  |  ------------------
  ------------------
  228|  1.15k|	switch (yych) {
  229|  1.14k|		case '=': goto yy11;
  ------------------
  |  Branch (229:3): [True: 1.14k, False: 12]
  ------------------
  230|     12|		default: goto yy7;
  ------------------
  |  Branch (230:3): [True: 12, False: 1.14k]
  ------------------
  231|  1.15k|	}
  232|  4.47k|yy10:
  233|  4.47k|	YYSKIP();
  ------------------
  |  |   35|  4.47k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  4.47k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  234|  4.47k|	yych = YYPEEK();
  ------------------
  |  |   33|  4.47k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.47k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.37k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 4.37k, False: 105]
  |  |  ------------------
  ------------------
  235|  4.47k|	switch (yych) {
  236|    658|		case '0':
  ------------------
  |  Branch (236:3): [True: 658, False: 3.81k]
  ------------------
  237|    971|		case '1':
  ------------------
  |  Branch (237:3): [True: 313, False: 4.16k]
  ------------------
  238|  1.23k|		case '2':
  ------------------
  |  Branch (238:3): [True: 267, False: 4.21k]
  ------------------
  239|  1.55k|		case '3':
  ------------------
  |  Branch (239:3): [True: 317, False: 4.16k]
  ------------------
  240|  1.81k|		case '4':
  ------------------
  |  Branch (240:3): [True: 260, False: 4.21k]
  ------------------
  241|  2.04k|		case '5':
  ------------------
  |  Branch (241:3): [True: 230, False: 4.24k]
  ------------------
  242|  2.31k|		case '6':
  ------------------
  |  Branch (242:3): [True: 268, False: 4.20k]
  ------------------
  243|  2.59k|		case '7':
  ------------------
  |  Branch (243:3): [True: 280, False: 4.19k]
  ------------------
  244|  2.96k|		case '8':
  ------------------
  |  Branch (244:3): [True: 374, False: 4.10k]
  ------------------
  245|  3.32k|		case '9': goto yy10;
  ------------------
  |  Branch (245:3): [True: 362, False: 4.11k]
  ------------------
  246|  1.04k|		case ';':
  ------------------
  |  Branch (246:3): [True: 1.04k, False: 3.43k]
  ------------------
  247|  1.04k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  1.04k|#define YYSTAGN(t) t = NULL
  ------------------
  248|  1.04k|			goto yy12;
  249|    106|		default: goto yy7;
  ------------------
  |  Branch (249:3): [True: 106, False: 4.37k]
  ------------------
  250|  4.47k|	}
  251|  1.14k|yy11:
  252|  1.14k|	YYSKIP();
  ------------------
  |  |   35|  1.14k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.14k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  253|  1.14k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.14k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.14k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.13k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.13k, False: 4]
  |  |  ------------------
  ------------------
  254|  1.14k|	switch (yych) {
  255|      4|		case 0x00: goto yy7;
  ------------------
  |  Branch (255:3): [True: 4, False: 1.13k]
  ------------------
  256|    546|		case ';':
  ------------------
  |  Branch (256:3): [True: 546, False: 596]
  ------------------
  257|    546|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    546|#define YYSTAGN(t) t = NULL
  ------------------
  258|    546|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    546|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    546|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  259|    546|			goto yy12;
  260|    592|		default:
  ------------------
  |  Branch (260:3): [True: 592, False: 550]
  ------------------
  261|    592|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    592|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    592|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  262|    592|			goto yy13;
  263|  1.14k|	}
  264|  2.16k|yy12:
  265|  2.16k|	YYSKIP();
  ------------------
  |  |   35|  2.16k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.16k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  266|  2.16k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.16k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.16k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.15k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.15k, False: 15]
  |  |  ------------------
  ------------------
  267|  2.16k|	switch (yych) {
  268|    197|		case 'b':
  ------------------
  |  Branch (268:3): [True: 197, False: 1.97k]
  ------------------
  269|    391|		case 'g':
  ------------------
  |  Branch (269:3): [True: 194, False: 1.97k]
  ------------------
  270|    722|		case 'i':
  ------------------
  |  Branch (270:3): [True: 331, False: 1.83k]
  ------------------
  271|  2.15k|		case 's': goto yy14;
  ------------------
  |  Branch (271:3): [True: 1.42k, False: 739]
  ------------------
  272|     17|		default: goto yy7;
  ------------------
  |  Branch (272:3): [True: 17, False: 2.15k]
  ------------------
  273|  2.16k|	}
  274|  2.71k|yy13:
  275|  2.71k|	YYSKIP();
  ------------------
  |  |   35|  2.71k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.71k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  276|  2.71k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.71k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.71k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.70k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.70k, False: 13]
  |  |  ------------------
  ------------------
  277|  2.71k|	switch (yych) {
  278|     13|		case 0x00: goto yy7;
  ------------------
  |  Branch (278:3): [True: 13, False: 2.70k]
  ------------------
  279|    579|		case ';':
  ------------------
  |  Branch (279:3): [True: 579, False: 2.13k]
  ------------------
  280|    579|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    579|#define YYSTAGN(t) t = NULL
  ------------------
  281|    579|			goto yy12;
  282|  2.12k|		default: goto yy13;
  ------------------
  |  Branch (282:3): [True: 2.12k, False: 592]
  ------------------
  283|  2.71k|	}
  284|  2.15k|yy14:
  285|  2.15k|	YYSKIP();
  ------------------
  |  |   35|  2.15k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.15k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  286|  2.15k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.15k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.15k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.12k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.12k, False: 28]
  |  |  ------------------
  ------------------
  287|  2.15k|	switch (yych) {
  288|  2.12k|		case '=': goto yy5;
  ------------------
  |  Branch (288:3): [True: 2.12k, False: 29]
  ------------------
  289|     29|		default: goto yy7;
  ------------------
  |  Branch (289:3): [True: 29, False: 2.12k]
  ------------------
  290|  2.15k|	}
  291|  2.15k|}
  292|       |
  293|       |
  294|  23.2k| match:
  295|  23.2k|    if(nsu) {
  ------------------
  |  Branch (295:8): [True: 1.09k, False: 22.1k]
  ------------------
  296|       |        /* NamespaceUri */
  297|  1.09k|        UA_String nsUri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  298|  1.09k|        UA_StatusCode res = escapedUri2Index(nsUri, &id->namespaceIndex, nsMapping);
  299|  1.09k|        if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  1.09k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (299:12): [True: 1.09k, False: 0]
  ------------------
  300|       |            /* Return the entire NodeId string s=... */
  301|  1.09k|            UA_String total = {(size_t)((const UA_Byte*)end - begin), begin};
  302|  1.09k|            id->identifierType = UA_NODEIDTYPE_STRING;
  303|  1.09k|            return UA_String_copy(&total, &id->identifier.string);
  304|  1.09k|        }
  305|  22.1k|    } else if(ns) {
  ------------------
  |  Branch (305:15): [True: 1.02k, False: 21.1k]
  ------------------
  306|       |        /* NamespaceIndex */
  307|  1.02k|        UA_UInt32 tmp;
  308|  1.02k|        size_t len = (size_t)(body - 1 - ns);
  309|  1.02k|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (309:12): [True: 0, False: 1.02k]
  ------------------
  310|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  311|  1.02k|        id->namespaceIndex = (UA_UInt16)tmp;
  312|  1.02k|        if(nsMapping)
  ------------------
  |  Branch (312:12): [True: 0, False: 1.02k]
  ------------------
  313|      0|            id->namespaceIndex =
  314|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->namespaceIndex);
  315|  1.02k|    }
  316|       |
  317|       |    /* From the current position until the end */
  318|  22.1k|    return parse_nodeid_body(id, body, end, idEsc);
  319|  23.2k|}
ua_types_lex.c:escapedUri2Index:
   95|  1.99k|                 const UA_NamespaceMapping *nsMapping) {
   96|  1.99k|    if(!nsMapping)
  ------------------
  |  Branch (96:8): [True: 1.99k, False: 0]
  ------------------
   97|  1.99k|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|  1.99k|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   98|      0|    UA_String tmp = uri; 
   99|      0|    status res = UA_String_unescape(&uri, true, UA_ESCAPING_PERCENT);
  100|      0|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (100:8): [True: 0, False: 0]
  ------------------
  101|      0|        return res;
  102|      0|    res = UA_NamespaceMapping_uri2Index(nsMapping, uri, nsIndex);
  103|      0|    if(tmp.data != uri.data)
  ------------------
  |  Branch (103:8): [True: 0, False: 0]
  ------------------
  104|      0|        UA_String_clear(&uri);
  105|      0|    return res;
  106|      0|}
ua_types_lex.c:parse_nodeid_body:
  109|  24.3k|parse_nodeid_body(UA_NodeId *id, const u8 *body, const u8 *end, UA_Escaping esc) {
  110|  24.3k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  24.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  111|  24.3k|    UA_String str = {(size_t)(end - (body+2)), (UA_Byte*)(uintptr_t)body + 2};
  112|  24.3k|    switch(*body) {
  113|  15.3k|    case 'i':
  ------------------
  |  Branch (113:5): [True: 15.3k, False: 8.97k]
  ------------------
  114|  15.3k|        id->identifierType = UA_NODEIDTYPE_NUMERIC;
  115|  15.3k|        if(UA_readNumber(str.data, str.length, &id->identifier.numeric) != str.length)
  ------------------
  |  Branch (115:12): [True: 52, False: 15.2k]
  ------------------
  116|     52|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     52|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  117|  15.3k|        break;
  118|  7.82k|    case 's':
  ------------------
  |  Branch (118:5): [True: 7.82k, False: 16.4k]
  ------------------
  119|  7.82k|        id->identifierType = UA_NODEIDTYPE_STRING;
  120|  7.82k|        res |= UA_String_copy(&str, &id->identifier.string);
  121|  7.82k|        res |= UA_String_unescape(&id->identifier.string, false, esc);
  122|  7.82k|        break;
  123|     27|    case 'g':
  ------------------
  |  Branch (123:5): [True: 27, False: 24.2k]
  ------------------
  124|     27|        id->identifierType = UA_NODEIDTYPE_GUID;
  125|     27|        res = parse_guid(&id->identifier.guid, str.data, end);
  126|     27|        break;
  127|  1.12k|    case 'b':
  ------------------
  |  Branch (127:5): [True: 1.12k, False: 23.1k]
  ------------------
  128|       |        /* For percent-escaping, base64url bytestring encoding is used. That
  129|       |         * doesn't need to be escaped here. The and-escaping is not applied to
  130|       |         * the NodeId identifier part. */
  131|  1.12k|        id->identifierType = UA_NODEIDTYPE_BYTESTRING;
  132|  1.12k|        id->identifier.byteString.data =
  133|  1.12k|            UA_unbase64(str.data, str.length, &id->identifier.byteString.length);
  134|  1.12k|        if(!id->identifier.byteString.data) {
  ------------------
  |  Branch (134:12): [True: 20, False: 1.10k]
  ------------------
  135|     20|            UA_assert(id->identifier.byteString.length == 0);
  ------------------
  |  |  399|     20|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (135:13): [True: 20, False: 0]
  ------------------
  136|     20|            res = UA_STATUSCODE_BADDECODINGERROR; /* Returned on error by UA_unbase64 */
  ------------------
  |  |   44|     20|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  137|     20|        }
  138|  1.12k|        break;
  139|  1.12k|    default:
  ------------------
  |  Branch (139:5): [True: 0, False: 24.3k]
  ------------------
  140|      0|        res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  141|      0|        break;
  142|  24.3k|    }
  143|  24.3k|    return res;
  144|  24.3k|}
ua_types_lex.c:parse_expandednodeid:
  339|  3.65k|                     size_t serverUrisSize, const UA_String *serverUris) {
  340|  3.65k|    *id = UA_EXPANDEDNODEID_NULL; /* Reset the NodeId */
  341|  3.65k|    LexContext context;
  342|  3.65k|    memset(&context, 0, sizeof(LexContext));
  343|  3.65k|    const u8 *svr = NULL, *sve = NULL, *svu = NULL,
  344|  3.65k|        *nsu = NULL, *ns = NULL, *body = NULL, *begin = pos;
  345|       |
  346|       |    
  347|  3.65k|{
  348|  3.65k|	u8 yych;
  349|  3.65k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.65k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.65k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.65k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.65k, False: 5]
  |  |  ------------------
  ------------------
  350|  3.65k|	switch (yych) {
  351|    333|		case 'b':
  ------------------
  |  Branch (351:3): [True: 333, False: 3.32k]
  ------------------
  352|    339|		case 'g':
  ------------------
  |  Branch (352:3): [True: 6, False: 3.64k]
  ------------------
  353|    555|		case 'i':
  ------------------
  |  Branch (353:3): [True: 216, False: 3.43k]
  ------------------
  354|    555|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    555|#define YYSTAGN(t) t = NULL
  ------------------
  355|    555|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|    555|#define YYSTAGN(t) t = NULL
  ------------------
  356|    555|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    555|#define YYSTAGN(t) t = NULL
  ------------------
  357|    555|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|    555|#define YYSTAGN(t) t = NULL
  ------------------
  358|    555|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    555|#define YYSTAGN(t) t = NULL
  ------------------
  359|    555|			goto yy18;
  360|  1.13k|		case 'n':
  ------------------
  |  Branch (360:3): [True: 1.13k, False: 2.52k]
  ------------------
  361|  1.13k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  1.13k|#define YYSTAGN(t) t = NULL
  ------------------
  362|  1.13k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  1.13k|#define YYSTAGN(t) t = NULL
  ------------------
  363|  1.13k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  1.13k|#define YYSTAGN(t) t = NULL
  ------------------
  364|  1.13k|			goto yy19;
  365|  1.96k|		case 's':
  ------------------
  |  Branch (365:3): [True: 1.96k, False: 1.69k]
  ------------------
  366|  1.96k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  1.96k|#define YYSTAGN(t) t = NULL
  ------------------
  367|  1.96k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  1.96k|#define YYSTAGN(t) t = NULL
  ------------------
  368|  1.96k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  1.96k|#define YYSTAGN(t) t = NULL
  ------------------
  369|  1.96k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  1.96k|#define YYSTAGN(t) t = NULL
  ------------------
  370|  1.96k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  1.96k|#define YYSTAGN(t) t = NULL
  ------------------
  371|  1.96k|			goto yy20;
  372|      6|		default: goto yy16;
  ------------------
  |  Branch (372:3): [True: 6, False: 3.64k]
  ------------------
  373|  3.65k|	}
  374|      6|yy16:
  375|      6|	YYSKIP();
  ------------------
  |  |   35|      6|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      6|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  376|    478|yy17:
  377|    478|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   44|    478|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  378|    555|yy18:
  379|    555|	YYSKIP();
  ------------------
  |  |   35|    555|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    555|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  380|    555|	yych = YYPEEK();
  ------------------
  |  |   33|    555|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    555|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    544|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 544, False: 11]
  |  |  ------------------
  ------------------
  381|    555|	switch (yych) {
  382|    529|		case '=': goto yy21;
  ------------------
  |  Branch (382:3): [True: 529, False: 26]
  ------------------
  383|     26|		default: goto yy17;
  ------------------
  |  Branch (383:3): [True: 26, False: 529]
  ------------------
  384|    555|	}
  385|  1.13k|yy19:
  386|  1.13k|	YYSKIP();
  ------------------
  |  |   35|  1.13k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.13k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  387|  1.13k|	YYBACKUP();
  ------------------
  |  |   36|  1.13k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  1.13k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.13k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  388|  1.13k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.13k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.13k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.13k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.13k, False: 1]
  |  |  ------------------
  ------------------
  389|  1.13k|	switch (yych) {
  390|  1.12k|		case 's': goto yy22;
  ------------------
  |  Branch (390:3): [True: 1.12k, False: 14]
  ------------------
  391|     14|		default: goto yy17;
  ------------------
  |  Branch (391:3): [True: 14, False: 1.12k]
  ------------------
  392|  1.13k|	}
  393|  1.96k|yy20:
  394|  1.96k|	YYSKIP();
  ------------------
  |  |   35|  1.96k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.96k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  395|  1.96k|	YYBACKUP();
  ------------------
  |  |   36|  1.96k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  1.96k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.96k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  396|  1.96k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.96k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.96k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.95k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.95k, False: 1]
  |  |  ------------------
  ------------------
  397|  1.96k|	switch (yych) {
  398|    203|		case '=': goto yy21;
  ------------------
  |  Branch (398:3): [True: 203, False: 1.75k]
  ------------------
  399|  1.75k|		case 'v': goto yy24;
  ------------------
  |  Branch (399:3): [True: 1.75k, False: 208]
  ------------------
  400|      5|		default: goto yy17;
  ------------------
  |  Branch (400:3): [True: 5, False: 1.95k]
  ------------------
  401|  1.96k|	}
  402|  3.17k|yy21:
  403|  3.17k|	YYSKIP();
  ------------------
  |  |   35|  3.17k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.17k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  404|  3.17k|	svr = context.yyt5;
  405|  3.17k|	svu = context.yyt1;
  406|  3.17k|	sve = context.yyt2;
  407|  3.17k|	ns = context.yyt3;
  408|  3.17k|	nsu = context.yyt4;
  409|  3.17k|	YYSTAGP(body);
  ------------------
  |  |   38|  3.17k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  3.17k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  410|  3.17k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  3.17k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  411|  3.17k|	{ goto match; }
  412|  1.58k|yy22:
  413|  1.58k|	YYSKIP();
  ------------------
  |  |   35|  1.58k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.58k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  414|  1.58k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.58k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.58k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.58k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.58k, False: 8]
  |  |  ------------------
  ------------------
  415|  1.58k|	switch (yych) {
  416|    366|		case '=': goto yy25;
  ------------------
  |  Branch (416:3): [True: 366, False: 1.22k]
  ------------------
  417|  1.21k|		case 'u': goto yy26;
  ------------------
  |  Branch (417:3): [True: 1.21k, False: 378]
  ------------------
  418|     12|		default: goto yy23;
  ------------------
  |  Branch (418:3): [True: 12, False: 1.57k]
  ------------------
  419|  1.58k|	}
  420|    427|yy23:
  421|    427|	YYRESTORE();
  ------------------
  |  |   37|    427|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|    427|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|    427|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  422|    427|	goto yy17;
  423|  1.75k|yy24:
  424|  1.75k|	YYSKIP();
  ------------------
  |  |   35|  1.75k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.75k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  425|  1.75k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.75k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.75k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.75k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.75k, False: 1]
  |  |  ------------------
  ------------------
  426|  1.75k|	switch (yych) {
  427|    669|		case 'r': goto yy27;
  ------------------
  |  Branch (427:3): [True: 669, False: 1.08k]
  ------------------
  428|  1.08k|		case 'u': goto yy28;
  ------------------
  |  Branch (428:3): [True: 1.08k, False: 672]
  ------------------
  429|      3|		default: goto yy23;
  ------------------
  |  Branch (429:3): [True: 3, False: 1.74k]
  ------------------
  430|  1.75k|	}
  431|    366|yy25:
  432|    366|	YYSKIP();
  ------------------
  |  |   35|    366|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    366|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  433|    366|	yych = YYPEEK();
  ------------------
  |  |   33|    366|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    366|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    365|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 365, False: 1]
  |  |  ------------------
  ------------------
  434|    366|	switch (yych) {
  435|    168|		case '0':
  ------------------
  |  Branch (435:3): [True: 168, False: 198]
  ------------------
  436|    194|		case '1':
  ------------------
  |  Branch (436:3): [True: 26, False: 340]
  ------------------
  437|    210|		case '2':
  ------------------
  |  Branch (437:3): [True: 16, False: 350]
  ------------------
  438|    240|		case '3':
  ------------------
  |  Branch (438:3): [True: 30, False: 336]
  ------------------
  439|    254|		case '4':
  ------------------
  |  Branch (439:3): [True: 14, False: 352]
  ------------------
  440|    263|		case '5':
  ------------------
  |  Branch (440:3): [True: 9, False: 357]
  ------------------
  441|    342|		case '6':
  ------------------
  |  Branch (441:3): [True: 79, False: 287]
  ------------------
  442|    349|		case '7':
  ------------------
  |  Branch (442:3): [True: 7, False: 359]
  ------------------
  443|    358|		case '8':
  ------------------
  |  Branch (443:3): [True: 9, False: 357]
  ------------------
  444|    363|		case '9':
  ------------------
  |  Branch (444:3): [True: 5, False: 361]
  ------------------
  445|    363|			YYSTAGP(context.yyt3);
  ------------------
  |  |   38|    363|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    363|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  446|    363|			goto yy29;
  447|      3|		default: goto yy23;
  ------------------
  |  Branch (447:3): [True: 3, False: 363]
  ------------------
  448|    366|	}
  449|  1.21k|yy26:
  450|  1.21k|	YYSKIP();
  ------------------
  |  |   35|  1.21k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.21k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  451|  1.21k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.21k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.21k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.21k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.21k, False: 1]
  |  |  ------------------
  ------------------
  452|  1.21k|	switch (yych) {
  453|  1.20k|		case '=': goto yy30;
  ------------------
  |  Branch (453:3): [True: 1.20k, False: 4]
  ------------------
  454|      4|		default: goto yy23;
  ------------------
  |  Branch (454:3): [True: 4, False: 1.20k]
  ------------------
  455|  1.21k|	}
  456|    669|yy27:
  457|    669|	YYSKIP();
  ------------------
  |  |   35|    669|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    669|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  458|    669|	yych = YYPEEK();
  ------------------
  |  |   33|    669|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    669|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    668|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 668, False: 1]
  |  |  ------------------
  ------------------
  459|    669|	switch (yych) {
  460|    652|		case '=': goto yy31;
  ------------------
  |  Branch (460:3): [True: 652, False: 17]
  ------------------
  461|     17|		default: goto yy23;
  ------------------
  |  Branch (461:3): [True: 17, False: 652]
  ------------------
  462|    669|	}
  463|  1.08k|yy28:
  464|  1.08k|	YYSKIP();
  ------------------
  |  |   35|  1.08k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.08k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  465|  1.08k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.08k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.08k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.07k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.07k, False: 2]
  |  |  ------------------
  ------------------
  466|  1.08k|	switch (yych) {
  467|  1.06k|		case '=': goto yy32;
  ------------------
  |  Branch (467:3): [True: 1.06k, False: 16]
  ------------------
  468|     16|		default: goto yy23;
  ------------------
  |  Branch (468:3): [True: 16, False: 1.06k]
  ------------------
  469|  1.08k|	}
  470|  8.70k|yy29:
  471|  8.70k|	YYSKIP();
  ------------------
  |  |   35|  8.70k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  8.70k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  472|  8.70k|	yych = YYPEEK();
  ------------------
  |  |   33|  8.70k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  8.70k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  8.61k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 8.61k, False: 85]
  |  |  ------------------
  ------------------
  473|  8.70k|	switch (yych) {
  474|  5.51k|		case '0':
  ------------------
  |  Branch (474:3): [True: 5.51k, False: 3.18k]
  ------------------
  475|  5.77k|		case '1':
  ------------------
  |  Branch (475:3): [True: 261, False: 8.43k]
  ------------------
  476|  6.06k|		case '2':
  ------------------
  |  Branch (476:3): [True: 282, False: 8.41k]
  ------------------
  477|  6.37k|		case '3':
  ------------------
  |  Branch (477:3): [True: 318, False: 8.38k]
  ------------------
  478|  6.66k|		case '4':
  ------------------
  |  Branch (478:3): [True: 286, False: 8.41k]
  ------------------
  479|  6.91k|		case '5':
  ------------------
  |  Branch (479:3): [True: 248, False: 8.45k]
  ------------------
  480|  7.23k|		case '6':
  ------------------
  |  Branch (480:3): [True: 327, False: 8.37k]
  ------------------
  481|  7.51k|		case '7':
  ------------------
  |  Branch (481:3): [True: 276, False: 8.42k]
  ------------------
  482|  7.80k|		case '8':
  ------------------
  |  Branch (482:3): [True: 285, False: 8.41k]
  ------------------
  483|  8.33k|		case '9': goto yy29;
  ------------------
  |  Branch (483:3): [True: 537, False: 8.16k]
  ------------------
  484|    261|		case ';':
  ------------------
  |  Branch (484:3): [True: 261, False: 8.43k]
  ------------------
  485|    261|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|    261|#define YYSTAGN(t) t = NULL
  ------------------
  486|    261|			goto yy33;
  487|    102|		default: goto yy23;
  ------------------
  |  Branch (487:3): [True: 102, False: 8.59k]
  ------------------
  488|  8.70k|	}
  489|  1.20k|yy30:
  490|  1.20k|	YYSKIP();
  ------------------
  |  |   35|  1.20k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.20k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  491|  1.20k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.20k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.20k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.20k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.20k, False: 2]
  |  |  ------------------
  ------------------
  492|  1.20k|	switch (yych) {
  493|      2|		case 0x00: goto yy23;
  ------------------
  |  Branch (493:3): [True: 2, False: 1.20k]
  ------------------
  494|    451|		case ';':
  ------------------
  |  Branch (494:3): [True: 451, False: 756]
  ------------------
  495|    451|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    451|#define YYSTAGN(t) t = NULL
  ------------------
  496|    451|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|    451|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    451|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  497|    451|			goto yy33;
  498|    754|		default:
  ------------------
  |  Branch (498:3): [True: 754, False: 453]
  ------------------
  499|    754|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|    754|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    754|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  500|    754|			goto yy34;
  501|  1.20k|	}
  502|    652|yy31:
  503|    652|	YYSKIP();
  ------------------
  |  |   35|    652|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    652|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  504|    652|	yych = YYPEEK();
  ------------------
  |  |   33|    652|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    652|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    651|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 651, False: 1]
  |  |  ------------------
  ------------------
  505|    652|	switch (yych) {
  506|    329|		case '0':
  ------------------
  |  Branch (506:3): [True: 329, False: 323]
  ------------------
  507|    389|		case '1':
  ------------------
  |  Branch (507:3): [True: 60, False: 592]
  ------------------
  508|    426|		case '2':
  ------------------
  |  Branch (508:3): [True: 37, False: 615]
  ------------------
  509|    462|		case '3':
  ------------------
  |  Branch (509:3): [True: 36, False: 616]
  ------------------
  510|    477|		case '4':
  ------------------
  |  Branch (510:3): [True: 15, False: 637]
  ------------------
  511|    562|		case '5':
  ------------------
  |  Branch (511:3): [True: 85, False: 567]
  ------------------
  512|    588|		case '6':
  ------------------
  |  Branch (512:3): [True: 26, False: 626]
  ------------------
  513|    618|		case '7':
  ------------------
  |  Branch (513:3): [True: 30, False: 622]
  ------------------
  514|    630|		case '8':
  ------------------
  |  Branch (514:3): [True: 12, False: 640]
  ------------------
  515|    636|		case '9':
  ------------------
  |  Branch (515:3): [True: 6, False: 646]
  ------------------
  516|    636|			YYSTAGP(context.yyt5);
  ------------------
  |  |   38|    636|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    636|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  517|    636|			goto yy35;
  518|     16|		default: goto yy23;
  ------------------
  |  Branch (518:3): [True: 16, False: 636]
  ------------------
  519|    652|	}
  520|  1.06k|yy32:
  521|  1.06k|	YYSKIP();
  ------------------
  |  |   35|  1.06k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.06k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  522|  1.06k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.06k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.06k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.06k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.06k, False: 1]
  |  |  ------------------
  ------------------
  523|  1.06k|	switch (yych) {
  524|      1|		case 0x00: goto yy23;
  ------------------
  |  Branch (524:3): [True: 1, False: 1.06k]
  ------------------
  525|    517|		case ';':
  ------------------
  |  Branch (525:3): [True: 517, False: 547]
  ------------------
  526|    517|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|    517|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    517|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  527|    517|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    517|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    517|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  528|    517|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    517|#define YYSTAGN(t) t = NULL
  ------------------
  529|    517|			goto yy37;
  530|    546|		default:
  ------------------
  |  Branch (530:3): [True: 546, False: 518]
  ------------------
  531|    546|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|    546|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    546|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  532|    546|			goto yy36;
  533|  1.06k|	}
  534|  1.45k|yy33:
  535|  1.45k|	YYSKIP();
  ------------------
  |  |   35|  1.45k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.45k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  536|  1.45k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.45k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.45k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.44k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.44k, False: 11]
  |  |  ------------------
  ------------------
  537|  1.45k|	switch (yych) {
  538|    246|		case 'b':
  ------------------
  |  Branch (538:3): [True: 246, False: 1.21k]
  ------------------
  539|    457|		case 'g':
  ------------------
  |  Branch (539:3): [True: 211, False: 1.24k]
  ------------------
  540|    839|		case 'i':
  ------------------
  |  Branch (540:3): [True: 382, False: 1.07k]
  ------------------
  541|  1.44k|		case 's': goto yy38;
  ------------------
  |  Branch (541:3): [True: 604, False: 853]
  ------------------
  542|     14|		default: goto yy23;
  ------------------
  |  Branch (542:3): [True: 14, False: 1.44k]
  ------------------
  543|  1.45k|	}
  544|  3.60k|yy34:
  545|  3.60k|	YYSKIP();
  ------------------
  |  |   35|  3.60k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.60k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  546|  3.60k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.60k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.60k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.59k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.59k, False: 9]
  |  |  ------------------
  ------------------
  547|  3.60k|	switch (yych) {
  548|      9|		case 0x00: goto yy23;
  ------------------
  |  Branch (548:3): [True: 9, False: 3.59k]
  ------------------
  549|    745|		case ';':
  ------------------
  |  Branch (549:3): [True: 745, False: 2.85k]
  ------------------
  550|    745|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    745|#define YYSTAGN(t) t = NULL
  ------------------
  551|    745|			goto yy33;
  552|  2.84k|		default: goto yy34;
  ------------------
  |  Branch (552:3): [True: 2.84k, False: 754]
  ------------------
  553|  3.60k|	}
  554|  68.4k|yy35:
  555|  68.4k|	YYSKIP();
  ------------------
  |  |   35|  68.4k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  68.4k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  556|  68.4k|	yych = YYPEEK();
  ------------------
  |  |   33|  68.4k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  68.4k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  68.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 68.3k, False: 85]
  |  |  ------------------
  ------------------
  557|  68.4k|	switch (yych) {
  558|  62.8k|		case '0':
  ------------------
  |  Branch (558:3): [True: 62.8k, False: 5.54k]
  ------------------
  559|  63.3k|		case '1':
  ------------------
  |  Branch (559:3): [True: 461, False: 67.9k]
  ------------------
  560|  63.6k|		case '2':
  ------------------
  |  Branch (560:3): [True: 292, False: 68.1k]
  ------------------
  561|  64.1k|		case '3':
  ------------------
  |  Branch (561:3): [True: 525, False: 67.8k]
  ------------------
  562|  64.9k|		case '4':
  ------------------
  |  Branch (562:3): [True: 827, False: 67.5k]
  ------------------
  563|  65.6k|		case '5':
  ------------------
  |  Branch (563:3): [True: 666, False: 67.7k]
  ------------------
  564|  66.0k|		case '6':
  ------------------
  |  Branch (564:3): [True: 441, False: 67.9k]
  ------------------
  565|  66.9k|		case '7':
  ------------------
  |  Branch (565:3): [True: 838, False: 67.5k]
  ------------------
  566|  67.3k|		case '8':
  ------------------
  |  Branch (566:3): [True: 465, False: 67.9k]
  ------------------
  567|  67.7k|		case '9': goto yy35;
  ------------------
  |  Branch (567:3): [True: 389, False: 68.0k]
  ------------------
  568|    511|		case ';':
  ------------------
  |  Branch (568:3): [True: 511, False: 67.8k]
  ------------------
  569|    511|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    511|#define YYSTAGN(t) t = NULL
  ------------------
  570|    511|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    511|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    511|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  571|    511|			goto yy37;
  572|    125|		default: goto yy23;
  ------------------
  |  Branch (572:3): [True: 125, False: 68.2k]
  ------------------
  573|  68.4k|	}
  574|  3.06M|yy36:
  575|  3.06M|	YYSKIP();
  ------------------
  |  |   35|  3.06M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.06M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  576|  3.06M|	yych = YYPEEK();
  ------------------
  |  |   33|  3.06M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.06M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.06M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.06M, False: 24]
  |  |  ------------------
  ------------------
  577|  3.06M|	switch (yych) {
  578|     24|		case 0x00: goto yy23;
  ------------------
  |  Branch (578:3): [True: 24, False: 3.06M]
  ------------------
  579|    522|		case ';':
  ------------------
  |  Branch (579:3): [True: 522, False: 3.06M]
  ------------------
  580|    522|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    522|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    522|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  581|    522|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    522|#define YYSTAGN(t) t = NULL
  ------------------
  582|    522|			goto yy37;
  583|  3.06M|		default: goto yy36;
  ------------------
  |  Branch (583:3): [True: 3.06M, False: 546]
  ------------------
  584|  3.06M|	}
  585|  1.55k|yy37:
  586|  1.55k|	YYSKIP();
  ------------------
  |  |   35|  1.55k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.55k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  587|  1.55k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.55k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.55k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.54k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.54k, False: 10]
  |  |  ------------------
  ------------------
  588|  1.55k|	switch (yych) {
  589|    196|		case 'b':
  ------------------
  |  Branch (589:3): [True: 196, False: 1.35k]
  ------------------
  590|    428|		case 'g':
  ------------------
  |  Branch (590:3): [True: 232, False: 1.31k]
  ------------------
  591|    633|		case 'i':
  ------------------
  |  Branch (591:3): [True: 205, False: 1.34k]
  ------------------
  592|  1.05k|		case 's':
  ------------------
  |  Branch (592:3): [True: 423, False: 1.12k]
  ------------------
  593|  1.05k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  1.05k|#define YYSTAGN(t) t = NULL
  ------------------
  594|  1.05k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  1.05k|#define YYSTAGN(t) t = NULL
  ------------------
  595|  1.05k|			goto yy38;
  596|    481|		case 'n': goto yy39;
  ------------------
  |  Branch (596:3): [True: 481, False: 1.06k]
  ------------------
  597|     13|		default: goto yy23;
  ------------------
  |  Branch (597:3): [True: 13, False: 1.53k]
  ------------------
  598|  1.55k|	}
  599|  2.49k|yy38:
  600|  2.49k|	YYSKIP();
  ------------------
  |  |   35|  2.49k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.49k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  601|  2.49k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.49k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.49k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.46k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.46k, False: 35]
  |  |  ------------------
  ------------------
  602|  2.49k|	switch (yych) {
  603|  2.44k|		case '=': goto yy21;
  ------------------
  |  Branch (603:3): [True: 2.44k, False: 54]
  ------------------
  604|     54|		default: goto yy23;
  ------------------
  |  Branch (604:3): [True: 54, False: 2.44k]
  ------------------
  605|  2.49k|	}
  606|    481|yy39:
  607|    481|	YYSKIP();
  ------------------
  |  |   35|    481|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    481|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  608|    481|	yych = YYPEEK();
  ------------------
  |  |   33|    481|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    481|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    480|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 480, False: 1]
  |  |  ------------------
  ------------------
  609|    481|	switch (yych) {
  610|    469|		case 's': goto yy22;
  ------------------
  |  Branch (610:3): [True: 469, False: 12]
  ------------------
  611|     12|		default: goto yy23;
  ------------------
  |  Branch (611:3): [True: 12, False: 469]
  ------------------
  612|    481|	}
  613|    481|}
  614|       |
  615|       |
  616|  3.17k| match:
  617|  3.17k|    if(svu) {
  ------------------
  |  Branch (617:8): [True: 990, False: 2.18k]
  ------------------
  618|       |        /* ServerUri */
  619|    990|        UA_String serverUri = {(size_t)(sve - svu), (UA_Byte*)(uintptr_t)svu};
  620|    990|        size_t i = 0;
  621|    990|        for(; i < serverUrisSize; i++) {
  ------------------
  |  Branch (621:15): [True: 0, False: 990]
  ------------------
  622|      0|            if(UA_String_equal(&serverUri, &serverUris[i]))
  ------------------
  |  Branch (622:16): [True: 0, False: 0]
  ------------------
  623|      0|                break;
  624|      0|        }
  625|    990|        if(i == serverUrisSize) {
  ------------------
  |  Branch (625:12): [True: 990, False: 0]
  ------------------
  626|       |            /* The ServerUri cannot be mapped. Return the entire input as a
  627|       |             * string NodeId. */
  628|    990|            UA_String total = {(size_t)(end - begin), (UA_Byte*)(uintptr_t)begin};
  629|    990|            id->nodeId.identifierType = UA_NODEIDTYPE_STRING;
  630|    990|            return UA_String_copy(&total, &id->nodeId.identifier.string);
  631|    990|        }
  632|      0|        id->serverIndex = (UA_UInt32)i;
  633|  2.18k|    } else if(svr) {
  ------------------
  |  Branch (633:15): [True: 499, False: 1.68k]
  ------------------
  634|       |        /* ServerIndex */
  635|    499|        size_t len = (size_t)(sve - svr);
  636|    499|        if(UA_readNumber((const UA_Byte*)svr, len, &id->serverIndex) != len)
  ------------------
  |  Branch (636:12): [True: 0, False: 499]
  ------------------
  637|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  638|    499|    }
  639|       |
  640|  2.18k|    if(nsu) {
  ------------------
  |  Branch (640:8): [True: 964, False: 1.22k]
  ------------------
  641|       |        /* NamespaceUri */
  642|    964|        UA_String nsuri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  643|    964|        UA_StatusCode res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    964|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  644|       |        /* Try to map the NamespaceUri to its NamespaceIndex for ServerIndex == 0.
  645|       |         * If this fails, keep the full NamespaceUri. */
  646|    964|        if(id->serverIndex == 0)
  ------------------
  |  Branch (646:12): [True: 707, False: 257]
  ------------------
  647|    707|            res = escapedUri2Index(nsuri, &id->nodeId.namespaceIndex, nsMapping);
  648|    964|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    964|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (648:12): [True: 964, False: 0]
  ------------------
  649|    964|            res = UA_String_copy(&nsuri, &id->namespaceUri); /* Keep the Uri without mapping */
  650|    964|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    964|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (650:12): [True: 0, False: 964]
  ------------------
  651|      0|            return res;
  652|  1.22k|    } else if(ns) {
  ------------------
  |  Branch (652:15): [True: 249, False: 974]
  ------------------
  653|       |        /* NamespaceIndex */
  654|    249|        UA_UInt32 tmp;
  655|    249|        size_t len = (size_t)(body - 1 - ns);
  656|    249|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (656:12): [True: 0, False: 249]
  ------------------
  657|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  658|    249|        id->nodeId.namespaceIndex = (UA_UInt16)tmp;
  659|    249|        if(nsMapping)
  ------------------
  |  Branch (659:12): [True: 0, False: 249]
  ------------------
  660|      0|            id->nodeId.namespaceIndex =
  661|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->nodeId.namespaceIndex);
  662|    249|    }
  663|       |
  664|       |    /* From the current position until the end */
  665|  2.18k|    return parse_nodeid_body(&id->nodeId, body, end, idEsc);
  666|  2.18k|}
ua_types_lex.c:parse_qn:
  707|  19.3k|         UA_UInt16 defaultNamespaceIndex) {
  708|  19.3k|    size_t len;
  709|  19.3k|    UA_UInt32 tmp;
  710|  19.3k|    UA_String str;
  711|  19.3k|    UA_StatusCode res;
  712|       |
  713|  19.3k|    LexContext context;
  714|  19.3k|    memset(&context, 0, sizeof(LexContext));
  715|       |
  716|  19.3k|    const u8 *begin = pos;
  717|  19.3k|    UA_QualifiedName_init(qn);
  718|  19.3k|    qn->namespaceIndex = defaultNamespaceIndex;
  719|       |
  720|       |    
  721|  19.3k|{
  722|  19.3k|	u8 yych;
  723|  19.3k|	yych = YYPEEK();
  ------------------
  |  |   33|  19.3k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  19.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  17.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 17.1k, False: 2.14k]
  |  |  ------------------
  ------------------
  724|  19.3k|	switch (yych) {
  725|  2.14k|		case 0x00:
  ------------------
  |  Branch (725:3): [True: 2.14k, False: 17.1k]
  ------------------
  726|  2.39k|		case ';': goto yy41;
  ------------------
  |  Branch (726:3): [True: 251, False: 19.0k]
  ------------------
  727|    397|		case '0':
  ------------------
  |  Branch (727:3): [True: 397, False: 18.9k]
  ------------------
  728|  1.05k|		case '1':
  ------------------
  |  Branch (728:3): [True: 659, False: 18.6k]
  ------------------
  729|  2.33k|		case '2':
  ------------------
  |  Branch (729:3): [True: 1.27k, False: 18.0k]
  ------------------
  730|  2.67k|		case '3':
  ------------------
  |  Branch (730:3): [True: 338, False: 19.0k]
  ------------------
  731|  5.66k|		case '4':
  ------------------
  |  Branch (731:3): [True: 2.99k, False: 16.3k]
  ------------------
  732|  6.56k|		case '5':
  ------------------
  |  Branch (732:3): [True: 895, False: 18.4k]
  ------------------
  733|  12.5k|		case '6':
  ------------------
  |  Branch (733:3): [True: 6.02k, False: 13.3k]
  ------------------
  734|  13.1k|		case '7':
  ------------------
  |  Branch (734:3): [True: 539, False: 18.7k]
  ------------------
  735|  14.5k|		case '8':
  ------------------
  |  Branch (735:3): [True: 1.38k, False: 17.9k]
  ------------------
  736|  14.9k|		case '9': goto yy44;
  ------------------
  |  Branch (736:3): [True: 466, False: 18.8k]
  ------------------
  737|  1.96k|		default: goto yy43;
  ------------------
  |  Branch (737:3): [True: 1.96k, False: 17.3k]
  ------------------
  738|  19.3k|	}
  739|  2.39k|yy41:
  740|  2.39k|	YYSKIP();
  ------------------
  |  |   35|  2.39k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.39k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  741|  18.8k|yy42:
  742|  18.8k|	{ pos = begin; goto match_name; }
  743|  1.96k|yy43:
  744|  1.96k|	YYSKIP();
  ------------------
  |  |   35|  1.96k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.96k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  745|  1.96k|	YYBACKUP();
  ------------------
  |  |   36|  1.96k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  1.96k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.96k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  746|  1.96k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.96k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.96k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.41k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.41k, False: 551]
  |  |  ------------------
  ------------------
  747|  1.96k|	if (yych <= 0x00) goto yy42;
  ------------------
  |  Branch (747:6): [True: 551, False: 1.41k]
  ------------------
  748|  1.41k|	goto yy46;
  749|  14.9k|yy44:
  750|  14.9k|	YYSKIP();
  ------------------
  |  |   35|  14.9k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  14.9k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  751|  14.9k|	YYBACKUP();
  ------------------
  |  |   36|  14.9k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  14.9k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  14.9k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  752|  14.9k|	yych = YYPEEK();
  ------------------
  |  |   33|  14.9k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  14.9k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.77k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.77k, False: 12.2k]
  |  |  ------------------
  ------------------
  753|  14.9k|	switch (yych) {
  754|    279|		case '0':
  ------------------
  |  Branch (754:3): [True: 279, False: 14.7k]
  ------------------
  755|    366|		case '1':
  ------------------
  |  Branch (755:3): [True: 87, False: 14.8k]
  ------------------
  756|    423|		case '2':
  ------------------
  |  Branch (756:3): [True: 57, False: 14.9k]
  ------------------
  757|    459|		case '3':
  ------------------
  |  Branch (757:3): [True: 36, False: 14.9k]
  ------------------
  758|    711|		case '4':
  ------------------
  |  Branch (758:3): [True: 252, False: 14.7k]
  ------------------
  759|    824|		case '5':
  ------------------
  |  Branch (759:3): [True: 113, False: 14.8k]
  ------------------
  760|    925|		case '6':
  ------------------
  |  Branch (760:3): [True: 101, False: 14.8k]
  ------------------
  761|  1.03k|		case '7':
  ------------------
  |  Branch (761:3): [True: 105, False: 14.8k]
  ------------------
  762|  1.43k|		case '8':
  ------------------
  |  Branch (762:3): [True: 403, False: 14.5k]
  ------------------
  763|  1.49k|		case '9':
  ------------------
  |  Branch (763:3): [True: 57, False: 14.9k]
  ------------------
  764|  1.73k|		case ':': goto yy50;
  ------------------
  |  Branch (764:3): [True: 243, False: 14.7k]
  ------------------
  765|  13.2k|		default: goto yy42;
  ------------------
  |  Branch (765:3): [True: 13.2k, False: 1.73k]
  ------------------
  766|  14.9k|	}
  767|  19.3k|yy45:
  768|  19.3k|	YYSKIP();
  ------------------
  |  |   35|  19.3k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  19.3k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  769|  19.3k|	yych = YYPEEK();
  ------------------
  |  |   33|  19.3k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  19.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  18.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 18.1k, False: 1.21k]
  |  |  ------------------
  ------------------
  770|  20.7k|yy46:
  771|  20.7k|	switch (yych) {
  772|  1.21k|		case 0x00: goto yy47;
  ------------------
  |  Branch (772:3): [True: 1.21k, False: 19.5k]
  ------------------
  773|    196|		case ';': goto yy48;
  ------------------
  |  Branch (773:3): [True: 196, False: 20.5k]
  ------------------
  774|  19.3k|		default: goto yy45;
  ------------------
  |  Branch (774:3): [True: 19.3k, False: 1.41k]
  ------------------
  775|  20.7k|	}
  776|  2.67k|yy47:
  777|  2.67k|	YYRESTORE();
  ------------------
  |  |   37|  2.67k|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|  2.67k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|  2.67k|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  778|  2.67k|	goto yy42;
  779|    196|yy48:
  780|    196|	YYSKIP();
  ------------------
  |  |   35|    196|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    196|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  781|    196|	{ goto match_uri; }
  782|  93.1k|yy49:
  783|  93.1k|	YYSKIP();
  ------------------
  |  |   35|  93.1k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  93.1k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  784|  93.1k|	yych = YYPEEK();
  ------------------
  |  |   33|  93.1k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  93.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  92.0k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 92.0k, False: 1.11k]
  |  |  ------------------
  ------------------
  785|  94.8k|yy50:
  786|  94.8k|	switch (yych) {
  787|  69.9k|		case '0':
  ------------------
  |  Branch (787:3): [True: 69.9k, False: 24.9k]
  ------------------
  788|  70.4k|		case '1':
  ------------------
  |  Branch (788:3): [True: 482, False: 94.3k]
  ------------------
  789|  84.7k|		case '2':
  ------------------
  |  Branch (789:3): [True: 14.3k, False: 80.4k]
  ------------------
  790|  85.1k|		case '3':
  ------------------
  |  Branch (790:3): [True: 365, False: 94.5k]
  ------------------
  791|  86.1k|		case '4':
  ------------------
  |  Branch (791:3): [True: 983, False: 93.8k]
  ------------------
  792|  89.5k|		case '5':
  ------------------
  |  Branch (792:3): [True: 3.43k, False: 91.4k]
  ------------------
  793|  90.4k|		case '6':
  ------------------
  |  Branch (793:3): [True: 870, False: 94.0k]
  ------------------
  794|  91.1k|		case '7':
  ------------------
  |  Branch (794:3): [True: 670, False: 94.2k]
  ------------------
  795|  92.7k|		case '8':
  ------------------
  |  Branch (795:3): [True: 1.62k, False: 93.2k]
  ------------------
  796|  93.1k|		case '9': goto yy49;
  ------------------
  |  Branch (796:3): [True: 394, False: 94.4k]
  ------------------
  797|    269|		case ':': goto yy51;
  ------------------
  |  Branch (797:3): [True: 269, False: 94.6k]
  ------------------
  798|  1.46k|		default: goto yy47;
  ------------------
  |  Branch (798:3): [True: 1.46k, False: 93.4k]
  ------------------
  799|  94.8k|	}
  800|    269|yy51:
  801|    269|	YYSKIP();
  ------------------
  |  |   35|    269|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    269|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  802|    269|	{ goto match_index; }
  803|  94.8k|}
  804|       |
  805|       |
  806|    269| match_index:
  807|    269|    len = (size_t)(pos - 1 - begin);
  808|    269|    if(UA_readNumber((const UA_Byte*)begin, len, &tmp) != len)
  ------------------
  |  Branch (808:8): [True: 0, False: 269]
  ------------------
  809|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  810|    269|    qn->namespaceIndex = (UA_UInt16)tmp;
  811|    269|    goto match_name;
  812|       |
  813|    196| match_uri:
  814|    196|    str.length = (size_t)(pos - 1 - begin);
  815|    196|    str.data = (UA_Byte*)(uintptr_t)begin;
  816|    196|    res = escapedUri2Index(str, &qn->namespaceIndex, nsMapping);
  817|    196|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    196|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (817:8): [True: 196, False: 0]
  ------------------
  818|    196|        pos = begin; /* Use the entire string for the name */
  819|       |
  820|  19.3k| match_name:
  821|  19.3k|    str.length = (size_t)(end - pos);
  822|  19.3k|    str.data = (UA_Byte*)(uintptr_t)pos;
  823|  19.3k|    res = UA_String_copy(&str, &qn->name);
  824|  19.3k|    if(UA_LIKELY(res == UA_STATUSCODE_GOOD))
  ------------------
  |  |  578|  19.3k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (578:23): [True: 19.3k, False: 1]
  |  |  ------------------
  ------------------
  825|  19.3k|        res = UA_String_unescape(&qn->name, false, escName);
  826|  19.3k|    return res;
  827|    196|}

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

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

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

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

ua_types.c:UA_ByteString_init:
  243|  9.43k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_String_copy:
  243|  30.2k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_NodeId_clear:
  243|    403|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_ExpandedNodeId_clear:
  243|    493|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_QualifiedName_clear:
  243|      1|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_QualifiedName_init:
  243|  19.3k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_clear:
  243|  46.6k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_init:
  243|    704|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_init:
  243|  46.6k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_init:
  243|  27.6k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_clear:
  243|  11.8k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_new:
  243|    194|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_clear:
  243|    222|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_json.c:UA_String_clear:
  243|  24.0k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_json.c:UA_DataValue_clear:
  243|  24.0k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_binary.c:UA_ByteString_clear:
  243|  6.85k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_pubsub_networkmessage_binary.c:UA_String_clear:
  243|  6.85k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl

