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

cj5_parse:
  305|  5.91k|          cj5_options *options) {
  306|  5.91k|    cj5_result r;
  307|  5.91k|    cj5__parser parser;
  308|  5.91k|    memset(&parser, 0x0, sizeof(parser));
  309|  5.91k|    parser.curr_tok_idx = 0;
  310|  5.91k|    parser.json5 = json5;
  311|  5.91k|    parser.len = len;
  312|  5.91k|    parser.tokens = tokens;
  313|  5.91k|    parser.max_tokens = max_tokens;
  314|       |
  315|  5.91k|    if(options)
  ------------------
  |  Branch (315:8): [True: 5.91k, False: 0]
  ------------------
  316|  5.91k|        parser.stop_early = options->stop_early;
  317|       |
  318|  5.91k|    unsigned short depth = 0; // Nesting depth zero means "outside the root object"
  319|  5.91k|    char nesting[CJ5_MAX_NESTING]; // Contains either '\0', '{' or '[' for the
  320|       |                                   // type of nesting at each depth. '\0'
  321|       |                                   // indicates we are out of the root object.
  322|  5.91k|    char next[CJ5_MAX_NESTING];    // Next content to parse: 'k' (key), ':', 'v'
  323|       |                                   // (value) or ',' (comma).
  324|  5.91k|    next[0] = 'v';  // The root is a "value" (object, array or primitive). If we
  325|       |                    // detect a colon after the first value then everything is
  326|       |                    // wrapped into a "virtual root object" and the parsing is
  327|       |                    // restarted.
  328|  5.91k|    nesting[0] = 0; // Becomes '{' if there is a virtual root object
  329|       |
  330|  5.91k|    cj5_token *token = NULL; // The current token
  331|       |
  332|  6.89k| start_parsing:
  333|  96.1M|    for(; parser.pos < len; parser.pos++) {
  ------------------
  |  Branch (333:11): [True: 96.1M, False: 5.83k]
  ------------------
  334|  96.1M|        char c = json5[parser.pos];
  335|  96.1M|        switch(c) {
  336|  51.0k|        case '\n': // Skip newline and whitespace
  ------------------
  |  Branch (336:9): [True: 51.0k, False: 96.1M]
  ------------------
  337|  51.3k|        case '\r':
  ------------------
  |  Branch (337:9): [True: 390, False: 96.1M]
  ------------------
  338|  51.5k|        case '\t':
  ------------------
  |  Branch (338:9): [True: 170, False: 96.1M]
  ------------------
  339|  52.1k|        case ' ':
  ------------------
  |  Branch (339:9): [True: 573, False: 96.1M]
  ------------------
  340|  52.1k|            break;
  341|       |
  342|    144|        case '#': // Skip comment
  ------------------
  |  Branch (342:9): [True: 144, False: 96.1M]
  ------------------
  343|  22.7k|        case '/':
  ------------------
  |  Branch (343:9): [True: 22.6k, False: 96.1M]
  ------------------
  344|  22.7k|            cj5__skip_comment(&parser);
  345|  22.7k|            if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (345:16): [True: 19.6k, False: 3.13k]
  ------------------
  346|  19.6k|               parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (346:16): [True: 34, False: 19.6k]
  ------------------
  347|     34|                goto finish;
  348|  22.7k|            break;
  349|       |
  350|  4.43M|        case '{': // Open an object or array
  ------------------
  |  Branch (350:9): [True: 4.43M, False: 91.7M]
  ------------------
  351|  4.48M|        case '[':
  ------------------
  |  Branch (351:9): [True: 43.5k, False: 96.1M]
  ------------------
  352|       |            // Check the nesting depth
  353|  4.48M|            if(depth + 1 >= CJ5_MAX_NESTING) {
  ------------------
  |  |   52|  4.48M|#define CJ5_MAX_NESTING 32
  ------------------
  |  Branch (353:16): [True: 1, False: 4.48M]
  ------------------
  354|      1|                parser.error = CJ5_ERROR_INVALID;
  355|      1|                goto finish;
  356|      1|            }
  357|       |
  358|       |            // Correct next?
  359|  4.48M|            if(next[depth] != 'v') {
  ------------------
  |  Branch (359:16): [True: 8, False: 4.48M]
  ------------------
  360|      8|                parser.error = CJ5_ERROR_INVALID;
  361|      8|                goto finish;
  362|      8|            }
  363|       |
  364|  4.48M|            depth++; // Increase the nesting depth
  365|  4.48M|            nesting[depth] = c; // Set the nesting type
  366|  4.48M|            next[depth] = (c == '{') ? 'k' : 'v'; // next is either a key or a value
  ------------------
  |  Branch (366:27): [True: 4.43M, False: 43.5k]
  ------------------
  367|       |
  368|       |            // Create a token for the object or array
  369|  4.48M|            token = cj5__alloc_token(&parser);
  370|  4.48M|            if(token) {
  ------------------
  |  Branch (370:16): [True: 2.29M, False: 2.18M]
  ------------------
  371|  2.29M|                token->parent_id = parser.curr_tok_idx;
  372|  2.29M|                token->type = (c == '{') ? CJ5_TOKEN_OBJECT : CJ5_TOKEN_ARRAY;
  ------------------
  |  Branch (372:31): [True: 2.27M, False: 23.8k]
  ------------------
  373|  2.29M|                token->start = parser.pos;
  374|  2.29M|                token->size = 0;
  375|  2.29M|                parser.curr_tok_idx = parser.token_count - 1; // The new curr_tok_idx
  376|       |                                                              // is for this token
  377|  2.29M|            }
  378|  4.48M|            break;
  379|       |
  380|  4.43M|        case '}': // Close an object or array
  ------------------
  |  Branch (380:9): [True: 4.43M, False: 91.7M]
  ------------------
  381|  4.48M|        case ']':
  ------------------
  |  Branch (381:9): [True: 43.3k, False: 96.1M]
  ------------------
  382|       |            // Check the nesting depth. Note that a "virtual root object" at
  383|       |            // depth zero must not be closed.
  384|  4.48M|            if(depth == 0) {
  ------------------
  |  Branch (384:16): [True: 4, False: 4.48M]
  ------------------
  385|      4|                parser.error = CJ5_ERROR_INVALID;
  386|      4|                goto finish;
  387|      4|            }
  388|       |
  389|       |            // Check and adjust the nesting. Note that ']' - '[' == 2 and '}' -
  390|       |            // '{' == 2. Arrays can always be closed. Objects can only close
  391|       |            // when a key or a comma is expected.
  392|  4.48M|            if(c - nesting[depth] != 2 ||
  ------------------
  |  Branch (392:16): [True: 0, False: 4.48M]
  ------------------
  393|  4.48M|               (c == '}' && next[depth] != 'k' && next[depth] != ',')) {
  ------------------
  |  Branch (393:17): [True: 4.43M, False: 43.3k]
  |  Branch (393:29): [True: 2.10M, False: 2.33M]
  |  Branch (393:51): [True: 2, False: 2.10M]
  ------------------
  394|      2|                parser.error = CJ5_ERROR_INVALID;
  395|      2|                goto finish;
  396|      2|            }
  397|       |
  398|  4.48M|            if(token) {
  ------------------
  |  Branch (398:16): [True: 2.29M, False: 2.18M]
  ------------------
  399|       |                // Finalize the current token
  400|  2.29M|                token->end = parser.pos;
  401|       |
  402|       |                // Move to the parent and increase the parent size. Omit this
  403|       |                // when we leave the root (parent the same as the current
  404|       |                // token).
  405|  2.29M|                if(parser.curr_tok_idx != token->parent_id) {
  ------------------
  |  Branch (405:20): [True: 2.28M, False: 4.52k]
  ------------------
  406|  2.28M|                    parser.curr_tok_idx = token->parent_id;
  407|  2.28M|                    token = &tokens[token->parent_id];
  408|  2.28M|                    token->size++;
  409|  2.28M|                }
  410|  2.29M|            }
  411|       |
  412|       |            // Step one level up
  413|  4.48M|            depth--;
  414|  4.48M|            next[depth] = (depth == 0) ? 0 : ','; // zero if we step out the root
  ------------------
  |  Branch (414:27): [True: 4.88k, False: 4.47M]
  ------------------
  415|       |                                                  // object. then we do not look for
  416|       |                                                  // another element.
  417|       |
  418|       |            // The first element was successfully parsed. Stop early or try to
  419|       |            // parse the full input string?
  420|  4.48M|            if(depth == 0 && parser.stop_early)
  ------------------
  |  Branch (420:16): [True: 4.88k, False: 4.47M]
  |  Branch (420:30): [True: 0, False: 4.88k]
  ------------------
  421|      0|                goto finish;
  422|       |
  423|  4.48M|            break;
  424|       |
  425|  4.48M|        case ':': // Colon (between key and value)
  ------------------
  |  Branch (425:9): [True: 4.20M, False: 91.9M]
  ------------------
  426|  4.20M|            if(next[depth] != ':') {
  ------------------
  |  Branch (426:16): [True: 938, False: 4.19M]
  ------------------
  427|    938|                parser.error = CJ5_ERROR_INVALID;
  428|    938|                goto finish;
  429|    938|            }
  430|  4.19M|            next[depth] = 'v';
  431|  4.19M|            break;
  432|       |
  433|  40.5M|        case ',': // Comma
  ------------------
  |  Branch (433:9): [True: 40.5M, False: 55.6M]
  ------------------
  434|  40.5M|            if(next[depth] != ',') {
  ------------------
  |  Branch (434:16): [True: 5, False: 40.5M]
  ------------------
  435|      5|                parser.error = CJ5_ERROR_INVALID;
  436|      5|                goto finish;
  437|      5|            }
  438|  40.5M|            next[depth] = (nesting[depth] == '{') ? 'k' : 'v';
  ------------------
  |  Branch (438:27): [True: 2.09M, False: 38.4M]
  ------------------
  439|  40.5M|            break;
  440|       |
  441|  42.4M|        default: // Value or key
  ------------------
  |  Branch (441:9): [True: 42.4M, False: 53.7M]
  ------------------
  442|  42.4M|            if(next[depth] == 'v') {
  ------------------
  |  Branch (442:16): [True: 38.2M, False: 4.19M]
  ------------------
  443|  38.2M|                cj5__parse_primitive(&parser); // Parse primitive value
  444|  38.2M|                if(nesting[depth] != 0) {
  ------------------
  |  Branch (444:20): [True: 38.2M, False: 974]
  ------------------
  445|       |                    // Parent is object or array
  446|  38.2M|                    if(token)
  ------------------
  |  Branch (446:24): [True: 36.0M, False: 2.11M]
  ------------------
  447|  36.0M|                        token->size++;
  448|  38.2M|                    next[depth] = ',';
  449|  38.2M|                } else {
  450|       |                    // The current value was the root element. Don't look for
  451|       |                    // any next element.
  452|    974|                    next[depth] = 0;
  453|       |
  454|       |                    // The first element was successfully parsed. Stop early or try to
  455|       |                    // parse the full input string?
  456|    974|                    if(parser.stop_early)
  ------------------
  |  Branch (456:24): [True: 0, False: 974]
  ------------------
  457|      0|                        goto finish;
  458|    974|                }
  459|  38.2M|            } else if(next[depth] == 'k') {
  ------------------
  |  Branch (459:23): [True: 4.19M, False: 41]
  ------------------
  460|  4.19M|                cj5__parse_key(&parser);
  461|  4.19M|                if(token)
  ------------------
  |  Branch (461:20): [True: 2.15M, False: 2.04M]
  ------------------
  462|  2.15M|                    token->size++; // Keys count towards the length
  463|  4.19M|                next[depth] = ':';
  464|  4.19M|            } else {
  465|     41|                parser.error = CJ5_ERROR_INVALID;
  466|     41|            }
  467|       |
  468|  42.4M|            if(parser.error && parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (468:16): [True: 21.2M, False: 21.1M]
  |  Branch (468:32): [True: 65, False: 21.2M]
  ------------------
  469|     65|                goto finish;
  470|       |
  471|  42.4M|            break;
  472|  96.1M|        }
  473|  96.1M|    }
  474|       |
  475|       |    // Are we back to the initial nesting depth?
  476|  5.83k|    if(depth != 0) {
  ------------------
  |  Branch (476:8): [True: 21, False: 5.81k]
  ------------------
  477|     21|        parser.error = CJ5_ERROR_INCOMPLETE;
  478|     21|        goto finish;
  479|     21|    }
  480|       |
  481|       |    // Close the virtual root object if there is one
  482|  5.81k|    if(nesting[0] == '{' && parser.error != CJ5_ERROR_OVERFLOW) {
  ------------------
  |  Branch (482:8): [True: 920, False: 4.89k]
  |  Branch (482:29): [True: 913, False: 7]
  ------------------
  483|       |        // Check the we end after a complete key-value pair (or dangling comma)
  484|    913|        if(next[0] != 'k' && next[0] != ',')
  ------------------
  |  Branch (484:12): [True: 909, False: 4]
  |  Branch (484:30): [True: 21, False: 888]
  ------------------
  485|     21|            parser.error = CJ5_ERROR_INVALID;
  486|    913|        tokens[0].end = parser.pos - 1;
  487|    913|    }
  488|       |
  489|  6.89k| finish:
  490|       |    // If parsing failed at the initial nesting depth, create a virtual root object
  491|       |    // and restart parsing.
  492|  6.89k|    if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (492:8): [True: 1.86k, False: 5.02k]
  ------------------
  493|  1.86k|       parser.error != CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (493:8): [True: 1.09k, False: 770]
  ------------------
  494|  1.09k|       depth == 0 && nesting[0] != '{') {
  ------------------
  |  Branch (494:8): [True: 1.03k, False: 60]
  |  Branch (494:22): [True: 980, False: 59]
  ------------------
  495|    980|        parser.token_count = 0;
  496|    980|        token = cj5__alloc_token(&parser);
  497|    980|        if(token) {
  ------------------
  |  Branch (497:12): [True: 980, False: 0]
  ------------------
  498|    980|            token->parent_id = 0;
  499|    980|            token->type = CJ5_TOKEN_OBJECT;
  500|    980|            token->start = 0;
  501|    980|            token->size = 0;
  502|       |
  503|    980|            nesting[0] = '{';
  504|    980|            next[0] = 'k';
  505|       |
  506|    980|            parser.curr_tok_idx = 0;
  507|    980|            parser.pos = 0;
  508|    980|            parser.error = CJ5_ERROR_NONE;
  509|    980|            goto start_parsing;
  510|    980|        }
  511|    980|    }
  512|       |
  513|  5.91k|    memset(&r, 0x0, sizeof(r));
  514|  5.91k|    r.error = parser.error;
  515|  5.91k|    r.error_pos = parser.pos;
  516|  5.91k|    r.num_tokens = parser.token_count; // How many tokens (would) have been
  517|       |                                       // consumed by the parser?
  518|       |
  519|       |    // Not a single token was parsed -> return an error
  520|  5.91k|    if(r.num_tokens == 0)
  ------------------
  |  Branch (520:8): [True: 2, False: 5.91k]
  ------------------
  521|      2|        r.error = CJ5_ERROR_INCOMPLETE;
  522|       |
  523|       |    // Set the tokens and original string only if successfully parsed
  524|  5.91k|    if(r.error == CJ5_ERROR_NONE) {
  ------------------
  |  Branch (524:8): [True: 5.02k, False: 891]
  ------------------
  525|  5.02k|        r.tokens = tokens;
  526|  5.02k|        r.json5 = json5;
  527|  5.02k|    }
  528|       |
  529|  5.91k|    return r;
  530|  6.89k|}
cj5_get_str:
  628|   215k|            char *buf, unsigned int *buflen) {
  629|   215k|    const cj5_token *token = &r->tokens[tok_index];
  630|   215k|    if(token->type != CJ5_TOKEN_STRING)
  ------------------
  |  Branch (630:8): [True: 0, False: 215k]
  ------------------
  631|      0|        return CJ5_ERROR_INVALID;
  632|       |
  633|   215k|    const char *pos = &r->json5[token->start];
  634|   215k|    const char *end = &r->json5[token->end + 1];
  635|   215k|    unsigned int outpos = 0;
  636|  28.5M|    for(; pos < end; pos++) {
  ------------------
  |  Branch (636:11): [True: 28.3M, False: 215k]
  ------------------
  637|  28.3M|        uint8_t c = (uint8_t)*pos;
  638|       |        // Unprintable ascii characters must be escaped
  639|  28.3M|        if(c < ' ' || c == 127)
  ------------------
  |  Branch (639:12): [True: 11, False: 28.3M]
  |  Branch (639:23): [True: 2, False: 28.3M]
  ------------------
  640|     13|            return CJ5_ERROR_INVALID;
  641|       |
  642|       |        // Unescaped Ascii character or utf8 byte
  643|  28.3M|        if(c != '\\') {
  ------------------
  |  Branch (643:12): [True: 24.1M, False: 4.13M]
  ------------------
  644|  24.1M|            buf[outpos++] = (char)c;
  645|  24.1M|            continue;
  646|  24.1M|        }
  647|       |
  648|       |        // End of input before the escaped character
  649|  4.13M|        if(pos + 1 >= end)
  ------------------
  |  Branch (649:12): [True: 0, False: 4.13M]
  ------------------
  650|      0|            return CJ5_ERROR_INCOMPLETE;
  651|       |
  652|       |        // Process escaped character
  653|  4.13M|        pos++;
  654|  4.13M|        c = (uint8_t)*pos;
  655|  4.13M|        switch(c) {
  656|    321|        case 'b': buf[outpos++] = '\b'; break;
  ------------------
  |  Branch (656:9): [True: 321, False: 4.13M]
  ------------------
  657|  11.2k|        case 'f': buf[outpos++] = '\f'; break;
  ------------------
  |  Branch (657:9): [True: 11.2k, False: 4.12M]
  ------------------
  658|    336|        case 'r': buf[outpos++] = '\r'; break;
  ------------------
  |  Branch (658:9): [True: 336, False: 4.13M]
  ------------------
  659|  98.8k|        case 'n': buf[outpos++] = '\n'; break;
  ------------------
  |  Branch (659:9): [True: 98.8k, False: 4.03M]
  ------------------
  660|    548|        case 't': buf[outpos++] = '\t'; break;
  ------------------
  |  Branch (660:9): [True: 548, False: 4.13M]
  ------------------
  661|  3.12M|        default:  buf[outpos++] = (char)c; break;
  ------------------
  |  Branch (661:9): [True: 3.12M, False: 1.01M]
  ------------------
  662|   898k|        case 'u': {
  ------------------
  |  Branch (662:9): [True: 898k, False: 3.23M]
  ------------------
  663|       |            // Parse a unicode code point
  664|   898k|            if(pos + 4 >= end)
  ------------------
  |  Branch (664:16): [True: 3, False: 898k]
  ------------------
  665|      3|                return CJ5_ERROR_INCOMPLETE;
  666|   898k|            pos++;
  667|   898k|            uint32_t utf;
  668|   898k|            cj5_error_code err = parse_codepoint(pos, &utf);
  669|   898k|            if(err != CJ5_ERROR_NONE)
  ------------------
  |  Branch (669:16): [True: 8, False: 898k]
  ------------------
  670|      8|                return err;
  671|   898k|            pos += 3;
  672|       |
  673|       |            // Parse a surrogate pair
  674|   898k|            if(0xd800 <= utf && utf <= 0xdfff) {
  ------------------
  |  Branch (674:16): [True: 910, False: 897k]
  |  Branch (674:33): [True: 710, False: 200]
  ------------------
  675|    710|                if(pos + 6 >= end)
  ------------------
  |  Branch (675:20): [True: 2, False: 708]
  ------------------
  676|      2|                    return CJ5_ERROR_INVALID;
  677|    708|                if(pos[1] != '\\' && pos[2] != 'u')
  ------------------
  |  Branch (677:20): [True: 253, False: 455]
  |  Branch (677:38): [True: 5, False: 248]
  ------------------
  678|      5|                    return CJ5_ERROR_INVALID;
  679|    703|                pos += 3;
  680|    703|                uint32_t utf2;
  681|    703|                err = parse_codepoint(pos, &utf2);
  682|    703|                if(err != CJ5_ERROR_NONE)
  ------------------
  |  Branch (682:20): [True: 5, False: 698]
  ------------------
  683|      5|                    return err;
  684|    698|                pos += 3;
  685|       |                // High or low surrogate pair
  686|    698|                utf = (utf <= 0xdbff) ?
  ------------------
  |  Branch (686:23): [True: 264, False: 434]
  ------------------
  687|    264|                    (utf << 10) + utf2 + SURROGATE_OFFSET :
  688|    698|                    (utf2 << 10) + utf + SURROGATE_OFFSET;
  689|    698|            }
  690|       |
  691|       |            // Write the utf8 bytes of the code point
  692|   898k|            unsigned len = utf8_from_codepoint((unsigned char*)buf + outpos, utf);
  693|   898k|            if(len == 0)
  ------------------
  |  Branch (693:16): [True: 14, False: 898k]
  ------------------
  694|     14|                return CJ5_ERROR_INVALID; // Not a utf8 string
  695|   898k|            outpos += len;
  696|   898k|            break;
  697|   898k|        }
  698|  4.13M|        }
  699|  4.13M|    }
  700|       |
  701|       |    // Terminate with \0
  702|   215k|    buf[outpos] = 0;
  703|       |
  704|       |    // Set the output length
  705|   215k|    if(buflen)
  ------------------
  |  Branch (705:8): [True: 215k, False: 0]
  ------------------
  706|   215k|        *buflen = outpos;
  707|   215k|    return CJ5_ERROR_NONE;
  708|   215k|}
cj5.c:cj5__skip_comment:
  260|  22.7k|cj5__skip_comment(cj5__parser* parser) {
  261|  22.7k|    const char* json5 = parser->json5;
  262|       |
  263|       |    // Single-line comment
  264|  22.7k|    if(json5[parser->pos] == '#') {
  ------------------
  |  Branch (264:8): [True: 144, False: 22.6k]
  ------------------
  265|  22.4k|    skip_line:
  266|  4.80M|        while(parser->pos < parser->len) {
  ------------------
  |  Branch (266:15): [True: 4.80M, False: 54]
  ------------------
  267|  4.80M|            if(json5[parser->pos] == '\n') {
  ------------------
  |  Branch (267:16): [True: 22.4k, False: 4.78M]
  ------------------
  268|  22.4k|                parser->pos--; // Reparse the newline in the main parse loop
  269|  22.4k|                return;
  270|  22.4k|            }
  271|  4.78M|            parser->pos++;
  272|  4.78M|        }
  273|     54|        return;
  274|  22.4k|    }
  275|       |
  276|       |    // Comment begins with '/' but not enough space for another character
  277|  22.6k|    if(parser->pos + 1 >= parser->len) {
  ------------------
  |  Branch (277:8): [True: 12, False: 22.6k]
  ------------------
  278|     12|        parser->error = CJ5_ERROR_INVALID;
  279|     12|        return;
  280|     12|    }
  281|  22.6k|    parser->pos++;
  282|       |
  283|       |    // Comment begins with '//' -> single-line comment
  284|  22.6k|    if(json5[parser->pos] == '/')
  ------------------
  |  Branch (284:8): [True: 22.3k, False: 322]
  ------------------
  285|  22.3k|        goto skip_line;
  286|       |
  287|       |    // Multi-line comments begin with '/*' and end with '*/'
  288|    322|    if(json5[parser->pos] == '*') {
  ------------------
  |  Branch (288:8): [True: 319, False: 3]
  ------------------
  289|    319|        parser->pos++;
  290|  1.02M|        for(; parser->pos + 1 < parser->len; parser->pos++) {
  ------------------
  |  Branch (290:15): [True: 1.02M, False: 19]
  ------------------
  291|  1.02M|            if(json5[parser->pos] == '*' && json5[parser->pos + 1] == '/') {
  ------------------
  |  Branch (291:16): [True: 766, False: 1.02M]
  |  Branch (291:45): [True: 300, False: 466]
  ------------------
  292|    300|                parser->pos++;
  293|    300|                return;
  294|    300|            }
  295|  1.02M|        }
  296|    319|    }
  297|       |
  298|       |    // Unknown comment type or the multi-line comment is not terminated
  299|     22|    parser->error = CJ5_ERROR_INCOMPLETE;
  300|     22|}
cj5.c:cj5__alloc_token:
   88|  46.8M|cj5__alloc_token(cj5__parser *parser) {
   89|  46.8M|    cj5_token* token = NULL;
   90|  46.8M|    if(parser->token_count < parser->max_tokens) {
  ------------------
  |  Branch (90:8): [True: 23.4M, False: 23.4M]
  ------------------
   91|  23.4M|        token = &parser->tokens[parser->token_count];
   92|  23.4M|        memset(token, 0x0, sizeof(cj5_token));
   93|  23.4M|    } else {
   94|  23.4M|        parser->error = CJ5_ERROR_OVERFLOW;
   95|  23.4M|    }
   96|       |
   97|       |    // Always increase the index. So we know eventually how many token would be
   98|       |    // required (if there are not enough).
   99|  46.8M|    parser->token_count++;
  100|  46.8M|    return token;
  101|  46.8M|}
cj5.c:cj5__parse_primitive:
  152|  38.2M|cj5__parse_primitive(cj5__parser* parser) {
  153|  38.2M|    const char* json5 = parser->json5;
  154|  38.2M|    unsigned int len = parser->len;
  155|  38.2M|    unsigned int start = parser->pos;
  156|       |
  157|       |    // String value
  158|  38.2M|    if(json5[start] == '\"' ||
  ------------------
  |  Branch (158:8): [True: 5.66M, False: 32.5M]
  ------------------
  159|  32.5M|       json5[start] == '\'') {
  ------------------
  |  Branch (159:8): [True: 394k, False: 32.1M]
  ------------------
  160|  6.05M|        cj5__parse_string(parser);
  161|  6.05M|        return;
  162|  6.05M|    }
  163|       |
  164|       |    // Fast comparison of bool, and null.
  165|       |    // Make the comparison case-insensitive.
  166|  32.1M|    uint32_t fourcc = 0;
  167|  32.1M|    if(start + 3 < len) {
  ------------------
  |  Branch (167:8): [True: 32.1M, False: 3.05k]
  ------------------
  168|  32.1M|        fourcc += (unsigned char)json5[start] | 32U;
  169|  32.1M|        fourcc += ((unsigned char)json5[start+1] | 32U) << 8;
  170|  32.1M|        fourcc += ((unsigned char)json5[start+2] | 32U) << 16;
  171|  32.1M|        fourcc += ((unsigned char)json5[start+3] | 32U) << 24;
  172|  32.1M|    }
  173|       |    
  174|  32.1M|    cj5_token_type type;
  175|  32.1M|    if(fourcc == CJ5__NULL_FOURCC) {
  ------------------
  |  Branch (175:8): [True: 3.90M, False: 28.2M]
  ------------------
  176|  3.90M|        type = CJ5_TOKEN_NULL;
  177|  3.90M|        parser->pos += 3;
  178|  28.2M|    } else if(fourcc == CJ5__TRUE_FOURCC) {
  ------------------
  |  Branch (178:15): [True: 530, False: 28.2M]
  ------------------
  179|    530|        type = CJ5_TOKEN_BOOL;
  180|    530|        parser->pos += 3;
  181|  28.2M|    } else if(fourcc == CJ5__FALSE_FOURCC) {
  ------------------
  |  Branch (181:15): [True: 10.8k, False: 28.2M]
  ------------------
  182|       |        // "false" has five characters
  183|  10.8k|        type = CJ5_TOKEN_BOOL;
  184|  10.8k|        if(start + 4 >= len || (json5[start+4] | 32) != 'e') {
  ------------------
  |  Branch (184:12): [True: 0, False: 10.8k]
  |  Branch (184:32): [True: 2, False: 10.8k]
  ------------------
  185|      2|            parser->error = CJ5_ERROR_INVALID;
  186|      2|            return;
  187|      2|        }
  188|  10.8k|        parser->pos += 4;
  189|  28.2M|    } else {
  190|       |        // Numbers are checked for basic compatibility.
  191|       |        // But they are fully parsed only in the cj5_get_XXX functions.
  192|  28.2M|        type = CJ5_TOKEN_NUMBER;
  193|  80.1M|        for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (193:15): [True: 80.1M, False: 882]
  ------------------
  194|  80.1M|            if(!cj5__isnum(json5[parser->pos]) &&
  ------------------
  |  |   85|   160M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  ------------------
  |  Branch (194:16): [True: 32.0M, False: 48.0M]
  ------------------
  195|  32.0M|               !(json5[parser->pos] == '.') &&
  ------------------
  |  Branch (195:16): [True: 29.2M, False: 2.86M]
  ------------------
  196|  29.2M|               !cj5__islowerchar(json5[parser->pos]) && 
  ------------------
  |  |   84|   109M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  ------------------
  |  Branch (196:16): [True: 28.2M, False: 961k]
  ------------------
  197|  28.2M|               !cj5__isupperchar(json5[parser->pos]) &&
  ------------------
  |  |   83|   108M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  ------------------
  |  Branch (197:16): [True: 28.2M, False: 27.9k]
  ------------------
  198|  28.2M|               !(json5[parser->pos] == '+') && !(json5[parser->pos] == '-')) {
  ------------------
  |  Branch (198:16): [True: 28.2M, False: 2.02k]
  |  Branch (198:48): [True: 28.2M, False: 14.5k]
  ------------------
  199|  28.2M|                break;
  200|  28.2M|            }
  201|  80.1M|        }
  202|  28.2M|        parser->pos--; // Point to the last character that is still inside the
  203|       |                       // primitive value
  204|  28.2M|    }
  205|       |
  206|  32.1M|    cj5_token *token = cj5__alloc_token(parser);
  207|  32.1M|    if(token) {
  ------------------
  |  Branch (207:8): [True: 15.9M, False: 16.2M]
  ------------------
  208|  15.9M|        token->type = type;
  209|  15.9M|        token->start = start;
  210|  15.9M|        token->end = parser->pos;
  211|  15.9M|        token->size = parser->pos - start + 1;
  212|  15.9M|        token->parent_id = parser->curr_tok_idx;
  213|  15.9M|    }
  214|  32.1M|}
cj5.c:cj5__parse_string:
  104|  10.0M|cj5__parse_string(cj5__parser *parser) {
  105|  10.0M|    const char *json5 = parser->json5;
  106|  10.0M|    unsigned int len = parser->len;
  107|  10.0M|    unsigned int start = parser->pos;
  108|  10.0M|    char str_open = json5[start];
  109|       |
  110|  10.0M|    parser->pos++;
  111|  86.1M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (111:11): [True: 86.1M, False: 13]
  ------------------
  112|  86.1M|        char c = json5[parser->pos];
  113|       |
  114|       |        // End of string
  115|  86.1M|        if(str_open == c) {
  ------------------
  |  Branch (115:12): [True: 10.0M, False: 76.0M]
  ------------------
  116|  10.0M|            cj5_token *token = cj5__alloc_token(parser);
  117|  10.0M|            if(token) {
  ------------------
  |  Branch (117:16): [True: 5.10M, False: 4.95M]
  ------------------
  118|  5.10M|                token->type = CJ5_TOKEN_STRING;
  119|  5.10M|                token->start = start + 1;
  120|  5.10M|                token->end = parser->pos - 1;
  121|  5.10M|                token->size = token->end - token->start + 1;
  122|  5.10M|                token->parent_id = parser->curr_tok_idx;
  123|  5.10M|            } 
  124|  10.0M|            return;
  125|  10.0M|        }
  126|       |
  127|       |        // Unescaped newlines are forbidden
  128|  76.0M|        if(c == '\n') {
  ------------------
  |  Branch (128:12): [True: 0, False: 76.0M]
  ------------------
  129|      0|            parser->error = CJ5_ERROR_INVALID;
  130|      0|            return;
  131|      0|        }
  132|       |
  133|       |        // Skip escape character
  134|  76.0M|        if(c == '\\') {
  ------------------
  |  Branch (134:12): [True: 5.40M, False: 70.6M]
  ------------------
  135|  5.40M|            if(parser->pos + 1 >= len) {
  ------------------
  |  Branch (135:16): [True: 0, False: 5.40M]
  ------------------
  136|      0|                parser->error = CJ5_ERROR_INCOMPLETE;
  137|      0|                return;
  138|      0|            }
  139|  5.40M|            parser->pos++;
  140|  5.40M|        }
  141|  76.0M|    }
  142|       |
  143|       |    // The file has ended before the string terminates
  144|     13|    parser->error = CJ5_ERROR_INCOMPLETE;
  145|     13|}
cj5.c:cj5__isrange:
   79|   146M|cj5__isrange(char ch, char from, char to) {
   80|   146M|    return (uint8_t)(ch - from) <= (uint8_t)(to - from);
   81|   146M|}
cj5.c:cj5__parse_key:
  217|  4.19M|cj5__parse_key(cj5__parser* parser) {
  218|  4.19M|    const char* json5 = parser->json5;
  219|  4.19M|    unsigned int start = parser->pos;
  220|  4.19M|    cj5_token* token;
  221|       |
  222|       |    // Key is a a normal string
  223|  4.19M|    if(json5[start] == '\"' || json5[start] == '\'') {
  ------------------
  |  Branch (223:8): [True: 3.99M, False: 204k]
  |  Branch (223:32): [True: 2.22k, False: 202k]
  ------------------
  224|  3.99M|        cj5__parse_string(parser);
  225|  3.99M|        return;
  226|  3.99M|    }
  227|       |
  228|       |    // An unquoted key. Must start with a-ZA-Z_$. Can contain numbers later on.
  229|   202k|    unsigned int len = parser->len;
  230|  3.22M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (230:11): [True: 3.22M, False: 31]
  ------------------
  231|  3.22M|        if(cj5__islowerchar(json5[parser->pos]) ||
  ------------------
  |  |   84|  6.45M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  |  |  ------------------
  |  |  |  Branch (84:30): [True: 2.55M, False: 668k]
  |  |  ------------------
  ------------------
  232|   668k|           cj5__isupperchar(json5[parser->pos]) ||
  ------------------
  |  |   83|  3.89M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  |  |  ------------------
  |  |  |  Branch (83:30): [True: 330k, False: 338k]
  |  |  ------------------
  ------------------
  233|   338k|           json5[parser->pos] == '_' || json5[parser->pos] == '$')
  ------------------
  |  Branch (233:12): [True: 1.79k, False: 336k]
  |  Branch (233:41): [True: 1.04k, False: 335k]
  ------------------
  234|  2.89M|            continue;
  235|   335k|        if(cj5__isnum(json5[parser->pos]) && parser->pos != start)
  ------------------
  |  |   85|   670k|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 132k, False: 202k]
  |  |  ------------------
  ------------------
  |  Branch (235:46): [True: 132k, False: 0]
  ------------------
  236|   132k|            continue;
  237|   202k|        break;
  238|   335k|    }
  239|       |
  240|       |    // An empty key is not allowed
  241|   202k|    if(parser->pos <= start) {
  ------------------
  |  Branch (241:8): [True: 9, False: 202k]
  ------------------
  242|      9|        parser->error = CJ5_ERROR_INVALID;
  243|      9|        return;
  244|      9|    }
  245|       |
  246|       |    // Move pos to the last character within the unquoted key
  247|   202k|    parser->pos--;
  248|       |
  249|   202k|    token = cj5__alloc_token(parser);
  250|   202k|    if(token) {
  ------------------
  |  Branch (250:8): [True: 111k, False: 91.7k]
  ------------------
  251|   111k|        token->type = CJ5_TOKEN_STRING;
  252|   111k|        token->start = start;
  253|   111k|        token->end = parser->pos;
  254|   111k|        token->size = parser->pos - start + 1;
  255|   111k|        token->parent_id = parser->curr_tok_idx;
  256|   111k|    }
  257|   202k|}
cj5.c:parse_codepoint:
  607|   899k|parse_codepoint(const char *pos, uint32_t *out_utf) {
  608|   899k|    uint32_t utf = 0;
  609|  4.49M|    for(unsigned int i = 0; i < 4; i++) {
  ------------------
  |  Branch (609:29): [True: 3.59M, False: 899k]
  ------------------
  610|  3.59M|        char byte = pos[i];
  611|  3.59M|        if(cj5__isnum(byte)) {
  ------------------
  |  |   85|  3.59M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 2.69M, False: 900k]
  |  |  ------------------
  ------------------
  612|  2.69M|            byte = (char)(byte - '0');
  613|  2.69M|        } else if(cj5__isrange(byte, 'a', 'f')) {
  ------------------
  |  Branch (613:19): [True: 896k, False: 3.24k]
  ------------------
  614|   896k|            byte = (char)(byte - ('a' - 10));
  615|   896k|        } else if(cj5__isrange(byte, 'A', 'F')) {
  ------------------
  |  Branch (615:19): [True: 3.23k, False: 13]
  ------------------
  616|  3.23k|            byte = (char)(byte - ('A' - 10));
  617|  3.23k|        } else {
  618|     13|            return CJ5_ERROR_INVALID;
  619|     13|        }
  620|  3.59M|        utf = (utf << 4) | ((uint8_t)byte & 0xF);
  621|  3.59M|    }
  622|   899k|    *out_utf = utf;
  623|   899k|    return CJ5_ERROR_NONE;
  624|   899k|}

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

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

musl_secs_to_tm:
   15|  26.2k|musl_secs_to_tm(long long t, struct musl_tm *tm) {
   16|  26.2k|    long long days, secs, years;
   17|  26.2k|    int remdays, remsecs, remyears;
   18|  26.2k|    int qc_cycles, c_cycles, q_cycles;
   19|  26.2k|    int months;
   20|  26.2k|    int wday, yday, leap;
   21|  26.2k|    static const char days_in_month[] = {31,30,31,30,31,31,30,31,30,31,31,29};
   22|       |
   23|       |    /* Reject time_t values whose year would overflow int */
   24|  26.2k|    if (t < INT_MIN * 31622400LL || t > INT_MAX * 31622400LL)
  ------------------
  |  Branch (24:9): [True: 0, False: 26.2k]
  |  Branch (24:37): [True: 0, False: 26.2k]
  ------------------
   25|      0|        return -1;
   26|       |
   27|  26.2k|    secs = t - LEAPOCH;
  ------------------
  |  |    8|  26.2k|#define LEAPOCH (946684800LL + 86400*(31+29))
  ------------------
   28|  26.2k|    days = secs / 86400LL;
   29|  26.2k|    remsecs = (int)(secs % 86400);
   30|  26.2k|    if (remsecs < 0) {
  ------------------
  |  Branch (30:9): [True: 17.2k, False: 9.00k]
  ------------------
   31|  17.2k|        remsecs += 86400;
   32|  17.2k|        --days;
   33|  17.2k|    }
   34|       |
   35|  26.2k|    wday = (int)((3+days)%7);
   36|  26.2k|    if (wday < 0) wday += 7;
  ------------------
  |  Branch (36:9): [True: 17.3k, False: 8.88k]
  ------------------
   37|       |
   38|  26.2k|    qc_cycles = (int)(days / DAYS_PER_400Y);
  ------------------
  |  |   10|  26.2k|#define DAYS_PER_400Y (365*400 + 97)
  ------------------
   39|  26.2k|    remdays = (int)(days % DAYS_PER_400Y);
  ------------------
  |  |   10|  26.2k|#define DAYS_PER_400Y (365*400 + 97)
  ------------------
   40|  26.2k|    if (remdays < 0) {
  ------------------
  |  Branch (40:9): [True: 20.8k, False: 5.39k]
  ------------------
   41|  20.8k|        remdays += DAYS_PER_400Y;
  ------------------
  |  |   10|  20.8k|#define DAYS_PER_400Y (365*400 + 97)
  ------------------
   42|  20.8k|        --qc_cycles;
   43|  20.8k|    }
   44|       |
   45|  26.2k|    c_cycles = remdays / DAYS_PER_100Y;
  ------------------
  |  |   11|  26.2k|#define DAYS_PER_100Y (365*100 + 24)
  ------------------
   46|  26.2k|    if (c_cycles == 4) --c_cycles;
  ------------------
  |  Branch (46:9): [True: 3.21k, False: 23.0k]
  ------------------
   47|  26.2k|    remdays -= c_cycles * DAYS_PER_100Y;
  ------------------
  |  |   11|  26.2k|#define DAYS_PER_100Y (365*100 + 24)
  ------------------
   48|       |
   49|  26.2k|    q_cycles = remdays / DAYS_PER_4Y;
  ------------------
  |  |   12|  26.2k|#define DAYS_PER_4Y   (365*4   + 1)
  ------------------
   50|  26.2k|    if (q_cycles == 25) --q_cycles;
  ------------------
  |  Branch (50:9): [True: 0, False: 26.2k]
  ------------------
   51|  26.2k|    remdays -= q_cycles * DAYS_PER_4Y;
  ------------------
  |  |   12|  26.2k|#define DAYS_PER_4Y   (365*4   + 1)
  ------------------
   52|       |
   53|  26.2k|    remyears = remdays / 365;
   54|  26.2k|    if (remyears == 4) --remyears;
  ------------------
  |  Branch (54:9): [True: 3.27k, False: 23.0k]
  ------------------
   55|  26.2k|    remdays -= remyears * 365;
   56|       |
   57|  26.2k|    leap = !remyears && (q_cycles || !c_cycles);
  ------------------
  |  Branch (57:12): [True: 9.98k, False: 16.3k]
  |  Branch (57:26): [True: 5.50k, False: 4.47k]
  |  Branch (57:38): [True: 4.44k, False: 27]
  ------------------
   58|  26.2k|    yday = remdays + 31 + 28 + leap;
   59|  26.2k|    if (yday >= 365+leap) yday -= 365+leap;
  ------------------
  |  Branch (59:9): [True: 13.9k, False: 12.3k]
  ------------------
   60|       |
   61|  26.2k|    years = remyears + 4*q_cycles + 100*c_cycles + 400LL*qc_cycles;
   62|       |
   63|   229k|    for (months=0; days_in_month[months] <= remdays; months++)
  ------------------
  |  Branch (63:20): [True: 203k, False: 26.2k]
  ------------------
   64|   203k|        remdays -= days_in_month[months];
   65|       |
   66|  26.2k|    if (months >= 10) {
  ------------------
  |  Branch (66:9): [True: 13.9k, False: 12.3k]
  ------------------
   67|  13.9k|        months -= 12;
   68|  13.9k|        years++;
   69|  13.9k|    }
   70|       |
   71|  26.2k|    if (years+100 > INT_MAX || years+100 < INT_MIN)
  ------------------
  |  Branch (71:9): [True: 0, False: 26.2k]
  |  Branch (71:32): [True: 0, False: 26.2k]
  ------------------
   72|      0|        return -1;
   73|       |
   74|  26.2k|    tm->tm_year = (int)(years + 100);
   75|  26.2k|    tm->tm_mon = months + 2;
   76|  26.2k|    tm->tm_mday = remdays + 1;
   77|  26.2k|    tm->tm_wday = wday;
   78|  26.2k|    tm->tm_yday = yday;
   79|       |
   80|  26.2k|    tm->tm_hour = remsecs / 3600;
   81|  26.2k|    tm->tm_min = remsecs / 60 % 60;
   82|  26.2k|    tm->tm_sec = remsecs % 60;
   83|       |
   84|  26.2k|    return 0;
   85|  26.2k|}
musl_tm_to_secs:
  149|  17.0k|musl_tm_to_secs(const struct musl_tm *tm) {
  150|  17.0k|    int is_leap;
  151|  17.0k|    long long year = tm->tm_year;
  152|  17.0k|    int month = tm->tm_mon;
  153|  17.0k|    if (month >= 12 || month < 0) {
  ------------------
  |  Branch (153:9): [True: 2.56k, False: 14.5k]
  |  Branch (153:24): [True: 2.54k, False: 11.9k]
  ------------------
  154|  5.10k|        int adj = month / 12;
  155|  5.10k|        month %= 12;
  156|  5.10k|        if (month < 0) {
  ------------------
  |  Branch (156:13): [True: 2.54k, False: 2.56k]
  ------------------
  157|  2.54k|            adj--;
  158|  2.54k|            month += 12;
  159|  2.54k|        }
  160|  5.10k|        year += adj;
  161|  5.10k|    }
  162|  17.0k|    long long t = musl_year_to_secs(year, &is_leap);
  163|  17.0k|    t += musl_month_to_secs(month, is_leap);
  164|  17.0k|    t += 86400LL * (tm->tm_mday-1);
  165|  17.0k|    t += 3600LL * tm->tm_hour;
  166|  17.0k|    t += 60LL * tm->tm_min;
  167|  17.0k|    t += tm->tm_sec;
  168|  17.0k|    return t;
  169|  17.0k|}
libc_time.c:musl_year_to_secs:
  101|  17.0k|musl_year_to_secs(const long long year, int *is_leap) {
  102|  17.0k|    if (year-2ULL <= 136) {
  ------------------
  |  Branch (102:9): [True: 1.14k, False: 15.9k]
  ------------------
  103|  1.14k|        int y = (int)year;
  104|  1.14k|        int leaps = (y-68)>>2;
  105|  1.14k|        if (!((y-68)&3)) {
  ------------------
  |  Branch (105:13): [True: 300, False: 840]
  ------------------
  106|    300|            leaps--;
  107|    300|            if (is_leap) *is_leap = 1;
  ------------------
  |  Branch (107:17): [True: 300, False: 0]
  ------------------
  108|    840|        } else if (is_leap) *is_leap = 0;
  ------------------
  |  Branch (108:20): [True: 840, False: 0]
  ------------------
  109|  1.14k|        return 31536000*(y-70) + 86400*leaps;
  110|  1.14k|    }
  111|       |
  112|  15.9k|    int cycles, centuries, leaps, rem, dummy;
  113|       |
  114|  15.9k|    if (!is_leap) is_leap = &dummy;
  ------------------
  |  Branch (114:9): [True: 0, False: 15.9k]
  ------------------
  115|  15.9k|    cycles = (int)((year-100) / 400);
  116|  15.9k|    rem = (int)((year-100) % 400);
  117|  15.9k|    if (rem < 0) {
  ------------------
  |  Branch (117:9): [True: 11.1k, False: 4.79k]
  ------------------
  118|  11.1k|        cycles--;
  119|  11.1k|        rem += 400;
  120|  11.1k|    }
  121|  15.9k|    if (!rem) {
  ------------------
  |  Branch (121:9): [True: 2.09k, False: 13.8k]
  ------------------
  122|  2.09k|        *is_leap = 1;
  123|  2.09k|        centuries = 0;
  124|  2.09k|        leaps = 0;
  125|  13.8k|    } else {
  126|  13.8k|        if (rem >= 200) {
  ------------------
  |  Branch (126:13): [True: 6.69k, False: 7.16k]
  ------------------
  127|  6.69k|            if (rem >= 300) centuries = 3, rem -= 300;
  ------------------
  |  Branch (127:17): [True: 4.40k, False: 2.29k]
  ------------------
  128|  2.29k|            else centuries = 2, rem -= 200;
  129|  7.16k|        } else {
  130|  7.16k|            if (rem >= 100) centuries = 1, rem -= 100;
  ------------------
  |  Branch (130:17): [True: 1.81k, False: 5.34k]
  ------------------
  131|  5.34k|            else centuries = 0;
  132|  7.16k|        }
  133|  13.8k|        if (!rem) {
  ------------------
  |  Branch (133:13): [True: 203, False: 13.6k]
  ------------------
  134|    203|            *is_leap = 0;
  135|    203|            leaps = 0;
  136|  13.6k|        } else {
  137|  13.6k|            leaps = rem / 4;
  138|  13.6k|            rem %= 4;
  139|  13.6k|            *is_leap = !rem;
  140|  13.6k|        }
  141|  13.8k|    }
  142|       |
  143|  15.9k|    leaps += 97*cycles + 24*centuries - *is_leap;
  144|       |
  145|  15.9k|    return (year-100) * 31536000LL + leaps * 86400LL + 946684800 + 86400;
  146|  17.0k|}
libc_time.c:musl_month_to_secs:
   93|  17.0k|musl_month_to_secs(int month, int is_leap) {
   94|  17.0k|    int t = secs_through_month[month];
   95|  17.0k|    if (is_leap && month >= 2)
  ------------------
  |  Branch (95:9): [True: 5.93k, False: 11.1k]
  |  Branch (95:20): [True: 2.33k, False: 3.60k]
  ------------------
   96|  2.33k|        t+=86400;
   97|  17.0k|    return t;
   98|  17.0k|}

parseUInt64:
   30|  11.2M|parseUInt64(const char *str, size_t size, uint64_t *result) {
   31|  11.2M|    size_t i = 0;
   32|  11.2M|    uint64_t n = 0, prev = 0;
   33|       |
   34|       |    /* Hex */
   35|  11.2M|    if(size > 2 && str[0] == '0' && (str[1] | 32) == 'x') {
  ------------------
  |  Branch (35:8): [True: 23.6k, False: 11.1M]
  |  Branch (35:20): [True: 8.18k, False: 15.5k]
  |  Branch (35:37): [True: 344, False: 7.84k]
  ------------------
   36|    344|        i = 2;
   37|  22.7k|        for(; i < size; i++) {
  ------------------
  |  Branch (37:15): [True: 22.4k, False: 267]
  ------------------
   38|  22.4k|            uint8_t c = (uint8_t)str[i] | 32;
   39|  22.4k|            if(c >= '0' && c <= '9')
  ------------------
  |  Branch (39:16): [True: 22.4k, False: 0]
  |  Branch (39:28): [True: 12.8k, False: 9.55k]
  ------------------
   40|  12.8k|                c = (uint8_t)(c - '0');
   41|  9.55k|            else if(c >= 'a' && c <='f')
  ------------------
  |  Branch (41:21): [True: 9.55k, False: 0]
  |  Branch (41:33): [True: 9.48k, False: 76]
  ------------------
   42|  9.48k|                c = (uint8_t)(c - 'a' + 10);
   43|     76|            else if(c >= 'A' && c <='F')
  ------------------
  |  Branch (43:21): [True: 76, False: 0]
  |  Branch (43:33): [True: 0, False: 76]
  ------------------
   44|      0|                c = (uint8_t)(c - 'A' + 10);
   45|     76|            else
   46|     76|                break;
   47|  22.3k|            n = (n << 4) | (c & 0xF);
   48|  22.3k|            if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (48:16): [True: 1, False: 22.3k]
  ------------------
   49|      1|                return 0;
   50|  22.3k|            prev = n;
   51|  22.3k|        }
   52|    343|        *result = n;
   53|    343|        return (i > 2) ? i : 0; /* 2 -> No digit was parsed */
  ------------------
  |  Branch (53:16): [True: 343, False: 0]
  ------------------
   54|    344|    }
   55|       |
   56|       |    /* Decimal */
   57|  22.9M|    for(; i < size; i++) {
  ------------------
  |  Branch (57:11): [True: 11.7M, False: 11.2M]
  ------------------
   58|  11.7M|        if(str[i] < '0' || str[i] > '9')
  ------------------
  |  Branch (58:12): [True: 17.3k, False: 11.7M]
  |  Branch (58:28): [True: 962, False: 11.7M]
  ------------------
   59|  18.3k|            break;
   60|       |        /* Fast multiplication: n*10 == (n*8) + (n*2) */
   61|  11.7M|        n = (n << 3) + (n << 1) + (uint8_t)(str[i] - '0');
   62|  11.7M|        if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (62:12): [True: 7, False: 11.7M]
  ------------------
   63|      7|            return 0;
   64|  11.7M|        prev = n;
   65|  11.7M|    }
   66|  11.2M|    *result = n;
   67|  11.2M|    return i;
   68|  11.2M|}
parseInt64:
   71|  4.50M|parseInt64(const char *str, size_t size, int64_t *result) {
   72|       |    /* Negative value? */
   73|  4.50M|    size_t i = 0;
   74|  4.50M|    bool neg = false;
   75|  4.50M|    if(*str == '-' || *str == '+') {
  ------------------
  |  Branch (75:8): [True: 6.78k, False: 4.49M]
  |  Branch (75:23): [True: 228, False: 4.49M]
  ------------------
   76|  7.00k|        neg = (*str == '-');
   77|  7.00k|        i++;
   78|  7.00k|    }
   79|       |
   80|       |    /* Parse as unsigned */
   81|  4.50M|    uint64_t n = 0;
   82|  4.50M|    size_t len = parseUInt64(&str[i], size - i, &n);
   83|  4.50M|    if(len == 0)
  ------------------
  |  Branch (83:8): [True: 11, False: 4.50M]
  ------------------
   84|     11|        return 0;
   85|       |
   86|       |    /* Check for overflow, adjust and return */
   87|  4.50M|    if(!neg) {
  ------------------
  |  Branch (87:8): [True: 4.49M, False: 6.77k]
  ------------------
   88|  4.49M|        if(n > 9223372036854775807UL)
  ------------------
  |  Branch (88:12): [True: 0, False: 4.49M]
  ------------------
   89|      0|            return 0;
   90|  4.49M|        *result = (int64_t)n;
   91|  4.49M|    } else {
   92|  6.77k|        if(n > 9223372036854775808UL)
  ------------------
  |  Branch (92:12): [True: 0, False: 6.77k]
  ------------------
   93|      0|            return 0;
   94|  6.77k|        *result = -(int64_t)n;
   95|  6.77k|    }
   96|  4.50M|    return len + i;
   97|  4.50M|}
parseDouble:
   99|  1.83M|size_t parseDouble(const char *str, size_t size, double *result) {
  100|  1.83M|    char buf[2000];
  101|  1.83M|    if(size >= 2000)
  ------------------
  |  Branch (101:8): [True: 1, False: 1.83M]
  ------------------
  102|      1|        return 0;
  103|  1.83M|    memcpy(buf, str, size);
  104|  1.83M|    buf[size] = 0;
  105|  1.83M|    errno = 0;
  106|  1.83M|    char *endptr;
  107|  1.83M|    *result = strtod(buf, &endptr);
  108|  1.83M|    if(errno != 0 && errno != ERANGE)
  ------------------
  |  Branch (108:8): [True: 3.25k, False: 1.83M]
  |  Branch (108:22): [True: 0, False: 3.25k]
  ------------------
  109|      0|        return 0;
  110|  1.83M|    return (uintptr_t)endptr - (uintptr_t)buf;
  111|  1.83M|}

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

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

writeJsonBeforeElement:
   82|  26.4M|writeJsonBeforeElement(CtxJson *ctx, UA_Boolean distinct) {
   83|  26.4M|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  26.4M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   84|       |    /* Comma if needed */
   85|  26.4M|    if(ctx->commaNeeded[ctx->depth])
  ------------------
  |  Branch (85:8): [True: 23.4M, False: 2.99M]
  ------------------
   86|  23.4M|        res |= writeChar(ctx, ',');
   87|  26.4M|    if(ctx->prettyPrint) {
  ------------------
  |  Branch (87:8): [True: 0, False: 26.4M]
  ------------------
   88|      0|        if(distinct) {
  ------------------
  |  Branch (88:12): [True: 0, False: 0]
  ------------------
   89|       |            /* Newline and indent if needed */
   90|      0|            res |= writeChar(ctx, '\n');
   91|      0|            for(size_t i = 0; i < ctx->depth; i++)
  ------------------
  |  Branch (91:31): [True: 0, False: 0]
  ------------------
   92|      0|                res |= writeChar(ctx, '\t');
   93|      0|        } else if(ctx->commaNeeded[ctx->depth]) {
  ------------------
  |  Branch (93:19): [True: 0, False: 0]
  ------------------
   94|       |            /* Space after the comma if no newline */
   95|      0|            res |= writeChar(ctx, ' ');
   96|      0|        }
   97|      0|    }
   98|  26.4M|    return res;
   99|  26.4M|}
writeJsonObjStart:
  101|  3.22M|WRITE_JSON_ELEMENT(ObjStart) {
  102|       |    /* increase depth, save: before first key-value no comma needed. */
  103|  3.22M|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|  3.22M|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (103:8): [True: 0, False: 3.22M]
  ------------------
  104|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  105|  3.22M|    ctx->depth++;
  106|       |    ctx->commaNeeded[ctx->depth] = false;
  107|  3.22M|    return writeChar(ctx, '{');
  108|  3.22M|}
writeJsonObjEnd:
  110|  3.22M|WRITE_JSON_ELEMENT(ObjEnd) {
  111|  3.22M|    if(ctx->depth == 0)
  ------------------
  |  Branch (111:8): [True: 0, False: 3.22M]
  ------------------
  112|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  113|       |
  114|  3.22M|    UA_Boolean have_elem = ctx->commaNeeded[ctx->depth];
  115|  3.22M|    ctx->depth--;
  116|  3.22M|    ctx->commaNeeded[ctx->depth] = true;
  117|       |
  118|  3.22M|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  3.22M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  119|  3.22M|    if(ctx->prettyPrint && have_elem) {
  ------------------
  |  Branch (119:8): [True: 0, False: 3.22M]
  |  Branch (119:28): [True: 0, False: 0]
  ------------------
  120|      0|        res |= writeChar(ctx, '\n');
  121|      0|        for(size_t i = 0; i < ctx->depth; i++)
  ------------------
  |  Branch (121:27): [True: 0, False: 0]
  ------------------
  122|      0|            res |= writeChar(ctx, '\t');
  123|      0|    }
  124|  3.22M|    return res | writeChar(ctx, '}');
  125|  3.22M|}
writeJsonArrStart:
  127|  22.9k|WRITE_JSON_ELEMENT(ArrStart) {
  128|       |    /* increase depth, save: before first array entry no comma needed. */
  129|  22.9k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|  22.9k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (129:8): [True: 0, False: 22.9k]
  ------------------
  130|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  131|  22.9k|    ctx->depth++;
  132|       |    ctx->commaNeeded[ctx->depth] = false;
  133|  22.9k|    return writeChar(ctx, '[');
  134|  22.9k|}
writeJsonArrEnd:
  137|  22.9k|writeJsonArrEnd(CtxJson *ctx, const UA_DataType *type) {
  138|  22.9k|    if(ctx->depth == 0)
  ------------------
  |  Branch (138:8): [True: 0, False: 22.9k]
  ------------------
  139|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  140|  22.9k|    UA_Boolean have_elem = ctx->commaNeeded[ctx->depth];
  141|  22.9k|    ctx->depth--;
  142|  22.9k|    ctx->commaNeeded[ctx->depth] = true;
  143|       |
  144|       |    /* If the array does not contain JSON objects (with a newline after), then
  145|       |     * add the closing ] on the same line */
  146|  22.9k|    UA_Boolean distinct = (!type || type->typeKind > UA_DATATYPEKIND_DOUBLE);
  ------------------
  |  Branch (146:28): [True: 0, False: 22.9k]
  |  Branch (146:37): [True: 7.79k, False: 15.1k]
  ------------------
  147|  22.9k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  22.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  148|  22.9k|    if(ctx->prettyPrint && have_elem && distinct) {
  ------------------
  |  Branch (148:8): [True: 0, False: 22.9k]
  |  Branch (148:28): [True: 0, False: 0]
  |  Branch (148:41): [True: 0, False: 0]
  ------------------
  149|      0|        res |= writeChar(ctx, '\n');
  150|      0|        for(size_t i = 0; i < ctx->depth; i++)
  ------------------
  |  Branch (150:27): [True: 0, False: 0]
  ------------------
  151|      0|            res |= writeChar(ctx, '\t');
  152|      0|    }
  153|  22.9k|    return res | writeChar(ctx, ']');
  154|  22.9k|}
writeJsonArrElm:
  158|  17.5M|                const UA_DataType *type) {
  159|  17.5M|    UA_Boolean distinct = (type->typeKind > UA_DATATYPEKIND_DOUBLE);
  160|  17.5M|    status ret = writeJsonBeforeElement(ctx, distinct);
  161|       |    ctx->commaNeeded[ctx->depth] = true;
  162|  17.5M|    return ret | encodeJsonJumpTable[type->typeKind](ctx, value, type);
  163|  17.5M|}
writeJsonKey:
  210|  5.97M|writeJsonKey(CtxJson *ctx, const char* key) {
  211|  5.97M|    status ret = writeJsonBeforeElement(ctx, true);
  212|  5.97M|    ctx->commaNeeded[ctx->depth] = true;
  213|  5.97M|    if(!ctx->unquotedKeys)
  ------------------
  |  Branch (213:8): [True: 5.97M, False: 0]
  ------------------
  214|  5.97M|        ret |= writeChar(ctx, '\"');
  215|  5.97M|    ret |= writeChars(ctx, key, strlen(key));
  216|  5.97M|    if(!ctx->unquotedKeys)
  ------------------
  |  Branch (216:8): [True: 5.97M, False: 0]
  ------------------
  217|  5.97M|        ret |= writeChar(ctx, '\"');
  218|  5.97M|    ret |= writeChar(ctx, ':');
  219|  5.97M|    if(ctx->prettyPrint)
  ------------------
  |  Branch (219:8): [True: 0, False: 5.97M]
  ------------------
  220|      0|        ret |= writeChar(ctx, ' ');
  221|  5.97M|    return ret;
  222|  5.97M|}
UA_encodeJson:
  933|  4.09k|              const UA_EncodeJsonOptions *options) {
  934|  4.09k|    if(!src || !type)
  ------------------
  |  Branch (934:8): [True: 0, False: 4.09k]
  |  Branch (934:16): [True: 0, False: 4.09k]
  ------------------
  935|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
  936|       |
  937|       |    /* Allocate buffer */
  938|  4.09k|    UA_Boolean allocated = false;
  939|  4.09k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  4.09k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  940|  4.09k|    if(outBuf->length == 0) {
  ------------------
  |  Branch (940:8): [True: 0, False: 4.09k]
  ------------------
  941|      0|        size_t len = UA_calcSizeJson(src, type, options);
  942|      0|        res = UA_ByteString_allocBuffer(outBuf, len);
  943|      0|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (943:12): [True: 0, False: 0]
  ------------------
  944|      0|            return res;
  945|      0|        allocated = true;
  946|      0|    }
  947|       |
  948|       |    /* Set up the context */
  949|  4.09k|    CtxJson ctx;
  950|  4.09k|    memset(&ctx, 0, sizeof(ctx));
  951|  4.09k|    ctx.pos = outBuf->data;
  952|  4.09k|    ctx.end = &outBuf->data[outBuf->length];
  953|  4.09k|    ctx.depth = 0;
  954|  4.09k|    ctx.calcOnly = false;
  955|  4.09k|    ctx.useReversible = true; /* default */
  956|  4.09k|    if(options) {
  ------------------
  |  Branch (956:8): [True: 0, False: 4.09k]
  ------------------
  957|      0|        ctx.namespaceMapping = options->namespaceMapping;
  958|      0|        ctx.serverUris = options->serverUris;
  959|      0|        ctx.serverUrisSize = options->serverUrisSize;
  960|      0|        ctx.useReversible = options->useReversible;
  961|      0|        ctx.prettyPrint = options->prettyPrint;
  962|      0|        ctx.unquotedKeys = options->unquotedKeys;
  963|      0|        ctx.stringNodeIds = options->stringNodeIds;
  964|      0|    }
  965|       |
  966|       |    /* Encode */
  967|  4.09k|    res = encodeJsonJumpTable[type->typeKind](&ctx, src, type);
  968|       |
  969|       |    /* Clean up */
  970|  4.09k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  4.09k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (970:8): [True: 4.09k, False: 0]
  ------------------
  971|  4.09k|        outBuf->length = (size_t)((uintptr_t)ctx.pos - (uintptr_t)outBuf->data);
  972|      0|    else if(allocated)
  ------------------
  |  Branch (972:13): [True: 0, False: 0]
  ------------------
  973|      0|        UA_ByteString_clear(outBuf);
  974|  4.09k|    return res;
  975|  4.09k|}
UA_calcSizeJson:
  997|  2.04k|                const UA_EncodeJsonOptions *options) {
  998|  2.04k|    if(!src || !type)
  ------------------
  |  Branch (998:8): [True: 0, False: 2.04k]
  |  Branch (998:16): [True: 0, False: 2.04k]
  ------------------
  999|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 1000|       |
 1001|       |    /* Set up the context */
 1002|  2.04k|    CtxJson ctx;
 1003|  2.04k|    memset(&ctx, 0, sizeof(ctx));
 1004|  2.04k|    ctx.pos = NULL;
 1005|  2.04k|    ctx.end = (const UA_Byte*)(uintptr_t)SIZE_MAX;
 1006|  2.04k|    ctx.depth = 0;
 1007|  2.04k|    ctx.useReversible = true; /* default */
 1008|  2.04k|    if(options) {
  ------------------
  |  Branch (1008:8): [True: 0, False: 2.04k]
  ------------------
 1009|      0|        ctx.namespaceMapping = options->namespaceMapping;
 1010|      0|        ctx.serverUris = options->serverUris;
 1011|      0|        ctx.serverUrisSize = options->serverUrisSize;
 1012|      0|        ctx.useReversible = options->useReversible;
 1013|      0|        ctx.prettyPrint = options->prettyPrint;
 1014|      0|        ctx.unquotedKeys = options->unquotedKeys;
 1015|      0|        ctx.stringNodeIds = options->stringNodeIds;
 1016|      0|    }
 1017|       |
 1018|  2.04k|    ctx.calcOnly = true;
 1019|       |
 1020|       |    /* Encode */
 1021|  2.04k|    status ret = encodeJsonJumpTable[type->typeKind](&ctx, src, type);
 1022|  2.04k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  2.04k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1022:8): [True: 0, False: 2.04k]
  ------------------
 1023|      0|        return 0;
 1024|  2.04k|    return (size_t)ctx.pos;
 1025|  2.04k|}
lookAheadForKey:
 1435|   331k|lookAheadForKey(ParseCtx *ctx, const char *key, size_t *resultIndex) {
 1436|       |    /* The current index must point to the beginning of an object.
 1437|       |     * This has to be ensured by the caller. */
 1438|   331k|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  397|   331k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1438:5): [True: 331k, False: 0]
  ------------------
 1439|       |
 1440|   331k|    status ret = UA_STATUSCODE_BADNOTFOUND;
  ------------------
  |  |  232|   331k|#define UA_STATUSCODE_BADNOTFOUND ((UA_StatusCode) 0x803E0000)
  ------------------
 1441|   331k|    size_t oldIndex = ctx->index; /* Save index for later restore */
 1442|   331k|    unsigned int end = ctx->tokens[ctx->index].end;
 1443|   331k|    ctx->index++; /* Move to the first key */
 1444|   694k|    while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1444:11): [True: 688k, False: 5.38k]
  ------------------
 1445|   688k|          ctx->tokens[ctx->index].start < end) {
  ------------------
  |  Branch (1445:11): [True: 539k, False: 149k]
  ------------------
 1446|       |        /* Key must be a string */
 1447|   539k|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  397|   539k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1447:9): [True: 539k, False: 0]
  ------------------
 1448|       |
 1449|       |        /* Move index to the value */
 1450|   539k|        ctx->index++;
 1451|       |
 1452|       |        /* Value for the key must exist */
 1453|   539k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  397|   539k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1453:9): [True: 539k, False: 0]
  ------------------
 1454|       |
 1455|       |        /* Compare the key (previous index) */
 1456|   539k|        if(jsoneq(ctx->json5, &ctx->tokens[ctx->index-1], key) == 0) {
  ------------------
  |  Branch (1456:12): [True: 176k, False: 362k]
  ------------------
 1457|   176k|            *resultIndex = ctx->index; /* Point result to the current index */
 1458|   176k|            ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   176k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1459|   176k|            break;
 1460|   176k|        }
 1461|       |
 1462|   362k|        skipObject(ctx); /* Jump over the value (can also be an array or object) */
 1463|   362k|    }
 1464|   331k|    ctx->index = oldIndex; /* Restore the old index */
 1465|   331k|    return ret;
 1466|   331k|}
decodeFields:
 2224|  2.06M|decodeFields(ParseCtx *ctx, DecodeEntry *entries, size_t entryCount) {
 2225|  2.06M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  2.06M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  2.06M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 2.06M]
  |  |  ------------------
  |  | 1038|  2.06M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  2.06M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 2.06M]
  |  |  ------------------
  ------------------
 2226|  2.06M|    CHECK_NULL_SKIP; /* null is treated like an empty object */
  ------------------
  |  | 1061|  2.06M|#define CHECK_NULL_SKIP do {                         \
  |  | 1062|  2.06M|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1062:8): [True: 0, False: 2.06M]
  |  |  ------------------
  |  | 1063|      0|        ctx->index++;                                \
  |  | 1064|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1065|  2.06M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1065:14): [Folded, False: 2.06M]
  |  |  ------------------
  ------------------
 2227|       |
 2228|  2.06M|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|  2.06M|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (2228:8): [True: 0, False: 2.06M]
  ------------------
 2229|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 2230|       |
 2231|       |    /* Keys and values are counted separately */
 2232|  2.06M|    CHECK_OBJECT;
  ------------------
  |  | 1056|  2.06M|#define CHECK_OBJECT do {                                \
  |  | 1057|  2.06M|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1057:8): [True: 0, False: 2.06M]
  |  |  ------------------
  |  | 1058|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1059|  2.06M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1059:14): [Folded, False: 2.06M]
  |  |  ------------------
  ------------------
 2233|  2.06M|    UA_assert(ctx->tokens[ctx->index].size % 2 == 0);
  ------------------
  |  |  397|  2.06M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2233:5): [True: 2.06M, False: 0]
  ------------------
 2234|  2.06M|    size_t keyCount = (size_t)(ctx->tokens[ctx->index].size) / 2;
 2235|       |
 2236|  2.06M|    ctx->index++; /* Go to first key - or jump after the empty object */
 2237|  2.06M|    ctx->depth++;
 2238|       |
 2239|  2.06M|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  2.06M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2240|  4.07M|    for(size_t key = 0; key < keyCount; key++) {
  ------------------
  |  Branch (2240:25): [True: 2.01M, False: 2.06M]
  ------------------
 2241|       |        /* Key must be a string */
 2242|  2.01M|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  397|  2.01M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2242:9): [True: 2.01M, False: 0]
  ------------------
 2243|  2.01M|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  397|  2.01M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2243:9): [True: 2.01M, False: 0]
  ------------------
 2244|       |
 2245|       |        /* Search for the decoding entry matching the key. Start at the key
 2246|       |         * index to speed-up the case where they key-order is the same as the
 2247|       |         * entry-order. */
 2248|  2.01M|        DecodeEntry *entry = NULL;
 2249|  2.04M|        for(size_t i = key; i < key + entryCount; i++) {
  ------------------
  |  Branch (2249:29): [True: 2.04M, False: 57]
  ------------------
 2250|  2.04M|            size_t ii = i;
 2251|  2.04M|            while(ii >= entryCount)
  ------------------
  |  Branch (2251:19): [True: 3.66k, False: 2.04M]
  ------------------
 2252|  3.66k|                ii -= entryCount;
 2253|       |
 2254|       |            /* Compare the key */
 2255|  2.04M|            if(jsoneq(ctx->json5, &ctx->tokens[ctx->index],
  ------------------
  |  Branch (2255:16): [True: 29.6k, False: 2.01M]
  ------------------
 2256|  2.04M|                      entries[ii].fieldName) != 0)
 2257|  29.6k|                continue;
 2258|       |
 2259|       |            /* Key was already used -> duplicate, abort */
 2260|  2.01M|            if(entries[ii].found) {
  ------------------
  |  Branch (2260:16): [True: 1, False: 2.01M]
  ------------------
 2261|      1|                ctx->depth--;
 2262|      1|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2263|      1|            }
 2264|       |
 2265|       |            /* Found the key */
 2266|  2.01M|            entries[ii].found = true;
 2267|  2.01M|            entry = &entries[ii];
 2268|  2.01M|            break;
 2269|  2.01M|        }
 2270|       |
 2271|       |        /* The key is unknown */
 2272|  2.01M|        if(!entry) {
  ------------------
  |  Branch (2272:12): [True: 57, False: 2.01M]
  ------------------
 2273|     57|            ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     57|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2274|     57|            break;
 2275|     57|        }
 2276|       |
 2277|       |        /* Go from key to value */
 2278|  2.01M|        ctx->index++;
 2279|  2.01M|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  397|  2.01M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2279:9): [True: 2.01M, False: 0]
  ------------------
 2280|       |
 2281|       |        /* An entry that was expected but shall not be decoded.
 2282|       |         * Jump over the value. */
 2283|  2.01M|        if(!entry->function && !entry->type) {
  ------------------
  |  Branch (2283:12): [True: 2.01M, False: 0]
  |  Branch (2283:32): [True: 121k, False: 1.89M]
  ------------------
 2284|   121k|            skipObject(ctx);
 2285|   121k|            continue;
 2286|   121k|        }
 2287|       |
 2288|       |        /* A null-value, skip the decoding (the value is already initialized) */
 2289|  1.89M|        if(currentTokenType(ctx) == CJ5_TOKEN_NULL && !entry->function) {
  ------------------
  |  Branch (2289:12): [True: 1.89M, False: 84]
  |  Branch (2289:55): [True: 1.89M, False: 0]
  ------------------
 2290|  1.89M|            ctx->index++; /* skip null value */
 2291|  1.89M|            continue;
 2292|  1.89M|        }
 2293|       |
 2294|       |        /* Decode. This also moves to the next key or right after the object for
 2295|       |         * the last value. */
 2296|     84|        decodeJsonSignature decodeFunc = (entry->function) ?
  ------------------
  |  Branch (2296:42): [True: 0, False: 84]
  ------------------
 2297|     84|            entry->function : decodeJsonJumpTable[entry->type->typeKind];
 2298|     84|        ret = decodeFunc(ctx, entry->fieldPointer, entry->type);
 2299|     84|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|     84|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2299:12): [True: 4, False: 80]
  ------------------
 2300|      4|            break;
 2301|     84|    }
 2302|       |
 2303|  2.06M|    ctx->depth--;
 2304|  2.06M|    return ret;
 2305|  2.06M|}
tokenize:
 2433|  5.91k|         size_t *decodedLength) {
 2434|       |    /* Tokenize */
 2435|  5.91k|    cj5_options options;
 2436|  5.91k|    options.stop_early = (decodedLength != NULL);
 2437|  5.91k|    cj5_result r = cj5_parse((char*)src->data, (unsigned int)src->length,
 2438|  5.91k|                             ctx->tokens, (unsigned int)tokensSize, &options);
 2439|       |
 2440|       |    /* Handle overflow error by allocating the number of tokens the parser would
 2441|       |     * have needed */
 2442|  5.91k|    if(r.error == CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (2442:8): [True: 770, False: 5.14k]
  ------------------
 2443|    770|       tokensSize != r.num_tokens) {
  ------------------
  |  Branch (2443:8): [True: 770, False: 0]
  ------------------
 2444|    770|        ctx->tokens = (cj5_token*)
 2445|    770|            UA_malloc(sizeof(cj5_token) * r.num_tokens);
  ------------------
  |  |   18|    770|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 2446|    770|        if(!ctx->tokens)
  ------------------
  |  Branch (2446:12): [True: 0, False: 770]
  ------------------
 2447|      0|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2448|    770|        return tokenize(ctx, src, r.num_tokens, decodedLength);
 2449|    770|    }
 2450|       |
 2451|       |    /* Cannot recover from other errors */
 2452|  5.14k|    if(r.error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (2452:8): [True: 121, False: 5.02k]
  ------------------
 2453|    121|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    121|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2454|       |
 2455|  5.02k|    if(decodedLength)
  ------------------
  |  Branch (2455:8): [True: 0, False: 5.02k]
  ------------------
 2456|      0|        *decodedLength = ctx->tokens[0].end + 1;
 2457|       |
 2458|       |    /* Set up the context */
 2459|  5.02k|    ctx->json5 = (char*)src->data;
 2460|  5.02k|    ctx->depth = 0;
 2461|  5.02k|    ctx->tokensSize = r.num_tokens;
 2462|  5.02k|    ctx->index = 0;
 2463|  5.02k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  5.02k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2464|  5.14k|}
UA_decodeJson:
 2468|  5.14k|              const UA_DecodeJsonOptions *options) {
 2469|  5.14k|    if(!dst || !src || !type)
  ------------------
  |  Branch (2469:8): [True: 0, False: 5.14k]
  |  Branch (2469:16): [True: 0, False: 5.14k]
  |  Branch (2469:24): [True: 0, False: 5.14k]
  ------------------
 2470|      0|        return UA_STATUSCODE_BADARGUMENTSMISSING;
  ------------------
  |  |  448|      0|#define UA_STATUSCODE_BADARGUMENTSMISSING ((UA_StatusCode) 0x80760000)
  ------------------
 2471|       |
 2472|       |    /* Set up the context */
 2473|  5.14k|    cj5_token tokens[UA_JSON_MAXTOKENCOUNT];
 2474|  5.14k|    ParseCtx ctx;
 2475|  5.14k|    memset(&ctx, 0, sizeof(ParseCtx));
 2476|  5.14k|    ctx.tokens = tokens;
 2477|       |
 2478|  5.14k|    if(options) {
  ------------------
  |  Branch (2478:8): [True: 0, False: 5.14k]
  ------------------
 2479|      0|        ctx.namespaceMapping = options->namespaceMapping;
 2480|      0|        ctx.serverUris = options->serverUris;
 2481|      0|        ctx.serverUrisSize = options->serverUrisSize;
 2482|      0|        ctx.customTypes = options->customTypes;
 2483|      0|    }
 2484|       |
 2485|       |    /* Decode */
 2486|  5.14k|    status ret = tokenize(&ctx, src, UA_JSON_MAXTOKENCOUNT,
  ------------------
  |  |   20|  5.14k|#define UA_JSON_MAXTOKENCOUNT 256
  ------------------
 2487|  5.14k|                          options ? options->decodedLength : NULL);
  ------------------
  |  Branch (2487:27): [True: 0, False: 5.14k]
  ------------------
 2488|  5.14k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  5.14k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2488:8): [True: 121, False: 5.02k]
  ------------------
 2489|    121|        goto cleanup;
 2490|       |
 2491|  5.02k|    memset(dst, 0, type->memSize); /* Initialize the value */
 2492|  5.02k|    ret = decodeJsonJumpTable[type->typeKind](&ctx, dst, type);
 2493|       |
 2494|       |    /* Sanity check if all tokens were processed */
 2495|  5.02k|    if(ctx.index != ctx.tokensSize &&
  ------------------
  |  Branch (2495:8): [True: 90, False: 4.93k]
  ------------------
 2496|     90|       ctx.index != ctx.tokensSize - 1)
  ------------------
  |  Branch (2496:8): [True: 68, False: 22]
  ------------------
 2497|     68|        ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     68|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2498|       |
 2499|  5.14k| cleanup:
 2500|       |
 2501|       |    /* Free token array on the heap */
 2502|  5.14k|    if(ctx.tokens != tokens)
  ------------------
  |  Branch (2502:8): [True: 770, False: 4.37k]
  ------------------
 2503|    770|        UA_free((void*)(uintptr_t)ctx.tokens);
  ------------------
  |  |   19|    770|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2504|       |
 2505|  5.14k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  5.14k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2505:8): [True: 1.04k, False: 4.09k]
  ------------------
 2506|  1.04k|        UA_clear(dst, type);
 2507|  5.14k|    return ret;
 2508|  5.02k|}
ua_types_encoding_json.c:writeChar:
   54|  48.2M|writeChar(CtxJson *ctx, char c) {
   55|  48.2M|    if(ctx->pos >= ctx->end)
  ------------------
  |  Branch (55:8): [True: 0, False: 48.2M]
  ------------------
   56|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
   57|  48.2M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (57:8): [True: 32.1M, False: 16.0M]
  ------------------
   58|  32.1M|        *ctx->pos = (UA_Byte)c;
   59|  48.2M|    ctx->pos++;
   60|  48.2M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  48.2M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   61|  48.2M|}
ua_types_encoding_json.c:writeChars:
   64|  11.8M|writeChars(CtxJson *ctx, const char *c, size_t len) {
   65|  11.8M|    if(ctx->pos + len > ctx->end)
  ------------------
  |  Branch (65:8): [True: 0, False: 11.8M]
  ------------------
   66|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
   67|  11.8M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (67:8): [True: 7.89M, False: 3.94M]
  ------------------
   68|  7.89M|        memcpy(ctx->pos, c, len);
   69|  11.8M|    ctx->pos += len;
   70|  11.8M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  11.8M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   71|  11.8M|}
ua_types_encoding_json.c:Boolean_encodeJson:
  234|  18.0k|ENCODE_JSON(Boolean) {
  235|  18.0k|    if(*src == true)
  ------------------
  |  Branch (235:8): [True: 786, False: 17.2k]
  ------------------
  236|    786|        return writeChars(ctx, "true", 4);
  237|  17.2k|    return writeChars(ctx, "false", 5);
  238|  18.0k|}
ua_types_encoding_json.c:SByte_encodeJson:
  257|   623k|ENCODE_JSON(SByte) {
  258|   623k|    char buf[5];
  259|   623k|    UA_UInt16 digits = itoaSigned(*src, buf);
  260|   623k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (260:8): [True: 0, False: 623k]
  ------------------
  261|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  262|   623k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (262:8): [True: 415k, False: 207k]
  ------------------
  263|   415k|        memcpy(ctx->pos, buf, digits);
  264|   623k|    ctx->pos += digits;
  265|   623k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   623k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  266|   623k|}
ua_types_encoding_json.c:Byte_encodeJson:
  241|  24.7k|ENCODE_JSON(Byte) {
  242|  24.7k|    char buf[4];
  243|  24.7k|    UA_UInt16 digits = itoaUnsigned(*src, buf, 10);
  244|       |
  245|       |    /* Ensure destination can hold the data- */
  246|  24.7k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (246:8): [True: 0, False: 24.7k]
  ------------------
  247|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  248|       |
  249|       |    /* Copy digits to the output string/buffer. */
  250|  24.7k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (250:8): [True: 16.4k, False: 8.24k]
  ------------------
  251|  16.4k|        memcpy(ctx->pos, buf, digits);
  252|  24.7k|    ctx->pos += digits;
  253|  24.7k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  24.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  254|  24.7k|}
ua_types_encoding_json.c:Int16_encodeJson:
  283|  29.5k|ENCODE_JSON(Int16) {
  284|  29.5k|    char buf[7];
  285|  29.5k|    UA_UInt16 digits = itoaSigned(*src, buf);
  286|       |
  287|  29.5k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (287:8): [True: 0, False: 29.5k]
  ------------------
  288|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  289|       |
  290|  29.5k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (290:8): [True: 19.6k, False: 9.84k]
  ------------------
  291|  19.6k|        memcpy(ctx->pos, buf, digits);
  292|  29.5k|    ctx->pos += digits;
  293|  29.5k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  29.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  294|  29.5k|}
ua_types_encoding_json.c:UInt16_encodeJson:
  269|  95.6k|ENCODE_JSON(UInt16) {
  270|  95.6k|    char buf[6];
  271|  95.6k|    UA_UInt16 digits = itoaUnsigned(*src, buf, 10);
  272|       |
  273|  95.6k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (273:8): [True: 0, False: 95.6k]
  ------------------
  274|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  275|       |
  276|  95.6k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (276:8): [True: 63.7k, False: 31.8k]
  ------------------
  277|  63.7k|        memcpy(ctx->pos, buf, digits);
  278|  95.6k|    ctx->pos += digits;
  279|  95.6k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  95.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  280|  95.6k|}
ua_types_encoding_json.c:Int32_encodeJson:
  311|  2.27M|ENCODE_JSON(Int32) {
  312|  2.27M|    char buf[12];
  313|  2.27M|    UA_UInt16 digits = itoaSigned(*src, buf);
  314|       |
  315|  2.27M|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (315:8): [True: 0, False: 2.27M]
  ------------------
  316|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  317|       |
  318|  2.27M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (318:8): [True: 1.51M, False: 758k]
  ------------------
  319|  1.51M|        memcpy(ctx->pos, buf, digits);
  320|  2.27M|    ctx->pos += digits;
  321|  2.27M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  2.27M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  322|  2.27M|}
ua_types_encoding_json.c:UInt32_encodeJson:
  297|  3.07M|ENCODE_JSON(UInt32) {
  298|  3.07M|    char buf[11];
  299|  3.07M|    UA_UInt16 digits = itoaUnsigned(*src, buf, 10);
  300|       |
  301|  3.07M|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (301:8): [True: 0, False: 3.07M]
  ------------------
  302|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  303|       |
  304|  3.07M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (304:8): [True: 2.05M, False: 1.02M]
  ------------------
  305|  2.05M|        memcpy(ctx->pos, buf, digits);
  306|  3.07M|    ctx->pos += digits;
  307|  3.07M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  3.07M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  308|  3.07M|}
ua_types_encoding_json.c:Int64_encodeJson:
  342|  2.97M|ENCODE_JSON(Int64) {
  343|  2.97M|    char buf[23];
  344|  2.97M|    buf[0] = '\"';
  345|  2.97M|    UA_UInt16 digits = itoaSigned(*src, buf + 1);
  346|  2.97M|    buf[digits + 1] = '\"';
  347|  2.97M|    UA_UInt16 length = (UA_UInt16)(digits + 2);
  348|       |
  349|  2.97M|    if(ctx->pos + length > ctx->end)
  ------------------
  |  Branch (349:8): [True: 0, False: 2.97M]
  ------------------
  350|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  351|       |
  352|  2.97M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (352:8): [True: 1.98M, False: 991k]
  ------------------
  353|  1.98M|        memcpy(ctx->pos, buf, length);
  354|  2.97M|    ctx->pos += length;
  355|  2.97M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  2.97M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  356|  2.97M|}
ua_types_encoding_json.c:UInt64_encodeJson:
  325|  5.38M|ENCODE_JSON(UInt64) {
  326|  5.38M|    char buf[23];
  327|  5.38M|    buf[0] = '\"';
  328|  5.38M|    UA_UInt16 digits = itoaUnsigned(*src, buf + 1, 10);
  329|  5.38M|    buf[digits + 1] = '\"';
  330|  5.38M|    UA_UInt16 length = (UA_UInt16)(digits + 2);
  331|       |
  332|  5.38M|    if(ctx->pos + length > ctx->end)
  ------------------
  |  Branch (332:8): [True: 0, False: 5.38M]
  ------------------
  333|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  334|       |
  335|  5.38M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (335:8): [True: 3.58M, False: 1.79M]
  ------------------
  336|  3.58M|        memcpy(ctx->pos, buf, length);
  337|  5.38M|    ctx->pos += length;
  338|  5.38M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  5.38M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  339|  5.38M|}
ua_types_encoding_json.c:Float_encodeJson:
  358|  1.83M|ENCODE_JSON(Float) {
  359|  1.83M|    char buffer[32];
  360|  1.83M|    size_t len;
  361|  1.83M|    if(*src != *src) {
  ------------------
  |  Branch (361:8): [True: 12.0k, False: 1.82M]
  ------------------
  362|  12.0k|        strcpy(buffer, "\"NaN\"");
  363|  12.0k|        len = strlen(buffer);
  364|  1.82M|    } else if(*src == INFINITY) {
  ------------------
  |  Branch (364:15): [True: 1.78k, False: 1.82M]
  ------------------
  365|  1.78k|        strcpy(buffer, "\"Infinity\"");
  366|  1.78k|        len = strlen(buffer);
  367|  1.82M|    } else if(*src == -INFINITY) {
  ------------------
  |  Branch (367:15): [True: 1.53k, False: 1.82M]
  ------------------
  368|  1.53k|        strcpy(buffer, "\"-Infinity\"");
  369|  1.53k|        len = strlen(buffer);
  370|  1.82M|    } else {
  371|  1.82M|        len = dtoa((UA_Double)*src, buffer);
  372|  1.82M|    }
  373|       |
  374|  1.83M|    if(ctx->pos + len > ctx->end)
  ------------------
  |  Branch (374:8): [True: 0, False: 1.83M]
  ------------------
  375|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  376|       |
  377|  1.83M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (377:8): [True: 1.22M, False: 612k]
  ------------------
  378|  1.22M|        memcpy(ctx->pos, buffer, len);
  379|  1.83M|    ctx->pos += len;
  380|  1.83M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.83M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  381|  1.83M|}
ua_types_encoding_json.c:Double_encodeJson:
  383|   921k|ENCODE_JSON(Double) {
  384|   921k|    char buffer[32];
  385|   921k|    size_t len;
  386|   921k|    if(*src != *src) {
  ------------------
  |  Branch (386:8): [True: 1.56k, False: 919k]
  ------------------
  387|  1.56k|        strcpy(buffer, "\"NaN\"");
  388|  1.56k|        len = strlen(buffer);
  389|   919k|    } else if(*src == INFINITY) {
  ------------------
  |  Branch (389:15): [True: 996, False: 918k]
  ------------------
  390|    996|        strcpy(buffer, "\"Infinity\"");
  391|    996|        len = strlen(buffer);
  392|   918k|    } else if(*src == -INFINITY) {
  ------------------
  |  Branch (392:15): [True: 960, False: 917k]
  ------------------
  393|    960|        strcpy(buffer, "\"-Infinity\"");
  394|    960|        len = strlen(buffer);
  395|   917k|    } else {
  396|   917k|        len = dtoa(*src, buffer);
  397|   917k|    }
  398|       |
  399|   921k|    if(ctx->pos + len > ctx->end)
  ------------------
  |  Branch (399:8): [True: 0, False: 921k]
  ------------------
  400|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  401|       |
  402|   921k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (402:8): [True: 614k, False: 307k]
  ------------------
  403|   614k|        memcpy(ctx->pos, buffer, len);
  404|   921k|    ctx->pos += len;
  405|   921k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   921k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  406|   921k|}
ua_types_encoding_json.c:String_encodeJson:
  435|  5.83M|ENCODE_JSON(String) {
  436|  5.83M|    if(!src->data)
  ------------------
  |  Branch (436:8): [True: 5.68M, False: 148k]
  ------------------
  437|  5.68M|        return writeChars(ctx, "null", 4);
  438|       |
  439|   148k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   148k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  440|   148k|    if(src->length == 0) {
  ------------------
  |  Branch (440:8): [True: 12.3k, False: 135k]
  ------------------
  441|  12.3k|        ret |= writeJsonQuote(ctx);
  442|  12.3k|        ret |= writeJsonQuote(ctx);
  443|  12.3k|        return ret;
  444|  12.3k|    }
  445|       |
  446|   135k|    ret |= writeJsonQuote(ctx);
  447|       |
  448|   135k|    const unsigned char *end = src->data + src->length;
  449|  9.10M|    for(const unsigned char *pos = src->data; pos < end; pos++) {
  ------------------
  |  Branch (449:47): [True: 9.09M, False: 2.51k]
  ------------------
  450|       |        /* Skip to the first character that needs escaping */
  451|  9.09M|        const unsigned char *start = pos;
  452|  32.3M|        for(; pos < end; pos++) {
  ------------------
  |  Branch (452:15): [True: 32.2M, False: 133k]
  ------------------
  453|  32.2M|            if(*pos < ' ' || *pos == 127 || *pos == '\\' || *pos == '\"')
  ------------------
  |  Branch (453:16): [True: 2.79M, False: 29.4M]
  |  Branch (453:30): [True: 18.9k, False: 29.4M]
  |  Branch (453:45): [True: 8.93k, False: 29.4M]
  |  Branch (453:61): [True: 6.14M, False: 23.2M]
  ------------------
  454|  8.96M|                break;
  455|  32.2M|        }
  456|       |
  457|       |        /* Write out the unescaped sequence */
  458|  9.09M|        if(ctx->pos + (pos - start) > ctx->end)
  ------------------
  |  Branch (458:12): [True: 0, False: 9.09M]
  ------------------
  459|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  460|  9.09M|        if(!ctx->calcOnly)
  ------------------
  |  Branch (460:12): [True: 6.06M, False: 3.03M]
  ------------------
  461|  6.06M|            memcpy(ctx->pos, start, (size_t)(pos - start));
  462|  9.09M|        ctx->pos += pos - start;
  463|       |
  464|       |        /* The unescaped sequence reached the end */
  465|  9.09M|        if(pos == end)
  ------------------
  |  Branch (465:12): [True: 133k, False: 8.96M]
  ------------------
  466|   133k|            break;
  467|       |
  468|       |        /* Write an escaped character */
  469|  8.96M|        char *escape_text;
  470|  8.96M|        char escape_buf[6];
  471|  8.96M|        size_t escape_len = 2;
  472|  8.96M|        switch(*pos) {
  473|    318|        case '\b': escape_text = "\\b"; break;
  ------------------
  |  Branch (473:9): [True: 318, False: 8.96M]
  ------------------
  474|  1.48k|        case '\f': escape_text = "\\f"; break;
  ------------------
  |  Branch (474:9): [True: 1.48k, False: 8.96M]
  ------------------
  475|   117k|        case '\n': escape_text = "\\n"; break;
  ------------------
  |  Branch (475:9): [True: 117k, False: 8.84M]
  ------------------
  476|    387|        case '\r': escape_text = "\\r"; break;
  ------------------
  |  Branch (476:9): [True: 387, False: 8.96M]
  ------------------
  477|    888|        case '\t': escape_text = "\\t"; break;
  ------------------
  |  Branch (477:9): [True: 888, False: 8.96M]
  ------------------
  478|  8.84M|        default:
  ------------------
  |  Branch (478:9): [True: 8.84M, False: 120k]
  ------------------
  479|  8.84M|            escape_text = escape_buf;
  480|  8.84M|            if(*pos >= ' ' && *pos != 127) {
  ------------------
  |  Branch (480:16): [True: 6.17M, False: 2.67M]
  |  Branch (480:31): [True: 6.15M, False: 18.9k]
  ------------------
  481|       |                /* Escape \ or " */
  482|  6.15M|                escape_buf[0] = '\\';
  483|  6.15M|                escape_buf[1] = (char)*pos;
  484|  6.15M|            } else {
  485|       |                /* Unprintable characters need to be escaped */
  486|  2.69M|                escape_buf[0] = '\\';
  487|  2.69M|                escape_buf[1] = 'u';
  488|  2.69M|                escape_buf[2] = '0';
  489|  2.69M|                escape_buf[3] = '0';
  490|  2.69M|                escape_buf[4] = hexmap[*pos >> 4];
  491|  2.69M|                escape_buf[5] = hexmap[*pos & 0x0f];
  492|  2.69M|                escape_len = 6;
  493|  2.69M|            }
  494|  8.84M|            break;
  495|  8.96M|        }
  496|       |
  497|       |        /* Enough space? */
  498|  8.96M|        if(ctx->pos + escape_len > ctx->end)
  ------------------
  |  Branch (498:12): [True: 0, False: 8.96M]
  ------------------
  499|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  500|       |
  501|       |        /* Write the escaped character */
  502|  8.96M|        if(!ctx->calcOnly)
  ------------------
  |  Branch (502:12): [True: 5.97M, False: 2.98M]
  ------------------
  503|  5.97M|            memcpy(ctx->pos, escape_text, escape_len);
  504|  8.96M|        ctx->pos += escape_len;
  505|  8.96M|    }
  506|       |
  507|   135k|    return ret | writeJsonQuote(ctx);
  508|   135k|}
ua_types_encoding_json.c:writeJsonQuote:
   77|   307k|static WRITE_JSON_ELEMENT(Quote) {
   78|   307k|    return writeChar(ctx, '\"');
   79|   307k|}
ua_types_encoding_json.c:DateTime_encodeJson:
  556|  26.2k|ENCODE_JSON(DateTime) {
  557|  26.2k|    UA_Byte buffer[40];
  558|  26.2k|    UA_String str = {40, buffer};
  559|  26.2k|    encodeDateTime(*src, &str);
  560|       |    return ENCODE_DIRECT_JSON(&str, String);
  ------------------
  |  |   51|  26.2k|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  561|  26.2k|}
ua_types_encoding_json.c:Guid_encodeJson:
  545|  3.44k|ENCODE_JSON(Guid) {
  546|  3.44k|    if(ctx->pos + 38 > ctx->end) /* 36 + 2 (") */
  ------------------
  |  Branch (546:8): [True: 0, False: 3.44k]
  ------------------
  547|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  548|  3.44k|    status ret = writeJsonQuote(ctx);
  549|  3.44k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (549:8): [True: 2.29k, False: 1.14k]
  ------------------
  550|  2.29k|        UA_Guid_to_hex(src, ctx->pos, false);
  551|  3.44k|    ctx->pos += 36;
  552|  3.44k|    return ret | writeJsonQuote(ctx);
  553|  3.44k|}
ua_types_encoding_json.c:ByteString_encodeJson:
  510|  3.02k|ENCODE_JSON(ByteString) {
  511|  3.02k|    if(!src->data)
  ------------------
  |  Branch (511:8): [True: 933, False: 2.09k]
  ------------------
  512|    933|        return writeChars(ctx, "null", 4);
  513|       |
  514|  2.09k|    if(src->length == 0) {
  ------------------
  |  Branch (514:8): [True: 1.85k, False: 237]
  ------------------
  515|  1.85k|        status retval = writeJsonQuote(ctx);
  516|  1.85k|        retval |= writeJsonQuote(ctx);
  517|  1.85k|        return retval;
  518|  1.85k|    }
  519|       |
  520|    237|    status ret = writeJsonQuote(ctx);
  521|    237|    size_t flen = 0;
  522|    237|    unsigned char *ba64 = UA_base64(src->data, src->length, &flen);
  523|       |
  524|       |    /* Not converted, no mem */
  525|    237|    if(!ba64)
  ------------------
  |  Branch (525:8): [True: 0, False: 237]
  ------------------
  526|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  527|       |
  528|    237|    if(ctx->pos + flen > ctx->end) {
  ------------------
  |  Branch (528:8): [True: 0, False: 237]
  ------------------
  529|      0|        UA_free(ba64);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  530|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  531|      0|    }
  532|       |
  533|       |    /* Copy flen bytes to output stream. */
  534|    237|    if(!ctx->calcOnly)
  ------------------
  |  Branch (534:8): [True: 158, False: 79]
  ------------------
  535|    158|        memcpy(ctx->pos, ba64, flen);
  536|    237|    ctx->pos += flen;
  537|       |
  538|       |    /* Base64 result no longer needed */
  539|    237|    UA_free(ba64);
  ------------------
  |  |   19|    237|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  540|       |
  541|    237|    return ret | writeJsonQuote(ctx);
  542|    237|}
ua_types_encoding_json.c:NodeId_encodeJson:
  564|  6.54k|ENCODE_JSON(NodeId) {
  565|  6.54k|    UA_String out = UA_STRING_NULL;
  566|  6.54k|    UA_StatusCode ret = UA_NodeId_printEx(src, &out, ctx->namespaceMapping);
  567|       |    ret |= ENCODE_DIRECT_JSON(&out, String);
  ------------------
  |  |   51|  6.54k|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  568|  6.54k|    UA_String_clear(&out);
  569|  6.54k|    return ret;
  570|  6.54k|}
ua_types_encoding_json.c:ExpandedNodeId_encodeJson:
  573|  26.8k|ENCODE_JSON(ExpandedNodeId) {
  574|  26.8k|    UA_String out = UA_STRING_NULL;
  575|  26.8k|    UA_StatusCode ret = UA_ExpandedNodeId_printEx(src, &out, ctx->namespaceMapping,
  576|  26.8k|                                                  ctx->serverUrisSize, ctx->serverUris);
  577|       |    ret |= ENCODE_DIRECT_JSON(&out, String);
  ------------------
  |  |   51|  26.8k|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  578|  26.8k|    UA_String_clear(&out);
  579|  26.8k|    return ret;
  580|  26.8k|}
ua_types_encoding_json.c:StatusCode_encodeJson:
  600|  1.81k|ENCODE_JSON(StatusCode) {
  601|  1.81k|    const char *codename = UA_StatusCode_name(*src);
  602|  1.81k|    UA_String statusDescription = UA_STRING((char*)(uintptr_t)codename);
  603|       |
  604|  1.81k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.81k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  605|  1.81k|    ret |= writeJsonObjStart(ctx);
  606|  1.81k|    if(*src > UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  1.81k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (606:8): [True: 96, False: 1.72k]
  ------------------
  607|     96|        ret |= writeJsonKey(ctx, UA_JSONKEY_CODE);
  608|     96|        ret |= ENCODE_DIRECT_JSON(src, UInt32);
  ------------------
  |  |   51|     96|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  609|     96|        if(codename) {
  ------------------
  |  Branch (609:12): [True: 96, False: 0]
  ------------------
  610|     96|            ret |= writeJsonKey(ctx, UA_JSONKEY_SYMBOL);
  611|       |            ret |= ENCODE_DIRECT_JSON(&statusDescription, String);
  ------------------
  |  |   51|     96|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  612|     96|        }
  613|     96|    }
  614|  1.81k|    ret |= writeJsonObjEnd(ctx);
  615|  1.81k|    return ret;
  616|  1.81k|}
ua_types_encoding_json.c:QualifiedName_encodeJson:
  592|  87.4k|ENCODE_JSON(QualifiedName) {
  593|  87.4k|    UA_String out = UA_STRING_NULL;
  594|  87.4k|    UA_StatusCode ret = UA_QualifiedName_printEx(src, &out, ctx->namespaceMapping);
  595|       |    ret |= ENCODE_DIRECT_JSON(&out, String);
  ------------------
  |  |   51|  87.4k|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  596|  87.4k|    UA_String_clear(&out);
  597|  87.4k|    return ret;
  598|  87.4k|}
ua_types_encoding_json.c:LocalizedText_encodeJson:
  583|  2.83M|ENCODE_JSON(LocalizedText) {
  584|  2.83M|    status ret = writeJsonObjStart(ctx);
  585|  2.83M|    ret |= writeJsonKey(ctx, UA_JSONKEY_LOCALE);
  586|  2.83M|    ret |= ENCODE_DIRECT_JSON(&src->locale, String);
  ------------------
  |  |   51|  2.83M|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  587|  2.83M|    ret |= writeJsonKey(ctx, UA_JSONKEY_TEXT);
  588|       |    ret |= ENCODE_DIRECT_JSON(&src->text, String);
  ------------------
  |  |   51|  2.83M|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  589|  2.83M|    return ret | writeJsonObjEnd(ctx);
  590|  2.83M|}
ua_types_encoding_json.c:ExtensionObject_encodeJson:
  619|   152k|ENCODE_JSON(ExtensionObject) {
  620|   152k|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_NOBODY)
  ------------------
  |  Branch (620:8): [True: 152k, False: 0]
  ------------------
  621|   152k|        return writeChars(ctx, "null", 4);
  622|       |
  623|       |    /* Must have a type set if data is decoded */
  624|      0|    if(src->encoding != UA_EXTENSIONOBJECT_ENCODED_BYTESTRING &&
  ------------------
  |  Branch (624:8): [True: 0, False: 0]
  ------------------
  625|      0|       src->encoding != UA_EXTENSIONOBJECT_ENCODED_XML &&
  ------------------
  |  Branch (625:8): [True: 0, False: 0]
  ------------------
  626|      0|       !src->content.decoded.type)
  ------------------
  |  Branch (626:8): [True: 0, False: 0]
  ------------------
  627|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  628|       |
  629|      0|    status ret = writeJsonObjStart(ctx);
  630|       |
  631|       |    /* Write the type NodeId */
  632|      0|    ret |= writeJsonKey(ctx, UA_JSONKEY_TYPEID);
  633|      0|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_BYTESTRING ||
  ------------------
  |  Branch (633:8): [True: 0, False: 0]
  ------------------
  634|      0|       src->encoding == UA_EXTENSIONOBJECT_ENCODED_XML)
  ------------------
  |  Branch (634:8): [True: 0, False: 0]
  ------------------
  635|      0|        ret |= ENCODE_DIRECT_JSON(&src->content.encoded.typeId, NodeId);
  ------------------
  |  |   51|      0|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  636|      0|    else
  637|      0|        ret |= ENCODE_DIRECT_JSON(&src->content.decoded.type->typeId, NodeId);
  ------------------
  |  |   51|      0|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  638|       |
  639|       |    /* Write the encoding type and body if encoded */
  640|      0|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_BYTESTRING ||
  ------------------
  |  Branch (640:8): [True: 0, False: 0]
  ------------------
  641|      0|       src->encoding == UA_EXTENSIONOBJECT_ENCODED_XML) {
  ------------------
  |  Branch (641:8): [True: 0, False: 0]
  ------------------
  642|      0|        if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_BYTESTRING) {
  ------------------
  |  Branch (642:12): [True: 0, False: 0]
  ------------------
  643|      0|            ret |= writeJsonKey(ctx, UA_JSONKEY_ENCODING);
  644|      0|            ret |= writeChar(ctx, '1');
  645|      0|        } else {
  646|      0|            ret |= writeJsonKey(ctx, UA_JSONKEY_ENCODING);
  647|      0|            ret |= writeChar(ctx, '2');
  648|      0|        }
  649|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_BODY);
  650|      0|        ret |= ENCODE_DIRECT_JSON(&src->content.encoded.body, String);
  ------------------
  |  |   51|      0|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  651|      0|        return ret | writeJsonObjEnd(ctx);
  652|      0|    }
  653|       |
  654|      0|    const UA_DataType *t = src->content.decoded.type;
  655|      0|    if(t->typeKind == UA_DATATYPEKIND_STRUCTURE) {
  ------------------
  |  Branch (655:8): [True: 0, False: 0]
  ------------------
  656|       |        /* Write structures in-situ.
  657|       |         * TODO: Structures with optional fields and unions */
  658|      0|        ret |= encodeJsonStructureContent(ctx, src->content.decoded.data, t);
  659|      0|    } else {
  660|       |        /* NON-STANDARD: The standard 1.05 doesn't let us print non-structure
  661|       |         * types in ExtensionObjects (e.g. enums). Print them in the body. */
  662|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_BODY);
  663|      0|        ret |= encodeJsonJumpTable[t->typeKind](ctx, src->content.decoded.data, t);
  664|      0|    }
  665|       |
  666|      0|    return ret | writeJsonObjEnd(ctx);
  667|      0|}
ua_types_encoding_json.c:encodeJsonArray:
  410|  4.83k|                const UA_DataType *type) {
  411|       |    /* Null-arrays (length -1) are written as empty arrays '[]'.
  412|       |     * TODO: Clarify the difference between length -1 and length 0 in JSON. */
  413|  4.83k|    status ret = writeJsonArrStart(ctx);
  414|  4.83k|    if(!ptr)
  ------------------
  |  Branch (414:8): [True: 0, False: 4.83k]
  ------------------
  415|      0|        return ret | writeJsonArrEnd(ctx, type);
  416|       |
  417|  4.83k|    uintptr_t uptr = (uintptr_t)ptr;
  418|  4.83k|    encodeJsonSignature encodeType = encodeJsonJumpTable[type->typeKind];
  419|  4.83k|    UA_Boolean distinct = (type->typeKind > UA_DATATYPEKIND_DOUBLE);
  420|  2.93M|    for(size_t i = 0; i < length && ret == UA_STATUSCODE_GOOD; ++i) {
  ------------------
  |  |   16|  2.92M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (420:23): [True: 2.92M, False: 4.83k]
  |  Branch (420:37): [True: 2.92M, False: 0]
  ------------------
  421|  2.92M|        ret |= writeJsonBeforeElement(ctx, distinct);
  422|  2.92M|        if(isNull((const void*)uptr, type))
  ------------------
  |  Branch (422:12): [True: 0, False: 2.92M]
  ------------------
  423|      0|            ret |= writeChars(ctx, "null", 4);
  424|  2.92M|        else
  425|  2.92M|            ret |= encodeType(ctx, (const void*)uptr, type);
  426|       |        ctx->commaNeeded[ctx->depth] = true;
  427|  2.92M|        uptr += type->memSize;
  428|  2.92M|    }
  429|  4.83k|    return ret | writeJsonArrEnd(ctx, type);
  430|  4.83k|}
ua_types_encoding_json.c:isNull:
  225|  2.92M|isNull(const void *p, const UA_DataType *type) {
  226|  2.92M|    if(UA_DataType_isNumeric(type) || type->typeKind == UA_DATATYPEKIND_BOOLEAN)
  ------------------
  |  Branch (226:8): [True: 2.92M, False: 0]
  |  Branch (226:39): [True: 0, False: 0]
  ------------------
  227|  2.92M|        return false;
  228|      0|    UA_STACKARRAY(char, buf, type->memSize);
  ------------------
  |  |  373|      0|#  define UA_STACKARRAY(TYPE, NAME, SIZE) TYPE NAME[SIZE]
  ------------------
  229|      0|    memset(buf, 0, type->memSize);
  230|      0|    return UA_equal(buf, p, type);
  231|  2.92M|}
ua_types_encoding_json.c:DataValue_encodeJson:
  775|   227k|ENCODE_JSON(DataValue) {
  776|   227k|    UA_Boolean hasValue = src->hasValue;
  777|   227k|    UA_Boolean hasStatus = src->hasStatus;
  778|   227k|    UA_Boolean hasSourceTimestamp = src->hasSourceTimestamp;
  779|   227k|    UA_Boolean hasSourcePicoseconds = src->hasSourcePicoseconds;
  780|   227k|    UA_Boolean hasServerTimestamp = src->hasServerTimestamp;
  781|   227k|    UA_Boolean hasServerPicoseconds = src->hasServerPicoseconds;
  782|       |
  783|   227k|    status ret = writeJsonObjStart(ctx);
  784|       |
  785|   227k|    if(hasValue)
  ------------------
  |  Branch (785:8): [True: 104k, False: 123k]
  ------------------
  786|   104k|        ret |= encodeVariantInner(ctx, &src->value);
  787|       |
  788|   227k|    if(hasStatus) {
  ------------------
  |  Branch (788:8): [True: 21, False: 227k]
  ------------------
  789|     21|        ret |= writeJsonKey(ctx, UA_JSONKEY_STATUS);
  790|     21|        ret |= ENCODE_DIRECT_JSON(&src->status, StatusCode);
  ------------------
  |  |   51|     21|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  791|     21|    }
  792|       |
  793|   227k|    if(hasSourceTimestamp) {
  ------------------
  |  Branch (793:8): [True: 0, False: 227k]
  ------------------
  794|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SOURCETIMESTAMP);
  795|      0|        ret |= ENCODE_DIRECT_JSON(&src->sourceTimestamp, DateTime);
  ------------------
  |  |   51|      0|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  796|      0|    }
  797|       |
  798|   227k|    if(hasSourcePicoseconds) {
  ------------------
  |  Branch (798:8): [True: 0, False: 227k]
  ------------------
  799|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SOURCEPICOSECONDS);
  800|      0|        ret |= ENCODE_DIRECT_JSON(&src->sourcePicoseconds, UInt16);
  ------------------
  |  |   51|      0|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  801|      0|    }
  802|       |
  803|   227k|    if(hasServerTimestamp) {
  ------------------
  |  Branch (803:8): [True: 0, False: 227k]
  ------------------
  804|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SERVERTIMESTAMP);
  805|      0|        ret |= ENCODE_DIRECT_JSON(&src->serverTimestamp, DateTime);
  ------------------
  |  |   51|      0|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  806|      0|    }
  807|       |
  808|   227k|    if(hasServerPicoseconds) {
  ------------------
  |  Branch (808:8): [True: 0, False: 227k]
  ------------------
  809|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SERVERPICOSECONDS);
  810|      0|        ret |= ENCODE_DIRECT_JSON(&src->serverPicoseconds, UInt16);
  ------------------
  |  |   51|      0|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  811|      0|    }
  812|       |
  813|   227k|    return ret | writeJsonObjEnd(ctx);
  814|   227k|}
ua_types_encoding_json.c:encodeVariantInner:
  725|   261k|encodeVariantInner(CtxJson *ctx, const UA_Variant *src) {
  726|       |    /* If type is 0 (NULL) the Variant contains a NULL value and the containing
  727|       |     * JSON object shall be omitted or replaced by the JSON literal ‘null’ (when
  728|       |     * an element of a JSON array). */
  729|   261k|    if(!src->type)
  ------------------
  |  Branch (729:8): [True: 116k, False: 145k]
  ------------------
  730|   116k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   116k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  731|       |
  732|       |    /* Set the array type in the encoding mask */
  733|   145k|    const bool isArray = src->arrayLength > 0 || src->data <= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|   281k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (733:26): [True: 9.43k, False: 136k]
  |  Branch (733:50): [True: 8.70k, False: 127k]
  ------------------
  734|   145k|    const bool hasDimensions = isArray && src->arrayDimensionsSize > 1;
  ------------------
  |  Branch (734:32): [True: 18.1k, False: 127k]
  |  Branch (734:43): [True: 4.83k, False: 13.3k]
  ------------------
  735|       |
  736|       |    /* Wrap the value in an ExtensionObject if not builtin. We cannot directly
  737|       |     * encode a variant inside a variant (but arrays of variant are possible) */
  738|   145k|    UA_Boolean wrapEO = (src->type->typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO);
  739|   145k|    if(src->type == &UA_TYPES[UA_TYPES_VARIANT] && !isArray)
  ------------------
  |  |  803|   145k|#define UA_TYPES_VARIANT 23
  ------------------
  |  Branch (739:8): [True: 1.53k, False: 144k]
  |  Branch (739:52): [True: 0, False: 1.53k]
  ------------------
  740|      0|        wrapEO = true;
  741|       |
  742|   145k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   145k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  743|       |
  744|       |    /* Write the type number */
  745|   145k|    UA_UInt32 typeId = src->type->typeKind + 1;
  746|   145k|    if(wrapEO)
  ------------------
  |  Branch (746:8): [True: 0, False: 145k]
  ------------------
  747|      0|        typeId = UA_TYPES[UA_TYPES_EXTENSIONOBJECT].typeKind + 1;
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  748|   145k|    ret |= writeJsonKey(ctx, UA_JSONKEY_TYPE);
  749|   145k|    ret |= ENCODE_DIRECT_JSON(&typeId, UInt32);
  ------------------
  |  |   51|   145k|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  750|       |
  751|       |    /* Write the value */
  752|   145k|    ret |= writeJsonKey(ctx, UA_JSONKEY_VALUE);
  753|   145k|    if(!isArray) {
  ------------------
  |  Branch (753:8): [True: 127k, False: 18.1k]
  ------------------
  754|   127k|        ret |= encodeScalarJsonWrapExtensionObject(ctx, src);
  755|   127k|    } else {
  756|  18.1k|        ret |= encodeArrayJsonWrapExtensionObject(ctx, src->data,
  757|  18.1k|                                                  src->arrayLength, src->type);
  758|  18.1k|    }
  759|       |
  760|       |    /* Write the dimensions */
  761|   145k|    if(hasDimensions) {
  ------------------
  |  Branch (761:8): [True: 4.83k, False: 140k]
  ------------------
  762|  4.83k|        ret |= writeJsonKey(ctx, UA_JSONKEY_DIMENSIONS);
  763|  4.83k|        ret |= encodeJsonArray(ctx, src->arrayDimensions, src->arrayDimensionsSize,
  764|  4.83k|                               &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  225|  4.83k|#define UA_TYPES_UINT32 6
  ------------------
  765|  4.83k|    }
  766|       |
  767|   145k|    return ret;
  768|   261k|}
ua_types_encoding_json.c:encodeScalarJsonWrapExtensionObject:
  671|   127k|encodeScalarJsonWrapExtensionObject(CtxJson *ctx, const UA_Variant *src) {
  672|   127k|    const UA_Boolean isBuiltin = (src->type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO);
  673|   127k|    const void *ptr = src->data;
  674|   127k|    const UA_DataType *type = src->type;
  675|       |
  676|       |    /* Set up a temporary ExtensionObject to wrap the data */
  677|   127k|    UA_ExtensionObject eo;
  678|   127k|    if(!isBuiltin) {
  ------------------
  |  Branch (678:8): [True: 0, False: 127k]
  ------------------
  679|      0|        UA_ExtensionObject_init(&eo);
  680|      0|        eo.encoding = UA_EXTENSIONOBJECT_DECODED;
  681|      0|        eo.content.decoded.type = src->type;
  682|      0|        eo.content.decoded.data = src->data;
  683|      0|        ptr = &eo;
  684|      0|        type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  685|      0|    }
  686|       |
  687|   127k|    return encodeJsonJumpTable[type->typeKind](ctx, ptr, type);
  688|   127k|}
ua_types_encoding_json.c:encodeArrayJsonWrapExtensionObject:
  693|  18.1k|                                   size_t size, const UA_DataType *type) {
  694|  18.1k|    if(size > UA_INT32_MAX)
  ------------------
  |  |  100|  18.1k|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (694:8): [True: 0, False: 18.1k]
  ------------------
  695|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  696|       |
  697|  18.1k|    status ret = writeJsonArrStart(ctx);
  698|       |
  699|  18.1k|    u16 memSize = type->memSize;
  700|  18.1k|    const UA_Boolean isBuiltin = (type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO);
  701|  18.1k|    if(isBuiltin) {
  ------------------
  |  Branch (701:8): [True: 18.1k, False: 0]
  ------------------
  702|  18.1k|        uintptr_t ptr = (uintptr_t)data;
  703|  17.6M|        for(size_t i = 0; i < size && ret == UA_STATUSCODE_GOOD; ++i) {
  ------------------
  |  |   16|  17.5M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (703:27): [True: 17.5M, False: 18.1k]
  |  Branch (703:39): [True: 17.5M, False: 0]
  ------------------
  704|  17.5M|            ret |= writeJsonArrElm(ctx, (const void*)ptr, type);
  705|  17.5M|            ptr += memSize;
  706|  17.5M|        }
  707|  18.1k|    } else {
  708|       |        /* Set up a temporary ExtensionObject to wrap the data */
  709|      0|        UA_ExtensionObject eo;
  710|      0|        UA_ExtensionObject_init(&eo);
  711|      0|        eo.encoding = UA_EXTENSIONOBJECT_DECODED;
  712|      0|        eo.content.decoded.type = type;
  713|      0|        eo.content.decoded.data = (void*)(uintptr_t)data;
  714|      0|        for(size_t i = 0; i < size && ret == UA_STATUSCODE_GOOD; ++i) {
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (714:27): [True: 0, False: 0]
  |  Branch (714:39): [True: 0, False: 0]
  ------------------
  715|      0|            ret |= writeJsonArrElm(ctx, &eo, &UA_TYPES[UA_TYPES_EXTENSIONOBJECT]);
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  716|      0|            eo.content.decoded.data = (void*)
  717|      0|                ((uintptr_t)eo.content.decoded.data + memSize);
  718|      0|        }
  719|      0|    }
  720|       |
  721|  18.1k|    return ret | writeJsonArrEnd(ctx, type);
  722|  18.1k|}
ua_types_encoding_json.c:Variant_encodeJson:
  770|   157k|ENCODE_JSON(Variant) {
  771|   157k|    return writeJsonObjStart(ctx) | encodeVariantInner(ctx, src) | writeJsonObjEnd(ctx);
  772|   157k|}
ua_types_encoding_json.c:DiagnosticInfo_encodeJson:
  817|  1.83k|ENCODE_JSON(DiagnosticInfo) {
  818|  1.83k|    status ret = writeJsonObjStart(ctx);
  819|       |
  820|  1.83k|    if(src->hasSymbolicId) {
  ------------------
  |  Branch (820:8): [True: 0, False: 1.83k]
  ------------------
  821|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SYMBOLICID);
  822|      0|        ret |= ENCODE_DIRECT_JSON(&src->symbolicId, Int32);
  ------------------
  |  |   51|      0|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  823|      0|    }
  824|       |
  825|  1.83k|    if(src->hasNamespaceUri) {
  ------------------
  |  Branch (825:8): [True: 0, False: 1.83k]
  ------------------
  826|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_NAMESPACEURI);
  827|      0|        ret |= ENCODE_DIRECT_JSON(&src->namespaceUri, Int32);
  ------------------
  |  |   51|      0|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  828|      0|    }
  829|       |
  830|  1.83k|    if(src->hasLocalizedText) {
  ------------------
  |  Branch (830:8): [True: 0, False: 1.83k]
  ------------------
  831|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_LOCALIZEDTEXT);
  832|      0|        ret |= ENCODE_DIRECT_JSON(&src->localizedText, Int32);
  ------------------
  |  |   51|      0|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  833|      0|    }
  834|       |
  835|  1.83k|    if(src->hasLocale) {
  ------------------
  |  Branch (835:8): [True: 0, False: 1.83k]
  ------------------
  836|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_LOCALE);
  837|      0|        ret |= ENCODE_DIRECT_JSON(&src->locale, Int32);
  ------------------
  |  |   51|      0|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  838|      0|    }
  839|       |
  840|  1.83k|    if(src->hasAdditionalInfo) {
  ------------------
  |  Branch (840:8): [True: 0, False: 1.83k]
  ------------------
  841|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_ADDITIONALINFO);
  842|      0|        ret |= ENCODE_DIRECT_JSON(&src->additionalInfo, String);
  ------------------
  |  |   51|      0|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  843|      0|    }
  844|       |
  845|  1.83k|    if(src->hasInnerStatusCode) {
  ------------------
  |  Branch (845:8): [True: 0, False: 1.83k]
  ------------------
  846|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_INNERSTATUSCODE);
  847|      0|        ret |= ENCODE_DIRECT_JSON(&src->innerStatusCode, StatusCode);
  ------------------
  |  |   51|      0|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  848|      0|    }
  849|       |
  850|  1.83k|    if(src->hasInnerDiagnosticInfo && src->innerDiagnosticInfo) {
  ------------------
  |  Branch (850:8): [True: 0, False: 1.83k]
  |  Branch (850:39): [True: 0, False: 0]
  ------------------
  851|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_INNERDIAGNOSTICINFO);
  852|      0|        ret |= encodeJsonJumpTable[UA_DATATYPEKIND_DIAGNOSTICINFO]
  853|      0|            (ctx, src->innerDiagnosticInfo, NULL);
  854|      0|    }
  855|       |
  856|  1.83k|    return ret | writeJsonObjEnd(ctx);
  857|  1.83k|}
ua_types_encoding_json.c:jsoneq:
 1091|  2.58M|jsoneq(const char *json, const cj5_token *tok, const char *searchKey) {
 1092|       |    /* TODO: necessary?
 1093|       |       if(json == NULL
 1094|       |            || tok == NULL
 1095|       |            || searchKey == NULL) {
 1096|       |        return -1;
 1097|       |    } */
 1098|       |
 1099|  2.58M|    size_t len = getTokenLength(tok);
 1100|  2.58M|    if(tok->type == CJ5_TOKEN_STRING &&
  ------------------
  |  Branch (1100:8): [True: 2.58M, False: 0]
  ------------------
 1101|  2.58M|       strlen(searchKey) ==  len &&
  ------------------
  |  Branch (1101:8): [True: 2.19M, False: 386k]
  ------------------
 1102|  2.19M|       strncmp(json + tok->start, (const char*)searchKey, len) == 0)
  ------------------
  |  Branch (1102:8): [True: 2.19M, False: 5.26k]
  ------------------
 1103|  2.19M|        return 0;
 1104|       |
 1105|   392k|    return -1;
 1106|  2.58M|}
ua_types_encoding_json.c:skipObject:
 1076|   594k|skipObject(ParseCtx *ctx) {
 1077|   594k|    unsigned int end = ctx->tokens[ctx->index].end;
 1078|  72.0M|    do {
 1079|  72.0M|        ctx->index++;
 1080|  72.0M|    } while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1080:13): [True: 71.9M, False: 11.0k]
  ------------------
 1081|  71.9M|            ctx->tokens[ctx->index].start < end);
  ------------------
  |  Branch (1081:13): [True: 71.4M, False: 583k]
  ------------------
 1082|   594k|}
ua_types_encoding_json.c:DiagnosticInfo_decodeJson:
 2187|  1.23k|DECODE_JSON(DiagnosticInfo) {
 2188|  1.23k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DiagnosticInfo */
  ------------------
  |  | 1061|  1.23k|#define CHECK_NULL_SKIP do {                         \
  |  | 1062|  1.23k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1062:8): [True: 0, False: 1.23k]
  |  |  ------------------
  |  | 1063|      0|        ctx->index++;                                \
  |  | 1064|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1065|  1.23k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1065:14): [Folded, False: 1.23k]
  |  |  ------------------
  ------------------
 2189|  1.23k|    CHECK_OBJECT;
  ------------------
  |  | 1056|  1.23k|#define CHECK_OBJECT do {                                \
  |  | 1057|  1.23k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1057:8): [True: 1, False: 1.23k]
  |  |  ------------------
  |  | 1058|      1|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1059|  1.23k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1059:14): [Folded, False: 1.23k]
  |  |  ------------------
  ------------------
 2190|       |
 2191|  1.23k|    DecodeEntry entries[7] = {
 2192|  1.23k|        {UA_JSONKEY_SYMBOLICID, &dst->symbolicId, NULL, false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|  1.23k|#define UA_TYPES_INT32 5
  ------------------
 2193|  1.23k|        {UA_JSONKEY_NAMESPACEURI, &dst->namespaceUri, NULL, false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|  1.23k|#define UA_TYPES_INT32 5
  ------------------
 2194|  1.23k|        {UA_JSONKEY_LOCALIZEDTEXT, &dst->localizedText, NULL, false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|  1.23k|#define UA_TYPES_INT32 5
  ------------------
 2195|  1.23k|        {UA_JSONKEY_LOCALE, &dst->locale, NULL, false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|  1.23k|#define UA_TYPES_INT32 5
  ------------------
 2196|  1.23k|        {UA_JSONKEY_ADDITIONALINFO, &dst->additionalInfo, NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  395|  1.23k|#define UA_TYPES_STRING 11
  ------------------
 2197|  1.23k|        {UA_JSONKEY_INNERSTATUSCODE, &dst->innerStatusCode, NULL, false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  633|  1.23k|#define UA_TYPES_STATUSCODE 18
  ------------------
 2198|  1.23k|        {UA_JSONKEY_INNERDIAGNOSTICINFO, &dst->innerDiagnosticInfo, DiagnosticInfoInner_decodeJson, false, NULL}
 2199|  1.23k|    };
 2200|  1.23k|    status ret = decodeFields(ctx, entries, 7);
 2201|       |
 2202|  1.23k|    dst->hasSymbolicId = entries[0].found;
 2203|  1.23k|    dst->hasNamespaceUri = entries[1].found;
 2204|  1.23k|    dst->hasLocalizedText = entries[2].found;
 2205|  1.23k|    dst->hasLocale = entries[3].found;
 2206|  1.23k|    dst->hasAdditionalInfo = entries[4].found;
 2207|  1.23k|    dst->hasInnerStatusCode = entries[5].found;
 2208|  1.23k|    dst->hasInnerDiagnosticInfo = entries[6].found;
 2209|  1.23k|    return ret;
 2210|  1.23k|}
ua_types_encoding_json.c:Boolean_decodeJson:
 1108|  6.29k|DECODE_JSON(Boolean) {
 1109|  6.29k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  6.29k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  6.29k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 6.29k]
  |  |  ------------------
  |  | 1038|  6.29k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  6.29k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 6.29k]
  |  |  ------------------
  ------------------
 1110|  6.29k|    CHECK_BOOL;
  ------------------
  |  | 1046|  6.29k|#define CHECK_BOOL do {                                \
  |  | 1047|  6.29k|    if(currentTokenType(ctx) != CJ5_TOKEN_BOOL) {      \
  |  |  ------------------
  |  |  |  Branch (1047:8): [True: 14, False: 6.27k]
  |  |  ------------------
  |  | 1048|     14|        return UA_STATUSCODE_BADDECODINGERROR;         \
  |  |  ------------------
  |  |  |  |   43|     14|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1049|  6.27k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1049:14): [Folded, False: 6.27k]
  |  |  ------------------
  ------------------
 1111|  6.27k|    GET_TOKEN;
  ------------------
  |  | 1032|  6.27k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|  6.27k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|  6.27k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 6.27k]
  |  |  ------------------
  ------------------
 1112|       |
 1113|  6.27k|    if(tokenSize == 4 &&
  ------------------
  |  Branch (1113:8): [True: 527, False: 5.75k]
  ------------------
 1114|    527|       (tokenData[0] | 32) == 't' && (tokenData[1] | 32) == 'r' &&
  ------------------
  |  Branch (1114:8): [True: 527, False: 0]
  |  Branch (1114:38): [True: 527, False: 0]
  ------------------
 1115|    527|       (tokenData[2] | 32) == 'u' && (tokenData[3] | 32) == 'e') {
  ------------------
  |  Branch (1115:8): [True: 527, False: 0]
  |  Branch (1115:38): [True: 527, False: 0]
  ------------------
 1116|    527|        *dst = true;
 1117|  5.75k|    } else if(tokenSize == 5 &&
  ------------------
  |  Branch (1117:15): [True: 5.75k, False: 0]
  ------------------
 1118|  5.75k|              (tokenData[0] | 32) == 'f' && (tokenData[1] | 32) == 'a' &&
  ------------------
  |  Branch (1118:15): [True: 5.75k, False: 0]
  |  Branch (1118:45): [True: 5.75k, False: 0]
  ------------------
 1119|  5.75k|              (tokenData[2] | 32) == 'l' && (tokenData[3] | 32) == 's' &&
  ------------------
  |  Branch (1119:15): [True: 5.75k, False: 0]
  |  Branch (1119:45): [True: 5.75k, False: 0]
  ------------------
 1120|  5.75k|              (tokenData[4] | 32) == 'e') {
  ------------------
  |  Branch (1120:15): [True: 5.75k, False: 0]
  ------------------
 1121|  5.75k|        *dst = false;
 1122|  5.75k|    } else {
 1123|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1124|      0|    }
 1125|       |
 1126|  6.27k|    ctx->index++;
 1127|  6.27k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  6.27k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1128|  6.27k|}
ua_types_encoding_json.c:SByte_decodeJson:
 1215|   474k|DECODE_JSON(SByte) {
 1216|   474k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|   474k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|   474k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 474k]
  |  |  ------------------
  |  | 1038|   474k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|   474k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 474k]
  |  |  ------------------
  ------------------
 1217|   474k|    CHECK_NUMBER;
  ------------------
  |  | 1041|   474k|#define CHECK_NUMBER do {                                \
  |  | 1042|   474k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1042:8): [True: 0, False: 474k]
  |  |  ------------------
  |  | 1043|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1044|   474k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1044:14): [Folded, False: 474k]
  |  |  ------------------
  ------------------
 1218|   474k|    GET_TOKEN;
  ------------------
  |  | 1032|   474k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|   474k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|   474k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 474k]
  |  |  ------------------
  ------------------
 1219|       |
 1220|   474k|    UA_Int64 out = 0;
 1221|   474k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1222|   474k|    if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   16|   949k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   63|   949k|#define UA_SBYTE_MIN (-128)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   64|   474k|#define UA_SBYTE_MAX 127
  ------------------
  |  Branch (1222:8): [True: 18, False: 474k]
  |  Branch (1222:35): [True: 0, False: 474k]
  |  Branch (1222:57): [True: 3, False: 474k]
  ------------------
 1223|     21|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     21|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1224|   474k|    *dst = (UA_SByte)out;
 1225|   474k|    ctx->index++;
 1226|   474k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   474k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1227|   474k|}
ua_types_encoding_json.c:parseSignedInteger:
 1147|  4.48M|parseSignedInteger(const char *tokenData, size_t tokenSize, UA_Int64 *dst) {
 1148|  4.48M|    size_t len = parseInt64(tokenData, tokenSize, dst);
 1149|  4.48M|    if(len == 0)
  ------------------
  |  Branch (1149:8): [True: 7, False: 4.48M]
  ------------------
 1150|      7|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1151|       |
 1152|       |    /* There must only be whitespace between the end of the parsed number and
 1153|       |     * the end of the token */
 1154|  4.49M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1154:25): [True: 771, False: 4.48M]
  ------------------
 1155|    771|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1155:12): [True: 740, False: 31]
  |  Branch (1155:35): [True: 43, False: 697]
  ------------------
 1156|     43|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     43|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1157|    771|    }
 1158|       |
 1159|  4.48M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  4.48M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1160|  4.48M|}
ua_types_encoding_json.c:Byte_decodeJson:
 1162|   269k|DECODE_JSON(Byte) {
 1163|   269k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|   269k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|   269k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 269k]
  |  |  ------------------
  |  | 1038|   269k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|   269k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 269k]
  |  |  ------------------
  ------------------
 1164|   269k|    CHECK_NUMBER;
  ------------------
  |  | 1041|   269k|#define CHECK_NUMBER do {                                \
  |  | 1042|   269k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1042:8): [True: 1, False: 269k]
  |  |  ------------------
  |  | 1043|      1|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1044|   269k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1044:14): [Folded, False: 269k]
  |  |  ------------------
  ------------------
 1165|   269k|    GET_TOKEN;
  ------------------
  |  | 1032|   269k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|   269k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|   269k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 269k]
  |  |  ------------------
  ------------------
 1166|       |
 1167|   269k|    UA_UInt64 out = 0;
 1168|   269k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1169|   269k|    if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   16|   539k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   73|   269k|#define UA_BYTE_MAX 255
  ------------------
  |  Branch (1169:8): [True: 14, False: 269k]
  |  Branch (1169:35): [True: 4, False: 269k]
  ------------------
 1170|     18|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     18|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1171|   269k|    *dst = (UA_Byte)out;
 1172|   269k|    ctx->index++;
 1173|   269k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   269k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1174|   269k|}
ua_types_encoding_json.c:parseUnsignedInteger:
 1131|  6.51M|parseUnsignedInteger(const char *tokenData, size_t tokenSize, UA_UInt64 *dst) {
 1132|  6.51M|    size_t len = parseUInt64(tokenData, tokenSize, dst);
 1133|  6.51M|    if(len == 0)
  ------------------
  |  Branch (1133:8): [True: 26, False: 6.51M]
  ------------------
 1134|     26|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     26|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1135|       |
 1136|       |    /* There must only be whitespace between the end of the parsed number and
 1137|       |     * the end of the token */
 1138|  6.51M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1138:25): [True: 1.44k, False: 6.51M]
  ------------------
 1139|  1.44k|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1139:12): [True: 1.40k, False: 42]
  |  Branch (1139:35): [True: 43, False: 1.36k]
  ------------------
 1140|     43|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     43|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1141|  1.44k|    }
 1142|       |
 1143|  6.51M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  6.51M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1144|  6.51M|}
ua_types_encoding_json.c:Int16_decodeJson:
 1229|   274k|DECODE_JSON(Int16) {
 1230|   274k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|   274k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|   274k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 274k]
  |  |  ------------------
  |  | 1038|   274k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|   274k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 274k]
  |  |  ------------------
  ------------------
 1231|   274k|    CHECK_NUMBER;
  ------------------
  |  | 1041|   274k|#define CHECK_NUMBER do {                                \
  |  | 1042|   274k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1042:8): [True: 0, False: 274k]
  |  |  ------------------
  |  | 1043|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1044|   274k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1044:14): [Folded, False: 274k]
  |  |  ------------------
  ------------------
 1232|   274k|    GET_TOKEN;
  ------------------
  |  | 1032|   274k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|   274k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|   274k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 274k]
  |  |  ------------------
  ------------------
 1233|       |
 1234|   274k|    UA_Int64 out = 0;
 1235|   274k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1236|   274k|    if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   16|   548k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   81|   548k|#define UA_INT16_MIN (-32768)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   82|   274k|#define UA_INT16_MAX 32767
  ------------------
  |  Branch (1236:8): [True: 3, False: 274k]
  |  Branch (1236:35): [True: 2, False: 274k]
  |  Branch (1236:57): [True: 0, False: 274k]
  ------------------
 1237|      5|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1238|   274k|    *dst = (UA_Int16)out;
 1239|   274k|    ctx->index++;
 1240|   274k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   274k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1241|   274k|}
ua_types_encoding_json.c:UInt16_decodeJson:
 1176|   679k|DECODE_JSON(UInt16) {
 1177|   679k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|   679k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|   679k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 679k]
  |  |  ------------------
  |  | 1038|   679k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|   679k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 679k]
  |  |  ------------------
  ------------------
 1178|   679k|    CHECK_NUMBER;
  ------------------
  |  | 1041|   679k|#define CHECK_NUMBER do {                                \
  |  | 1042|   679k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1042:8): [True: 0, False: 679k]
  |  |  ------------------
  |  | 1043|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1044|   679k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1044:14): [Folded, False: 679k]
  |  |  ------------------
  ------------------
 1179|   679k|    GET_TOKEN;
  ------------------
  |  | 1032|   679k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|   679k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|   679k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 679k]
  |  |  ------------------
  ------------------
 1180|       |
 1181|   679k|    UA_UInt64 out = 0;
 1182|   679k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1183|   679k|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   16|  1.35M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   91|   679k|#define UA_UINT16_MAX 65535
  ------------------
  |  Branch (1183:8): [True: 13, False: 679k]
  |  Branch (1183:35): [True: 8, False: 679k]
  ------------------
 1184|     21|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     21|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1185|   679k|    *dst = (UA_UInt16)out;
 1186|   679k|    ctx->index++;
 1187|   679k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   679k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1188|   679k|}
ua_types_encoding_json.c:Int32_decodeJson:
 1243|  1.76M|DECODE_JSON(Int32) {
 1244|  1.76M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  1.76M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  1.76M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 1.76M]
  |  |  ------------------
  |  | 1038|  1.76M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  1.76M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 1.76M]
  |  |  ------------------
  ------------------
 1245|  1.76M|    CHECK_NUMBER;
  ------------------
  |  | 1041|  1.76M|#define CHECK_NUMBER do {                                \
  |  | 1042|  1.76M|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1042:8): [True: 0, False: 1.76M]
  |  |  ------------------
  |  | 1043|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1044|  1.76M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1044:14): [Folded, False: 1.76M]
  |  |  ------------------
  ------------------
 1246|  1.76M|    GET_TOKEN;
  ------------------
  |  | 1032|  1.76M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|  1.76M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|  1.76M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 1.76M]
  |  |  ------------------
  ------------------
 1247|       |
 1248|  1.76M|    UA_Int64 out = 0;
 1249|  1.76M|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1250|  1.76M|    if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   16|  3.52M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   99|  3.52M|#define UA_INT32_MIN ((int32_t)-2147483648LL)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |  100|  1.76M|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (1250:8): [True: 9, False: 1.76M]
  |  Branch (1250:35): [True: 0, False: 1.76M]
  |  Branch (1250:57): [True: 3, False: 1.76M]
  ------------------
 1251|     12|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     12|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1252|  1.76M|    *dst = (UA_Int32)out;
 1253|  1.76M|    ctx->index++;
 1254|  1.76M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.76M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1255|  1.76M|}
ua_types_encoding_json.c:UInt32_decodeJson:
 1190|  1.95M|DECODE_JSON(UInt32) {
 1191|  1.95M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  1.95M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  1.95M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 1.95M]
  |  |  ------------------
  |  | 1038|  1.95M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  1.95M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 1.95M]
  |  |  ------------------
  ------------------
 1192|  1.95M|    CHECK_NUMBER;
  ------------------
  |  | 1041|  1.95M|#define CHECK_NUMBER do {                                \
  |  | 1042|  1.95M|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1042:8): [True: 5, False: 1.95M]
  |  |  ------------------
  |  | 1043|      5|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1044|  1.95M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1044:14): [Folded, False: 1.95M]
  |  |  ------------------
  ------------------
 1193|  1.95M|    GET_TOKEN;
  ------------------
  |  | 1032|  1.95M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|  1.95M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|  1.95M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 1.95M]
  |  |  ------------------
  ------------------
 1194|       |
 1195|  1.95M|    UA_UInt64 out = 0;
 1196|  1.95M|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1197|  1.95M|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |   16|  3.91M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |  109|  1.95M|#define UA_UINT32_MAX 4294967295UL
  ------------------
  |  Branch (1197:8): [True: 23, False: 1.95M]
  |  Branch (1197:35): [True: 2, False: 1.95M]
  ------------------
 1198|     25|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     25|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1199|  1.95M|    *dst = (UA_UInt32)out;
 1200|  1.95M|    ctx->index++;
 1201|  1.95M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.95M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1202|  1.95M|}
ua_types_encoding_json.c:Int64_decodeJson:
 1257|  1.97M|DECODE_JSON(Int64) {
 1258|  1.97M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  1.97M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  1.97M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 1.97M]
  |  |  ------------------
  |  | 1038|  1.97M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  1.97M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 1.97M]
  |  |  ------------------
  ------------------
 1259|  1.97M|    GET_TOKEN;
  ------------------
  |  | 1032|  1.97M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|  1.97M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|  1.97M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 1.97M]
  |  |  ------------------
  ------------------
 1260|       |
 1261|  1.97M|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, dst);
 1262|  1.97M|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  1.97M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1262:8): [True: 20, False: 1.97M]
  ------------------
 1263|     20|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     20|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1264|  1.97M|    ctx->index++;
 1265|  1.97M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.97M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1266|  1.97M|}
ua_types_encoding_json.c:UInt64_decodeJson:
 1204|  3.60M|DECODE_JSON(UInt64) {
 1205|  3.60M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  3.60M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  3.60M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 3.60M]
  |  |  ------------------
  |  | 1038|  3.60M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  3.60M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 3.60M]
  |  |  ------------------
  ------------------
 1206|  3.60M|    GET_TOKEN;
  ------------------
  |  | 1032|  3.60M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|  3.60M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|  3.60M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 3.60M]
  |  |  ------------------
  ------------------
 1207|       |
 1208|  3.60M|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, dst);
 1209|  3.60M|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  3.60M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1209:8): [True: 19, False: 3.60M]
  ------------------
 1210|     19|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     19|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1211|  3.60M|    ctx->index++;
 1212|  3.60M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  3.60M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1213|  3.60M|}
ua_types_encoding_json.c:Float_decodeJson:
 1328|  1.22M|DECODE_JSON(Float) {
 1329|  1.22M|    UA_Double v = 0.0;
 1330|       |    UA_StatusCode res = Double_decodeJson(ctx, &v, NULL);
 1331|  1.22M|    *dst = (UA_Float)v;
 1332|  1.22M|    return res;
 1333|  1.22M|}
ua_types_encoding_json.c:Double_decodeJson:
 1269|  1.84M|DECODE_JSON(Double) {
 1270|  1.84M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  1.84M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  1.84M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 1.84M]
  |  |  ------------------
  |  | 1038|  1.84M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  1.84M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 1.84M]
  |  |  ------------------
  ------------------
 1271|  1.84M|    GET_TOKEN;
  ------------------
  |  | 1032|  1.84M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|  1.84M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|  1.84M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 1.84M]
  |  |  ------------------
  ------------------
 1272|       |
 1273|       |    /* https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/
 1274|       |     * Maximum digit counts for select IEEE floating-point formats: 1074
 1275|       |     * Sanity check.
 1276|       |     */
 1277|  1.84M|    if(tokenSize > 2000)
  ------------------
  |  Branch (1277:8): [True: 1, False: 1.84M]
  ------------------
 1278|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1279|       |
 1280|  1.84M|    cj5_token_type tokenType = currentTokenType(ctx);
 1281|       |
 1282|       |    /* It could be a String with Nan, Infinity */
 1283|  1.84M|    if(tokenType == CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (1283:8): [True: 6.81k, False: 1.83M]
  ------------------
 1284|  6.81k|        ctx->index++;
 1285|       |
 1286|  6.81k|        if(tokenSize == 8 && memcmp(tokenData, "Infinity", 8) == 0) {
  ------------------
  |  Branch (1286:12): [True: 928, False: 5.89k]
  |  Branch (1286:30): [True: 928, False: 0]
  ------------------
 1287|    928|            *dst = INFINITY;
 1288|    928|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    928|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1289|    928|        }
 1290|       |
 1291|  5.89k|        if(tokenSize == 9 && memcmp(tokenData, "-Infinity", 9) == 0) {
  ------------------
  |  Branch (1291:12): [True: 833, False: 5.05k]
  |  Branch (1291:30): [True: 832, False: 1]
  ------------------
 1292|       |            /* workaround an MSVC 2013 issue */
 1293|    832|            *dst = -INFINITY;
 1294|    832|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    832|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1295|    832|        }
 1296|       |
 1297|  5.05k|        if(tokenSize == 3 && memcmp(tokenData, "NaN", 3) == 0) {
  ------------------
  |  Branch (1297:12): [True: 4.64k, False: 411]
  |  Branch (1297:30): [True: 4.64k, False: 1]
  ------------------
 1298|  4.64k|            *dst = NAN;
 1299|  4.64k|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  4.64k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1300|  4.64k|        }
 1301|       |
 1302|    412|        if(tokenSize == 4 && memcmp(tokenData, "-NaN", 4) == 0) {
  ------------------
  |  Branch (1302:12): [True: 392, False: 20]
  |  Branch (1302:30): [True: 390, False: 2]
  ------------------
 1303|    390|            *dst = NAN;
 1304|    390|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    390|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1305|    390|        }
 1306|       |
 1307|     22|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     22|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1308|    412|    }
 1309|       |
 1310|  1.83M|    if(tokenType != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1310:8): [True: 0, False: 1.83M]
  ------------------
 1311|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1312|       |
 1313|  1.83M|    size_t len = parseDouble(tokenData, tokenSize, dst);
 1314|  1.83M|    if(len == 0)
  ------------------
  |  Branch (1314:8): [True: 3, False: 1.83M]
  ------------------
 1315|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1316|       |
 1317|       |    /* There must only be whitespace between the end of the parsed number and
 1318|       |     * the end of the token */
 1319|  1.83M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1319:25): [True: 16, False: 1.83M]
  ------------------
 1320|     16|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1320:12): [True: 16, False: 0]
  |  Branch (1320:35): [True: 16, False: 0]
  ------------------
 1321|     16|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     16|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1322|     16|    }
 1323|       |
 1324|  1.83M|    ctx->index++;
 1325|  1.83M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.83M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1326|  1.83M|}
ua_types_encoding_json.c:String_decodeJson:
 1346|   224k|DECODE_JSON(String) {
 1347|   224k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|   224k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|   224k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 224k]
  |  |  ------------------
  |  | 1038|   224k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|   224k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1348|   224k|    CHECK_STRING;
  ------------------
  |  | 1051|   224k|#define CHECK_STRING do {                                \
  |  | 1052|   224k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1052:8): [True: 7, False: 224k]
  |  |  ------------------
  |  | 1053|      7|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1054|   224k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1054:14): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1349|   224k|    GET_TOKEN;
  ------------------
  |  | 1032|   224k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|   224k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|   224k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 1350|   224k|    (void)tokenData;
 1351|       |
 1352|       |    /* Empty string? */
 1353|   224k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1353:8): [True: 8.22k, False: 215k]
  ------------------
 1354|  8.22k|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  8.22k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1355|  8.22k|        dst->length = 0;
 1356|  8.22k|        ctx->index++;
 1357|  8.22k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  8.22k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1358|  8.22k|    }
 1359|       |
 1360|       |    /* The decoded utf8 is at most of the same length as the source string */
 1361|   215k|    char *outBuf = (char*)UA_malloc(tokenSize+1);
  ------------------
  |  |   18|   215k|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 1362|   215k|    if(!outBuf)
  ------------------
  |  Branch (1362:8): [True: 0, False: 215k]
  ------------------
 1363|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1364|       |
 1365|       |    /* Decode the string */
 1366|   215k|    cj5_result r;
 1367|   215k|    r.tokens = ctx->tokens;
 1368|   215k|    r.num_tokens = (unsigned int)ctx->tokensSize;
 1369|   215k|    r.json5 = ctx->json5;
 1370|   215k|    unsigned int len = 0;
 1371|   215k|    cj5_error_code err = cj5_get_str(&r, (unsigned int)ctx->index, outBuf, &len);
 1372|   215k|    if(err != CJ5_ERROR_NONE) {
  ------------------
  |  Branch (1372:8): [True: 50, False: 215k]
  ------------------
 1373|     50|        UA_free(outBuf);
  ------------------
  |  |   19|     50|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1374|     50|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     50|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1375|     50|    }
 1376|       |
 1377|       |    /* Set the output */
 1378|   215k|    dst->length = len;
 1379|   215k|    if(dst->length > 0) {
  ------------------
  |  Branch (1379:8): [True: 215k, False: 0]
  ------------------
 1380|   215k|        dst->data = (UA_Byte*)outBuf;
 1381|   215k|    } else {
 1382|      0|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|      0|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1383|      0|        UA_free(outBuf);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1384|      0|    }
 1385|       |
 1386|   215k|    ctx->index++;
 1387|   215k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   215k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1388|   215k|}
ua_types_encoding_json.c:DateTime_decodeJson:
 1489|  17.1k|DECODE_JSON(DateTime) {
 1490|  17.1k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  17.1k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  17.1k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 17.1k]
  |  |  ------------------
  |  | 1038|  17.1k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  17.1k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 17.1k]
  |  |  ------------------
  ------------------
 1491|  17.1k|    CHECK_STRING;
  ------------------
  |  | 1051|  17.1k|#define CHECK_STRING do {                                \
  |  | 1052|  17.1k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1052:8): [True: 5, False: 17.1k]
  |  |  ------------------
  |  | 1053|      5|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1054|  17.1k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1054:14): [Folded, False: 17.1k]
  |  |  ------------------
  ------------------
 1492|  17.1k|    GET_TOKEN;
  ------------------
  |  | 1032|  17.1k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|  17.1k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|  17.1k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 17.1k]
  |  |  ------------------
  ------------------
 1493|       |
 1494|       |    /* The last character has to be 'Z'. We can omit some length checks later on
 1495|       |     * because we know the atoi functions stop before the 'Z'. */
 1496|  17.1k|    if(tokenSize == 0 || tokenData[tokenSize-1] != 'Z')
  ------------------
  |  Branch (1496:8): [True: 0, False: 17.1k]
  |  Branch (1496:26): [True: 10, False: 17.1k]
  ------------------
 1497|     10|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     10|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1498|       |
 1499|  17.1k|    struct musl_tm dts;
 1500|  17.1k|    memset(&dts, 0, sizeof(dts));
 1501|       |
 1502|  17.1k|    size_t pos = 0;
 1503|  17.1k|    size_t len;
 1504|       |
 1505|       |    /* Parse the year. The ISO standard asks for four digits. But we accept up
 1506|       |     * to five with an optional plus or minus in front due to the range of the
 1507|       |     * DateTime 64bit integer. But in that case we require the year and the
 1508|       |     * month to be separated by a '-'. Otherwise we cannot know where the month
 1509|       |     * starts. */
 1510|  17.1k|    if(tokenData[0] == '-' || tokenData[0] == '+')
  ------------------
  |  Branch (1510:8): [True: 3.45k, False: 13.6k]
  |  Branch (1510:31): [True: 68, False: 13.6k]
  ------------------
 1511|  3.52k|        pos++;
 1512|  17.1k|    UA_Int64 year = 0;
 1513|  17.1k|    len = parseInt64(&tokenData[pos], 5, &year);
 1514|  17.1k|    pos += len;
 1515|  17.1k|    if(len != 4 && tokenData[pos] != '-')
  ------------------
  |  Branch (1515:8): [True: 5.62k, False: 11.5k]
  |  Branch (1515:20): [True: 6, False: 5.61k]
  ------------------
 1516|      6|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1517|  17.1k|    if(tokenData[0] == '-')
  ------------------
  |  Branch (1517:8): [True: 3.45k, False: 13.6k]
  ------------------
 1518|  3.45k|        year = -year;
 1519|  17.1k|    dts.tm_year = (UA_Int16)year - 1900;
 1520|  17.1k|    if(tokenData[pos] == '-')
  ------------------
  |  Branch (1520:8): [True: 17.1k, False: 1]
  ------------------
 1521|  17.1k|        pos++;
 1522|       |
 1523|       |    /* Parse the month */
 1524|  17.1k|    UA_UInt64 month = 0;
 1525|  17.1k|    len = parseUInt64(&tokenData[pos], 2, &month);
 1526|  17.1k|    pos += len;
 1527|  17.1k|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|  17.1k|    do {                                                                                 \
  |  |  173|  17.1k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  577|  17.1k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (577:25): [True: 2, False: 17.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      2|            EVAL_ON_ERROR;                                                               \
  |  |  175|      2|        }                                                                                \
  |  |  176|  17.1k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 17.1k]
  |  |  ------------------
  ------------------
 1528|  17.1k|    dts.tm_mon = (UA_UInt16)month - 1;
 1529|  17.1k|    if(tokenData[pos] == '-')
  ------------------
  |  Branch (1529:8): [True: 8.77k, False: 8.34k]
  ------------------
 1530|  8.77k|        pos++;
 1531|       |
 1532|       |    /* Parse the day and check the T between date and time */
 1533|  17.1k|    UA_UInt64 day = 0;
 1534|  17.1k|    len = parseUInt64(&tokenData[pos], 2, &day);
 1535|  17.1k|    pos += len;
 1536|  17.1k|    UA_CHECK(len == 2 || tokenData[pos] != 'T',
  ------------------
  |  |  172|  17.1k|    do {                                                                                 \
  |  |  173|  17.1k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  577|  18.2k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (577:25): [True: 0, False: 17.1k]
  |  |  |  |  |  Branch (577:43): [True: 16.0k, False: 1.09k]
  |  |  |  |  |  Branch (577:43): [True: 1.09k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|  17.1k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 17.1k]
  |  |  ------------------
  ------------------
 1537|  17.1k|             return UA_STATUSCODE_BADDECODINGERROR);
 1538|  17.1k|    dts.tm_mday = (UA_UInt16)day;
 1539|  17.1k|    pos++;
 1540|       |
 1541|       |    /* Parse the hour */
 1542|  17.1k|    UA_UInt64 hour = 0;
 1543|  17.1k|    len = parseUInt64(&tokenData[pos], 2, &hour);
 1544|  17.1k|    pos += len;
 1545|  17.1k|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|  17.1k|    do {                                                                                 \
  |  |  173|  17.1k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  577|  17.1k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (577:25): [True: 8, False: 17.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      8|            EVAL_ON_ERROR;                                                               \
  |  |  175|      8|        }                                                                                \
  |  |  176|  17.1k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 17.1k]
  |  |  ------------------
  ------------------
 1546|  17.1k|    dts.tm_hour = (UA_UInt16)hour;
 1547|  17.1k|    if(tokenData[pos] == ':')
  ------------------
  |  Branch (1547:8): [True: 8.76k, False: 8.35k]
  ------------------
 1548|  8.76k|        pos++;
 1549|       |
 1550|       |    /* Parse the minute */
 1551|  17.1k|    UA_UInt64 min = 0;
 1552|  17.1k|    len = parseUInt64(&tokenData[pos], 2, &min);
 1553|  17.1k|    pos += len;
 1554|  17.1k|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|  17.1k|    do {                                                                                 \
  |  |  173|  17.1k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  577|  17.1k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (577:25): [True: 9, False: 17.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      9|            EVAL_ON_ERROR;                                                               \
  |  |  175|      9|        }                                                                                \
  |  |  176|  17.1k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 17.1k]
  |  |  ------------------
  ------------------
 1555|  17.1k|    dts.tm_min = (UA_UInt16)min;
 1556|  17.1k|    if(tokenData[pos] == ':')
  ------------------
  |  Branch (1556:8): [True: 8.76k, False: 8.34k]
  ------------------
 1557|  8.76k|        pos++;
 1558|       |
 1559|       |    /* Parse the second */
 1560|  17.1k|    UA_UInt64 sec = 0;
 1561|  17.1k|    len = parseUInt64(&tokenData[pos], 2, &sec);
 1562|  17.1k|    pos += len;
 1563|  17.1k|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|  17.1k|    do {                                                                                 \
  |  |  173|  17.1k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  577|  17.1k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (577:25): [True: 5, False: 17.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      5|            EVAL_ON_ERROR;                                                               \
  |  |  175|      5|        }                                                                                \
  |  |  176|  17.1k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 17.0k]
  |  |  ------------------
  ------------------
 1564|  17.0k|    dts.tm_sec = (UA_UInt16)sec;
 1565|       |
 1566|       |    /* Compute the seconds since the Unix epoch */
 1567|  17.0k|    long long sinceunix = musl_tm_to_secs(&dts);
 1568|       |
 1569|       |    /* Are we within the range that can be represented? */
 1570|  17.0k|    long long sinceunix_min =
 1571|  17.0k|        (long long)(UA_INT64_MIN / UA_DATETIME_SEC) -
  ------------------
  |  |  119|  17.0k|#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
  |  |  ------------------
  |  |  |  |  118|  17.0k|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  |  |  ------------------
  ------------------
                      (long long)(UA_INT64_MIN / UA_DATETIME_SEC) -
  ------------------
  |  |  285|  17.0k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  17.0k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  17.0k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1572|  17.0k|        (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC) -
  ------------------
  |  |  327|  17.0k|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|  17.0k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  17.0k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  17.0k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC) -
  ------------------
  |  |  285|  17.0k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  17.0k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  17.0k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1573|  17.0k|        (long long)1; /* manual correction due to rounding */
 1574|  17.0k|    long long sinceunix_max = (long long)
 1575|  17.0k|        ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  118|  17.0k|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  ------------------
                      ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  327|  17.0k|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|  17.0k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  17.0k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  17.0k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  285|  17.0k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  17.0k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  17.0k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1576|  17.0k|    if(sinceunix < sinceunix_min || sinceunix > sinceunix_max)
  ------------------
  |  Branch (1576:8): [True: 0, False: 17.0k]
  |  Branch (1576:37): [True: 0, False: 17.0k]
  ------------------
 1577|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1578|       |
 1579|       |    /* Convert to DateTime. Add or subtract one extra second here to prevent
 1580|       |     * underflow/overflow. This is reverted once the fractional part has been
 1581|       |     * added. */
 1582|  17.0k|    sinceunix -= (sinceunix > 0) ? 1 : -1;
  ------------------
  |  Branch (1582:18): [True: 3.84k, False: 13.2k]
  ------------------
 1583|  17.0k|    UA_DateTime dt = (UA_DateTime)
 1584|  17.0k|        (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  327|  17.0k|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|  17.0k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  17.0k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  17.0k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  285|  17.0k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  17.0k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  17.0k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  285|  17.0k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  17.0k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  17.0k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1585|       |
 1586|       |    /* Parse the fraction of the second if defined */
 1587|  17.0k|    if(tokenData[pos] == ',' || tokenData[pos] == '.') {
  ------------------
  |  Branch (1587:8): [True: 721, False: 16.3k]
  |  Branch (1587:33): [True: 4.29k, False: 12.0k]
  ------------------
 1588|  5.01k|        pos++;
 1589|  5.01k|        double frac = 0.0;
 1590|  5.01k|        double denom = 0.1;
 1591|   126k|        while(pos < tokenSize &&
  ------------------
  |  Branch (1591:15): [True: 126k, False: 0]
  ------------------
 1592|   126k|              tokenData[pos] >= '0' && tokenData[pos] <= '9') {
  ------------------
  |  Branch (1592:15): [True: 126k, False: 22]
  |  Branch (1592:40): [True: 121k, False: 4.99k]
  ------------------
 1593|   121k|            frac += denom * (tokenData[pos] - '0');
 1594|   121k|            denom *= 0.1;
 1595|   121k|            pos++;
 1596|   121k|        }
 1597|  5.01k|        frac += 0.00000005; /* Correct rounding when converting to integer */
 1598|  5.01k|        dt += (UA_DateTime)(frac * UA_DATETIME_SEC);
  ------------------
  |  |  285|  5.01k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  5.01k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  5.01k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1599|  5.01k|    }
 1600|       |
 1601|       |    /* Remove the underflow/overflow protection (see above) */
 1602|  17.0k|    if(sinceunix > 0) {
  ------------------
  |  Branch (1602:8): [True: 3.84k, False: 13.2k]
  ------------------
 1603|  3.84k|        if(dt > UA_INT64_MAX - UA_DATETIME_SEC)
  ------------------
  |  |  118|  3.84k|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  ------------------
                      if(dt > UA_INT64_MAX - UA_DATETIME_SEC)
  ------------------
  |  |  285|  3.84k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  3.84k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  3.84k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1603:12): [True: 0, False: 3.84k]
  ------------------
 1604|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1605|  3.84k|        dt += UA_DATETIME_SEC;
  ------------------
  |  |  285|  3.84k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  3.84k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  3.84k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1606|  13.2k|    } else {
 1607|  13.2k|        if(dt < UA_INT64_MIN + UA_DATETIME_SEC)
  ------------------
  |  |  119|  13.2k|#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
  |  |  ------------------
  |  |  |  |  118|  13.2k|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  |  |  ------------------
  ------------------
                      if(dt < UA_INT64_MIN + UA_DATETIME_SEC)
  ------------------
  |  |  285|  13.2k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  13.2k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  13.2k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1607:12): [True: 0, False: 13.2k]
  ------------------
 1608|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1609|  13.2k|        dt -= UA_DATETIME_SEC;
  ------------------
  |  |  285|  13.2k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  13.2k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  13.2k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1610|  13.2k|    }
 1611|       |
 1612|       |    /* We must be at the end of the string (ending with 'Z' as checked above) */
 1613|  17.0k|    if(pos != tokenSize - 1)
  ------------------
  |  Branch (1613:8): [True: 39, False: 17.0k]
  ------------------
 1614|     39|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     39|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1615|       |
 1616|  17.0k|    *dst = dt;
 1617|       |
 1618|  17.0k|    ctx->index++;
 1619|  17.0k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  17.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1620|  17.0k|}
ua_types_encoding_json.c:Guid_decodeJson:
 1335|  1.18k|DECODE_JSON(Guid) {
 1336|  1.18k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  1.18k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  1.18k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 1.18k]
  |  |  ------------------
  |  | 1038|  1.18k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  1.18k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 1.18k]
  |  |  ------------------
  ------------------
 1337|  1.18k|    CHECK_STRING;
  ------------------
  |  | 1051|  1.18k|#define CHECK_STRING do {                                \
  |  | 1052|  1.18k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1052:8): [True: 0, False: 1.18k]
  |  |  ------------------
  |  | 1053|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1054|  1.18k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1054:14): [Folded, False: 1.18k]
  |  |  ------------------
  ------------------
 1338|  1.18k|    GET_TOKEN;
  ------------------
  |  | 1032|  1.18k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|  1.18k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|  1.18k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 1.18k]
  |  |  ------------------
  ------------------
 1339|       |
 1340|       |    /* Use the existing parsing routine if available */
 1341|  1.18k|    UA_String str = {tokenSize, (UA_Byte*)(uintptr_t)tokenData};
 1342|  1.18k|    ctx->index++;
 1343|  1.18k|    return UA_Guid_parse(dst, str);
 1344|  1.18k|}
ua_types_encoding_json.c:ByteString_decodeJson:
 1390|  1.65k|DECODE_JSON(ByteString) {
 1391|  1.65k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  1.65k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  1.65k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 1.65k]
  |  |  ------------------
  |  | 1038|  1.65k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  1.65k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 1.65k]
  |  |  ------------------
  ------------------
 1392|  1.65k|    CHECK_STRING;
  ------------------
  |  | 1051|  1.65k|#define CHECK_STRING do {                                \
  |  | 1052|  1.65k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1052:8): [True: 2, False: 1.65k]
  |  |  ------------------
  |  | 1053|      2|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1054|  1.65k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1054:14): [Folded, False: 1.65k]
  |  |  ------------------
  ------------------
 1393|  1.65k|    GET_TOKEN;
  ------------------
  |  | 1032|  1.65k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|  1.65k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|  1.65k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 1.65k]
  |  |  ------------------
  ------------------
 1394|       |
 1395|       |    /* Empty bytestring? */
 1396|  1.65k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1396:8): [True: 1.39k, False: 263]
  ------------------
 1397|  1.39k|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  1.39k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1398|  1.39k|        dst->length = 0;
 1399|  1.39k|    } else {
 1400|    263|        size_t flen = 0;
 1401|    263|        unsigned char* unB64 =
 1402|    263|            UA_unbase64((const unsigned char*)tokenData, tokenSize, &flen);
 1403|    263|        if(unB64 == 0)
  ------------------
  |  Branch (1403:12): [True: 26, False: 237]
  ------------------
 1404|     26|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     26|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1405|    237|        dst->data = (u8*)unB64;
 1406|    237|        dst->length = flen;
 1407|    237|    }
 1408|       |
 1409|  1.63k|    ctx->index++;
 1410|  1.63k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.63k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1411|  1.65k|}
ua_types_encoding_json.c:NodeId_decodeJson:
 1468|  3.95k|DECODE_JSON(NodeId) {
 1469|  3.95k|    UA_String str;
 1470|  3.95k|    UA_String_init(&str);
 1471|  3.95k|    status res = String_decodeJson(ctx, &str, NULL);
 1472|  3.95k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  3.95k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1472:8): [True: 3.93k, False: 22]
  ------------------
 1473|  3.93k|        res = UA_NodeId_parseEx(dst, str, ctx->namespaceMapping);
 1474|  3.95k|    UA_String_clear(&str);
 1475|  3.95k|    return res;
 1476|  3.95k|}
ua_types_encoding_json.c:ExpandedNodeId_decodeJson:
 1478|  18.3k|DECODE_JSON(ExpandedNodeId) {
 1479|  18.3k|    UA_String str;
 1480|  18.3k|    UA_String_init(&str);
 1481|  18.3k|    status res = String_decodeJson(ctx, &str, NULL);
 1482|  18.3k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  18.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1482:8): [True: 18.3k, False: 3]
  ------------------
 1483|  18.3k|        res = UA_ExpandedNodeId_parseEx(dst, str, ctx->namespaceMapping,
 1484|  18.3k|                                        ctx->serverUrisSize, ctx->serverUris);
 1485|  18.3k|    UA_String_clear(&str);
 1486|  18.3k|    return res;
 1487|  18.3k|}
ua_types_encoding_json.c:StatusCode_decodeJson:
 1622|  1.21k|DECODE_JSON(StatusCode) {
 1623|  1.21k|    CHECK_OBJECT;
  ------------------
  |  | 1056|  1.21k|#define CHECK_OBJECT do {                                \
  |  | 1057|  1.21k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1057:8): [True: 0, False: 1.21k]
  |  |  ------------------
  |  | 1058|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1059|  1.21k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1059:14): [Folded, False: 1.21k]
  |  |  ------------------
  ------------------
 1624|  1.21k|    DecodeEntry entries[2] = {
 1625|  1.21k|        {UA_JSONKEY_CODE, dst, NULL, false, &UA_TYPES[UA_TYPES_UINT32]},
  ------------------
  |  |  225|  1.21k|#define UA_TYPES_UINT32 6
  ------------------
 1626|  1.21k|        {UA_JSONKEY_SYMBOL, NULL, NULL, false, NULL}
 1627|  1.21k|    };
 1628|  1.21k|    return decodeFields(ctx, entries, 2);
 1629|  1.21k|}
ua_types_encoding_json.c:QualifiedName_decodeJson:
 1424|   198k|DECODE_JSON(QualifiedName) {
 1425|   198k|    UA_String str;
 1426|   198k|    UA_String_init(&str);
 1427|   198k|    status res = String_decodeJson(ctx, &str, NULL);
 1428|   198k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|   198k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1428:8): [True: 198k, False: 28]
  ------------------
 1429|   198k|        res = UA_QualifiedName_parseEx(dst, str, ctx->namespaceMapping);
 1430|   198k|    UA_String_clear(&str);
 1431|   198k|    return res;
 1432|   198k|}
ua_types_encoding_json.c:LocalizedText_decodeJson:
 1413|  1.89M|DECODE_JSON(LocalizedText) {
 1414|  1.89M|    CHECK_OBJECT;
  ------------------
  |  | 1056|  1.89M|#define CHECK_OBJECT do {                                \
  |  | 1057|  1.89M|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1057:8): [True: 0, False: 1.89M]
  |  |  ------------------
  |  | 1058|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1059|  1.89M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1059:14): [Folded, False: 1.89M]
  |  |  ------------------
  ------------------
 1415|       |
 1416|  1.89M|    DecodeEntry entries[2] = {
 1417|  1.89M|        {UA_JSONKEY_LOCALE, &dst->locale, NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  395|  1.89M|#define UA_TYPES_STRING 11
  ------------------
 1418|  1.89M|        {UA_JSONKEY_TEXT, &dst->text, NULL, false, &UA_TYPES[UA_TYPES_STRING]}
  ------------------
  |  |  395|  1.89M|#define UA_TYPES_STRING 11
  ------------------
 1419|  1.89M|    };
 1420|       |
 1421|  1.89M|    return decodeFields(ctx, entries, 2);
 1422|  1.89M|}
ua_types_encoding_json.c:ExtensionObject_decodeJson:
 2014|  49.8k|DECODE_JSON(ExtensionObject) {
 2015|  49.8k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1061|  49.8k|#define CHECK_NULL_SKIP do {                         \
  |  | 1062|  49.8k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1062:8): [True: 0, False: 49.8k]
  |  |  ------------------
  |  | 1063|      0|        ctx->index++;                                \
  |  | 1064|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1065|  49.8k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1065:14): [Folded, False: 49.8k]
  |  |  ------------------
  ------------------
 2016|  49.8k|    CHECK_OBJECT;
  ------------------
  |  | 1056|  49.8k|#define CHECK_OBJECT do {                                \
  |  | 1057|  49.8k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1057:8): [True: 1, False: 49.8k]
  |  |  ------------------
  |  | 1058|      1|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1059|  49.8k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1059:14): [Folded, False: 49.8k]
  |  |  ------------------
  ------------------
 2017|       |
 2018|       |    /* Empty object -> Null ExtensionObject */
 2019|  49.8k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (2019:8): [True: 49.7k, False: 142]
  ------------------
 2020|  49.7k|        ctx->index++; /* Skip the empty ExtensionObject */
 2021|  49.7k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  49.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2022|  49.7k|    }
 2023|       |
 2024|       |    /* Store the index where the ExtensionObject begins */
 2025|    142|    size_t beginIndex = ctx->index;
 2026|       |
 2027|       |    /* Search for non-JSON encoding */
 2028|    142|    UA_UInt64 encoding = 0;
 2029|    142|    size_t encIndex = 0;
 2030|    142|    status ret = lookAheadForKey(ctx, UA_JSONKEY_ENCODING, &encIndex);
 2031|    142|    if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|    142|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2031:8): [True: 104, False: 38]
  ------------------
 2032|    104|        const char *extObjEncoding = &ctx->json5[ctx->tokens[encIndex].start];
 2033|    104|        size_t len = parseUInt64(extObjEncoding, getTokenLength(&ctx->tokens[encIndex]), &encoding);
 2034|    104|        if(len == 0 || encoding > 2)
  ------------------
  |  Branch (2034:12): [True: 0, False: 104]
  |  Branch (2034:24): [True: 104, False: 0]
  ------------------
 2035|    104|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    104|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2036|    104|    }
 2037|       |
 2038|       |    /* Get the type NodeId index */
 2039|     38|    size_t typeIdIndex = 0;
 2040|     38|    ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 2041|     38|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|     38|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2041:8): [True: 5, False: 33]
  ------------------
 2042|      5|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2043|       |
 2044|       |    /* Decode the type NodeId */
 2045|     33|    UA_NodeId typeId;
 2046|     33|    UA_NodeId_init(&typeId);
 2047|     33|    ctx->index = (UA_UInt16)typeIdIndex;
 2048|     33|    ret = NodeId_decodeJson(ctx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|     33|#define UA_TYPES_NODEID 16
  ------------------
 2049|     33|    ctx->index = beginIndex;
 2050|     33|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|     33|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2050:8): [True: 33, False: 0]
  ------------------
 2051|     33|        UA_NodeId_clear(&typeId); /* We don't have the global cleanup */
 2052|     33|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     33|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2053|     33|    }
 2054|       |
 2055|       |    /* Lookup the type */
 2056|      0|    type = UA_findDataTypeWithCustom(&typeId, ctx->customTypes);
 2057|       |
 2058|       |    /* Unknown body type */
 2059|      0|    if(!type) {
  ------------------
  |  Branch (2059:8): [True: 0, False: 0]
  ------------------
 2060|       |        /* FIXME: We need UA_EXTENSIONOBJECT_ENCODED_JSON when we parse an
 2061|       |         * unknown type in JSON. But it is not defined in the standard. */
 2062|      0|        dst->encoding = (encoding != 2) ?
  ------------------
  |  Branch (2062:25): [True: 0, False: 0]
  ------------------
 2063|      0|            UA_EXTENSIONOBJECT_ENCODED_BYTESTRING :
 2064|      0|            UA_EXTENSIONOBJECT_ENCODED_XML;
 2065|      0|        dst->content.encoded.typeId = typeId;
 2066|       |
 2067|       |        /* Get the body field index */
 2068|      0|        size_t bodyIndex = 0;
 2069|      0|        ret = lookAheadForKey(ctx, UA_JSONKEY_BODY, &bodyIndex);
 2070|      0|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2070:12): [True: 0, False: 0]
  ------------------
 2071|       |            /* Only JSON structures can be encoded in-situ */
 2072|      0|            if(encoding != 0)
  ------------------
  |  Branch (2072:16): [True: 0, False: 0]
  ------------------
 2073|      0|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2074|       |
 2075|       |            /* Extract the entire ExtensionObject object as the body */
 2076|      0|            size_t parentIndex = ctx->index;
 2077|      0|            ret = tokenToByteString(ctx, &dst->content.encoded.body);
 2078|      0|            if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2078:16): [True: 0, False: 0]
  ------------------
 2079|      0|                return ret;
 2080|       |
 2081|       |            /* Remove the UaEncoding and UaTypeId field from the encoding.
 2082|       |             * Remove the later field first. */
 2083|      0|            if(encIndex != 0 && encIndex > typeIdIndex)
  ------------------
  |  Branch (2083:16): [True: 0, False: 0]
  |  Branch (2083:33): [True: 0, False: 0]
  ------------------
 2084|      0|                removeFieldFromEncoding(ctx, &dst->content.encoded.body, parentIndex, encIndex);
 2085|      0|            removeFieldFromEncoding(ctx, &dst->content.encoded.body, parentIndex, typeIdIndex);
 2086|      0|            if(encIndex != 0 && encIndex < typeIdIndex)
  ------------------
  |  Branch (2086:16): [True: 0, False: 0]
  |  Branch (2086:33): [True: 0, False: 0]
  ------------------
 2087|      0|                removeFieldFromEncoding(ctx, &dst->content.encoded.body, parentIndex, encIndex);
 2088|       |
 2089|      0|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2090|      0|        }
 2091|       |
 2092|      0|        ctx->index = bodyIndex;
 2093|      0|        if(encoding != 0) {
  ------------------
  |  Branch (2093:12): [True: 0, False: 0]
  ------------------
 2094|       |            /* Decode the body as a ByteString */
 2095|      0|            ret = ByteString_decodeJson(ctx, &dst->content.encoded.body, NULL);
 2096|      0|        } else {
 2097|       |            /* Use the JSON encoding directly */
 2098|      0|            ret = tokenToByteString(ctx, &dst->content.encoded.body);
 2099|      0|        }
 2100|      0|        ctx->index = beginIndex;
 2101|      0|        skipObject(ctx);
 2102|      0|        return ret;
 2103|      0|    }
 2104|       |
 2105|       |    /* No need to keep the TypeId */
 2106|      0|    UA_NodeId_clear(&typeId);
 2107|       |
 2108|       |    /* Disallow directly nested ExtensionObjects */
 2109|      0|    if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (2109:8): [True: 0, False: 0]
  ------------------
 2110|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2111|       |
 2112|       |    /* Allocate memory for the decoded data */
 2113|      0|    dst->content.decoded.data = UA_new(type);
 2114|      0|    if(!dst->content.decoded.data)
  ------------------
  |  Branch (2114:8): [True: 0, False: 0]
  ------------------
 2115|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2116|      0|    dst->content.decoded.type = type;
 2117|      0|    dst->encoding = UA_EXTENSIONOBJECT_DECODED;
 2118|       |
 2119|       |    /* Get the body field index */
 2120|      0|    size_t bodyIndex = ctx->index;
 2121|      0|    ret = lookAheadForKey(ctx, UA_JSONKEY_BODY, &bodyIndex); /* Can fail */
 2122|      0|    if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2122:8): [True: 0, False: 0]
  ------------------
 2123|      0|        ctx->index = bodyIndex;
 2124|      0|        ret = decodeJsonJumpTable[type->typeKind](ctx, dst->content.decoded.data, type);
 2125|      0|        ctx->index = beginIndex;
 2126|      0|        skipObject(ctx);
 2127|      0|        return ret;
 2128|      0|    }
 2129|       |
 2130|      0|    return decodeJsonJumpTable[type->typeKind](ctx, dst->content.decoded.data, type);
 2131|      0|}
ua_types_encoding_json.c:DataValue_decodeJson:
 1912|   164k|DECODE_JSON(DataValue) {
 1913|   164k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1061|   164k|#define CHECK_NULL_SKIP do {                         \
  |  | 1062|   164k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1062:8): [True: 0, False: 164k]
  |  |  ------------------
  |  | 1063|      0|        ctx->index++;                                \
  |  | 1064|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1065|   164k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1065:14): [Folded, False: 164k]
  |  |  ------------------
  ------------------
 1914|   164k|    CHECK_OBJECT;
  ------------------
  |  | 1056|   164k|#define CHECK_OBJECT do {                                \
  |  | 1057|   164k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1057:8): [True: 6, False: 164k]
  |  |  ------------------
  |  | 1058|      6|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1059|   164k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1059:14): [Folded, False: 164k]
  |  |  ------------------
  ------------------
 1915|       |
 1916|       |    /* Decode the Variant in-situ */
 1917|   164k|    size_t beginIndex = ctx->index;
 1918|   164k|    status ret = decodeJSONVariant(ctx, &dst->value);
 1919|   164k|    ctx->index = beginIndex;
 1920|   164k|    dst->hasValue = (dst->value.type != NULL);
 1921|   164k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|   164k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1921:8): [True: 195, False: 164k]
  ------------------
 1922|    195|        return ret;
 1923|       |
 1924|       |    /* Decode the other members (skip the Variant members) */
 1925|   164k|    DecodeEntry entries[8] = {
 1926|   164k|        {UA_JSONKEY_TYPE, NULL, NULL, false, NULL},
 1927|   164k|        {UA_JSONKEY_VALUE, NULL, NULL, false, NULL},
 1928|   164k|        {UA_JSONKEY_DIMENSIONS, NULL, NULL, false, NULL},
 1929|   164k|        {UA_JSONKEY_STATUS, &dst->status, NULL, false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  633|   164k|#define UA_TYPES_STATUSCODE 18
  ------------------
 1930|   164k|        {UA_JSONKEY_SOURCETIMESTAMP, &dst->sourceTimestamp, NULL, false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  429|   164k|#define UA_TYPES_DATETIME 12
  ------------------
 1931|   164k|        {UA_JSONKEY_SOURCEPICOSECONDS, &dst->sourcePicoseconds, NULL, false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  157|   164k|#define UA_TYPES_UINT16 4
  ------------------
 1932|   164k|        {UA_JSONKEY_SERVERTIMESTAMP, &dst->serverTimestamp, NULL, false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  429|   164k|#define UA_TYPES_DATETIME 12
  ------------------
 1933|   164k|        {UA_JSONKEY_SERVERPICOSECONDS, &dst->serverPicoseconds, NULL, false, &UA_TYPES[UA_TYPES_UINT16]}
  ------------------
  |  |  157|   164k|#define UA_TYPES_UINT16 4
  ------------------
 1934|   164k|    };
 1935|       |
 1936|   164k|    ret = decodeFields(ctx, entries, 8);
 1937|   164k|    dst->hasStatus = entries[3].found;
 1938|   164k|    dst->hasSourceTimestamp = entries[4].found;
 1939|   164k|    dst->hasSourcePicoseconds = entries[5].found;
 1940|   164k|    dst->hasServerTimestamp = entries[6].found;
 1941|   164k|    dst->hasServerPicoseconds = entries[7].found;
 1942|   164k|    return ret;
 1943|   164k|}
ua_types_encoding_json.c:decodeJSONVariant:
 1784|   278k|decodeJSONVariant(ParseCtx *ctx, UA_Variant *dst) {
 1785|       |    /* Empty variant == null */
 1786|   278k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (1786:8): [True: 167k, False: 110k]
  ------------------
 1787|   167k|        ctx->index++;
 1788|   167k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   167k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1789|   167k|    }
 1790|       |
 1791|       |    /* Search the value field */
 1792|   110k|    size_t valueIndex = 0;
 1793|   110k|    lookAheadForKey(ctx, UA_JSONKEY_VALUE, &valueIndex);
 1794|       |
 1795|       |    /* Search for the dimensions field */
 1796|   110k|    size_t dimIndex = 0;
 1797|   110k|    lookAheadForKey(ctx, UA_JSONKEY_DIMENSIONS, &dimIndex);
 1798|       |
 1799|       |    /* Parse the type kind */
 1800|   110k|    size_t typeIndex = 0;
 1801|   110k|    lookAheadForKey(ctx, UA_JSONKEY_TYPE, &typeIndex);
 1802|   110k|    if(typeIndex == 0 || ctx->tokens[typeIndex].type != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1802:8): [True: 74, False: 110k]
  |  Branch (1802:26): [True: 1, False: 110k]
  ------------------
 1803|     75|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     75|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1804|   110k|    UA_UInt64 typeKind = 0;
 1805|   110k|    size_t len = parseUInt64(&ctx->json5[ctx->tokens[typeIndex].start],
 1806|   110k|                             getTokenLength(&ctx->tokens[typeIndex]), &typeKind);
 1807|   110k|    if(len == 0)
  ------------------
  |  Branch (1807:8): [True: 3, False: 110k]
  ------------------
 1808|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1809|       |
 1810|       |    /* Shift to get the datatype index. The type must be a builtin data type.
 1811|       |     * All not-builtin types are wrapped in an ExtensionObject. */
 1812|   110k|    typeKind--;
 1813|   110k|    if(typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (1813:8): [True: 15, False: 110k]
  ------------------
 1814|     15|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     15|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1815|   110k|    const UA_DataType *type = &UA_TYPES[typeKind];
 1816|       |
 1817|       |    /* Value is an array? */
 1818|   110k|    UA_Boolean isArray =
 1819|   110k|        (valueIndex > 0 && ctx->tokens[valueIndex].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  Branch (1819:10): [True: 62.8k, False: 47.4k]
  |  Branch (1819:28): [True: 12.6k, False: 50.2k]
  ------------------
 1820|       |
 1821|       |    /* Adjust the depth and set the value index as current */
 1822|   110k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|   110k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (1822:8): [True: 0, False: 110k]
  ------------------
 1823|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1824|   110k|    size_t beginIndex = ctx->index;
 1825|   110k|    ctx->index = valueIndex;
 1826|   110k|    ctx->depth++;
 1827|       |
 1828|       |    /* Decode the value */
 1829|   110k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   110k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1830|   110k|    if(!isArray) {
  ------------------
  |  Branch (1830:8): [True: 97.7k, False: 12.6k]
  ------------------
 1831|       |        /* Scalar with dimensions -> error */
 1832|  97.7k|        if(dimIndex > 0) {
  ------------------
  |  Branch (1832:12): [True: 16, False: 97.7k]
  ------------------
 1833|     16|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     16|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1834|     16|            goto out;
 1835|     16|        }
 1836|       |
 1837|       |        /* A variant cannot contain a variant. But it can contain an array of
 1838|       |         * variants */
 1839|  97.7k|        if(type->typeKind == UA_DATATYPEKIND_VARIANT) {
  ------------------
  |  Branch (1839:12): [True: 0, False: 97.7k]
  ------------------
 1840|      0|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1841|      0|            goto out;
 1842|      0|        }
 1843|       |
 1844|       |        /* Decode a value wrapped in an ExtensionObject */
 1845|  97.7k|        if(valueIndex > 0 && type->typeKind == UA_DATATYPEKIND_EXTENSIONOBJECT) {
  ------------------
  |  Branch (1845:12): [True: 50.2k, False: 47.4k]
  |  Branch (1845:30): [True: 495, False: 49.7k]
  ------------------
 1846|    495|            res = Variant_decodeJsonUnwrapExtensionObject(ctx, dst, NULL);
 1847|    495|            goto out;
 1848|    495|        }
 1849|       |
 1850|       |        /* Allocate memory for the value */
 1851|  97.2k|        dst->data = UA_new(type);
 1852|  97.2k|        if(!dst->data) {
  ------------------
  |  Branch (1852:12): [True: 0, False: 97.2k]
  ------------------
 1853|      0|            res = UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1854|      0|            goto out;
 1855|      0|        }
 1856|  97.2k|        dst->type = type;
 1857|       |
 1858|       |        /* Decode the value */
 1859|  97.2k|        if(valueIndex > 0 && ctx->tokens[valueIndex].type != CJ5_TOKEN_NULL)
  ------------------
  |  Branch (1859:12): [True: 49.7k, False: 47.4k]
  |  Branch (1859:30): [True: 46.8k, False: 2.94k]
  ------------------
 1860|  46.8k|            res = decodeJsonJumpTable[type->typeKind](ctx, dst->data, type);
 1861|  97.2k|    } else {
 1862|       |        /* Decode an array. Try to unwrap ExtensionObjects in the array. The
 1863|       |         * members must all have the same type. */
 1864|  12.6k|        const UA_DataType *unwrapType = NULL;
 1865|  12.6k|        if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  735|  12.6k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (1865:12): [True: 531, False: 12.0k]
  ------------------
 1866|    531|            unwrapType = getArrayUnwrapType(ctx);
 1867|  12.6k|        if(unwrapType) {
  ------------------
  |  Branch (1867:12): [True: 0, False: 12.6k]
  ------------------
 1868|      0|            dst->type = unwrapType;
 1869|      0|            res = Array_decodeJsonUnwrapExtensionObject(ctx, &dst->data, unwrapType);
 1870|  12.6k|        } else {
 1871|  12.6k|            dst->type = type;
 1872|  12.6k|            res = Array_decodeJson(ctx, &dst->data, type);
 1873|  12.6k|        }
 1874|       |
 1875|       |        /* Decode array dimensions */
 1876|  12.6k|        if(dimIndex > 0) {
  ------------------
  |  Branch (1876:12): [True: 3.34k, False: 9.27k]
  ------------------
 1877|  3.34k|            ctx->index = dimIndex;
 1878|  3.34k|            res |= Array_decodeJson(ctx, (void**)&dst->arrayDimensions, &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  225|  3.34k|#define UA_TYPES_UINT32 6
  ------------------
 1879|       |
 1880|       |            /* Help clang-analyzer */
 1881|  3.34k|            UA_assert(dst->arrayDimensionsSize == 0 || dst->arrayDimensions);
  ------------------
  |  |  397|  3.34k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1881:13): [True: 26, False: 3.32k]
  |  Branch (1881:13): [True: 3.32k, False: 0]
  ------------------
 1882|       |
 1883|       |            /* Validate the dimensions */
 1884|  3.34k|            size_t total = 1;
 1885|  1.95M|            for(size_t i = 0; i < dst->arrayDimensionsSize; i++)
  ------------------
  |  Branch (1885:31): [True: 1.95M, False: 3.34k]
  ------------------
 1886|  1.95M|                total *= dst->arrayDimensions[i];
 1887|  3.34k|            if(total != dst->arrayLength)
  ------------------
  |  Branch (1887:16): [True: 83, False: 3.26k]
  ------------------
 1888|     83|                res |= UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     83|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1889|       |
 1890|       |            /* Only keep >= 2 dimensions */
 1891|  3.34k|            if(dst->arrayDimensionsSize == 1) {
  ------------------
  |  Branch (1891:16): [True: 27, False: 3.32k]
  ------------------
 1892|     27|                UA_free(dst->arrayDimensions);
  ------------------
  |  |   19|     27|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1893|     27|                dst->arrayDimensions = NULL;
 1894|     27|                dst->arrayDimensionsSize = 0;
 1895|     27|            }
 1896|  3.34k|        }
 1897|  12.6k|    }
 1898|       |
 1899|   110k| out:
 1900|   110k|    ctx->index = beginIndex;
 1901|   110k|    skipObject(ctx);
 1902|   110k|    ctx->depth--;
 1903|   110k|    return res;
 1904|   110k|}
ua_types_encoding_json.c:Variant_decodeJsonUnwrapExtensionObject:
 2134|    495|Variant_decodeJsonUnwrapExtensionObject(ParseCtx *ctx, void *p, const UA_DataType *type) {
 2135|    495|    (void) type;
 2136|    495|    UA_Variant *dst = (UA_Variant*)p;
 2137|       |
 2138|       |    /* ExtensionObject with null body */
 2139|    495|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2139:8): [True: 388, False: 107]
  ------------------
 2140|    388|        dst->data = UA_ExtensionObject_new();
 2141|    388|        dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|    388|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2142|    388|        ctx->index++;
 2143|    388|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    388|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2144|    388|    }
 2145|       |
 2146|       |    /* Decode the ExtensionObject */
 2147|    107|    UA_ExtensionObject eo;
 2148|    107|    UA_ExtensionObject_init(&eo);
 2149|    107|    UA_StatusCode ret = ExtensionObject_decodeJson(ctx, &eo, NULL);
 2150|    107|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|    107|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2150:8): [True: 107, False: 0]
  ------------------
 2151|    107|        UA_ExtensionObject_clear(&eo); /* We don't have the global cleanup */
 2152|    107|        return ret;
 2153|    107|    }
 2154|       |
 2155|       |    /* The content is still encoded, cannot unwrap */
 2156|      0|    if(eo.encoding != UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2156:8): [True: 0, False: 0]
  ------------------
 2157|      0|        goto use_eo;
 2158|       |
 2159|       |    /* The content is a builtin type that could have been directly encoded in
 2160|       |     * the Variant, there was no need to wrap in an ExtensionObject. But this
 2161|       |     * means for us, that somebody made an extra effort to explicitly get an
 2162|       |     * ExtensionObject. So we keep it. As an added advantage we will generate
 2163|       |     * the same JSON again when encoding again. */
 2164|      0|    if(eo.content.decoded.type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (2164:8): [True: 0, False: 0]
  ------------------
 2165|      0|        goto use_eo;
 2166|       |
 2167|       |    /* Unwrap the ExtensionObject */
 2168|      0|    dst->data = eo.content.decoded.data;
 2169|      0|    dst->type = eo.content.decoded.type;
 2170|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2171|       |
 2172|      0| use_eo:
 2173|       |    /* Don't unwrap */
 2174|      0|    dst->data = UA_new(&UA_TYPES[UA_TYPES_EXTENSIONOBJECT]);
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2175|      0|    if(!dst->data) {
  ------------------
  |  Branch (2175:8): [True: 0, False: 0]
  ------------------
 2176|      0|        UA_ExtensionObject_clear(&eo);
 2177|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2178|      0|    }
 2179|      0|    dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2180|      0|    *(UA_ExtensionObject*)dst->data = eo;
 2181|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2182|      0|}
ua_types_encoding_json.c:getArrayUnwrapType:
 1666|    531|getArrayUnwrapType(ParseCtx *ctx) {
 1667|    531|    UA_assert(ctx->tokens[ctx->index].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  |  397|    531|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1667:5): [True: 531, False: 0]
  ------------------
 1668|       |
 1669|       |    /* Return early for empty arrays */
 1670|    531|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 1671|    531|    if(length == 0)
  ------------------
  |  Branch (1671:8): [True: 197, False: 334]
  ------------------
 1672|    197|        return NULL;
 1673|       |
 1674|       |    /* Save the original index and go to the first array member */
 1675|    334|    size_t oldIndex = ctx->index;
 1676|    334|    ctx->index++;
 1677|       |
 1678|       |    /* Lookup the type for the first array member */
 1679|    334|    UA_NodeId typeId;
 1680|    334|    UA_NodeId_init(&typeId);
 1681|    334|    const UA_DataType *typeOfBody = getExtensionObjectType(ctx);
 1682|    334|    if(!typeOfBody) {
  ------------------
  |  Branch (1682:8): [True: 334, False: 0]
  ------------------
 1683|    334|        ctx->index = oldIndex; /* Restore the index */
 1684|    334|        return NULL;
 1685|    334|    }
 1686|       |
 1687|       |    /* Get the TypeId encoding for faster comparison below.
 1688|       |     * Cannot fail as getExtensionObjectType already looked this up. */
 1689|      0|    size_t typeIdIndex = 0;
 1690|      0|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 1691|      0|    (void)ret;
 1692|      0|    UA_assert(ret == UA_STATUSCODE_GOOD);
  ------------------
  |  |  397|      0|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1692:5): [True: 0, False: 0]
  ------------------
 1693|      0|    const char* typeIdData = &ctx->json5[ctx->tokens[typeIdIndex].start];
 1694|      0|    size_t typeIdSize = getTokenLength(&ctx->tokens[typeIdIndex]);
 1695|       |
 1696|       |    /* Loop over all members and check whether they can be unwrapped. Don't skip
 1697|       |     * the first member. We still haven't checked the encoding type. */
 1698|      0|    for(size_t i = 0; i < length; i++) {
  ------------------
  |  Branch (1698:23): [True: 0, False: 0]
  ------------------
 1699|       |        /* Array element must be an object */
 1700|      0|        if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {
  ------------------
  |  Branch (1700:12): [True: 0, False: 0]
  ------------------
 1701|      0|            ctx->index = oldIndex; /* Restore the index */
 1702|      0|            return NULL;
 1703|      0|        }
 1704|       |
 1705|       |        /* Check for non-JSON encoding */
 1706|      0|        size_t encIndex = 0;
 1707|      0|        ret = lookAheadForKey(ctx, UA_JSONKEY_ENCODING, &encIndex);
 1708|      0|        if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1708:12): [True: 0, False: 0]
  ------------------
 1709|      0|            ctx->index = oldIndex; /* Restore the index */
 1710|      0|            return NULL;
 1711|      0|        }
 1712|       |
 1713|       |        /* Get the type NodeId index */
 1714|      0|        size_t memberTypeIdIndex = 0;
 1715|      0|        ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &memberTypeIdIndex);
 1716|      0|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1716:12): [True: 0, False: 0]
  ------------------
 1717|      0|            ctx->index = oldIndex; /* Restore the index */
 1718|      0|            return NULL;
 1719|      0|        }
 1720|       |
 1721|       |        /* Is it the same type? Compare raw NodeId string */
 1722|      0|        const char* memberTypeIdData = &ctx->json5[ctx->tokens[memberTypeIdIndex].start];
 1723|      0|        size_t memberTypeIdSize = getTokenLength(&ctx->tokens[memberTypeIdIndex]);
 1724|      0|        if(typeIdSize != memberTypeIdSize ||
  ------------------
  |  Branch (1724:12): [True: 0, False: 0]
  ------------------
 1725|      0|           memcmp(typeIdData, memberTypeIdData, typeIdSize) != 0) {
  ------------------
  |  Branch (1725:12): [True: 0, False: 0]
  ------------------
 1726|      0|            ctx->index = oldIndex; /* Restore the index */
 1727|      0|            return NULL;
 1728|      0|        }
 1729|       |
 1730|       |        /* Skip to the next array member */
 1731|      0|        skipObject(ctx);
 1732|      0|    }
 1733|       |
 1734|      0|    ctx->index = oldIndex; /* Restore the index */
 1735|      0|    return typeOfBody;
 1736|      0|}
ua_types_encoding_json.c:getExtensionObjectType:
 1634|    334|getExtensionObjectType(ParseCtx *ctx) {
 1635|    334|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (1635:8): [True: 237, False: 97]
  ------------------
 1636|    237|        return NULL;
 1637|       |
 1638|       |    /* Get the type NodeId index */
 1639|     97|    size_t typeIdIndex = 0;
 1640|     97|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 1641|     97|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|     97|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1641:8): [True: 64, False: 33]
  ------------------
 1642|     64|        return NULL;
 1643|       |
 1644|     33|    size_t oldIndex = ctx->index;
 1645|     33|    ctx->index = (UA_UInt16)typeIdIndex;
 1646|       |
 1647|       |    /* Decode the type NodeId */
 1648|     33|    UA_NodeId typeId;
 1649|     33|    UA_NodeId_init(&typeId);
 1650|     33|    ret = NodeId_decodeJson(ctx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|     33|#define UA_TYPES_NODEID 16
  ------------------
 1651|     33|    ctx->index = oldIndex;
 1652|     33|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|     33|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1652:8): [True: 33, False: 0]
  ------------------
 1653|     33|        UA_NodeId_clear(&typeId); /* We don't have the global cleanup */
 1654|     33|        return NULL;
 1655|     33|    }
 1656|       |
 1657|       |    /* Lookup an return */
 1658|      0|    const UA_DataType *type = UA_findDataTypeWithCustom(&typeId, ctx->customTypes);
 1659|      0|    UA_NodeId_clear(&typeId);
 1660|      0|    return type;
 1661|     33|}
ua_types_encoding_json.c:Array_decodeJson:
 2308|  15.9k|Array_decodeJson(ParseCtx *ctx, void **dst, const UA_DataType *type) {
 2309|       |    /* Save the length of the array */
 2310|  15.9k|    size_t *size_ptr = (size_t*) dst - 1;
 2311|       |
 2312|  15.9k|    if(currentTokenType(ctx) != CJ5_TOKEN_ARRAY)
  ------------------
  |  Branch (2312:8): [True: 4, False: 15.9k]
  ------------------
 2313|      4|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2314|       |
 2315|  15.9k|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 2316|       |
 2317|  15.9k|    ctx->index++; /* Go to first array member or to the first element after
 2318|       |                   * the array (if empty) */
 2319|       |
 2320|       |    /* Return early for empty arrays */
 2321|  15.9k|    if(length == 0) {
  ------------------
  |  Branch (2321:8): [True: 5.93k, False: 10.0k]
  ------------------
 2322|  5.93k|        *size_ptr = length;
 2323|  5.93k|        *dst = UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  5.93k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2324|  5.93k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  5.93k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2325|  5.93k|    }
 2326|       |
 2327|       |    /* Allocate memory */
 2328|  10.0k|    *dst = UA_calloc(length, type->memSize);
  ------------------
  |  |   20|  10.0k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2329|  10.0k|    if(*dst == NULL)
  ------------------
  |  Branch (2329:8): [True: 0, False: 10.0k]
  ------------------
 2330|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2331|       |
 2332|       |    /* Decode array members */
 2333|  10.0k|    uintptr_t ptr = (uintptr_t)*dst;
 2334|  15.3M|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (2334:23): [True: 15.3M, False: 9.63k]
  ------------------
 2335|  15.3M|        if(ctx->tokens[ctx->index].type != CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2335:12): [True: 15.2M, False: 59.7k]
  ------------------
 2336|  15.2M|            status ret = decodeJsonJumpTable[type->typeKind](ctx, (void*)ptr, type);
 2337|  15.2M|            if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  15.2M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2337:16): [True: 405, False: 15.2M]
  ------------------
 2338|    405|                UA_Array_delete(*dst, i+1, type);
 2339|    405|                *dst = NULL;
 2340|    405|                return ret;
 2341|    405|            }
 2342|  15.2M|        } else {
 2343|  59.7k|            ctx->index++;
 2344|  59.7k|        }
 2345|  15.3M|        ptr += type->memSize;
 2346|  15.3M|    }
 2347|       |
 2348|  9.63k|    *size_ptr = length; /* All good, set the size */
 2349|  9.63k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  9.63k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2350|  10.0k|}
ua_types_encoding_json.c:Variant_decodeJson:
 1906|   113k|DECODE_JSON(Variant) {
 1907|   113k|    CHECK_NULL_SKIP; /* Treat null as an empty variant */
  ------------------
  |  | 1061|   113k|#define CHECK_NULL_SKIP do {                         \
  |  | 1062|   113k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1062:8): [True: 0, False: 113k]
  |  |  ------------------
  |  | 1063|      0|        ctx->index++;                                \
  |  | 1064|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1065|   113k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1065:14): [Folded, False: 113k]
  |  |  ------------------
  ------------------
 1908|   113k|    CHECK_OBJECT;
  ------------------
  |  | 1056|   113k|#define CHECK_OBJECT do {                                \
  |  | 1057|   113k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1057:8): [True: 11, False: 113k]
  |  |  ------------------
  |  | 1058|     11|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     11|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1059|   113k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1059:14): [Folded, False: 113k]
  |  |  ------------------
  ------------------
 1909|   113k|    return decodeJSONVariant(ctx, dst);
 1910|   113k|}

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

UA_Guid_parse:
   86|  1.18k|UA_Guid_parse(UA_Guid *guid, const UA_String str) {
   87|  1.18k|    UA_StatusCode res = parse_guid(guid, str.data, str.data + str.length);
   88|  1.18k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  1.18k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (88:8): [True: 37, False: 1.14k]
  ------------------
   89|     37|        *guid = UA_GUID_NULL;
   90|  1.18k|    return res;
   91|  1.18k|}
UA_NodeId_parseEx:
  323|  3.93k|                  const UA_NamespaceMapping *nsMapping) {
  324|  3.93k|    UA_StatusCode res =
  325|  3.93k|        parse_nodeid(id, str.data, str.data+str.length, UA_ESCAPING_NONE, nsMapping);
  326|  3.93k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  3.93k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (326:8): [True: 97, False: 3.84k]
  ------------------
  327|     97|        UA_NodeId_clear(id);
  328|  3.93k|    return res;
  329|  3.93k|}
UA_ExpandedNodeId_parseEx:
  671|  18.3k|                          size_t serverUrisSize, const UA_String *serverUris) {
  672|  18.3k|    UA_StatusCode res =
  673|  18.3k|        parse_expandednodeid(id, str.data, str.data + str.length, UA_ESCAPING_NONE,
  674|  18.3k|                             nsMapping, serverUrisSize, serverUris);
  675|  18.3k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  18.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (675:8): [True: 119, False: 18.2k]
  ------------------
  676|    119|        UA_ExpandedNodeId_clear(id);
  677|  18.3k|    return res;
  678|  18.3k|}
UA_QualifiedName_parseEx:
  831|   198k|                         const UA_NamespaceMapping *nsMapping) {
  832|   198k|    const u8 *pos = str.data;
  833|   198k|    const u8 *end = str.data + str.length;
  834|   198k|    UA_StatusCode res = parse_qn(qn, pos, end, UA_ESCAPING_NONE, nsMapping, 0);
  835|   198k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|   198k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (835:8): [True: 0, False: 198k]
  ------------------
  836|      0|        UA_QualifiedName_clear(qn);
  837|   198k|    return res;
  838|   198k|}
ua_types_lex.c:parse_guid:
   50|  1.19k|parse_guid(UA_Guid *guid, const UA_Byte *s, const UA_Byte *e) {
   51|  1.19k|    size_t len = (size_t)(e - s);
   52|  1.19k|    if(len != 36 || s[8] != '-' || s[13] != '-' || s[23] != '-')
  ------------------
  |  Branch (52:8): [True: 19, False: 1.17k]
  |  Branch (52:21): [True: 3, False: 1.16k]
  |  Branch (52:36): [True: 1, False: 1.16k]
  |  Branch (52:52): [True: 6, False: 1.16k]
  ------------------
   53|     29|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     29|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   54|       |
   55|  1.16k|    UA_UInt32 tmp;
   56|  1.16k|    if(UA_readNumberWithBase(s, 8, &tmp, 16) != 8)
  ------------------
  |  Branch (56:8): [True: 3, False: 1.15k]
  ------------------
   57|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   58|  1.15k|    guid->data1 = tmp;
   59|       |
   60|  1.15k|    if(UA_readNumberWithBase(&s[9], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (60:8): [True: 2, False: 1.15k]
  ------------------
   61|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   62|  1.15k|    guid->data2 = (UA_UInt16)tmp;
   63|       |
   64|  1.15k|    if(UA_readNumberWithBase(&s[14], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (64:8): [True: 1, False: 1.15k]
  ------------------
   65|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   66|  1.15k|    guid->data3 = (UA_UInt16)tmp;
   67|       |
   68|  1.15k|    if(UA_readNumberWithBase(&s[19], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (68:8): [True: 1, False: 1.15k]
  ------------------
   69|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   70|  1.15k|    guid->data4[0] = (UA_Byte)tmp;
   71|       |
   72|  1.15k|    if(UA_readNumberWithBase(&s[21], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (72:8): [True: 1, False: 1.15k]
  ------------------
   73|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   74|  1.15k|    guid->data4[1] = (UA_Byte)tmp;
   75|       |
   76|  8.05k|    for(size_t pos = 2, spos = 24; pos < 8; pos++, spos += 2) {
  ------------------
  |  Branch (76:36): [True: 6.90k, False: 1.14k]
  ------------------
   77|  6.90k|        if(UA_readNumberWithBase(&s[spos], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (77:12): [True: 4, False: 6.90k]
  ------------------
   78|      4|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   79|  6.90k|        guid->data4[pos] = (UA_Byte)tmp;
   80|  6.90k|    }
   81|       |
   82|  1.14k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.14k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   83|  1.15k|}
ua_types_lex.c:parse_nodeid:
  148|  3.93k|             UA_Escaping idEsc, const UA_NamespaceMapping *nsMapping) {
  149|  3.93k|    *id = UA_NODEID_NULL; /* Reset the NodeId */
  150|  3.93k|    LexContext context;
  151|  3.93k|    memset(&context, 0, sizeof(LexContext));
  152|  3.93k|    UA_Byte *begin = (UA_Byte*)(uintptr_t)pos;
  153|  3.93k|    const u8 *ns = NULL, *nsu = NULL, *body = NULL;
  154|       |
  155|       |    
  156|  3.93k|{
  157|  3.93k|	u8 yych;
  158|  3.93k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.93k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.93k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.93k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.93k, False: 3]
  |  |  ------------------
  ------------------
  159|  3.93k|	switch (yych) {
  160|    419|		case 'b':
  ------------------
  |  Branch (160:3): [True: 419, False: 3.51k]
  ------------------
  161|    425|		case 'g':
  ------------------
  |  Branch (161:3): [True: 6, False: 3.93k]
  ------------------
  162|  1.01k|		case 'i':
  ------------------
  |  Branch (162:3): [True: 587, False: 3.35k]
  ------------------
  163|  2.91k|		case 's':
  ------------------
  |  Branch (163:3): [True: 1.90k, False: 2.03k]
  ------------------
  164|  2.91k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  2.91k|#define YYSTAGN(t) t = NULL
  ------------------
  165|  2.91k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  2.91k|#define YYSTAGN(t) t = NULL
  ------------------
  166|  2.91k|			goto yy3;
  167|  1.01k|		case 'n': goto yy4;
  ------------------
  |  Branch (167:3): [True: 1.01k, False: 2.92k]
  ------------------
  168|      5|		default: goto yy1;
  ------------------
  |  Branch (168:3): [True: 5, False: 3.93k]
  ------------------
  169|  3.93k|	}
  170|      5|yy1:
  171|      5|	YYSKIP();
  ------------------
  |  |   35|      5|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      5|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  172|     68|yy2:
  173|     68|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   43|     68|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  174|  2.91k|yy3:
  175|  2.91k|	YYSKIP();
  ------------------
  |  |   35|  2.91k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.91k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  176|  2.91k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.91k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.91k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.91k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.91k, False: 2]
  |  |  ------------------
  ------------------
  177|  2.91k|	switch (yych) {
  178|  2.90k|		case '=': goto yy5;
  ------------------
  |  Branch (178:3): [True: 2.90k, False: 8]
  ------------------
  179|      8|		default: goto yy2;
  ------------------
  |  Branch (179:3): [True: 8, False: 2.90k]
  ------------------
  180|  2.91k|	}
  181|  1.01k|yy4:
  182|  1.01k|	YYSKIP();
  ------------------
  |  |   35|  1.01k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.01k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  183|  1.01k|	YYBACKUP();
  ------------------
  |  |   36|  1.01k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  1.01k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.01k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  184|  1.01k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.01k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.01k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.01k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.01k, False: 2]
  |  |  ------------------
  ------------------
  185|  1.01k|	switch (yych) {
  186|  1.01k|		case 's': goto yy6;
  ------------------
  |  Branch (186:3): [True: 1.01k, False: 4]
  ------------------
  187|      4|		default: goto yy2;
  ------------------
  |  Branch (187:3): [True: 4, False: 1.01k]
  ------------------
  188|  1.01k|	}
  189|  3.86k|yy5:
  190|  3.86k|	YYSKIP();
  ------------------
  |  |   35|  3.86k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.86k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  191|  3.86k|	nsu = context.yyt2;
  192|  3.86k|	ns = context.yyt1;
  193|  3.86k|	YYSTAGP(body);
  ------------------
  |  |   38|  3.86k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  3.86k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  194|  3.86k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  3.86k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  195|  3.86k|	{ goto match; }
  196|  1.01k|yy6:
  197|  1.01k|	YYSKIP();
  ------------------
  |  |   35|  1.01k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.01k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  198|  1.01k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.01k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.01k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.01k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.01k, False: 2]
  |  |  ------------------
  ------------------
  199|  1.01k|	switch (yych) {
  200|    920|		case '=': goto yy8;
  ------------------
  |  Branch (200:3): [True: 920, False: 93]
  ------------------
  201|     91|		case 'u': goto yy9;
  ------------------
  |  Branch (201:3): [True: 91, False: 922]
  ------------------
  202|      2|		default: goto yy7;
  ------------------
  |  Branch (202:3): [True: 2, False: 1.01k]
  ------------------
  203|  1.01k|	}
  204|     51|yy7:
  205|     51|	YYRESTORE();
  ------------------
  |  |   37|     51|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|     51|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|     51|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  206|     51|	goto yy2;
  207|    920|yy8:
  208|    920|	YYSKIP();
  ------------------
  |  |   35|    920|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    920|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  209|    920|	yych = YYPEEK();
  ------------------
  |  |   33|    920|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    920|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    918|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 918, False: 2]
  |  |  ------------------
  ------------------
  210|    920|	switch (yych) {
  211|    385|		case '0':
  ------------------
  |  Branch (211:3): [True: 385, False: 535]
  ------------------
  212|    428|		case '1':
  ------------------
  |  Branch (212:3): [True: 43, False: 877]
  ------------------
  213|    459|		case '2':
  ------------------
  |  Branch (213:3): [True: 31, False: 889]
  ------------------
  214|    482|		case '3':
  ------------------
  |  Branch (214:3): [True: 23, False: 897]
  ------------------
  215|    836|		case '4':
  ------------------
  |  Branch (215:3): [True: 354, False: 566]
  ------------------
  216|    848|		case '5':
  ------------------
  |  Branch (216:3): [True: 12, False: 908]
  ------------------
  217|    854|		case '6':
  ------------------
  |  Branch (217:3): [True: 6, False: 914]
  ------------------
  218|    858|		case '7':
  ------------------
  |  Branch (218:3): [True: 4, False: 916]
  ------------------
  219|    897|		case '8':
  ------------------
  |  Branch (219:3): [True: 39, False: 881]
  ------------------
  220|    916|		case '9':
  ------------------
  |  Branch (220:3): [True: 19, False: 901]
  ------------------
  221|    916|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|    916|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    916|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  222|    916|			goto yy10;
  223|      4|		default: goto yy7;
  ------------------
  |  Branch (223:3): [True: 4, False: 916]
  ------------------
  224|    920|	}
  225|     91|yy9:
  226|     91|	YYSKIP();
  ------------------
  |  |   35|     91|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|     91|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  227|     91|	yych = YYPEEK();
  ------------------
  |  |   33|     91|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|     91|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|     89|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 89, False: 2]
  |  |  ------------------
  ------------------
  228|     91|	switch (yych) {
  229|     85|		case '=': goto yy11;
  ------------------
  |  Branch (229:3): [True: 85, False: 6]
  ------------------
  230|      6|		default: goto yy7;
  ------------------
  |  Branch (230:3): [True: 6, False: 85]
  ------------------
  231|     91|	}
  232|  12.3k|yy10:
  233|  12.3k|	YYSKIP();
  ------------------
  |  |   35|  12.3k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  12.3k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  234|  12.3k|	yych = YYPEEK();
  ------------------
  |  |   33|  12.3k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  12.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  12.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 12.2k, False: 30]
  |  |  ------------------
  ------------------
  235|  12.3k|	switch (yych) {
  236|  2.23k|		case '0':
  ------------------
  |  Branch (236:3): [True: 2.23k, False: 10.0k]
  ------------------
  237|  3.15k|		case '1':
  ------------------
  |  Branch (237:3): [True: 923, False: 11.3k]
  ------------------
  238|  3.80k|		case '2':
  ------------------
  |  Branch (238:3): [True: 651, False: 11.6k]
  ------------------
  239|  4.80k|		case '3':
  ------------------
  |  Branch (239:3): [True: 998, False: 11.3k]
  ------------------
  240|  6.84k|		case '4':
  ------------------
  |  Branch (240:3): [True: 2.04k, False: 10.2k]
  ------------------
  241|  7.48k|		case '5':
  ------------------
  |  Branch (241:3): [True: 641, False: 11.6k]
  ------------------
  242|  8.10k|		case '6':
  ------------------
  |  Branch (242:3): [True: 618, False: 11.6k]
  ------------------
  243|  9.29k|		case '7':
  ------------------
  |  Branch (243:3): [True: 1.18k, False: 11.1k]
  ------------------
  244|  10.0k|		case '8':
  ------------------
  |  Branch (244:3): [True: 778, False: 11.5k]
  ------------------
  245|  11.3k|		case '9': goto yy10;
  ------------------
  |  Branch (245:3): [True: 1.32k, False: 10.9k]
  ------------------
  246|    885|		case ';':
  ------------------
  |  Branch (246:3): [True: 885, False: 11.4k]
  ------------------
  247|    885|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|    885|#define YYSTAGN(t) t = NULL
  ------------------
  248|    885|			goto yy12;
  249|     31|		default: goto yy7;
  ------------------
  |  Branch (249:3): [True: 31, False: 12.2k]
  ------------------
  250|  12.3k|	}
  251|     85|yy11:
  252|     85|	YYSKIP();
  ------------------
  |  |   35|     85|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|     85|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  253|     85|	yych = YYPEEK();
  ------------------
  |  |   33|     85|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|     85|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|     85|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 85, False: 0]
  |  |  ------------------
  ------------------
  254|     85|	switch (yych) {
  255|      0|		case 0x00: goto yy7;
  ------------------
  |  Branch (255:3): [True: 0, False: 85]
  ------------------
  256|      5|		case ';':
  ------------------
  |  Branch (256:3): [True: 5, False: 80]
  ------------------
  257|      5|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|      5|#define YYSTAGN(t) t = NULL
  ------------------
  258|      5|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|      5|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|      5|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  259|      5|			goto yy12;
  260|     80|		default:
  ------------------
  |  Branch (260:3): [True: 80, False: 5]
  ------------------
  261|     80|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|     80|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|     80|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  262|     80|			goto yy13;
  263|     85|	}
  264|    967|yy12:
  265|    967|	YYSKIP();
  ------------------
  |  |   35|    967|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    967|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  266|    967|	yych = YYPEEK();
  ------------------
  |  |   33|    967|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    967|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    965|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 965, False: 2]
  |  |  ------------------
  ------------------
  267|    967|	switch (yych) {
  268|     33|		case 'b':
  ------------------
  |  Branch (268:3): [True: 33, False: 934]
  ------------------
  269|     33|		case 'g':
  ------------------
  |  Branch (269:3): [True: 0, False: 967]
  ------------------
  270|    872|		case 'i':
  ------------------
  |  Branch (270:3): [True: 839, False: 128]
  ------------------
  271|    965|		case 's': goto yy14;
  ------------------
  |  Branch (271:3): [True: 93, False: 874]
  ------------------
  272|      2|		default: goto yy7;
  ------------------
  |  Branch (272:3): [True: 2, False: 965]
  ------------------
  273|    967|	}
  274|    486|yy13:
  275|    486|	YYSKIP();
  ------------------
  |  |   35|    486|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    486|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  276|    486|	yych = YYPEEK();
  ------------------
  |  |   33|    486|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    486|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    483|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 483, False: 3]
  |  |  ------------------
  ------------------
  277|    486|	switch (yych) {
  278|      3|		case 0x00: goto yy7;
  ------------------
  |  Branch (278:3): [True: 3, False: 483]
  ------------------
  279|     77|		case ';':
  ------------------
  |  Branch (279:3): [True: 77, False: 409]
  ------------------
  280|     77|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|     77|#define YYSTAGN(t) t = NULL
  ------------------
  281|     77|			goto yy12;
  282|    406|		default: goto yy13;
  ------------------
  |  Branch (282:3): [True: 406, False: 80]
  ------------------
  283|    486|	}
  284|    965|yy14:
  285|    965|	YYSKIP();
  ------------------
  |  |   35|    965|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    965|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  286|    965|	yych = YYPEEK();
  ------------------
  |  |   33|    965|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    965|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    965|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 965, False: 0]
  |  |  ------------------
  ------------------
  287|    965|	switch (yych) {
  288|    962|		case '=': goto yy5;
  ------------------
  |  Branch (288:3): [True: 962, False: 3]
  ------------------
  289|      3|		default: goto yy7;
  ------------------
  |  Branch (289:3): [True: 3, False: 962]
  ------------------
  290|    965|	}
  291|    965|}
  292|       |
  293|       |
  294|  3.86k| match:
  295|  3.86k|    if(nsu) {
  ------------------
  |  Branch (295:8): [True: 80, False: 3.78k]
  ------------------
  296|       |        /* NamespaceUri */
  297|     80|        UA_String nsUri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  298|     80|        UA_StatusCode res = escapedUri2Index(nsUri, &id->namespaceIndex, nsMapping);
  299|     80|        if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|     80|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (299:12): [True: 80, False: 0]
  ------------------
  300|       |            /* Return the entire NodeId string s=... */
  301|     80|            UA_String total = {(size_t)((const UA_Byte*)end - begin), begin};
  302|     80|            id->identifierType = UA_NODEIDTYPE_STRING;
  303|     80|            return UA_String_copy(&total, &id->identifier.string);
  304|     80|        }
  305|  3.78k|    } else if(ns) {
  ------------------
  |  Branch (305:15): [True: 882, False: 2.90k]
  ------------------
  306|       |        /* NamespaceIndex */
  307|    882|        UA_UInt32 tmp;
  308|    882|        size_t len = (size_t)(body - 1 - ns);
  309|    882|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (309:12): [True: 0, False: 882]
  ------------------
  310|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  311|    882|        id->namespaceIndex = (UA_UInt16)tmp;
  312|    882|        if(nsMapping)
  ------------------
  |  Branch (312:12): [True: 0, False: 882]
  ------------------
  313|      0|            id->namespaceIndex =
  314|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->namespaceIndex);
  315|    882|    }
  316|       |
  317|       |    /* From the current position until the end */
  318|  3.78k|    return parse_nodeid_body(id, body, end, idEsc);
  319|  3.86k|}
ua_types_lex.c:escapedUri2Index:
   95|    904|                 const UA_NamespaceMapping *nsMapping) {
   96|    904|    if(!nsMapping)
  ------------------
  |  Branch (96:8): [True: 904, False: 0]
  ------------------
   97|    904|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    904|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   98|      0|    UA_String tmp = uri; 
   99|      0|    status res = UA_String_unescape(&uri, true, UA_ESCAPING_PERCENT);
  100|      0|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (100:8): [True: 0, False: 0]
  ------------------
  101|      0|        return res;
  102|      0|    res = UA_NamespaceMapping_uri2Index(nsMapping, uri, nsIndex);
  103|      0|    if(tmp.data != uri.data)
  ------------------
  |  Branch (103:8): [True: 0, False: 0]
  ------------------
  104|      0|        UA_String_clear(&uri);
  105|      0|    return res;
  106|      0|}
ua_types_lex.c:parse_nodeid_body:
  109|  21.8k|parse_nodeid_body(UA_NodeId *id, const u8 *body, const u8 *end, UA_Escaping esc) {
  110|  21.8k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  21.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  111|  21.8k|    UA_String str = {(size_t)(end - (body+2)), (UA_Byte*)(uintptr_t)body + 2};
  112|  21.8k|    switch(*body) {
  113|  2.27k|    case 'i':
  ------------------
  |  Branch (113:5): [True: 2.27k, False: 19.6k]
  ------------------
  114|  2.27k|        id->identifierType = UA_NODEIDTYPE_NUMERIC;
  115|  2.27k|        if(UA_readNumber(str.data, str.length, &id->identifier.numeric) != str.length)
  ------------------
  |  Branch (115:12): [True: 25, False: 2.25k]
  ------------------
  116|     25|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     25|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  117|  2.27k|        break;
  118|  11.9k|    case 's':
  ------------------
  |  Branch (118:5): [True: 11.9k, False: 9.93k]
  ------------------
  119|  11.9k|        id->identifierType = UA_NODEIDTYPE_STRING;
  120|  11.9k|        res |= UA_String_copy(&str, &id->identifier.string);
  121|  11.9k|        res |= UA_String_unescape(&id->identifier.string, false, esc);
  122|  11.9k|        break;
  123|      4|    case 'g':
  ------------------
  |  Branch (123:5): [True: 4, False: 21.8k]
  ------------------
  124|      4|        id->identifierType = UA_NODEIDTYPE_GUID;
  125|      4|        res = parse_guid(&id->identifier.guid, str.data, end);
  126|      4|        break;
  127|  7.65k|    case 'b':
  ------------------
  |  Branch (127:5): [True: 7.65k, False: 14.2k]
  ------------------
  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|  7.65k|        id->identifierType = UA_NODEIDTYPE_BYTESTRING;
  132|  7.65k|        id->identifier.byteString.data =
  133|  7.65k|            UA_unbase64(str.data, str.length, &id->identifier.byteString.length);
  134|  7.65k|        if(!id->identifier.byteString.data) {
  ------------------
  |  Branch (134:12): [True: 16, False: 7.64k]
  ------------------
  135|     16|            UA_assert(id->identifier.byteString.length == 0);
  ------------------
  |  |  397|     16|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (135:13): [True: 16, False: 0]
  ------------------
  136|     16|            res = UA_STATUSCODE_BADDECODINGERROR; /* Returned on error by UA_unbase64 */
  ------------------
  |  |   43|     16|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  137|     16|        }
  138|  7.65k|        break;
  139|  7.65k|    default:
  ------------------
  |  Branch (139:5): [True: 0, False: 21.8k]
  ------------------
  140|      0|        res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  141|      0|        break;
  142|  21.8k|    }
  143|  21.8k|    return res;
  144|  21.8k|}
ua_types_lex.c:parse_expandednodeid:
  339|  18.3k|                     size_t serverUrisSize, const UA_String *serverUris) {
  340|  18.3k|    *id = UA_EXPANDEDNODEID_NULL; /* Reset the NodeId */
  341|  18.3k|    LexContext context;
  342|  18.3k|    memset(&context, 0, sizeof(LexContext));
  343|  18.3k|    const u8 *svr = NULL, *sve = NULL, *svu = NULL,
  344|  18.3k|        *nsu = NULL, *ns = NULL, *body = NULL, *begin = pos;
  345|       |
  346|       |    
  347|  18.3k|{
  348|  18.3k|	u8 yych;
  349|  18.3k|	yych = YYPEEK();
  ------------------
  |  |   33|  18.3k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  18.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  18.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 18.3k, False: 1]
  |  |  ------------------
  ------------------
  350|  18.3k|	switch (yych) {
  351|  7.13k|		case 'b':
  ------------------
  |  Branch (351:3): [True: 7.13k, False: 11.1k]
  ------------------
  352|  7.14k|		case 'g':
  ------------------
  |  Branch (352:3): [True: 2, False: 18.3k]
  ------------------
  353|  7.84k|		case 'i':
  ------------------
  |  Branch (353:3): [True: 704, False: 17.6k]
  ------------------
  354|  7.84k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  7.84k|#define YYSTAGN(t) t = NULL
  ------------------
  355|  7.84k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  7.84k|#define YYSTAGN(t) t = NULL
  ------------------
  356|  7.84k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  7.84k|#define YYSTAGN(t) t = NULL
  ------------------
  357|  7.84k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  7.84k|#define YYSTAGN(t) t = NULL
  ------------------
  358|  7.84k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  7.84k|#define YYSTAGN(t) t = NULL
  ------------------
  359|  7.84k|			goto yy18;
  360|    869|		case 'n':
  ------------------
  |  Branch (360:3): [True: 869, False: 17.4k]
  ------------------
  361|    869|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    869|#define YYSTAGN(t) t = NULL
  ------------------
  362|    869|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|    869|#define YYSTAGN(t) t = NULL
  ------------------
  363|    869|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    869|#define YYSTAGN(t) t = NULL
  ------------------
  364|    869|			goto yy19;
  365|  9.61k|		case 's':
  ------------------
  |  Branch (365:3): [True: 9.61k, False: 8.71k]
  ------------------
  366|  9.61k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  9.61k|#define YYSTAGN(t) t = NULL
  ------------------
  367|  9.61k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  9.61k|#define YYSTAGN(t) t = NULL
  ------------------
  368|  9.61k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  9.61k|#define YYSTAGN(t) t = NULL
  ------------------
  369|  9.61k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  9.61k|#define YYSTAGN(t) t = NULL
  ------------------
  370|  9.61k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  9.61k|#define YYSTAGN(t) t = NULL
  ------------------
  371|  9.61k|			goto yy20;
  372|      3|		default: goto yy16;
  ------------------
  |  Branch (372:3): [True: 3, False: 18.3k]
  ------------------
  373|  18.3k|	}
  374|      3|yy16:
  375|      3|	YYSKIP();
  ------------------
  |  |   35|      3|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      3|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  376|    103|yy17:
  377|    103|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   43|    103|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  378|  7.84k|yy18:
  379|  7.84k|	YYSKIP();
  ------------------
  |  |   35|  7.84k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  7.84k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  380|  7.84k|	yych = YYPEEK();
  ------------------
  |  |   33|  7.84k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  7.84k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  7.84k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 7.84k, False: 0]
  |  |  ------------------
  ------------------
  381|  7.84k|	switch (yych) {
  382|  7.83k|		case '=': goto yy21;
  ------------------
  |  Branch (382:3): [True: 7.83k, False: 8]
  ------------------
  383|      8|		default: goto yy17;
  ------------------
  |  Branch (383:3): [True: 8, False: 7.83k]
  ------------------
  384|  7.84k|	}
  385|    869|yy19:
  386|    869|	YYSKIP();
  ------------------
  |  |   35|    869|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    869|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  387|    869|	YYBACKUP();
  ------------------
  |  |   36|    869|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|    869|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    869|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  388|    869|	yych = YYPEEK();
  ------------------
  |  |   33|    869|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    869|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    869|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 869, False: 0]
  |  |  ------------------
  ------------------
  389|    869|	switch (yych) {
  390|    868|		case 's': goto yy22;
  ------------------
  |  Branch (390:3): [True: 868, False: 1]
  ------------------
  391|      1|		default: goto yy17;
  ------------------
  |  Branch (391:3): [True: 1, False: 868]
  ------------------
  392|    869|	}
  393|  9.61k|yy20:
  394|  9.61k|	YYSKIP();
  ------------------
  |  |   35|  9.61k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  9.61k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  395|  9.61k|	YYBACKUP();
  ------------------
  |  |   36|  9.61k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  9.61k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  9.61k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  396|  9.61k|	yych = YYPEEK();
  ------------------
  |  |   33|  9.61k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  9.61k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  9.61k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 9.61k, False: 0]
  |  |  ------------------
  ------------------
  397|  9.61k|	switch (yych) {
  398|  8.41k|		case '=': goto yy21;
  ------------------
  |  Branch (398:3): [True: 8.41k, False: 1.20k]
  ------------------
  399|  1.20k|		case 'v': goto yy24;
  ------------------
  |  Branch (399:3): [True: 1.20k, False: 8.41k]
  ------------------
  400|      1|		default: goto yy17;
  ------------------
  |  Branch (400:3): [True: 1, False: 9.61k]
  ------------------
  401|  9.61k|	}
  402|  18.2k|yy21:
  403|  18.2k|	YYSKIP();
  ------------------
  |  |   35|  18.2k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  18.2k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  404|  18.2k|	svr = context.yyt5;
  405|  18.2k|	svu = context.yyt1;
  406|  18.2k|	sve = context.yyt2;
  407|  18.2k|	ns = context.yyt3;
  408|  18.2k|	nsu = context.yyt4;
  409|  18.2k|	YYSTAGP(body);
  ------------------
  |  |   38|  18.2k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  18.2k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  410|  18.2k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  18.2k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  411|  18.2k|	{ goto match; }
  412|    868|yy22:
  413|    868|	YYSKIP();
  ------------------
  |  |   35|    868|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    868|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  414|    868|	yych = YYPEEK();
  ------------------
  |  |   33|    868|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    868|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    868|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 868, False: 0]
  |  |  ------------------
  ------------------
  415|    868|	switch (yych) {
  416|    242|		case '=': goto yy25;
  ------------------
  |  Branch (416:3): [True: 242, False: 626]
  ------------------
  417|    626|		case 'u': goto yy26;
  ------------------
  |  Branch (417:3): [True: 626, False: 242]
  ------------------
  418|      0|		default: goto yy23;
  ------------------
  |  Branch (418:3): [True: 0, False: 868]
  ------------------
  419|    868|	}
  420|     90|yy23:
  421|     90|	YYRESTORE();
  ------------------
  |  |   37|     90|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|     90|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|     90|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  422|     90|	goto yy17;
  423|  1.20k|yy24:
  424|  1.20k|	YYSKIP();
  ------------------
  |  |   35|  1.20k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.20k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  425|  1.20k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.20k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.20k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.20k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.20k, False: 0]
  |  |  ------------------
  ------------------
  426|  1.20k|	switch (yych) {
  427|  1.07k|		case 'r': goto yy27;
  ------------------
  |  Branch (427:3): [True: 1.07k, False: 128]
  ------------------
  428|    128|		case 'u': goto yy28;
  ------------------
  |  Branch (428:3): [True: 128, False: 1.07k]
  ------------------
  429|      0|		default: goto yy23;
  ------------------
  |  Branch (429:3): [True: 0, False: 1.20k]
  ------------------
  430|  1.20k|	}
  431|    242|yy25:
  432|    242|	YYSKIP();
  ------------------
  |  |   35|    242|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    242|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  433|    242|	yych = YYPEEK();
  ------------------
  |  |   33|    242|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    242|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    242|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 242, False: 0]
  |  |  ------------------
  ------------------
  434|    242|	switch (yych) {
  435|     36|		case '0':
  ------------------
  |  Branch (435:3): [True: 36, False: 206]
  ------------------
  436|     76|		case '1':
  ------------------
  |  Branch (436:3): [True: 40, False: 202]
  ------------------
  437|    118|		case '2':
  ------------------
  |  Branch (437:3): [True: 42, False: 200]
  ------------------
  438|    178|		case '3':
  ------------------
  |  Branch (438:3): [True: 60, False: 182]
  ------------------
  439|    184|		case '4':
  ------------------
  |  Branch (439:3): [True: 6, False: 236]
  ------------------
  440|    193|		case '5':
  ------------------
  |  Branch (440:3): [True: 9, False: 233]
  ------------------
  441|    197|		case '6':
  ------------------
  |  Branch (441:3): [True: 4, False: 238]
  ------------------
  442|    237|		case '7':
  ------------------
  |  Branch (442:3): [True: 40, False: 202]
  ------------------
  443|    240|		case '8':
  ------------------
  |  Branch (443:3): [True: 3, False: 239]
  ------------------
  444|    241|		case '9':
  ------------------
  |  Branch (444:3): [True: 1, False: 241]
  ------------------
  445|    241|			YYSTAGP(context.yyt3);
  ------------------
  |  |   38|    241|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    241|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  446|    241|			goto yy29;
  447|      1|		default: goto yy23;
  ------------------
  |  Branch (447:3): [True: 1, False: 241]
  ------------------
  448|    242|	}
  449|    626|yy26:
  450|    626|	YYSKIP();
  ------------------
  |  |   35|    626|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    626|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  451|    626|	yych = YYPEEK();
  ------------------
  |  |   33|    626|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    626|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    626|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 626, False: 0]
  |  |  ------------------
  ------------------
  452|    626|	switch (yych) {
  453|    625|		case '=': goto yy30;
  ------------------
  |  Branch (453:3): [True: 625, False: 1]
  ------------------
  454|      1|		default: goto yy23;
  ------------------
  |  Branch (454:3): [True: 1, False: 625]
  ------------------
  455|    626|	}
  456|  1.07k|yy27:
  457|  1.07k|	YYSKIP();
  ------------------
  |  |   35|  1.07k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.07k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  458|  1.07k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.07k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.07k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.07k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.07k, False: 0]
  |  |  ------------------
  ------------------
  459|  1.07k|	switch (yych) {
  460|  1.07k|		case '=': goto yy31;
  ------------------
  |  Branch (460:3): [True: 1.07k, False: 0]
  ------------------
  461|      0|		default: goto yy23;
  ------------------
  |  Branch (461:3): [True: 0, False: 1.07k]
  ------------------
  462|  1.07k|	}
  463|    128|yy28:
  464|    128|	YYSKIP();
  ------------------
  |  |   35|    128|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    128|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  465|    128|	yych = YYPEEK();
  ------------------
  |  |   33|    128|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    128|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    128|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 128, False: 0]
  |  |  ------------------
  ------------------
  466|    128|	switch (yych) {
  467|    127|		case '=': goto yy32;
  ------------------
  |  Branch (467:3): [True: 127, False: 1]
  ------------------
  468|      1|		default: goto yy23;
  ------------------
  |  Branch (468:3): [True: 1, False: 127]
  ------------------
  469|    128|	}
  470|   240k|yy29:
  471|   240k|	YYSKIP();
  ------------------
  |  |   35|   240k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|   240k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  472|   240k|	yych = YYPEEK();
  ------------------
  |  |   33|   240k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   240k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   240k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 240k, False: 28]
  |  |  ------------------
  ------------------
  473|   240k|	switch (yych) {
  474|   223k|		case '0':
  ------------------
  |  Branch (474:3): [True: 223k, False: 17.4k]
  ------------------
  475|   225k|		case '1':
  ------------------
  |  Branch (475:3): [True: 2.44k, False: 238k]
  ------------------
  476|   226k|		case '2':
  ------------------
  |  Branch (476:3): [True: 648, False: 240k]
  ------------------
  477|   227k|		case '3':
  ------------------
  |  Branch (477:3): [True: 1.49k, False: 239k]
  ------------------
  478|   228k|		case '4':
  ------------------
  |  Branch (478:3): [True: 980, False: 239k]
  ------------------
  479|   229k|		case '5':
  ------------------
  |  Branch (479:3): [True: 260, False: 240k]
  ------------------
  480|   237k|		case '6':
  ------------------
  |  Branch (480:3): [True: 7.88k, False: 232k]
  ------------------
  481|   237k|		case '7':
  ------------------
  |  Branch (481:3): [True: 528, False: 240k]
  ------------------
  482|   239k|		case '8':
  ------------------
  |  Branch (482:3): [True: 1.92k, False: 238k]
  ------------------
  483|   240k|		case '9': goto yy29;
  ------------------
  |  Branch (483:3): [True: 1.04k, False: 239k]
  ------------------
  484|    203|		case ';':
  ------------------
  |  Branch (484:3): [True: 203, False: 240k]
  ------------------
  485|    203|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|    203|#define YYSTAGN(t) t = NULL
  ------------------
  486|    203|			goto yy33;
  487|     38|		default: goto yy23;
  ------------------
  |  Branch (487:3): [True: 38, False: 240k]
  ------------------
  488|   240k|	}
  489|    625|yy30:
  490|    625|	YYSKIP();
  ------------------
  |  |   35|    625|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    625|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  491|    625|	yych = YYPEEK();
  ------------------
  |  |   33|    625|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    625|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    625|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 625, False: 0]
  |  |  ------------------
  ------------------
  492|    625|	switch (yych) {
  493|      0|		case 0x00: goto yy23;
  ------------------
  |  Branch (493:3): [True: 0, False: 625]
  ------------------
  494|      0|		case ';':
  ------------------
  |  Branch (494:3): [True: 0, False: 625]
  ------------------
  495|      0|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|      0|#define YYSTAGN(t) t = NULL
  ------------------
  496|      0|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|      0|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  497|      0|			goto yy33;
  498|    625|		default:
  ------------------
  |  Branch (498:3): [True: 625, False: 0]
  ------------------
  499|    625|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|    625|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    625|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  500|    625|			goto yy34;
  501|    625|	}
  502|  1.07k|yy31:
  503|  1.07k|	YYSKIP();
  ------------------
  |  |   35|  1.07k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.07k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  504|  1.07k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.07k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.07k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.07k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.07k, False: 0]
  |  |  ------------------
  ------------------
  505|  1.07k|	switch (yych) {
  506|     46|		case '0':
  ------------------
  |  Branch (506:3): [True: 46, False: 1.02k]
  ------------------
  507|    277|		case '1':
  ------------------
  |  Branch (507:3): [True: 231, False: 844]
  ------------------
  508|    299|		case '2':
  ------------------
  |  Branch (508:3): [True: 22, False: 1.05k]
  ------------------
  509|    498|		case '3':
  ------------------
  |  Branch (509:3): [True: 199, False: 876]
  ------------------
  510|    866|		case '4':
  ------------------
  |  Branch (510:3): [True: 368, False: 707]
  ------------------
  511|    888|		case '5':
  ------------------
  |  Branch (511:3): [True: 22, False: 1.05k]
  ------------------
  512|    896|		case '6':
  ------------------
  |  Branch (512:3): [True: 8, False: 1.06k]
  ------------------
  513|  1.01k|		case '7':
  ------------------
  |  Branch (513:3): [True: 123, False: 952]
  ------------------
  514|  1.06k|		case '8':
  ------------------
  |  Branch (514:3): [True: 47, False: 1.02k]
  ------------------
  515|  1.07k|		case '9':
  ------------------
  |  Branch (515:3): [True: 5, False: 1.07k]
  ------------------
  516|  1.07k|			YYSTAGP(context.yyt5);
  ------------------
  |  |   38|  1.07k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.07k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  517|  1.07k|			goto yy35;
  518|      4|		default: goto yy23;
  ------------------
  |  Branch (518:3): [True: 4, False: 1.07k]
  ------------------
  519|  1.07k|	}
  520|    127|yy32:
  521|    127|	YYSKIP();
  ------------------
  |  |   35|    127|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    127|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  522|    127|	yych = YYPEEK();
  ------------------
  |  |   33|    127|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    127|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    127|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 127, False: 0]
  |  |  ------------------
  ------------------
  523|    127|	switch (yych) {
  524|      0|		case 0x00: goto yy23;
  ------------------
  |  Branch (524:3): [True: 0, False: 127]
  ------------------
  525|      0|		case ';':
  ------------------
  |  Branch (525:3): [True: 0, False: 127]
  ------------------
  526|      0|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|      0|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  527|      0|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|      0|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  528|      0|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|      0|#define YYSTAGN(t) t = NULL
  ------------------
  529|      0|			goto yy37;
  530|    127|		default:
  ------------------
  |  Branch (530:3): [True: 127, False: 0]
  ------------------
  531|    127|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|    127|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    127|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  532|    127|			goto yy36;
  533|    127|	}
  534|    827|yy33:
  535|    827|	YYSKIP();
  ------------------
  |  |   35|    827|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    827|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  536|    827|	yych = YYPEEK();
  ------------------
  |  |   33|    827|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    827|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    827|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 827, False: 0]
  |  |  ------------------
  ------------------
  537|    827|	switch (yych) {
  538|     73|		case 'b':
  ------------------
  |  Branch (538:3): [True: 73, False: 754]
  ------------------
  539|     73|		case 'g':
  ------------------
  |  Branch (539:3): [True: 0, False: 827]
  ------------------
  540|    220|		case 'i':
  ------------------
  |  Branch (540:3): [True: 147, False: 680]
  ------------------
  541|    826|		case 's': goto yy38;
  ------------------
  |  Branch (541:3): [True: 606, False: 221]
  ------------------
  542|      1|		default: goto yy23;
  ------------------
  |  Branch (542:3): [True: 1, False: 826]
  ------------------
  543|    827|	}
  544|  2.14M|yy34:
  545|  2.14M|	YYSKIP();
  ------------------
  |  |   35|  2.14M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.14M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  546|  2.14M|	yych = YYPEEK();
  ------------------
  |  |   33|  2.14M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.14M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.14M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.14M, False: 1]
  |  |  ------------------
  ------------------
  547|  2.14M|	switch (yych) {
  548|      1|		case 0x00: goto yy23;
  ------------------
  |  Branch (548:3): [True: 1, False: 2.14M]
  ------------------
  549|    624|		case ';':
  ------------------
  |  Branch (549:3): [True: 624, False: 2.14M]
  ------------------
  550|    624|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    624|#define YYSTAGN(t) t = NULL
  ------------------
  551|    624|			goto yy33;
  552|  2.14M|		default: goto yy34;
  ------------------
  |  Branch (552:3): [True: 2.14M, False: 625]
  ------------------
  553|  2.14M|	}
  554|  9.06k|yy35:
  555|  9.06k|	YYSKIP();
  ------------------
  |  |   35|  9.06k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  9.06k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  556|  9.06k|	yych = YYPEEK();
  ------------------
  |  |   33|  9.06k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  9.06k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  9.04k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 9.04k, False: 16]
  |  |  ------------------
  ------------------
  557|  9.06k|	switch (yych) {
  558|  5.04k|		case '0':
  ------------------
  |  Branch (558:3): [True: 5.04k, False: 4.02k]
  ------------------
  559|  5.30k|		case '1':
  ------------------
  |  Branch (559:3): [True: 265, False: 8.80k]
  ------------------
  560|  5.59k|		case '2':
  ------------------
  |  Branch (560:3): [True: 283, False: 8.78k]
  ------------------
  561|  5.87k|		case '3':
  ------------------
  |  Branch (561:3): [True: 284, False: 8.78k]
  ------------------
  562|  6.18k|		case '4':
  ------------------
  |  Branch (562:3): [True: 311, False: 8.75k]
  ------------------
  563|  6.54k|		case '5':
  ------------------
  |  Branch (563:3): [True: 360, False: 8.70k]
  ------------------
  564|  6.96k|		case '6':
  ------------------
  |  Branch (564:3): [True: 420, False: 8.64k]
  ------------------
  565|  7.34k|		case '7':
  ------------------
  |  Branch (565:3): [True: 378, False: 8.68k]
  ------------------
  566|  7.61k|		case '8':
  ------------------
  |  Branch (566:3): [True: 273, False: 8.79k]
  ------------------
  567|  7.99k|		case '9': goto yy35;
  ------------------
  |  Branch (567:3): [True: 376, False: 8.68k]
  ------------------
  568|  1.03k|		case ';':
  ------------------
  |  Branch (568:3): [True: 1.03k, False: 8.02k]
  ------------------
  569|  1.03k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  1.03k|#define YYSTAGN(t) t = NULL
  ------------------
  570|  1.03k|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|  1.03k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.03k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  571|  1.03k|			goto yy37;
  572|     33|		default: goto yy23;
  ------------------
  |  Branch (572:3): [True: 33, False: 9.03k]
  ------------------
  573|  9.06k|	}
  574|  3.65M|yy36:
  575|  3.65M|	YYSKIP();
  ------------------
  |  |   35|  3.65M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.65M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  576|  3.65M|	yych = YYPEEK();
  ------------------
  |  |   33|  3.65M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.65M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.65M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.65M, False: 4]
  |  |  ------------------
  ------------------
  577|  3.65M|	switch (yych) {
  578|      4|		case 0x00: goto yy23;
  ------------------
  |  Branch (578:3): [True: 4, False: 3.65M]
  ------------------
  579|    123|		case ';':
  ------------------
  |  Branch (579:3): [True: 123, False: 3.65M]
  ------------------
  580|    123|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    123|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    123|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  581|    123|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    123|#define YYSTAGN(t) t = NULL
  ------------------
  582|    123|			goto yy37;
  583|  3.65M|		default: goto yy36;
  ------------------
  |  Branch (583:3): [True: 3.65M, False: 127]
  ------------------
  584|  3.65M|	}
  585|  1.16k|yy37:
  586|  1.16k|	YYSKIP();
  ------------------
  |  |   35|  1.16k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.16k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  587|  1.16k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.16k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.16k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.16k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.16k, False: 0]
  |  |  ------------------
  ------------------
  588|  1.16k|	switch (yych) {
  589|      1|		case 'b':
  ------------------
  |  Branch (589:3): [True: 1, False: 1.16k]
  ------------------
  590|      1|		case 'g':
  ------------------
  |  Branch (590:3): [True: 0, False: 1.16k]
  ------------------
  591|      5|		case 'i':
  ------------------
  |  Branch (591:3): [True: 4, False: 1.15k]
  ------------------
  592|  1.15k|		case 's':
  ------------------
  |  Branch (592:3): [True: 1.15k, False: 7]
  ------------------
  593|  1.15k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  1.15k|#define YYSTAGN(t) t = NULL
  ------------------
  594|  1.15k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  1.15k|#define YYSTAGN(t) t = NULL
  ------------------
  595|  1.15k|			goto yy38;
  596|      1|		case 'n': goto yy39;
  ------------------
  |  Branch (596:3): [True: 1, False: 1.16k]
  ------------------
  597|      1|		default: goto yy23;
  ------------------
  |  Branch (597:3): [True: 1, False: 1.16k]
  ------------------
  598|  1.16k|	}
  599|  1.98k|yy38:
  600|  1.98k|	YYSKIP();
  ------------------
  |  |   35|  1.98k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.98k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  601|  1.98k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.98k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.98k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.98k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.98k, False: 0]
  |  |  ------------------
  ------------------
  602|  1.98k|	switch (yych) {
  603|  1.98k|		case '=': goto yy21;
  ------------------
  |  Branch (603:3): [True: 1.98k, False: 4]
  ------------------
  604|      4|		default: goto yy23;
  ------------------
  |  Branch (604:3): [True: 4, False: 1.98k]
  ------------------
  605|  1.98k|	}
  606|      1|yy39:
  607|      1|	YYSKIP();
  ------------------
  |  |   35|      1|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      1|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  608|      1|	yych = YYPEEK();
  ------------------
  |  |   33|      1|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      1|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      1|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  609|      1|	switch (yych) {
  610|      0|		case 's': goto yy22;
  ------------------
  |  Branch (610:3): [True: 0, False: 1]
  ------------------
  611|      1|		default: goto yy23;
  ------------------
  |  Branch (611:3): [True: 1, False: 0]
  ------------------
  612|      1|	}
  613|      1|}
  614|       |
  615|       |
  616|  18.2k| match:
  617|  18.2k|    if(svu) {
  ------------------
  |  Branch (617:8): [True: 120, False: 18.1k]
  ------------------
  618|       |        /* ServerUri */
  619|    120|        UA_String serverUri = {(size_t)(sve - svu), (UA_Byte*)(uintptr_t)svu};
  620|    120|        size_t i = 0;
  621|    120|        for(; i < serverUrisSize; i++) {
  ------------------
  |  Branch (621:15): [True: 0, False: 120]
  ------------------
  622|      0|            if(UA_String_equal(&serverUri, &serverUris[i]))
  ------------------
  |  Branch (622:16): [True: 0, False: 0]
  ------------------
  623|      0|                break;
  624|      0|        }
  625|    120|        if(i == serverUrisSize) {
  ------------------
  |  Branch (625:12): [True: 120, False: 0]
  ------------------
  626|       |            /* The ServerUri cannot be mapped. Return the entire input as a
  627|       |             * string NodeId. */
  628|    120|            UA_String total = {(size_t)(end - begin), (UA_Byte*)(uintptr_t)begin};
  629|    120|            id->nodeId.identifierType = UA_NODEIDTYPE_STRING;
  630|    120|            return UA_String_copy(&total, &id->nodeId.identifier.string);
  631|    120|        }
  632|      0|        id->serverIndex = (UA_UInt32)i;
  633|  18.1k|    } else if(svr) {
  ------------------
  |  Branch (633:15): [True: 1.03k, False: 17.0k]
  ------------------
  634|       |        /* ServerIndex */
  635|  1.03k|        size_t len = (size_t)(sve - svr);
  636|  1.03k|        if(UA_readNumber((const UA_Byte*)svr, len, &id->serverIndex) != len)
  ------------------
  |  Branch (636:12): [True: 0, False: 1.03k]
  ------------------
  637|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  638|  1.03k|    }
  639|       |
  640|  18.1k|    if(nsu) {
  ------------------
  |  Branch (640:8): [True: 623, False: 17.4k]
  ------------------
  641|       |        /* NamespaceUri */
  642|    623|        UA_String nsuri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  643|    623|        UA_StatusCode res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    623|#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|    623|        if(id->serverIndex == 0)
  ------------------
  |  Branch (646:12): [True: 623, False: 0]
  ------------------
  647|    623|            res = escapedUri2Index(nsuri, &id->nodeId.namespaceIndex, nsMapping);
  648|    623|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    623|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (648:12): [True: 623, False: 0]
  ------------------
  649|    623|            res = UA_String_copy(&nsuri, &id->namespaceUri); /* Keep the Uri without mapping */
  650|    623|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    623|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (650:12): [True: 0, False: 623]
  ------------------
  651|      0|            return res;
  652|  17.4k|    } else if(ns) {
  ------------------
  |  Branch (652:15): [True: 202, False: 17.2k]
  ------------------
  653|       |        /* NamespaceIndex */
  654|    202|        UA_UInt32 tmp;
  655|    202|        size_t len = (size_t)(body - 1 - ns);
  656|    202|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (656:12): [True: 0, False: 202]
  ------------------
  657|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  658|    202|        id->nodeId.namespaceIndex = (UA_UInt16)tmp;
  659|    202|        if(nsMapping)
  ------------------
  |  Branch (659:12): [True: 0, False: 202]
  ------------------
  660|      0|            id->nodeId.namespaceIndex =
  661|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->nodeId.namespaceIndex);
  662|    202|    }
  663|       |
  664|       |    /* From the current position until the end */
  665|  18.1k|    return parse_nodeid_body(&id->nodeId, body, end, idEsc);
  666|  18.1k|}
ua_types_lex.c:parse_qn:
  707|   198k|         UA_UInt16 defaultNamespaceIndex) {
  708|   198k|    size_t len;
  709|   198k|    UA_UInt32 tmp;
  710|   198k|    UA_String str;
  711|   198k|    UA_StatusCode res;
  712|       |
  713|   198k|    LexContext context;
  714|   198k|    memset(&context, 0, sizeof(LexContext));
  715|       |
  716|   198k|    const u8 *begin = pos;
  717|   198k|    UA_QualifiedName_init(qn);
  718|   198k|    qn->namespaceIndex = defaultNamespaceIndex;
  719|       |
  720|       |    
  721|   198k|{
  722|   198k|	u8 yych;
  723|   198k|	yych = YYPEEK();
  ------------------
  |  |   33|   198k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   198k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   190k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 190k, False: 7.96k]
  |  |  ------------------
  ------------------
  724|   198k|	switch (yych) {
  725|  7.96k|		case 0x00:
  ------------------
  |  Branch (725:3): [True: 7.96k, False: 190k]
  ------------------
  726|  8.19k|		case ';': goto yy41;
  ------------------
  |  Branch (726:3): [True: 225, False: 197k]
  ------------------
  727|  38.0k|		case '0':
  ------------------
  |  Branch (727:3): [True: 38.0k, False: 159k]
  ------------------
  728|  47.3k|		case '1':
  ------------------
  |  Branch (728:3): [True: 9.30k, False: 188k]
  ------------------
  729|  50.1k|		case '2':
  ------------------
  |  Branch (729:3): [True: 2.77k, False: 195k]
  ------------------
  730|  54.0k|		case '3':
  ------------------
  |  Branch (730:3): [True: 3.88k, False: 194k]
  ------------------
  731|  85.7k|		case '4':
  ------------------
  |  Branch (731:3): [True: 31.7k, False: 166k]
  ------------------
  732|  86.4k|		case '5':
  ------------------
  |  Branch (732:3): [True: 674, False: 197k]
  ------------------
  733|  97.6k|		case '6':
  ------------------
  |  Branch (733:3): [True: 11.2k, False: 186k]
  ------------------
  734|  98.6k|		case '7':
  ------------------
  |  Branch (734:3): [True: 1.01k, False: 197k]
  ------------------
  735|   105k|		case '8':
  ------------------
  |  Branch (735:3): [True: 6.50k, False: 191k]
  ------------------
  736|   105k|		case '9': goto yy44;
  ------------------
  |  Branch (736:3): [True: 356, False: 197k]
  ------------------
  737|  84.3k|		default: goto yy43;
  ------------------
  |  Branch (737:3): [True: 84.3k, False: 113k]
  ------------------
  738|   198k|	}
  739|  8.19k|yy41:
  740|  8.19k|	YYSKIP();
  ------------------
  |  |   35|  8.19k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  8.19k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  741|   196k|yy42:
  742|   196k|	{ pos = begin; goto match_name; }
  743|  84.3k|yy43:
  744|  84.3k|	YYSKIP();
  ------------------
  |  |   35|  84.3k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  84.3k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  745|  84.3k|	YYBACKUP();
  ------------------
  |  |   36|  84.3k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  84.3k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  84.3k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  746|  84.3k|	yych = YYPEEK();
  ------------------
  |  |   33|  84.3k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  84.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  71.8k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 71.8k, False: 12.4k]
  |  |  ------------------
  ------------------
  747|  84.3k|	if (yych <= 0x00) goto yy42;
  ------------------
  |  Branch (747:6): [True: 12.4k, False: 71.8k]
  ------------------
  748|  71.8k|	goto yy46;
  749|   105k|yy44:
  750|   105k|	YYSKIP();
  ------------------
  |  |   35|   105k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|   105k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  751|   105k|	YYBACKUP();
  ------------------
  |  |   36|   105k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|   105k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|   105k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  752|   105k|	yych = YYPEEK();
  ------------------
  |  |   33|   105k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   105k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  89.5k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 89.5k, False: 15.9k]
  |  |  ------------------
  ------------------
  753|   105k|	switch (yych) {
  754|  6.49k|		case '0':
  ------------------
  |  Branch (754:3): [True: 6.49k, False: 99.0k]
  ------------------
  755|  6.77k|		case '1':
  ------------------
  |  Branch (755:3): [True: 278, False: 105k]
  ------------------
  756|  9.34k|		case '2':
  ------------------
  |  Branch (756:3): [True: 2.57k, False: 102k]
  ------------------
  757|  9.71k|		case '3':
  ------------------
  |  Branch (757:3): [True: 365, False: 105k]
  ------------------
  758|  43.7k|		case '4':
  ------------------
  |  Branch (758:3): [True: 34.0k, False: 71.4k]
  ------------------
  759|  50.0k|		case '5':
  ------------------
  |  Branch (759:3): [True: 6.28k, False: 99.2k]
  ------------------
  760|  50.2k|		case '6':
  ------------------
  |  Branch (760:3): [True: 218, False: 105k]
  ------------------
  761|  56.5k|		case '7':
  ------------------
  |  Branch (761:3): [True: 6.25k, False: 99.2k]
  ------------------
  762|  56.6k|		case '8':
  ------------------
  |  Branch (762:3): [True: 60, False: 105k]
  ------------------
  763|  56.7k|		case '9':
  ------------------
  |  Branch (763:3): [True: 182, False: 105k]
  ------------------
  764|  57.4k|		case ':': goto yy50;
  ------------------
  |  Branch (764:3): [True: 681, False: 104k]
  ------------------
  765|  48.0k|		default: goto yy42;
  ------------------
  |  Branch (765:3): [True: 48.0k, False: 57.4k]
  ------------------
  766|   105k|	}
  767|  7.40M|yy45:
  768|  7.40M|	YYSKIP();
  ------------------
  |  |   35|  7.40M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  7.40M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  769|  7.40M|	yych = YYPEEK();
  ------------------
  |  |   33|  7.40M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  7.40M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  7.33M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 7.33M, False: 71.6k]
  |  |  ------------------
  ------------------
  770|  7.47M|yy46:
  771|  7.47M|	switch (yych) {
  772|  71.6k|		case 0x00: goto yy47;
  ------------------
  |  Branch (772:3): [True: 71.6k, False: 7.40M]
  ------------------
  773|    201|		case ';': goto yy48;
  ------------------
  |  Branch (773:3): [True: 201, False: 7.47M]
  ------------------
  774|  7.40M|		default: goto yy45;
  ------------------
  |  Branch (774:3): [True: 7.40M, False: 71.8k]
  ------------------
  775|  7.47M|	}
  776|   128k|yy47:
  777|   128k|	YYRESTORE();
  ------------------
  |  |   37|   128k|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|   128k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|   128k|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  778|   128k|	goto yy42;
  779|    201|yy48:
  780|    201|	YYSKIP();
  ------------------
  |  |   35|    201|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    201|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  781|    201|	{ goto match_uri; }
  782|   326k|yy49:
  783|   326k|	YYSKIP();
  ------------------
  |  |   35|   326k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|   326k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  784|   326k|	yych = YYPEEK();
  ------------------
  |  |   33|   326k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   326k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   323k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 323k, False: 3.26k]
  |  |  ------------------
  ------------------
  785|   383k|yy50:
  786|   383k|	switch (yych) {
  787|   110k|		case '0':
  ------------------
  |  Branch (787:3): [True: 110k, False: 272k]
  ------------------
  788|   122k|		case '1':
  ------------------
  |  Branch (788:3): [True: 11.6k, False: 372k]
  ------------------
  789|   159k|		case '2':
  ------------------
  |  Branch (789:3): [True: 36.7k, False: 347k]
  ------------------
  790|   166k|		case '3':
  ------------------
  |  Branch (790:3): [True: 7.61k, False: 376k]
  ------------------
  791|   231k|		case '4':
  ------------------
  |  Branch (791:3): [True: 64.0k, False: 319k]
  ------------------
  792|   251k|		case '5':
  ------------------
  |  Branch (792:3): [True: 20.7k, False: 363k]
  ------------------
  793|   279k|		case '6':
  ------------------
  |  Branch (793:3): [True: 28.0k, False: 355k]
  ------------------
  794|   291k|		case '7':
  ------------------
  |  Branch (794:3): [True: 11.8k, False: 371k]
  ------------------
  795|   297k|		case '8':
  ------------------
  |  Branch (795:3): [True: 5.82k, False: 377k]
  ------------------
  796|   326k|		case '9': goto yy49;
  ------------------
  |  Branch (796:3): [True: 28.8k, False: 354k]
  ------------------
  797|    884|		case ':': goto yy51;
  ------------------
  |  Branch (797:3): [True: 884, False: 382k]
  ------------------
  798|  56.5k|		default: goto yy47;
  ------------------
  |  Branch (798:3): [True: 56.5k, False: 327k]
  ------------------
  799|   383k|	}
  800|    884|yy51:
  801|    884|	YYSKIP();
  ------------------
  |  |   35|    884|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    884|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  802|    884|	{ goto match_index; }
  803|   383k|}
  804|       |
  805|       |
  806|    884| match_index:
  807|    884|    len = (size_t)(pos - 1 - begin);
  808|    884|    if(UA_readNumber((const UA_Byte*)begin, len, &tmp) != len)
  ------------------
  |  Branch (808:8): [True: 0, False: 884]
  ------------------
  809|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  810|    884|    qn->namespaceIndex = (UA_UInt16)tmp;
  811|    884|    goto match_name;
  812|       |
  813|    201| match_uri:
  814|    201|    str.length = (size_t)(pos - 1 - begin);
  815|    201|    str.data = (UA_Byte*)(uintptr_t)begin;
  816|    201|    res = escapedUri2Index(str, &qn->namespaceIndex, nsMapping);
  817|    201|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    201|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (817:8): [True: 201, False: 0]
  ------------------
  818|    201|        pos = begin; /* Use the entire string for the name */
  819|       |
  820|   198k| match_name:
  821|   198k|    str.length = (size_t)(end - pos);
  822|   198k|    str.data = (UA_Byte*)(uintptr_t)pos;
  823|   198k|    res = UA_String_copy(&str, &qn->name);
  824|   198k|    if(UA_LIKELY(res == UA_STATUSCODE_GOOD))
  ------------------
  |  |  576|   198k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (576:23): [True: 198k, False: 0]
  |  |  ------------------
  ------------------
  825|   198k|        res = UA_String_unescape(&qn->name, false, escName);
  826|   198k|    return res;
  827|    201|}

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

ua_util.c:isReservedPercent:
   95|  20.2M|isReservedPercent(u8 c) {
   96|  20.2M|    return (c == ';'  || c == '%' || c <= ' ' || c == 127);
  ------------------
  |  Branch (96:13): [True: 1.99k, False: 20.2M]
  |  Branch (96:26): [True: 4.19k, False: 20.2M]
  |  Branch (96:38): [True: 122k, False: 20.1M]
  |  Branch (96:50): [True: 453, False: 20.1M]
  ------------------
   97|  20.2M|}
ua_util.c:isReservedPercentExtended:
  100|  13.7M|isReservedPercentExtended(u8 c) {
  101|  13.7M|    return (isReservedPercent(c) || c == ':' || c == '#' || c == '[' || c == ']' ||
  ------------------
  |  Branch (101:13): [True: 129k, False: 13.6M]
  |  Branch (101:37): [True: 4.80k, False: 13.6M]
  |  Branch (101:49): [True: 4.78k, False: 13.6M]
  |  Branch (101:61): [True: 4.58k, False: 13.6M]
  |  Branch (101:73): [True: 3.88k, False: 13.6M]
  ------------------
  102|  13.6M|            c == '&' || c == '(' || c == ')' || c == ',' || c == '<' || c == '>' ||
  ------------------
  |  Branch (102:13): [True: 4.11k, False: 13.6M]
  |  Branch (102:25): [True: 112k, False: 13.5M]
  |  Branch (102:37): [True: 8.02k, False: 13.5M]
  |  Branch (102:49): [True: 3.78M, False: 9.73M]
  |  Branch (102:61): [True: 4.16k, False: 9.73M]
  |  Branch (102:73): [True: 5.03k, False: 9.72M]
  ------------------
  103|  9.72M|            c == '`' || c == '/' || c == '\\' || c == '"' || c == '\'' );
  ------------------
  |  Branch (103:13): [True: 2.51k, False: 9.72M]
  |  Branch (103:25): [True: 33.7k, False: 9.69M]
  |  Branch (103:37): [True: 2.86k, False: 9.68M]
  |  Branch (103:50): [True: 153k, False: 9.53M]
  |  Branch (103:62): [True: 9, False: 9.53M]
  ------------------
  104|  13.7M|}
ua_types_encoding_json.c:isTrue:
  167|  85.5k|isTrue(uint8_t expr) {
  168|  85.5k|    return expr;
  169|  85.5k|}

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

fuzz_json_decode_encode.cc:_ZL15UA_Variant_initP10UA_Variant:
  241|  5.14k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_json_decode_encode.cc:_ZL16UA_Variant_clearP10UA_Variant:
  241|  4.09k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_json_decode_encode.cc:_ZL19UA_ByteString_clearP9UA_String:
  241|  4.09k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_String_clear:
  241|  4.64k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_ByteString_init:
  241|   120k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_String_copy:
  241|   210k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_NodeId_clear:
  241|     97|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_ExpandedNodeId_clear:
  241|    119|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_QualifiedName_init:
  241|   198k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_clear:
  241|   341k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_init:
  241|    107|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_init:
  241|   220k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_init:
  241|    400|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_clear:
  241|     66|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_new:
  241|    388|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_clear:
  241|    107|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl

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

