UA_base64:
   17|  10.6k|UA_base64(const unsigned char *src, size_t len, size_t *out_len) {
   18|  10.6k|    if(len == 0) {
  ------------------
  |  Branch (18:8): [True: 0, False: 10.6k]
  ------------------
   19|      0|        *out_len = 0;
   20|      0|        return NULL;
   21|      0|    }
   22|       |
   23|  10.6k|    size_t olen = 4*((len + 2) / 3); /* 3-byte blocks to 4-byte */
   24|  10.6k|    if(olen < len)
  ------------------
  |  Branch (24:8): [True: 0, False: 10.6k]
  ------------------
   25|      0|        return NULL; /* integer overflow */
   26|       |
   27|  10.6k|    unsigned char *out = (unsigned char*)UA_malloc(olen);
  ------------------
  |  |   22|  10.6k|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
   28|  10.6k|    if(!out)
  ------------------
  |  Branch (28:8): [True: 0, False: 10.6k]
  ------------------
   29|      0|        return NULL;
   30|       |
   31|  10.6k|    *out_len = UA_base64_buf(src, len, out);
   32|  10.6k|    return out;
   33|  10.6k|}
UA_base64_buf:
   36|  29.9k|UA_base64_buf(const unsigned char *src, size_t len, unsigned char *out) {
   37|  29.9k|    const unsigned char *end = src + len;
   38|  29.9k|    const unsigned char *in = src;
   39|  29.9k|    unsigned char *pos = out;
   40|  1.30M|    while(end - in >= 3) {
  ------------------
  |  Branch (40:11): [True: 1.27M, False: 29.9k]
  ------------------
   41|  1.27M|        *pos++ = base64_table[in[0] >> 2];
   42|  1.27M|        *pos++ = base64_table[((in[0] & 0x03) << 4) | (in[1] >> 4)];
   43|  1.27M|        *pos++ = base64_table[((in[1] & 0x0f) << 2) | (in[2] >> 6)];
   44|  1.27M|        *pos++ = base64_table[in[2] & 0x3f];
   45|  1.27M|        in += 3;
   46|  1.27M|    }
   47|       |
   48|  29.9k|    if(end - in) {
  ------------------
  |  Branch (48:8): [True: 4.60k, False: 25.2k]
  ------------------
   49|  4.60k|        *pos++ = base64_table[in[0] >> 2];
   50|  4.60k|        if(end - in == 1) {
  ------------------
  |  Branch (50:12): [True: 1.80k, False: 2.80k]
  ------------------
   51|  1.80k|            *pos++ = base64_table[(in[0] & 0x03) << 4];
   52|  1.80k|            *pos++ = '=';
   53|  2.80k|        } else {
   54|  2.80k|            *pos++ = base64_table[((in[0] & 0x03) << 4) | (in[1] >> 4)];
   55|  2.80k|            *pos++ = base64_table[(in[1] & 0x0f) << 2];
   56|  2.80k|        }
   57|  4.60k|        *pos++ = '=';
   58|  4.60k|    }
   59|       |
   60|  29.9k|    return (size_t)(pos - out);
   61|  29.9k|}
UA_unbase64:
   75|  21.9k|UA_unbase64(const unsigned char *src, size_t len, size_t *out_len) {
   76|       |    /* Empty base64 results in an empty byte-string */
   77|  21.9k|    if(len == 0) {
  ------------------
  |  Branch (77:8): [True: 10.7k, False: 11.1k]
  ------------------
   78|  10.7k|        *out_len = 0;
   79|  10.7k|        return (unsigned char*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  757|  10.7k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
   80|  10.7k|    }
   81|       |
   82|       |    /* Allocate the output string. Append four bytes to allow missing padding */
   83|  11.1k|    size_t olen = (len / 4 * 3) + 4;
   84|  11.1k|    unsigned char *out = (unsigned char*)UA_malloc(olen);
  ------------------
  |  |   22|  11.1k|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
   85|  11.1k|    if(!out)
  ------------------
  |  Branch (85:8): [True: 0, False: 11.1k]
  ------------------
   86|      0|        return NULL;
   87|       |
   88|       |    /* Iterate over the input */
   89|  11.1k|    size_t pad = 0;
   90|  11.1k|    unsigned char count = 0;
   91|  11.1k|    unsigned char block[4];
   92|  11.1k|    unsigned char *pos = out;
   93|  3.45M|    for(size_t i = 0; i < len; i++) {
  ------------------
  |  Branch (93:23): [True: 3.44M, False: 11.1k]
  ------------------
   94|  3.44M|        if(src[i] & 0x80)
  ------------------
  |  Branch (94:12): [True: 13, False: 3.44M]
  ------------------
   95|     13|            goto error; /* Non-ASCII input */
   96|  3.44M|        unsigned char tmp = dtable[src[i]];
   97|  3.44M|        if(tmp == 0x80)
  ------------------
  |  Branch (97:12): [True: 14, False: 3.44M]
  ------------------
   98|     14|            goto error; /* Not an allowed character */
   99|  3.44M|        if(tmp == 0x7f)
  ------------------
  |  Branch (99:12): [True: 2.04k, False: 3.44M]
  ------------------
  100|  2.04k|            continue; /* Whitespace is ignored to accomodate RFC 2045, used in
  101|       |                       * XML for xs:base64Binary. */
  102|  3.44M|        block[count++] = tmp;
  103|       |
  104|       |        /* Padding */
  105|  3.44M|        if(src[i] == '=') {
  ------------------
  |  Branch (105:12): [True: 4.15k, False: 3.43M]
  ------------------
  106|  4.15k|            if(count < 3) /* Padding can only be the last two bytes of a block */
  ------------------
  |  Branch (106:16): [True: 5, False: 4.15k]
  ------------------
  107|      5|                goto error;
  108|  4.15k|            block[count-1] = 0;
  109|  4.15k|            pad++;
  110|  3.43M|        } else if(pad > 0) {
  ------------------
  |  Branch (110:19): [True: 7, False: 3.43M]
  ------------------
  111|      7|            goto error; /* Padding not terminated correctly */
  112|      7|        }
  113|       |
  114|       |        /* Write three output characters for four characters of input */
  115|  3.44M|        if(count == 4) {
  ------------------
  |  Branch (115:12): [True: 860k, False: 2.58M]
  ------------------
  116|   860k|            if(pad > 2)
  ------------------
  |  Branch (116:16): [True: 0, False: 860k]
  ------------------
  117|      0|                goto error; /* Invalid padding */
  118|   860k|            *pos++ = (block[0] << 2) | (block[1] >> 4);
  119|   860k|            *pos++ = (block[1] << 4) | (block[2] >> 2);
  120|   860k|            *pos++ = (block[2] << 6) | block[3];
  121|   860k|            count = 0;
  122|   860k|            pos -= pad;
  123|   860k|            pad = 0;
  124|   860k|        }
  125|  3.44M|    }
  126|       |
  127|       |    /* Base64URL permits omitting the padding in the final block. A single
  128|       |     * character cannot encode a byte, and explicit padding must be complete. */
  129|  11.1k|    if(count == 1 || pad > 0)
  ------------------
  |  Branch (129:8): [True: 14, False: 11.1k]
  |  Branch (129:22): [True: 1, False: 11.1k]
  ------------------
  130|     15|        goto error;
  131|  11.1k|    if(count >= 2) {
  ------------------
  |  Branch (131:8): [True: 218, False: 10.9k]
  ------------------
  132|    218|        *pos++ = (block[0] << 2) | (block[1] >> 4);
  133|    218|        if(count == 3)
  ------------------
  |  Branch (133:12): [True: 91, False: 127]
  ------------------
  134|     91|            *pos++ = (block[1] << 4) | (block[2] >> 2);
  135|    218|    }
  136|       |
  137|  11.1k|    *out_len = (size_t)(pos - out);
  138|  11.1k|    if(*out_len == 0) {
  ------------------
  |  Branch (138:8): [True: 233, False: 10.8k]
  ------------------
  139|    233|        UA_free(out);
  ------------------
  |  |   23|    233|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  140|    233|        return (unsigned char*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  757|    233|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  141|    233|    }
  142|  10.8k|    return out;
  143|       |
  144|     54| error:
  145|     54|    UA_free(out);
  ------------------
  |  |   23|     54|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  146|       |    return NULL;
  147|  11.1k|}

cj5_parse:
  306|  11.3k|          cj5_options *options) {
  307|  11.3k|    cj5_result r;
  308|  11.3k|    cj5__parser parser;
  309|  11.3k|    memset(&parser, 0x0, sizeof(parser));
  310|  11.3k|    parser.curr_tok_idx = 0;
  311|  11.3k|    parser.json5 = json5;
  312|  11.3k|    parser.len = len;
  313|  11.3k|    parser.tokens = tokens;
  314|  11.3k|    parser.max_tokens = max_tokens;
  315|       |
  316|  11.3k|    if(options)
  ------------------
  |  Branch (316:8): [True: 11.3k, False: 0]
  ------------------
  317|  11.3k|        parser.stop_early = options->stop_early;
  318|       |
  319|  11.3k|    unsigned short depth = 0; // Nesting depth zero means "outside the root object"
  320|  11.3k|    char nesting[CJ5_MAX_NESTING]; // Contains either '\0', '{' or '[' for the
  321|       |                                   // type of nesting at each depth. '\0'
  322|       |                                   // indicates we are out of the root object.
  323|  11.3k|    char next[CJ5_MAX_NESTING];    // Next content to parse: 'k' (key), ':', 'v'
  324|       |                                   // (value) or ',' (comma).
  325|  11.3k|    next[0] = 'v';  // The root is a "value" (object, array or primitive). If we
  326|       |                    // detect a colon after the first value then everything is
  327|       |                    // wrapped into a "virtual root object" and the parsing is
  328|       |                    // restarted.
  329|  11.3k|    nesting[0] = 0; // Becomes '{' if there is a virtual root object
  330|       |
  331|  11.3k|    cj5_token *token = NULL; // The current token
  332|       |
  333|  15.1k| start_parsing:
  334|  85.0M|    for(; parser.pos < len; parser.pos++) {
  ------------------
  |  Branch (334:11): [True: 85.0M, False: 10.9k]
  ------------------
  335|  85.0M|        char c = json5[parser.pos];
  336|  85.0M|        switch(c) {
  337|  28.4k|        case '\n': // Skip newline and whitespace
  ------------------
  |  Branch (337:9): [True: 28.4k, False: 85.0M]
  ------------------
  338|   102k|        case '\r':
  ------------------
  |  Branch (338:9): [True: 74.3k, False: 85.0M]
  ------------------
  339|   104k|        case '\t':
  ------------------
  |  Branch (339:9): [True: 1.53k, False: 85.0M]
  ------------------
  340|   107k|        case ' ':
  ------------------
  |  Branch (340:9): [True: 3.60k, False: 85.0M]
  ------------------
  341|   107k|            break;
  342|       |
  343|    682|        case '#': // Skip comment
  ------------------
  |  Branch (343:9): [True: 682, False: 85.0M]
  ------------------
  344|  12.8k|        case '/':
  ------------------
  |  Branch (344:9): [True: 12.1k, False: 85.0M]
  ------------------
  345|  12.8k|            cj5__skip_comment(&parser);
  346|  12.8k|            if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (346:16): [True: 10.6k, False: 2.13k]
  ------------------
  347|  10.6k|               parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (347:16): [True: 163, False: 10.5k]
  ------------------
  348|    163|                goto finish;
  349|  12.6k|            break;
  350|       |
  351|  2.96M|        case '{': // Open an object or array
  ------------------
  |  Branch (351:9): [True: 2.96M, False: 82.1M]
  ------------------
  352|  2.99M|        case '[':
  ------------------
  |  Branch (352:9): [True: 31.1k, False: 85.0M]
  ------------------
  353|       |            // Check the nesting depth
  354|  2.99M|            if(depth + 1 >= CJ5_MAX_NESTING) {
  ------------------
  |  |   53|  2.99M|#define CJ5_MAX_NESTING 256
  ------------------
  |  Branch (354:16): [True: 3, False: 2.99M]
  ------------------
  355|      3|                parser.error = CJ5_ERROR_INVALID;
  356|      3|                goto finish;
  357|      3|            }
  358|       |
  359|       |            // Correct next?
  360|  2.99M|            if(next[depth] != 'v') {
  ------------------
  |  Branch (360:16): [True: 41, False: 2.99M]
  ------------------
  361|     41|                parser.error = CJ5_ERROR_INVALID;
  362|     41|                goto finish;
  363|     41|            }
  364|       |
  365|  2.99M|            depth++; // Increase the nesting depth
  366|  2.99M|            nesting[depth] = c; // Set the nesting type
  367|  2.99M|            next[depth] = (c == '{') ? 'k' : 'v'; // next is either a key or a value
  ------------------
  |  Branch (367:27): [True: 2.96M, False: 31.1k]
  ------------------
  368|       |
  369|       |            // Create a token for the object or array
  370|  2.99M|            token = cj5__alloc_token(&parser);
  371|  2.99M|            if(token) {
  ------------------
  |  Branch (371:16): [True: 1.56M, False: 1.43M]
  ------------------
  372|  1.56M|                token->parent_id = parser.curr_tok_idx;
  373|  1.56M|                token->type = (c == '{') ? CJ5_TOKEN_OBJECT : CJ5_TOKEN_ARRAY;
  ------------------
  |  Branch (373:31): [True: 1.54M, False: 20.1k]
  ------------------
  374|  1.56M|                token->start = parser.pos;
  375|  1.56M|                token->size = 0;
  376|  1.56M|                parser.curr_tok_idx = parser.token_count - 1; // The new curr_tok_idx
  377|       |                                                              // is for this token
  378|  1.56M|            }
  379|  2.99M|            break;
  380|       |
  381|  2.96M|        case '}': // Close an object or array
  ------------------
  |  Branch (381:9): [True: 2.96M, False: 82.1M]
  ------------------
  382|  2.99M|        case ']':
  ------------------
  |  Branch (382:9): [True: 26.9k, False: 85.0M]
  ------------------
  383|       |            // Check the nesting depth. Note that a "virtual root object" at
  384|       |            // depth zero must not be closed.
  385|  2.99M|            if(depth == 0) {
  ------------------
  |  Branch (385:16): [True: 24, False: 2.99M]
  ------------------
  386|     24|                parser.error = CJ5_ERROR_INVALID;
  387|     24|                goto finish;
  388|     24|            }
  389|       |
  390|       |            // Check and adjust the nesting. Note that ']' - '[' == 2 and '}' -
  391|       |            // '{' == 2. Arrays can always be closed. Objects can only close
  392|       |            // when a key or a comma is expected.
  393|  2.99M|            if(c - nesting[depth] != 2 ||
  ------------------
  |  Branch (393:16): [True: 5, False: 2.99M]
  ------------------
  394|  2.99M|               (c == '}' && next[depth] != 'k' && next[depth] != ',')) {
  ------------------
  |  Branch (394:17): [True: 2.96M, False: 26.9k]
  |  Branch (394:29): [True: 92.2k, False: 2.87M]
  |  Branch (394:51): [True: 5, False: 92.2k]
  ------------------
  395|     10|                parser.error = CJ5_ERROR_INVALID;
  396|     10|                goto finish;
  397|     10|            }
  398|       |
  399|  2.99M|            if(token) {
  ------------------
  |  Branch (399:16): [True: 1.55M, False: 1.43M]
  ------------------
  400|       |                // Finalize the current token
  401|  1.55M|                token->end = parser.pos;
  402|       |
  403|       |                // Move to the parent and increase the parent size. Omit this
  404|       |                // when we leave the root (parent the same as the current
  405|       |                // token).
  406|  1.55M|                if(parser.curr_tok_idx != token->parent_id) {
  ------------------
  |  Branch (406:20): [True: 1.54M, False: 6.95k]
  ------------------
  407|  1.54M|                    parser.curr_tok_idx = token->parent_id;
  408|  1.54M|                    token = &tokens[token->parent_id];
  409|  1.54M|                    token->size++;
  410|  1.54M|                }
  411|  1.55M|            }
  412|       |
  413|       |            // Step one level up
  414|  2.99M|            depth--;
  415|  2.99M|            next[depth] = (depth == 0) ? 0 : ','; // zero if we step out the root
  ------------------
  |  Branch (415:27): [True: 7.34k, False: 2.98M]
  ------------------
  416|       |                                                  // object. then we do not look for
  417|       |                                                  // another element.
  418|       |
  419|       |            // The first element was successfully parsed. Stop early or try to
  420|       |            // parse the full input string?
  421|  2.99M|            if(depth == 0 && parser.stop_early)
  ------------------
  |  Branch (421:16): [True: 7.34k, False: 2.98M]
  |  Branch (421:30): [True: 0, False: 7.34k]
  ------------------
  422|      0|                goto finish;
  423|       |
  424|  2.99M|            break;
  425|       |
  426|  2.99M|        case ':': // Colon (between key and value)
  ------------------
  |  Branch (426:9): [True: 1.20M, False: 83.8M]
  ------------------
  427|  1.20M|            if(next[depth] != ':') {
  ------------------
  |  Branch (427:16): [True: 3.46k, False: 1.20M]
  ------------------
  428|  3.46k|                parser.error = CJ5_ERROR_INVALID;
  429|  3.46k|                goto finish;
  430|  3.46k|            }
  431|  1.20M|            next[depth] = 'v';
  432|  1.20M|            break;
  433|       |
  434|  39.7M|        case ',': // Comma
  ------------------
  |  Branch (434:9): [True: 39.7M, False: 45.3M]
  ------------------
  435|  39.7M|            if(next[depth] != ',') {
  ------------------
  |  Branch (435:16): [True: 21, False: 39.7M]
  ------------------
  436|     21|                parser.error = CJ5_ERROR_INVALID;
  437|     21|                goto finish;
  438|     21|            }
  439|  39.7M|            next[depth] = (nesting[depth] == '{') ? 'k' : 'v';
  ------------------
  |  Branch (439:27): [True: 1.10M, False: 38.5M]
  ------------------
  440|  39.7M|            break;
  441|       |
  442|  38.0M|        default: // Value or key
  ------------------
  |  Branch (442:9): [True: 38.0M, False: 47.0M]
  ------------------
  443|  38.0M|            if(next[depth] == 'v') {
  ------------------
  |  Branch (443:16): [True: 36.8M, False: 1.20M]
  ------------------
  444|  36.8M|                cj5__parse_primitive(&parser); // Parse primitive value
  445|  36.8M|                if(nesting[depth] != 0) {
  ------------------
  |  Branch (445:20): [True: 36.8M, False: 3.79k]
  ------------------
  446|       |                    // Parent is object or array
  447|  36.8M|                    if(token)
  ------------------
  |  Branch (447:24): [True: 36.7M, False: 133k]
  ------------------
  448|  36.7M|                        token->size++;
  449|  36.8M|                    next[depth] = ',';
  450|  36.8M|                } else {
  451|       |                    // The current value was the root element. Don't look for
  452|       |                    // any next element.
  453|  3.79k|                    next[depth] = 0;
  454|       |
  455|       |                    // The first element was successfully parsed. Stop early or try to
  456|       |                    // parse the full input string?
  457|  3.79k|                    if(parser.stop_early)
  ------------------
  |  Branch (457:24): [True: 0, False: 3.79k]
  ------------------
  458|      0|                        goto finish;
  459|  3.79k|                }
  460|  36.8M|            } else if(next[depth] == 'k') {
  ------------------
  |  Branch (460:23): [True: 1.20M, False: 235]
  ------------------
  461|  1.20M|                cj5__parse_key(&parser);
  462|  1.20M|                if(token)
  ------------------
  |  Branch (462:20): [True: 1.11M, False: 87.2k]
  ------------------
  463|  1.11M|                    token->size++; // Keys count towards the length
  464|  1.20M|                next[depth] = ':';
  465|  1.20M|            } else {
  466|    235|                parser.error = CJ5_ERROR_INVALID;
  467|    235|            }
  468|       |
  469|  38.0M|            if(parser.error && parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (469:16): [True: 19.5M, False: 18.5M]
  |  Branch (469:32): [True: 474, False: 19.5M]
  ------------------
  470|    474|                goto finish;
  471|       |
  472|  38.0M|            break;
  473|  85.0M|        }
  474|  85.0M|    }
  475|       |
  476|       |    // Are we back to the initial nesting depth?
  477|  10.9k|    if(depth != 0) {
  ------------------
  |  Branch (477:8): [True: 82, False: 10.8k]
  ------------------
  478|     82|        parser.error = CJ5_ERROR_INCOMPLETE;
  479|     82|        goto finish;
  480|     82|    }
  481|       |
  482|       |    // Close the virtual root object if there is one
  483|  10.8k|    if(nesting[0] == '{' && parser.error != CJ5_ERROR_OVERFLOW) {
  ------------------
  |  Branch (483:8): [True: 3.44k, False: 7.44k]
  |  Branch (483:29): [True: 3.43k, False: 6]
  ------------------
  484|       |        // Check the we end after a complete key-value pair (or dangling comma)
  485|  3.43k|        if(next[0] != 'k' && next[0] != ',')
  ------------------
  |  Branch (485:12): [True: 3.42k, False: 9]
  |  Branch (485:30): [True: 55, False: 3.37k]
  ------------------
  486|     55|            parser.error = CJ5_ERROR_INVALID;
  487|  3.43k|        tokens[0].end = parser.pos - 1;
  488|  3.43k|    }
  489|       |
  490|  15.1k| finish:
  491|       |    // If parsing failed at the initial nesting depth, create a virtual root object
  492|       |    // and restart parsing.
  493|  15.1k|    if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (493:8): [True: 5.24k, False: 9.91k]
  ------------------
  494|  5.24k|       parser.error != CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (494:8): [True: 4.33k, False: 911]
  ------------------
  495|  4.33k|       depth == 0 && nesting[0] != '{') {
  ------------------
  |  Branch (495:8): [True: 4.15k, False: 185]
  |  Branch (495:22): [True: 3.79k, False: 357]
  ------------------
  496|  3.79k|        parser.token_count = 0;
  497|  3.79k|        token = cj5__alloc_token(&parser);
  498|  3.79k|        if(token) {
  ------------------
  |  Branch (498:12): [True: 3.79k, False: 0]
  ------------------
  499|  3.79k|            token->parent_id = 0;
  500|  3.79k|            token->type = CJ5_TOKEN_OBJECT;
  501|  3.79k|            token->start = 0;
  502|  3.79k|            token->size = 0;
  503|       |
  504|  3.79k|            nesting[0] = '{';
  505|  3.79k|            next[0] = 'k';
  506|       |
  507|  3.79k|            parser.curr_tok_idx = 0;
  508|  3.79k|            parser.pos = 0;
  509|  3.79k|            parser.error = CJ5_ERROR_NONE;
  510|  3.79k|            goto start_parsing;
  511|  3.79k|        }
  512|  3.79k|    }
  513|       |
  514|  11.3k|    memset(&r, 0x0, sizeof(r));
  515|  11.3k|    r.error = parser.error;
  516|  11.3k|    r.error_pos = parser.pos;
  517|  11.3k|    r.num_tokens = parser.token_count; // How many tokens (would) have been
  518|       |                                       // consumed by the parser?
  519|       |
  520|       |    // Not a single token was parsed -> return an error
  521|  11.3k|    if(r.num_tokens == 0)
  ------------------
  |  Branch (521:8): [True: 24, False: 11.3k]
  ------------------
  522|     24|        r.error = CJ5_ERROR_INCOMPLETE;
  523|       |
  524|       |    // Set the tokens and original string only if successfully parsed
  525|  11.3k|    if(r.error == CJ5_ERROR_NONE) {
  ------------------
  |  Branch (525:8): [True: 9.89k, False: 1.47k]
  ------------------
  526|  9.89k|        r.tokens = tokens;
  527|  9.89k|        r.json5 = json5;
  528|  9.89k|    }
  529|       |
  530|  11.3k|    return r;
  531|  15.1k|}
cj5_get_str:
  629|   125k|            char *buf, unsigned int *buflen) {
  630|   125k|    const cj5_token *token = &r->tokens[tok_index];
  631|   125k|    if(token->type != CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (631:8): [True: 0, False: 125k]
  ------------------
  632|      0|        buf[0] = 0;
  633|      0|        if(buflen)
  ------------------
  |  Branch (633:12): [True: 0, False: 0]
  ------------------
  634|      0|            *buflen = 0;
  635|      0|        return CJ5_ERROR_INVALID;
  636|      0|    }
  637|       |
  638|   125k|    const char *pos = &r->json5[token->start];
  639|   125k|    const char *end = &r->json5[token->end + 1];
  640|   125k|    unsigned int outpos = 0;
  641|   125k|    cj5_error_code error = CJ5_ERROR_NONE;
  642|  36.1M|    for(; pos < end; pos++) {
  ------------------
  |  Branch (642:11): [True: 36.0M, False: 125k]
  ------------------
  643|  36.0M|        uint8_t c = (uint8_t)*pos;
  644|       |        // Unprintable ascii characters must be escaped
  645|  36.0M|        if(c < ' ' || c == 127) {
  ------------------
  |  Branch (645:12): [True: 30, False: 36.0M]
  |  Branch (645:23): [True: 3, False: 36.0M]
  ------------------
  646|     33|            error = CJ5_ERROR_INVALID;
  647|     33|            goto done;
  648|     33|        }
  649|       |
  650|       |        // Unescaped Ascii character or utf8 byte
  651|  36.0M|        if(c != '\\') {
  ------------------
  |  Branch (651:12): [True: 27.1M, False: 8.89M]
  ------------------
  652|  27.1M|            buf[outpos++] = (char)c;
  653|  27.1M|            continue;
  654|  27.1M|        }
  655|       |
  656|       |        // End of input before the escaped character
  657|  8.89M|        if(pos + 1 >= end) {
  ------------------
  |  Branch (657:12): [True: 0, False: 8.89M]
  ------------------
  658|      0|            error = CJ5_ERROR_INCOMPLETE;
  659|      0|            goto done;
  660|      0|        }
  661|       |
  662|       |        // Process escaped character
  663|  8.89M|        pos++;
  664|  8.89M|        c = (uint8_t)*pos;
  665|  8.89M|        switch(c) {
  666|    451|        case 'b': buf[outpos++] = '\b'; break;
  ------------------
  |  Branch (666:9): [True: 451, False: 8.89M]
  ------------------
  667|  2.35k|        case 'f': buf[outpos++] = '\f'; break;
  ------------------
  |  Branch (667:9): [True: 2.35k, False: 8.89M]
  ------------------
  668|    274|        case 'r': buf[outpos++] = '\r'; break;
  ------------------
  |  Branch (668:9): [True: 274, False: 8.89M]
  ------------------
  669|  89.2k|        case 'n': buf[outpos++] = '\n'; break;
  ------------------
  |  Branch (669:9): [True: 89.2k, False: 8.80M]
  ------------------
  670|    224|        case 't': buf[outpos++] = '\t'; break;
  ------------------
  |  Branch (670:9): [True: 224, False: 8.89M]
  ------------------
  671|  6.62M|        default:  buf[outpos++] = (char)c; break;
  ------------------
  |  Branch (671:9): [True: 6.62M, False: 2.27M]
  ------------------
  672|  2.18M|        case 'u': {
  ------------------
  |  Branch (672:9): [True: 2.18M, False: 6.71M]
  ------------------
  673|       |            // Parse a unicode code point
  674|  2.18M|            if(pos + 4 >= end) {
  ------------------
  |  Branch (674:16): [True: 9, False: 2.18M]
  ------------------
  675|      9|                error = CJ5_ERROR_INCOMPLETE;
  676|      9|                goto done;
  677|      9|            }
  678|  2.18M|            pos++;
  679|  2.18M|            uint32_t utf;
  680|  2.18M|            error = parse_codepoint(pos, &utf);
  681|  2.18M|            if(error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (681:16): [True: 13, False: 2.18M]
  ------------------
  682|     13|                goto done;
  683|  2.18M|            pos += 3;
  684|       |
  685|       |            // Parse a surrogate pair
  686|  2.18M|            if(0xd800 <= utf && utf <= 0xdfff) {
  ------------------
  |  Branch (686:16): [True: 622, False: 2.18M]
  |  Branch (686:33): [True: 408, False: 214]
  ------------------
  687|    408|                if(pos + 6 >= end) {
  ------------------
  |  Branch (687:20): [True: 4, False: 404]
  ------------------
  688|      4|                    error = CJ5_ERROR_INVALID;
  689|      4|                    goto done;
  690|      4|                }
  691|    404|                if(pos[1] != '\\' || pos[2] != 'u') {
  ------------------
  |  Branch (691:20): [True: 5, False: 399]
  |  Branch (691:38): [True: 11, False: 388]
  ------------------
  692|     16|                    error = CJ5_ERROR_INVALID;
  693|     16|                    goto done;
  694|     16|                }
  695|    388|                pos += 3;
  696|    388|                uint32_t utf2;
  697|    388|                error = parse_codepoint(pos, &utf2);
  698|    388|                if(error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (698:20): [True: 15, False: 373]
  ------------------
  699|     15|                    goto done;
  700|    373|                pos += 3;
  701|       |                // High or low surrogate pair
  702|    373|                utf = (utf <= 0xdbff) ?
  ------------------
  |  Branch (702:23): [True: 114, False: 259]
  ------------------
  703|    114|                    (utf << 10) + utf2 + SURROGATE_OFFSET :
  704|    373|                    (utf2 << 10) + utf + SURROGATE_OFFSET;
  705|    373|            }
  706|       |
  707|       |            // Write the utf8 bytes of the code point
  708|  2.18M|            unsigned len = utf8_from_codepoint((unsigned char*)buf + outpos, utf);
  709|  2.18M|            if(len == 0) {
  ------------------
  |  Branch (709:16): [True: 40, False: 2.18M]
  ------------------
  710|     40|                error = CJ5_ERROR_INVALID; // Not a utf8 string
  711|     40|                goto done;
  712|     40|            }
  713|  2.18M|            outpos += len;
  714|  2.18M|            break;
  715|  2.18M|        }
  716|  8.89M|        }
  717|  8.89M|    }
  718|       |
  719|   125k| done:
  720|       |    // Always leave buf as a valid, NUL-terminated string, even when decoding
  721|       |    // fails midway. Callers still must check the returned error code.
  722|   125k|    buf[outpos] = 0;
  723|       |
  724|       |    // Set the output length
  725|   125k|    if(buflen)
  ------------------
  |  Branch (725:8): [True: 125k, False: 0]
  ------------------
  726|   125k|        *buflen = outpos;
  727|   125k|    return error;
  728|   125k|}
cj5.c:cj5__skip_comment:
  261|  12.8k|cj5__skip_comment(cj5__parser* parser) {
  262|  12.8k|    const char* json5 = parser->json5;
  263|       |
  264|       |    // Single-line comment
  265|  12.8k|    if(json5[parser->pos] == '#') {
  ------------------
  |  Branch (265:8): [True: 682, False: 12.1k]
  ------------------
  266|  12.1k|    skip_line:
  267|  4.88M|        while(parser->pos < parser->len) {
  ------------------
  |  Branch (267:15): [True: 4.88M, False: 106]
  ------------------
  268|  4.88M|            if(json5[parser->pos] == '\n') {
  ------------------
  |  Branch (268:16): [True: 12.0k, False: 4.87M]
  ------------------
  269|  12.0k|                parser->pos--; // Reparse the newline in the main parse loop
  270|  12.0k|                return;
  271|  12.0k|            }
  272|  4.87M|            parser->pos++;
  273|  4.87M|        }
  274|    106|        return;
  275|  12.1k|    }
  276|       |
  277|       |    // Comment begins with '/' but not enough space for another character
  278|  12.1k|    if(parser->pos + 1 >= parser->len) {
  ------------------
  |  Branch (278:8): [True: 31, False: 12.1k]
  ------------------
  279|     31|        parser->error = CJ5_ERROR_INVALID;
  280|     31|        return;
  281|     31|    }
  282|  12.1k|    parser->pos++;
  283|       |
  284|       |    // Comment begins with '//' -> single-line comment
  285|  12.1k|    if(json5[parser->pos] == '/')
  ------------------
  |  Branch (285:8): [True: 11.4k, False: 676]
  ------------------
  286|  11.4k|        goto skip_line;
  287|       |
  288|       |    // Multi-line comments begin with '/*' and end with '*/'
  289|    676|    if(json5[parser->pos] == '*') {
  ------------------
  |  Branch (289:8): [True: 639, False: 37]
  ------------------
  290|    639|        parser->pos++;
  291|  1.38M|        for(; parser->pos + 1 < parser->len; parser->pos++) {
  ------------------
  |  Branch (291:15): [True: 1.38M, False: 95]
  ------------------
  292|  1.38M|            if(json5[parser->pos] == '*' && json5[parser->pos + 1] == '/') {
  ------------------
  |  Branch (292:16): [True: 951, False: 1.38M]
  |  Branch (292:45): [True: 544, False: 407]
  ------------------
  293|    544|                parser->pos++;
  294|    544|                return;
  295|    544|            }
  296|  1.38M|        }
  297|    639|    }
  298|       |
  299|       |    // Unknown comment type or the multi-line comment is not terminated
  300|    132|    parser->error = CJ5_ERROR_INCOMPLETE;
  301|    132|}
cj5.c:cj5__alloc_token:
   89|  41.0M|cj5__alloc_token(cj5__parser *parser) {
   90|  41.0M|    cj5_token* token = NULL;
   91|  41.0M|    if(parser->token_count < parser->max_tokens) {
  ------------------
  |  Branch (91:8): [True: 20.0M, False: 20.9M]
  ------------------
   92|  20.0M|        token = &parser->tokens[parser->token_count];
   93|  20.0M|        memset(token, 0x0, sizeof(cj5_token));
   94|  20.9M|    } else {
   95|  20.9M|        parser->error = CJ5_ERROR_OVERFLOW;
   96|  20.9M|    }
   97|       |
   98|       |    // Always increase the index. So we know eventually how many token would be
   99|       |    // required (if there are not enough).
  100|  41.0M|    parser->token_count++;
  101|  41.0M|    return token;
  102|  41.0M|}
cj5.c:cj5__parse_primitive:
  153|  36.8M|cj5__parse_primitive(cj5__parser* parser) {
  154|  36.8M|    const char* json5 = parser->json5;
  155|  36.8M|    unsigned int len = parser->len;
  156|  36.8M|    unsigned int start = parser->pos;
  157|       |
  158|       |    // String value
  159|  36.8M|    if(json5[start] == '\"' ||
  ------------------
  |  Branch (159:8): [True: 4.91M, False: 31.9M]
  ------------------
  160|  31.9M|       json5[start] == '\'') {
  ------------------
  |  Branch (160:8): [True: 170k, False: 31.7M]
  ------------------
  161|  5.08M|        cj5__parse_string(parser);
  162|  5.08M|        return;
  163|  5.08M|    }
  164|       |
  165|       |    // Fast comparison of bool, and null.
  166|       |    // Make the comparison case-insensitive.
  167|  31.7M|    uint32_t fourcc = 0;
  168|  31.7M|    if(start + 3 < len) {
  ------------------
  |  Branch (168:8): [True: 31.7M, False: 4.72k]
  ------------------
  169|  31.7M|        fourcc += (unsigned char)json5[start] | 32U;
  170|  31.7M|        fourcc += ((unsigned char)json5[start+1] | 32U) << 8;
  171|  31.7M|        fourcc += ((unsigned char)json5[start+2] | 32U) << 16;
  172|  31.7M|        fourcc += ((unsigned char)json5[start+3] | 32U) << 24;
  173|  31.7M|    }
  174|       |    
  175|  31.7M|    cj5_token_type type;
  176|  31.7M|    if(fourcc == CJ5__NULL_FOURCC) {
  ------------------
  |  Branch (176:8): [True: 72.7k, False: 31.6M]
  ------------------
  177|  72.7k|        type = CJ5_TOKEN_NULL;
  178|  72.7k|        parser->pos += 3;
  179|  31.6M|    } else if(fourcc == CJ5__TRUE_FOURCC) {
  ------------------
  |  Branch (179:15): [True: 425, False: 31.6M]
  ------------------
  180|    425|        type = CJ5_TOKEN_BOOL;
  181|    425|        parser->pos += 3;
  182|  31.6M|    } else if(fourcc == CJ5__FALSE_FOURCC) {
  ------------------
  |  Branch (182:15): [True: 7.10k, False: 31.6M]
  ------------------
  183|       |        // "false" has five characters
  184|  7.10k|        type = CJ5_TOKEN_BOOL;
  185|  7.10k|        if(start + 4 >= len || (json5[start+4] | 32) != 'e') {
  ------------------
  |  Branch (185:12): [True: 1, False: 7.10k]
  |  Branch (185:32): [True: 10, False: 7.09k]
  ------------------
  186|     11|            parser->error = CJ5_ERROR_INVALID;
  187|     11|            return;
  188|     11|        }
  189|  7.09k|        parser->pos += 4;
  190|  31.6M|    } else {
  191|       |        // Numbers are checked for basic compatibility.
  192|       |        // But they are fully parsed only in the cj5_get_XXX functions.
  193|  31.6M|        type = CJ5_TOKEN_NUMBER;
  194|   122M|        for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (194:15): [True: 122M, False: 3.40k]
  ------------------
  195|   122M|            if(!cj5__isnum(json5[parser->pos]) &&
  ------------------
  |  |   86|   244M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  ------------------
  |  Branch (195:16): [True: 43.2M, False: 78.8M]
  ------------------
  196|  43.2M|               !(json5[parser->pos] == '.') &&
  ------------------
  |  Branch (196:16): [True: 34.9M, False: 8.32M]
  ------------------
  197|  34.9M|               !cj5__islowerchar(json5[parser->pos]) && 
  ------------------
  |  |   85|   157M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  ------------------
  |  Branch (197:16): [True: 32.4M, False: 2.48M]
  ------------------
  198|  32.4M|               !cj5__isupperchar(json5[parser->pos]) &&
  ------------------
  |  |   84|   154M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  ------------------
  |  Branch (198:16): [True: 32.0M, False: 358k]
  ------------------
  199|  32.0M|               !(json5[parser->pos] == '+') && !(json5[parser->pos] == '-')) {
  ------------------
  |  Branch (199:16): [True: 32.0M, False: 9.27k]
  |  Branch (199:48): [True: 31.6M, False: 402k]
  ------------------
  200|  31.6M|                break;
  201|  31.6M|            }
  202|   122M|        }
  203|  31.6M|        parser->pos--; // Point to the last character that is still inside the
  204|       |                       // primitive value
  205|  31.6M|    }
  206|       |
  207|  31.7M|    cj5_token *token = cj5__alloc_token(parser);
  208|  31.7M|    if(token) {
  ------------------
  |  Branch (208:8): [True: 15.3M, False: 16.3M]
  ------------------
  209|  15.3M|        token->type = type;
  210|  15.3M|        token->start = start;
  211|  15.3M|        token->end = parser->pos;
  212|  15.3M|        token->size = parser->pos - start + 1;
  213|  15.3M|        token->parent_id = parser->curr_tok_idx;
  214|  15.3M|    }
  215|  31.7M|}
cj5.c:cj5__parse_string:
  105|  5.28M|cj5__parse_string(cj5__parser *parser) {
  106|  5.28M|    const char *json5 = parser->json5;
  107|  5.28M|    unsigned int len = parser->len;
  108|  5.28M|    unsigned int start = parser->pos;
  109|  5.28M|    char str_open = json5[start];
  110|       |
  111|  5.28M|    parser->pos++;
  112|  92.0M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (112:11): [True: 92.0M, False: 117]
  ------------------
  113|  92.0M|        char c = json5[parser->pos];
  114|       |
  115|       |        // End of string
  116|  92.0M|        if(str_open == c) {
  ------------------
  |  Branch (116:12): [True: 5.28M, False: 86.7M]
  ------------------
  117|  5.28M|            cj5_token *token = cj5__alloc_token(parser);
  118|  5.28M|            if(token) {
  ------------------
  |  Branch (118:16): [True: 2.68M, False: 2.60M]
  ------------------
  119|  2.68M|                token->type = CJ5_TOKEN_STRING;
  120|  2.68M|                token->start = start + 1;
  121|  2.68M|                token->end = parser->pos - 1;
  122|  2.68M|                token->size = token->end - token->start + 1;
  123|  2.68M|                token->parent_id = parser->curr_tok_idx;
  124|  2.68M|            } 
  125|  5.28M|            return;
  126|  5.28M|        }
  127|       |
  128|       |        // Unescaped newlines are forbidden
  129|  86.7M|        if(c == '\n') {
  ------------------
  |  Branch (129:12): [True: 3, False: 86.7M]
  ------------------
  130|      3|            parser->error = CJ5_ERROR_INVALID;
  131|      3|            return;
  132|      3|        }
  133|       |
  134|       |        // Skip escape character
  135|  86.7M|        if(c == '\\') {
  ------------------
  |  Branch (135:12): [True: 11.1M, False: 75.5M]
  ------------------
  136|  11.1M|            if(parser->pos + 1 >= len) {
  ------------------
  |  Branch (136:16): [True: 3, False: 11.1M]
  ------------------
  137|      3|                parser->error = CJ5_ERROR_INCOMPLETE;
  138|      3|                return;
  139|      3|            }
  140|  11.1M|            parser->pos++;
  141|  11.1M|        }
  142|  86.7M|    }
  143|       |
  144|       |    // The file has ended before the string terminates
  145|    117|    parser->error = CJ5_ERROR_INCOMPLETE;
  146|    117|}
cj5.c:cj5__isrange:
   80|   215M|cj5__isrange(char ch, char from, char to) {
   81|   215M|    return (uint8_t)(ch - from) <= (uint8_t)(to - from);
   82|   215M|}
cj5.c:cj5__parse_key:
  218|  1.20M|cj5__parse_key(cj5__parser* parser) {
  219|  1.20M|    const char* json5 = parser->json5;
  220|  1.20M|    unsigned int start = parser->pos;
  221|  1.20M|    cj5_token* token;
  222|       |
  223|       |    // Key is a a normal string
  224|  1.20M|    if(json5[start] == '\"' || json5[start] == '\'') {
  ------------------
  |  Branch (224:8): [True: 203k, False: 1.00M]
  |  Branch (224:32): [True: 1.60k, False: 999k]
  ------------------
  225|   205k|        cj5__parse_string(parser);
  226|   205k|        return;
  227|   205k|    }
  228|       |
  229|       |    // An unquoted key. Must start with a-ZA-Z_$. Can contain numbers later on.
  230|   999k|    unsigned int len = parser->len;
  231|  7.81M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (231:11): [True: 7.81M, False: 69]
  ------------------
  232|  7.81M|        if(cj5__islowerchar(json5[parser->pos]) ||
  ------------------
  |  |   85|  15.6M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 3.13M, False: 4.68M]
  |  |  ------------------
  ------------------
  233|  4.68M|           cj5__isupperchar(json5[parser->pos]) ||
  ------------------
  |  |   84|  12.4M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  |  |  ------------------
  |  |  |  Branch (84:30): [True: 1.73M, False: 2.95M]
  |  |  ------------------
  ------------------
  234|  2.95M|           json5[parser->pos] == '_' || json5[parser->pos] == '$')
  ------------------
  |  Branch (234:12): [True: 398k, False: 2.55M]
  |  Branch (234:41): [True: 1.74k, False: 2.54M]
  ------------------
  235|  5.26M|            continue;
  236|  2.54M|        if(cj5__isnum(json5[parser->pos]) && parser->pos != start)
  ------------------
  |  |   86|  5.09M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (86:30): [True: 1.55M, False: 999k]
  |  |  ------------------
  ------------------
  |  Branch (236:46): [True: 1.55M, False: 5]
  ------------------
  237|  1.55M|            continue;
  238|   999k|        break;
  239|  2.54M|    }
  240|       |
  241|       |    // An empty key is not allowed
  242|   999k|    if(parser->pos <= start) {
  ------------------
  |  Branch (242:8): [True: 105, False: 999k]
  ------------------
  243|    105|        parser->error = CJ5_ERROR_INVALID;
  244|    105|        return;
  245|    105|    }
  246|       |
  247|       |    // Move pos to the last character within the unquoted key
  248|   999k|    parser->pos--;
  249|       |
  250|   999k|    token = cj5__alloc_token(parser);
  251|   999k|    if(token) {
  ------------------
  |  Branch (251:8): [True: 448k, False: 550k]
  ------------------
  252|   448k|        token->type = CJ5_TOKEN_STRING;
  253|   448k|        token->start = start;
  254|   448k|        token->end = parser->pos;
  255|   448k|        token->size = parser->pos - start + 1;
  256|   448k|        token->parent_id = parser->curr_tok_idx;
  257|   448k|    }
  258|   999k|}
cj5.c:parse_codepoint:
  608|  2.18M|parse_codepoint(const char *pos, uint32_t *out_utf) {
  609|  2.18M|    uint32_t utf = 0;
  610|  10.9M|    for(unsigned int i = 0; i < 4; i++) {
  ------------------
  |  Branch (610:29): [True: 8.73M, False: 2.18M]
  ------------------
  611|  8.73M|        char byte = pos[i];
  612|  8.73M|        if(cj5__isnum(byte)) {
  ------------------
  |  |   86|  8.73M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (86:30): [True: 6.55M, False: 2.18M]
  |  |  ------------------
  ------------------
  613|  6.55M|            byte = (char)(byte - '0');
  614|  6.55M|        } else if(cj5__isrange(byte, 'a', 'f')) {
  ------------------
  |  Branch (614:19): [True: 2.18M, False: 2.56k]
  ------------------
  615|  2.18M|            byte = (char)(byte - ('a' - 10));
  616|  2.18M|        } else if(cj5__isrange(byte, 'A', 'F')) {
  ------------------
  |  Branch (616:19): [True: 2.53k, False: 28]
  ------------------
  617|  2.53k|            byte = (char)(byte - ('A' - 10));
  618|  2.53k|        } else {
  619|     28|            return CJ5_ERROR_INVALID;
  620|     28|        }
  621|  8.73M|        utf = (utf << 4) | ((uint8_t)byte & 0xF);
  622|  8.73M|    }
  623|  2.18M|    *out_utf = utf;
  624|  2.18M|    return CJ5_ERROR_NONE;
  625|  2.18M|}

dtoa:
  336|  8.92M|unsigned dtoa(double d, char* buffer) {
  337|  8.92M|    uint64_t bits = 0;
  338|  8.92M|    memcpy(&bits, &d, sizeof(double));
  339|       |
  340|  8.92M|    uint64_t mantissa = bits & ((1ull << mantissa_bits) - 1);
  ------------------
  |  |   33|  8.92M|#define mantissa_bits 52
  ------------------
  341|  8.92M|    uint32_t exponent = (uint32_t)
  342|  8.92M|        ((bits >> mantissa_bits) & ((1u << exponent_bits) - 1));
  ------------------
  |  |   33|  8.92M|#define mantissa_bits 52
  ------------------
                      ((bits >> mantissa_bits) & ((1u << exponent_bits) - 1));
  ------------------
  |  |   34|  8.92M|#define exponent_bits 11
  ------------------
  343|       |
  344|  8.92M|    if(exponent == 0 && mantissa == 0) {
  ------------------
  |  Branch (344:8): [True: 315k, False: 8.60M]
  |  Branch (344:25): [True: 183k, False: 131k]
  ------------------
  345|   183k|        memcpy(buffer, "0.0", 3);
  346|   183k|        return 3;
  347|   183k|    }
  348|       |
  349|  8.92M|    bool sign = ((bits >> (mantissa_bits + exponent_bits)) & 1) != 0;
  ------------------
  |  |   33|  8.73M|#define mantissa_bits 52
  ------------------
                  bool sign = ((bits >> (mantissa_bits + exponent_bits)) & 1) != 0;
  ------------------
  |  |   34|  8.73M|#define exponent_bits 11
  ------------------
  350|  8.73M|    unsigned pos = 0;
  351|  8.73M|    if(sign) {
  ------------------
  |  Branch (351:8): [True: 19.9k, False: 8.71M]
  ------------------
  352|  19.9k|        buffer[0] = '-';
  353|  19.9k|        pos++;
  354|  19.9k|    }
  355|       |
  356|  8.73M|    if(exponent == ((1u << exponent_bits) - 1u)) {
  ------------------
  |  |   34|  8.73M|#define exponent_bits 11
  ------------------
  |  Branch (356:8): [True: 0, False: 8.73M]
  ------------------
  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|  8.73M|    int K = 0;
  367|  8.73M|    char digits[18];
  368|  8.73M|    memset(digits, 0, 18);
  369|  8.73M|    unsigned ndigits = grisu2(bits, digits, &K);
  370|  8.73M|    return pos + emit_digits(digits, ndigits, &buffer[pos], K, sign);
  371|  8.73M|}
dtoa.c:grisu2:
  255|  8.73M|static unsigned grisu2(uint64_t bits, char* digits, int* K) {
  256|  8.73M|    Fp w = build_fp(bits);
  257|  8.73M|    Fp lower, upper;
  258|  8.73M|    get_normalized_boundaries(&w, &lower, &upper);
  259|  8.73M|    normalize(&w);
  260|  8.73M|    int k;
  261|  8.73M|    Fp cp = find_cachedpow10(upper.exp, &k);
  262|  8.73M|    w     = multiply(&w,     &cp);
  263|  8.73M|    upper = multiply(&upper, &cp);
  264|  8.73M|    lower = multiply(&lower, &cp);
  265|  8.73M|    lower.frac++;
  266|  8.73M|    upper.frac--;
  267|  8.73M|    *K = -k;
  268|  8.73M|    return generate_digits(&w, &upper, &lower, digits, K);
  269|  8.73M|}
dtoa.c:build_fp:
  132|  8.73M|static Fp build_fp(uint64_t bits) {
  133|  8.73M|    Fp fp;
  134|  8.73M|    fp.frac = bits & fracmask;
  ------------------
  |  |   35|  8.73M|#define fracmask  0x000FFFFFFFFFFFFFU
  ------------------
  135|  8.73M|    fp.exp = (bits & expmask) >> 52;
  ------------------
  |  |   36|  8.73M|#define expmask   0x7FF0000000000000U
  ------------------
  136|  8.73M|    if(fp.exp) {
  ------------------
  |  Branch (136:8): [True: 8.60M, False: 131k]
  ------------------
  137|  8.60M|        fp.frac += hiddenbit;
  ------------------
  |  |   37|  8.60M|#define hiddenbit 0x0010000000000000U
  ------------------
  138|  8.60M|        fp.exp -= expbias;
  ------------------
  |  |   39|  8.60M|#define expbias   (1023 + 52)
  ------------------
  139|  8.60M|    } else {
  140|   131k|        fp.exp = -expbias + 1;
  ------------------
  |  |   39|   131k|#define expbias   (1023 + 52)
  ------------------
  141|   131k|    }
  142|  8.73M|    return fp;
  143|  8.73M|}
dtoa.c:get_normalized_boundaries:
  155|  8.73M|static void get_normalized_boundaries(Fp* fp, Fp* lower, Fp* upper) {
  156|  8.73M|    upper->frac = (fp->frac << 1) + 1;
  157|  8.73M|    upper->exp  = fp->exp - 1;
  158|  12.0M|    while ((upper->frac & (hiddenbit << 1)) == 0) {
  ------------------
  |  |   37|  12.0M|#define hiddenbit 0x0010000000000000U
  ------------------
  |  Branch (158:12): [True: 3.26M, False: 8.73M]
  ------------------
  159|  3.26M|        upper->frac <<= 1;
  160|  3.26M|        upper->exp--;
  161|  3.26M|    }
  162|       |
  163|  8.73M|    int u_shift = 64 - 52 - 2;
  164|  8.73M|    upper->frac <<= u_shift;
  165|  8.73M|    upper->exp = upper->exp - u_shift;
  166|       |
  167|  8.73M|    int l_shift = fp->frac == hiddenbit ? 2 : 1;
  ------------------
  |  |   37|  8.73M|#define hiddenbit 0x0010000000000000U
  ------------------
  |  Branch (167:19): [True: 594k, False: 8.14M]
  ------------------
  168|  8.73M|    lower->frac = (fp->frac << l_shift) - 1;
  169|  8.73M|    lower->exp = fp->exp - l_shift;
  170|  8.73M|    lower->frac <<= lower->exp - upper->exp;
  171|  8.73M|    lower->exp = upper->exp;
  172|  8.73M|}
dtoa.c:normalize:
  145|  8.73M|static void normalize(Fp* fp) {
  146|  12.0M|    while((fp->frac & hiddenbit) == 0) {
  ------------------
  |  |   37|  12.0M|#define hiddenbit 0x0010000000000000U
  ------------------
  |  Branch (146:11): [True: 3.26M, False: 8.73M]
  ------------------
  147|  3.26M|        fp->frac <<= 1;
  148|  3.26M|        fp->exp--;
  149|  3.26M|    }
  150|  8.73M|    int shift = 64 - 52 - 1;
  151|  8.73M|    fp->frac <<= shift;
  152|  8.73M|    fp->exp -= shift;
  153|  8.73M|}
dtoa.c:find_cachedpow10:
  113|  8.73M|find_cachedpow10(int exp, int* k) {
  114|  8.73M|    const double one_log_ten = 0.30102999566398114;
  115|  8.73M|    int approx = (int)(-(exp + npowers) * one_log_ten);
  ------------------
  |  |   54|  8.73M|#define npowers     87
  ------------------
  116|  8.73M|    int idx = (approx - firstpower) / steppowers;
  ------------------
  |  |   56|  8.73M|#define firstpower -348 /* 10 ^ -348 */
  ------------------
                  int idx = (approx - firstpower) / steppowers;
  ------------------
  |  |   55|  8.73M|#define steppowers  8
  ------------------
  117|  26.1M|    while(1) {
  ------------------
  |  Branch (117:11): [True: 26.1M, Folded]
  ------------------
  118|  26.1M|        int current = exp + powers_ten[idx].exp + 64;
  119|  26.1M|        if(current < expmin) {
  ------------------
  |  |   58|  26.1M|#define expmin     -60
  ------------------
  |  Branch (119:12): [True: 17.4M, False: 8.73M]
  ------------------
  120|  17.4M|            idx++;
  121|  17.4M|            continue;
  122|  17.4M|        }
  123|  8.73M|        if(current > expmax) {
  ------------------
  |  |   57|  8.73M|#define expmax     -32
  ------------------
  |  Branch (123:12): [True: 0, False: 8.73M]
  ------------------
  124|      0|            idx--;
  125|      0|            continue;
  126|      0|        }
  127|  8.73M|        *k = (firstpower + idx * steppowers);
  ------------------
  |  |   56|  8.73M|#define firstpower -348 /* 10 ^ -348 */
  ------------------
                      *k = (firstpower + idx * steppowers);
  ------------------
  |  |   55|  8.73M|#define steppowers  8
  ------------------
  128|  8.73M|        return powers_ten[idx];
  129|  8.73M|    }
  130|  8.73M|}
dtoa.c:multiply:
  174|  26.2M|static Fp multiply(Fp* a, Fp* b) {
  175|  26.2M|    const uint64_t lomask = 0x00000000FFFFFFFF;
  176|  26.2M|    uint64_t ah_bl = (a->frac >> 32)    * (b->frac & lomask);
  177|  26.2M|    uint64_t al_bh = (a->frac & lomask) * (b->frac >> 32);
  178|  26.2M|    uint64_t al_bl = (a->frac & lomask) * (b->frac & lomask);
  179|  26.2M|    uint64_t ah_bh = (a->frac >> 32)    * (b->frac >> 32);
  180|  26.2M|    uint64_t tmp = (ah_bl & lomask) + (al_bh & lomask) + (al_bl >> 32); 
  181|       |    /* round up */
  182|  26.2M|    tmp += 1U << 31;
  183|  26.2M|    Fp fp;
  184|  26.2M|    fp.frac = ah_bh + (ah_bl >> 32) + (al_bh >> 32) + (tmp >> 32);
  185|  26.2M|    fp.exp = a->exp + b->exp + 64;
  186|  26.2M|    return fp;
  187|  26.2M|}
dtoa.c:generate_digits:
  198|  8.73M|static unsigned generate_digits(Fp* fp, Fp* upper, Fp* lower, char* digits, int* K) {
  199|  8.73M|    uint64_t wfrac = upper->frac - fp->frac;
  200|  8.73M|    uint64_t delta = upper->frac - lower->frac;
  201|       |
  202|  8.73M|    Fp one;
  203|  8.73M|    one.frac = 1ULL << -upper->exp;
  204|  8.73M|    one.exp  = upper->exp;
  205|       |
  206|  8.73M|    uint64_t part1 = upper->frac >> -one.exp;
  207|  8.73M|    uint64_t part2 = upper->frac & (one.frac - 1);
  208|       |
  209|  8.73M|    unsigned idx = 0;
  210|  8.73M|    int kappa = 10;
  211|  8.73M|    uint64_t* divp;
  212|       |
  213|       |    /* 1000000000 */
  214|  68.3M|    for(divp = tens + 10; kappa > 0; divp++) {
  ------------------
  |  Branch (214:27): [True: 65.3M, False: 3.08M]
  ------------------
  215|  65.3M|        uint64_t div = *divp;
  216|  65.3M|        uint64_t digit = part1 / div;
  217|  65.3M|        if(digit || idx) {
  ------------------
  |  Branch (217:12): [True: 14.1M, False: 51.1M]
  |  Branch (217:21): [True: 7.46M, False: 43.7M]
  ------------------
  218|  21.5M|            digits[idx++] = (char)(digit + '0');
  219|  21.5M|        }
  220|       |
  221|  65.3M|        part1 -= digit * div;
  222|  65.3M|        kappa--;
  223|       |
  224|  65.3M|        uint64_t tmp = (part1 <<-one.exp) + part2;
  225|  65.3M|        if(tmp <= delta) {
  ------------------
  |  Branch (225:12): [True: 5.65M, False: 59.6M]
  ------------------
  226|  5.65M|            *K += kappa;
  227|  5.65M|            round_digit(digits, idx, delta, tmp, div << -one.exp, wfrac);
  228|  5.65M|            return idx;
  229|  5.65M|        }
  230|  65.3M|    }
  231|       |
  232|       |    /* 10 */
  233|  3.08M|    uint64_t* unit = tens + 18;
  234|  35.8M|    while(true) {
  ------------------
  |  Branch (234:11): [True: 35.8M, Folded]
  ------------------
  235|  35.8M|        part2 *= 10;
  236|  35.8M|        delta *= 10;
  237|  35.8M|        kappa--;
  238|       |
  239|  35.8M|        uint64_t digit = part2 >> -one.exp;
  240|  35.8M|        if(digit || idx) {
  ------------------
  |  Branch (240:12): [True: 27.3M, False: 8.48M]
  |  Branch (240:21): [True: 8.48M, False: 0]
  ------------------
  241|  35.8M|            digits[idx++] = (char)(digit + '0');
  242|  35.8M|        }
  243|       |
  244|  35.8M|        part2 &= one.frac - 1;
  245|  35.8M|        if(part2 < delta) {
  ------------------
  |  Branch (245:12): [True: 3.08M, False: 32.7M]
  ------------------
  246|  3.08M|            *K += kappa;
  247|  3.08M|            round_digit(digits, idx, delta, part2, one.frac, wfrac * *unit);
  248|  3.08M|            break;
  249|  3.08M|        }
  250|  32.7M|        unit--;
  251|  32.7M|    }
  252|  3.08M|    return idx;
  253|  8.73M|}
dtoa.c:round_digit:
  190|  8.73M|                        uint64_t rem, uint64_t kappa, uint64_t frac) {
  191|  10.9M|    while(rem < frac && delta - rem >= kappa &&
  ------------------
  |  Branch (191:11): [True: 3.68M, False: 7.30M]
  |  Branch (191:25): [True: 2.92M, False: 764k]
  ------------------
  192|  2.92M|          (rem + kappa < frac || frac - rem > rem + kappa - frac)) {
  ------------------
  |  Branch (192:12): [True: 684k, False: 2.23M]
  |  Branch (192:34): [True: 1.56M, False: 672k]
  ------------------
  193|  2.24M|        digits[ndigits - 1]--;
  194|  2.24M|        rem += kappa;
  195|  2.24M|    }
  196|  8.73M|}
dtoa.c:emit_digits:
  272|  8.73M|emit_digits(char* digits, unsigned ndigits, char* dest, int K, bool neg) {
  273|  8.73M|    int exp = absv(K + (int)ndigits - 1);
  ------------------
  |  |   41|  8.73M|#define absv(n) ((n) < 0 ? -(n) : (n))
  |  |  ------------------
  |  |  |  Branch (41:18): [True: 873k, False: 7.86M]
  |  |  ------------------
  ------------------
  274|       |
  275|       |    /* write plain integer */
  276|  8.73M|    if(K >= 0 && (exp < (int)ndigits + 7)) {
  ------------------
  |  Branch (276:8): [True: 5.21M, False: 3.52M]
  |  Branch (276:18): [True: 5.19M, False: 14.9k]
  ------------------
  277|  5.19M|        memcpy(dest, digits, ndigits);
  278|  5.19M|        memset(dest + ndigits, '0', (unsigned)K);
  279|  5.19M|        memcpy(dest + ndigits + (unsigned)K, ".0", 2); /* always append .0 for naked integers */
  280|  5.19M|        return (unsigned)(ndigits + (unsigned)K + 2);
  281|  5.19M|    }
  282|       |
  283|       |    /* write decimal w/o scientific notation */
  284|  3.53M|    if(K < 0 && (K > -7 || exp < 4)) {
  ------------------
  |  Branch (284:8): [True: 3.52M, False: 14.9k]
  |  Branch (284:18): [True: 456k, False: 3.06M]
  |  Branch (284:28): [True: 2.82M, False: 239k]
  ------------------
  285|  3.28M|        int offset = (int)ndigits - absv(K);
  ------------------
  |  |   41|  3.28M|#define absv(n) ((n) < 0 ? -(n) : (n))
  |  |  ------------------
  |  |  |  Branch (41:18): [True: 3.28M, False: 0]
  |  |  ------------------
  ------------------
  286|  3.28M|        if(offset <= 0) {
  ------------------
  |  Branch (286:12): [True: 633k, False: 2.65M]
  ------------------
  287|       |            /* fp < 1.0 -> write leading zero */
  288|   633k|            offset = -offset;
  289|   633k|            dest[0] = '0';
  290|   633k|            dest[1] = '.';
  291|   633k|            memset(dest + 2, '0', (size_t)offset);
  292|   633k|            memcpy(dest + offset + 2, digits, ndigits);
  293|   633k|            return ndigits + 2 + (unsigned)offset;
  294|  2.65M|        } else {
  295|       |            /* fp > 1.0 */
  296|  2.65M|            memcpy(dest, digits, (size_t)offset);
  297|  2.65M|            dest[offset] = '.';
  298|  2.65M|            memcpy(dest + offset + 1, digits + offset, ndigits - (unsigned)offset);
  299|  2.65M|            return ndigits + 1;
  300|  2.65M|        }
  301|  3.28M|    }
  302|       |
  303|       |    /* write decimal w/ scientific notation */
  304|   254k|    ndigits = minv(ndigits, (unsigned)(18 - neg));
  ------------------
  |  |   42|   254k|#define minv(a, b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 253k, False: 1.83k]
  |  |  ------------------
  ------------------
  305|   254k|    unsigned idx = 0;
  306|   254k|    dest[idx++] = digits[0];
  307|   254k|    if(ndigits > 1) {
  ------------------
  |  Branch (307:8): [True: 246k, False: 7.87k]
  ------------------
  308|   246k|        dest[idx++] = '.';
  309|   246k|        memcpy(dest + idx, digits + 1, ndigits - 1);
  310|   246k|        idx += ndigits - 1;
  311|   246k|    }
  312|       |
  313|   254k|    dest[idx++] = 'e';
  314|       |
  315|   254k|    char sign = K + (int)ndigits - 1 < 0 ? '-' : '+';
  ------------------
  |  Branch (315:17): [True: 239k, False: 14.9k]
  ------------------
  316|   254k|    dest[idx++] = sign;
  317|       |
  318|   254k|    int cent = 0;
  319|   254k|    if(exp > 99) {
  ------------------
  |  Branch (319:8): [True: 229k, False: 25.4k]
  ------------------
  320|   229k|        cent = exp / 100;
  321|   229k|        dest[idx++] = (char)(cent + '0');
  322|   229k|        exp -= cent * 100;
  323|   229k|    }
  324|   254k|    if(exp > 9) {
  ------------------
  |  Branch (324:8): [True: 155k, False: 99.1k]
  ------------------
  325|   155k|        int dec = exp / 10;
  326|   155k|        dest[idx++] = (char)(dec + '0');
  327|   155k|        exp -= dec * 10;
  328|       |
  329|   155k|    } else if(cent) {
  ------------------
  |  Branch (329:15): [True: 95.8k, False: 3.33k]
  ------------------
  330|  95.8k|        dest[idx++] = '0';
  331|  95.8k|    }
  332|   254k|    dest[idx++] = (char)(exp % 10 + '0');
  333|   254k|    return idx;
  334|  3.53M|}

itoaUnsigned:
   42|  4.37M|UA_UInt16 itoaUnsigned(UA_UInt64 value, char* buffer, UA_Byte base) {
   43|       |    /* consider absolute value of number */
   44|  4.37M|    UA_UInt64 n = value;
   45|       |
   46|  4.37M|    UA_UInt16 i = 0;
   47|  8.69M|    while (n) {
  ------------------
  |  Branch (47:12): [True: 4.32M, False: 4.37M]
  ------------------
   48|  4.32M|        UA_UInt64 r = n % base;
   49|       |
   50|  4.32M|        if (r >= 10)
  ------------------
  |  Branch (50:13): [True: 0, False: 4.32M]
  ------------------
   51|      0|            buffer[i++] = (char)(65 + (r - 10));
   52|  4.32M|        else
   53|  4.32M|            buffer[i++] = (char)(48 + r);
   54|       |
   55|  4.32M|        n = n / base;
   56|  4.32M|    }
   57|       |    /* if number is 0 */
   58|  4.37M|    if (i == 0)
  ------------------
  |  Branch (58:9): [True: 118k, False: 4.25M]
  ------------------
   59|   118k|        buffer[i++] = '0';
   60|       |
   61|  4.37M|    buffer[i] = '\0'; /* null terminate string */
   62|  4.37M|    i--;
   63|       |    /* reverse the string */
   64|  4.37M|    reverse(buffer, 0, i);
   65|  4.37M|    i++;
   66|  4.37M|    return i;
   67|  4.37M|}
itoaSigned:
   70|  6.94M|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|  6.94M|    UA_UInt64 n;
   74|  6.94M|    if(value == UA_INT64_MIN) {
  ------------------
  |  |  120|  6.94M|#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
  |  |  ------------------
  |  |  |  |  119|  6.94M|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  |  |  ------------------
  ------------------
  |  Branch (74:8): [True: 1.24k, False: 6.94M]
  ------------------
   75|  1.24k|        n = (UA_UInt64)UA_INT64_MAX + 1;
  ------------------
  |  |  119|  1.24k|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  ------------------
   76|  6.94M|    } else {
   77|  6.94M|        n = (UA_UInt64)value;
   78|  6.94M|        if(value < 0){
  ------------------
  |  Branch (78:12): [True: 2.83k, False: 6.93M]
  ------------------
   79|  2.83k|            n = (UA_UInt64)-value;
   80|  2.83k|        }
   81|  6.94M|    }
   82|       |
   83|  6.94M|    UA_UInt16 i = 0;
   84|  13.7M|    while(n) {
  ------------------
  |  Branch (84:11): [True: 6.84M, False: 6.94M]
  ------------------
   85|  6.84M|        UA_UInt64 r = n % 10;
   86|  6.84M|        buffer[i++] = (char)('0' + r);
   87|  6.84M|        n = n / 10;
   88|  6.84M|    }
   89|       |
   90|  6.94M|    if(i == 0)
  ------------------
  |  Branch (90:8): [True: 151k, False: 6.79M]
  ------------------
   91|   151k|        buffer[i++] = '0'; /* if number is 0 */
   92|  6.94M|    if(value < 0)
  ------------------
  |  Branch (92:8): [True: 4.08k, False: 6.93M]
  ------------------
   93|  4.08k|        buffer[i++] = '-';
   94|  6.94M|    buffer[i] = '\0'; /* null terminate string */
   95|  6.94M|    i--;
   96|  6.94M|    reverse(buffer, 0, i); /* reverse the string and return it */
   97|  6.94M|    i++;
   98|  6.94M|    return i;
   99|  6.94M|}
itoa.c:reverse:
   34|  11.3M|static char* reverse(char *buffer, UA_UInt16 i, UA_UInt16 j) {
   35|  11.4M|    while (i < j)
  ------------------
  |  Branch (35:12): [True: 93.7k, False: 11.3M]
  ------------------
   36|  93.7k|        swap(&buffer[i++], &buffer[j--]);
   37|       |
   38|  11.3M|    return buffer;
   39|  11.3M|}
itoa.c:swap:
   27|  93.7k|static void swap(char *x, char *y) {
   28|  93.7k|    char t = *x;
   29|  93.7k|    *x = *y;
   30|  93.7k|    *y = t;
   31|  93.7k|}

musl_secs_to_tm:
   15|    732|musl_secs_to_tm(long long t, struct musl_tm *tm) {
   16|    732|    long long days, secs, years;
   17|    732|    int remdays, remsecs, remyears;
   18|    732|    int qc_cycles, c_cycles, q_cycles;
   19|    732|    int months;
   20|    732|    int wday, yday, leap;
   21|    732|    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|    732|    if (t < INT_MIN * 31622400LL || t > INT_MAX * 31622400LL)
  ------------------
  |  Branch (24:9): [True: 0, False: 732]
  |  Branch (24:37): [True: 0, False: 732]
  ------------------
   25|      0|        return -1;
   26|       |
   27|    732|    secs = t - LEAPOCH;
  ------------------
  |  |    8|    732|#define LEAPOCH (946684800LL + 86400*(31+29))
  ------------------
   28|    732|    days = secs / 86400LL;
   29|    732|    remsecs = (int)(secs % 86400);
   30|    732|    if (remsecs < 0) {
  ------------------
  |  Branch (30:9): [True: 408, False: 324]
  ------------------
   31|    408|        remsecs += 86400;
   32|    408|        --days;
   33|    408|    }
   34|       |
   35|    732|    wday = (int)((3+days)%7);
   36|    732|    if (wday < 0) wday += 7;
  ------------------
  |  Branch (36:9): [True: 378, False: 354]
  ------------------
   37|       |
   38|    732|    qc_cycles = (int)(days / DAYS_PER_400Y);
  ------------------
  |  |   10|    732|#define DAYS_PER_400Y (365*400 + 97)
  ------------------
   39|    732|    remdays = (int)(days % DAYS_PER_400Y);
  ------------------
  |  |   10|    732|#define DAYS_PER_400Y (365*400 + 97)
  ------------------
   40|    732|    if (remdays < 0) {
  ------------------
  |  Branch (40:9): [True: 408, False: 324]
  ------------------
   41|    408|        remdays += DAYS_PER_400Y;
  ------------------
  |  |   10|    408|#define DAYS_PER_400Y (365*400 + 97)
  ------------------
   42|    408|        --qc_cycles;
   43|    408|    }
   44|       |
   45|    732|    c_cycles = remdays / DAYS_PER_100Y;
  ------------------
  |  |   11|    732|#define DAYS_PER_100Y (365*100 + 24)
  ------------------
   46|    732|    if (c_cycles == 4) --c_cycles;
  ------------------
  |  Branch (46:9): [True: 6, False: 726]
  ------------------
   47|    732|    remdays -= c_cycles * DAYS_PER_100Y;
  ------------------
  |  |   11|    732|#define DAYS_PER_100Y (365*100 + 24)
  ------------------
   48|       |
   49|    732|    q_cycles = remdays / DAYS_PER_4Y;
  ------------------
  |  |   12|    732|#define DAYS_PER_4Y   (365*4   + 1)
  ------------------
   50|    732|    if (q_cycles == 25) --q_cycles;
  ------------------
  |  Branch (50:9): [True: 0, False: 732]
  ------------------
   51|    732|    remdays -= q_cycles * DAYS_PER_4Y;
  ------------------
  |  |   12|    732|#define DAYS_PER_4Y   (365*4   + 1)
  ------------------
   52|       |
   53|    732|    remyears = remdays / 365;
   54|    732|    if (remyears == 4) --remyears;
  ------------------
  |  Branch (54:9): [True: 12, False: 720]
  ------------------
   55|    732|    remdays -= remyears * 365;
   56|       |
   57|    732|    leap = !remyears && (q_cycles || !c_cycles);
  ------------------
  |  Branch (57:12): [True: 198, False: 534]
  |  Branch (57:26): [True: 138, False: 60]
  |  Branch (57:38): [True: 6, False: 54]
  ------------------
   58|    732|    yday = remdays + 31 + 28 + leap;
   59|    732|    if (yday >= 365+leap) yday -= 365+leap;
  ------------------
  |  Branch (59:9): [True: 372, False: 360]
  ------------------
   60|       |
   61|    732|    years = remyears + 4*q_cycles + 100*c_cycles + 400LL*qc_cycles;
   62|       |
   63|  5.41k|    for (months=0; days_in_month[months] <= remdays; months++)
  ------------------
  |  Branch (63:20): [True: 4.68k, False: 732]
  ------------------
   64|  4.68k|        remdays -= days_in_month[months];
   65|       |
   66|    732|    if (months >= 10) {
  ------------------
  |  Branch (66:9): [True: 372, False: 360]
  ------------------
   67|    372|        months -= 12;
   68|    372|        years++;
   69|    372|    }
   70|       |
   71|    732|    if (years+100 > INT_MAX || years+100 < INT_MIN)
  ------------------
  |  Branch (71:9): [True: 0, False: 732]
  |  Branch (71:32): [True: 0, False: 732]
  ------------------
   72|      0|        return -1;
   73|       |
   74|    732|    tm->tm_year = (int)(years + 100);
   75|    732|    tm->tm_mon = months + 2;
   76|    732|    tm->tm_mday = remdays + 1;
   77|    732|    tm->tm_wday = wday;
   78|    732|    tm->tm_yday = yday;
   79|       |
   80|    732|    tm->tm_hour = remsecs / 3600;
   81|    732|    tm->tm_min = remsecs / 60 % 60;
   82|    732|    tm->tm_sec = remsecs % 60;
   83|       |
   84|    732|    return 0;
   85|    732|}
musl_tm_to_secs:
  149|    251|musl_tm_to_secs(const struct musl_tm *tm) {
  150|    251|    int is_leap;
  151|    251|    long long year = tm->tm_year;
  152|    251|    int month = tm->tm_mon;
  153|    251|    if (month >= 12 || month < 0) {
  ------------------
  |  Branch (153:9): [True: 0, False: 251]
  |  Branch (153:24): [True: 0, False: 251]
  ------------------
  154|      0|        int adj = month / 12;
  155|      0|        month %= 12;
  156|      0|        if (month < 0) {
  ------------------
  |  Branch (156:13): [True: 0, False: 0]
  ------------------
  157|      0|            adj--;
  158|      0|            month += 12;
  159|      0|        }
  160|      0|        year += adj;
  161|      0|    }
  162|    251|    long long t = musl_year_to_secs(year, &is_leap);
  163|    251|    t += musl_month_to_secs(month, is_leap);
  164|    251|    t += 86400LL * (tm->tm_mday-1);
  165|    251|    t += 3600LL * tm->tm_hour;
  166|    251|    t += 60LL * tm->tm_min;
  167|    251|    t += tm->tm_sec;
  168|    251|    return t;
  169|    251|}
libc_time.c:musl_year_to_secs:
  101|    251|musl_year_to_secs(const long long year, int *is_leap) {
  102|    251|    if (year-2ULL <= 136) {
  ------------------
  |  Branch (102:9): [True: 12, False: 239]
  ------------------
  103|     12|        int y = (int)year;
  104|     12|        int leaps = (y-68)>>2;
  105|     12|        if (!((y-68)&3)) {
  ------------------
  |  Branch (105:13): [True: 7, False: 5]
  ------------------
  106|      7|            leaps--;
  107|      7|            if (is_leap) *is_leap = 1;
  ------------------
  |  Branch (107:17): [True: 7, False: 0]
  ------------------
  108|      7|        } else if (is_leap) *is_leap = 0;
  ------------------
  |  Branch (108:20): [True: 5, False: 0]
  ------------------
  109|     12|        return 31536000*(y-70) + 86400*leaps;
  110|     12|    }
  111|       |
  112|    239|    int cycles, centuries, leaps, rem, dummy;
  113|       |
  114|    239|    if (!is_leap) is_leap = &dummy;
  ------------------
  |  Branch (114:9): [True: 0, False: 239]
  ------------------
  115|    239|    cycles = (int)((year-100) / 400);
  116|    239|    rem = (int)((year-100) % 400);
  117|    239|    if (rem < 0) {
  ------------------
  |  Branch (117:9): [True: 131, False: 108]
  ------------------
  118|    131|        cycles--;
  119|    131|        rem += 400;
  120|    131|    }
  121|    239|    if (!rem) {
  ------------------
  |  Branch (121:9): [True: 4, False: 235]
  ------------------
  122|      4|        *is_leap = 1;
  123|      4|        centuries = 0;
  124|      4|        leaps = 0;
  125|    235|    } else {
  126|    235|        if (rem >= 200) {
  ------------------
  |  Branch (126:13): [True: 121, False: 114]
  ------------------
  127|    121|            if (rem >= 300) centuries = 3, rem -= 300;
  ------------------
  |  Branch (127:17): [True: 76, False: 45]
  ------------------
  128|     45|            else centuries = 2, rem -= 200;
  129|    121|        } else {
  130|    114|            if (rem >= 100) centuries = 1, rem -= 100;
  ------------------
  |  Branch (130:17): [True: 67, False: 47]
  ------------------
  131|     47|            else centuries = 0;
  132|    114|        }
  133|    235|        if (!rem) {
  ------------------
  |  Branch (133:13): [True: 27, False: 208]
  ------------------
  134|     27|            *is_leap = 0;
  135|     27|            leaps = 0;
  136|    208|        } else {
  137|    208|            leaps = rem / 4;
  138|    208|            rem %= 4;
  139|    208|            *is_leap = !rem;
  140|    208|        }
  141|    235|    }
  142|       |
  143|    239|    leaps += 97*cycles + 24*centuries - *is_leap;
  144|       |
  145|    239|    return (year-100) * 31536000LL + leaps * 86400LL + 946684800 + 86400;
  146|    251|}
libc_time.c:musl_month_to_secs:
   93|    251|musl_month_to_secs(int month, int is_leap) {
   94|    251|    int t = secs_through_month[month];
   95|    251|    if (is_leap && month >= 2)
  ------------------
  |  Branch (95:9): [True: 46, False: 205]
  |  Branch (95:20): [True: 21, False: 25]
  ------------------
   96|     21|        t+=86400;
   97|    251|    return t;
   98|    251|}

parseUInt64:
   30|  8.33M|parseUInt64(const char *str, size_t size, uint64_t *result) {
   31|  8.33M|    size_t i = 0;
   32|  8.33M|    uint64_t n = 0, prev = 0;
   33|       |
   34|       |    /* Hex */
   35|  8.33M|    if(size > 2 && str[0] == '0' && (str[1] | 32) == 'x') {
  ------------------
  |  Branch (35:8): [True: 8.65k, False: 8.32M]
  |  Branch (35:20): [True: 2.97k, False: 5.68k]
  |  Branch (35:37): [True: 1.11k, False: 1.85k]
  ------------------
   36|  1.11k|        i = 2;
   37|  57.1k|        for(; i < size; i++) {
  ------------------
  |  Branch (37:15): [True: 56.1k, False: 1.06k]
  ------------------
   38|  56.1k|            uint8_t c = (uint8_t)str[i] | 32;
   39|  56.1k|            if(c >= '0' && c <= '9')
  ------------------
  |  Branch (39:16): [True: 56.0k, False: 9]
  |  Branch (39:28): [True: 31.3k, False: 24.7k]
  ------------------
   40|  31.3k|                c = (uint8_t)(c - '0');
   41|  24.7k|            else if(c >= 'a' && c <='f')
  ------------------
  |  Branch (41:21): [True: 24.7k, False: 11]
  |  Branch (41:33): [True: 24.6k, False: 36]
  ------------------
   42|  24.6k|                c = (uint8_t)(c - 'a' + 10);
   43|     47|            else if(c >= 'A' && c <='F')
  ------------------
  |  Branch (43:21): [True: 37, False: 10]
  |  Branch (43:33): [True: 0, False: 37]
  ------------------
   44|      0|                c = (uint8_t)(c - 'A' + 10);
   45|     47|            else
   46|     47|                break;
   47|  56.0k|            n = (n << 4) | (c & 0xF);
   48|  56.0k|            if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (48:16): [True: 3, False: 56.0k]
  ------------------
   49|      3|                return 0;
   50|  56.0k|            prev = n;
   51|  56.0k|        }
   52|  1.11k|        *result = n;
   53|  1.11k|        return (i > 2) ? i : 0; /* 2 -> No digit was parsed */
  ------------------
  |  Branch (53:16): [True: 1.09k, False: 15]
  ------------------
   54|  1.11k|    }
   55|       |
   56|       |    /* Decimal */
   57|  17.4M|    for(; i < size; i++) {
  ------------------
  |  Branch (57:11): [True: 9.10M, False: 8.32M]
  ------------------
   58|  9.10M|        if(str[i] < '0' || str[i] > '9')
  ------------------
  |  Branch (58:12): [True: 836, False: 9.10M]
  |  Branch (58:28): [True: 1.81k, False: 9.10M]
  ------------------
   59|  2.64k|            break;
   60|       |        /* Fast multiplication: n*10 == (n*8) + (n*2) */
   61|  9.10M|        n = (n << 3) + (n << 1) + (uint8_t)(str[i] - '0');
   62|  9.10M|        if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (62:12): [True: 3, False: 9.10M]
  ------------------
   63|      3|            return 0;
   64|  9.10M|        prev = n;
   65|  9.10M|    }
   66|  8.33M|    *result = n;
   67|  8.33M|    return i;
   68|  8.33M|}
parseInt64:
   71|  4.90M|parseInt64(const char *str, size_t size, int64_t *result) {
   72|       |    /* Negative value? */
   73|  4.90M|    size_t i = 0;
   74|  4.90M|    bool neg = false;
   75|  4.90M|    if(*str == '-' || *str == '+') {
  ------------------
  |  Branch (75:8): [True: 3.53k, False: 4.90M]
  |  Branch (75:23): [True: 231, False: 4.90M]
  ------------------
   76|  3.76k|        neg = (*str == '-');
   77|  3.76k|        i++;
   78|  3.76k|    }
   79|       |
   80|       |    /* Parse as unsigned */
   81|  4.90M|    uint64_t n = 0;
   82|  4.90M|    size_t len = parseUInt64(&str[i], size - i, &n);
   83|  4.90M|    if(len == 0)
  ------------------
  |  Branch (83:8): [True: 94, False: 4.90M]
  ------------------
   84|     94|        return 0;
   85|       |
   86|       |    /* Check for overflow, adjust and return */
   87|  4.90M|    if(!neg) {
  ------------------
  |  Branch (87:8): [True: 4.90M, False: 3.53k]
  ------------------
   88|  4.90M|        if(n > 9223372036854775807UL)
  ------------------
  |  Branch (88:12): [True: 58, False: 4.90M]
  ------------------
   89|     58|            return 0;
   90|  4.90M|        *result = (int64_t)n;
   91|  4.90M|    } else {
   92|       |        /* n is unsigned, so 9223372036854775808UL == 2^63 fits without
   93|       |         * overflow. (int64_t)n would also fit for n in [0, 2^63], but
   94|       |         * the negation -(int64_t)(2^63) is undefined because the result
   95|       |         * (which is +2^63) cannot be represented. Use the unsigned
   96|       |         * representation and reinterpret as int64_t instead. */
   97|  3.53k|        if(n > 9223372036854775808UL)
  ------------------
  |  Branch (97:12): [True: 1, False: 3.53k]
  ------------------
   98|      1|            return 0;
   99|  3.53k|        *result = (n == 9223372036854775808UL)
  ------------------
  |  Branch (99:19): [True: 842, False: 2.68k]
  ------------------
  100|  3.53k|            ? (int64_t)(-9223372036854775807LL - 1)
  101|  3.53k|            : -(int64_t)n;
  102|  3.53k|    }
  103|  4.90M|    return len + i;
  104|  4.90M|}
parseDouble:
  106|  6.00M|size_t parseDouble(const char *str, size_t size, double *result) {
  107|  6.00M|    char buf[2000];
  108|  6.00M|    if(size >= 2000)
  ------------------
  |  Branch (108:8): [True: 1, False: 6.00M]
  ------------------
  109|      1|        return 0;
  110|  6.00M|    memcpy(buf, str, size);
  111|  6.00M|    buf[size] = 0;
  112|  6.00M|    errno = 0;
  113|  6.00M|    char *endptr;
  114|  6.00M|    *result = strtod(buf, &endptr);
  115|  6.00M|    if(errno != 0 && errno != ERANGE)
  ------------------
  |  Branch (115:8): [True: 125k, False: 5.88M]
  |  Branch (115:22): [True: 0, False: 125k]
  ------------------
  116|      0|        return 0;
  117|  6.00M|    return (uintptr_t)endptr - (uintptr_t)buf;
  118|  6.00M|}

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

UA_findDataTypeWithCustom:
   66|  3.82k|                          const UA_DataTypeArray *customTypes) {
   67|       |    /* Always look in built-in types first (may contain data types from all
   68|       |     * namespaces).
   69|       |     *
   70|       |     * TODO: The standard-defined types are ordered. See if binary search is
   71|       |     * more efficient. */
   72|  1.17M|    for(size_t i = 0; i < UA_TYPES_COUNT; ++i) {
  ------------------
  |  |   17|  1.17M|#define UA_TYPES_COUNT 388
  ------------------
  |  Branch (72:23): [True: 1.17M, False: 2.78k]
  ------------------
   73|  1.17M|        if(nodeIdOrder(&UA_TYPES[i].typeId, typeId, NULL) == UA_ORDER_EQ)
  ------------------
  |  Branch (73:12): [True: 1.04k, False: 1.17M]
  ------------------
   74|  1.04k|            return &UA_TYPES[i];
   75|  1.17M|    }
   76|       |
   77|       |    /* Search in the customTypes */
   78|  2.78k|    while(customTypes) {
  ------------------
  |  Branch (78:11): [True: 0, False: 2.78k]
  ------------------
   79|      0|        for(size_t i = 0; i < customTypes->typesSize; ++i) {
  ------------------
  |  Branch (79:27): [True: 0, False: 0]
  ------------------
   80|      0|            if(nodeIdOrder(&customTypes->types[i].typeId, typeId, NULL) == UA_ORDER_EQ)
  ------------------
  |  Branch (80:16): [True: 0, False: 0]
  ------------------
   81|      0|                return &customTypes->types[i];
   82|      0|        }
   83|      0|        customTypes = customTypes->next;
   84|      0|    }
   85|       |
   86|  2.78k|    return NULL;
   87|  2.78k|}
UA_StatusCode_equalTop:
  237|  34.8k|UA_StatusCode_equalTop(UA_StatusCode s1, UA_StatusCode s2) {
  238|  34.8k|    return ((s1 & 0xFFFF0000) == (s2 & 0xFFFF0000));
  239|  34.8k|}
UA_STRING:
  242|    441|UA_STRING(char *chars) {
  243|    441|    UA_String s = {0, NULL};
  244|    441|    if(!chars)
  ------------------
  |  Branch (244:8): [True: 0, False: 441]
  ------------------
  245|      0|        return s;
  246|    441|    s.length = strlen(chars);
  247|    441|    s.data = (UA_Byte*)chars;
  248|    441|    return s;
  249|    441|}
UA_QualifiedName_printEx:
  434|  25.4k|                         const UA_NamespaceMapping *nsMapping) {
  435|       |    /* Start tracking the output length */
  436|  25.4k|    size_t len = qn->name.length;
  437|       |
  438|       |    /* Try to map the NamespaceIndex to the Uri */
  439|  25.4k|    UA_String nsUri = UA_STRING_NULL;
  440|  25.4k|    if(qn->namespaceIndex > 0 && nsMapping) {
  ------------------
  |  Branch (440:8): [True: 1.50k, False: 23.9k]
  |  Branch (440:34): [True: 0, False: 1.50k]
  ------------------
  441|      0|        UA_NamespaceMapping_index2Uri(nsMapping, qn->namespaceIndex, &nsUri);
  442|      0|        if(nsUri.length > 0)
  ------------------
  |  Branch (442:12): [True: 0, False: 0]
  ------------------
  443|      0|            len += nsUri.length + 1;
  444|      0|    }
  445|       |
  446|       |    /* Print the NamespaceIndex */
  447|  25.4k|    char nsStr[6];
  448|  25.4k|    size_t nsStrSize = 0;
  449|  25.4k|    if(nsUri.length == 0 && qn->namespaceIndex > 0) {
  ------------------
  |  Branch (449:8): [True: 25.4k, False: 0]
  |  Branch (449:29): [True: 1.50k, False: 23.9k]
  ------------------
  450|  1.50k|        nsStrSize = itoaUnsigned(qn->namespaceIndex, nsStr, 10);
  451|  1.50k|        len += 1 + nsStrSize;
  452|  1.50k|    }
  453|       |
  454|       |    /* Allocate memory if required */
  455|  25.4k|    if(output->length == 0) {
  ------------------
  |  Branch (455:8): [True: 25.4k, False: 0]
  ------------------
  456|  25.4k|        UA_StatusCode res = UA_ByteString_allocBuffer((UA_ByteString*)output, len);
  457|  25.4k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  25.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (457:12): [True: 0, False: 25.4k]
  ------------------
  458|      0|            return res;
  459|  25.4k|    } else {
  460|      0|        if(output->length < len)
  ------------------
  |  Branch (460:12): [True: 0, False: 0]
  ------------------
  461|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  462|      0|        output->length = len;
  463|      0|    }
  464|       |
  465|       |    /* Print the namespace */
  466|  25.4k|    u8 *pos = output->data;
  467|  25.4k|    if(nsUri.length > 0) {
  ------------------
  |  Branch (467:8): [True: 0, False: 25.4k]
  ------------------
  468|      0|        memcpy(pos, nsUri.data, nsUri.length);
  469|      0|        pos += nsUri.length;
  470|      0|        *pos++ = ';';
  471|  25.4k|    } else if(qn->namespaceIndex > 0) {
  ------------------
  |  Branch (471:15): [True: 1.50k, False: 23.9k]
  ------------------
  472|  1.50k|        memcpy(pos, nsStr, nsStrSize);
  473|  1.50k|        pos += nsStrSize;
  474|  1.50k|        *pos++ = ':';
  475|  1.50k|    }
  476|       |
  477|       |    /* Print the name */
  478|  25.4k|    if(UA_LIKELY(qn->name.data != NULL))
  ------------------
  |  |  344|  25.4k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (344:23): [True: 25.4k, False: 0]
  |  |  ------------------
  ------------------
  479|  25.4k|        memcpy(pos, qn->name.data, qn->name.length);
  480|       |
  481|  25.4k|    UA_assert(output->length == (size_t)((UA_Byte*)pos + qn->name.length - output->data));
  ------------------
  |  |  248|  25.4k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (481:5): [True: 25.4k, False: 0]
  ------------------
  482|  25.4k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  25.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  483|  25.4k|}
UA_DateTime_toStruct:
  502|    732|UA_DateTime_toStruct(UA_DateTime t) {
  503|       |    /* Divide, then subtract -> avoid underflow. Also, negative numbers are
  504|       |     * rounded up, not down. */
  505|    732|    long long secSinceUnixEpoch = (long long)(t / UA_DATETIME_SEC)
  ------------------
  |  |  286|    732|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  285|    732|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|    732|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  506|    732|        - (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC);
  ------------------
  |  |  329|    732|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  286|    732|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  285|    732|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  284|    732|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      - (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC);
  ------------------
  |  |  286|    732|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  285|    732|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|    732|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  507|       |
  508|       |    /* Negative fractions of a second? Remove one full second from the epoch
  509|       |     * distance and allow only a positive fraction. */
  510|    732|    UA_DateTime frac = t % UA_DATETIME_SEC;
  ------------------
  |  |  286|    732|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  285|    732|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|    732|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  511|    732|    if(frac < 0) {
  ------------------
  |  Branch (511:8): [True: 138, False: 594]
  ------------------
  512|    138|        secSinceUnixEpoch--;
  513|    138|        frac += UA_DATETIME_SEC;
  ------------------
  |  |  286|    138|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  285|    138|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|    138|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  514|    138|    }
  515|       |
  516|    732|    struct musl_tm ts;
  517|    732|    memset(&ts, 0, sizeof(struct musl_tm));
  518|    732|    musl_secs_to_tm(secSinceUnixEpoch, &ts);
  519|       |
  520|    732|    UA_DateTimeStruct dateTimeStruct;
  521|    732|    dateTimeStruct.year   = (i16)(ts.tm_year + 1900);
  522|    732|    dateTimeStruct.month  = (u16)(ts.tm_mon + 1);
  523|    732|    dateTimeStruct.day    = (u16)ts.tm_mday;
  524|    732|    dateTimeStruct.hour   = (u16)ts.tm_hour;
  525|    732|    dateTimeStruct.min    = (u16)ts.tm_min;
  526|    732|    dateTimeStruct.sec    = (u16)ts.tm_sec;
  527|    732|    dateTimeStruct.milliSec = (u16)((frac % 10000000) / 10000);
  528|    732|    dateTimeStruct.microSec = (u16)((frac % 10000) / 10);
  529|    732|    dateTimeStruct.nanoSec  = (u16)((frac % 10) * 100);
  530|    732|    return dateTimeStruct;
  531|    732|}
UA_DateTime_fromStruct:
  534|    251|UA_DateTime_fromStruct(UA_DateTimeStruct ts) {
  535|       |    /* Seconds since the Unix epoch */
  536|    251|    struct musl_tm tm;
  537|    251|    memset(&tm, 0, sizeof(struct musl_tm));
  538|    251|    tm.tm_year = ts.year - 1900;
  539|    251|    tm.tm_mon = ts.month - 1;
  540|    251|    tm.tm_mday = ts.day;
  541|    251|    tm.tm_hour = ts.hour;
  542|    251|    tm.tm_min = ts.min;
  543|    251|    tm.tm_sec = ts.sec;
  544|    251|    long long sec_epoch = musl_tm_to_secs(&tm);
  545|       |
  546|    251|    UA_DateTime t = UA_DATETIME_UNIX_EPOCH;
  ------------------
  |  |  329|    251|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  286|    251|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  285|    251|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  284|    251|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  547|    251|    t += sec_epoch * UA_DATETIME_SEC;
  ------------------
  |  |  286|    251|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  285|    251|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|    251|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  548|    251|    t += ts.milliSec * UA_DATETIME_MSEC;
  ------------------
  |  |  285|    251|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|    251|#define UA_DATETIME_USEC 10LL
  |  |  ------------------
  ------------------
  549|    251|    t += ts.microSec * UA_DATETIME_USEC;
  ------------------
  |  |  284|    251|#define UA_DATETIME_USEC 10LL
  ------------------
  550|    251|    t += ts.nanoSec / 100;
  551|    251|    return t;
  552|    251|}
UA_Guid_to_hex:
  736|  2.76k|UA_Guid_to_hex(const UA_Guid *guid, u8* out, UA_Boolean lower) {
  737|  2.76k|    const u8 *hexmap = (lower) ? hexmapLower : hexmapUpper;
  ------------------
  |  Branch (737:24): [True: 0, False: 2.76k]
  ------------------
  738|  2.76k|    size_t i = 0, j = 28;
  739|  24.9k|    for(; i<8;i++,j-=4)         /* pos 0-7, 4byte, (a) */
  ------------------
  |  Branch (739:11): [True: 22.1k, False: 2.76k]
  ------------------
  740|  22.1k|        out[i] = hexmap[(guid->data1 >> j) & 0x0Fu];
  741|  2.76k|    out[i++] = '-';             /* pos 8 */
  742|  13.8k|    for(j=12; i<13;i++,j-=4)    /* pos 9-12, 2byte, (b) */
  ------------------
  |  Branch (742:15): [True: 11.0k, False: 2.76k]
  ------------------
  743|  11.0k|        out[i] = hexmap[(uint16_t)(guid->data2 >> j) & 0x0Fu];
  744|  2.76k|    out[i++] = '-';             /* pos 13 */
  745|  13.8k|    for(j=12; i<18;i++,j-=4)    /* pos 14-17, 2byte (c) */
  ------------------
  |  Branch (745:15): [True: 11.0k, False: 2.76k]
  ------------------
  746|  11.0k|        out[i] = hexmap[(uint16_t)(guid->data3 >> j) & 0x0Fu];
  747|  2.76k|    out[i++] = '-';              /* pos 18 */
  748|  8.30k|    for(j=0;i<23;i+=2,j++) {     /* pos 19-22, 2byte (d) */
  ------------------
  |  Branch (748:13): [True: 5.53k, False: 2.76k]
  ------------------
  749|  5.53k|        out[i] = hexmap[(guid->data4[j] & 0xF0u) >> 4u];
  750|  5.53k|        out[i+1] = hexmap[guid->data4[j] & 0x0Fu];
  751|  5.53k|    }
  752|  2.76k|    out[i++] = '-';              /* pos 23 */
  753|  19.3k|    for(j=2; i<36;i+=2,j++) {    /* pos 24-35, 6byte (e) */
  ------------------
  |  Branch (753:14): [True: 16.6k, False: 2.76k]
  ------------------
  754|  16.6k|        out[i] = hexmap[(guid->data4[j] & 0xF0u) >> 4u];
  755|  16.6k|        out[i+1] = hexmap[guid->data4[j] & 0x0Fu];
  756|  16.6k|    }
  757|  2.76k|}
UA_ByteString_allocBuffer:
  784|   105k|UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length) {
  785|   105k|    UA_ByteString_init(bs);
  786|   105k|    if(length == 0) {
  ------------------
  |  Branch (786:8): [True: 3.73k, False: 101k]
  ------------------
  787|  3.73k|        bs->data = (u8*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  757|  3.73k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  788|  3.73k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  3.73k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  789|  3.73k|    }
  790|   101k|    bs->data = (u8*)UA_calloc(1,length);
  ------------------
  |  |   24|   101k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  791|   101k|    if(UA_UNLIKELY(!bs->data))
  ------------------
  |  |  345|   101k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (345:25): [True: 0, False: 101k]
  |  |  ------------------
  ------------------
  792|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  793|   101k|    bs->length = length;
  794|   101k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   101k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  795|   101k|}
nodeId_printEscape:
 1051|  24.7k|                   const UA_NamespaceMapping *nsMapping, UA_Escaping idEsc) {
 1052|       |    /* Try to map the NamespaceIndex to the Uri */
 1053|  24.7k|    UA_String nsUri = UA_STRING_NULL;
 1054|  24.7k|    if(id->namespaceIndex > 0 && nsMapping)
  ------------------
  |  Branch (1054:8): [True: 2.70k, False: 22.0k]
  |  Branch (1054:34): [True: 0, False: 2.70k]
  ------------------
 1055|      0|        UA_NamespaceMapping_index2Uri(nsMapping, id->namespaceIndex, &nsUri);
 1056|       |
 1057|       |    /* Compute the string length and print numerical identifiers. */
 1058|  24.7k|    u8 nsStr[7];
 1059|  24.7k|    u8 numIdStr[12];
 1060|  24.7k|    size_t idLen = nodeIdSize(id, nsStr, numIdStr, nsUri, idEsc);
 1061|  24.7k|    if(idLen == 0)
  ------------------
  |  Branch (1061:8): [True: 0, False: 24.7k]
  ------------------
 1062|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 1063|       |
 1064|       |    /* Allocate memory if required */
 1065|  24.7k|    if(output->length == 0) {
  ------------------
  |  Branch (1065:8): [True: 24.7k, False: 0]
  ------------------
 1066|  24.7k|        UA_StatusCode res = UA_ByteString_allocBuffer((UA_ByteString*)output, idLen);
 1067|  24.7k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  24.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1067:12): [True: 0, False: 24.7k]
  ------------------
 1068|      0|            return res;
 1069|  24.7k|    } else {
 1070|      0|        if(output->length < idLen)
  ------------------
  |  Branch (1070:12): [True: 0, False: 0]
  ------------------
 1071|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
 1072|      0|        output->length = idLen;
 1073|      0|    }
 1074|       |
 1075|       |    /* Print the NodeId */
 1076|  24.7k|    u8 *pos = printNodeIdBody(id, nsUri, nsStr, numIdStr, output->data, nsMapping, idEsc);
 1077|  24.7k|    output->length = (size_t)(pos - output->data);
 1078|  24.7k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  24.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1079|  24.7k|}
UA_NodeId_printEx:
 1083|  24.7k|                  const UA_NamespaceMapping *nsMapping) {
 1084|  24.7k|    return nodeId_printEscape(id, output, nsMapping, UA_ESCAPING_NONE);
 1085|  24.7k|}
UA_ExpandedNodeId_printEx:
 1203|  45.9k|                          size_t serverUrisSize, const UA_String *serverUris) {
 1204|       |    /* Try to map the NamespaceIndex to the Uri */
 1205|  45.9k|    UA_String nsUri = eid->namespaceUri;
 1206|  45.9k|    if(nsUri.data == NULL && eid->nodeId.namespaceIndex > 0 && nsMapping)
  ------------------
  |  Branch (1206:8): [True: 41.2k, False: 4.71k]
  |  Branch (1206:30): [True: 2.94k, False: 38.2k]
  |  Branch (1206:64): [True: 0, False: 2.94k]
  ------------------
 1207|      0|        UA_NamespaceMapping_index2Uri(nsMapping, eid->nodeId.namespaceIndex, &nsUri);
 1208|       |
 1209|       |    /* Try to map the ServerIndex to a Uri */
 1210|  45.9k|    UA_String srvUri = UA_STRING_NULL;
 1211|  45.9k|    if(eid->serverIndex > 0 && eid->serverIndex < serverUrisSize)
  ------------------
  |  Branch (1211:8): [True: 2.00k, False: 43.9k]
  |  Branch (1211:32): [True: 0, False: 2.00k]
  ------------------
 1212|      0|        srvUri = serverUris[eid->serverIndex];
 1213|       |
 1214|       |    /* No special escaping for ExpandedNodeIds */
 1215|  45.9k|    UA_Escaping idEsc = UA_ESCAPING_NONE;
 1216|       |
 1217|       |    /* Compute the NodeId string length */
 1218|  45.9k|    u8 nsStr[7];
 1219|  45.9k|    u8 numIdStr[12];
 1220|  45.9k|    char srvIdxStr[11];
 1221|  45.9k|    size_t srvIdxSize = 0;
 1222|  45.9k|    size_t idLen = nodeIdSize(&eid->nodeId, nsStr, numIdStr, nsUri, idEsc);
 1223|  45.9k|    if(idLen == 0)
  ------------------
  |  Branch (1223:8): [True: 0, False: 45.9k]
  ------------------
 1224|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 1225|  45.9k|    if(srvUri.length  > 0) {
  ------------------
  |  Branch (1225:8): [True: 0, False: 45.9k]
  ------------------
 1226|      0|        idLen += 5; /* svu=; */
 1227|      0|        idLen += UA_String_escapedSize(srvUri, UA_ESCAPING_PERCENT);
 1228|  45.9k|    } else if(eid->serverIndex > 0) {
  ------------------
  |  Branch (1228:15): [True: 2.00k, False: 43.9k]
  ------------------
 1229|  2.00k|        idLen += 5; /* svr=; */
 1230|  2.00k|        srvIdxSize = itoaUnsigned(eid->serverIndex, srvIdxStr, 10);
 1231|  2.00k|        idLen += srvIdxSize;
 1232|  2.00k|    }
 1233|       |
 1234|       |    /* Allocate memory if required */
 1235|  45.9k|    if(output->length == 0) {
  ------------------
  |  Branch (1235:8): [True: 45.9k, False: 0]
  ------------------
 1236|  45.9k|        UA_StatusCode res = UA_ByteString_allocBuffer((UA_ByteString*)output, idLen);
 1237|  45.9k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  45.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1237:12): [True: 0, False: 45.9k]
  ------------------
 1238|      0|            return res;
 1239|  45.9k|    } else {
 1240|      0|        if(output->length < idLen)
  ------------------
  |  Branch (1240:12): [True: 0, False: 0]
  ------------------
 1241|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
 1242|      0|        output->length = idLen;
 1243|      0|    }
 1244|       |
 1245|       |    /* Encode the ServerIndex or ServerUrl */
 1246|  45.9k|    u8 *pos = output->data;
 1247|  45.9k|    if(srvUri.length  > 0) {
  ------------------
  |  Branch (1247:8): [True: 0, False: 45.9k]
  ------------------
 1248|      0|        memcpy(pos, "svu=", 4);
 1249|      0|        pos += 4;
 1250|      0|        pos += UA_String_escapeInsert(pos, srvUri, UA_ESCAPING_PERCENT);
 1251|      0|        *pos++ = ';';
 1252|  45.9k|    } else if(eid->serverIndex > 0) {
  ------------------
  |  Branch (1252:15): [True: 2.00k, False: 43.9k]
  ------------------
 1253|  2.00k|        memcpy(pos, "svr=", 4);
 1254|  2.00k|        pos += 4;
 1255|  2.00k|        memcpy(pos, srvIdxStr, srvIdxSize);
 1256|  2.00k|        pos += srvIdxSize;
 1257|  2.00k|        *pos++ = ';';
 1258|  2.00k|    }
 1259|       |
 1260|       |    /* Print the NodeId */
 1261|  45.9k|    pos = printNodeIdBody(&eid->nodeId, nsUri, nsStr, numIdStr, pos, nsMapping, idEsc);
 1262|  45.9k|    output->length = (size_t)(pos - output->data);
 1263|  45.9k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  45.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1264|  45.9k|}
UA_Variant_isScalar:
 1385|  34.7k|UA_Variant_isScalar(const UA_Variant *v) {
 1386|  34.7k|    return (v->type != NULL && v->arrayLength == 0 &&
  ------------------
  |  Branch (1386:13): [True: 34.7k, False: 0]
  |  Branch (1386:32): [True: 24.8k, False: 9.94k]
  ------------------
 1387|  24.8k|            v->data > UA_EMPTY_ARRAY_SENTINEL);
  ------------------
  |  |  757|  24.8k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1387:13): [True: 23.7k, False: 1.07k]
  ------------------
 1388|  34.7k|}
UA_new:
 1950|  32.3k|UA_new(const UA_DataType *type) {
 1951|  32.3k|    void *p = UA_calloc(1, type->memSize);
  ------------------
  |  |   24|  32.3k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1952|  32.3k|    return p;
 1953|  32.3k|}
UA_copy:
 2126|  48.9k|UA_copy(const void *src, void *dst, const UA_DataType *type) {
 2127|  48.9k|    memset(dst, 0, type->memSize); /* init */
 2128|  48.9k|    UA_StatusCode retval = copyJumpTable[type->typeKind](src, dst, type);
 2129|  48.9k|    if(retval != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  48.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2129:8): [True: 0, False: 48.9k]
  ------------------
 2130|      0|        UA_clear(dst, type);
 2131|  48.9k|    return retval;
 2132|  48.9k|}
UA_clear:
 2229|  1.68M|UA_clear(void *p, const UA_DataType *type) {
 2230|  1.68M|    clearJumpTable[type->typeKind](p, type);
 2231|  1.68M|    memset(p, 0, type->memSize); /* init */
 2232|  1.68M|}
UA_delete:
 2235|    335|UA_delete(void *p, const UA_DataType *type) {
 2236|    335|    clearJumpTable[type->typeKind](p, type);
 2237|    335|    UA_free(p);
  ------------------
  |  |   23|    335|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2238|    335|}
UA_order:
 2703|  35.9k|UA_Order UA_order(const void *p1, const void *p2, const UA_DataType *type) {
 2704|  35.9k|    return orderJumpTable[type->typeKind](p1, p2, type);
 2705|  35.9k|}
UA_equal:
 2708|  32.4k|UA_equal(const void *p1, const void *p2, const UA_DataType *type) {
 2709|  32.4k|    return (UA_order(p1, p2, type) == UA_ORDER_EQ);
 2710|  32.4k|}
UA_Array_copy:
 2729|  48.9k|              void **dst, const UA_DataType *type) {
 2730|  48.9k|    if(size == 0) {
  ------------------
  |  Branch (2730:8): [True: 10.5k, False: 38.3k]
  ------------------
 2731|  10.5k|        if(src == NULL)
  ------------------
  |  Branch (2731:12): [True: 0, False: 10.5k]
  ------------------
 2732|      0|            *dst = NULL;
 2733|  10.5k|        else
 2734|  10.5k|            *dst= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  757|  10.5k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2735|  10.5k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  10.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2736|  10.5k|    }
 2737|       |
 2738|       |    /* Check the array consistency -- defensive programming in case the user
 2739|       |     * manually created an inconsistent array */
 2740|  38.3k|    if(UA_UNLIKELY(!type || !src))
  ------------------
  |  |  345|  76.7k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (345:25): [True: 0, False: 38.3k]
  |  |  |  Branch (345:43): [True: 0, False: 38.3k]
  |  |  |  Branch (345:43): [True: 0, False: 38.3k]
  |  |  ------------------
  ------------------
 2741|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 2742|       |
 2743|  38.3k|    if(size > SIZE_MAX / type->memSize)
  ------------------
  |  Branch (2743:8): [True: 0, False: 38.3k]
  ------------------
 2744|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2745|  38.3k|    size_t byteSize = size * type->memSize;
 2746|       |
 2747|       |    /* calloc, so we don't have to check retval in every iteration of copying */
 2748|  38.3k|    *dst = UA_calloc(size, type->memSize);
  ------------------
  |  |   24|  38.3k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2749|  38.3k|    if(!*dst)
  ------------------
  |  Branch (2749:8): [True: 0, False: 38.3k]
  ------------------
 2750|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2751|       |
 2752|  38.3k|    if(type->pointerFree) {
  ------------------
  |  Branch (2752:8): [True: 38.3k, False: 0]
  ------------------
 2753|  38.3k|        memcpy(*dst, src, byteSize);
 2754|  38.3k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  38.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2755|  38.3k|    }
 2756|       |
 2757|      0|    uintptr_t ptrs = (uintptr_t)src;
 2758|      0|    uintptr_t ptrd = (uintptr_t)*dst;
 2759|      0|    UA_StatusCode retval = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2760|      0|    for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2760:23): [True: 0, False: 0]
  ------------------
 2761|      0|        retval |= UA_copy((void*)ptrs, (void*)ptrd, type);
 2762|      0|        ptrs += type->memSize;
 2763|      0|        ptrd += type->memSize;
 2764|      0|    }
 2765|      0|    if(retval != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2765:8): [True: 0, False: 0]
  ------------------
 2766|      0|        UA_Array_delete(*dst, size, type);
 2767|       |        *dst = NULL;
 2768|      0|    }
 2769|      0|    return retval;
 2770|  38.3k|}
UA_Array_delete:
 2872|   809k|UA_Array_delete(void *p, size_t size, const UA_DataType *type) {
 2873|   809k|    if(!type->pointerFree) {
  ------------------
  |  Branch (2873:8): [True: 37.7k, False: 771k]
  ------------------
 2874|  37.7k|        uintptr_t ptr = (uintptr_t)p;
 2875|  1.54M|        for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2875:27): [True: 1.50M, False: 37.7k]
  ------------------
 2876|  1.50M|            UA_clear((void*)ptr, type);
 2877|  1.50M|            ptr += type->memSize;
 2878|  1.50M|        }
 2879|  37.7k|    }
 2880|   809k|    UA_free((void*)((uintptr_t)p & ~(uintptr_t)UA_EMPTY_ARRAY_SENTINEL));
  ------------------
  |  |   23|   809k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2881|   809k|}
ua_types.c:nodeIdSize:
  950|  70.6k|           UA_Escaping idEsc) {
  951|       |    /* Namespace length */
  952|  70.6k|    size_t len = 0;
  953|  70.6k|    if(nsUri.data != NULL) {
  ------------------
  |  Branch (953:8): [True: 4.71k, False: 65.9k]
  ------------------
  954|  4.71k|        len += 5; /* nsu=; */
  955|  4.71k|        len += UA_String_escapedSize(nsUri, UA_ESCAPING_PERCENT);
  956|  65.9k|    } else if(id->namespaceIndex > 0) {
  ------------------
  |  Branch (956:15): [True: 5.64k, False: 60.3k]
  ------------------
  957|  5.64k|        len += 4; /* ns=; */
  958|  5.64k|        size_t nsStrSize = itoaUnsigned(id->namespaceIndex, (char*)nsStr, 10);
  959|  5.64k|        nsStr[nsStrSize] = 0;
  960|  5.64k|        len += nsStrSize;
  961|  5.64k|    }
  962|       |
  963|  70.6k|    len += 2; /* ?= */
  964|       |
  965|  70.6k|    switch (id->identifierType) {
  966|  14.5k|    case UA_NODEIDTYPE_NUMERIC: {
  ------------------
  |  Branch (966:5): [True: 14.5k, False: 56.1k]
  ------------------
  967|  14.5k|        size_t numIdStrSize = itoaUnsigned(id->identifier.numeric, (char*)numIdStr, 10);
  968|  14.5k|        numIdStr[numIdStrSize] = 0;
  969|  14.5k|        len += numIdStrSize;
  970|  14.5k|        break;
  971|      0|    }
  972|  36.9k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (972:5): [True: 36.9k, False: 33.7k]
  ------------------
  973|  36.9k|        len += UA_String_escapedSize(id->identifier.string, idEsc);
  974|  36.9k|        break;
  975|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (975:5): [True: 0, False: 70.6k]
  ------------------
  976|      0|        len += 36;
  977|      0|        break;
  978|  19.2k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (978:5): [True: 19.2k, False: 51.4k]
  ------------------
  979|  19.2k|        len += 4 * ((id->identifier.byteString.length + 2) / 3);
  980|  19.2k|        break;
  981|      0|    default:
  ------------------
  |  Branch (981:5): [True: 0, False: 70.6k]
  ------------------
  982|      0|        len = 0;
  983|  70.6k|    }
  984|  70.6k|    return len;
  985|  70.6k|}
ua_types.c:printNodeIdBody:
  989|  70.6k|                const UA_NamespaceMapping *nsMapping, UA_Escaping idEsc) {
  990|  70.6k|    size_t len;
  991|       |
  992|       |    /* Encode the namespace */
  993|  70.6k|    if(nsUri.data != NULL) {
  ------------------
  |  Branch (993:8): [True: 4.71k, False: 65.9k]
  ------------------
  994|  4.71k|        memcpy(pos, "nsu=", 4);
  995|  4.71k|        pos += 4;
  996|  4.71k|        pos += UA_String_escapeInsert(pos, nsUri, UA_ESCAPING_PERCENT);
  997|  4.71k|        *pos++ = ';';
  998|  65.9k|    } else if(id->namespaceIndex > 0) {
  ------------------
  |  Branch (998:15): [True: 5.64k, False: 60.3k]
  ------------------
  999|  5.64k|        memcpy(pos, "ns=", 3);
 1000|  5.64k|        pos += 3;
 1001|  5.64k|        len = strlen((char*)nsStr);
 1002|  5.64k|        memcpy(pos, nsStr, len);
 1003|  5.64k|        pos += len;
 1004|  5.64k|        *pos++ = ';';
 1005|  5.64k|    }
 1006|       |
 1007|       |    /* Encode the identifier */
 1008|  70.6k|    switch(id->identifierType) {
  ------------------
  |  Branch (1008:12): [True: 70.6k, False: 0]
  ------------------
 1009|  14.5k|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (1009:5): [True: 14.5k, False: 56.1k]
  ------------------
 1010|  14.5k|        memcpy(pos, "i=", 2);
 1011|  14.5k|        pos += 2;
 1012|  14.5k|        len = strlen((char*)numIdStr);
 1013|  14.5k|        memcpy(pos, numIdStr, len);
 1014|  14.5k|        pos += len;
 1015|  14.5k|        break;
 1016|  36.9k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (1016:5): [True: 36.9k, False: 33.7k]
  ------------------
 1017|  36.9k|        memcpy(pos, "s=", 2);
 1018|  36.9k|        pos += 2;
 1019|  36.9k|        pos += UA_String_escapeInsert(pos, id->identifier.string, idEsc);
 1020|  36.9k|        break;
 1021|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (1021:5): [True: 0, False: 70.6k]
  ------------------
 1022|      0|        memcpy(pos, "g=", 2);
 1023|      0|        pos += 2;
 1024|      0|        UA_Guid_to_hex(&id->identifier.guid, pos, true);
 1025|      0|        pos += 36;
 1026|      0|        break;
 1027|  19.2k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (1027:5): [True: 19.2k, False: 51.4k]
  ------------------
 1028|  19.2k|        memcpy(pos, "b=", 2);
 1029|  19.2k|        pos += 2;
 1030|       |        /* Use base64url encoding for percent-escaping.
 1031|       |         * Replace +/ with -_ and remove the padding. */
 1032|  19.2k|        u8 *bpos = pos;
 1033|  19.2k|        pos += UA_base64_buf(id->identifier.byteString.data,
 1034|  19.2k|                             id->identifier.byteString.length, pos);
 1035|  19.2k|        if(idEsc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (1035:12): [True: 0, False: 19.2k]
  ------------------
 1036|  19.2k|           idEsc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (1036:12): [True: 0, False: 19.2k]
  ------------------
 1037|      0|            while(pos > bpos && pos[-1] == '=')
  ------------------
  |  Branch (1037:19): [True: 0, False: 0]
  |  Branch (1037:33): [True: 0, False: 0]
  ------------------
 1038|      0|                pos--;
 1039|      0|            for(; bpos < pos; bpos++) {
  ------------------
  |  Branch (1039:19): [True: 0, False: 0]
  ------------------
 1040|      0|                if(*bpos == '+') *bpos = '-';
  ------------------
  |  Branch (1040:20): [True: 0, False: 0]
  ------------------
 1041|      0|                else if(*bpos == '/') *bpos = '_';
  ------------------
  |  Branch (1041:25): [True: 0, False: 0]
  ------------------
 1042|      0|            }
 1043|      0|        }
 1044|  19.2k|        break;
 1045|  70.6k|    }
 1046|  70.6k|    return pos;
 1047|  70.6k|}
ua_types.c:Variant_clear:
 1406|   987k|Variant_clear(void *p, const UA_DataType *_) {
 1407|   987k|    UA_Variant *v = (UA_Variant *)p;
 1408|       |
 1409|       |    /* The content is "borrowed" */
 1410|   987k|    if(v->storageType == UA_VARIANT_DATA_NODELETE)
  ------------------
  |  Branch (1410:8): [True: 0, False: 987k]
  ------------------
 1411|      0|        return;
 1412|       |
 1413|       |    /* Delete the value */
 1414|   987k|    if(v->type && v->data > UA_EMPTY_ARRAY_SENTINEL) {
  ------------------
  |  |  757|  44.6k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1414:8): [True: 44.6k, False: 943k]
  |  Branch (1414:19): [True: 42.5k, False: 2.14k]
  ------------------
 1415|  42.5k|        if(v->arrayLength == 0)
  ------------------
  |  Branch (1415:12): [True: 32.0k, False: 10.4k]
  ------------------
 1416|  32.0k|            v->arrayLength = 1;
 1417|  42.5k|        UA_Array_delete(v->data, v->arrayLength, v->type);
 1418|  42.5k|        v->data = NULL;
 1419|  42.5k|    }
 1420|       |
 1421|       |    /* Delete the array dimensions */
 1422|   987k|    if((void*)v->arrayDimensions > UA_EMPTY_ARRAY_SENTINEL)
  ------------------
  |  |  757|   987k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1422:8): [True: 64, False: 987k]
  ------------------
 1423|     64|        UA_free(v->arrayDimensions);
  ------------------
  |  |   23|     64|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1424|   987k|}
ua_types.c:DataValue_clear:
 1880|   838k|DataValue_clear(void *p, const UA_DataType *_) {
 1881|   838k|    UA_DataValue *dv = (UA_DataValue *)p;
 1882|       |    Variant_clear(&dv->value, NULL);
 1883|   838k|}
ua_types.c:String_copy:
  303|  48.9k|String_copy(const void *src, void *dst, const UA_DataType *_) {
  304|  48.9k|    const UA_String *srcS = (const UA_String*)src;
  305|  48.9k|    UA_String *dstS = (UA_String *)dst;
  306|  48.9k|    UA_StatusCode res =
  307|  48.9k|        UA_Array_copy(srcS->data, srcS->length, (void**)&dstS->data,
  308|  48.9k|                      &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   96|  48.9k|#define UA_TYPES_BYTE 2
  ------------------
  309|  48.9k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  48.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (309:8): [True: 48.9k, False: 0]
  ------------------
  310|  48.9k|        dstS->length = srcS->length;
  311|  48.9k|    return res;
  312|  48.9k|}
ua_types.c:nopClear:
 2191|  23.5k|static void nopClear(void *p, const UA_DataType *type) { }
ua_types.c:String_clear:
  315|   758k|String_clear(void *p, const UA_DataType *_) {
  316|   758k|    UA_String *s = (UA_String*)p;
  317|   758k|    UA_Array_delete(s->data, s->length, &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   96|   758k|#define UA_TYPES_BYTE 2
  ------------------
  318|   758k|}
ua_types.c:NodeId_clear:
  799|   415k|NodeId_clear(void *p, const UA_DataType *_) {
  800|   415k|    UA_NodeId *id = (UA_NodeId*)p;
  801|   415k|    switch(id->identifierType) {
  802|  27.0k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (802:5): [True: 27.0k, False: 388k]
  ------------------
  803|  41.4k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (803:5): [True: 14.4k, False: 401k]
  ------------------
  804|  41.4k|        String_clear(&id->identifier.string, NULL);
  805|  41.4k|        break;
  806|   374k|    default: break;
  ------------------
  |  Branch (806:5): [True: 374k, False: 41.4k]
  ------------------
  807|   415k|    }
  808|   415k|}
ua_types.c:ExpandedNodeId_clear:
 1100|  35.4k|ExpandedNodeId_clear(void *p, const UA_DataType *_) {
 1101|  35.4k|    UA_ExpandedNodeId *id = (UA_ExpandedNodeId*)p;
 1102|  35.4k|    NodeId_clear(&id->nodeId, NULL);
 1103|       |    String_clear(&id->namespaceUri, NULL);
 1104|  35.4k|}
ua_types.c:QualifiedName_clear:
  421|  21.5k|QualifiedName_clear(void *p, const UA_DataType *_) {
  422|  21.5k|    UA_QualifiedName *qn = (UA_QualifiedName*)p;
  423|       |    String_clear(&qn->name, NULL);
  424|  21.5k|}
ua_types.c:LocalizedText_clear:
 1863|  19.3k|LocalizedText_clear(void *p, const UA_DataType *_) {
 1864|  19.3k|    UA_LocalizedText *lt = (UA_LocalizedText *)p;
 1865|  19.3k|    String_clear(&lt->locale, NULL);
 1866|       |    String_clear(&lt->text, NULL);
 1867|  19.3k|}
ua_types.c:ExtensionObject_clear:
 1273|   359k|ExtensionObject_clear(void *p, const UA_DataType *_) {
 1274|   359k|    UA_ExtensionObject *eo = (UA_ExtensionObject *)p;
 1275|   359k|    switch(eo->encoding) {
 1276|   357k|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (1276:5): [True: 357k, False: 2.65k]
  ------------------
 1277|   357k|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (1277:5): [True: 3, False: 359k]
  ------------------
 1278|   357k|    case UA_EXTENSIONOBJECT_ENCODED_XML:
  ------------------
  |  Branch (1278:5): [True: 3, False: 359k]
  ------------------
 1279|   359k|    case UA_EXTENSIONOBJECT_ENCODED_JSON:
  ------------------
  |  Branch (1279:5): [True: 2.31k, False: 357k]
  ------------------
 1280|   359k|        NodeId_clear(&eo->content.encoded.typeId, NULL);
 1281|   359k|        String_clear(&eo->content.encoded.body, NULL);
 1282|   359k|        break;
 1283|    335|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (1283:5): [True: 335, False: 359k]
  ------------------
 1284|    335|        if(eo->content.decoded.data)
  ------------------
  |  Branch (1284:12): [True: 335, False: 0]
  ------------------
 1285|    335|            UA_delete(eo->content.decoded.data, eo->content.decoded.type);
 1286|    335|        break;
 1287|      0|    default:
  ------------------
  |  Branch (1287:5): [True: 0, False: 359k]
  ------------------
 1288|      0|        break;
 1289|   359k|    }
 1290|   359k|}
ua_types.c:DiagnosticInfo_clear:
 1910|     15|DiagnosticInfo_clear(void *p, const UA_DataType *_) {
 1911|     15|    UA_DiagnosticInfo *di = (UA_DiagnosticInfo *)p;
 1912|       |
 1913|     15|    String_clear(&di->additionalInfo, NULL);
 1914|     15|    if(di->hasInnerDiagnosticInfo && di->innerDiagnosticInfo) {
  ------------------
  |  Branch (1914:8): [True: 0, False: 15]
  |  Branch (1914:38): [True: 0, False: 0]
  ------------------
 1915|      0|        DiagnosticInfo_clear(di->innerDiagnosticInfo, NULL);
 1916|      0|        UA_free(di->innerDiagnosticInfo);
  ------------------
  |  |   23|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1917|      0|    }
 1918|     15|}
ua_types.c:clearStructure:
 2135|  8.84k|clearStructure(void *p, const UA_DataType *type) {
 2136|  8.84k|    uintptr_t ptr = (uintptr_t)p;
 2137|  65.3k|    for(size_t i = 0; i < type->membersSize; ++i) {
  ------------------
  |  Branch (2137:23): [True: 56.4k, False: 8.84k]
  ------------------
 2138|  56.4k|        const UA_DataTypeMember *m = &type->members[i];
 2139|  56.4k|        const UA_DataType *mt = m->memberType;
 2140|  56.4k|        ptr += m->padding;
 2141|  56.4k|        if(!m->isOptional) {
  ------------------
  |  Branch (2141:12): [True: 56.4k, False: 0]
  ------------------
 2142|  56.4k|            if(!m->isArray) {
  ------------------
  |  Branch (2142:16): [True: 49.1k, False: 7.33k]
  ------------------
 2143|  49.1k|                clearJumpTable[mt->typeKind]((void*)ptr, mt);
 2144|  49.1k|                ptr += mt->memSize;
 2145|  49.1k|            } else {
 2146|  7.33k|                size_t length = *(size_t*)ptr;
 2147|  7.33k|                ptr += sizeof(size_t);
 2148|  7.33k|                UA_Array_delete(*(void**)ptr, length, mt);
 2149|  7.33k|                ptr += sizeof(void*);
 2150|  7.33k|            }
 2151|  56.4k|        } else { /* field is optional */
 2152|      0|            if(!m->isArray) {
  ------------------
  |  Branch (2152:16): [True: 0, False: 0]
  ------------------
 2153|       |                /* optional scalar field is contained */
 2154|      0|                if((*(void *const *)ptr != NULL))
  ------------------
  |  Branch (2154:20): [True: 0, False: 0]
  ------------------
 2155|      0|                    UA_Array_delete(*(void **)ptr, 1, mt);
 2156|      0|                ptr += sizeof(void *);
 2157|      0|            } else {
 2158|       |                /* optional array field is contained */
 2159|      0|                if((*(void *const *)(ptr + sizeof(size_t)) != NULL)) {
  ------------------
  |  Branch (2159:20): [True: 0, False: 0]
  ------------------
 2160|      0|                    size_t length = *(size_t *)ptr;
 2161|      0|                    ptr += sizeof(size_t);
 2162|      0|                    UA_Array_delete(*(void **)ptr, length, mt);
 2163|      0|                    ptr += sizeof(void *);
 2164|      0|                } else { /* optional array field not contained */
 2165|      0|                    ptr += sizeof(size_t);
 2166|      0|                    ptr += sizeof(void *);
 2167|      0|                }
 2168|      0|            }
 2169|      0|        }
 2170|  56.4k|    }
 2171|  8.84k|}
ua_types.c:guidOrder:
 2288|  1.41k|guidOrder(const void *p1_, const void *p2_, const UA_DataType *type) {
 2289|  1.41k|    const UA_Guid *p1 = (const UA_Guid*)p1_;
 2290|  1.41k|    const UA_Guid *p2 = (const UA_Guid*)p2_;
 2291|  1.41k|    if(p1->data1 != p2->data1)
  ------------------
  |  Branch (2291:8): [True: 18, False: 1.40k]
  ------------------
 2292|     18|        return (p1->data1 < p2->data1) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2292:16): [True: 18, False: 0]
  ------------------
 2293|  1.40k|    if(p1->data2 != p2->data2)
  ------------------
  |  Branch (2293:8): [True: 0, False: 1.40k]
  ------------------
 2294|      0|        return (p1->data2 < p2->data2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2294:16): [True: 0, False: 0]
  ------------------
 2295|  1.40k|    if(p1->data3 != p2->data3)
  ------------------
  |  Branch (2295:8): [True: 0, False: 1.40k]
  ------------------
 2296|      0|        return (p1->data3 < p2->data3) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2296:16): [True: 0, False: 0]
  ------------------
 2297|  1.40k|    int cmp = memcmp(p1->data4, p2->data4, 8);
 2298|  1.40k|    if(cmp != 0)
  ------------------
  |  Branch (2298:8): [True: 0, False: 1.40k]
  ------------------
 2299|      0|        return (cmp < 0) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2299:16): [True: 0, False: 0]
  ------------------
 2300|  1.40k|    return UA_ORDER_EQ;
 2301|  1.40k|}
ua_types.c:nodeIdOrder:
 2321|  1.21M|nodeIdOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2322|  1.21M|    const UA_NodeId *p1 = (const UA_NodeId*)p1_;
 2323|  1.21M|    const UA_NodeId *p2 = (const UA_NodeId*)p2_;
 2324|       |    /* Compare namespaceIndex */
 2325|  1.21M|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2325:8): [True: 3.15k, False: 1.21M]
  ------------------
 2326|  3.15k|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2326:16): [True: 3.15k, False: 0]
  ------------------
 2327|       |
 2328|       |    /* Compare identifierType */
 2329|  1.21M|    if(p1->identifierType != p2->identifierType)
  ------------------
  |  Branch (2329:8): [True: 491k, False: 723k]
  ------------------
 2330|   491k|        return (p1->identifierType < p2->identifierType) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2330:16): [True: 491k, False: 0]
  ------------------
 2331|       |
 2332|       |    /* Compare the identifier */
 2333|   723k|    switch(p1->identifierType) {
 2334|   703k|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (2334:5): [True: 703k, False: 19.1k]
  ------------------
 2335|   703k|    default:
  ------------------
  |  Branch (2335:5): [True: 0, False: 723k]
  ------------------
 2336|   703k|        if(p1->identifier.numeric != p2->identifier.numeric)
  ------------------
  |  Branch (2336:12): [True: 692k, False: 11.2k]
  ------------------
 2337|   692k|            return (p1->identifier.numeric < p2->identifier.numeric) ?
  ------------------
  |  Branch (2337:20): [True: 111k, False: 581k]
  ------------------
 2338|   581k|                UA_ORDER_LESS : UA_ORDER_MORE;
 2339|  11.2k|        return UA_ORDER_EQ;
 2340|      1|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (2340:5): [True: 1, False: 723k]
  ------------------
 2341|      1|        return guidOrder(&p1->identifier.guid, &p2->identifier.guid, NULL);
 2342|  12.3k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (2342:5): [True: 12.3k, False: 710k]
  ------------------
 2343|  19.1k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (2343:5): [True: 6.80k, False: 716k]
  ------------------
 2344|       |        return stringOrder(&p1->identifier.string, &p2->identifier.string, NULL);
 2345|   723k|    }
 2346|   723k|}
ua_types.c:expandedNodeIdOrder:
 2349|  40.5k|expandedNodeIdOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2350|  40.5k|    const UA_ExpandedNodeId *p1 = (const UA_ExpandedNodeId*)p1_;
 2351|  40.5k|    const UA_ExpandedNodeId *p2 = (const UA_ExpandedNodeId*)p2_;
 2352|  40.5k|    if(p1->serverIndex != p2->serverIndex)
  ------------------
  |  Branch (2352:8): [True: 2.00k, False: 38.5k]
  ------------------
 2353|  2.00k|        return (p1->serverIndex < p2->serverIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2353:16): [True: 2.00k, False: 0]
  ------------------
 2354|  38.5k|    UA_Order o = stringOrder(&p1->namespaceUri, &p2->namespaceUri, NULL);
 2355|  38.5k|    if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2355:8): [True: 4.69k, False: 33.8k]
  ------------------
 2356|  4.69k|        return o;
 2357|  33.8k|    return nodeIdOrder(&p1->nodeId, &p2->nodeId, NULL);
 2358|  38.5k|}
ua_types.c:booleanOrder:
 2246|  3.80k|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2247|  3.80k|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2248|  3.80k|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2249|  3.80k|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2249:12): [True: 0, False: 3.80k]
  ------------------
 2250|  3.80k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2250:20): [True: 0, False: 0]
  ------------------
 2251|  3.80k|        return UA_ORDER_EQ;                                               \
 2252|  3.80k|    }
ua_types.c:sByteOrder:
 2246|  26.8k|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2247|  26.8k|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2248|  26.8k|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2249|  26.8k|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2249:12): [True: 0, False: 26.8k]
  ------------------
 2250|  26.8k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2250:20): [True: 0, False: 0]
  ------------------
 2251|  26.8k|        return UA_ORDER_EQ;                                               \
 2252|  26.8k|    }
ua_types.c:byteOrder:
 2246|    938|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2247|    938|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2248|    938|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2249|    938|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2249:12): [True: 0, False: 938]
  ------------------
 2250|    938|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2250:20): [True: 0, False: 0]
  ------------------
 2251|    938|        return UA_ORDER_EQ;                                               \
 2252|    938|    }
ua_types.c:int16Order:
 2246|  1.55k|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2247|  1.55k|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2248|  1.55k|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2249|  1.55k|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2249:12): [True: 0, False: 1.55k]
  ------------------
 2250|  1.55k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2250:20): [True: 0, False: 0]
  ------------------
 2251|  1.55k|        return UA_ORDER_EQ;                                               \
 2252|  1.55k|    }
ua_types.c:uInt16Order:
 2246|  2.09k|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2247|  2.09k|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2248|  2.09k|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2249|  2.09k|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2249:12): [True: 0, False: 2.09k]
  ------------------
 2250|  2.09k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2250:20): [True: 0, False: 0]
  ------------------
 2251|  2.09k|        return UA_ORDER_EQ;                                               \
 2252|  2.09k|    }
ua_types.c:int32Order:
 2246|  1.38M|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2247|  1.38M|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2248|  1.38M|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2249|  1.38M|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2249:12): [True: 0, False: 1.38M]
  ------------------
 2250|  1.38M|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2250:20): [True: 0, False: 0]
  ------------------
 2251|  1.38M|        return UA_ORDER_EQ;                                               \
 2252|  1.38M|    }
ua_types.c:uInt32Order:
 2246|  17.4k|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2247|  17.4k|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2248|  17.4k|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2249|  17.4k|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2249:12): [True: 0, False: 17.4k]
  ------------------
 2250|  17.4k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2250:20): [True: 0, False: 0]
  ------------------
 2251|  17.4k|        return UA_ORDER_EQ;                                               \
 2252|  17.4k|    }
ua_types.c:int64Order:
 2246|   900k|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2247|   900k|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2248|   900k|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2249|   900k|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2249:12): [True: 366, False: 899k]
  ------------------
 2250|   900k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2250:20): [True: 189, False: 177]
  ------------------
 2251|   900k|        return UA_ORDER_EQ;                                               \
 2252|   900k|    }
ua_types.c:uInt64Order:
 2246|  1.42M|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2247|  1.42M|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2248|  1.42M|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2249|  1.42M|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2249:12): [True: 0, False: 1.42M]
  ------------------
 2250|  1.42M|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2250:20): [True: 0, False: 0]
  ------------------
 2251|  1.42M|        return UA_ORDER_EQ;                                               \
 2252|  1.42M|    }
ua_types.c:floatOrder:
 2266|  1.29M|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2267|  1.29M|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2268|  1.29M|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2269|  1.29M|        if(*p1 != *p2) {                                                  \
  ------------------
  |  Branch (2269:12): [True: 7.29k, False: 1.29M]
  ------------------
 2270|  7.29k|            /* p1 is NaN */                                         \
 2271|  7.29k|            if(*p1 != *p1) {                                        \
  ------------------
  |  Branch (2271:16): [True: 7.29k, False: 0]
  ------------------
 2272|  7.29k|                if(*p2 != *p2)                                      \
  ------------------
  |  Branch (2272:20): [True: 7.29k, False: 0]
  ------------------
 2273|  7.29k|                    return UA_ORDER_EQ;                             \
 2274|  7.29k|                return UA_ORDER_LESS;                               \
 2275|  7.29k|            }                                                       \
 2276|  7.29k|            /* p2 is NaN */                                         \
 2277|  7.29k|            if(*p2 != *p2)                                          \
  ------------------
  |  Branch (2277:16): [True: 0, False: 0]
  ------------------
 2278|      0|                return UA_ORDER_MORE;                               \
 2279|      0|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2279:20): [True: 0, False: 0]
  ------------------
 2280|      0|        }                                                           \
 2281|  1.29M|        return UA_ORDER_EQ;                                         \
 2282|  1.29M|    }
ua_types.c:doubleOrder:
 2266|  1.73M|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2267|  1.73M|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2268|  1.73M|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2269|  1.73M|        if(*p1 != *p2) {                                                  \
  ------------------
  |  Branch (2269:12): [True: 3.04k, False: 1.73M]
  ------------------
 2270|  3.04k|            /* p1 is NaN */                                         \
 2271|  3.04k|            if(*p1 != *p1) {                                        \
  ------------------
  |  Branch (2271:16): [True: 3.04k, False: 0]
  ------------------
 2272|  3.04k|                if(*p2 != *p2)                                      \
  ------------------
  |  Branch (2272:20): [True: 3.04k, False: 0]
  ------------------
 2273|  3.04k|                    return UA_ORDER_EQ;                             \
 2274|  3.04k|                return UA_ORDER_LESS;                               \
 2275|  3.04k|            }                                                       \
 2276|  3.04k|            /* p2 is NaN */                                         \
 2277|  3.04k|            if(*p2 != *p2)                                          \
  ------------------
  |  Branch (2277:16): [True: 0, False: 0]
  ------------------
 2278|      0|                return UA_ORDER_MORE;                               \
 2279|      0|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2279:20): [True: 0, False: 0]
  ------------------
 2280|      0|        }                                                           \
 2281|  1.73M|        return UA_ORDER_EQ;                                         \
 2282|  1.73M|    }
ua_types.c:stringOrder:
 2304|   137k|stringOrder(const void *p1_, const void *p2_, const UA_DataType *type) {
 2305|   137k|    const UA_String *p1 = (const UA_String*)p1_;
 2306|   137k|    const UA_String *p2 = (const UA_String*)p2_;
 2307|   137k|    if(p1->length != p2->length)
  ------------------
  |  Branch (2307:8): [True: 8.14k, False: 129k]
  ------------------
 2308|  8.14k|        return (p1->length < p2->length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2308:16): [True: 8.14k, False: 0]
  ------------------
 2309|       |    /* For zero-length arrays, every pointer not NULL is considered a
 2310|       |     * UA_EMPTY_ARRAY_SENTINEL. */
 2311|   129k|    if(p1->data == p2->data) return UA_ORDER_EQ;
  ------------------
  |  Branch (2311:8): [True: 75.2k, False: 54.0k]
  ------------------
 2312|  54.0k|    if(p1->data == NULL) return UA_ORDER_LESS;
  ------------------
  |  Branch (2312:8): [True: 966, False: 53.0k]
  ------------------
 2313|  53.0k|    if(p2->data == NULL) return UA_ORDER_MORE;
  ------------------
  |  Branch (2313:8): [True: 0, False: 53.0k]
  ------------------
 2314|  53.0k|    int cmp = memcmp((const char*)p1->data, (const char*)p2->data, p1->length);
 2315|  53.0k|    if(cmp != 0)
  ------------------
  |  Branch (2315:8): [True: 0, False: 53.0k]
  ------------------
 2316|      0|        return (cmp < 0) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2316:16): [True: 0, False: 0]
  ------------------
 2317|  53.0k|    return UA_ORDER_EQ;
 2318|  53.0k|}
ua_types.c:qualifiedNameOrder:
 2361|  13.6k|qualifiedNameOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2362|  13.6k|    const UA_QualifiedName *p1 = (const UA_QualifiedName*)p1_;
 2363|  13.6k|    const UA_QualifiedName *p2 = (const UA_QualifiedName*)p2_;
 2364|  13.6k|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2364:8): [True: 192, False: 13.4k]
  ------------------
 2365|    192|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2365:16): [True: 192, False: 0]
  ------------------
 2366|  13.4k|    return stringOrder(&p1->name, &p2->name, NULL);
 2367|  13.6k|}
ua_types.c:localizedTextOrder:
 2370|  9.82k|localizedTextOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2371|  9.82k|    const UA_LocalizedText *p1 = (const UA_LocalizedText*)p1_;
 2372|  9.82k|    const UA_LocalizedText *p2 = (const UA_LocalizedText*)p2_;
 2373|  9.82k|    UA_Order o = stringOrder(&p1->locale, &p2->locale, NULL);
 2374|  9.82k|    if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2374:8): [True: 0, False: 9.82k]
  ------------------
 2375|      0|        return o;
 2376|  9.82k|    return stringOrder(&p1->text, &p2->text, NULL);
 2377|  9.82k|}
ua_types.c:extensionObjectOrder:
 2380|   178k|extensionObjectOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2381|   178k|    const UA_ExtensionObject *p1 = (const UA_ExtensionObject*)p1_;
 2382|   178k|    const UA_ExtensionObject *p2 = (const UA_ExtensionObject*)p2_;
 2383|   178k|    UA_ExtensionObjectEncoding enc1 = p1->encoding;
 2384|   178k|    UA_ExtensionObjectEncoding enc2 = p2->encoding;
 2385|   178k|    if(enc1 == UA_EXTENSIONOBJECT_DECODED_NODELETE)
  ------------------
  |  Branch (2385:8): [True: 0, False: 178k]
  ------------------
 2386|      0|        enc1 = UA_EXTENSIONOBJECT_DECODED;
 2387|   178k|    if(enc2 == UA_EXTENSIONOBJECT_DECODED_NODELETE)
  ------------------
  |  Branch (2387:8): [True: 0, False: 178k]
  ------------------
 2388|      0|        enc2 = UA_EXTENSIONOBJECT_DECODED;
 2389|   178k|    if(enc1 != enc2)
  ------------------
  |  Branch (2389:8): [True: 72, False: 178k]
  ------------------
 2390|     72|        return (enc1 < enc2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2390:16): [True: 72, False: 0]
  ------------------
 2391|       |
 2392|   178k|    switch(enc1) {
 2393|   177k|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (2393:5): [True: 177k, False: 967]
  ------------------
 2394|   177k|        return UA_ORDER_EQ;
 2395|       |
 2396|      0|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (2396:5): [True: 0, False: 178k]
  ------------------
 2397|      0|    case UA_EXTENSIONOBJECT_ENCODED_XML:
  ------------------
  |  Branch (2397:5): [True: 0, False: 178k]
  ------------------
 2398|    903|    case UA_EXTENSIONOBJECT_ENCODED_JSON: {
  ------------------
  |  Branch (2398:5): [True: 903, False: 178k]
  ------------------
 2399|    903|            UA_Order o = nodeIdOrder(&p1->content.encoded.typeId,
 2400|    903|                                     &p2->content.encoded.typeId, NULL);
 2401|    903|            if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2401:16): [True: 0, False: 903]
  ------------------
 2402|      0|                return o;
 2403|    903|            return stringOrder((const UA_String*)&p1->content.encoded.body,
 2404|    903|                               (const UA_String*)&p2->content.encoded.body, NULL);
 2405|    903|        }
 2406|       |
 2407|     64|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (2407:5): [True: 64, False: 178k]
  ------------------
 2408|     64|    default: {
  ------------------
  |  Branch (2408:5): [True: 0, False: 178k]
  ------------------
 2409|     64|            const UA_DataType *type1 = p1->content.decoded.type;
 2410|     64|            const UA_DataType *type2 = p2->content.decoded.type;
 2411|     64|            if(type1 != type2)
  ------------------
  |  Branch (2411:16): [True: 0, False: 64]
  ------------------
 2412|      0|                return ((uintptr_t)type1 < (uintptr_t)type2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2412:24): [True: 0, False: 0]
  ------------------
 2413|     64|            if(!type1)
  ------------------
  |  Branch (2413:16): [True: 0, False: 64]
  ------------------
 2414|      0|                return UA_ORDER_EQ;
 2415|     64|            return orderJumpTable[type1->typeKind]
 2416|     64|                (p1->content.decoded.data, p2->content.decoded.data, type1);
 2417|     64|        }
 2418|   178k|    }
 2419|   178k|}
ua_types.c:dataValueOrder:
 2483|   413k|dataValueOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2484|   413k|    const UA_DataValue *p1 = (const UA_DataValue*)p1_;
 2485|   413k|    const UA_DataValue *p2 = (const UA_DataValue*)p2_;
 2486|       |    /* Value */
 2487|   413k|    if(p1->hasValue != p2->hasValue)
  ------------------
  |  Branch (2487:8): [True: 30, False: 413k]
  ------------------
 2488|     30|        return (!p1->hasValue) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2488:16): [True: 30, False: 0]
  ------------------
 2489|   413k|    if(p1->hasValue) {
  ------------------
  |  Branch (2489:8): [True: 7.53k, False: 405k]
  ------------------
 2490|  7.53k|        UA_Order o = variantOrder(&p1->value, &p2->value, NULL);
 2491|  7.53k|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2491:12): [True: 0, False: 7.53k]
  ------------------
 2492|      0|            return o;
 2493|  7.53k|    }
 2494|       |
 2495|       |    /* Status */
 2496|   413k|    if(p1->hasStatus != p2->hasStatus)
  ------------------
  |  Branch (2496:8): [True: 0, False: 413k]
  ------------------
 2497|      0|        return (!p1->hasStatus) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2497:16): [True: 0, False: 0]
  ------------------
 2498|   413k|    if(p1->hasStatus && p1->status != p2->status)
  ------------------
  |  Branch (2498:8): [True: 0, False: 413k]
  |  Branch (2498:25): [True: 0, False: 0]
  ------------------
 2499|      0|        return (p1->status < p2->status) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2499:16): [True: 0, False: 0]
  ------------------
 2500|       |
 2501|       |    /* SourceTimestamp */
 2502|   413k|    if(p1->hasSourceTimestamp != p2->hasSourceTimestamp)
  ------------------
  |  Branch (2502:8): [True: 0, False: 413k]
  ------------------
 2503|      0|        return (!p1->hasSourceTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2503:16): [True: 0, False: 0]
  ------------------
 2504|   413k|    if(p1->hasSourceTimestamp && p1->sourceTimestamp != p2->sourceTimestamp)
  ------------------
  |  Branch (2504:8): [True: 0, False: 413k]
  |  Branch (2504:34): [True: 0, False: 0]
  ------------------
 2505|      0|        return (p1->sourceTimestamp < p2->sourceTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2505:16): [True: 0, False: 0]
  ------------------
 2506|       |
 2507|       |    /* ServerTimestamp */
 2508|   413k|    if(p1->hasServerTimestamp != p2->hasServerTimestamp)
  ------------------
  |  Branch (2508:8): [True: 0, False: 413k]
  ------------------
 2509|      0|        return (!p1->hasServerTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2509:16): [True: 0, False: 0]
  ------------------
 2510|   413k|    if(p1->hasServerTimestamp && p1->serverTimestamp != p2->serverTimestamp)
  ------------------
  |  Branch (2510:8): [True: 0, False: 413k]
  |  Branch (2510:34): [True: 0, False: 0]
  ------------------
 2511|      0|        return (p1->serverTimestamp < p2->serverTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2511:16): [True: 0, False: 0]
  ------------------
 2512|       |
 2513|       |    /* SourcePicoseconds */
 2514|   413k|    if(p1->hasSourcePicoseconds != p2->hasSourcePicoseconds)
  ------------------
  |  Branch (2514:8): [True: 0, False: 413k]
  ------------------
 2515|      0|        return (!p1->hasSourcePicoseconds) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2515:16): [True: 0, False: 0]
  ------------------
 2516|   413k|    if(p1->hasSourcePicoseconds && p1->sourcePicoseconds != p2->sourcePicoseconds)
  ------------------
  |  Branch (2516:8): [True: 0, False: 413k]
  |  Branch (2516:36): [True: 0, False: 0]
  ------------------
 2517|      0|        return (p1->sourcePicoseconds < p2->sourcePicoseconds) ?
  ------------------
  |  Branch (2517:16): [True: 0, False: 0]
  ------------------
 2518|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2519|       |
 2520|       |    /* ServerPicoseconds */
 2521|   413k|    if(p1->hasServerPicoseconds != p2->hasServerPicoseconds)
  ------------------
  |  Branch (2521:8): [True: 0, False: 413k]
  ------------------
 2522|      0|        return (!p1->hasServerPicoseconds) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2522:16): [True: 0, False: 0]
  ------------------
 2523|   413k|    if(p1->hasServerPicoseconds && p1->serverPicoseconds != p2->serverPicoseconds)
  ------------------
  |  Branch (2523:8): [True: 0, False: 413k]
  |  Branch (2523:36): [True: 0, False: 0]
  ------------------
 2524|      0|        return (p1->serverPicoseconds < p2->serverPicoseconds) ?
  ------------------
  |  Branch (2524:16): [True: 0, False: 0]
  ------------------
 2525|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2526|       |
 2527|   413k|    return UA_ORDER_EQ;
 2528|   413k|}
ua_types.c:variantOrder:
 2446|  74.1k|variantOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2447|  74.1k|    const UA_Variant *p1 = (const UA_Variant*)p1_;
 2448|  74.1k|    const UA_Variant *p2 = (const UA_Variant*)p2_;
 2449|  74.1k|    if(p1->type != p2->type)
  ------------------
  |  Branch (2449:8): [True: 0, False: 74.1k]
  ------------------
 2450|      0|        return ((uintptr_t)p1->type < (uintptr_t)p2->type) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2450:16): [True: 0, False: 0]
  ------------------
 2451|       |
 2452|  74.1k|    UA_Order o;
 2453|  74.1k|    if(p1->type != NULL) {
  ------------------
  |  Branch (2453:8): [True: 17.3k, False: 56.7k]
  ------------------
 2454|       |        /* Check if both variants are scalars or arrays */
 2455|  17.3k|        UA_Boolean s1 = UA_Variant_isScalar(p1);
 2456|  17.3k|        UA_Boolean s2 = UA_Variant_isScalar(p2);
 2457|  17.3k|        if(s1 != s2)
  ------------------
  |  Branch (2457:12): [True: 0, False: 17.3k]
  ------------------
 2458|      0|            return s1 ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2458:20): [True: 0, False: 0]
  ------------------
 2459|  17.3k|        if(s1) {
  ------------------
  |  Branch (2459:12): [True: 11.8k, False: 5.50k]
  ------------------
 2460|  11.8k|            o = orderJumpTable[p1->type->typeKind](p1->data, p2->data, p1->type);
 2461|  11.8k|        } else {
 2462|       |            /* Mismatching array length? */
 2463|  5.50k|            if(p1->arrayLength != p2->arrayLength)
  ------------------
  |  Branch (2463:16): [True: 0, False: 5.50k]
  ------------------
 2464|      0|                return (p1->arrayLength < p2->arrayLength) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2464:24): [True: 0, False: 0]
  ------------------
 2465|  5.50k|            o = arrayOrder(p1->data, p1->arrayLength, p2->data, p2->arrayLength, p1->type);
 2466|  5.50k|        }
 2467|  17.3k|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2467:12): [True: 0, False: 17.3k]
  ------------------
 2468|      0|            return o;
 2469|  17.3k|    }
 2470|       |
 2471|  74.1k|    if(p1->arrayDimensionsSize != p2->arrayDimensionsSize)
  ------------------
  |  Branch (2471:8): [True: 0, False: 74.1k]
  ------------------
 2472|      0|        return (p1->arrayDimensionsSize < p2->arrayDimensionsSize) ?
  ------------------
  |  Branch (2472:16): [True: 0, False: 0]
  ------------------
 2473|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2474|  74.1k|    o = UA_ORDER_EQ;
 2475|  74.1k|    if(p1->arrayDimensionsSize > 0)
  ------------------
  |  Branch (2475:8): [True: 0, False: 74.1k]
  ------------------
 2476|      0|        o = arrayOrder(p1->arrayDimensions, p1->arrayDimensionsSize,
 2477|      0|                       p2->arrayDimensions, p2->arrayDimensionsSize,
 2478|      0|                       &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  232|      0|#define UA_TYPES_UINT32 6
  ------------------
 2479|  74.1k|    return o;
 2480|  74.1k|}
ua_types.c:arrayOrder:
 2430|  9.13k|           const UA_DataType *type) {
 2431|  9.13k|    if(p1Length != p2Length)
  ------------------
  |  Branch (2431:8): [True: 0, False: 9.13k]
  ------------------
 2432|      0|        return (p1Length < p2Length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2432:16): [True: 0, False: 0]
  ------------------
 2433|  9.13k|    uintptr_t u1 = (uintptr_t)p1;
 2434|  9.13k|    uintptr_t u2 = (uintptr_t)p2;
 2435|  7.52M|    for(size_t i = 0; i < p1Length; i++) {
  ------------------
  |  Branch (2435:23): [True: 7.51M, False: 9.13k]
  ------------------
 2436|  7.51M|        UA_Order o = orderJumpTable[type->typeKind]((const void*)u1, (const void*)u2, type);
 2437|  7.51M|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2437:12): [True: 0, False: 7.51M]
  ------------------
 2438|      0|            return o;
 2439|  7.51M|        u1 += type->memSize;
 2440|  7.51M|        u2 += type->memSize;
 2441|  7.51M|    }
 2442|  9.13k|    return UA_ORDER_EQ;
 2443|  9.13k|}
ua_types.c:diagnosticInfoOrder:
 2531|      4|diagnosticInfoOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2532|      4|    const UA_DiagnosticInfo *p1 = (const UA_DiagnosticInfo*)p1_;
 2533|      4|    const UA_DiagnosticInfo *p2 = (const UA_DiagnosticInfo*)p2_;
 2534|       |    /* SymbolicId */
 2535|      4|    if(p1->hasSymbolicId != p2->hasSymbolicId)
  ------------------
  |  Branch (2535:8): [True: 0, False: 4]
  ------------------
 2536|      0|        return (!p1->hasSymbolicId) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2536:16): [True: 0, False: 0]
  ------------------
 2537|      4|    if(p1->hasSymbolicId && p1->symbolicId != p2->symbolicId)
  ------------------
  |  Branch (2537:8): [True: 0, False: 4]
  |  Branch (2537:29): [True: 0, False: 0]
  ------------------
 2538|      0|        return (p1->symbolicId < p2->symbolicId) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2538:16): [True: 0, False: 0]
  ------------------
 2539|       |
 2540|       |    /* NamespaceUri */
 2541|      4|    if(p1->hasNamespaceUri != p2->hasNamespaceUri)
  ------------------
  |  Branch (2541:8): [True: 0, False: 4]
  ------------------
 2542|      0|        return (!p1->hasNamespaceUri) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2542:16): [True: 0, False: 0]
  ------------------
 2543|      4|    if(p1->hasNamespaceUri && p1->namespaceUri != p2->namespaceUri)
  ------------------
  |  Branch (2543:8): [True: 0, False: 4]
  |  Branch (2543:31): [True: 0, False: 0]
  ------------------
 2544|      0|        return (p1->namespaceUri < p2->namespaceUri) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2544:16): [True: 0, False: 0]
  ------------------
 2545|       |
 2546|       |    /* LocalizedText */
 2547|      4|    if(p1->hasLocalizedText != p2->hasLocalizedText)
  ------------------
  |  Branch (2547:8): [True: 0, False: 4]
  ------------------
 2548|      0|        return (!p1->hasLocalizedText) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2548:16): [True: 0, False: 0]
  ------------------
 2549|      4|    if(p1->hasLocalizedText && p1->localizedText != p2->localizedText)
  ------------------
  |  Branch (2549:8): [True: 0, False: 4]
  |  Branch (2549:32): [True: 0, False: 0]
  ------------------
 2550|      0|        return (p1->localizedText < p2->localizedText) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2550:16): [True: 0, False: 0]
  ------------------
 2551|       |
 2552|       |    /* Locale */
 2553|      4|    if(p1->hasLocale != p2->hasLocale)
  ------------------
  |  Branch (2553:8): [True: 0, False: 4]
  ------------------
 2554|      0|        return (!p1->hasLocale) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2554:16): [True: 0, False: 0]
  ------------------
 2555|      4|    if(p1->hasLocale && p1->locale != p2->locale)
  ------------------
  |  Branch (2555:8): [True: 0, False: 4]
  |  Branch (2555:25): [True: 0, False: 0]
  ------------------
 2556|      0|        return (p1->locale < p2->locale) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2556:16): [True: 0, False: 0]
  ------------------
 2557|       |
 2558|       |    /* AdditionalInfo */
 2559|      4|    if(p1->hasAdditionalInfo != p2->hasAdditionalInfo)
  ------------------
  |  Branch (2559:8): [True: 0, False: 4]
  ------------------
 2560|      0|        return (!p1->hasAdditionalInfo) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2560:16): [True: 0, False: 0]
  ------------------
 2561|      4|    if(p1->hasAdditionalInfo) {
  ------------------
  |  Branch (2561:8): [True: 0, False: 4]
  ------------------
 2562|      0|        UA_Order o = stringOrder(&p1->additionalInfo, &p2->additionalInfo, NULL);
 2563|      0|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2563:12): [True: 0, False: 0]
  ------------------
 2564|      0|            return o;
 2565|      0|    }
 2566|       |
 2567|       |    /* InnerStatusCode */
 2568|      4|    if(p1->hasInnerStatusCode != p2->hasInnerStatusCode)
  ------------------
  |  Branch (2568:8): [True: 0, False: 4]
  ------------------
 2569|      0|        return (!p1->hasInnerStatusCode) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2569:16): [True: 0, False: 0]
  ------------------
 2570|      4|    if(p1->hasInnerStatusCode && p1->innerStatusCode != p2->innerStatusCode)
  ------------------
  |  Branch (2570:8): [True: 0, False: 4]
  |  Branch (2570:34): [True: 0, False: 0]
  ------------------
 2571|      0|        return (p1->innerStatusCode < p2->innerStatusCode) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2571:16): [True: 0, False: 0]
  ------------------
 2572|       |
 2573|       |    /* InnerDiagnosticInfo */
 2574|      4|    if(p1->hasInnerDiagnosticInfo != p2->hasInnerDiagnosticInfo)
  ------------------
  |  Branch (2574:8): [True: 0, False: 4]
  ------------------
 2575|      0|        return (!p1->hasInnerDiagnosticInfo) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2575:16): [True: 0, False: 0]
  ------------------
 2576|      4|    if(p1->innerDiagnosticInfo == p2->innerDiagnosticInfo)
  ------------------
  |  Branch (2576:8): [True: 4, False: 0]
  ------------------
 2577|      4|        return UA_ORDER_EQ;
 2578|      0|    if(!p1->innerDiagnosticInfo || !p2->innerDiagnosticInfo)
  ------------------
  |  Branch (2578:8): [True: 0, False: 0]
  |  Branch (2578:36): [True: 0, False: 0]
  ------------------
 2579|      0|        return (!p1->innerDiagnosticInfo) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2579:16): [True: 0, False: 0]
  ------------------
 2580|      0|    return diagnosticInfoOrder(p1->innerDiagnosticInfo, p2->innerDiagnosticInfo, NULL);
 2581|      0|}
ua_types.c:structureOrder:
 2584|  4.37k|structureOrder(const void *p1, const void *p2, const UA_DataType *type) {
 2585|  4.37k|    uintptr_t u1 = (uintptr_t)p1;
 2586|  4.37k|    uintptr_t u2 = (uintptr_t)p2;
 2587|  4.37k|    UA_Order o = UA_ORDER_EQ;
 2588|  32.3k|    for(size_t i = 0; i < type->membersSize; ++i) {
  ------------------
  |  Branch (2588:23): [True: 27.9k, False: 4.37k]
  ------------------
 2589|  27.9k|        const UA_DataTypeMember *m = &type->members[i];
 2590|  27.9k|        const UA_DataType *mt = m->memberType;
 2591|  27.9k|        u1 += m->padding;
 2592|  27.9k|        u2 += m->padding;
 2593|  27.9k|        if(!m->isOptional) {
  ------------------
  |  Branch (2593:12): [True: 27.9k, False: 0]
  ------------------
 2594|  27.9k|            if(!m->isArray) {
  ------------------
  |  Branch (2594:16): [True: 24.3k, False: 3.62k]
  ------------------
 2595|  24.3k|                o = orderJumpTable[mt->typeKind]((const void *)u1, (const void *)u2, mt);
 2596|  24.3k|                u1 += mt->memSize;
 2597|  24.3k|                u2 += mt->memSize;
 2598|  24.3k|            } else {
 2599|  3.62k|                size_t size1 = *(size_t*)u1;
 2600|  3.62k|                size_t size2 = *(size_t*)u2;
 2601|  3.62k|                u1 += sizeof(size_t);
 2602|  3.62k|                u2 += sizeof(size_t);
 2603|  3.62k|                o = arrayOrder(*(void* const*)u1, size1, *(void* const*)u2, size2, mt);
 2604|  3.62k|                u1 += sizeof(void*);
 2605|  3.62k|                u2 += sizeof(void*);
 2606|  3.62k|            }
 2607|  27.9k|        } else {
 2608|      0|            if(!m->isArray) {
  ------------------
  |  Branch (2608:16): [True: 0, False: 0]
  ------------------
 2609|      0|                const void *pp1 = *(void* const*)u1;
 2610|      0|                const void *pp2 = *(void* const*)u2;
 2611|      0|                if(pp1 == pp2) {
  ------------------
  |  Branch (2611:20): [True: 0, False: 0]
  ------------------
 2612|      0|                    o = UA_ORDER_EQ;
 2613|      0|                } else if(pp1 == NULL) {
  ------------------
  |  Branch (2613:27): [True: 0, False: 0]
  ------------------
 2614|      0|                    o = UA_ORDER_LESS;
 2615|      0|                } else if(pp2 == NULL) {
  ------------------
  |  Branch (2615:27): [True: 0, False: 0]
  ------------------
 2616|      0|                    o = UA_ORDER_MORE;
 2617|      0|                } else {
 2618|      0|                    o = orderJumpTable[mt->typeKind](pp1, pp2, mt);
 2619|      0|                }
 2620|      0|            } else {
 2621|      0|                size_t sa1 = *(size_t*)u1;
 2622|      0|                size_t sa2 = *(size_t*)u2;
 2623|      0|                u1 += sizeof(size_t);
 2624|      0|                u2 += sizeof(size_t);
 2625|      0|                o = arrayOrder(*(void* const*)u1, sa1, *(void* const*)u2, sa2, mt);
 2626|      0|            }
 2627|      0|            u1 += sizeof(void*);
 2628|      0|            u2 += sizeof(void*);
 2629|      0|        }
 2630|       |
 2631|  27.9k|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2631:12): [True: 0, False: 27.9k]
  ------------------
 2632|      0|            break;
 2633|  27.9k|    }
 2634|  4.37k|    return o;
 2635|  4.37k|}

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

writeJsonBeforeElement:
  108|  22.7M|writeJsonBeforeElement(CtxJson *ctx, UA_Boolean distinct) {
  109|  22.7M|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  22.7M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  110|       |    /* Comma if needed */
  111|  22.7M|    if(ctx->commaNeeded[ctx->depth])
  ------------------
  |  Branch (111:8): [True: 22.6M, False: 80.8k]
  ------------------
  112|  22.6M|        res |= writeChar(ctx, ',');
  113|  22.7M|    if(ctx->prettyPrint) {
  ------------------
  |  Branch (113:8): [True: 0, False: 22.7M]
  ------------------
  114|      0|        if(distinct) {
  ------------------
  |  Branch (114:12): [True: 0, False: 0]
  ------------------
  115|       |            /* Newline and indent if needed */
  116|      0|            res |= writeChar(ctx, '\n');
  117|      0|            for(size_t i = 0; i < ctx->depth; i++)
  ------------------
  |  Branch (117:31): [True: 0, False: 0]
  ------------------
  118|      0|                res |= writeChar(ctx, '\t');
  119|      0|        } else if(ctx->commaNeeded[ctx->depth]) {
  ------------------
  |  Branch (119:19): [True: 0, False: 0]
  ------------------
  120|       |            /* Space after the comma if no newline */
  121|      0|            res |= writeChar(ctx, ' ');
  122|      0|        }
  123|      0|    }
  124|  22.7M|    return res;
  125|  22.7M|}
writeJsonObjStart:
  127|  1.52M|WRITE_JSON_ELEMENT(ObjStart) {
  128|       |    /* Increase depth, save: before first key-value no comma needed. */
  129|  1.52M|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION)
  ------------------
  |  |  128|  1.52M|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (129:8): [True: 0, False: 1.52M]
  ------------------
  130|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  131|  1.52M|    ctx->depth++;
  132|       |    ctx->commaNeeded[ctx->depth] = false;
  133|  1.52M|    return writeChar(ctx, '{');
  134|  1.52M|}
writeJsonObjEnd:
  136|  1.52M|WRITE_JSON_ELEMENT(ObjEnd) {
  137|  1.52M|    if(ctx->depth == 0)
  ------------------
  |  Branch (137:8): [True: 0, False: 1.52M]
  ------------------
  138|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  139|       |
  140|  1.52M|    UA_Boolean have_elem = ctx->commaNeeded[ctx->depth];
  141|  1.52M|    ctx->depth--;
  142|  1.52M|    ctx->commaNeeded[ctx->depth] = true;
  143|       |
  144|  1.52M|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.52M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  145|  1.52M|    if(ctx->prettyPrint && have_elem) {
  ------------------
  |  Branch (145:8): [True: 0, False: 1.52M]
  |  Branch (145:28): [True: 0, False: 0]
  ------------------
  146|      0|        res |= writeChar(ctx, '\n');
  147|      0|        for(size_t i = 0; i < ctx->depth; i++)
  ------------------
  |  Branch (147:27): [True: 0, False: 0]
  ------------------
  148|      0|            res |= writeChar(ctx, '\t');
  149|      0|    }
  150|  1.52M|    return res | writeChar(ctx, '}');
  151|  1.52M|}
writeJsonArrStart:
  153|  16.7k|WRITE_JSON_ELEMENT(ArrStart) {
  154|       |    /* Increase depth, save: before first array entry no comma needed. */
  155|  16.7k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION)
  ------------------
  |  |  128|  16.7k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (155:8): [True: 0, False: 16.7k]
  ------------------
  156|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  157|  16.7k|    ctx->depth++;
  158|       |    ctx->commaNeeded[ctx->depth] = false;
  159|  16.7k|    return writeChar(ctx, '[');
  160|  16.7k|}
writeJsonArrEnd:
  163|  16.7k|writeJsonArrEnd(CtxJson *ctx, const UA_DataType *type) {
  164|  16.7k|    if(ctx->depth == 0)
  ------------------
  |  Branch (164:8): [True: 0, False: 16.7k]
  ------------------
  165|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  166|  16.7k|    UA_Boolean have_elem = ctx->commaNeeded[ctx->depth];
  167|  16.7k|    ctx->depth--;
  168|  16.7k|    ctx->commaNeeded[ctx->depth] = true;
  169|       |
  170|       |    /* If the array does not contain JSON objects (with a newline after), then
  171|       |     * add the closing ] on the same line */
  172|  16.7k|    UA_Boolean distinct = (!type || type->typeKind > UA_DATATYPEKIND_DOUBLE);
  ------------------
  |  Branch (172:28): [True: 0, False: 16.7k]
  |  Branch (172:37): [True: 12.7k, False: 4.01k]
  ------------------
  173|  16.7k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  16.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  174|  16.7k|    if(ctx->prettyPrint && have_elem && distinct) {
  ------------------
  |  Branch (174:8): [True: 0, False: 16.7k]
  |  Branch (174:28): [True: 0, False: 0]
  |  Branch (174:41): [True: 0, False: 0]
  ------------------
  175|      0|        res |= writeChar(ctx, '\n');
  176|      0|        for(size_t i = 0; i < ctx->depth; i++)
  ------------------
  |  Branch (176:27): [True: 0, False: 0]
  ------------------
  177|      0|            res |= writeChar(ctx, '\t');
  178|      0|    }
  179|  16.7k|    return res | writeChar(ctx, ']');
  180|  16.7k|}
writeJsonArrElm:
  184|  22.5M|                const UA_DataType *type) {
  185|  22.5M|    UA_Boolean distinct = (type->typeKind > UA_DATATYPEKIND_DOUBLE);
  186|  22.5M|    status ret = writeJsonBeforeElement(ctx, distinct);
  187|       |    ctx->commaNeeded[ctx->depth] = true;
  188|  22.5M|    return ret | encodeJsonJumpTable[type->typeKind](ctx, value, type);
  189|  22.5M|}
writeJsonKey:
  238|   184k|writeJsonKey(CtxJson *ctx, const char* key) {
  239|   184k|    status ret = writeJsonBeforeElement(ctx, true);
  240|   184k|    ctx->commaNeeded[ctx->depth] = true;
  241|   184k|    if(!ctx->unquotedKeys)
  ------------------
  |  Branch (241:8): [True: 184k, False: 0]
  ------------------
  242|   184k|        ret |= writeChar(ctx, '\"');
  243|   184k|    ret |= writeChars(ctx, key, strlen(key));
  244|   184k|    if(!ctx->unquotedKeys)
  ------------------
  |  Branch (244:8): [True: 184k, False: 0]
  ------------------
  245|   184k|        ret |= writeChar(ctx, '\"');
  246|   184k|    ret |= writeChar(ctx, ':');
  247|   184k|    if(ctx->prettyPrint)
  ------------------
  |  Branch (247:8): [True: 0, False: 184k]
  ------------------
  248|      0|        ret |= writeChar(ctx, ' ');
  249|   184k|    return ret;
  250|   184k|}
UA_encodeJson:
 1198|  6.94k|              const UA_EncodeJsonOptions *options) {
 1199|  6.94k|    if(!src || !type)
  ------------------
  |  Branch (1199:8): [True: 0, False: 6.94k]
  |  Branch (1199:16): [True: 0, False: 6.94k]
  ------------------
 1200|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 1201|       |
 1202|       |    /* Allocate buffer */
 1203|  6.94k|    UA_Boolean allocated = false;
 1204|  6.94k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  6.94k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1205|  6.94k|    if(outBuf->length == 0) {
  ------------------
  |  Branch (1205:8): [True: 0, False: 6.94k]
  ------------------
 1206|      0|        size_t len = UA_calcSizeJson(src, type, options);
 1207|      0|        res = UA_ByteString_allocBuffer(outBuf, len);
 1208|      0|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1208:12): [True: 0, False: 0]
  ------------------
 1209|      0|            return res;
 1210|      0|        allocated = true;
 1211|      0|    }
 1212|       |
 1213|       |    /* Set up the context */
 1214|  6.94k|    CtxJson ctx;
 1215|  6.94k|    memset(&ctx, 0, sizeof(ctx));
 1216|  6.94k|    ctx.pos = outBuf->data;
 1217|  6.94k|    ctx.end = &outBuf->data[outBuf->length];
 1218|  6.94k|    ctx.depth = 0;
 1219|  6.94k|    ctx.calcOnly = false;
 1220|  6.94k|    if(options) {
  ------------------
  |  Branch (1220:8): [True: 0, False: 6.94k]
  ------------------
 1221|      0|        ctx.namespaceMapping = options->namespaceMapping;
 1222|      0|        ctx.serverUris = options->serverUris;
 1223|      0|        ctx.serverUrisSize = options->serverUrisSize;
 1224|      0|        ctx.useCompactEncoding = options->useCompactEncoding;
 1225|      0|        ctx.prettyPrint = options->prettyPrint;
 1226|      0|        ctx.unquotedKeys = options->unquotedKeys;
 1227|      0|    }
 1228|       |
 1229|       |    /* Encode */
 1230|  6.94k|    res = encodeJsonJumpTable[type->typeKind](&ctx, src, type);
 1231|       |
 1232|       |    /* Clean up */
 1233|  6.94k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.94k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1233:8): [True: 6.94k, False: 0]
  ------------------
 1234|  6.94k|        outBuf->length = (size_t)((uintptr_t)ctx.pos - (uintptr_t)outBuf->data);
 1235|      0|    else if(allocated)
  ------------------
  |  Branch (1235:13): [True: 0, False: 0]
  ------------------
 1236|      0|        UA_ByteString_clear(outBuf);
 1237|  6.94k|    return res;
 1238|  6.94k|}
UA_calcSizeJson:
 1261|  3.47k|                const UA_EncodeJsonOptions *options) {
 1262|  3.47k|    if(!src || !type)
  ------------------
  |  Branch (1262:8): [True: 0, False: 3.47k]
  |  Branch (1262:16): [True: 0, False: 3.47k]
  ------------------
 1263|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 1264|       |
 1265|       |    /* Set up the context */
 1266|  3.47k|    CtxJson ctx;
 1267|  3.47k|    memset(&ctx, 0, sizeof(ctx));
 1268|  3.47k|    ctx.pos = (UA_Byte*)0x01;
 1269|  3.47k|    ctx.end = (const UA_Byte*)(uintptr_t)SIZE_MAX;
 1270|  3.47k|    ctx.depth = 0;
 1271|  3.47k|    if(options) {
  ------------------
  |  Branch (1271:8): [True: 0, False: 3.47k]
  ------------------
 1272|      0|        ctx.namespaceMapping = options->namespaceMapping;
 1273|      0|        ctx.serverUris = options->serverUris;
 1274|      0|        ctx.serverUrisSize = options->serverUrisSize;
 1275|      0|        ctx.useCompactEncoding = options->useCompactEncoding;
 1276|      0|        ctx.prettyPrint = options->prettyPrint;
 1277|      0|        ctx.unquotedKeys = options->unquotedKeys;
 1278|      0|    }
 1279|       |
 1280|  3.47k|    ctx.calcOnly = true;
 1281|       |
 1282|       |    /* Encode */
 1283|  3.47k|    status ret = encodeJsonJumpTable[type->typeKind](&ctx, src, type);
 1284|  3.47k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  3.47k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1284:8): [True: 2, False: 3.47k]
  ------------------
 1285|      2|        return 0;
 1286|  3.47k|    return ((size_t)ctx.pos) - 1u;
 1287|  3.47k|}
lookAheadForKey:
 1810|   144k|lookAheadForKey(ParseCtx *ctx, const char *key, size_t *resultIndex) {
 1811|       |    /* The current index must point to the beginning of an object.
 1812|       |     * This has to be ensured by the caller. */
 1813|   144k|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  248|   144k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1813:5): [True: 144k, False: 0]
  ------------------
 1814|       |
 1815|   144k|    status ret = UA_STATUSCODE_BADNOTFOUND;
  ------------------
  |  |  233|   144k|#define UA_STATUSCODE_BADNOTFOUND ((UA_StatusCode) 0x803E0000)
  ------------------
 1816|   144k|    size_t oldIndex = ctx->index; /* Save index for later restore */
 1817|   144k|    unsigned int end = ctx->tokens[ctx->index].end;
 1818|   144k|    ctx->index++; /* Move to the first key */
 1819|   809k|    while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1819:11): [True: 799k, False: 10.8k]
  ------------------
 1820|   799k|          ctx->tokens[ctx->index].start < end) {
  ------------------
  |  Branch (1820:11): [True: 754k, False: 44.2k]
  ------------------
 1821|       |        /* Key must be a string */
 1822|   754k|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  248|   754k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1822:9): [True: 754k, False: 0]
  ------------------
 1823|       |
 1824|       |        /* Move index to the value */
 1825|   754k|        ctx->index++;
 1826|       |
 1827|       |        /* Value for the key must exist */
 1828|   754k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  248|   754k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1828:9): [True: 754k, False: 0]
  ------------------
 1829|       |
 1830|       |        /* Compare the key (previous index) */
 1831|   754k|        if(jsoneq(ctx->json5, &ctx->tokens[ctx->index-1], key) == 0) {
  ------------------
  |  Branch (1831:12): [True: 89.7k, False: 665k]
  ------------------
 1832|  89.7k|            *resultIndex = ctx->index; /* Point result to the current index */
 1833|  89.7k|            ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  89.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1834|  89.7k|            break;
 1835|  89.7k|        }
 1836|       |
 1837|   665k|        skipObject(ctx); /* Jump over the value (can also be an array or object) */
 1838|   665k|    }
 1839|   144k|    ctx->index = oldIndex; /* Restore the old index */
 1840|   144k|    return ret;
 1841|   144k|}
decodeFields:
 2620|   886k|decodeFields(ParseCtx *ctx, DecodeEntry *entries, size_t entryCount) {
 2621|       |    return decodeFieldsInternal(ctx, entries, entryCount, false);
 2622|   886k|}
tokenize:
 2955|  11.3k|         size_t *decodedLength) {
 2956|       |    /* Tokenize */
 2957|  11.3k|    cj5_options options;
 2958|  11.3k|    options.stop_early = (decodedLength != NULL);
 2959|  11.3k|    cj5_result r = cj5_parse((char*)src->data, (unsigned int)src->length,
 2960|  11.3k|                             ctx->tokens, (unsigned int)tokensSize, &options);
 2961|       |
 2962|       |    /* Handle overflow error by allocating the number of tokens the parser would
 2963|       |     * have needed */
 2964|  11.3k|    if(r.error == CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (2964:8): [True: 911, False: 10.4k]
  ------------------
 2965|    911|       tokensSize != r.num_tokens) {
  ------------------
  |  Branch (2965:8): [True: 911, False: 0]
  ------------------
 2966|       |#if SIZE_MAX <= UINT_MAX
 2967|       |        if((size_t)r.num_tokens > SIZE_MAX / sizeof(cj5_token))
 2968|       |            return UA_STATUSCODE_BADDECODINGERROR;
 2969|       |#endif
 2970|    911|        ctx->tokens = (cj5_token*)
 2971|    911|            UA_malloc(sizeof(cj5_token) * r.num_tokens);
  ------------------
  |  |   22|    911|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 2972|    911|        if(!ctx->tokens)
  ------------------
  |  Branch (2972:12): [True: 0, False: 911]
  ------------------
 2973|      0|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2974|    911|        return tokenize(ctx, src, r.num_tokens, decodedLength);
 2975|    911|    }
 2976|       |
 2977|       |    /* Cannot recover from other errors */
 2978|  10.4k|    if(r.error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (2978:8): [True: 566, False: 9.89k]
  ------------------
 2979|    566|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    566|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2980|       |
 2981|  9.89k|    if(decodedLength)
  ------------------
  |  Branch (2981:8): [True: 0, False: 9.89k]
  ------------------
 2982|      0|        *decodedLength = ctx->tokens[0].end + 1;
 2983|       |
 2984|       |    /* Set up the context */
 2985|  9.89k|    ctx->json5 = (char*)src->data;
 2986|  9.89k|    ctx->depth = 0;
 2987|  9.89k|    ctx->tokensSize = r.num_tokens;
 2988|  9.89k|    ctx->index = 0;
 2989|  9.89k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  9.89k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2990|  10.4k|}
UA_decodeJson:
 2994|  10.4k|              const UA_DecodeJsonOptions *options) {
 2995|  10.4k|    if(!dst || !src || !type)
  ------------------
  |  Branch (2995:8): [True: 0, False: 10.4k]
  |  Branch (2995:16): [True: 0, False: 10.4k]
  |  Branch (2995:24): [True: 0, False: 10.4k]
  ------------------
 2996|      0|        return UA_STATUSCODE_BADARGUMENTSMISSING;
  ------------------
  |  |  449|      0|#define UA_STATUSCODE_BADARGUMENTSMISSING ((UA_StatusCode) 0x80760000)
  ------------------
 2997|       |
 2998|       |    /* The destination is always initialized, including tokenizer failures. */
 2999|  10.4k|    memset(dst, 0, type->memSize);
 3000|       |
 3001|       |    /* Set up the context */
 3002|  10.4k|    cj5_token tokens[UA_JSON_MAXTOKENCOUNT];
 3003|  10.4k|    ParseCtx ctx;
 3004|  10.4k|    memset(&ctx, 0, sizeof(ParseCtx));
 3005|  10.4k|    ctx.tokens = tokens;
 3006|       |
 3007|  10.4k|    if(options) {
  ------------------
  |  Branch (3007:8): [True: 0, False: 10.4k]
  ------------------
 3008|      0|        ctx.namespaceMapping = options->namespaceMapping;
 3009|      0|        ctx.serverUris = options->serverUris;
 3010|      0|        ctx.serverUrisSize = options->serverUrisSize;
 3011|      0|        ctx.customTypes = options->customTypes;
 3012|      0|    }
 3013|       |
 3014|       |    /* Decode */
 3015|  10.4k|    status ret = tokenize(&ctx, src, UA_JSON_MAXTOKENCOUNT,
  ------------------
  |  |  127|  10.4k|#define UA_JSON_MAXTOKENCOUNT 256
  ------------------
 3016|  10.4k|                          options ? options->decodedLength : NULL);
  ------------------
  |  Branch (3016:27): [True: 0, False: 10.4k]
  ------------------
 3017|  10.4k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  10.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (3017:8): [True: 566, False: 9.89k]
  ------------------
 3018|    566|        goto cleanup;
 3019|       |
 3020|  9.89k|    ret = decodeJsonJumpTable[type->typeKind](&ctx, dst, type);
 3021|       |
 3022|       |    /* Boundary decoding intentionally stops after the first JSON value. */
 3023|  9.89k|    if((!options || !options->decodedLength) &&
  ------------------
  |  Branch (3023:9): [True: 9.89k, False: 0]
  |  Branch (3023:21): [True: 0, False: 0]
  ------------------
 3024|  9.89k|       ctx.index != ctx.tokensSize)
  ------------------
  |  Branch (3024:8): [True: 644, False: 9.25k]
  ------------------
 3025|    644|        ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    644|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 3026|       |
 3027|  10.4k| cleanup:
 3028|       |
 3029|       |    /* Free token array on the heap */
 3030|  10.4k|    if(ctx.tokens != tokens)
  ------------------
  |  Branch (3030:8): [True: 911, False: 9.55k]
  ------------------
 3031|    911|        UA_free((void*)(uintptr_t)ctx.tokens);
  ------------------
  |  |   23|    911|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 3032|       |
 3033|  10.4k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  10.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (3033:8): [True: 3.51k, False: 6.94k]
  ------------------
 3034|  3.51k|        UA_clear(dst, type);
 3035|  10.4k|    return ret;
 3036|  9.89k|}
ua_types_encoding_json.c:writeChar:
   69|  26.7M|writeChar(CtxJson *ctx, char c) {
   70|  26.7M|    if(ctx->calcOnly) {
  ------------------
  |  Branch (70:8): [True: 8.90M, False: 17.8M]
  ------------------
   71|  8.90M|        if((uintptr_t)ctx->pos >= (uintptr_t)ctx->end)
  ------------------
  |  Branch (71:12): [True: 0, False: 8.90M]
  ------------------
   72|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
   73|  8.90M|        ctx->pos = (UA_Byte*)((uintptr_t)ctx->pos + 1u);
   74|  8.90M|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  8.90M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   75|  8.90M|    }
   76|  17.8M|    if(ctx->pos >= ctx->end)
  ------------------
  |  Branch (76:8): [True: 0, False: 17.8M]
  ------------------
   77|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
   78|  17.8M|    *ctx->pos++ = (UA_Byte)c;
   79|  17.8M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  17.8M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   80|  17.8M|}
ua_types_encoding_json.c:writeChars:
   83|   948k|writeChars(CtxJson *ctx, const char *c, size_t len) {
   84|   948k|    if(ctx->calcOnly) {
  ------------------
  |  Branch (84:8): [True: 316k, False: 632k]
  ------------------
   85|   316k|        uintptr_t pos = (uintptr_t)ctx->pos;
   86|   316k|        uintptr_t end = (uintptr_t)ctx->end;
   87|   316k|        if(len > end - pos)
  ------------------
  |  Branch (87:12): [True: 0, False: 316k]
  ------------------
   88|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
   89|   316k|        ctx->pos = (UA_Byte*)(pos + len);
   90|   316k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   316k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   91|   316k|    }
   92|   632k|    if(len > (size_t)(ctx->end - ctx->pos))
  ------------------
  |  Branch (92:8): [True: 0, False: 632k]
  ------------------
   93|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
   94|   632k|    memcpy(ctx->pos, c, len);
   95|   632k|    ctx->pos += len;
   96|   632k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   632k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   97|   632k|}
ua_types_encoding_json.c:Boolean_encodeJson:
  271|  11.4k|ENCODE_JSON(Boolean) {
  272|  11.4k|    const UA_Boolean *src = (const UA_Boolean*)p;
  273|  11.4k|    if(*src == true)
  ------------------
  |  Branch (273:8): [True: 408, False: 11.0k]
  ------------------
  274|    408|        return writeChars(ctx, "true", 4);
  275|  11.0k|    return writeChars(ctx, "false", 5);
  276|  11.4k|}
ua_types_encoding_json.c:SByte_encodeJson:
  294|  80.5k|ENCODE_JSON(SByte) {
  295|  80.5k|    const UA_SByte *src = (const UA_SByte*)p;
  296|  80.5k|    char buf[5];
  297|  80.5k|    UA_UInt16 digits = itoaSigned(*src, buf);
  298|  80.5k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (298:8): [True: 0, False: 80.5k]
  ------------------
  299|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  300|  80.5k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (300:8): [True: 53.7k, False: 26.8k]
  ------------------
  301|  53.7k|        memcpy(ctx->pos, buf, digits);
  302|  80.5k|    ctx->pos += digits;
  303|  80.5k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  80.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  304|  80.5k|}
ua_types_encoding_json.c:Byte_encodeJson:
  278|  2.81k|ENCODE_JSON(Byte) {
  279|  2.81k|    const UA_Byte *src = (const UA_Byte*)p;
  280|  2.81k|    char buf[4];
  281|  2.81k|    UA_UInt16 digits = itoaUnsigned(*src, buf, 10);
  282|       |
  283|       |    /* Ensure destination can hold the data- */
  284|  2.81k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (284:8): [True: 0, False: 2.81k]
  ------------------
  285|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  286|       |
  287|       |    /* Copy digits to the output string/buffer. */
  288|  2.81k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (288:8): [True: 1.87k, False: 938]
  ------------------
  289|  1.87k|        memcpy(ctx->pos, buf, digits);
  290|  2.81k|    ctx->pos += digits;
  291|  2.81k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  2.81k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  292|  2.81k|}
ua_types_encoding_json.c:Int16_encodeJson:
  318|  4.66k|ENCODE_JSON(Int16) {
  319|  4.66k|    const UA_Int16 *src = (const UA_Int16*)p;
  320|  4.66k|    char buf[7];
  321|  4.66k|    UA_UInt16 digits = itoaSigned(*src, buf);
  322|  4.66k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (322:8): [True: 0, False: 4.66k]
  ------------------
  323|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  324|  4.66k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (324:8): [True: 3.10k, False: 1.55k]
  ------------------
  325|  3.10k|        memcpy(ctx->pos, buf, digits);
  326|  4.66k|    ctx->pos += digits;
  327|  4.66k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.66k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  328|  4.66k|}
ua_types_encoding_json.c:UInt16_encodeJson:
  306|  6.28k|ENCODE_JSON(UInt16) {
  307|  6.28k|    const UA_UInt16 *src = (const UA_UInt16*)p;
  308|  6.28k|    char buf[6];
  309|  6.28k|    UA_UInt16 digits = itoaUnsigned(*src, buf, 10);
  310|  6.28k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (310:8): [True: 0, False: 6.28k]
  ------------------
  311|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  312|  6.28k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (312:8): [True: 4.19k, False: 2.09k]
  ------------------
  313|  4.19k|        memcpy(ctx->pos, buf, digits);
  314|  6.28k|    ctx->pos += digits;
  315|  6.28k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  6.28k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  316|  6.28k|}
ua_types_encoding_json.c:Int32_encodeJson:
  342|  4.16M|ENCODE_JSON(Int32) {
  343|  4.16M|    const UA_Int32 *src = (const UA_Int32*)p;
  344|  4.16M|    char buf[12];
  345|  4.16M|    UA_UInt16 digits = itoaSigned(*src, buf);
  346|  4.16M|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (346:8): [True: 0, False: 4.16M]
  ------------------
  347|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  348|  4.16M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (348:8): [True: 2.77M, False: 1.38M]
  ------------------
  349|  2.77M|        memcpy(ctx->pos, buf, digits);
  350|  4.16M|    ctx->pos += digits;
  351|  4.16M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.16M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  352|  4.16M|}
ua_types_encoding_json.c:UInt32_encodeJson:
  330|  65.4k|ENCODE_JSON(UInt32) {
  331|  65.4k|    const UA_UInt32 *src = (const UA_UInt32*)p;
  332|  65.4k|    char buf[11];
  333|  65.4k|    UA_UInt16 digits = itoaUnsigned(*src, buf, 10);
  334|  65.4k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (334:8): [True: 0, False: 65.4k]
  ------------------
  335|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  336|  65.4k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (336:8): [True: 43.6k, False: 21.8k]
  ------------------
  337|  43.6k|        memcpy(ctx->pos, buf, digits);
  338|  65.4k|    ctx->pos += digits;
  339|  65.4k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  65.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  340|  65.4k|}
ua_types_encoding_json.c:Int64_encodeJson:
  392|  2.69M|ENCODE_JSON(Int64) {
  393|  2.69M|    const UA_Int64 *src = (const UA_Int64*)p;
  394|  2.69M|    char buf[23];
  395|  2.69M|    buf[0] = '\"';
  396|  2.69M|    UA_UInt16 digits = itoaSigned(*src, buf + 1);
  397|  2.69M|    buf[digits + 1] = '\"';
  398|  2.69M|    UA_UInt16 length = (UA_UInt16)(digits + 2);
  399|  2.69M|    if(ctx->pos + length > ctx->end)
  ------------------
  |  Branch (399:8): [True: 0, False: 2.69M]
  ------------------
  400|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  401|  2.69M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (401:8): [True: 1.79M, False: 898k]
  ------------------
  402|  1.79M|        memcpy(ctx->pos, buf, length);
  403|  2.69M|    ctx->pos += length;
  404|  2.69M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  2.69M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  405|  2.69M|}
ua_types_encoding_json.c:UInt64_encodeJson:
  377|  4.27M|ENCODE_JSON(UInt64) {
  378|  4.27M|    const UA_UInt64 *src = (const UA_UInt64*)p;
  379|  4.27M|    char buf[23];
  380|  4.27M|    buf[0] = '\"';
  381|  4.27M|    UA_UInt16 digits = itoaUnsigned(*src, buf + 1, 10);
  382|  4.27M|    buf[digits + 1] = '\"';
  383|  4.27M|    UA_UInt16 length = (UA_UInt16)(digits + 2);
  384|  4.27M|    if(ctx->pos + length > ctx->end)
  ------------------
  |  Branch (384:8): [True: 0, False: 4.27M]
  ------------------
  385|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  386|  4.27M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (386:8): [True: 2.84M, False: 1.42M]
  ------------------
  387|  2.84M|        memcpy(ctx->pos, buf, length);
  388|  4.27M|    ctx->pos += length;
  389|  4.27M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.27M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  390|  4.27M|}
ua_types_encoding_json.c:Float_encodeJson:
  407|  3.89M|ENCODE_JSON(Float) {
  408|  3.89M|    const UA_Float *src = (const UA_Float*)p;
  409|  3.89M|    char buffer[32];
  410|  3.89M|    size_t len;
  411|  3.89M|    if(*src != *src)
  ------------------
  |  Branch (411:8): [True: 21.8k, False: 3.87M]
  ------------------
  412|  21.8k|        return writeChars(ctx, "\"NaN\"", 5);
  413|  3.87M|    if(*src == INFINITY)
  ------------------
  |  Branch (413:8): [True: 54.0k, False: 3.81M]
  ------------------
  414|  54.0k|        return writeChars(ctx, "\"Infinity\"", 10);
  415|  3.81M|    if(*src == -INFINITY)
  ------------------
  |  Branch (415:8): [True: 28.7k, False: 3.78M]
  ------------------
  416|  28.7k|        return writeChars(ctx, "\"-Infinity\"", 11);
  417|  3.78M|    len = dtoa((UA_Double)*src, buffer);
  418|  3.78M|    if(ctx->pos + len > ctx->end)
  ------------------
  |  Branch (418:8): [True: 0, False: 3.78M]
  ------------------
  419|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  420|  3.78M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (420:8): [True: 2.52M, False: 1.26M]
  ------------------
  421|  2.52M|        memcpy(ctx->pos, buffer, len);
  422|  3.78M|    ctx->pos += len;
  423|  3.78M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  3.78M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  424|  3.78M|}
ua_types_encoding_json.c:Double_encodeJson:
  426|  5.21M|ENCODE_JSON(Double) {
  427|  5.21M|    const UA_Double *src = (const UA_Double*)p;
  428|  5.21M|    char buffer[32];
  429|  5.21M|    size_t len;
  430|  5.21M|    if(*src != *src)
  ------------------
  |  Branch (430:8): [True: 9.12k, False: 5.20M]
  ------------------
  431|  9.12k|        return writeChars(ctx, "\"NaN\"", 5);
  432|  5.20M|    if(*src == INFINITY)
  ------------------
  |  Branch (432:8): [True: 34.3k, False: 5.16M]
  ------------------
  433|  34.3k|        return writeChars(ctx, "\"Infinity\"", 10);
  434|  5.16M|    if(*src == -INFINITY)
  ------------------
  |  Branch (434:8): [True: 34.1k, False: 5.13M]
  ------------------
  435|  34.1k|        return writeChars(ctx, "\"-Infinity\"", 11);
  436|  5.13M|    len = dtoa(*src, buffer);
  437|  5.13M|    if(ctx->pos + len > ctx->end)
  ------------------
  |  Branch (437:8): [True: 0, False: 5.13M]
  ------------------
  438|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  439|  5.13M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (439:8): [True: 3.42M, False: 1.71M]
  ------------------
  440|  3.42M|        memcpy(ctx->pos, buffer, len);
  441|  5.13M|    ctx->pos += len;
  442|  5.13M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  5.13M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  443|  5.13M|}
ua_types_encoding_json.c:String_encodeJson:
  537|   213k|ENCODE_JSON(String) {
  538|   213k|    const UA_String *src = (const UA_String*)p;
  539|   213k|    if(!src->data)
  ------------------
  |  Branch (539:8): [True: 13.2k, False: 200k]
  ------------------
  540|  13.2k|        return writeChars(ctx, "null", 4);
  541|       |
  542|   200k|    status ret = writeJsonQuote(ctx);
  543|   200k|    ret |= writeJsonStringContent(ctx, src);
  544|   200k|    return ret | writeJsonQuote(ctx);
  545|   213k|}
ua_types_encoding_json.c:writeJsonQuote:
  103|   435k|static WRITE_JSON_ELEMENT(Quote) {
  104|   435k|    return writeChar(ctx, '\"');
  105|   435k|}
ua_types_encoding_json.c:writeJsonStringContent:
  473|   200k|writeJsonStringContent(CtxJson *ctx, const UA_String *src) {
  474|   200k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   200k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  475|   200k|    const unsigned char *end = src->data + src->length;
  476|  19.3M|    for(const unsigned char *pos = src->data; pos < end; pos++) {
  ------------------
  |  Branch (476:47): [True: 19.3M, False: 20.9k]
  ------------------
  477|       |        /* Skip to the first character that needs escaping */
  478|  19.3M|        const unsigned char *start = pos;
  479|  44.1M|        for(; pos < end; pos++) {
  ------------------
  |  Branch (479:15): [True: 44.0M, False: 179k]
  ------------------
  480|  44.0M|            if(*pos < ' ' || *pos == 127 || *pos == '\\' || *pos == '\"')
  ------------------
  |  Branch (480:16): [True: 6.80M, False: 37.2M]
  |  Branch (480:30): [True: 3.45k, False: 37.2M]
  |  Branch (480:45): [True: 40.3k, False: 37.1M]
  |  Branch (480:61): [True: 12.2M, False: 24.8M]
  ------------------
  481|  19.1M|                break;
  482|  44.0M|        }
  483|       |
  484|       |        /* Write out the unescaped sequence */
  485|  19.3M|        if(ctx->pos + (pos - start) > ctx->end)
  ------------------
  |  Branch (485:12): [True: 0, False: 19.3M]
  ------------------
  486|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  487|  19.3M|        if(!ctx->calcOnly)
  ------------------
  |  Branch (487:12): [True: 12.8M, False: 6.43M]
  ------------------
  488|  12.8M|            memcpy(ctx->pos, start, (size_t)(pos - start));
  489|  19.3M|        ctx->pos += pos - start;
  490|       |
  491|       |        /* The unescaped sequence reached the end */
  492|  19.3M|        if(pos == end)
  ------------------
  |  Branch (492:12): [True: 179k, False: 19.1M]
  ------------------
  493|   179k|            break;
  494|       |
  495|       |        /* Write an escaped character */
  496|  19.1M|        char *escape_text;
  497|  19.1M|        char escape_buf[6];
  498|  19.1M|        size_t escape_len = 2;
  499|  19.1M|        switch(*pos) {
  500|    441|        case '\b': escape_text = "\\b"; break;
  ------------------
  |  Branch (500:9): [True: 441, False: 19.1M]
  ------------------
  501|  3.53k|        case '\f': escape_text = "\\f"; break;
  ------------------
  |  Branch (501:9): [True: 3.53k, False: 19.1M]
  ------------------
  502|   248k|        case '\n': escape_text = "\\n"; break;
  ------------------
  |  Branch (502:9): [True: 248k, False: 18.8M]
  ------------------
  503|    447|        case '\r': escape_text = "\\r"; break;
  ------------------
  |  Branch (503:9): [True: 447, False: 19.1M]
  ------------------
  504|    366|        case '\t': escape_text = "\\t"; break;
  ------------------
  |  Branch (504:9): [True: 366, False: 19.1M]
  ------------------
  505|  18.8M|        default:
  ------------------
  |  Branch (505:9): [True: 18.8M, False: 253k]
  ------------------
  506|  18.8M|            escape_text = escape_buf;
  507|  18.8M|            if(*pos >= ' ' && *pos != 127) {
  ------------------
  |  Branch (507:16): [True: 12.3M, False: 6.54M]
  |  Branch (507:31): [True: 12.3M, False: 3.45k]
  ------------------
  508|       |                /* Escape \ or " */
  509|  12.3M|                escape_buf[0] = '\\';
  510|  12.3M|                escape_buf[1] = (char)*pos;
  511|  12.3M|            } else {
  512|       |                /* Unprintable characters need to be escaped */
  513|  6.55M|                escape_buf[0] = '\\';
  514|  6.55M|                escape_buf[1] = 'u';
  515|  6.55M|                escape_buf[2] = '0';
  516|  6.55M|                escape_buf[3] = '0';
  517|  6.55M|                escape_buf[4] = hexmap[*pos >> 4];
  518|  6.55M|                escape_buf[5] = hexmap[*pos & 0x0f];
  519|  6.55M|                escape_len = 6;
  520|  6.55M|            }
  521|  18.8M|            break;
  522|  19.1M|        }
  523|       |
  524|       |        /* Enough space? */
  525|  19.1M|        if(ctx->pos + escape_len > ctx->end)
  ------------------
  |  Branch (525:12): [True: 0, False: 19.1M]
  ------------------
  526|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  527|       |
  528|       |        /* Write the escaped character */
  529|  19.1M|        if(!ctx->calcOnly)
  ------------------
  |  Branch (529:12): [True: 12.7M, False: 6.37M]
  ------------------
  530|  12.7M|            memcpy(ctx->pos, escape_text, escape_len);
  531|  19.1M|        ctx->pos += escape_len;
  532|  19.1M|    }
  533|       |
  534|   200k|    return ret;
  535|   200k|}
ua_types_encoding_json.c:DateTime_encodeJson:
  593|  3.18k|ENCODE_JSON(DateTime) {
  594|  3.18k|    const UA_DateTime *src = (const UA_DateTime*)p;
  595|  3.18k|    if(*src == 0)
  ------------------
  |  Branch (595:8): [True: 2.82k, False: 366]
  ------------------
  596|  2.82k|        return writeChars(ctx, "\"0001-01-01T00:00:00Z\"", 22);
  597|       |
  598|    366|    UA_DateTimeStruct date = UA_DateTime_toStruct(*src);
  599|    366|    if(date.year < 1)
  ------------------
  |  Branch (599:8): [True: 0, False: 366]
  ------------------
  600|      0|        return writeChars(ctx, "\"0001-01-01T00:00:00Z\"", 22);
  601|    366|    if(date.year > 9999)
  ------------------
  |  Branch (601:8): [True: 0, False: 366]
  ------------------
  602|      0|        return writeChars(ctx, "\"9999-12-31T23:59:59.9999999Z\"", 30);
  603|       |
  604|    366|    UA_Byte buffer[40];
  605|    366|    UA_String str = {40, buffer};
  606|    366|    encodeDateTime(*src, &str);
  607|       |    return String_encodeJson(ctx, &str, NULL);
  608|    366|}
ua_types_encoding_json.c:Guid_encodeJson:
  582|  4.15k|ENCODE_JSON(Guid) {
  583|  4.15k|    const UA_Guid *src = (const UA_Guid*)p;
  584|  4.15k|    if(ctx->pos + 38 > ctx->end) /* 36 + 2 (") */
  ------------------
  |  Branch (584:8): [True: 0, False: 4.15k]
  ------------------
  585|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  586|  4.15k|    status ret = writeJsonQuote(ctx);
  587|  4.15k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (587:8): [True: 2.76k, False: 1.38k]
  ------------------
  588|  2.76k|        UA_Guid_to_hex(src, ctx->pos, false);
  589|  4.15k|    ctx->pos += 36;
  590|  4.15k|    return ret | writeJsonQuote(ctx);
  591|  4.15k|}
ua_types_encoding_json.c:ByteString_encodeJson:
  547|  17.0k|ENCODE_JSON(ByteString) {
  548|  17.0k|    const UA_ByteString *src = (const UA_ByteString*)p;
  549|  17.0k|    if(!src->data)
  ------------------
  |  Branch (549:8): [True: 4.35k, False: 12.7k]
  ------------------
  550|  4.35k|        return writeChars(ctx, "null", 4);
  551|       |
  552|  12.7k|    if(src->length == 0) {
  ------------------
  |  Branch (552:8): [True: 2.06k, False: 10.6k]
  ------------------
  553|  2.06k|        status retval = writeJsonQuote(ctx);
  554|  2.06k|        retval |= writeJsonQuote(ctx);
  555|  2.06k|        return retval;
  556|  2.06k|    }
  557|       |
  558|  10.6k|    status ret = writeJsonQuote(ctx);
  559|  10.6k|    size_t flen = 0;
  560|  10.6k|    unsigned char *ba64 = UA_base64(src->data, src->length, &flen);
  561|       |
  562|       |    /* Not converted, no mem */
  563|  10.6k|    if(!ba64)
  ------------------
  |  Branch (563:8): [True: 0, False: 10.6k]
  ------------------
  564|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  565|       |
  566|  10.6k|    if(ctx->pos + flen > ctx->end) {
  ------------------
  |  Branch (566:8): [True: 0, False: 10.6k]
  ------------------
  567|      0|        UA_free(ba64);
  ------------------
  |  |   23|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  568|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  569|      0|    }
  570|       |
  571|       |    /* Copy flen bytes to output stream. */
  572|  10.6k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (572:8): [True: 7.11k, False: 3.55k]
  ------------------
  573|  7.11k|        memcpy(ctx->pos, ba64, flen);
  574|  10.6k|    ctx->pos += flen;
  575|       |
  576|       |    /* Base64 result no longer needed */
  577|  10.6k|    UA_free(ba64);
  ------------------
  |  |   23|  10.6k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  578|       |
  579|  10.6k|    return ret | writeJsonQuote(ctx);
  580|  10.6k|}
ua_types_encoding_json.c:NodeId_encodeJson:
  610|  24.7k|ENCODE_JSON(NodeId) {
  611|  24.7k|    const UA_NodeId *src = (const UA_NodeId*)p;
  612|  24.7k|    UA_String out = UA_STRING_NULL;
  613|  24.7k|    UA_StatusCode ret =
  614|  24.7k|        UA_NodeId_printEx(src, &out, ctx->namespaceMapping);
  615|       |    ret |= String_encodeJson(ctx, &out, NULL);
  616|  24.7k|    UA_String_clear(&out);
  617|  24.7k|    return ret;
  618|  24.7k|}
ua_types_encoding_json.c:ExpandedNodeId_encodeJson:
  620|  45.9k|ENCODE_JSON(ExpandedNodeId) {
  621|  45.9k|    const UA_ExpandedNodeId *src = (const UA_ExpandedNodeId*)p;
  622|  45.9k|    UA_String out = UA_STRING_NULL;
  623|  45.9k|    UA_StatusCode ret =
  624|  45.9k|        UA_ExpandedNodeId_printEx(src, &out, ctx->namespaceMapping,
  625|  45.9k|                                  ctx->serverUrisSize, ctx->serverUris);
  626|       |    ret |= String_encodeJson(ctx, &out, NULL);
  627|  45.9k|    UA_String_clear(&out);
  628|  45.9k|    return ret;
  629|  45.9k|}
ua_types_encoding_json.c:StatusCode_encodeJson:
  657|  39.1k|ENCODE_JSON(StatusCode) {
  658|  39.1k|    const UA_StatusCode *src = (const UA_StatusCode*)p;
  659|  39.1k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  39.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  660|  39.1k|    ret |= writeJsonObjStart(ctx);
  661|  39.1k|    if(*src > UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  39.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (661:8): [True: 195, False: 38.9k]
  ------------------
  662|    195|        ret |= writeJsonKey(ctx, UA_JSONKEY_CODE);
  663|    195|        ret |= UInt32_encodeJson(ctx, src, NULL);
  664|    195|        const char *codename = NULL;
  665|    195|        if(!ctx->useCompactEncoding)
  ------------------
  |  Branch (665:12): [True: 195, False: 0]
  ------------------
  666|    195|            codename = UA_StatusCode_name(*src);
  667|    195|        if(codename && codename[0] != '\0') {
  ------------------
  |  Branch (667:12): [True: 195, False: 0]
  |  Branch (667:24): [True: 195, False: 0]
  ------------------
  668|    195|            UA_String statusDescription =
  669|    195|                UA_STRING((char*)(uintptr_t)codename);
  670|    195|            ret |= writeJsonKey(ctx, UA_JSONKEY_SYMBOL);
  671|       |            ret |= String_encodeJson(ctx, &statusDescription, NULL);
  672|    195|        }
  673|    195|    }
  674|  39.1k|    ret |= writeJsonObjEnd(ctx);
  675|  39.1k|    return ret;
  676|  39.1k|}
ua_types_encoding_json.c:QualifiedName_encodeJson:
  645|  28.5k|ENCODE_JSON(QualifiedName) {
  646|  28.5k|    const UA_QualifiedName *src = (const UA_QualifiedName*)p;
  647|  28.5k|    if(src->namespaceIndex == 0 && src->name.data == NULL)
  ------------------
  |  Branch (647:8): [True: 27.0k, False: 1.50k]
  |  Branch (647:36): [True: 3.10k, False: 23.9k]
  ------------------
  648|  3.10k|        return writeChars(ctx, "null", 4);
  649|  25.4k|    UA_String out = UA_STRING_NULL;
  650|  25.4k|    UA_StatusCode ret =
  651|  25.4k|        UA_QualifiedName_printEx(src, &out, ctx->namespaceMapping);
  652|       |    ret |= String_encodeJson(ctx, &out, NULL);
  653|  25.4k|    UA_String_clear(&out);
  654|  25.4k|    return ret;
  655|  28.5k|}
ua_types_encoding_json.c:LocalizedText_encodeJson:
  631|  28.7k|ENCODE_JSON(LocalizedText) {
  632|  28.7k|    const UA_LocalizedText *src = (const UA_LocalizedText*)p;
  633|  28.7k|    status ret = writeJsonObjStart(ctx);
  634|  28.7k|    if(src->locale.length > 0) {
  ------------------
  |  Branch (634:8): [True: 0, False: 28.7k]
  ------------------
  635|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_LOCALE);
  636|      0|        ret |= String_encodeJson(ctx, &src->locale, NULL);
  637|      0|    }
  638|  28.7k|    if(src->text.length > 0) {
  ------------------
  |  Branch (638:8): [True: 39, False: 28.7k]
  ------------------
  639|     39|        ret |= writeJsonKey(ctx, UA_JSONKEY_TEXT);
  640|       |        ret |= String_encodeJson(ctx, &src->text, NULL);
  641|     39|    }
  642|  28.7k|    return ret | writeJsonObjEnd(ctx);
  643|  28.7k|}
ua_types_encoding_json.c:ExtensionObject_encodeJson:
  678|   536k|ENCODE_JSON(ExtensionObject) {
  679|   536k|    const UA_ExtensionObject *src = (const UA_ExtensionObject*)p;
  680|   536k|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_NOBODY)
  ------------------
  |  Branch (680:8): [True: 532k, False: 3.24k]
  ------------------
  681|   532k|        return writeChars(ctx, "{}", 2);
  682|       |
  683|       |    /* Unknown JSON datatypes retain their complete wire representation. */
  684|  3.24k|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_JSON) {
  ------------------
  |  Branch (684:8): [True: 2.70k, False: 534]
  ------------------
  685|  2.70k|        if(src->content.encoded.body.length < 2 ||
  ------------------
  |  Branch (685:12): [True: 0, False: 2.70k]
  ------------------
  686|  2.70k|           src->content.encoded.body.data[0] != '{' ||
  ------------------
  |  Branch (686:12): [True: 0, False: 2.70k]
  ------------------
  687|  2.70k|           src->content.encoded.body.data[src->content.encoded.body.length - 1] != '}')
  ------------------
  |  Branch (687:12): [True: 0, False: 2.70k]
  ------------------
  688|      0|            return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  689|  2.70k|        return writeChars(ctx, (const char*)src->content.encoded.body.data,
  690|  2.70k|                          src->content.encoded.body.length);
  691|  2.70k|    }
  692|       |
  693|       |    /* Must have a type set if data is decoded */
  694|    534|    if(src->encoding != UA_EXTENSIONOBJECT_ENCODED_BYTESTRING &&
  ------------------
  |  Branch (694:8): [True: 534, False: 0]
  ------------------
  695|    534|       src->encoding != UA_EXTENSIONOBJECT_ENCODED_XML &&
  ------------------
  |  Branch (695:8): [True: 534, False: 0]
  ------------------
  696|    534|       !src->content.decoded.type)
  ------------------
  |  Branch (696:8): [True: 0, False: 534]
  ------------------
  697|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  698|       |
  699|    534|    status ret = writeJsonObjStart(ctx);
  700|       |
  701|       |    /* Write the type NodeId */
  702|    534|    ret |= writeJsonKey(ctx, UA_JSONKEY_TYPEID);
  703|    534|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_BYTESTRING ||
  ------------------
  |  Branch (703:8): [True: 0, False: 534]
  ------------------
  704|    534|       src->encoding == UA_EXTENSIONOBJECT_ENCODED_XML)
  ------------------
  |  Branch (704:8): [True: 0, False: 534]
  ------------------
  705|      0|        ret |= NodeId_encodeJson(ctx, &src->content.encoded.typeId, NULL);
  706|    534|    else
  707|    534|        ret |= NodeId_encodeJson(ctx, &src->content.decoded.type->typeId, NULL);
  708|       |
  709|       |    /* Write the encoding type and body if encoded */
  710|    534|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_BYTESTRING ||
  ------------------
  |  Branch (710:8): [True: 0, False: 534]
  ------------------
  711|    534|       src->encoding == UA_EXTENSIONOBJECT_ENCODED_XML) {
  ------------------
  |  Branch (711:8): [True: 0, False: 534]
  ------------------
  712|      0|        if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_BYTESTRING) {
  ------------------
  |  Branch (712:12): [True: 0, False: 0]
  ------------------
  713|      0|            ret |= writeJsonKey(ctx, UA_JSONKEY_ENCODING);
  714|      0|            ret |= writeChar(ctx, '1');
  715|      0|        } else {
  716|      0|            ret |= writeJsonKey(ctx, UA_JSONKEY_ENCODING);
  717|      0|            ret |= writeChar(ctx, '2');
  718|      0|        }
  719|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_BODY);
  720|      0|        ret |= ByteString_encodeJson(ctx, &src->content.encoded.body, NULL);
  721|      0|        return ret | writeJsonObjEnd(ctx);
  722|      0|    }
  723|       |
  724|    534|    const UA_DataType *t = src->content.decoded.type;
  725|    534|    if(t->typeKind == UA_DATATYPEKIND_STRUCTURE ||
  ------------------
  |  Branch (725:8): [True: 348, False: 186]
  ------------------
  726|    348|       t->typeKind == UA_DATATYPEKIND_OPTSTRUCT) {
  ------------------
  |  Branch (726:8): [True: 0, False: 186]
  ------------------
  727|       |        /* Write structures in-situ. */
  728|    348|        ret |= encodeJsonStructureContent(ctx, src->content.decoded.data, t);
  729|    348|    } else if(t->typeKind == UA_DATATYPEKIND_UNION) {
  ------------------
  |  Branch (729:15): [True: 0, False: 186]
  ------------------
  730|      0|        ret |= encodeJsonUnionContent(ctx, src->content.decoded.data, t);
  731|    186|    } else {
  732|       |        /* NON-STANDARD: The standard 1.05 doesn't let us print non-structure
  733|       |         * types in ExtensionObjects (e.g. enums). Print them in the body. */
  734|    186|        ret |= writeJsonKey(ctx, UA_JSONKEY_BODY);
  735|    186|        ret |= encodeJsonJumpTable[t->typeKind](ctx, src->content.decoded.data, t);
  736|    186|    }
  737|       |
  738|    534|    return ret | writeJsonObjEnd(ctx);
  739|    534|}
ua_types_encoding_json.c:encodeJsonStructureContent:
 1039|  13.1k|                           const UA_DataType *type) {
 1040|  13.1k|    uintptr_t ptr = (uintptr_t) src;
 1041|  13.1k|    size_t membersSize = type->membersSize;
 1042|  13.1k|    UA_StatusCode ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  13.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1043|       |
 1044|  13.1k|    if(ctx->useCompactEncoding &&
  ------------------
  |  Branch (1044:8): [True: 0, False: 13.1k]
  ------------------
 1045|      0|       type->typeKind == UA_DATATYPEKIND_OPTSTRUCT) {
  ------------------
  |  Branch (1045:8): [True: 0, False: 0]
  ------------------
 1046|      0|        UA_UInt32 encodingMask = 0;
 1047|      0|        ret = getJsonEncodingMask(src, type, &encodingMask);
 1048|      0|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1048:12): [True: 0, False: 0]
  ------------------
 1049|      0|            return ret;
 1050|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_ENCODINGMASK);
 1051|      0|        ret |= UInt32_encodeJson(ctx, &encodingMask, NULL);
 1052|      0|    }
 1053|       |
 1054|  96.9k|    for(size_t i = 0; i < membersSize && ret == UA_STATUSCODE_GOOD; ++i) {
  ------------------
  |  |   17|  83.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1054:23): [True: 83.8k, False: 13.1k]
  |  Branch (1054:42): [True: 83.8k, False: 0]
  ------------------
 1055|  83.8k|        const UA_DataTypeMember *m = &type->members[i];
 1056|  83.8k|        const UA_DataType *mt = m->memberType;
 1057|  83.8k|        if(m->memberName == NULL)
  ------------------
  |  Branch (1057:12): [True: 0, False: 83.8k]
  ------------------
 1058|      0|            return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 1059|  83.8k|        ptr += m->padding;
 1060|       |
 1061|  83.8k|        if(m->isArray) {
  ------------------
  |  Branch (1061:12): [True: 10.8k, False: 72.9k]
  ------------------
 1062|  10.8k|            const size_t length = *(const size_t*)ptr;
 1063|  10.8k|            ptr += sizeof(size_t);
 1064|  10.8k|            const void *data = *(void *const *)ptr;
 1065|  10.8k|            ptr += sizeof(void*);
 1066|  10.8k|            if(m->isOptional && !data)
  ------------------
  |  Branch (1066:16): [True: 0, False: 10.8k]
  |  Branch (1066:33): [True: 0, False: 0]
  ------------------
 1067|      0|                continue;
 1068|  10.8k|            if(ctx->useCompactEncoding && (!data || length == 0))
  ------------------
  |  Branch (1068:16): [True: 0, False: 10.8k]
  |  Branch (1068:44): [True: 0, False: 0]
  |  Branch (1068:53): [True: 0, False: 0]
  ------------------
 1069|      0|                continue;
 1070|  10.8k|            ret |= writeJsonKey(ctx, m->memberName);
 1071|  10.8k|            if(data)
  ------------------
  |  Branch (1071:16): [True: 237, False: 10.6k]
  ------------------
 1072|    237|                ret |= encodeJsonArray(ctx, data, length, mt);
 1073|  10.6k|            else
 1074|  10.6k|                ret |= writeChars(ctx, "null", 4);
 1075|  10.8k|            continue;
 1076|  10.8k|        }
 1077|       |
 1078|  72.9k|        if(m->isOptional) {
  ------------------
  |  Branch (1078:12): [True: 0, False: 72.9k]
  ------------------
 1079|      0|            const void *data = *(void *const *)ptr;
 1080|      0|            ptr += sizeof(void*);
 1081|      0|            if(!data)
  ------------------
  |  Branch (1081:16): [True: 0, False: 0]
  ------------------
 1082|      0|                continue;
 1083|      0|            if(ctx->useCompactEncoding && isJsonDefaultValue(data, mt))
  ------------------
  |  Branch (1083:16): [True: 0, False: 0]
  |  Branch (1083:43): [True: 0, False: 0]
  ------------------
 1084|      0|                continue;
 1085|      0|            ret |= writeJsonKey(ctx, m->memberName);
 1086|      0|            ret |= encodeJsonJumpTable[mt->typeKind](ctx, data, mt);
 1087|      0|            continue;
 1088|      0|        }
 1089|       |
 1090|  72.9k|        const void *data = (const void*)ptr;
 1091|  72.9k|        if(ctx->useCompactEncoding && isJsonDefaultValue(data, mt)) {
  ------------------
  |  Branch (1091:12): [True: 0, False: 72.9k]
  |  Branch (1091:39): [True: 0, False: 0]
  ------------------
 1092|      0|            ptr += mt->memSize;
 1093|      0|            continue;
 1094|      0|        }
 1095|  72.9k|        ret |= writeJsonKey(ctx, m->memberName);
 1096|  72.9k|        ret |= encodeJsonJumpTable[mt->typeKind](ctx, data, mt);
 1097|  72.9k|        ptr += mt->memSize;
 1098|  72.9k|    }
 1099|  13.1k|    return ret;
 1100|  13.1k|}
ua_types_encoding_json.c:encodeJsonArray:
  447|    237|                const UA_DataType *type) {
  448|       |    /* Null-arrays (length -1) are written as empty arrays '[]'.
  449|       |     * TODO: Clarify the difference between length -1 and length 0 in JSON. */
  450|    237|    status ret = writeJsonArrStart(ctx);
  451|    237|    if(!ptr)
  ------------------
  |  Branch (451:8): [True: 0, False: 237]
  ------------------
  452|      0|        return ret | writeJsonArrEnd(ctx, type);
  453|       |
  454|    237|    uintptr_t uptr = (uintptr_t)ptr;
  455|    237|    encodeJsonSignature encodeType = encodeJsonJumpTable[type->typeKind];
  456|    237|    UA_Boolean distinct = (type->typeKind > UA_DATATYPEKIND_DOUBLE);
  457|  12.6k|    for(size_t i = 0; i < length && ret == UA_STATUSCODE_GOOD; ++i) {
  ------------------
  |  |   17|  12.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (457:23): [True: 12.4k, False: 237]
  |  Branch (457:37): [True: 12.4k, False: 0]
  ------------------
  458|  12.4k|        ret |= writeJsonBeforeElement(ctx, distinct);
  459|  12.4k|        if(isNull((const void*)uptr, type))
  ------------------
  |  Branch (459:12): [True: 0, False: 12.4k]
  ------------------
  460|      0|            ret |= writeChars(ctx, "null", 4);
  461|  12.4k|        else
  462|  12.4k|            ret |= encodeType(ctx, (const void*)uptr, type);
  463|       |        ctx->commaNeeded[ctx->depth] = true;
  464|  12.4k|        uptr += type->memSize;
  465|  12.4k|    }
  466|    237|    return ret | writeJsonArrEnd(ctx, type);
  467|    237|}
ua_types_encoding_json.c:isNull:
  267|  44.8k|isNull(const void *p, const UA_DataType *type) {
  268|  44.8k|    return isJsonNullable(type) && isJsonDefaultValue(p, type);
  ------------------
  |  Branch (268:12): [True: 32.4k, False: 12.4k]
  |  Branch (268:36): [True: 4.74k, False: 27.6k]
  ------------------
  269|  44.8k|}
ua_types_encoding_json.c:isJsonNullable:
  253|   119k|isJsonNullable(const UA_DataType *type) {
  254|   119k|    return (type->typeKind >= UA_DATATYPEKIND_STRING &&
  ------------------
  |  Branch (254:13): [True: 116k, False: 2.98k]
  ------------------
  255|   116k|            type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO &&
  ------------------
  |  Branch (255:13): [True: 104k, False: 12.5k]
  ------------------
  256|   104k|            type->typeKind != UA_DATATYPEKIND_STATUSCODE);
  ------------------
  |  Branch (256:13): [True: 104k, False: 209]
  ------------------
  257|   119k|}
ua_types_encoding_json.c:isJsonDefaultValue:
  260|  32.4k|isJsonDefaultValue(const void *p, const UA_DataType *type) {
  261|  32.4k|    UA_STACKARRAY(char, buf, type->memSize);
  ------------------
  |  |  225|  32.4k|#  define UA_STACKARRAY(TYPE, NAME, SIZE) TYPE NAME[SIZE]
  ------------------
  262|  32.4k|    memset(buf, 0, type->memSize);
  263|  32.4k|    return UA_equal(buf, p, type);
  264|  32.4k|}
ua_types_encoding_json.c:DataValue_encodeJson:
  897|  1.23M|ENCODE_JSON(DataValue) {
  898|  1.23M|    const UA_DataValue *src = (const UA_DataValue*)p;
  899|  1.23M|    UA_Boolean hasValue = src->hasValue && src->value.type;
  ------------------
  |  Branch (899:27): [True: 22.6k, False: 1.21M]
  |  Branch (899:44): [True: 22.6k, False: 0]
  ------------------
  900|  1.23M|    UA_Boolean hasStatus = src->hasStatus && src->status != UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.23M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (900:28): [True: 0, False: 1.23M]
  |  Branch (900:46): [True: 0, False: 0]
  ------------------
  901|  1.23M|    UA_Boolean hasSourceTimestamp =
  902|  1.23M|        src->hasSourceTimestamp && src->sourceTimestamp != 0;
  ------------------
  |  Branch (902:9): [True: 0, False: 1.23M]
  |  Branch (902:36): [True: 0, False: 0]
  ------------------
  903|  1.23M|    UA_Boolean hasSourcePicoseconds =
  904|  1.23M|        src->hasSourcePicoseconds && src->sourcePicoseconds != 0;
  ------------------
  |  Branch (904:9): [True: 0, False: 1.23M]
  |  Branch (904:38): [True: 0, False: 0]
  ------------------
  905|  1.23M|    UA_Boolean hasServerTimestamp =
  906|  1.23M|        src->hasServerTimestamp && src->serverTimestamp != 0;
  ------------------
  |  Branch (906:9): [True: 0, False: 1.23M]
  |  Branch (906:36): [True: 0, False: 0]
  ------------------
  907|  1.23M|    UA_Boolean hasServerPicoseconds =
  908|  1.23M|        src->hasServerPicoseconds && src->serverPicoseconds != 0;
  ------------------
  |  Branch (908:9): [True: 0, False: 1.23M]
  |  Branch (908:38): [True: 0, False: 0]
  ------------------
  909|       |
  910|  1.23M|    status ret = writeJsonObjStart(ctx);
  911|       |
  912|  1.23M|    if(hasValue)
  ------------------
  |  Branch (912:8): [True: 22.6k, False: 1.21M]
  ------------------
  913|  22.6k|        ret |= encodeVariantInner(ctx, &src->value, true);
  914|       |
  915|  1.23M|    if(hasStatus) {
  ------------------
  |  Branch (915:8): [True: 0, False: 1.23M]
  ------------------
  916|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_STATUS);
  917|      0|        ret |= StatusCode_encodeJson(ctx, &src->status, NULL);
  918|      0|    }
  919|       |
  920|  1.23M|    if(hasSourceTimestamp) {
  ------------------
  |  Branch (920:8): [True: 0, False: 1.23M]
  ------------------
  921|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SOURCETIMESTAMP);
  922|      0|        ret |= DateTime_encodeJson(ctx, &src->sourceTimestamp, NULL);
  923|      0|    }
  924|       |
  925|  1.23M|    if(hasSourcePicoseconds) {
  ------------------
  |  Branch (925:8): [True: 0, False: 1.23M]
  ------------------
  926|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SOURCEPICOSECONDS);
  927|      0|        ret |= UInt16_encodeJson(ctx, &src->sourcePicoseconds, NULL);
  928|      0|    }
  929|       |
  930|  1.23M|    if(hasServerTimestamp) {
  ------------------
  |  Branch (930:8): [True: 0, False: 1.23M]
  ------------------
  931|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SERVERTIMESTAMP);
  932|      0|        ret |= DateTime_encodeJson(ctx, &src->serverTimestamp, NULL);
  933|      0|    }
  934|       |
  935|  1.23M|    if(hasServerPicoseconds) {
  ------------------
  |  Branch (935:8): [True: 0, False: 1.23M]
  ------------------
  936|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SERVERPICOSECONDS);
  937|      0|        ret |= UInt16_encodeJson(ctx, &src->serverPicoseconds, NULL);
  938|      0|    }
  939|       |
  940|  1.23M|    return ret | writeJsonObjEnd(ctx);
  941|  1.23M|}
ua_types_encoding_json.c:encodeVariantInner:
  816|   222k|                   UA_Boolean insideDataValue) {
  817|       |    /* If type is 0 (NULL) the Variant contains a NULL value and the containing
  818|       |     * JSON object shall be omitted or replaced by the JSON literal ‘null’ (when
  819|       |     * an element of a JSON array). */
  820|   222k|    if(!src->type)
  ------------------
  |  Branch (820:8): [True: 170k, False: 52.1k]
  ------------------
  821|   170k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   170k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  822|       |
  823|       |    /* These combinations are excluded by the Variant definition. */
  824|  52.1k|    if(src->type->typeKind == UA_DATATYPEKIND_DIAGNOSTICINFO ||
  ------------------
  |  Branch (824:8): [True: 1, False: 52.1k]
  ------------------
  825|  52.1k|       (insideDataValue && src->type->typeKind == UA_DATATYPEKIND_DATAVALUE))
  ------------------
  |  Branch (825:9): [True: 22.6k, False: 29.5k]
  |  Branch (825:28): [True: 1, False: 22.6k]
  ------------------
  826|      2|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      2|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  827|       |
  828|       |    /* Set the array type in the encoding mask */
  829|  52.1k|    const bool isArray = src->arrayLength > 0 || src->data <= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  757|  89.4k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (829:26): [True: 14.9k, False: 37.2k]
  |  Branch (829:50): [True: 1.60k, False: 35.6k]
  ------------------
  830|  52.1k|    const bool hasDimensions = isArray && src->arrayDimensionsSize > 1;
  ------------------
  |  Branch (830:32): [True: 16.5k, False: 35.6k]
  |  Branch (830:43): [True: 0, False: 16.5k]
  ------------------
  831|  52.1k|    if(src->type->typeKind == UA_DATATYPEKIND_VARIANT && !isArray)
  ------------------
  |  Branch (831:8): [True: 678, False: 51.5k]
  |  Branch (831:58): [True: 0, False: 678]
  ------------------
  832|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  833|  52.1k|    if(!isArray && src->arrayDimensionsSize > 0)
  ------------------
  |  Branch (833:8): [True: 35.6k, False: 16.5k]
  |  Branch (833:20): [True: 0, False: 35.6k]
  ------------------
  834|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  835|  52.1k|    if(hasDimensions &&
  ------------------
  |  Branch (835:8): [True: 0, False: 52.1k]
  ------------------
  836|      0|       !variantDimensionsValid(src->arrayLength, src->arrayDimensionsSize,
  ------------------
  |  Branch (836:8): [True: 0, False: 0]
  ------------------
  837|      0|                               src->arrayDimensions))
  838|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  839|       |
  840|       |    /* Enumerations lose their concrete type in a Variant and are represented
  841|       |     * as Int32 in both the Compact and Verbose encodings. */
  842|  52.1k|    const UA_DataType *valueType = src->type;
  843|  52.1k|    if(valueType->typeKind == UA_DATATYPEKIND_ENUM)
  ------------------
  |  Branch (843:8): [True: 0, False: 52.1k]
  ------------------
  844|      0|        valueType = &UA_TYPES[UA_TYPES_INT32];
  ------------------
  |  |  198|      0|#define UA_TYPES_INT32 5
  ------------------
  845|       |
  846|       |    /* Non-builtin values are wrapped in ExtensionObjects. */
  847|  52.1k|    UA_Boolean wrapEO =
  848|  52.1k|        (valueType->typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO);
  849|       |
  850|  52.1k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  52.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  851|       |
  852|       |    /* Write the type number */
  853|  52.1k|    UA_UInt32 typeId = valueType->typeKind + 1;
  854|  52.1k|    if(wrapEO)
  ------------------
  |  Branch (854:8): [True: 342, False: 51.8k]
  ------------------
  855|    342|        typeId = UA_TYPES[UA_TYPES_EXTENSIONOBJECT].typeKind + 1;
  ------------------
  |  |  742|    342|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  856|  52.1k|    ret |= writeJsonKey(ctx, UA_JSONKEY_TYPE);
  857|  52.1k|    ret |= UInt32_encodeJson(ctx, &typeId, NULL);
  858|       |
  859|       |    /* A nullable scalar with its default value has no Value field. */
  860|  52.1k|    UA_Boolean nullValue = false;
  861|  52.1k|    if(!isArray && isJsonNullable(valueType))
  ------------------
  |  Branch (861:8): [True: 35.6k, False: 16.5k]
  |  Branch (861:20): [True: 32.4k, False: 3.22k]
  ------------------
  862|  32.4k|        nullValue = (!src->data || isNull(src->data, valueType));
  ------------------
  |  Branch (862:22): [True: 0, False: 32.4k]
  |  Branch (862:36): [True: 4.74k, False: 27.6k]
  ------------------
  863|       |
  864|  52.1k|    if(!nullValue) {
  ------------------
  |  Branch (864:8): [True: 47.4k, False: 4.74k]
  ------------------
  865|  47.4k|        if(!src->data && !isArray)
  ------------------
  |  Branch (865:12): [True: 0, False: 47.4k]
  |  Branch (865:26): [True: 0, False: 0]
  ------------------
  866|      0|            return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  867|  47.4k|        ret |= writeJsonKey(ctx, UA_JSONKEY_VALUE);
  868|  47.4k|        if(!isArray) {
  ------------------
  |  Branch (868:12): [True: 30.9k, False: 16.5k]
  ------------------
  869|  30.9k|            UA_Variant value = *src;
  870|  30.9k|            value.type = valueType;
  871|  30.9k|            ret |= encodeScalarJsonWrapExtensionObject(ctx, &value);
  872|  30.9k|        } else {
  873|  16.5k|            ret |= encodeArrayJsonWrapExtensionObject(ctx, src->data,
  874|  16.5k|                                                      src->arrayLength, valueType);
  875|  16.5k|        }
  876|  47.4k|    }
  877|       |
  878|       |    /* Write the dimensions */
  879|  52.1k|    if(hasDimensions) {
  ------------------
  |  Branch (879:8): [True: 0, False: 52.1k]
  ------------------
  880|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_DIMENSIONS);
  881|      0|        ret |= encodeJsonArray(ctx, src->arrayDimensions, src->arrayDimensionsSize,
  882|      0|                               &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  232|      0|#define UA_TYPES_UINT32 6
  ------------------
  883|      0|    }
  884|       |
  885|  52.1k|    return ret;
  886|  52.1k|}
ua_types_encoding_json.c:variantDimensionsValid:
  800|    104|                       const UA_UInt32 *dimensions) {
  801|    104|    if(dimensionsSize == 0 || !dimensions)
  ------------------
  |  Branch (801:8): [True: 2, False: 102]
  |  Branch (801:31): [True: 0, False: 102]
  ------------------
  802|      2|        return false;
  803|       |
  804|    102|    size_t total = 1;
  805|    518|    for(size_t i = 0; i < dimensionsSize; i++) {
  ------------------
  |  Branch (805:23): [True: 426, False: 92]
  ------------------
  806|    426|        UA_UInt32 dimension = dimensions[i];
  807|    426|        if(dimension == 0 || total > SIZE_MAX / dimension)
  ------------------
  |  Branch (807:12): [True: 4, False: 422]
  |  Branch (807:30): [True: 6, False: 416]
  ------------------
  808|     10|            return false;
  809|    416|        total *= dimension;
  810|    416|    }
  811|     92|    return total == arrayLength;
  812|    102|}
ua_types_encoding_json.c:encodeScalarJsonWrapExtensionObject:
  743|  30.9k|encodeScalarJsonWrapExtensionObject(CtxJson *ctx, const UA_Variant *src) {
  744|  30.9k|    const UA_Boolean isBuiltin =
  745|  30.9k|        (src->type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO);
  746|  30.9k|    const void *ptr = src->data;
  747|  30.9k|    const UA_DataType *type = src->type;
  748|       |
  749|       |    /* Set up a temporary ExtensionObject to wrap the data */
  750|  30.9k|    UA_ExtensionObject eo;
  751|  30.9k|    if(!isBuiltin) {
  ------------------
  |  Branch (751:8): [True: 66, False: 30.8k]
  ------------------
  752|     66|        UA_ExtensionObject_init(&eo);
  753|     66|        eo.encoding = UA_EXTENSIONOBJECT_DECODED;
  754|     66|        eo.content.decoded.type = src->type;
  755|     66|        eo.content.decoded.data = src->data;
  756|     66|        ptr = &eo;
  757|     66|        type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  742|     66|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  758|     66|    }
  759|       |
  760|  30.9k|    return encodeJsonJumpTable[type->typeKind](ctx, ptr, type);
  761|  30.9k|}
ua_types_encoding_json.c:encodeArrayJsonWrapExtensionObject:
  766|  16.5k|                                   size_t size, const UA_DataType *type) {
  767|  16.5k|    if(size > UA_INT32_MAX)
  ------------------
  |  |  101|  16.5k|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (767:8): [True: 0, False: 16.5k]
  ------------------
  768|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  769|       |
  770|  16.5k|    status ret = writeJsonArrStart(ctx);
  771|       |
  772|  16.5k|    u16 memSize = type->memSize;
  773|  16.5k|    const UA_Boolean isBuiltin =
  774|  16.5k|        (type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO);
  775|  16.5k|    if(isBuiltin) {
  ------------------
  |  Branch (775:8): [True: 16.2k, False: 276]
  ------------------
  776|  16.2k|        uintptr_t ptr = (uintptr_t)data;
  777|  22.5M|        for(size_t i = 0; i < size && ret == UA_STATUSCODE_GOOD; ++i) {
  ------------------
  |  |   17|  22.5M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (777:27): [True: 22.5M, False: 16.2k]
  |  Branch (777:39): [True: 22.5M, False: 1]
  ------------------
  778|  22.5M|            ret |= writeJsonArrElm(ctx, (const void*)ptr, type);
  779|  22.5M|            ptr += memSize;
  780|  22.5M|        }
  781|  16.2k|    } else {
  782|       |        /* Set up a temporary ExtensionObject to wrap the data */
  783|    276|        UA_ExtensionObject eo;
  784|    276|        UA_ExtensionObject_init(&eo);
  785|    276|        eo.encoding = UA_EXTENSIONOBJECT_DECODED;
  786|    276|        eo.content.decoded.type = type;
  787|    276|        eo.content.decoded.data = (void*)(uintptr_t)data;
  788|    552|        for(size_t i = 0; i < size && ret == UA_STATUSCODE_GOOD; ++i) {
  ------------------
  |  |   17|    276|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (788:27): [True: 276, False: 276]
  |  Branch (788:39): [True: 276, False: 0]
  ------------------
  789|    276|            ret |= writeJsonArrElm(ctx, &eo, &UA_TYPES[UA_TYPES_EXTENSIONOBJECT]);
  ------------------
  |  |  742|    276|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  790|    276|            eo.content.decoded.data = (void*)
  791|    276|                ((uintptr_t)eo.content.decoded.data + memSize);
  792|    276|        }
  793|    276|    }
  794|       |
  795|  16.5k|    return ret | writeJsonArrEnd(ctx, type);
  796|  16.5k|}
ua_types_encoding_json.c:Variant_encodeJson:
  888|   199k|ENCODE_JSON(Variant) {
  889|   199k|    const UA_Variant *src = (const UA_Variant*)p;
  890|   199k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   199k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  891|   199k|    res |= writeJsonObjStart(ctx);
  892|       |    res |= encodeVariantInner(ctx, src, false);
  893|   199k|    res |= writeJsonObjEnd(ctx);
  894|   199k|    return res;
  895|   199k|}
ua_types_encoding_json.c:DiagnosticInfo_encodeJson:
  959|     12|ENCODE_JSON(DiagnosticInfo) {
  960|     12|    const UA_DiagnosticInfo *src = (const UA_DiagnosticInfo*)p;
  961|     12|    status ret = writeJsonObjStart(ctx);
  962|       |
  963|     12|    if(src->hasSymbolicId && src->symbolicId != -1) {
  ------------------
  |  Branch (963:8): [True: 0, False: 12]
  |  Branch (963:30): [True: 0, False: 0]
  ------------------
  964|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SYMBOLICID);
  965|      0|        ret |= Int32_encodeJson(ctx, &src->symbolicId, NULL);
  966|      0|    }
  967|       |
  968|     12|    if(src->hasNamespaceUri && src->namespaceUri != -1) {
  ------------------
  |  Branch (968:8): [True: 0, False: 12]
  |  Branch (968:32): [True: 0, False: 0]
  ------------------
  969|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_NAMESPACEURI);
  970|      0|        ret |= Int32_encodeJson(ctx, &src->namespaceUri, NULL);
  971|      0|    }
  972|       |
  973|     12|    if(src->hasLocalizedText && src->localizedText != -1) {
  ------------------
  |  Branch (973:8): [True: 0, False: 12]
  |  Branch (973:33): [True: 0, False: 0]
  ------------------
  974|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_LOCALIZEDTEXT);
  975|      0|        ret |= Int32_encodeJson(ctx, &src->localizedText, NULL);
  976|      0|    }
  977|       |
  978|     12|    if(src->hasLocale && src->locale != -1) {
  ------------------
  |  Branch (978:8): [True: 0, False: 12]
  |  Branch (978:26): [True: 0, False: 0]
  ------------------
  979|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_LOCALE);
  980|      0|        ret |= Int32_encodeJson(ctx, &src->locale, NULL);
  981|      0|    }
  982|       |
  983|     12|    if(src->hasAdditionalInfo && src->additionalInfo.length > 0) {
  ------------------
  |  Branch (983:8): [True: 0, False: 12]
  |  Branch (983:34): [True: 0, False: 0]
  ------------------
  984|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_ADDITIONALINFO);
  985|      0|        ret |= String_encodeJson(ctx, &src->additionalInfo, NULL);
  986|      0|    }
  987|       |
  988|     12|    if(src->hasInnerStatusCode &&
  ------------------
  |  Branch (988:8): [True: 0, False: 12]
  ------------------
  989|      0|       src->innerStatusCode != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (989:8): [True: 0, False: 0]
  ------------------
  990|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_INNERSTATUSCODE);
  991|      0|        ret |= StatusCode_encodeJson(ctx, &src->innerStatusCode, NULL);
  992|      0|    }
  993|       |
  994|     12|    if(src->hasInnerDiagnosticInfo && src->innerDiagnosticInfo &&
  ------------------
  |  Branch (994:8): [True: 0, False: 12]
  |  Branch (994:39): [True: 0, False: 0]
  ------------------
  995|      0|       diagnosticInfoHasContent(src->innerDiagnosticInfo, 0)) {
  ------------------
  |  Branch (995:8): [True: 0, False: 0]
  ------------------
  996|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_INNERDIAGNOSTICINFO);
  997|      0|        ret |= DiagnosticInfo_encodeJson(ctx, src->innerDiagnosticInfo, NULL);
  998|      0|    }
  999|       |
 1000|     12|    return ret | writeJsonObjEnd(ctx);
 1001|     12|}
ua_types_encoding_json.c:Enum_encodeJson:
  354|    273|ENCODE_JSON(Enum) {
  355|    273|    if(ctx->useCompactEncoding)
  ------------------
  |  Branch (355:8): [True: 0, False: 273]
  ------------------
  356|      0|        return Int32_encodeJson(ctx, p, type);
  357|       |
  358|    273|    status ret = writeJsonQuote(ctx);
  359|    273|#ifdef UA_ENABLE_TYPEDESCRIPTION
  360|    273|    const UA_Int32 value = *(const UA_Int32*)p;
  361|    414|    for(size_t i = 0; i < type->membersSize; i++) {
  ------------------
  |  Branch (361:23): [True: 387, False: 27]
  ------------------
  362|    387|        const UA_DataTypeMember *member = &type->members[i];
  363|    387|        if((UA_Int32)(intptr_t)member->memberType != value ||
  ------------------
  |  Branch (363:12): [True: 141, False: 246]
  ------------------
  364|    246|           !member->memberName)
  ------------------
  |  Branch (364:12): [True: 0, False: 246]
  ------------------
  365|    141|            continue;
  366|       |
  367|    246|        UA_String name = UA_STRING((char*)(uintptr_t)member->memberName);
  368|    246|        ret |= writeJsonStringContent(ctx, &name);
  369|    246|        ret |= writeChar(ctx, '_');
  370|    246|        break;
  371|    387|    }
  372|    273|#endif
  373|    273|    ret |= Int32_encodeJson(ctx, p, type);
  374|    273|    return ret | writeJsonQuote(ctx);
  375|    273|}
ua_types_encoding_json.c:encodeJsonStructure:
 1140|  12.7k|encodeJsonStructure(CtxJson *ctx, const void *src, const UA_DataType *type) {
 1141|  12.7k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  12.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1142|  12.7k|    res |= writeJsonObjStart(ctx);
 1143|  12.7k|    res |= encodeJsonStructureContent(ctx, src, type);
 1144|  12.7k|    res |= writeJsonObjEnd(ctx);
 1145|  12.7k|    return res;
 1146|  12.7k|}
ua_types_encoding_json.c:jsoneq:
 1354|   875k|jsoneq(const char *json, const cj5_token *tok, const char *searchKey) {
 1355|       |    /* TODO: necessary?
 1356|       |       if(json == NULL
 1357|       |            || tok == NULL
 1358|       |            || searchKey == NULL) {
 1359|       |        return -1;
 1360|       |    } */
 1361|       |
 1362|   875k|    size_t len = getTokenLength(tok);
 1363|   875k|    if(tok->type == CJ5_TOKEN_STRING &&
  ------------------
  |  Branch (1363:8): [True: 875k, False: 0]
  ------------------
 1364|   875k|       strlen(searchKey) ==  len &&
  ------------------
  |  Branch (1364:8): [True: 165k, False: 710k]
  ------------------
 1365|   165k|       strncmp(json + tok->start, (const char*)searchKey, len) == 0)
  ------------------
  |  Branch (1365:8): [True: 156k, False: 8.43k]
  ------------------
 1366|   156k|        return 0;
 1367|       |
 1368|   718k|    return -1;
 1369|   875k|}
ua_types_encoding_json.c:skipObject:
 1338|   756k|skipObject(ParseCtx *ctx) {
 1339|   756k|    unsigned int end = ctx->tokens[ctx->index].end;
 1340|  65.4M|    do {
 1341|  65.4M|        ctx->index++;
 1342|  65.4M|    } while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1342:13): [True: 65.4M, False: 21.4k]
  ------------------
 1343|  65.4M|            ctx->tokens[ctx->index].start < end);
  ------------------
  |  Branch (1343:13): [True: 64.7M, False: 734k]
  ------------------
 1344|   756k|}
ua_types_encoding_json.c:DiagnosticInfo_decodeJson:
 2481|      7|DECODE_JSON(DiagnosticInfo) {
 2482|      7|    UA_DiagnosticInfo *dst = (UA_DiagnosticInfo*)p;
 2483|      7|    CHECK_NULL_SKIP; /* Treat a null value as an empty DiagnosticInfo */
  ------------------
  |  | 1323|      7|#define CHECK_NULL_SKIP do {                         \
  |  | 1324|      7|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1324:8): [True: 0, False: 7]
  |  |  ------------------
  |  | 1325|      0|        ctx->index++;                                \
  |  | 1326|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1327|      7|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1327:14): [Folded, False: 7]
  |  |  ------------------
  ------------------
 2484|      7|    CHECK_OBJECT;
  ------------------
  |  | 1318|      7|#define CHECK_OBJECT do {                                \
  |  | 1319|      7|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1319:8): [True: 2, False: 5]
  |  |  ------------------
  |  | 1320|      2|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1321|      5|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1321:14): [Folded, False: 5]
  |  |  ------------------
  ------------------
 2485|       |
 2486|      5|    DecodeEntry entries[7] = {
 2487|      5|        {UA_JSONKEY_SYMBOLICID, &dst->symbolicId, NULL,
 2488|      5|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  198|      5|#define UA_TYPES_INT32 5
  ------------------
 2489|      5|        {UA_JSONKEY_NAMESPACEURI, &dst->namespaceUri, NULL,
 2490|      5|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  198|      5|#define UA_TYPES_INT32 5
  ------------------
 2491|      5|        {UA_JSONKEY_LOCALIZEDTEXT, &dst->localizedText, NULL,
 2492|      5|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  198|      5|#define UA_TYPES_INT32 5
  ------------------
 2493|      5|        {UA_JSONKEY_LOCALE, &dst->locale, NULL,
 2494|      5|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  198|      5|#define UA_TYPES_INT32 5
  ------------------
 2495|      5|        {UA_JSONKEY_ADDITIONALINFO, &dst->additionalInfo, NULL,
 2496|      5|         false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  402|      5|#define UA_TYPES_STRING 11
  ------------------
 2497|      5|        {UA_JSONKEY_INNERSTATUSCODE, &dst->innerStatusCode, NULL,
 2498|      5|         false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  640|      5|#define UA_TYPES_STATUSCODE 18
  ------------------
 2499|      5|        {UA_JSONKEY_INNERDIAGNOSTICINFO, &dst->innerDiagnosticInfo,
 2500|      5|         DiagnosticInfoInner_decodeJson, false, NULL}
 2501|      5|    };
 2502|      5|    status ret = decodeFields(ctx, entries, 7);
 2503|       |
 2504|      5|    dst->hasSymbolicId = entries[0].found;
 2505|      5|    dst->hasNamespaceUri = entries[1].found;
 2506|      5|    dst->hasLocalizedText = entries[2].found;
 2507|      5|    dst->hasLocale = entries[3].found;
 2508|      5|    dst->hasAdditionalInfo = entries[4].found;
 2509|      5|    dst->hasInnerStatusCode = entries[5].found;
 2510|      5|    dst->hasInnerDiagnosticInfo = entries[6].found;
 2511|      5|    return ret;
 2512|      7|}
ua_types_encoding_json.c:decodeFieldsInternal:
 2527|   886k|                     UA_Boolean allowUnknown) {
 2528|   886k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|   886k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|   886k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 886k]
  |  |  ------------------
  |  | 1300|   886k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|   886k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 886k]
  |  |  ------------------
  ------------------
 2529|   886k|    CHECK_NULL_SKIP; /* null is treated like an empty object */
  ------------------
  |  | 1323|   886k|#define CHECK_NULL_SKIP do {                         \
  |  | 1324|   886k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1324:8): [True: 0, False: 886k]
  |  |  ------------------
  |  | 1325|      0|        ctx->index++;                                \
  |  | 1326|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1327|   886k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1327:14): [Folded, False: 886k]
  |  |  ------------------
  ------------------
 2530|       |
 2531|   886k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION)
  ------------------
  |  |  128|   886k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (2531:8): [True: 0, False: 886k]
  ------------------
 2532|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2533|       |
 2534|       |    /* Keys and values are counted separately */
 2535|   886k|    CHECK_OBJECT;
  ------------------
  |  | 1318|   886k|#define CHECK_OBJECT do {                                \
  |  | 1319|   886k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1319:8): [True: 7, False: 886k]
  |  |  ------------------
  |  | 1320|      7|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1321|   886k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1321:14): [Folded, False: 886k]
  |  |  ------------------
  ------------------
 2536|   886k|    UA_assert(ctx->tokens[ctx->index].size % 2 == 0);
  ------------------
  |  |  248|   886k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2536:5): [True: 886k, False: 0]
  ------------------
 2537|   886k|    size_t keyCount = (size_t)(ctx->tokens[ctx->index].size) / 2;
 2538|       |
 2539|   886k|    ctx->index++; /* Go to first key - or jump after the empty object */
 2540|   886k|    ctx->depth++;
 2541|       |
 2542|   886k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   886k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2543|   949k|    for(size_t key = 0; key < keyCount; key++) {
  ------------------
  |  Branch (2543:25): [True: 63.2k, False: 886k]
  ------------------
 2544|       |        /* Key must be a string */
 2545|  63.2k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  248|  63.2k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2545:9): [True: 63.2k, False: 0]
  ------------------
 2546|  63.2k|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  248|  63.2k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2546:9): [True: 63.2k, False: 0]
  ------------------
 2547|       |
 2548|       |        /* Search for the decoding entry matching the key. Start at the key
 2549|       |         * index to speed-up the case where they key-order is the same as the
 2550|       |         * entry-order. */
 2551|  63.2k|        DecodeEntry *entry = NULL;
 2552|   106k|        for(size_t i = key; i < key + entryCount; i++) {
  ------------------
  |  Branch (2552:29): [True: 106k, False: 62]
  ------------------
 2553|   106k|            size_t ii = i;
 2554|   111k|            while(ii >= entryCount)
  ------------------
  |  Branch (2554:19): [True: 5.37k, False: 106k]
  ------------------
 2555|  5.37k|                ii -= entryCount;
 2556|       |
 2557|       |            /* Compare the key */
 2558|   106k|            if(jsoneq(ctx->json5, &ctx->tokens[ctx->index],
  ------------------
  |  Branch (2558:16): [True: 43.0k, False: 63.2k]
  ------------------
 2559|   106k|                      entries[ii].fieldName) != 0)
 2560|  43.0k|                continue;
 2561|       |
 2562|       |            /* Key was already used -> duplicate, abort */
 2563|  63.2k|            if(entries[ii].found) {
  ------------------
  |  Branch (2563:16): [True: 2, False: 63.2k]
  ------------------
 2564|      2|                ctx->depth--;
 2565|      2|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2566|      2|            }
 2567|       |
 2568|       |            /* Found the key */
 2569|  63.2k|            entries[ii].found = true;
 2570|  63.2k|            entry = &entries[ii];
 2571|  63.2k|            break;
 2572|  63.2k|        }
 2573|       |
 2574|       |        /* The key is unknown */
 2575|  63.2k|        if(!entry) {
  ------------------
  |  Branch (2575:12): [True: 62, False: 63.2k]
  ------------------
 2576|     62|            if(allowUnknown) {
  ------------------
  |  Branch (2576:16): [True: 0, False: 62]
  ------------------
 2577|      0|                ctx->index++; /* key -> value */
 2578|      0|                skipObject(ctx);
 2579|      0|                continue;
 2580|      0|            }
 2581|     62|            ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     62|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2582|     62|            break;
 2583|     62|        }
 2584|       |
 2585|       |        /* Go from key to value */
 2586|  63.2k|        ctx->index++;
 2587|  63.2k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  248|  63.2k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2587:9): [True: 63.2k, False: 0]
  ------------------
 2588|       |
 2589|       |        /* An entry that was expected but shall not be decoded.
 2590|       |         * Jump over the value. */
 2591|  63.2k|        if(!entry->function && !entry->type) {
  ------------------
  |  Branch (2591:12): [True: 59.5k, False: 3.71k]
  |  Branch (2591:32): [True: 35.0k, False: 24.4k]
  ------------------
 2592|  35.0k|            skipObject(ctx);
 2593|  35.0k|            continue;
 2594|  35.0k|        }
 2595|       |
 2596|       |        /* A null-value is only valid for nullable fields. */
 2597|  28.2k|        if(currentTokenType(ctx) == CJ5_TOKEN_NULL && !entry->function) {
  ------------------
  |  Branch (2597:12): [True: 7.76k, False: 20.4k]
  |  Branch (2597:55): [True: 4.21k, False: 3.54k]
  ------------------
 2598|  4.21k|            if(!entry->type || !isJsonNullable(entry->type)) {
  ------------------
  |  Branch (2598:16): [True: 0, False: 4.21k]
  |  Branch (2598:32): [True: 1, False: 4.21k]
  ------------------
 2599|      1|                ctx->depth--;
 2600|      1|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2601|      1|            }
 2602|  4.21k|            ctx->index++; /* skip null value */
 2603|  4.21k|            continue;
 2604|  4.21k|        }
 2605|       |
 2606|       |        /* Decode. This also moves to the next key or right after the object for
 2607|       |         * the last value. */
 2608|  23.9k|        decodeJsonSignature decodeFunc = (entry->function) ?
  ------------------
  |  Branch (2608:42): [True: 3.71k, False: 20.2k]
  ------------------
 2609|  20.2k|            entry->function : decodeJsonJumpTable[entry->type->typeKind];
 2610|  23.9k|        ret = decodeFunc(ctx, entry->fieldPointer, entry->type);
 2611|  23.9k|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  23.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2611:12): [True: 10, False: 23.9k]
  ------------------
 2612|     10|            break;
 2613|  23.9k|    }
 2614|       |
 2615|   886k|    ctx->depth--;
 2616|   886k|    return ret;
 2617|   886k|}
ua_types_encoding_json.c:Boolean_decodeJson:
 1427|  4.03k|DECODE_JSON(Boolean) {
 1428|  4.03k|    UA_Boolean *dst = (UA_Boolean*)p;
 1429|  4.03k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|  4.03k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|  4.03k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 4.03k]
  |  |  ------------------
  |  | 1300|  4.03k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|  4.03k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 4.03k]
  |  |  ------------------
  ------------------
 1430|  4.03k|    CHECK_BOOL;
  ------------------
  |  | 1308|  4.03k|#define CHECK_BOOL do {                                \
  |  | 1309|  4.03k|    if(currentTokenType(ctx) != CJ5_TOKEN_BOOL) {      \
  |  |  ------------------
  |  |  |  Branch (1309:8): [True: 51, False: 3.98k]
  |  |  ------------------
  |  | 1310|     51|        return UA_STATUSCODE_BADDECODINGERROR;         \
  |  |  ------------------
  |  |  |  |   44|     51|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1311|  3.98k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1311:14): [Folded, False: 3.98k]
  |  |  ------------------
  ------------------
 1431|  3.98k|    GET_TOKEN;
  ------------------
  |  | 1294|  3.98k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|  3.98k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|  3.98k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 3.98k]
  |  |  ------------------
  ------------------
 1432|       |
 1433|  3.98k|    if(tokenSize == 4 &&
  ------------------
  |  Branch (1433:8): [True: 278, False: 3.70k]
  ------------------
 1434|    278|       (tokenData[0] | 32) == 't' && (tokenData[1] | 32) == 'r' &&
  ------------------
  |  Branch (1434:8): [True: 278, False: 0]
  |  Branch (1434:38): [True: 278, False: 0]
  ------------------
 1435|    278|       (tokenData[2] | 32) == 'u' && (tokenData[3] | 32) == 'e') {
  ------------------
  |  Branch (1435:8): [True: 278, False: 0]
  |  Branch (1435:38): [True: 278, False: 0]
  ------------------
 1436|    278|        *dst = true;
 1437|  3.70k|    } else if(tokenSize == 5 &&
  ------------------
  |  Branch (1437:15): [True: 3.70k, False: 0]
  ------------------
 1438|  3.70k|              (tokenData[0] | 32) == 'f' && (tokenData[1] | 32) == 'a' &&
  ------------------
  |  Branch (1438:15): [True: 3.70k, False: 0]
  |  Branch (1438:45): [True: 3.70k, False: 0]
  ------------------
 1439|  3.70k|              (tokenData[2] | 32) == 'l' && (tokenData[3] | 32) == 's' &&
  ------------------
  |  Branch (1439:15): [True: 3.70k, False: 0]
  |  Branch (1439:45): [True: 3.70k, False: 0]
  ------------------
 1440|  3.70k|              (tokenData[4] | 32) == 'e') {
  ------------------
  |  Branch (1440:15): [True: 3.70k, False: 0]
  ------------------
 1441|  3.70k|        *dst = false;
 1442|  3.70k|    } else {
 1443|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1444|      0|    }
 1445|       |
 1446|  3.98k|    ctx->index++;
 1447|  3.98k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  3.98k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1448|  3.98k|}
ua_types_encoding_json.c:SByte_decodeJson:
 1535|  70.6k|DECODE_JSON(SByte) {
 1536|  70.6k|    UA_SByte *dst = (UA_SByte*)p;
 1537|  70.6k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|  70.6k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|  70.6k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 70.6k]
  |  |  ------------------
  |  | 1300|  70.6k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|  70.6k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 70.6k]
  |  |  ------------------
  ------------------
 1538|  70.6k|    CHECK_NUMBER;
  ------------------
  |  | 1303|  70.6k|#define CHECK_NUMBER do {                                \
  |  | 1304|  70.6k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1304:8): [True: 9, False: 70.6k]
  |  |  ------------------
  |  | 1305|      9|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1306|  70.6k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1306:14): [Folded, False: 70.6k]
  |  |  ------------------
  ------------------
 1539|  70.6k|    GET_TOKEN;
  ------------------
  |  | 1294|  70.6k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|  70.6k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|  70.6k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 70.6k]
  |  |  ------------------
  ------------------
 1540|  70.6k|    UA_Int64 out = 0;
 1541|  70.6k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1542|  70.6k|    if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   17|   141k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   64|   141k|#define UA_SBYTE_MIN (-128)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   65|  70.5k|#define UA_SBYTE_MAX 127
  ------------------
  |  Branch (1542:8): [True: 50, False: 70.6k]
  |  Branch (1542:35): [True: 91, False: 70.5k]
  |  Branch (1542:57): [True: 55, False: 70.4k]
  ------------------
 1543|    196|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    196|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1544|  70.4k|    *dst = (UA_SByte)out;
 1545|  70.4k|    ctx->index++;
 1546|  70.4k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  70.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1547|  70.6k|}
ua_types_encoding_json.c:parseSignedInteger:
 1467|  4.90M|parseSignedInteger(const char *tokenData, size_t tokenSize, UA_Int64 *dst) {
 1468|  4.90M|    size_t len = parseInt64(tokenData, tokenSize, dst);
 1469|  4.90M|    if(len == 0)
  ------------------
  |  Branch (1469:8): [True: 101, False: 4.90M]
  ------------------
 1470|    101|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    101|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1471|       |
 1472|       |    /* There must only be whitespace between the end of the parsed number and
 1473|       |     * the end of the token */
 1474|  4.90M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1474:25): [True: 1.66k, False: 4.90M]
  ------------------
 1475|  1.66k|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1475:12): [True: 1.64k, False: 19]
  |  Branch (1475:35): [True: 87, False: 1.55k]
  ------------------
 1476|     87|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     87|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1477|  1.66k|    }
 1478|       |
 1479|  4.90M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.90M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1480|  4.90M|}
ua_types_encoding_json.c:Byte_decodeJson:
 1482|  1.97k|DECODE_JSON(Byte) {
 1483|  1.97k|    UA_Byte *dst = (UA_Byte*)p;
 1484|  1.97k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|  1.97k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|  1.97k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 1.97k]
  |  |  ------------------
  |  | 1300|  1.97k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|  1.97k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 1.97k]
  |  |  ------------------
  ------------------
 1485|  1.97k|    CHECK_NUMBER;
  ------------------
  |  | 1303|  1.97k|#define CHECK_NUMBER do {                                \
  |  | 1304|  1.97k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1304:8): [True: 6, False: 1.97k]
  |  |  ------------------
  |  | 1305|      6|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1306|  1.97k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1306:14): [Folded, False: 1.97k]
  |  |  ------------------
  ------------------
 1486|  1.97k|    GET_TOKEN;
  ------------------
  |  | 1294|  1.97k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|  1.97k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|  1.97k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 1.97k]
  |  |  ------------------
  ------------------
 1487|  1.97k|    UA_UInt64 out = 0;
 1488|  1.97k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1489|  1.97k|    if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   17|  3.94k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   74|  1.95k|#define UA_BYTE_MAX 255
  ------------------
  |  Branch (1489:8): [True: 19, False: 1.95k]
  |  Branch (1489:35): [True: 59, False: 1.89k]
  ------------------
 1490|     78|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     78|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1491|  1.89k|    *dst = (UA_Byte)out;
 1492|  1.89k|    ctx->index++;
 1493|  1.89k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.89k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1494|  1.97k|}
ua_types_encoding_json.c:parseUnsignedInteger:
 1451|  3.37M|parseUnsignedInteger(const char *tokenData, size_t tokenSize, UA_UInt64 *dst) {
 1452|  3.37M|    size_t len = parseUInt64(tokenData, tokenSize, dst);
 1453|  3.37M|    if(len == 0)
  ------------------
  |  Branch (1453:8): [True: 45, False: 3.37M]
  ------------------
 1454|     45|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     45|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1455|       |
 1456|       |    /* There must only be whitespace between the end of the parsed number and
 1457|       |     * the end of the token */
 1458|  3.37M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1458:25): [True: 1.60k, False: 3.37M]
  ------------------
 1459|  1.60k|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1459:12): [True: 1.56k, False: 35]
  |  Branch (1459:35): [True: 78, False: 1.48k]
  ------------------
 1460|     78|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     78|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1461|  1.60k|    }
 1462|       |
 1463|  3.37M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  3.37M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1464|  3.37M|}
ua_types_encoding_json.c:Int16_decodeJson:
 1549|   265k|DECODE_JSON(Int16) {
 1550|   265k|    UA_Int16 *dst = (UA_Int16*)p;
 1551|   265k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|   265k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|   265k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 265k]
  |  |  ------------------
  |  | 1300|   265k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|   265k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 265k]
  |  |  ------------------
  ------------------
 1552|   265k|    CHECK_NUMBER;
  ------------------
  |  | 1303|   265k|#define CHECK_NUMBER do {                                \
  |  | 1304|   265k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1304:8): [True: 17, False: 265k]
  |  |  ------------------
  |  | 1305|     17|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     17|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1306|   265k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1306:14): [Folded, False: 265k]
  |  |  ------------------
  ------------------
 1553|   265k|    GET_TOKEN;
  ------------------
  |  | 1294|   265k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|   265k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|   265k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 265k]
  |  |  ------------------
  ------------------
 1554|   265k|    UA_Int64 out = 0;
 1555|   265k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1556|   265k|    if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   17|   530k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   82|   530k|#define UA_INT16_MIN (-32768)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   83|   265k|#define UA_INT16_MAX 32767
  ------------------
  |  Branch (1556:8): [True: 36, False: 265k]
  |  Branch (1556:35): [True: 66, False: 265k]
  |  Branch (1556:57): [True: 34, False: 265k]
  ------------------
 1557|    136|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    136|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1558|   265k|    *dst = (UA_Int16)out;
 1559|   265k|    ctx->index++;
 1560|   265k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   265k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1561|   265k|}
ua_types_encoding_json.c:UInt16_decodeJson:
 1496|  22.2k|DECODE_JSON(UInt16) {
 1497|  22.2k|    UA_UInt16 *dst = (UA_UInt16*)p;
 1498|  22.2k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|  22.2k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|  22.2k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 22.2k]
  |  |  ------------------
  |  | 1300|  22.2k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|  22.2k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 22.2k]
  |  |  ------------------
  ------------------
 1499|  22.2k|    CHECK_NUMBER;
  ------------------
  |  | 1303|  22.2k|#define CHECK_NUMBER do {                                \
  |  | 1304|  22.2k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1304:8): [True: 7, False: 22.2k]
  |  |  ------------------
  |  | 1305|      7|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1306|  22.2k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1306:14): [Folded, False: 22.2k]
  |  |  ------------------
  ------------------
 1500|  22.2k|    GET_TOKEN;
  ------------------
  |  | 1294|  22.2k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|  22.2k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|  22.2k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 22.2k]
  |  |  ------------------
  ------------------
 1501|  22.2k|    UA_UInt64 out = 0;
 1502|  22.2k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1503|  22.2k|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   17|  44.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   92|  22.2k|#define UA_UINT16_MAX 65535
  ------------------
  |  Branch (1503:8): [True: 21, False: 22.2k]
  |  Branch (1503:35): [True: 58, False: 22.2k]
  ------------------
 1504|     79|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     79|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1505|  22.2k|    *dst = (UA_UInt16)out;
 1506|  22.2k|    ctx->index++;
 1507|  22.2k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  22.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1508|  22.2k|}
ua_types_encoding_json.c:Int32_decodeJson:
 1563|  2.77M|DECODE_JSON(Int32) {
 1564|  2.77M|    UA_Int32 *dst = (UA_Int32*)p;
 1565|  2.77M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|  2.77M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|  2.77M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 2.77M]
  |  |  ------------------
  |  | 1300|  2.77M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|  2.77M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 2.77M]
  |  |  ------------------
  ------------------
 1566|  2.77M|    CHECK_NUMBER;
  ------------------
  |  | 1303|  2.77M|#define CHECK_NUMBER do {                                \
  |  | 1304|  2.77M|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1304:8): [True: 8, False: 2.77M]
  |  |  ------------------
  |  | 1305|      8|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      8|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1306|  2.77M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1306:14): [Folded, False: 2.77M]
  |  |  ------------------
  ------------------
 1567|  2.77M|    GET_TOKEN;
  ------------------
  |  | 1294|  2.77M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|  2.77M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|  2.77M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 2.77M]
  |  |  ------------------
  ------------------
 1568|  2.77M|    UA_Int64 out = 0;
 1569|  2.77M|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1570|  2.77M|    if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   17|  5.54M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |  100|  5.54M|#define UA_INT32_MIN ((int32_t)-2147483648LL)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |  101|  2.77M|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (1570:8): [True: 49, False: 2.77M]
  |  Branch (1570:35): [True: 53, False: 2.77M]
  |  Branch (1570:57): [True: 8, False: 2.77M]
  ------------------
 1571|    110|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    110|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1572|  2.77M|    *dst = (UA_Int32)out;
 1573|  2.77M|    ctx->index++;
 1574|  2.77M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  2.77M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1575|  2.77M|}
ua_types_encoding_json.c:UInt32_decodeJson:
 1510|   501k|DECODE_JSON(UInt32) {
 1511|   501k|    UA_UInt32 *dst = (UA_UInt32*)p;
 1512|   501k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|   501k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|   501k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 501k]
  |  |  ------------------
  |  | 1300|   501k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|   501k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 501k]
  |  |  ------------------
  ------------------
 1513|   501k|    CHECK_NUMBER;
  ------------------
  |  | 1303|   501k|#define CHECK_NUMBER do {                                \
  |  | 1304|   501k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1304:8): [True: 3, False: 501k]
  |  |  ------------------
  |  | 1305|      3|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1306|   501k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1306:14): [Folded, False: 501k]
  |  |  ------------------
  ------------------
 1514|   501k|    GET_TOKEN;
  ------------------
  |  | 1294|   501k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|   501k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|   501k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 501k]
  |  |  ------------------
  ------------------
 1515|   501k|    UA_UInt64 out = 0;
 1516|   501k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1517|   501k|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |   17|  1.00M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |  110|   501k|#define UA_UINT32_MAX 4294967295UL
  ------------------
  |  Branch (1517:8): [True: 42, False: 501k]
  |  Branch (1517:35): [True: 52, False: 500k]
  ------------------
 1518|     94|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     94|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1519|   500k|    *dst = (UA_UInt32)out;
 1520|   500k|    ctx->index++;
 1521|   500k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   500k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1522|   501k|}
ua_types_encoding_json.c:Int64_decodeJson:
 1577|  1.79M|DECODE_JSON(Int64) {
 1578|  1.79M|    UA_Int64 *dst = (UA_Int64*)p;
 1579|  1.79M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|  1.79M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|  1.79M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 1.79M]
  |  |  ------------------
  |  | 1300|  1.79M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|  1.79M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 1.79M]
  |  |  ------------------
  ------------------
 1580|  1.79M|    GET_TOKEN;
  ------------------
  |  | 1294|  1.79M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|  1.79M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|  1.79M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 1.79M]
  |  |  ------------------
  ------------------
 1581|  1.79M|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, dst);
 1582|  1.79M|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  1.79M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1582:8): [True: 53, False: 1.79M]
  ------------------
 1583|     53|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     53|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1584|  1.79M|    ctx->index++;
 1585|  1.79M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.79M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1586|  1.79M|}
ua_types_encoding_json.c:UInt64_decodeJson:
 1524|  2.84M|DECODE_JSON(UInt64) {
 1525|  2.84M|    UA_UInt64 *dst = (UA_UInt64*)p;
 1526|  2.84M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|  2.84M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|  2.84M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 2.84M]
  |  |  ------------------
  |  | 1300|  2.84M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|  2.84M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 2.84M]
  |  |  ------------------
  ------------------
 1527|  2.84M|    GET_TOKEN;
  ------------------
  |  | 1294|  2.84M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|  2.84M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|  2.84M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 2.84M]
  |  |  ------------------
  ------------------
 1528|  2.84M|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, dst);
 1529|  2.84M|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  2.84M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1529:8): [True: 41, False: 2.84M]
  ------------------
 1530|     41|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     41|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1531|  2.84M|    ctx->index++;
 1532|  2.84M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  2.84M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1533|  2.84M|}
ua_types_encoding_json.c:Float_decodeJson:
 1649|  2.59M|DECODE_JSON(Float) {
 1650|  2.59M|    UA_Float *dst = (UA_Float*)p;
 1651|  2.59M|    UA_Double v = 0.0;
 1652|       |    UA_StatusCode res = Double_decodeJson(ctx, &v, NULL);
 1653|  2.59M|    *dst = (UA_Float)v;
 1654|  2.59M|    return res;
 1655|  2.59M|}
ua_types_encoding_json.c:Double_decodeJson:
 1589|  6.07M|DECODE_JSON(Double) {
 1590|  6.07M|    UA_Double *dst = (UA_Double*)p;
 1591|  6.07M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|  6.07M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|  6.07M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 6.07M]
  |  |  ------------------
  |  | 1300|  6.07M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|  6.07M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 6.07M]
  |  |  ------------------
  ------------------
 1592|  6.07M|    GET_TOKEN;
  ------------------
  |  | 1294|  6.07M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|  6.07M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|  6.07M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 6.07M]
  |  |  ------------------
  ------------------
 1593|       |
 1594|       |    /* https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/
 1595|       |     * Maximum digit counts for select IEEE floating-point formats: 1074
 1596|       |     * Sanity check.
 1597|       |     */
 1598|  6.07M|    if(tokenSize > 2000)
  ------------------
  |  Branch (1598:8): [True: 1, False: 6.07M]
  ------------------
 1599|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1600|       |
 1601|  6.07M|    cj5_token_type tokenType = currentTokenType(ctx);
 1602|       |
 1603|       |    /* It could be a String with Nan, Infinity */
 1604|  6.07M|    if(tokenType == CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (1604:8): [True: 61.3k, False: 6.00M]
  ------------------
 1605|  61.3k|        ctx->index++;
 1606|       |
 1607|  61.3k|        if(tokenSize == 8 && memcmp(tokenData, "Infinity", 8) == 0) {
  ------------------
  |  Branch (1607:12): [True: 29.4k, False: 31.8k]
  |  Branch (1607:30): [True: 29.4k, False: 14]
  ------------------
 1608|  29.4k|            *dst = INFINITY;
 1609|  29.4k|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  29.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1610|  29.4k|        }
 1611|       |
 1612|  31.8k|        if(tokenSize == 9 && memcmp(tokenData, "-Infinity", 9) == 0) {
  ------------------
  |  Branch (1612:12): [True: 20.9k, False: 10.9k]
  |  Branch (1612:30): [True: 20.9k, False: 7]
  ------------------
 1613|       |            /* workaround an MSVC 2013 issue */
 1614|  20.9k|            *dst = -INFINITY;
 1615|  20.9k|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  20.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1616|  20.9k|        }
 1617|       |
 1618|  10.9k|        if(tokenSize == 3 && memcmp(tokenData, "NaN", 3) == 0) {
  ------------------
  |  Branch (1618:12): [True: 10.4k, False: 467]
  |  Branch (1618:30): [True: 10.4k, False: 16]
  ------------------
 1619|  10.4k|            *dst = NAN;
 1620|  10.4k|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  10.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1621|  10.4k|        }
 1622|       |
 1623|    483|        if(tokenSize == 4 && memcmp(tokenData, "-NaN", 4) == 0) {
  ------------------
  |  Branch (1623:12): [True: 410, False: 73]
  |  Branch (1623:30): [True: 390, False: 20]
  ------------------
 1624|    390|            *dst = NAN;
 1625|    390|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    390|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1626|    390|        }
 1627|       |
 1628|     93|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     93|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1629|    483|    }
 1630|       |
 1631|  6.00M|    if(tokenType != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1631:8): [True: 4, False: 6.00M]
  ------------------
 1632|      4|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1633|       |
 1634|  6.00M|    size_t len = parseDouble(tokenData, tokenSize, dst);
 1635|  6.00M|    if(len == 0)
  ------------------
  |  Branch (1635:8): [True: 3, False: 6.00M]
  ------------------
 1636|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1637|       |
 1638|       |    /* There must only be whitespace between the end of the parsed number and
 1639|       |     * the end of the token */
 1640|  6.00M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1640:25): [True: 12, False: 6.00M]
  ------------------
 1641|     12|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1641:12): [True: 12, False: 0]
  |  Branch (1641:35): [True: 12, False: 0]
  ------------------
 1642|     12|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     12|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1643|     12|    }
 1644|       |
 1645|  6.00M|    ctx->index++;
 1646|  6.00M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  6.00M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1647|  6.00M|}
ua_types_encoding_json.c:String_decodeJson:
 1667|   137k|DECODE_JSON(String) {
 1668|   137k|    UA_String *dst = (UA_String*)p;
 1669|   137k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|   137k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|   137k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 137k]
  |  |  ------------------
  |  | 1300|   137k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|   137k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 137k]
  |  |  ------------------
  ------------------
 1670|   137k|    CHECK_NULL_SKIP;
  ------------------
  |  | 1323|   137k|#define CHECK_NULL_SKIP do {                         \
  |  | 1324|   137k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1324:8): [True: 0, False: 137k]
  |  |  ------------------
  |  | 1325|      0|        ctx->index++;                                \
  |  | 1326|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1327|   137k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1327:14): [Folded, False: 137k]
  |  |  ------------------
  ------------------
 1671|   137k|    CHECK_STRING;
  ------------------
  |  | 1313|   137k|#define CHECK_STRING do {                                \
  |  | 1314|   137k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1314:8): [True: 40, False: 137k]
  |  |  ------------------
  |  | 1315|     40|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     40|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1316|   137k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1316:14): [Folded, False: 137k]
  |  |  ------------------
  ------------------
 1672|   137k|    GET_TOKEN;
  ------------------
  |  | 1294|   137k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|   137k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|   137k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 137k]
  |  |  ------------------
  ------------------
 1673|   137k|    (void)tokenData;
 1674|       |
 1675|       |    /* Empty string? */
 1676|   137k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1676:8): [True: 12.5k, False: 125k]
  ------------------
 1677|  12.5k|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  757|  12.5k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1678|  12.5k|        dst->length = 0;
 1679|  12.5k|        ctx->index++;
 1680|  12.5k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  12.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1681|  12.5k|    }
 1682|       |
 1683|       |    /* The decoded utf8 is at most of the same length as the source string */
 1684|   125k|    char *outBuf = (char*)UA_malloc(tokenSize+1);
  ------------------
  |  |   22|   125k|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 1685|   125k|    if(!outBuf)
  ------------------
  |  Branch (1685:8): [True: 0, False: 125k]
  ------------------
 1686|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1687|       |
 1688|       |    /* Decode the string */
 1689|   125k|    cj5_result r;
 1690|   125k|    r.tokens = ctx->tokens;
 1691|   125k|    r.num_tokens = (unsigned int)ctx->tokensSize;
 1692|   125k|    r.json5 = ctx->json5;
 1693|   125k|    unsigned int len = 0;
 1694|   125k|    cj5_error_code err = cj5_get_str(&r, (unsigned int)ctx->index, outBuf, &len);
 1695|   125k|    if(err != CJ5_ERROR_NONE) {
  ------------------
  |  Branch (1695:8): [True: 130, False: 125k]
  ------------------
 1696|    130|        UA_free(outBuf);
  ------------------
  |  |   23|    130|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1697|    130|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    130|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1698|    130|    }
 1699|       |
 1700|       |    /* Set the output */
 1701|   125k|    dst->length = len;
 1702|   125k|    if(dst->length > 0) {
  ------------------
  |  Branch (1702:8): [True: 125k, False: 0]
  ------------------
 1703|   125k|        dst->data = (UA_Byte*)outBuf;
 1704|   125k|    } else {
 1705|      0|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  757|      0|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1706|      0|        UA_free(outBuf);
  ------------------
  |  |   23|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1707|      0|    }
 1708|       |
 1709|   125k|    ctx->index++;
 1710|   125k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   125k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1711|   125k|}
ua_types_encoding_json.c:DateTime_decodeJson:
 1866|  1.32k|DECODE_JSON(DateTime) {
 1867|  1.32k|    UA_DateTime *dst = (UA_DateTime*)p;
 1868|  1.32k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|  1.32k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|  1.32k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 1.32k]
  |  |  ------------------
  |  | 1300|  1.32k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|  1.32k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 1.32k]
  |  |  ------------------
  ------------------
 1869|  1.32k|    CHECK_NULL_SKIP;
  ------------------
  |  | 1323|  1.32k|#define CHECK_NULL_SKIP do {                         \
  |  | 1324|  1.32k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1324:8): [True: 0, False: 1.32k]
  |  |  ------------------
  |  | 1325|      0|        ctx->index++;                                \
  |  | 1326|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1327|  1.32k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1327:14): [Folded, False: 1.32k]
  |  |  ------------------
  ------------------
 1870|  1.32k|    CHECK_STRING;
  ------------------
  |  | 1313|  1.32k|#define CHECK_STRING do {                                \
  |  | 1314|  1.32k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1314:8): [True: 4, False: 1.32k]
  |  |  ------------------
  |  | 1315|      4|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1316|  1.32k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1316:14): [Folded, False: 1.32k]
  |  |  ------------------
  ------------------
 1871|  1.32k|    GET_TOKEN;
  ------------------
  |  | 1294|  1.32k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|  1.32k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|  1.32k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 1.32k]
  |  |  ------------------
  ------------------
 1872|       |
 1873|       |    /* YYYY-MM-DDTHH:MM:SS[.fffffff]Z */
 1874|  1.32k|    if(tokenSize < 20 || tokenData[tokenSize-1] != 'Z' ||
  ------------------
  |  Branch (1874:8): [True: 9, False: 1.31k]
  |  Branch (1874:26): [True: 20, False: 1.29k]
  ------------------
 1875|  1.29k|       tokenData[4] != '-' || tokenData[7] != '-' ||
  ------------------
  |  Branch (1875:8): [True: 8, False: 1.28k]
  |  Branch (1875:31): [True: 7, False: 1.27k]
  ------------------
 1876|  1.27k|       tokenData[10] != 'T' || tokenData[13] != ':' ||
  ------------------
  |  Branch (1876:8): [True: 1, False: 1.27k]
  |  Branch (1876:32): [True: 9, False: 1.26k]
  ------------------
 1877|  1.26k|       tokenData[16] != ':')
  ------------------
  |  Branch (1877:8): [True: 8, False: 1.26k]
  ------------------
 1878|     62|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     62|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1879|       |
 1880|  1.26k|    const size_t positions[6] = {0, 5, 8, 11, 14, 17};
 1881|  1.26k|    UA_UInt16 values[6];
 1882|  8.80k|    for(size_t i = 0; i < 6; i++) {
  ------------------
  |  Branch (1882:23): [True: 7.55k, False: 1.25k]
  ------------------
 1883|  7.55k|        UA_UInt64 value = 0;
 1884|  7.55k|        size_t digits = (i == 0) ? 4 : 2;
  ------------------
  |  Branch (1884:25): [True: 1.26k, False: 6.29k]
  ------------------
 1885|  7.55k|        if(parseUInt64(&tokenData[positions[i]], digits, &value) != digits)
  ------------------
  |  Branch (1885:12): [True: 4, False: 7.54k]
  ------------------
 1886|      4|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1887|  7.54k|        values[i] = (UA_UInt16)value;
 1888|  7.54k|    }
 1889|       |
 1890|  1.25k|    UA_UInt16 daysInMonth = 31;
 1891|  1.25k|    switch(values[1]) {
 1892|    126|    case 2:
  ------------------
  |  Branch (1892:5): [True: 126, False: 1.13k]
  ------------------
 1893|    126|        daysInMonth = (UA_UInt16)
 1894|    126|            (((values[0] % 4 == 0 && values[0] % 100 != 0) ||
  ------------------
  |  Branch (1894:16): [True: 62, False: 64]
  |  Branch (1894:38): [True: 15, False: 47]
  ------------------
 1895|    111|              values[0] % 400 == 0) ? 29 : 28);
  ------------------
  |  Branch (1895:15): [True: 7, False: 104]
  ------------------
 1896|    126|        break;
 1897|     39|    case 4: case 6: case 9: case 11:
  ------------------
  |  Branch (1897:5): [True: 8, False: 1.24k]
  |  Branch (1897:13): [True: 13, False: 1.24k]
  |  Branch (1897:21): [True: 9, False: 1.24k]
  |  Branch (1897:29): [True: 9, False: 1.24k]
  ------------------
 1898|     39|        daysInMonth = 30;
 1899|     39|        break;
 1900|  1.09k|    default:
  ------------------
  |  Branch (1900:5): [True: 1.09k, False: 165]
  ------------------
 1901|  1.09k|        break;
 1902|  1.25k|    }
 1903|  1.25k|    if(values[0] < 1 || values[1] < 1 || values[1] > 12 ||
  ------------------
  |  Branch (1903:8): [True: 1, False: 1.25k]
  |  Branch (1903:25): [True: 1, False: 1.25k]
  |  Branch (1903:42): [True: 2, False: 1.25k]
  ------------------
 1904|  1.25k|       values[2] < 1 || values[2] > daysInMonth || values[3] > 23 ||
  ------------------
  |  Branch (1904:8): [True: 2, False: 1.25k]
  |  Branch (1904:25): [True: 1, False: 1.25k]
  |  Branch (1904:52): [True: 1, False: 1.24k]
  ------------------
 1905|  1.24k|       values[4] > 59 || values[5] > 59)
  ------------------
  |  Branch (1905:8): [True: 2, False: 1.24k]
  |  Branch (1905:26): [True: 2, False: 1.24k]
  ------------------
 1906|     12|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     12|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1907|       |
 1908|  1.24k|    size_t pos = 19;
 1909|  1.24k|    UA_UInt32 fraction = 0;
 1910|  1.24k|    size_t fractionDigits = 0;
 1911|  1.24k|    if(pos < tokenSize - 1 &&
  ------------------
  |  Branch (1911:8): [True: 163, False: 1.08k]
  ------------------
 1912|    163|       (tokenData[pos] == '.' || tokenData[pos] == ',')) {
  ------------------
  |  Branch (1912:9): [True: 57, False: 106]
  |  Branch (1912:34): [True: 97, False: 9]
  ------------------
 1913|    154|        pos++;
 1914|   109k|        while(pos < tokenSize - 1 && tokenData[pos] >= '0' &&
  ------------------
  |  Branch (1914:15): [True: 109k, False: 110]
  |  Branch (1914:38): [True: 109k, False: 26]
  ------------------
 1915|   109k|              tokenData[pos] <= '9') {
  ------------------
  |  Branch (1915:15): [True: 109k, False: 18]
  ------------------
 1916|   109k|            if(fractionDigits < 7)
  ------------------
  |  Branch (1916:16): [True: 628, False: 109k]
  ------------------
 1917|    628|                fraction = fraction * 10 + (UA_UInt32)(tokenData[pos] - '0');
 1918|   109k|            fractionDigits++;
 1919|   109k|            pos++;
 1920|   109k|        }
 1921|    154|        if(fractionDigits == 0)
  ------------------
  |  Branch (1921:12): [True: 6, False: 148]
  ------------------
 1922|      6|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1923|    556|        while(fractionDigits < 7) {
  ------------------
  |  Branch (1923:15): [True: 408, False: 148]
  ------------------
 1924|    408|            fraction *= 10;
 1925|    408|            fractionDigits++;
 1926|    408|        }
 1927|    148|    }
 1928|  1.23k|    if(pos != tokenSize - 1)
  ------------------
  |  Branch (1928:8): [True: 48, False: 1.19k]
  ------------------
 1929|     48|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     48|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1930|       |
 1931|       |    /* The minimum JSON DateTime is the null value. */
 1932|  1.19k|    if(values[0] == 1 && values[1] == 1 && values[2] == 1 &&
  ------------------
  |  Branch (1932:8): [True: 944, False: 247]
  |  Branch (1932:26): [True: 942, False: 2]
  |  Branch (1932:44): [True: 940, False: 2]
  ------------------
 1933|    940|       values[3] == 0 && values[4] == 0 && values[5] == 0 && fraction == 0) {
  ------------------
  |  Branch (1933:8): [True: 940, False: 0]
  |  Branch (1933:26): [True: 940, False: 0]
  |  Branch (1933:44): [True: 940, False: 0]
  |  Branch (1933:62): [True: 940, False: 0]
  ------------------
 1934|    940|        *dst = 0;
 1935|    940|    } else {
 1936|    251|        UA_DateTimeStruct date;
 1937|    251|        memset(&date, 0, sizeof(date));
 1938|    251|        date.year = (UA_Int16)values[0];
 1939|    251|        date.month = values[1];
 1940|    251|        date.day = values[2];
 1941|    251|        date.hour = values[3];
 1942|    251|        date.min = values[4];
 1943|    251|        date.sec = values[5];
 1944|    251|        date.milliSec = (UA_UInt16)(fraction / 10000);
 1945|    251|        date.microSec = (UA_UInt16)((fraction % 10000) / 10);
 1946|    251|        date.nanoSec = (UA_UInt16)((fraction % 10) * 100);
 1947|    251|        *dst = UA_DateTime_fromStruct(date);
 1948|    251|    }
 1949|       |
 1950|  1.19k|    ctx->index++;
 1951|  1.19k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.19k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1952|  1.23k|}
ua_types_encoding_json.c:Guid_decodeJson:
 1657|  1.42k|DECODE_JSON(Guid) {
 1658|  1.42k|    UA_Guid *dst = (UA_Guid*)p;
 1659|  1.42k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|  1.42k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|  1.42k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 1.42k]
  |  |  ------------------
  |  | 1300|  1.42k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|  1.42k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 1.42k]
  |  |  ------------------
  ------------------
 1660|  1.42k|    CHECK_STRING;
  ------------------
  |  | 1313|  1.42k|#define CHECK_STRING do {                                \
  |  | 1314|  1.42k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1314:8): [True: 4, False: 1.41k]
  |  |  ------------------
  |  | 1315|      4|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1316|  1.41k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1316:14): [Folded, False: 1.41k]
  |  |  ------------------
  ------------------
 1661|  1.41k|    GET_TOKEN;
  ------------------
  |  | 1294|  1.41k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|  1.41k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|  1.41k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 1.41k]
  |  |  ------------------
  ------------------
 1662|  1.41k|    UA_String str = {tokenSize, (UA_Byte*)(uintptr_t)tokenData};
 1663|  1.41k|    ctx->index++;
 1664|  1.41k|    return UA_Guid_parse(dst, str);
 1665|  1.42k|}
ua_types_encoding_json.c:ByteString_decodeJson:
 1762|  8.93k|DECODE_JSON(ByteString) {
 1763|  8.93k|    UA_ByteString *dst = (UA_ByteString*)p;
 1764|  8.93k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1298|  8.93k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1299|  8.93k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1299:8): [True: 0, False: 8.93k]
  |  |  ------------------
  |  | 1300|  8.93k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1301|  8.93k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1301:13): [Folded, False: 8.93k]
  |  |  ------------------
  ------------------
 1765|  8.93k|    CHECK_NULL_SKIP;
  ------------------
  |  | 1323|  8.93k|#define CHECK_NULL_SKIP do {                         \
  |  | 1324|  8.93k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1324:8): [True: 0, False: 8.93k]
  |  |  ------------------
  |  | 1325|      0|        ctx->index++;                                \
  |  | 1326|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1327|  8.93k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1327:14): [Folded, False: 8.93k]
  |  |  ------------------
  ------------------
 1766|  8.93k|    CHECK_STRING;
  ------------------
  |  | 1313|  8.93k|#define CHECK_STRING do {                                \
  |  | 1314|  8.93k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1314:8): [True: 10, False: 8.92k]
  |  |  ------------------
  |  | 1315|     10|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     10|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1316|  8.92k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1316:14): [Folded, False: 8.92k]
  |  |  ------------------
  ------------------
 1767|  8.92k|    GET_TOKEN;
  ------------------
  |  | 1294|  8.92k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|  8.92k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|  8.92k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 8.92k]
  |  |  ------------------
  ------------------
 1768|       |
 1769|       |    /* Empty bytestring? */
 1770|  8.92k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1770:8): [True: 1.43k, False: 7.48k]
  ------------------
 1771|  1.43k|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  757|  1.43k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1772|  1.43k|        dst->length = 0;
 1773|  7.48k|    } else {
 1774|  7.48k|        size_t flen = 0;
 1775|  7.48k|        unsigned char* unB64 =
 1776|  7.48k|            UA_unbase64((const unsigned char*)tokenData, tokenSize, &flen);
 1777|  7.48k|        if(unB64 == 0)
  ------------------
  |  Branch (1777:12): [True: 39, False: 7.44k]
  ------------------
 1778|     39|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     39|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1779|  7.44k|        dst->data = (u8*)unB64;
 1780|  7.44k|        dst->length = flen;
 1781|  7.44k|    }
 1782|       |
 1783|  8.88k|    ctx->index++;
 1784|  8.88k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  8.88k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1785|  8.92k|}
ua_types_encoding_json.c:NodeId_decodeJson:
 1843|  18.0k|DECODE_JSON(NodeId) {
 1844|  18.0k|    UA_NodeId *dst = (UA_NodeId*)p;
 1845|  18.0k|    UA_String str;
 1846|  18.0k|    UA_String_init(&str);
 1847|  18.0k|    status res = String_decodeJson(ctx, &str, NULL);
 1848|  18.0k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  18.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1848:8): [True: 18.0k, False: 70]
  ------------------
 1849|  18.0k|        res = UA_NodeId_parseEx(dst, str, ctx->namespaceMapping);
 1850|  18.0k|    UA_String_clear(&str);
 1851|  18.0k|    return res;
 1852|  18.0k|}
ua_types_encoding_json.c:ExpandedNodeId_decodeJson:
 1854|  31.9k|DECODE_JSON(ExpandedNodeId) {
 1855|  31.9k|    UA_ExpandedNodeId *dst = (UA_ExpandedNodeId*)p;
 1856|  31.9k|    UA_String str;
 1857|  31.9k|    UA_String_init(&str);
 1858|  31.9k|    status res = String_decodeJson(ctx, &str, NULL);
 1859|  31.9k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  31.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1859:8): [True: 31.8k, False: 16]
  ------------------
 1860|  31.8k|        res = UA_ExpandedNodeId_parseEx(dst, str, ctx->namespaceMapping,
 1861|  31.8k|                                        ctx->serverUrisSize, ctx->serverUris);
 1862|  31.9k|    UA_String_clear(&str);
 1863|  31.9k|    return res;
 1864|  31.9k|}
ua_types_encoding_json.c:StatusCode_decodeJson:
 1954|  26.2k|DECODE_JSON(StatusCode) {
 1955|  26.2k|    UA_StatusCode *dst = (UA_StatusCode*)p;
 1956|  26.2k|    CHECK_OBJECT;
  ------------------
  |  | 1318|  26.2k|#define CHECK_OBJECT do {                                \
  |  | 1319|  26.2k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1319:8): [True: 5, False: 26.2k]
  |  |  ------------------
  |  | 1320|      5|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1321|  26.2k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1321:14): [Folded, False: 26.2k]
  |  |  ------------------
  ------------------
 1957|  26.2k|    DecodeEntry entries[2] = {
 1958|  26.2k|        {UA_JSONKEY_CODE, dst, NULL, false, &UA_TYPES[UA_TYPES_UINT32]},
  ------------------
  |  |  232|  26.2k|#define UA_TYPES_UINT32 6
  ------------------
 1959|  26.2k|        {UA_JSONKEY_SYMBOL, NULL, NULL, false, NULL}
 1960|  26.2k|    };
 1961|  26.2k|    return decodeFields(ctx, entries, 2);
 1962|  26.2k|}
ua_types_encoding_json.c:QualifiedName_decodeJson:
 1797|  18.6k|DECODE_JSON(QualifiedName) {
 1798|  18.6k|    UA_QualifiedName *dst = (UA_QualifiedName*)p;
 1799|  18.6k|    CHECK_NULL_SKIP;
  ------------------
  |  | 1323|  18.6k|#define CHECK_NULL_SKIP do {                         \
  |  | 1324|  18.6k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1324:8): [True: 0, False: 18.6k]
  |  |  ------------------
  |  | 1325|      0|        ctx->index++;                                \
  |  | 1326|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1327|  18.6k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1327:14): [Folded, False: 18.6k]
  |  |  ------------------
  ------------------
 1800|  18.6k|    UA_String str;
 1801|  18.6k|    UA_String_init(&str);
 1802|  18.6k|    status res = String_decodeJson(ctx, &str, NULL);
 1803|  18.6k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  18.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1803:8): [True: 18.5k, False: 64]
  ------------------
 1804|  18.5k|        res = UA_QualifiedName_parseEx(dst, str, ctx->namespaceMapping);
 1805|  18.6k|    UA_String_clear(&str);
 1806|  18.6k|    return res;
 1807|  18.6k|}
ua_types_encoding_json.c:LocalizedText_decodeJson:
 1787|  12.3k|DECODE_JSON(LocalizedText) {
 1788|  12.3k|    UA_LocalizedText *dst = (UA_LocalizedText*)p;
 1789|  12.3k|    CHECK_OBJECT;
  ------------------
  |  | 1318|  12.3k|#define CHECK_OBJECT do {                                \
  |  | 1319|  12.3k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1319:8): [True: 3, False: 12.3k]
  |  |  ------------------
  |  | 1320|      3|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1321|  12.3k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1321:14): [Folded, False: 12.3k]
  |  |  ------------------
  ------------------
 1790|  12.3k|    DecodeEntry entries[2] = {
 1791|  12.3k|        {UA_JSONKEY_LOCALE, &dst->locale, NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  402|  12.3k|#define UA_TYPES_STRING 11
  ------------------
 1792|  12.3k|        {UA_JSONKEY_TEXT, &dst->text, NULL, false, &UA_TYPES[UA_TYPES_STRING]}
  ------------------
  |  |  402|  12.3k|#define UA_TYPES_STRING 11
  ------------------
 1793|  12.3k|    };
 1794|  12.3k|    return decodeFields(ctx, entries, 2);
 1795|  12.3k|}
ua_types_encoding_json.c:ExtensionObject_decodeJson:
 2318|   339k|DECODE_JSON(ExtensionObject) {
 2319|   339k|    UA_ExtensionObject *dst = (UA_ExtensionObject*)p;
 2320|   339k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1323|   339k|#define CHECK_NULL_SKIP do {                         \
  |  | 1324|   339k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1324:8): [True: 0, False: 339k]
  |  |  ------------------
  |  | 1325|      0|        ctx->index++;                                \
  |  | 1326|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1327|   339k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1327:14): [Folded, False: 339k]
  |  |  ------------------
  ------------------
 2321|   339k|    CHECK_OBJECT;
  ------------------
  |  | 1318|   339k|#define CHECK_OBJECT do {                                \
  |  | 1319|   339k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1319:8): [True: 14, False: 339k]
  |  |  ------------------
  |  | 1320|     14|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     14|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1321|   339k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1321:14): [Folded, False: 339k]
  |  |  ------------------
  ------------------
 2322|       |
 2323|       |    /* Empty object -> Null ExtensionObject */
 2324|   339k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (2324:8): [True: 336k, False: 2.97k]
  ------------------
 2325|   336k|        ctx->index++; /* Skip the empty ExtensionObject */
 2326|   336k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   336k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2327|   336k|    }
 2328|       |
 2329|       |    /* Scan the object once for metadata and duplicate keys. */
 2330|  2.97k|    size_t beginIndex = ctx->index;
 2331|  2.97k|    JsonFieldIndex fields[3] = {
 2332|  2.97k|        {UA_JSONKEY_TYPEID, SIZE_MAX},
 2333|  2.97k|        {UA_JSONKEY_ENCODING, SIZE_MAX},
 2334|  2.97k|        {UA_JSONKEY_BODY, SIZE_MAX}
 2335|  2.97k|    };
 2336|  2.97k|    status ret = scanObjectFields(ctx, fields, 3);
 2337|  2.97k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  2.97k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2337:8): [True: 25, False: 2.94k]
  ------------------
 2338|     25|        return ret;
 2339|       |
 2340|       |    /* Decode the optional non-JSON encoding. */
 2341|  2.94k|    UA_UInt64 encoding = 0;
 2342|  2.94k|    size_t encIndex = fields[1].valueIndex;
 2343|  2.94k|    if(encIndex != SIZE_MAX) {
  ------------------
  |  Branch (2343:8): [True: 641, False: 2.30k]
  ------------------
 2344|    641|        const char *extObjEncoding = &ctx->json5[ctx->tokens[encIndex].start];
 2345|    641|        size_t len = parseUInt64(extObjEncoding,
 2346|    641|                                 getTokenLength(&ctx->tokens[encIndex]),
 2347|    641|                                 &encoding);
 2348|    641|        if(len == 0 || encoding > 2)
  ------------------
  |  Branch (2348:12): [True: 3, False: 638]
  |  Branch (2348:24): [True: 91, False: 547]
  ------------------
 2349|     94|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     94|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2350|    641|    }
 2351|       |
 2352|       |    /* Decode the type NodeId. */
 2353|  2.85k|    size_t typeIdIndex = fields[0].valueIndex;
 2354|  2.85k|    if(typeIdIndex == SIZE_MAX)
  ------------------
  |  Branch (2354:8): [True: 75, False: 2.77k]
  ------------------
 2355|     75|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     75|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2356|       |
 2357|  2.77k|    UA_NodeId typeId;
 2358|  2.77k|    UA_NodeId_init(&typeId);
 2359|  2.77k|    ParseCtx decodeCtx = *ctx;
 2360|  2.77k|    decodeCtx.index = typeIdIndex;
 2361|  2.77k|    ret = NodeId_decodeJson(&decodeCtx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  572|  2.77k|#define UA_TYPES_NODEID 16
  ------------------
 2362|  2.77k|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  2.77k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2362:8): [True: 79, False: 2.69k]
  ------------------
 2363|     79|        UA_NodeId_clear(&typeId); /* We don't have the global cleanup */
 2364|     79|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     79|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2365|     79|    }
 2366|       |
 2367|  2.69k|    size_t bodyIndex = fields[2].valueIndex;
 2368|       |
 2369|       |    /* Binary and XML bodies stay encoded even if the datatype is known. */
 2370|  2.69k|    if(encoding != 0) {
  ------------------
  |  Branch (2370:8): [True: 6, False: 2.69k]
  ------------------
 2371|      6|        dst->encoding = (encoding == 1) ?
  ------------------
  |  Branch (2371:25): [True: 3, False: 3]
  ------------------
 2372|      3|            UA_EXTENSIONOBJECT_ENCODED_BYTESTRING :
 2373|      6|            UA_EXTENSIONOBJECT_ENCODED_XML;
 2374|      6|        dst->content.encoded.typeId = typeId;
 2375|      6|        if(bodyIndex == SIZE_MAX)
  ------------------
  |  Branch (2375:12): [True: 4, False: 2]
  ------------------
 2376|      4|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2377|      2|        decodeCtx.index = bodyIndex;
 2378|      2|        return ByteString_decodeJson(&decodeCtx,
 2379|      2|                                     &dst->content.encoded.body, NULL);
 2380|      6|    }
 2381|       |
 2382|       |    /* Lookup the JSON datatype. */
 2383|  2.69k|    type = UA_findDataTypeWithCustom(&typeId, ctx->customTypes);
 2384|  2.69k|    if(!type) {
  ------------------
  |  Branch (2384:8): [True: 2.31k, False: 381]
  ------------------
 2385|  2.31k|        dst->encoding = UA_EXTENSIONOBJECT_ENCODED_JSON;
 2386|  2.31k|        dst->content.encoded.typeId = typeId;
 2387|  2.31k|        decodeCtx.index = beginIndex;
 2388|  2.31k|        return tokenToByteString(&decodeCtx, &dst->content.encoded.body);
 2389|  2.31k|    }
 2390|       |
 2391|       |    /* No need to keep the TypeId */
 2392|    381|    UA_NodeId_clear(&typeId);
 2393|       |
 2394|       |    /* Disallow directly nested ExtensionObjects */
 2395|    381|    if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  742|    381|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (2395:8): [True: 2, False: 379]
  ------------------
 2396|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2397|       |
 2398|       |    /* Allocate memory for the decoded data */
 2399|    379|    dst->content.decoded.data = UA_new(type);
 2400|    379|    if(!dst->content.decoded.data)
  ------------------
  |  Branch (2400:8): [True: 0, False: 379]
  ------------------
 2401|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2402|    379|    dst->content.decoded.type = type;
 2403|    379|    dst->encoding = UA_EXTENSIONOBJECT_DECODED;
 2404|       |
 2405|    379|    decodeJsonSignature decodeType = decodeJsonJumpTable[type->typeKind];
 2406|    379|    if(bodyIndex != SIZE_MAX) {
  ------------------
  |  Branch (2406:8): [True: 225, False: 154]
  ------------------
 2407|    225|        decodeCtx.index = bodyIndex;
 2408|    225|        return decodeType(&decodeCtx, dst->content.decoded.data, type);
 2409|    225|    }
 2410|       |
 2411|       |    /* Only JSON structures without an explicit encoding can be in-situ. */
 2412|    154|    if(encoding != 0)
  ------------------
  |  Branch (2412:8): [True: 0, False: 154]
  ------------------
 2413|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2414|       |
 2415|    154|    decodeCtx.index = beginIndex;
 2416|    154|    if(type->typeKind == UA_DATATYPEKIND_STRUCTURE ||
  ------------------
  |  Branch (2416:8): [True: 52, False: 102]
  ------------------
 2417|    102|       type->typeKind == UA_DATATYPEKIND_OPTSTRUCT)
  ------------------
  |  Branch (2417:8): [True: 0, False: 102]
  ------------------
 2418|     52|        return decodeJsonStructureExtensionObject(
 2419|     52|            &decodeCtx, dst->content.decoded.data, type);
 2420|    102|    if(type->typeKind == UA_DATATYPEKIND_UNION)
  ------------------
  |  Branch (2420:8): [True: 0, False: 102]
  ------------------
 2421|      0|        return decodeJsonUnionExtensionObject(
 2422|      0|            &decodeCtx, dst->content.decoded.data, type);
 2423|    102|    return decodeType(&decodeCtx, dst->content.decoded.data, type);
 2424|    102|}
ua_types_encoding_json.c:scanObjectFields:
 1387|  2.97k|scanObjectFields(ParseCtx *ctx, JsonFieldIndex *fields, size_t fieldsSize) {
 1388|  2.97k|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  248|  2.97k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1388:5): [True: 2.97k, False: 0]
  ------------------
 1389|  2.97k|    size_t keyCount = (size_t)ctx->tokens[ctx->index].size / 2;
 1390|  2.97k|    if(keyCount > UA_JSON_MAX_EXTENSIONOBJECT_FIELDS)
  ------------------
  |  | 1382|  2.97k|#define UA_JSON_MAX_EXTENSIONOBJECT_FIELDS (UA_DATATYPE_MEMBERS_MAX + 3)
  |  |  ------------------
  |  |  |  | 1037|  2.97k|#define UA_DATATYPE_MEMBERS_MAX 511
  |  |  ------------------
  ------------------
  |  Branch (1390:8): [True: 8, False: 2.96k]
  ------------------
 1391|      8|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      8|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1392|       |
 1393|  2.96k|    size_t keys[UA_JSON_MAX_EXTENSIONOBJECT_FIELDS];
 1394|  2.96k|    ctx->index++;
 1395|       |
 1396|  9.75k|    for(size_t i = 0; i < keyCount; i++) {
  ------------------
  |  Branch (1396:23): [True: 6.80k, False: 2.94k]
  ------------------
 1397|  6.80k|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  248|  6.80k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1397:9): [True: 6.80k, False: 0]
  ------------------
 1398|  6.80k|        const cj5_token *key = &ctx->tokens[ctx->index];
 1399|  6.80k|        size_t keyLength = getTokenLength(key);
 1400|       |
 1401|       |        /* Duplicate names are invalid, including unknown in-situ Structure
 1402|       |         * fields of an ExtensionObject. */
 1403|  14.5k|        for(size_t j = 0; j < i; j++) {
  ------------------
  |  Branch (1403:27): [True: 7.72k, False: 6.79k]
  ------------------
 1404|  7.72k|            const cj5_token *previous = &ctx->tokens[keys[j]];
 1405|  7.72k|            if(keyLength == getTokenLength(previous) &&
  ------------------
  |  Branch (1405:16): [True: 624, False: 7.10k]
  ------------------
 1406|    624|               memcmp(&ctx->json5[key->start], &ctx->json5[previous->start],
  ------------------
  |  Branch (1406:16): [True: 17, False: 607]
  ------------------
 1407|    624|                      keyLength) == 0)
 1408|     17|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     17|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1409|  7.72k|        }
 1410|  6.79k|        keys[i] = ctx->index;
 1411|       |
 1412|       |        /* Record the value position of interesting fields. */
 1413|  6.79k|        ctx->index++;
 1414|  6.79k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  248|  6.79k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1414:9): [True: 6.79k, False: 0]
  ------------------
 1415|  17.2k|        for(size_t j = 0; j < fieldsSize; j++) {
  ------------------
  |  Branch (1415:27): [True: 14.1k, False: 3.08k]
  ------------------
 1416|  14.1k|            if(jsoneq(ctx->json5, key, fields[j].fieldName) == 0) {
  ------------------
  |  Branch (1416:16): [True: 3.70k, False: 10.4k]
  ------------------
 1417|  3.70k|                fields[j].valueIndex = ctx->index;
 1418|  3.70k|                break;
 1419|  3.70k|            }
 1420|  14.1k|        }
 1421|       |
 1422|  6.79k|        skipObject(ctx);
 1423|  6.79k|    }
 1424|  2.94k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  2.94k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1425|  2.96k|}
ua_types_encoding_json.c:tokenToByteString:
 2308|  2.31k|tokenToByteString(ParseCtx *ctx, UA_ByteString *p) {
 2309|  2.31k|    GET_TOKEN;
  ------------------
  |  | 1294|  2.31k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1295|  2.31k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1296|  2.31k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1296:17): [Folded, False: 2.31k]
  |  |  ------------------
  ------------------
 2310|  2.31k|    UA_StatusCode res = UA_ByteString_allocBuffer(p, tokenSize);
 2311|  2.31k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  2.31k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2311:8): [True: 0, False: 2.31k]
  ------------------
 2312|      0|        return res;
 2313|  2.31k|    memcpy(p->data, tokenData, tokenSize);
 2314|  2.31k|    skipObject(ctx);
 2315|  2.31k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  2.31k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2316|  2.31k|}
ua_types_encoding_json.c:decodeJsonStructureExtensionObject:
 2818|    252|                                   const UA_DataType *type) {
 2819|       |    return decodeJsonStructureInternal(ctx, dst, type, true);
 2820|    252|}
ua_types_encoding_json.c:decodeJsonStructureInternal:
 2724|  8.70k|                            UA_Boolean extensionObject) {
 2725|  8.70k|    uintptr_t ptr = (uintptr_t)dst;
 2726|  8.70k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  8.70k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2727|  8.70k|    const UA_Boolean optional = (type->typeKind == UA_DATATYPEKIND_OPTSTRUCT);
 2728|  8.70k|    size_t offset = (extensionObject ? 1 : 0) + (optional ? 1 : 0);
  ------------------
  |  Branch (2728:22): [True: 252, False: 8.45k]
  |  Branch (2728:50): [True: 0, False: 8.70k]
  ------------------
 2729|  8.70k|    size_t membersSize = type->membersSize + offset;
 2730|  8.70k|    UA_STACKARRAY(DecodeEntry, entries, membersSize);
  ------------------
  |  |  225|  8.70k|#  define UA_STACKARRAY(TYPE, NAME, SIZE) TYPE NAME[SIZE]
  ------------------
 2731|  8.70k|    memset(entries, 0, sizeof(DecodeEntry) * membersSize);
 2732|  8.70k|    size_t entryIndex = 0;
 2733|  8.70k|    if(extensionObject) {
  ------------------
  |  Branch (2733:8): [True: 252, False: 8.45k]
  ------------------
 2734|    252|        entries[entryIndex++] =
 2735|    252|            (DecodeEntry){UA_JSONKEY_TYPEID, NULL, NULL, false, NULL};
 2736|    252|    }
 2737|  8.70k|    UA_UInt32 encodingMask = 0;
 2738|  8.70k|    size_t encodingMaskIndex = SIZE_MAX;
 2739|  8.70k|    if(optional) {
  ------------------
  |  Branch (2739:8): [True: 0, False: 8.70k]
  ------------------
 2740|      0|        encodingMaskIndex = entryIndex;
 2741|      0|        entries[entryIndex++] =
 2742|      0|            (DecodeEntry){UA_JSONKEY_ENCODINGMASK, &encodingMask, NULL, false,
 2743|      0|                          &UA_TYPES[UA_TYPES_UINT32]};
  ------------------
  |  |  232|      0|#define UA_TYPES_UINT32 6
  ------------------
 2744|      0|    }
 2745|  64.8k|    for(size_t i = 0; i < type->membersSize; ++i, ++entryIndex) {
  ------------------
  |  Branch (2745:23): [True: 56.1k, False: 8.70k]
  ------------------
 2746|  56.1k|        const UA_DataTypeMember *m = &type->members[i];
 2747|  56.1k|        const UA_DataType *mt = m->memberType;
 2748|  56.1k|        entries[entryIndex].type = mt;
 2749|  56.1k|        entries[entryIndex].fieldName = m->memberName;
 2750|  56.1k|        if(!m->isArray) {
  ------------------
  |  Branch (2750:12): [True: 48.7k, False: 7.31k]
  ------------------
 2751|  48.7k|            ptr += m->padding;
 2752|  48.7k|            entries[entryIndex].fieldPointer = (void*)ptr;
 2753|  48.7k|            if(m->isOptional)
  ------------------
  |  Branch (2753:16): [True: 0, False: 48.7k]
  ------------------
 2754|      0|                entries[entryIndex].function = OptionalScalar_decodeJson;
 2755|  48.7k|            ptr += m->isOptional ? sizeof(void*) : mt->memSize;
  ------------------
  |  Branch (2755:20): [True: 0, False: 48.7k]
  ------------------
 2756|  48.7k|        } else {
 2757|  7.31k|            ptr += m->padding;
 2758|  7.31k|            ptr += sizeof(size_t);
 2759|  7.31k|            entries[entryIndex].fieldPointer = (void*)ptr;
 2760|  7.31k|            entries[entryIndex].function = m->isOptional ?
  ------------------
  |  Branch (2760:44): [True: 0, False: 7.31k]
  ------------------
 2761|  7.31k|                OptionalArray_decodeJson : Array_decodeJson;
 2762|  7.31k|            ptr += sizeof(void*);
 2763|  7.31k|        }
 2764|  56.1k|    }
 2765|       |
 2766|  8.70k|    ret = decodeFields(ctx, entries, membersSize);
 2767|       |
 2768|       |    /* Compact JSON uses EncodingMask. Materialize optional fields whose bit is
 2769|       |     * set even when their default value was omitted from the object. */
 2770|  8.70k|    if(ret == UA_STATUSCODE_GOOD && optional &&
  ------------------
  |  |   17|  17.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2770:8): [True: 8.68k, False: 24]
  |  Branch (2770:37): [True: 0, False: 8.68k]
  ------------------
 2771|      0|       entries[encodingMaskIndex].found) {
  ------------------
  |  Branch (2771:8): [True: 0, False: 0]
  ------------------
 2772|      0|        size_t optionalIndex = 0;
 2773|      0|        entryIndex = offset;
 2774|      0|        for(size_t i = 0; i < type->membersSize; i++, entryIndex++) {
  ------------------
  |  Branch (2774:27): [True: 0, False: 0]
  ------------------
 2775|      0|            const UA_DataTypeMember *m = &type->members[i];
 2776|      0|            if(!m->isOptional)
  ------------------
  |  Branch (2776:16): [True: 0, False: 0]
  ------------------
 2777|      0|                continue;
 2778|      0|            if(optionalIndex >= 32) {
  ------------------
  |  Branch (2778:16): [True: 0, False: 0]
  ------------------
 2779|      0|                ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2780|      0|                break;
 2781|      0|            }
 2782|      0|            UA_Boolean inMask =
 2783|      0|                (encodingMask & ((UA_UInt32)1 << optionalIndex)) != 0;
 2784|      0|            if(entries[entryIndex].found != inMask) {
  ------------------
  |  Branch (2784:16): [True: 0, False: 0]
  ------------------
 2785|      0|                if(entries[entryIndex].found) {
  ------------------
  |  Branch (2785:20): [True: 0, False: 0]
  ------------------
 2786|      0|                    ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2787|      0|                    break;
 2788|      0|                }
 2789|      0|                if(m->isArray) {
  ------------------
  |  Branch (2789:20): [True: 0, False: 0]
  ------------------
 2790|      0|                    *(void**)entries[entryIndex].fieldPointer =
 2791|      0|                        UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  757|      0|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2792|      0|                } else {
 2793|      0|                    void *value = UA_calloc(1, m->memberType->memSize);
  ------------------
  |  |   24|      0|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2794|      0|                    if(!value) {
  ------------------
  |  Branch (2794:24): [True: 0, False: 0]
  ------------------
 2795|      0|                        ret = UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2796|      0|                        break;
 2797|      0|                    }
 2798|      0|                    *(void**)entries[entryIndex].fieldPointer = value;
 2799|      0|                }
 2800|      0|            }
 2801|      0|            optionalIndex++;
 2802|      0|        }
 2803|      0|        if(optionalIndex < 32 &&
  ------------------
  |  Branch (2803:12): [True: 0, False: 0]
  ------------------
 2804|      0|           (encodingMask >> optionalIndex) != 0)
  ------------------
  |  Branch (2804:12): [True: 0, False: 0]
  ------------------
 2805|      0|            ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2806|      0|    }
 2807|       |
 2808|  8.70k|    return ret;
 2809|  8.70k|}
ua_types_encoding_json.c:Array_decodeJson:
 2631|  16.0k|Array_decodeJson(ParseCtx *ctx, void *dst_, const UA_DataType *type) {
 2632|  16.0k|    void **dst = (void**)dst_;
 2633|       |
 2634|       |    /* Save the length of the array */
 2635|  16.0k|    size_t *size_ptr = (size_t*) dst - 1;
 2636|       |
 2637|       |    /* A null JSON array represents a null OPC UA array. */
 2638|  16.0k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2638:8): [True: 3.54k, False: 12.4k]
  ------------------
 2639|  3.54k|        *size_ptr = 0;
 2640|  3.54k|        *dst = NULL;
 2641|  3.54k|        ctx->index++;
 2642|  3.54k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  3.54k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2643|  3.54k|    }
 2644|       |
 2645|  12.4k|    if(currentTokenType(ctx) != CJ5_TOKEN_ARRAY)
  ------------------
  |  Branch (2645:8): [True: 8, False: 12.4k]
  ------------------
 2646|      8|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      8|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2647|       |
 2648|  12.4k|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 2649|       |
 2650|  12.4k|    ctx->index++; /* Go to first array member or to the first element after
 2651|       |                   * the array (if empty) */
 2652|       |
 2653|       |    /* Return early for empty arrays */
 2654|  12.4k|    if(length == 0) {
  ------------------
  |  Branch (2654:8): [True: 1.34k, False: 11.1k]
  ------------------
 2655|  1.34k|        *size_ptr = length;
 2656|  1.34k|        *dst = UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  757|  1.34k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2657|  1.34k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.34k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2658|  1.34k|    }
 2659|       |
 2660|       |    /* Allocate memory */
 2661|  11.1k|    if(length > SIZE_MAX / type->memSize)
  ------------------
  |  Branch (2661:8): [True: 0, False: 11.1k]
  ------------------
 2662|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2663|  11.1k|    *dst = UA_calloc(length, type->memSize);
  ------------------
  |  |   24|  11.1k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2664|  11.1k|    if(*dst == NULL)
  ------------------
  |  Branch (2664:8): [True: 0, False: 11.1k]
  ------------------
 2665|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2666|       |
 2667|       |    /* Decode array members */
 2668|  11.1k|    decodeJsonSignature decodeFunc = decodeJsonJumpTable[type->typeKind];
 2669|  11.1k|    uintptr_t ptr = (uintptr_t)*dst;
 2670|  15.8M|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (2670:23): [True: 15.8M, False: 10.2k]
  ------------------
 2671|  15.8M|        if(ctx->tokens[ctx->index].type == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2671:12): [True: 30.1k, False: 15.8M]
  ------------------
 2672|  30.1k|            if(!isJsonNullable(type)) {
  ------------------
  |  Branch (2672:16): [True: 6, False: 30.1k]
  ------------------
 2673|      6|                UA_Array_delete(*dst, i, type);
 2674|      6|                *dst = NULL;
 2675|      6|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2676|      6|            }
 2677|  30.1k|            ptr += type->memSize;
 2678|  30.1k|            ctx->index++;
 2679|  30.1k|            continue;
 2680|  30.1k|        }
 2681|       |
 2682|  15.8M|        status ret = decodeFunc(ctx, (void*)ptr, type);
 2683|  15.8M|        ptr += type->memSize;
 2684|  15.8M|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  15.8M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2684:12): [True: 817, False: 15.8M]
  ------------------
 2685|    817|            UA_Array_delete(*dst, i+1, type);
 2686|    817|            *dst = NULL;
 2687|    817|            return ret;
 2688|    817|        }
 2689|  15.8M|    }
 2690|       |
 2691|  10.2k|    *size_ptr = length; /* All good, set the size */
 2692|  10.2k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  10.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2693|  11.1k|}
ua_types_encoding_json.c:DataValue_decodeJson:
 2268|   838k|DECODE_JSON(DataValue) {
 2269|   838k|    UA_DataValue *dst = (UA_DataValue*)p;
 2270|   838k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1323|   838k|#define CHECK_NULL_SKIP do {                         \
  |  | 1324|   838k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1324:8): [True: 0, False: 838k]
  |  |  ------------------
  |  | 1325|      0|        ctx->index++;                                \
  |  | 1326|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1327|   838k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1327:14): [Folded, False: 838k]
  |  |  ------------------
  ------------------
 2271|   838k|    CHECK_OBJECT;
  ------------------
  |  | 1318|   838k|#define CHECK_OBJECT do {                                \
  |  | 1319|   838k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1319:8): [True: 8, False: 838k]
  |  |  ------------------
  |  | 1320|      8|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      8|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1321|   838k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1321:14): [Folded, False: 838k]
  |  |  ------------------
  ------------------
 2272|       |
 2273|       |    /* Decode the Variant in-situ */
 2274|   838k|    size_t beginIndex = ctx->index;
 2275|   838k|    status ret = decodeJSONVariant(ctx, &dst->value, true);
 2276|   838k|    ctx->index = beginIndex;
 2277|   838k|    dst->hasValue = (dst->value.type != NULL);
 2278|   838k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|   838k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2278:8): [True: 90, False: 838k]
  ------------------
 2279|     90|        return ret;
 2280|       |
 2281|       |    /* Decode the other members (skip the Variant members) */
 2282|   838k|    DecodeEntry entries[8] = {
 2283|   838k|        {UA_JSONKEY_TYPE, NULL, NULL, false, NULL},
 2284|   838k|        {UA_JSONKEY_VALUE, NULL, NULL, false, NULL},
 2285|   838k|        {UA_JSONKEY_DIMENSIONS, NULL, NULL, false, NULL},
 2286|   838k|        {UA_JSONKEY_STATUS, &dst->status, NULL, false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  640|   838k|#define UA_TYPES_STATUSCODE 18
  ------------------
 2287|   838k|        {UA_JSONKEY_SOURCETIMESTAMP, &dst->sourceTimestamp, NULL,
 2288|   838k|         false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  436|   838k|#define UA_TYPES_DATETIME 12
  ------------------
 2289|   838k|        {UA_JSONKEY_SOURCEPICOSECONDS, &dst->sourcePicoseconds, NULL,
 2290|   838k|         false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  164|   838k|#define UA_TYPES_UINT16 4
  ------------------
 2291|   838k|        {UA_JSONKEY_SERVERTIMESTAMP, &dst->serverTimestamp, NULL,
 2292|   838k|         false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  436|   838k|#define UA_TYPES_DATETIME 12
  ------------------
 2293|   838k|        {UA_JSONKEY_SERVERPICOSECONDS, &dst->serverPicoseconds, NULL,
 2294|   838k|         false, &UA_TYPES[UA_TYPES_UINT16]}
  ------------------
  |  |  164|   838k|#define UA_TYPES_UINT16 4
  ------------------
 2295|   838k|    };
 2296|       |
 2297|   838k|    ret = decodeFields(ctx, entries, 8);
 2298|   838k|    dst->hasStatus = entries[3].found;
 2299|   838k|    dst->hasSourceTimestamp = entries[4].found;
 2300|   838k|    dst->hasSourcePicoseconds = entries[5].found;
 2301|   838k|    dst->hasServerTimestamp = entries[6].found;
 2302|   838k|    dst->hasServerPicoseconds = entries[7].found;
 2303|   838k|    return ret;
 2304|   838k|}
ua_types_encoding_json.c:decodeJSONVariant:
 2125|   987k|                  UA_Boolean insideDataValue) {
 2126|       |    /* Empty variant == null */
 2127|   987k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (2127:8): [True: 941k, False: 45.3k]
  ------------------
 2128|   941k|        ctx->index++;
 2129|   941k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   941k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2130|   941k|    }
 2131|       |
 2132|       |    /* Search the value field */
 2133|  45.3k|    size_t valueIndex = 0;
 2134|  45.3k|    lookAheadForKey(ctx, UA_JSONKEY_VALUE, &valueIndex);
 2135|       |
 2136|       |    /* Search for the dimensions field */
 2137|  45.3k|    size_t dimIndex = 0;
 2138|  45.3k|    lookAheadForKey(ctx, UA_JSONKEY_DIMENSIONS, &dimIndex);
 2139|       |
 2140|       |    /* Parse the type kind */
 2141|  45.3k|    size_t typeIndex = 0;
 2142|  45.3k|    lookAheadForKey(ctx, UA_JSONKEY_TYPE, &typeIndex);
 2143|  45.3k|    if(typeIndex == 0 || ctx->tokens[typeIndex].type != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (2143:8): [True: 163, False: 45.1k]
  |  Branch (2143:26): [True: 4, False: 45.1k]
  ------------------
 2144|    167|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    167|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2145|  45.1k|    UA_UInt64 typeKind = 0;
 2146|  45.1k|    size_t len = parseUInt64(&ctx->json5[ctx->tokens[typeIndex].start],
 2147|  45.1k|                             getTokenLength(&ctx->tokens[typeIndex]), &typeKind);
 2148|  45.1k|    if(len == 0)
  ------------------
  |  Branch (2148:8): [True: 18, False: 45.1k]
  ------------------
 2149|     18|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     18|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2150|       |
 2151|       |    /* Shift to get the datatype index. The type must be a builtin data type.
 2152|       |     * All not-builtin types are wrapped in an ExtensionObject. */
 2153|  45.1k|    typeKind--;
 2154|  45.1k|    if(typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (2154:8): [True: 285, False: 44.8k]
  ------------------
 2155|    285|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    285|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2156|  44.8k|    const UA_DataType *type = &UA_TYPES[typeKind];
 2157|       |
 2158|       |    /* These combinations are excluded by the Variant definition. */
 2159|  44.8k|    if(type->typeKind == UA_DATATYPEKIND_DIAGNOSTICINFO ||
  ------------------
  |  Branch (2159:8): [True: 2, False: 44.8k]
  ------------------
 2160|  44.8k|       (insideDataValue && type->typeKind == UA_DATATYPEKIND_DATAVALUE))
  ------------------
  |  Branch (2160:9): [True: 17.2k, False: 27.5k]
  |  Branch (2160:28): [True: 3, False: 17.2k]
  ------------------
 2161|      5|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2162|       |
 2163|       |    /* Value is an array? */
 2164|  44.8k|    UA_Boolean isArray =
 2165|  44.8k|        (valueIndex > 0 && ctx->tokens[valueIndex].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  Branch (2165:10): [True: 40.3k, False: 4.51k]
  |  Branch (2165:28): [True: 12.6k, False: 27.7k]
  ------------------
 2166|  44.8k|    if(type->typeKind == UA_DATATYPEKIND_VARIANT && !isArray)
  ------------------
  |  Branch (2166:8): [True: 637, False: 44.1k]
  |  Branch (2166:53): [True: 1, False: 636]
  ------------------
 2167|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2168|       |
 2169|       |    /* Adjust the depth and set the value index as current */
 2170|  44.8k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION)
  ------------------
  |  |  128|  44.8k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (2170:8): [True: 0, False: 44.8k]
  ------------------
 2171|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2172|  44.8k|    size_t beginIndex = ctx->index;
 2173|  44.8k|    ctx->index = valueIndex;
 2174|  44.8k|    ctx->depth++;
 2175|       |
 2176|       |    /* Decode the value */
 2177|  44.8k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  44.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2178|  44.8k|    if(!isArray) {
  ------------------
  |  Branch (2178:8): [True: 32.2k, False: 12.6k]
  ------------------
 2179|       |        /* Scalar with dimensions -> error */
 2180|  32.2k|        if(dimIndex > 0) {
  ------------------
  |  Branch (2180:12): [True: 7, False: 32.2k]
  ------------------
 2181|      7|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2182|      7|            goto out;
 2183|      7|        }
 2184|       |
 2185|       |        /* Missing values are only valid for nullable types. */
 2186|  32.2k|        if(valueIndex == 0 && !isJsonNullable(type)) {
  ------------------
  |  Branch (2186:12): [True: 4.50k, False: 27.7k]
  |  Branch (2186:31): [True: 31, False: 4.47k]
  ------------------
 2187|     31|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     31|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2188|     31|            goto out;
 2189|     31|        }
 2190|       |
 2191|       |        /* JSON null is only valid for nullable types. */
 2192|  32.1k|        if(valueIndex > 0 && ctx->tokens[valueIndex].type == CJ5_TOKEN_NULL &&
  ------------------
  |  Branch (2192:12): [True: 27.7k, False: 4.47k]
  |  Branch (2192:30): [True: 554, False: 27.1k]
  ------------------
 2193|    554|           !isJsonNullable(type)) {
  ------------------
  |  Branch (2193:12): [True: 2, False: 552]
  ------------------
 2194|      2|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2195|      2|            goto out;
 2196|      2|        }
 2197|       |
 2198|       |        /* Decode a value wrapped in an ExtensionObject */
 2199|  32.1k|        if(valueIndex > 0 && type->typeKind == UA_DATATYPEKIND_EXTENSIONOBJECT) {
  ------------------
  |  Branch (2199:12): [True: 27.7k, False: 4.47k]
  |  Branch (2199:30): [True: 684, False: 27.0k]
  ------------------
 2200|    684|            res = Variant_decodeJsonUnwrapExtensionObject(ctx, dst, NULL);
 2201|    684|            goto out;
 2202|    684|        }
 2203|       |
 2204|       |        /* Allocate memory for the value */
 2205|  31.5k|        dst->data = UA_new(type);
 2206|  31.5k|        if(!dst->data) {
  ------------------
  |  Branch (2206:12): [True: 0, False: 31.5k]
  ------------------
 2207|      0|            res = UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2208|      0|            goto out;
 2209|      0|        }
 2210|  31.5k|        dst->type = type;
 2211|       |
 2212|       |        /* Decode the value */
 2213|  31.5k|        if(valueIndex > 0 && ctx->tokens[valueIndex].type != CJ5_TOKEN_NULL)
  ------------------
  |  Branch (2213:12): [True: 27.0k, False: 4.47k]
  |  Branch (2213:30): [True: 26.9k, False: 98]
  ------------------
 2214|  26.9k|            res = decodeJsonJumpTable[type->typeKind](ctx, dst->data, type);
 2215|  31.5k|    } else {
 2216|       |        /* Decode an array. Try to unwrap ExtensionObjects in the array. The
 2217|       |         * members must all have the same type. */
 2218|  12.6k|        const UA_DataType *unwrapType = NULL;
 2219|  12.6k|        if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  742|  12.6k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (2219:12): [True: 6.47k, False: 6.12k]
  ------------------
 2220|  6.47k|            unwrapType = getArrayUnwrapType(ctx);
 2221|  12.6k|        if(unwrapType) {
  ------------------
  |  Branch (2221:12): [True: 485, False: 12.1k]
  ------------------
 2222|    485|            dst->type = unwrapType;
 2223|    485|            res = Array_decodeJsonUnwrapExtensionObject(ctx, &dst->data, unwrapType);
 2224|  12.1k|        } else {
 2225|  12.1k|            dst->type = type;
 2226|  12.1k|            res = Array_decodeJson(ctx, &dst->data, type);
 2227|  12.1k|        }
 2228|       |
 2229|       |        /* Decode array dimensions */
 2230|  12.6k|        if(dimIndex > 0) {
  ------------------
  |  Branch (2230:12): [True: 176, False: 12.4k]
  ------------------
 2231|    176|            ctx->index = dimIndex;
 2232|    176|            res |= Array_decodeJson(ctx, (void**)&dst->arrayDimensions,
 2233|    176|                                    &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  232|    176|#define UA_TYPES_UINT32 6
  ------------------
 2234|       |
 2235|       |            /* Help clang-analyzer */
 2236|    176|            UA_assert(dst->arrayDimensionsSize == 0 || dst->arrayDimensions);
  ------------------
  |  |  248|    176|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2236:13): [True: 44, False: 132]
  |  Branch (2236:13): [True: 132, False: 0]
  ------------------
 2237|       |
 2238|       |            /* Validate the dimensions */
 2239|    176|            if(res == UA_STATUSCODE_GOOD &&
  ------------------
  |  |   17|    352|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2239:16): [True: 104, False: 72]
  ------------------
 2240|    104|               !variantDimensionsValid(dst->arrayLength,
  ------------------
  |  Branch (2240:16): [True: 103, False: 1]
  ------------------
 2241|    104|                                       dst->arrayDimensionsSize,
 2242|    104|                                       dst->arrayDimensions))
 2243|    103|                res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    103|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2244|       |
 2245|       |            /* Only keep >= 2 dimensions */
 2246|    176|            if(dst->arrayDimensionsSize == 1) {
  ------------------
  |  Branch (2246:16): [True: 68, False: 108]
  ------------------
 2247|     68|                UA_free(dst->arrayDimensions);
  ------------------
  |  |   23|     68|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2248|     68|                dst->arrayDimensions = NULL;
 2249|     68|                dst->arrayDimensionsSize = 0;
 2250|     68|            }
 2251|    176|        }
 2252|  12.6k|    }
 2253|       |
 2254|  44.8k| out:
 2255|  44.8k|    ctx->index = beginIndex;
 2256|  44.8k|    skipObject(ctx);
 2257|  44.8k|    ctx->depth--;
 2258|  44.8k|    return res;
 2259|  44.8k|}
ua_types_encoding_json.c:Variant_decodeJsonUnwrapExtensionObject:
 2428|    684|                                        const UA_DataType *type) {
 2429|    684|    (void) type;
 2430|    684|    UA_Variant *dst = (UA_Variant*)p;
 2431|       |
 2432|       |    /* ExtensionObject with null body */
 2433|    684|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2433:8): [True: 454, False: 230]
  ------------------
 2434|    454|        dst->data = UA_ExtensionObject_new();
 2435|    454|        dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  742|    454|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2436|    454|        ctx->index++;
 2437|    454|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    454|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2438|    454|    }
 2439|       |
 2440|       |    /* Decode the ExtensionObject */
 2441|    230|    UA_ExtensionObject eo;
 2442|    230|    UA_ExtensionObject_init(&eo);
 2443|    230|    UA_StatusCode ret = ExtensionObject_decodeJson(ctx, &eo, NULL);
 2444|    230|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|    230|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2444:8): [True: 134, False: 96]
  ------------------
 2445|    134|        UA_ExtensionObject_clear(&eo); /* We don't have the global cleanup */
 2446|    134|        return ret;
 2447|    134|    }
 2448|       |
 2449|       |    /* The content is still encoded, cannot unwrap */
 2450|     96|    if(eo.encoding != UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2450:8): [True: 35, False: 61]
  ------------------
 2451|     35|        goto use_eo;
 2452|       |
 2453|       |    /* The content is a builtin type that could have been directly encoded in
 2454|       |     * the Variant, there was no need to wrap in an ExtensionObject. But this
 2455|       |     * means for us, that somebody made an extra effort to explicitly get an
 2456|       |     * ExtensionObject. So we keep it. As an added advantage we will generate
 2457|       |     * the same JSON again when encoding again. */
 2458|     61|    if(eo.content.decoded.type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (2458:8): [True: 17, False: 44]
  ------------------
 2459|     17|        goto use_eo;
 2460|       |
 2461|       |    /* Unwrap the ExtensionObject */
 2462|     44|    dst->data = eo.content.decoded.data;
 2463|     44|    dst->type = eo.content.decoded.type;
 2464|     44|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     44|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2465|       |
 2466|     52| use_eo:
 2467|       |    /* Don't unwrap */
 2468|     52|    dst->data = UA_new(&UA_TYPES[UA_TYPES_EXTENSIONOBJECT]);
  ------------------
  |  |  742|     52|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2469|     52|    if(!dst->data) {
  ------------------
  |  Branch (2469:8): [True: 0, False: 52]
  ------------------
 2470|      0|        UA_ExtensionObject_clear(&eo);
 2471|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2472|      0|    }
 2473|     52|    dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  742|     52|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2474|     52|    *(UA_ExtensionObject*)dst->data = eo;
 2475|     52|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     52|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2476|     52|}
ua_types_encoding_json.c:getArrayUnwrapType:
 1999|  6.47k|getArrayUnwrapType(ParseCtx *ctx) {
 2000|  6.47k|    UA_assert(ctx->tokens[ctx->index].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  |  248|  6.47k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2000:5): [True: 6.47k, False: 0]
  ------------------
 2001|       |
 2002|       |    /* Return early for empty arrays */
 2003|  6.47k|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 2004|  6.47k|    if(length == 0)
  ------------------
  |  Branch (2004:8): [True: 194, False: 6.28k]
  ------------------
 2005|    194|        return NULL;
 2006|       |
 2007|       |    /* Save the original index and go to the first array member */
 2008|  6.28k|    size_t oldIndex = ctx->index;
 2009|  6.28k|    ctx->index++;
 2010|       |
 2011|       |    /* Lookup the type for the first array member */
 2012|  6.28k|    UA_NodeId typeId;
 2013|  6.28k|    UA_NodeId_init(&typeId);
 2014|  6.28k|    const UA_DataType *typeOfBody = getExtensionObjectType(ctx);
 2015|  6.28k|    if(!typeOfBody) {
  ------------------
  |  Branch (2015:8): [True: 5.62k, False: 659]
  ------------------
 2016|  5.62k|        ctx->index = oldIndex; /* Restore the index */
 2017|  5.62k|        return NULL;
 2018|  5.62k|    }
 2019|       |
 2020|       |    /* Get the TypeId encoding for faster comparison below.
 2021|       |     * Cannot fail as getExtensionObjectType already looked this up. */
 2022|    659|    size_t typeIdIndex = 0;
 2023|    659|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 2024|    659|    (void)ret;
 2025|    659|    UA_assert(ret == UA_STATUSCODE_GOOD);
  ------------------
  |  |  248|    659|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2025:5): [True: 659, False: 0]
  ------------------
 2026|    659|    const char* typeIdData = &ctx->json5[ctx->tokens[typeIdIndex].start];
 2027|    659|    size_t typeIdSize = getTokenLength(&ctx->tokens[typeIdIndex]);
 2028|       |
 2029|       |    /* Loop over all members and check whether they can be unwrapped. Don't skip
 2030|       |     * the first member. We still haven't checked the encoding type. */
 2031|  2.85k|    for(size_t i = 0; i < length; i++) {
  ------------------
  |  Branch (2031:23): [True: 2.36k, False: 485]
  ------------------
 2032|       |        /* Array element must be an object */
 2033|  2.36k|        if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {
  ------------------
  |  Branch (2033:12): [True: 103, False: 2.26k]
  ------------------
 2034|    103|            ctx->index = oldIndex; /* Restore the index */
 2035|    103|            return NULL;
 2036|    103|        }
 2037|       |
 2038|       |        /* Check for non-JSON encoding */
 2039|  2.26k|        size_t encIndex = 0;
 2040|  2.26k|        ret = lookAheadForKey(ctx, UA_JSONKEY_ENCODING, &encIndex);
 2041|  2.26k|        if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  2.26k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2041:12): [True: 1, False: 2.26k]
  ------------------
 2042|      1|            ctx->index = oldIndex; /* Restore the index */
 2043|      1|            return NULL;
 2044|      1|        }
 2045|       |
 2046|       |        /* Get the type NodeId index */
 2047|  2.26k|        size_t memberTypeIdIndex = 0;
 2048|  2.26k|        ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &memberTypeIdIndex);
 2049|  2.26k|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  2.26k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2049:12): [True: 13, False: 2.25k]
  ------------------
 2050|     13|            ctx->index = oldIndex; /* Restore the index */
 2051|     13|            return NULL;
 2052|     13|        }
 2053|       |
 2054|       |        /* Is it the same type? Compare raw NodeId string */
 2055|  2.25k|        const char* memberTypeIdData = &ctx->json5[ctx->tokens[memberTypeIdIndex].start];
 2056|  2.25k|        size_t memberTypeIdSize = getTokenLength(&ctx->tokens[memberTypeIdIndex]);
 2057|  2.25k|        if(typeIdSize != memberTypeIdSize ||
  ------------------
  |  Branch (2057:12): [True: 9, False: 2.24k]
  ------------------
 2058|  2.24k|           memcmp(typeIdData, memberTypeIdData, typeIdSize) != 0) {
  ------------------
  |  Branch (2058:12): [True: 48, False: 2.19k]
  ------------------
 2059|     57|            ctx->index = oldIndex; /* Restore the index */
 2060|     57|            return NULL;
 2061|     57|        }
 2062|       |
 2063|       |        /* Skip to the next array member */
 2064|  2.19k|        skipObject(ctx);
 2065|  2.19k|    }
 2066|       |
 2067|    485|    ctx->index = oldIndex; /* Restore the index */
 2068|    485|    return typeOfBody;
 2069|    659|}
ua_types_encoding_json.c:getExtensionObjectType:
 1967|  6.28k|getExtensionObjectType(ParseCtx *ctx) {
 1968|  6.28k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (1968:8): [True: 2.44k, False: 3.83k]
  ------------------
 1969|  2.44k|        return NULL;
 1970|       |
 1971|       |    /* Get the type NodeId index */
 1972|  3.83k|    size_t typeIdIndex = 0;
 1973|  3.83k|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 1974|  3.83k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  3.83k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1974:8): [True: 2.62k, False: 1.21k]
  ------------------
 1975|  2.62k|        return NULL;
 1976|       |
 1977|  1.21k|    size_t oldIndex = ctx->index;
 1978|  1.21k|    ctx->index = (UA_UInt16)typeIdIndex;
 1979|       |
 1980|       |    /* Decode the type NodeId */
 1981|  1.21k|    UA_NodeId typeId;
 1982|  1.21k|    UA_NodeId_init(&typeId);
 1983|  1.21k|    ret = NodeId_decodeJson(ctx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  572|  1.21k|#define UA_TYPES_NODEID 16
  ------------------
 1984|  1.21k|    ctx->index = oldIndex;
 1985|  1.21k|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  1.21k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1985:8): [True: 78, False: 1.13k]
  ------------------
 1986|     78|        UA_NodeId_clear(&typeId); /* We don't have the global cleanup */
 1987|     78|        return NULL;
 1988|     78|    }
 1989|       |
 1990|       |    /* Lookup an return */
 1991|  1.13k|    const UA_DataType *type = UA_findDataTypeWithCustom(&typeId, ctx->customTypes);
 1992|  1.13k|    UA_NodeId_clear(&typeId);
 1993|  1.13k|    return type;
 1994|  1.21k|}
ua_types_encoding_json.c:Array_decodeJsonUnwrapExtensionObject:
 2073|    485|                                      const UA_DataType *type) {
 2074|    485|    size_t *size_ptr = (size_t*) dst - 1; /* Save the length pointer of the array */
 2075|    485|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 2076|       |
 2077|       |    /* Known from the previous unwrapping-check */
 2078|    485|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_ARRAY);
  ------------------
  |  |  248|    485|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2078:5): [True: 485, False: 0]
  ------------------
 2079|    485|    UA_assert(length > 0);
  ------------------
  |  |  248|    485|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2079:5): [True: 485, False: 0]
  ------------------
 2080|       |
 2081|    485|    ctx->index++; /* Go to first array member */
 2082|       |
 2083|       |    /* Allocate memory */
 2084|    485|    if(length > SIZE_MAX / type->memSize)
  ------------------
  |  Branch (2084:8): [True: 0, False: 485]
  ------------------
 2085|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2086|    485|    *dst = UA_calloc(length, type->memSize);
  ------------------
  |  |   24|    485|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2087|    485|    if(*dst == NULL)
  ------------------
  |  Branch (2087:8): [True: 0, False: 485]
  ------------------
 2088|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2089|       |
 2090|       |    /* Decode array members */
 2091|    485|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    485|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2092|    485|    uintptr_t ptr = (uintptr_t)*dst;
 2093|  1.06k|    for(size_t i = 0; i < length; i++) {
  ------------------
  |  Branch (2093:23): [True: 604, False: 464]
  ------------------
 2094|    604|        UA_assert(ctx->tokens[ctx->index].type == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  248|    604|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2094:9): [True: 604, False: 0]
  ------------------
 2095|    604|        if(type->typeKind == UA_DATATYPEKIND_STRUCTURE ||
  ------------------
  |  Branch (2095:12): [True: 200, False: 404]
  ------------------
 2096|    404|           type->typeKind == UA_DATATYPEKIND_OPTSTRUCT) {
  ------------------
  |  Branch (2096:12): [True: 0, False: 404]
  ------------------
 2097|       |            /* Decode structure in-situ in the ExtensionObject */
 2098|    200|            ret = decodeJsonStructureExtensionObject(ctx, (void*)ptr, type);
 2099|    404|        } else if(type->typeKind == UA_DATATYPEKIND_UNION) {
  ------------------
  |  Branch (2099:19): [True: 0, False: 404]
  ------------------
 2100|       |            /* Decode union in-situ in the ExtensionObject */
 2101|      0|            ret = decodeJsonUnionExtensionObject(ctx, (void*)ptr, type);
 2102|    404|        } else {
 2103|       |            /* Get the body field and decode it */
 2104|    404|            DecodeEntry entries[3] = {
 2105|    404|                {UA_JSONKEY_TYPEID, NULL, NULL, false, NULL},
 2106|    404|                {UA_JSONKEY_BODY, (void*)ptr, NULL, false, type},
 2107|    404|                {UA_JSONKEY_ENCODING, NULL, NULL, false, NULL}
 2108|    404|            };
 2109|    404|            ret = decodeFields(ctx, entries, 3);
 2110|    404|        }
 2111|    604|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|    604|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2111:12): [True: 21, False: 583]
  ------------------
 2112|     21|            UA_Array_delete(*dst, i+1, type);
 2113|     21|            *dst = NULL;
 2114|     21|            return ret;
 2115|     21|        }
 2116|    583|        ptr += type->memSize;
 2117|    583|    }
 2118|       |
 2119|    464|    *size_ptr = length; /* All good, set the size */
 2120|    464|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    464|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2121|    485|}
ua_types_encoding_json.c:Variant_decodeJson:
 2261|   148k|DECODE_JSON(Variant) {
 2262|   148k|    UA_Variant *dst = (UA_Variant*)p;
 2263|   148k|    CHECK_NULL_SKIP; /* Treat null as an empty variant */
  ------------------
  |  | 1323|   148k|#define CHECK_NULL_SKIP do {                         \
  |  | 1324|   148k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1324:8): [True: 1, False: 148k]
  |  |  ------------------
  |  | 1325|      1|        ctx->index++;                                \
  |  | 1326|      1|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1327|   148k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1327:14): [Folded, False: 148k]
  |  |  ------------------
  ------------------
 2264|   148k|    CHECK_OBJECT;
  ------------------
  |  | 1318|   148k|#define CHECK_OBJECT do {                                \
  |  | 1319|   148k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1319:8): [True: 101, False: 148k]
  |  |  ------------------
  |  | 1320|    101|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|    101|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1321|   148k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1321:14): [Folded, False: 148k]
  |  |  ------------------
  ------------------
 2265|   148k|    return decodeJSONVariant(ctx, dst, false);
 2266|   148k|}
ua_types_encoding_json.c:Enum_decodeJson:
 1717|    180|DECODE_JSON(Enum) {
 1718|    180|    if(currentTokenType(ctx) == CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1718:8): [True: 24, False: 156]
  ------------------
 1719|     24|        return Int32_decodeJson(ctx, p, type);
 1720|    156|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING)
  ------------------
  |  Branch (1720:8): [True: 1, False: 155]
  ------------------
 1721|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1722|       |
 1723|    155|    UA_String encoded = UA_STRING_NULL;
 1724|    155|    status ret = String_decodeJson(ctx, &encoded, &UA_TYPES[UA_TYPES_STRING]);
  ------------------
  |  |  402|    155|#define UA_TYPES_STRING 11
  ------------------
 1725|    155|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    155|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1725:8): [True: 4, False: 151]
  ------------------
 1726|      4|        return ret;
 1727|       |
 1728|       |    /* Use the suffix after the final underscore, if present. Enumeration
 1729|       |     * names can themselves contain underscores. */
 1730|    151|    size_t numberStart = 0;
 1731|  1.74M|    for(size_t i = encoded.length; i > 0; i--) {
  ------------------
  |  Branch (1731:36): [True: 1.74M, False: 42]
  ------------------
 1732|  1.74M|        if(encoded.data[i - 1] != '_')
  ------------------
  |  Branch (1732:12): [True: 1.74M, False: 109]
  ------------------
 1733|  1.74M|            continue;
 1734|    109|        if(i == 1 || i == encoded.length) {
  ------------------
  |  Branch (1734:12): [True: 1, False: 108]
  |  Branch (1734:22): [True: 1, False: 107]
  ------------------
 1735|      2|            ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1736|      2|            goto cleanup;
 1737|      2|        }
 1738|    107|        numberStart = i;
 1739|    107|        break;
 1740|    109|    }
 1741|       |
 1742|    149|    size_t numberLength = encoded.length - numberStart;
 1743|    149|    if(numberLength == 0) {
  ------------------
  |  Branch (1743:8): [True: 1, False: 148]
  ------------------
 1744|      1|        ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1745|      1|        goto cleanup;
 1746|      1|    }
 1747|       |
 1748|    148|    UA_Int64 value = 0;
 1749|    148|    size_t parsed = parseInt64((const char*)&encoded.data[numberStart],
 1750|    148|                               numberLength, &value);
 1751|    148|    if(parsed != numberLength || value < UA_INT32_MIN || value > UA_INT32_MAX) {
  ------------------
  |  |  100|    239|#define UA_INT32_MIN ((int32_t)-2147483648LL)
  ------------------
                  if(parsed != numberLength || value < UA_INT32_MIN || value > UA_INT32_MAX) {
  ------------------
  |  |  101|     91|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (1751:8): [True: 57, False: 91]
  |  Branch (1751:34): [True: 0, False: 91]
  |  Branch (1751:58): [True: 0, False: 91]
  ------------------
 1752|     57|        ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     57|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1753|     57|        goto cleanup;
 1754|     57|    }
 1755|     91|    *(UA_Int32*)p = (UA_Int32)value;
 1756|       |
 1757|    151| cleanup:
 1758|    151|    UA_String_clear(&encoded);
 1759|    151|    return ret;
 1760|     91|}
ua_types_encoding_json.c:decodeJsonStructure:
 2812|  8.45k|decodeJsonStructure(ParseCtx *ctx, void *dst, const UA_DataType *type) {
 2813|       |    return decodeJsonStructureInternal(ctx, dst, type, false);
 2814|  8.45k|}

UA_Guid_parse:
   86|  1.41k|UA_Guid_parse(UA_Guid *guid, const UA_String str) {
   87|  1.41k|    UA_StatusCode res = parse_guid(guid, str.data, str.data + str.length);
   88|  1.41k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  1.41k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (88:8): [True: 28, False: 1.39k]
  ------------------
   89|     28|        *guid = UA_GUID_NULL;
   90|  1.41k|    return res;
   91|  1.41k|}
UA_NodeId_parseEx:
  323|  18.0k|                  const UA_NamespaceMapping *nsMapping) {
  324|  18.0k|    UA_StatusCode res =
  325|  18.0k|        parse_nodeid(id, str.data, str.data+str.length, UA_ESCAPING_NONE, nsMapping);
  326|  18.0k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  18.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (326:8): [True: 242, False: 17.7k]
  ------------------
  327|    242|        UA_NodeId_clear(id);
  328|  18.0k|    return res;
  329|  18.0k|}
UA_ExpandedNodeId_parseEx:
  671|  31.8k|                          size_t serverUrisSize, const UA_String *serverUris) {
  672|  31.8k|    UA_StatusCode res =
  673|  31.8k|        parse_expandednodeid(id, str.data, str.data + str.length, UA_ESCAPING_NONE,
  674|  31.8k|                             nsMapping, serverUrisSize, serverUris);
  675|  31.8k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  31.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (675:8): [True: 280, False: 31.6k]
  ------------------
  676|    280|        UA_ExpandedNodeId_clear(id);
  677|  31.8k|    return res;
  678|  31.8k|}
UA_QualifiedName_parseEx:
  834|  18.5k|                         const UA_NamespaceMapping *nsMapping) {
  835|  18.5k|    const u8 *pos = str.data;
  836|  18.5k|    const u8 *end = str.data + str.length;
  837|  18.5k|    UA_StatusCode res = parse_qn(qn, pos, end, UA_ESCAPING_NONE, nsMapping, 0);
  838|  18.5k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  18.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (838:8): [True: 3, False: 18.5k]
  ------------------
  839|      3|        UA_QualifiedName_clear(qn);
  840|  18.5k|    return res;
  841|  18.5k|}
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: 9, False: 1.43k]
  |  Branch (52:21): [True: 4, False: 1.43k]
  |  Branch (52:36): [True: 4, False: 1.42k]
  |  Branch (52:52): [True: 5, False: 1.42k]
  ------------------
   53|     22|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     22|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   54|       |
   55|  1.42k|    UA_UInt32 tmp;
   56|  1.42k|    if(UA_readNumberWithBase(s, 8, &tmp, 16) != 8)
  ------------------
  |  Branch (56:8): [True: 7, False: 1.41k]
  ------------------
   57|      7|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      7|#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: 3, False: 1.41k]
  ------------------
   61|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#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: 4, False: 1.40k]
  ------------------
   65|      4|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      4|#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: 3, False: 1.40k]
  ------------------
   69|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#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: 3, False: 1.40k]
  ------------------
   73|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   74|  1.40k|    guid->data4[1] = (UA_Byte)tmp;
   75|       |
   76|  9.78k|    for(size_t pos = 2, spos = 24; pos < 8; pos++, spos += 2) {
  ------------------
  |  Branch (76:36): [True: 8.39k, False: 1.39k]
  ------------------
   77|  8.39k|        if(UA_readNumberWithBase(&s[spos], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (77:12): [True: 9, False: 8.38k]
  ------------------
   78|      9|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   79|  8.38k|        guid->data4[pos] = (UA_Byte)tmp;
   80|  8.38k|    }
   81|       |
   82|  1.39k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.39k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   83|  1.40k|}
ua_types_lex.c:parse_nodeid:
  148|  18.0k|             UA_Escaping idEsc, const UA_NamespaceMapping *nsMapping) {
  149|  18.0k|    *id = UA_NODEID_NULL; /* Reset the NodeId */
  150|  18.0k|    LexContext context;
  151|  18.0k|    memset(&context, 0, sizeof(LexContext));
  152|  18.0k|    UA_Byte *begin = (UA_Byte*)(uintptr_t)pos;
  153|  18.0k|    const u8 *ns = NULL, *nsu = NULL, *body = NULL;
  154|       |
  155|       |    
  156|  18.0k|{
  157|  18.0k|	u8 yych;
  158|  18.0k|	yych = YYPEEK();
  ------------------
  |  |   33|  18.0k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  18.0k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  17.9k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 17.9k, False: 7]
  |  |  ------------------
  ------------------
  159|  18.0k|	switch (yych) {
  160|  4.55k|		case 'b':
  ------------------
  |  Branch (160:3): [True: 4.55k, False: 13.4k]
  ------------------
  161|  4.58k|		case 'g':
  ------------------
  |  Branch (161:3): [True: 29, False: 17.9k]
  ------------------
  162|  11.1k|		case 'i':
  ------------------
  |  Branch (162:3): [True: 6.57k, False: 11.4k]
  ------------------
  163|  14.2k|		case 's':
  ------------------
  |  Branch (163:3): [True: 3.11k, False: 14.8k]
  ------------------
  164|  14.2k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  14.2k|#define YYSTAGN(t) t = NULL
  ------------------
  165|  14.2k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  14.2k|#define YYSTAGN(t) t = NULL
  ------------------
  166|  14.2k|			goto yy3;
  167|  3.71k|		case 'n': goto yy4;
  ------------------
  |  Branch (167:3): [True: 3.71k, False: 14.2k]
  ------------------
  168|     18|		default: goto yy1;
  ------------------
  |  Branch (168:3): [True: 18, False: 17.9k]
  ------------------
  169|  18.0k|	}
  170|     18|yy1:
  171|     18|	YYSKIP();
  ------------------
  |  |   35|     18|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|     18|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  172|    178|yy2:
  173|    178|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   44|    178|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  174|  14.2k|yy3:
  175|  14.2k|	YYSKIP();
  ------------------
  |  |   35|  14.2k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  14.2k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  176|  14.2k|	yych = YYPEEK();
  ------------------
  |  |   33|  14.2k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  14.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  14.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 14.2k, False: 10]
  |  |  ------------------
  ------------------
  177|  14.2k|	switch (yych) {
  178|  14.2k|		case '=': goto yy5;
  ------------------
  |  Branch (178:3): [True: 14.2k, False: 18]
  ------------------
  179|     18|		default: goto yy2;
  ------------------
  |  Branch (179:3): [True: 18, False: 14.2k]
  ------------------
  180|  14.2k|	}
  181|  3.71k|yy4:
  182|  3.71k|	YYSKIP();
  ------------------
  |  |   35|  3.71k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.71k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  183|  3.71k|	YYBACKUP();
  ------------------
  |  |   36|  3.71k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  3.71k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  3.71k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  184|  3.71k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.71k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.71k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.71k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.71k, False: 3]
  |  |  ------------------
  ------------------
  185|  3.71k|	switch (yych) {
  186|  3.69k|		case 's': goto yy6;
  ------------------
  |  Branch (186:3): [True: 3.69k, False: 15]
  ------------------
  187|     15|		default: goto yy2;
  ------------------
  |  Branch (187:3): [True: 15, False: 3.69k]
  ------------------
  188|  3.71k|	}
  189|  17.8k|yy5:
  190|  17.8k|	YYSKIP();
  ------------------
  |  |   35|  17.8k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  17.8k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  191|  17.8k|	nsu = context.yyt2;
  192|  17.8k|	ns = context.yyt1;
  193|  17.8k|	YYSTAGP(body);
  ------------------
  |  |   38|  17.8k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  17.8k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  194|  17.8k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  17.8k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  195|  17.8k|	{ goto match; }
  196|  3.69k|yy6:
  197|  3.69k|	YYSKIP();
  ------------------
  |  |   35|  3.69k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.69k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  198|  3.69k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.69k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.69k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.69k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.69k, False: 3]
  |  |  ------------------
  ------------------
  199|  3.69k|	switch (yych) {
  200|  2.71k|		case '=': goto yy8;
  ------------------
  |  Branch (200:3): [True: 2.71k, False: 988]
  ------------------
  201|    985|		case 'u': goto yy9;
  ------------------
  |  Branch (201:3): [True: 985, False: 2.71k]
  ------------------
  202|      3|		default: goto yy7;
  ------------------
  |  Branch (202:3): [True: 3, False: 3.69k]
  ------------------
  203|  3.69k|	}
  204|    127|yy7:
  205|    127|	YYRESTORE();
  ------------------
  |  |   37|    127|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|    127|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|    127|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  206|    127|	goto yy2;
  207|  2.71k|yy8:
  208|  2.71k|	YYSKIP();
  ------------------
  |  |   35|  2.71k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.71k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  209|  2.71k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.71k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.71k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.70k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.70k, False: 3]
  |  |  ------------------
  ------------------
  210|  2.71k|	switch (yych) {
  211|    741|		case '0':
  ------------------
  |  Branch (211:3): [True: 741, False: 1.96k]
  ------------------
  212|  1.57k|		case '1':
  ------------------
  |  Branch (212:3): [True: 830, False: 1.88k]
  ------------------
  213|  1.65k|		case '2':
  ------------------
  |  Branch (213:3): [True: 87, False: 2.62k]
  ------------------
  214|  2.57k|		case '3':
  ------------------
  |  Branch (214:3): [True: 915, False: 1.79k]
  ------------------
  215|  2.58k|		case '4':
  ------------------
  |  Branch (215:3): [True: 15, False: 2.69k]
  ------------------
  216|  2.61k|		case '5':
  ------------------
  |  Branch (216:3): [True: 23, False: 2.68k]
  ------------------
  217|  2.63k|		case '6':
  ------------------
  |  Branch (217:3): [True: 26, False: 2.68k]
  ------------------
  218|  2.65k|		case '7':
  ------------------
  |  Branch (218:3): [True: 20, False: 2.69k]
  ------------------
  219|  2.69k|		case '8':
  ------------------
  |  Branch (219:3): [True: 35, False: 2.67k]
  ------------------
  220|  2.70k|		case '9':
  ------------------
  |  Branch (220:3): [True: 12, False: 2.69k]
  ------------------
  221|  2.70k|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|  2.70k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  2.70k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  222|  2.70k|			goto yy10;
  223|      6|		default: goto yy7;
  ------------------
  |  Branch (223:3): [True: 6, False: 2.70k]
  ------------------
  224|  2.71k|	}
  225|    985|yy9:
  226|    985|	YYSKIP();
  ------------------
  |  |   35|    985|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    985|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  227|    985|	yych = YYPEEK();
  ------------------
  |  |   33|    985|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    985|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    982|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 982, False: 3]
  |  |  ------------------
  ------------------
  228|    985|	switch (yych) {
  229|    977|		case '=': goto yy11;
  ------------------
  |  Branch (229:3): [True: 977, False: 8]
  ------------------
  230|      8|		default: goto yy7;
  ------------------
  |  Branch (230:3): [True: 8, False: 977]
  ------------------
  231|    985|	}
  232|  10.6k|yy10:
  233|  10.6k|	YYSKIP();
  ------------------
  |  |   35|  10.6k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  10.6k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  234|  10.6k|	yych = YYPEEK();
  ------------------
  |  |   33|  10.6k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  10.6k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  10.5k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 10.5k, False: 72]
  |  |  ------------------
  ------------------
  235|  10.6k|	switch (yych) {
  236|    635|		case '0':
  ------------------
  |  Branch (236:3): [True: 635, False: 10.0k]
  ------------------
  237|  1.29k|		case '1':
  ------------------
  |  Branch (237:3): [True: 658, False: 9.99k]
  ------------------
  238|  1.67k|		case '2':
  ------------------
  |  Branch (238:3): [True: 377, False: 10.2k]
  ------------------
  239|  2.73k|		case '3':
  ------------------
  |  Branch (239:3): [True: 1.06k, False: 9.59k]
  ------------------
  240|  2.94k|		case '4':
  ------------------
  |  Branch (240:3): [True: 219, False: 10.4k]
  ------------------
  241|  4.09k|		case '5':
  ------------------
  |  Branch (241:3): [True: 1.14k, False: 9.50k]
  ------------------
  242|  5.48k|		case '6':
  ------------------
  |  Branch (242:3): [True: 1.39k, False: 9.25k]
  ------------------
  243|  5.88k|		case '7':
  ------------------
  |  Branch (243:3): [True: 401, False: 10.2k]
  ------------------
  244|  6.82k|		case '8':
  ------------------
  |  Branch (244:3): [True: 940, False: 9.71k]
  ------------------
  245|  7.94k|		case '9': goto yy10;
  ------------------
  |  Branch (245:3): [True: 1.12k, False: 9.53k]
  ------------------
  246|  2.62k|		case ';':
  ------------------
  |  Branch (246:3): [True: 2.62k, False: 8.02k]
  ------------------
  247|  2.62k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  2.62k|#define YYSTAGN(t) t = NULL
  ------------------
  248|  2.62k|			goto yy12;
  249|     76|		default: goto yy7;
  ------------------
  |  Branch (249:3): [True: 76, False: 10.5k]
  ------------------
  250|  10.6k|	}
  251|    977|yy11:
  252|    977|	YYSKIP();
  ------------------
  |  |   35|    977|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    977|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  253|    977|	yych = YYPEEK();
  ------------------
  |  |   33|    977|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    977|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    974|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 974, False: 3]
  |  |  ------------------
  ------------------
  254|    977|	switch (yych) {
  255|      3|		case 0x00: goto yy7;
  ------------------
  |  Branch (255:3): [True: 3, False: 974]
  ------------------
  256|    347|		case ';':
  ------------------
  |  Branch (256:3): [True: 347, False: 630]
  ------------------
  257|    347|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    347|#define YYSTAGN(t) t = NULL
  ------------------
  258|    347|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    347|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    347|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  259|    347|			goto yy12;
  260|    627|		default:
  ------------------
  |  Branch (260:3): [True: 627, False: 350]
  ------------------
  261|    627|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    627|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    627|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  262|    627|			goto yy13;
  263|    977|	}
  264|  3.59k|yy12:
  265|  3.59k|	YYSKIP();
  ------------------
  |  |   35|  3.59k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.59k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  266|  3.59k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.59k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.59k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.58k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.58k, False: 5]
  |  |  ------------------
  ------------------
  267|  3.59k|	switch (yych) {
  268|  1.95k|		case 'b':
  ------------------
  |  Branch (268:3): [True: 1.95k, False: 1.63k]
  ------------------
  269|  2.14k|		case 'g':
  ------------------
  |  Branch (269:3): [True: 194, False: 3.39k]
  ------------------
  270|  2.54k|		case 'i':
  ------------------
  |  Branch (270:3): [True: 396, False: 3.19k]
  ------------------
  271|  3.58k|		case 's': goto yy14;
  ------------------
  |  Branch (271:3): [True: 1.03k, False: 2.55k]
  ------------------
  272|      9|		default: goto yy7;
  ------------------
  |  Branch (272:3): [True: 9, False: 3.58k]
  ------------------
  273|  3.59k|	}
  274|  2.71k|yy13:
  275|  2.71k|	YYSKIP();
  ------------------
  |  |   35|  2.71k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.71k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  276|  2.71k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.71k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.71k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.70k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.70k, False: 10]
  |  |  ------------------
  ------------------
  277|  2.71k|	switch (yych) {
  278|     10|		case 0x00: goto yy7;
  ------------------
  |  Branch (278:3): [True: 10, False: 2.70k]
  ------------------
  279|    617|		case ';':
  ------------------
  |  Branch (279:3): [True: 617, False: 2.10k]
  ------------------
  280|    617|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    617|#define YYSTAGN(t) t = NULL
  ------------------
  281|    617|			goto yy12;
  282|  2.09k|		default: goto yy13;
  ------------------
  |  Branch (282:3): [True: 2.09k, False: 627]
  ------------------
  283|  2.71k|	}
  284|  3.58k|yy14:
  285|  3.58k|	YYSKIP();
  ------------------
  |  |   35|  3.58k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.58k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  286|  3.58k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.58k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.58k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.57k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.57k, False: 7]
  |  |  ------------------
  ------------------
  287|  3.58k|	switch (yych) {
  288|  3.57k|		case '=': goto yy5;
  ------------------
  |  Branch (288:3): [True: 3.57k, False: 12]
  ------------------
  289|     12|		default: goto yy7;
  ------------------
  |  Branch (289:3): [True: 12, False: 3.57k]
  ------------------
  290|  3.58k|	}
  291|  3.58k|}
  292|       |
  293|       |
  294|  17.8k| match:
  295|  17.8k|    if(nsu) {
  ------------------
  |  Branch (295:8): [True: 955, False: 16.8k]
  ------------------
  296|       |        /* NamespaceUri */
  297|    955|        UA_String nsUri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  298|    955|        UA_StatusCode res = escapedUri2Index(nsUri, &id->namespaceIndex, nsMapping);
  299|    955|        if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|    955|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (299:12): [True: 955, False: 0]
  ------------------
  300|       |            /* Return the entire NodeId string s=... */
  301|    955|            UA_String total = {(size_t)((const UA_Byte*)end - begin), begin};
  302|    955|            id->identifierType = UA_NODEIDTYPE_STRING;
  303|    955|            return UA_String_copy(&total, &id->identifier.string);
  304|    955|        }
  305|  16.8k|    } else if(ns) {
  ------------------
  |  Branch (305:15): [True: 2.61k, False: 14.2k]
  ------------------
  306|       |        /* NamespaceIndex */
  307|  2.61k|        UA_UInt32 tmp;
  308|  2.61k|        size_t len = (size_t)(body - 1 - ns);
  309|  2.61k|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (309:12): [True: 2, False: 2.61k]
  ------------------
  310|      2|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  311|  2.61k|        id->namespaceIndex = (UA_UInt16)tmp;
  312|  2.61k|        if(nsMapping)
  ------------------
  |  Branch (312:12): [True: 0, False: 2.61k]
  ------------------
  313|      0|            id->namespaceIndex =
  314|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->namespaceIndex);
  315|  2.61k|    }
  316|       |
  317|       |    /* From the current position until the end */
  318|  16.8k|    return parse_nodeid_body(id, body, end, idEsc);
  319|  17.8k|}
ua_types_lex.c:escapedUri2Index:
   95|  5.99k|                 const UA_NamespaceMapping *nsMapping) {
   96|  5.99k|    if(!nsMapping)
  ------------------
  |  Branch (96:8): [True: 5.99k, False: 0]
  ------------------
   97|  5.99k|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|  5.99k|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   98|      0|    UA_String tmp = uri; 
   99|      0|    status res = UA_String_unescape(&uri, true, UA_ESCAPING_PERCENT);
  100|      0|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (100:8): [True: 0, False: 0]
  ------------------
  101|      0|        return res;
  102|      0|    res = UA_NamespaceMapping_uri2Index(nsMapping, uri, nsIndex);
  103|      0|    if(tmp.data != uri.data)
  ------------------
  |  Branch (103:8): [True: 0, False: 0]
  ------------------
  104|      0|        UA_String_clear(&uri);
  105|      0|    return res;
  106|      0|}
ua_types_lex.c:parse_nodeid_body:
  109|  45.3k|parse_nodeid_body(UA_NodeId *id, const u8 *body, const u8 *end, UA_Escaping esc) {
  110|  45.3k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  45.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  111|  45.3k|    UA_String str = {(size_t)(end - (body+2)), (UA_Byte*)(uintptr_t)body + 2};
  112|  45.3k|    switch(*body) {
  113|  7.95k|    case 'i':
  ------------------
  |  Branch (113:5): [True: 7.95k, False: 37.4k]
  ------------------
  114|  7.95k|        id->identifierType = UA_NODEIDTYPE_NUMERIC;
  115|  7.95k|        if(UA_readNumber(str.data, str.length, &id->identifier.numeric) != str.length)
  ------------------
  |  Branch (115:12): [True: 41, False: 7.91k]
  ------------------
  116|     41|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     41|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  117|  7.95k|        break;
  118|  22.9k|    case 's':
  ------------------
  |  Branch (118:5): [True: 22.9k, False: 22.4k]
  ------------------
  119|  22.9k|        id->identifierType = UA_NODEIDTYPE_STRING;
  120|  22.9k|        res |= UA_String_copy(&str, &id->identifier.string);
  121|  22.9k|        res |= UA_String_unescape(&id->identifier.string, false, esc);
  122|  22.9k|        break;
  123|     27|    case 'g':
  ------------------
  |  Branch (123:5): [True: 27, False: 45.3k]
  ------------------
  124|     27|        id->identifierType = UA_NODEIDTYPE_GUID;
  125|     27|        res = parse_guid(&id->identifier.guid, str.data, end);
  126|     27|        break;
  127|  14.4k|    case 'b':
  ------------------
  |  Branch (127:5): [True: 14.4k, False: 30.9k]
  ------------------
  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|  14.4k|        id->identifierType = UA_NODEIDTYPE_BYTESTRING;
  132|  14.4k|        id->identifier.byteString.data =
  133|  14.4k|            UA_unbase64(str.data, str.length, &id->identifier.byteString.length);
  134|  14.4k|        if(!id->identifier.byteString.data) {
  ------------------
  |  Branch (134:12): [True: 15, False: 14.4k]
  ------------------
  135|     15|            UA_assert(id->identifier.byteString.length == 0);
  ------------------
  |  |  248|     15|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (135:13): [True: 15, False: 0]
  ------------------
  136|     15|            res = UA_STATUSCODE_BADDECODINGERROR; /* Returned on error by UA_unbase64 */
  ------------------
  |  |   44|     15|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  137|     15|        }
  138|  14.4k|        break;
  139|  14.4k|    default:
  ------------------
  |  Branch (139:5): [True: 0, False: 45.3k]
  ------------------
  140|      0|        res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  141|      0|        break;
  142|  45.3k|    }
  143|  45.3k|    return res;
  144|  45.3k|}
ua_types_lex.c:parse_expandednodeid:
  339|  31.8k|                     size_t serverUrisSize, const UA_String *serverUris) {
  340|  31.8k|    *id = UA_EXPANDEDNODEID_NULL; /* Reset the NodeId */
  341|  31.8k|    LexContext context;
  342|  31.8k|    memset(&context, 0, sizeof(LexContext));
  343|  31.8k|    const u8 *svr = NULL, *sve = NULL, *svu = NULL,
  344|  31.8k|        *nsu = NULL, *ns = NULL, *body = NULL, *begin = pos;
  345|       |
  346|       |    
  347|  31.8k|{
  348|  31.8k|	u8 yych;
  349|  31.8k|	yych = YYPEEK();
  ------------------
  |  |   33|  31.8k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  31.8k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  31.8k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 31.8k, False: 5]
  |  |  ------------------
  ------------------
  350|  31.8k|	switch (yych) {
  351|  7.43k|		case 'b':
  ------------------
  |  Branch (351:3): [True: 7.43k, False: 24.4k]
  ------------------
  352|  7.43k|		case 'g':
  ------------------
  |  Branch (352:3): [True: 2, False: 31.8k]
  ------------------
  353|  8.07k|		case 'i':
  ------------------
  |  Branch (353:3): [True: 638, False: 31.2k]
  ------------------
  354|  8.07k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  8.07k|#define YYSTAGN(t) t = NULL
  ------------------
  355|  8.07k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  8.07k|#define YYSTAGN(t) t = NULL
  ------------------
  356|  8.07k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  8.07k|#define YYSTAGN(t) t = NULL
  ------------------
  357|  8.07k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  8.07k|#define YYSTAGN(t) t = NULL
  ------------------
  358|  8.07k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  8.07k|#define YYSTAGN(t) t = NULL
  ------------------
  359|  8.07k|			goto yy18;
  360|  5.57k|		case 'n':
  ------------------
  |  Branch (360:3): [True: 5.57k, False: 26.3k]
  ------------------
  361|  5.57k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  5.57k|#define YYSTAGN(t) t = NULL
  ------------------
  362|  5.57k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  5.57k|#define YYSTAGN(t) t = NULL
  ------------------
  363|  5.57k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  5.57k|#define YYSTAGN(t) t = NULL
  ------------------
  364|  5.57k|			goto yy19;
  365|  18.2k|		case 's':
  ------------------
  |  Branch (365:3): [True: 18.2k, False: 13.6k]
  ------------------
  366|  18.2k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  18.2k|#define YYSTAGN(t) t = NULL
  ------------------
  367|  18.2k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  18.2k|#define YYSTAGN(t) t = NULL
  ------------------
  368|  18.2k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  18.2k|#define YYSTAGN(t) t = NULL
  ------------------
  369|  18.2k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  18.2k|#define YYSTAGN(t) t = NULL
  ------------------
  370|  18.2k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  18.2k|#define YYSTAGN(t) t = NULL
  ------------------
  371|  18.2k|			goto yy20;
  372|     17|		default: goto yy16;
  ------------------
  |  Branch (372:3): [True: 17, False: 31.8k]
  ------------------
  373|  31.8k|	}
  374|     17|yy16:
  375|     17|	YYSKIP();
  ------------------
  |  |   35|     17|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|     17|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  376|    258|yy17:
  377|    258|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   44|    258|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  378|  8.07k|yy18:
  379|  8.07k|	YYSKIP();
  ------------------
  |  |   35|  8.07k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  8.07k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  380|  8.07k|	yych = YYPEEK();
  ------------------
  |  |   33|  8.07k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  8.07k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  8.07k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 8.07k, False: 4]
  |  |  ------------------
  ------------------
  381|  8.07k|	switch (yych) {
  382|  8.06k|		case '=': goto yy21;
  ------------------
  |  Branch (382:3): [True: 8.06k, False: 10]
  ------------------
  383|     10|		default: goto yy17;
  ------------------
  |  Branch (383:3): [True: 10, False: 8.06k]
  ------------------
  384|  8.07k|	}
  385|  5.57k|yy19:
  386|  5.57k|	YYSKIP();
  ------------------
  |  |   35|  5.57k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  5.57k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  387|  5.57k|	YYBACKUP();
  ------------------
  |  |   36|  5.57k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  5.57k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  5.57k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  388|  5.57k|	yych = YYPEEK();
  ------------------
  |  |   33|  5.57k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  5.57k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  5.56k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 5.56k, False: 1]
  |  |  ------------------
  ------------------
  389|  5.57k|	switch (yych) {
  390|  5.56k|		case 's': goto yy22;
  ------------------
  |  Branch (390:3): [True: 5.56k, False: 4]
  ------------------
  391|      4|		default: goto yy17;
  ------------------
  |  Branch (391:3): [True: 4, False: 5.56k]
  ------------------
  392|  5.57k|	}
  393|  18.2k|yy20:
  394|  18.2k|	YYSKIP();
  ------------------
  |  |   35|  18.2k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  18.2k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  395|  18.2k|	YYBACKUP();
  ------------------
  |  |   36|  18.2k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  18.2k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  18.2k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  396|  18.2k|	yych = YYPEEK();
  ------------------
  |  |   33|  18.2k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  18.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  18.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 18.2k, False: 1]
  |  |  ------------------
  ------------------
  397|  18.2k|	switch (yych) {
  398|  13.2k|		case '=': goto yy21;
  ------------------
  |  Branch (398:3): [True: 13.2k, False: 4.94k]
  ------------------
  399|  4.93k|		case 'v': goto yy24;
  ------------------
  |  Branch (399:3): [True: 4.93k, False: 13.2k]
  ------------------
  400|      4|		default: goto yy17;
  ------------------
  |  Branch (400:3): [True: 4, False: 18.2k]
  ------------------
  401|  18.2k|	}
  402|  31.6k|yy21:
  403|  31.6k|	YYSKIP();
  ------------------
  |  |   35|  31.6k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  31.6k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  404|  31.6k|	svr = context.yyt5;
  405|  31.6k|	svu = context.yyt1;
  406|  31.6k|	sve = context.yyt2;
  407|  31.6k|	ns = context.yyt3;
  408|  31.6k|	nsu = context.yyt4;
  409|  31.6k|	YYSTAGP(body);
  ------------------
  |  |   38|  31.6k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  31.6k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  410|  31.6k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  31.6k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  411|  31.6k|	{ goto match; }
  412|  7.96k|yy22:
  413|  7.96k|	YYSKIP();
  ------------------
  |  |   35|  7.96k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  7.96k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  414|  7.96k|	yych = YYPEEK();
  ------------------
  |  |   33|  7.96k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  7.96k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  7.95k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 7.95k, False: 2]
  |  |  ------------------
  ------------------
  415|  7.96k|	switch (yych) {
  416|  2.41k|		case '=': goto yy25;
  ------------------
  |  Branch (416:3): [True: 2.41k, False: 5.54k]
  ------------------
  417|  5.54k|		case 'u': goto yy26;
  ------------------
  |  Branch (417:3): [True: 5.54k, False: 2.41k]
  ------------------
  418|      2|		default: goto yy23;
  ------------------
  |  Branch (418:3): [True: 2, False: 7.95k]
  ------------------
  419|  7.96k|	}
  420|    223|yy23:
  421|    223|	YYRESTORE();
  ------------------
  |  |   37|    223|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|    223|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|    223|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  422|    223|	goto yy17;
  423|  4.93k|yy24:
  424|  4.93k|	YYSKIP();
  ------------------
  |  |   35|  4.93k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  4.93k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  425|  4.93k|	yych = YYPEEK();
  ------------------
  |  |   33|  4.93k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.93k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.93k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 4.93k, False: 1]
  |  |  ------------------
  ------------------
  426|  4.93k|	switch (yych) {
  427|  1.77k|		case 'r': goto yy27;
  ------------------
  |  Branch (427:3): [True: 1.77k, False: 3.16k]
  ------------------
  428|  3.15k|		case 'u': goto yy28;
  ------------------
  |  Branch (428:3): [True: 3.15k, False: 1.77k]
  ------------------
  429|      2|		default: goto yy23;
  ------------------
  |  Branch (429:3): [True: 2, False: 4.93k]
  ------------------
  430|  4.93k|	}
  431|  2.41k|yy25:
  432|  2.41k|	YYSKIP();
  ------------------
  |  |   35|  2.41k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.41k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  433|  2.41k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.41k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.41k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.41k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.41k, False: 1]
  |  |  ------------------
  ------------------
  434|  2.41k|	switch (yych) {
  435|    709|		case '0':
  ------------------
  |  Branch (435:3): [True: 709, False: 1.70k]
  ------------------
  436|  2.15k|		case '1':
  ------------------
  |  Branch (436:3): [True: 1.44k, False: 974]
  ------------------
  437|  2.25k|		case '2':
  ------------------
  |  Branch (437:3): [True: 104, False: 2.31k]
  ------------------
  438|  2.31k|		case '3':
  ------------------
  |  Branch (438:3): [True: 58, False: 2.35k]
  ------------------
  439|  2.32k|		case '4':
  ------------------
  |  Branch (439:3): [True: 12, False: 2.40k]
  ------------------
  440|  2.33k|		case '5':
  ------------------
  |  Branch (440:3): [True: 10, False: 2.40k]
  ------------------
  441|  2.36k|		case '6':
  ------------------
  |  Branch (441:3): [True: 31, False: 2.38k]
  ------------------
  442|  2.39k|		case '7':
  ------------------
  |  Branch (442:3): [True: 29, False: 2.38k]
  ------------------
  443|  2.40k|		case '8':
  ------------------
  |  Branch (443:3): [True: 12, False: 2.40k]
  ------------------
  444|  2.41k|		case '9':
  ------------------
  |  Branch (444:3): [True: 6, False: 2.41k]
  ------------------
  445|  2.41k|			YYSTAGP(context.yyt3);
  ------------------
  |  |   38|  2.41k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  2.41k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  446|  2.41k|			goto yy29;
  447|      3|		default: goto yy23;
  ------------------
  |  Branch (447:3): [True: 3, False: 2.41k]
  ------------------
  448|  2.41k|	}
  449|  5.54k|yy26:
  450|  5.54k|	YYSKIP();
  ------------------
  |  |   35|  5.54k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  5.54k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  451|  5.54k|	yych = YYPEEK();
  ------------------
  |  |   33|  5.54k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  5.54k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  5.54k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 5.54k, False: 1]
  |  |  ------------------
  ------------------
  452|  5.54k|	switch (yych) {
  453|  5.53k|		case '=': goto yy30;
  ------------------
  |  Branch (453:3): [True: 5.53k, False: 4]
  ------------------
  454|      4|		default: goto yy23;
  ------------------
  |  Branch (454:3): [True: 4, False: 5.53k]
  ------------------
  455|  5.54k|	}
  456|  1.77k|yy27:
  457|  1.77k|	YYSKIP();
  ------------------
  |  |   35|  1.77k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.77k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  458|  1.77k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.77k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.77k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.77k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.77k, False: 1]
  |  |  ------------------
  ------------------
  459|  1.77k|	switch (yych) {
  460|  1.77k|		case '=': goto yy31;
  ------------------
  |  Branch (460:3): [True: 1.77k, False: 6]
  ------------------
  461|      6|		default: goto yy23;
  ------------------
  |  Branch (461:3): [True: 6, False: 1.77k]
  ------------------
  462|  1.77k|	}
  463|  3.15k|yy28:
  464|  3.15k|	YYSKIP();
  ------------------
  |  |   35|  3.15k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.15k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  465|  3.15k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.15k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.15k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.15k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.15k, False: 1]
  |  |  ------------------
  ------------------
  466|  3.15k|	switch (yych) {
  467|  3.15k|		case '=': goto yy32;
  ------------------
  |  Branch (467:3): [True: 3.15k, False: 9]
  ------------------
  468|      9|		default: goto yy23;
  ------------------
  |  Branch (468:3): [True: 9, False: 3.15k]
  ------------------
  469|  3.15k|	}
  470|  8.80k|yy29:
  471|  8.80k|	YYSKIP();
  ------------------
  |  |   35|  8.80k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  8.80k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  472|  8.80k|	yych = YYPEEK();
  ------------------
  |  |   33|  8.80k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  8.80k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  8.73k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 8.73k, False: 70]
  |  |  ------------------
  ------------------
  473|  8.80k|	switch (yych) {
  474|    669|		case '0':
  ------------------
  |  Branch (474:3): [True: 669, False: 8.13k]
  ------------------
  475|  1.33k|		case '1':
  ------------------
  |  Branch (475:3): [True: 670, False: 8.13k]
  ------------------
  476|  1.56k|		case '2':
  ------------------
  |  Branch (476:3): [True: 227, False: 8.57k]
  ------------------
  477|  1.81k|		case '3':
  ------------------
  |  Branch (477:3): [True: 253, False: 8.55k]
  ------------------
  478|  2.08k|		case '4':
  ------------------
  |  Branch (478:3): [True: 261, False: 8.54k]
  ------------------
  479|  2.35k|		case '5':
  ------------------
  |  Branch (479:3): [True: 279, False: 8.52k]
  ------------------
  480|  3.56k|		case '6':
  ------------------
  |  Branch (480:3): [True: 1.20k, False: 7.59k]
  ------------------
  481|  3.83k|		case '7':
  ------------------
  |  Branch (481:3): [True: 271, False: 8.53k]
  ------------------
  482|  6.08k|		case '8':
  ------------------
  |  Branch (482:3): [True: 2.25k, False: 6.55k]
  ------------------
  483|  6.39k|		case '9': goto yy29;
  ------------------
  |  Branch (483:3): [True: 303, False: 8.50k]
  ------------------
  484|  2.34k|		case ';':
  ------------------
  |  Branch (484:3): [True: 2.34k, False: 6.46k]
  ------------------
  485|  2.34k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  2.34k|#define YYSTAGN(t) t = NULL
  ------------------
  486|  2.34k|			goto yy33;
  487|     71|		default: goto yy23;
  ------------------
  |  Branch (487:3): [True: 71, False: 8.73k]
  ------------------
  488|  8.80k|	}
  489|  5.53k|yy30:
  490|  5.53k|	YYSKIP();
  ------------------
  |  |   35|  5.53k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  5.53k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  491|  5.53k|	yych = YYPEEK();
  ------------------
  |  |   33|  5.53k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  5.53k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  5.53k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 5.53k, False: 1]
  |  |  ------------------
  ------------------
  492|  5.53k|	switch (yych) {
  493|      1|		case 0x00: goto yy23;
  ------------------
  |  Branch (493:3): [True: 1, False: 5.53k]
  ------------------
  494|    282|		case ';':
  ------------------
  |  Branch (494:3): [True: 282, False: 5.25k]
  ------------------
  495|    282|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    282|#define YYSTAGN(t) t = NULL
  ------------------
  496|    282|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|    282|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    282|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  497|    282|			goto yy33;
  498|  5.25k|		default:
  ------------------
  |  Branch (498:3): [True: 5.25k, False: 283]
  ------------------
  499|  5.25k|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|  5.25k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  5.25k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  500|  5.25k|			goto yy34;
  501|  5.53k|	}
  502|  1.77k|yy31:
  503|  1.77k|	YYSKIP();
  ------------------
  |  |   35|  1.77k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.77k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  504|  1.77k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.77k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.77k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.77k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.77k, False: 1]
  |  |  ------------------
  ------------------
  505|  1.77k|	switch (yych) {
  506|     89|		case '0':
  ------------------
  |  Branch (506:3): [True: 89, False: 1.68k]
  ------------------
  507|    582|		case '1':
  ------------------
  |  Branch (507:3): [True: 493, False: 1.27k]
  ------------------
  508|    744|		case '2':
  ------------------
  |  Branch (508:3): [True: 162, False: 1.60k]
  ------------------
  509|    954|		case '3':
  ------------------
  |  Branch (509:3): [True: 210, False: 1.56k]
  ------------------
  510|  1.28k|		case '4':
  ------------------
  |  Branch (510:3): [True: 329, False: 1.44k]
  ------------------
  511|  1.32k|		case '5':
  ------------------
  |  Branch (511:3): [True: 43, False: 1.72k]
  ------------------
  512|  1.58k|		case '6':
  ------------------
  |  Branch (512:3): [True: 259, False: 1.51k]
  ------------------
  513|  1.69k|		case '7':
  ------------------
  |  Branch (513:3): [True: 112, False: 1.65k]
  ------------------
  514|  1.74k|		case '8':
  ------------------
  |  Branch (514:3): [True: 51, False: 1.72k]
  ------------------
  515|  1.76k|		case '9':
  ------------------
  |  Branch (515:3): [True: 21, False: 1.75k]
  ------------------
  516|  1.76k|			YYSTAGP(context.yyt5);
  ------------------
  |  |   38|  1.76k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.76k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  517|  1.76k|			goto yy35;
  518|      2|		default: goto yy23;
  ------------------
  |  Branch (518:3): [True: 2, False: 1.76k]
  ------------------
  519|  1.77k|	}
  520|  3.15k|yy32:
  521|  3.15k|	YYSKIP();
  ------------------
  |  |   35|  3.15k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.15k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  522|  3.15k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.15k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.15k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.14k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.14k, False: 1]
  |  |  ------------------
  ------------------
  523|  3.15k|	switch (yych) {
  524|      1|		case 0x00: goto yy23;
  ------------------
  |  Branch (524:3): [True: 1, False: 3.14k]
  ------------------
  525|  1.10k|		case ';':
  ------------------
  |  Branch (525:3): [True: 1.10k, False: 2.04k]
  ------------------
  526|  1.10k|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|  1.10k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.10k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  527|  1.10k|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|  1.10k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.10k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  528|  1.10k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  1.10k|#define YYSTAGN(t) t = NULL
  ------------------
  529|  1.10k|			goto yy37;
  530|  2.04k|		default:
  ------------------
  |  Branch (530:3): [True: 2.04k, False: 1.10k]
  ------------------
  531|  2.04k|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|  2.04k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  2.04k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  532|  2.04k|			goto yy36;
  533|  3.15k|	}
  534|  7.87k|yy33:
  535|  7.87k|	YYSKIP();
  ------------------
  |  |   35|  7.87k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  7.87k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  536|  7.87k|	yych = YYPEEK();
  ------------------
  |  |   33|  7.87k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  7.87k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  7.87k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 7.87k, False: 3]
  |  |  ------------------
  ------------------
  537|  7.87k|	switch (yych) {
  538|  1.12k|		case 'b':
  ------------------
  |  Branch (538:3): [True: 1.12k, False: 6.75k]
  ------------------
  539|  2.42k|		case 'g':
  ------------------
  |  Branch (539:3): [True: 1.30k, False: 6.57k]
  ------------------
  540|  3.61k|		case 'i':
  ------------------
  |  Branch (540:3): [True: 1.18k, False: 6.68k]
  ------------------
  541|  7.87k|		case 's': goto yy38;
  ------------------
  |  Branch (541:3): [True: 4.26k, False: 3.61k]
  ------------------
  542|      3|		default: goto yy23;
  ------------------
  |  Branch (542:3): [True: 3, False: 7.87k]
  ------------------
  543|  7.87k|	}
  544|   841k|yy34:
  545|   841k|	YYSKIP();
  ------------------
  |  |   35|   841k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|   841k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  546|   841k|	yych = YYPEEK();
  ------------------
  |  |   33|   841k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   841k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   841k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 841k, False: 6]
  |  |  ------------------
  ------------------
  547|   841k|	switch (yych) {
  548|      6|		case 0x00: goto yy23;
  ------------------
  |  Branch (548:3): [True: 6, False: 841k]
  ------------------
  549|  5.24k|		case ';':
  ------------------
  |  Branch (549:3): [True: 5.24k, False: 835k]
  ------------------
  550|  5.24k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  5.24k|#define YYSTAGN(t) t = NULL
  ------------------
  551|  5.24k|			goto yy33;
  552|   835k|		default: goto yy34;
  ------------------
  |  Branch (552:3): [True: 835k, False: 5.25k]
  ------------------
  553|   841k|	}
  554|  6.18k|yy35:
  555|  6.18k|	YYSKIP();
  ------------------
  |  |   35|  6.18k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  6.18k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  556|  6.18k|	yych = YYPEEK();
  ------------------
  |  |   33|  6.18k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.18k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.12k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 6.12k, False: 59]
  |  |  ------------------
  ------------------
  557|  6.18k|	switch (yych) {
  558|    347|		case '0':
  ------------------
  |  Branch (558:3): [True: 347, False: 5.83k]
  ------------------
  559|    872|		case '1':
  ------------------
  |  Branch (559:3): [True: 525, False: 5.65k]
  ------------------
  560|  1.35k|		case '2':
  ------------------
  |  Branch (560:3): [True: 485, False: 5.69k]
  ------------------
  561|  1.72k|		case '3':
  ------------------
  |  Branch (561:3): [True: 369, False: 5.81k]
  ------------------
  562|  2.10k|		case '4':
  ------------------
  |  Branch (562:3): [True: 378, False: 5.80k]
  ------------------
  563|  2.64k|		case '5':
  ------------------
  |  Branch (563:3): [True: 544, False: 5.63k]
  ------------------
  564|  3.35k|		case '6':
  ------------------
  |  Branch (564:3): [True: 707, False: 5.47k]
  ------------------
  565|  3.66k|		case '7':
  ------------------
  |  Branch (565:3): [True: 312, False: 5.87k]
  ------------------
  566|  3.95k|		case '8':
  ------------------
  |  Branch (566:3): [True: 289, False: 5.89k]
  ------------------
  567|  4.41k|		case '9': goto yy35;
  ------------------
  |  Branch (567:3): [True: 458, False: 5.72k]
  ------------------
  568|  1.69k|		case ';':
  ------------------
  |  Branch (568:3): [True: 1.69k, False: 4.48k]
  ------------------
  569|  1.69k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  1.69k|#define YYSTAGN(t) t = NULL
  ------------------
  570|  1.69k|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|  1.69k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.69k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  571|  1.69k|			goto yy37;
  572|     73|		default: goto yy23;
  ------------------
  |  Branch (572:3): [True: 73, False: 6.11k]
  ------------------
  573|  6.18k|	}
  574|  2.70M|yy36:
  575|  2.70M|	YYSKIP();
  ------------------
  |  |   35|  2.70M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.70M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  576|  2.70M|	yych = YYPEEK();
  ------------------
  |  |   33|  2.70M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.70M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.70M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.70M, False: 9]
  |  |  ------------------
  ------------------
  577|  2.70M|	switch (yych) {
  578|      9|		case 0x00: goto yy23;
  ------------------
  |  Branch (578:3): [True: 9, False: 2.70M]
  ------------------
  579|  2.03k|		case ';':
  ------------------
  |  Branch (579:3): [True: 2.03k, False: 2.70M]
  ------------------
  580|  2.03k|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|  2.03k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  2.03k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  581|  2.03k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  2.03k|#define YYSTAGN(t) t = NULL
  ------------------
  582|  2.03k|			goto yy37;
  583|  2.70M|		default: goto yy36;
  ------------------
  |  Branch (583:3): [True: 2.70M, False: 2.04k]
  ------------------
  584|  2.70M|	}
  585|  4.83k|yy37:
  586|  4.83k|	YYSKIP();
  ------------------
  |  |   35|  4.83k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  4.83k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  587|  4.83k|	yych = YYPEEK();
  ------------------
  |  |   33|  4.83k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.83k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.83k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 4.83k, False: 5]
  |  |  ------------------
  ------------------
  588|  4.83k|	switch (yych) {
  589|    197|		case 'b':
  ------------------
  |  Branch (589:3): [True: 197, False: 4.63k]
  ------------------
  590|    436|		case 'g':
  ------------------
  |  Branch (590:3): [True: 239, False: 4.59k]
  ------------------
  591|    696|		case 'i':
  ------------------
  |  Branch (591:3): [True: 260, False: 4.57k]
  ------------------
  592|  2.42k|		case 's':
  ------------------
  |  Branch (592:3): [True: 1.73k, False: 3.10k]
  ------------------
  593|  2.42k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  2.42k|#define YYSTAGN(t) t = NULL
  ------------------
  594|  2.42k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  2.42k|#define YYSTAGN(t) t = NULL
  ------------------
  595|  2.42k|			goto yy38;
  596|  2.40k|		case 'n': goto yy39;
  ------------------
  |  Branch (596:3): [True: 2.40k, False: 2.43k]
  ------------------
  597|      7|		default: goto yy23;
  ------------------
  |  Branch (597:3): [True: 7, False: 4.82k]
  ------------------
  598|  4.83k|	}
  599|  10.2k|yy38:
  600|  10.2k|	YYSKIP();
  ------------------
  |  |   35|  10.2k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  10.2k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  601|  10.2k|	yych = YYPEEK();
  ------------------
  |  |   33|  10.2k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  10.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  10.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 10.2k, False: 9]
  |  |  ------------------
  ------------------
  602|  10.2k|	switch (yych) {
  603|  10.2k|		case '=': goto yy21;
  ------------------
  |  Branch (603:3): [True: 10.2k, False: 17]
  ------------------
  604|     17|		default: goto yy23;
  ------------------
  |  Branch (604:3): [True: 17, False: 10.2k]
  ------------------
  605|  10.2k|	}
  606|  2.40k|yy39:
  607|  2.40k|	YYSKIP();
  ------------------
  |  |   35|  2.40k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.40k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  608|  2.40k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.40k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.40k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.40k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.40k, False: 1]
  |  |  ------------------
  ------------------
  609|  2.40k|	switch (yych) {
  610|  2.39k|		case 's': goto yy22;
  ------------------
  |  Branch (610:3): [True: 2.39k, False: 7]
  ------------------
  611|      7|		default: goto yy23;
  ------------------
  |  Branch (611:3): [True: 7, False: 2.39k]
  ------------------
  612|  2.40k|	}
  613|  2.40k|}
  614|       |
  615|       |
  616|  31.6k| match:
  617|  31.6k|    if(svu) {
  ------------------
  |  Branch (617:8): [True: 3.12k, False: 28.5k]
  ------------------
  618|       |        /* ServerUri */
  619|  3.12k|        UA_String serverUri = {(size_t)(sve - svu), (UA_Byte*)(uintptr_t)svu};
  620|  3.12k|        size_t i = 0;
  621|  3.12k|        for(; i < serverUrisSize; i++) {
  ------------------
  |  Branch (621:15): [True: 0, False: 3.12k]
  ------------------
  622|      0|            if(UA_String_equal(&serverUri, &serverUris[i]))
  ------------------
  |  Branch (622:16): [True: 0, False: 0]
  ------------------
  623|      0|                break;
  624|      0|        }
  625|  3.12k|        if(i == serverUrisSize) {
  ------------------
  |  Branch (625:12): [True: 3.12k, False: 0]
  ------------------
  626|       |            /* The ServerUri cannot be mapped. Return the entire input as a
  627|       |             * string NodeId. */
  628|  3.12k|            UA_String total = {(size_t)(end - begin), (UA_Byte*)(uintptr_t)begin};
  629|  3.12k|            id->nodeId.identifierType = UA_NODEIDTYPE_STRING;
  630|  3.12k|            return UA_String_copy(&total, &id->nodeId.identifier.string);
  631|  3.12k|        }
  632|      0|        id->serverIndex = (UA_UInt32)i;
  633|  28.5k|    } else if(svr) {
  ------------------
  |  Branch (633:15): [True: 1.69k, False: 26.8k]
  ------------------
  634|       |        /* ServerIndex */
  635|  1.69k|        size_t len = (size_t)(sve - svr);
  636|  1.69k|        if(UA_readNumber((const UA_Byte*)svr, len, &id->serverIndex) != len)
  ------------------
  |  Branch (636:12): [True: 3, False: 1.68k]
  ------------------
  637|      3|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  638|  1.69k|    }
  639|       |
  640|  28.5k|    if(nsu) {
  ------------------
  |  Branch (640:8): [True: 3.34k, False: 25.1k]
  ------------------
  641|       |        /* NamespaceUri */
  642|  3.34k|        UA_String nsuri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  643|  3.34k|        UA_StatusCode res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|  3.34k|#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|  3.34k|        if(id->serverIndex == 0)
  ------------------
  |  Branch (646:12): [True: 3.14k, False: 205]
  ------------------
  647|  3.14k|            res = escapedUri2Index(nsuri, &id->nodeId.namespaceIndex, nsMapping);
  648|  3.34k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  3.34k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (648:12): [True: 3.34k, False: 0]
  ------------------
  649|  3.34k|            res = UA_String_copy(&nsuri, &id->namespaceUri); /* Keep the Uri without mapping */
  650|  3.34k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  3.34k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (650:12): [True: 0, False: 3.34k]
  ------------------
  651|      0|            return res;
  652|  25.1k|    } else if(ns) {
  ------------------
  |  Branch (652:15): [True: 2.33k, False: 22.8k]
  ------------------
  653|       |        /* NamespaceIndex */
  654|  2.33k|        UA_UInt32 tmp;
  655|  2.33k|        size_t len = (size_t)(body - 1 - ns);
  656|  2.33k|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (656:12): [True: 2, False: 2.32k]
  ------------------
  657|      2|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  658|  2.32k|        id->nodeId.namespaceIndex = (UA_UInt16)tmp;
  659|  2.32k|        if(nsMapping)
  ------------------
  |  Branch (659:12): [True: 0, False: 2.32k]
  ------------------
  660|      0|            id->nodeId.namespaceIndex =
  661|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->nodeId.namespaceIndex);
  662|  2.32k|    }
  663|       |
  664|       |    /* From the current position until the end */
  665|  28.5k|    return parse_nodeid_body(&id->nodeId, body, end, idEsc);
  666|  28.5k|}
ua_types_lex.c:parse_qn:
  707|  18.5k|         UA_UInt16 defaultNamespaceIndex) {
  708|  18.5k|    size_t len;
  709|  18.5k|    UA_UInt32 tmp;
  710|  18.5k|    UA_String str;
  711|  18.5k|    UA_StatusCode res;
  712|       |
  713|  18.5k|    LexContext context;
  714|  18.5k|    memset(&context, 0, sizeof(LexContext));
  715|       |
  716|  18.5k|    const u8 *begin = pos;
  717|  18.5k|    UA_QualifiedName_init(qn);
  718|  18.5k|    qn->namespaceIndex = defaultNamespaceIndex;
  719|       |
  720|       |    
  721|  18.5k|{
  722|  18.5k|	u8 yych;
  723|  18.5k|	yych = YYPEEK();
  ------------------
  |  |   33|  18.5k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  18.5k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  16.0k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 16.0k, False: 2.53k]
  |  |  ------------------
  ------------------
  724|  18.5k|	switch (yych) {
  725|  2.54k|		case 0x00:
  ------------------
  |  Branch (725:3): [True: 2.54k, False: 16.0k]
  ------------------
  726|  2.80k|		case ';': goto yy41;
  ------------------
  |  Branch (726:3): [True: 265, False: 18.2k]
  ------------------
  727|  3.18k|		case '0':
  ------------------
  |  Branch (727:3): [True: 3.18k, False: 15.3k]
  ------------------
  728|  4.23k|		case '1':
  ------------------
  |  Branch (728:3): [True: 1.04k, False: 17.5k]
  ------------------
  729|  4.75k|		case '2':
  ------------------
  |  Branch (729:3): [True: 526, False: 18.0k]
  ------------------
  730|  5.66k|		case '3':
  ------------------
  |  Branch (730:3): [True: 906, False: 17.6k]
  ------------------
  731|  6.68k|		case '4':
  ------------------
  |  Branch (731:3): [True: 1.01k, False: 17.5k]
  ------------------
  732|  7.16k|		case '5':
  ------------------
  |  Branch (732:3): [True: 482, False: 18.0k]
  ------------------
  733|  7.97k|		case '6':
  ------------------
  |  Branch (733:3): [True: 814, False: 17.7k]
  ------------------
  734|  8.28k|		case '7':
  ------------------
  |  Branch (734:3): [True: 308, False: 18.2k]
  ------------------
  735|  8.55k|		case '8':
  ------------------
  |  Branch (735:3): [True: 265, False: 18.2k]
  ------------------
  736|  9.16k|		case '9': goto yy44;
  ------------------
  |  Branch (736:3): [True: 611, False: 17.9k]
  ------------------
  737|  6.59k|		default: goto yy43;
  ------------------
  |  Branch (737:3): [True: 6.59k, False: 11.9k]
  ------------------
  738|  18.5k|	}
  739|  2.80k|yy41:
  740|  2.80k|	YYSKIP();
  ------------------
  |  |   35|  2.80k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.80k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  741|  15.6k|yy42:
  742|  15.6k|	{ pos = begin; goto match_name; }
  743|  6.59k|yy43:
  744|  6.59k|	YYSKIP();
  ------------------
  |  |   35|  6.59k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  6.59k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  745|  6.59k|	YYBACKUP();
  ------------------
  |  |   36|  6.59k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  6.59k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  6.59k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  746|  6.59k|	yych = YYPEEK();
  ------------------
  |  |   33|  6.59k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.59k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.07k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 4.07k, False: 2.51k]
  |  |  ------------------
  ------------------
  747|  6.59k|	if (yych <= 0x00) goto yy42;
  ------------------
  |  Branch (747:6): [True: 2.52k, False: 4.07k]
  ------------------
  748|  4.07k|	goto yy46;
  749|  9.16k|yy44:
  750|  9.16k|	YYSKIP();
  ------------------
  |  |   35|  9.16k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  9.16k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  751|  9.16k|	YYBACKUP();
  ------------------
  |  |   36|  9.16k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  9.16k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  9.16k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  752|  9.16k|	yych = YYPEEK();
  ------------------
  |  |   33|  9.16k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  9.16k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  5.57k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 5.57k, False: 3.58k]
  |  |  ------------------
  ------------------
  753|  9.16k|	switch (yych) {
  754|  1.43k|		case '0':
  ------------------
  |  Branch (754:3): [True: 1.43k, False: 7.72k]
  ------------------
  755|  1.95k|		case '1':
  ------------------
  |  Branch (755:3): [True: 515, False: 8.64k]
  ------------------
  756|  2.31k|		case '2':
  ------------------
  |  Branch (756:3): [True: 358, False: 8.80k]
  ------------------
  757|  2.87k|		case '3':
  ------------------
  |  Branch (757:3): [True: 558, False: 8.60k]
  ------------------
  758|  3.07k|		case '4':
  ------------------
  |  Branch (758:3): [True: 201, False: 8.96k]
  ------------------
  759|  3.23k|		case '5':
  ------------------
  |  Branch (759:3): [True: 159, False: 9.00k]
  ------------------
  760|  3.38k|		case '6':
  ------------------
  |  Branch (760:3): [True: 155, False: 9.00k]
  ------------------
  761|  3.52k|		case '7':
  ------------------
  |  Branch (761:3): [True: 135, False: 9.02k]
  ------------------
  762|  3.56k|		case '8':
  ------------------
  |  Branch (762:3): [True: 49, False: 9.11k]
  ------------------
  763|  3.74k|		case '9':
  ------------------
  |  Branch (763:3): [True: 178, False: 8.98k]
  ------------------
  764|  4.51k|		case ':': goto yy50;
  ------------------
  |  Branch (764:3): [True: 769, False: 8.39k]
  ------------------
  765|  4.64k|		default: goto yy42;
  ------------------
  |  Branch (765:3): [True: 4.64k, False: 4.51k]
  ------------------
  766|  9.16k|	}
  767|  14.9M|yy45:
  768|  14.9M|	YYSKIP();
  ------------------
  |  |   35|  14.9M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  14.9M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  769|  14.9M|	yych = YYPEEK();
  ------------------
  |  |   33|  14.9M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  14.9M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  14.9M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 14.9M, False: 2.17k]
  |  |  ------------------
  ------------------
  770|  14.9M|yy46:
  771|  14.9M|	switch (yych) {
  772|  2.17k|		case 0x00: goto yy47;
  ------------------
  |  Branch (772:3): [True: 2.17k, False: 14.9M]
  ------------------
  773|  1.89k|		case ';': goto yy48;
  ------------------
  |  Branch (773:3): [True: 1.89k, False: 14.9M]
  ------------------
  774|  14.9M|		default: goto yy45;
  ------------------
  |  Branch (774:3): [True: 14.9M, False: 4.07k]
  ------------------
  775|  14.9M|	}
  776|  5.64k|yy47:
  777|  5.64k|	YYRESTORE();
  ------------------
  |  |   37|  5.64k|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|  5.64k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|  5.64k|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  778|  5.64k|	goto yy42;
  779|  1.89k|yy48:
  780|  1.89k|	YYSKIP();
  ------------------
  |  |   35|  1.89k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.89k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  781|  1.89k|	{ goto match_uri; }
  782|  45.3k|yy49:
  783|  45.3k|	YYSKIP();
  ------------------
  |  |   35|  45.3k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  45.3k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  784|  45.3k|	yych = YYPEEK();
  ------------------
  |  |   33|  45.3k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  45.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  44.0k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 44.0k, False: 1.31k]
  |  |  ------------------
  ------------------
  785|  49.8k|yy50:
  786|  49.8k|	switch (yych) {
  787|  15.4k|		case '0':
  ------------------
  |  Branch (787:3): [True: 15.4k, False: 34.4k]
  ------------------
  788|  17.1k|		case '1':
  ------------------
  |  Branch (788:3): [True: 1.71k, False: 48.1k]
  ------------------
  789|  20.0k|		case '2':
  ------------------
  |  Branch (789:3): [True: 2.91k, False: 46.9k]
  ------------------
  790|  22.6k|		case '3':
  ------------------
  |  Branch (790:3): [True: 2.57k, False: 47.2k]
  ------------------
  791|  25.9k|		case '4':
  ------------------
  |  Branch (791:3): [True: 3.27k, False: 46.5k]
  ------------------
  792|  27.8k|		case '5':
  ------------------
  |  Branch (792:3): [True: 1.90k, False: 47.9k]
  ------------------
  793|  30.8k|		case '6':
  ------------------
  |  Branch (793:3): [True: 3.06k, False: 46.8k]
  ------------------
  794|  41.1k|		case '7':
  ------------------
  |  Branch (794:3): [True: 10.2k, False: 39.6k]
  ------------------
  795|  42.5k|		case '8':
  ------------------
  |  Branch (795:3): [True: 1.42k, False: 48.4k]
  ------------------
  796|  45.3k|		case '9': goto yy49;
  ------------------
  |  Branch (796:3): [True: 2.81k, False: 47.0k]
  ------------------
  797|  1.04k|		case ':': goto yy51;
  ------------------
  |  Branch (797:3): [True: 1.04k, False: 48.8k]
  ------------------
  798|  3.47k|		default: goto yy47;
  ------------------
  |  Branch (798:3): [True: 3.47k, False: 46.3k]
  ------------------
  799|  49.8k|	}
  800|  1.04k|yy51:
  801|  1.04k|	YYSKIP();
  ------------------
  |  |   35|  1.04k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.04k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  802|  1.04k|	{ goto match_index; }
  803|  49.8k|}
  804|       |
  805|       |
  806|  1.04k| match_index:
  807|  1.04k|    len = (size_t)(pos - 1 - begin);
  808|  1.04k|    if(UA_readNumber((const UA_Byte*)begin, len, &tmp) != len)
  ------------------
  |  Branch (808:8): [True: 3, False: 1.04k]
  ------------------
  809|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  810|  1.04k|    qn->namespaceIndex = (UA_UInt16)tmp;
  811|  1.04k|    if(nsMapping)
  ------------------
  |  Branch (811:8): [True: 0, False: 1.04k]
  ------------------
  812|      0|        qn->namespaceIndex =
  813|      0|            UA_NamespaceMapping_remote2Local(nsMapping, qn->namespaceIndex);
  814|  1.04k|    goto match_name;
  815|       |
  816|  1.89k| match_uri:
  817|  1.89k|    str.length = (size_t)(pos - 1 - begin);
  818|  1.89k|    str.data = (UA_Byte*)(uintptr_t)begin;
  819|  1.89k|    res = escapedUri2Index(str, &qn->namespaceIndex, nsMapping);
  820|  1.89k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  1.89k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (820:8): [True: 1.89k, False: 0]
  ------------------
  821|  1.89k|        pos = begin; /* Use the entire string for the name */
  822|       |
  823|  18.5k| match_name:
  824|  18.5k|    str.length = (size_t)(end - pos);
  825|  18.5k|    str.data = (UA_Byte*)(uintptr_t)pos;
  826|  18.5k|    res = UA_String_copy(&str, &qn->name);
  827|  18.5k|    if(UA_LIKELY(res == UA_STATUSCODE_GOOD))
  ------------------
  |  |  344|  18.5k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (344:23): [True: 18.5k, False: 0]
  |  |  ------------------
  ------------------
  828|  18.5k|        res = UA_String_unescape(&qn->name, false, escName);
  829|  18.5k|    return res;
  830|  1.89k|}

UA_readNumberWithBase:
  122|  31.0k|                      UA_UInt32 *number, UA_Byte base) {
  123|  31.0k|    UA_assert(buf);
  ------------------
  |  |  248|  31.0k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (123:5): [True: 31.0k, False: 0]
  ------------------
  124|  31.0k|    UA_assert(number);
  ------------------
  |  |  248|  31.0k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (124:5): [True: 31.0k, False: 0]
  ------------------
  125|       |    /* Accumulate in 64 bits. n stays below 2^32 between the digits, so n * base
  126|       |     * + digit cannot overflow for any base up to 36. */
  127|  31.0k|    u64 n = 0;
  128|  31.0k|    size_t progress = 0;
  129|       |    /* read numbers until the end or a non-number character appears */
  130|  1.63M|    while(progress < buflen) {
  ------------------
  |  Branch (130:11): [True: 1.60M, False: 31.0k]
  ------------------
  131|  1.60M|        u8 c = buf[progress];
  132|  1.60M|        u32 digit;
  133|  1.60M|        if(c >= '0' && c <= '9' && c <= '0' + (base-1))
  ------------------
  |  Branch (133:12): [True: 1.60M, False: 13]
  |  Branch (133:24): [True: 1.60M, False: 657]
  |  Branch (133:36): [True: 1.60M, False: 0]
  ------------------
  134|  1.60M|           digit = c - '0';
  135|    670|        else if(base > 9 && c >= 'a' && c <= 'z' && c <= 'a' + (base-11))
  ------------------
  |  Branch (135:17): [True: 670, False: 0]
  |  Branch (135:29): [True: 234, False: 436]
  |  Branch (135:41): [True: 219, False: 15]
  |  Branch (135:53): [True: 207, False: 12]
  ------------------
  136|    207|           digit = c-'a' + 10;
  137|    463|        else if(base > 9 && c >= 'A' && c <= 'Z' && c <= 'A' + (base-11))
  ------------------
  |  Branch (137:17): [True: 463, False: 0]
  |  Branch (137:29): [True: 446, False: 17]
  |  Branch (137:41): [True: 417, False: 29]
  |  Branch (137:53): [True: 402, False: 15]
  ------------------
  138|    402|           digit = c-'A' + 10;
  139|     61|        else
  140|     61|           break;
  141|  1.60M|        n = (n * base) + digit;
  142|       |        /* The number does not fit into 32 bits. Report no valid digits
  143|       |         * instead of returning a wrapped value. */
  144|  1.60M|        if(n > UA_UINT32_MAX)
  ------------------
  |  |  110|  1.60M|#define UA_UINT32_MAX 4294967295UL
  ------------------
  |  Branch (144:12): [True: 19, False: 1.60M]
  ------------------
  145|     19|            return 0;
  146|  1.60M|        ++progress;
  147|  1.60M|    }
  148|  31.0k|    *number = (u32)n;
  149|  31.0k|    return progress;
  150|  31.0k|}
UA_readNumber:
  153|  15.6k|UA_readNumber(const UA_Byte *buf, size_t buflen, UA_UInt32 *number) {
  154|  15.6k|    return UA_readNumberWithBase(buf, buflen, number, 10);
  155|  15.6k|}
encodeDateTime:
  383|    366|encodeDateTime(const UA_DateTime dt, UA_String *output) {
  384|    366|    char buffer[UA_DATETIME_LENGTH];
  385|    366|    char *pos = buffer;
  386|       |
  387|    366|    if(output->length > 0) {
  ------------------
  |  Branch (387:8): [True: 366, False: 0]
  ------------------
  388|    366|        if(output->length < UA_DATETIME_LENGTH)
  ------------------
  |  |  380|    366|#define UA_DATETIME_LENGTH 40
  ------------------
  |  Branch (388:12): [True: 0, False: 366]
  ------------------
  389|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  390|    366|        pos = (char*)output->data;
  391|    366|    }
  392|       |
  393|       |    /* Format: -yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS'Z' is used. max 31 bytes.
  394|       |     * Note the optional minus for negative years. */
  395|    366|    UA_DateTimeStruct tSt = UA_DateTime_toStruct(dt);
  396|    366|    pos += printNum(tSt.year, pos, 4);
  397|    366|    *(pos++) = '-';
  398|    366|    pos += printNum(tSt.month, pos, 2);
  399|    366|    *(pos++) = '-';
  400|    366|    pos += printNum(tSt.day, pos, 2);
  401|    366|    *(pos++) = 'T';
  402|    366|    pos += printNum(tSt.hour, pos, 2);
  403|    366|    *(pos++) = ':';
  404|    366|    pos += printNum(tSt.min, pos, 2);
  405|    366|    *(pos++) = ':';
  406|    366|    pos += printNum(tSt.sec, pos, 2);
  407|    366|    *(pos++) = '.';
  408|    366|    pos += printNum(tSt.milliSec, pos, 3);
  409|    366|    pos += printNum(tSt.microSec, pos, 3);
  410|    366|    pos += printNum(tSt.nanoSec, pos, 3);
  411|       |
  412|       |    /* Remove trailing zeros */
  413|    366|    pos--;
  414|  3.14k|    while(*pos == '0')
  ------------------
  |  Branch (414:11): [True: 2.77k, False: 366]
  ------------------
  415|  2.77k|        pos--;
  416|    366|    if(*pos == '.')
  ------------------
  |  Branch (416:8): [True: 228, False: 138]
  ------------------
  417|    228|        pos--;
  418|       |
  419|    366|    pos++;
  420|    366|    *(pos++) = 'Z';
  421|       |
  422|    366|    if(output->length > 0) {
  ------------------
  |  Branch (422:8): [True: 366, False: 0]
  ------------------
  423|    366|        output->length = (size_t)(pos - (char*)output->data);
  424|    366|    } else {
  425|      0|        UA_String str = {(size_t)(pos - buffer), (UA_Byte*)buffer};
  426|      0|        return UA_String_copy(&str, output);
  427|      0|    }
  428|       |
  429|    366|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    366|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  430|    366|}
UA_String_unescape:
  881|  41.5k|UA_String_unescape(UA_String *str, UA_Boolean copyEscape, UA_Escaping esc) {
  882|  41.5k|    if(esc == UA_ESCAPING_NONE)
  ------------------
  |  Branch (882:8): [True: 41.5k, False: 0]
  ------------------
  883|  41.5k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  41.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  884|       |
  885|       |    /* Does the string need escaping? */
  886|      0|    UA_String tmp;
  887|      0|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  888|      0|    u8 *pos = str->data;
  889|      0|    u8 *end = str->data + str->length;
  890|      0|    u8 escape_char = (esc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (890:23): [True: 0, False: 0]
  ------------------
  891|      0|                      esc == UA_ESCAPING_PERCENT_EXTENDED) ? '%' : '&';
  ------------------
  |  Branch (891:23): [True: 0, False: 0]
  ------------------
  892|      0|    for(; pos < end; pos++) {
  ------------------
  |  Branch (892:11): [True: 0, False: 0]
  ------------------
  893|      0|        if(*pos == escape_char)
  ------------------
  |  Branch (893:12): [True: 0, False: 0]
  ------------------
  894|      0|            goto escape;
  895|      0|    }
  896|       |
  897|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  898|       |
  899|      0| escape:
  900|      0|    if(copyEscape) {
  ------------------
  |  Branch (900:8): [True: 0, False: 0]
  ------------------
  901|      0|        res = UA_String_copy(str, &tmp);
  902|      0|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (902:12): [True: 0, False: 0]
  ------------------
  903|      0|            return res;
  904|      0|        pos = tmp.data;
  905|      0|        end = tmp.data + tmp.length;
  906|      0|    }
  907|       |
  908|      0|    u8 byte = 0;
  909|      0|    u8 *writepos = pos;
  910|       |
  911|      0|    res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  912|      0|    if(esc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (912:8): [True: 0, False: 0]
  ------------------
  913|      0|       esc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (913:8): [True: 0, False: 0]
  ------------------
  914|       |        /* Percent-Escaping */
  915|      0|        for(; pos < end; pos++) {
  ------------------
  |  Branch (915:15): [True: 0, False: 0]
  ------------------
  916|      0|            if(*pos == '%') {
  ------------------
  |  Branch (916:16): [True: 0, False: 0]
  ------------------
  917|      0|                if(pos + 2 >= end || !isHex(pos[1]) || !isHex(pos[2]))
  ------------------
  |  Branch (917:20): [True: 0, False: 0]
  |  Branch (917:38): [True: 0, False: 0]
  |  Branch (917:56): [True: 0, False: 0]
  ------------------
  918|      0|                    goto out;
  919|      0|                if(pos[1] >= 'a')
  ------------------
  |  Branch (919:20): [True: 0, False: 0]
  ------------------
  920|      0|                    byte = pos[1] - ('a' - 10);
  921|      0|                else if(pos[1] >= 'A')
  ------------------
  |  Branch (921:25): [True: 0, False: 0]
  ------------------
  922|      0|                    byte = pos[1] - ('A' - 10);
  923|      0|                else
  924|      0|                    byte = pos[1] - '0';
  925|      0|                byte <<= 4;
  926|       |
  927|      0|                if(pos[2] >= 'a')
  ------------------
  |  Branch (927:20): [True: 0, False: 0]
  ------------------
  928|      0|                    byte += (u8)(pos[2] - ('a' - 10));
  929|      0|                else if(pos[2] >= 'A')
  ------------------
  |  Branch (929:25): [True: 0, False: 0]
  ------------------
  930|      0|                    byte += (u8)(pos[2] - ('A' - 10));
  931|      0|                else
  932|      0|                    byte += (u8)(pos[2] - '0');
  933|       |
  934|      0|                pos += 2;
  935|      0|                *writepos++ = byte;
  936|      0|                continue;
  937|      0|            }
  938|      0|            *writepos++ = *pos;
  939|      0|        }
  940|      0|    } else {
  941|       |        /* And-Escaping */
  942|      0|        for(; pos < end; pos++) {
  ------------------
  |  Branch (942:15): [True: 0, False: 0]
  ------------------
  943|      0|            if(*pos == '&') {
  ------------------
  |  Branch (943:16): [True: 0, False: 0]
  ------------------
  944|      0|                pos++;
  945|      0|                if(pos == end)
  ------------------
  |  Branch (945:20): [True: 0, False: 0]
  ------------------
  946|      0|                    goto out;
  947|      0|            }
  948|      0|            *writepos++ = *pos;
  949|      0|        }
  950|      0|    }
  951|      0|    res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  952|       |
  953|      0| out:
  954|      0|    if(copyEscape) {
  ------------------
  |  Branch (954:8): [True: 0, False: 0]
  ------------------
  955|      0|        tmp.length = (size_t)(writepos - tmp.data);
  956|      0|        if(tmp.length == 0)
  ------------------
  |  Branch (956:12): [True: 0, False: 0]
  ------------------
  957|      0|            UA_String_clear(&tmp);
  958|      0|        if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (958:12): [True: 0, False: 0]
  ------------------
  959|      0|            *str = tmp;
  960|      0|        else
  961|      0|            UA_String_clear(&tmp);
  962|      0|    } else if(res == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (962:15): [True: 0, False: 0]
  ------------------
  963|      0|        str->length = (size_t)(writepos - str->data);
  964|      0|    }
  965|      0|    return res;
  966|      0|}
UA_String_escapedSize:
  972|  41.6k|UA_String_escapedSize(const UA_String s, UA_Escaping esc) {
  973|  41.6k|    if(esc == UA_ESCAPING_NONE)
  ------------------
  |  Branch (973:8): [True: 36.9k, False: 4.71k]
  ------------------
  974|  36.9k|        return s.length;
  975|       |
  976|       |    /* Find out the overhead from escaping */
  977|  4.71k|    size_t overhead = 0;
  978|  1.04M|    for(size_t j = 0; j < s.length; j++) {
  ------------------
  |  Branch (978:23): [True: 1.03M, False: 4.71k]
  ------------------
  979|  1.03M|        if(esc == UA_ESCAPING_AND_EXTENDED)
  ------------------
  |  Branch (979:12): [True: 0, False: 1.03M]
  ------------------
  980|      0|            overhead += isReservedAndExtended(s.data[j]);
  981|  1.03M|        else if(esc == UA_ESCAPING_AND)
  ------------------
  |  Branch (981:17): [True: 0, False: 1.03M]
  ------------------
  982|      0|            overhead += isReservedAnd(s.data[j]);
  983|  1.03M|        else if(esc == UA_ESCAPING_PERCENT)
  ------------------
  |  Branch (983:17): [True: 1.03M, False: 0]
  ------------------
  984|  1.03M|            overhead += (isReservedPercent(s.data[j]) ? 2 : 0);
  ------------------
  |  Branch (984:26): [True: 0, False: 1.03M]
  ------------------
  985|      0|        else /* if(esc == UA_ESCAPING_PERCENT_EXTENDED) */
  986|      0|            overhead += (isReservedPercentExtended(s.data[j]) ? 2 : 0);
  ------------------
  |  Branch (986:26): [True: 0, False: 0]
  ------------------
  987|  1.03M|    }
  988|       |
  989|  4.71k|    return s.length + overhead;
  990|  41.6k|}
UA_String_escapeInsert:
  993|  41.6k|UA_String_escapeInsert(u8 *pos, const UA_String s2, UA_Escaping esc) {
  994|  41.6k|    u8 *begin = pos;
  995|       |
  996|  41.6k|    if(esc == UA_ESCAPING_NONE) {
  ------------------
  |  Branch (996:8): [True: 36.9k, False: 4.71k]
  ------------------
  997|  11.8M|        for(size_t j = 0; j < s2.length; j++)
  ------------------
  |  Branch (997:27): [True: 11.8M, False: 36.9k]
  ------------------
  998|  11.8M|            *pos++ = s2.data[j];
  999|  36.9k|    } else if(esc == UA_ESCAPING_PERCENT || esc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (999:15): [True: 4.71k, False: 0]
  |  Branch (999:45): [True: 0, False: 0]
  ------------------
 1000|  1.04M|        for(size_t j = 0; j < s2.length; j++) {
  ------------------
  |  Branch (1000:27): [True: 1.03M, False: 4.71k]
  ------------------
 1001|  1.03M|            UA_Boolean reserved = (esc == UA_ESCAPING_PERCENT_EXTENDED) ?
  ------------------
  |  Branch (1001:35): [True: 0, False: 1.03M]
  ------------------
 1002|  1.03M|                isReservedPercentExtended(s2.data[j]) : isReservedPercent(s2.data[j]);
 1003|  1.03M|            if(UA_LIKELY(!reserved)) {
  ------------------
  |  |  344|  1.03M|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (344:23): [True: 1.03M, False: 0]
  |  |  ------------------
  ------------------
 1004|  1.03M|                *pos++ = s2.data[j];
 1005|  1.03M|            } else {
 1006|      0|                *pos++ = '%';
 1007|      0|                *pos++ = hexchars[s2.data[j] >> 4];
 1008|      0|                *pos++ = hexchars[s2.data[j] & 0x0f];
 1009|      0|            }
 1010|  1.03M|        }
 1011|  4.71k|    } else {
 1012|      0|        for(size_t j = 0; j < s2.length; j++) {
  ------------------
  |  Branch (1012:27): [True: 0, False: 0]
  ------------------
 1013|      0|            UA_Boolean reserved = (esc == UA_ESCAPING_AND_EXTENDED) ?
  ------------------
  |  Branch (1013:35): [True: 0, False: 0]
  ------------------
 1014|      0|                isReservedAndExtended(s2.data[j]) : isReservedAnd(s2.data[j]);
 1015|      0|            if(reserved)
  ------------------
  |  Branch (1015:16): [True: 0, False: 0]
  ------------------
 1016|      0|                *pos++ = '&';
 1017|      0|            *pos++ = s2.data[j];
 1018|      0|        }
 1019|      0|    }
 1020|       |
 1021|  41.6k|    return (size_t)(pos - begin);
 1022|  41.6k|}
ua_util.c:printNum:
  358|  3.29k|printNum(i32 n, char *pos, u8 min_digits) {
  359|  3.29k|    char digits[10];
  360|  3.29k|    u8 len = 0;
  361|       |    /* Handle negative values */
  362|  3.29k|    if(n < 0) {
  ------------------
  |  Branch (362:8): [True: 0, False: 3.29k]
  ------------------
  363|      0|        pos[len++] = '-';
  364|      0|        n = -n;
  365|      0|    }
  366|       |
  367|       |    /* Extract the digits */
  368|  3.29k|    u8 i = 0;
  369|  11.7k|    for(; i < min_digits || n > 0; i++) {
  ------------------
  |  Branch (369:11): [True: 8.41k, False: 3.29k]
  |  Branch (369:29): [True: 0, False: 3.29k]
  ------------------
  370|  8.41k|        digits[i] = (char)((n % 10) + '0');
  371|  8.41k|        n /= 10;
  372|  8.41k|    }
  373|       |
  374|       |    /* Print in reverse order and return */
  375|  11.7k|    for(; i > 0; i--)
  ------------------
  |  Branch (375:11): [True: 8.41k, False: 3.29k]
  ------------------
  376|  8.41k|        pos[len++] = digits[i-1];
  377|  3.29k|    return len;
  378|  3.29k|}

ua_util.c:isReservedPercent:
   94|  2.07M|isReservedPercent(u8 c) {
   95|  2.07M|    return (c == ';'  || c == '%' || c <= ' ' || c == 127);
  ------------------
  |  Branch (95:13): [True: 0, False: 2.07M]
  |  Branch (95:26): [True: 0, False: 2.07M]
  |  Branch (95:38): [True: 0, False: 2.07M]
  |  Branch (95:50): [True: 0, False: 2.07M]
  ------------------
   96|  2.07M|}

LLVMFuzzerTestOneInput:
   13|  6.99k|LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
   14|  6.99k|    UA_ByteString buf;
   15|  6.99k|    buf.data = (UA_Byte*)data;
   16|  6.99k|    buf.length = size;
   17|       |
   18|  6.99k|    UA_Variant value;
   19|  6.99k|    UA_Variant_init(&value);
   20|       |
   21|  6.99k|    UA_StatusCode retval = UA_decodeJson(&buf, &value, &UA_TYPES[UA_TYPES_VARIANT], NULL);
  ------------------
  |  |  810|  6.99k|#define UA_TYPES_VARIANT 23
  ------------------
   22|  6.99k|    if(retval != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.99k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (22:8): [True: 3.51k, False: 3.47k]
  ------------------
   23|  3.51k|        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|  3.47k|    size_t jsonSize = UA_calcSizeJson(&value, &UA_TYPES[UA_TYPES_VARIANT], NULL);
  ------------------
  |  |  810|  3.47k|#define UA_TYPES_VARIANT 23
  ------------------
   28|  3.47k|    if(jsonSize == 0) {
  ------------------
  |  Branch (28:8): [True: 2, False: 3.47k]
  ------------------
   29|      2|        UA_Variant_clear(&value);
   30|      2|        return 0;
   31|      2|    }
   32|       |
   33|  3.47k|    UA_ByteString buf2 = UA_BYTESTRING_NULL;
   34|  3.47k|    retval = UA_ByteString_allocBuffer(&buf2, jsonSize);
   35|  3.47k|    if(retval != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  3.47k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (35:8): [True: 0, False: 3.47k]
  ------------------
   36|      0|        UA_Variant_clear(&value);
   37|      0|        return 0;
   38|      0|    }
   39|       |
   40|  3.47k|    retval = UA_encodeJson(&value, &UA_TYPES[UA_TYPES_VARIANT], &buf2, NULL);
  ------------------
  |  |  810|  3.47k|#define UA_TYPES_VARIANT 23
  ------------------
   41|  3.47k|    UA_assert(retval == UA_STATUSCODE_GOOD);
  ------------------
  |  |  248|  3.47k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (41:5): [True: 3.47k, False: 0]
  ------------------
   42|       |
   43|  3.47k|    UA_Variant value2;
   44|  3.47k|    UA_Variant_init(&value2);
   45|  3.47k|    retval = UA_decodeJson(&buf2, &value2, &UA_TYPES[UA_TYPES_VARIANT], NULL);
  ------------------
  |  |  810|  3.47k|#define UA_TYPES_VARIANT 23
  ------------------
   46|  3.47k|    if(retval == UA_STATUSCODE_BADOUTOFMEMORY) {
  ------------------
  |  |   32|  3.47k|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  |  Branch (46:8): [True: 0, False: 3.47k]
  ------------------
   47|      0|        UA_Variant_clear(&value);
   48|      0|        UA_ByteString_clear(&buf2);
   49|      0|        return 0;
   50|      0|    }
   51|  3.47k|    UA_assert(retval == UA_STATUSCODE_GOOD);
  ------------------
  |  |  248|  3.47k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (51:5): [True: 3.47k, False: 0]
  ------------------
   52|       |
   53|  3.47k|    UA_assert(UA_order(&value, &value2, &UA_TYPES[UA_TYPES_VARIANT]) == UA_ORDER_EQ);
  ------------------
  |  |  248|  3.47k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (53:5): [True: 3.47k, False: 0]
  ------------------
   54|       |
   55|  3.47k|    UA_ByteString buf3 = UA_BYTESTRING_NULL;
   56|  3.47k|    retval = UA_ByteString_allocBuffer(&buf3, jsonSize);
   57|  3.47k|    if(retval != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  3.47k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (57:8): [True: 0, False: 3.47k]
  ------------------
   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|  3.47k|    retval = UA_encodeJson(&value2, &UA_TYPES[UA_TYPES_VARIANT], &buf3, NULL);
  ------------------
  |  |  810|  3.47k|#define UA_TYPES_VARIANT 23
  ------------------
   65|  3.47k|    UA_assert(retval == UA_STATUSCODE_GOOD);
  ------------------
  |  |  248|  3.47k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (65:5): [True: 3.47k, False: 0]
  ------------------
   66|       |
   67|  3.47k|    UA_assert(buf2.length == buf3.length);
  ------------------
  |  |  248|  3.47k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (67:5): [True: 3.47k, False: 0]
  ------------------
   68|  3.47k|    UA_assert(memcmp(buf2.data, buf3.data, buf2.length) == 0);
  ------------------
  |  |  248|  3.47k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (68:5): [True: 3.47k, False: 0]
  ------------------
   69|       |
   70|  3.47k|    UA_Variant_clear(&value);
   71|  3.47k|    UA_Variant_clear(&value2);
   72|  3.47k|    UA_ByteString_clear(&buf2);
   73|  3.47k|    UA_ByteString_clear(&buf3);
   74|  3.47k|    return 0;
   75|  3.47k|}

fuzz_json_decode_encode.cc:_ZL15UA_Variant_initP10UA_Variant:
  138|  10.4k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_json_decode_encode.cc:_ZL16UA_Variant_clearP10UA_Variant:
  138|  6.94k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_json_decode_encode.cc:_ZL19UA_ByteString_clearP9UA_String:
  138|  6.94k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_ByteString_init:
  138|   105k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_String_copy:
  138|  48.9k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_NodeId_clear:
  138|    242|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_ExpandedNodeId_clear:
  138|    280|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_QualifiedName_clear:
  138|      3|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_QualifiedName_init:
  138|  18.5k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_clear:
  138|   164k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_init:
  138|    572|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_init:
  138|  68.6k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_init:
  138|  10.2k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_clear:
  138|  1.67k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_new:
  138|    454|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_clear:
  138|    134|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl

UA_StatusCode_name:
  275|    195|const char * UA_StatusCode_name(UA_StatusCode code) {
  276|  34.9k|    for (size_t i = 0; i < statusCodeDescriptionsSize; ++i) {
  ------------------
  |  Branch (276:24): [True: 34.8k, False: 99]
  ------------------
  277|  34.8k|        if (UA_StatusCode_isEqualTop(statusCodeDescriptions[i].code,code))
  ------------------
  |  |  199|  34.8k|#define UA_StatusCode_isEqualTop(s1, s2) UA_StatusCode_equalTop(s1, s2)
  |  |  ------------------
  |  |  |  Branch (199:42): [True: 96, False: 34.7k]
  |  |  ------------------
  ------------------
  278|     96|            return statusCodeDescriptions[i].name;
  279|  34.8k|    }
  280|     99|    return statusCodeDescriptions[statusCodeDescriptionsSize-1].name;
  281|    195|}

