UA_base64:
   17|    240|UA_base64(const unsigned char *src, size_t len, size_t *out_len) {
   18|    240|    if(len == 0) {
  ------------------
  |  Branch (18:8): [True: 0, False: 240]
  ------------------
   19|      0|        *out_len = 0;
   20|      0|        return NULL;
   21|      0|    }
   22|       |
   23|    240|    size_t olen = 4*((len + 2) / 3); /* 3-byte blocks to 4-byte */
   24|    240|    if(olen < len)
  ------------------
  |  Branch (24:8): [True: 0, False: 240]
  ------------------
   25|      0|        return NULL; /* integer overflow */
   26|       |
   27|    240|    unsigned char *out = (unsigned char*)UA_malloc(olen);
  ------------------
  |  |   18|    240|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
   28|    240|    if(!out)
  ------------------
  |  Branch (28:8): [True: 0, False: 240]
  ------------------
   29|      0|        return NULL;
   30|       |
   31|    240|    *out_len = UA_base64_buf(src, len, out);
   32|    240|    return out;
   33|    240|}
UA_base64_buf:
   36|  13.3k|UA_base64_buf(const unsigned char *src, size_t len, unsigned char *out) {
   37|  13.3k|    const unsigned char *end = src + len;
   38|  13.3k|    const unsigned char *in = src;
   39|  13.3k|    unsigned char *pos = out;
   40|  1.23M|    while(end - in >= 3) {
  ------------------
  |  Branch (40:11): [True: 1.21M, False: 13.3k]
  ------------------
   41|  1.21M|        *pos++ = base64_table[in[0] >> 2];
   42|  1.21M|        *pos++ = base64_table[((in[0] & 0x03) << 4) | (in[1] >> 4)];
   43|  1.21M|        *pos++ = base64_table[((in[1] & 0x0f) << 2) | (in[2] >> 6)];
   44|  1.21M|        *pos++ = base64_table[in[2] & 0x3f];
   45|  1.21M|        in += 3;
   46|  1.21M|    }
   47|       |
   48|  13.3k|    if(end - in) {
  ------------------
  |  Branch (48:8): [True: 3.72k, False: 9.63k]
  ------------------
   49|  3.72k|        *pos++ = base64_table[in[0] >> 2];
   50|  3.72k|        if(end - in == 1) {
  ------------------
  |  Branch (50:12): [True: 1.12k, False: 2.59k]
  ------------------
   51|  1.12k|            *pos++ = base64_table[(in[0] & 0x03) << 4];
   52|  1.12k|            *pos++ = '=';
   53|  2.59k|        } else {
   54|  2.59k|            *pos++ = base64_table[((in[0] & 0x03) << 4) | (in[1] >> 4)];
   55|  2.59k|            *pos++ = base64_table[(in[1] & 0x0f) << 2];
   56|  2.59k|        }
   57|  3.72k|        *pos++ = '=';
   58|  3.72k|    }
   59|       |
   60|  13.3k|    return (size_t)(pos - out);
   61|  13.3k|}
UA_unbase64:
   75|  9.07k|UA_unbase64(const unsigned char *src, size_t len, size_t *out_len) {
   76|       |    /* Empty base64 results in an empty byte-string */
   77|  9.07k|    if(len == 0) {
  ------------------
  |  Branch (77:8): [True: 6.33k, False: 2.73k]
  ------------------
   78|  6.33k|        *out_len = 0;
   79|  6.33k|        return (unsigned char*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  6.33k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
   80|  6.33k|    }
   81|       |
   82|       |    /* Allocate the output string. Append four bytes to allow missing padding */
   83|  2.73k|    size_t olen = (len / 4 * 3) + 4;
   84|  2.73k|    unsigned char *out = (unsigned char*)UA_malloc(olen);
  ------------------
  |  |   18|  2.73k|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
   85|  2.73k|    if(!out)
  ------------------
  |  Branch (85:8): [True: 0, False: 2.73k]
  ------------------
   86|      0|        return NULL;
   87|       |
   88|       |    /* Iterate over the input */
   89|  2.73k|    size_t pad = 0;
   90|  2.73k|    unsigned char count = 0;
   91|  2.73k|    unsigned char block[4];
   92|  2.73k|    unsigned char *pos = out;
   93|  3.29M|    for(size_t i = 0; i < len; i++) {
  ------------------
  |  Branch (93:23): [True: 3.28M, False: 2.70k]
  ------------------
   94|  3.28M|        if(src[i] & 0x80)
  ------------------
  |  Branch (94:12): [True: 17, False: 3.28M]
  ------------------
   95|     17|            goto error; /* Non-ASCII input */
   96|  3.28M|        unsigned char tmp = dtable[src[i]];
   97|  3.28M|        if(tmp == 0x80)
  ------------------
  |  Branch (97:12): [True: 10, False: 3.28M]
  ------------------
   98|     10|            goto error; /* Not an allowed character */
   99|  3.28M|        if(tmp == 0x7f)
  ------------------
  |  Branch (99:12): [True: 1.39k, False: 3.28M]
  ------------------
  100|  1.39k|            continue; /* Whitespace is ignored to accomodate RFC 2045, used in
  101|       |                       * XML for xs:base64Binary. */
  102|  3.28M|        block[count++] = tmp;
  103|       |
  104|       |        /* Padding */
  105|  3.28M|        if(src[i] == '=') {
  ------------------
  |  Branch (105:12): [True: 3.24k, False: 3.28M]
  ------------------
  106|  3.24k|            if(count < 3) /* Padding can only be the last two bytes of a block */
  ------------------
  |  Branch (106:16): [True: 4, False: 3.24k]
  ------------------
  107|      4|                goto error;
  108|  3.24k|            block[count-1] = 0;
  109|  3.24k|            pad++;
  110|  3.28M|        } else if(pad > 0) {
  ------------------
  |  Branch (110:19): [True: 2, False: 3.28M]
  ------------------
  111|      2|            goto error; /* Padding not terminated correctly */
  112|      2|        }
  113|       |
  114|       |        /* Write three output characters for four characters of input */
  115|  3.28M|        if(count == 4) {
  ------------------
  |  Branch (115:12): [True: 821k, False: 2.46M]
  ------------------
  116|   821k|            if(pad > 2)
  ------------------
  |  Branch (116:16): [True: 0, False: 821k]
  ------------------
  117|      0|                goto error; /* Invalid padding */
  118|   821k|            *pos++ = (block[0] << 2) | (block[1] >> 4);
  119|   821k|            *pos++ = (block[1] << 4) | (block[2] >> 2);
  120|   821k|            *pos++ = (block[2] << 6) | block[3];
  121|   821k|            count = 0;
  122|   821k|            pos -= pad;
  123|   821k|            pad = 0;
  124|   821k|        }
  125|  3.28M|    }
  126|       |
  127|       |    /* Input length not a multiple of four */
  128|  2.70k|    if(count > 0)
  ------------------
  |  Branch (128:8): [True: 6, False: 2.69k]
  ------------------
  129|      6|        goto error;
  130|       |
  131|  2.69k|    *out_len = (size_t)(pos - out);
  132|  2.69k|    if(*out_len == 0) {
  ------------------
  |  Branch (132:8): [True: 73, False: 2.62k]
  ------------------
  133|     73|        UA_free(out);
  ------------------
  |  |   19|     73|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  134|     73|        return (unsigned char*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|     73|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  135|     73|    }
  136|  2.62k|    return out;
  137|       |
  138|     39| error:
  139|     39|    UA_free(out);
  ------------------
  |  |   19|     39|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  140|       |    return NULL;
  141|  2.69k|}

cj5_parse:
  305|  5.67k|          cj5_options *options) {
  306|  5.67k|    cj5_result r;
  307|  5.67k|    cj5__parser parser;
  308|  5.67k|    memset(&parser, 0x0, sizeof(parser));
  309|  5.67k|    parser.curr_tok_idx = 0;
  310|  5.67k|    parser.json5 = json5;
  311|  5.67k|    parser.len = len;
  312|  5.67k|    parser.tokens = tokens;
  313|  5.67k|    parser.max_tokens = max_tokens;
  314|       |
  315|  5.67k|    if(options)
  ------------------
  |  Branch (315:8): [True: 5.67k, False: 0]
  ------------------
  316|  5.67k|        parser.stop_early = options->stop_early;
  317|       |
  318|  5.67k|    unsigned short depth = 0; // Nesting depth zero means "outside the root object"
  319|  5.67k|    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|  5.67k|    char next[CJ5_MAX_NESTING];    // Next content to parse: 'k' (key), ':', 'v'
  323|       |                                   // (value) or ',' (comma).
  324|  5.67k|    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|  5.67k|    nesting[0] = 0; // Becomes '{' if there is a virtual root object
  329|       |
  330|  5.67k|    cj5_token *token = NULL; // The current token
  331|       |
  332|  6.62k| start_parsing:
  333|  86.0M|    for(; parser.pos < len; parser.pos++) {
  ------------------
  |  Branch (333:11): [True: 85.9M, False: 5.58k]
  ------------------
  334|  85.9M|        char c = json5[parser.pos];
  335|  85.9M|        switch(c) {
  336|  45.3k|        case '\n': // Skip newline and whitespace
  ------------------
  |  Branch (336:9): [True: 45.3k, False: 85.9M]
  ------------------
  337|  45.8k|        case '\r':
  ------------------
  |  Branch (337:9): [True: 447, False: 85.9M]
  ------------------
  338|  46.1k|        case '\t':
  ------------------
  |  Branch (338:9): [True: 310, False: 85.9M]
  ------------------
  339|  46.7k|        case ' ':
  ------------------
  |  Branch (339:9): [True: 579, False: 85.9M]
  ------------------
  340|  46.7k|            break;
  341|       |
  342|    138|        case '#': // Skip comment
  ------------------
  |  Branch (342:9): [True: 138, False: 85.9M]
  ------------------
  343|  20.4k|        case '/':
  ------------------
  |  Branch (343:9): [True: 20.3k, False: 85.9M]
  ------------------
  344|  20.4k|            cj5__skip_comment(&parser);
  345|  20.4k|            if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (345:16): [True: 17.3k, False: 3.11k]
  ------------------
  346|  17.3k|               parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (346:16): [True: 37, False: 17.3k]
  ------------------
  347|     37|                goto finish;
  348|  20.4k|            break;
  349|       |
  350|  4.26M|        case '{': // Open an object or array
  ------------------
  |  Branch (350:9): [True: 4.26M, False: 81.7M]
  ------------------
  351|  4.29M|        case '[':
  ------------------
  |  Branch (351:9): [True: 38.4k, False: 85.9M]
  ------------------
  352|       |            // Check the nesting depth
  353|  4.29M|            if(depth + 1 >= CJ5_MAX_NESTING) {
  ------------------
  |  |   52|  4.29M|#define CJ5_MAX_NESTING 32
  ------------------
  |  Branch (353:16): [True: 1, False: 4.29M]
  ------------------
  354|      1|                parser.error = CJ5_ERROR_INVALID;
  355|      1|                goto finish;
  356|      1|            }
  357|       |
  358|       |            // Correct next?
  359|  4.29M|            if(next[depth] != 'v') {
  ------------------
  |  Branch (359:16): [True: 9, False: 4.29M]
  ------------------
  360|      9|                parser.error = CJ5_ERROR_INVALID;
  361|      9|                goto finish;
  362|      9|            }
  363|       |
  364|  4.29M|            depth++; // Increase the nesting depth
  365|  4.29M|            nesting[depth] = c; // Set the nesting type
  366|  4.29M|            next[depth] = (c == '{') ? 'k' : 'v'; // next is either a key or a value
  ------------------
  |  Branch (366:27): [True: 4.26M, False: 38.4k]
  ------------------
  367|       |
  368|       |            // Create a token for the object or array
  369|  4.29M|            token = cj5__alloc_token(&parser);
  370|  4.29M|            if(token) {
  ------------------
  |  Branch (370:16): [True: 2.19M, False: 2.09M]
  ------------------
  371|  2.19M|                token->parent_id = parser.curr_tok_idx;
  372|  2.19M|                token->type = (c == '{') ? CJ5_TOKEN_OBJECT : CJ5_TOKEN_ARRAY;
  ------------------
  |  Branch (372:31): [True: 2.17M, False: 21.6k]
  ------------------
  373|  2.19M|                token->start = parser.pos;
  374|  2.19M|                token->size = 0;
  375|  2.19M|                parser.curr_tok_idx = parser.token_count - 1; // The new curr_tok_idx
  376|       |                                                              // is for this token
  377|  2.19M|            }
  378|  4.29M|            break;
  379|       |
  380|  4.26M|        case '}': // Close an object or array
  ------------------
  |  Branch (380:9): [True: 4.26M, False: 81.7M]
  ------------------
  381|  4.29M|        case ']':
  ------------------
  |  Branch (381:9): [True: 38.2k, False: 85.9M]
  ------------------
  382|       |            // Check the nesting depth. Note that a "virtual root object" at
  383|       |            // depth zero must not be closed.
  384|  4.29M|            if(depth == 0) {
  ------------------
  |  Branch (384:16): [True: 6, False: 4.29M]
  ------------------
  385|      6|                parser.error = CJ5_ERROR_INVALID;
  386|      6|                goto finish;
  387|      6|            }
  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|  4.29M|            if(c - nesting[depth] != 2 ||
  ------------------
  |  Branch (392:16): [True: 0, False: 4.29M]
  ------------------
  393|  4.29M|               (c == '}' && next[depth] != 'k' && next[depth] != ',')) {
  ------------------
  |  Branch (393:17): [True: 4.26M, False: 38.2k]
  |  Branch (393:29): [True: 2.07M, False: 2.18M]
  |  Branch (393:51): [True: 3, False: 2.07M]
  ------------------
  394|      3|                parser.error = CJ5_ERROR_INVALID;
  395|      3|                goto finish;
  396|      3|            }
  397|       |
  398|  4.29M|            if(token) {
  ------------------
  |  Branch (398:16): [True: 2.19M, False: 2.10M]
  ------------------
  399|       |                // Finalize the current token
  400|  2.19M|                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|  2.19M|                if(parser.curr_tok_idx != token->parent_id) {
  ------------------
  |  Branch (405:20): [True: 2.19M, False: 4.32k]
  ------------------
  406|  2.19M|                    parser.curr_tok_idx = token->parent_id;
  407|  2.19M|                    token = &tokens[token->parent_id];
  408|  2.19M|                    token->size++;
  409|  2.19M|                }
  410|  2.19M|            }
  411|       |
  412|       |            // Step one level up
  413|  4.29M|            depth--;
  414|  4.29M|            next[depth] = (depth == 0) ? 0 : ','; // zero if we step out the root
  ------------------
  |  Branch (414:27): [True: 4.67k, False: 4.29M]
  ------------------
  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|  4.29M|            if(depth == 0 && parser.stop_early)
  ------------------
  |  Branch (420:16): [True: 4.67k, False: 4.29M]
  |  Branch (420:30): [True: 0, False: 4.67k]
  ------------------
  421|      0|                goto finish;
  422|       |
  423|  4.29M|            break;
  424|       |
  425|  4.29M|        case ':': // Colon (between key and value)
  ------------------
  |  Branch (425:9): [True: 4.17M, False: 81.8M]
  ------------------
  426|  4.17M|            if(next[depth] != ':') {
  ------------------
  |  Branch (426:16): [True: 900, False: 4.17M]
  ------------------
  427|    900|                parser.error = CJ5_ERROR_INVALID;
  428|    900|                goto finish;
  429|    900|            }
  430|  4.17M|            next[depth] = 'v';
  431|  4.17M|            break;
  432|       |
  433|  35.5M|        case ',': // Comma
  ------------------
  |  Branch (433:9): [True: 35.5M, False: 50.4M]
  ------------------
  434|  35.5M|            if(next[depth] != ',') {
  ------------------
  |  Branch (434:16): [True: 9, False: 35.5M]
  ------------------
  435|      9|                parser.error = CJ5_ERROR_INVALID;
  436|      9|                goto finish;
  437|      9|            }
  438|  35.5M|            next[depth] = (nesting[depth] == '{') ? 'k' : 'v';
  ------------------
  |  Branch (438:27): [True: 2.09M, False: 33.4M]
  ------------------
  439|  35.5M|            break;
  440|       |
  441|  37.5M|        default: // Value or key
  ------------------
  |  Branch (441:9): [True: 37.5M, False: 48.4M]
  ------------------
  442|  37.5M|            if(next[depth] == 'v') {
  ------------------
  |  Branch (442:16): [True: 33.3M, False: 4.17M]
  ------------------
  443|  33.3M|                cj5__parse_primitive(&parser); // Parse primitive value
  444|  33.3M|                if(nesting[depth] != 0) {
  ------------------
  |  Branch (444:20): [True: 33.3M, False: 945]
  ------------------
  445|       |                    // Parent is object or array
  446|  33.3M|                    if(token)
  ------------------
  |  Branch (446:24): [True: 31.3M, False: 2.05M]
  ------------------
  447|  31.3M|                        token->size++;
  448|  33.3M|                    next[depth] = ',';
  449|  33.3M|                } else {
  450|       |                    // The current value was the root element. Don't look for
  451|       |                    // any next element.
  452|    945|                    next[depth] = 0;
  453|       |
  454|       |                    // The first element was successfully parsed. Stop early or try to
  455|       |                    // parse the full input string?
  456|    945|                    if(parser.stop_early)
  ------------------
  |  Branch (456:24): [True: 0, False: 945]
  ------------------
  457|      0|                        goto finish;
  458|    945|                }
  459|  33.3M|            } else if(next[depth] == 'k') {
  ------------------
  |  Branch (459:23): [True: 4.17M, False: 45]
  ------------------
  460|  4.17M|                cj5__parse_key(&parser);
  461|  4.17M|                if(token)
  ------------------
  |  Branch (461:20): [True: 2.14M, False: 2.02M]
  ------------------
  462|  2.14M|                    token->size++; // Keys count towards the length
  463|  4.17M|                next[depth] = ':';
  464|  4.17M|            } else {
  465|     45|                parser.error = CJ5_ERROR_INVALID;
  466|     45|            }
  467|       |
  468|  37.5M|            if(parser.error && parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (468:16): [True: 18.8M, False: 18.7M]
  |  Branch (468:32): [True: 69, False: 18.8M]
  ------------------
  469|     69|                goto finish;
  470|       |
  471|  37.5M|            break;
  472|  85.9M|        }
  473|  85.9M|    }
  474|       |
  475|       |    // Are we back to the initial nesting depth?
  476|  5.58k|    if(depth != 0) {
  ------------------
  |  Branch (476:8): [True: 22, False: 5.56k]
  ------------------
  477|     22|        parser.error = CJ5_ERROR_INCOMPLETE;
  478|     22|        goto finish;
  479|     22|    }
  480|       |
  481|       |    // Close the virtual root object if there is one
  482|  5.56k|    if(nesting[0] == '{' && parser.error != CJ5_ERROR_OVERFLOW) {
  ------------------
  |  Branch (482:8): [True: 885, False: 4.68k]
  |  Branch (482:29): [True: 876, False: 9]
  ------------------
  483|       |        // Check the we end after a complete key-value pair (or dangling comma)
  484|    876|        if(next[0] != 'k' && next[0] != ',')
  ------------------
  |  Branch (484:12): [True: 872, False: 4]
  |  Branch (484:30): [True: 18, False: 854]
  ------------------
  485|     18|            parser.error = CJ5_ERROR_INVALID;
  486|    876|        tokens[0].end = parser.pos - 1;
  487|    876|    }
  488|       |
  489|  6.62k| finish:
  490|       |    // If parsing failed at the initial nesting depth, create a virtual root object
  491|       |    // and restart parsing.
  492|  6.62k|    if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (492:8): [True: 1.77k, False: 4.85k]
  ------------------
  493|  1.77k|       parser.error != CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (493:8): [True: 1.07k, False: 696]
  ------------------
  494|  1.07k|       depth == 0 && nesting[0] != '{') {
  ------------------
  |  Branch (494:8): [True: 1.01k, False: 63]
  |  Branch (494:22): [True: 950, False: 61]
  ------------------
  495|    950|        parser.token_count = 0;
  496|    950|        token = cj5__alloc_token(&parser);
  497|    950|        if(token) {
  ------------------
  |  Branch (497:12): [True: 950, False: 0]
  ------------------
  498|    950|            token->parent_id = 0;
  499|    950|            token->type = CJ5_TOKEN_OBJECT;
  500|    950|            token->start = 0;
  501|    950|            token->size = 0;
  502|       |
  503|    950|            nesting[0] = '{';
  504|    950|            next[0] = 'k';
  505|       |
  506|    950|            parser.curr_tok_idx = 0;
  507|    950|            parser.pos = 0;
  508|    950|            parser.error = CJ5_ERROR_NONE;
  509|    950|            goto start_parsing;
  510|    950|        }
  511|    950|    }
  512|       |
  513|  5.67k|    memset(&r, 0x0, sizeof(r));
  514|  5.67k|    r.error = parser.error;
  515|  5.67k|    r.error_pos = parser.pos;
  516|  5.67k|    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|  5.67k|    if(r.num_tokens == 0)
  ------------------
  |  Branch (520:8): [True: 2, False: 5.66k]
  ------------------
  521|      2|        r.error = CJ5_ERROR_INCOMPLETE;
  522|       |
  523|       |    // Set the tokens and original string only if successfully parsed
  524|  5.67k|    if(r.error == CJ5_ERROR_NONE) {
  ------------------
  |  Branch (524:8): [True: 4.84k, False: 822]
  ------------------
  525|  4.84k|        r.tokens = tokens;
  526|  4.84k|        r.json5 = json5;
  527|  4.84k|    }
  528|       |
  529|  5.67k|    return r;
  530|  6.62k|}
cj5_get_str:
  628|   202k|            char *buf, unsigned int *buflen) {
  629|   202k|    const cj5_token *token = &r->tokens[tok_index];
  630|   202k|    if(token->type != CJ5_TOKEN_STRING)
  ------------------
  |  Branch (630:8): [True: 0, False: 202k]
  ------------------
  631|      0|        return CJ5_ERROR_INVALID;
  632|       |
  633|   202k|    const char *pos = &r->json5[token->start];
  634|   202k|    const char *end = &r->json5[token->end + 1];
  635|   202k|    unsigned int outpos = 0;
  636|  28.2M|    for(; pos < end; pos++) {
  ------------------
  |  Branch (636:11): [True: 28.0M, False: 202k]
  ------------------
  637|  28.0M|        uint8_t c = (uint8_t)*pos;
  638|       |        // Unprintable ascii characters must be escaped
  639|  28.0M|        if(c < ' ' || c == 127)
  ------------------
  |  Branch (639:12): [True: 15, False: 28.0M]
  |  Branch (639:23): [True: 2, False: 28.0M]
  ------------------
  640|     17|            return CJ5_ERROR_INVALID;
  641|       |
  642|       |        // Unescaped Ascii character or utf8 byte
  643|  28.0M|        if(c != '\\') {
  ------------------
  |  Branch (643:12): [True: 23.8M, False: 4.15M]
  ------------------
  644|  23.8M|            buf[outpos++] = (char)c;
  645|  23.8M|            continue;
  646|  23.8M|        }
  647|       |
  648|       |        // End of input before the escaped character
  649|  4.15M|        if(pos + 1 >= end)
  ------------------
  |  Branch (649:12): [True: 0, False: 4.15M]
  ------------------
  650|      0|            return CJ5_ERROR_INCOMPLETE;
  651|       |
  652|       |        // Process escaped character
  653|  4.15M|        pos++;
  654|  4.15M|        c = (uint8_t)*pos;
  655|  4.15M|        switch(c) {
  656|    331|        case 'b': buf[outpos++] = '\b'; break;
  ------------------
  |  Branch (656:9): [True: 331, False: 4.15M]
  ------------------
  657|  10.4k|        case 'f': buf[outpos++] = '\f'; break;
  ------------------
  |  Branch (657:9): [True: 10.4k, False: 4.14M]
  ------------------
  658|    241|        case 'r': buf[outpos++] = '\r'; break;
  ------------------
  |  Branch (658:9): [True: 241, False: 4.15M]
  ------------------
  659|  94.2k|        case 'n': buf[outpos++] = '\n'; break;
  ------------------
  |  Branch (659:9): [True: 94.2k, False: 4.06M]
  ------------------
  660|    171|        case 't': buf[outpos++] = '\t'; break;
  ------------------
  |  Branch (660:9): [True: 171, False: 4.15M]
  ------------------
  661|  3.07M|        default:  buf[outpos++] = (char)c; break;
  ------------------
  |  Branch (661:9): [True: 3.07M, False: 1.08M]
  ------------------
  662|   976k|        case 'u': {
  ------------------
  |  Branch (662:9): [True: 976k, False: 3.17M]
  ------------------
  663|       |            // Parse a unicode code point
  664|   976k|            if(pos + 4 >= end)
  ------------------
  |  Branch (664:16): [True: 3, False: 976k]
  ------------------
  665|      3|                return CJ5_ERROR_INCOMPLETE;
  666|   976k|            pos++;
  667|   976k|            uint32_t utf;
  668|   976k|            cj5_error_code err = parse_codepoint(pos, &utf);
  669|   976k|            if(err != CJ5_ERROR_NONE)
  ------------------
  |  Branch (669:16): [True: 4, False: 976k]
  ------------------
  670|      4|                return err;
  671|   976k|            pos += 3;
  672|       |
  673|       |            // Parse a surrogate pair
  674|   976k|            if(0xd800 <= utf && utf <= 0xdfff) {
  ------------------
  |  Branch (674:16): [True: 765, False: 975k]
  |  Branch (674:33): [True: 569, False: 196]
  ------------------
  675|    569|                if(pos + 6 >= end)
  ------------------
  |  Branch (675:20): [True: 2, False: 567]
  ------------------
  676|      2|                    return CJ5_ERROR_INVALID;
  677|    567|                if(pos[1] != '\\' && pos[2] != 'u')
  ------------------
  |  Branch (677:20): [True: 249, False: 318]
  |  Branch (677:38): [True: 3, False: 246]
  ------------------
  678|      3|                    return CJ5_ERROR_INVALID;
  679|    564|                pos += 3;
  680|    564|                uint32_t utf2;
  681|    564|                err = parse_codepoint(pos, &utf2);
  682|    564|                if(err != CJ5_ERROR_NONE)
  ------------------
  |  Branch (682:20): [True: 4, False: 560]
  ------------------
  683|      4|                    return err;
  684|    560|                pos += 3;
  685|       |                // High or low surrogate pair
  686|    560|                utf = (utf <= 0xdbff) ?
  ------------------
  |  Branch (686:23): [True: 264, False: 296]
  ------------------
  687|    264|                    (utf << 10) + utf2 + SURROGATE_OFFSET :
  688|    560|                    (utf2 << 10) + utf + SURROGATE_OFFSET;
  689|    560|            }
  690|       |
  691|       |            // Write the utf8 bytes of the code point
  692|   976k|            unsigned len = utf8_from_codepoint((unsigned char*)buf + outpos, utf);
  693|   976k|            if(len == 0)
  ------------------
  |  Branch (693:16): [True: 13, False: 976k]
  ------------------
  694|     13|                return CJ5_ERROR_INVALID; // Not a utf8 string
  695|   976k|            outpos += len;
  696|   976k|            break;
  697|   976k|        }
  698|  4.15M|        }
  699|  4.15M|    }
  700|       |
  701|       |    // Terminate with \0
  702|   202k|    buf[outpos] = 0;
  703|       |
  704|       |    // Set the output length
  705|   202k|    if(buflen)
  ------------------
  |  Branch (705:8): [True: 202k, False: 0]
  ------------------
  706|   202k|        *buflen = outpos;
  707|   202k|    return CJ5_ERROR_NONE;
  708|   202k|}
cj5.c:cj5__skip_comment:
  260|  20.4k|cj5__skip_comment(cj5__parser* parser) {
  261|  20.4k|    const char* json5 = parser->json5;
  262|       |
  263|       |    // Single-line comment
  264|  20.4k|    if(json5[parser->pos] == '#') {
  ------------------
  |  Branch (264:8): [True: 138, False: 20.3k]
  ------------------
  265|  20.1k|    skip_line:
  266|  4.58M|        while(parser->pos < parser->len) {
  ------------------
  |  Branch (266:15): [True: 4.58M, False: 52]
  ------------------
  267|  4.58M|            if(json5[parser->pos] == '\n') {
  ------------------
  |  Branch (267:16): [True: 20.0k, False: 4.56M]
  ------------------
  268|  20.0k|                parser->pos--; // Reparse the newline in the main parse loop
  269|  20.0k|                return;
  270|  20.0k|            }
  271|  4.56M|            parser->pos++;
  272|  4.56M|        }
  273|     52|        return;
  274|  20.1k|    }
  275|       |
  276|       |    // Comment begins with '/' but not enough space for another character
  277|  20.3k|    if(parser->pos + 1 >= parser->len) {
  ------------------
  |  Branch (277:8): [True: 13, False: 20.3k]
  ------------------
  278|     13|        parser->error = CJ5_ERROR_INVALID;
  279|     13|        return;
  280|     13|    }
  281|  20.3k|    parser->pos++;
  282|       |
  283|       |    // Comment begins with '//' -> single-line comment
  284|  20.3k|    if(json5[parser->pos] == '/')
  ------------------
  |  Branch (284:8): [True: 19.9k, False: 334]
  ------------------
  285|  19.9k|        goto skip_line;
  286|       |
  287|       |    // Multi-line comments begin with '/*' and end with '*/'
  288|    334|    if(json5[parser->pos] == '*') {
  ------------------
  |  Branch (288:8): [True: 327, False: 7]
  ------------------
  289|    327|        parser->pos++;
  290|   425k|        for(; parser->pos + 1 < parser->len; parser->pos++) {
  ------------------
  |  Branch (290:15): [True: 425k, False: 17]
  ------------------
  291|   425k|            if(json5[parser->pos] == '*' && json5[parser->pos + 1] == '/') {
  ------------------
  |  Branch (291:16): [True: 800, False: 425k]
  |  Branch (291:45): [True: 310, False: 490]
  ------------------
  292|    310|                parser->pos++;
  293|    310|                return;
  294|    310|            }
  295|   425k|        }
  296|    327|    }
  297|       |
  298|       |    // Unknown comment type or the multi-line comment is not terminated
  299|     24|    parser->error = CJ5_ERROR_INCOMPLETE;
  300|     24|}
cj5.c:cj5__alloc_token:
   88|  41.8M|cj5__alloc_token(cj5__parser *parser) {
   89|  41.8M|    cj5_token* token = NULL;
   90|  41.8M|    if(parser->token_count < parser->max_tokens) {
  ------------------
  |  Branch (90:8): [True: 20.9M, False: 20.9M]
  ------------------
   91|  20.9M|        token = &parser->tokens[parser->token_count];
   92|  20.9M|        memset(token, 0x0, sizeof(cj5_token));
   93|  20.9M|    } else {
   94|  20.9M|        parser->error = CJ5_ERROR_OVERFLOW;
   95|  20.9M|    }
   96|       |
   97|       |    // Always increase the index. So we know eventually how many token would be
   98|       |    // required (if there are not enough).
   99|  41.8M|    parser->token_count++;
  100|  41.8M|    return token;
  101|  41.8M|}
cj5.c:cj5__parse_primitive:
  152|  33.3M|cj5__parse_primitive(cj5__parser* parser) {
  153|  33.3M|    const char* json5 = parser->json5;
  154|  33.3M|    unsigned int len = parser->len;
  155|  33.3M|    unsigned int start = parser->pos;
  156|       |
  157|       |    // String value
  158|  33.3M|    if(json5[start] == '\"' ||
  ------------------
  |  Branch (158:8): [True: 4.79M, False: 28.5M]
  ------------------
  159|  28.5M|       json5[start] == '\'') {
  ------------------
  |  Branch (159:8): [True: 395k, False: 28.2M]
  ------------------
  160|  5.19M|        cj5__parse_string(parser);
  161|  5.19M|        return;
  162|  5.19M|    }
  163|       |
  164|       |    // Fast comparison of bool, and null.
  165|       |    // Make the comparison case-insensitive.
  166|  28.2M|    uint32_t fourcc = 0;
  167|  28.2M|    if(start + 3 < len) {
  ------------------
  |  Branch (167:8): [True: 28.2M, False: 2.96k]
  ------------------
  168|  28.2M|        fourcc += (unsigned char)json5[start] | 32U;
  169|  28.2M|        fourcc += ((unsigned char)json5[start+1] | 32U) << 8;
  170|  28.2M|        fourcc += ((unsigned char)json5[start+2] | 32U) << 16;
  171|  28.2M|        fourcc += ((unsigned char)json5[start+3] | 32U) << 24;
  172|  28.2M|    }
  173|       |    
  174|  28.2M|    cj5_token_type type;
  175|  28.2M|    if(fourcc == CJ5__NULL_FOURCC) {
  ------------------
  |  Branch (175:8): [True: 3.82M, False: 24.3M]
  ------------------
  176|  3.82M|        type = CJ5_TOKEN_NULL;
  177|  3.82M|        parser->pos += 3;
  178|  24.3M|    } else if(fourcc == CJ5__TRUE_FOURCC) {
  ------------------
  |  Branch (178:15): [True: 520, False: 24.3M]
  ------------------
  179|    520|        type = CJ5_TOKEN_BOOL;
  180|    520|        parser->pos += 3;
  181|  24.3M|    } else if(fourcc == CJ5__FALSE_FOURCC) {
  ------------------
  |  Branch (181:15): [True: 8.51k, False: 24.3M]
  ------------------
  182|       |        // "false" has five characters
  183|  8.51k|        type = CJ5_TOKEN_BOOL;
  184|  8.51k|        if(start + 4 >= len || (json5[start+4] | 32) != 'e') {
  ------------------
  |  Branch (184:12): [True: 0, False: 8.51k]
  |  Branch (184:32): [True: 3, False: 8.51k]
  ------------------
  185|      3|            parser->error = CJ5_ERROR_INVALID;
  186|      3|            return;
  187|      3|        }
  188|  8.51k|        parser->pos += 4;
  189|  24.3M|    } else {
  190|       |        // Numbers are checked for basic compatibility.
  191|       |        // But they are fully parsed only in the cj5_get_XXX functions.
  192|  24.3M|        type = CJ5_TOKEN_NUMBER;
  193|  59.8M|        for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (193:15): [True: 59.8M, False: 853]
  ------------------
  194|  59.8M|            if(!cj5__isnum(json5[parser->pos]) &&
  ------------------
  |  |   85|   119M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  ------------------
  |  Branch (194:16): [True: 26.7M, False: 33.0M]
  ------------------
  195|  26.7M|               !(json5[parser->pos] == '.') &&
  ------------------
  |  Branch (195:16): [True: 25.4M, False: 1.37M]
  ------------------
  196|  25.4M|               !cj5__islowerchar(json5[parser->pos]) && 
  ------------------
  |  |   84|  85.2M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  ------------------
  |  Branch (196:16): [True: 24.4M, False: 1.01M]
  ------------------
  197|  24.4M|               !cj5__isupperchar(json5[parser->pos]) &&
  ------------------
  |  |   83|  84.2M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  ------------------
  |  Branch (197:16): [True: 24.3M, False: 19.2k]
  ------------------
  198|  24.3M|               !(json5[parser->pos] == '+') && !(json5[parser->pos] == '-')) {
  ------------------
  |  Branch (198:16): [True: 24.3M, False: 1.99k]
  |  Branch (198:48): [True: 24.3M, False: 14.6k]
  ------------------
  199|  24.3M|                break;
  200|  24.3M|            }
  201|  59.8M|        }
  202|  24.3M|        parser->pos--; // Point to the last character that is still inside the
  203|       |                       // primitive value
  204|  24.3M|    }
  205|       |
  206|  28.2M|    cj5_token *token = cj5__alloc_token(parser);
  207|  28.2M|    if(token) {
  ------------------
  |  Branch (207:8): [True: 13.9M, False: 14.2M]
  ------------------
  208|  13.9M|        token->type = type;
  209|  13.9M|        token->start = start;
  210|  13.9M|        token->end = parser->pos;
  211|  13.9M|        token->size = parser->pos - start + 1;
  212|  13.9M|        token->parent_id = parser->curr_tok_idx;
  213|  13.9M|    }
  214|  28.2M|}
cj5.c:cj5__parse_string:
  104|  9.17M|cj5__parse_string(cj5__parser *parser) {
  105|  9.17M|    const char *json5 = parser->json5;
  106|  9.17M|    unsigned int len = parser->len;
  107|  9.17M|    unsigned int start = parser->pos;
  108|  9.17M|    char str_open = json5[start];
  109|       |
  110|  9.17M|    parser->pos++;
  111|  83.6M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (111:11): [True: 83.6M, False: 15]
  ------------------
  112|  83.6M|        char c = json5[parser->pos];
  113|       |
  114|       |        // End of string
  115|  83.6M|        if(str_open == c) {
  ------------------
  |  Branch (115:12): [True: 9.17M, False: 74.5M]
  ------------------
  116|  9.17M|            cj5_token *token = cj5__alloc_token(parser);
  117|  9.17M|            if(token) {
  ------------------
  |  Branch (117:16): [True: 4.65M, False: 4.51M]
  ------------------
  118|  4.65M|                token->type = CJ5_TOKEN_STRING;
  119|  4.65M|                token->start = start + 1;
  120|  4.65M|                token->end = parser->pos - 1;
  121|  4.65M|                token->size = token->end - token->start + 1;
  122|  4.65M|                token->parent_id = parser->curr_tok_idx;
  123|  4.65M|            } 
  124|  9.17M|            return;
  125|  9.17M|        }
  126|       |
  127|       |        // Unescaped newlines are forbidden
  128|  74.5M|        if(c == '\n') {
  ------------------
  |  Branch (128:12): [True: 0, False: 74.5M]
  ------------------
  129|      0|            parser->error = CJ5_ERROR_INVALID;
  130|      0|            return;
  131|      0|        }
  132|       |
  133|       |        // Skip escape character
  134|  74.5M|        if(c == '\\') {
  ------------------
  |  Branch (134:12): [True: 5.44M, False: 69.0M]
  ------------------
  135|  5.44M|            if(parser->pos + 1 >= len) {
  ------------------
  |  Branch (135:16): [True: 0, False: 5.44M]
  ------------------
  136|      0|                parser->error = CJ5_ERROR_INCOMPLETE;
  137|      0|                return;
  138|      0|            }
  139|  5.44M|            parser->pos++;
  140|  5.44M|        }
  141|  74.5M|    }
  142|       |
  143|       |    // The file has ended before the string terminates
  144|     15|    parser->error = CJ5_ERROR_INCOMPLETE;
  145|     15|}
cj5.c:cj5__isrange:
   79|   117M|cj5__isrange(char ch, char from, char to) {
   80|   117M|    return (uint8_t)(ch - from) <= (uint8_t)(to - from);
   81|   117M|}
cj5.c:cj5__parse_key:
  217|  4.17M|cj5__parse_key(cj5__parser* parser) {
  218|  4.17M|    const char* json5 = parser->json5;
  219|  4.17M|    unsigned int start = parser->pos;
  220|  4.17M|    cj5_token* token;
  221|       |
  222|       |    // Key is a a normal string
  223|  4.17M|    if(json5[start] == '\"' || json5[start] == '\'') {
  ------------------
  |  Branch (223:8): [True: 3.98M, False: 192k]
  |  Branch (223:32): [True: 182, False: 192k]
  ------------------
  224|  3.98M|        cj5__parse_string(parser);
  225|  3.98M|        return;
  226|  3.98M|    }
  227|       |
  228|       |    // An unquoted key. Must start with a-ZA-Z_$. Can contain numbers later on.
  229|   192k|    unsigned int len = parser->len;
  230|  2.56M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (230:11): [True: 2.56M, False: 28]
  ------------------
  231|  2.56M|        if(cj5__islowerchar(json5[parser->pos]) ||
  ------------------
  |  |   84|  5.12M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  |  |  ------------------
  |  |  |  Branch (84:30): [True: 2.06M, False: 494k]
  |  |  ------------------
  ------------------
  232|   494k|           cj5__isupperchar(json5[parser->pos]) ||
  ------------------
  |  |   83|  3.05M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  |  |  ------------------
  |  |  |  Branch (83:30): [True: 286k, False: 208k]
  |  |  ------------------
  ------------------
  233|   208k|           json5[parser->pos] == '_' || json5[parser->pos] == '$')
  ------------------
  |  Branch (233:12): [True: 398, False: 207k]
  |  Branch (233:41): [True: 738, False: 207k]
  ------------------
  234|  2.35M|            continue;
  235|   207k|        if(cj5__isnum(json5[parser->pos]) && parser->pos != start)
  ------------------
  |  |   85|   414k|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 15.0k, False: 192k]
  |  |  ------------------
  ------------------
  |  Branch (235:46): [True: 15.0k, False: 0]
  ------------------
  236|  15.0k|            continue;
  237|   192k|        break;
  238|   207k|    }
  239|       |
  240|       |    // An empty key is not allowed
  241|   192k|    if(parser->pos <= start) {
  ------------------
  |  Branch (241:8): [True: 6, False: 192k]
  ------------------
  242|      6|        parser->error = CJ5_ERROR_INVALID;
  243|      6|        return;
  244|      6|    }
  245|       |
  246|       |    // Move pos to the last character within the unquoted key
  247|   192k|    parser->pos--;
  248|       |
  249|   192k|    token = cj5__alloc_token(parser);
  250|   192k|    if(token) {
  ------------------
  |  Branch (250:8): [True: 106k, False: 85.8k]
  ------------------
  251|   106k|        token->type = CJ5_TOKEN_STRING;
  252|   106k|        token->start = start;
  253|   106k|        token->end = parser->pos;
  254|   106k|        token->size = parser->pos - start + 1;
  255|   106k|        token->parent_id = parser->curr_tok_idx;
  256|   106k|    }
  257|   192k|}
cj5.c:parse_codepoint:
  607|   976k|parse_codepoint(const char *pos, uint32_t *out_utf) {
  608|   976k|    uint32_t utf = 0;
  609|  4.88M|    for(unsigned int i = 0; i < 4; i++) {
  ------------------
  |  Branch (609:29): [True: 3.90M, False: 976k]
  ------------------
  610|  3.90M|        char byte = pos[i];
  611|  3.90M|        if(cj5__isnum(byte)) {
  ------------------
  |  |   85|  3.90M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 2.93M, False: 977k]
  |  |  ------------------
  ------------------
  612|  2.93M|            byte = (char)(byte - '0');
  613|  2.93M|        } else if(cj5__isrange(byte, 'a', 'f')) {
  ------------------
  |  Branch (613:19): [True: 974k, False: 2.63k]
  ------------------
  614|   974k|            byte = (char)(byte - ('a' - 10));
  615|   974k|        } else if(cj5__isrange(byte, 'A', 'F')) {
  ------------------
  |  Branch (615:19): [True: 2.62k, False: 8]
  ------------------
  616|  2.62k|            byte = (char)(byte - ('A' - 10));
  617|  2.62k|        } else {
  618|      8|            return CJ5_ERROR_INVALID;
  619|      8|        }
  620|  3.90M|        utf = (utf << 4) | ((uint8_t)byte & 0xF);
  621|  3.90M|    }
  622|   976k|    *out_utf = utf;
  623|   976k|    return CJ5_ERROR_NONE;
  624|   976k|}

dtoa:
  336|  1.52M|unsigned dtoa(double d, char* buffer) {
  337|  1.52M|    uint64_t bits = 0;
  338|  1.52M|    memcpy(&bits, &d, sizeof(double));
  339|       |
  340|  1.52M|    uint64_t mantissa = bits & ((1ull << mantissa_bits) - 1);
  ------------------
  |  |   33|  1.52M|#define mantissa_bits 52
  ------------------
  341|  1.52M|    uint32_t exponent = (uint32_t)
  342|  1.52M|        ((bits >> mantissa_bits) & ((1u << exponent_bits) - 1));
  ------------------
  |  |   33|  1.52M|#define mantissa_bits 52
  ------------------
                      ((bits >> mantissa_bits) & ((1u << exponent_bits) - 1));
  ------------------
  |  |   34|  1.52M|#define exponent_bits 11
  ------------------
  343|       |
  344|  1.52M|    if(exponent == 0 && mantissa == 0) {
  ------------------
  |  Branch (344:8): [True: 26.4k, False: 1.49M]
  |  Branch (344:25): [True: 22.9k, False: 3.53k]
  ------------------
  345|  22.9k|        memcpy(buffer, "0.0", 3);
  346|  22.9k|        return 3;
  347|  22.9k|    }
  348|       |
  349|  1.52M|    bool sign = ((bits >> (mantissa_bits + exponent_bits)) & 1) != 0;
  ------------------
  |  |   33|  1.49M|#define mantissa_bits 52
  ------------------
                  bool sign = ((bits >> (mantissa_bits + exponent_bits)) & 1) != 0;
  ------------------
  |  |   34|  1.49M|#define exponent_bits 11
  ------------------
  350|  1.49M|    unsigned pos = 0;
  351|  1.49M|    if(sign) {
  ------------------
  |  Branch (351:8): [True: 2.61k, False: 1.49M]
  ------------------
  352|  2.61k|        buffer[0] = '-';
  353|  2.61k|        pos++;
  354|  2.61k|    }
  355|       |
  356|  1.49M|    if(exponent == ((1u << exponent_bits) - 1u)) {
  ------------------
  |  |   34|  1.49M|#define exponent_bits 11
  ------------------
  |  Branch (356:8): [True: 0, False: 1.49M]
  ------------------
  357|      0|        if(mantissa != 0) {
  ------------------
  |  Branch (357:12): [True: 0, False: 0]
  ------------------
  358|      0|            memcpy(buffer, "nan", 3);
  359|      0|            return 3;
  360|      0|        } else {
  361|      0|            memcpy(&buffer[pos], "inf", 3);
  362|      0|            return pos + 3;
  363|      0|        }
  364|      0|    }
  365|       |
  366|  1.49M|    int K = 0;
  367|  1.49M|    char digits[18];
  368|  1.49M|    memset(digits, 0, 18);
  369|  1.49M|    unsigned ndigits = grisu2(bits, digits, &K);
  370|  1.49M|    return pos + emit_digits(digits, ndigits, &buffer[pos], K, sign);
  371|  1.49M|}
dtoa.c:grisu2:
  255|  1.49M|static unsigned grisu2(uint64_t bits, char* digits, int* K) {
  256|  1.49M|    Fp w = build_fp(bits);
  257|  1.49M|    Fp lower, upper;
  258|  1.49M|    get_normalized_boundaries(&w, &lower, &upper);
  259|  1.49M|    normalize(&w);
  260|  1.49M|    int k;
  261|  1.49M|    Fp cp = find_cachedpow10(upper.exp, &k);
  262|  1.49M|    w     = multiply(&w,     &cp);
  263|  1.49M|    upper = multiply(&upper, &cp);
  264|  1.49M|    lower = multiply(&lower, &cp);
  265|  1.49M|    lower.frac++;
  266|  1.49M|    upper.frac--;
  267|  1.49M|    *K = -k;
  268|  1.49M|    return generate_digits(&w, &upper, &lower, digits, K);
  269|  1.49M|}
dtoa.c:build_fp:
  132|  1.49M|static Fp build_fp(uint64_t bits) {
  133|  1.49M|    Fp fp;
  134|  1.49M|    fp.frac = bits & fracmask;
  ------------------
  |  |   35|  1.49M|#define fracmask  0x000FFFFFFFFFFFFFU
  ------------------
  135|  1.49M|    fp.exp = (bits & expmask) >> 52;
  ------------------
  |  |   36|  1.49M|#define expmask   0x7FF0000000000000U
  ------------------
  136|  1.49M|    if(fp.exp) {
  ------------------
  |  Branch (136:8): [True: 1.49M, False: 3.53k]
  ------------------
  137|  1.49M|        fp.frac += hiddenbit;
  ------------------
  |  |   37|  1.49M|#define hiddenbit 0x0010000000000000U
  ------------------
  138|  1.49M|        fp.exp -= expbias;
  ------------------
  |  |   39|  1.49M|#define expbias   (1023 + 52)
  ------------------
  139|  1.49M|    } else {
  140|  3.53k|        fp.exp = -expbias + 1;
  ------------------
  |  |   39|  3.53k|#define expbias   (1023 + 52)
  ------------------
  141|  3.53k|    }
  142|  1.49M|    return fp;
  143|  1.49M|}
dtoa.c:get_normalized_boundaries:
  155|  1.49M|static void get_normalized_boundaries(Fp* fp, Fp* lower, Fp* upper) {
  156|  1.49M|    upper->frac = (fp->frac << 1) + 1;
  157|  1.49M|    upper->exp  = fp->exp - 1;
  158|  1.61M|    while ((upper->frac & (hiddenbit << 1)) == 0) {
  ------------------
  |  |   37|  1.61M|#define hiddenbit 0x0010000000000000U
  ------------------
  |  Branch (158:12): [True: 118k, False: 1.49M]
  ------------------
  159|   118k|        upper->frac <<= 1;
  160|   118k|        upper->exp--;
  161|   118k|    }
  162|       |
  163|  1.49M|    int u_shift = 64 - 52 - 2;
  164|  1.49M|    upper->frac <<= u_shift;
  165|  1.49M|    upper->exp = upper->exp - u_shift;
  166|       |
  167|  1.49M|    int l_shift = fp->frac == hiddenbit ? 2 : 1;
  ------------------
  |  |   37|  1.49M|#define hiddenbit 0x0010000000000000U
  ------------------
  |  Branch (167:19): [True: 90.3k, False: 1.40M]
  ------------------
  168|  1.49M|    lower->frac = (fp->frac << l_shift) - 1;
  169|  1.49M|    lower->exp = fp->exp - l_shift;
  170|  1.49M|    lower->frac <<= lower->exp - upper->exp;
  171|  1.49M|    lower->exp = upper->exp;
  172|  1.49M|}
dtoa.c:normalize:
  145|  1.49M|static void normalize(Fp* fp) {
  146|  1.61M|    while((fp->frac & hiddenbit) == 0) {
  ------------------
  |  |   37|  1.61M|#define hiddenbit 0x0010000000000000U
  ------------------
  |  Branch (146:11): [True: 118k, False: 1.49M]
  ------------------
  147|   118k|        fp->frac <<= 1;
  148|   118k|        fp->exp--;
  149|   118k|    }
  150|  1.49M|    int shift = 64 - 52 - 1;
  151|  1.49M|    fp->frac <<= shift;
  152|  1.49M|    fp->exp -= shift;
  153|  1.49M|}
dtoa.c:find_cachedpow10:
  113|  1.49M|find_cachedpow10(int exp, int* k) {
  114|  1.49M|    const double one_log_ten = 0.30102999566398114;
  115|  1.49M|    int approx = (int)(-(exp + npowers) * one_log_ten);
  ------------------
  |  |   54|  1.49M|#define npowers     87
  ------------------
  116|  1.49M|    int idx = (approx - firstpower) / steppowers;
  ------------------
  |  |   56|  1.49M|#define firstpower -348 /* 10 ^ -348 */
  ------------------
                  int idx = (approx - firstpower) / steppowers;
  ------------------
  |  |   55|  1.49M|#define steppowers  8
  ------------------
  117|  4.48M|    while(1) {
  ------------------
  |  Branch (117:11): [True: 4.48M, Folded]
  ------------------
  118|  4.48M|        int current = exp + powers_ten[idx].exp + 64;
  119|  4.48M|        if(current < expmin) {
  ------------------
  |  |   58|  4.48M|#define expmin     -60
  ------------------
  |  Branch (119:12): [True: 2.98M, False: 1.49M]
  ------------------
  120|  2.98M|            idx++;
  121|  2.98M|            continue;
  122|  2.98M|        }
  123|  1.49M|        if(current > expmax) {
  ------------------
  |  |   57|  1.49M|#define expmax     -32
  ------------------
  |  Branch (123:12): [True: 0, False: 1.49M]
  ------------------
  124|      0|            idx--;
  125|      0|            continue;
  126|      0|        }
  127|  1.49M|        *k = (firstpower + idx * steppowers);
  ------------------
  |  |   56|  1.49M|#define firstpower -348 /* 10 ^ -348 */
  ------------------
                      *k = (firstpower + idx * steppowers);
  ------------------
  |  |   55|  1.49M|#define steppowers  8
  ------------------
  128|  1.49M|        return powers_ten[idx];
  129|  1.49M|    }
  130|  1.49M|}
dtoa.c:multiply:
  174|  4.49M|static Fp multiply(Fp* a, Fp* b) {
  175|  4.49M|    const uint64_t lomask = 0x00000000FFFFFFFF;
  176|  4.49M|    uint64_t ah_bl = (a->frac >> 32)    * (b->frac & lomask);
  177|  4.49M|    uint64_t al_bh = (a->frac & lomask) * (b->frac >> 32);
  178|  4.49M|    uint64_t al_bl = (a->frac & lomask) * (b->frac & lomask);
  179|  4.49M|    uint64_t ah_bh = (a->frac >> 32)    * (b->frac >> 32);
  180|  4.49M|    uint64_t tmp = (ah_bl & lomask) + (al_bh & lomask) + (al_bl >> 32); 
  181|       |    /* round up */
  182|  4.49M|    tmp += 1U << 31;
  183|  4.49M|    Fp fp;
  184|  4.49M|    fp.frac = ah_bh + (ah_bl >> 32) + (al_bh >> 32) + (tmp >> 32);
  185|  4.49M|    fp.exp = a->exp + b->exp + 64;
  186|  4.49M|    return fp;
  187|  4.49M|}
dtoa.c:generate_digits:
  198|  1.49M|static unsigned generate_digits(Fp* fp, Fp* upper, Fp* lower, char* digits, int* K) {
  199|  1.49M|    uint64_t wfrac = upper->frac - fp->frac;
  200|  1.49M|    uint64_t delta = upper->frac - lower->frac;
  201|       |
  202|  1.49M|    Fp one;
  203|  1.49M|    one.frac = 1ULL << -upper->exp;
  204|  1.49M|    one.exp  = upper->exp;
  205|       |
  206|  1.49M|    uint64_t part1 = upper->frac >> -one.exp;
  207|  1.49M|    uint64_t part2 = upper->frac & (one.frac - 1);
  208|       |
  209|  1.49M|    unsigned idx = 0;
  210|  1.49M|    int kappa = 10;
  211|  1.49M|    uint64_t* divp;
  212|       |
  213|       |    /* 1000000000 */
  214|  11.6M|    for(divp = tens + 10; kappa > 0; divp++) {
  ------------------
  |  Branch (214:27): [True: 11.1M, False: 532k]
  ------------------
  215|  11.1M|        uint64_t div = *divp;
  216|  11.1M|        uint64_t digit = part1 / div;
  217|  11.1M|        if(digit || idx) {
  ------------------
  |  Branch (217:12): [True: 2.26M, False: 8.86M]
  |  Branch (217:21): [True: 1.36M, False: 7.50M]
  ------------------
  218|  3.62M|            digits[idx++] = (char)(digit + '0');
  219|  3.62M|        }
  220|       |
  221|  11.1M|        part1 -= digit * div;
  222|  11.1M|        kappa--;
  223|       |
  224|  11.1M|        uint64_t tmp = (part1 <<-one.exp) + part2;
  225|  11.1M|        if(tmp <= delta) {
  ------------------
  |  Branch (225:12): [True: 964k, False: 10.1M]
  ------------------
  226|   964k|            *K += kappa;
  227|   964k|            round_digit(digits, idx, delta, tmp, div << -one.exp, wfrac);
  228|   964k|            return idx;
  229|   964k|        }
  230|  11.1M|    }
  231|       |
  232|       |    /* 10 */
  233|   532k|    uint64_t* unit = tens + 18;
  234|  6.26M|    while(true) {
  ------------------
  |  Branch (234:11): [True: 6.26M, Folded]
  ------------------
  235|  6.26M|        part2 *= 10;
  236|  6.26M|        delta *= 10;
  237|  6.26M|        kappa--;
  238|       |
  239|  6.26M|        uint64_t digit = part2 >> -one.exp;
  240|  6.26M|        if(digit || idx) {
  ------------------
  |  Branch (240:12): [True: 4.77M, False: 1.48M]
  |  Branch (240:21): [True: 1.48M, False: 0]
  ------------------
  241|  6.26M|            digits[idx++] = (char)(digit + '0');
  242|  6.26M|        }
  243|       |
  244|  6.26M|        part2 &= one.frac - 1;
  245|  6.26M|        if(part2 < delta) {
  ------------------
  |  Branch (245:12): [True: 532k, False: 5.73M]
  ------------------
  246|   532k|            *K += kappa;
  247|   532k|            round_digit(digits, idx, delta, part2, one.frac, wfrac * *unit);
  248|   532k|            break;
  249|   532k|        }
  250|  5.73M|        unit--;
  251|  5.73M|    }
  252|   532k|    return idx;
  253|  1.49M|}
dtoa.c:round_digit:
  190|  1.49M|                        uint64_t rem, uint64_t kappa, uint64_t frac) {
  191|  1.86M|    while(rem < frac && delta - rem >= kappa &&
  ------------------
  |  Branch (191:11): [True: 556k, False: 1.31M]
  |  Branch (191:25): [True: 477k, False: 78.5k]
  ------------------
  192|   477k|          (rem + kappa < frac || frac - rem > rem + kappa - frac)) {
  ------------------
  |  Branch (192:12): [True: 91.2k, False: 386k]
  |  Branch (192:34): [True: 280k, False: 105k]
  ------------------
  193|   372k|        digits[ndigits - 1]--;
  194|   372k|        rem += kappa;
  195|   372k|    }
  196|  1.49M|}
dtoa.c:emit_digits:
  272|  1.49M|emit_digits(char* digits, unsigned ndigits, char* dest, int K, bool neg) {
  273|  1.49M|    int exp = absv(K + (int)ndigits - 1);
  ------------------
  |  |   41|  1.49M|#define absv(n) ((n) < 0 ? -(n) : (n))
  |  |  ------------------
  |  |  |  Branch (41:18): [True: 106k, False: 1.39M]
  |  |  ------------------
  ------------------
  274|       |
  275|       |    /* write plain integer */
  276|  1.49M|    if(K >= 0 && (exp < (int)ndigits + 7)) {
  ------------------
  |  Branch (276:8): [True: 959k, False: 537k]
  |  Branch (276:18): [True: 955k, False: 4.53k]
  ------------------
  277|   955k|        memcpy(dest, digits, ndigits);
  278|   955k|        memset(dest + ndigits, '0', (unsigned)K);
  279|   955k|        memcpy(dest + ndigits + (unsigned)K, ".0", 2); /* always append .0 for naked integers */
  280|   955k|        return (unsigned)(ndigits + (unsigned)K + 2);
  281|   955k|    }
  282|       |
  283|       |    /* write decimal w/o scientific notation */
  284|   541k|    if(K < 0 && (K > -7 || exp < 4)) {
  ------------------
  |  Branch (284:8): [True: 537k, False: 4.53k]
  |  Branch (284:18): [True: 7.78k, False: 529k]
  |  Branch (284:28): [True: 524k, False: 5.15k]
  ------------------
  285|   532k|        int offset = (int)ndigits - absv(K);
  ------------------
  |  |   41|   532k|#define absv(n) ((n) < 0 ? -(n) : (n))
  |  |  ------------------
  |  |  |  Branch (41:18): [True: 532k, False: 0]
  |  |  ------------------
  ------------------
  286|   532k|        if(offset <= 0) {
  ------------------
  |  Branch (286:12): [True: 101k, False: 430k]
  ------------------
  287|       |            /* fp < 1.0 -> write leading zero */
  288|   101k|            offset = -offset;
  289|   101k|            dest[0] = '0';
  290|   101k|            dest[1] = '.';
  291|   101k|            memset(dest + 2, '0', (size_t)offset);
  292|   101k|            memcpy(dest + offset + 2, digits, ndigits);
  293|   101k|            return ndigits + 2 + (unsigned)offset;
  294|   430k|        } else {
  295|       |            /* fp > 1.0 */
  296|   430k|            memcpy(dest, digits, (size_t)offset);
  297|   430k|            dest[offset] = '.';
  298|   430k|            memcpy(dest + offset + 1, digits + offset, ndigits - (unsigned)offset);
  299|   430k|            return ndigits + 1;
  300|   430k|        }
  301|   532k|    }
  302|       |
  303|       |    /* write decimal w/ scientific notation */
  304|  9.69k|    ndigits = minv(ndigits, (unsigned)(18 - neg));
  ------------------
  |  |   42|  9.69k|#define minv(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 8.73k, False: 960]
  |  |  ------------------
  ------------------
  305|  9.69k|    unsigned idx = 0;
  306|  9.69k|    dest[idx++] = digits[0];
  307|  9.69k|    if(ndigits > 1) {
  ------------------
  |  Branch (307:8): [True: 4.21k, False: 5.48k]
  ------------------
  308|  4.21k|        dest[idx++] = '.';
  309|  4.21k|        memcpy(dest + idx, digits + 1, ndigits - 1);
  310|  4.21k|        idx += ndigits - 1;
  311|  4.21k|    }
  312|       |
  313|  9.69k|    dest[idx++] = 'e';
  314|       |
  315|  9.69k|    char sign = K + (int)ndigits - 1 < 0 ? '-' : '+';
  ------------------
  |  Branch (315:17): [True: 5.15k, False: 4.54k]
  ------------------
  316|  9.69k|    dest[idx++] = sign;
  317|       |
  318|  9.69k|    int cent = 0;
  319|  9.69k|    if(exp > 99) {
  ------------------
  |  Branch (319:8): [True: 4.59k, False: 5.10k]
  ------------------
  320|  4.59k|        cent = exp / 100;
  321|  4.59k|        dest[idx++] = (char)(cent + '0');
  322|  4.59k|        exp -= cent * 100;
  323|  4.59k|    }
  324|  9.69k|    if(exp > 9) {
  ------------------
  |  Branch (324:8): [True: 7.06k, False: 2.63k]
  ------------------
  325|  7.06k|        int dec = exp / 10;
  326|  7.06k|        dest[idx++] = (char)(dec + '0');
  327|  7.06k|        exp -= dec * 10;
  328|       |
  329|  7.06k|    } else if(cent) {
  ------------------
  |  Branch (329:15): [True: 1.04k, False: 1.58k]
  ------------------
  330|  1.04k|        dest[idx++] = '0';
  331|  1.04k|    }
  332|  9.69k|    dest[idx++] = (char)(exp % 10 + '0');
  333|  9.69k|    return idx;
  334|   541k|}

itoaUnsigned:
   42|  7.95M|UA_UInt16 itoaUnsigned(UA_UInt64 value, char* buffer, UA_Byte base) {
   43|       |    /* consider absolute value of number */
   44|  7.95M|    UA_UInt64 n = value;
   45|       |
   46|  7.95M|    UA_UInt16 i = 0;
   47|  14.1M|    while (n) {
  ------------------
  |  Branch (47:12): [True: 6.19M, False: 7.95M]
  ------------------
   48|  6.19M|        UA_UInt64 r = n % base;
   49|       |
   50|  6.19M|        if (r >= 10)
  ------------------
  |  Branch (50:13): [True: 0, False: 6.19M]
  ------------------
   51|      0|            buffer[i++] = (char)(65 + (r - 10));
   52|  6.19M|        else
   53|  6.19M|            buffer[i++] = (char)(48 + r);
   54|       |
   55|  6.19M|        n = n / base;
   56|  6.19M|    }
   57|       |    /* if number is 0 */
   58|  7.95M|    if (i == 0)
  ------------------
  |  Branch (58:9): [True: 1.81M, False: 6.14M]
  ------------------
   59|  1.81M|        buffer[i++] = '0';
   60|       |
   61|  7.95M|    buffer[i] = '\0'; /* null terminate string */
   62|  7.95M|    i--;
   63|       |    /* reverse the string */
   64|  7.95M|    reverse(buffer, 0, i);
   65|  7.95M|    i++;
   66|  7.95M|    return i;
   67|  7.95M|}
itoaSigned:
   70|  5.04M|UA_UInt16 itoaSigned(UA_Int64 value, char* buffer) {
   71|       |    /* Special case for UA_INT64_MIN which can not simply be negated */
   72|       |    /* it will cause a signed integer overflow */
   73|  5.04M|    UA_UInt64 n;
   74|  5.04M|    if(value == UA_INT64_MIN) {
  ------------------
  |  |  119|  5.04M|#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
  |  |  ------------------
  |  |  |  |  118|  5.04M|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  |  |  ------------------
  ------------------
  |  Branch (74:8): [True: 1.44k, False: 5.04M]
  ------------------
   75|  1.44k|        n = (UA_UInt64)UA_INT64_MAX + 1;
  ------------------
  |  |  118|  1.44k|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  ------------------
   76|  5.04M|    } else {
   77|  5.04M|        n = (UA_UInt64)value;
   78|  5.04M|        if(value < 0){
  ------------------
  |  Branch (78:12): [True: 8.04k, False: 5.03M]
  ------------------
   79|  8.04k|            n = (UA_UInt64)-value;
   80|  8.04k|        }
   81|  5.04M|    }
   82|       |
   83|  5.04M|    UA_UInt16 i = 0;
   84|  9.98M|    while(n) {
  ------------------
  |  Branch (84:11): [True: 4.94M, False: 5.04M]
  ------------------
   85|  4.94M|        UA_UInt64 r = n % 10;
   86|  4.94M|        buffer[i++] = (char)('0' + r);
   87|  4.94M|        n = n / 10;
   88|  4.94M|    }
   89|       |
   90|  5.04M|    if(i == 0)
  ------------------
  |  Branch (90:8): [True: 160k, False: 4.88M]
  ------------------
   91|   160k|        buffer[i++] = '0'; /* if number is 0 */
   92|  5.04M|    if(value < 0)
  ------------------
  |  Branch (92:8): [True: 9.48k, False: 5.03M]
  ------------------
   93|  9.48k|        buffer[i++] = '-';
   94|  5.04M|    buffer[i] = '\0'; /* null terminate string */
   95|  5.04M|    i--;
   96|  5.04M|    reverse(buffer, 0, i); /* reverse the string and return it */
   97|  5.04M|    i++;
   98|  5.04M|    return i;
   99|  5.04M|}
itoa.c:reverse:
   34|  13.0M|static char* reverse(char *buffer, UA_UInt16 i, UA_UInt16 j) {
   35|  13.0M|    while (i < j)
  ------------------
  |  Branch (35:12): [True: 87.6k, False: 13.0M]
  ------------------
   36|  87.6k|        swap(&buffer[i++], &buffer[j--]);
   37|       |
   38|  13.0M|    return buffer;
   39|  13.0M|}
itoa.c:swap:
   27|  87.6k|static void swap(char *x, char *y) {
   28|  87.6k|    char t = *x;
   29|  87.6k|    *x = *y;
   30|  87.6k|    *y = t;
   31|  87.6k|}

musl_secs_to_tm:
   15|  26.6k|musl_secs_to_tm(long long t, struct musl_tm *tm) {
   16|  26.6k|    long long days, secs, years;
   17|  26.6k|    int remdays, remsecs, remyears;
   18|  26.6k|    int qc_cycles, c_cycles, q_cycles;
   19|  26.6k|    int months;
   20|  26.6k|    int wday, yday, leap;
   21|  26.6k|    static const char days_in_month[] = {31,30,31,30,31,31,30,31,30,31,31,29};
   22|       |
   23|       |    /* Reject time_t values whose year would overflow int */
   24|  26.6k|    if (t < INT_MIN * 31622400LL || t > INT_MAX * 31622400LL)
  ------------------
  |  Branch (24:9): [True: 0, False: 26.6k]
  |  Branch (24:37): [True: 0, False: 26.6k]
  ------------------
   25|      0|        return -1;
   26|       |
   27|  26.6k|    secs = t - LEAPOCH;
  ------------------
  |  |    8|  26.6k|#define LEAPOCH (946684800LL + 86400*(31+29))
  ------------------
   28|  26.6k|    days = secs / 86400LL;
   29|  26.6k|    remsecs = (int)(secs % 86400);
   30|  26.6k|    if (remsecs < 0) {
  ------------------
  |  Branch (30:9): [True: 17.6k, False: 9.00k]
  ------------------
   31|  17.6k|        remsecs += 86400;
   32|  17.6k|        --days;
   33|  17.6k|    }
   34|       |
   35|  26.6k|    wday = (int)((3+days)%7);
   36|  26.6k|    if (wday < 0) wday += 7;
  ------------------
  |  Branch (36:9): [True: 17.8k, False: 8.85k]
  ------------------
   37|       |
   38|  26.6k|    qc_cycles = (int)(days / DAYS_PER_400Y);
  ------------------
  |  |   10|  26.6k|#define DAYS_PER_400Y (365*400 + 97)
  ------------------
   39|  26.6k|    remdays = (int)(days % DAYS_PER_400Y);
  ------------------
  |  |   10|  26.6k|#define DAYS_PER_400Y (365*400 + 97)
  ------------------
   40|  26.6k|    if (remdays < 0) {
  ------------------
  |  Branch (40:9): [True: 21.4k, False: 5.19k]
  ------------------
   41|  21.4k|        remdays += DAYS_PER_400Y;
  ------------------
  |  |   10|  21.4k|#define DAYS_PER_400Y (365*400 + 97)
  ------------------
   42|  21.4k|        --qc_cycles;
   43|  21.4k|    }
   44|       |
   45|  26.6k|    c_cycles = remdays / DAYS_PER_100Y;
  ------------------
  |  |   11|  26.6k|#define DAYS_PER_100Y (365*100 + 24)
  ------------------
   46|  26.6k|    if (c_cycles == 4) --c_cycles;
  ------------------
  |  Branch (46:9): [True: 3.23k, False: 23.4k]
  ------------------
   47|  26.6k|    remdays -= c_cycles * DAYS_PER_100Y;
  ------------------
  |  |   11|  26.6k|#define DAYS_PER_100Y (365*100 + 24)
  ------------------
   48|       |
   49|  26.6k|    q_cycles = remdays / DAYS_PER_4Y;
  ------------------
  |  |   12|  26.6k|#define DAYS_PER_4Y   (365*4   + 1)
  ------------------
   50|  26.6k|    if (q_cycles == 25) --q_cycles;
  ------------------
  |  Branch (50:9): [True: 0, False: 26.6k]
  ------------------
   51|  26.6k|    remdays -= q_cycles * DAYS_PER_4Y;
  ------------------
  |  |   12|  26.6k|#define DAYS_PER_4Y   (365*4   + 1)
  ------------------
   52|       |
   53|  26.6k|    remyears = remdays / 365;
   54|  26.6k|    if (remyears == 4) --remyears;
  ------------------
  |  Branch (54:9): [True: 3.29k, False: 23.3k]
  ------------------
   55|  26.6k|    remdays -= remyears * 365;
   56|       |
   57|  26.6k|    leap = !remyears && (q_cycles || !c_cycles);
  ------------------
  |  Branch (57:12): [True: 10.5k, False: 16.1k]
  |  Branch (57:26): [True: 5.81k, False: 4.71k]
  |  Branch (57:38): [True: 4.67k, False: 39]
  ------------------
   58|  26.6k|    yday = remdays + 31 + 28 + leap;
   59|  26.6k|    if (yday >= 365+leap) yday -= 365+leap;
  ------------------
  |  Branch (59:9): [True: 13.8k, False: 12.8k]
  ------------------
   60|       |
   61|  26.6k|    years = remyears + 4*q_cycles + 100*c_cycles + 400LL*qc_cycles;
   62|       |
   63|   231k|    for (months=0; days_in_month[months] <= remdays; months++)
  ------------------
  |  Branch (63:20): [True: 204k, False: 26.6k]
  ------------------
   64|   204k|        remdays -= days_in_month[months];
   65|       |
   66|  26.6k|    if (months >= 10) {
  ------------------
  |  Branch (66:9): [True: 13.8k, False: 12.8k]
  ------------------
   67|  13.8k|        months -= 12;
   68|  13.8k|        years++;
   69|  13.8k|    }
   70|       |
   71|  26.6k|    if (years+100 > INT_MAX || years+100 < INT_MIN)
  ------------------
  |  Branch (71:9): [True: 0, False: 26.6k]
  |  Branch (71:32): [True: 0, False: 26.6k]
  ------------------
   72|      0|        return -1;
   73|       |
   74|  26.6k|    tm->tm_year = (int)(years + 100);
   75|  26.6k|    tm->tm_mon = months + 2;
   76|  26.6k|    tm->tm_mday = remdays + 1;
   77|  26.6k|    tm->tm_wday = wday;
   78|  26.6k|    tm->tm_yday = yday;
   79|       |
   80|  26.6k|    tm->tm_hour = remsecs / 3600;
   81|  26.6k|    tm->tm_min = remsecs / 60 % 60;
   82|  26.6k|    tm->tm_sec = remsecs % 60;
   83|       |
   84|  26.6k|    return 0;
   85|  26.6k|}
musl_tm_to_secs:
  149|  17.1k|musl_tm_to_secs(const struct musl_tm *tm) {
  150|  17.1k|    int is_leap;
  151|  17.1k|    long long year = tm->tm_year;
  152|  17.1k|    int month = tm->tm_mon;
  153|  17.1k|    if (month >= 12 || month < 0) {
  ------------------
  |  Branch (153:9): [True: 2.70k, False: 14.4k]
  |  Branch (153:24): [True: 2.43k, False: 12.0k]
  ------------------
  154|  5.13k|        int adj = month / 12;
  155|  5.13k|        month %= 12;
  156|  5.13k|        if (month < 0) {
  ------------------
  |  Branch (156:13): [True: 2.43k, False: 2.70k]
  ------------------
  157|  2.43k|            adj--;
  158|  2.43k|            month += 12;
  159|  2.43k|        }
  160|  5.13k|        year += adj;
  161|  5.13k|    }
  162|  17.1k|    long long t = musl_year_to_secs(year, &is_leap);
  163|  17.1k|    t += musl_month_to_secs(month, is_leap);
  164|  17.1k|    t += 86400LL * (tm->tm_mday-1);
  165|  17.1k|    t += 3600LL * tm->tm_hour;
  166|  17.1k|    t += 60LL * tm->tm_min;
  167|  17.1k|    t += tm->tm_sec;
  168|  17.1k|    return t;
  169|  17.1k|}
libc_time.c:musl_year_to_secs:
  101|  17.1k|musl_year_to_secs(const long long year, int *is_leap) {
  102|  17.1k|    if (year-2ULL <= 136) {
  ------------------
  |  Branch (102:9): [True: 1.15k, False: 15.9k]
  ------------------
  103|  1.15k|        int y = (int)year;
  104|  1.15k|        int leaps = (y-68)>>2;
  105|  1.15k|        if (!((y-68)&3)) {
  ------------------
  |  Branch (105:13): [True: 292, False: 859]
  ------------------
  106|    292|            leaps--;
  107|    292|            if (is_leap) *is_leap = 1;
  ------------------
  |  Branch (107:17): [True: 292, False: 0]
  ------------------
  108|    859|        } else if (is_leap) *is_leap = 0;
  ------------------
  |  Branch (108:20): [True: 859, False: 0]
  ------------------
  109|  1.15k|        return 31536000*(y-70) + 86400*leaps;
  110|  1.15k|    }
  111|       |
  112|  15.9k|    int cycles, centuries, leaps, rem, dummy;
  113|       |
  114|  15.9k|    if (!is_leap) is_leap = &dummy;
  ------------------
  |  Branch (114:9): [True: 0, False: 15.9k]
  ------------------
  115|  15.9k|    cycles = (int)((year-100) / 400);
  116|  15.9k|    rem = (int)((year-100) % 400);
  117|  15.9k|    if (rem < 0) {
  ------------------
  |  Branch (117:9): [True: 11.5k, False: 4.44k]
  ------------------
  118|  11.5k|        cycles--;
  119|  11.5k|        rem += 400;
  120|  11.5k|    }
  121|  15.9k|    if (!rem) {
  ------------------
  |  Branch (121:9): [True: 2.09k, False: 13.9k]
  ------------------
  122|  2.09k|        *is_leap = 1;
  123|  2.09k|        centuries = 0;
  124|  2.09k|        leaps = 0;
  125|  13.9k|    } else {
  126|  13.9k|        if (rem >= 200) {
  ------------------
  |  Branch (126:13): [True: 6.89k, False: 7.01k]
  ------------------
  127|  6.89k|            if (rem >= 300) centuries = 3, rem -= 300;
  ------------------
  |  Branch (127:17): [True: 4.62k, False: 2.27k]
  ------------------
  128|  2.27k|            else centuries = 2, rem -= 200;
  129|  7.01k|        } else {
  130|  7.01k|            if (rem >= 100) centuries = 1, rem -= 100;
  ------------------
  |  Branch (130:17): [True: 1.84k, False: 5.17k]
  ------------------
  131|  5.17k|            else centuries = 0;
  132|  7.01k|        }
  133|  13.9k|        if (!rem) {
  ------------------
  |  Branch (133:13): [True: 226, False: 13.6k]
  ------------------
  134|    226|            *is_leap = 0;
  135|    226|            leaps = 0;
  136|  13.6k|        } else {
  137|  13.6k|            leaps = rem / 4;
  138|  13.6k|            rem %= 4;
  139|  13.6k|            *is_leap = !rem;
  140|  13.6k|        }
  141|  13.9k|    }
  142|       |
  143|  15.9k|    leaps += 97*cycles + 24*centuries - *is_leap;
  144|       |
  145|  15.9k|    return (year-100) * 31536000LL + leaps * 86400LL + 946684800 + 86400;
  146|  17.1k|}
libc_time.c:musl_month_to_secs:
   93|  17.1k|musl_month_to_secs(int month, int is_leap) {
   94|  17.1k|    int t = secs_through_month[month];
   95|  17.1k|    if (is_leap && month >= 2)
  ------------------
  |  Branch (95:9): [True: 5.80k, False: 11.3k]
  |  Branch (95:20): [True: 2.50k, False: 3.30k]
  ------------------
   96|  2.50k|        t+=86400;
   97|  17.1k|    return t;
   98|  17.1k|}

parseUInt64:
   30|  10.2M|parseUInt64(const char *str, size_t size, uint64_t *result) {
   31|  10.2M|    size_t i = 0;
   32|  10.2M|    uint64_t n = 0, prev = 0;
   33|       |
   34|       |    /* Hex */
   35|  10.2M|    if(size > 2 && str[0] == '0' && (str[1] | 32) == 'x') {
  ------------------
  |  Branch (35:8): [True: 22.6k, False: 10.2M]
  |  Branch (35:20): [True: 8.27k, False: 14.4k]
  |  Branch (35:37): [True: 353, False: 7.92k]
  ------------------
   36|    353|        i = 2;
   37|  23.6k|        for(; i < size; i++) {
  ------------------
  |  Branch (37:15): [True: 23.3k, False: 274]
  ------------------
   38|  23.3k|            uint8_t c = (uint8_t)str[i] | 32;
   39|  23.3k|            if(c >= '0' && c <= '9')
  ------------------
  |  Branch (39:16): [True: 23.3k, False: 0]
  |  Branch (39:28): [True: 13.5k, False: 9.80k]
  ------------------
   40|  13.5k|                c = (uint8_t)(c - '0');
   41|  9.80k|            else if(c >= 'a' && c <='f')
  ------------------
  |  Branch (41:21): [True: 9.80k, False: 0]
  |  Branch (41:33): [True: 9.72k, False: 78]
  ------------------
   42|  9.72k|                c = (uint8_t)(c - 'a' + 10);
   43|     78|            else if(c >= 'A' && c <='F')
  ------------------
  |  Branch (43:21): [True: 78, False: 0]
  |  Branch (43:33): [True: 0, False: 78]
  ------------------
   44|      0|                c = (uint8_t)(c - 'A' + 10);
   45|     78|            else
   46|     78|                break;
   47|  23.2k|            n = (n << 4) | (c & 0xF);
   48|  23.2k|            if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (48:16): [True: 1, False: 23.2k]
  ------------------
   49|      1|                return 0;
   50|  23.2k|            prev = n;
   51|  23.2k|        }
   52|    352|        *result = n;
   53|    352|        return (i > 2) ? i : 0; /* 2 -> No digit was parsed */
  ------------------
  |  Branch (53:16): [True: 352, False: 0]
  ------------------
   54|    353|    }
   55|       |
   56|       |    /* Decimal */
   57|  21.1M|    for(; i < size; i++) {
  ------------------
  |  Branch (57:11): [True: 10.8M, False: 10.2M]
  ------------------
   58|  10.8M|        if(str[i] < '0' || str[i] > '9')
  ------------------
  |  Branch (58:12): [True: 17.4k, False: 10.8M]
  |  Branch (58:28): [True: 994, False: 10.8M]
  ------------------
   59|  18.4k|            break;
   60|       |        /* Fast multiplication: n*10 == (n*8) + (n*2) */
   61|  10.8M|        n = (n << 3) + (n << 1) + (uint8_t)(str[i] - '0');
   62|  10.8M|        if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (62:12): [True: 4, False: 10.8M]
  ------------------
   63|      4|            return 0;
   64|  10.8M|        prev = n;
   65|  10.8M|    }
   66|  10.2M|    *result = n;
   67|  10.2M|    return i;
   68|  10.2M|}
parseInt64:
   71|  4.33M|parseInt64(const char *str, size_t size, int64_t *result) {
   72|       |    /* Negative value? */
   73|  4.33M|    size_t i = 0;
   74|  4.33M|    bool neg = false;
   75|  4.33M|    if(*str == '-' || *str == '+') {
  ------------------
  |  Branch (75:8): [True: 6.78k, False: 4.32M]
  |  Branch (75:23): [True: 229, False: 4.32M]
  ------------------
   76|  7.01k|        neg = (*str == '-');
   77|  7.01k|        i++;
   78|  7.01k|    }
   79|       |
   80|       |    /* Parse as unsigned */
   81|  4.33M|    uint64_t n = 0;
   82|  4.33M|    size_t len = parseUInt64(&str[i], size - i, &n);
   83|  4.33M|    if(len == 0)
  ------------------
  |  Branch (83:8): [True: 11, False: 4.33M]
  ------------------
   84|     11|        return 0;
   85|       |
   86|       |    /* Check for overflow, adjust and return */
   87|  4.33M|    if(!neg) {
  ------------------
  |  Branch (87:8): [True: 4.32M, False: 6.78k]
  ------------------
   88|  4.32M|        if(n > 9223372036854775807UL)
  ------------------
  |  Branch (88:12): [True: 2, False: 4.32M]
  ------------------
   89|      2|            return 0;
   90|  4.32M|        *result = (int64_t)n;
   91|  4.32M|    } else {
   92|  6.78k|        if(n > 9223372036854775808UL)
  ------------------
  |  Branch (92:12): [True: 0, False: 6.78k]
  ------------------
   93|      0|            return 0;
   94|  6.78k|        *result = -(int64_t)n;
   95|  6.78k|    }
   96|  4.33M|    return len + i;
   97|  4.33M|}
parseDouble:
   99|  1.01M|size_t parseDouble(const char *str, size_t size, double *result) {
  100|  1.01M|    char buf[2000];
  101|  1.01M|    if(size >= 2000)
  ------------------
  |  Branch (101:8): [True: 1, False: 1.01M]
  ------------------
  102|      1|        return 0;
  103|  1.01M|    memcpy(buf, str, size);
  104|  1.01M|    buf[size] = 0;
  105|  1.01M|    errno = 0;
  106|  1.01M|    char *endptr;
  107|  1.01M|    *result = strtod(buf, &endptr);
  108|  1.01M|    if(errno != 0 && errno != ERANGE)
  ------------------
  |  Branch (108:8): [True: 3.06k, False: 1.01M]
  |  Branch (108:22): [True: 0, False: 3.06k]
  ------------------
  109|      0|        return 0;
  110|  1.01M|    return (uintptr_t)endptr - (uintptr_t)buf;
  111|  1.01M|}

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

UA_StatusCode_equalTop:
  215|  15.6k|UA_StatusCode_equalTop(UA_StatusCode s1, UA_StatusCode s2) {
  216|  15.6k|    return ((s1 & 0xFFFF0000) == (s2 & 0xFFFF0000));
  217|  15.6k|}
UA_STRING:
  220|  1.78k|UA_STRING(char *chars) {
  221|  1.78k|    UA_String s = {0, NULL};
  222|  1.78k|    if(!chars)
  ------------------
  |  Branch (222:8): [True: 0, False: 1.78k]
  ------------------
  223|      0|        return s;
  224|  1.78k|    s.length = strlen(chars);
  225|  1.78k|    s.data = (UA_Byte*)chars;
  226|  1.78k|    return s;
  227|  1.78k|}
UA_QualifiedName_printEx:
  410|  72.6k|                         const UA_NamespaceMapping *nsMapping) {
  411|       |    /* If the QualifiedName is NULL, return a NULL string */
  412|  72.6k|    if(qn->name.data == NULL && qn->namespaceIndex == 0) {
  ------------------
  |  Branch (412:8): [True: 4.63k, False: 68.0k]
  |  Branch (412:33): [True: 4.63k, False: 0]
  ------------------
  413|  4.63k|        UA_String_clear(output);
  414|  4.63k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  4.63k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  415|  4.63k|    }
  416|       |
  417|       |    /* Start tracking the output length */
  418|  68.0k|    size_t len = qn->name.length;
  419|       |
  420|       |    /* Try to map the NamespaceIndex to the Uri */
  421|  68.0k|    UA_String nsUri = UA_STRING_NULL;
  422|  68.0k|    if(qn->namespaceIndex > 0 && nsMapping) {
  ------------------
  |  Branch (422:8): [True: 1.28k, False: 66.7k]
  |  Branch (422:34): [True: 0, False: 1.28k]
  ------------------
  423|      0|        UA_NamespaceMapping_index2Uri(nsMapping, qn->namespaceIndex, &nsUri);
  424|      0|        if(nsUri.length > 0)
  ------------------
  |  Branch (424:12): [True: 0, False: 0]
  ------------------
  425|      0|            len += nsUri.length + 1;
  426|      0|    }
  427|       |
  428|       |    /* Print the NamespaceIndex */
  429|  68.0k|    char nsStr[6];
  430|  68.0k|    size_t nsStrSize = 0;
  431|  68.0k|    if(nsUri.length == 0 && qn->namespaceIndex > 0) {
  ------------------
  |  Branch (431:8): [True: 68.0k, False: 0]
  |  Branch (431:29): [True: 1.28k, False: 66.7k]
  ------------------
  432|  1.28k|        nsStrSize = itoaUnsigned(qn->namespaceIndex, nsStr, 10);
  433|  1.28k|        len += 1 + nsStrSize;
  434|  1.28k|    }
  435|       |
  436|       |    /* Allocate memory if required */
  437|  68.0k|    if(output->length == 0) {
  ------------------
  |  Branch (437:8): [True: 68.0k, False: 0]
  ------------------
  438|  68.0k|        UA_StatusCode res = UA_ByteString_allocBuffer((UA_ByteString*)output, len);
  439|  68.0k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  68.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (439:12): [True: 0, False: 68.0k]
  ------------------
  440|      0|            return res;
  441|  68.0k|    } else {
  442|      0|        if(output->length < len)
  ------------------
  |  Branch (442:12): [True: 0, False: 0]
  ------------------
  443|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  444|      0|        output->length = len;
  445|      0|    }
  446|       |
  447|       |    /* Print the namespace */
  448|  68.0k|    u8 *pos = output->data;
  449|  68.0k|    if(nsUri.length > 0) {
  ------------------
  |  Branch (449:8): [True: 0, False: 68.0k]
  ------------------
  450|      0|        memcpy(pos, nsUri.data, nsUri.length);
  451|      0|        pos += nsUri.length;
  452|      0|        *pos++ = ';';
  453|  68.0k|    } else if(qn->namespaceIndex > 0) {
  ------------------
  |  Branch (453:15): [True: 1.28k, False: 66.7k]
  ------------------
  454|  1.28k|        memcpy(pos, nsStr, nsStrSize);
  455|  1.28k|        pos += nsStrSize;
  456|  1.28k|        *pos++ = ':';
  457|  1.28k|    }
  458|       |
  459|       |    /* Print the name */
  460|  68.0k|    if(UA_LIKELY(qn->name.data != NULL))
  ------------------
  |  |  574|  68.0k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (574:23): [True: 68.0k, False: 0]
  |  |  ------------------
  ------------------
  461|  68.0k|        memcpy(pos, qn->name.data, qn->name.length);
  462|       |
  463|  68.0k|    UA_assert(output->length == (size_t)((UA_Byte*)pos + qn->name.length - output->data));
  ------------------
  |  |  395|  68.0k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (463:5): [True: 68.0k, False: 0]
  ------------------
  464|  68.0k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  68.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  465|  68.0k|}
UA_DateTime_toStruct:
  484|  26.6k|UA_DateTime_toStruct(UA_DateTime t) {
  485|       |    /* Divide, then subtract -> avoid underflow. Also, negative numbers are
  486|       |     * rounded up, not down. */
  487|  26.6k|    long long secSinceUnixEpoch = (long long)(t / UA_DATETIME_SEC)
  ------------------
  |  |  285|  26.6k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  26.6k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  26.6k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  488|  26.6k|        - (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC);
  ------------------
  |  |  327|  26.6k|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|  26.6k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  26.6k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  26.6k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      - (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC);
  ------------------
  |  |  285|  26.6k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  26.6k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  26.6k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  489|       |
  490|       |    /* Negative fractions of a second? Remove one full second from the epoch
  491|       |     * distance and allow only a positive fraction. */
  492|  26.6k|    UA_DateTime frac = t % UA_DATETIME_SEC;
  ------------------
  |  |  285|  26.6k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  26.6k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  26.6k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  493|  26.6k|    if(frac < 0) {
  ------------------
  |  Branch (493:8): [True: 3.14k, False: 23.5k]
  ------------------
  494|  3.14k|        secSinceUnixEpoch--;
  495|  3.14k|        frac += UA_DATETIME_SEC;
  ------------------
  |  |  285|  3.14k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  3.14k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  3.14k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  496|  3.14k|    }
  497|       |
  498|  26.6k|    struct musl_tm ts;
  499|  26.6k|    memset(&ts, 0, sizeof(struct musl_tm));
  500|  26.6k|    musl_secs_to_tm(secSinceUnixEpoch, &ts);
  501|       |
  502|  26.6k|    UA_DateTimeStruct dateTimeStruct;
  503|  26.6k|    dateTimeStruct.year   = (i16)(ts.tm_year + 1900);
  504|  26.6k|    dateTimeStruct.month  = (u16)(ts.tm_mon + 1);
  505|  26.6k|    dateTimeStruct.day    = (u16)ts.tm_mday;
  506|  26.6k|    dateTimeStruct.hour   = (u16)ts.tm_hour;
  507|  26.6k|    dateTimeStruct.min    = (u16)ts.tm_min;
  508|  26.6k|    dateTimeStruct.sec    = (u16)ts.tm_sec;
  509|  26.6k|    dateTimeStruct.milliSec = (u16)((frac % 10000000) / 10000);
  510|  26.6k|    dateTimeStruct.microSec = (u16)((frac % 10000) / 10);
  511|  26.6k|    dateTimeStruct.nanoSec  = (u16)((frac % 10) * 100);
  512|  26.6k|    return dateTimeStruct;
  513|  26.6k|}
UA_Guid_to_hex:
  715|  2.80k|UA_Guid_to_hex(const UA_Guid *guid, u8* out, UA_Boolean lower) {
  716|  2.80k|    const u8 *hexmap = (lower) ? hexmapLower : hexmapUpper;
  ------------------
  |  Branch (716:24): [True: 0, False: 2.80k]
  ------------------
  717|  2.80k|    size_t i = 0, j = 28;
  718|  25.2k|    for(; i<8;i++,j-=4)         /* pos 0-7, 4byte, (a) */
  ------------------
  |  Branch (718:11): [True: 22.4k, False: 2.80k]
  ------------------
  719|  22.4k|        out[i] = hexmap[(guid->data1 >> j) & 0x0Fu];
  720|  2.80k|    out[i++] = '-';             /* pos 8 */
  721|  14.0k|    for(j=12; i<13;i++,j-=4)    /* pos 9-12, 2byte, (b) */
  ------------------
  |  Branch (721:15): [True: 11.2k, False: 2.80k]
  ------------------
  722|  11.2k|        out[i] = hexmap[(uint16_t)(guid->data2 >> j) & 0x0Fu];
  723|  2.80k|    out[i++] = '-';             /* pos 13 */
  724|  14.0k|    for(j=12; i<18;i++,j-=4)    /* pos 14-17, 2byte (c) */
  ------------------
  |  Branch (724:15): [True: 11.2k, False: 2.80k]
  ------------------
  725|  11.2k|        out[i] = hexmap[(uint16_t)(guid->data3 >> j) & 0x0Fu];
  726|  2.80k|    out[i++] = '-';              /* pos 18 */
  727|  8.40k|    for(j=0;i<23;i+=2,j++) {     /* pos 19-22, 2byte (d) */
  ------------------
  |  Branch (727:13): [True: 5.60k, False: 2.80k]
  ------------------
  728|  5.60k|        out[i] = hexmap[(guid->data4[j] & 0xF0u) >> 4u];
  729|  5.60k|        out[i+1] = hexmap[guid->data4[j] & 0x0Fu];
  730|  5.60k|    }
  731|  2.80k|    out[i++] = '-';              /* pos 23 */
  732|  19.6k|    for(j=2; i<36;i+=2,j++) {    /* pos 24-35, 6byte (e) */
  ------------------
  |  Branch (732:14): [True: 16.8k, False: 2.80k]
  ------------------
  733|  16.8k|        out[i] = hexmap[(guid->data4[j] & 0xF0u) >> 4u];
  734|  16.8k|        out[i+1] = hexmap[guid->data4[j] & 0x0Fu];
  735|  16.8k|    }
  736|  2.80k|}
UA_ByteString_allocBuffer:
  763|   107k|UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length) {
  764|   107k|    UA_ByteString_init(bs);
  765|   107k|    if(length == 0) {
  ------------------
  |  Branch (765:8): [True: 10.0k, False: 97.4k]
  ------------------
  766|  10.0k|        bs->data = (u8*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  10.0k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  767|  10.0k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  10.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  768|  10.0k|    }
  769|  97.4k|    bs->data = (u8*)UA_calloc(1,length);
  ------------------
  |  |   20|  97.4k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  770|  97.4k|    if(UA_UNLIKELY(!bs->data))
  ------------------
  |  |  575|  97.4k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (575:25): [True: 0, False: 97.4k]
  |  |  ------------------
  ------------------
  771|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  772|  97.4k|    bs->length = length;
  773|  97.4k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  97.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  774|  97.4k|}
nodeId_printEscape:
 1030|  8.87k|                   const UA_NamespaceMapping *nsMapping, UA_Escaping idEsc) {
 1031|       |    /* Try to map the NamespaceIndex to the Uri */
 1032|  8.87k|    UA_String nsUri = UA_STRING_NULL;
 1033|  8.87k|    if(id->namespaceIndex > 0 && nsMapping)
  ------------------
  |  Branch (1033:8): [True: 1.50k, False: 7.36k]
  |  Branch (1033:34): [True: 0, False: 1.50k]
  ------------------
 1034|      0|        UA_NamespaceMapping_index2Uri(nsMapping, id->namespaceIndex, &nsUri);
 1035|       |
 1036|       |    /* Compute the string length and print numerical identifiers. */
 1037|  8.87k|    u8 nsStr[7];
 1038|  8.87k|    u8 numIdStr[12];
 1039|  8.87k|    size_t idLen = nodeIdSize(id, nsStr, numIdStr, nsUri, idEsc);
 1040|  8.87k|    if(idLen == 0)
  ------------------
  |  Branch (1040:8): [True: 0, False: 8.87k]
  ------------------
 1041|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 1042|       |
 1043|       |    /* Allocate memory if required */
 1044|  8.87k|    if(output->length == 0) {
  ------------------
  |  Branch (1044:8): [True: 8.87k, False: 0]
  ------------------
 1045|  8.87k|        UA_StatusCode res = UA_ByteString_allocBuffer((UA_ByteString*)output, idLen);
 1046|  8.87k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  8.87k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1046:12): [True: 0, False: 8.87k]
  ------------------
 1047|      0|            return res;
 1048|  8.87k|    } else {
 1049|      0|        if(output->length < idLen)
  ------------------
  |  Branch (1049:12): [True: 0, False: 0]
  ------------------
 1050|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
 1051|      0|        output->length = idLen;
 1052|      0|    }
 1053|       |
 1054|       |    /* Print the NodeId */
 1055|  8.87k|    u8 *pos = printNodeIdBody(id, nsUri, nsStr, numIdStr, output->data, nsMapping, idEsc);
 1056|  8.87k|    output->length = (size_t)(pos - output->data);
 1057|  8.87k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  8.87k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1058|  8.87k|}
UA_NodeId_printEx:
 1062|  8.87k|                  const UA_NamespaceMapping *nsMapping) {
 1063|  8.87k|    return nodeId_printEscape(id, output, nsMapping, UA_ESCAPING_NONE);
 1064|  8.87k|}
UA_ExpandedNodeId_printEx:
 1182|  26.6k|                          size_t serverUrisSize, const UA_String *serverUris) {
 1183|       |    /* Try to map the NamespaceIndex to the Uri */
 1184|  26.6k|    UA_String nsUri = eid->namespaceUri;
 1185|  26.6k|    if(nsUri.data == NULL && eid->nodeId.namespaceIndex > 0 && nsMapping)
  ------------------
  |  Branch (1185:8): [True: 25.7k, False: 903]
  |  Branch (1185:30): [True: 300, False: 25.4k]
  |  Branch (1185:64): [True: 0, False: 300]
  ------------------
 1186|      0|        UA_NamespaceMapping_index2Uri(nsMapping, eid->nodeId.namespaceIndex, &nsUri);
 1187|       |
 1188|       |    /* Try to map the ServerIndex to a Uri */
 1189|  26.6k|    UA_String srvUri = UA_STRING_NULL;
 1190|  26.6k|    if(eid->serverIndex > 0 && eid->serverIndex < serverUrisSize)
  ------------------
  |  Branch (1190:8): [True: 1.35k, False: 25.3k]
  |  Branch (1190:32): [True: 0, False: 1.35k]
  ------------------
 1191|      0|        srvUri = serverUris[eid->serverIndex];
 1192|       |
 1193|       |    /* No special escaping for ExpandedNodeIds */
 1194|  26.6k|    UA_Escaping idEsc = UA_ESCAPING_NONE;
 1195|       |
 1196|       |    /* Compute the NodeId string length */
 1197|  26.6k|    u8 nsStr[7];
 1198|  26.6k|    u8 numIdStr[12];
 1199|  26.6k|    char srvIdxStr[11];
 1200|  26.6k|    size_t srvIdxSize = 0;
 1201|  26.6k|    size_t idLen = nodeIdSize(&eid->nodeId, nsStr, numIdStr, nsUri, idEsc);
 1202|  26.6k|    if(idLen == 0)
  ------------------
  |  Branch (1202:8): [True: 0, False: 26.6k]
  ------------------
 1203|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 1204|  26.6k|    if(srvUri.length  > 0) {
  ------------------
  |  Branch (1204:8): [True: 0, False: 26.6k]
  ------------------
 1205|      0|        idLen += 5; /* svu=; */
 1206|      0|        idLen += UA_String_escapedSize(srvUri, UA_ESCAPING_PERCENT);
 1207|  26.6k|    } else if(eid->serverIndex > 0) {
  ------------------
  |  Branch (1207:15): [True: 1.35k, False: 25.3k]
  ------------------
 1208|  1.35k|        idLen += 5; /* svr=; */
 1209|  1.35k|        srvIdxSize = itoaUnsigned(eid->serverIndex, srvIdxStr, 10);
 1210|  1.35k|        idLen += srvIdxSize;
 1211|  1.35k|    }
 1212|       |
 1213|       |    /* Allocate memory if required */
 1214|  26.6k|    if(output->length == 0) {
  ------------------
  |  Branch (1214:8): [True: 26.6k, False: 0]
  ------------------
 1215|  26.6k|        UA_StatusCode res = UA_ByteString_allocBuffer((UA_ByteString*)output, idLen);
 1216|  26.6k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  26.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1216:12): [True: 0, False: 26.6k]
  ------------------
 1217|      0|            return res;
 1218|  26.6k|    } else {
 1219|      0|        if(output->length < idLen)
  ------------------
  |  Branch (1219:12): [True: 0, False: 0]
  ------------------
 1220|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
 1221|      0|        output->length = idLen;
 1222|      0|    }
 1223|       |
 1224|       |    /* Encode the ServerIndex or ServerUrl */
 1225|  26.6k|    u8 *pos = output->data;
 1226|  26.6k|    if(srvUri.length  > 0) {
  ------------------
  |  Branch (1226:8): [True: 0, False: 26.6k]
  ------------------
 1227|      0|        memcpy(pos, "svu=", 4);
 1228|      0|        pos += 4;
 1229|      0|        pos += UA_String_escapeInsert(pos, srvUri, UA_ESCAPING_PERCENT);
 1230|      0|        *pos++ = ';';
 1231|  26.6k|    } else if(eid->serverIndex > 0) {
  ------------------
  |  Branch (1231:15): [True: 1.35k, False: 25.3k]
  ------------------
 1232|  1.35k|        memcpy(pos, "svr=", 4);
 1233|  1.35k|        pos += 4;
 1234|  1.35k|        memcpy(pos, srvIdxStr, srvIdxSize);
 1235|  1.35k|        pos += srvIdxSize;
 1236|  1.35k|        *pos++ = ';';
 1237|  1.35k|    }
 1238|       |
 1239|       |    /* Print the NodeId */
 1240|  26.6k|    pos = printNodeIdBody(&eid->nodeId, nsUri, nsStr, numIdStr, pos, nsMapping, idEsc);
 1241|  26.6k|    output->length = (size_t)(pos - output->data);
 1242|  26.6k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  26.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1243|  26.6k|}
UA_Variant_isScalar:
 1362|  79.7k|UA_Variant_isScalar(const UA_Variant *v) {
 1363|  79.7k|    return (v->type != NULL && v->arrayLength == 0 &&
  ------------------
  |  Branch (1363:13): [True: 79.7k, False: 0]
  |  Branch (1363:32): [True: 74.3k, False: 5.42k]
  ------------------
 1364|  74.3k|            v->data > UA_EMPTY_ARRAY_SENTINEL);
  ------------------
  |  |  755|  74.3k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1364:13): [True: 68.8k, False: 5.48k]
  ------------------
 1365|  79.7k|}
UA_new:
 1917|  80.8k|UA_new(const UA_DataType *type) {
 1918|  80.8k|    void *p = UA_calloc(1, type->memSize);
  ------------------
  |  |   20|  80.8k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1919|  80.8k|    return p;
 1920|  80.8k|}
UA_copy:
 2093|   194k|UA_copy(const void *src, void *dst, const UA_DataType *type) {
 2094|   194k|    memset(dst, 0, type->memSize); /* init */
 2095|   194k|    UA_StatusCode retval = copyJumpTable[type->typeKind](src, dst, type);
 2096|   194k|    if(retval != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|   194k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2096:8): [True: 0, False: 194k]
  ------------------
 2097|      0|        UA_clear(dst, type);
 2098|   194k|    return retval;
 2099|   194k|}
UA_clear:
 2196|  2.68M|UA_clear(void *p, const UA_DataType *type) {
 2197|  2.68M|    clearJumpTable[type->typeKind](p, type);
 2198|  2.68M|    memset(p, 0, type->memSize); /* init */
 2199|  2.68M|}
UA_order:
 2650|  1.95k|UA_Order UA_order(const void *p1, const void *p2, const UA_DataType *type) {
 2651|  1.95k|    return orderJumpTable[type->typeKind](p1, p2, type);
 2652|  1.95k|}
UA_Array_copy:
 2674|   194k|              void **dst, const UA_DataType *type) {
 2675|   194k|    if(size == 0) {
  ------------------
  |  Branch (2675:8): [True: 11.7k, False: 183k]
  ------------------
 2676|  11.7k|        if(src == NULL)
  ------------------
  |  Branch (2676:12): [True: 0, False: 11.7k]
  ------------------
 2677|      0|            *dst = NULL;
 2678|  11.7k|        else
 2679|  11.7k|            *dst= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  11.7k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2680|  11.7k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  11.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2681|  11.7k|    }
 2682|       |
 2683|       |    /* Check the array consistency -- defensive programming in case the user
 2684|       |     * manually created an inconsistent array */
 2685|   183k|    if(UA_UNLIKELY(!type || !src))
  ------------------
  |  |  575|   366k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (575:25): [True: 0, False: 183k]
  |  |  |  Branch (575:43): [True: 0, False: 183k]
  |  |  |  Branch (575:43): [True: 0, False: 183k]
  |  |  ------------------
  ------------------
 2686|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 2687|       |
 2688|       |    /* calloc, so we don't have to check retval in every iteration of copying */
 2689|   183k|    *dst = UA_calloc(size, type->memSize);
  ------------------
  |  |   20|   183k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2690|   183k|    if(!*dst)
  ------------------
  |  Branch (2690:8): [True: 0, False: 183k]
  ------------------
 2691|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2692|       |
 2693|   183k|    if(type->pointerFree) {
  ------------------
  |  Branch (2693:8): [True: 183k, False: 0]
  ------------------
 2694|   183k|        memcpy(*dst, src, type->memSize * size);
 2695|   183k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   183k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2696|   183k|    }
 2697|       |
 2698|      0|    uintptr_t ptrs = (uintptr_t)src;
 2699|      0|    uintptr_t ptrd = (uintptr_t)*dst;
 2700|      0|    UA_StatusCode retval = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2701|      0|    for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2701:23): [True: 0, False: 0]
  ------------------
 2702|      0|        retval |= UA_copy((void*)ptrs, (void*)ptrd, type);
 2703|      0|        ptrs += type->memSize;
 2704|      0|        ptrd += type->memSize;
 2705|      0|    }
 2706|      0|    if(retval != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2706:8): [True: 0, False: 0]
  ------------------
 2707|      0|        UA_Array_delete(*dst, size, type);
 2708|       |        *dst = NULL;
 2709|      0|    }
 2710|      0|    return retval;
 2711|   183k|}
UA_Array_delete:
 2802|  4.45M|UA_Array_delete(void *p, size_t size, const UA_DataType *type) {
 2803|  4.45M|    if(!type->pointerFree) {
  ------------------
  |  Branch (2803:8): [True: 19.4k, False: 4.43M]
  ------------------
 2804|  19.4k|        uintptr_t ptr = (uintptr_t)p;
 2805|  2.37M|        for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2805:27): [True: 2.35M, False: 19.4k]
  ------------------
 2806|  2.35M|            UA_clear((void*)ptr, type);
 2807|  2.35M|            ptr += type->memSize;
 2808|  2.35M|        }
 2809|  19.4k|    }
 2810|  4.45M|    UA_free((void*)((uintptr_t)p & ~(uintptr_t)UA_EMPTY_ARRAY_SENTINEL));
  ------------------
  |  |   19|  4.45M|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2811|  4.45M|}
UA_DataType_isNumeric:
 2857|  2.92M|UA_DataType_isNumeric(const UA_DataType *type) {
 2858|  2.92M|    switch(type->typeKind) {
 2859|      0|    case UA_DATATYPEKIND_SBYTE:
  ------------------
  |  Branch (2859:5): [True: 0, False: 2.92M]
  ------------------
 2860|      0|    case UA_DATATYPEKIND_BYTE:
  ------------------
  |  Branch (2860:5): [True: 0, False: 2.92M]
  ------------------
 2861|      0|    case UA_DATATYPEKIND_INT16:
  ------------------
  |  Branch (2861:5): [True: 0, False: 2.92M]
  ------------------
 2862|      0|    case UA_DATATYPEKIND_UINT16:
  ------------------
  |  Branch (2862:5): [True: 0, False: 2.92M]
  ------------------
 2863|      0|    case UA_DATATYPEKIND_INT32:
  ------------------
  |  Branch (2863:5): [True: 0, False: 2.92M]
  ------------------
 2864|  2.92M|    case UA_DATATYPEKIND_UINT32:
  ------------------
  |  Branch (2864:5): [True: 2.92M, False: 0]
  ------------------
 2865|  2.92M|    case UA_DATATYPEKIND_INT64:
  ------------------
  |  Branch (2865:5): [True: 0, False: 2.92M]
  ------------------
 2866|  2.92M|    case UA_DATATYPEKIND_UINT64:
  ------------------
  |  Branch (2866:5): [True: 0, False: 2.92M]
  ------------------
 2867|  2.92M|    case UA_DATATYPEKIND_FLOAT:
  ------------------
  |  Branch (2867:5): [True: 0, False: 2.92M]
  ------------------
 2868|  2.92M|    case UA_DATATYPEKIND_DOUBLE:
  ------------------
  |  Branch (2868:5): [True: 0, False: 2.92M]
  ------------------
 2869|       |    /* not implemented: UA_DATATYPEKIND_DECIMAL */
 2870|  2.92M|        return true;
 2871|      0|    default:
  ------------------
  |  Branch (2871:5): [True: 0, False: 2.92M]
  ------------------
 2872|       |        return false;
 2873|  2.92M|    }
 2874|  2.92M|}
ua_types.c:nodeIdSize:
  929|  35.5k|           UA_Escaping idEsc) {
  930|       |    /* Namespace length */
  931|  35.5k|    size_t len = 0;
  932|  35.5k|    if(nsUri.data != NULL) {
  ------------------
  |  Branch (932:8): [True: 903, False: 34.6k]
  ------------------
  933|    903|        len += 5; /* nsu=; */
  934|    903|        len += UA_String_escapedSize(nsUri, UA_ESCAPING_PERCENT);
  935|  34.6k|    } else if(id->namespaceIndex > 0) {
  ------------------
  |  Branch (935:15): [True: 1.80k, False: 32.8k]
  ------------------
  936|  1.80k|        len += 4; /* ns=; */
  937|  1.80k|        size_t nsStrSize = itoaUnsigned(id->namespaceIndex, (char*)nsStr, 10);
  938|  1.80k|        nsStr[nsStrSize] = 0;
  939|  1.80k|        len += nsStrSize;
  940|  1.80k|    }
  941|       |
  942|  35.5k|    len += 2; /* ?= */
  943|       |
  944|  35.5k|    switch (id->identifierType) {
  945|  5.34k|    case UA_NODEIDTYPE_NUMERIC: {
  ------------------
  |  Branch (945:5): [True: 5.34k, False: 30.1k]
  ------------------
  946|  5.34k|        size_t numIdStrSize = itoaUnsigned(id->identifier.numeric, (char*)numIdStr, 10);
  947|  5.34k|        numIdStr[numIdStrSize] = 0;
  948|  5.34k|        len += numIdStrSize;
  949|  5.34k|        break;
  950|      0|    }
  951|  17.0k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (951:5): [True: 17.0k, False: 18.4k]
  ------------------
  952|  17.0k|        len += UA_String_escapedSize(id->identifier.string, idEsc);
  953|  17.0k|        break;
  954|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (954:5): [True: 0, False: 35.5k]
  ------------------
  955|      0|        len += 36;
  956|      0|        break;
  957|  13.1k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (957:5): [True: 13.1k, False: 22.4k]
  ------------------
  958|  13.1k|        len += 4 * ((id->identifier.byteString.length + 2) / 3);
  959|  13.1k|        break;
  960|      0|    default:
  ------------------
  |  Branch (960:5): [True: 0, False: 35.5k]
  ------------------
  961|      0|        len = 0;
  962|  35.5k|    }
  963|  35.5k|    return len;
  964|  35.5k|}
ua_types.c:printNodeIdBody:
  968|  35.5k|                const UA_NamespaceMapping *nsMapping, UA_Escaping idEsc) {
  969|  35.5k|    size_t len;
  970|       |
  971|       |    /* Encode the namespace */
  972|  35.5k|    if(nsUri.data != NULL) {
  ------------------
  |  Branch (972:8): [True: 903, False: 34.6k]
  ------------------
  973|    903|        memcpy(pos, "nsu=", 4);
  974|    903|        pos += 4;
  975|    903|        pos += UA_String_escapeInsert(pos, nsUri, UA_ESCAPING_PERCENT);
  976|    903|        *pos++ = ';';
  977|  34.6k|    } else if(id->namespaceIndex > 0) {
  ------------------
  |  Branch (977:15): [True: 1.80k, False: 32.8k]
  ------------------
  978|  1.80k|        memcpy(pos, "ns=", 3);
  979|  1.80k|        pos += 3;
  980|  1.80k|        len = strlen((char*)nsStr);
  981|  1.80k|        memcpy(pos, nsStr, len);
  982|  1.80k|        pos += len;
  983|  1.80k|        *pos++ = ';';
  984|  1.80k|    }
  985|       |
  986|       |    /* Encode the identifier */
  987|  35.5k|    switch(id->identifierType) {
  ------------------
  |  Branch (987:12): [True: 35.5k, False: 0]
  ------------------
  988|  5.34k|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (988:5): [True: 5.34k, False: 30.1k]
  ------------------
  989|  5.34k|        memcpy(pos, "i=", 2);
  990|  5.34k|        pos += 2;
  991|  5.34k|        len = strlen((char*)numIdStr);
  992|  5.34k|        memcpy(pos, numIdStr, len);
  993|  5.34k|        pos += len;
  994|  5.34k|        break;
  995|  17.0k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (995:5): [True: 17.0k, False: 18.4k]
  ------------------
  996|  17.0k|        memcpy(pos, "s=", 2);
  997|  17.0k|        pos += 2;
  998|  17.0k|        pos += UA_String_escapeInsert(pos, id->identifier.string, idEsc);
  999|  17.0k|        break;
 1000|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (1000:5): [True: 0, False: 35.5k]
  ------------------
 1001|      0|        memcpy(pos, "g=", 2);
 1002|      0|        pos += 2;
 1003|      0|        UA_Guid_to_hex(&id->identifier.guid, pos, true);
 1004|      0|        pos += 36;
 1005|      0|        break;
 1006|  13.1k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (1006:5): [True: 13.1k, False: 22.4k]
  ------------------
 1007|  13.1k|        memcpy(pos, "b=", 2);
 1008|  13.1k|        pos += 2;
 1009|       |        /* Use base64url encoding for percent-escaping.
 1010|       |         * Replace +/ with -_ and remove the padding. */
 1011|  13.1k|        u8 *bpos = pos;
 1012|  13.1k|        pos += UA_base64_buf(id->identifier.byteString.data,
 1013|  13.1k|                             id->identifier.byteString.length, pos);
 1014|  13.1k|        if(idEsc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (1014:12): [True: 0, False: 13.1k]
  ------------------
 1015|  13.1k|           idEsc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (1015:12): [True: 0, False: 13.1k]
  ------------------
 1016|      0|            while(pos > bpos && pos[-1] == '=')
  ------------------
  |  Branch (1016:19): [True: 0, False: 0]
  |  Branch (1016:33): [True: 0, False: 0]
  ------------------
 1017|      0|                pos--;
 1018|      0|            for(; bpos < pos; bpos++) {
  ------------------
  |  Branch (1018:19): [True: 0, False: 0]
  ------------------
 1019|      0|                if(*bpos == '+') *bpos = '-';
  ------------------
  |  Branch (1019:20): [True: 0, False: 0]
  ------------------
 1020|      0|                else if(*bpos == '/') *bpos = '_';
  ------------------
  |  Branch (1020:25): [True: 0, False: 0]
  ------------------
 1021|      0|            }
 1022|      0|        }
 1023|  13.1k|        break;
 1024|  35.5k|    }
 1025|  35.5k|    return pos;
 1026|  35.5k|}
ua_types.c:Variant_clear:
 1383|   232k|Variant_clear(void *p, const UA_DataType *_) {
 1384|   232k|    UA_Variant *v = (UA_Variant *)p;
 1385|       |
 1386|       |    /* The content is "borrowed" */
 1387|   232k|    if(v->storageType == UA_VARIANT_DATA_NODELETE)
  ------------------
  |  Branch (1387:8): [True: 0, False: 232k]
  ------------------
 1388|      0|        return;
 1389|       |
 1390|       |    /* Delete the value */
 1391|   232k|    if(v->type && v->data > UA_EMPTY_ARRAY_SENTINEL) {
  ------------------
  |  |  755|  92.2k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1391:8): [True: 92.2k, False: 140k]
  |  Branch (1391:19): [True: 86.2k, False: 5.99k]
  ------------------
 1392|  86.2k|        if(v->arrayLength == 0)
  ------------------
  |  Branch (1392:12): [True: 80.8k, False: 5.44k]
  ------------------
 1393|  80.8k|            v->arrayLength = 1;
 1394|  86.2k|        UA_Array_delete(v->data, v->arrayLength, v->type);
 1395|  86.2k|        v->data = NULL;
 1396|  86.2k|    }
 1397|       |
 1398|       |    /* Delete the array dimensions */
 1399|   232k|    if((void*)v->arrayDimensions > UA_EMPTY_ARRAY_SENTINEL)
  ------------------
  |  |  755|   232k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1399:8): [True: 2.69k, False: 229k]
  ------------------
 1400|  2.69k|        UA_free(v->arrayDimensions);
  ------------------
  |  |   19|  2.69k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1401|   232k|}
ua_types.c:DataValue_clear:
 1847|   130k|DataValue_clear(void *p, const UA_DataType *_) {
 1848|   130k|    UA_DataValue *dv = (UA_DataValue *)p;
 1849|       |    Variant_clear(&dv->value, NULL);
 1850|   130k|}
ua_types.c:String_copy:
  281|   194k|String_copy(const void *src, void *dst, const UA_DataType *_) {
  282|   194k|    const UA_String *srcS = (const UA_String*)src;
  283|   194k|    UA_String *dstS = (UA_String *)dst;
  284|   194k|    UA_StatusCode res =
  285|   194k|        UA_Array_copy(srcS->data, srcS->length, (void**)&dstS->data,
  286|   194k|                      &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|   194k|#define UA_TYPES_BYTE 2
  ------------------
  287|   194k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|   194k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (287:8): [True: 194k, False: 0]
  ------------------
  288|   194k|        dstS->length = srcS->length;
  289|   194k|    return res;
  290|   194k|}
ua_types.c:String_clear:
  293|  4.36M|String_clear(void *p, const UA_DataType *_) {
  294|  4.36M|    UA_String *s = (UA_String*)p;
  295|  4.36M|    UA_Array_delete(s->data, s->length, &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|  4.36M|#define UA_TYPES_BYTE 2
  ------------------
  296|  4.36M|}
ua_types.c:NodeId_clear:
  778|  28.1k|NodeId_clear(void *p, const UA_DataType *_) {
  779|  28.1k|    UA_NodeId *id = (UA_NodeId*)p;
  780|  28.1k|    switch(id->identifierType) {
  781|  11.6k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (781:5): [True: 11.6k, False: 16.4k]
  ------------------
  782|  20.4k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (782:5): [True: 8.79k, False: 19.3k]
  ------------------
  783|  20.4k|        String_clear(&id->identifier.string, NULL);
  784|  20.4k|        break;
  785|  7.65k|    default: break;
  ------------------
  |  Branch (785:5): [True: 7.65k, False: 20.4k]
  ------------------
  786|  28.1k|    }
  787|  28.1k|}
ua_types.c:ExpandedNodeId_clear:
 1079|  18.0k|ExpandedNodeId_clear(void *p, const UA_DataType *_) {
 1080|  18.0k|    UA_ExpandedNodeId *id = (UA_ExpandedNodeId*)p;
 1081|  18.0k|    NodeId_clear(&id->nodeId, NULL);
 1082|       |    String_clear(&id->namespaceUri, NULL);
 1083|  18.0k|}
ua_types.c:QualifiedName_clear:
  397|   185k|QualifiedName_clear(void *p, const UA_DataType *_) {
  398|   185k|    UA_QualifiedName *qn = (UA_QualifiedName*)p;
  399|       |    String_clear(&qn->name, NULL);
  400|   185k|}
ua_types.c:LocalizedText_clear:
 1830|  1.90M|LocalizedText_clear(void *p, const UA_DataType *_) {
 1831|  1.90M|    UA_LocalizedText *lt = (UA_LocalizedText *)p;
 1832|  1.90M|    String_clear(&lt->locale, NULL);
 1833|       |    String_clear(&lt->text, NULL);
 1834|  1.90M|}
ua_types.c:ExtensionObject_clear:
 1252|  3.62k|ExtensionObject_clear(void *p, const UA_DataType *_) {
 1253|  3.62k|    UA_ExtensionObject *eo = (UA_ExtensionObject *)p;
 1254|  3.62k|    switch(eo->encoding) {
 1255|  3.62k|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (1255:5): [True: 3.62k, False: 0]
  ------------------
 1256|  3.62k|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (1256:5): [True: 0, False: 3.62k]
  ------------------
 1257|  3.62k|    case UA_EXTENSIONOBJECT_ENCODED_XML:
  ------------------
  |  Branch (1257:5): [True: 0, False: 3.62k]
  ------------------
 1258|  3.62k|        NodeId_clear(&eo->content.encoded.typeId, NULL);
 1259|  3.62k|        String_clear(&eo->content.encoded.body, NULL);
 1260|  3.62k|        break;
 1261|      0|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (1261:5): [True: 0, False: 3.62k]
  ------------------
 1262|      0|        if(eo->content.decoded.data)
  ------------------
  |  Branch (1262:12): [True: 0, False: 0]
  ------------------
 1263|      0|            UA_delete(eo->content.decoded.data, eo->content.decoded.type);
 1264|      0|        break;
 1265|      0|    default:
  ------------------
  |  Branch (1265:5): [True: 0, False: 3.62k]
  ------------------
 1266|      0|        break;
 1267|  3.62k|    }
 1268|  3.62k|}
ua_types.c:DiagnosticInfo_clear:
 1877|  1.26k|DiagnosticInfo_clear(void *p, const UA_DataType *_) {
 1878|  1.26k|    UA_DiagnosticInfo *di = (UA_DiagnosticInfo *)p;
 1879|       |
 1880|  1.26k|    String_clear(&di->additionalInfo, NULL);
 1881|  1.26k|    if(di->hasInnerDiagnosticInfo && di->innerDiagnosticInfo) {
  ------------------
  |  Branch (1881:8): [True: 0, False: 1.26k]
  |  Branch (1881:38): [True: 0, False: 0]
  ------------------
 1882|      0|        DiagnosticInfo_clear(di->innerDiagnosticInfo, NULL);
 1883|      0|        UA_free(di->innerDiagnosticInfo);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1884|      0|    }
 1885|  1.26k|}
ua_types.c:guidOrder:
 2251|  1.40k|guidOrder(const UA_Guid *p1, const UA_Guid *p2, const UA_DataType *type) {
 2252|  1.40k|    if(p1->data1 != p2->data1)
  ------------------
  |  Branch (2252:8): [True: 0, False: 1.40k]
  ------------------
 2253|      0|        return (p1->data1 < p2->data1) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2253:16): [True: 0, False: 0]
  ------------------
 2254|  1.40k|    if(p1->data2 != p2->data2)
  ------------------
  |  Branch (2254:8): [True: 0, False: 1.40k]
  ------------------
 2255|      0|        return (p1->data2 < p2->data2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2255:16): [True: 0, False: 0]
  ------------------
 2256|  1.40k|    if(p1->data3 != p2->data3)
  ------------------
  |  Branch (2256:8): [True: 0, False: 1.40k]
  ------------------
 2257|      0|        return (p1->data3 < p2->data3) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2257:16): [True: 0, False: 0]
  ------------------
 2258|  1.40k|    int cmp = memcmp(p1->data4, p2->data4, 8);
 2259|  1.40k|    if(cmp != 0)
  ------------------
  |  Branch (2259:8): [True: 0, False: 1.40k]
  ------------------
 2260|      0|        return (cmp < 0) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2260:16): [True: 0, False: 0]
  ------------------
 2261|  1.40k|    return UA_ORDER_EQ;
 2262|  1.40k|}
ua_types.c:nodeIdOrder:
 2280|  11.8k|nodeIdOrder(const UA_NodeId *p1, const UA_NodeId *p2, const UA_DataType *_) {
 2281|       |    /* Compare namespaceIndex */
 2282|  11.8k|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2282:8): [True: 0, False: 11.8k]
  ------------------
 2283|      0|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2283:16): [True: 0, False: 0]
  ------------------
 2284|       |
 2285|       |    /* Compare identifierType */
 2286|  11.8k|    if(p1->identifierType != p2->identifierType)
  ------------------
  |  Branch (2286:8): [True: 0, False: 11.8k]
  ------------------
 2287|      0|        return (p1->identifierType < p2->identifierType) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2287:16): [True: 0, False: 0]
  ------------------
 2288|       |
 2289|       |    /* Compare the identifier */
 2290|  11.8k|    switch(p1->identifierType) {
 2291|  1.78k|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (2291:5): [True: 1.78k, False: 10.0k]
  ------------------
 2292|  1.78k|    default:
  ------------------
  |  Branch (2292:5): [True: 0, False: 11.8k]
  ------------------
 2293|  1.78k|        if(p1->identifier.numeric != p2->identifier.numeric)
  ------------------
  |  Branch (2293:12): [True: 0, False: 1.78k]
  ------------------
 2294|      0|            return (p1->identifier.numeric < p2->identifier.numeric) ?
  ------------------
  |  Branch (2294:20): [True: 0, False: 0]
  ------------------
 2295|      0|                UA_ORDER_LESS : UA_ORDER_MORE;
 2296|  1.78k|        return UA_ORDER_EQ;
 2297|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (2297:5): [True: 0, False: 11.8k]
  ------------------
 2298|      0|        return guidOrder(&p1->identifier.guid, &p2->identifier.guid, NULL);
 2299|  5.69k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (2299:5): [True: 5.69k, False: 6.15k]
  ------------------
 2300|  10.0k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (2300:5): [True: 4.37k, False: 7.47k]
  ------------------
 2301|       |        return stringOrder(&p1->identifier.string, &p2->identifier.string, NULL);
 2302|  11.8k|    }
 2303|  11.8k|}
ua_types.c:expandedNodeIdOrder:
 2307|  8.88k|                    const UA_DataType *_) {
 2308|  8.88k|    if(p1->serverIndex != p2->serverIndex)
  ------------------
  |  Branch (2308:8): [True: 0, False: 8.88k]
  ------------------
 2309|      0|        return (p1->serverIndex < p2->serverIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2309:16): [True: 0, False: 0]
  ------------------
 2310|  8.88k|    UA_Order o = stringOrder(&p1->namespaceUri, &p2->namespaceUri, NULL);
 2311|  8.88k|    if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2311:8): [True: 0, False: 8.88k]
  ------------------
 2312|      0|        return o;
 2313|  8.88k|    return nodeIdOrder(&p1->nodeId, &p2->nodeId, NULL);
 2314|  8.88k|}
ua_types.c:booleanOrder:
 2213|  4.84k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2214|  4.84k|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2214:12): [True: 0, False: 4.84k]
  ------------------
 2215|  4.84k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2215:20): [True: 0, False: 0]
  ------------------
 2216|  4.84k|        return UA_ORDER_EQ;                                         \
 2217|  4.84k|    }
ua_types.c:sByteOrder:
 2213|  36.5k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2214|  36.5k|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2214:12): [True: 0, False: 36.5k]
  ------------------
 2215|  36.5k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2215:20): [True: 0, False: 0]
  ------------------
 2216|  36.5k|        return UA_ORDER_EQ;                                         \
 2217|  36.5k|    }
ua_types.c:byteOrder:
 2213|  12.4k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2214|  12.4k|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2214:12): [True: 0, False: 12.4k]
  ------------------
 2215|  12.4k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2215:20): [True: 0, False: 0]
  ------------------
 2216|  12.4k|        return UA_ORDER_EQ;                                         \
 2217|  12.4k|    }
ua_types.c:int16Order:
 2213|  8.73k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2214|  8.73k|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2214:12): [True: 0, False: 8.73k]
  ------------------
 2215|  8.73k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2215:20): [True: 0, False: 0]
  ------------------
 2216|  8.73k|        return UA_ORDER_EQ;                                         \
 2217|  8.73k|    }
ua_types.c:uInt16Order:
 2213|  4.57k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2214|  4.57k|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2214:12): [True: 0, False: 4.57k]
  ------------------
 2215|  4.57k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2215:20): [True: 0, False: 0]
  ------------------
 2216|  4.57k|        return UA_ORDER_EQ;                                         \
 2217|  4.57k|    }
ua_types.c:int32Order:
 2213|   892k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2214|   892k|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2214:12): [True: 0, False: 892k]
  ------------------
 2215|   892k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2215:20): [True: 0, False: 0]
  ------------------
 2216|   892k|        return UA_ORDER_EQ;                                         \
 2217|   892k|    }
ua_types.c:uInt32Order:
 2213|   977k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2214|   977k|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2214:12): [True: 0, False: 977k]
  ------------------
 2215|   977k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2215:20): [True: 0, False: 0]
  ------------------
 2216|   977k|        return UA_ORDER_EQ;                                         \
 2217|   977k|    }
ua_types.c:int64Order:
 2213|   753k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2214|   753k|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2214:12): [True: 0, False: 753k]
  ------------------
 2215|   753k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2215:20): [True: 0, False: 0]
  ------------------
 2216|   753k|        return UA_ORDER_EQ;                                         \
 2217|   753k|    }
ua_types.c:uInt64Order:
 2213|  1.61M|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2214|  1.61M|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2214:12): [True: 0, False: 1.61M]
  ------------------
 2215|  1.61M|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2215:20): [True: 0, False: 0]
  ------------------
 2216|  1.61M|        return UA_ORDER_EQ;                                         \
 2217|  1.61M|    }
ua_types.c:floatOrder:
 2231|   371k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2232|   371k|        if(*p1 != *p2) {                                            \
  ------------------
  |  Branch (2232:12): [True: 1.57k, False: 369k]
  ------------------
 2233|  1.57k|            /* p1 is NaN */                                         \
 2234|  1.57k|            if(*p1 != *p1) {                                        \
  ------------------
  |  Branch (2234:16): [True: 1.57k, False: 0]
  ------------------
 2235|  1.57k|                if(*p2 != *p2)                                      \
  ------------------
  |  Branch (2235:20): [True: 1.57k, False: 0]
  ------------------
 2236|  1.57k|                    return UA_ORDER_EQ;                             \
 2237|  1.57k|                return UA_ORDER_LESS;                               \
 2238|  1.57k|            }                                                       \
 2239|  1.57k|            /* p2 is NaN */                                         \
 2240|  1.57k|            if(*p2 != *p2)                                          \
  ------------------
  |  Branch (2240:16): [True: 0, False: 0]
  ------------------
 2241|      0|                return UA_ORDER_MORE;                               \
 2242|      0|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2242:20): [True: 0, False: 0]
  ------------------
 2243|      0|        }                                                           \
 2244|   371k|        return UA_ORDER_EQ;                                         \
 2245|   371k|    }
ua_types.c:doubleOrder:
 2231|   138k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2232|   138k|        if(*p1 != *p2) {                                            \
  ------------------
  |  Branch (2232:12): [True: 278, False: 138k]
  ------------------
 2233|    278|            /* p1 is NaN */                                         \
 2234|    278|            if(*p1 != *p1) {                                        \
  ------------------
  |  Branch (2234:16): [True: 278, False: 0]
  ------------------
 2235|    278|                if(*p2 != *p2)                                      \
  ------------------
  |  Branch (2235:20): [True: 278, False: 0]
  ------------------
 2236|    278|                    return UA_ORDER_EQ;                             \
 2237|    278|                return UA_ORDER_LESS;                               \
 2238|    278|            }                                                       \
 2239|    278|            /* p2 is NaN */                                         \
 2240|    278|            if(*p2 != *p2)                                          \
  ------------------
  |  Branch (2240:16): [True: 0, False: 0]
  ------------------
 2241|      0|                return UA_ORDER_MORE;                               \
 2242|      0|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2242:20): [True: 0, False: 0]
  ------------------
 2243|      0|        }                                                           \
 2244|   138k|        return UA_ORDER_EQ;                                         \
 2245|   138k|    }
ua_types.c:stringOrder:
 2265|  1.95M|stringOrder(const UA_String *p1, const UA_String *p2, const UA_DataType *type) {
 2266|  1.95M|    if(p1->length != p2->length)
  ------------------
  |  Branch (2266:8): [True: 0, False: 1.95M]
  ------------------
 2267|      0|        return (p1->length < p2->length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2267:16): [True: 0, False: 0]
  ------------------
 2268|       |    /* For zero-length arrays, every pointer not NULL is considered a
 2269|       |     * UA_EMPTY_ARRAY_SENTINEL. */
 2270|  1.95M|    if(p1->data == p2->data) return UA_ORDER_EQ;
  ------------------
  |  Branch (2270:8): [True: 1.92M, False: 25.9k]
  ------------------
 2271|  25.9k|    if(p1->data == NULL) return UA_ORDER_LESS;
  ------------------
  |  Branch (2271:8): [True: 0, False: 25.9k]
  ------------------
 2272|  25.9k|    if(p2->data == NULL) return UA_ORDER_MORE;
  ------------------
  |  Branch (2272:8): [True: 0, False: 25.9k]
  ------------------
 2273|  25.9k|    int cmp = memcmp((const char*)p1->data, (const char*)p2->data, p1->length);
 2274|  25.9k|    if(cmp != 0)
  ------------------
  |  Branch (2274:8): [True: 0, False: 25.9k]
  ------------------
 2275|      0|        return (cmp < 0) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2275:16): [True: 0, False: 0]
  ------------------
 2276|  25.9k|    return UA_ORDER_EQ;
 2277|  25.9k|}
ua_types.c:qualifiedNameOrder:
 2318|  24.2k|                   const UA_DataType *_) {
 2319|  24.2k|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2319:8): [True: 0, False: 24.2k]
  ------------------
 2320|      0|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2320:16): [True: 0, False: 0]
  ------------------
 2321|  24.2k|    return stringOrder(&p1->name, &p2->name, NULL);
 2322|  24.2k|}
ua_types.c:localizedTextOrder:
 2326|   951k|                   const UA_DataType *_) {
 2327|   951k|    UA_Order o = stringOrder(&p1->locale, &p2->locale, NULL);
 2328|   951k|    if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2328:8): [True: 0, False: 951k]
  ------------------
 2329|      0|        return o;
 2330|   951k|    return stringOrder(&p1->text, &p2->text, NULL);
 2331|   951k|}
ua_types.c:extensionObjectOrder:
 2335|  1.70k|                     const UA_DataType *_) {
 2336|  1.70k|    UA_ExtensionObjectEncoding enc1 = p1->encoding;
 2337|  1.70k|    UA_ExtensionObjectEncoding enc2 = p2->encoding;
 2338|  1.70k|    if(enc1 > UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2338:8): [True: 0, False: 1.70k]
  ------------------
 2339|      0|        enc1 = UA_EXTENSIONOBJECT_DECODED;
 2340|  1.70k|    if(enc2 > UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2340:8): [True: 0, False: 1.70k]
  ------------------
 2341|      0|        enc2 = UA_EXTENSIONOBJECT_DECODED;
 2342|  1.70k|    if(enc1 != enc2)
  ------------------
  |  Branch (2342:8): [True: 0, False: 1.70k]
  ------------------
 2343|      0|        return (enc1 < enc2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2343:16): [True: 0, False: 0]
  ------------------
 2344|       |
 2345|  1.70k|    switch(enc1) {
 2346|  1.70k|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (2346:5): [True: 1.70k, False: 0]
  ------------------
 2347|  1.70k|        return UA_ORDER_EQ;
 2348|       |
 2349|      0|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (2349:5): [True: 0, False: 1.70k]
  ------------------
 2350|      0|    case UA_EXTENSIONOBJECT_ENCODED_XML: {
  ------------------
  |  Branch (2350:5): [True: 0, False: 1.70k]
  ------------------
 2351|      0|            UA_Order o = nodeIdOrder(&p1->content.encoded.typeId,
 2352|      0|                                     &p2->content.encoded.typeId, NULL);
 2353|      0|            if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2353:16): [True: 0, False: 0]
  ------------------
 2354|      0|                return o;
 2355|      0|            return stringOrder((const UA_String*)&p1->content.encoded.body,
 2356|      0|                               (const UA_String*)&p2->content.encoded.body, NULL);
 2357|      0|        }
 2358|       |
 2359|      0|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (2359:5): [True: 0, False: 1.70k]
  ------------------
 2360|      0|    default: {
  ------------------
  |  Branch (2360:5): [True: 0, False: 1.70k]
  ------------------
 2361|      0|            const UA_DataType *type1 = p1->content.decoded.type;
 2362|      0|            const UA_DataType *type2 = p2->content.decoded.type;
 2363|      0|            if(type1 != type2)
  ------------------
  |  Branch (2363:16): [True: 0, False: 0]
  ------------------
 2364|      0|                return ((uintptr_t)type1 < (uintptr_t)type2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2364:24): [True: 0, False: 0]
  ------------------
 2365|      0|            if(!type1)
  ------------------
  |  Branch (2365:16): [True: 0, False: 0]
  ------------------
 2366|      0|                return UA_ORDER_EQ;
 2367|      0|            return orderJumpTable[type1->typeKind]
 2368|      0|                (p1->content.decoded.data, p2->content.decoded.data, type1);
 2369|      0|        }
 2370|  1.70k|    }
 2371|  1.70k|}
ua_types.c:dataValueOrder:
 2433|  59.3k|dataValueOrder(const UA_DataValue *p1, const UA_DataValue *p2, const UA_DataType *_) {
 2434|       |    /* Value */
 2435|  59.3k|    if(p1->hasValue != p2->hasValue)
  ------------------
  |  Branch (2435:8): [True: 0, False: 59.3k]
  ------------------
 2436|      0|        return (!p1->hasValue) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2436:16): [True: 0, False: 0]
  ------------------
 2437|  59.3k|    if(p1->hasValue) {
  ------------------
  |  Branch (2437:8): [True: 26.3k, False: 33.0k]
  ------------------
 2438|  26.3k|        UA_Order o = variantOrder(&p1->value, &p2->value, NULL);
 2439|  26.3k|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2439:12): [True: 0, False: 26.3k]
  ------------------
 2440|      0|            return o;
 2441|  26.3k|    }
 2442|       |
 2443|       |    /* Status */
 2444|  59.3k|    if(p1->hasStatus != p2->hasStatus)
  ------------------
  |  Branch (2444:8): [True: 0, False: 59.3k]
  ------------------
 2445|      0|        return (!p1->hasStatus) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2445:16): [True: 0, False: 0]
  ------------------
 2446|  59.3k|    if(p1->hasStatus && p1->status != p2->status)
  ------------------
  |  Branch (2446:8): [True: 7, False: 59.3k]
  |  Branch (2446:25): [True: 0, False: 7]
  ------------------
 2447|      0|        return (p1->status < p2->status) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2447:16): [True: 0, False: 0]
  ------------------
 2448|       |
 2449|       |    /* SourceTimestamp */
 2450|  59.3k|    if(p1->hasSourceTimestamp != p2->hasSourceTimestamp)
  ------------------
  |  Branch (2450:8): [True: 0, False: 59.3k]
  ------------------
 2451|      0|        return (!p1->hasSourceTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2451:16): [True: 0, False: 0]
  ------------------
 2452|  59.3k|    if(p1->hasSourceTimestamp && p1->sourceTimestamp != p2->sourceTimestamp)
  ------------------
  |  Branch (2452:8): [True: 0, False: 59.3k]
  |  Branch (2452:34): [True: 0, False: 0]
  ------------------
 2453|      0|        return (p1->sourceTimestamp < p2->sourceTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2453:16): [True: 0, False: 0]
  ------------------
 2454|       |
 2455|       |    /* ServerTimestamp */
 2456|  59.3k|    if(p1->hasServerTimestamp != p2->hasServerTimestamp)
  ------------------
  |  Branch (2456:8): [True: 0, False: 59.3k]
  ------------------
 2457|      0|        return (!p1->hasServerTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2457:16): [True: 0, False: 0]
  ------------------
 2458|  59.3k|    if(p1->hasServerTimestamp && p1->serverTimestamp != p2->serverTimestamp)
  ------------------
  |  Branch (2458:8): [True: 0, False: 59.3k]
  |  Branch (2458:34): [True: 0, False: 0]
  ------------------
 2459|      0|        return (p1->serverTimestamp < p2->serverTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2459:16): [True: 0, False: 0]
  ------------------
 2460|       |
 2461|       |    /* SourcePicoseconds */
 2462|  59.3k|    if(p1->hasSourcePicoseconds != p2->hasSourcePicoseconds)
  ------------------
  |  Branch (2462:8): [True: 0, False: 59.3k]
  ------------------
 2463|      0|        return (!p1->hasSourcePicoseconds) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2463:16): [True: 0, False: 0]
  ------------------
 2464|  59.3k|    if(p1->hasSourcePicoseconds && p1->sourcePicoseconds != p2->sourcePicoseconds)
  ------------------
  |  Branch (2464:8): [True: 0, False: 59.3k]
  |  Branch (2464:36): [True: 0, False: 0]
  ------------------
 2465|      0|        return (p1->sourcePicoseconds < p2->sourcePicoseconds) ?
  ------------------
  |  Branch (2465:16): [True: 0, False: 0]
  ------------------
 2466|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2467|       |
 2468|       |    /* ServerPicoseconds */
 2469|  59.3k|    if(p1->hasServerPicoseconds != p2->hasServerPicoseconds)
  ------------------
  |  Branch (2469:8): [True: 0, False: 59.3k]
  ------------------
 2470|      0|        return (!p1->hasServerPicoseconds) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2470:16): [True: 0, False: 0]
  ------------------
 2471|  59.3k|    if(p1->hasServerPicoseconds && p1->serverPicoseconds != p2->serverPicoseconds)
  ------------------
  |  Branch (2471:8): [True: 0, False: 59.3k]
  |  Branch (2471:36): [True: 0, False: 0]
  ------------------
 2472|      0|        return (p1->serverPicoseconds < p2->serverPicoseconds) ?
  ------------------
  |  Branch (2472:16): [True: 0, False: 0]
  ------------------
 2473|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2474|       |
 2475|  59.3k|    return UA_ORDER_EQ;
 2476|  59.3k|}
ua_types.c:variantOrder:
 2398|  75.9k|variantOrder(const UA_Variant *p1, const UA_Variant *p2, const UA_DataType *_) {
 2399|  75.9k|    if(p1->type != p2->type)
  ------------------
  |  Branch (2399:8): [True: 0, False: 75.9k]
  ------------------
 2400|      0|        return ((uintptr_t)p1->type < (uintptr_t)p2->type) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2400:16): [True: 0, False: 0]
  ------------------
 2401|       |
 2402|  75.9k|    UA_Order o;
 2403|  75.9k|    if(p1->type != NULL) {
  ------------------
  |  Branch (2403:8): [True: 39.8k, False: 36.1k]
  ------------------
 2404|       |        /* Check if both variants are scalars or arrays */
 2405|  39.8k|        UA_Boolean s1 = UA_Variant_isScalar(p1);
 2406|  39.8k|        UA_Boolean s2 = UA_Variant_isScalar(p2);
 2407|  39.8k|        if(s1 != s2)
  ------------------
  |  Branch (2407:12): [True: 0, False: 39.8k]
  ------------------
 2408|      0|            return s1 ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2408:20): [True: 0, False: 0]
  ------------------
 2409|  39.8k|        if(s1) {
  ------------------
  |  Branch (2409:12): [True: 34.4k, False: 5.45k]
  ------------------
 2410|  34.4k|            o = orderJumpTable[p1->type->typeKind](p1->data, p2->data, p1->type);
 2411|  34.4k|        } else {
 2412|       |            /* Mismatching array length? */
 2413|  5.45k|            if(p1->arrayLength != p2->arrayLength)
  ------------------
  |  Branch (2413:16): [True: 0, False: 5.45k]
  ------------------
 2414|      0|                return (p1->arrayLength < p2->arrayLength) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2414:24): [True: 0, False: 0]
  ------------------
 2415|  5.45k|            o = arrayOrder(p1->data, p1->arrayLength, p2->data, p2->arrayLength, p1->type);
 2416|  5.45k|        }
 2417|  39.8k|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2417:12): [True: 0, False: 39.8k]
  ------------------
 2418|      0|            return o;
 2419|  39.8k|    }
 2420|       |
 2421|  75.9k|    if(p1->arrayDimensionsSize != p2->arrayDimensionsSize)
  ------------------
  |  Branch (2421:8): [True: 0, False: 75.9k]
  ------------------
 2422|      0|        return (p1->arrayDimensionsSize < p2->arrayDimensionsSize) ?
  ------------------
  |  Branch (2422:16): [True: 0, False: 0]
  ------------------
 2423|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2424|  75.9k|    o = UA_ORDER_EQ;
 2425|  75.9k|    if(p1->arrayDimensionsSize > 0)
  ------------------
  |  Branch (2425:8): [True: 1.31k, False: 74.6k]
  ------------------
 2426|  1.31k|        o = arrayOrder(p1->arrayDimensions, p1->arrayDimensionsSize,
 2427|  1.31k|                       p2->arrayDimensions, p2->arrayDimensionsSize,
 2428|  1.31k|                       &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  225|  1.31k|#define UA_TYPES_UINT32 6
  ------------------
 2429|  75.9k|    return o;
 2430|  75.9k|}
ua_types.c:arrayOrder:
 2382|  6.76k|           const UA_DataType *type) {
 2383|  6.76k|    if(p1Length != p2Length)
  ------------------
  |  Branch (2383:8): [True: 0, False: 6.76k]
  ------------------
 2384|      0|        return (p1Length < p2Length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2384:16): [True: 0, False: 0]
  ------------------
 2385|  6.76k|    uintptr_t u1 = (uintptr_t)p1;
 2386|  6.76k|    uintptr_t u2 = (uintptr_t)p2;
 2387|  5.89M|    for(size_t i = 0; i < p1Length; i++) {
  ------------------
  |  Branch (2387:23): [True: 5.88M, False: 6.76k]
  ------------------
 2388|  5.88M|        UA_Order o = orderJumpTable[type->typeKind]((const void*)u1, (const void*)u2, type);
 2389|  5.88M|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2389:12): [True: 0, False: 5.88M]
  ------------------
 2390|      0|            return o;
 2391|  5.88M|        u1 += type->memSize;
 2392|  5.88M|        u2 += type->memSize;
 2393|  5.88M|    }
 2394|  6.76k|    return UA_ORDER_EQ;
 2395|  6.76k|}
ua_types.c:diagnosticInfoOrder:
 2480|    630|                    const UA_DataType *_) {
 2481|       |    /* SymbolicId */
 2482|    630|    if(p1->hasSymbolicId != p2->hasSymbolicId)
  ------------------
  |  Branch (2482:8): [True: 0, False: 630]
  ------------------
 2483|      0|        return (!p1->hasSymbolicId) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2483:16): [True: 0, False: 0]
  ------------------
 2484|    630|    if(p1->hasSymbolicId && p1->symbolicId != p2->symbolicId)
  ------------------
  |  Branch (2484:8): [True: 0, False: 630]
  |  Branch (2484:29): [True: 0, False: 0]
  ------------------
 2485|      0|        return (p1->symbolicId < p2->symbolicId) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2485:16): [True: 0, False: 0]
  ------------------
 2486|       |
 2487|       |    /* NamespaceUri */
 2488|    630|    if(p1->hasNamespaceUri != p2->hasNamespaceUri)
  ------------------
  |  Branch (2488:8): [True: 0, False: 630]
  ------------------
 2489|      0|        return (!p1->hasNamespaceUri) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2489:16): [True: 0, False: 0]
  ------------------
 2490|    630|    if(p1->hasNamespaceUri && p1->namespaceUri != p2->namespaceUri)
  ------------------
  |  Branch (2490:8): [True: 0, False: 630]
  |  Branch (2490:31): [True: 0, False: 0]
  ------------------
 2491|      0|        return (p1->namespaceUri < p2->namespaceUri) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2491:16): [True: 0, False: 0]
  ------------------
 2492|       |
 2493|       |    /* LocalizedText */
 2494|    630|    if(p1->hasLocalizedText != p2->hasLocalizedText)
  ------------------
  |  Branch (2494:8): [True: 0, False: 630]
  ------------------
 2495|      0|        return (!p1->hasLocalizedText) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2495:16): [True: 0, False: 0]
  ------------------
 2496|    630|    if(p1->hasLocalizedText && p1->localizedText != p2->localizedText)
  ------------------
  |  Branch (2496:8): [True: 0, False: 630]
  |  Branch (2496:32): [True: 0, False: 0]
  ------------------
 2497|      0|        return (p1->localizedText < p2->localizedText) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2497:16): [True: 0, False: 0]
  ------------------
 2498|       |
 2499|       |    /* Locale */
 2500|    630|    if(p1->hasLocale != p2->hasLocale)
  ------------------
  |  Branch (2500:8): [True: 0, False: 630]
  ------------------
 2501|      0|        return (!p1->hasLocale) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2501:16): [True: 0, False: 0]
  ------------------
 2502|    630|    if(p1->hasLocale && p1->locale != p2->locale)
  ------------------
  |  Branch (2502:8): [True: 0, False: 630]
  |  Branch (2502:25): [True: 0, False: 0]
  ------------------
 2503|      0|        return (p1->locale < p2->locale) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2503:16): [True: 0, False: 0]
  ------------------
 2504|       |
 2505|       |    /* AdditionalInfo */
 2506|    630|    if(p1->hasAdditionalInfo != p2->hasAdditionalInfo)
  ------------------
  |  Branch (2506:8): [True: 0, False: 630]
  ------------------
 2507|      0|        return (!p1->hasAdditionalInfo) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2507:16): [True: 0, False: 0]
  ------------------
 2508|    630|    if(p1->hasAdditionalInfo) {
  ------------------
  |  Branch (2508:8): [True: 0, False: 630]
  ------------------
 2509|      0|        UA_Order o = stringOrder(&p1->additionalInfo, &p2->additionalInfo, NULL);
 2510|      0|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2510:12): [True: 0, False: 0]
  ------------------
 2511|      0|            return o;
 2512|      0|    }
 2513|       |
 2514|       |    /* InnerStatusCode */
 2515|    630|    if(p1->hasInnerStatusCode != p2->hasInnerStatusCode)
  ------------------
  |  Branch (2515:8): [True: 0, False: 630]
  ------------------
 2516|      0|        return (!p1->hasInnerStatusCode) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2516:16): [True: 0, False: 0]
  ------------------
 2517|    630|    if(p1->hasInnerStatusCode && p1->innerStatusCode != p2->innerStatusCode)
  ------------------
  |  Branch (2517:8): [True: 0, False: 630]
  |  Branch (2517:34): [True: 0, False: 0]
  ------------------
 2518|      0|        return (p1->innerStatusCode < p2->innerStatusCode) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2518:16): [True: 0, False: 0]
  ------------------
 2519|       |
 2520|       |    /* InnerDiagnosticInfo */
 2521|    630|    if(p1->hasInnerDiagnosticInfo != p2->hasInnerDiagnosticInfo)
  ------------------
  |  Branch (2521:8): [True: 0, False: 630]
  ------------------
 2522|      0|        return (!p1->hasInnerDiagnosticInfo) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2522:16): [True: 0, False: 0]
  ------------------
 2523|    630|    if(p1->innerDiagnosticInfo == p2->innerDiagnosticInfo)
  ------------------
  |  Branch (2523:8): [True: 630, False: 0]
  ------------------
 2524|    630|        return UA_ORDER_EQ;
 2525|      0|    if(!p1->innerDiagnosticInfo || !p2->innerDiagnosticInfo)
  ------------------
  |  Branch (2525:8): [True: 0, False: 0]
  |  Branch (2525:36): [True: 0, False: 0]
  ------------------
 2526|      0|        return (!p1->innerDiagnosticInfo) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2526:16): [True: 0, False: 0]
  ------------------
 2527|      0|    return diagnosticInfoOrder(p1->innerDiagnosticInfo, p2->innerDiagnosticInfo, NULL);
 2528|      0|}

writeJsonBeforeElement:
   80|  23.6M|writeJsonBeforeElement(CtxJson *ctx, UA_Boolean distinct) {
   81|  23.6M|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  23.6M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   82|       |    /* Comma if needed */
   83|  23.6M|    if(ctx->commaNeeded[ctx->depth])
  ------------------
  |  Branch (83:8): [True: 20.6M, False: 2.98M]
  ------------------
   84|  20.6M|        res |= writeChar(ctx, ',');
   85|  23.6M|    if(ctx->prettyPrint) {
  ------------------
  |  Branch (85:8): [True: 0, False: 23.6M]
  ------------------
   86|      0|        if(distinct) {
  ------------------
  |  Branch (86:12): [True: 0, False: 0]
  ------------------
   87|       |            /* Newline and indent if needed */
   88|      0|            res |= writeChar(ctx, '\n');
   89|      0|            for(size_t i = 0; i < ctx->depth; i++)
  ------------------
  |  Branch (89:31): [True: 0, False: 0]
  ------------------
   90|      0|                res |= writeChar(ctx, '\t');
   91|      0|        } else if(ctx->commaNeeded[ctx->depth]) {
  ------------------
  |  Branch (91:19): [True: 0, False: 0]
  ------------------
   92|       |            /* Space after the comma if no newline */
   93|      0|            res |= writeChar(ctx, ' ');
   94|      0|        }
   95|      0|    }
   96|  23.6M|    return res;
   97|  23.6M|}
writeJsonObjStart:
   99|  3.18M|WRITE_JSON_ELEMENT(ObjStart) {
  100|       |    /* Increase depth, save: before first key-value no comma needed. */
  101|  3.18M|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|  3.18M|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (101:8): [True: 0, False: 3.18M]
  ------------------
  102|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  103|  3.18M|    ctx->depth++;
  104|       |    ctx->commaNeeded[ctx->depth] = false;
  105|  3.18M|    return writeChar(ctx, '{');
  106|  3.18M|}
writeJsonObjEnd:
  108|  3.18M|WRITE_JSON_ELEMENT(ObjEnd) {
  109|  3.18M|    if(ctx->depth == 0)
  ------------------
  |  Branch (109:8): [True: 0, False: 3.18M]
  ------------------
  110|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  111|       |
  112|  3.18M|    UA_Boolean have_elem = ctx->commaNeeded[ctx->depth];
  113|  3.18M|    ctx->depth--;
  114|  3.18M|    ctx->commaNeeded[ctx->depth] = true;
  115|       |
  116|  3.18M|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  3.18M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  117|  3.18M|    if(ctx->prettyPrint && have_elem) {
  ------------------
  |  Branch (117:8): [True: 0, False: 3.18M]
  |  Branch (117:28): [True: 0, False: 0]
  ------------------
  118|      0|        res |= writeChar(ctx, '\n');
  119|      0|        for(size_t i = 0; i < ctx->depth; i++)
  ------------------
  |  Branch (119:27): [True: 0, False: 0]
  ------------------
  120|      0|            res |= writeChar(ctx, '\t');
  121|      0|    }
  122|  3.18M|    return res | writeChar(ctx, '}');
  123|  3.18M|}
writeJsonArrStart:
  125|  20.3k|WRITE_JSON_ELEMENT(ArrStart) {
  126|       |    /* Increase depth, save: before first array entry no comma needed. */
  127|  20.3k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|  20.3k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (127:8): [True: 0, False: 20.3k]
  ------------------
  128|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  129|  20.3k|    ctx->depth++;
  130|       |    ctx->commaNeeded[ctx->depth] = false;
  131|  20.3k|    return writeChar(ctx, '[');
  132|  20.3k|}
writeJsonArrEnd:
  135|  20.3k|writeJsonArrEnd(CtxJson *ctx, const UA_DataType *type) {
  136|  20.3k|    if(ctx->depth == 0)
  ------------------
  |  Branch (136:8): [True: 0, False: 20.3k]
  ------------------
  137|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  138|  20.3k|    UA_Boolean have_elem = ctx->commaNeeded[ctx->depth];
  139|  20.3k|    ctx->depth--;
  140|  20.3k|    ctx->commaNeeded[ctx->depth] = true;
  141|       |
  142|       |    /* If the array does not contain JSON objects (with a newline after), then
  143|       |     * add the closing ] on the same line */
  144|  20.3k|    UA_Boolean distinct = (!type || type->typeKind > UA_DATATYPEKIND_DOUBLE);
  ------------------
  |  Branch (144:28): [True: 0, False: 20.3k]
  |  Branch (144:37): [True: 6.63k, False: 13.6k]
  ------------------
  145|  20.3k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  20.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  146|  20.3k|    if(ctx->prettyPrint && have_elem && distinct) {
  ------------------
  |  Branch (146:8): [True: 0, False: 20.3k]
  |  Branch (146:28): [True: 0, False: 0]
  |  Branch (146:41): [True: 0, False: 0]
  ------------------
  147|      0|        res |= writeChar(ctx, '\n');
  148|      0|        for(size_t i = 0; i < ctx->depth; i++)
  ------------------
  |  Branch (148:27): [True: 0, False: 0]
  ------------------
  149|      0|            res |= writeChar(ctx, '\t');
  150|      0|    }
  151|  20.3k|    return res | writeChar(ctx, ']');
  152|  20.3k|}
writeJsonArrElm:
  156|  14.7M|                const UA_DataType *type) {
  157|  14.7M|    UA_Boolean distinct = (type->typeKind > UA_DATATYPEKIND_DOUBLE);
  158|  14.7M|    status ret = writeJsonBeforeElement(ctx, distinct);
  159|       |    ctx->commaNeeded[ctx->depth] = true;
  160|  14.7M|    return ret | encodeJsonJumpTable[type->typeKind](ctx, value, type);
  161|  14.7M|}
writeJsonKey:
  206|  5.95M|writeJsonKey(CtxJson *ctx, const char* key) {
  207|  5.95M|    status ret = writeJsonBeforeElement(ctx, true);
  208|  5.95M|    ctx->commaNeeded[ctx->depth] = true;
  209|  5.95M|    if(!ctx->unquotedKeys)
  ------------------
  |  Branch (209:8): [True: 5.95M, False: 0]
  ------------------
  210|  5.95M|        ret |= writeChar(ctx, '\"');
  211|  5.95M|    ret |= writeChars(ctx, key, strlen(key));
  212|  5.95M|    if(!ctx->unquotedKeys)
  ------------------
  |  Branch (212:8): [True: 5.95M, False: 0]
  ------------------
  213|  5.95M|        ret |= writeChar(ctx, '\"');
  214|  5.95M|    ret |= writeChar(ctx, ':');
  215|  5.95M|    if(ctx->prettyPrint)
  ------------------
  |  Branch (215:8): [True: 0, False: 5.95M]
  ------------------
  216|      0|        ret |= writeChar(ctx, ' ');
  217|  5.95M|    return ret;
  218|  5.95M|}
UA_encodeJson:
  916|  3.90k|              const UA_EncodeJsonOptions *options) {
  917|  3.90k|    if(!src || !type)
  ------------------
  |  Branch (917:8): [True: 0, False: 3.90k]
  |  Branch (917:16): [True: 0, False: 3.90k]
  ------------------
  918|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
  919|       |
  920|       |    /* Allocate buffer */
  921|  3.90k|    UA_Boolean allocated = false;
  922|  3.90k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  3.90k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  923|  3.90k|    if(outBuf->length == 0) {
  ------------------
  |  Branch (923:8): [True: 0, False: 3.90k]
  ------------------
  924|      0|        size_t len = UA_calcSizeJson(src, type, options);
  925|      0|        res = UA_ByteString_allocBuffer(outBuf, len);
  926|      0|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (926:12): [True: 0, False: 0]
  ------------------
  927|      0|            return res;
  928|      0|        allocated = true;
  929|      0|    }
  930|       |
  931|       |    /* Set up the context */
  932|  3.90k|    CtxJson ctx;
  933|  3.90k|    memset(&ctx, 0, sizeof(ctx));
  934|  3.90k|    ctx.pos = outBuf->data;
  935|  3.90k|    ctx.end = &outBuf->data[outBuf->length];
  936|  3.90k|    ctx.depth = 0;
  937|  3.90k|    ctx.calcOnly = false;
  938|  3.90k|    ctx.useReversible = true; /* default */
  939|  3.90k|    if(options) {
  ------------------
  |  Branch (939:8): [True: 0, False: 3.90k]
  ------------------
  940|      0|        ctx.namespaceMapping = options->namespaceMapping;
  941|      0|        ctx.serverUris = options->serverUris;
  942|      0|        ctx.serverUrisSize = options->serverUrisSize;
  943|      0|        ctx.useReversible = options->useReversible;
  944|      0|        ctx.prettyPrint = options->prettyPrint;
  945|      0|        ctx.unquotedKeys = options->unquotedKeys;
  946|      0|        ctx.stringNodeIds = options->stringNodeIds;
  947|      0|    }
  948|       |
  949|       |    /* Encode */
  950|  3.90k|    res = encodeJsonJumpTable[type->typeKind](&ctx, src, type);
  951|       |
  952|       |    /* Clean up */
  953|  3.90k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  3.90k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (953:8): [True: 3.90k, False: 0]
  ------------------
  954|  3.90k|        outBuf->length = (size_t)((uintptr_t)ctx.pos - (uintptr_t)outBuf->data);
  955|      0|    else if(allocated)
  ------------------
  |  Branch (955:13): [True: 0, False: 0]
  ------------------
  956|      0|        UA_ByteString_clear(outBuf);
  957|  3.90k|    return res;
  958|  3.90k|}
UA_calcSizeJson:
  983|  1.95k|                const UA_EncodeJsonOptions *options) {
  984|  1.95k|    if(!src || !type)
  ------------------
  |  Branch (984:8): [True: 0, False: 1.95k]
  |  Branch (984:16): [True: 0, False: 1.95k]
  ------------------
  985|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
  986|       |
  987|       |    /* Set up the context */
  988|  1.95k|    CtxJson ctx;
  989|  1.95k|    memset(&ctx, 0, sizeof(ctx));
  990|  1.95k|    ctx.pos = (UA_Byte*)0x01;
  991|  1.95k|    ctx.end = (const UA_Byte*)(uintptr_t)SIZE_MAX;
  992|  1.95k|    ctx.depth = 0;
  993|  1.95k|    ctx.useReversible = true; /* default */
  994|  1.95k|    if(options) {
  ------------------
  |  Branch (994:8): [True: 0, False: 1.95k]
  ------------------
  995|      0|        ctx.namespaceMapping = options->namespaceMapping;
  996|      0|        ctx.serverUris = options->serverUris;
  997|      0|        ctx.serverUrisSize = options->serverUrisSize;
  998|      0|        ctx.useReversible = options->useReversible;
  999|      0|        ctx.prettyPrint = options->prettyPrint;
 1000|      0|        ctx.unquotedKeys = options->unquotedKeys;
 1001|      0|        ctx.stringNodeIds = options->stringNodeIds;
 1002|      0|    }
 1003|       |
 1004|  1.95k|    ctx.calcOnly = true;
 1005|       |
 1006|       |    /* Encode */
 1007|  1.95k|    status ret = encodeJsonJumpTable[type->typeKind](&ctx, src, type);
 1008|  1.95k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  1.95k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1008:8): [True: 0, False: 1.95k]
  ------------------
 1009|      0|        return 0;
 1010|  1.95k|    return ((size_t)ctx.pos) - 1u;
 1011|  1.95k|}
lookAheadForKey:
 1426|   277k|lookAheadForKey(ParseCtx *ctx, const char *key, size_t *resultIndex) {
 1427|       |    /* The current index must point to the beginning of an object.
 1428|       |     * This has to be ensured by the caller. */
 1429|   277k|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  395|   277k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1429:5): [True: 277k, False: 0]
  ------------------
 1430|       |
 1431|   277k|    status ret = UA_STATUSCODE_BADNOTFOUND;
  ------------------
  |  |  232|   277k|#define UA_STATUSCODE_BADNOTFOUND ((UA_StatusCode) 0x803E0000)
  ------------------
 1432|   277k|    size_t oldIndex = ctx->index; /* Save index for later restore */
 1433|   277k|    unsigned int end = ctx->tokens[ctx->index].end;
 1434|   277k|    ctx->index++; /* Move to the first key */
 1435|   595k|    while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1435:11): [True: 590k, False: 5.16k]
  ------------------
 1436|   590k|          ctx->tokens[ctx->index].start < end) {
  ------------------
  |  Branch (1436:11): [True: 466k, False: 124k]
  ------------------
 1437|       |        /* Key must be a string */
 1438|   466k|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  395|   466k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1438:9): [True: 466k, False: 0]
  ------------------
 1439|       |
 1440|       |        /* Move index to the value */
 1441|   466k|        ctx->index++;
 1442|       |
 1443|       |        /* Value for the key must exist */
 1444|   466k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  395|   466k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1444:9): [True: 466k, False: 0]
  ------------------
 1445|       |
 1446|       |        /* Compare the key (previous index) */
 1447|   466k|        if(jsoneq(ctx->json5, &ctx->tokens[ctx->index-1], key) == 0) {
  ------------------
  |  Branch (1447:12): [True: 148k, False: 317k]
  ------------------
 1448|   148k|            *resultIndex = ctx->index; /* Point result to the current index */
 1449|   148k|            ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   148k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1450|   148k|            break;
 1451|   148k|        }
 1452|       |
 1453|   317k|        skipObject(ctx); /* Jump over the value (can also be an array or object) */
 1454|   317k|    }
 1455|   277k|    ctx->index = oldIndex; /* Restore the old index */
 1456|   277k|    return ret;
 1457|   277k|}
decodeFields:
 2245|  2.03M|decodeFields(ParseCtx *ctx, DecodeEntry *entries, size_t entryCount) {
 2246|  2.03M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|  2.03M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|  2.03M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 2.03M]
  |  |  ------------------
  |  | 1024|  2.03M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|  2.03M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 2.03M]
  |  |  ------------------
  ------------------
 2247|  2.03M|    CHECK_NULL_SKIP; /* null is treated like an empty object */
  ------------------
  |  | 1047|  2.03M|#define CHECK_NULL_SKIP do {                         \
  |  | 1048|  2.03M|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1048:8): [True: 0, False: 2.03M]
  |  |  ------------------
  |  | 1049|      0|        ctx->index++;                                \
  |  | 1050|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1051|  2.03M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1051:14): [Folded, False: 2.03M]
  |  |  ------------------
  ------------------
 2248|       |
 2249|  2.03M|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|  2.03M|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (2249:8): [True: 0, False: 2.03M]
  ------------------
 2250|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 2251|       |
 2252|       |    /* Keys and values are counted separately */
 2253|  2.03M|    CHECK_OBJECT;
  ------------------
  |  | 1042|  2.03M|#define CHECK_OBJECT do {                                \
  |  | 1043|  2.03M|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1043:8): [True: 0, False: 2.03M]
  |  |  ------------------
  |  | 1044|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1045|  2.03M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1045:14): [Folded, False: 2.03M]
  |  |  ------------------
  ------------------
 2254|  2.03M|    UA_assert(ctx->tokens[ctx->index].size % 2 == 0);
  ------------------
  |  |  395|  2.03M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2254:5): [True: 2.03M, False: 0]
  ------------------
 2255|  2.03M|    size_t keyCount = (size_t)(ctx->tokens[ctx->index].size) / 2;
 2256|       |
 2257|  2.03M|    ctx->index++; /* Go to first key - or jump after the empty object */
 2258|  2.03M|    ctx->depth++;
 2259|       |
 2260|  2.03M|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  2.03M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2261|  4.03M|    for(size_t key = 0; key < keyCount; key++) {
  ------------------
  |  Branch (2261:25): [True: 1.99M, False: 2.03M]
  ------------------
 2262|       |        /* Key must be a string */
 2263|  1.99M|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  395|  1.99M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2263:9): [True: 1.99M, False: 0]
  ------------------
 2264|  1.99M|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  395|  1.99M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2264:9): [True: 1.99M, False: 0]
  ------------------
 2265|       |
 2266|       |        /* Search for the decoding entry matching the key. Start at the key
 2267|       |         * index to speed-up the case where they key-order is the same as the
 2268|       |         * entry-order. */
 2269|  1.99M|        DecodeEntry *entry = NULL;
 2270|  2.02M|        for(size_t i = key; i < key + entryCount; i++) {
  ------------------
  |  Branch (2270:29): [True: 2.02M, False: 48]
  ------------------
 2271|  2.02M|            size_t ii = i;
 2272|  2.02M|            while(ii >= entryCount)
  ------------------
  |  Branch (2272:19): [True: 3.07k, False: 2.02M]
  ------------------
 2273|  3.07k|                ii -= entryCount;
 2274|       |
 2275|       |            /* Compare the key */
 2276|  2.02M|            if(jsoneq(ctx->json5, &ctx->tokens[ctx->index],
  ------------------
  |  Branch (2276:16): [True: 24.8k, False: 1.99M]
  ------------------
 2277|  2.02M|                      entries[ii].fieldName) != 0)
 2278|  24.8k|                continue;
 2279|       |
 2280|       |            /* Key was already used -> duplicate, abort */
 2281|  1.99M|            if(entries[ii].found) {
  ------------------
  |  Branch (2281:16): [True: 1, False: 1.99M]
  ------------------
 2282|      1|                ctx->depth--;
 2283|      1|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2284|      1|            }
 2285|       |
 2286|       |            /* Found the key */
 2287|  1.99M|            entries[ii].found = true;
 2288|  1.99M|            entry = &entries[ii];
 2289|  1.99M|            break;
 2290|  1.99M|        }
 2291|       |
 2292|       |        /* The key is unknown */
 2293|  1.99M|        if(!entry) {
  ------------------
  |  Branch (2293:12): [True: 48, False: 1.99M]
  ------------------
 2294|     48|            ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     48|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2295|     48|            break;
 2296|     48|        }
 2297|       |
 2298|       |        /* Go from key to value */
 2299|  1.99M|        ctx->index++;
 2300|  1.99M|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  395|  1.99M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2300:9): [True: 1.99M, False: 0]
  ------------------
 2301|       |
 2302|       |        /* An entry that was expected but shall not be decoded.
 2303|       |         * Jump over the value. */
 2304|  1.99M|        if(!entry->function && !entry->type) {
  ------------------
  |  Branch (2304:12): [True: 1.99M, False: 0]
  |  Branch (2304:32): [True: 94.5k, False: 1.90M]
  ------------------
 2305|  94.5k|            skipObject(ctx);
 2306|  94.5k|            continue;
 2307|  94.5k|        }
 2308|       |
 2309|       |        /* A null-value, skip the decoding (the value is already initialized) */
 2310|  1.90M|        if(currentTokenType(ctx) == CJ5_TOKEN_NULL && !entry->function) {
  ------------------
  |  Branch (2310:12): [True: 1.90M, False: 63]
  |  Branch (2310:55): [True: 1.90M, False: 0]
  ------------------
 2311|  1.90M|            ctx->index++; /* skip null value */
 2312|  1.90M|            continue;
 2313|  1.90M|        }
 2314|       |
 2315|       |        /* Decode. This also moves to the next key or right after the object for
 2316|       |         * the last value. */
 2317|     63|        decodeJsonSignature decodeFunc = (entry->function) ?
  ------------------
  |  Branch (2317:42): [True: 0, False: 63]
  ------------------
 2318|     63|            entry->function : decodeJsonJumpTable[entry->type->typeKind];
 2319|     63|        ret = decodeFunc(ctx, entry->fieldPointer, entry->type);
 2320|     63|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|     63|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2320:12): [True: 3, False: 60]
  ------------------
 2321|      3|            break;
 2322|     63|    }
 2323|       |
 2324|  2.03M|    ctx->depth--;
 2325|  2.03M|    return ret;
 2326|  2.03M|}
tokenize:
 2457|  5.67k|         size_t *decodedLength) {
 2458|       |    /* Tokenize */
 2459|  5.67k|    cj5_options options;
 2460|  5.67k|    options.stop_early = (decodedLength != NULL);
 2461|  5.67k|    cj5_result r = cj5_parse((char*)src->data, (unsigned int)src->length,
 2462|  5.67k|                             ctx->tokens, (unsigned int)tokensSize, &options);
 2463|       |
 2464|       |    /* Handle overflow error by allocating the number of tokens the parser would
 2465|       |     * have needed */
 2466|  5.67k|    if(r.error == CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (2466:8): [True: 696, False: 4.97k]
  ------------------
 2467|    696|       tokensSize != r.num_tokens) {
  ------------------
  |  Branch (2467:8): [True: 696, False: 0]
  ------------------
 2468|    696|        ctx->tokens = (cj5_token*)
 2469|    696|            UA_malloc(sizeof(cj5_token) * r.num_tokens);
  ------------------
  |  |   18|    696|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 2470|    696|        if(!ctx->tokens)
  ------------------
  |  Branch (2470:12): [True: 0, False: 696]
  ------------------
 2471|      0|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2472|    696|        return tokenize(ctx, src, r.num_tokens, decodedLength);
 2473|    696|    }
 2474|       |
 2475|       |    /* Cannot recover from other errors */
 2476|  4.97k|    if(r.error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (2476:8): [True: 126, False: 4.84k]
  ------------------
 2477|    126|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    126|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2478|       |
 2479|  4.84k|    if(decodedLength)
  ------------------
  |  Branch (2479:8): [True: 0, False: 4.84k]
  ------------------
 2480|      0|        *decodedLength = ctx->tokens[0].end + 1;
 2481|       |
 2482|       |    /* Set up the context */
 2483|  4.84k|    ctx->json5 = (char*)src->data;
 2484|  4.84k|    ctx->depth = 0;
 2485|  4.84k|    ctx->tokensSize = r.num_tokens;
 2486|  4.84k|    ctx->index = 0;
 2487|  4.84k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  4.84k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2488|  4.97k|}
UA_decodeJson:
 2492|  4.97k|              const UA_DecodeJsonOptions *options) {
 2493|  4.97k|    if(!dst || !src || !type)
  ------------------
  |  Branch (2493:8): [True: 0, False: 4.97k]
  |  Branch (2493:16): [True: 0, False: 4.97k]
  |  Branch (2493:24): [True: 0, False: 4.97k]
  ------------------
 2494|      0|        return UA_STATUSCODE_BADARGUMENTSMISSING;
  ------------------
  |  |  448|      0|#define UA_STATUSCODE_BADARGUMENTSMISSING ((UA_StatusCode) 0x80760000)
  ------------------
 2495|       |
 2496|       |    /* Set up the context */
 2497|  4.97k|    cj5_token tokens[UA_JSON_MAXTOKENCOUNT];
 2498|  4.97k|    ParseCtx ctx;
 2499|  4.97k|    memset(&ctx, 0, sizeof(ParseCtx));
 2500|  4.97k|    ctx.tokens = tokens;
 2501|       |
 2502|  4.97k|    if(options) {
  ------------------
  |  Branch (2502:8): [True: 0, False: 4.97k]
  ------------------
 2503|      0|        ctx.namespaceMapping = options->namespaceMapping;
 2504|      0|        ctx.serverUris = options->serverUris;
 2505|      0|        ctx.serverUrisSize = options->serverUrisSize;
 2506|      0|        ctx.customTypes = options->customTypes;
 2507|      0|    }
 2508|       |
 2509|       |    /* Decode */
 2510|  4.97k|    status ret = tokenize(&ctx, src, UA_JSON_MAXTOKENCOUNT,
  ------------------
  |  |   20|  4.97k|#define UA_JSON_MAXTOKENCOUNT 256
  ------------------
 2511|  4.97k|                          options ? options->decodedLength : NULL);
  ------------------
  |  Branch (2511:27): [True: 0, False: 4.97k]
  ------------------
 2512|  4.97k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  4.97k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2512:8): [True: 126, False: 4.84k]
  ------------------
 2513|    126|        goto cleanup;
 2514|       |
 2515|  4.84k|    memset(dst, 0, type->memSize); /* Initialize the value */
 2516|  4.84k|    ret = decodeJsonJumpTable[type->typeKind](&ctx, dst, type);
 2517|       |
 2518|       |    /* Sanity check if all tokens were processed */
 2519|  4.84k|    if(ctx.index != ctx.tokensSize &&
  ------------------
  |  Branch (2519:8): [True: 87, False: 4.76k]
  ------------------
 2520|     87|       ctx.index != ctx.tokensSize - 1)
  ------------------
  |  Branch (2520:8): [True: 65, False: 22]
  ------------------
 2521|     65|        ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     65|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2522|       |
 2523|  4.97k| cleanup:
 2524|       |
 2525|       |    /* Free token array on the heap */
 2526|  4.97k|    if(ctx.tokens != tokens)
  ------------------
  |  Branch (2526:8): [True: 696, False: 4.27k]
  ------------------
 2527|    696|        UA_free((void*)(uintptr_t)ctx.tokens);
  ------------------
  |  |   19|    696|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2528|       |
 2529|  4.97k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  4.97k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2529:8): [True: 1.07k, False: 3.90k]
  ------------------
 2530|  1.07k|        UA_clear(dst, type);
 2531|  4.97k|    return ret;
 2532|  4.84k|}
ua_types_encoding_json.c:writeChar:
   52|  45.1M|writeChar(CtxJson *ctx, char c) {
   53|  45.1M|    if(ctx->pos >= ctx->end)
  ------------------
  |  Branch (53:8): [True: 0, False: 45.1M]
  ------------------
   54|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
   55|  45.1M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (55:8): [True: 30.1M, False: 15.0M]
  ------------------
   56|  30.1M|        *ctx->pos = (UA_Byte)c;
   57|  45.1M|    ctx->pos++;
   58|  45.1M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  45.1M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   59|  45.1M|}
ua_types_encoding_json.c:writeChars:
   62|  11.7M|writeChars(CtxJson *ctx, const char *c, size_t len) {
   63|  11.7M|    if(ctx->pos + len > ctx->end)
  ------------------
  |  Branch (63:8): [True: 0, False: 11.7M]
  ------------------
   64|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
   65|  11.7M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (65:8): [True: 7.80M, False: 3.90M]
  ------------------
   66|  7.80M|        memcpy(ctx->pos, c, len);
   67|  11.7M|    ctx->pos += len;
   68|  11.7M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  11.7M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   69|  11.7M|}
ua_types_encoding_json.c:Boolean_encodeJson:
  230|  14.5k|ENCODE_JSON(Boolean) {
  231|  14.5k|    const UA_Boolean *src = (const UA_Boolean*)p;
  232|  14.5k|    if(*src == true)
  ------------------
  |  Branch (232:8): [True: 771, False: 13.7k]
  ------------------
  233|    771|        return writeChars(ctx, "true", 4);
  234|  13.7k|    return writeChars(ctx, "false", 5);
  235|  14.5k|}
ua_types_encoding_json.c:SByte_encodeJson:
  253|   109k|ENCODE_JSON(SByte) {
  254|   109k|    const UA_SByte *src = (const UA_SByte*)p;
  255|   109k|    char buf[5];
  256|   109k|    UA_UInt16 digits = itoaSigned(*src, buf);
  257|   109k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (257:8): [True: 0, False: 109k]
  ------------------
  258|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  259|   109k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (259:8): [True: 73.1k, False: 36.5k]
  ------------------
  260|  73.1k|        memcpy(ctx->pos, buf, digits);
  261|   109k|    ctx->pos += digits;
  262|   109k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   109k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  263|   109k|}
ua_types_encoding_json.c:Byte_encodeJson:
  237|  37.2k|ENCODE_JSON(Byte) {
  238|  37.2k|    const UA_Byte *src = (const UA_Byte*)p;
  239|  37.2k|    char buf[4];
  240|  37.2k|    UA_UInt16 digits = itoaUnsigned(*src, buf, 10);
  241|       |
  242|       |    /* Ensure destination can hold the data- */
  243|  37.2k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (243:8): [True: 0, False: 37.2k]
  ------------------
  244|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  245|       |
  246|       |    /* Copy digits to the output string/buffer. */
  247|  37.2k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (247:8): [True: 24.8k, False: 12.4k]
  ------------------
  248|  24.8k|        memcpy(ctx->pos, buf, digits);
  249|  37.2k|    ctx->pos += digits;
  250|  37.2k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  37.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  251|  37.2k|}
ua_types_encoding_json.c:Int16_encodeJson:
  277|  26.1k|ENCODE_JSON(Int16) {
  278|  26.1k|    const UA_Int16 *src = (const UA_Int16*)p;
  279|  26.1k|    char buf[7];
  280|  26.1k|    UA_UInt16 digits = itoaSigned(*src, buf);
  281|  26.1k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (281:8): [True: 0, False: 26.1k]
  ------------------
  282|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  283|  26.1k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (283:8): [True: 17.4k, False: 8.73k]
  ------------------
  284|  17.4k|        memcpy(ctx->pos, buf, digits);
  285|  26.1k|    ctx->pos += digits;
  286|  26.1k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  26.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  287|  26.1k|}
ua_types_encoding_json.c:UInt16_encodeJson:
  265|  13.7k|ENCODE_JSON(UInt16) {
  266|  13.7k|    const UA_UInt16 *src = (const UA_UInt16*)p;
  267|  13.7k|    char buf[6];
  268|  13.7k|    UA_UInt16 digits = itoaUnsigned(*src, buf, 10);
  269|  13.7k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (269:8): [True: 0, False: 13.7k]
  ------------------
  270|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  271|  13.7k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (271:8): [True: 9.15k, False: 4.57k]
  ------------------
  272|  9.15k|        memcpy(ctx->pos, buf, digits);
  273|  13.7k|    ctx->pos += digits;
  274|  13.7k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  13.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  275|  13.7k|}
ua_types_encoding_json.c:Int32_encodeJson:
  301|  2.67M|ENCODE_JSON(Int32) {
  302|  2.67M|    const UA_Int32 *src = (const UA_Int32*)p;
  303|  2.67M|    char buf[12];
  304|  2.67M|    UA_UInt16 digits = itoaSigned(*src, buf);
  305|  2.67M|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (305:8): [True: 0, False: 2.67M]
  ------------------
  306|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  307|  2.67M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (307:8): [True: 1.78M, False: 892k]
  ------------------
  308|  1.78M|        memcpy(ctx->pos, buf, digits);
  309|  2.67M|    ctx->pos += digits;
  310|  2.67M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  2.67M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  311|  2.67M|}
ua_types_encoding_json.c:UInt32_encodeJson:
  289|  3.05M|ENCODE_JSON(UInt32) {
  290|  3.05M|    const UA_UInt32 *src = (const UA_UInt32*)p;
  291|  3.05M|    char buf[11];
  292|  3.05M|    UA_UInt16 digits = itoaUnsigned(*src, buf, 10);
  293|  3.05M|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (293:8): [True: 0, False: 3.05M]
  ------------------
  294|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  295|  3.05M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (295:8): [True: 2.03M, False: 1.01M]
  ------------------
  296|  2.03M|        memcpy(ctx->pos, buf, digits);
  297|  3.05M|    ctx->pos += digits;
  298|  3.05M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  3.05M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  299|  3.05M|}
ua_types_encoding_json.c:Int64_encodeJson:
  328|  2.23M|ENCODE_JSON(Int64) {
  329|  2.23M|    const UA_Int64 *src = (const UA_Int64*)p;
  330|  2.23M|    char buf[23];
  331|  2.23M|    buf[0] = '\"';
  332|  2.23M|    UA_UInt16 digits = itoaSigned(*src, buf + 1);
  333|  2.23M|    buf[digits + 1] = '\"';
  334|  2.23M|    UA_UInt16 length = (UA_UInt16)(digits + 2);
  335|  2.23M|    if(ctx->pos + length > ctx->end)
  ------------------
  |  Branch (335:8): [True: 0, False: 2.23M]
  ------------------
  336|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  337|  2.23M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (337:8): [True: 1.48M, False: 744k]
  ------------------
  338|  1.48M|        memcpy(ctx->pos, buf, length);
  339|  2.23M|    ctx->pos += length;
  340|  2.23M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  2.23M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  341|  2.23M|}
ua_types_encoding_json.c:UInt64_encodeJson:
  313|  4.84M|ENCODE_JSON(UInt64) {
  314|  4.84M|    const UA_UInt64 *src = (const UA_UInt64*)p;
  315|  4.84M|    char buf[23];
  316|  4.84M|    buf[0] = '\"';
  317|  4.84M|    UA_UInt16 digits = itoaUnsigned(*src, buf + 1, 10);
  318|  4.84M|    buf[digits + 1] = '\"';
  319|  4.84M|    UA_UInt16 length = (UA_UInt16)(digits + 2);
  320|  4.84M|    if(ctx->pos + length > ctx->end)
  ------------------
  |  Branch (320:8): [True: 0, False: 4.84M]
  ------------------
  321|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  322|  4.84M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (322:8): [True: 3.23M, False: 1.61M]
  ------------------
  323|  3.23M|        memcpy(ctx->pos, buf, length);
  324|  4.84M|    ctx->pos += length;
  325|  4.84M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  4.84M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  326|  4.84M|}
ua_types_encoding_json.c:Float_encodeJson:
  343|  1.11M|ENCODE_JSON(Float) {
  344|  1.11M|    const UA_Float *src = (const UA_Float*)p;
  345|  1.11M|    char buffer[32];
  346|  1.11M|    size_t len;
  347|  1.11M|    if(*src != *src)
  ------------------
  |  Branch (347:8): [True: 4.71k, False: 1.10M]
  ------------------
  348|  4.71k|        return writeChars(ctx, "\"NaN\"", 5);
  349|  1.10M|    if(*src == INFINITY)
  ------------------
  |  Branch (349:8): [True: 1.34k, False: 1.10M]
  ------------------
  350|  1.34k|        return writeChars(ctx, "\"Infinity\"", 10);
  351|  1.10M|    if(*src == -INFINITY)
  ------------------
  |  Branch (351:8): [True: 786, False: 1.10M]
  ------------------
  352|    786|        return writeChars(ctx, "\"-Infinity\"", 11);
  353|  1.10M|    len = dtoa((UA_Double)*src, buffer);
  354|  1.10M|    if(ctx->pos + len > ctx->end)
  ------------------
  |  Branch (354:8): [True: 0, False: 1.10M]
  ------------------
  355|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  356|  1.10M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (356:8): [True: 737k, False: 368k]
  ------------------
  357|   737k|        memcpy(ctx->pos, buffer, len);
  358|  1.10M|    ctx->pos += len;
  359|  1.10M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.10M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  360|  1.10M|}
ua_types_encoding_json.c:Double_encodeJson:
  362|   416k|ENCODE_JSON(Double) {
  363|   416k|    const UA_Double *src = (const UA_Double*)p;
  364|   416k|    char buffer[32];
  365|   416k|    size_t len;
  366|   416k|    if(*src != *src)
  ------------------
  |  Branch (366:8): [True: 834, False: 415k]
  ------------------
  367|    834|        return writeChars(ctx, "\"NaN\"", 5);
  368|   415k|    if(*src == INFINITY)
  ------------------
  |  Branch (368:8): [True: 834, False: 414k]
  ------------------
  369|    834|        return writeChars(ctx, "\"Infinity\"", 10);
  370|   414k|    if(*src == -INFINITY)
  ------------------
  |  Branch (370:8): [True: 849, False: 413k]
  ------------------
  371|    849|        return writeChars(ctx, "\"-Infinity\"", 11);
  372|   413k|    len = dtoa(*src, buffer);
  373|   413k|    if(ctx->pos + len > ctx->end)
  ------------------
  |  Branch (373:8): [True: 0, False: 413k]
  ------------------
  374|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  375|   413k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (375:8): [True: 275k, False: 137k]
  ------------------
  376|   275k|        memcpy(ctx->pos, buffer, len);
  377|   413k|    ctx->pos += len;
  378|   413k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   413k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  379|   413k|}
ua_types_encoding_json.c:String_encodeJson:
  408|  5.85M|ENCODE_JSON(String) {
  409|  5.85M|    const UA_String *src = (const UA_String*)p;
  410|  5.85M|    if(!src->data)
  ------------------
  |  Branch (410:8): [True: 5.71M, False: 135k]
  ------------------
  411|  5.71M|        return writeChars(ctx, "null", 4);
  412|       |
  413|   135k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   135k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  414|   135k|    if(src->length == 0) {
  ------------------
  |  Branch (414:8): [True: 10.0k, False: 125k]
  ------------------
  415|  10.0k|        ret |= writeJsonQuote(ctx);
  416|  10.0k|        ret |= writeJsonQuote(ctx);
  417|  10.0k|        return ret;
  418|  10.0k|    }
  419|       |
  420|   125k|    ret |= writeJsonQuote(ctx);
  421|       |
  422|   125k|    const unsigned char *end = src->data + src->length;
  423|  8.96M|    for(const unsigned char *pos = src->data; pos < end; pos++) {
  ------------------
  |  Branch (423:47): [True: 8.96M, False: 2.17k]
  ------------------
  424|       |        /* Skip to the first character that needs escaping */
  425|  8.96M|        const unsigned char *start = pos;
  426|  28.8M|        for(; pos < end; pos++) {
  ------------------
  |  Branch (426:15): [True: 28.7M, False: 123k]
  ------------------
  427|  28.7M|            if(*pos < ' ' || *pos == 127 || *pos == '\\' || *pos == '\"')
  ------------------
  |  Branch (427:16): [True: 3.03M, False: 25.7M]
  |  Branch (427:30): [True: 14.5k, False: 25.7M]
  |  Branch (427:45): [True: 12.4k, False: 25.6M]
  |  Branch (427:61): [True: 5.78M, False: 19.9M]
  ------------------
  428|  8.84M|                break;
  429|  28.7M|        }
  430|       |
  431|       |        /* Write out the unescaped sequence */
  432|  8.96M|        if(ctx->pos + (pos - start) > ctx->end)
  ------------------
  |  Branch (432:12): [True: 0, False: 8.96M]
  ------------------
  433|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  434|  8.96M|        if(!ctx->calcOnly)
  ------------------
  |  Branch (434:12): [True: 5.97M, False: 2.98M]
  ------------------
  435|  5.97M|            memcpy(ctx->pos, start, (size_t)(pos - start));
  436|  8.96M|        ctx->pos += pos - start;
  437|       |
  438|       |        /* The unescaped sequence reached the end */
  439|  8.96M|        if(pos == end)
  ------------------
  |  Branch (439:12): [True: 123k, False: 8.84M]
  ------------------
  440|   123k|            break;
  441|       |
  442|       |        /* Write an escaped character */
  443|  8.84M|        char *escape_text;
  444|  8.84M|        char escape_buf[6];
  445|  8.84M|        size_t escape_len = 2;
  446|  8.84M|        switch(*pos) {
  447|    330|        case '\b': escape_text = "\\b"; break;
  ------------------
  |  Branch (447:9): [True: 330, False: 8.84M]
  ------------------
  448|  1.47k|        case '\f': escape_text = "\\f"; break;
  ------------------
  |  Branch (448:9): [True: 1.47k, False: 8.84M]
  ------------------
  449|   117k|        case '\n': escape_text = "\\n"; break;
  ------------------
  |  Branch (449:9): [True: 117k, False: 8.72M]
  ------------------
  450|    336|        case '\r': escape_text = "\\r"; break;
  ------------------
  |  Branch (450:9): [True: 336, False: 8.84M]
  ------------------
  451|    264|        case '\t': escape_text = "\\t"; break;
  ------------------
  |  Branch (451:9): [True: 264, False: 8.84M]
  ------------------
  452|  8.72M|        default:
  ------------------
  |  Branch (452:9): [True: 8.72M, False: 119k]
  ------------------
  453|  8.72M|            escape_text = escape_buf;
  454|  8.72M|            if(*pos >= ' ' && *pos != 127) {
  ------------------
  |  Branch (454:16): [True: 5.81M, False: 2.91M]
  |  Branch (454:31): [True: 5.79M, False: 14.5k]
  ------------------
  455|       |                /* Escape \ or " */
  456|  5.79M|                escape_buf[0] = '\\';
  457|  5.79M|                escape_buf[1] = (char)*pos;
  458|  5.79M|            } else {
  459|       |                /* Unprintable characters need to be escaped */
  460|  2.92M|                escape_buf[0] = '\\';
  461|  2.92M|                escape_buf[1] = 'u';
  462|  2.92M|                escape_buf[2] = '0';
  463|  2.92M|                escape_buf[3] = '0';
  464|  2.92M|                escape_buf[4] = hexmap[*pos >> 4];
  465|  2.92M|                escape_buf[5] = hexmap[*pos & 0x0f];
  466|  2.92M|                escape_len = 6;
  467|  2.92M|            }
  468|  8.72M|            break;
  469|  8.84M|        }
  470|       |
  471|       |        /* Enough space? */
  472|  8.84M|        if(ctx->pos + escape_len > ctx->end)
  ------------------
  |  Branch (472:12): [True: 0, False: 8.84M]
  ------------------
  473|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  474|       |
  475|       |        /* Write the escaped character */
  476|  8.84M|        if(!ctx->calcOnly)
  ------------------
  |  Branch (476:12): [True: 5.89M, False: 2.94M]
  ------------------
  477|  5.89M|            memcpy(ctx->pos, escape_text, escape_len);
  478|  8.84M|        ctx->pos += escape_len;
  479|  8.84M|    }
  480|       |
  481|   125k|    return ret | writeJsonQuote(ctx);
  482|   125k|}
ua_types_encoding_json.c:writeJsonQuote:
   75|   283k|static WRITE_JSON_ELEMENT(Quote) {
   76|   283k|    return writeChar(ctx, '\"');
   77|   283k|}
ua_types_encoding_json.c:DateTime_encodeJson:
  530|  26.6k|ENCODE_JSON(DateTime) {
  531|  26.6k|    const UA_DateTime *src = (const UA_DateTime*)p;
  532|  26.6k|    UA_Byte buffer[40];
  533|  26.6k|    UA_String str = {40, buffer};
  534|  26.6k|    encodeDateTime(*src, &str);
  535|       |    return String_encodeJson(ctx, &str, NULL);
  536|  26.6k|}
ua_types_encoding_json.c:Guid_encodeJson:
  519|  4.20k|ENCODE_JSON(Guid) {
  520|  4.20k|    const UA_Guid *src = (const UA_Guid*)p;
  521|  4.20k|    if(ctx->pos + 38 > ctx->end) /* 36 + 2 (") */
  ------------------
  |  Branch (521:8): [True: 0, False: 4.20k]
  ------------------
  522|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  523|  4.20k|    status ret = writeJsonQuote(ctx);
  524|  4.20k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (524:8): [True: 2.80k, False: 1.40k]
  ------------------
  525|  2.80k|        UA_Guid_to_hex(src, ctx->pos, false);
  526|  4.20k|    ctx->pos += 36;
  527|  4.20k|    return ret | writeJsonQuote(ctx);
  528|  4.20k|}
ua_types_encoding_json.c:ByteString_encodeJson:
  484|  3.02k|ENCODE_JSON(ByteString) {
  485|  3.02k|    const UA_ByteString *src = (const UA_ByteString*)p;
  486|  3.02k|    if(!src->data)
  ------------------
  |  Branch (486:8): [True: 930, False: 2.09k]
  ------------------
  487|    930|        return writeChars(ctx, "null", 4);
  488|       |
  489|  2.09k|    if(src->length == 0) {
  ------------------
  |  Branch (489:8): [True: 1.85k, False: 240]
  ------------------
  490|  1.85k|        status retval = writeJsonQuote(ctx);
  491|  1.85k|        retval |= writeJsonQuote(ctx);
  492|  1.85k|        return retval;
  493|  1.85k|    }
  494|       |
  495|    240|    status ret = writeJsonQuote(ctx);
  496|    240|    size_t flen = 0;
  497|    240|    unsigned char *ba64 = UA_base64(src->data, src->length, &flen);
  498|       |
  499|       |    /* Not converted, no mem */
  500|    240|    if(!ba64)
  ------------------
  |  Branch (500:8): [True: 0, False: 240]
  ------------------
  501|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  502|       |
  503|    240|    if(ctx->pos + flen > ctx->end) {
  ------------------
  |  Branch (503:8): [True: 0, False: 240]
  ------------------
  504|      0|        UA_free(ba64);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  505|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  506|      0|    }
  507|       |
  508|       |    /* Copy flen bytes to output stream. */
  509|    240|    if(!ctx->calcOnly)
  ------------------
  |  Branch (509:8): [True: 160, False: 80]
  ------------------
  510|    160|        memcpy(ctx->pos, ba64, flen);
  511|    240|    ctx->pos += flen;
  512|       |
  513|       |    /* Base64 result no longer needed */
  514|    240|    UA_free(ba64);
  ------------------
  |  |   19|    240|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  515|       |
  516|    240|    return ret | writeJsonQuote(ctx);
  517|    240|}
ua_types_encoding_json.c:NodeId_encodeJson:
  538|  8.87k|ENCODE_JSON(NodeId) {
  539|  8.87k|    const UA_NodeId *src = (const UA_NodeId*)p;
  540|  8.87k|    UA_String out = UA_STRING_NULL;
  541|  8.87k|    UA_StatusCode ret =
  542|  8.87k|        UA_NodeId_printEx(src, &out, ctx->namespaceMapping);
  543|       |    ret |= String_encodeJson(ctx, &out, NULL);
  544|  8.87k|    UA_String_clear(&out);
  545|  8.87k|    return ret;
  546|  8.87k|}
ua_types_encoding_json.c:ExpandedNodeId_encodeJson:
  548|  26.6k|ENCODE_JSON(ExpandedNodeId) {
  549|  26.6k|    const UA_ExpandedNodeId *src = (const UA_ExpandedNodeId*)p;
  550|  26.6k|    UA_String out = UA_STRING_NULL;
  551|  26.6k|    UA_StatusCode ret =
  552|  26.6k|        UA_ExpandedNodeId_printEx(src, &out, ctx->namespaceMapping,
  553|  26.6k|                                  ctx->serverUrisSize, ctx->serverUris);
  554|       |    ret |= String_encodeJson(ctx, &out, NULL);
  555|  26.6k|    UA_String_clear(&out);
  556|  26.6k|    return ret;
  557|  26.6k|}
ua_types_encoding_json.c:StatusCode_encodeJson:
  579|  1.78k|ENCODE_JSON(StatusCode) {
  580|  1.78k|    const UA_StatusCode *src = (const UA_StatusCode*)p;
  581|  1.78k|    const char *codename = UA_StatusCode_name(*src);
  582|  1.78k|    UA_String statusDescription = UA_STRING((char*)(uintptr_t)codename);
  583|  1.78k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.78k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  584|  1.78k|    ret |= writeJsonObjStart(ctx);
  585|  1.78k|    if(*src > UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  1.78k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (585:8): [True: 66, False: 1.72k]
  ------------------
  586|     66|        ret |= writeJsonKey(ctx, UA_JSONKEY_CODE);
  587|     66|        ret |= UInt32_encodeJson(ctx, src, NULL);
  588|     66|        if(codename) {
  ------------------
  |  Branch (588:12): [True: 66, False: 0]
  ------------------
  589|     66|            ret |= writeJsonKey(ctx, UA_JSONKEY_SYMBOL);
  590|       |            ret |= String_encodeJson(ctx, &statusDescription, NULL);
  591|     66|        }
  592|     66|    }
  593|  1.78k|    ret |= writeJsonObjEnd(ctx);
  594|  1.78k|    return ret;
  595|  1.78k|}
ua_types_encoding_json.c:QualifiedName_encodeJson:
  569|  72.6k|ENCODE_JSON(QualifiedName) {
  570|  72.6k|    const UA_QualifiedName *src = (const UA_QualifiedName*)p;
  571|  72.6k|    UA_String out = UA_STRING_NULL;
  572|  72.6k|    UA_StatusCode ret =
  573|  72.6k|        UA_QualifiedName_printEx(src, &out, ctx->namespaceMapping);
  574|       |    ret |= String_encodeJson(ctx, &out, NULL);
  575|  72.6k|    UA_String_clear(&out);
  576|  72.6k|    return ret;
  577|  72.6k|}
ua_types_encoding_json.c:LocalizedText_encodeJson:
  559|  2.85M|ENCODE_JSON(LocalizedText) {
  560|  2.85M|    const UA_LocalizedText *src = (const UA_LocalizedText*)p;
  561|  2.85M|    status ret = writeJsonObjStart(ctx);
  562|  2.85M|    ret |= writeJsonKey(ctx, UA_JSONKEY_LOCALE);
  563|  2.85M|    ret |= String_encodeJson(ctx, &src->locale, NULL);
  564|  2.85M|    ret |= writeJsonKey(ctx, UA_JSONKEY_TEXT);
  565|       |    ret |= String_encodeJson(ctx, &src->text, NULL);
  566|  2.85M|    return ret | writeJsonObjEnd(ctx);
  567|  2.85M|}
ua_types_encoding_json.c:ExtensionObject_encodeJson:
  597|  5.11k|ENCODE_JSON(ExtensionObject) {
  598|  5.11k|    const UA_ExtensionObject *src = (const UA_ExtensionObject*)p;
  599|  5.11k|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_NOBODY)
  ------------------
  |  Branch (599:8): [True: 5.11k, False: 0]
  ------------------
  600|  5.11k|        return writeChars(ctx, "null", 4);
  601|       |
  602|       |    /* Must have a type set if data is decoded */
  603|      0|    if(src->encoding != UA_EXTENSIONOBJECT_ENCODED_BYTESTRING &&
  ------------------
  |  Branch (603:8): [True: 0, False: 0]
  ------------------
  604|      0|       src->encoding != UA_EXTENSIONOBJECT_ENCODED_XML &&
  ------------------
  |  Branch (604:8): [True: 0, False: 0]
  ------------------
  605|      0|       !src->content.decoded.type)
  ------------------
  |  Branch (605:8): [True: 0, False: 0]
  ------------------
  606|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  607|       |
  608|      0|    status ret = writeJsonObjStart(ctx);
  609|       |
  610|       |    /* Write the type NodeId */
  611|      0|    ret |= writeJsonKey(ctx, UA_JSONKEY_TYPEID);
  612|      0|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_BYTESTRING ||
  ------------------
  |  Branch (612:8): [True: 0, False: 0]
  ------------------
  613|      0|       src->encoding == UA_EXTENSIONOBJECT_ENCODED_XML)
  ------------------
  |  Branch (613:8): [True: 0, False: 0]
  ------------------
  614|      0|        ret |= NodeId_encodeJson(ctx, &src->content.encoded.typeId, NULL);
  615|      0|    else
  616|      0|        ret |= NodeId_encodeJson(ctx, &src->content.decoded.type->typeId, NULL);
  617|       |
  618|       |    /* Write the encoding type and body if encoded */
  619|      0|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_BYTESTRING ||
  ------------------
  |  Branch (619:8): [True: 0, False: 0]
  ------------------
  620|      0|       src->encoding == UA_EXTENSIONOBJECT_ENCODED_XML) {
  ------------------
  |  Branch (620:8): [True: 0, False: 0]
  ------------------
  621|      0|        if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_BYTESTRING) {
  ------------------
  |  Branch (621:12): [True: 0, False: 0]
  ------------------
  622|      0|            ret |= writeJsonKey(ctx, UA_JSONKEY_ENCODING);
  623|      0|            ret |= writeChar(ctx, '1');
  624|      0|        } else {
  625|      0|            ret |= writeJsonKey(ctx, UA_JSONKEY_ENCODING);
  626|      0|            ret |= writeChar(ctx, '2');
  627|      0|        }
  628|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_BODY);
  629|      0|        ret |= String_encodeJson(ctx, &src->content.encoded.body, NULL);
  630|      0|        return ret | writeJsonObjEnd(ctx);
  631|      0|    }
  632|       |
  633|      0|    const UA_DataType *t = src->content.decoded.type;
  634|      0|    if(t->typeKind == UA_DATATYPEKIND_STRUCTURE) {
  ------------------
  |  Branch (634:8): [True: 0, False: 0]
  ------------------
  635|       |        /* Write structures in-situ.
  636|       |         * TODO: Structures with optional fields and unions */
  637|      0|        ret |= encodeJsonStructureContent(ctx, src->content.decoded.data, t);
  638|      0|    } else {
  639|       |        /* NON-STANDARD: The standard 1.05 doesn't let us print non-structure
  640|       |         * types in ExtensionObjects (e.g. enums). Print them in the body. */
  641|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_BODY);
  642|      0|        ret |= encodeJsonJumpTable[t->typeKind](ctx, src->content.decoded.data, t);
  643|      0|    }
  644|       |
  645|      0|    return ret | writeJsonObjEnd(ctx);
  646|      0|}
ua_types_encoding_json.c:encodeJsonArray:
  383|  3.94k|                const UA_DataType *type) {
  384|       |    /* Null-arrays (length -1) are written as empty arrays '[]'.
  385|       |     * TODO: Clarify the difference between length -1 and length 0 in JSON. */
  386|  3.94k|    status ret = writeJsonArrStart(ctx);
  387|  3.94k|    if(!ptr)
  ------------------
  |  Branch (387:8): [True: 0, False: 3.94k]
  ------------------
  388|      0|        return ret | writeJsonArrEnd(ctx, type);
  389|       |
  390|  3.94k|    uintptr_t uptr = (uintptr_t)ptr;
  391|  3.94k|    encodeJsonSignature encodeType = encodeJsonJumpTable[type->typeKind];
  392|  3.94k|    UA_Boolean distinct = (type->typeKind > UA_DATATYPEKIND_DOUBLE);
  393|  2.93M|    for(size_t i = 0; i < length && ret == UA_STATUSCODE_GOOD; ++i) {
  ------------------
  |  |   16|  2.92M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (393:23): [True: 2.92M, False: 3.94k]
  |  Branch (393:37): [True: 2.92M, False: 0]
  ------------------
  394|  2.92M|        ret |= writeJsonBeforeElement(ctx, distinct);
  395|  2.92M|        if(isNull((const void*)uptr, type))
  ------------------
  |  Branch (395:12): [True: 0, False: 2.92M]
  ------------------
  396|      0|            ret |= writeChars(ctx, "null", 4);
  397|  2.92M|        else
  398|  2.92M|            ret |= encodeType(ctx, (const void*)uptr, type);
  399|       |        ctx->commaNeeded[ctx->depth] = true;
  400|  2.92M|        uptr += type->memSize;
  401|  2.92M|    }
  402|  3.94k|    return ret | writeJsonArrEnd(ctx, type);
  403|  3.94k|}
ua_types_encoding_json.c:isNull:
  221|  2.92M|isNull(const void *p, const UA_DataType *type) {
  222|  2.92M|    if(UA_DataType_isNumeric(type) ||
  ------------------
  |  Branch (222:8): [True: 2.92M, False: 0]
  ------------------
  223|      0|       type->typeKind == UA_DATATYPEKIND_BOOLEAN)
  ------------------
  |  Branch (223:8): [True: 0, False: 0]
  ------------------
  224|  2.92M|        return false;
  225|      0|    UA_STACKARRAY(char, buf, type->memSize);
  ------------------
  |  |  371|      0|#  define UA_STACKARRAY(TYPE, NAME, SIZE) TYPE NAME[SIZE]
  ------------------
  226|      0|    memset(buf, 0, type->memSize);
  227|      0|    return UA_equal(buf, p, type);
  228|  2.92M|}
ua_types_encoding_json.c:DataValue_encodeJson:
  756|   178k|ENCODE_JSON(DataValue) {
  757|   178k|    const UA_DataValue *src = (const UA_DataValue*)p;
  758|   178k|    UA_Boolean hasValue = src->hasValue;
  759|   178k|    UA_Boolean hasStatus = src->hasStatus;
  760|   178k|    UA_Boolean hasSourceTimestamp = src->hasSourceTimestamp;
  761|   178k|    UA_Boolean hasSourcePicoseconds = src->hasSourcePicoseconds;
  762|   178k|    UA_Boolean hasServerTimestamp = src->hasServerTimestamp;
  763|   178k|    UA_Boolean hasServerPicoseconds = src->hasServerPicoseconds;
  764|       |
  765|   178k|    status ret = writeJsonObjStart(ctx);
  766|       |
  767|   178k|    if(hasValue)
  ------------------
  |  Branch (767:8): [True: 79.0k, False: 99.1k]
  ------------------
  768|  79.0k|        ret |= encodeVariantInner(ctx, &src->value);
  769|       |
  770|   178k|    if(hasStatus) {
  ------------------
  |  Branch (770:8): [True: 21, False: 178k]
  ------------------
  771|     21|        ret |= writeJsonKey(ctx, UA_JSONKEY_STATUS);
  772|     21|        ret |= StatusCode_encodeJson(ctx, &src->status, NULL);
  773|     21|    }
  774|       |
  775|   178k|    if(hasSourceTimestamp) {
  ------------------
  |  Branch (775:8): [True: 0, False: 178k]
  ------------------
  776|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SOURCETIMESTAMP);
  777|      0|        ret |= DateTime_encodeJson(ctx, &src->sourceTimestamp, NULL);
  778|      0|    }
  779|       |
  780|   178k|    if(hasSourcePicoseconds) {
  ------------------
  |  Branch (780:8): [True: 0, False: 178k]
  ------------------
  781|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SOURCEPICOSECONDS);
  782|      0|        ret |= UInt16_encodeJson(ctx, &src->sourcePicoseconds, NULL);
  783|      0|    }
  784|       |
  785|   178k|    if(hasServerTimestamp) {
  ------------------
  |  Branch (785:8): [True: 0, False: 178k]
  ------------------
  786|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SERVERTIMESTAMP);
  787|      0|        ret |= DateTime_encodeJson(ctx, &src->serverTimestamp, NULL);
  788|      0|    }
  789|       |
  790|   178k|    if(hasServerPicoseconds) {
  ------------------
  |  Branch (790:8): [True: 0, False: 178k]
  ------------------
  791|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SERVERPICOSECONDS);
  792|      0|        ret |= UInt16_encodeJson(ctx, &src->serverPicoseconds, NULL);
  793|      0|    }
  794|       |
  795|   178k|    return ret | writeJsonObjEnd(ctx);
  796|   178k|}
ua_types_encoding_json.c:encodeVariantInner:
  706|   227k|encodeVariantInner(CtxJson *ctx, const UA_Variant *src) {
  707|       |    /* If type is 0 (NULL) the Variant contains a NULL value and the containing
  708|       |     * JSON object shall be omitted or replaced by the JSON literal ‘null’ (when
  709|       |     * an element of a JSON array). */
  710|   227k|    if(!src->type)
  ------------------
  |  Branch (710:8): [True: 108k, False: 119k]
  ------------------
  711|   108k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   108k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  712|       |
  713|       |    /* Set the array type in the encoding mask */
  714|   119k|    const bool isArray = src->arrayLength > 0 || src->data <= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|   231k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (714:26): [True: 8.13k, False: 111k]
  |  Branch (714:50): [True: 8.22k, False: 103k]
  ------------------
  715|   119k|    const bool hasDimensions = isArray && src->arrayDimensionsSize > 1;
  ------------------
  |  Branch (715:32): [True: 16.3k, False: 103k]
  |  Branch (715:43): [True: 3.94k, False: 12.4k]
  ------------------
  716|       |
  717|       |    /* Wrap the value in an ExtensionObject if not builtin. We cannot directly
  718|       |     * encode a variant inside a variant (but arrays of variant are possible) */
  719|   119k|    UA_Boolean wrapEO = (src->type->typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO);
  720|   119k|    if(src->type == &UA_TYPES[UA_TYPES_VARIANT] && !isArray)
  ------------------
  |  |  803|   119k|#define UA_TYPES_VARIANT 23
  ------------------
  |  Branch (720:8): [True: 1.37k, False: 118k]
  |  Branch (720:52): [True: 0, False: 1.37k]
  ------------------
  721|      0|        wrapEO = true;
  722|       |
  723|   119k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   119k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  724|       |
  725|       |    /* Write the type number */
  726|   119k|    UA_UInt32 typeId = src->type->typeKind + 1;
  727|   119k|    if(wrapEO)
  ------------------
  |  Branch (727:8): [True: 0, False: 119k]
  ------------------
  728|      0|        typeId = UA_TYPES[UA_TYPES_EXTENSIONOBJECT].typeKind + 1;
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  729|   119k|    ret |= writeJsonKey(ctx, UA_JSONKEY_TYPE);
  730|   119k|    ret |= UInt32_encodeJson(ctx, &typeId, NULL);
  731|       |
  732|       |    /* Write the value */
  733|   119k|    ret |= writeJsonKey(ctx, UA_JSONKEY_VALUE);
  734|   119k|    if(!isArray) {
  ------------------
  |  Branch (734:8): [True: 103k, False: 16.3k]
  ------------------
  735|   103k|        ret |= encodeScalarJsonWrapExtensionObject(ctx, src);
  736|   103k|    } else {
  737|  16.3k|        ret |= encodeArrayJsonWrapExtensionObject(ctx, src->data,
  738|  16.3k|                                                  src->arrayLength, src->type);
  739|  16.3k|    }
  740|       |
  741|       |    /* Write the dimensions */
  742|   119k|    if(hasDimensions) {
  ------------------
  |  Branch (742:8): [True: 3.94k, False: 115k]
  ------------------
  743|  3.94k|        ret |= writeJsonKey(ctx, UA_JSONKEY_DIMENSIONS);
  744|  3.94k|        ret |= encodeJsonArray(ctx, src->arrayDimensions, src->arrayDimensionsSize,
  745|  3.94k|                               &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  225|  3.94k|#define UA_TYPES_UINT32 6
  ------------------
  746|  3.94k|    }
  747|       |
  748|   119k|    return ret;
  749|   227k|}
ua_types_encoding_json.c:encodeScalarJsonWrapExtensionObject:
  650|   103k|encodeScalarJsonWrapExtensionObject(CtxJson *ctx, const UA_Variant *src) {
  651|   103k|    const UA_Boolean isBuiltin =
  652|   103k|        (src->type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO);
  653|   103k|    const void *ptr = src->data;
  654|   103k|    const UA_DataType *type = src->type;
  655|       |
  656|       |    /* Set up a temporary ExtensionObject to wrap the data */
  657|   103k|    UA_ExtensionObject eo;
  658|   103k|    if(!isBuiltin) {
  ------------------
  |  Branch (658:8): [True: 0, False: 103k]
  ------------------
  659|      0|        UA_ExtensionObject_init(&eo);
  660|      0|        eo.encoding = UA_EXTENSIONOBJECT_DECODED;
  661|      0|        eo.content.decoded.type = src->type;
  662|      0|        eo.content.decoded.data = src->data;
  663|      0|        ptr = &eo;
  664|      0|        type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  665|      0|    }
  666|       |
  667|   103k|    return encodeJsonJumpTable[type->typeKind](ctx, ptr, type);
  668|   103k|}
ua_types_encoding_json.c:encodeArrayJsonWrapExtensionObject:
  673|  16.3k|                                   size_t size, const UA_DataType *type) {
  674|  16.3k|    if(size > UA_INT32_MAX)
  ------------------
  |  |  100|  16.3k|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (674:8): [True: 0, False: 16.3k]
  ------------------
  675|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  676|       |
  677|  16.3k|    status ret = writeJsonArrStart(ctx);
  678|       |
  679|  16.3k|    u16 memSize = type->memSize;
  680|  16.3k|    const UA_Boolean isBuiltin =
  681|  16.3k|        (type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO);
  682|  16.3k|    if(isBuiltin) {
  ------------------
  |  Branch (682:8): [True: 16.3k, False: 0]
  ------------------
  683|  16.3k|        uintptr_t ptr = (uintptr_t)data;
  684|  14.7M|        for(size_t i = 0; i < size && ret == UA_STATUSCODE_GOOD; ++i) {
  ------------------
  |  |   16|  14.7M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (684:27): [True: 14.7M, False: 16.3k]
  |  Branch (684:39): [True: 14.7M, False: 0]
  ------------------
  685|  14.7M|            ret |= writeJsonArrElm(ctx, (const void*)ptr, type);
  686|  14.7M|            ptr += memSize;
  687|  14.7M|        }
  688|  16.3k|    } else {
  689|       |        /* Set up a temporary ExtensionObject to wrap the data */
  690|      0|        UA_ExtensionObject eo;
  691|      0|        UA_ExtensionObject_init(&eo);
  692|      0|        eo.encoding = UA_EXTENSIONOBJECT_DECODED;
  693|      0|        eo.content.decoded.type = type;
  694|      0|        eo.content.decoded.data = (void*)(uintptr_t)data;
  695|      0|        for(size_t i = 0; i < size && ret == UA_STATUSCODE_GOOD; ++i) {
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (695:27): [True: 0, False: 0]
  |  Branch (695:39): [True: 0, False: 0]
  ------------------
  696|      0|            ret |= writeJsonArrElm(ctx, &eo, &UA_TYPES[UA_TYPES_EXTENSIONOBJECT]);
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  697|      0|            eo.content.decoded.data = (void*)
  698|      0|                ((uintptr_t)eo.content.decoded.data + memSize);
  699|      0|        }
  700|      0|    }
  701|       |
  702|  16.3k|    return ret | writeJsonArrEnd(ctx, type);
  703|  16.3k|}
ua_types_encoding_json.c:Variant_encodeJson:
  751|   148k|ENCODE_JSON(Variant) {
  752|   148k|    const UA_Variant *src = (const UA_Variant*)p;
  753|   148k|    return writeJsonObjStart(ctx) | encodeVariantInner(ctx, src) | writeJsonObjEnd(ctx);
  754|   148k|}
ua_types_encoding_json.c:DiagnosticInfo_encodeJson:
  798|  1.89k|ENCODE_JSON(DiagnosticInfo) {
  799|  1.89k|    const UA_DiagnosticInfo *src = (const UA_DiagnosticInfo*)p;
  800|  1.89k|    status ret = writeJsonObjStart(ctx);
  801|       |
  802|  1.89k|    if(src->hasSymbolicId) {
  ------------------
  |  Branch (802:8): [True: 0, False: 1.89k]
  ------------------
  803|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SYMBOLICID);
  804|      0|        ret |= Int32_encodeJson(ctx, &src->symbolicId, NULL);
  805|      0|    }
  806|       |
  807|  1.89k|    if(src->hasNamespaceUri) {
  ------------------
  |  Branch (807:8): [True: 0, False: 1.89k]
  ------------------
  808|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_NAMESPACEURI);
  809|      0|        ret |= Int32_encodeJson(ctx, &src->namespaceUri, NULL);
  810|      0|    }
  811|       |
  812|  1.89k|    if(src->hasLocalizedText) {
  ------------------
  |  Branch (812:8): [True: 0, False: 1.89k]
  ------------------
  813|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_LOCALIZEDTEXT);
  814|      0|        ret |= Int32_encodeJson(ctx, &src->localizedText, NULL);
  815|      0|    }
  816|       |
  817|  1.89k|    if(src->hasLocale) {
  ------------------
  |  Branch (817:8): [True: 0, False: 1.89k]
  ------------------
  818|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_LOCALE);
  819|      0|        ret |= Int32_encodeJson(ctx, &src->locale, NULL);
  820|      0|    }
  821|       |
  822|  1.89k|    if(src->hasAdditionalInfo) {
  ------------------
  |  Branch (822:8): [True: 0, False: 1.89k]
  ------------------
  823|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_ADDITIONALINFO);
  824|      0|        ret |= String_encodeJson(ctx, &src->additionalInfo, NULL);
  825|      0|    }
  826|       |
  827|  1.89k|    if(src->hasInnerStatusCode) {
  ------------------
  |  Branch (827:8): [True: 0, False: 1.89k]
  ------------------
  828|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_INNERSTATUSCODE);
  829|      0|        ret |= StatusCode_encodeJson(ctx, &src->innerStatusCode, NULL);
  830|      0|    }
  831|       |
  832|  1.89k|    if(src->hasInnerDiagnosticInfo && src->innerDiagnosticInfo) {
  ------------------
  |  Branch (832:8): [True: 0, False: 1.89k]
  |  Branch (832:39): [True: 0, False: 0]
  ------------------
  833|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_INNERDIAGNOSTICINFO);
  834|      0|        ret |= DiagnosticInfo_encodeJson(ctx, src->innerDiagnosticInfo, NULL);
  835|      0|    }
  836|       |
  837|  1.89k|    return ret | writeJsonObjEnd(ctx);
  838|  1.89k|}
ua_types_encoding_json.c:jsoneq:
 1078|  2.48M|jsoneq(const char *json, const cj5_token *tok, const char *searchKey) {
 1079|       |    /* TODO: necessary?
 1080|       |       if(json == NULL
 1081|       |            || tok == NULL
 1082|       |            || searchKey == NULL) {
 1083|       |        return -1;
 1084|       |    } */
 1085|       |
 1086|  2.48M|    size_t len = getTokenLength(tok);
 1087|  2.48M|    if(tok->type == CJ5_TOKEN_STRING &&
  ------------------
  |  Branch (1087:8): [True: 2.48M, False: 0]
  ------------------
 1088|  2.48M|       strlen(searchKey) ==  len &&
  ------------------
  |  Branch (1088:8): [True: 2.15M, False: 338k]
  ------------------
 1089|  2.15M|       strncmp(json + tok->start, (const char*)searchKey, len) == 0)
  ------------------
  |  Branch (1089:8): [True: 2.14M, False: 4.48k]
  ------------------
 1090|  2.14M|        return 0;
 1091|       |
 1092|   342k|    return -1;
 1093|  2.48M|}
ua_types_encoding_json.c:skipObject:
 1062|   504k|skipObject(ParseCtx *ctx) {
 1063|   504k|    unsigned int end = ctx->tokens[ctx->index].end;
 1064|  62.8M|    do {
 1065|  62.8M|        ctx->index++;
 1066|  62.8M|    } while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1066:13): [True: 62.8M, False: 10.6k]
  ------------------
 1067|  62.8M|            ctx->tokens[ctx->index].start < end);
  ------------------
  |  Branch (1067:13): [True: 62.3M, False: 494k]
  ------------------
 1068|   504k|}
ua_types_encoding_json.c:DiagnosticInfo_decodeJson:
 2200|  1.26k|DECODE_JSON(DiagnosticInfo) {
 2201|  1.26k|    UA_DiagnosticInfo *dst = (UA_DiagnosticInfo*)p;
 2202|  1.26k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DiagnosticInfo */
  ------------------
  |  | 1047|  1.26k|#define CHECK_NULL_SKIP do {                         \
  |  | 1048|  1.26k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1048:8): [True: 0, False: 1.26k]
  |  |  ------------------
  |  | 1049|      0|        ctx->index++;                                \
  |  | 1050|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1051|  1.26k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1051:14): [Folded, False: 1.26k]
  |  |  ------------------
  ------------------
 2203|  1.26k|    CHECK_OBJECT;
  ------------------
  |  | 1042|  1.26k|#define CHECK_OBJECT do {                                \
  |  | 1043|  1.26k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1043:8): [True: 0, False: 1.26k]
  |  |  ------------------
  |  | 1044|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1045|  1.26k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1045:14): [Folded, False: 1.26k]
  |  |  ------------------
  ------------------
 2204|       |
 2205|  1.26k|    DecodeEntry entries[7] = {
 2206|  1.26k|        {UA_JSONKEY_SYMBOLICID, &dst->symbolicId, NULL,
 2207|  1.26k|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|  1.26k|#define UA_TYPES_INT32 5
  ------------------
 2208|  1.26k|        {UA_JSONKEY_NAMESPACEURI, &dst->namespaceUri, NULL,
 2209|  1.26k|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|  1.26k|#define UA_TYPES_INT32 5
  ------------------
 2210|  1.26k|        {UA_JSONKEY_LOCALIZEDTEXT, &dst->localizedText, NULL,
 2211|  1.26k|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|  1.26k|#define UA_TYPES_INT32 5
  ------------------
 2212|  1.26k|        {UA_JSONKEY_LOCALE, &dst->locale, NULL,
 2213|  1.26k|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|  1.26k|#define UA_TYPES_INT32 5
  ------------------
 2214|  1.26k|        {UA_JSONKEY_ADDITIONALINFO, &dst->additionalInfo, NULL,
 2215|  1.26k|         false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  395|  1.26k|#define UA_TYPES_STRING 11
  ------------------
 2216|  1.26k|        {UA_JSONKEY_INNERSTATUSCODE, &dst->innerStatusCode, NULL,
 2217|  1.26k|         false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  633|  1.26k|#define UA_TYPES_STATUSCODE 18
  ------------------
 2218|  1.26k|        {UA_JSONKEY_INNERDIAGNOSTICINFO, &dst->innerDiagnosticInfo,
 2219|  1.26k|         DiagnosticInfoInner_decodeJson, false, NULL}
 2220|  1.26k|    };
 2221|  1.26k|    status ret = decodeFields(ctx, entries, 7);
 2222|       |
 2223|  1.26k|    dst->hasSymbolicId = entries[0].found;
 2224|  1.26k|    dst->hasNamespaceUri = entries[1].found;
 2225|  1.26k|    dst->hasLocalizedText = entries[2].found;
 2226|  1.26k|    dst->hasLocale = entries[3].found;
 2227|  1.26k|    dst->hasAdditionalInfo = entries[4].found;
 2228|  1.26k|    dst->hasInnerStatusCode = entries[5].found;
 2229|  1.26k|    dst->hasInnerDiagnosticInfo = entries[6].found;
 2230|  1.26k|    return ret;
 2231|  1.26k|}
ua_types_encoding_json.c:Boolean_decodeJson:
 1095|  5.11k|DECODE_JSON(Boolean) {
 1096|  5.11k|    UA_Boolean *dst = (UA_Boolean*)p;
 1097|  5.11k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|  5.11k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|  5.11k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 5.11k]
  |  |  ------------------
  |  | 1024|  5.11k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|  5.11k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 5.11k]
  |  |  ------------------
  ------------------
 1098|  5.11k|    CHECK_BOOL;
  ------------------
  |  | 1032|  5.11k|#define CHECK_BOOL do {                                \
  |  | 1033|  5.11k|    if(currentTokenType(ctx) != CJ5_TOKEN_BOOL) {      \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 10, False: 5.10k]
  |  |  ------------------
  |  | 1034|     10|        return UA_STATUSCODE_BADDECODINGERROR;         \
  |  |  ------------------
  |  |  |  |   43|     10|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|  5.10k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1035:14): [Folded, False: 5.10k]
  |  |  ------------------
  ------------------
 1099|  5.10k|    GET_TOKEN;
  ------------------
  |  | 1018|  5.10k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|  5.10k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|  5.10k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 5.10k]
  |  |  ------------------
  ------------------
 1100|       |
 1101|  5.10k|    if(tokenSize == 4 &&
  ------------------
  |  Branch (1101:8): [True: 517, False: 4.59k]
  ------------------
 1102|    517|       (tokenData[0] | 32) == 't' && (tokenData[1] | 32) == 'r' &&
  ------------------
  |  Branch (1102:8): [True: 517, False: 0]
  |  Branch (1102:38): [True: 517, False: 0]
  ------------------
 1103|    517|       (tokenData[2] | 32) == 'u' && (tokenData[3] | 32) == 'e') {
  ------------------
  |  Branch (1103:8): [True: 517, False: 0]
  |  Branch (1103:38): [True: 517, False: 0]
  ------------------
 1104|    517|        *dst = true;
 1105|  4.59k|    } else if(tokenSize == 5 &&
  ------------------
  |  Branch (1105:15): [True: 4.59k, False: 0]
  ------------------
 1106|  4.59k|              (tokenData[0] | 32) == 'f' && (tokenData[1] | 32) == 'a' &&
  ------------------
  |  Branch (1106:15): [True: 4.59k, False: 0]
  |  Branch (1106:45): [True: 4.59k, False: 0]
  ------------------
 1107|  4.59k|              (tokenData[2] | 32) == 'l' && (tokenData[3] | 32) == 's' &&
  ------------------
  |  Branch (1107:15): [True: 4.59k, False: 0]
  |  Branch (1107:45): [True: 4.59k, False: 0]
  ------------------
 1108|  4.59k|              (tokenData[4] | 32) == 'e') {
  ------------------
  |  Branch (1108:15): [True: 4.59k, False: 0]
  ------------------
 1109|  4.59k|        *dst = false;
 1110|  4.59k|    } else {
 1111|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1112|      0|    }
 1113|       |
 1114|  5.10k|    ctx->index++;
 1115|  5.10k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  5.10k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1116|  5.10k|}
ua_types_encoding_json.c:SByte_decodeJson:
 1203|   527k|DECODE_JSON(SByte) {
 1204|   527k|    UA_SByte *dst = (UA_SByte*)p;
 1205|   527k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|   527k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|   527k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 527k]
  |  |  ------------------
  |  | 1024|   527k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|   527k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 527k]
  |  |  ------------------
  ------------------
 1206|   527k|    CHECK_NUMBER;
  ------------------
  |  | 1027|   527k|#define CHECK_NUMBER do {                                \
  |  | 1028|   527k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1028:8): [True: 2, False: 527k]
  |  |  ------------------
  |  | 1029|      2|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1030|   527k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:14): [Folded, False: 527k]
  |  |  ------------------
  ------------------
 1207|   527k|    GET_TOKEN;
  ------------------
  |  | 1018|   527k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|   527k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|   527k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 527k]
  |  |  ------------------
  ------------------
 1208|   527k|    UA_Int64 out = 0;
 1209|   527k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1210|   527k|    if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   16|  1.05M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   63|  1.05M|#define UA_SBYTE_MIN (-128)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   64|   527k|#define UA_SBYTE_MAX 127
  ------------------
  |  Branch (1210:8): [True: 16, False: 527k]
  |  Branch (1210:35): [True: 1, False: 527k]
  |  Branch (1210:57): [True: 1, False: 527k]
  ------------------
 1211|     18|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     18|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1212|   527k|    *dst = (UA_SByte)out;
 1213|   527k|    ctx->index++;
 1214|   527k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   527k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1215|   527k|}
ua_types_encoding_json.c:parseSignedInteger:
 1135|  4.31M|parseSignedInteger(const char *tokenData, size_t tokenSize, UA_Int64 *dst) {
 1136|  4.31M|    size_t len = parseInt64(tokenData, tokenSize, dst);
 1137|  4.31M|    if(len == 0)
  ------------------
  |  Branch (1137:8): [True: 9, False: 4.31M]
  ------------------
 1138|      9|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1139|       |
 1140|       |    /* There must only be whitespace between the end of the parsed number and
 1141|       |     * the end of the token */
 1142|  4.31M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1142:25): [True: 890, False: 4.31M]
  ------------------
 1143|    890|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1143:12): [True: 876, False: 14]
  |  Branch (1143:35): [True: 47, False: 829]
  ------------------
 1144|     47|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     47|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1145|    890|    }
 1146|       |
 1147|  4.31M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  4.31M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1148|  4.31M|}
ua_types_encoding_json.c:Byte_decodeJson:
 1150|   279k|DECODE_JSON(Byte) {
 1151|   279k|    UA_Byte *dst = (UA_Byte*)p;
 1152|   279k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|   279k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|   279k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 279k]
  |  |  ------------------
  |  | 1024|   279k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|   279k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 279k]
  |  |  ------------------
  ------------------
 1153|   279k|    CHECK_NUMBER;
  ------------------
  |  | 1027|   279k|#define CHECK_NUMBER do {                                \
  |  | 1028|   279k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1028:8): [True: 1, False: 279k]
  |  |  ------------------
  |  | 1029|      1|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1030|   279k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:14): [Folded, False: 279k]
  |  |  ------------------
  ------------------
 1154|   279k|    GET_TOKEN;
  ------------------
  |  | 1018|   279k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|   279k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|   279k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 279k]
  |  |  ------------------
  ------------------
 1155|   279k|    UA_UInt64 out = 0;
 1156|   279k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1157|   279k|    if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   16|   558k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   73|   279k|#define UA_BYTE_MAX 255
  ------------------
  |  Branch (1157:8): [True: 13, False: 279k]
  |  Branch (1157:35): [True: 2, False: 279k]
  ------------------
 1158|     15|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     15|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1159|   279k|    *dst = (UA_Byte)out;
 1160|   279k|    ctx->index++;
 1161|   279k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   279k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1162|   279k|}
ua_types_encoding_json.c:parseUnsignedInteger:
 1119|  5.74M|parseUnsignedInteger(const char *tokenData, size_t tokenSize, UA_UInt64 *dst) {
 1120|  5.74M|    size_t len = parseUInt64(tokenData, tokenSize, dst);
 1121|  5.74M|    if(len == 0)
  ------------------
  |  Branch (1121:8): [True: 24, False: 5.74M]
  ------------------
 1122|     24|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     24|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1123|       |
 1124|       |    /* There must only be whitespace between the end of the parsed number and
 1125|       |     * the end of the token */
 1126|  5.74M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1126:25): [True: 1.62k, False: 5.74M]
  ------------------
 1127|  1.62k|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1127:12): [True: 1.60k, False: 22]
  |  Branch (1127:35): [True: 45, False: 1.55k]
  ------------------
 1128|     45|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     45|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1129|  1.62k|    }
 1130|       |
 1131|  5.74M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  5.74M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1132|  5.74M|}
ua_types_encoding_json.c:Int16_decodeJson:
 1217|   273k|DECODE_JSON(Int16) {
 1218|   273k|    UA_Int16 *dst = (UA_Int16*)p;
 1219|   273k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|   273k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|   273k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 273k]
  |  |  ------------------
  |  | 1024|   273k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|   273k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 273k]
  |  |  ------------------
  ------------------
 1220|   273k|    CHECK_NUMBER;
  ------------------
  |  | 1027|   273k|#define CHECK_NUMBER do {                                \
  |  | 1028|   273k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1028:8): [True: 0, False: 273k]
  |  |  ------------------
  |  | 1029|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1030|   273k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:14): [Folded, False: 273k]
  |  |  ------------------
  ------------------
 1221|   273k|    GET_TOKEN;
  ------------------
  |  | 1018|   273k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|   273k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|   273k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 273k]
  |  |  ------------------
  ------------------
 1222|   273k|    UA_Int64 out = 0;
 1223|   273k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1224|   273k|    if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   16|   546k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   81|   546k|#define UA_INT16_MIN (-32768)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   82|   273k|#define UA_INT16_MAX 32767
  ------------------
  |  Branch (1224:8): [True: 7, False: 273k]
  |  Branch (1224:35): [True: 0, False: 273k]
  |  Branch (1224:57): [True: 0, False: 273k]
  ------------------
 1225|      7|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1226|   273k|    *dst = (UA_Int16)out;
 1227|   273k|    ctx->index++;
 1228|   273k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   273k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1229|   273k|}
ua_types_encoding_json.c:UInt16_decodeJson:
 1164|   276k|DECODE_JSON(UInt16) {
 1165|   276k|    UA_UInt16 *dst = (UA_UInt16*)p;
 1166|   276k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|   276k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|   276k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 276k]
  |  |  ------------------
  |  | 1024|   276k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|   276k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 276k]
  |  |  ------------------
  ------------------
 1167|   276k|    CHECK_NUMBER;
  ------------------
  |  | 1027|   276k|#define CHECK_NUMBER do {                                \
  |  | 1028|   276k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1028:8): [True: 0, False: 276k]
  |  |  ------------------
  |  | 1029|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1030|   276k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:14): [Folded, False: 276k]
  |  |  ------------------
  ------------------
 1168|   276k|    GET_TOKEN;
  ------------------
  |  | 1018|   276k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|   276k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|   276k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 276k]
  |  |  ------------------
  ------------------
 1169|   276k|    UA_UInt64 out = 0;
 1170|   276k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1171|   276k|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   16|   552k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   91|   276k|#define UA_UINT16_MAX 65535
  ------------------
  |  Branch (1171:8): [True: 8, False: 276k]
  |  Branch (1171:35): [True: 3, False: 276k]
  ------------------
 1172|     11|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     11|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1173|   276k|    *dst = (UA_UInt16)out;
 1174|   276k|    ctx->index++;
 1175|   276k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   276k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1176|   276k|}
ua_types_encoding_json.c:Int32_decodeJson:
 1231|  2.03M|DECODE_JSON(Int32) {
 1232|  2.03M|    UA_Int32 *dst = (UA_Int32*)p;
 1233|  2.03M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|  2.03M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|  2.03M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 2.03M]
  |  |  ------------------
  |  | 1024|  2.03M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|  2.03M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 2.03M]
  |  |  ------------------
  ------------------
 1234|  2.03M|    CHECK_NUMBER;
  ------------------
  |  | 1027|  2.03M|#define CHECK_NUMBER do {                                \
  |  | 1028|  2.03M|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1028:8): [True: 0, False: 2.03M]
  |  |  ------------------
  |  | 1029|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1030|  2.03M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:14): [Folded, False: 2.03M]
  |  |  ------------------
  ------------------
 1235|  2.03M|    GET_TOKEN;
  ------------------
  |  | 1018|  2.03M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|  2.03M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|  2.03M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 2.03M]
  |  |  ------------------
  ------------------
 1236|  2.03M|    UA_Int64 out = 0;
 1237|  2.03M|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1238|  2.03M|    if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   16|  4.06M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   99|  4.06M|#define UA_INT32_MIN ((int32_t)-2147483648LL)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |  100|  2.03M|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (1238:8): [True: 8, False: 2.03M]
  |  Branch (1238:35): [True: 2, False: 2.03M]
  |  Branch (1238:57): [True: 2, False: 2.03M]
  ------------------
 1239|     12|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     12|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1240|  2.03M|    *dst = (UA_Int32)out;
 1241|  2.03M|    ctx->index++;
 1242|  2.03M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  2.03M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1243|  2.03M|}
ua_types_encoding_json.c:UInt32_decodeJson:
 1178|  1.95M|DECODE_JSON(UInt32) {
 1179|  1.95M|    UA_UInt32 *dst = (UA_UInt32*)p;
 1180|  1.95M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|  1.95M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|  1.95M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 1.95M]
  |  |  ------------------
  |  | 1024|  1.95M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|  1.95M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 1.95M]
  |  |  ------------------
  ------------------
 1181|  1.95M|    CHECK_NUMBER;
  ------------------
  |  | 1027|  1.95M|#define CHECK_NUMBER do {                                \
  |  | 1028|  1.95M|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1028:8): [True: 5, False: 1.95M]
  |  |  ------------------
  |  | 1029|      5|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1030|  1.95M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:14): [Folded, False: 1.95M]
  |  |  ------------------
  ------------------
 1182|  1.95M|    GET_TOKEN;
  ------------------
  |  | 1018|  1.95M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|  1.95M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|  1.95M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 1.95M]
  |  |  ------------------
  ------------------
 1183|  1.95M|    UA_UInt64 out = 0;
 1184|  1.95M|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1185|  1.95M|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |   16|  3.90M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |  109|  1.95M|#define UA_UINT32_MAX 4294967295UL
  ------------------
  |  Branch (1185:8): [True: 28, False: 1.95M]
  |  Branch (1185:35): [True: 3, False: 1.95M]
  ------------------
 1186|     31|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     31|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1187|  1.95M|    *dst = (UA_UInt32)out;
 1188|  1.95M|    ctx->index++;
 1189|  1.95M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.95M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1190|  1.95M|}
ua_types_encoding_json.c:Int64_decodeJson:
 1245|  1.48M|DECODE_JSON(Int64) {
 1246|  1.48M|    UA_Int64 *dst = (UA_Int64*)p;
 1247|  1.48M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|  1.48M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|  1.48M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 1.48M]
  |  |  ------------------
  |  | 1024|  1.48M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|  1.48M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 1.48M]
  |  |  ------------------
  ------------------
 1248|  1.48M|    GET_TOKEN;
  ------------------
  |  | 1018|  1.48M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|  1.48M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|  1.48M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 1.48M]
  |  |  ------------------
  ------------------
 1249|  1.48M|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, dst);
 1250|  1.48M|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  1.48M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1250:8): [True: 25, False: 1.48M]
  ------------------
 1251|     25|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     25|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1252|  1.48M|    ctx->index++;
 1253|  1.48M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.48M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1254|  1.48M|}
ua_types_encoding_json.c:UInt64_decodeJson:
 1192|  3.23M|DECODE_JSON(UInt64) {
 1193|  3.23M|    UA_UInt64 *dst = (UA_UInt64*)p;
 1194|  3.23M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|  3.23M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|  3.23M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 3.23M]
  |  |  ------------------
  |  | 1024|  3.23M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|  3.23M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 3.23M]
  |  |  ------------------
  ------------------
 1195|  3.23M|    GET_TOKEN;
  ------------------
  |  | 1018|  3.23M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|  3.23M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|  3.23M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 3.23M]
  |  |  ------------------
  ------------------
 1196|  3.23M|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, dst);
 1197|  3.23M|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  3.23M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1197:8): [True: 20, False: 3.23M]
  ------------------
 1198|     20|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     20|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1199|  3.23M|    ctx->index++;
 1200|  3.23M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  3.23M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1201|  3.23M|}
ua_types_encoding_json.c:Float_decodeJson:
 1317|   742k|DECODE_JSON(Float) {
 1318|   742k|    UA_Float *dst = (UA_Float*)p;
 1319|   742k|    UA_Double v = 0.0;
 1320|       |    UA_StatusCode res = Double_decodeJson(ctx, &v, NULL);
 1321|   742k|    *dst = (UA_Float)v;
 1322|   742k|    return res;
 1323|   742k|}
ua_types_encoding_json.c:Double_decodeJson:
 1257|  1.02M|DECODE_JSON(Double) {
 1258|  1.02M|    UA_Double *dst = (UA_Double*)p;
 1259|  1.02M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|  1.02M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|  1.02M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 1.02M]
  |  |  ------------------
  |  | 1024|  1.02M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|  1.02M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 1.02M]
  |  |  ------------------
  ------------------
 1260|  1.02M|    GET_TOKEN;
  ------------------
  |  | 1018|  1.02M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|  1.02M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|  1.02M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 1.02M]
  |  |  ------------------
  ------------------
 1261|       |
 1262|       |    /* https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/
 1263|       |     * Maximum digit counts for select IEEE floating-point formats: 1074
 1264|       |     * Sanity check.
 1265|       |     */
 1266|  1.02M|    if(tokenSize > 2000)
  ------------------
  |  Branch (1266:8): [True: 1, False: 1.02M]
  ------------------
 1267|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1268|       |
 1269|  1.02M|    cj5_token_type tokenType = currentTokenType(ctx);
 1270|       |
 1271|       |    /* It could be a String with Nan, Infinity */
 1272|  1.02M|    if(tokenType == CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (1272:8): [True: 3.66k, False: 1.01M]
  ------------------
 1273|  3.66k|        ctx->index++;
 1274|       |
 1275|  3.66k|        if(tokenSize == 8 && memcmp(tokenData, "Infinity", 8) == 0) {
  ------------------
  |  Branch (1275:12): [True: 726, False: 2.93k]
  |  Branch (1275:30): [True: 726, False: 0]
  ------------------
 1276|    726|            *dst = INFINITY;
 1277|    726|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    726|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1278|    726|        }
 1279|       |
 1280|  2.93k|        if(tokenSize == 9 && memcmp(tokenData, "-Infinity", 9) == 0) {
  ------------------
  |  Branch (1280:12): [True: 545, False: 2.39k]
  |  Branch (1280:30): [True: 545, False: 0]
  ------------------
 1281|       |            /* workaround an MSVC 2013 issue */
 1282|    545|            *dst = -INFINITY;
 1283|    545|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    545|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1284|    545|        }
 1285|       |
 1286|  2.39k|        if(tokenSize == 3 && memcmp(tokenData, "NaN", 3) == 0) {
  ------------------
  |  Branch (1286:12): [True: 1.97k, False: 424]
  |  Branch (1286:30): [True: 1.96k, False: 5]
  ------------------
 1287|  1.96k|            *dst = NAN;
 1288|  1.96k|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.96k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1289|  1.96k|        }
 1290|       |
 1291|    429|        if(tokenSize == 4 && memcmp(tokenData, "-NaN", 4) == 0) {
  ------------------
  |  Branch (1291:12): [True: 402, False: 27]
  |  Branch (1291:30): [True: 397, False: 5]
  ------------------
 1292|    397|            *dst = NAN;
 1293|    397|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    397|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1294|    397|        }
 1295|       |
 1296|     32|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     32|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1297|    429|    }
 1298|       |
 1299|  1.01M|    if(tokenType != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1299:8): [True: 1, False: 1.01M]
  ------------------
 1300|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1301|       |
 1302|  1.01M|    size_t len = parseDouble(tokenData, tokenSize, dst);
 1303|  1.01M|    if(len == 0)
  ------------------
  |  Branch (1303:8): [True: 3, False: 1.01M]
  ------------------
 1304|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1305|       |
 1306|       |    /* There must only be whitespace between the end of the parsed number and
 1307|       |     * the end of the token */
 1308|  1.01M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1308:25): [True: 15, False: 1.01M]
  ------------------
 1309|     15|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1309:12): [True: 15, False: 0]
  |  Branch (1309:35): [True: 15, False: 0]
  ------------------
 1310|     15|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     15|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1311|     15|    }
 1312|       |
 1313|  1.01M|    ctx->index++;
 1314|  1.01M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.01M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1315|  1.01M|}
ua_types_encoding_json.c:String_decodeJson:
 1335|   209k|DECODE_JSON(String) {
 1336|   209k|    UA_String *dst = (UA_String*)p;
 1337|   209k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|   209k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|   209k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 209k]
  |  |  ------------------
  |  | 1024|   209k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|   209k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 209k]
  |  |  ------------------
  ------------------
 1338|   209k|    CHECK_STRING;
  ------------------
  |  | 1037|   209k|#define CHECK_STRING do {                                \
  |  | 1038|   209k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 4, False: 209k]
  |  |  ------------------
  |  | 1039|      4|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|   209k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 209k]
  |  |  ------------------
  ------------------
 1339|   209k|    GET_TOKEN;
  ------------------
  |  | 1018|   209k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|   209k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|   209k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 209k]
  |  |  ------------------
  ------------------
 1340|   209k|    (void)tokenData;
 1341|       |
 1342|       |    /* Empty string? */
 1343|   209k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1343:8): [True: 6.81k, False: 202k]
  ------------------
 1344|  6.81k|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  6.81k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1345|  6.81k|        dst->length = 0;
 1346|  6.81k|        ctx->index++;
 1347|  6.81k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  6.81k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1348|  6.81k|    }
 1349|       |
 1350|       |    /* The decoded utf8 is at most of the same length as the source string */
 1351|   202k|    char *outBuf = (char*)UA_malloc(tokenSize+1);
  ------------------
  |  |   18|   202k|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 1352|   202k|    if(!outBuf)
  ------------------
  |  Branch (1352:8): [True: 0, False: 202k]
  ------------------
 1353|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1354|       |
 1355|       |    /* Decode the string */
 1356|   202k|    cj5_result r;
 1357|   202k|    r.tokens = ctx->tokens;
 1358|   202k|    r.num_tokens = (unsigned int)ctx->tokensSize;
 1359|   202k|    r.json5 = ctx->json5;
 1360|   202k|    unsigned int len = 0;
 1361|   202k|    cj5_error_code err = cj5_get_str(&r, (unsigned int)ctx->index, outBuf, &len);
 1362|   202k|    if(err != CJ5_ERROR_NONE) {
  ------------------
  |  Branch (1362:8): [True: 46, False: 202k]
  ------------------
 1363|     46|        UA_free(outBuf);
  ------------------
  |  |   19|     46|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1364|     46|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     46|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1365|     46|    }
 1366|       |
 1367|       |    /* Set the output */
 1368|   202k|    dst->length = len;
 1369|   202k|    if(dst->length > 0) {
  ------------------
  |  Branch (1369:8): [True: 202k, False: 0]
  ------------------
 1370|   202k|        dst->data = (UA_Byte*)outBuf;
 1371|   202k|    } else {
 1372|      0|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|      0|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1373|      0|        UA_free(outBuf);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1374|      0|    }
 1375|       |
 1376|   202k|    ctx->index++;
 1377|   202k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   202k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1378|   202k|}
ua_types_encoding_json.c:DateTime_decodeJson:
 1482|  17.1k|DECODE_JSON(DateTime) {
 1483|  17.1k|    UA_DateTime *dst = (UA_DateTime*)p;
 1484|  17.1k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|  17.1k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|  17.1k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 17.1k]
  |  |  ------------------
  |  | 1024|  17.1k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|  17.1k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 17.1k]
  |  |  ------------------
  ------------------
 1485|  17.1k|    CHECK_STRING;
  ------------------
  |  | 1037|  17.1k|#define CHECK_STRING do {                                \
  |  | 1038|  17.1k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 3, False: 17.1k]
  |  |  ------------------
  |  | 1039|      3|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|  17.1k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 17.1k]
  |  |  ------------------
  ------------------
 1486|  17.1k|    GET_TOKEN;
  ------------------
  |  | 1018|  17.1k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|  17.1k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|  17.1k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 17.1k]
  |  |  ------------------
  ------------------
 1487|       |
 1488|       |    /* The last character has to be 'Z'. We can omit some length checks later on
 1489|       |     * because we know the atoi functions stop before the 'Z'. */
 1490|  17.1k|    if(tokenSize == 0 || tokenData[tokenSize-1] != 'Z')
  ------------------
  |  Branch (1490:8): [True: 0, False: 17.1k]
  |  Branch (1490:26): [True: 3, False: 17.1k]
  ------------------
 1491|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1492|       |
 1493|  17.1k|    struct musl_tm dts;
 1494|  17.1k|    memset(&dts, 0, sizeof(dts));
 1495|       |
 1496|  17.1k|    size_t pos = 0;
 1497|  17.1k|    size_t len;
 1498|       |
 1499|       |    /* Parse the year. The ISO standard asks for four digits. But we accept up
 1500|       |     * to five with an optional plus or minus in front due to the range of the
 1501|       |     * DateTime 64bit integer. But in that case we require the year and the
 1502|       |     * month to be separated by a '-'. Otherwise we cannot know where the month
 1503|       |     * starts. */
 1504|  17.1k|    if(tokenData[0] == '-' || tokenData[0] == '+')
  ------------------
  |  Branch (1504:8): [True: 3.63k, False: 13.5k]
  |  Branch (1504:31): [True: 66, False: 13.4k]
  ------------------
 1505|  3.70k|        pos++;
 1506|  17.1k|    UA_Int64 year = 0;
 1507|  17.1k|    len = parseInt64(&tokenData[pos], 5, &year);
 1508|  17.1k|    pos += len;
 1509|  17.1k|    if(len != 4 && tokenData[pos] != '-')
  ------------------
  |  Branch (1509:8): [True: 5.79k, False: 11.3k]
  |  Branch (1509:20): [True: 4, False: 5.78k]
  ------------------
 1510|      4|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1511|  17.1k|    if(tokenData[0] == '-')
  ------------------
  |  Branch (1511:8): [True: 3.63k, False: 13.5k]
  ------------------
 1512|  3.63k|        year = -year;
 1513|  17.1k|    dts.tm_year = (UA_Int16)year - 1900;
 1514|  17.1k|    if(tokenData[pos] == '-')
  ------------------
  |  Branch (1514:8): [True: 17.1k, False: 1]
  ------------------
 1515|  17.1k|        pos++;
 1516|       |
 1517|       |    /* Parse the month */
 1518|  17.1k|    UA_UInt64 month = 0;
 1519|  17.1k|    len = parseUInt64(&tokenData[pos], 2, &month);
 1520|  17.1k|    pos += len;
 1521|  17.1k|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|  17.1k|    do {                                                                                 \
  |  |  173|  17.1k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|  17.1k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 3, False: 17.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      3|            EVAL_ON_ERROR;                                                               \
  |  |  175|      3|        }                                                                                \
  |  |  176|  17.1k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 17.1k]
  |  |  ------------------
  ------------------
 1522|  17.1k|    dts.tm_mon = (UA_UInt16)month - 1;
 1523|  17.1k|    if(tokenData[pos] == '-')
  ------------------
  |  Branch (1523:8): [True: 8.91k, False: 8.25k]
  ------------------
 1524|  8.91k|        pos++;
 1525|       |
 1526|       |    /* Parse the day and check the T between date and time */
 1527|  17.1k|    UA_UInt64 day = 0;
 1528|  17.1k|    len = parseUInt64(&tokenData[pos], 2, &day);
 1529|  17.1k|    pos += len;
 1530|  17.1k|    UA_CHECK(len == 2 || tokenData[pos] != 'T',
  ------------------
  |  |  172|  17.1k|    do {                                                                                 \
  |  |  173|  17.1k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|  18.3k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 0, False: 17.1k]
  |  |  |  |  |  Branch (575:43): [True: 15.9k, False: 1.18k]
  |  |  |  |  |  Branch (575:43): [True: 1.18k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|  17.1k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 17.1k]
  |  |  ------------------
  ------------------
 1531|  17.1k|             return UA_STATUSCODE_BADDECODINGERROR);
 1532|  17.1k|    dts.tm_mday = (UA_UInt16)day;
 1533|  17.1k|    pos++;
 1534|       |
 1535|       |    /* Parse the hour */
 1536|  17.1k|    UA_UInt64 hour = 0;
 1537|  17.1k|    len = parseUInt64(&tokenData[pos], 2, &hour);
 1538|  17.1k|    pos += len;
 1539|  17.1k|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|  17.1k|    do {                                                                                 \
  |  |  173|  17.1k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|  17.1k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 7, False: 17.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      7|            EVAL_ON_ERROR;                                                               \
  |  |  175|      7|        }                                                                                \
  |  |  176|  17.1k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 17.1k]
  |  |  ------------------
  ------------------
 1540|  17.1k|    dts.tm_hour = (UA_UInt16)hour;
 1541|  17.1k|    if(tokenData[pos] == ':')
  ------------------
  |  Branch (1541:8): [True: 8.89k, False: 8.26k]
  ------------------
 1542|  8.89k|        pos++;
 1543|       |
 1544|       |    /* Parse the minute */
 1545|  17.1k|    UA_UInt64 min = 0;
 1546|  17.1k|    len = parseUInt64(&tokenData[pos], 2, &min);
 1547|  17.1k|    pos += len;
 1548|  17.1k|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|  17.1k|    do {                                                                                 \
  |  |  173|  17.1k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|  17.1k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 7, False: 17.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      7|            EVAL_ON_ERROR;                                                               \
  |  |  175|      7|        }                                                                                \
  |  |  176|  17.1k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 17.1k]
  |  |  ------------------
  ------------------
 1549|  17.1k|    dts.tm_min = (UA_UInt16)min;
 1550|  17.1k|    if(tokenData[pos] == ':')
  ------------------
  |  Branch (1550:8): [True: 8.89k, False: 8.26k]
  ------------------
 1551|  8.89k|        pos++;
 1552|       |
 1553|       |    /* Parse the second */
 1554|  17.1k|    UA_UInt64 sec = 0;
 1555|  17.1k|    len = parseUInt64(&tokenData[pos], 2, &sec);
 1556|  17.1k|    pos += len;
 1557|  17.1k|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|  17.1k|    do {                                                                                 \
  |  |  173|  17.1k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|  17.1k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 6, False: 17.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      6|            EVAL_ON_ERROR;                                                               \
  |  |  175|      6|        }                                                                                \
  |  |  176|  17.1k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 17.1k]
  |  |  ------------------
  ------------------
 1558|  17.1k|    dts.tm_sec = (UA_UInt16)sec;
 1559|       |
 1560|       |    /* Compute the seconds since the Unix epoch */
 1561|  17.1k|    long long sinceunix = musl_tm_to_secs(&dts);
 1562|       |
 1563|       |    /* Are we within the range that can be represented? */
 1564|  17.1k|    long long sinceunix_min =
 1565|  17.1k|        (long long)(UA_INT64_MIN / UA_DATETIME_SEC) -
  ------------------
  |  |  119|  17.1k|#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
  |  |  ------------------
  |  |  |  |  118|  17.1k|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  |  |  ------------------
  ------------------
                      (long long)(UA_INT64_MIN / UA_DATETIME_SEC) -
  ------------------
  |  |  285|  17.1k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  17.1k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  17.1k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1566|  17.1k|        (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC) -
  ------------------
  |  |  327|  17.1k|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|  17.1k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  17.1k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  17.1k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC) -
  ------------------
  |  |  285|  17.1k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  17.1k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  17.1k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1567|  17.1k|        (long long)1; /* manual correction due to rounding */
 1568|  17.1k|    long long sinceunix_max = (long long)
 1569|  17.1k|        ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  118|  17.1k|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  ------------------
                      ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  327|  17.1k|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|  17.1k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  17.1k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  17.1k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  285|  17.1k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  17.1k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  17.1k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1570|  17.1k|    if(sinceunix < sinceunix_min || sinceunix > sinceunix_max)
  ------------------
  |  Branch (1570:8): [True: 1, False: 17.1k]
  |  Branch (1570:37): [True: 0, False: 17.1k]
  ------------------
 1571|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1572|       |
 1573|       |    /* Convert to DateTime. Add or subtract one extra second here to prevent
 1574|       |     * underflow/overflow. This is reverted once the fractional part has been
 1575|       |     * added. */
 1576|  17.1k|    sinceunix -= (sinceunix > 0) ? 1 : -1;
  ------------------
  |  Branch (1576:18): [True: 3.53k, False: 13.6k]
  ------------------
 1577|  17.1k|    UA_DateTime dt = (UA_DateTime)
 1578|  17.1k|        (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  327|  17.1k|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|  17.1k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  17.1k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  17.1k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  285|  17.1k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  17.1k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  17.1k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  285|  17.1k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  17.1k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  17.1k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1579|       |
 1580|       |    /* Parse the fraction of the second if defined */
 1581|  17.1k|    if(tokenData[pos] == ',' || tokenData[pos] == '.') {
  ------------------
  |  Branch (1581:8): [True: 714, False: 16.4k]
  |  Branch (1581:33): [True: 3.98k, False: 12.4k]
  ------------------
 1582|  4.70k|        pos++;
 1583|  4.70k|        double frac = 0.0;
 1584|  4.70k|        double denom = 0.1;
 1585|  64.7k|        while(pos < tokenSize &&
  ------------------
  |  Branch (1585:15): [True: 64.7k, False: 0]
  ------------------
 1586|  64.7k|              tokenData[pos] >= '0' && tokenData[pos] <= '9') {
  ------------------
  |  Branch (1586:15): [True: 64.7k, False: 12]
  |  Branch (1586:40): [True: 60.0k, False: 4.68k]
  ------------------
 1587|  60.0k|            frac += denom * (tokenData[pos] - '0');
 1588|  60.0k|            denom *= 0.1;
 1589|  60.0k|            pos++;
 1590|  60.0k|        }
 1591|  4.70k|        frac += 0.00000005; /* Correct rounding when converting to integer */
 1592|  4.70k|        dt += (UA_DateTime)(frac * UA_DATETIME_SEC);
  ------------------
  |  |  285|  4.70k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  4.70k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  4.70k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1593|  4.70k|    }
 1594|       |
 1595|       |    /* Remove the underflow/overflow protection (see above) */
 1596|  17.1k|    if(sinceunix > 0) {
  ------------------
  |  Branch (1596:8): [True: 3.53k, False: 13.6k]
  ------------------
 1597|  3.53k|        if(dt > UA_INT64_MAX - UA_DATETIME_SEC)
  ------------------
  |  |  118|  3.53k|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  ------------------
                      if(dt > UA_INT64_MAX - UA_DATETIME_SEC)
  ------------------
  |  |  285|  3.53k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  3.53k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  3.53k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1597:12): [True: 0, False: 3.53k]
  ------------------
 1598|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1599|  3.53k|        dt += UA_DATETIME_SEC;
  ------------------
  |  |  285|  3.53k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  3.53k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  3.53k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1600|  13.6k|    } else {
 1601|  13.6k|        if(dt < UA_INT64_MIN + UA_DATETIME_SEC)
  ------------------
  |  |  119|  13.6k|#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
  |  |  ------------------
  |  |  |  |  118|  13.6k|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  |  |  ------------------
  ------------------
                      if(dt < UA_INT64_MIN + UA_DATETIME_SEC)
  ------------------
  |  |  285|  13.6k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  13.6k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  13.6k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1601:12): [True: 0, False: 13.6k]
  ------------------
 1602|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1603|  13.6k|        dt -= UA_DATETIME_SEC;
  ------------------
  |  |  285|  13.6k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  13.6k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  13.6k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1604|  13.6k|    }
 1605|       |
 1606|       |    /* We must be at the end of the string (ending with 'Z' as checked above) */
 1607|  17.1k|    if(pos != tokenSize - 1)
  ------------------
  |  Branch (1607:8): [True: 35, False: 17.1k]
  ------------------
 1608|     35|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     35|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1609|       |
 1610|  17.1k|    *dst = dt;
 1611|       |
 1612|  17.1k|    ctx->index++;
 1613|  17.1k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  17.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1614|  17.1k|}
ua_types_encoding_json.c:Guid_decodeJson:
 1325|  1.43k|DECODE_JSON(Guid) {
 1326|  1.43k|    UA_Guid *dst = (UA_Guid*)p;
 1327|  1.43k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|  1.43k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|  1.43k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 1.43k]
  |  |  ------------------
  |  | 1024|  1.43k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|  1.43k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 1.43k]
  |  |  ------------------
  ------------------
 1328|  1.43k|    CHECK_STRING;
  ------------------
  |  | 1037|  1.43k|#define CHECK_STRING do {                                \
  |  | 1038|  1.43k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 0, False: 1.43k]
  |  |  ------------------
  |  | 1039|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|  1.43k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 1.43k]
  |  |  ------------------
  ------------------
 1329|  1.43k|    GET_TOKEN;
  ------------------
  |  | 1018|  1.43k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|  1.43k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|  1.43k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 1.43k]
  |  |  ------------------
  ------------------
 1330|  1.43k|    UA_String str = {tokenSize, (UA_Byte*)(uintptr_t)tokenData};
 1331|  1.43k|    ctx->index++;
 1332|  1.43k|    return UA_Guid_parse(dst, str);
 1333|  1.43k|}
ua_types_encoding_json.c:ByteString_decodeJson:
 1380|  1.61k|DECODE_JSON(ByteString) {
 1381|  1.61k|    UA_ByteString *dst = (UA_ByteString*)p;
 1382|  1.61k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1022|  1.61k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1023|  1.61k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1023:8): [True: 0, False: 1.61k]
  |  |  ------------------
  |  | 1024|  1.61k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1025|  1.61k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1025:13): [Folded, False: 1.61k]
  |  |  ------------------
  ------------------
 1383|  1.61k|    CHECK_STRING;
  ------------------
  |  | 1037|  1.61k|#define CHECK_STRING do {                                \
  |  | 1038|  1.61k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 5, False: 1.60k]
  |  |  ------------------
  |  | 1039|      5|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|  1.60k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 1.60k]
  |  |  ------------------
  ------------------
 1384|  1.60k|    GET_TOKEN;
  ------------------
  |  | 1018|  1.60k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1019|  1.60k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1020|  1.60k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1020:17): [Folded, False: 1.60k]
  |  |  ------------------
  ------------------
 1385|       |
 1386|       |    /* Empty bytestring? */
 1387|  1.60k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1387:8): [True: 1.33k, False: 277]
  ------------------
 1388|  1.33k|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  1.33k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1389|  1.33k|        dst->length = 0;
 1390|  1.33k|    } else {
 1391|    277|        size_t flen = 0;
 1392|    277|        unsigned char* unB64 =
 1393|    277|            UA_unbase64((const unsigned char*)tokenData, tokenSize, &flen);
 1394|    277|        if(unB64 == 0)
  ------------------
  |  Branch (1394:12): [True: 23, False: 254]
  ------------------
 1395|     23|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     23|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1396|    254|        dst->data = (u8*)unB64;
 1397|    254|        dst->length = flen;
 1398|    254|    }
 1399|       |
 1400|  1.58k|    ctx->index++;
 1401|  1.58k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.58k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1402|  1.60k|}
ua_types_encoding_json.c:NodeId_decodeJson:
 1459|  5.76k|DECODE_JSON(NodeId) {
 1460|  5.76k|    UA_NodeId *dst = (UA_NodeId*)p;
 1461|  5.76k|    UA_String str;
 1462|  5.76k|    UA_String_init(&str);
 1463|  5.76k|    status res = String_decodeJson(ctx, &str, NULL);
 1464|  5.76k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  5.76k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1464:8): [True: 5.74k, False: 19]
  ------------------
 1465|  5.74k|        res = UA_NodeId_parseEx(dst, str, ctx->namespaceMapping);
 1466|  5.76k|    UA_String_clear(&str);
 1467|  5.76k|    return res;
 1468|  5.76k|}
ua_types_encoding_json.c:ExpandedNodeId_decodeJson:
 1470|  17.3k|DECODE_JSON(ExpandedNodeId) {
 1471|  17.3k|    UA_ExpandedNodeId *dst = (UA_ExpandedNodeId*)p;
 1472|  17.3k|    UA_String str;
 1473|  17.3k|    UA_String_init(&str);
 1474|  17.3k|    status res = String_decodeJson(ctx, &str, NULL);
 1475|  17.3k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  17.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1475:8): [True: 17.3k, False: 0]
  ------------------
 1476|  17.3k|        res = UA_ExpandedNodeId_parseEx(dst, str, ctx->namespaceMapping,
 1477|  17.3k|                                        ctx->serverUrisSize, ctx->serverUris);
 1478|  17.3k|    UA_String_clear(&str);
 1479|  17.3k|    return res;
 1480|  17.3k|}
ua_types_encoding_json.c:StatusCode_decodeJson:
 1616|  1.19k|DECODE_JSON(StatusCode) {
 1617|  1.19k|    UA_StatusCode *dst = (UA_StatusCode*)p;
 1618|  1.19k|    CHECK_OBJECT;
  ------------------
  |  | 1042|  1.19k|#define CHECK_OBJECT do {                                \
  |  | 1043|  1.19k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1043:8): [True: 0, False: 1.19k]
  |  |  ------------------
  |  | 1044|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1045|  1.19k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1045:14): [Folded, False: 1.19k]
  |  |  ------------------
  ------------------
 1619|  1.19k|    DecodeEntry entries[2] = {
 1620|  1.19k|        {UA_JSONKEY_CODE, dst, NULL, false, &UA_TYPES[UA_TYPES_UINT32]},
  ------------------
  |  |  225|  1.19k|#define UA_TYPES_UINT32 6
  ------------------
 1621|  1.19k|        {UA_JSONKEY_SYMBOL, NULL, NULL, false, NULL}
 1622|  1.19k|    };
 1623|  1.19k|    return decodeFields(ctx, entries, 2);
 1624|  1.19k|}
ua_types_encoding_json.c:QualifiedName_decodeJson:
 1414|   182k|DECODE_JSON(QualifiedName) {
 1415|   182k|    UA_QualifiedName *dst = (UA_QualifiedName*)p;
 1416|   182k|    UA_String str;
 1417|   182k|    UA_String_init(&str);
 1418|   182k|    status res = String_decodeJson(ctx, &str, NULL);
 1419|   182k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|   182k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1419:8): [True: 182k, False: 27]
  ------------------
 1420|   182k|        res = UA_QualifiedName_parseEx(dst, str, ctx->namespaceMapping);
 1421|   182k|    UA_String_clear(&str);
 1422|   182k|    return res;
 1423|   182k|}
ua_types_encoding_json.c:LocalizedText_decodeJson:
 1404|  1.90M|DECODE_JSON(LocalizedText) {
 1405|  1.90M|    UA_LocalizedText *dst = (UA_LocalizedText*)p;
 1406|  1.90M|    CHECK_OBJECT;
  ------------------
  |  | 1042|  1.90M|#define CHECK_OBJECT do {                                \
  |  | 1043|  1.90M|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1043:8): [True: 0, False: 1.90M]
  |  |  ------------------
  |  | 1044|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1045|  1.90M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1045:14): [Folded, False: 1.90M]
  |  |  ------------------
  ------------------
 1407|  1.90M|    DecodeEntry entries[2] = {
 1408|  1.90M|        {UA_JSONKEY_LOCALE, &dst->locale, NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  395|  1.90M|#define UA_TYPES_STRING 11
  ------------------
 1409|  1.90M|        {UA_JSONKEY_TEXT, &dst->text, NULL, false, &UA_TYPES[UA_TYPES_STRING]}
  ------------------
  |  |  395|  1.90M|#define UA_TYPES_STRING 11
  ------------------
 1410|  1.90M|    };
 1411|  1.90M|    return decodeFields(ctx, entries, 2);
 1412|  1.90M|}
ua_types_encoding_json.c:ExtensionObject_decodeJson:
 2017|    781|DECODE_JSON(ExtensionObject) {
 2018|    781|    UA_ExtensionObject *dst = (UA_ExtensionObject*)p;
 2019|    781|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1047|    781|#define CHECK_NULL_SKIP do {                         \
  |  | 1048|    781|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1048:8): [True: 0, False: 781]
  |  |  ------------------
  |  | 1049|      0|        ctx->index++;                                \
  |  | 1050|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1051|    781|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1051:14): [Folded, False: 781]
  |  |  ------------------
  ------------------
 2020|    781|    CHECK_OBJECT;
  ------------------
  |  | 1042|    781|#define CHECK_OBJECT do {                                \
  |  | 1043|    781|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1043:8): [True: 5, False: 776]
  |  |  ------------------
  |  | 1044|      5|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1045|    776|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1045:14): [Folded, False: 776]
  |  |  ------------------
  ------------------
 2021|       |
 2022|       |    /* Empty object -> Null ExtensionObject */
 2023|    776|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (2023:8): [True: 622, False: 154]
  ------------------
 2024|    622|        ctx->index++; /* Skip the empty ExtensionObject */
 2025|    622|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    622|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2026|    622|    }
 2027|       |
 2028|       |    /* Store the index where the ExtensionObject begins */
 2029|    154|    size_t beginIndex = ctx->index;
 2030|       |
 2031|       |    /* Search for non-JSON encoding */
 2032|    154|    UA_UInt64 encoding = 0;
 2033|    154|    size_t encIndex = 0;
 2034|    154|    status ret = lookAheadForKey(ctx, UA_JSONKEY_ENCODING, &encIndex);
 2035|    154|    if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|    154|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2035:8): [True: 113, False: 41]
  ------------------
 2036|    113|        const char *extObjEncoding = &ctx->json5[ctx->tokens[encIndex].start];
 2037|    113|        size_t len = parseUInt64(extObjEncoding,
 2038|    113|                                 getTokenLength(&ctx->tokens[encIndex]),
 2039|    113|                                 &encoding);
 2040|    113|        if(len == 0 || encoding > 2)
  ------------------
  |  Branch (2040:12): [True: 0, False: 113]
  |  Branch (2040:24): [True: 111, False: 2]
  ------------------
 2041|    111|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    111|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2042|    113|    }
 2043|       |
 2044|       |    /* Get the type NodeId index */
 2045|     43|    size_t typeIdIndex = 0;
 2046|     43|    ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 2047|     43|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|     43|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2047:8): [True: 8, False: 35]
  ------------------
 2048|      8|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      8|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2049|       |
 2050|       |    /* Decode the type NodeId */
 2051|     35|    UA_NodeId typeId;
 2052|     35|    UA_NodeId_init(&typeId);
 2053|     35|    ctx->index = (UA_UInt16)typeIdIndex;
 2054|     35|    ret = NodeId_decodeJson(ctx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|     35|#define UA_TYPES_NODEID 16
  ------------------
 2055|     35|    ctx->index = beginIndex;
 2056|     35|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|     35|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2056:8): [True: 35, False: 0]
  ------------------
 2057|     35|        UA_NodeId_clear(&typeId); /* We don't have the global cleanup */
 2058|     35|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     35|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2059|     35|    }
 2060|       |
 2061|       |    /* Lookup the type */
 2062|      0|    type = UA_findDataTypeWithCustom(&typeId, ctx->customTypes);
 2063|       |
 2064|       |    /* Unknown body type */
 2065|      0|    if(!type) {
  ------------------
  |  Branch (2065:8): [True: 0, False: 0]
  ------------------
 2066|       |        /* FIXME: We need UA_EXTENSIONOBJECT_ENCODED_JSON when we parse an
 2067|       |         * unknown type in JSON. But it is not defined in the standard. */
 2068|      0|        dst->encoding = (encoding != 2) ?
  ------------------
  |  Branch (2068:25): [True: 0, False: 0]
  ------------------
 2069|      0|            UA_EXTENSIONOBJECT_ENCODED_BYTESTRING :
 2070|      0|            UA_EXTENSIONOBJECT_ENCODED_XML;
 2071|      0|        dst->content.encoded.typeId = typeId;
 2072|       |
 2073|       |        /* Get the body field index */
 2074|      0|        size_t bodyIndex = 0;
 2075|      0|        ret = lookAheadForKey(ctx, UA_JSONKEY_BODY, &bodyIndex);
 2076|      0|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2076:12): [True: 0, False: 0]
  ------------------
 2077|       |            /* Only JSON structures can be encoded in-situ */
 2078|      0|            if(encoding != 0)
  ------------------
  |  Branch (2078:16): [True: 0, False: 0]
  ------------------
 2079|      0|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2080|       |
 2081|       |            /* Extract the entire ExtensionObject object as the body */
 2082|      0|            size_t parentIndex = ctx->index;
 2083|      0|            ret = tokenToByteString(ctx, &dst->content.encoded.body);
 2084|      0|            if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2084:16): [True: 0, False: 0]
  ------------------
 2085|      0|                return ret;
 2086|       |
 2087|       |            /* Remove the UaEncoding and UaTypeId field from the encoding.
 2088|       |             * Remove the later field first. */
 2089|      0|            if(encIndex != 0 && encIndex > typeIdIndex)
  ------------------
  |  Branch (2089:16): [True: 0, False: 0]
  |  Branch (2089:33): [True: 0, False: 0]
  ------------------
 2090|      0|                removeFieldFromEncoding(ctx, &dst->content.encoded.body,
 2091|      0|                                        parentIndex, encIndex);
 2092|       |
 2093|      0|            removeFieldFromEncoding(ctx, &dst->content.encoded.body,
 2094|      0|                                    parentIndex, typeIdIndex);
 2095|       |
 2096|      0|            if(encIndex != 0 && encIndex < typeIdIndex)
  ------------------
  |  Branch (2096:16): [True: 0, False: 0]
  |  Branch (2096:33): [True: 0, False: 0]
  ------------------
 2097|      0|                removeFieldFromEncoding(ctx, &dst->content.encoded.body,
 2098|      0|                                        parentIndex, encIndex);
 2099|       |
 2100|      0|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2101|      0|        }
 2102|       |
 2103|      0|        ctx->index = bodyIndex;
 2104|      0|        if(encoding != 0) {
  ------------------
  |  Branch (2104:12): [True: 0, False: 0]
  ------------------
 2105|       |            /* Decode the body as a ByteString */
 2106|      0|            ret = ByteString_decodeJson(ctx, &dst->content.encoded.body, NULL);
 2107|      0|        } else {
 2108|       |            /* Use the JSON encoding directly */
 2109|      0|            ret = tokenToByteString(ctx, &dst->content.encoded.body);
 2110|      0|        }
 2111|      0|        ctx->index = beginIndex;
 2112|      0|        skipObject(ctx);
 2113|      0|        return ret;
 2114|      0|    }
 2115|       |
 2116|       |    /* No need to keep the TypeId */
 2117|      0|    UA_NodeId_clear(&typeId);
 2118|       |
 2119|       |    /* Disallow directly nested ExtensionObjects */
 2120|      0|    if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (2120:8): [True: 0, False: 0]
  ------------------
 2121|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2122|       |
 2123|       |    /* Allocate memory for the decoded data */
 2124|      0|    dst->content.decoded.data = UA_new(type);
 2125|      0|    if(!dst->content.decoded.data)
  ------------------
  |  Branch (2125:8): [True: 0, False: 0]
  ------------------
 2126|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2127|      0|    dst->content.decoded.type = type;
 2128|      0|    dst->encoding = UA_EXTENSIONOBJECT_DECODED;
 2129|       |
 2130|       |    /* Get the body field index */
 2131|      0|    decodeJsonSignature decodeType = decodeJsonJumpTable[type->typeKind];
 2132|      0|    size_t bodyIndex = ctx->index;
 2133|      0|    ret = lookAheadForKey(ctx, UA_JSONKEY_BODY, &bodyIndex); /* Can fail */
 2134|      0|    if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2134:8): [True: 0, False: 0]
  ------------------
 2135|      0|        ctx->index = bodyIndex;
 2136|      0|        ret = decodeType(ctx, dst->content.decoded.data, type);
 2137|      0|        ctx->index = beginIndex;
 2138|      0|        skipObject(ctx);
 2139|      0|        return ret;
 2140|      0|    }
 2141|       |
 2142|      0|    return decodeType(ctx, dst->content.decoded.data, type);
 2143|      0|}
ua_types_encoding_json.c:DataValue_decodeJson:
 1910|   130k|DECODE_JSON(DataValue) {
 1911|   130k|    UA_DataValue *dst = (UA_DataValue*)p;
 1912|   130k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1047|   130k|#define CHECK_NULL_SKIP do {                         \
  |  | 1048|   130k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1048:8): [True: 0, False: 130k]
  |  |  ------------------
  |  | 1049|      0|        ctx->index++;                                \
  |  | 1050|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1051|   130k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1051:14): [Folded, False: 130k]
  |  |  ------------------
  ------------------
 1913|   130k|    CHECK_OBJECT;
  ------------------
  |  | 1042|   130k|#define CHECK_OBJECT do {                                \
  |  | 1043|   130k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1043:8): [True: 6, False: 130k]
  |  |  ------------------
  |  | 1044|      6|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1045|   130k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1045:14): [Folded, False: 130k]
  |  |  ------------------
  ------------------
 1914|       |
 1915|       |    /* Decode the Variant in-situ */
 1916|   130k|    size_t beginIndex = ctx->index;
 1917|   130k|    status ret = decodeJSONVariant(ctx, &dst->value);
 1918|   130k|    ctx->index = beginIndex;
 1919|   130k|    dst->hasValue = (dst->value.type != NULL);
 1920|   130k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|   130k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1920:8): [True: 189, False: 130k]
  ------------------
 1921|    189|        return ret;
 1922|       |
 1923|       |    /* Decode the other members (skip the Variant members) */
 1924|   130k|    DecodeEntry entries[8] = {
 1925|   130k|        {UA_JSONKEY_TYPE, NULL, NULL, false, NULL},
 1926|   130k|        {UA_JSONKEY_VALUE, NULL, NULL, false, NULL},
 1927|   130k|        {UA_JSONKEY_DIMENSIONS, NULL, NULL, false, NULL},
 1928|   130k|        {UA_JSONKEY_STATUS, &dst->status, NULL, false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  633|   130k|#define UA_TYPES_STATUSCODE 18
  ------------------
 1929|   130k|        {UA_JSONKEY_SOURCETIMESTAMP, &dst->sourceTimestamp, NULL,
 1930|   130k|         false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  429|   130k|#define UA_TYPES_DATETIME 12
  ------------------
 1931|   130k|        {UA_JSONKEY_SOURCEPICOSECONDS, &dst->sourcePicoseconds, NULL,
 1932|   130k|         false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  157|   130k|#define UA_TYPES_UINT16 4
  ------------------
 1933|   130k|        {UA_JSONKEY_SERVERTIMESTAMP, &dst->serverTimestamp, NULL,
 1934|   130k|         false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  429|   130k|#define UA_TYPES_DATETIME 12
  ------------------
 1935|   130k|        {UA_JSONKEY_SERVERPICOSECONDS, &dst->serverPicoseconds, NULL,
 1936|   130k|         false, &UA_TYPES[UA_TYPES_UINT16]}
  ------------------
  |  |  157|   130k|#define UA_TYPES_UINT16 4
  ------------------
 1937|   130k|    };
 1938|       |
 1939|   130k|    ret = decodeFields(ctx, entries, 8);
 1940|   130k|    dst->hasStatus = entries[3].found;
 1941|   130k|    dst->hasSourceTimestamp = entries[4].found;
 1942|   130k|    dst->hasSourcePicoseconds = entries[5].found;
 1943|   130k|    dst->hasServerTimestamp = entries[6].found;
 1944|   130k|    dst->hasServerPicoseconds = entries[7].found;
 1945|   130k|    return ret;
 1946|   130k|}
ua_types_encoding_json.c:decodeJSONVariant:
 1780|   232k|decodeJSONVariant(ParseCtx *ctx, UA_Variant *dst) {
 1781|       |    /* Empty variant == null */
 1782|   232k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (1782:8): [True: 139k, False: 92.4k]
  ------------------
 1783|   139k|        ctx->index++;
 1784|   139k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   139k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1785|   139k|    }
 1786|       |
 1787|       |    /* Search the value field */
 1788|  92.4k|    size_t valueIndex = 0;
 1789|  92.4k|    lookAheadForKey(ctx, UA_JSONKEY_VALUE, &valueIndex);
 1790|       |
 1791|       |    /* Search for the dimensions field */
 1792|  92.4k|    size_t dimIndex = 0;
 1793|  92.4k|    lookAheadForKey(ctx, UA_JSONKEY_DIMENSIONS, &dimIndex);
 1794|       |
 1795|       |    /* Parse the type kind */
 1796|  92.4k|    size_t typeIndex = 0;
 1797|  92.4k|    lookAheadForKey(ctx, UA_JSONKEY_TYPE, &typeIndex);
 1798|  92.4k|    if(typeIndex == 0 || ctx->tokens[typeIndex].type != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1798:8): [True: 65, False: 92.4k]
  |  Branch (1798:26): [True: 1, False: 92.4k]
  ------------------
 1799|     66|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     66|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1800|  92.4k|    UA_UInt64 typeKind = 0;
 1801|  92.4k|    size_t len = parseUInt64(&ctx->json5[ctx->tokens[typeIndex].start],
 1802|  92.4k|                             getTokenLength(&ctx->tokens[typeIndex]), &typeKind);
 1803|  92.4k|    if(len == 0)
  ------------------
  |  Branch (1803:8): [True: 4, False: 92.4k]
  ------------------
 1804|      4|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1805|       |
 1806|       |    /* Shift to get the datatype index. The type must be a builtin data type.
 1807|       |     * All not-builtin types are wrapped in an ExtensionObject. */
 1808|  92.4k|    typeKind--;
 1809|  92.4k|    if(typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (1809:8): [True: 15, False: 92.3k]
  ------------------
 1810|     15|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     15|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1811|  92.3k|    const UA_DataType *type = &UA_TYPES[typeKind];
 1812|       |
 1813|       |    /* Value is an array? */
 1814|  92.3k|    UA_Boolean isArray =
 1815|  92.3k|        (valueIndex > 0 && ctx->tokens[valueIndex].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  Branch (1815:10): [True: 53.1k, False: 39.2k]
  |  Branch (1815:28): [True: 11.4k, False: 41.7k]
  ------------------
 1816|       |
 1817|       |    /* Adjust the depth and set the value index as current */
 1818|  92.3k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|  92.3k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (1818:8): [True: 0, False: 92.3k]
  ------------------
 1819|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1820|  92.3k|    size_t beginIndex = ctx->index;
 1821|  92.3k|    ctx->index = valueIndex;
 1822|  92.3k|    ctx->depth++;
 1823|       |
 1824|       |    /* Decode the value */
 1825|  92.3k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  92.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1826|  92.3k|    if(!isArray) {
  ------------------
  |  Branch (1826:8): [True: 80.9k, False: 11.4k]
  ------------------
 1827|       |        /* Scalar with dimensions -> error */
 1828|  80.9k|        if(dimIndex > 0) {
  ------------------
  |  Branch (1828:12): [True: 19, False: 80.9k]
  ------------------
 1829|     19|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     19|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1830|     19|            goto out;
 1831|     19|        }
 1832|       |
 1833|       |        /* A variant cannot contain a variant. But it can contain an array of
 1834|       |         * variants */
 1835|  80.9k|        if(type->typeKind == UA_DATATYPEKIND_VARIANT) {
  ------------------
  |  Branch (1835:12): [True: 0, False: 80.9k]
  ------------------
 1836|      0|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1837|      0|            goto out;
 1838|      0|        }
 1839|       |
 1840|       |        /* Decode a value wrapped in an ExtensionObject */
 1841|  80.9k|        if(valueIndex > 0 && type->typeKind == UA_DATATYPEKIND_EXTENSIONOBJECT) {
  ------------------
  |  Branch (1841:12): [True: 41.7k, False: 39.2k]
  |  Branch (1841:30): [True: 504, False: 41.2k]
  ------------------
 1842|    504|            res = Variant_decodeJsonUnwrapExtensionObject(ctx, dst, NULL);
 1843|    504|            goto out;
 1844|    504|        }
 1845|       |
 1846|       |        /* Allocate memory for the value */
 1847|  80.4k|        dst->data = UA_new(type);
 1848|  80.4k|        if(!dst->data) {
  ------------------
  |  Branch (1848:12): [True: 0, False: 80.4k]
  ------------------
 1849|      0|            res = UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1850|      0|            goto out;
 1851|      0|        }
 1852|  80.4k|        dst->type = type;
 1853|       |
 1854|       |        /* Decode the value */
 1855|  80.4k|        if(valueIndex > 0 && ctx->tokens[valueIndex].type != CJ5_TOKEN_NULL)
  ------------------
  |  Branch (1855:12): [True: 41.2k, False: 39.2k]
  |  Branch (1855:30): [True: 38.2k, False: 2.93k]
  ------------------
 1856|  38.2k|            res = decodeJsonJumpTable[type->typeKind](ctx, dst->data, type);
 1857|  80.4k|    } else {
 1858|       |        /* Decode an array. Try to unwrap ExtensionObjects in the array. The
 1859|       |         * members must all have the same type. */
 1860|  11.4k|        const UA_DataType *unwrapType = NULL;
 1861|  11.4k|        if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  735|  11.4k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (1861:12): [True: 508, False: 10.9k]
  ------------------
 1862|    508|            unwrapType = getArrayUnwrapType(ctx);
 1863|  11.4k|        if(unwrapType) {
  ------------------
  |  Branch (1863:12): [True: 0, False: 11.4k]
  ------------------
 1864|      0|            dst->type = unwrapType;
 1865|      0|            res = Array_decodeJsonUnwrapExtensionObject(ctx, &dst->data, unwrapType);
 1866|  11.4k|        } else {
 1867|  11.4k|            dst->type = type;
 1868|  11.4k|            res = Array_decodeJson(ctx, &dst->data, type);
 1869|  11.4k|        }
 1870|       |
 1871|       |        /* Decode array dimensions */
 1872|  11.4k|        if(dimIndex > 0) {
  ------------------
  |  Branch (1872:12): [True: 2.75k, False: 8.68k]
  ------------------
 1873|  2.75k|            ctx->index = dimIndex;
 1874|  2.75k|            res |= Array_decodeJson(ctx, (void**)&dst->arrayDimensions,
 1875|  2.75k|                                    &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  225|  2.75k|#define UA_TYPES_UINT32 6
  ------------------
 1876|       |
 1877|       |            /* Help clang-analyzer */
 1878|  2.75k|            UA_assert(dst->arrayDimensionsSize == 0 || dst->arrayDimensions);
  ------------------
  |  |  395|  2.75k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1878:13): [True: 22, False: 2.73k]
  |  Branch (1878:13): [True: 2.73k, False: 0]
  ------------------
 1879|       |
 1880|       |            /* Validate the dimensions */
 1881|  2.75k|            size_t total = 1;
 1882|  1.95M|            for(size_t i = 0; i < dst->arrayDimensionsSize; i++)
  ------------------
  |  Branch (1882:31): [True: 1.95M, False: 2.75k]
  ------------------
 1883|  1.95M|                total *= dst->arrayDimensions[i];
 1884|  2.75k|            if(total != dst->arrayLength)
  ------------------
  |  Branch (1884:16): [True: 100, False: 2.65k]
  ------------------
 1885|    100|                res |= UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    100|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1886|       |
 1887|       |            /* Only keep >= 2 dimensions */
 1888|  2.75k|            if(dst->arrayDimensionsSize == 1) {
  ------------------
  |  Branch (1888:16): [True: 41, False: 2.71k]
  ------------------
 1889|     41|                UA_free(dst->arrayDimensions);
  ------------------
  |  |   19|     41|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1890|     41|                dst->arrayDimensions = NULL;
 1891|     41|                dst->arrayDimensionsSize = 0;
 1892|     41|            }
 1893|  2.75k|        }
 1894|  11.4k|    }
 1895|       |
 1896|  92.3k| out:
 1897|  92.3k|    ctx->index = beginIndex;
 1898|  92.3k|    skipObject(ctx);
 1899|  92.3k|    ctx->depth--;
 1900|  92.3k|    return res;
 1901|  92.3k|}
ua_types_encoding_json.c:Variant_decodeJsonUnwrapExtensionObject:
 2147|    504|                                        const UA_DataType *type) {
 2148|    504|    (void) type;
 2149|    504|    UA_Variant *dst = (UA_Variant*)p;
 2150|       |
 2151|       |    /* ExtensionObject with null body */
 2152|    504|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2152:8): [True: 388, False: 116]
  ------------------
 2153|    388|        dst->data = UA_ExtensionObject_new();
 2154|    388|        dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|    388|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2155|    388|        ctx->index++;
 2156|    388|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    388|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2157|    388|    }
 2158|       |
 2159|       |    /* Decode the ExtensionObject */
 2160|    116|    UA_ExtensionObject eo;
 2161|    116|    UA_ExtensionObject_init(&eo);
 2162|    116|    UA_StatusCode ret = ExtensionObject_decodeJson(ctx, &eo, NULL);
 2163|    116|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|    116|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2163:8): [True: 116, False: 0]
  ------------------
 2164|    116|        UA_ExtensionObject_clear(&eo); /* We don't have the global cleanup */
 2165|    116|        return ret;
 2166|    116|    }
 2167|       |
 2168|       |    /* The content is still encoded, cannot unwrap */
 2169|      0|    if(eo.encoding != UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2169:8): [True: 0, False: 0]
  ------------------
 2170|      0|        goto use_eo;
 2171|       |
 2172|       |    /* The content is a builtin type that could have been directly encoded in
 2173|       |     * the Variant, there was no need to wrap in an ExtensionObject. But this
 2174|       |     * means for us, that somebody made an extra effort to explicitly get an
 2175|       |     * ExtensionObject. So we keep it. As an added advantage we will generate
 2176|       |     * the same JSON again when encoding again. */
 2177|      0|    if(eo.content.decoded.type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (2177:8): [True: 0, False: 0]
  ------------------
 2178|      0|        goto use_eo;
 2179|       |
 2180|       |    /* Unwrap the ExtensionObject */
 2181|      0|    dst->data = eo.content.decoded.data;
 2182|      0|    dst->type = eo.content.decoded.type;
 2183|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2184|       |
 2185|      0| use_eo:
 2186|       |    /* Don't unwrap */
 2187|      0|    dst->data = UA_new(&UA_TYPES[UA_TYPES_EXTENSIONOBJECT]);
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2188|      0|    if(!dst->data) {
  ------------------
  |  Branch (2188:8): [True: 0, False: 0]
  ------------------
 2189|      0|        UA_ExtensionObject_clear(&eo);
 2190|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2191|      0|    }
 2192|      0|    dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2193|      0|    *(UA_ExtensionObject*)dst->data = eo;
 2194|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2195|      0|}
ua_types_encoding_json.c:getArrayUnwrapType:
 1661|    508|getArrayUnwrapType(ParseCtx *ctx) {
 1662|    508|    UA_assert(ctx->tokens[ctx->index].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  |  395|    508|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1662:5): [True: 508, False: 0]
  ------------------
 1663|       |
 1664|       |    /* Return early for empty arrays */
 1665|    508|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 1666|    508|    if(length == 0)
  ------------------
  |  Branch (1666:8): [True: 195, False: 313]
  ------------------
 1667|    195|        return NULL;
 1668|       |
 1669|       |    /* Save the original index and go to the first array member */
 1670|    313|    size_t oldIndex = ctx->index;
 1671|    313|    ctx->index++;
 1672|       |
 1673|       |    /* Lookup the type for the first array member */
 1674|    313|    UA_NodeId typeId;
 1675|    313|    UA_NodeId_init(&typeId);
 1676|    313|    const UA_DataType *typeOfBody = getExtensionObjectType(ctx);
 1677|    313|    if(!typeOfBody) {
  ------------------
  |  Branch (1677:8): [True: 313, False: 0]
  ------------------
 1678|    313|        ctx->index = oldIndex; /* Restore the index */
 1679|    313|        return NULL;
 1680|    313|    }
 1681|       |
 1682|       |    /* Get the TypeId encoding for faster comparison below.
 1683|       |     * Cannot fail as getExtensionObjectType already looked this up. */
 1684|      0|    size_t typeIdIndex = 0;
 1685|      0|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 1686|      0|    (void)ret;
 1687|      0|    UA_assert(ret == UA_STATUSCODE_GOOD);
  ------------------
  |  |  395|      0|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1687:5): [True: 0, False: 0]
  ------------------
 1688|      0|    const char* typeIdData = &ctx->json5[ctx->tokens[typeIdIndex].start];
 1689|      0|    size_t typeIdSize = getTokenLength(&ctx->tokens[typeIdIndex]);
 1690|       |
 1691|       |    /* Loop over all members and check whether they can be unwrapped. Don't skip
 1692|       |     * the first member. We still haven't checked the encoding type. */
 1693|      0|    for(size_t i = 0; i < length; i++) {
  ------------------
  |  Branch (1693:23): [True: 0, False: 0]
  ------------------
 1694|       |        /* Array element must be an object */
 1695|      0|        if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {
  ------------------
  |  Branch (1695:12): [True: 0, False: 0]
  ------------------
 1696|      0|            ctx->index = oldIndex; /* Restore the index */
 1697|      0|            return NULL;
 1698|      0|        }
 1699|       |
 1700|       |        /* Check for non-JSON encoding */
 1701|      0|        size_t encIndex = 0;
 1702|      0|        ret = lookAheadForKey(ctx, UA_JSONKEY_ENCODING, &encIndex);
 1703|      0|        if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1703:12): [True: 0, False: 0]
  ------------------
 1704|      0|            ctx->index = oldIndex; /* Restore the index */
 1705|      0|            return NULL;
 1706|      0|        }
 1707|       |
 1708|       |        /* Get the type NodeId index */
 1709|      0|        size_t memberTypeIdIndex = 0;
 1710|      0|        ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &memberTypeIdIndex);
 1711|      0|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1711:12): [True: 0, False: 0]
  ------------------
 1712|      0|            ctx->index = oldIndex; /* Restore the index */
 1713|      0|            return NULL;
 1714|      0|        }
 1715|       |
 1716|       |        /* Is it the same type? Compare raw NodeId string */
 1717|      0|        const char* memberTypeIdData = &ctx->json5[ctx->tokens[memberTypeIdIndex].start];
 1718|      0|        size_t memberTypeIdSize = getTokenLength(&ctx->tokens[memberTypeIdIndex]);
 1719|      0|        if(typeIdSize != memberTypeIdSize ||
  ------------------
  |  Branch (1719:12): [True: 0, False: 0]
  ------------------
 1720|      0|           memcmp(typeIdData, memberTypeIdData, typeIdSize) != 0) {
  ------------------
  |  Branch (1720:12): [True: 0, False: 0]
  ------------------
 1721|      0|            ctx->index = oldIndex; /* Restore the index */
 1722|      0|            return NULL;
 1723|      0|        }
 1724|       |
 1725|       |        /* Skip to the next array member */
 1726|      0|        skipObject(ctx);
 1727|      0|    }
 1728|       |
 1729|      0|    ctx->index = oldIndex; /* Restore the index */
 1730|      0|    return typeOfBody;
 1731|      0|}
ua_types_encoding_json.c:getExtensionObjectType:
 1629|    313|getExtensionObjectType(ParseCtx *ctx) {
 1630|    313|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (1630:8): [True: 226, False: 87]
  ------------------
 1631|    226|        return NULL;
 1632|       |
 1633|       |    /* Get the type NodeId index */
 1634|     87|    size_t typeIdIndex = 0;
 1635|     87|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 1636|     87|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|     87|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1636:8): [True: 52, False: 35]
  ------------------
 1637|     52|        return NULL;
 1638|       |
 1639|     35|    size_t oldIndex = ctx->index;
 1640|     35|    ctx->index = (UA_UInt16)typeIdIndex;
 1641|       |
 1642|       |    /* Decode the type NodeId */
 1643|     35|    UA_NodeId typeId;
 1644|     35|    UA_NodeId_init(&typeId);
 1645|     35|    ret = NodeId_decodeJson(ctx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|     35|#define UA_TYPES_NODEID 16
  ------------------
 1646|     35|    ctx->index = oldIndex;
 1647|     35|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|     35|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1647:8): [True: 35, False: 0]
  ------------------
 1648|     35|        UA_NodeId_clear(&typeId); /* We don't have the global cleanup */
 1649|     35|        return NULL;
 1650|     35|    }
 1651|       |
 1652|       |    /* Lookup an return */
 1653|      0|    const UA_DataType *type = UA_findDataTypeWithCustom(&typeId, ctx->customTypes);
 1654|      0|    UA_NodeId_clear(&typeId);
 1655|      0|    return type;
 1656|     35|}
ua_types_encoding_json.c:Array_decodeJson:
 2329|  14.1k|Array_decodeJson(ParseCtx *ctx, void **dst, const UA_DataType *type) {
 2330|       |    /* Save the length of the array */
 2331|  14.1k|    size_t *size_ptr = (size_t*) dst - 1;
 2332|       |
 2333|  14.1k|    if(currentTokenType(ctx) != CJ5_TOKEN_ARRAY)
  ------------------
  |  Branch (2333:8): [True: 4, False: 14.1k]
  ------------------
 2334|      4|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2335|       |
 2336|  14.1k|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 2337|       |
 2338|  14.1k|    ctx->index++; /* Go to first array member or to the first element after
 2339|       |                   * the array (if empty) */
 2340|       |
 2341|       |    /* Return early for empty arrays */
 2342|  14.1k|    if(length == 0) {
  ------------------
  |  Branch (2342:8): [True: 5.61k, False: 8.57k]
  ------------------
 2343|  5.61k|        *size_ptr = length;
 2344|  5.61k|        *dst = UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  5.61k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2345|  5.61k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  5.61k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2346|  5.61k|    }
 2347|       |
 2348|       |    /* Allocate memory */
 2349|  8.57k|    *dst = UA_calloc(length, type->memSize);
  ------------------
  |  |   20|  8.57k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2350|  8.57k|    if(*dst == NULL)
  ------------------
  |  Branch (2350:8): [True: 0, False: 8.57k]
  ------------------
 2351|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2352|       |
 2353|       |    /* Decode array members */
 2354|  8.57k|    decodeJsonSignature decodeFunc = decodeJsonJumpTable[type->typeKind];
 2355|  8.57k|    uintptr_t ptr = (uintptr_t)*dst;
 2356|  13.4M|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (2356:23): [True: 13.4M, False: 8.17k]
  ------------------
 2357|  13.4M|        if(ctx->tokens[ctx->index].type == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2357:12): [True: 10.8k, False: 13.4M]
  ------------------
 2358|  10.8k|            ptr += type->memSize;
 2359|  10.8k|            ctx->index++;
 2360|  10.8k|            continue;
 2361|  10.8k|        }
 2362|       |
 2363|  13.4M|        status ret = decodeFunc(ctx, (void*)ptr, type);
 2364|  13.4M|        ptr += type->memSize;
 2365|  13.4M|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  13.4M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2365:12): [True: 401, False: 13.4M]
  ------------------
 2366|    401|            UA_Array_delete(*dst, i+1, type);
 2367|    401|            *dst = NULL;
 2368|    401|            return ret;
 2369|    401|        }
 2370|  13.4M|    }
 2371|       |
 2372|  8.17k|    *size_ptr = length; /* All good, set the size */
 2373|  8.17k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  8.17k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2374|  8.57k|}
ua_types_encoding_json.c:Variant_decodeJson:
 1903|   101k|DECODE_JSON(Variant) {
 1904|   101k|    UA_Variant *dst = (UA_Variant*)p;
 1905|   101k|    CHECK_NULL_SKIP; /* Treat null as an empty variant */
  ------------------
  |  | 1047|   101k|#define CHECK_NULL_SKIP do {                         \
  |  | 1048|   101k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1048:8): [True: 0, False: 101k]
  |  |  ------------------
  |  | 1049|      0|        ctx->index++;                                \
  |  | 1050|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1051|   101k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1051:14): [Folded, False: 101k]
  |  |  ------------------
  ------------------
 1906|   101k|    CHECK_OBJECT;
  ------------------
  |  | 1042|   101k|#define CHECK_OBJECT do {                                \
  |  | 1043|   101k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1043:8): [True: 14, False: 101k]
  |  |  ------------------
  |  | 1044|     14|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     14|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1045|   101k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1045:14): [Folded, False: 101k]
  |  |  ------------------
  ------------------
 1907|   101k|    return decodeJSONVariant(ctx, dst);
 1908|   101k|}

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

UA_Guid_parse:
   86|  1.43k|UA_Guid_parse(UA_Guid *guid, const UA_String str) {
   87|  1.43k|    UA_StatusCode res = parse_guid(guid, str.data, str.data + str.length);
   88|  1.43k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  1.43k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (88:8): [True: 34, False: 1.40k]
  ------------------
   89|     34|        *guid = UA_GUID_NULL;
   90|  1.43k|    return res;
   91|  1.43k|}
UA_NodeId_parseEx:
  323|  5.74k|                  const UA_NamespaceMapping *nsMapping) {
  324|  5.74k|    UA_StatusCode res =
  325|  5.74k|        parse_nodeid(id, str.data, str.data+str.length, UA_ESCAPING_NONE, nsMapping);
  326|  5.74k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  5.74k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (326:8): [True: 105, False: 5.63k]
  ------------------
  327|    105|        UA_NodeId_clear(id);
  328|  5.74k|    return res;
  329|  5.74k|}
UA_ExpandedNodeId_parseEx:
  671|  17.3k|                          size_t serverUrisSize, const UA_String *serverUris) {
  672|  17.3k|    UA_StatusCode res =
  673|  17.3k|        parse_expandednodeid(id, str.data, str.data + str.length, UA_ESCAPING_NONE,
  674|  17.3k|                             nsMapping, serverUrisSize, serverUris);
  675|  17.3k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  17.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (675:8): [True: 128, False: 17.1k]
  ------------------
  676|    128|        UA_ExpandedNodeId_clear(id);
  677|  17.3k|    return res;
  678|  17.3k|}
UA_QualifiedName_parseEx:
  831|   182k|                         const UA_NamespaceMapping *nsMapping) {
  832|   182k|    const u8 *pos = str.data;
  833|   182k|    const u8 *end = str.data + str.length;
  834|   182k|    UA_StatusCode res = parse_qn(qn, pos, end, UA_ESCAPING_NONE, nsMapping, 0);
  835|   182k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|   182k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (835:8): [True: 0, False: 182k]
  ------------------
  836|      0|        UA_QualifiedName_clear(qn);
  837|   182k|    return res;
  838|   182k|}
ua_types_lex.c:parse_guid:
   50|  1.44k|parse_guid(UA_Guid *guid, const UA_Byte *s, const UA_Byte *e) {
   51|  1.44k|    size_t len = (size_t)(e - s);
   52|  1.44k|    if(len != 36 || s[8] != '-' || s[13] != '-' || s[23] != '-')
  ------------------
  |  Branch (52:8): [True: 3, False: 1.44k]
  |  Branch (52:21): [True: 11, False: 1.43k]
  |  Branch (52:36): [True: 3, False: 1.42k]
  |  Branch (52:52): [True: 10, False: 1.41k]
  ------------------
   53|     27|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     27|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   54|       |
   55|  1.41k|    UA_UInt32 tmp;
   56|  1.41k|    if(UA_readNumberWithBase(s, 8, &tmp, 16) != 8)
  ------------------
  |  Branch (56:8): [True: 8, False: 1.41k]
  ------------------
   57|      8|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      8|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   58|  1.41k|    guid->data1 = tmp;
   59|       |
   60|  1.41k|    if(UA_readNumberWithBase(&s[9], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (60:8): [True: 1, False: 1.41k]
  ------------------
   61|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   62|  1.41k|    guid->data2 = (UA_UInt16)tmp;
   63|       |
   64|  1.41k|    if(UA_readNumberWithBase(&s[14], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (64:8): [True: 2, False: 1.40k]
  ------------------
   65|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   66|  1.40k|    guid->data3 = (UA_UInt16)tmp;
   67|       |
   68|  1.40k|    if(UA_readNumberWithBase(&s[19], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (68:8): [True: 1, False: 1.40k]
  ------------------
   69|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   70|  1.40k|    guid->data4[0] = (UA_Byte)tmp;
   71|       |
   72|  1.40k|    if(UA_readNumberWithBase(&s[21], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (72:8): [True: 1, False: 1.40k]
  ------------------
   73|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   74|  1.40k|    guid->data4[1] = (UA_Byte)tmp;
   75|       |
   76|  9.82k|    for(size_t pos = 2, spos = 24; pos < 8; pos++, spos += 2) {
  ------------------
  |  Branch (76:36): [True: 8.42k, False: 1.40k]
  ------------------
   77|  8.42k|        if(UA_readNumberWithBase(&s[spos], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (77:12): [True: 4, False: 8.42k]
  ------------------
   78|      4|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   79|  8.42k|        guid->data4[pos] = (UA_Byte)tmp;
   80|  8.42k|    }
   81|       |
   82|  1.40k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.40k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   83|  1.40k|}
ua_types_lex.c:parse_nodeid:
  148|  5.74k|             UA_Escaping idEsc, const UA_NamespaceMapping *nsMapping) {
  149|  5.74k|    *id = UA_NODEID_NULL; /* Reset the NodeId */
  150|  5.74k|    LexContext context;
  151|  5.74k|    memset(&context, 0, sizeof(LexContext));
  152|  5.74k|    UA_Byte *begin = (UA_Byte*)(uintptr_t)pos;
  153|  5.74k|    const u8 *ns = NULL, *nsu = NULL, *body = NULL;
  154|       |
  155|       |    
  156|  5.74k|{
  157|  5.74k|	u8 yych;
  158|  5.74k|	yych = YYPEEK();
  ------------------
  |  |   33|  5.74k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  5.74k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  5.74k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 5.74k, False: 4]
  |  |  ------------------
  ------------------
  159|  5.74k|	switch (yych) {
  160|    839|		case 'b':
  ------------------
  |  Branch (160:3): [True: 839, False: 4.90k]
  ------------------
  161|    851|		case 'g':
  ------------------
  |  Branch (161:3): [True: 12, False: 5.73k]
  ------------------
  162|  1.44k|		case 'i':
  ------------------
  |  Branch (162:3): [True: 589, False: 5.15k]
  ------------------
  163|  4.58k|		case 's':
  ------------------
  |  Branch (163:3): [True: 3.14k, False: 2.60k]
  ------------------
  164|  4.58k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  4.58k|#define YYSTAGN(t) t = NULL
  ------------------
  165|  4.58k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  4.58k|#define YYSTAGN(t) t = NULL
  ------------------
  166|  4.58k|			goto yy3;
  167|  1.15k|		case 'n': goto yy4;
  ------------------
  |  Branch (167:3): [True: 1.15k, False: 4.59k]
  ------------------
  168|      6|		default: goto yy1;
  ------------------
  |  Branch (168:3): [True: 6, False: 5.73k]
  ------------------
  169|  5.74k|	}
  170|      6|yy1:
  171|      6|	YYSKIP();
  ------------------
  |  |   35|      6|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      6|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  172|     75|yy2:
  173|     75|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   43|     75|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  174|  4.58k|yy3:
  175|  4.58k|	YYSKIP();
  ------------------
  |  |   35|  4.58k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  4.58k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  176|  4.58k|	yych = YYPEEK();
  ------------------
  |  |   33|  4.58k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.58k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.58k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 4.58k, False: 2]
  |  |  ------------------
  ------------------
  177|  4.58k|	switch (yych) {
  178|  4.57k|		case '=': goto yy5;
  ------------------
  |  Branch (178:3): [True: 4.57k, False: 8]
  ------------------
  179|      8|		default: goto yy2;
  ------------------
  |  Branch (179:3): [True: 8, False: 4.57k]
  ------------------
  180|  4.58k|	}
  181|  1.15k|yy4:
  182|  1.15k|	YYSKIP();
  ------------------
  |  |   35|  1.15k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.15k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  183|  1.15k|	YYBACKUP();
  ------------------
  |  |   36|  1.15k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  1.15k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.15k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  184|  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: 2]
  |  |  ------------------
  ------------------
  185|  1.15k|	switch (yych) {
  186|  1.14k|		case 's': goto yy6;
  ------------------
  |  Branch (186:3): [True: 1.14k, False: 6]
  ------------------
  187|      6|		default: goto yy2;
  ------------------
  |  Branch (187:3): [True: 6, False: 1.14k]
  ------------------
  188|  1.15k|	}
  189|  5.66k|yy5:
  190|  5.66k|	YYSKIP();
  ------------------
  |  |   35|  5.66k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  5.66k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  191|  5.66k|	nsu = context.yyt2;
  192|  5.66k|	ns = context.yyt1;
  193|  5.66k|	YYSTAGP(body);
  ------------------
  |  |   38|  5.66k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  5.66k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  194|  5.66k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  5.66k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  195|  5.66k|	{ goto match; }
  196|  1.14k|yy6:
  197|  1.14k|	YYSKIP();
  ------------------
  |  |   35|  1.14k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.14k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  198|  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.14k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.14k, False: 2]
  |  |  ------------------
  ------------------
  199|  1.14k|	switch (yych) {
  200|  1.05k|		case '=': goto yy8;
  ------------------
  |  Branch (200:3): [True: 1.05k, False: 97]
  ------------------
  201|     95|		case 'u': goto yy9;
  ------------------
  |  Branch (201:3): [True: 95, False: 1.05k]
  ------------------
  202|      2|		default: goto yy7;
  ------------------
  |  Branch (202:3): [True: 2, False: 1.14k]
  ------------------
  203|  1.14k|	}
  204|     55|yy7:
  205|     55|	YYRESTORE();
  ------------------
  |  |   37|     55|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|     55|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|     55|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  206|     55|	goto yy2;
  207|  1.05k|yy8:
  208|  1.05k|	YYSKIP();
  ------------------
  |  |   35|  1.05k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.05k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  209|  1.05k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.05k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.05k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.04k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.04k, False: 2]
  |  |  ------------------
  ------------------
  210|  1.05k|	switch (yych) {
  211|    453|		case '0':
  ------------------
  |  Branch (211:3): [True: 453, False: 598]
  ------------------
  212|    497|		case '1':
  ------------------
  |  Branch (212:3): [True: 44, False: 1.00k]
  ------------------
  213|    529|		case '2':
  ------------------
  |  Branch (213:3): [True: 32, False: 1.01k]
  ------------------
  214|    544|		case '3':
  ------------------
  |  Branch (214:3): [True: 15, False: 1.03k]
  ------------------
  215|    953|		case '4':
  ------------------
  |  Branch (215:3): [True: 409, False: 642]
  ------------------
  216|    970|		case '5':
  ------------------
  |  Branch (216:3): [True: 17, False: 1.03k]
  ------------------
  217|    987|		case '6':
  ------------------
  |  Branch (217:3): [True: 17, False: 1.03k]
  ------------------
  218|    992|		case '7':
  ------------------
  |  Branch (218:3): [True: 5, False: 1.04k]
  ------------------
  219|  1.03k|		case '8':
  ------------------
  |  Branch (219:3): [True: 41, False: 1.01k]
  ------------------
  220|  1.04k|		case '9':
  ------------------
  |  Branch (220:3): [True: 14, False: 1.03k]
  ------------------
  221|  1.04k|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|  1.04k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.04k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  222|  1.04k|			goto yy10;
  223|      4|		default: goto yy7;
  ------------------
  |  Branch (223:3): [True: 4, False: 1.04k]
  ------------------
  224|  1.05k|	}
  225|     95|yy9:
  226|     95|	YYSKIP();
  ------------------
  |  |   35|     95|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|     95|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  227|     95|	yych = YYPEEK();
  ------------------
  |  |   33|     95|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|     95|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|     93|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 93, False: 2]
  |  |  ------------------
  ------------------
  228|     95|	switch (yych) {
  229|     89|		case '=': goto yy11;
  ------------------
  |  Branch (229:3): [True: 89, False: 6]
  ------------------
  230|      6|		default: goto yy7;
  ------------------
  |  Branch (230:3): [True: 6, False: 89]
  ------------------
  231|     95|	}
  232|  22.2k|yy10:
  233|  22.2k|	YYSKIP();
  ------------------
  |  |   35|  22.2k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  22.2k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  234|  22.2k|	yych = YYPEEK();
  ------------------
  |  |   33|  22.2k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  22.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  22.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 22.2k, False: 31]
  |  |  ------------------
  ------------------
  235|  22.2k|	switch (yych) {
  236|  10.9k|		case '0':
  ------------------
  |  Branch (236:3): [True: 10.9k, False: 11.3k]
  ------------------
  237|  12.0k|		case '1':
  ------------------
  |  Branch (237:3): [True: 1.11k, False: 21.1k]
  ------------------
  238|  12.7k|		case '2':
  ------------------
  |  Branch (238:3): [True: 722, False: 21.5k]
  ------------------
  239|  13.8k|		case '3':
  ------------------
  |  Branch (239:3): [True: 1.01k, False: 21.2k]
  ------------------
  240|  16.1k|		case '4':
  ------------------
  |  Branch (240:3): [True: 2.35k, False: 19.9k]
  ------------------
  241|  16.9k|		case '5':
  ------------------
  |  Branch (241:3): [True: 831, False: 21.4k]
  ------------------
  242|  17.6k|		case '6':
  ------------------
  |  Branch (242:3): [True: 683, False: 21.5k]
  ------------------
  243|  18.7k|		case '7':
  ------------------
  |  Branch (243:3): [True: 1.12k, False: 21.1k]
  ------------------
  244|  19.6k|		case '8':
  ------------------
  |  Branch (244:3): [True: 870, False: 21.3k]
  ------------------
  245|  21.2k|		case '9': goto yy10;
  ------------------
  |  Branch (245:3): [True: 1.54k, False: 20.7k]
  ------------------
  246|  1.01k|		case ';':
  ------------------
  |  Branch (246:3): [True: 1.01k, False: 21.2k]
  ------------------
  247|  1.01k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  1.01k|#define YYSTAGN(t) t = NULL
  ------------------
  248|  1.01k|			goto yy12;
  249|     32|		default: goto yy7;
  ------------------
  |  Branch (249:3): [True: 32, False: 22.2k]
  ------------------
  250|  22.2k|	}
  251|     89|yy11:
  252|     89|	YYSKIP();
  ------------------
  |  |   35|     89|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|     89|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  253|     89|	yych = YYPEEK();
  ------------------
  |  |   33|     89|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|     89|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|     89|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 89, False: 0]
  |  |  ------------------
  ------------------
  254|     89|	switch (yych) {
  255|      0|		case 0x00: goto yy7;
  ------------------
  |  Branch (255:3): [True: 0, False: 89]
  ------------------
  256|      9|		case ';':
  ------------------
  |  Branch (256:3): [True: 9, False: 80]
  ------------------
  257|      9|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|      9|#define YYSTAGN(t) t = NULL
  ------------------
  258|      9|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|      9|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|      9|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  259|      9|			goto yy12;
  260|     80|		default:
  ------------------
  |  Branch (260:3): [True: 80, False: 9]
  ------------------
  261|     80|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|     80|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|     80|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  262|     80|			goto yy13;
  263|     89|	}
  264|  1.10k|yy12:
  265|  1.10k|	YYSKIP();
  ------------------
  |  |   35|  1.10k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.10k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  266|  1.10k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.10k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.10k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.09k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.09k, False: 2]
  |  |  ------------------
  ------------------
  267|  1.10k|	switch (yych) {
  268|     31|		case 'b':
  ------------------
  |  Branch (268:3): [True: 31, False: 1.07k]
  ------------------
  269|     31|		case 'g':
  ------------------
  |  Branch (269:3): [True: 0, False: 1.10k]
  ------------------
  270|  1.00k|		case 'i':
  ------------------
  |  Branch (270:3): [True: 969, False: 132]
  ------------------
  271|  1.09k|		case 's': goto yy14;
  ------------------
  |  Branch (271:3): [True: 99, False: 1.00k]
  ------------------
  272|      2|		default: goto yy7;
  ------------------
  |  Branch (272:3): [True: 2, False: 1.09k]
  ------------------
  273|  1.10k|	}
  274|    509|yy13:
  275|    509|	YYSKIP();
  ------------------
  |  |   35|    509|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    509|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  276|    509|	yych = YYPEEK();
  ------------------
  |  |   33|    509|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    509|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    506|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 506, False: 3]
  |  |  ------------------
  ------------------
  277|    509|	switch (yych) {
  278|      3|		case 0x00: goto yy7;
  ------------------
  |  Branch (278:3): [True: 3, False: 506]
  ------------------
  279|     77|		case ';':
  ------------------
  |  Branch (279:3): [True: 77, False: 432]
  ------------------
  280|     77|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|     77|#define YYSTAGN(t) t = NULL
  ------------------
  281|     77|			goto yy12;
  282|    429|		default: goto yy13;
  ------------------
  |  Branch (282:3): [True: 429, False: 80]
  ------------------
  283|    509|	}
  284|  1.09k|yy14:
  285|  1.09k|	YYSKIP();
  ------------------
  |  |   35|  1.09k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.09k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  286|  1.09k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.09k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.09k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.09k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.09k, False: 0]
  |  |  ------------------
  ------------------
  287|  1.09k|	switch (yych) {
  288|  1.09k|		case '=': goto yy5;
  ------------------
  |  Branch (288:3): [True: 1.09k, False: 6]
  ------------------
  289|      6|		default: goto yy7;
  ------------------
  |  Branch (289:3): [True: 6, False: 1.09k]
  ------------------
  290|  1.09k|	}
  291|  1.09k|}
  292|       |
  293|       |
  294|  5.66k| match:
  295|  5.66k|    if(nsu) {
  ------------------
  |  Branch (295:8): [True: 83, False: 5.58k]
  ------------------
  296|       |        /* NamespaceUri */
  297|     83|        UA_String nsUri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  298|     83|        UA_StatusCode res = escapedUri2Index(nsUri, &id->namespaceIndex, nsMapping);
  299|     83|        if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|     83|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (299:12): [True: 83, False: 0]
  ------------------
  300|       |            /* Return the entire NodeId string s=... */
  301|     83|            UA_String total = {(size_t)((const UA_Byte*)end - begin), begin};
  302|     83|            id->identifierType = UA_NODEIDTYPE_STRING;
  303|     83|            return UA_String_copy(&total, &id->identifier.string);
  304|     83|        }
  305|  5.58k|    } else if(ns) {
  ------------------
  |  Branch (305:15): [True: 1.01k, False: 4.57k]
  ------------------
  306|       |        /* NamespaceIndex */
  307|  1.01k|        UA_UInt32 tmp;
  308|  1.01k|        size_t len = (size_t)(body - 1 - ns);
  309|  1.01k|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (309:12): [True: 0, False: 1.01k]
  ------------------
  310|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  311|  1.01k|        id->namespaceIndex = (UA_UInt16)tmp;
  312|  1.01k|        if(nsMapping)
  ------------------
  |  Branch (312:12): [True: 0, False: 1.01k]
  ------------------
  313|      0|            id->namespaceIndex =
  314|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->namespaceIndex);
  315|  1.01k|    }
  316|       |
  317|       |    /* From the current position until the end */
  318|  5.58k|    return parse_nodeid_body(id, body, end, idEsc);
  319|  5.66k|}
ua_types_lex.c:escapedUri2Index:
   95|    888|                 const UA_NamespaceMapping *nsMapping) {
   96|    888|    if(!nsMapping)
  ------------------
  |  Branch (96:8): [True: 888, False: 0]
  ------------------
   97|    888|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    888|#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)
  ------------------
  |  |   16|      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|  22.6k|parse_nodeid_body(UA_NodeId *id, const u8 *body, const u8 *end, UA_Escaping esc) {
  110|  22.6k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  22.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  111|  22.6k|    UA_String str = {(size_t)(end - (body+2)), (UA_Byte*)(uintptr_t)body + 2};
  112|  22.6k|    switch(*body) {
  113|  2.37k|    case 'i':
  ------------------
  |  Branch (113:5): [True: 2.37k, False: 20.2k]
  ------------------
  114|  2.37k|        id->identifierType = UA_NODEIDTYPE_NUMERIC;
  115|  2.37k|        if(UA_readNumber(str.data, str.length, &id->identifier.numeric) != str.length)
  ------------------
  |  Branch (115:12): [True: 35, False: 2.34k]
  ------------------
  116|     35|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     35|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  117|  2.37k|        break;
  118|  11.4k|    case 's':
  ------------------
  |  Branch (118:5): [True: 11.4k, False: 11.1k]
  ------------------
  119|  11.4k|        id->identifierType = UA_NODEIDTYPE_STRING;
  120|  11.4k|        res |= UA_String_copy(&str, &id->identifier.string);
  121|  11.4k|        res |= UA_String_unescape(&id->identifier.string, false, esc);
  122|  11.4k|        break;
  123|     10|    case 'g':
  ------------------
  |  Branch (123:5): [True: 10, False: 22.6k]
  ------------------
  124|     10|        id->identifierType = UA_NODEIDTYPE_GUID;
  125|     10|        res = parse_guid(&id->identifier.guid, str.data, end);
  126|     10|        break;
  127|  8.79k|    case 'b':
  ------------------
  |  Branch (127:5): [True: 8.79k, False: 13.8k]
  ------------------
  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|  8.79k|        id->identifierType = UA_NODEIDTYPE_BYTESTRING;
  132|  8.79k|        id->identifier.byteString.data =
  133|  8.79k|            UA_unbase64(str.data, str.length, &id->identifier.byteString.length);
  134|  8.79k|        if(!id->identifier.byteString.data) {
  ------------------
  |  Branch (134:12): [True: 16, False: 8.77k]
  ------------------
  135|     16|            UA_assert(id->identifier.byteString.length == 0);
  ------------------
  |  |  395|     16|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (135:13): [True: 16, False: 0]
  ------------------
  136|     16|            res = UA_STATUSCODE_BADDECODINGERROR; /* Returned on error by UA_unbase64 */
  ------------------
  |  |   43|     16|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  137|     16|        }
  138|  8.79k|        break;
  139|  8.79k|    default:
  ------------------
  |  Branch (139:5): [True: 0, False: 22.6k]
  ------------------
  140|      0|        res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  141|      0|        break;
  142|  22.6k|    }
  143|  22.6k|    return res;
  144|  22.6k|}
ua_types_lex.c:parse_expandednodeid:
  339|  17.3k|                     size_t serverUrisSize, const UA_String *serverUris) {
  340|  17.3k|    *id = UA_EXPANDEDNODEID_NULL; /* Reset the NodeId */
  341|  17.3k|    LexContext context;
  342|  17.3k|    memset(&context, 0, sizeof(LexContext));
  343|  17.3k|    const u8 *svr = NULL, *sve = NULL, *svu = NULL,
  344|  17.3k|        *nsu = NULL, *ns = NULL, *body = NULL, *begin = pos;
  345|       |
  346|       |    
  347|  17.3k|{
  348|  17.3k|	u8 yych;
  349|  17.3k|	yych = YYPEEK();
  ------------------
  |  |   33|  17.3k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  17.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  17.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 17.3k, False: 1]
  |  |  ------------------
  ------------------
  350|  17.3k|	switch (yych) {
  351|  7.85k|		case 'b':
  ------------------
  |  Branch (351:3): [True: 7.85k, False: 9.45k]
  ------------------
  352|  7.85k|		case 'g':
  ------------------
  |  Branch (352:3): [True: 3, False: 17.3k]
  ------------------
  353|  8.55k|		case 'i':
  ------------------
  |  Branch (353:3): [True: 696, False: 16.6k]
  ------------------
  354|  8.55k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  8.55k|#define YYSTAGN(t) t = NULL
  ------------------
  355|  8.55k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  8.55k|#define YYSTAGN(t) t = NULL
  ------------------
  356|  8.55k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  8.55k|#define YYSTAGN(t) t = NULL
  ------------------
  357|  8.55k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  8.55k|#define YYSTAGN(t) t = NULL
  ------------------
  358|  8.55k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  8.55k|#define YYSTAGN(t) t = NULL
  ------------------
  359|  8.55k|			goto yy18;
  360|    849|		case 'n':
  ------------------
  |  Branch (360:3): [True: 849, False: 16.4k]
  ------------------
  361|    849|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    849|#define YYSTAGN(t) t = NULL
  ------------------
  362|    849|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|    849|#define YYSTAGN(t) t = NULL
  ------------------
  363|    849|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    849|#define YYSTAGN(t) t = NULL
  ------------------
  364|    849|			goto yy19;
  365|  7.90k|		case 's':
  ------------------
  |  Branch (365:3): [True: 7.90k, False: 9.40k]
  ------------------
  366|  7.90k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  7.90k|#define YYSTAGN(t) t = NULL
  ------------------
  367|  7.90k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  7.90k|#define YYSTAGN(t) t = NULL
  ------------------
  368|  7.90k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  7.90k|#define YYSTAGN(t) t = NULL
  ------------------
  369|  7.90k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  7.90k|#define YYSTAGN(t) t = NULL
  ------------------
  370|  7.90k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  7.90k|#define YYSTAGN(t) t = NULL
  ------------------
  371|  7.90k|			goto yy20;
  372|      2|		default: goto yy16;
  ------------------
  |  Branch (372:3): [True: 2, False: 17.3k]
  ------------------
  373|  17.3k|	}
  374|      2|yy16:
  375|      2|	YYSKIP();
  ------------------
  |  |   35|      2|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      2|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  376|     97|yy17:
  377|     97|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   43|     97|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  378|  8.55k|yy18:
  379|  8.55k|	YYSKIP();
  ------------------
  |  |   35|  8.55k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  8.55k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  380|  8.55k|	yych = YYPEEK();
  ------------------
  |  |   33|  8.55k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  8.55k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  8.55k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 8.55k, False: 0]
  |  |  ------------------
  ------------------
  381|  8.55k|	switch (yych) {
  382|  8.54k|		case '=': goto yy21;
  ------------------
  |  Branch (382:3): [True: 8.54k, False: 5]
  ------------------
  383|      5|		default: goto yy17;
  ------------------
  |  Branch (383:3): [True: 5, False: 8.54k]
  ------------------
  384|  8.55k|	}
  385|    849|yy19:
  386|    849|	YYSKIP();
  ------------------
  |  |   35|    849|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    849|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  387|    849|	YYBACKUP();
  ------------------
  |  |   36|    849|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|    849|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    849|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  388|    849|	yych = YYPEEK();
  ------------------
  |  |   33|    849|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    849|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    849|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 849, False: 0]
  |  |  ------------------
  ------------------
  389|    849|	switch (yych) {
  390|    849|		case 's': goto yy22;
  ------------------
  |  Branch (390:3): [True: 849, False: 0]
  ------------------
  391|      0|		default: goto yy17;
  ------------------
  |  Branch (391:3): [True: 0, False: 849]
  ------------------
  392|    849|	}
  393|  7.90k|yy20:
  394|  7.90k|	YYSKIP();
  ------------------
  |  |   35|  7.90k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  7.90k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  395|  7.90k|	YYBACKUP();
  ------------------
  |  |   36|  7.90k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  7.90k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  7.90k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  396|  7.90k|	yych = YYPEEK();
  ------------------
  |  |   33|  7.90k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  7.90k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  7.90k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 7.90k, False: 0]
  |  |  ------------------
  ------------------
  397|  7.90k|	switch (yych) {
  398|  6.82k|		case '=': goto yy21;
  ------------------
  |  Branch (398:3): [True: 6.82k, False: 1.07k]
  ------------------
  399|  1.07k|		case 'v': goto yy24;
  ------------------
  |  Branch (399:3): [True: 1.07k, False: 6.82k]
  ------------------
  400|      0|		default: goto yy17;
  ------------------
  |  Branch (400:3): [True: 0, False: 7.90k]
  ------------------
  401|  7.90k|	}
  402|  17.2k|yy21:
  403|  17.2k|	YYSKIP();
  ------------------
  |  |   35|  17.2k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  17.2k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  404|  17.2k|	svr = context.yyt5;
  405|  17.2k|	svu = context.yyt1;
  406|  17.2k|	sve = context.yyt2;
  407|  17.2k|	ns = context.yyt3;
  408|  17.2k|	nsu = context.yyt4;
  409|  17.2k|	YYSTAGP(body);
  ------------------
  |  |   38|  17.2k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  17.2k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  410|  17.2k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  17.2k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  411|  17.2k|	{ goto match; }
  412|    849|yy22:
  413|    849|	YYSKIP();
  ------------------
  |  |   35|    849|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    849|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  414|    849|	yych = YYPEEK();
  ------------------
  |  |   33|    849|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    849|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    849|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 849, False: 0]
  |  |  ------------------
  ------------------
  415|    849|	switch (yych) {
  416|    241|		case '=': goto yy25;
  ------------------
  |  Branch (416:3): [True: 241, False: 608]
  ------------------
  417|    608|		case 'u': goto yy26;
  ------------------
  |  Branch (417:3): [True: 608, False: 241]
  ------------------
  418|      0|		default: goto yy23;
  ------------------
  |  Branch (418:3): [True: 0, False: 849]
  ------------------
  419|    849|	}
  420|     90|yy23:
  421|     90|	YYRESTORE();
  ------------------
  |  |   37|     90|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|     90|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|     90|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  422|     90|	goto yy17;
  423|  1.07k|yy24:
  424|  1.07k|	YYSKIP();
  ------------------
  |  |   35|  1.07k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.07k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  425|  1.07k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.07k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.07k|#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: 0]
  |  |  ------------------
  ------------------
  426|  1.07k|	switch (yych) {
  427|    940|		case 'r': goto yy27;
  ------------------
  |  Branch (427:3): [True: 940, False: 139]
  ------------------
  428|    139|		case 'u': goto yy28;
  ------------------
  |  Branch (428:3): [True: 139, False: 940]
  ------------------
  429|      0|		default: goto yy23;
  ------------------
  |  Branch (429:3): [True: 0, False: 1.07k]
  ------------------
  430|  1.07k|	}
  431|    241|yy25:
  432|    241|	YYSKIP();
  ------------------
  |  |   35|    241|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    241|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  433|    241|	yych = YYPEEK();
  ------------------
  |  |   33|    241|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    241|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    241|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 241, False: 0]
  |  |  ------------------
  ------------------
  434|    241|	switch (yych) {
  435|     37|		case '0':
  ------------------
  |  Branch (435:3): [True: 37, False: 204]
  ------------------
  436|     72|		case '1':
  ------------------
  |  Branch (436:3): [True: 35, False: 206]
  ------------------
  437|    106|		case '2':
  ------------------
  |  Branch (437:3): [True: 34, False: 207]
  ------------------
  438|    168|		case '3':
  ------------------
  |  Branch (438:3): [True: 62, False: 179]
  ------------------
  439|    178|		case '4':
  ------------------
  |  Branch (439:3): [True: 10, False: 231]
  ------------------
  440|    192|		case '5':
  ------------------
  |  Branch (440:3): [True: 14, False: 227]
  ------------------
  441|    198|		case '6':
  ------------------
  |  Branch (441:3): [True: 6, False: 235]
  ------------------
  442|    236|		case '7':
  ------------------
  |  Branch (442:3): [True: 38, False: 203]
  ------------------
  443|    241|		case '8':
  ------------------
  |  Branch (443:3): [True: 5, False: 236]
  ------------------
  444|    241|		case '9':
  ------------------
  |  Branch (444:3): [True: 0, False: 241]
  ------------------
  445|    241|			YYSTAGP(context.yyt3);
  ------------------
  |  |   38|    241|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    241|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  446|    241|			goto yy29;
  447|      0|		default: goto yy23;
  ------------------
  |  Branch (447:3): [True: 0, False: 241]
  ------------------
  448|    241|	}
  449|    608|yy26:
  450|    608|	YYSKIP();
  ------------------
  |  |   35|    608|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    608|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  451|    608|	yych = YYPEEK();
  ------------------
  |  |   33|    608|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    608|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    608|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 608, False: 0]
  |  |  ------------------
  ------------------
  452|    608|	switch (yych) {
  453|    608|		case '=': goto yy30;
  ------------------
  |  Branch (453:3): [True: 608, False: 0]
  ------------------
  454|      0|		default: goto yy23;
  ------------------
  |  Branch (454:3): [True: 0, False: 608]
  ------------------
  455|    608|	}
  456|    940|yy27:
  457|    940|	YYSKIP();
  ------------------
  |  |   35|    940|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    940|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  458|    940|	yych = YYPEEK();
  ------------------
  |  |   33|    940|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    940|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    940|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 940, False: 0]
  |  |  ------------------
  ------------------
  459|    940|	switch (yych) {
  460|    939|		case '=': goto yy31;
  ------------------
  |  Branch (460:3): [True: 939, False: 1]
  ------------------
  461|      1|		default: goto yy23;
  ------------------
  |  Branch (461:3): [True: 1, False: 939]
  ------------------
  462|    940|	}
  463|    139|yy28:
  464|    139|	YYSKIP();
  ------------------
  |  |   35|    139|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    139|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  465|    139|	yych = YYPEEK();
  ------------------
  |  |   33|    139|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    139|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    139|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 139, False: 0]
  |  |  ------------------
  ------------------
  466|    139|	switch (yych) {
  467|    135|		case '=': goto yy32;
  ------------------
  |  Branch (467:3): [True: 135, False: 4]
  ------------------
  468|      4|		default: goto yy23;
  ------------------
  |  Branch (468:3): [True: 4, False: 135]
  ------------------
  469|    139|	}
  470|   734k|yy29:
  471|   734k|	YYSKIP();
  ------------------
  |  |   35|   734k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|   734k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  472|   734k|	yych = YYPEEK();
  ------------------
  |  |   33|   734k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   734k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   734k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 734k, False: 29]
  |  |  ------------------
  ------------------
  473|   734k|	switch (yych) {
  474|   722k|		case '0':
  ------------------
  |  Branch (474:3): [True: 722k, False: 12.4k]
  ------------------
  475|   723k|		case '1':
  ------------------
  |  Branch (475:3): [True: 1.54k, False: 732k]
  ------------------
  476|   724k|		case '2':
  ------------------
  |  Branch (476:3): [True: 553, False: 733k]
  ------------------
  477|   725k|		case '3':
  ------------------
  |  Branch (477:3): [True: 1.10k, False: 733k]
  ------------------
  478|   726k|		case '4':
  ------------------
  |  Branch (478:3): [True: 737, False: 733k]
  ------------------
  479|   726k|		case '5':
  ------------------
  |  Branch (479:3): [True: 303, False: 734k]
  ------------------
  480|   731k|		case '6':
  ------------------
  |  Branch (480:3): [True: 5.05k, False: 729k]
  ------------------
  481|   731k|		case '7':
  ------------------
  |  Branch (481:3): [True: 589, False: 733k]
  ------------------
  482|   733k|		case '8':
  ------------------
  |  Branch (482:3): [True: 1.47k, False: 733k]
  ------------------
  483|   734k|		case '9': goto yy29;
  ------------------
  |  Branch (483:3): [True: 802, False: 733k]
  ------------------
  484|    204|		case ';':
  ------------------
  |  Branch (484:3): [True: 204, False: 734k]
  ------------------
  485|    204|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|    204|#define YYSTAGN(t) t = NULL
  ------------------
  486|    204|			goto yy33;
  487|     37|		default: goto yy23;
  ------------------
  |  Branch (487:3): [True: 37, False: 734k]
  ------------------
  488|   734k|	}
  489|    608|yy30:
  490|    608|	YYSKIP();
  ------------------
  |  |   35|    608|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    608|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  491|    608|	yych = YYPEEK();
  ------------------
  |  |   33|    608|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    608|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    608|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 608, False: 0]
  |  |  ------------------
  ------------------
  492|    608|	switch (yych) {
  493|      0|		case 0x00: goto yy23;
  ------------------
  |  Branch (493:3): [True: 0, False: 608]
  ------------------
  494|      0|		case ';':
  ------------------
  |  Branch (494:3): [True: 0, False: 608]
  ------------------
  495|      0|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|      0|#define YYSTAGN(t) t = NULL
  ------------------
  496|      0|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|      0|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  497|      0|			goto yy33;
  498|    608|		default:
  ------------------
  |  Branch (498:3): [True: 608, False: 0]
  ------------------
  499|    608|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|    608|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    608|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  500|    608|			goto yy34;
  501|    608|	}
  502|    939|yy31:
  503|    939|	YYSKIP();
  ------------------
  |  |   35|    939|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    939|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  504|    939|	yych = YYPEEK();
  ------------------
  |  |   33|    939|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    939|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    939|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 939, False: 0]
  |  |  ------------------
  ------------------
  505|    939|	switch (yych) {
  506|     38|		case '0':
  ------------------
  |  Branch (506:3): [True: 38, False: 901]
  ------------------
  507|    232|		case '1':
  ------------------
  |  Branch (507:3): [True: 194, False: 745]
  ------------------
  508|    255|		case '2':
  ------------------
  |  Branch (508:3): [True: 23, False: 916]
  ------------------
  509|    424|		case '3':
  ------------------
  |  Branch (509:3): [True: 169, False: 770]
  ------------------
  510|    755|		case '4':
  ------------------
  |  Branch (510:3): [True: 331, False: 608]
  ------------------
  511|    775|		case '5':
  ------------------
  |  Branch (511:3): [True: 20, False: 919]
  ------------------
  512|    784|		case '6':
  ------------------
  |  Branch (512:3): [True: 9, False: 930]
  ------------------
  513|    889|		case '7':
  ------------------
  |  Branch (513:3): [True: 105, False: 834]
  ------------------
  514|    931|		case '8':
  ------------------
  |  Branch (514:3): [True: 42, False: 897]
  ------------------
  515|    935|		case '9':
  ------------------
  |  Branch (515:3): [True: 4, False: 935]
  ------------------
  516|    935|			YYSTAGP(context.yyt5);
  ------------------
  |  |   38|    935|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    935|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  517|    935|			goto yy35;
  518|      4|		default: goto yy23;
  ------------------
  |  Branch (518:3): [True: 4, False: 935]
  ------------------
  519|    939|	}
  520|    135|yy32:
  521|    135|	YYSKIP();
  ------------------
  |  |   35|    135|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    135|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  522|    135|	yych = YYPEEK();
  ------------------
  |  |   33|    135|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    135|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    135|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 135, False: 0]
  |  |  ------------------
  ------------------
  523|    135|	switch (yych) {
  524|      0|		case 0x00: goto yy23;
  ------------------
  |  Branch (524:3): [True: 0, False: 135]
  ------------------
  525|      1|		case ';':
  ------------------
  |  Branch (525:3): [True: 1, False: 134]
  ------------------
  526|      1|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|      1|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|      1|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  527|      1|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|      1|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|      1|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  528|      1|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|      1|#define YYSTAGN(t) t = NULL
  ------------------
  529|      1|			goto yy37;
  530|    134|		default:
  ------------------
  |  Branch (530:3): [True: 134, False: 1]
  ------------------
  531|    134|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|    134|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    134|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  532|    134|			goto yy36;
  533|    135|	}
  534|    812|yy33:
  535|    812|	YYSKIP();
  ------------------
  |  |   35|    812|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    812|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  536|    812|	yych = YYPEEK();
  ------------------
  |  |   33|    812|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    812|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    812|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 812, False: 0]
  |  |  ------------------
  ------------------
  537|    812|	switch (yych) {
  538|     73|		case 'b':
  ------------------
  |  Branch (538:3): [True: 73, False: 739]
  ------------------
  539|     73|		case 'g':
  ------------------
  |  Branch (539:3): [True: 0, False: 812]
  ------------------
  540|    199|		case 'i':
  ------------------
  |  Branch (540:3): [True: 126, False: 686]
  ------------------
  541|    811|		case 's': goto yy38;
  ------------------
  |  Branch (541:3): [True: 612, False: 200]
  ------------------
  542|      1|		default: goto yy23;
  ------------------
  |  Branch (542:3): [True: 1, False: 811]
  ------------------
  543|    812|	}
  544|  91.6k|yy34:
  545|  91.6k|	YYSKIP();
  ------------------
  |  |   35|  91.6k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  91.6k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  546|  91.6k|	yych = YYPEEK();
  ------------------
  |  |   33|  91.6k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  91.6k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  91.6k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 91.6k, False: 0]
  |  |  ------------------
  ------------------
  547|  91.6k|	switch (yych) {
  548|      0|		case 0x00: goto yy23;
  ------------------
  |  Branch (548:3): [True: 0, False: 91.6k]
  ------------------
  549|    608|		case ';':
  ------------------
  |  Branch (549:3): [True: 608, False: 91.0k]
  ------------------
  550|    608|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    608|#define YYSTAGN(t) t = NULL
  ------------------
  551|    608|			goto yy33;
  552|  91.0k|		default: goto yy34;
  ------------------
  |  Branch (552:3): [True: 91.0k, False: 608]
  ------------------
  553|  91.6k|	}
  554|  58.2k|yy35:
  555|  58.2k|	YYSKIP();
  ------------------
  |  |   35|  58.2k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  58.2k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  556|  58.2k|	yych = YYPEEK();
  ------------------
  |  |   33|  58.2k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  58.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  58.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 58.2k, False: 17]
  |  |  ------------------
  ------------------
  557|  58.2k|	switch (yych) {
  558|  54.8k|		case '0':
  ------------------
  |  Branch (558:3): [True: 54.8k, False: 3.47k]
  ------------------
  559|  55.0k|		case '1':
  ------------------
  |  Branch (559:3): [True: 257, False: 58.0k]
  ------------------
  560|  55.3k|		case '2':
  ------------------
  |  Branch (560:3): [True: 267, False: 58.0k]
  ------------------
  561|  55.5k|		case '3':
  ------------------
  |  Branch (561:3): [True: 261, False: 58.0k]
  ------------------
  562|  55.8k|		case '4':
  ------------------
  |  Branch (562:3): [True: 300, False: 57.9k]
  ------------------
  563|  56.1k|		case '5':
  ------------------
  |  Branch (563:3): [True: 262, False: 58.0k]
  ------------------
  564|  56.5k|		case '6':
  ------------------
  |  Branch (564:3): [True: 374, False: 57.9k]
  ------------------
  565|  56.7k|		case '7':
  ------------------
  |  Branch (565:3): [True: 258, False: 58.0k]
  ------------------
  566|  57.0k|		case '8':
  ------------------
  |  Branch (566:3): [True: 256, False: 58.0k]
  ------------------
  567|  57.3k|		case '9': goto yy35;
  ------------------
  |  Branch (567:3): [True: 304, False: 57.9k]
  ------------------
  568|    904|		case ';':
  ------------------
  |  Branch (568:3): [True: 904, False: 57.3k]
  ------------------
  569|    904|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    904|#define YYSTAGN(t) t = NULL
  ------------------
  570|    904|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    904|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    904|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  571|    904|			goto yy37;
  572|     31|		default: goto yy23;
  ------------------
  |  Branch (572:3): [True: 31, False: 58.2k]
  ------------------
  573|  58.2k|	}
  574|  3.47M|yy36:
  575|  3.47M|	YYSKIP();
  ------------------
  |  |   35|  3.47M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.47M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  576|  3.47M|	yych = YYPEEK();
  ------------------
  |  |   33|  3.47M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.47M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.47M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.47M, False: 4]
  |  |  ------------------
  ------------------
  577|  3.47M|	switch (yych) {
  578|      4|		case 0x00: goto yy23;
  ------------------
  |  Branch (578:3): [True: 4, False: 3.47M]
  ------------------
  579|    130|		case ';':
  ------------------
  |  Branch (579:3): [True: 130, False: 3.47M]
  ------------------
  580|    130|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    130|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    130|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  581|    130|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    130|#define YYSTAGN(t) t = NULL
  ------------------
  582|    130|			goto yy37;
  583|  3.47M|		default: goto yy36;
  ------------------
  |  Branch (583:3): [True: 3.47M, False: 134]
  ------------------
  584|  3.47M|	}
  585|  1.03k|yy37:
  586|  1.03k|	YYSKIP();
  ------------------
  |  |   35|  1.03k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.03k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  587|  1.03k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.03k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.03k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.03k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.03k, False: 0]
  |  |  ------------------
  ------------------
  588|  1.03k|	switch (yych) {
  589|      4|		case 'b':
  ------------------
  |  Branch (589:3): [True: 4, False: 1.03k]
  ------------------
  590|      4|		case 'g':
  ------------------
  |  Branch (590:3): [True: 0, False: 1.03k]
  ------------------
  591|     15|		case 'i':
  ------------------
  |  Branch (591:3): [True: 11, False: 1.02k]
  ------------------
  592|  1.02k|		case 's':
  ------------------
  |  Branch (592:3): [True: 1.01k, False: 21]
  ------------------
  593|  1.02k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  1.02k|#define YYSTAGN(t) t = NULL
  ------------------
  594|  1.02k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  1.02k|#define YYSTAGN(t) t = NULL
  ------------------
  595|  1.02k|			goto yy38;
  596|      6|		case 'n': goto yy39;
  ------------------
  |  Branch (596:3): [True: 6, False: 1.02k]
  ------------------
  597|      0|		default: goto yy23;
  ------------------
  |  Branch (597:3): [True: 0, False: 1.03k]
  ------------------
  598|  1.03k|	}
  599|  1.84k|yy38:
  600|  1.84k|	YYSKIP();
  ------------------
  |  |   35|  1.84k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.84k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  601|  1.84k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.84k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.84k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.84k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.84k, False: 0]
  |  |  ------------------
  ------------------
  602|  1.84k|	switch (yych) {
  603|  1.83k|		case '=': goto yy21;
  ------------------
  |  Branch (603:3): [True: 1.83k, False: 2]
  ------------------
  604|      2|		default: goto yy23;
  ------------------
  |  Branch (604:3): [True: 2, False: 1.83k]
  ------------------
  605|  1.84k|	}
  606|      6|yy39:
  607|      6|	YYSKIP();
  ------------------
  |  |   35|      6|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      6|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  608|      6|	yych = YYPEEK();
  ------------------
  |  |   33|      6|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      6|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      6|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 6, False: 0]
  |  |  ------------------
  ------------------
  609|      6|	switch (yych) {
  610|      0|		case 's': goto yy22;
  ------------------
  |  Branch (610:3): [True: 0, False: 6]
  ------------------
  611|      6|		default: goto yy23;
  ------------------
  |  Branch (611:3): [True: 6, False: 0]
  ------------------
  612|      6|	}
  613|      6|}
  614|       |
  615|       |
  616|  17.2k| match:
  617|  17.2k|    if(svu) {
  ------------------
  |  Branch (617:8): [True: 124, False: 17.0k]
  ------------------
  618|       |        /* ServerUri */
  619|    124|        UA_String serverUri = {(size_t)(sve - svu), (UA_Byte*)(uintptr_t)svu};
  620|    124|        size_t i = 0;
  621|    124|        for(; i < serverUrisSize; i++) {
  ------------------
  |  Branch (621:15): [True: 0, False: 124]
  ------------------
  622|      0|            if(UA_String_equal(&serverUri, &serverUris[i]))
  ------------------
  |  Branch (622:16): [True: 0, False: 0]
  ------------------
  623|      0|                break;
  624|      0|        }
  625|    124|        if(i == serverUrisSize) {
  ------------------
  |  Branch (625:12): [True: 124, False: 0]
  ------------------
  626|       |            /* The ServerUri cannot be mapped. Return the entire input as a
  627|       |             * string NodeId. */
  628|    124|            UA_String total = {(size_t)(end - begin), (UA_Byte*)(uintptr_t)begin};
  629|    124|            id->nodeId.identifierType = UA_NODEIDTYPE_STRING;
  630|    124|            return UA_String_copy(&total, &id->nodeId.identifier.string);
  631|    124|        }
  632|      0|        id->serverIndex = (UA_UInt32)i;
  633|  17.0k|    } else if(svr) {
  ------------------
  |  Branch (633:15): [True: 904, False: 16.1k]
  ------------------
  634|       |        /* ServerIndex */
  635|    904|        size_t len = (size_t)(sve - svr);
  636|    904|        if(UA_readNumber((const UA_Byte*)svr, len, &id->serverIndex) != len)
  ------------------
  |  Branch (636:12): [True: 0, False: 904]
  ------------------
  637|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  638|    904|    }
  639|       |
  640|  17.0k|    if(nsu) {
  ------------------
  |  Branch (640:8): [True: 607, False: 16.4k]
  ------------------
  641|       |        /* NamespaceUri */
  642|    607|        UA_String nsuri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  643|    607|        UA_StatusCode res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    607|#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|    607|        if(id->serverIndex == 0)
  ------------------
  |  Branch (646:12): [True: 607, False: 0]
  ------------------
  647|    607|            res = escapedUri2Index(nsuri, &id->nodeId.namespaceIndex, nsMapping);
  648|    607|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    607|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (648:12): [True: 607, False: 0]
  ------------------
  649|    607|            res = UA_String_copy(&nsuri, &id->namespaceUri); /* Keep the Uri without mapping */
  650|    607|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    607|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (650:12): [True: 0, False: 607]
  ------------------
  651|      0|            return res;
  652|  16.4k|    } else if(ns) {
  ------------------
  |  Branch (652:15): [True: 203, False: 16.2k]
  ------------------
  653|       |        /* NamespaceIndex */
  654|    203|        UA_UInt32 tmp;
  655|    203|        size_t len = (size_t)(body - 1 - ns);
  656|    203|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (656:12): [True: 0, False: 203]
  ------------------
  657|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  658|    203|        id->nodeId.namespaceIndex = (UA_UInt16)tmp;
  659|    203|        if(nsMapping)
  ------------------
  |  Branch (659:12): [True: 0, False: 203]
  ------------------
  660|      0|            id->nodeId.namespaceIndex =
  661|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->nodeId.namespaceIndex);
  662|    203|    }
  663|       |
  664|       |    /* From the current position until the end */
  665|  17.0k|    return parse_nodeid_body(&id->nodeId, body, end, idEsc);
  666|  17.0k|}
ua_types_lex.c:parse_qn:
  707|   182k|         UA_UInt16 defaultNamespaceIndex) {
  708|   182k|    size_t len;
  709|   182k|    UA_UInt32 tmp;
  710|   182k|    UA_String str;
  711|   182k|    UA_StatusCode res;
  712|       |
  713|   182k|    LexContext context;
  714|   182k|    memset(&context, 0, sizeof(LexContext));
  715|       |
  716|   182k|    const u8 *begin = pos;
  717|   182k|    UA_QualifiedName_init(qn);
  718|   182k|    qn->namespaceIndex = defaultNamespaceIndex;
  719|       |
  720|       |    
  721|   182k|{
  722|   182k|	u8 yych;
  723|   182k|	yych = YYPEEK();
  ------------------
  |  |   33|   182k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   182k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   175k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 175k, False: 6.81k]
  |  |  ------------------
  ------------------
  724|   182k|	switch (yych) {
  725|  6.81k|		case 0x00:
  ------------------
  |  Branch (725:3): [True: 6.81k, False: 175k]
  ------------------
  726|  7.06k|		case ';': goto yy41;
  ------------------
  |  Branch (726:3): [True: 249, False: 182k]
  ------------------
  727|  33.6k|		case '0':
  ------------------
  |  Branch (727:3): [True: 33.6k, False: 148k]
  ------------------
  728|  42.4k|		case '1':
  ------------------
  |  Branch (728:3): [True: 8.82k, False: 173k]
  ------------------
  729|  45.1k|		case '2':
  ------------------
  |  Branch (729:3): [True: 2.63k, False: 179k]
  ------------------
  730|  48.7k|		case '3':
  ------------------
  |  Branch (730:3): [True: 3.65k, False: 178k]
  ------------------
  731|  78.5k|		case '4':
  ------------------
  |  Branch (731:3): [True: 29.7k, False: 152k]
  ------------------
  732|  79.2k|		case '5':
  ------------------
  |  Branch (732:3): [True: 705, False: 181k]
  ------------------
  733|  89.8k|		case '6':
  ------------------
  |  Branch (733:3): [True: 10.6k, False: 171k]
  ------------------
  734|  90.8k|		case '7':
  ------------------
  |  Branch (734:3): [True: 1.00k, False: 181k]
  ------------------
  735|  97.0k|		case '8':
  ------------------
  |  Branch (735:3): [True: 6.15k, False: 176k]
  ------------------
  736|  97.3k|		case '9': goto yy44;
  ------------------
  |  Branch (736:3): [True: 354, False: 182k]
  ------------------
  737|  78.1k|		default: goto yy43;
  ------------------
  |  Branch (737:3): [True: 78.1k, False: 104k]
  ------------------
  738|   182k|	}
  739|  7.06k|yy41:
  740|  7.06k|	YYSKIP();
  ------------------
  |  |   35|  7.06k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  7.06k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  741|   181k|yy42:
  742|   181k|	{ pos = begin; goto match_name; }
  743|  78.1k|yy43:
  744|  78.1k|	YYSKIP();
  ------------------
  |  |   35|  78.1k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  78.1k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  745|  78.1k|	YYBACKUP();
  ------------------
  |  |   36|  78.1k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  78.1k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  78.1k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  746|  78.1k|	yych = YYPEEK();
  ------------------
  |  |   33|  78.1k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  78.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  67.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 67.1k, False: 11.0k]
  |  |  ------------------
  ------------------
  747|  78.1k|	if (yych <= 0x00) goto yy42;
  ------------------
  |  Branch (747:6): [True: 11.0k, False: 67.1k]
  ------------------
  748|  67.1k|	goto yy46;
  749|  97.3k|yy44:
  750|  97.3k|	YYSKIP();
  ------------------
  |  |   35|  97.3k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  97.3k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  751|  97.3k|	YYBACKUP();
  ------------------
  |  |   36|  97.3k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  97.3k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  97.3k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  752|  97.3k|	yych = YYPEEK();
  ------------------
  |  |   33|  97.3k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  97.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  83.4k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 83.4k, False: 13.8k]
  |  |  ------------------
  ------------------
  753|  97.3k|	switch (yych) {
  754|  5.19k|		case '0':
  ------------------
  |  Branch (754:3): [True: 5.19k, False: 92.1k]
  ------------------
  755|  5.47k|		case '1':
  ------------------
  |  Branch (755:3): [True: 279, False: 97.0k]
  ------------------
  756|  7.88k|		case '2':
  ------------------
  |  Branch (756:3): [True: 2.41k, False: 94.9k]
  ------------------
  757|  8.24k|		case '3':
  ------------------
  |  Branch (757:3): [True: 357, False: 97.0k]
  ------------------
  758|  40.3k|		case '4':
  ------------------
  |  Branch (758:3): [True: 32.1k, False: 65.2k]
  ------------------
  759|  46.2k|		case '5':
  ------------------
  |  Branch (759:3): [True: 5.93k, False: 91.4k]
  ------------------
  760|  46.5k|		case '6':
  ------------------
  |  Branch (760:3): [True: 212, False: 97.1k]
  ------------------
  761|  52.3k|		case '7':
  ------------------
  |  Branch (761:3): [True: 5.88k, False: 91.4k]
  ------------------
  762|  52.4k|		case '8':
  ------------------
  |  Branch (762:3): [True: 52, False: 97.3k]
  ------------------
  763|  52.6k|		case '9':
  ------------------
  |  Branch (763:3): [True: 182, False: 97.1k]
  ------------------
  764|  53.3k|		case ':': goto yy50;
  ------------------
  |  Branch (764:3): [True: 678, False: 96.6k]
  ------------------
  765|  44.0k|		default: goto yy42;
  ------------------
  |  Branch (765:3): [True: 44.0k, False: 53.3k]
  ------------------
  766|  97.3k|	}
  767|  7.23M|yy45:
  768|  7.23M|	YYSKIP();
  ------------------
  |  |   35|  7.23M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  7.23M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  769|  7.23M|	yych = YYPEEK();
  ------------------
  |  |   33|  7.23M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  7.23M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  7.17M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 7.17M, False: 66.9k]
  |  |  ------------------
  ------------------
  770|  7.30M|yy46:
  771|  7.30M|	switch (yych) {
  772|  66.9k|		case 0x00: goto yy47;
  ------------------
  |  Branch (772:3): [True: 66.9k, False: 7.23M]
  ------------------
  773|    198|		case ';': goto yy48;
  ------------------
  |  Branch (773:3): [True: 198, False: 7.30M]
  ------------------
  774|  7.23M|		default: goto yy45;
  ------------------
  |  Branch (774:3): [True: 7.23M, False: 67.1k]
  ------------------
  775|  7.30M|	}
  776|   119k|yy47:
  777|   119k|	YYRESTORE();
  ------------------
  |  |   37|   119k|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|   119k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|   119k|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  778|   119k|	goto yy42;
  779|    198|yy48:
  780|    198|	YYSKIP();
  ------------------
  |  |   35|    198|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    198|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  781|    198|	{ goto match_uri; }
  782|   281k|yy49:
  783|   281k|	YYSKIP();
  ------------------
  |  |   35|   281k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|   281k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  784|   281k|	yych = YYPEEK();
  ------------------
  |  |   33|   281k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   281k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   278k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 278k, False: 3.12k]
  |  |  ------------------
  ------------------
  785|   334k|yy50:
  786|   334k|	switch (yych) {
  787|  95.9k|		case '0':
  ------------------
  |  Branch (787:3): [True: 95.9k, False: 238k]
  ------------------
  788|   106k|		case '1':
  ------------------
  |  Branch (788:3): [True: 10.3k, False: 324k]
  ------------------
  789|   135k|		case '2':
  ------------------
  |  Branch (789:3): [True: 28.7k, False: 305k]
  ------------------
  790|   141k|		case '3':
  ------------------
  |  Branch (790:3): [True: 6.22k, False: 328k]
  ------------------
  791|   199k|		case '4':
  ------------------
  |  Branch (791:3): [True: 57.7k, False: 276k]
  ------------------
  792|   217k|		case '5':
  ------------------
  |  Branch (792:3): [True: 18.4k, False: 316k]
  ------------------
  793|   241k|		case '6':
  ------------------
  |  Branch (793:3): [True: 23.9k, False: 310k]
  ------------------
  794|   251k|		case '7':
  ------------------
  |  Branch (794:3): [True: 10.4k, False: 324k]
  ------------------
  795|   256k|		case '8':
  ------------------
  |  Branch (795:3): [True: 4.72k, False: 329k]
  ------------------
  796|   281k|		case '9': goto yy49;
  ------------------
  |  Branch (796:3): [True: 24.6k, False: 309k]
  ------------------
  797|    890|		case ':': goto yy51;
  ------------------
  |  Branch (797:3): [True: 890, False: 333k]
  ------------------
  798|  52.4k|		default: goto yy47;
  ------------------
  |  Branch (798:3): [True: 52.4k, False: 282k]
  ------------------
  799|   334k|	}
  800|    890|yy51:
  801|    890|	YYSKIP();
  ------------------
  |  |   35|    890|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    890|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  802|    890|	{ goto match_index; }
  803|   334k|}
  804|       |
  805|       |
  806|    890| match_index:
  807|    890|    len = (size_t)(pos - 1 - begin);
  808|    890|    if(UA_readNumber((const UA_Byte*)begin, len, &tmp) != len)
  ------------------
  |  Branch (808:8): [True: 0, False: 890]
  ------------------
  809|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  810|    890|    qn->namespaceIndex = (UA_UInt16)tmp;
  811|    890|    goto match_name;
  812|       |
  813|    198| match_uri:
  814|    198|    str.length = (size_t)(pos - 1 - begin);
  815|    198|    str.data = (UA_Byte*)(uintptr_t)begin;
  816|    198|    res = escapedUri2Index(str, &qn->namespaceIndex, nsMapping);
  817|    198|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    198|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (817:8): [True: 198, False: 0]
  ------------------
  818|    198|        pos = begin; /* Use the entire string for the name */
  819|       |
  820|   182k| match_name:
  821|   182k|    str.length = (size_t)(end - pos);
  822|   182k|    str.data = (UA_Byte*)(uintptr_t)pos;
  823|   182k|    res = UA_String_copy(&str, &qn->name);
  824|   182k|    if(UA_LIKELY(res == UA_STATUSCODE_GOOD))
  ------------------
  |  |  574|   182k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (574:23): [True: 182k, False: 0]
  |  |  ------------------
  ------------------
  825|   182k|        res = UA_String_unescape(&qn->name, false, escName);
  826|   182k|    return res;
  827|    198|}

UA_readNumberWithBase:
  110|  20.8k|UA_readNumberWithBase(const UA_Byte *buf, size_t buflen, UA_UInt32 *number, UA_Byte base) {
  111|  20.8k|    UA_assert(buf);
  ------------------
  |  |  395|  20.8k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (111:5): [True: 20.8k, False: 0]
  ------------------
  112|  20.8k|    UA_assert(number);
  ------------------
  |  |  395|  20.8k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (112:5): [True: 20.8k, False: 0]
  ------------------
  113|  20.8k|    u32 n = 0;
  114|  20.8k|    size_t progress = 0;
  115|       |    /* read numbers until the end or a non-number character appears */
  116|   860k|    while(progress < buflen) {
  ------------------
  |  Branch (116:11): [True: 839k, False: 20.8k]
  ------------------
  117|   839k|        u8 c = buf[progress];
  118|   839k|        if(c >= '0' && c <= '9' && c <= '0' + (base-1))
  ------------------
  |  Branch (118:12): [True: 839k, False: 12]
  |  Branch (118:24): [True: 839k, False: 231]
  |  Branch (118:36): [True: 839k, False: 0]
  ------------------
  119|   839k|           n = (n * base) + c - '0';
  120|    243|        else if(base > 9 && c >= 'a' && c <= 'z' && c <= 'a' + (base-11))
  ------------------
  |  Branch (120:17): [True: 243, False: 0]
  |  Branch (120:29): [True: 98, False: 145]
  |  Branch (120:41): [True: 84, False: 14]
  |  Branch (120:53): [True: 74, False: 10]
  ------------------
  121|     74|           n = (n * base) + c-'a' + 10;
  122|    169|        else if(base > 9 && c >= 'A' && c <= 'Z' && c <= 'A' + (base-11))
  ------------------
  |  Branch (122:17): [True: 169, False: 0]
  |  Branch (122:29): [True: 156, False: 13]
  |  Branch (122:41): [True: 131, False: 25]
  |  Branch (122:53): [True: 117, False: 14]
  ------------------
  123|    117|           n = (n * base) + c-'A' + 10;
  124|     52|        else
  125|     52|           break;
  126|   839k|        ++progress;
  127|   839k|    }
  128|  20.8k|    *number = n;
  129|  20.8k|    return progress;
  130|  20.8k|}
UA_readNumber:
  133|  5.38k|UA_readNumber(const UA_Byte *buf, size_t buflen, UA_UInt32 *number) {
  134|  5.38k|    return UA_readNumberWithBase(buf, buflen, number, 10);
  135|  5.38k|}
encodeDateTime:
  369|  26.6k|encodeDateTime(const UA_DateTime dt, UA_String *output) {
  370|  26.6k|    char buffer[UA_DATETIME_LENGTH];
  371|  26.6k|    char *pos = buffer;
  372|       |
  373|  26.6k|    if(output->length > 0) {
  ------------------
  |  Branch (373:8): [True: 26.6k, False: 0]
  ------------------
  374|  26.6k|        if(output->length < UA_DATETIME_LENGTH)
  ------------------
  |  |  366|  26.6k|#define UA_DATETIME_LENGTH 40
  ------------------
  |  Branch (374:12): [True: 0, False: 26.6k]
  ------------------
  375|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  376|  26.6k|        pos = (char*)output->data;
  377|  26.6k|    }
  378|       |
  379|       |    /* Format: -yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS'Z' is used. max 31 bytes.
  380|       |     * Note the optional minus for negative years. */
  381|  26.6k|    UA_DateTimeStruct tSt = UA_DateTime_toStruct(dt);
  382|  26.6k|    pos += printNum(tSt.year, pos, 4);
  383|  26.6k|    *(pos++) = '-';
  384|  26.6k|    pos += printNum(tSt.month, pos, 2);
  385|  26.6k|    *(pos++) = '-';
  386|  26.6k|    pos += printNum(tSt.day, pos, 2);
  387|  26.6k|    *(pos++) = 'T';
  388|  26.6k|    pos += printNum(tSt.hour, pos, 2);
  389|  26.6k|    *(pos++) = ':';
  390|  26.6k|    pos += printNum(tSt.min, pos, 2);
  391|  26.6k|    *(pos++) = ':';
  392|  26.6k|    pos += printNum(tSt.sec, pos, 2);
  393|  26.6k|    *(pos++) = '.';
  394|  26.6k|    pos += printNum(tSt.milliSec, pos, 3);
  395|  26.6k|    pos += printNum(tSt.microSec, pos, 3);
  396|  26.6k|    pos += printNum(tSt.nanoSec, pos, 3);
  397|       |
  398|       |    /* Remove trailing zeros */
  399|  26.6k|    pos--;
  400|   251k|    while(*pos == '0')
  ------------------
  |  Branch (400:11): [True: 225k, False: 26.6k]
  ------------------
  401|   225k|        pos--;
  402|  26.6k|    if(*pos == '.')
  ------------------
  |  Branch (402:8): [True: 23.4k, False: 3.19k]
  ------------------
  403|  23.4k|        pos--;
  404|       |
  405|  26.6k|    pos++;
  406|  26.6k|    *(pos++) = 'Z';
  407|       |
  408|  26.6k|    if(output->length > 0) {
  ------------------
  |  Branch (408:8): [True: 26.6k, False: 0]
  ------------------
  409|  26.6k|        output->length = (size_t)(pos - (char*)output->data);
  410|  26.6k|    } else {
  411|      0|        UA_String str = {(size_t)(pos - buffer), (UA_Byte*)buffer};
  412|      0|        return UA_String_copy(&str, output);
  413|      0|    }
  414|       |
  415|  26.6k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  26.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  416|  26.6k|}
UA_String_unescape:
  798|   194k|UA_String_unescape(UA_String *str, UA_Boolean copyEscape, UA_Escaping esc) {
  799|   194k|    if(esc == UA_ESCAPING_NONE)
  ------------------
  |  Branch (799:8): [True: 194k, False: 0]
  ------------------
  800|   194k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   194k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  801|       |
  802|       |    /* Does the string need escaping? */
  803|      0|    UA_String tmp;
  804|      0|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  805|      0|    u8 *pos = str->data;
  806|      0|    u8 *end = str->data + str->length;
  807|      0|    u8 escape_char = (esc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (807:23): [True: 0, False: 0]
  ------------------
  808|      0|                      esc == UA_ESCAPING_PERCENT_EXTENDED) ? '%' : '&';
  ------------------
  |  Branch (808:23): [True: 0, False: 0]
  ------------------
  809|      0|    for(; pos < end; pos++) {
  ------------------
  |  Branch (809:11): [True: 0, False: 0]
  ------------------
  810|      0|        if(*pos == escape_char)
  ------------------
  |  Branch (810:12): [True: 0, False: 0]
  ------------------
  811|      0|            goto escape;
  812|      0|    }
  813|       |
  814|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  815|       |
  816|      0| escape:
  817|      0|    if(copyEscape) {
  ------------------
  |  Branch (817:8): [True: 0, False: 0]
  ------------------
  818|      0|        res = UA_String_copy(str, &tmp);
  819|      0|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (819:12): [True: 0, False: 0]
  ------------------
  820|      0|            return res;
  821|      0|        pos = tmp.data;
  822|      0|        end = tmp.data + tmp.length;
  823|      0|    }
  824|       |
  825|      0|    u8 byte = 0;
  826|      0|    u8 *writepos = pos;
  827|       |
  828|      0|    res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  829|      0|    if(esc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (829:8): [True: 0, False: 0]
  ------------------
  830|      0|       esc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (830:8): [True: 0, False: 0]
  ------------------
  831|       |        /* Percent-Escaping */
  832|      0|        for(; pos < end; pos++) {
  ------------------
  |  Branch (832:15): [True: 0, False: 0]
  ------------------
  833|      0|            if(*pos == '%') {
  ------------------
  |  Branch (833:16): [True: 0, False: 0]
  ------------------
  834|      0|                if(pos + 2 >= end || !isHex(pos[1]) || !isHex(pos[2]))
  ------------------
  |  Branch (834:20): [True: 0, False: 0]
  |  Branch (834:38): [True: 0, False: 0]
  |  Branch (834:56): [True: 0, False: 0]
  ------------------
  835|      0|                    goto out;
  836|      0|                if(pos[1] >= 'a')
  ------------------
  |  Branch (836:20): [True: 0, False: 0]
  ------------------
  837|      0|                    byte = pos[1] - ('a' - 10);
  838|      0|                else if(pos[1] >= 'A')
  ------------------
  |  Branch (838:25): [True: 0, False: 0]
  ------------------
  839|      0|                    byte = pos[1] - ('A' - 10);
  840|      0|                else
  841|      0|                    byte = pos[1] - '0';
  842|      0|                byte <<= 4;
  843|       |
  844|      0|                if(pos[2] >= 'a')
  ------------------
  |  Branch (844:20): [True: 0, False: 0]
  ------------------
  845|      0|                    byte += (u8)(pos[2] - ('a' - 10));
  846|      0|                else if(pos[2] >= 'A')
  ------------------
  |  Branch (846:25): [True: 0, False: 0]
  ------------------
  847|      0|                    byte += (u8)(pos[2] - ('A' - 10));
  848|      0|                else
  849|      0|                    byte += (u8)(pos[2] - '0');
  850|       |
  851|      0|                pos += 2;
  852|      0|                *writepos++ = byte;
  853|      0|                continue;
  854|      0|            }
  855|      0|            *writepos++ = *pos;
  856|      0|        }
  857|      0|    } else {
  858|       |        /* And-Escaping */
  859|      0|        for(; pos < end; pos++) {
  ------------------
  |  Branch (859:15): [True: 0, False: 0]
  ------------------
  860|      0|            if(*pos == '&') {
  ------------------
  |  Branch (860:16): [True: 0, False: 0]
  ------------------
  861|      0|                pos++;
  862|      0|                if(pos == end)
  ------------------
  |  Branch (862:20): [True: 0, False: 0]
  ------------------
  863|      0|                    goto out;
  864|      0|            }
  865|      0|            *writepos++ = *pos;
  866|      0|        }
  867|      0|    }
  868|      0|    res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  869|       |
  870|      0| out:
  871|      0|    if(copyEscape) {
  ------------------
  |  Branch (871:8): [True: 0, False: 0]
  ------------------
  872|      0|        tmp.length = (size_t)(writepos - tmp.data);
  873|      0|        if(tmp.length == 0)
  ------------------
  |  Branch (873:12): [True: 0, False: 0]
  ------------------
  874|      0|            UA_String_clear(&tmp);
  875|      0|        if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (875:12): [True: 0, False: 0]
  ------------------
  876|      0|            *str = tmp;
  877|      0|        else
  878|      0|            UA_String_clear(&tmp);
  879|      0|    } else if(res == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (879:15): [True: 0, False: 0]
  ------------------
  880|      0|        str->length = (size_t)(writepos - str->data);
  881|      0|    }
  882|      0|    return res;
  883|      0|}
UA_String_escapedSize:
  889|  17.9k|UA_String_escapedSize(const UA_String s, UA_Escaping esc) {
  890|       |    /* Find out the overhead from escaping */
  891|  17.9k|    size_t overhead = 0;
  892|  14.6M|    for(size_t j = 0; j < s.length; j++) {
  ------------------
  |  Branch (892:23): [True: 14.6M, False: 17.9k]
  ------------------
  893|  14.6M|        if(esc == UA_ESCAPING_AND_EXTENDED)
  ------------------
  |  Branch (893:12): [True: 0, False: 14.6M]
  ------------------
  894|      0|            overhead += isReservedAndExtended(s.data[j]);
  895|  14.6M|        else if(esc == UA_ESCAPING_AND)
  ------------------
  |  Branch (895:17): [True: 0, False: 14.6M]
  ------------------
  896|      0|            overhead += isReservedAnd(s.data[j]);
  897|  14.6M|        else if(esc == UA_ESCAPING_PERCENT)
  ------------------
  |  Branch (897:17): [True: 137k, False: 14.4M]
  ------------------
  898|   137k|            overhead += (isReservedPercent(s.data[j]) ? 2 : 0);
  ------------------
  |  Branch (898:26): [True: 0, False: 137k]
  ------------------
  899|  14.4M|        else /* if(esc == UA_ESCAPING_PERCENT_EXTENDED) */
  900|  14.4M|            overhead += (isReservedPercentExtended(s.data[j]) ? 2 : 0);
  ------------------
  |  Branch (900:26): [True: 2.65M, False: 11.8M]
  ------------------
  901|  14.6M|    }
  902|       |
  903|  17.9k|    return s.length + overhead;
  904|  17.9k|}
UA_String_escapeInsert:
  907|  17.9k|UA_String_escapeInsert(u8 *pos, const UA_String s2, UA_Escaping esc) {
  908|  17.9k|    u8 *begin = pos;
  909|       |
  910|  17.9k|    if(esc == UA_ESCAPING_NONE) {
  ------------------
  |  Branch (910:8): [True: 17.0k, False: 903]
  ------------------
  911|  14.4M|        for(size_t j = 0; j < s2.length; j++)
  ------------------
  |  Branch (911:27): [True: 14.4M, False: 17.0k]
  ------------------
  912|  14.4M|            *pos++ = s2.data[j];
  913|  17.0k|    } else if(esc == UA_ESCAPING_PERCENT || esc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (913:15): [True: 903, False: 0]
  |  Branch (913:45): [True: 0, False: 0]
  ------------------
  914|   138k|        for(size_t j = 0; j < s2.length; j++) {
  ------------------
  |  Branch (914:27): [True: 137k, False: 903]
  ------------------
  915|   137k|            UA_Boolean reserved = (esc == UA_ESCAPING_PERCENT_EXTENDED) ?
  ------------------
  |  Branch (915:35): [True: 0, False: 137k]
  ------------------
  916|   137k|                isReservedPercentExtended(s2.data[j]) : isReservedPercent(s2.data[j]);
  917|   137k|            if(UA_LIKELY(!reserved)) {
  ------------------
  |  |  574|   137k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (574:23): [True: 137k, False: 0]
  |  |  ------------------
  ------------------
  918|   137k|                *pos++ = s2.data[j];
  919|   137k|            } else {
  920|      0|                *pos++ = '%';
  921|      0|                *pos++ = hexchars[s2.data[j] >> 4];
  922|      0|                *pos++ = hexchars[s2.data[j] & 0x0f];
  923|      0|            }
  924|   137k|        }
  925|    903|    } else {
  926|      0|        for(size_t j = 0; j < s2.length; j++) {
  ------------------
  |  Branch (926:27): [True: 0, False: 0]
  ------------------
  927|      0|            UA_Boolean reserved = (esc == UA_ESCAPING_AND_EXTENDED) ?
  ------------------
  |  Branch (927:35): [True: 0, False: 0]
  ------------------
  928|      0|                isReservedAndExtended(s2.data[j]) : isReservedAnd(s2.data[j]);
  929|      0|            if(reserved)
  ------------------
  |  Branch (929:16): [True: 0, False: 0]
  ------------------
  930|      0|                *pos++ = '&';
  931|      0|            *pos++ = s2.data[j];
  932|      0|        }
  933|      0|    }
  934|       |
  935|  17.9k|    return (size_t)(pos - begin);
  936|  17.9k|}
ua_util.c:printNum:
  344|   240k|printNum(i32 n, char *pos, u8 min_digits) {
  345|   240k|    char digits[10];
  346|   240k|    u8 len = 0;
  347|       |    /* Handle negative values */
  348|   240k|    if(n < 0) {
  ------------------
  |  Branch (348:8): [True: 5.63k, False: 234k]
  ------------------
  349|  5.63k|        pos[len++] = '-';
  350|  5.63k|        n = -n;
  351|  5.63k|    }
  352|       |
  353|       |    /* Extract the digits */
  354|   240k|    u8 i = 0;
  355|   854k|    for(; i < min_digits || n > 0; i++) {
  ------------------
  |  Branch (355:11): [True: 613k, False: 240k]
  |  Branch (355:29): [True: 519, False: 240k]
  ------------------
  356|   614k|        digits[i] = (char)((n % 10) + '0');
  357|   614k|        n /= 10;
  358|   614k|    }
  359|       |
  360|       |    /* Print in reverse order and return */
  361|   854k|    for(; i > 0; i--)
  ------------------
  |  Branch (361:11): [True: 614k, False: 240k]
  ------------------
  362|   614k|        pos[len++] = digits[i-1];
  363|   240k|    return len;
  364|   240k|}

ua_util.c:isReservedPercent:
   95|  14.7M|isReservedPercent(u8 c) {
   96|  14.7M|    return (c == ';'  || c == '%' || c <= ' ' || c == 127);
  ------------------
  |  Branch (96:13): [True: 4.46k, False: 14.7M]
  |  Branch (96:26): [True: 4.68k, False: 14.7M]
  |  Branch (96:38): [True: 71.1k, False: 14.6M]
  |  Branch (96:50): [True: 480, False: 14.6M]
  ------------------
   97|  14.7M|}
ua_util.c:isReservedPercentExtended:
  100|  14.4M|isReservedPercentExtended(u8 c) {
  101|  14.4M|    return (isReservedPercent(c) || c == ':' || c == '#' || c == '[' || c == ']' ||
  ------------------
  |  Branch (101:13): [True: 80.7k, False: 14.3M]
  |  Branch (101:37): [True: 4.23k, False: 14.3M]
  |  Branch (101:49): [True: 3.85k, False: 14.3M]
  |  Branch (101:61): [True: 2.43k, False: 14.3M]
  |  Branch (101:73): [True: 2.76k, False: 14.3M]
  ------------------
  102|  14.3M|            c == '&' || c == '(' || c == ')' || c == ',' || c == '<' || c == '>' ||
  ------------------
  |  Branch (102:13): [True: 2.21k, False: 14.3M]
  |  Branch (102:25): [True: 63.7k, False: 14.3M]
  |  Branch (102:37): [True: 2.07k, False: 14.3M]
  |  Branch (102:49): [True: 2.34M, False: 11.9M]
  |  Branch (102:61): [True: 5.55k, False: 11.9M]
  |  Branch (102:73): [True: 6.72k, False: 11.9M]
  ------------------
  103|  11.9M|            c == '`' || c == '/' || c == '\\' || c == '"' || c == '\'' );
  ------------------
  |  Branch (103:13): [True: 2.26k, False: 11.9M]
  |  Branch (103:25): [True: 16.5k, False: 11.9M]
  |  Branch (103:37): [True: 6.82k, False: 11.9M]
  |  Branch (103:50): [True: 102k, False: 11.8M]
  |  Branch (103:62): [True: 30, False: 11.8M]
  ------------------
  104|  14.4M|}
ua_types_encoding_json.c:isTrue:
  167|  85.8k|isTrue(uint8_t expr) {
  168|  85.8k|    return expr;
  169|  85.8k|}

LLVMFuzzerTestOneInput:
   13|  3.02k|LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
   14|  3.02k|    UA_ByteString buf;
   15|  3.02k|    buf.data = (UA_Byte*)data;
   16|  3.02k|    buf.length = size;
   17|       |
   18|  3.02k|    UA_Variant value;
   19|  3.02k|    UA_Variant_init(&value);
   20|       |
   21|  3.02k|    UA_StatusCode retval = UA_decodeJson(&buf, &value, &UA_TYPES[UA_TYPES_VARIANT], NULL);
  ------------------
  |  |  803|  3.02k|#define UA_TYPES_VARIANT 23
  ------------------
   22|  3.02k|    if(retval != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  3.02k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (22:8): [True: 1.07k, False: 1.95k]
  ------------------
   23|  1.07k|        return 0;
   24|       |
   25|       |    /* This can fail for now. For example length limits are not always computed
   26|       |     * 100% identical between encoding and decoding. */
   27|  1.95k|    size_t jsonSize = UA_calcSizeJson(&value, &UA_TYPES[UA_TYPES_VARIANT], NULL);
  ------------------
  |  |  803|  1.95k|#define UA_TYPES_VARIANT 23
  ------------------
   28|  1.95k|    if(jsonSize == 0) {
  ------------------
  |  Branch (28:8): [True: 0, False: 1.95k]
  ------------------
   29|      0|        UA_Variant_clear(&value);
   30|      0|        return 0;
   31|      0|    }
   32|       |
   33|  1.95k|    UA_ByteString buf2 = UA_BYTESTRING_NULL;
   34|  1.95k|    retval = UA_ByteString_allocBuffer(&buf2, jsonSize);
   35|  1.95k|    if(retval != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  1.95k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (35:8): [True: 0, False: 1.95k]
  ------------------
   36|      0|        UA_Variant_clear(&value);
   37|      0|        return 0;
   38|      0|    }
   39|       |
   40|  1.95k|    retval = UA_encodeJson(&value, &UA_TYPES[UA_TYPES_VARIANT], &buf2, NULL);
  ------------------
  |  |  803|  1.95k|#define UA_TYPES_VARIANT 23
  ------------------
   41|  1.95k|    UA_assert(retval == UA_STATUSCODE_GOOD);
  ------------------
  |  |  395|  1.95k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (41:5): [True: 1.95k, False: 0]
  ------------------
   42|       |
   43|  1.95k|    UA_Variant value2;
   44|  1.95k|    UA_Variant_init(&value2);
   45|  1.95k|    retval = UA_decodeJson(&buf2, &value2, &UA_TYPES[UA_TYPES_VARIANT], NULL);
  ------------------
  |  |  803|  1.95k|#define UA_TYPES_VARIANT 23
  ------------------
   46|  1.95k|    if(retval == UA_STATUSCODE_BADOUTOFMEMORY) {
  ------------------
  |  |   31|  1.95k|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  |  Branch (46:8): [True: 0, False: 1.95k]
  ------------------
   47|      0|        UA_Variant_clear(&value);
   48|      0|        UA_ByteString_clear(&buf2);
   49|      0|        return 0;
   50|      0|    }
   51|  1.95k|    UA_assert(retval == UA_STATUSCODE_GOOD);
  ------------------
  |  |  395|  1.95k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (51:5): [True: 1.95k, False: 0]
  ------------------
   52|       |
   53|  1.95k|    UA_assert(UA_order(&value, &value2, &UA_TYPES[UA_TYPES_VARIANT]) == UA_ORDER_EQ);
  ------------------
  |  |  395|  1.95k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (53:5): [True: 1.95k, False: 0]
  ------------------
   54|       |
   55|  1.95k|    UA_ByteString buf3 = UA_BYTESTRING_NULL;
   56|  1.95k|    retval = UA_ByteString_allocBuffer(&buf3, jsonSize);
   57|  1.95k|    if(retval != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  1.95k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (57:8): [True: 0, False: 1.95k]
  ------------------
   58|      0|        UA_Variant_clear(&value);
   59|      0|        UA_Variant_clear(&value2);
   60|      0|        UA_ByteString_clear(&buf2);
   61|      0|        return 0;
   62|      0|    }
   63|       |
   64|  1.95k|    retval = UA_encodeJson(&value2, &UA_TYPES[UA_TYPES_VARIANT], &buf3, NULL);
  ------------------
  |  |  803|  1.95k|#define UA_TYPES_VARIANT 23
  ------------------
   65|  1.95k|    UA_assert(retval == UA_STATUSCODE_GOOD);
  ------------------
  |  |  395|  1.95k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (65:5): [True: 1.95k, False: 0]
  ------------------
   66|       |
   67|  1.95k|    UA_assert(buf2.length == buf3.length);
  ------------------
  |  |  395|  1.95k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (67:5): [True: 1.95k, False: 0]
  ------------------
   68|  1.95k|    UA_assert(memcmp(buf2.data, buf3.data, buf2.length) == 0);
  ------------------
  |  |  395|  1.95k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (68:5): [True: 1.95k, False: 0]
  ------------------
   69|       |
   70|  1.95k|    UA_Variant_clear(&value);
   71|  1.95k|    UA_Variant_clear(&value2);
   72|  1.95k|    UA_ByteString_clear(&buf2);
   73|  1.95k|    UA_ByteString_clear(&buf3);
   74|  1.95k|    return 0;
   75|  1.95k|}

fuzz_json_decode_encode.cc:_ZL15UA_Variant_initP10UA_Variant:
  239|  4.97k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_json_decode_encode.cc:_ZL16UA_Variant_clearP10UA_Variant:
  239|  3.90k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_json_decode_encode.cc:_ZL19UA_ByteString_clearP9UA_String:
  239|  3.90k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_String_clear:
  239|  4.63k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_ByteString_init:
  239|   107k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_String_copy:
  239|   194k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_NodeId_clear:
  239|    105|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_ExpandedNodeId_clear:
  239|    128|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_QualifiedName_init:
  239|   182k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_clear:
  239|   313k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_init:
  239|    116|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_init:
  239|   205k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_init:
  239|    383|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_clear:
  239|     70|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_new:
  239|    388|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_clear:
  239|    116|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl

UA_StatusCode_name:
  275|  1.78k|const char * UA_StatusCode_name(UA_StatusCode code) {
  276|  15.7k|    for (size_t i = 0; i < statusCodeDescriptionsSize; ++i) {
  ------------------
  |  Branch (276:24): [True: 15.6k, False: 27]
  ------------------
  277|  15.6k|        if (UA_StatusCode_isEqualTop(statusCodeDescriptions[i].code,code))
  ------------------
  |  |  198|  15.6k|#define UA_StatusCode_isEqualTop(s1, s2) UA_StatusCode_equalTop(s1, s2)
  |  |  ------------------
  |  |  |  Branch (198:42): [True: 1.76k, False: 13.9k]
  |  |  ------------------
  ------------------
  278|  1.76k|            return statusCodeDescriptions[i].name;
  279|  15.6k|    }
  280|     27|    return statusCodeDescriptions[statusCodeDescriptionsSize-1].name;
  281|  1.78k|}

