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

cj5_parse:
  306|  10.4k|          cj5_options *options) {
  307|  10.4k|    cj5_result r;
  308|  10.4k|    cj5__parser parser;
  309|  10.4k|    memset(&parser, 0x0, sizeof(parser));
  310|  10.4k|    parser.curr_tok_idx = 0;
  311|  10.4k|    parser.json5 = json5;
  312|  10.4k|    parser.len = len;
  313|  10.4k|    parser.tokens = tokens;
  314|  10.4k|    parser.max_tokens = max_tokens;
  315|       |
  316|  10.4k|    if(options)
  ------------------
  |  Branch (316:8): [True: 10.4k, False: 0]
  ------------------
  317|  10.4k|        parser.stop_early = options->stop_early;
  318|       |
  319|  10.4k|    unsigned short depth = 0; // Nesting depth zero means "outside the root object"
  320|  10.4k|    char nesting[CJ5_MAX_NESTING]; // Contains either '\0', '{' or '[' for the
  321|       |                                   // type of nesting at each depth. '\0'
  322|       |                                   // indicates we are out of the root object.
  323|  10.4k|    char next[CJ5_MAX_NESTING];    // Next content to parse: 'k' (key), ':', 'v'
  324|       |                                   // (value) or ',' (comma).
  325|  10.4k|    next[0] = 'v';  // The root is a "value" (object, array or primitive). If we
  326|       |                    // detect a colon after the first value then everything is
  327|       |                    // wrapped into a "virtual root object" and the parsing is
  328|       |                    // restarted.
  329|  10.4k|    nesting[0] = 0; // Becomes '{' if there is a virtual root object
  330|       |
  331|  10.4k|    cj5_token *token = NULL; // The current token
  332|       |
  333|  14.6k| start_parsing:
  334|  75.9M|    for(; parser.pos < len; parser.pos++) {
  ------------------
  |  Branch (334:11): [True: 75.9M, False: 10.0k]
  ------------------
  335|  75.9M|        char c = json5[parser.pos];
  336|  75.9M|        switch(c) {
  337|  30.3k|        case '\n': // Skip newline and whitespace
  ------------------
  |  Branch (337:9): [True: 30.3k, False: 75.8M]
  ------------------
  338|  31.0k|        case '\r':
  ------------------
  |  Branch (338:9): [True: 675, False: 75.9M]
  ------------------
  339|  31.3k|        case '\t':
  ------------------
  |  Branch (339:9): [True: 333, False: 75.9M]
  ------------------
  340|  31.9k|        case ' ':
  ------------------
  |  Branch (340:9): [True: 517, False: 75.9M]
  ------------------
  341|  31.9k|            break;
  342|       |
  343|    363|        case '#': // Skip comment
  ------------------
  |  Branch (343:9): [True: 363, False: 75.9M]
  ------------------
  344|  13.6k|        case '/':
  ------------------
  |  Branch (344:9): [True: 13.3k, False: 75.9M]
  ------------------
  345|  13.6k|            cj5__skip_comment(&parser);
  346|  13.6k|            if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (346:16): [True: 10.5k, False: 3.11k]
  ------------------
  347|  10.5k|               parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (347:16): [True: 159, False: 10.3k]
  ------------------
  348|    159|                goto finish;
  349|  13.5k|            break;
  350|       |
  351|  2.90M|        case '{': // Open an object or array
  ------------------
  |  Branch (351:9): [True: 2.90M, False: 73.0M]
  ------------------
  352|  2.92M|        case '[':
  ------------------
  |  Branch (352:9): [True: 18.3k, False: 75.9M]
  ------------------
  353|       |            // Check the nesting depth
  354|  2.92M|            if(depth + 1 >= CJ5_MAX_NESTING) {
  ------------------
  |  |   53|  2.92M|#define CJ5_MAX_NESTING 256
  ------------------
  |  Branch (354:16): [True: 1, False: 2.92M]
  ------------------
  355|      1|                parser.error = CJ5_ERROR_INVALID;
  356|      1|                goto finish;
  357|      1|            }
  358|       |
  359|       |            // Correct next?
  360|  2.92M|            if(next[depth] != 'v') {
  ------------------
  |  Branch (360:16): [True: 31, False: 2.92M]
  ------------------
  361|     31|                parser.error = CJ5_ERROR_INVALID;
  362|     31|                goto finish;
  363|     31|            }
  364|       |
  365|  2.92M|            depth++; // Increase the nesting depth
  366|  2.92M|            nesting[depth] = c; // Set the nesting type
  367|  2.92M|            next[depth] = (c == '{') ? 'k' : 'v'; // next is either a key or a value
  ------------------
  |  Branch (367:27): [True: 2.90M, False: 18.2k]
  ------------------
  368|       |
  369|       |            // Create a token for the object or array
  370|  2.92M|            token = cj5__alloc_token(&parser);
  371|  2.92M|            if(token) {
  ------------------
  |  Branch (371:16): [True: 1.50M, False: 1.42M]
  ------------------
  372|  1.50M|                token->parent_id = parser.curr_tok_idx;
  373|  1.50M|                token->type = (c == '{') ? CJ5_TOKEN_OBJECT : CJ5_TOKEN_ARRAY;
  ------------------
  |  Branch (373:31): [True: 1.49M, False: 11.2k]
  ------------------
  374|  1.50M|                token->start = parser.pos;
  375|  1.50M|                token->size = 0;
  376|  1.50M|                parser.curr_tok_idx = parser.token_count - 1; // The new curr_tok_idx
  377|       |                                                              // is for this token
  378|  1.50M|            }
  379|  2.92M|            break;
  380|       |
  381|  2.90M|        case '}': // Close an object or array
  ------------------
  |  Branch (381:9): [True: 2.90M, False: 73.0M]
  ------------------
  382|  2.92M|        case ']':
  ------------------
  |  Branch (382:9): [True: 16.0k, False: 75.9M]
  ------------------
  383|       |            // Check the nesting depth. Note that a "virtual root object" at
  384|       |            // depth zero must not be closed.
  385|  2.92M|            if(depth == 0) {
  ------------------
  |  Branch (385:16): [True: 23, False: 2.92M]
  ------------------
  386|     23|                parser.error = CJ5_ERROR_INVALID;
  387|     23|                goto finish;
  388|     23|            }
  389|       |
  390|       |            // Check and adjust the nesting. Note that ']' - '[' == 2 and '}' -
  391|       |            // '{' == 2. Arrays can always be closed. Objects can only close
  392|       |            // when a key or a comma is expected.
  393|  2.92M|            if(c - nesting[depth] != 2 ||
  ------------------
  |  Branch (393:16): [True: 4, False: 2.92M]
  ------------------
  394|  2.92M|               (c == '}' && next[depth] != 'k' && next[depth] != ',')) {
  ------------------
  |  Branch (394:17): [True: 2.90M, False: 16.0k]
  |  Branch (394:29): [True: 117k, False: 2.79M]
  |  Branch (394:51): [True: 7, False: 117k]
  ------------------
  395|     11|                parser.error = CJ5_ERROR_INVALID;
  396|     11|                goto finish;
  397|     11|            }
  398|       |
  399|  2.92M|            if(token) {
  ------------------
  |  Branch (399:16): [True: 1.50M, False: 1.42M]
  ------------------
  400|       |                // Finalize the current token
  401|  1.50M|                token->end = parser.pos;
  402|       |
  403|       |                // Move to the parent and increase the parent size. Omit this
  404|       |                // when we leave the root (parent the same as the current
  405|       |                // token).
  406|  1.50M|                if(parser.curr_tok_idx != token->parent_id) {
  ------------------
  |  Branch (406:20): [True: 1.49M, False: 5.85k]
  ------------------
  407|  1.49M|                    parser.curr_tok_idx = token->parent_id;
  408|  1.49M|                    token = &tokens[token->parent_id];
  409|  1.49M|                    token->size++;
  410|  1.49M|                }
  411|  1.50M|            }
  412|       |
  413|       |            // Step one level up
  414|  2.92M|            depth--;
  415|  2.92M|            next[depth] = (depth == 0) ? 0 : ','; // zero if we step out the root
  ------------------
  |  Branch (415:27): [True: 6.05k, False: 2.91M]
  ------------------
  416|       |                                                  // object. then we do not look for
  417|       |                                                  // another element.
  418|       |
  419|       |            // The first element was successfully parsed. Stop early or try to
  420|       |            // parse the full input string?
  421|  2.92M|            if(depth == 0 && parser.stop_early)
  ------------------
  |  Branch (421:16): [True: 6.05k, False: 2.91M]
  |  Branch (421:30): [True: 0, False: 6.05k]
  ------------------
  422|      0|                goto finish;
  423|       |
  424|  2.92M|            break;
  425|       |
  426|  2.92M|        case ':': // Colon (between key and value)
  ------------------
  |  Branch (426:9): [True: 294k, False: 75.6M]
  ------------------
  427|   294k|            if(next[depth] != ':') {
  ------------------
  |  Branch (427:16): [True: 3.83k, False: 291k]
  ------------------
  428|  3.83k|                parser.error = CJ5_ERROR_INVALID;
  429|  3.83k|                goto finish;
  430|  3.83k|            }
  431|   291k|            next[depth] = 'v';
  432|   291k|            break;
  433|       |
  434|  36.1M|        case ',': // Comma
  ------------------
  |  Branch (434:9): [True: 36.1M, False: 39.8M]
  ------------------
  435|  36.1M|            if(next[depth] != ',') {
  ------------------
  |  Branch (435:16): [True: 23, False: 36.1M]
  ------------------
  436|     23|                parser.error = CJ5_ERROR_INVALID;
  437|     23|                goto finish;
  438|     23|            }
  439|  36.1M|            next[depth] = (nesting[depth] == '{') ? 'k' : 'v';
  ------------------
  |  Branch (439:27): [True: 168k, False: 35.9M]
  ------------------
  440|  36.1M|            break;
  441|       |
  442|  33.6M|        default: // Value or key
  ------------------
  |  Branch (442:9): [True: 33.6M, False: 42.3M]
  ------------------
  443|  33.6M|            if(next[depth] == 'v') {
  ------------------
  |  Branch (443:16): [True: 33.3M, False: 291k]
  ------------------
  444|  33.3M|                cj5__parse_primitive(&parser); // Parse primitive value
  445|  33.3M|                if(nesting[depth] != 0) {
  ------------------
  |  Branch (445:20): [True: 33.3M, False: 4.17k]
  ------------------
  446|       |                    // Parent is object or array
  447|  33.3M|                    if(token)
  ------------------
  |  Branch (447:24): [True: 33.0M, False: 295k]
  ------------------
  448|  33.0M|                        token->size++;
  449|  33.3M|                    next[depth] = ',';
  450|  33.3M|                } else {
  451|       |                    // The current value was the root element. Don't look for
  452|       |                    // any next element.
  453|  4.17k|                    next[depth] = 0;
  454|       |
  455|       |                    // The first element was successfully parsed. Stop early or try to
  456|       |                    // parse the full input string?
  457|  4.17k|                    if(parser.stop_early)
  ------------------
  |  Branch (457:24): [True: 0, False: 4.17k]
  ------------------
  458|      0|                        goto finish;
  459|  4.17k|                }
  460|  33.3M|            } else if(next[depth] == 'k') {
  ------------------
  |  Branch (460:23): [True: 291k, False: 253]
  ------------------
  461|   291k|                cj5__parse_key(&parser);
  462|   291k|                if(token)
  ------------------
  |  Branch (462:20): [True: 184k, False: 106k]
  ------------------
  463|   184k|                    token->size++; // Keys count towards the length
  464|   291k|                next[depth] = ':';
  465|   291k|            } else {
  466|    253|                parser.error = CJ5_ERROR_INVALID;
  467|    253|            }
  468|       |
  469|  33.6M|            if(parser.error && parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (469:16): [True: 16.9M, False: 16.6M]
  |  Branch (469:32): [True: 513, False: 16.9M]
  ------------------
  470|    513|                goto finish;
  471|       |
  472|  33.6M|            break;
  473|  75.9M|        }
  474|  75.9M|    }
  475|       |
  476|       |    // Are we back to the initial nesting depth?
  477|  10.0k|    if(depth != 0) {
  ------------------
  |  Branch (477:8): [True: 92, False: 9.96k]
  ------------------
  478|     92|        parser.error = CJ5_ERROR_INCOMPLETE;
  479|     92|        goto finish;
  480|     92|    }
  481|       |
  482|       |    // Close the virtual root object if there is one
  483|  9.96k|    if(nesting[0] == '{' && parser.error != CJ5_ERROR_OVERFLOW) {
  ------------------
  |  Branch (483:8): [True: 3.80k, False: 6.16k]
  |  Branch (483:29): [True: 3.79k, False: 10]
  ------------------
  484|       |        // Check the we end after a complete key-value pair (or dangling comma)
  485|  3.79k|        if(next[0] != 'k' && next[0] != ',')
  ------------------
  |  Branch (485:12): [True: 3.78k, False: 5]
  |  Branch (485:30): [True: 61, False: 3.72k]
  ------------------
  486|     61|            parser.error = CJ5_ERROR_INVALID;
  487|  3.79k|        tokens[0].end = parser.pos - 1;
  488|  3.79k|    }
  489|       |
  490|  14.6k| finish:
  491|       |    // If parsing failed at the initial nesting depth, create a virtual root object
  492|       |    // and restart parsing.
  493|  14.6k|    if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (493:8): [True: 5.36k, False: 9.28k]
  ------------------
  494|  5.36k|       parser.error != CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (494:8): [True: 4.74k, False: 621]
  ------------------
  495|  4.74k|       depth == 0 && nesting[0] != '{') {
  ------------------
  |  Branch (495:8): [True: 4.52k, False: 218]
  |  Branch (495:22): [True: 4.16k, False: 364]
  ------------------
  496|  4.16k|        parser.token_count = 0;
  497|  4.16k|        token = cj5__alloc_token(&parser);
  498|  4.16k|        if(token) {
  ------------------
  |  Branch (498:12): [True: 4.16k, False: 0]
  ------------------
  499|  4.16k|            token->parent_id = 0;
  500|  4.16k|            token->type = CJ5_TOKEN_OBJECT;
  501|  4.16k|            token->start = 0;
  502|  4.16k|            token->size = 0;
  503|       |
  504|  4.16k|            nesting[0] = '{';
  505|  4.16k|            next[0] = 'k';
  506|       |
  507|  4.16k|            parser.curr_tok_idx = 0;
  508|  4.16k|            parser.pos = 0;
  509|  4.16k|            parser.error = CJ5_ERROR_NONE;
  510|  4.16k|            goto start_parsing;
  511|  4.16k|        }
  512|  4.16k|    }
  513|       |
  514|  10.4k|    memset(&r, 0x0, sizeof(r));
  515|  10.4k|    r.error = parser.error;
  516|  10.4k|    r.error_pos = parser.pos;
  517|  10.4k|    r.num_tokens = parser.token_count; // How many tokens (would) have been
  518|       |                                       // consumed by the parser?
  519|       |
  520|       |    // Not a single token was parsed -> return an error
  521|  10.4k|    if(r.num_tokens == 0)
  ------------------
  |  Branch (521:8): [True: 27, False: 10.4k]
  ------------------
  522|     27|        r.error = CJ5_ERROR_INCOMPLETE;
  523|       |
  524|       |    // Set the tokens and original string only if successfully parsed
  525|  10.4k|    if(r.error == CJ5_ERROR_NONE) {
  ------------------
  |  Branch (525:8): [True: 9.25k, False: 1.23k]
  ------------------
  526|  9.25k|        r.tokens = tokens;
  527|  9.25k|        r.json5 = json5;
  528|  9.25k|    }
  529|       |
  530|  10.4k|    return r;
  531|  14.6k|}
cj5_get_str:
  629|  94.5k|            char *buf, unsigned int *buflen) {
  630|  94.5k|    const cj5_token *token = &r->tokens[tok_index];
  631|  94.5k|    if(token->type != CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (631:8): [True: 0, False: 94.5k]
  ------------------
  632|      0|        buf[0] = 0;
  633|      0|        if(buflen)
  ------------------
  |  Branch (633:12): [True: 0, False: 0]
  ------------------
  634|      0|            *buflen = 0;
  635|      0|        return CJ5_ERROR_INVALID;
  636|      0|    }
  637|       |
  638|  94.5k|    const char *pos = &r->json5[token->start];
  639|  94.5k|    const char *end = &r->json5[token->end + 1];
  640|  94.5k|    unsigned int outpos = 0;
  641|  94.5k|    cj5_error_code error = CJ5_ERROR_NONE;
  642|  30.1M|    for(; pos < end; pos++) {
  ------------------
  |  Branch (642:11): [True: 30.0M, False: 94.4k]
  ------------------
  643|  30.0M|        uint8_t c = (uint8_t)*pos;
  644|       |        // Unprintable ascii characters must be escaped
  645|  30.0M|        if(c < ' ' || c == 127) {
  ------------------
  |  Branch (645:12): [True: 20, False: 30.0M]
  |  Branch (645:23): [True: 3, False: 30.0M]
  ------------------
  646|     23|            error = CJ5_ERROR_INVALID;
  647|     23|            goto done;
  648|     23|        }
  649|       |
  650|       |        // Unescaped Ascii character or utf8 byte
  651|  30.0M|        if(c != '\\') {
  ------------------
  |  Branch (651:12): [True: 24.7M, False: 5.22M]
  ------------------
  652|  24.7M|            buf[outpos++] = (char)c;
  653|  24.7M|            continue;
  654|  24.7M|        }
  655|       |
  656|       |        // End of input before the escaped character
  657|  5.22M|        if(pos + 1 >= end) {
  ------------------
  |  Branch (657:12): [True: 0, False: 5.22M]
  ------------------
  658|      0|            error = CJ5_ERROR_INCOMPLETE;
  659|      0|            goto done;
  660|      0|        }
  661|       |
  662|       |        // Process escaped character
  663|  5.22M|        pos++;
  664|  5.22M|        c = (uint8_t)*pos;
  665|  5.22M|        switch(c) {
  666|    250|        case 'b': buf[outpos++] = '\b'; break;
  ------------------
  |  Branch (666:9): [True: 250, False: 5.22M]
  ------------------
  667|  1.01k|        case 'f': buf[outpos++] = '\f'; break;
  ------------------
  |  Branch (667:9): [True: 1.01k, False: 5.22M]
  ------------------
  668|    222|        case 'r': buf[outpos++] = '\r'; break;
  ------------------
  |  Branch (668:9): [True: 222, False: 5.22M]
  ------------------
  669|  51.3k|        case 'n': buf[outpos++] = '\n'; break;
  ------------------
  |  Branch (669:9): [True: 51.3k, False: 5.17M]
  ------------------
  670|    230|        case 't': buf[outpos++] = '\t'; break;
  ------------------
  |  Branch (670:9): [True: 230, False: 5.22M]
  ------------------
  671|  3.84M|        default:  buf[outpos++] = (char)c; break;
  ------------------
  |  Branch (671:9): [True: 3.84M, False: 1.37M]
  ------------------
  672|  1.32M|        case 'u': {
  ------------------
  |  Branch (672:9): [True: 1.32M, False: 3.89M]
  ------------------
  673|       |            // Parse a unicode code point
  674|  1.32M|            if(pos + 4 >= end) {
  ------------------
  |  Branch (674:16): [True: 8, False: 1.32M]
  ------------------
  675|      8|                error = CJ5_ERROR_INCOMPLETE;
  676|      8|                goto done;
  677|      8|            }
  678|  1.32M|            pos++;
  679|  1.32M|            uint32_t utf;
  680|  1.32M|            error = parse_codepoint(pos, &utf);
  681|  1.32M|            if(error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (681:16): [True: 11, False: 1.32M]
  ------------------
  682|     11|                goto done;
  683|  1.32M|            pos += 3;
  684|       |
  685|       |            // Parse a surrogate pair
  686|  1.32M|            if(0xd800 <= utf && utf <= 0xdfff) {
  ------------------
  |  Branch (686:16): [True: 834, False: 1.32M]
  |  Branch (686:33): [True: 623, False: 211]
  ------------------
  687|    623|                if(pos + 6 >= end) {
  ------------------
  |  Branch (687:20): [True: 11, False: 612]
  ------------------
  688|     11|                    error = CJ5_ERROR_INVALID;
  689|     11|                    goto done;
  690|     11|                }
  691|    612|                if(pos[1] != '\\' && pos[2] != 'u') {
  ------------------
  |  Branch (691:20): [True: 279, False: 333]
  |  Branch (691:38): [True: 12, False: 267]
  ------------------
  692|     12|                    error = CJ5_ERROR_INVALID;
  693|     12|                    goto done;
  694|     12|                }
  695|    600|                pos += 3;
  696|    600|                uint32_t utf2;
  697|    600|                error = parse_codepoint(pos, &utf2);
  698|    600|                if(error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (698:20): [True: 10, False: 590]
  ------------------
  699|     10|                    goto done;
  700|    590|                pos += 3;
  701|       |                // High or low surrogate pair
  702|    590|                utf = (utf <= 0xdbff) ?
  ------------------
  |  Branch (702:23): [True: 267, False: 323]
  ------------------
  703|    267|                    (utf << 10) + utf2 + SURROGATE_OFFSET :
  704|    590|                    (utf2 << 10) + utf + SURROGATE_OFFSET;
  705|    590|            }
  706|       |
  707|       |            // Write the utf8 bytes of the code point
  708|  1.32M|            unsigned len = utf8_from_codepoint((unsigned char*)buf + outpos, utf);
  709|  1.32M|            if(len == 0) {
  ------------------
  |  Branch (709:16): [True: 38, False: 1.32M]
  ------------------
  710|     38|                error = CJ5_ERROR_INVALID; // Not a utf8 string
  711|     38|                goto done;
  712|     38|            }
  713|  1.32M|            outpos += len;
  714|  1.32M|            break;
  715|  1.32M|        }
  716|  5.22M|        }
  717|  5.22M|    }
  718|       |
  719|  94.5k| done:
  720|       |    // Always leave buf as a valid, NUL-terminated string, even when decoding
  721|       |    // fails midway. Callers still must check the returned error code.
  722|  94.5k|    buf[outpos] = 0;
  723|       |
  724|       |    // Set the output length
  725|  94.5k|    if(buflen)
  ------------------
  |  Branch (725:8): [True: 94.5k, False: 0]
  ------------------
  726|  94.5k|        *buflen = outpos;
  727|  94.5k|    return error;
  728|  94.5k|}
cj5.c:cj5__skip_comment:
  261|  13.6k|cj5__skip_comment(cj5__parser* parser) {
  262|  13.6k|    const char* json5 = parser->json5;
  263|       |
  264|       |    // Single-line comment
  265|  13.6k|    if(json5[parser->pos] == '#') {
  ------------------
  |  Branch (265:8): [True: 363, False: 13.3k]
  ------------------
  266|  13.0k|    skip_line:
  267|  4.93M|        while(parser->pos < parser->len) {
  ------------------
  |  Branch (267:15): [True: 4.93M, False: 123]
  ------------------
  268|  4.93M|            if(json5[parser->pos] == '\n') {
  ------------------
  |  Branch (268:16): [True: 12.9k, False: 4.92M]
  ------------------
  269|  12.9k|                parser->pos--; // Reparse the newline in the main parse loop
  270|  12.9k|                return;
  271|  12.9k|            }
  272|  4.92M|            parser->pos++;
  273|  4.92M|        }
  274|    123|        return;
  275|  13.0k|    }
  276|       |
  277|       |    // Comment begins with '/' but not enough space for another character
  278|  13.3k|    if(parser->pos + 1 >= parser->len) {
  ------------------
  |  Branch (278:8): [True: 33, False: 13.2k]
  ------------------
  279|     33|        parser->error = CJ5_ERROR_INVALID;
  280|     33|        return;
  281|     33|    }
  282|  13.2k|    parser->pos++;
  283|       |
  284|       |    // Comment begins with '//' -> single-line comment
  285|  13.2k|    if(json5[parser->pos] == '/')
  ------------------
  |  Branch (285:8): [True: 12.7k, False: 567]
  ------------------
  286|  12.7k|        goto skip_line;
  287|       |
  288|       |    // Multi-line comments begin with '/*' and end with '*/'
  289|    567|    if(json5[parser->pos] == '*') {
  ------------------
  |  Branch (289:8): [True: 533, False: 34]
  ------------------
  290|    533|        parser->pos++;
  291|   925k|        for(; parser->pos + 1 < parser->len; parser->pos++) {
  ------------------
  |  Branch (291:15): [True: 925k, False: 92]
  ------------------
  292|   925k|            if(json5[parser->pos] == '*' && json5[parser->pos + 1] == '/') {
  ------------------
  |  Branch (292:16): [True: 1.00k, False: 924k]
  |  Branch (292:45): [True: 441, False: 559]
  ------------------
  293|    441|                parser->pos++;
  294|    441|                return;
  295|    441|            }
  296|   925k|        }
  297|    533|    }
  298|       |
  299|       |    // Unknown comment type or the multi-line comment is not terminated
  300|    126|    parser->error = CJ5_ERROR_INCOMPLETE;
  301|    126|}
cj5.c:cj5__alloc_token:
   89|  36.5M|cj5__alloc_token(cj5__parser *parser) {
   90|  36.5M|    cj5_token* token = NULL;
   91|  36.5M|    if(parser->token_count < parser->max_tokens) {
  ------------------
  |  Branch (91:8): [True: 18.1M, False: 18.3M]
  ------------------
   92|  18.1M|        token = &parser->tokens[parser->token_count];
   93|  18.1M|        memset(token, 0x0, sizeof(cj5_token));
   94|  18.3M|    } else {
   95|  18.3M|        parser->error = CJ5_ERROR_OVERFLOW;
   96|  18.3M|    }
   97|       |
   98|       |    // Always increase the index. So we know eventually how many token would be
   99|       |    // required (if there are not enough).
  100|  36.5M|    parser->token_count++;
  101|  36.5M|    return token;
  102|  36.5M|}
cj5.c:cj5__parse_primitive:
  153|  33.3M|cj5__parse_primitive(cj5__parser* parser) {
  154|  33.3M|    const char* json5 = parser->json5;
  155|  33.3M|    unsigned int len = parser->len;
  156|  33.3M|    unsigned int start = parser->pos;
  157|       |
  158|       |    // String value
  159|  33.3M|    if(json5[start] == '\"' ||
  ------------------
  |  Branch (159:8): [True: 7.02M, False: 26.3M]
  ------------------
  160|  26.3M|       json5[start] == '\'') {
  ------------------
  |  Branch (160:8): [True: 129k, False: 26.1M]
  ------------------
  161|  7.15M|        cj5__parse_string(parser);
  162|  7.15M|        return;
  163|  7.15M|    }
  164|       |
  165|       |    // Fast comparison of bool, and null.
  166|       |    // Make the comparison case-insensitive.
  167|  26.1M|    uint32_t fourcc = 0;
  168|  26.1M|    if(start + 3 < len) {
  ------------------
  |  Branch (168:8): [True: 26.1M, False: 4.65k]
  ------------------
  169|  26.1M|        fourcc += (unsigned char)json5[start] | 32U;
  170|  26.1M|        fourcc += ((unsigned char)json5[start+1] | 32U) << 8;
  171|  26.1M|        fourcc += ((unsigned char)json5[start+2] | 32U) << 16;
  172|  26.1M|        fourcc += ((unsigned char)json5[start+3] | 32U) << 24;
  173|  26.1M|    }
  174|       |    
  175|  26.1M|    cj5_token_type type;
  176|  26.1M|    if(fourcc == CJ5__NULL_FOURCC) {
  ------------------
  |  Branch (176:8): [True: 19.4k, False: 26.1M]
  ------------------
  177|  19.4k|        type = CJ5_TOKEN_NULL;
  178|  19.4k|        parser->pos += 3;
  179|  26.1M|    } else if(fourcc == CJ5__TRUE_FOURCC) {
  ------------------
  |  Branch (179:15): [True: 247, False: 26.1M]
  ------------------
  180|    247|        type = CJ5_TOKEN_BOOL;
  181|    247|        parser->pos += 3;
  182|  26.1M|    } else if(fourcc == CJ5__FALSE_FOURCC) {
  ------------------
  |  Branch (182:15): [True: 74, False: 26.1M]
  ------------------
  183|       |        // "false" has five characters
  184|     74|        type = CJ5_TOKEN_BOOL;
  185|     74|        if(start + 4 >= len || (json5[start+4] | 32) != 'e') {
  ------------------
  |  Branch (185:12): [True: 1, False: 73]
  |  Branch (185:32): [True: 22, False: 51]
  ------------------
  186|     23|            parser->error = CJ5_ERROR_INVALID;
  187|     23|            return;
  188|     23|        }
  189|     51|        parser->pos += 4;
  190|  26.1M|    } else {
  191|       |        // Numbers are checked for basic compatibility.
  192|       |        // But they are fully parsed only in the cj5_get_XXX functions.
  193|  26.1M|        type = CJ5_TOKEN_NUMBER;
  194|  59.9M|        for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (194:15): [True: 59.9M, False: 3.77k]
  ------------------
  195|  59.9M|            if(!cj5__isnum(json5[parser->pos]) &&
  ------------------
  |  |   86|   119M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  ------------------
  |  Branch (195:16): [True: 29.0M, False: 30.8M]
  ------------------
  196|  29.0M|               !(json5[parser->pos] == '.') &&
  ------------------
  |  Branch (196:16): [True: 27.7M, False: 1.26M]
  ------------------
  197|  27.7M|               !cj5__islowerchar(json5[parser->pos]) && 
  ------------------
  |  |   85|  87.7M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  ------------------
  |  Branch (197:16): [True: 26.1M, False: 1.59M]
  ------------------
  198|  26.1M|               !cj5__isupperchar(json5[parser->pos]) &&
  ------------------
  |  |   84|  86.1M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  ------------------
  |  Branch (198:16): [True: 26.1M, False: 25.8k]
  ------------------
  199|  26.1M|               !(json5[parser->pos] == '+') && !(json5[parser->pos] == '-')) {
  ------------------
  |  Branch (199:16): [True: 26.1M, False: 2.15k]
  |  Branch (199:48): [True: 26.1M, False: 11.5k]
  ------------------
  200|  26.1M|                break;
  201|  26.1M|            }
  202|  59.9M|        }
  203|  26.1M|        parser->pos--; // Point to the last character that is still inside the
  204|       |                       // primitive value
  205|  26.1M|    }
  206|       |
  207|  26.1M|    cj5_token *token = cj5__alloc_token(parser);
  208|  26.1M|    if(token) {
  ------------------
  |  Branch (208:8): [True: 12.8M, False: 13.3M]
  ------------------
  209|  12.8M|        token->type = type;
  210|  12.8M|        token->start = start;
  211|  12.8M|        token->end = parser->pos;
  212|  12.8M|        token->size = parser->pos - start + 1;
  213|  12.8M|        token->parent_id = parser->curr_tok_idx;
  214|  12.8M|    }
  215|  26.1M|}
cj5.c:cj5__parse_string:
  105|  7.27M|cj5__parse_string(cj5__parser *parser) {
  106|  7.27M|    const char *json5 = parser->json5;
  107|  7.27M|    unsigned int len = parser->len;
  108|  7.27M|    unsigned int start = parser->pos;
  109|  7.27M|    char str_open = json5[start];
  110|       |
  111|  7.27M|    parser->pos++;
  112|  71.8M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (112:11): [True: 71.8M, False: 121]
  ------------------
  113|  71.8M|        char c = json5[parser->pos];
  114|       |
  115|       |        // End of string
  116|  71.8M|        if(str_open == c) {
  ------------------
  |  Branch (116:12): [True: 7.27M, False: 64.5M]
  ------------------
  117|  7.27M|            cj5_token *token = cj5__alloc_token(parser);
  118|  7.27M|            if(token) {
  ------------------
  |  Branch (118:16): [True: 3.69M, False: 3.58M]
  ------------------
  119|  3.69M|                token->type = CJ5_TOKEN_STRING;
  120|  3.69M|                token->start = start + 1;
  121|  3.69M|                token->end = parser->pos - 1;
  122|  3.69M|                token->size = token->end - token->start + 1;
  123|  3.69M|                token->parent_id = parser->curr_tok_idx;
  124|  3.69M|            } 
  125|  7.27M|            return;
  126|  7.27M|        }
  127|       |
  128|       |        // Unescaped newlines are forbidden
  129|  64.5M|        if(c == '\n') {
  ------------------
  |  Branch (129:12): [True: 2, False: 64.5M]
  ------------------
  130|      2|            parser->error = CJ5_ERROR_INVALID;
  131|      2|            return;
  132|      2|        }
  133|       |
  134|       |        // Skip escape character
  135|  64.5M|        if(c == '\\') {
  ------------------
  |  Branch (135:12): [True: 6.59M, False: 57.9M]
  ------------------
  136|  6.59M|            if(parser->pos + 1 >= len) {
  ------------------
  |  Branch (136:16): [True: 7, False: 6.59M]
  ------------------
  137|      7|                parser->error = CJ5_ERROR_INCOMPLETE;
  138|      7|                return;
  139|      7|            }
  140|  6.59M|            parser->pos++;
  141|  6.59M|        }
  142|  64.5M|    }
  143|       |
  144|       |    // The file has ended before the string terminates
  145|    121|    parser->error = CJ5_ERROR_INCOMPLETE;
  146|    121|}
cj5.c:cj5__isrange:
   80|   124M|cj5__isrange(char ch, char from, char to) {
   81|   124M|    return (uint8_t)(ch - from) <= (uint8_t)(to - from);
   82|   124M|}
cj5.c:cj5__parse_key:
  218|   291k|cj5__parse_key(cj5__parser* parser) {
  219|   291k|    const char* json5 = parser->json5;
  220|   291k|    unsigned int start = parser->pos;
  221|   291k|    cj5_token* token;
  222|       |
  223|       |    // Key is a a normal string
  224|   291k|    if(json5[start] == '\"' || json5[start] == '\'') {
  ------------------
  |  Branch (224:8): [True: 116k, False: 175k]
  |  Branch (224:32): [True: 339, False: 174k]
  ------------------
  225|   116k|        cj5__parse_string(parser);
  226|   116k|        return;
  227|   116k|    }
  228|       |
  229|       |    // An unquoted key. Must start with a-ZA-Z_$. Can contain numbers later on.
  230|   174k|    unsigned int len = parser->len;
  231|  3.24M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (231:11): [True: 3.24M, False: 77]
  ------------------
  232|  3.24M|        if(cj5__islowerchar(json5[parser->pos]) ||
  ------------------
  |  |   85|  6.49M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 2.81M, False: 436k]
  |  |  ------------------
  ------------------
  233|   436k|           cj5__isupperchar(json5[parser->pos]) ||
  ------------------
  |  |   84|  3.68M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  |  |  ------------------
  |  |  |  Branch (84:30): [True: 232k, False: 204k]
  |  |  ------------------
  ------------------
  234|   204k|           json5[parser->pos] == '_' || json5[parser->pos] == '$')
  ------------------
  |  Branch (234:12): [True: 793, False: 203k]
  |  Branch (234:41): [True: 539, False: 202k]
  ------------------
  235|  3.04M|            continue;
  236|   202k|        if(cj5__isnum(json5[parser->pos]) && parser->pos != start)
  ------------------
  |  |   86|   405k|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (86:30): [True: 27.8k, False: 174k]
  |  |  ------------------
  ------------------
  |  Branch (236:46): [True: 27.8k, False: 3]
  ------------------
  237|  27.8k|            continue;
  238|   174k|        break;
  239|   202k|    }
  240|       |
  241|       |    // An empty key is not allowed
  242|   174k|    if(parser->pos <= start) {
  ------------------
  |  Branch (242:8): [True: 107, False: 174k]
  ------------------
  243|    107|        parser->error = CJ5_ERROR_INVALID;
  244|    107|        return;
  245|    107|    }
  246|       |
  247|       |    // Move pos to the last character within the unquoted key
  248|   174k|    parser->pos--;
  249|       |
  250|   174k|    token = cj5__alloc_token(parser);
  251|   174k|    if(token) {
  ------------------
  |  Branch (251:8): [True: 100k, False: 74.5k]
  ------------------
  252|   100k|        token->type = CJ5_TOKEN_STRING;
  253|   100k|        token->start = start;
  254|   100k|        token->end = parser->pos;
  255|   100k|        token->size = parser->pos - start + 1;
  256|   100k|        token->parent_id = parser->curr_tok_idx;
  257|   100k|    }
  258|   174k|}
cj5.c:parse_codepoint:
  608|  1.32M|parse_codepoint(const char *pos, uint32_t *out_utf) {
  609|  1.32M|    uint32_t utf = 0;
  610|  6.62M|    for(unsigned int i = 0; i < 4; i++) {
  ------------------
  |  Branch (610:29): [True: 5.29M, False: 1.32M]
  ------------------
  611|  5.29M|        char byte = pos[i];
  612|  5.29M|        if(cj5__isnum(byte)) {
  ------------------
  |  |   86|  5.29M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (86:30): [True: 3.97M, False: 1.32M]
  |  |  ------------------
  ------------------
  613|  3.97M|            byte = (char)(byte - '0');
  614|  3.97M|        } else if(cj5__isrange(byte, 'a', 'f')) {
  ------------------
  |  Branch (614:19): [True: 1.32M, False: 2.87k]
  ------------------
  615|  1.32M|            byte = (char)(byte - ('a' - 10));
  616|  1.32M|        } else if(cj5__isrange(byte, 'A', 'F')) {
  ------------------
  |  Branch (616:19): [True: 2.85k, False: 21]
  ------------------
  617|  2.85k|            byte = (char)(byte - ('A' - 10));
  618|  2.85k|        } else {
  619|     21|            return CJ5_ERROR_INVALID;
  620|     21|        }
  621|  5.29M|        utf = (utf << 4) | ((uint8_t)byte & 0xF);
  622|  5.29M|    }
  623|  1.32M|    *out_utf = utf;
  624|  1.32M|    return CJ5_ERROR_NONE;
  625|  1.32M|}

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

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

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

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

UA_findDataTypeWithCustom:
   66|     33|                          const UA_DataTypeArray *customTypes) {
   67|       |    /* Always look in built-in types first (may contain data types from all
   68|       |     * namespaces).
   69|       |     *
   70|       |     * TODO: The standard-defined types are ordered. See if binary search is
   71|       |     * more efficient. */
   72|  12.8k|    for(size_t i = 0; i < UA_TYPES_COUNT; ++i) {
  ------------------
  |  |   17|  12.8k|#define UA_TYPES_COUNT 388
  ------------------
  |  Branch (72:23): [True: 12.8k, False: 33]
  ------------------
   73|  12.8k|        if(nodeIdOrder(&UA_TYPES[i].typeId, typeId, NULL) == UA_ORDER_EQ)
  ------------------
  |  Branch (73:12): [True: 0, False: 12.8k]
  ------------------
   74|      0|            return &UA_TYPES[i];
   75|  12.8k|    }
   76|       |
   77|       |    /* Search in the customTypes */
   78|     33|    while(customTypes) {
  ------------------
  |  Branch (78:11): [True: 0, False: 33]
  ------------------
   79|      0|        for(size_t i = 0; i < customTypes->typesSize; ++i) {
  ------------------
  |  Branch (79:27): [True: 0, False: 0]
  ------------------
   80|      0|            if(nodeIdOrder(&customTypes->types[i].typeId, typeId, NULL) == UA_ORDER_EQ)
  ------------------
  |  Branch (80:16): [True: 0, False: 0]
  ------------------
   81|      0|                return &customTypes->types[i];
   82|      0|        }
   83|      0|        customTypes = customTypes->next;
   84|      0|    }
   85|       |
   86|     33|    return NULL;
   87|     33|}
UA_StatusCode_equalTop:
  215|  33.0k|UA_StatusCode_equalTop(UA_StatusCode s1, UA_StatusCode s2) {
  216|  33.0k|    return ((s1 & 0xFFFF0000) == (s2 & 0xFFFF0000));
  217|  33.0k|}
UA_STRING:
  220|    156|UA_STRING(char *chars) {
  221|    156|    UA_String s = {0, NULL};
  222|    156|    if(!chars)
  ------------------
  |  Branch (222:8): [True: 0, False: 156]
  ------------------
  223|      0|        return s;
  224|    156|    s.length = strlen(chars);
  225|    156|    s.data = (UA_Byte*)chars;
  226|    156|    return s;
  227|    156|}
UA_QualifiedName_printEx:
  410|  68.6k|                         const UA_NamespaceMapping *nsMapping) {
  411|       |    /* Start tracking the output length */
  412|  68.6k|    size_t len = qn->name.length;
  413|       |
  414|       |    /* Try to map the NamespaceIndex to the Uri */
  415|  68.6k|    UA_String nsUri = UA_STRING_NULL;
  416|  68.6k|    if(qn->namespaceIndex > 0 && nsMapping) {
  ------------------
  |  Branch (416:8): [True: 1.41k, False: 67.2k]
  |  Branch (416:34): [True: 0, False: 1.41k]
  ------------------
  417|      0|        UA_NamespaceMapping_index2Uri(nsMapping, qn->namespaceIndex, &nsUri);
  418|      0|        if(nsUri.length > 0)
  ------------------
  |  Branch (418:12): [True: 0, False: 0]
  ------------------
  419|      0|            len += nsUri.length + 1;
  420|      0|    }
  421|       |
  422|       |    /* Print the NamespaceIndex */
  423|  68.6k|    char nsStr[6];
  424|  68.6k|    size_t nsStrSize = 0;
  425|  68.6k|    if(nsUri.length == 0 && qn->namespaceIndex > 0) {
  ------------------
  |  Branch (425:8): [True: 68.6k, False: 0]
  |  Branch (425:29): [True: 1.41k, False: 67.2k]
  ------------------
  426|  1.41k|        nsStrSize = itoaUnsigned(qn->namespaceIndex, nsStr, 10);
  427|  1.41k|        len += 1 + nsStrSize;
  428|  1.41k|    }
  429|       |
  430|       |    /* Allocate memory if required */
  431|  68.6k|    if(output->length == 0) {
  ------------------
  |  Branch (431:8): [True: 68.6k, False: 0]
  ------------------
  432|  68.6k|        UA_StatusCode res = UA_ByteString_allocBuffer((UA_ByteString*)output, len);
  433|  68.6k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  68.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (433:12): [True: 0, False: 68.6k]
  ------------------
  434|      0|            return res;
  435|  68.6k|    } else {
  436|      0|        if(output->length < len)
  ------------------
  |  Branch (436:12): [True: 0, False: 0]
  ------------------
  437|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  438|      0|        output->length = len;
  439|      0|    }
  440|       |
  441|       |    /* Print the namespace */
  442|  68.6k|    u8 *pos = output->data;
  443|  68.6k|    if(nsUri.length > 0) {
  ------------------
  |  Branch (443:8): [True: 0, False: 68.6k]
  ------------------
  444|      0|        memcpy(pos, nsUri.data, nsUri.length);
  445|      0|        pos += nsUri.length;
  446|      0|        *pos++ = ';';
  447|  68.6k|    } else if(qn->namespaceIndex > 0) {
  ------------------
  |  Branch (447:15): [True: 1.41k, False: 67.2k]
  ------------------
  448|  1.41k|        memcpy(pos, nsStr, nsStrSize);
  449|  1.41k|        pos += nsStrSize;
  450|  1.41k|        *pos++ = ':';
  451|  1.41k|    }
  452|       |
  453|       |    /* Print the name */
  454|  68.6k|    if(UA_LIKELY(qn->name.data != NULL))
  ------------------
  |  |  579|  68.6k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (579:23): [True: 68.6k, False: 0]
  |  |  ------------------
  ------------------
  455|  68.6k|        memcpy(pos, qn->name.data, qn->name.length);
  456|       |
  457|  68.6k|    UA_assert(output->length == (size_t)((UA_Byte*)pos + qn->name.length - output->data));
  ------------------
  |  |  400|  68.6k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (457:5): [True: 68.6k, False: 0]
  ------------------
  458|  68.6k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  68.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  459|  68.6k|}
UA_Guid_to_hex:
  709|  2.59k|UA_Guid_to_hex(const UA_Guid *guid, u8* out, UA_Boolean lower) {
  710|  2.59k|    const u8 *hexmap = (lower) ? hexmapLower : hexmapUpper;
  ------------------
  |  Branch (710:24): [True: 0, False: 2.59k]
  ------------------
  711|  2.59k|    size_t i = 0, j = 28;
  712|  23.3k|    for(; i<8;i++,j-=4)         /* pos 0-7, 4byte, (a) */
  ------------------
  |  Branch (712:11): [True: 20.7k, False: 2.59k]
  ------------------
  713|  20.7k|        out[i] = hexmap[(guid->data1 >> j) & 0x0Fu];
  714|  2.59k|    out[i++] = '-';             /* pos 8 */
  715|  12.9k|    for(j=12; i<13;i++,j-=4)    /* pos 9-12, 2byte, (b) */
  ------------------
  |  Branch (715:15): [True: 10.3k, False: 2.59k]
  ------------------
  716|  10.3k|        out[i] = hexmap[(uint16_t)(guid->data2 >> j) & 0x0Fu];
  717|  2.59k|    out[i++] = '-';             /* pos 13 */
  718|  12.9k|    for(j=12; i<18;i++,j-=4)    /* pos 14-17, 2byte (c) */
  ------------------
  |  Branch (718:15): [True: 10.3k, False: 2.59k]
  ------------------
  719|  10.3k|        out[i] = hexmap[(uint16_t)(guid->data3 >> j) & 0x0Fu];
  720|  2.59k|    out[i++] = '-';              /* pos 18 */
  721|  7.77k|    for(j=0;i<23;i+=2,j++) {     /* pos 19-22, 2byte (d) */
  ------------------
  |  Branch (721:13): [True: 5.18k, False: 2.59k]
  ------------------
  722|  5.18k|        out[i] = hexmap[(guid->data4[j] & 0xF0u) >> 4u];
  723|  5.18k|        out[i+1] = hexmap[guid->data4[j] & 0x0Fu];
  724|  5.18k|    }
  725|  2.59k|    out[i++] = '-';              /* pos 23 */
  726|  18.1k|    for(j=2; i<36;i+=2,j++) {    /* pos 24-35, 6byte (e) */
  ------------------
  |  Branch (726:14): [True: 15.5k, False: 2.59k]
  ------------------
  727|  15.5k|        out[i] = hexmap[(guid->data4[j] & 0xF0u) >> 4u];
  728|  15.5k|        out[i+1] = hexmap[guid->data4[j] & 0x0Fu];
  729|  15.5k|    }
  730|  2.59k|}
UA_ByteString_allocBuffer:
  757|   154k|UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length) {
  758|   154k|    UA_ByteString_init(bs);
  759|   154k|    if(length == 0) {
  ------------------
  |  Branch (759:8): [True: 10.0k, False: 144k]
  ------------------
  760|  10.0k|        bs->data = (u8*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|  10.0k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  761|  10.0k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  10.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  762|  10.0k|    }
  763|   144k|    bs->data = (u8*)UA_calloc(1,length);
  ------------------
  |  |   20|   144k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  764|   144k|    if(UA_UNLIKELY(!bs->data))
  ------------------
  |  |  580|   144k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (580:25): [True: 0, False: 144k]
  |  |  ------------------
  ------------------
  765|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  766|   144k|    bs->length = length;
  767|   144k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   144k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  768|   144k|}
nodeId_printEscape:
 1024|  45.0k|                   const UA_NamespaceMapping *nsMapping, UA_Escaping idEsc) {
 1025|       |    /* Try to map the NamespaceIndex to the Uri */
 1026|  45.0k|    UA_String nsUri = UA_STRING_NULL;
 1027|  45.0k|    if(id->namespaceIndex > 0 && nsMapping)
  ------------------
  |  Branch (1027:8): [True: 35.1k, False: 9.93k]
  |  Branch (1027:34): [True: 0, False: 35.1k]
  ------------------
 1028|      0|        UA_NamespaceMapping_index2Uri(nsMapping, id->namespaceIndex, &nsUri);
 1029|       |
 1030|       |    /* Compute the string length and print numerical identifiers. */
 1031|  45.0k|    u8 nsStr[7];
 1032|  45.0k|    u8 numIdStr[12];
 1033|  45.0k|    size_t idLen = nodeIdSize(id, nsStr, numIdStr, nsUri, idEsc);
 1034|  45.0k|    if(idLen == 0)
  ------------------
  |  Branch (1034:8): [True: 0, False: 45.0k]
  ------------------
 1035|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 1036|       |
 1037|       |    /* Allocate memory if required */
 1038|  45.0k|    if(output->length == 0) {
  ------------------
  |  Branch (1038:8): [True: 45.0k, False: 0]
  ------------------
 1039|  45.0k|        UA_StatusCode res = UA_ByteString_allocBuffer((UA_ByteString*)output, idLen);
 1040|  45.0k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  45.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1040:12): [True: 0, False: 45.0k]
  ------------------
 1041|      0|            return res;
 1042|  45.0k|    } else {
 1043|      0|        if(output->length < idLen)
  ------------------
  |  Branch (1043:12): [True: 0, False: 0]
  ------------------
 1044|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
 1045|      0|        output->length = idLen;
 1046|      0|    }
 1047|       |
 1048|       |    /* Print the NodeId */
 1049|  45.0k|    u8 *pos = printNodeIdBody(id, nsUri, nsStr, numIdStr, output->data, nsMapping, idEsc);
 1050|  45.0k|    output->length = (size_t)(pos - output->data);
 1051|  45.0k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  45.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1052|  45.0k|}
UA_NodeId_printEx:
 1056|  45.0k|                  const UA_NamespaceMapping *nsMapping) {
 1057|  45.0k|    return nodeId_printEscape(id, output, nsMapping, UA_ESCAPING_NONE);
 1058|  45.0k|}
UA_ExpandedNodeId_printEx:
 1176|  34.1k|                          size_t serverUrisSize, const UA_String *serverUris) {
 1177|       |    /* Try to map the NamespaceIndex to the Uri */
 1178|  34.1k|    UA_String nsUri = eid->namespaceUri;
 1179|  34.1k|    if(nsUri.data == NULL && eid->nodeId.namespaceIndex > 0 && nsMapping)
  ------------------
  |  Branch (1179:8): [True: 31.5k, False: 2.59k]
  |  Branch (1179:30): [True: 6.68k, False: 24.8k]
  |  Branch (1179:64): [True: 0, False: 6.68k]
  ------------------
 1180|      0|        UA_NamespaceMapping_index2Uri(nsMapping, eid->nodeId.namespaceIndex, &nsUri);
 1181|       |
 1182|       |    /* Try to map the ServerIndex to a Uri */
 1183|  34.1k|    UA_String srvUri = UA_STRING_NULL;
 1184|  34.1k|    if(eid->serverIndex > 0 && eid->serverIndex < serverUrisSize)
  ------------------
  |  Branch (1184:8): [True: 2.00k, False: 32.1k]
  |  Branch (1184:32): [True: 0, False: 2.00k]
  ------------------
 1185|      0|        srvUri = serverUris[eid->serverIndex];
 1186|       |
 1187|       |    /* No special escaping for ExpandedNodeIds */
 1188|  34.1k|    UA_Escaping idEsc = UA_ESCAPING_NONE;
 1189|       |
 1190|       |    /* Compute the NodeId string length */
 1191|  34.1k|    u8 nsStr[7];
 1192|  34.1k|    u8 numIdStr[12];
 1193|  34.1k|    char srvIdxStr[11];
 1194|  34.1k|    size_t srvIdxSize = 0;
 1195|  34.1k|    size_t idLen = nodeIdSize(&eid->nodeId, nsStr, numIdStr, nsUri, idEsc);
 1196|  34.1k|    if(idLen == 0)
  ------------------
  |  Branch (1196:8): [True: 0, False: 34.1k]
  ------------------
 1197|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 1198|  34.1k|    if(srvUri.length  > 0) {
  ------------------
  |  Branch (1198:8): [True: 0, False: 34.1k]
  ------------------
 1199|      0|        idLen += 5; /* svu=; */
 1200|      0|        idLen += UA_String_escapedSize(srvUri, UA_ESCAPING_PERCENT);
 1201|  34.1k|    } else if(eid->serverIndex > 0) {
  ------------------
  |  Branch (1201:15): [True: 2.00k, False: 32.1k]
  ------------------
 1202|  2.00k|        idLen += 5; /* svr=; */
 1203|  2.00k|        srvIdxSize = itoaUnsigned(eid->serverIndex, srvIdxStr, 10);
 1204|  2.00k|        idLen += srvIdxSize;
 1205|  2.00k|    }
 1206|       |
 1207|       |    /* Allocate memory if required */
 1208|  34.1k|    if(output->length == 0) {
  ------------------
  |  Branch (1208:8): [True: 34.1k, False: 0]
  ------------------
 1209|  34.1k|        UA_StatusCode res = UA_ByteString_allocBuffer((UA_ByteString*)output, idLen);
 1210|  34.1k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  34.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1210:12): [True: 0, False: 34.1k]
  ------------------
 1211|      0|            return res;
 1212|  34.1k|    } else {
 1213|      0|        if(output->length < idLen)
  ------------------
  |  Branch (1213:12): [True: 0, False: 0]
  ------------------
 1214|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
 1215|      0|        output->length = idLen;
 1216|      0|    }
 1217|       |
 1218|       |    /* Encode the ServerIndex or ServerUrl */
 1219|  34.1k|    u8 *pos = output->data;
 1220|  34.1k|    if(srvUri.length  > 0) {
  ------------------
  |  Branch (1220:8): [True: 0, False: 34.1k]
  ------------------
 1221|      0|        memcpy(pos, "svu=", 4);
 1222|      0|        pos += 4;
 1223|      0|        pos += UA_String_escapeInsert(pos, srvUri, UA_ESCAPING_PERCENT);
 1224|      0|        *pos++ = ';';
 1225|  34.1k|    } else if(eid->serverIndex > 0) {
  ------------------
  |  Branch (1225:15): [True: 2.00k, False: 32.1k]
  ------------------
 1226|  2.00k|        memcpy(pos, "svr=", 4);
 1227|  2.00k|        pos += 4;
 1228|  2.00k|        memcpy(pos, srvIdxStr, srvIdxSize);
 1229|  2.00k|        pos += srvIdxSize;
 1230|  2.00k|        *pos++ = ';';
 1231|  2.00k|    }
 1232|       |
 1233|       |    /* Print the NodeId */
 1234|  34.1k|    pos = printNodeIdBody(&eid->nodeId, nsUri, nsStr, numIdStr, pos, nsMapping, idEsc);
 1235|  34.1k|    output->length = (size_t)(pos - output->data);
 1236|  34.1k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  34.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1237|  34.1k|}
UA_Variant_isScalar:
 1358|  58.4k|UA_Variant_isScalar(const UA_Variant *v) {
 1359|  58.4k|    return (v->type != NULL && v->arrayLength == 0 &&
  ------------------
  |  Branch (1359:13): [True: 58.4k, False: 0]
  |  Branch (1359:32): [True: 53.7k, False: 4.71k]
  ------------------
 1360|  53.7k|            v->data > UA_EMPTY_ARRAY_SENTINEL);
  ------------------
  |  |  756|  53.7k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1360:13): [True: 52.9k, False: 782]
  ------------------
 1361|  58.4k|}
UA_new:
 1921|  55.6k|UA_new(const UA_DataType *type) {
 1922|  55.6k|    void *p = UA_calloc(1, type->memSize);
  ------------------
  |  |   20|  55.6k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1923|  55.6k|    return p;
 1924|  55.6k|}
UA_copy:
 2097|  61.5k|UA_copy(const void *src, void *dst, const UA_DataType *type) {
 2098|  61.5k|    memset(dst, 0, type->memSize); /* init */
 2099|  61.5k|    UA_StatusCode retval = copyJumpTable[type->typeKind](src, dst, type);
 2100|  61.5k|    if(retval != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  61.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2100:8): [True: 0, False: 61.5k]
  ------------------
 2101|      0|        UA_clear(dst, type);
 2102|  61.5k|    return retval;
 2103|  61.5k|}
UA_clear:
 2200|  1.64M|UA_clear(void *p, const UA_DataType *type) {
 2201|  1.64M|    clearJumpTable[type->typeKind](p, type);
 2202|  1.64M|    memset(p, 0, type->memSize); /* init */
 2203|  1.64M|}
UA_order:
 2674|  79.7k|UA_Order UA_order(const void *p1, const void *p2, const UA_DataType *type) {
 2675|  79.7k|    return orderJumpTable[type->typeKind](p1, p2, type);
 2676|  79.7k|}
UA_equal:
 2679|  76.5k|UA_equal(const void *p1, const void *p2, const UA_DataType *type) {
 2680|  76.5k|    return (UA_order(p1, p2, type) == UA_ORDER_EQ);
 2681|  76.5k|}
UA_Array_copy:
 2698|  61.5k|              void **dst, const UA_DataType *type) {
 2699|  61.5k|    if(size == 0) {
  ------------------
  |  Branch (2699:8): [True: 13.2k, False: 48.3k]
  ------------------
 2700|  13.2k|        if(src == NULL)
  ------------------
  |  Branch (2700:12): [True: 0, False: 13.2k]
  ------------------
 2701|      0|            *dst = NULL;
 2702|  13.2k|        else
 2703|  13.2k|            *dst= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|  13.2k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2704|  13.2k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  13.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2705|  13.2k|    }
 2706|       |
 2707|       |    /* Check the array consistency -- defensive programming in case the user
 2708|       |     * manually created an inconsistent array */
 2709|  48.3k|    if(UA_UNLIKELY(!type || !src))
  ------------------
  |  |  580|  96.6k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (580:25): [True: 0, False: 48.3k]
  |  |  |  Branch (580:43): [True: 0, False: 48.3k]
  |  |  |  Branch (580:43): [True: 0, False: 48.3k]
  |  |  ------------------
  ------------------
 2710|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 2711|       |
 2712|       |    /* calloc, so we don't have to check retval in every iteration of copying */
 2713|  48.3k|    *dst = UA_calloc(size, type->memSize);
  ------------------
  |  |   20|  48.3k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2714|  48.3k|    if(!*dst)
  ------------------
  |  Branch (2714:8): [True: 0, False: 48.3k]
  ------------------
 2715|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2716|       |
 2717|  48.3k|    if(type->pointerFree) {
  ------------------
  |  Branch (2717:8): [True: 48.3k, False: 0]
  ------------------
 2718|  48.3k|        memcpy(*dst, src, type->memSize * size);
 2719|  48.3k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  48.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2720|  48.3k|    }
 2721|       |
 2722|      0|    uintptr_t ptrs = (uintptr_t)src;
 2723|      0|    uintptr_t ptrd = (uintptr_t)*dst;
 2724|      0|    UA_StatusCode retval = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2725|      0|    for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2725:23): [True: 0, False: 0]
  ------------------
 2726|      0|        retval |= UA_copy((void*)ptrs, (void*)ptrd, type);
 2727|      0|        ptrs += type->memSize;
 2728|      0|        ptrd += type->memSize;
 2729|      0|    }
 2730|      0|    if(retval != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2730:8): [True: 0, False: 0]
  ------------------
 2731|      0|        UA_Array_delete(*dst, size, type);
 2732|       |        *dst = NULL;
 2733|      0|    }
 2734|      0|    return retval;
 2735|  48.3k|}
UA_Array_delete:
 2826|  1.81M|UA_Array_delete(void *p, size_t size, const UA_DataType *type) {
 2827|  1.81M|    if(!type->pointerFree) {
  ------------------
  |  Branch (2827:8): [True: 55.8k, False: 1.76M]
  ------------------
 2828|  55.8k|        uintptr_t ptr = (uintptr_t)p;
 2829|  1.43M|        for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2829:27): [True: 1.38M, False: 55.8k]
  ------------------
 2830|  1.38M|            UA_clear((void*)ptr, type);
 2831|  1.38M|            ptr += type->memSize;
 2832|  1.38M|        }
 2833|  55.8k|    }
 2834|  1.81M|    UA_free((void*)((uintptr_t)p & ~(uintptr_t)UA_EMPTY_ARRAY_SENTINEL));
  ------------------
  |  |   19|  1.81M|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2835|  1.81M|}
ua_types.c:nodeIdSize:
  923|  79.2k|           UA_Escaping idEsc) {
  924|       |    /* Namespace length */
  925|  79.2k|    size_t len = 0;
  926|  79.2k|    if(nsUri.data != NULL) {
  ------------------
  |  Branch (926:8): [True: 2.59k, False: 76.6k]
  ------------------
  927|  2.59k|        len += 5; /* nsu=; */
  928|  2.59k|        len += UA_String_escapedSize(nsUri, UA_ESCAPING_PERCENT);
  929|  76.6k|    } else if(id->namespaceIndex > 0) {
  ------------------
  |  Branch (929:15): [True: 41.8k, False: 34.7k]
  ------------------
  930|  41.8k|        len += 4; /* ns=; */
  931|  41.8k|        size_t nsStrSize = itoaUnsigned(id->namespaceIndex, (char*)nsStr, 10);
  932|  41.8k|        nsStr[nsStrSize] = 0;
  933|  41.8k|        len += nsStrSize;
  934|  41.8k|    }
  935|       |
  936|  79.2k|    len += 2; /* ?= */
  937|       |
  938|  79.2k|    switch (id->identifierType) {
  939|  6.72k|    case UA_NODEIDTYPE_NUMERIC: {
  ------------------
  |  Branch (939:5): [True: 6.72k, False: 72.5k]
  ------------------
  940|  6.72k|        size_t numIdStrSize = itoaUnsigned(id->identifier.numeric, (char*)numIdStr, 10);
  941|  6.72k|        numIdStr[numIdStrSize] = 0;
  942|  6.72k|        len += numIdStrSize;
  943|  6.72k|        break;
  944|      0|    }
  945|  20.5k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (945:5): [True: 20.5k, False: 58.7k]
  ------------------
  946|  20.5k|        len += UA_String_escapedSize(id->identifier.string, idEsc);
  947|  20.5k|        break;
  948|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (948:5): [True: 0, False: 79.2k]
  ------------------
  949|      0|        len += 36;
  950|      0|        break;
  951|  52.0k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (951:5): [True: 52.0k, False: 27.2k]
  ------------------
  952|  52.0k|        len += 4 * ((id->identifier.byteString.length + 2) / 3);
  953|  52.0k|        break;
  954|      0|    default:
  ------------------
  |  Branch (954:5): [True: 0, False: 79.2k]
  ------------------
  955|      0|        len = 0;
  956|  79.2k|    }
  957|  79.2k|    return len;
  958|  79.2k|}
ua_types.c:printNodeIdBody:
  962|  79.2k|                const UA_NamespaceMapping *nsMapping, UA_Escaping idEsc) {
  963|  79.2k|    size_t len;
  964|       |
  965|       |    /* Encode the namespace */
  966|  79.2k|    if(nsUri.data != NULL) {
  ------------------
  |  Branch (966:8): [True: 2.59k, False: 76.6k]
  ------------------
  967|  2.59k|        memcpy(pos, "nsu=", 4);
  968|  2.59k|        pos += 4;
  969|  2.59k|        pos += UA_String_escapeInsert(pos, nsUri, UA_ESCAPING_PERCENT);
  970|  2.59k|        *pos++ = ';';
  971|  76.6k|    } else if(id->namespaceIndex > 0) {
  ------------------
  |  Branch (971:15): [True: 41.8k, False: 34.7k]
  ------------------
  972|  41.8k|        memcpy(pos, "ns=", 3);
  973|  41.8k|        pos += 3;
  974|  41.8k|        len = strlen((char*)nsStr);
  975|  41.8k|        memcpy(pos, nsStr, len);
  976|  41.8k|        pos += len;
  977|  41.8k|        *pos++ = ';';
  978|  41.8k|    }
  979|       |
  980|       |    /* Encode the identifier */
  981|  79.2k|    switch(id->identifierType) {
  ------------------
  |  Branch (981:12): [True: 79.2k, False: 0]
  ------------------
  982|  6.72k|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (982:5): [True: 6.72k, False: 72.5k]
  ------------------
  983|  6.72k|        memcpy(pos, "i=", 2);
  984|  6.72k|        pos += 2;
  985|  6.72k|        len = strlen((char*)numIdStr);
  986|  6.72k|        memcpy(pos, numIdStr, len);
  987|  6.72k|        pos += len;
  988|  6.72k|        break;
  989|  20.5k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (989:5): [True: 20.5k, False: 58.7k]
  ------------------
  990|  20.5k|        memcpy(pos, "s=", 2);
  991|  20.5k|        pos += 2;
  992|  20.5k|        pos += UA_String_escapeInsert(pos, id->identifier.string, idEsc);
  993|  20.5k|        break;
  994|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (994:5): [True: 0, False: 79.2k]
  ------------------
  995|      0|        memcpy(pos, "g=", 2);
  996|      0|        pos += 2;
  997|      0|        UA_Guid_to_hex(&id->identifier.guid, pos, true);
  998|      0|        pos += 36;
  999|      0|        break;
 1000|  52.0k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (1000:5): [True: 52.0k, False: 27.2k]
  ------------------
 1001|  52.0k|        memcpy(pos, "b=", 2);
 1002|  52.0k|        pos += 2;
 1003|       |        /* Use base64url encoding for percent-escaping.
 1004|       |         * Replace +/ with -_ and remove the padding. */
 1005|  52.0k|        u8 *bpos = pos;
 1006|  52.0k|        pos += UA_base64_buf(id->identifier.byteString.data,
 1007|  52.0k|                             id->identifier.byteString.length, pos);
 1008|  52.0k|        if(idEsc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (1008:12): [True: 0, False: 52.0k]
  ------------------
 1009|  52.0k|           idEsc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (1009:12): [True: 0, False: 52.0k]
  ------------------
 1010|      0|            while(pos > bpos && pos[-1] == '=')
  ------------------
  |  Branch (1010:19): [True: 0, False: 0]
  |  Branch (1010:33): [True: 0, False: 0]
  ------------------
 1011|      0|                pos--;
 1012|      0|            for(; bpos < pos; bpos++) {
  ------------------
  |  Branch (1012:19): [True: 0, False: 0]
  ------------------
 1013|      0|                if(*bpos == '+') *bpos = '-';
  ------------------
  |  Branch (1013:20): [True: 0, False: 0]
  ------------------
 1014|      0|                else if(*bpos == '/') *bpos = '_';
  ------------------
  |  Branch (1014:25): [True: 0, False: 0]
  ------------------
 1015|      0|            }
 1016|      0|        }
 1017|  52.0k|        break;
 1018|  79.2k|    }
 1019|  79.2k|    return pos;
 1020|  79.2k|}
ua_types.c:Variant_clear:
 1379|   452k|Variant_clear(void *p, const UA_DataType *_) {
 1380|   452k|    UA_Variant *v = (UA_Variant *)p;
 1381|       |
 1382|       |    /* The content is "borrowed" */
 1383|   452k|    if(v->storageType == UA_VARIANT_DATA_NODELETE)
  ------------------
  |  Branch (1383:8): [True: 0, False: 452k]
  ------------------
 1384|      0|        return;
 1385|       |
 1386|       |    /* Delete the value */
 1387|   452k|    if(v->type && v->data > UA_EMPTY_ARRAY_SENTINEL) {
  ------------------
  |  |  756|  61.7k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1387:8): [True: 61.7k, False: 390k]
  |  Branch (1387:19): [True: 60.3k, False: 1.39k]
  ------------------
 1388|  60.3k|        if(v->arrayLength == 0)
  ------------------
  |  Branch (1388:12): [True: 55.6k, False: 4.76k]
  ------------------
 1389|  55.6k|            v->arrayLength = 1;
 1390|  60.3k|        UA_Array_delete(v->data, v->arrayLength, v->type);
 1391|  60.3k|        v->data = NULL;
 1392|  60.3k|    }
 1393|       |
 1394|       |    /* Delete the array dimensions */
 1395|   452k|    if((void*)v->arrayDimensions > UA_EMPTY_ARRAY_SENTINEL)
  ------------------
  |  |  756|   452k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1395:8): [True: 58, False: 452k]
  ------------------
 1396|     58|        UA_free(v->arrayDimensions);
  ------------------
  |  |   19|     58|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1397|   452k|}
ua_types.c:DataValue_clear:
 1851|   274k|DataValue_clear(void *p, const UA_DataType *_) {
 1852|   274k|    UA_DataValue *dv = (UA_DataValue *)p;
 1853|       |    Variant_clear(&dv->value, NULL);
 1854|   274k|}
ua_types.c:String_copy:
  281|  61.5k|String_copy(const void *src, void *dst, const UA_DataType *_) {
  282|  61.5k|    const UA_String *srcS = (const UA_String*)src;
  283|  61.5k|    UA_String *dstS = (UA_String *)dst;
  284|  61.5k|    UA_StatusCode res =
  285|  61.5k|        UA_Array_copy(srcS->data, srcS->length, (void**)&dstS->data,
  286|  61.5k|                      &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|  61.5k|#define UA_TYPES_BYTE 2
  ------------------
  287|  61.5k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  61.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (287:8): [True: 61.5k, False: 0]
  ------------------
  288|  61.5k|        dstS->length = srcS->length;
  289|  61.5k|    return res;
  290|  61.5k|}
ua_types.c:String_clear:
  293|  1.75M|String_clear(void *p, const UA_DataType *_) {
  294|  1.75M|    UA_String *s = (UA_String*)p;
  295|  1.75M|    UA_Array_delete(s->data, s->length, &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|  1.75M|#define UA_TYPES_BYTE 2
  ------------------
  296|  1.75M|}
ua_types.c:NodeId_clear:
  772|   335k|NodeId_clear(void *p, const UA_DataType *_) {
  773|   335k|    UA_NodeId *id = (UA_NodeId*)p;
  774|   335k|    switch(id->identifierType) {
  775|  13.9k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (775:5): [True: 13.9k, False: 321k]
  ------------------
  776|  49.0k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (776:5): [True: 35.1k, False: 300k]
  ------------------
  777|  49.0k|        String_clear(&id->identifier.string, NULL);
  778|  49.0k|        break;
  779|   286k|    default: break;
  ------------------
  |  Branch (779:5): [True: 286k, False: 49.0k]
  ------------------
  780|   335k|    }
  781|   335k|}
ua_types.c:ExpandedNodeId_clear:
 1073|  31.3k|ExpandedNodeId_clear(void *p, const UA_DataType *_) {
 1074|  31.3k|    UA_ExpandedNodeId *id = (UA_ExpandedNodeId*)p;
 1075|  31.3k|    NodeId_clear(&id->nodeId, NULL);
 1076|       |    String_clear(&id->namespaceUri, NULL);
 1077|  31.3k|}
ua_types.c:QualifiedName_clear:
  397|  46.6k|QualifiedName_clear(void *p, const UA_DataType *_) {
  398|  46.6k|    UA_QualifiedName *qn = (UA_QualifiedName*)p;
  399|       |    String_clear(&qn->name, NULL);
  400|  46.6k|}
ua_types.c:LocalizedText_clear:
 1834|   552k|LocalizedText_clear(void *p, const UA_DataType *_) {
 1835|   552k|    UA_LocalizedText *lt = (UA_LocalizedText *)p;
 1836|   552k|    String_clear(&lt->locale, NULL);
 1837|       |    String_clear(&lt->text, NULL);
 1838|   552k|}
ua_types.c:ExtensionObject_clear:
 1246|   267k|ExtensionObject_clear(void *p, const UA_DataType *_) {
 1247|   267k|    UA_ExtensionObject *eo = (UA_ExtensionObject *)p;
 1248|   267k|    switch(eo->encoding) {
 1249|   267k|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (1249:5): [True: 267k, False: 16]
  ------------------
 1250|   267k|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (1250:5): [True: 0, False: 267k]
  ------------------
 1251|   267k|    case UA_EXTENSIONOBJECT_ENCODED_XML:
  ------------------
  |  Branch (1251:5): [True: 0, False: 267k]
  ------------------
 1252|   267k|    case UA_EXTENSIONOBJECT_ENCODED_JSON:
  ------------------
  |  Branch (1252:5): [True: 16, False: 267k]
  ------------------
 1253|   267k|        NodeId_clear(&eo->content.encoded.typeId, NULL);
 1254|   267k|        String_clear(&eo->content.encoded.body, NULL);
 1255|   267k|        break;
 1256|      0|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (1256:5): [True: 0, False: 267k]
  ------------------
 1257|      0|        if(eo->content.decoded.data)
  ------------------
  |  Branch (1257:12): [True: 0, False: 0]
  ------------------
 1258|      0|            UA_delete(eo->content.decoded.data, eo->content.decoded.type);
 1259|      0|        break;
 1260|      0|    default:
  ------------------
  |  Branch (1260:5): [True: 0, False: 267k]
  ------------------
 1261|      0|        break;
 1262|   267k|    }
 1263|   267k|}
ua_types.c:guidOrder:
 2259|  1.30k|guidOrder(const void *p1_, const void *p2_, const UA_DataType *type) {
 2260|  1.30k|    const UA_Guid *p1 = (const UA_Guid*)p1_;
 2261|  1.30k|    const UA_Guid *p2 = (const UA_Guid*)p2_;
 2262|  1.30k|    if(p1->data1 != p2->data1)
  ------------------
  |  Branch (2262:8): [True: 6, False: 1.30k]
  ------------------
 2263|      6|        return (p1->data1 < p2->data1) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2263:16): [True: 6, False: 0]
  ------------------
 2264|  1.30k|    if(p1->data2 != p2->data2)
  ------------------
  |  Branch (2264:8): [True: 0, False: 1.30k]
  ------------------
 2265|      0|        return (p1->data2 < p2->data2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2265:16): [True: 0, False: 0]
  ------------------
 2266|  1.30k|    if(p1->data3 != p2->data3)
  ------------------
  |  Branch (2266:8): [True: 0, False: 1.30k]
  ------------------
 2267|      0|        return (p1->data3 < p2->data3) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2267:16): [True: 0, False: 0]
  ------------------
 2268|  1.30k|    int cmp = memcmp(p1->data4, p2->data4, 8);
 2269|  1.30k|    if(cmp != 0)
  ------------------
  |  Branch (2269:8): [True: 0, False: 1.30k]
  ------------------
 2270|      0|        return (cmp < 0) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2270:16): [True: 0, False: 0]
  ------------------
 2271|  1.30k|    return UA_ORDER_EQ;
 2272|  1.30k|}
ua_types.c:nodeIdOrder:
 2292|   110k|nodeIdOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2293|   110k|    const UA_NodeId *p1 = (const UA_NodeId*)p1_;
 2294|   110k|    const UA_NodeId *p2 = (const UA_NodeId*)p2_;
 2295|       |    /* Compare namespaceIndex */
 2296|   110k|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2296:8): [True: 41.8k, False: 68.2k]
  ------------------
 2297|  41.8k|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2297:16): [True: 41.8k, False: 0]
  ------------------
 2298|       |
 2299|       |    /* Compare identifierType */
 2300|  68.2k|    if(p1->identifierType != p2->identifierType)
  ------------------
  |  Branch (2300:8): [True: 13.0k, False: 55.1k]
  ------------------
 2301|  13.0k|        return (p1->identifierType < p2->identifierType) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2301:16): [True: 13.0k, False: 0]
  ------------------
 2302|       |
 2303|       |    /* Compare the identifier */
 2304|  55.1k|    switch(p1->identifierType) {
 2305|  30.9k|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (2305:5): [True: 30.9k, False: 24.1k]
  ------------------
 2306|  30.9k|    default:
  ------------------
  |  Branch (2306:5): [True: 0, False: 55.1k]
  ------------------
 2307|  30.9k|        if(p1->identifier.numeric != p2->identifier.numeric)
  ------------------
  |  Branch (2307:12): [True: 1.56k, False: 29.4k]
  ------------------
 2308|  1.56k|            return (p1->identifier.numeric < p2->identifier.numeric) ?
  ------------------
  |  Branch (2308:20): [True: 15, False: 1.55k]
  ------------------
 2309|  1.55k|                UA_ORDER_LESS : UA_ORDER_MORE;
 2310|  29.4k|        return UA_ORDER_EQ;
 2311|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (2311:5): [True: 0, False: 55.1k]
  ------------------
 2312|      0|        return guidOrder(&p1->identifier.guid, &p2->identifier.guid, NULL);
 2313|  6.84k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (2313:5): [True: 6.84k, False: 48.3k]
  ------------------
 2314|  24.1k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (2314:5): [True: 17.3k, False: 37.8k]
  ------------------
 2315|       |        return stringOrder(&p1->identifier.string, &p2->identifier.string, NULL);
 2316|  55.1k|    }
 2317|  55.1k|}
ua_types.c:expandedNodeIdOrder:
 2320|  39.0k|expandedNodeIdOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2321|  39.0k|    const UA_ExpandedNodeId *p1 = (const UA_ExpandedNodeId*)p1_;
 2322|  39.0k|    const UA_ExpandedNodeId *p2 = (const UA_ExpandedNodeId*)p2_;
 2323|  39.0k|    if(p1->serverIndex != p2->serverIndex)
  ------------------
  |  Branch (2323:8): [True: 2.00k, False: 37.0k]
  ------------------
 2324|  2.00k|        return (p1->serverIndex < p2->serverIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2324:16): [True: 2.00k, False: 0]
  ------------------
 2325|  37.0k|    UA_Order o = stringOrder(&p1->namespaceUri, &p2->namespaceUri, NULL);
 2326|  37.0k|    if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2326:8): [True: 2.59k, False: 34.4k]
  ------------------
 2327|  2.59k|        return o;
 2328|  34.4k|    return nodeIdOrder(&p1->nodeId, &p2->nodeId, NULL);
 2329|  37.0k|}
ua_types.c:booleanOrder:
 2217|     11|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2218|     11|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2219|     11|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2220|     11|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2220:12): [True: 0, False: 11]
  ------------------
 2221|     11|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2221:20): [True: 0, False: 0]
  ------------------
 2222|     11|        return UA_ORDER_EQ;                                               \
 2223|     11|    }
ua_types.c:sByteOrder:
 2217|  71.6k|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2218|  71.6k|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2219|  71.6k|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2220|  71.6k|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2220:12): [True: 0, False: 71.6k]
  ------------------
 2221|  71.6k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2221:20): [True: 0, False: 0]
  ------------------
 2222|  71.6k|        return UA_ORDER_EQ;                                               \
 2223|  71.6k|    }
ua_types.c:byteOrder:
 2217|  5.41k|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2218|  5.41k|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2219|  5.41k|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2220|  5.41k|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2220:12): [True: 0, False: 5.41k]
  ------------------
 2221|  5.41k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2221:20): [True: 0, False: 0]
  ------------------
 2222|  5.41k|        return UA_ORDER_EQ;                                               \
 2223|  5.41k|    }
ua_types.c:int16Order:
 2217|  2.52k|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2218|  2.52k|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2219|  2.52k|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2220|  2.52k|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2220:12): [True: 0, False: 2.52k]
  ------------------
 2221|  2.52k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2221:20): [True: 0, False: 0]
  ------------------
 2222|  2.52k|        return UA_ORDER_EQ;                                               \
 2223|  2.52k|    }
ua_types.c:uInt16Order:
 2217|  25.6k|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2218|  25.6k|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2219|  25.6k|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2220|  25.6k|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2220:12): [True: 0, False: 25.6k]
  ------------------
 2221|  25.6k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2221:20): [True: 0, False: 0]
  ------------------
 2222|  25.6k|        return UA_ORDER_EQ;                                               \
 2223|  25.6k|    }
ua_types.c:int32Order:
 2217|  1.59M|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2218|  1.59M|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2219|  1.59M|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2220|  1.59M|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2220:12): [True: 0, False: 1.59M]
  ------------------
 2221|  1.59M|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2221:20): [True: 0, False: 0]
  ------------------
 2222|  1.59M|        return UA_ORDER_EQ;                                               \
 2223|  1.59M|    }
ua_types.c:uInt32Order:
 2217|  1.36k|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2218|  1.36k|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2219|  1.36k|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2220|  1.36k|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2220:12): [True: 0, False: 1.36k]
  ------------------
 2221|  1.36k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2221:20): [True: 0, False: 0]
  ------------------
 2222|  1.36k|        return UA_ORDER_EQ;                                               \
 2223|  1.36k|    }
ua_types.c:int64Order:
 2217|  1.11M|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2218|  1.11M|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2219|  1.11M|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2220|  1.11M|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2220:12): [True: 0, False: 1.11M]
  ------------------
 2221|  1.11M|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2221:20): [True: 0, False: 0]
  ------------------
 2222|  1.11M|        return UA_ORDER_EQ;                                               \
 2223|  1.11M|    }
ua_types.c:uInt64Order:
 2217|  2.35M|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2218|  2.35M|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2219|  2.35M|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2220|  2.35M|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2220:12): [True: 0, False: 2.35M]
  ------------------
 2221|  2.35M|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2221:20): [True: 0, False: 0]
  ------------------
 2222|  2.35M|        return UA_ORDER_EQ;                                               \
 2223|  2.35M|    }
ua_types.c:floatOrder:
 2237|  94.5k|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2238|  94.5k|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2239|  94.5k|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2240|  94.5k|        if(*p1 != *p2) {                                                  \
  ------------------
  |  Branch (2240:12): [True: 747, False: 93.8k]
  ------------------
 2241|    747|            /* p1 is NaN */                                         \
 2242|    747|            if(*p1 != *p1) {                                        \
  ------------------
  |  Branch (2242:16): [True: 747, False: 0]
  ------------------
 2243|    747|                if(*p2 != *p2)                                      \
  ------------------
  |  Branch (2243:20): [True: 747, False: 0]
  ------------------
 2244|    747|                    return UA_ORDER_EQ;                             \
 2245|    747|                return UA_ORDER_LESS;                               \
 2246|    747|            }                                                       \
 2247|    747|            /* p2 is NaN */                                         \
 2248|    747|            if(*p2 != *p2)                                          \
  ------------------
  |  Branch (2248:16): [True: 0, False: 0]
  ------------------
 2249|      0|                return UA_ORDER_MORE;                               \
 2250|      0|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2250:20): [True: 0, False: 0]
  ------------------
 2251|      0|        }                                                           \
 2252|  94.5k|        return UA_ORDER_EQ;                                         \
 2253|  94.5k|    }
ua_types.c:doubleOrder:
 2237|   485k|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2238|   485k|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2239|   485k|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2240|   485k|        if(*p1 != *p2) {                                                  \
  ------------------
  |  Branch (2240:12): [True: 268, False: 484k]
  ------------------
 2241|    268|            /* p1 is NaN */                                         \
 2242|    268|            if(*p1 != *p1) {                                        \
  ------------------
  |  Branch (2242:16): [True: 268, False: 0]
  ------------------
 2243|    268|                if(*p2 != *p2)                                      \
  ------------------
  |  Branch (2243:20): [True: 268, False: 0]
  ------------------
 2244|    268|                    return UA_ORDER_EQ;                             \
 2245|    268|                return UA_ORDER_LESS;                               \
 2246|    268|            }                                                       \
 2247|    268|            /* p2 is NaN */                                         \
 2248|    268|            if(*p2 != *p2)                                          \
  ------------------
  |  Branch (2248:16): [True: 0, False: 0]
  ------------------
 2249|      0|                return UA_ORDER_MORE;                               \
 2250|      0|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2250:20): [True: 0, False: 0]
  ------------------
 2251|      0|        }                                                           \
 2252|   485k|        return UA_ORDER_EQ;                                         \
 2253|   485k|    }
ua_types.c:stringOrder:
 2275|   647k|stringOrder(const void *p1_, const void *p2_, const UA_DataType *type) {
 2276|   647k|    const UA_String *p1 = (const UA_String*)p1_;
 2277|   647k|    const UA_String *p2 = (const UA_String*)p2_;
 2278|   647k|    if(p1->length != p2->length)
  ------------------
  |  Branch (2278:8): [True: 9.07k, False: 637k]
  ------------------
 2279|  9.07k|        return (p1->length < p2->length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2279:16): [True: 9.07k, False: 0]
  ------------------
 2280|       |    /* For zero-length arrays, every pointer not NULL is considered a
 2281|       |     * UA_EMPTY_ARRAY_SENTINEL. */
 2282|   637k|    if(p1->data == p2->data) return UA_ORDER_EQ;
  ------------------
  |  Branch (2282:8): [True: 611k, False: 26.8k]
  ------------------
 2283|  26.8k|    if(p1->data == NULL) return UA_ORDER_LESS;
  ------------------
  |  Branch (2283:8): [True: 234, False: 26.5k]
  ------------------
 2284|  26.5k|    if(p2->data == NULL) return UA_ORDER_MORE;
  ------------------
  |  Branch (2284:8): [True: 0, False: 26.5k]
  ------------------
 2285|  26.5k|    int cmp = memcmp((const char*)p1->data, (const char*)p2->data, p1->length);
 2286|  26.5k|    if(cmp != 0)
  ------------------
  |  Branch (2286:8): [True: 0, False: 26.5k]
  ------------------
 2287|      0|        return (cmp < 0) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2287:16): [True: 0, False: 0]
  ------------------
 2288|  26.5k|    return UA_ORDER_EQ;
 2289|  26.5k|}
ua_types.c:qualifiedNameOrder:
 2332|  27.4k|qualifiedNameOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2333|  27.4k|    const UA_QualifiedName *p1 = (const UA_QualifiedName*)p1_;
 2334|  27.4k|    const UA_QualifiedName *p2 = (const UA_QualifiedName*)p2_;
 2335|  27.4k|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2335:8): [True: 108, False: 27.3k]
  ------------------
 2336|    108|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2336:16): [True: 108, False: 0]
  ------------------
 2337|  27.3k|    return stringOrder(&p1->name, &p2->name, NULL);
 2338|  27.4k|}
ua_types.c:localizedTextOrder:
 2341|   276k|localizedTextOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2342|   276k|    const UA_LocalizedText *p1 = (const UA_LocalizedText*)p1_;
 2343|   276k|    const UA_LocalizedText *p2 = (const UA_LocalizedText*)p2_;
 2344|   276k|    UA_Order o = stringOrder(&p1->locale, &p2->locale, NULL);
 2345|   276k|    if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2345:8): [True: 0, False: 276k]
  ------------------
 2346|      0|        return o;
 2347|   276k|    return stringOrder(&p1->text, &p2->text, NULL);
 2348|   276k|}
ua_types.c:extensionObjectOrder:
 2351|   133k|extensionObjectOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2352|   133k|    const UA_ExtensionObject *p1 = (const UA_ExtensionObject*)p1_;
 2353|   133k|    const UA_ExtensionObject *p2 = (const UA_ExtensionObject*)p2_;
 2354|   133k|    UA_ExtensionObjectEncoding enc1 = p1->encoding;
 2355|   133k|    UA_ExtensionObjectEncoding enc2 = p2->encoding;
 2356|   133k|    if(enc1 == UA_EXTENSIONOBJECT_DECODED_NODELETE)
  ------------------
  |  Branch (2356:8): [True: 0, False: 133k]
  ------------------
 2357|      0|        enc1 = UA_EXTENSIONOBJECT_DECODED;
 2358|   133k|    if(enc2 == UA_EXTENSIONOBJECT_DECODED_NODELETE)
  ------------------
  |  Branch (2358:8): [True: 0, False: 133k]
  ------------------
 2359|      0|        enc2 = UA_EXTENSIONOBJECT_DECODED;
 2360|   133k|    if(enc1 != enc2)
  ------------------
  |  Branch (2360:8): [True: 0, False: 133k]
  ------------------
 2361|      0|        return (enc1 < enc2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2361:16): [True: 0, False: 0]
  ------------------
 2362|       |
 2363|   133k|    switch(enc1) {
 2364|   133k|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (2364:5): [True: 133k, False: 7]
  ------------------
 2365|   133k|        return UA_ORDER_EQ;
 2366|       |
 2367|      0|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (2367:5): [True: 0, False: 133k]
  ------------------
 2368|      0|    case UA_EXTENSIONOBJECT_ENCODED_XML:
  ------------------
  |  Branch (2368:5): [True: 0, False: 133k]
  ------------------
 2369|      7|    case UA_EXTENSIONOBJECT_ENCODED_JSON: {
  ------------------
  |  Branch (2369:5): [True: 7, False: 133k]
  ------------------
 2370|      7|            UA_Order o = nodeIdOrder(&p1->content.encoded.typeId,
 2371|      7|                                     &p2->content.encoded.typeId, NULL);
 2372|      7|            if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2372:16): [True: 0, False: 7]
  ------------------
 2373|      0|                return o;
 2374|      7|            return stringOrder((const UA_String*)&p1->content.encoded.body,
 2375|      7|                               (const UA_String*)&p2->content.encoded.body, NULL);
 2376|      7|        }
 2377|       |
 2378|      0|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (2378:5): [True: 0, False: 133k]
  ------------------
 2379|      0|    default: {
  ------------------
  |  Branch (2379:5): [True: 0, False: 133k]
  ------------------
 2380|      0|            const UA_DataType *type1 = p1->content.decoded.type;
 2381|      0|            const UA_DataType *type2 = p2->content.decoded.type;
 2382|      0|            if(type1 != type2)
  ------------------
  |  Branch (2382:16): [True: 0, False: 0]
  ------------------
 2383|      0|                return ((uintptr_t)type1 < (uintptr_t)type2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2383:24): [True: 0, False: 0]
  ------------------
 2384|      0|            if(!type1)
  ------------------
  |  Branch (2384:16): [True: 0, False: 0]
  ------------------
 2385|      0|                return UA_ORDER_EQ;
 2386|      0|            return orderJumpTable[type1->typeKind]
 2387|      0|                (p1->content.decoded.data, p2->content.decoded.data, type1);
 2388|      0|        }
 2389|   133k|    }
 2390|   133k|}
ua_types.c:dataValueOrder:
 2454|   135k|dataValueOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2455|   135k|    const UA_DataValue *p1 = (const UA_DataValue*)p1_;
 2456|   135k|    const UA_DataValue *p2 = (const UA_DataValue*)p2_;
 2457|       |    /* Value */
 2458|   135k|    if(p1->hasValue != p2->hasValue)
  ------------------
  |  Branch (2458:8): [True: 21, False: 135k]
  ------------------
 2459|     21|        return (!p1->hasValue) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2459:16): [True: 21, False: 0]
  ------------------
 2460|   135k|    if(p1->hasValue) {
  ------------------
  |  Branch (2460:8): [True: 3.24k, False: 132k]
  ------------------
 2461|  3.24k|        UA_Order o = variantOrder(&p1->value, &p2->value, NULL);
 2462|  3.24k|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2462:12): [True: 0, False: 3.24k]
  ------------------
 2463|      0|            return o;
 2464|  3.24k|    }
 2465|       |
 2466|       |    /* Status */
 2467|   135k|    if(p1->hasStatus != p2->hasStatus)
  ------------------
  |  Branch (2467:8): [True: 0, False: 135k]
  ------------------
 2468|      0|        return (!p1->hasStatus) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2468:16): [True: 0, False: 0]
  ------------------
 2469|   135k|    if(p1->hasStatus && p1->status != p2->status)
  ------------------
  |  Branch (2469:8): [True: 0, False: 135k]
  |  Branch (2469:25): [True: 0, False: 0]
  ------------------
 2470|      0|        return (p1->status < p2->status) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2470:16): [True: 0, False: 0]
  ------------------
 2471|       |
 2472|       |    /* SourceTimestamp */
 2473|   135k|    if(p1->hasSourceTimestamp != p2->hasSourceTimestamp)
  ------------------
  |  Branch (2473:8): [True: 0, False: 135k]
  ------------------
 2474|      0|        return (!p1->hasSourceTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2474:16): [True: 0, False: 0]
  ------------------
 2475|   135k|    if(p1->hasSourceTimestamp && p1->sourceTimestamp != p2->sourceTimestamp)
  ------------------
  |  Branch (2475:8): [True: 0, False: 135k]
  |  Branch (2475:34): [True: 0, False: 0]
  ------------------
 2476|      0|        return (p1->sourceTimestamp < p2->sourceTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2476:16): [True: 0, False: 0]
  ------------------
 2477|       |
 2478|       |    /* ServerTimestamp */
 2479|   135k|    if(p1->hasServerTimestamp != p2->hasServerTimestamp)
  ------------------
  |  Branch (2479:8): [True: 0, False: 135k]
  ------------------
 2480|      0|        return (!p1->hasServerTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2480:16): [True: 0, False: 0]
  ------------------
 2481|   135k|    if(p1->hasServerTimestamp && p1->serverTimestamp != p2->serverTimestamp)
  ------------------
  |  Branch (2481:8): [True: 0, False: 135k]
  |  Branch (2481:34): [True: 0, False: 0]
  ------------------
 2482|      0|        return (p1->serverTimestamp < p2->serverTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2482:16): [True: 0, False: 0]
  ------------------
 2483|       |
 2484|       |    /* SourcePicoseconds */
 2485|   135k|    if(p1->hasSourcePicoseconds != p2->hasSourcePicoseconds)
  ------------------
  |  Branch (2485:8): [True: 0, False: 135k]
  ------------------
 2486|      0|        return (!p1->hasSourcePicoseconds) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2486:16): [True: 0, False: 0]
  ------------------
 2487|   135k|    if(p1->hasSourcePicoseconds && p1->sourcePicoseconds != p2->sourcePicoseconds)
  ------------------
  |  Branch (2487:8): [True: 0, False: 135k]
  |  Branch (2487:36): [True: 0, False: 0]
  ------------------
 2488|      0|        return (p1->sourcePicoseconds < p2->sourcePicoseconds) ?
  ------------------
  |  Branch (2488:16): [True: 0, False: 0]
  ------------------
 2489|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2490|       |
 2491|       |    /* ServerPicoseconds */
 2492|   135k|    if(p1->hasServerPicoseconds != p2->hasServerPicoseconds)
  ------------------
  |  Branch (2492:8): [True: 0, False: 135k]
  ------------------
 2493|      0|        return (!p1->hasServerPicoseconds) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2493:16): [True: 0, False: 0]
  ------------------
 2494|   135k|    if(p1->hasServerPicoseconds && p1->serverPicoseconds != p2->serverPicoseconds)
  ------------------
  |  Branch (2494:8): [True: 0, False: 135k]
  |  Branch (2494:36): [True: 0, False: 0]
  ------------------
 2495|      0|        return (p1->serverPicoseconds < p2->serverPicoseconds) ?
  ------------------
  |  Branch (2495:16): [True: 0, False: 0]
  ------------------
 2496|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2497|       |
 2498|   135k|    return UA_ORDER_EQ;
 2499|   135k|}
ua_types.c:variantOrder:
 2417|  88.5k|variantOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2418|  88.5k|    const UA_Variant *p1 = (const UA_Variant*)p1_;
 2419|  88.5k|    const UA_Variant *p2 = (const UA_Variant*)p2_;
 2420|  88.5k|    if(p1->type != p2->type)
  ------------------
  |  Branch (2420:8): [True: 0, False: 88.5k]
  ------------------
 2421|      0|        return ((uintptr_t)p1->type < (uintptr_t)p2->type) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2421:16): [True: 0, False: 0]
  ------------------
 2422|       |
 2423|  88.5k|    UA_Order o;
 2424|  88.5k|    if(p1->type != NULL) {
  ------------------
  |  Branch (2424:8): [True: 29.2k, False: 59.3k]
  ------------------
 2425|       |        /* Check if both variants are scalars or arrays */
 2426|  29.2k|        UA_Boolean s1 = UA_Variant_isScalar(p1);
 2427|  29.2k|        UA_Boolean s2 = UA_Variant_isScalar(p2);
 2428|  29.2k|        if(s1 != s2)
  ------------------
  |  Branch (2428:12): [True: 0, False: 29.2k]
  ------------------
 2429|      0|            return s1 ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2429:20): [True: 0, False: 0]
  ------------------
 2430|  29.2k|        if(s1) {
  ------------------
  |  Branch (2430:12): [True: 26.4k, False: 2.75k]
  ------------------
 2431|  26.4k|            o = orderJumpTable[p1->type->typeKind](p1->data, p2->data, p1->type);
 2432|  26.4k|        } else {
 2433|       |            /* Mismatching array length? */
 2434|  2.75k|            if(p1->arrayLength != p2->arrayLength)
  ------------------
  |  Branch (2434:16): [True: 0, False: 2.75k]
  ------------------
 2435|      0|                return (p1->arrayLength < p2->arrayLength) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2435:24): [True: 0, False: 0]
  ------------------
 2436|  2.75k|            o = arrayOrder(p1->data, p1->arrayLength, p2->data, p2->arrayLength, p1->type);
 2437|  2.75k|        }
 2438|  29.2k|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2438:12): [True: 0, False: 29.2k]
  ------------------
 2439|      0|            return o;
 2440|  29.2k|    }
 2441|       |
 2442|  88.5k|    if(p1->arrayDimensionsSize != p2->arrayDimensionsSize)
  ------------------
  |  Branch (2442:8): [True: 0, False: 88.5k]
  ------------------
 2443|      0|        return (p1->arrayDimensionsSize < p2->arrayDimensionsSize) ?
  ------------------
  |  Branch (2443:16): [True: 0, False: 0]
  ------------------
 2444|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2445|  88.5k|    o = UA_ORDER_EQ;
 2446|  88.5k|    if(p1->arrayDimensionsSize > 0)
  ------------------
  |  Branch (2446:8): [True: 0, False: 88.5k]
  ------------------
 2447|      0|        o = arrayOrder(p1->arrayDimensions, p1->arrayDimensionsSize,
 2448|      0|                       p2->arrayDimensions, p2->arrayDimensionsSize,
 2449|      0|                       &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  225|      0|#define UA_TYPES_UINT32 6
  ------------------
 2450|  88.5k|    return o;
 2451|  88.5k|}
ua_types.c:arrayOrder:
 2401|  2.75k|           const UA_DataType *type) {
 2402|  2.75k|    if(p1Length != p2Length)
  ------------------
  |  Branch (2402:8): [True: 0, False: 2.75k]
  ------------------
 2403|      0|        return (p1Length < p2Length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2403:16): [True: 0, False: 0]
  ------------------
 2404|  2.75k|    uintptr_t u1 = (uintptr_t)p1;
 2405|  2.75k|    uintptr_t u2 = (uintptr_t)p2;
 2406|  6.41M|    for(size_t i = 0; i < p1Length; i++) {
  ------------------
  |  Branch (2406:23): [True: 6.41M, False: 2.75k]
  ------------------
 2407|  6.41M|        UA_Order o = orderJumpTable[type->typeKind]((const void*)u1, (const void*)u2, type);
 2408|  6.41M|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2408:12): [True: 0, False: 6.41M]
  ------------------
 2409|      0|            return o;
 2410|  6.41M|        u1 += type->memSize;
 2411|  6.41M|        u2 += type->memSize;
 2412|  6.41M|    }
 2413|  2.75k|    return UA_ORDER_EQ;
 2414|  2.75k|}

writeJsonBeforeElement:
   95|  19.3M|writeJsonBeforeElement(CtxJson *ctx, UA_Boolean distinct) {
   96|  19.3M|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  19.3M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   97|       |    /* Comma if needed */
   98|  19.3M|    if(ctx->commaNeeded[ctx->depth])
  ------------------
  |  Branch (98:8): [True: 19.3M, False: 94.8k]
  ------------------
   99|  19.3M|        res |= writeChar(ctx, ',');
  100|  19.3M|    if(ctx->prettyPrint) {
  ------------------
  |  Branch (100:8): [True: 0, False: 19.3M]
  ------------------
  101|      0|        if(distinct) {
  ------------------
  |  Branch (101:12): [True: 0, False: 0]
  ------------------
  102|       |            /* Newline and indent if needed */
  103|      0|            res |= writeChar(ctx, '\n');
  104|      0|            for(size_t i = 0; i < ctx->depth; i++)
  ------------------
  |  Branch (104:31): [True: 0, False: 0]
  ------------------
  105|      0|                res |= writeChar(ctx, '\t');
  106|      0|        } else if(ctx->commaNeeded[ctx->depth]) {
  ------------------
  |  Branch (106:19): [True: 0, False: 0]
  ------------------
  107|       |            /* Space after the comma if no newline */
  108|      0|            res |= writeChar(ctx, ' ');
  109|      0|        }
  110|      0|    }
  111|  19.3M|    return res;
  112|  19.3M|}
writeJsonObjStart:
  114|  1.49M|WRITE_JSON_ELEMENT(ObjStart) {
  115|       |    /* Increase depth, save: before first key-value no comma needed. */
  116|  1.49M|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION)
  ------------------
  |  |   22|  1.49M|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (116:8): [True: 0, False: 1.49M]
  ------------------
  117|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  118|  1.49M|    ctx->depth++;
  119|       |    ctx->commaNeeded[ctx->depth] = false;
  120|  1.49M|    return writeChar(ctx, '{');
  121|  1.49M|}
writeJsonObjEnd:
  123|  1.49M|WRITE_JSON_ELEMENT(ObjEnd) {
  124|  1.49M|    if(ctx->depth == 0)
  ------------------
  |  Branch (124:8): [True: 0, False: 1.49M]
  ------------------
  125|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  126|       |
  127|  1.49M|    UA_Boolean have_elem = ctx->commaNeeded[ctx->depth];
  128|  1.49M|    ctx->depth--;
  129|  1.49M|    ctx->commaNeeded[ctx->depth] = true;
  130|       |
  131|  1.49M|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.49M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  132|  1.49M|    if(ctx->prettyPrint && have_elem) {
  ------------------
  |  Branch (132:8): [True: 0, False: 1.49M]
  |  Branch (132:28): [True: 0, False: 0]
  ------------------
  133|      0|        res |= writeChar(ctx, '\n');
  134|      0|        for(size_t i = 0; i < ctx->depth; i++)
  ------------------
  |  Branch (134:27): [True: 0, False: 0]
  ------------------
  135|      0|            res |= writeChar(ctx, '\t');
  136|      0|    }
  137|  1.49M|    return res | writeChar(ctx, '}');
  138|  1.49M|}
writeJsonArrStart:
  140|  8.25k|WRITE_JSON_ELEMENT(ArrStart) {
  141|       |    /* Increase depth, save: before first array entry no comma needed. */
  142|  8.25k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION)
  ------------------
  |  |   22|  8.25k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (142:8): [True: 0, False: 8.25k]
  ------------------
  143|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  144|  8.25k|    ctx->depth++;
  145|       |    ctx->commaNeeded[ctx->depth] = false;
  146|  8.25k|    return writeChar(ctx, '[');
  147|  8.25k|}
writeJsonArrEnd:
  150|  8.25k|writeJsonArrEnd(CtxJson *ctx, const UA_DataType *type) {
  151|  8.25k|    if(ctx->depth == 0)
  ------------------
  |  Branch (151:8): [True: 0, False: 8.25k]
  ------------------
  152|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  153|  8.25k|    UA_Boolean have_elem = ctx->commaNeeded[ctx->depth];
  154|  8.25k|    ctx->depth--;
  155|  8.25k|    ctx->commaNeeded[ctx->depth] = true;
  156|       |
  157|       |    /* If the array does not contain JSON objects (with a newline after), then
  158|       |     * add the closing ] on the same line */
  159|  8.25k|    UA_Boolean distinct = (!type || type->typeKind > UA_DATATYPEKIND_DOUBLE);
  ------------------
  |  Branch (159:28): [True: 0, False: 8.25k]
  |  Branch (159:37): [True: 4.98k, False: 3.26k]
  ------------------
  160|  8.25k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  8.25k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  161|  8.25k|    if(ctx->prettyPrint && have_elem && distinct) {
  ------------------
  |  Branch (161:8): [True: 0, False: 8.25k]
  |  Branch (161:28): [True: 0, False: 0]
  |  Branch (161:41): [True: 0, False: 0]
  ------------------
  162|      0|        res |= writeChar(ctx, '\n');
  163|      0|        for(size_t i = 0; i < ctx->depth; i++)
  ------------------
  |  Branch (163:27): [True: 0, False: 0]
  ------------------
  164|      0|            res |= writeChar(ctx, '\t');
  165|      0|    }
  166|  8.25k|    return res | writeChar(ctx, ']');
  167|  8.25k|}
writeJsonArrElm:
  171|  19.2M|                const UA_DataType *type) {
  172|  19.2M|    UA_Boolean distinct = (type->typeKind > UA_DATATYPEKIND_DOUBLE);
  173|  19.2M|    status ret = writeJsonBeforeElement(ctx, distinct);
  174|       |    ctx->commaNeeded[ctx->depth] = true;
  175|  19.2M|    return ret | encodeJsonJumpTable[type->typeKind](ctx, value, type);
  176|  19.2M|}
writeJsonKey:
  225|   154k|writeJsonKey(CtxJson *ctx, const char* key) {
  226|   154k|    status ret = writeJsonBeforeElement(ctx, true);
  227|   154k|    ctx->commaNeeded[ctx->depth] = true;
  228|   154k|    if(!ctx->unquotedKeys)
  ------------------
  |  Branch (228:8): [True: 154k, False: 0]
  ------------------
  229|   154k|        ret |= writeChar(ctx, '\"');
  230|   154k|    ret |= writeChars(ctx, key, strlen(key));
  231|   154k|    if(!ctx->unquotedKeys)
  ------------------
  |  Branch (231:8): [True: 154k, False: 0]
  ------------------
  232|   154k|        ret |= writeChar(ctx, '\"');
  233|   154k|    ret |= writeChar(ctx, ':');
  234|   154k|    if(ctx->prettyPrint)
  ------------------
  |  Branch (234:8): [True: 0, False: 154k]
  ------------------
  235|      0|        ret |= writeChar(ctx, ' ');
  236|   154k|    return ret;
  237|   154k|}
UA_encodeJson:
 1185|  6.50k|              const UA_EncodeJsonOptions *options) {
 1186|  6.50k|    if(!src || !type)
  ------------------
  |  Branch (1186:8): [True: 0, False: 6.50k]
  |  Branch (1186:16): [True: 0, False: 6.50k]
  ------------------
 1187|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 1188|       |
 1189|       |    /* Allocate buffer */
 1190|  6.50k|    UA_Boolean allocated = false;
 1191|  6.50k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  6.50k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1192|  6.50k|    if(outBuf->length == 0) {
  ------------------
  |  Branch (1192:8): [True: 0, False: 6.50k]
  ------------------
 1193|      0|        size_t len = UA_calcSizeJson(src, type, options);
 1194|      0|        res = UA_ByteString_allocBuffer(outBuf, len);
 1195|      0|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1195:12): [True: 0, False: 0]
  ------------------
 1196|      0|            return res;
 1197|      0|        allocated = true;
 1198|      0|    }
 1199|       |
 1200|       |    /* Set up the context */
 1201|  6.50k|    CtxJson ctx;
 1202|  6.50k|    memset(&ctx, 0, sizeof(ctx));
 1203|  6.50k|    ctx.pos = outBuf->data;
 1204|  6.50k|    ctx.end = &outBuf->data[outBuf->length];
 1205|  6.50k|    ctx.depth = 0;
 1206|  6.50k|    ctx.calcOnly = false;
 1207|  6.50k|    if(options) {
  ------------------
  |  Branch (1207:8): [True: 0, False: 6.50k]
  ------------------
 1208|      0|        ctx.namespaceMapping = options->namespaceMapping;
 1209|      0|        ctx.serverUris = options->serverUris;
 1210|      0|        ctx.serverUrisSize = options->serverUrisSize;
 1211|      0|        ctx.useCompactEncoding = options->useCompactEncoding;
 1212|      0|        ctx.prettyPrint = options->prettyPrint;
 1213|      0|        ctx.unquotedKeys = options->unquotedKeys;
 1214|      0|    }
 1215|       |
 1216|       |    /* Encode */
 1217|  6.50k|    res = encodeJsonJumpTable[type->typeKind](&ctx, src, type);
 1218|       |
 1219|       |    /* Clean up */
 1220|  6.50k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  6.50k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1220:8): [True: 6.50k, False: 0]
  ------------------
 1221|  6.50k|        outBuf->length = (size_t)((uintptr_t)ctx.pos - (uintptr_t)outBuf->data);
 1222|      0|    else if(allocated)
  ------------------
  |  Branch (1222:13): [True: 0, False: 0]
  ------------------
 1223|      0|        UA_ByteString_clear(outBuf);
 1224|  6.50k|    return res;
 1225|  6.50k|}
UA_calcSizeJson:
 1248|  3.25k|                const UA_EncodeJsonOptions *options) {
 1249|  3.25k|    if(!src || !type)
  ------------------
  |  Branch (1249:8): [True: 0, False: 3.25k]
  |  Branch (1249:16): [True: 0, False: 3.25k]
  ------------------
 1250|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 1251|       |
 1252|       |    /* Set up the context */
 1253|  3.25k|    CtxJson ctx;
 1254|  3.25k|    memset(&ctx, 0, sizeof(ctx));
 1255|  3.25k|    ctx.pos = (UA_Byte*)0x01;
 1256|  3.25k|    ctx.end = (const UA_Byte*)(uintptr_t)SIZE_MAX;
 1257|  3.25k|    ctx.depth = 0;
 1258|  3.25k|    if(options) {
  ------------------
  |  Branch (1258:8): [True: 0, False: 3.25k]
  ------------------
 1259|      0|        ctx.namespaceMapping = options->namespaceMapping;
 1260|      0|        ctx.serverUris = options->serverUris;
 1261|      0|        ctx.serverUrisSize = options->serverUrisSize;
 1262|      0|        ctx.useCompactEncoding = options->useCompactEncoding;
 1263|      0|        ctx.prettyPrint = options->prettyPrint;
 1264|      0|        ctx.unquotedKeys = options->unquotedKeys;
 1265|      0|    }
 1266|       |
 1267|  3.25k|    ctx.calcOnly = true;
 1268|       |
 1269|       |    /* Encode */
 1270|  3.25k|    status ret = encodeJsonJumpTable[type->typeKind](&ctx, src, type);
 1271|  3.25k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  3.25k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1271:8): [True: 0, False: 3.25k]
  ------------------
 1272|      0|        return 0;
 1273|  3.25k|    return ((size_t)ctx.pos) - 1u;
 1274|  3.25k|}
lookAheadForKey:
 1789|   188k|lookAheadForKey(ParseCtx *ctx, const char *key, size_t *resultIndex) {
 1790|       |    /* The current index must point to the beginning of an object.
 1791|       |     * This has to be ensured by the caller. */
 1792|   188k|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  400|   188k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1792:5): [True: 188k, False: 0]
  ------------------
 1793|       |
 1794|   188k|    status ret = UA_STATUSCODE_BADNOTFOUND;
  ------------------
  |  |  233|   188k|#define UA_STATUSCODE_BADNOTFOUND ((UA_StatusCode) 0x803E0000)
  ------------------
 1795|   188k|    size_t oldIndex = ctx->index; /* Save index for later restore */
 1796|   188k|    unsigned int end = ctx->tokens[ctx->index].end;
 1797|   188k|    ctx->index++; /* Move to the first key */
 1798|   438k|    while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1798:11): [True: 428k, False: 9.89k]
  ------------------
 1799|   428k|          ctx->tokens[ctx->index].start < end) {
  ------------------
  |  Branch (1799:11): [True: 360k, False: 68.5k]
  ------------------
 1800|       |        /* Key must be a string */
 1801|   360k|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  400|   360k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1801:9): [True: 360k, False: 0]
  ------------------
 1802|       |
 1803|       |        /* Move index to the value */
 1804|   360k|        ctx->index++;
 1805|       |
 1806|       |        /* Value for the key must exist */
 1807|   360k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  400|   360k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1807:9): [True: 360k, False: 0]
  ------------------
 1808|       |
 1809|       |        /* Compare the key (previous index) */
 1810|   360k|        if(jsoneq(ctx->json5, &ctx->tokens[ctx->index-1], key) == 0) {
  ------------------
  |  Branch (1810:12): [True: 109k, False: 250k]
  ------------------
 1811|   109k|            *resultIndex = ctx->index; /* Point result to the current index */
 1812|   109k|            ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   109k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1813|   109k|            break;
 1814|   109k|        }
 1815|       |
 1816|   250k|        skipObject(ctx); /* Jump over the value (can also be an array or object) */
 1817|   250k|    }
 1818|   188k|    ctx->index = oldIndex; /* Restore the old index */
 1819|   188k|    return ret;
 1820|   188k|}
decodeFields:
 2503|   828k|decodeFields(ParseCtx *ctx, DecodeEntry *entries, size_t entryCount) {
 2504|   828k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1285|   828k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1286|   828k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1286:8): [True: 0, False: 828k]
  |  |  ------------------
  |  | 1287|   828k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1288|   828k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1288:13): [Folded, False: 828k]
  |  |  ------------------
  ------------------
 2505|   828k|    CHECK_NULL_SKIP; /* null is treated like an empty object */
  ------------------
  |  | 1310|   828k|#define CHECK_NULL_SKIP do {                         \
  |  | 1311|   828k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1311:8): [True: 0, False: 828k]
  |  |  ------------------
  |  | 1312|      0|        ctx->index++;                                \
  |  | 1313|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1314|   828k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1314:14): [Folded, False: 828k]
  |  |  ------------------
  ------------------
 2506|       |
 2507|   828k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION)
  ------------------
  |  |   22|   828k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (2507:8): [True: 0, False: 828k]
  ------------------
 2508|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2509|       |
 2510|       |    /* Keys and values are counted separately */
 2511|   828k|    CHECK_OBJECT;
  ------------------
  |  | 1305|   828k|#define CHECK_OBJECT do {                                \
  |  | 1306|   828k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1306:8): [True: 0, False: 828k]
  |  |  ------------------
  |  | 1307|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1308|   828k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1308:14): [Folded, False: 828k]
  |  |  ------------------
  ------------------
 2512|   828k|    UA_assert(ctx->tokens[ctx->index].size % 2 == 0);
  ------------------
  |  |  400|   828k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2512:5): [True: 828k, False: 0]
  ------------------
 2513|   828k|    size_t keyCount = (size_t)(ctx->tokens[ctx->index].size) / 2;
 2514|       |
 2515|   828k|    ctx->index++; /* Go to first key - or jump after the empty object */
 2516|   828k|    ctx->depth++;
 2517|       |
 2518|   828k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   828k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2519|   841k|    for(size_t key = 0; key < keyCount; key++) {
  ------------------
  |  Branch (2519:25): [True: 13.6k, False: 828k]
  ------------------
 2520|       |        /* Key must be a string */
 2521|  13.6k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  400|  13.6k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2521:9): [True: 13.6k, False: 0]
  ------------------
 2522|  13.6k|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  400|  13.6k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2522:9): [True: 13.6k, False: 0]
  ------------------
 2523|       |
 2524|       |        /* Search for the decoding entry matching the key. Start at the key
 2525|       |         * index to speed-up the case where they key-order is the same as the
 2526|       |         * entry-order. */
 2527|  13.6k|        DecodeEntry *entry = NULL;
 2528|  41.6k|        for(size_t i = key; i < key + entryCount; i++) {
  ------------------
  |  Branch (2528:29): [True: 41.5k, False: 42]
  ------------------
 2529|  41.5k|            size_t ii = i;
 2530|  45.0k|            while(ii >= entryCount)
  ------------------
  |  Branch (2530:19): [True: 3.48k, False: 41.5k]
  ------------------
 2531|  3.48k|                ii -= entryCount;
 2532|       |
 2533|       |            /* Compare the key */
 2534|  41.5k|            if(jsoneq(ctx->json5, &ctx->tokens[ctx->index],
  ------------------
  |  Branch (2534:16): [True: 27.9k, False: 13.6k]
  ------------------
 2535|  41.5k|                      entries[ii].fieldName) != 0)
 2536|  27.9k|                continue;
 2537|       |
 2538|       |            /* Key was already used -> duplicate, abort */
 2539|  13.6k|            if(entries[ii].found) {
  ------------------
  |  Branch (2539:16): [True: 1, False: 13.6k]
  ------------------
 2540|      1|                ctx->depth--;
 2541|      1|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2542|      1|            }
 2543|       |
 2544|       |            /* Found the key */
 2545|  13.6k|            entries[ii].found = true;
 2546|  13.6k|            entry = &entries[ii];
 2547|  13.6k|            break;
 2548|  13.6k|        }
 2549|       |
 2550|       |        /* The key is unknown */
 2551|  13.6k|        if(!entry) {
  ------------------
  |  Branch (2551:12): [True: 42, False: 13.6k]
  ------------------
 2552|     42|            ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     42|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2553|     42|            break;
 2554|     42|        }
 2555|       |
 2556|       |        /* Go from key to value */
 2557|  13.6k|        ctx->index++;
 2558|  13.6k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  400|  13.6k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2558:9): [True: 13.6k, False: 0]
  ------------------
 2559|       |
 2560|       |        /* An entry that was expected but shall not be decoded.
 2561|       |         * Jump over the value. */
 2562|  13.6k|        if(!entry->function && !entry->type) {
  ------------------
  |  Branch (2562:12): [True: 13.6k, False: 0]
  |  Branch (2562:32): [True: 13.5k, False: 108]
  ------------------
 2563|  13.5k|            skipObject(ctx);
 2564|  13.5k|            continue;
 2565|  13.5k|        }
 2566|       |
 2567|       |        /* A null-value is only valid for nullable fields. */
 2568|    108|        if(currentTokenType(ctx) == CJ5_TOKEN_NULL && !entry->function) {
  ------------------
  |  Branch (2568:12): [True: 1, False: 107]
  |  Branch (2568:55): [True: 1, False: 0]
  ------------------
 2569|      1|            if(!entry->type || !isJsonNullable(entry->type)) {
  ------------------
  |  Branch (2569:16): [True: 0, False: 1]
  |  Branch (2569:32): [True: 1, False: 0]
  ------------------
 2570|      1|                ctx->depth--;
 2571|      1|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2572|      1|            }
 2573|      0|            ctx->index++; /* skip null value */
 2574|      0|            continue;
 2575|      1|        }
 2576|       |
 2577|       |        /* Decode. This also moves to the next key or right after the object for
 2578|       |         * the last value. */
 2579|    107|        decodeJsonSignature decodeFunc = (entry->function) ?
  ------------------
  |  Branch (2579:42): [True: 0, False: 107]
  ------------------
 2580|    107|            entry->function : decodeJsonJumpTable[entry->type->typeKind];
 2581|    107|        ret = decodeFunc(ctx, entry->fieldPointer, entry->type);
 2582|    107|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    107|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2582:12): [True: 1, False: 106]
  ------------------
 2583|      1|            break;
 2584|    107|    }
 2585|       |
 2586|   828k|    ctx->depth--;
 2587|   828k|    return ret;
 2588|   828k|}
tokenize:
 2913|  10.4k|         size_t *decodedLength) {
 2914|       |    /* Tokenize */
 2915|  10.4k|    cj5_options options;
 2916|  10.4k|    options.stop_early = (decodedLength != NULL);
 2917|  10.4k|    cj5_result r = cj5_parse((char*)src->data, (unsigned int)src->length,
 2918|  10.4k|                             ctx->tokens, (unsigned int)tokensSize, &options);
 2919|       |
 2920|       |    /* Handle overflow error by allocating the number of tokens the parser would
 2921|       |     * have needed */
 2922|  10.4k|    if(r.error == CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (2922:8): [True: 621, False: 9.86k]
  ------------------
 2923|    621|       tokensSize != r.num_tokens) {
  ------------------
  |  Branch (2923:8): [True: 621, False: 0]
  ------------------
 2924|    621|        ctx->tokens = (cj5_token*)
 2925|    621|            UA_malloc(sizeof(cj5_token) * r.num_tokens);
  ------------------
  |  |   18|    621|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 2926|    621|        if(!ctx->tokens)
  ------------------
  |  Branch (2926:12): [True: 0, False: 621]
  ------------------
 2927|      0|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2928|    621|        return tokenize(ctx, src, r.num_tokens, decodedLength);
 2929|    621|    }
 2930|       |
 2931|       |    /* Cannot recover from other errors */
 2932|  9.86k|    if(r.error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (2932:8): [True: 609, False: 9.25k]
  ------------------
 2933|    609|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    609|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2934|       |
 2935|  9.25k|    if(decodedLength)
  ------------------
  |  Branch (2935:8): [True: 0, False: 9.25k]
  ------------------
 2936|      0|        *decodedLength = ctx->tokens[0].end + 1;
 2937|       |
 2938|       |    /* Set up the context */
 2939|  9.25k|    ctx->json5 = (char*)src->data;
 2940|  9.25k|    ctx->depth = 0;
 2941|  9.25k|    ctx->tokensSize = r.num_tokens;
 2942|  9.25k|    ctx->index = 0;
 2943|  9.25k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  9.25k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2944|  9.86k|}
UA_decodeJson:
 2948|  9.86k|              const UA_DecodeJsonOptions *options) {
 2949|  9.86k|    if(!dst || !src || !type)
  ------------------
  |  Branch (2949:8): [True: 0, False: 9.86k]
  |  Branch (2949:16): [True: 0, False: 9.86k]
  |  Branch (2949:24): [True: 0, False: 9.86k]
  ------------------
 2950|      0|        return UA_STATUSCODE_BADARGUMENTSMISSING;
  ------------------
  |  |  449|      0|#define UA_STATUSCODE_BADARGUMENTSMISSING ((UA_StatusCode) 0x80760000)
  ------------------
 2951|       |
 2952|       |    /* The destination is always initialized, including tokenizer failures. */
 2953|  9.86k|    memset(dst, 0, type->memSize);
 2954|       |
 2955|       |    /* Set up the context */
 2956|  9.86k|    cj5_token tokens[UA_JSON_MAXTOKENCOUNT];
 2957|  9.86k|    ParseCtx ctx;
 2958|  9.86k|    memset(&ctx, 0, sizeof(ParseCtx));
 2959|  9.86k|    ctx.tokens = tokens;
 2960|       |
 2961|  9.86k|    if(options) {
  ------------------
  |  Branch (2961:8): [True: 0, False: 9.86k]
  ------------------
 2962|      0|        ctx.namespaceMapping = options->namespaceMapping;
 2963|      0|        ctx.serverUris = options->serverUris;
 2964|      0|        ctx.serverUrisSize = options->serverUrisSize;
 2965|      0|        ctx.customTypes = options->customTypes;
 2966|      0|    }
 2967|       |
 2968|       |    /* Decode */
 2969|  9.86k|    status ret = tokenize(&ctx, src, UA_JSON_MAXTOKENCOUNT,
  ------------------
  |  |   21|  9.86k|#define UA_JSON_MAXTOKENCOUNT 256
  ------------------
 2970|  9.86k|                          options ? options->decodedLength : NULL);
  ------------------
  |  Branch (2970:27): [True: 0, False: 9.86k]
  ------------------
 2971|  9.86k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  9.86k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2971:8): [True: 609, False: 9.25k]
  ------------------
 2972|    609|        goto cleanup;
 2973|       |
 2974|  9.25k|    ret = decodeJsonJumpTable[type->typeKind](&ctx, dst, type);
 2975|       |
 2976|       |    /* Boundary decoding intentionally stops after the first JSON value. */
 2977|  9.25k|    if((!options || !options->decodedLength) &&
  ------------------
  |  Branch (2977:9): [True: 9.25k, False: 0]
  |  Branch (2977:21): [True: 0, False: 0]
  ------------------
 2978|  9.25k|       ctx.index != ctx.tokensSize)
  ------------------
  |  Branch (2978:8): [True: 708, False: 8.54k]
  ------------------
 2979|    708|        ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    708|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2980|       |
 2981|  9.86k| cleanup:
 2982|       |
 2983|       |    /* Free token array on the heap */
 2984|  9.86k|    if(ctx.tokens != tokens)
  ------------------
  |  Branch (2984:8): [True: 621, False: 9.24k]
  ------------------
 2985|    621|        UA_free((void*)(uintptr_t)ctx.tokens);
  ------------------
  |  |   19|    621|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2986|       |
 2987|  9.86k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  9.86k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2987:8): [True: 3.36k, False: 6.50k]
  ------------------
 2988|  3.36k|        UA_clear(dst, type);
 2989|  9.86k|    return ret;
 2990|  9.25k|}
ua_types_encoding_json.c:writeChar:
   67|  23.0M|writeChar(CtxJson *ctx, char c) {
   68|  23.0M|    if(ctx->pos >= ctx->end)
  ------------------
  |  Branch (68:8): [True: 0, False: 23.0M]
  ------------------
   69|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
   70|  23.0M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (70:8): [True: 15.3M, False: 7.69M]
  ------------------
   71|  15.3M|        *ctx->pos = (UA_Byte)c;
   72|  23.0M|    ctx->pos++;
   73|  23.0M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  23.0M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   74|  23.0M|}
ua_types_encoding_json.c:writeChars:
   77|   566k|writeChars(CtxJson *ctx, const char *c, size_t len) {
   78|   566k|    if(ctx->pos + len > ctx->end)
  ------------------
  |  Branch (78:8): [True: 0, False: 566k]
  ------------------
   79|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
   80|   566k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (80:8): [True: 377k, False: 188k]
  ------------------
   81|   377k|        memcpy(ctx->pos, c, len);
   82|   566k|    ctx->pos += len;
   83|   566k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   566k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   84|   566k|}
ua_types_encoding_json.c:Boolean_encodeJson:
  258|     33|ENCODE_JSON(Boolean) {
  259|     33|    const UA_Boolean *src = (const UA_Boolean*)p;
  260|     33|    if(*src == true)
  ------------------
  |  Branch (260:8): [True: 30, False: 3]
  ------------------
  261|     30|        return writeChars(ctx, "true", 4);
  262|      3|    return writeChars(ctx, "false", 5);
  263|     33|}
ua_types_encoding_json.c:SByte_encodeJson:
  281|   214k|ENCODE_JSON(SByte) {
  282|   214k|    const UA_SByte *src = (const UA_SByte*)p;
  283|   214k|    char buf[5];
  284|   214k|    UA_UInt16 digits = itoaSigned(*src, buf);
  285|   214k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (285:8): [True: 0, False: 214k]
  ------------------
  286|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  287|   214k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (287:8): [True: 143k, False: 71.6k]
  ------------------
  288|   143k|        memcpy(ctx->pos, buf, digits);
  289|   214k|    ctx->pos += digits;
  290|   214k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   214k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  291|   214k|}
ua_types_encoding_json.c:Byte_encodeJson:
  265|  16.2k|ENCODE_JSON(Byte) {
  266|  16.2k|    const UA_Byte *src = (const UA_Byte*)p;
  267|  16.2k|    char buf[4];
  268|  16.2k|    UA_UInt16 digits = itoaUnsigned(*src, buf, 10);
  269|       |
  270|       |    /* Ensure destination can hold the data- */
  271|  16.2k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (271:8): [True: 0, False: 16.2k]
  ------------------
  272|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  273|       |
  274|       |    /* Copy digits to the output string/buffer. */
  275|  16.2k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (275:8): [True: 10.8k, False: 5.41k]
  ------------------
  276|  10.8k|        memcpy(ctx->pos, buf, digits);
  277|  16.2k|    ctx->pos += digits;
  278|  16.2k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  16.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  279|  16.2k|}
ua_types_encoding_json.c:Int16_encodeJson:
  305|  7.56k|ENCODE_JSON(Int16) {
  306|  7.56k|    const UA_Int16 *src = (const UA_Int16*)p;
  307|  7.56k|    char buf[7];
  308|  7.56k|    UA_UInt16 digits = itoaSigned(*src, buf);
  309|  7.56k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (309:8): [True: 0, False: 7.56k]
  ------------------
  310|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  311|  7.56k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (311:8): [True: 5.04k, False: 2.52k]
  ------------------
  312|  5.04k|        memcpy(ctx->pos, buf, digits);
  313|  7.56k|    ctx->pos += digits;
  314|  7.56k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  7.56k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  315|  7.56k|}
ua_types_encoding_json.c:UInt16_encodeJson:
  293|  76.8k|ENCODE_JSON(UInt16) {
  294|  76.8k|    const UA_UInt16 *src = (const UA_UInt16*)p;
  295|  76.8k|    char buf[6];
  296|  76.8k|    UA_UInt16 digits = itoaUnsigned(*src, buf, 10);
  297|  76.8k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (297:8): [True: 0, False: 76.8k]
  ------------------
  298|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  299|  76.8k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (299:8): [True: 51.2k, False: 25.6k]
  ------------------
  300|  51.2k|        memcpy(ctx->pos, buf, digits);
  301|  76.8k|    ctx->pos += digits;
  302|  76.8k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  76.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  303|  76.8k|}
ua_types_encoding_json.c:Int32_encodeJson:
  329|  4.79M|ENCODE_JSON(Int32) {
  330|  4.79M|    const UA_Int32 *src = (const UA_Int32*)p;
  331|  4.79M|    char buf[12];
  332|  4.79M|    UA_UInt16 digits = itoaSigned(*src, buf);
  333|  4.79M|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (333:8): [True: 0, False: 4.79M]
  ------------------
  334|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  335|  4.79M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (335:8): [True: 3.19M, False: 1.59M]
  ------------------
  336|  3.19M|        memcpy(ctx->pos, buf, digits);
  337|  4.79M|    ctx->pos += digits;
  338|  4.79M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.79M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  339|  4.79M|}
ua_types_encoding_json.c:UInt32_encodeJson:
  317|  90.0k|ENCODE_JSON(UInt32) {
  318|  90.0k|    const UA_UInt32 *src = (const UA_UInt32*)p;
  319|  90.0k|    char buf[11];
  320|  90.0k|    UA_UInt16 digits = itoaUnsigned(*src, buf, 10);
  321|  90.0k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (321:8): [True: 0, False: 90.0k]
  ------------------
  322|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  323|  90.0k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (323:8): [True: 60.0k, False: 30.0k]
  ------------------
  324|  60.0k|        memcpy(ctx->pos, buf, digits);
  325|  90.0k|    ctx->pos += digits;
  326|  90.0k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  90.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  327|  90.0k|}
ua_types_encoding_json.c:Int64_encodeJson:
  379|  3.35M|ENCODE_JSON(Int64) {
  380|  3.35M|    const UA_Int64 *src = (const UA_Int64*)p;
  381|  3.35M|    char buf[23];
  382|  3.35M|    buf[0] = '\"';
  383|  3.35M|    UA_UInt16 digits = itoaSigned(*src, buf + 1);
  384|  3.35M|    buf[digits + 1] = '\"';
  385|  3.35M|    UA_UInt16 length = (UA_UInt16)(digits + 2);
  386|  3.35M|    if(ctx->pos + length > ctx->end)
  ------------------
  |  Branch (386:8): [True: 0, False: 3.35M]
  ------------------
  387|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  388|  3.35M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (388:8): [True: 2.23M, False: 1.11M]
  ------------------
  389|  2.23M|        memcpy(ctx->pos, buf, length);
  390|  3.35M|    ctx->pos += length;
  391|  3.35M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  3.35M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  392|  3.35M|}
ua_types_encoding_json.c:UInt64_encodeJson:
  364|  7.05M|ENCODE_JSON(UInt64) {
  365|  7.05M|    const UA_UInt64 *src = (const UA_UInt64*)p;
  366|  7.05M|    char buf[23];
  367|  7.05M|    buf[0] = '\"';
  368|  7.05M|    UA_UInt16 digits = itoaUnsigned(*src, buf + 1, 10);
  369|  7.05M|    buf[digits + 1] = '\"';
  370|  7.05M|    UA_UInt16 length = (UA_UInt16)(digits + 2);
  371|  7.05M|    if(ctx->pos + length > ctx->end)
  ------------------
  |  Branch (371:8): [True: 0, False: 7.05M]
  ------------------
  372|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  373|  7.05M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (373:8): [True: 4.70M, False: 2.35M]
  ------------------
  374|  4.70M|        memcpy(ctx->pos, buf, length);
  375|  7.05M|    ctx->pos += length;
  376|  7.05M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  7.05M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  377|  7.05M|}
ua_types_encoding_json.c:Float_encodeJson:
  394|   283k|ENCODE_JSON(Float) {
  395|   283k|    const UA_Float *src = (const UA_Float*)p;
  396|   283k|    char buffer[32];
  397|   283k|    size_t len;
  398|   283k|    if(*src != *src)
  ------------------
  |  Branch (398:8): [True: 2.24k, False: 281k]
  ------------------
  399|  2.24k|        return writeChars(ctx, "\"NaN\"", 5);
  400|   281k|    if(*src == INFINITY)
  ------------------
  |  Branch (400:8): [True: 870, False: 280k]
  ------------------
  401|    870|        return writeChars(ctx, "\"Infinity\"", 10);
  402|   280k|    if(*src == -INFINITY)
  ------------------
  |  Branch (402:8): [True: 789, False: 279k]
  ------------------
  403|    789|        return writeChars(ctx, "\"-Infinity\"", 11);
  404|   279k|    len = dtoa((UA_Double)*src, buffer);
  405|   279k|    if(ctx->pos + len > ctx->end)
  ------------------
  |  Branch (405:8): [True: 0, False: 279k]
  ------------------
  406|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  407|   279k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (407:8): [True: 186k, False: 93.2k]
  ------------------
  408|   186k|        memcpy(ctx->pos, buffer, len);
  409|   279k|    ctx->pos += len;
  410|   279k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   279k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  411|   279k|}
ua_types_encoding_json.c:Double_encodeJson:
  413|  1.45M|ENCODE_JSON(Double) {
  414|  1.45M|    const UA_Double *src = (const UA_Double*)p;
  415|  1.45M|    char buffer[32];
  416|  1.45M|    size_t len;
  417|  1.45M|    if(*src != *src)
  ------------------
  |  Branch (417:8): [True: 804, False: 1.45M]
  ------------------
  418|    804|        return writeChars(ctx, "\"NaN\"", 5);
  419|  1.45M|    if(*src == INFINITY)
  ------------------
  |  Branch (419:8): [True: 804, False: 1.45M]
  ------------------
  420|    804|        return writeChars(ctx, "\"Infinity\"", 10);
  421|  1.45M|    if(*src == -INFINITY)
  ------------------
  |  Branch (421:8): [True: 789, False: 1.45M]
  ------------------
  422|    789|        return writeChars(ctx, "\"-Infinity\"", 11);
  423|  1.45M|    len = dtoa(*src, buffer);
  424|  1.45M|    if(ctx->pos + len > ctx->end)
  ------------------
  |  Branch (424:8): [True: 0, False: 1.45M]
  ------------------
  425|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  426|  1.45M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (426:8): [True: 968k, False: 484k]
  ------------------
  427|   968k|        memcpy(ctx->pos, buffer, len);
  428|  1.45M|    ctx->pos += len;
  429|  1.45M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.45M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  430|  1.45M|}
ua_types_encoding_json.c:String_encodeJson:
  524|   153k|ENCODE_JSON(String) {
  525|   153k|    const UA_String *src = (const UA_String*)p;
  526|   153k|    if(!src->data)
  ------------------
  |  Branch (526:8): [True: 1.67k, False: 151k]
  ------------------
  527|  1.67k|        return writeChars(ctx, "null", 4);
  528|       |
  529|   151k|    status ret = writeJsonQuote(ctx);
  530|   151k|    ret |= writeJsonStringContent(ctx, src);
  531|   151k|    return ret | writeJsonQuote(ctx);
  532|   153k|}
ua_types_encoding_json.c:writeJsonQuote:
   90|   315k|static WRITE_JSON_ELEMENT(Quote) {
   91|   315k|    return writeChar(ctx, '\"');
   92|   315k|}
ua_types_encoding_json.c:writeJsonStringContent:
  460|   151k|writeJsonStringContent(CtxJson *ctx, const UA_String *src) {
  461|   151k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   151k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  462|   151k|    const unsigned char *end = src->data + src->length;
  463|  11.2M|    for(const unsigned char *pos = src->data; pos < end; pos++) {
  ------------------
  |  Branch (463:47): [True: 11.2M, False: 12.8k]
  ------------------
  464|       |        /* Skip to the first character that needs escaping */
  465|  11.2M|        const unsigned char *start = pos;
  466|  36.3M|        for(; pos < end; pos++) {
  ------------------
  |  Branch (466:15): [True: 36.2M, False: 138k]
  ------------------
  467|  36.2M|            if(*pos < ' ' || *pos == 127 || *pos == '\\' || *pos == '\"')
  ------------------
  |  Branch (467:16): [True: 4.10M, False: 32.1M]
  |  Branch (467:30): [True: 15.0k, False: 32.1M]
  |  Branch (467:45): [True: 10.3k, False: 32.1M]
  |  Branch (467:61): [True: 6.97M, False: 25.1M]
  ------------------
  468|  11.1M|                break;
  469|  36.2M|        }
  470|       |
  471|       |        /* Write out the unescaped sequence */
  472|  11.2M|        if(ctx->pos + (pos - start) > ctx->end)
  ------------------
  |  Branch (472:12): [True: 0, False: 11.2M]
  ------------------
  473|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  474|  11.2M|        if(!ctx->calcOnly)
  ------------------
  |  Branch (474:12): [True: 7.49M, False: 3.74M]
  ------------------
  475|  7.49M|            memcpy(ctx->pos, start, (size_t)(pos - start));
  476|  11.2M|        ctx->pos += pos - start;
  477|       |
  478|       |        /* The unescaped sequence reached the end */
  479|  11.2M|        if(pos == end)
  ------------------
  |  Branch (479:12): [True: 138k, False: 11.1M]
  ------------------
  480|   138k|            break;
  481|       |
  482|       |        /* Write an escaped character */
  483|  11.1M|        char *escape_text;
  484|  11.1M|        char escape_buf[6];
  485|  11.1M|        size_t escape_len = 2;
  486|  11.1M|        switch(*pos) {
  487|    426|        case '\b': escape_text = "\\b"; break;
  ------------------
  |  Branch (487:9): [True: 426, False: 11.1M]
  ------------------
  488|  1.53k|        case '\f': escape_text = "\\f"; break;
  ------------------
  |  Branch (488:9): [True: 1.53k, False: 11.1M]
  ------------------
  489|   145k|        case '\n': escape_text = "\\n"; break;
  ------------------
  |  Branch (489:9): [True: 145k, False: 10.9M]
  ------------------
  490|    363|        case '\r': escape_text = "\\r"; break;
  ------------------
  |  Branch (490:9): [True: 363, False: 11.1M]
  ------------------
  491|    372|        case '\t': escape_text = "\\t"; break;
  ------------------
  |  Branch (491:9): [True: 372, False: 11.1M]
  ------------------
  492|  10.9M|        default:
  ------------------
  |  Branch (492:9): [True: 10.9M, False: 148k]
  ------------------
  493|  10.9M|            escape_text = escape_buf;
  494|  10.9M|            if(*pos >= ' ' && *pos != 127) {
  ------------------
  |  Branch (494:16): [True: 7.00M, False: 3.95M]
  |  Branch (494:31): [True: 6.98M, False: 15.0k]
  ------------------
  495|       |                /* Escape \ or " */
  496|  6.98M|                escape_buf[0] = '\\';
  497|  6.98M|                escape_buf[1] = (char)*pos;
  498|  6.98M|            } else {
  499|       |                /* Unprintable characters need to be escaped */
  500|  3.96M|                escape_buf[0] = '\\';
  501|  3.96M|                escape_buf[1] = 'u';
  502|  3.96M|                escape_buf[2] = '0';
  503|  3.96M|                escape_buf[3] = '0';
  504|  3.96M|                escape_buf[4] = hexmap[*pos >> 4];
  505|  3.96M|                escape_buf[5] = hexmap[*pos & 0x0f];
  506|  3.96M|                escape_len = 6;
  507|  3.96M|            }
  508|  10.9M|            break;
  509|  11.1M|        }
  510|       |
  511|       |        /* Enough space? */
  512|  11.1M|        if(ctx->pos + escape_len > ctx->end)
  ------------------
  |  Branch (512:12): [True: 0, False: 11.1M]
  ------------------
  513|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  514|       |
  515|       |        /* Write the escaped character */
  516|  11.1M|        if(!ctx->calcOnly)
  ------------------
  |  Branch (516:12): [True: 7.40M, False: 3.70M]
  ------------------
  517|  7.40M|            memcpy(ctx->pos, escape_text, escape_len);
  518|  11.1M|        ctx->pos += escape_len;
  519|  11.1M|    }
  520|       |
  521|   151k|    return ret;
  522|   151k|}
ua_types_encoding_json.c:DateTime_encodeJson:
  580|  2.17k|ENCODE_JSON(DateTime) {
  581|  2.17k|    const UA_DateTime *src = (const UA_DateTime*)p;
  582|  2.17k|    if(*src == 0)
  ------------------
  |  Branch (582:8): [True: 2.17k, False: 0]
  ------------------
  583|  2.17k|        return writeChars(ctx, "\"0001-01-01T00:00:00Z\"", 22);
  584|       |
  585|      0|    UA_DateTimeStruct date = UA_DateTime_toStruct(*src);
  586|      0|    if(date.year < 1)
  ------------------
  |  Branch (586:8): [True: 0, False: 0]
  ------------------
  587|      0|        return writeChars(ctx, "\"0001-01-01T00:00:00Z\"", 22);
  588|      0|    if(date.year > 9999)
  ------------------
  |  Branch (588:8): [True: 0, False: 0]
  ------------------
  589|      0|        return writeChars(ctx, "\"9999-12-31T23:59:59.9999999Z\"", 30);
  590|       |
  591|      0|    UA_Byte buffer[40];
  592|      0|    UA_String str = {40, buffer};
  593|      0|    encodeDateTime(*src, &str);
  594|       |    return String_encodeJson(ctx, &str, NULL);
  595|      0|}
ua_types_encoding_json.c:Guid_encodeJson:
  569|  3.88k|ENCODE_JSON(Guid) {
  570|  3.88k|    const UA_Guid *src = (const UA_Guid*)p;
  571|  3.88k|    if(ctx->pos + 38 > ctx->end) /* 36 + 2 (") */
  ------------------
  |  Branch (571:8): [True: 0, False: 3.88k]
  ------------------
  572|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  573|  3.88k|    status ret = writeJsonQuote(ctx);
  574|  3.88k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (574:8): [True: 2.59k, False: 1.29k]
  ------------------
  575|  2.59k|        UA_Guid_to_hex(src, ctx->pos, false);
  576|  3.88k|    ctx->pos += 36;
  577|  3.88k|    return ret | writeJsonQuote(ctx);
  578|  3.88k|}
ua_types_encoding_json.c:ByteString_encodeJson:
  534|  3.44k|ENCODE_JSON(ByteString) {
  535|  3.44k|    const UA_ByteString *src = (const UA_ByteString*)p;
  536|  3.44k|    if(!src->data)
  ------------------
  |  Branch (536:8): [True: 1.20k, False: 2.23k]
  ------------------
  537|  1.20k|        return writeChars(ctx, "null", 4);
  538|       |
  539|  2.23k|    if(src->length == 0) {
  ------------------
  |  Branch (539:8): [True: 1.90k, False: 327]
  ------------------
  540|  1.90k|        status retval = writeJsonQuote(ctx);
  541|  1.90k|        retval |= writeJsonQuote(ctx);
  542|  1.90k|        return retval;
  543|  1.90k|    }
  544|       |
  545|    327|    status ret = writeJsonQuote(ctx);
  546|    327|    size_t flen = 0;
  547|    327|    unsigned char *ba64 = UA_base64(src->data, src->length, &flen);
  548|       |
  549|       |    /* Not converted, no mem */
  550|    327|    if(!ba64)
  ------------------
  |  Branch (550:8): [True: 0, False: 327]
  ------------------
  551|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  552|       |
  553|    327|    if(ctx->pos + flen > ctx->end) {
  ------------------
  |  Branch (553:8): [True: 0, False: 327]
  ------------------
  554|      0|        UA_free(ba64);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  555|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  556|      0|    }
  557|       |
  558|       |    /* Copy flen bytes to output stream. */
  559|    327|    if(!ctx->calcOnly)
  ------------------
  |  Branch (559:8): [True: 218, False: 109]
  ------------------
  560|    218|        memcpy(ctx->pos, ba64, flen);
  561|    327|    ctx->pos += flen;
  562|       |
  563|       |    /* Base64 result no longer needed */
  564|    327|    UA_free(ba64);
  ------------------
  |  |   19|    327|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  565|       |
  566|    327|    return ret | writeJsonQuote(ctx);
  567|    327|}
ua_types_encoding_json.c:NodeId_encodeJson:
  597|  45.0k|ENCODE_JSON(NodeId) {
  598|  45.0k|    const UA_NodeId *src = (const UA_NodeId*)p;
  599|  45.0k|    UA_String out = UA_STRING_NULL;
  600|  45.0k|    UA_StatusCode ret =
  601|  45.0k|        UA_NodeId_printEx(src, &out, ctx->namespaceMapping);
  602|       |    ret |= String_encodeJson(ctx, &out, NULL);
  603|  45.0k|    UA_String_clear(&out);
  604|  45.0k|    return ret;
  605|  45.0k|}
ua_types_encoding_json.c:ExpandedNodeId_encodeJson:
  607|  34.1k|ENCODE_JSON(ExpandedNodeId) {
  608|  34.1k|    const UA_ExpandedNodeId *src = (const UA_ExpandedNodeId*)p;
  609|  34.1k|    UA_String out = UA_STRING_NULL;
  610|  34.1k|    UA_StatusCode ret =
  611|  34.1k|        UA_ExpandedNodeId_printEx(src, &out, ctx->namespaceMapping,
  612|  34.1k|                                  ctx->serverUrisSize, ctx->serverUris);
  613|       |    ret |= String_encodeJson(ctx, &out, NULL);
  614|  34.1k|    UA_String_clear(&out);
  615|  34.1k|    return ret;
  616|  34.1k|}
ua_types_encoding_json.c:StatusCode_encodeJson:
  644|  1.88k|ENCODE_JSON(StatusCode) {
  645|  1.88k|    const UA_StatusCode *src = (const UA_StatusCode*)p;
  646|  1.88k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.88k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  647|  1.88k|    ret |= writeJsonObjStart(ctx);
  648|  1.88k|    if(*src > UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  1.88k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (648:8): [True: 156, False: 1.73k]
  ------------------
  649|    156|        ret |= writeJsonKey(ctx, UA_JSONKEY_CODE);
  650|    156|        ret |= UInt32_encodeJson(ctx, src, NULL);
  651|    156|        const char *codename = NULL;
  652|    156|        if(!ctx->useCompactEncoding)
  ------------------
  |  Branch (652:12): [True: 156, False: 0]
  ------------------
  653|    156|            codename = UA_StatusCode_name(*src);
  654|    156|        if(codename && codename[0] != '\0') {
  ------------------
  |  Branch (654:12): [True: 156, False: 0]
  |  Branch (654:24): [True: 156, False: 0]
  ------------------
  655|    156|            UA_String statusDescription =
  656|    156|                UA_STRING((char*)(uintptr_t)codename);
  657|    156|            ret |= writeJsonKey(ctx, UA_JSONKEY_SYMBOL);
  658|       |            ret |= String_encodeJson(ctx, &statusDescription, NULL);
  659|    156|        }
  660|    156|    }
  661|  1.88k|    ret |= writeJsonObjEnd(ctx);
  662|  1.88k|    return ret;
  663|  1.88k|}
ua_types_encoding_json.c:QualifiedName_encodeJson:
  632|  69.5k|ENCODE_JSON(QualifiedName) {
  633|  69.5k|    const UA_QualifiedName *src = (const UA_QualifiedName*)p;
  634|  69.5k|    if(src->namespaceIndex == 0 && src->name.data == NULL)
  ------------------
  |  Branch (634:8): [True: 68.1k, False: 1.41k]
  |  Branch (634:36): [True: 942, False: 67.2k]
  ------------------
  635|    942|        return writeChars(ctx, "null", 4);
  636|  68.6k|    UA_String out = UA_STRING_NULL;
  637|  68.6k|    UA_StatusCode ret =
  638|  68.6k|        UA_QualifiedName_printEx(src, &out, ctx->namespaceMapping);
  639|       |    ret |= String_encodeJson(ctx, &out, NULL);
  640|  68.6k|    UA_String_clear(&out);
  641|  68.6k|    return ret;
  642|  69.5k|}
ua_types_encoding_json.c:LocalizedText_encodeJson:
  618|   828k|ENCODE_JSON(LocalizedText) {
  619|   828k|    const UA_LocalizedText *src = (const UA_LocalizedText*)p;
  620|   828k|    status ret = writeJsonObjStart(ctx);
  621|   828k|    if(src->locale.length > 0) {
  ------------------
  |  Branch (621:8): [True: 0, False: 828k]
  ------------------
  622|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_LOCALE);
  623|      0|        ret |= String_encodeJson(ctx, &src->locale, NULL);
  624|      0|    }
  625|   828k|    if(src->text.length > 0) {
  ------------------
  |  Branch (625:8): [True: 0, False: 828k]
  ------------------
  626|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_TEXT);
  627|       |        ret |= String_encodeJson(ctx, &src->text, NULL);
  628|      0|    }
  629|   828k|    return ret | writeJsonObjEnd(ctx);
  630|   828k|}
ua_types_encoding_json.c:ExtensionObject_encodeJson:
  665|   400k|ENCODE_JSON(ExtensionObject) {
  666|   400k|    const UA_ExtensionObject *src = (const UA_ExtensionObject*)p;
  667|   400k|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_NOBODY)
  ------------------
  |  Branch (667:8): [True: 400k, False: 21]
  ------------------
  668|   400k|        return writeChars(ctx, "{}", 2);
  669|       |
  670|       |    /* Unknown JSON datatypes retain their complete wire representation. */
  671|     21|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_JSON) {
  ------------------
  |  Branch (671:8): [True: 21, False: 0]
  ------------------
  672|     21|        if(src->content.encoded.body.length < 2 ||
  ------------------
  |  Branch (672:12): [True: 0, False: 21]
  ------------------
  673|     21|           src->content.encoded.body.data[0] != '{' ||
  ------------------
  |  Branch (673:12): [True: 0, False: 21]
  ------------------
  674|     21|           src->content.encoded.body.data[src->content.encoded.body.length - 1] != '}')
  ------------------
  |  Branch (674:12): [True: 0, False: 21]
  ------------------
  675|      0|            return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  676|     21|        return writeChars(ctx, (const char*)src->content.encoded.body.data,
  677|     21|                          src->content.encoded.body.length);
  678|     21|    }
  679|       |
  680|       |    /* Must have a type set if data is decoded */
  681|      0|    if(src->encoding != UA_EXTENSIONOBJECT_ENCODED_BYTESTRING &&
  ------------------
  |  Branch (681:8): [True: 0, False: 0]
  ------------------
  682|      0|       src->encoding != UA_EXTENSIONOBJECT_ENCODED_XML &&
  ------------------
  |  Branch (682:8): [True: 0, False: 0]
  ------------------
  683|      0|       !src->content.decoded.type)
  ------------------
  |  Branch (683:8): [True: 0, False: 0]
  ------------------
  684|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  685|       |
  686|      0|    status ret = writeJsonObjStart(ctx);
  687|       |
  688|       |    /* Write the type NodeId */
  689|      0|    ret |= writeJsonKey(ctx, UA_JSONKEY_TYPEID);
  690|      0|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_BYTESTRING ||
  ------------------
  |  Branch (690:8): [True: 0, False: 0]
  ------------------
  691|      0|       src->encoding == UA_EXTENSIONOBJECT_ENCODED_XML)
  ------------------
  |  Branch (691:8): [True: 0, False: 0]
  ------------------
  692|      0|        ret |= NodeId_encodeJson(ctx, &src->content.encoded.typeId, NULL);
  693|      0|    else
  694|      0|        ret |= NodeId_encodeJson(ctx, &src->content.decoded.type->typeId, NULL);
  695|       |
  696|       |    /* Write the encoding type and body if encoded */
  697|      0|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_BYTESTRING ||
  ------------------
  |  Branch (697:8): [True: 0, False: 0]
  ------------------
  698|      0|       src->encoding == UA_EXTENSIONOBJECT_ENCODED_XML) {
  ------------------
  |  Branch (698:8): [True: 0, False: 0]
  ------------------
  699|      0|        if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_BYTESTRING) {
  ------------------
  |  Branch (699:12): [True: 0, False: 0]
  ------------------
  700|      0|            ret |= writeJsonKey(ctx, UA_JSONKEY_ENCODING);
  701|      0|            ret |= writeChar(ctx, '1');
  702|      0|        } else {
  703|      0|            ret |= writeJsonKey(ctx, UA_JSONKEY_ENCODING);
  704|      0|            ret |= writeChar(ctx, '2');
  705|      0|        }
  706|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_BODY);
  707|      0|        ret |= ByteString_encodeJson(ctx, &src->content.encoded.body, NULL);
  708|      0|        return ret | writeJsonObjEnd(ctx);
  709|      0|    }
  710|       |
  711|      0|    const UA_DataType *t = src->content.decoded.type;
  712|      0|    if(t->typeKind == UA_DATATYPEKIND_STRUCTURE ||
  ------------------
  |  Branch (712:8): [True: 0, False: 0]
  ------------------
  713|      0|       t->typeKind == UA_DATATYPEKIND_OPTSTRUCT) {
  ------------------
  |  Branch (713:8): [True: 0, False: 0]
  ------------------
  714|       |        /* Write structures in-situ. */
  715|      0|        ret |= encodeJsonStructureContent(ctx, src->content.decoded.data, t);
  716|      0|    } else if(t->typeKind == UA_DATATYPEKIND_UNION) {
  ------------------
  |  Branch (716:15): [True: 0, False: 0]
  ------------------
  717|      0|        ret |= encodeJsonUnionContent(ctx, src->content.decoded.data, t);
  718|      0|    } else {
  719|       |        /* NON-STANDARD: The standard 1.05 doesn't let us print non-structure
  720|       |         * types in ExtensionObjects (e.g. enums). Print them in the body. */
  721|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_BODY);
  722|      0|        ret |= encodeJsonJumpTable[t->typeKind](ctx, src->content.decoded.data, t);
  723|      0|    }
  724|       |
  725|      0|    return ret | writeJsonObjEnd(ctx);
  726|      0|}
ua_types_encoding_json.c:isNull:
  254|  76.5k|isNull(const void *p, const UA_DataType *type) {
  255|  76.5k|    return isJsonNullable(type) && isJsonDefaultValue(p, type);
  ------------------
  |  Branch (255:12): [True: 76.5k, False: 0]
  |  Branch (255:36): [True: 21.3k, False: 55.1k]
  ------------------
  256|  76.5k|}
ua_types_encoding_json.c:isJsonDefaultValue:
  247|  76.5k|isJsonDefaultValue(const void *p, const UA_DataType *type) {
  248|  76.5k|    UA_STACKARRAY(char, buf, type->memSize);
  ------------------
  |  |  376|  76.5k|#  define UA_STACKARRAY(TYPE, NAME, SIZE) TYPE NAME[SIZE]
  ------------------
  249|  76.5k|    memset(buf, 0, type->memSize);
  250|  76.5k|    return UA_equal(buf, p, type);
  251|  76.5k|}
ua_types_encoding_json.c:DataValue_encodeJson:
  884|   407k|ENCODE_JSON(DataValue) {
  885|   407k|    const UA_DataValue *src = (const UA_DataValue*)p;
  886|   407k|    UA_Boolean hasValue = src->hasValue && src->value.type;
  ------------------
  |  Branch (886:27): [True: 9.72k, False: 397k]
  |  Branch (886:44): [True: 9.72k, False: 0]
  ------------------
  887|   407k|    UA_Boolean hasStatus = src->hasStatus && src->status != UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   407k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (887:28): [True: 0, False: 407k]
  |  Branch (887:46): [True: 0, False: 0]
  ------------------
  888|   407k|    UA_Boolean hasSourceTimestamp =
  889|   407k|        src->hasSourceTimestamp && src->sourceTimestamp != 0;
  ------------------
  |  Branch (889:9): [True: 0, False: 407k]
  |  Branch (889:36): [True: 0, False: 0]
  ------------------
  890|   407k|    UA_Boolean hasSourcePicoseconds =
  891|   407k|        src->hasSourcePicoseconds && src->sourcePicoseconds != 0;
  ------------------
  |  Branch (891:9): [True: 0, False: 407k]
  |  Branch (891:38): [True: 0, False: 0]
  ------------------
  892|   407k|    UA_Boolean hasServerTimestamp =
  893|   407k|        src->hasServerTimestamp && src->serverTimestamp != 0;
  ------------------
  |  Branch (893:9): [True: 0, False: 407k]
  |  Branch (893:36): [True: 0, False: 0]
  ------------------
  894|   407k|    UA_Boolean hasServerPicoseconds =
  895|   407k|        src->hasServerPicoseconds && src->serverPicoseconds != 0;
  ------------------
  |  Branch (895:9): [True: 0, False: 407k]
  |  Branch (895:38): [True: 0, False: 0]
  ------------------
  896|       |
  897|   407k|    status ret = writeJsonObjStart(ctx);
  898|       |
  899|   407k|    if(hasValue)
  ------------------
  |  Branch (899:8): [True: 9.72k, False: 397k]
  ------------------
  900|  9.72k|        ret |= encodeVariantInner(ctx, &src->value, true);
  901|       |
  902|   407k|    if(hasStatus) {
  ------------------
  |  Branch (902:8): [True: 0, False: 407k]
  ------------------
  903|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_STATUS);
  904|      0|        ret |= StatusCode_encodeJson(ctx, &src->status, NULL);
  905|      0|    }
  906|       |
  907|   407k|    if(hasSourceTimestamp) {
  ------------------
  |  Branch (907:8): [True: 0, False: 407k]
  ------------------
  908|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SOURCETIMESTAMP);
  909|      0|        ret |= DateTime_encodeJson(ctx, &src->sourceTimestamp, NULL);
  910|      0|    }
  911|       |
  912|   407k|    if(hasSourcePicoseconds) {
  ------------------
  |  Branch (912:8): [True: 0, False: 407k]
  ------------------
  913|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SOURCEPICOSECONDS);
  914|      0|        ret |= UInt16_encodeJson(ctx, &src->sourcePicoseconds, NULL);
  915|      0|    }
  916|       |
  917|   407k|    if(hasServerTimestamp) {
  ------------------
  |  Branch (917:8): [True: 0, False: 407k]
  ------------------
  918|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SERVERTIMESTAMP);
  919|      0|        ret |= DateTime_encodeJson(ctx, &src->serverTimestamp, NULL);
  920|      0|    }
  921|       |
  922|   407k|    if(hasServerPicoseconds) {
  ------------------
  |  Branch (922:8): [True: 0, False: 407k]
  ------------------
  923|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SERVERPICOSECONDS);
  924|      0|        ret |= UInt16_encodeJson(ctx, &src->serverPicoseconds, NULL);
  925|      0|    }
  926|       |
  927|   407k|    return ret | writeJsonObjEnd(ctx);
  928|   407k|}
ua_types_encoding_json.c:encodeVariantInner:
  803|   265k|                   UA_Boolean insideDataValue) {
  804|       |    /* If type is 0 (NULL) the Variant contains a NULL value and the containing
  805|       |     * JSON object shall be omitted or replaced by the JSON literal ‘null’ (when
  806|       |     * an element of a JSON array). */
  807|   265k|    if(!src->type)
  ------------------
  |  Branch (807:8): [True: 178k, False: 87.6k]
  ------------------
  808|   178k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   178k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  809|       |
  810|       |    /* These combinations are excluded by the Variant definition. */
  811|  87.6k|    if(src->type->typeKind == UA_DATATYPEKIND_DIAGNOSTICINFO ||
  ------------------
  |  Branch (811:8): [True: 0, False: 87.6k]
  ------------------
  812|  87.6k|       (insideDataValue && src->type->typeKind == UA_DATATYPEKIND_DATAVALUE))
  ------------------
  |  Branch (812:9): [True: 9.72k, False: 77.9k]
  |  Branch (812:28): [True: 0, False: 9.72k]
  ------------------
  813|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  814|       |
  815|       |    /* Set the array type in the encoding mask */
  816|  87.6k|    const bool isArray = src->arrayLength > 0 || src->data <= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|   168k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (816:26): [True: 7.07k, False: 80.5k]
  |  Branch (816:50): [True: 1.17k, False: 79.3k]
  ------------------
  817|  87.6k|    const bool hasDimensions = isArray && src->arrayDimensionsSize > 1;
  ------------------
  |  Branch (817:32): [True: 8.25k, False: 79.3k]
  |  Branch (817:43): [True: 0, False: 8.25k]
  ------------------
  818|  87.6k|    if(src->type->typeKind == UA_DATATYPEKIND_VARIANT && !isArray)
  ------------------
  |  Branch (818:8): [True: 552, False: 87.0k]
  |  Branch (818:58): [True: 0, False: 552]
  ------------------
  819|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  820|  87.6k|    if(!isArray && src->arrayDimensionsSize > 0)
  ------------------
  |  Branch (820:8): [True: 79.3k, False: 8.25k]
  |  Branch (820:20): [True: 0, False: 79.3k]
  ------------------
  821|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  822|  87.6k|    if(hasDimensions &&
  ------------------
  |  Branch (822:8): [True: 0, False: 87.6k]
  ------------------
  823|      0|       !variantDimensionsValid(src->arrayLength, src->arrayDimensionsSize,
  ------------------
  |  Branch (823:8): [True: 0, False: 0]
  ------------------
  824|      0|                               src->arrayDimensions))
  825|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  826|       |
  827|       |    /* Enumerations lose their concrete type in a Variant and are represented
  828|       |     * as Int32 in both the Compact and Verbose encodings. */
  829|  87.6k|    const UA_DataType *valueType = src->type;
  830|  87.6k|    if(valueType->typeKind == UA_DATATYPEKIND_ENUM)
  ------------------
  |  Branch (830:8): [True: 0, False: 87.6k]
  ------------------
  831|      0|        valueType = &UA_TYPES[UA_TYPES_INT32];
  ------------------
  |  |  191|      0|#define UA_TYPES_INT32 5
  ------------------
  832|       |
  833|       |    /* Non-builtin values are wrapped in ExtensionObjects. */
  834|  87.6k|    UA_Boolean wrapEO =
  835|  87.6k|        (valueType->typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO);
  836|       |
  837|  87.6k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  87.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  838|       |
  839|       |    /* Write the type number */
  840|  87.6k|    UA_UInt32 typeId = valueType->typeKind + 1;
  841|  87.6k|    if(wrapEO)
  ------------------
  |  Branch (841:8): [True: 0, False: 87.6k]
  ------------------
  842|      0|        typeId = UA_TYPES[UA_TYPES_EXTENSIONOBJECT].typeKind + 1;
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  843|  87.6k|    ret |= writeJsonKey(ctx, UA_JSONKEY_TYPE);
  844|  87.6k|    ret |= UInt32_encodeJson(ctx, &typeId, NULL);
  845|       |
  846|       |    /* A nullable scalar with its default value has no Value field. */
  847|  87.6k|    UA_Boolean nullValue = false;
  848|  87.6k|    if(!isArray && isJsonNullable(valueType))
  ------------------
  |  Branch (848:8): [True: 79.3k, False: 8.25k]
  |  Branch (848:20): [True: 76.5k, False: 2.88k]
  ------------------
  849|  76.5k|        nullValue = (!src->data || isNull(src->data, valueType));
  ------------------
  |  Branch (849:22): [True: 0, False: 76.5k]
  |  Branch (849:36): [True: 21.3k, False: 55.1k]
  ------------------
  850|       |
  851|  87.6k|    if(!nullValue) {
  ------------------
  |  Branch (851:8): [True: 66.2k, False: 21.3k]
  ------------------
  852|  66.2k|        if(!src->data && !isArray)
  ------------------
  |  Branch (852:12): [True: 0, False: 66.2k]
  |  Branch (852:26): [True: 0, False: 0]
  ------------------
  853|      0|            return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  854|  66.2k|        ret |= writeJsonKey(ctx, UA_JSONKEY_VALUE);
  855|  66.2k|        if(!isArray) {
  ------------------
  |  Branch (855:12): [True: 57.9k, False: 8.25k]
  ------------------
  856|  57.9k|            UA_Variant value = *src;
  857|  57.9k|            value.type = valueType;
  858|  57.9k|            ret |= encodeScalarJsonWrapExtensionObject(ctx, &value);
  859|  57.9k|        } else {
  860|  8.25k|            ret |= encodeArrayJsonWrapExtensionObject(ctx, src->data,
  861|  8.25k|                                                      src->arrayLength, valueType);
  862|  8.25k|        }
  863|  66.2k|    }
  864|       |
  865|       |    /* Write the dimensions */
  866|  87.6k|    if(hasDimensions) {
  ------------------
  |  Branch (866:8): [True: 0, False: 87.6k]
  ------------------
  867|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_DIMENSIONS);
  868|      0|        ret |= encodeJsonArray(ctx, src->arrayDimensions, src->arrayDimensionsSize,
  869|      0|                               &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  225|      0|#define UA_TYPES_UINT32 6
  ------------------
  870|      0|    }
  871|       |
  872|  87.6k|    return ret;
  873|  87.6k|}
ua_types_encoding_json.c:variantDimensionsValid:
  787|    110|                       const UA_UInt32 *dimensions) {
  788|    110|    if(dimensionsSize == 0 || !dimensions)
  ------------------
  |  Branch (788:8): [True: 2, False: 108]
  |  Branch (788:31): [True: 0, False: 108]
  ------------------
  789|      2|        return false;
  790|       |
  791|    108|    size_t total = 1;
  792|    671|    for(size_t i = 0; i < dimensionsSize; i++) {
  ------------------
  |  Branch (792:23): [True: 579, False: 92]
  ------------------
  793|    579|        UA_UInt32 dimension = dimensions[i];
  794|    579|        if(dimension == 0 || total > SIZE_MAX / dimension)
  ------------------
  |  Branch (794:12): [True: 5, False: 574]
  |  Branch (794:30): [True: 11, False: 563]
  ------------------
  795|     16|            return false;
  796|    563|        total *= dimension;
  797|    563|    }
  798|     92|    return total == arrayLength;
  799|    108|}
ua_types_encoding_json.c:encodeScalarJsonWrapExtensionObject:
  730|  57.9k|encodeScalarJsonWrapExtensionObject(CtxJson *ctx, const UA_Variant *src) {
  731|  57.9k|    const UA_Boolean isBuiltin =
  732|  57.9k|        (src->type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO);
  733|  57.9k|    const void *ptr = src->data;
  734|  57.9k|    const UA_DataType *type = src->type;
  735|       |
  736|       |    /* Set up a temporary ExtensionObject to wrap the data */
  737|  57.9k|    UA_ExtensionObject eo;
  738|  57.9k|    if(!isBuiltin) {
  ------------------
  |  Branch (738:8): [True: 0, False: 57.9k]
  ------------------
  739|      0|        UA_ExtensionObject_init(&eo);
  740|      0|        eo.encoding = UA_EXTENSIONOBJECT_DECODED;
  741|      0|        eo.content.decoded.type = src->type;
  742|      0|        eo.content.decoded.data = src->data;
  743|      0|        ptr = &eo;
  744|      0|        type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  745|      0|    }
  746|       |
  747|  57.9k|    return encodeJsonJumpTable[type->typeKind](ctx, ptr, type);
  748|  57.9k|}
ua_types_encoding_json.c:encodeArrayJsonWrapExtensionObject:
  753|  8.25k|                                   size_t size, const UA_DataType *type) {
  754|  8.25k|    if(size > UA_INT32_MAX)
  ------------------
  |  |  101|  8.25k|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (754:8): [True: 0, False: 8.25k]
  ------------------
  755|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  756|       |
  757|  8.25k|    status ret = writeJsonArrStart(ctx);
  758|       |
  759|  8.25k|    u16 memSize = type->memSize;
  760|  8.25k|    const UA_Boolean isBuiltin =
  761|  8.25k|        (type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO);
  762|  8.25k|    if(isBuiltin) {
  ------------------
  |  Branch (762:8): [True: 8.25k, False: 0]
  ------------------
  763|  8.25k|        uintptr_t ptr = (uintptr_t)data;
  764|  19.2M|        for(size_t i = 0; i < size && ret == UA_STATUSCODE_GOOD; ++i) {
  ------------------
  |  |   17|  19.2M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (764:27): [True: 19.2M, False: 8.25k]
  |  Branch (764:39): [True: 19.2M, False: 0]
  ------------------
  765|  19.2M|            ret |= writeJsonArrElm(ctx, (const void*)ptr, type);
  766|  19.2M|            ptr += memSize;
  767|  19.2M|        }
  768|  8.25k|    } else {
  769|       |        /* Set up a temporary ExtensionObject to wrap the data */
  770|      0|        UA_ExtensionObject eo;
  771|      0|        UA_ExtensionObject_init(&eo);
  772|      0|        eo.encoding = UA_EXTENSIONOBJECT_DECODED;
  773|      0|        eo.content.decoded.type = type;
  774|      0|        eo.content.decoded.data = (void*)(uintptr_t)data;
  775|      0|        for(size_t i = 0; i < size && ret == UA_STATUSCODE_GOOD; ++i) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (775:27): [True: 0, False: 0]
  |  Branch (775:39): [True: 0, False: 0]
  ------------------
  776|      0|            ret |= writeJsonArrElm(ctx, &eo, &UA_TYPES[UA_TYPES_EXTENSIONOBJECT]);
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  777|      0|            eo.content.decoded.data = (void*)
  778|      0|                ((uintptr_t)eo.content.decoded.data + memSize);
  779|      0|        }
  780|      0|    }
  781|       |
  782|  8.25k|    return ret | writeJsonArrEnd(ctx, type);
  783|  8.25k|}
ua_types_encoding_json.c:Variant_encodeJson:
  875|   256k|ENCODE_JSON(Variant) {
  876|   256k|    const UA_Variant *src = (const UA_Variant*)p;
  877|   256k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   256k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  878|   256k|    res |= writeJsonObjStart(ctx);
  879|       |    res |= encodeVariantInner(ctx, src, false);
  880|   256k|    res |= writeJsonObjEnd(ctx);
  881|   256k|    return res;
  882|   256k|}
ua_types_encoding_json.c:jsoneq:
 1341|   402k|jsoneq(const char *json, const cj5_token *tok, const char *searchKey) {
 1342|       |    /* TODO: necessary?
 1343|       |       if(json == NULL
 1344|       |            || tok == NULL
 1345|       |            || searchKey == NULL) {
 1346|       |        return -1;
 1347|       |    } */
 1348|       |
 1349|   402k|    size_t len = getTokenLength(tok);
 1350|   402k|    if(tok->type == CJ5_TOKEN_STRING &&
  ------------------
  |  Branch (1350:8): [True: 402k, False: 0]
  ------------------
 1351|   402k|       strlen(searchKey) ==  len &&
  ------------------
  |  Branch (1351:8): [True: 133k, False: 268k]
  ------------------
 1352|   133k|       strncmp(json + tok->start, (const char*)searchKey, len) == 0)
  ------------------
  |  Branch (1352:8): [True: 123k, False: 10.1k]
  ------------------
 1353|   123k|        return 0;
 1354|       |
 1355|   279k|    return -1;
 1356|   402k|}
ua_types_encoding_json.c:skipObject:
 1325|   326k|skipObject(ParseCtx *ctx) {
 1326|   326k|    unsigned int end = ctx->tokens[ctx->index].end;
 1327|  66.7M|    do {
 1328|  66.7M|        ctx->index++;
 1329|  66.7M|    } while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1329:13): [True: 66.7M, False: 18.7k]
  ------------------
 1330|  66.7M|            ctx->tokens[ctx->index].start < end);
  ------------------
  |  Branch (1330:13): [True: 66.4M, False: 307k]
  ------------------
 1331|   326k|}
ua_types_encoding_json.c:isJsonNullable:
  240|   182k|isJsonNullable(const UA_DataType *type) {
  241|   182k|    return (type->typeKind >= UA_DATATYPEKIND_STRING &&
  ------------------
  |  Branch (241:13): [True: 179k, False: 2.78k]
  ------------------
  242|   179k|            type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO &&
  ------------------
  |  Branch (242:13): [True: 179k, False: 0]
  ------------------
  243|   179k|            type->typeKind != UA_DATATYPEKIND_STATUSCODE);
  ------------------
  |  Branch (243:13): [True: 179k, False: 168]
  ------------------
  244|   182k|}
ua_types_encoding_json.c:Boolean_decodeJson:
 1406|     65|DECODE_JSON(Boolean) {
 1407|     65|    UA_Boolean *dst = (UA_Boolean*)p;
 1408|     65|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1285|     65|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1286|     65|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1286:8): [True: 0, False: 65]
  |  |  ------------------
  |  | 1287|     65|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1288|     65|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1288:13): [Folded, False: 65]
  |  |  ------------------
  ------------------
 1409|     65|    CHECK_BOOL;
  ------------------
  |  | 1295|     65|#define CHECK_BOOL do {                                \
  |  | 1296|     65|    if(currentTokenType(ctx) != CJ5_TOKEN_BOOL) {      \
  |  |  ------------------
  |  |  |  Branch (1296:8): [True: 18, False: 47]
  |  |  ------------------
  |  | 1297|     18|        return UA_STATUSCODE_BADDECODINGERROR;         \
  |  |  ------------------
  |  |  |  |   44|     18|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1298|     47|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1298:14): [Folded, False: 47]
  |  |  ------------------
  ------------------
 1410|     47|    GET_TOKEN;
  ------------------
  |  | 1281|     47|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1282|     47|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1283|     47|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1283:17): [Folded, False: 47]
  |  |  ------------------
  ------------------
 1411|       |
 1412|     47|    if(tokenSize == 4 &&
  ------------------
  |  Branch (1412:8): [True: 44, False: 3]
  ------------------
 1413|     44|       (tokenData[0] | 32) == 't' && (tokenData[1] | 32) == 'r' &&
  ------------------
  |  Branch (1413:8): [True: 44, False: 0]
  |  Branch (1413:38): [True: 44, False: 0]
  ------------------
 1414|     44|       (tokenData[2] | 32) == 'u' && (tokenData[3] | 32) == 'e') {
  ------------------
  |  Branch (1414:8): [True: 44, False: 0]
  |  Branch (1414:38): [True: 44, False: 0]
  ------------------
 1415|     44|        *dst = true;
 1416|     44|    } else if(tokenSize == 5 &&
  ------------------
  |  Branch (1416:15): [True: 3, False: 0]
  ------------------
 1417|      3|              (tokenData[0] | 32) == 'f' && (tokenData[1] | 32) == 'a' &&
  ------------------
  |  Branch (1417:15): [True: 3, False: 0]
  |  Branch (1417:45): [True: 3, False: 0]
  ------------------
 1418|      3|              (tokenData[2] | 32) == 'l' && (tokenData[3] | 32) == 's' &&
  ------------------
  |  Branch (1418:15): [True: 3, False: 0]
  |  Branch (1418:45): [True: 3, False: 0]
  ------------------
 1419|      3|              (tokenData[4] | 32) == 'e') {
  ------------------
  |  Branch (1419:15): [True: 3, False: 0]
  ------------------
 1420|      3|        *dst = false;
 1421|      3|    } else {
 1422|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1423|      0|    }
 1424|       |
 1425|     47|    ctx->index++;
 1426|     47|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     47|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1427|     47|}
ua_types_encoding_json.c:SByte_decodeJson:
 1514|   160k|DECODE_JSON(SByte) {
 1515|   160k|    UA_SByte *dst = (UA_SByte*)p;
 1516|   160k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1285|   160k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1286|   160k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1286:8): [True: 0, False: 160k]
  |  |  ------------------
  |  | 1287|   160k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1288|   160k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1288:13): [Folded, False: 160k]
  |  |  ------------------
  ------------------
 1517|   160k|    CHECK_NUMBER;
  ------------------
  |  | 1290|   160k|#define CHECK_NUMBER do {                                \
  |  | 1291|   160k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1291:8): [True: 4, False: 160k]
  |  |  ------------------
  |  | 1292|      4|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1293|   160k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1293:14): [Folded, False: 160k]
  |  |  ------------------
  ------------------
 1518|   160k|    GET_TOKEN;
  ------------------
  |  | 1281|   160k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1282|   160k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1283|   160k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1283:17): [Folded, False: 160k]
  |  |  ------------------
  ------------------
 1519|   160k|    UA_Int64 out = 0;
 1520|   160k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1521|   160k|    if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   17|   320k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   64|   320k|#define UA_SBYTE_MIN (-128)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   65|   160k|#define UA_SBYTE_MAX 127
  ------------------
  |  Branch (1521:8): [True: 35, False: 160k]
  |  Branch (1521:35): [True: 91, False: 160k]
  |  Branch (1521:57): [True: 52, False: 160k]
  ------------------
 1522|    178|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    178|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1523|   160k|    *dst = (UA_SByte)out;
 1524|   160k|    ctx->index++;
 1525|   160k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   160k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1526|   160k|}
ua_types_encoding_json.c:parseSignedInteger:
 1446|  5.98M|parseSignedInteger(const char *tokenData, size_t tokenSize, UA_Int64 *dst) {
 1447|  5.98M|    size_t len = parseInt64(tokenData, tokenSize, dst);
 1448|  5.98M|    if(len == 0)
  ------------------
  |  Branch (1448:8): [True: 79, False: 5.98M]
  ------------------
 1449|     79|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     79|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1450|       |
 1451|       |    /* There must only be whitespace between the end of the parsed number and
 1452|       |     * the end of the token */
 1453|  5.98M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1453:25): [True: 905, False: 5.98M]
  ------------------
 1454|    905|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1454:12): [True: 878, False: 27]
  |  Branch (1454:35): [True: 84, False: 794]
  ------------------
 1455|     84|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     84|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1456|    905|    }
 1457|       |
 1458|  5.98M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  5.98M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1459|  5.98M|}
ua_types_encoding_json.c:Byte_decodeJson:
 1461|   276k|DECODE_JSON(Byte) {
 1462|   276k|    UA_Byte *dst = (UA_Byte*)p;
 1463|   276k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1285|   276k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1286|   276k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1286:8): [True: 0, False: 276k]
  |  |  ------------------
  |  | 1287|   276k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1288|   276k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1288:13): [Folded, False: 276k]
  |  |  ------------------
  ------------------
 1464|   276k|    CHECK_NUMBER;
  ------------------
  |  | 1290|   276k|#define CHECK_NUMBER do {                                \
  |  | 1291|   276k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1291:8): [True: 1, False: 276k]
  |  |  ------------------
  |  | 1292|      1|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1293|   276k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1293:14): [Folded, False: 276k]
  |  |  ------------------
  ------------------
 1465|   276k|    GET_TOKEN;
  ------------------
  |  | 1281|   276k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1282|   276k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1283|   276k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1283:17): [Folded, False: 276k]
  |  |  ------------------
  ------------------
 1466|   276k|    UA_UInt64 out = 0;
 1467|   276k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1468|   276k|    if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   17|   553k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   74|   276k|#define UA_BYTE_MAX 255
  ------------------
  |  Branch (1468:8): [True: 21, False: 276k]
  |  Branch (1468:35): [True: 112, False: 276k]
  ------------------
 1469|    133|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    133|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1470|   276k|    *dst = (UA_Byte)out;
 1471|   276k|    ctx->index++;
 1472|   276k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   276k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1473|   276k|}
ua_types_encoding_json.c:parseUnsignedInteger:
 1430|  6.10M|parseUnsignedInteger(const char *tokenData, size_t tokenSize, UA_UInt64 *dst) {
 1431|  6.10M|    size_t len = parseUInt64(tokenData, tokenSize, dst);
 1432|  6.10M|    if(len == 0)
  ------------------
  |  Branch (1432:8): [True: 41, False: 6.10M]
  ------------------
 1433|     41|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     41|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1434|       |
 1435|       |    /* There must only be whitespace between the end of the parsed number and
 1436|       |     * the end of the token */
 1437|  6.10M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1437:25): [True: 1.74k, False: 6.10M]
  ------------------
 1438|  1.74k|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1438:12): [True: 1.68k, False: 59]
  |  Branch (1438:35): [True: 82, False: 1.59k]
  ------------------
 1439|     82|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     82|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1440|  1.74k|    }
 1441|       |
 1442|  6.10M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  6.10M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1443|  6.10M|}
ua_types_encoding_json.c:Int16_decodeJson:
 1528|   267k|DECODE_JSON(Int16) {
 1529|   267k|    UA_Int16 *dst = (UA_Int16*)p;
 1530|   267k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1285|   267k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1286|   267k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1286:8): [True: 0, False: 267k]
  |  |  ------------------
  |  | 1287|   267k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1288|   267k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1288:13): [Folded, False: 267k]
  |  |  ------------------
  ------------------
 1531|   267k|    CHECK_NUMBER;
  ------------------
  |  | 1290|   267k|#define CHECK_NUMBER do {                                \
  |  | 1291|   267k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1291:8): [True: 2, False: 267k]
  |  |  ------------------
  |  | 1292|      2|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1293|   267k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1293:14): [Folded, False: 267k]
  |  |  ------------------
  ------------------
 1532|   267k|    GET_TOKEN;
  ------------------
  |  | 1281|   267k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1282|   267k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1283|   267k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1283:17): [Folded, False: 267k]
  |  |  ------------------
  ------------------
 1533|   267k|    UA_Int64 out = 0;
 1534|   267k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1535|   267k|    if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   17|   534k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   82|   534k|#define UA_INT16_MIN (-32768)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   83|   267k|#define UA_INT16_MAX 32767
  ------------------
  |  Branch (1535:8): [True: 48, False: 267k]
  |  Branch (1535:35): [True: 74, False: 267k]
  |  Branch (1535:57): [True: 23, False: 267k]
  ------------------
 1536|    145|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    145|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1537|   267k|    *dst = (UA_Int16)out;
 1538|   267k|    ctx->index++;
 1539|   267k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   267k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1540|   267k|}
ua_types_encoding_json.c:UInt16_decodeJson:
 1475|   447k|DECODE_JSON(UInt16) {
 1476|   447k|    UA_UInt16 *dst = (UA_UInt16*)p;
 1477|   447k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1285|   447k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1286|   447k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1286:8): [True: 0, False: 447k]
  |  |  ------------------
  |  | 1287|   447k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1288|   447k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1288:13): [Folded, False: 447k]
  |  |  ------------------
  ------------------
 1478|   447k|    CHECK_NUMBER;
  ------------------
  |  | 1290|   447k|#define CHECK_NUMBER do {                                \
  |  | 1291|   447k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1291:8): [True: 4, False: 447k]
  |  |  ------------------
  |  | 1292|      4|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1293|   447k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1293:14): [Folded, False: 447k]
  |  |  ------------------
  ------------------
 1479|   447k|    GET_TOKEN;
  ------------------
  |  | 1281|   447k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1282|   447k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1283|   447k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1283:17): [Folded, False: 447k]
  |  |  ------------------
  ------------------
 1480|   447k|    UA_UInt64 out = 0;
 1481|   447k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1482|   447k|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   17|   894k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   92|   447k|#define UA_UINT16_MAX 65535
  ------------------
  |  Branch (1482:8): [True: 31, False: 447k]
  |  Branch (1482:35): [True: 89, False: 447k]
  ------------------
 1483|    120|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    120|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1484|   447k|    *dst = (UA_UInt16)out;
 1485|   447k|    ctx->index++;
 1486|   447k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   447k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1487|   447k|}
ua_types_encoding_json.c:Int32_decodeJson:
 1542|  3.32M|DECODE_JSON(Int32) {
 1543|  3.32M|    UA_Int32 *dst = (UA_Int32*)p;
 1544|  3.32M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1285|  3.32M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1286|  3.32M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1286:8): [True: 0, False: 3.32M]
  |  |  ------------------
  |  | 1287|  3.32M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1288|  3.32M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1288:13): [Folded, False: 3.32M]
  |  |  ------------------
  ------------------
 1545|  3.32M|    CHECK_NUMBER;
  ------------------
  |  | 1290|  3.32M|#define CHECK_NUMBER do {                                \
  |  | 1291|  3.32M|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1291:8): [True: 3, False: 3.32M]
  |  |  ------------------
  |  | 1292|      3|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1293|  3.32M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1293:14): [Folded, False: 3.32M]
  |  |  ------------------
  ------------------
 1546|  3.32M|    GET_TOKEN;
  ------------------
  |  | 1281|  3.32M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1282|  3.32M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1283|  3.32M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1283:17): [Folded, False: 3.32M]
  |  |  ------------------
  ------------------
 1547|  3.32M|    UA_Int64 out = 0;
 1548|  3.32M|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1549|  3.32M|    if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   17|  6.64M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |  100|  6.64M|#define UA_INT32_MIN ((int32_t)-2147483648LL)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |  101|  3.32M|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (1549:8): [True: 34, False: 3.32M]
  |  Branch (1549:35): [True: 39, False: 3.32M]
  |  Branch (1549:57): [True: 4, False: 3.32M]
  ------------------
 1550|     77|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     77|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1551|  3.32M|    *dst = (UA_Int32)out;
 1552|  3.32M|    ctx->index++;
 1553|  3.32M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  3.32M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1554|  3.32M|}
ua_types_encoding_json.c:UInt32_decodeJson:
 1489|   675k|DECODE_JSON(UInt32) {
 1490|   675k|    UA_UInt32 *dst = (UA_UInt32*)p;
 1491|   675k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1285|   675k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1286|   675k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1286:8): [True: 0, False: 675k]
  |  |  ------------------
  |  | 1287|   675k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1288|   675k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1288:13): [Folded, False: 675k]
  |  |  ------------------
  ------------------
 1492|   675k|    CHECK_NUMBER;
  ------------------
  |  | 1290|   675k|#define CHECK_NUMBER do {                                \
  |  | 1291|   675k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1291:8): [True: 6, False: 675k]
  |  |  ------------------
  |  | 1292|      6|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1293|   675k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1293:14): [Folded, False: 675k]
  |  |  ------------------
  ------------------
 1493|   675k|    GET_TOKEN;
  ------------------
  |  | 1281|   675k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1282|   675k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1283|   675k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1283:17): [Folded, False: 675k]
  |  |  ------------------
  ------------------
 1494|   675k|    UA_UInt64 out = 0;
 1495|   675k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1496|   675k|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |   17|  1.35M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |  110|   675k|#define UA_UINT32_MAX 4294967295UL
  ------------------
  |  Branch (1496:8): [True: 31, False: 675k]
  |  Branch (1496:35): [True: 28, False: 675k]
  ------------------
 1497|     59|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     59|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1498|   675k|    *dst = (UA_UInt32)out;
 1499|   675k|    ctx->index++;
 1500|   675k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   675k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1501|   675k|}
ua_types_encoding_json.c:Int64_decodeJson:
 1556|  2.23M|DECODE_JSON(Int64) {
 1557|  2.23M|    UA_Int64 *dst = (UA_Int64*)p;
 1558|  2.23M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1285|  2.23M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1286|  2.23M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1286:8): [True: 0, False: 2.23M]
  |  |  ------------------
  |  | 1287|  2.23M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1288|  2.23M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1288:13): [Folded, False: 2.23M]
  |  |  ------------------
  ------------------
 1559|  2.23M|    GET_TOKEN;
  ------------------
  |  | 1281|  2.23M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1282|  2.23M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1283|  2.23M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1283:17): [Folded, False: 2.23M]
  |  |  ------------------
  ------------------
 1560|  2.23M|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, dst);
 1561|  2.23M|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  2.23M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1561:8): [True: 46, False: 2.23M]
  ------------------
 1562|     46|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     46|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1563|  2.23M|    ctx->index++;
 1564|  2.23M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  2.23M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1565|  2.23M|}
ua_types_encoding_json.c:UInt64_decodeJson:
 1503|  4.70M|DECODE_JSON(UInt64) {
 1504|  4.70M|    UA_UInt64 *dst = (UA_UInt64*)p;
 1505|  4.70M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1285|  4.70M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1286|  4.70M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1286:8): [True: 0, False: 4.70M]
  |  |  ------------------
  |  | 1287|  4.70M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1288|  4.70M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1288:13): [Folded, False: 4.70M]
  |  |  ------------------
  ------------------
 1506|  4.70M|    GET_TOKEN;
  ------------------
  |  | 1281|  4.70M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1282|  4.70M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1283|  4.70M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1283:17): [Folded, False: 4.70M]
  |  |  ------------------
  ------------------
 1507|  4.70M|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, dst);
 1508|  4.70M|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  4.70M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1508:8): [True: 40, False: 4.70M]
  ------------------
 1509|     40|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     40|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1510|  4.70M|    ctx->index++;
 1511|  4.70M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.70M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1512|  4.70M|}
ua_types_encoding_json.c:Float_decodeJson:
 1628|   189k|DECODE_JSON(Float) {
 1629|   189k|    UA_Float *dst = (UA_Float*)p;
 1630|   189k|    UA_Double v = 0.0;
 1631|       |    UA_StatusCode res = Double_decodeJson(ctx, &v, NULL);
 1632|   189k|    *dst = (UA_Float)v;
 1633|   189k|    return res;
 1634|   189k|}
ua_types_encoding_json.c:Double_decodeJson:
 1568|  1.15M|DECODE_JSON(Double) {
 1569|  1.15M|    UA_Double *dst = (UA_Double*)p;
 1570|  1.15M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1285|  1.15M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1286|  1.15M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1286:8): [True: 0, False: 1.15M]
  |  |  ------------------
  |  | 1287|  1.15M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1288|  1.15M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1288:13): [Folded, False: 1.15M]
  |  |  ------------------
  ------------------
 1571|  1.15M|    GET_TOKEN;
  ------------------
  |  | 1281|  1.15M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1282|  1.15M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1283|  1.15M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1283:17): [Folded, False: 1.15M]
  |  |  ------------------
  ------------------
 1572|       |
 1573|       |    /* https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/
 1574|       |     * Maximum digit counts for select IEEE floating-point formats: 1074
 1575|       |     * Sanity check.
 1576|       |     */
 1577|  1.15M|    if(tokenSize > 2000)
  ------------------
  |  Branch (1577:8): [True: 1, False: 1.15M]
  ------------------
 1578|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1579|       |
 1580|  1.15M|    cj5_token_type tokenType = currentTokenType(ctx);
 1581|       |
 1582|       |    /* It could be a String with Nan, Infinity */
 1583|  1.15M|    if(tokenType == CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (1583:8): [True: 2.73k, False: 1.15M]
  ------------------
 1584|  2.73k|        ctx->index++;
 1585|       |
 1586|  2.73k|        if(tokenSize == 8 && memcmp(tokenData, "Infinity", 8) == 0) {
  ------------------
  |  Branch (1586:12): [True: 569, False: 2.16k]
  |  Branch (1586:30): [True: 559, False: 10]
  ------------------
 1587|    559|            *dst = INFINITY;
 1588|    559|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    559|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1589|    559|        }
 1590|       |
 1591|  2.17k|        if(tokenSize == 9 && memcmp(tokenData, "-Infinity", 9) == 0) {
  ------------------
  |  Branch (1591:12): [True: 533, False: 1.64k]
  |  Branch (1591:30): [True: 527, False: 6]
  ------------------
 1592|       |            /* workaround an MSVC 2013 issue */
 1593|    527|            *dst = -INFINITY;
 1594|    527|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    527|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1595|    527|        }
 1596|       |
 1597|  1.64k|        if(tokenSize == 3 && memcmp(tokenData, "NaN", 3) == 0) {
  ------------------
  |  Branch (1597:12): [True: 1.14k, False: 501]
  |  Branch (1597:30): [True: 1.13k, False: 12]
  ------------------
 1598|  1.13k|            *dst = NAN;
 1599|  1.13k|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.13k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1600|  1.13k|        }
 1601|       |
 1602|    513|        if(tokenSize == 4 && memcmp(tokenData, "-NaN", 4) == 0) {
  ------------------
  |  Branch (1602:12): [True: 452, False: 61]
  |  Branch (1602:30): [True: 432, False: 20]
  ------------------
 1603|    432|            *dst = NAN;
 1604|    432|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    432|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1605|    432|        }
 1606|       |
 1607|     81|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     81|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1608|    513|    }
 1609|       |
 1610|  1.15M|    if(tokenType != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1610:8): [True: 2, False: 1.15M]
  ------------------
 1611|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1612|       |
 1613|  1.15M|    size_t len = parseDouble(tokenData, tokenSize, dst);
 1614|  1.15M|    if(len == 0)
  ------------------
  |  Branch (1614:8): [True: 3, False: 1.15M]
  ------------------
 1615|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1616|       |
 1617|       |    /* There must only be whitespace between the end of the parsed number and
 1618|       |     * the end of the token */
 1619|  1.15M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1619:25): [True: 19, False: 1.15M]
  ------------------
 1620|     19|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1620:12): [True: 19, False: 0]
  |  Branch (1620:35): [True: 19, False: 0]
  ------------------
 1621|     19|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     19|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1622|     19|    }
 1623|       |
 1624|  1.15M|    ctx->index++;
 1625|  1.15M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.15M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1626|  1.15M|}
ua_types_encoding_json.c:String_decodeJson:
 1646|   101k|DECODE_JSON(String) {
 1647|   101k|    UA_String *dst = (UA_String*)p;
 1648|   101k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1285|   101k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1286|   101k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1286:8): [True: 0, False: 101k]
  |  |  ------------------
  |  | 1287|   101k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1288|   101k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1288:13): [Folded, False: 101k]
  |  |  ------------------
  ------------------
 1649|   101k|    CHECK_NULL_SKIP;
  ------------------
  |  | 1310|   101k|#define CHECK_NULL_SKIP do {                         \
  |  | 1311|   101k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1311:8): [True: 0, False: 101k]
  |  |  ------------------
  |  | 1312|      0|        ctx->index++;                                \
  |  | 1313|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1314|   101k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1314:14): [Folded, False: 101k]
  |  |  ------------------
  ------------------
 1650|   101k|    CHECK_STRING;
  ------------------
  |  | 1300|   101k|#define CHECK_STRING do {                                \
  |  | 1301|   101k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1301:8): [True: 27, False: 101k]
  |  |  ------------------
  |  | 1302|     27|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     27|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1303|   101k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1303:14): [Folded, False: 101k]
  |  |  ------------------
  ------------------
 1651|   101k|    GET_TOKEN;
  ------------------
  |  | 1281|   101k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1282|   101k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1283|   101k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1283:17): [Folded, False: 101k]
  |  |  ------------------
  ------------------
 1652|   101k|    (void)tokenData;
 1653|       |
 1654|       |    /* Empty string? */
 1655|   101k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1655:8): [True: 6.87k, False: 94.5k]
  ------------------
 1656|  6.87k|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|  6.87k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1657|  6.87k|        dst->length = 0;
 1658|  6.87k|        ctx->index++;
 1659|  6.87k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  6.87k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1660|  6.87k|    }
 1661|       |
 1662|       |    /* The decoded utf8 is at most of the same length as the source string */
 1663|  94.5k|    char *outBuf = (char*)UA_malloc(tokenSize+1);
  ------------------
  |  |   18|  94.5k|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 1664|  94.5k|    if(!outBuf)
  ------------------
  |  Branch (1664:8): [True: 0, False: 94.5k]
  ------------------
 1665|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1666|       |
 1667|       |    /* Decode the string */
 1668|  94.5k|    cj5_result r;
 1669|  94.5k|    r.tokens = ctx->tokens;
 1670|  94.5k|    r.num_tokens = (unsigned int)ctx->tokensSize;
 1671|  94.5k|    r.json5 = ctx->json5;
 1672|  94.5k|    unsigned int len = 0;
 1673|  94.5k|    cj5_error_code err = cj5_get_str(&r, (unsigned int)ctx->index, outBuf, &len);
 1674|  94.5k|    if(err != CJ5_ERROR_NONE) {
  ------------------
  |  Branch (1674:8): [True: 113, False: 94.4k]
  ------------------
 1675|    113|        UA_free(outBuf);
  ------------------
  |  |   19|    113|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1676|    113|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    113|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1677|    113|    }
 1678|       |
 1679|       |    /* Set the output */
 1680|  94.4k|    dst->length = len;
 1681|  94.4k|    if(dst->length > 0) {
  ------------------
  |  Branch (1681:8): [True: 94.4k, False: 0]
  ------------------
 1682|  94.4k|        dst->data = (UA_Byte*)outBuf;
 1683|  94.4k|    } else {
 1684|      0|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|      0|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1685|      0|        UA_free(outBuf);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1686|      0|    }
 1687|       |
 1688|  94.4k|    ctx->index++;
 1689|  94.4k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  94.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1690|  94.5k|}
ua_types_encoding_json.c:DateTime_decodeJson:
 1845|    771|DECODE_JSON(DateTime) {
 1846|    771|    UA_DateTime *dst = (UA_DateTime*)p;
 1847|    771|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1285|    771|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1286|    771|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1286:8): [True: 0, False: 771]
  |  |  ------------------
  |  | 1287|    771|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1288|    771|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1288:13): [Folded, False: 771]
  |  |  ------------------
  ------------------
 1848|    771|    CHECK_NULL_SKIP;
  ------------------
  |  | 1310|    771|#define CHECK_NULL_SKIP do {                         \
  |  | 1311|    771|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1311:8): [True: 0, False: 771]
  |  |  ------------------
  |  | 1312|      0|        ctx->index++;                                \
  |  | 1313|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1314|    771|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1314:14): [Folded, False: 771]
  |  |  ------------------
  ------------------
 1849|    771|    CHECK_STRING;
  ------------------
  |  | 1300|    771|#define CHECK_STRING do {                                \
  |  | 1301|    771|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1301:8): [True: 3, False: 768]
  |  |  ------------------
  |  | 1302|      3|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1303|    768|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1303:14): [Folded, False: 768]
  |  |  ------------------
  ------------------
 1850|    768|    GET_TOKEN;
  ------------------
  |  | 1281|    768|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1282|    768|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1283|    768|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1283:17): [Folded, False: 768]
  |  |  ------------------
  ------------------
 1851|       |
 1852|       |    /* YYYY-MM-DDTHH:MM:SS[.fffffff]Z */
 1853|    768|    if(tokenSize < 20 || tokenData[tokenSize-1] != 'Z' ||
  ------------------
  |  Branch (1853:8): [True: 1, False: 767]
  |  Branch (1853:26): [True: 17, False: 750]
  ------------------
 1854|    750|       tokenData[4] != '-' || tokenData[7] != '-' ||
  ------------------
  |  Branch (1854:8): [True: 8, False: 742]
  |  Branch (1854:31): [True: 1, False: 741]
  ------------------
 1855|    741|       tokenData[10] != 'T' || tokenData[13] != ':' ||
  ------------------
  |  Branch (1855:8): [True: 1, False: 740]
  |  Branch (1855:32): [True: 5, False: 735]
  ------------------
 1856|    735|       tokenData[16] != ':')
  ------------------
  |  Branch (1856:8): [True: 4, False: 731]
  ------------------
 1857|     37|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     37|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1858|       |
 1859|    731|    const size_t positions[6] = {0, 5, 8, 11, 14, 17};
 1860|    731|    UA_UInt16 values[6];
 1861|  5.09k|    for(size_t i = 0; i < 6; i++) {
  ------------------
  |  Branch (1861:23): [True: 4.37k, False: 727]
  ------------------
 1862|  4.37k|        UA_UInt64 value = 0;
 1863|  4.37k|        size_t digits = (i == 0) ? 4 : 2;
  ------------------
  |  Branch (1863:25): [True: 731, False: 3.64k]
  ------------------
 1864|  4.37k|        if(parseUInt64(&tokenData[positions[i]], digits, &value) != digits)
  ------------------
  |  Branch (1864:12): [True: 4, False: 4.36k]
  ------------------
 1865|      4|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1866|  4.36k|        values[i] = (UA_UInt16)value;
 1867|  4.36k|    }
 1868|       |
 1869|    727|    UA_UInt16 daysInMonth = 31;
 1870|    727|    switch(values[1]) {
 1871|      0|    case 2:
  ------------------
  |  Branch (1871:5): [True: 0, False: 727]
  ------------------
 1872|      0|        daysInMonth = (UA_UInt16)
 1873|      0|            (((values[0] % 4 == 0 && values[0] % 100 != 0) ||
  ------------------
  |  Branch (1873:16): [True: 0, False: 0]
  |  Branch (1873:38): [True: 0, False: 0]
  ------------------
 1874|      0|              values[0] % 400 == 0) ? 29 : 28);
  ------------------
  |  Branch (1874:15): [True: 0, False: 0]
  ------------------
 1875|      0|        break;
 1876|      1|    case 4: case 6: case 9: case 11:
  ------------------
  |  Branch (1876:5): [True: 0, False: 727]
  |  Branch (1876:13): [True: 0, False: 727]
  |  Branch (1876:21): [True: 0, False: 727]
  |  Branch (1876:29): [True: 1, False: 726]
  ------------------
 1877|      1|        daysInMonth = 30;
 1878|      1|        break;
 1879|    726|    default:
  ------------------
  |  Branch (1879:5): [True: 726, False: 1]
  ------------------
 1880|    726|        break;
 1881|    727|    }
 1882|    727|    if(values[0] < 1 || values[1] < 1 || values[1] > 12 ||
  ------------------
  |  Branch (1882:8): [True: 0, False: 727]
  |  Branch (1882:25): [True: 0, False: 727]
  |  Branch (1882:42): [True: 1, False: 726]
  ------------------
 1883|    726|       values[2] < 1 || values[2] > daysInMonth || values[3] > 23 ||
  ------------------
  |  Branch (1883:8): [True: 1, False: 725]
  |  Branch (1883:25): [True: 1, False: 724]
  |  Branch (1883:52): [True: 0, False: 724]
  ------------------
 1884|    724|       values[4] > 59 || values[5] > 59)
  ------------------
  |  Branch (1884:8): [True: 0, False: 724]
  |  Branch (1884:26): [True: 0, False: 724]
  ------------------
 1885|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1886|       |
 1887|    724|    size_t pos = 19;
 1888|    724|    UA_UInt32 fraction = 0;
 1889|    724|    size_t fractionDigits = 0;
 1890|    724|    if(pos < tokenSize - 1 &&
  ------------------
  |  Branch (1890:8): [True: 0, False: 724]
  ------------------
 1891|      0|       (tokenData[pos] == '.' || tokenData[pos] == ',')) {
  ------------------
  |  Branch (1891:9): [True: 0, False: 0]
  |  Branch (1891:34): [True: 0, False: 0]
  ------------------
 1892|      0|        pos++;
 1893|      0|        while(pos < tokenSize - 1 && tokenData[pos] >= '0' &&
  ------------------
  |  Branch (1893:15): [True: 0, False: 0]
  |  Branch (1893:38): [True: 0, False: 0]
  ------------------
 1894|      0|              tokenData[pos] <= '9') {
  ------------------
  |  Branch (1894:15): [True: 0, False: 0]
  ------------------
 1895|      0|            if(fractionDigits < 7)
  ------------------
  |  Branch (1895:16): [True: 0, False: 0]
  ------------------
 1896|      0|                fraction = fraction * 10 + (UA_UInt32)(tokenData[pos] - '0');
 1897|      0|            fractionDigits++;
 1898|      0|            pos++;
 1899|      0|        }
 1900|      0|        if(fractionDigits == 0)
  ------------------
  |  Branch (1900:12): [True: 0, False: 0]
  ------------------
 1901|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1902|      0|        while(fractionDigits < 7) {
  ------------------
  |  Branch (1902:15): [True: 0, False: 0]
  ------------------
 1903|      0|            fraction *= 10;
 1904|      0|            fractionDigits++;
 1905|      0|        }
 1906|      0|    }
 1907|    724|    if(pos != tokenSize - 1)
  ------------------
  |  Branch (1907:8): [True: 0, False: 724]
  ------------------
 1908|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1909|       |
 1910|       |    /* The minimum JSON DateTime is the null value. */
 1911|    724|    if(values[0] == 1 && values[1] == 1 && values[2] == 1 &&
  ------------------
  |  Branch (1911:8): [True: 724, False: 0]
  |  Branch (1911:26): [True: 724, False: 0]
  |  Branch (1911:44): [True: 724, False: 0]
  ------------------
 1912|    724|       values[3] == 0 && values[4] == 0 && values[5] == 0 && fraction == 0) {
  ------------------
  |  Branch (1912:8): [True: 724, False: 0]
  |  Branch (1912:26): [True: 724, False: 0]
  |  Branch (1912:44): [True: 724, False: 0]
  |  Branch (1912:62): [True: 724, False: 0]
  ------------------
 1913|    724|        *dst = 0;
 1914|    724|    } else {
 1915|      0|        UA_DateTimeStruct date;
 1916|      0|        memset(&date, 0, sizeof(date));
 1917|      0|        date.year = (UA_Int16)values[0];
 1918|      0|        date.month = values[1];
 1919|      0|        date.day = values[2];
 1920|      0|        date.hour = values[3];
 1921|      0|        date.min = values[4];
 1922|      0|        date.sec = values[5];
 1923|      0|        date.milliSec = (UA_UInt16)(fraction / 10000);
 1924|      0|        date.microSec = (UA_UInt16)((fraction % 10000) / 10);
 1925|      0|        date.nanoSec = (UA_UInt16)((fraction % 10) * 100);
 1926|      0|        *dst = UA_DateTime_fromStruct(date);
 1927|      0|    }
 1928|       |
 1929|    724|    ctx->index++;
 1930|    724|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    724|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1931|    724|}
ua_types_encoding_json.c:Guid_decodeJson:
 1636|  1.34k|DECODE_JSON(Guid) {
 1637|  1.34k|    UA_Guid *dst = (UA_Guid*)p;
 1638|  1.34k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1285|  1.34k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1286|  1.34k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1286:8): [True: 0, False: 1.34k]
  |  |  ------------------
  |  | 1287|  1.34k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1288|  1.34k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1288:13): [Folded, False: 1.34k]
  |  |  ------------------
  ------------------
 1639|  1.34k|    CHECK_STRING;
  ------------------
  |  | 1300|  1.34k|#define CHECK_STRING do {                                \
  |  | 1301|  1.34k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1301:8): [True: 8, False: 1.33k]
  |  |  ------------------
  |  | 1302|      8|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      8|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1303|  1.33k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1303:14): [Folded, False: 1.33k]
  |  |  ------------------
  ------------------
 1640|  1.33k|    GET_TOKEN;
  ------------------
  |  | 1281|  1.33k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1282|  1.33k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1283|  1.33k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1283:17): [Folded, False: 1.33k]
  |  |  ------------------
  ------------------
 1641|  1.33k|    UA_String str = {tokenSize, (UA_Byte*)(uintptr_t)tokenData};
 1642|  1.33k|    ctx->index++;
 1643|  1.33k|    return UA_Guid_parse(dst, str);
 1644|  1.34k|}
ua_types_encoding_json.c:ByteString_decodeJson:
 1741|  1.73k|DECODE_JSON(ByteString) {
 1742|  1.73k|    UA_ByteString *dst = (UA_ByteString*)p;
 1743|  1.73k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1285|  1.73k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1286|  1.73k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1286:8): [True: 0, False: 1.73k]
  |  |  ------------------
  |  | 1287|  1.73k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1288|  1.73k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1288:13): [Folded, False: 1.73k]
  |  |  ------------------
  ------------------
 1744|  1.73k|    CHECK_NULL_SKIP;
  ------------------
  |  | 1310|  1.73k|#define CHECK_NULL_SKIP do {                         \
  |  | 1311|  1.73k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1311:8): [True: 0, False: 1.73k]
  |  |  ------------------
  |  | 1312|      0|        ctx->index++;                                \
  |  | 1313|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1314|  1.73k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1314:14): [Folded, False: 1.73k]
  |  |  ------------------
  ------------------
 1745|  1.73k|    CHECK_STRING;
  ------------------
  |  | 1300|  1.73k|#define CHECK_STRING do {                                \
  |  | 1301|  1.73k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1301:8): [True: 8, False: 1.72k]
  |  |  ------------------
  |  | 1302|      8|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      8|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1303|  1.72k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1303:14): [Folded, False: 1.72k]
  |  |  ------------------
  ------------------
 1746|  1.72k|    GET_TOKEN;
  ------------------
  |  | 1281|  1.72k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1282|  1.72k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1283|  1.72k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1283:17): [Folded, False: 1.72k]
  |  |  ------------------
  ------------------
 1747|       |
 1748|       |    /* Empty bytestring? */
 1749|  1.72k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1749:8): [True: 1.35k, False: 365]
  ------------------
 1750|  1.35k|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|  1.35k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1751|  1.35k|        dst->length = 0;
 1752|  1.35k|    } else {
 1753|    365|        size_t flen = 0;
 1754|    365|        unsigned char* unB64 =
 1755|    365|            UA_unbase64((const unsigned char*)tokenData, tokenSize, &flen);
 1756|    365|        if(unB64 == 0)
  ------------------
  |  Branch (1756:12): [True: 56, False: 309]
  ------------------
 1757|     56|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     56|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1758|    309|        dst->data = (u8*)unB64;
 1759|    309|        dst->length = flen;
 1760|    309|    }
 1761|       |
 1762|  1.66k|    ctx->index++;
 1763|  1.66k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.66k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1764|  1.72k|}
ua_types_encoding_json.c:NodeId_decodeJson:
 1822|  30.3k|DECODE_JSON(NodeId) {
 1823|  30.3k|    UA_NodeId *dst = (UA_NodeId*)p;
 1824|  30.3k|    UA_String str;
 1825|  30.3k|    UA_String_init(&str);
 1826|  30.3k|    status res = String_decodeJson(ctx, &str, NULL);
 1827|  30.3k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  30.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1827:8): [True: 30.2k, False: 50]
  ------------------
 1828|  30.2k|        res = UA_NodeId_parseEx(dst, str, ctx->namespaceMapping);
 1829|  30.3k|    UA_String_clear(&str);
 1830|  30.3k|    return res;
 1831|  30.3k|}
ua_types_encoding_json.c:ExpandedNodeId_decodeJson:
 1833|  22.7k|DECODE_JSON(ExpandedNodeId) {
 1834|  22.7k|    UA_ExpandedNodeId *dst = (UA_ExpandedNodeId*)p;
 1835|  22.7k|    UA_String str;
 1836|  22.7k|    UA_String_init(&str);
 1837|  22.7k|    status res = String_decodeJson(ctx, &str, NULL);
 1838|  22.7k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  22.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1838:8): [True: 22.7k, False: 21]
  ------------------
 1839|  22.7k|        res = UA_ExpandedNodeId_parseEx(dst, str, ctx->namespaceMapping,
 1840|  22.7k|                                        ctx->serverUrisSize, ctx->serverUris);
 1841|  22.7k|    UA_String_clear(&str);
 1842|  22.7k|    return res;
 1843|  22.7k|}
ua_types_encoding_json.c:StatusCode_decodeJson:
 1933|  1.28k|DECODE_JSON(StatusCode) {
 1934|  1.28k|    UA_StatusCode *dst = (UA_StatusCode*)p;
 1935|  1.28k|    CHECK_OBJECT;
  ------------------
  |  | 1305|  1.28k|#define CHECK_OBJECT do {                                \
  |  | 1306|  1.28k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1306:8): [True: 4, False: 1.28k]
  |  |  ------------------
  |  | 1307|      4|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1308|  1.28k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1308:14): [Folded, False: 1.28k]
  |  |  ------------------
  ------------------
 1936|  1.28k|    DecodeEntry entries[2] = {
 1937|  1.28k|        {UA_JSONKEY_CODE, dst, NULL, false, &UA_TYPES[UA_TYPES_UINT32]},
  ------------------
  |  |  225|  1.28k|#define UA_TYPES_UINT32 6
  ------------------
 1938|  1.28k|        {UA_JSONKEY_SYMBOL, NULL, NULL, false, NULL}
 1939|  1.28k|    };
 1940|  1.28k|    return decodeFields(ctx, entries, 2);
 1941|  1.28k|}
ua_types_encoding_json.c:QualifiedName_decodeJson:
 1776|  45.8k|DECODE_JSON(QualifiedName) {
 1777|  45.8k|    UA_QualifiedName *dst = (UA_QualifiedName*)p;
 1778|  45.8k|    CHECK_NULL_SKIP;
  ------------------
  |  | 1310|  45.8k|#define CHECK_NULL_SKIP do {                         \
  |  | 1311|  45.8k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1311:8): [True: 0, False: 45.8k]
  |  |  ------------------
  |  | 1312|      0|        ctx->index++;                                \
  |  | 1313|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1314|  45.8k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1314:14): [Folded, False: 45.8k]
  |  |  ------------------
  ------------------
 1779|  45.8k|    UA_String str;
 1780|  45.8k|    UA_String_init(&str);
 1781|  45.8k|    status res = String_decodeJson(ctx, &str, NULL);
 1782|  45.8k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  45.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1782:8): [True: 45.8k, False: 36]
  ------------------
 1783|  45.8k|        res = UA_QualifiedName_parseEx(dst, str, ctx->namespaceMapping);
 1784|  45.8k|    UA_String_clear(&str);
 1785|  45.8k|    return res;
 1786|  45.8k|}
ua_types_encoding_json.c:LocalizedText_decodeJson:
 1766|   552k|DECODE_JSON(LocalizedText) {
 1767|   552k|    UA_LocalizedText *dst = (UA_LocalizedText*)p;
 1768|   552k|    CHECK_OBJECT;
  ------------------
  |  | 1305|   552k|#define CHECK_OBJECT do {                                \
  |  | 1306|   552k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1306:8): [True: 4, False: 552k]
  |  |  ------------------
  |  | 1307|      4|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1308|   552k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1308:14): [Folded, False: 552k]
  |  |  ------------------
  ------------------
 1769|   552k|    DecodeEntry entries[2] = {
 1770|   552k|        {UA_JSONKEY_LOCALE, &dst->locale, NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  395|   552k|#define UA_TYPES_STRING 11
  ------------------
 1771|   552k|        {UA_JSONKEY_TEXT, &dst->text, NULL, false, &UA_TYPES[UA_TYPES_STRING]}
  ------------------
  |  |  395|   552k|#define UA_TYPES_STRING 11
  ------------------
 1772|   552k|    };
 1773|   552k|    return decodeFields(ctx, entries, 2);
 1774|   552k|}
ua_types_encoding_json.c:ExtensionObject_decodeJson:
 2295|   261k|DECODE_JSON(ExtensionObject) {
 2296|   261k|    UA_ExtensionObject *dst = (UA_ExtensionObject*)p;
 2297|   261k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1310|   261k|#define CHECK_NULL_SKIP do {                         \
  |  | 1311|   261k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1311:8): [True: 0, False: 261k]
  |  |  ------------------
  |  | 1312|      0|        ctx->index++;                                \
  |  | 1313|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1314|   261k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1314:14): [Folded, False: 261k]
  |  |  ------------------
  ------------------
 2298|   261k|    CHECK_OBJECT;
  ------------------
  |  | 1305|   261k|#define CHECK_OBJECT do {                                \
  |  | 1306|   261k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1306:8): [True: 8, False: 261k]
  |  |  ------------------
  |  | 1307|      8|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      8|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1308|   261k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1308:14): [Folded, False: 261k]
  |  |  ------------------
  ------------------
 2299|       |
 2300|       |    /* Empty object -> Null ExtensionObject */
 2301|   261k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (2301:8): [True: 261k, False: 195]
  ------------------
 2302|   261k|        ctx->index++; /* Skip the empty ExtensionObject */
 2303|   261k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   261k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2304|   261k|    }
 2305|       |
 2306|       |    /* Scan the object once for metadata and duplicate keys. */
 2307|    195|    size_t beginIndex = ctx->index;
 2308|    195|    JsonFieldIndex fields[3] = {
 2309|    195|        {UA_JSONKEY_TYPEID, SIZE_MAX},
 2310|    195|        {UA_JSONKEY_ENCODING, SIZE_MAX},
 2311|    195|        {UA_JSONKEY_BODY, SIZE_MAX}
 2312|    195|    };
 2313|    195|    status ret = scanObjectFields(ctx, fields, 3);
 2314|    195|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    195|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2314:8): [True: 7, False: 188]
  ------------------
 2315|      7|        return ret;
 2316|       |
 2317|       |    /* Decode the optional non-JSON encoding. */
 2318|    188|    UA_UInt64 encoding = 0;
 2319|    188|    size_t encIndex = fields[1].valueIndex;
 2320|    188|    if(encIndex != SIZE_MAX) {
  ------------------
  |  Branch (2320:8): [True: 39, False: 149]
  ------------------
 2321|     39|        const char *extObjEncoding = &ctx->json5[ctx->tokens[encIndex].start];
 2322|     39|        size_t len = parseUInt64(extObjEncoding,
 2323|     39|                                 getTokenLength(&ctx->tokens[encIndex]),
 2324|     39|                                 &encoding);
 2325|     39|        if(len == 0 || encoding > 2)
  ------------------
  |  Branch (2325:12): [True: 1, False: 38]
  |  Branch (2325:24): [True: 36, False: 2]
  ------------------
 2326|     37|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     37|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2327|     39|    }
 2328|       |
 2329|       |    /* Decode the type NodeId. */
 2330|    151|    size_t typeIdIndex = fields[0].valueIndex;
 2331|    151|    if(typeIdIndex == SIZE_MAX)
  ------------------
  |  Branch (2331:8): [True: 87, False: 64]
  ------------------
 2332|     87|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     87|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2333|       |
 2334|     64|    UA_NodeId typeId;
 2335|     64|    UA_NodeId_init(&typeId);
 2336|     64|    ParseCtx decodeCtx = *ctx;
 2337|     64|    decodeCtx.index = typeIdIndex;
 2338|     64|    ret = NodeId_decodeJson(&decodeCtx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|     64|#define UA_TYPES_NODEID 16
  ------------------
 2339|     64|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|     64|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2339:8): [True: 48, False: 16]
  ------------------
 2340|     48|        UA_NodeId_clear(&typeId); /* We don't have the global cleanup */
 2341|     48|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     48|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2342|     48|    }
 2343|       |
 2344|     16|    size_t bodyIndex = fields[2].valueIndex;
 2345|       |
 2346|       |    /* Binary and XML bodies stay encoded even if the datatype is known. */
 2347|     16|    if(encoding != 0) {
  ------------------
  |  Branch (2347:8): [True: 0, False: 16]
  ------------------
 2348|      0|        dst->encoding = (encoding == 1) ?
  ------------------
  |  Branch (2348:25): [True: 0, False: 0]
  ------------------
 2349|      0|            UA_EXTENSIONOBJECT_ENCODED_BYTESTRING :
 2350|      0|            UA_EXTENSIONOBJECT_ENCODED_XML;
 2351|      0|        dst->content.encoded.typeId = typeId;
 2352|      0|        if(bodyIndex == SIZE_MAX)
  ------------------
  |  Branch (2352:12): [True: 0, False: 0]
  ------------------
 2353|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2354|      0|        decodeCtx.index = bodyIndex;
 2355|      0|        return ByteString_decodeJson(&decodeCtx,
 2356|      0|                                     &dst->content.encoded.body, NULL);
 2357|      0|    }
 2358|       |
 2359|       |    /* Lookup the JSON datatype. */
 2360|     16|    type = UA_findDataTypeWithCustom(&typeId, ctx->customTypes);
 2361|     16|    if(!type) {
  ------------------
  |  Branch (2361:8): [True: 16, False: 0]
  ------------------
 2362|     16|        dst->encoding = UA_EXTENSIONOBJECT_ENCODED_JSON;
 2363|     16|        dst->content.encoded.typeId = typeId;
 2364|     16|        decodeCtx.index = beginIndex;
 2365|     16|        return tokenToByteString(&decodeCtx, &dst->content.encoded.body);
 2366|     16|    }
 2367|       |
 2368|       |    /* No need to keep the TypeId */
 2369|      0|    UA_NodeId_clear(&typeId);
 2370|       |
 2371|       |    /* Disallow directly nested ExtensionObjects */
 2372|      0|    if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (2372:8): [True: 0, False: 0]
  ------------------
 2373|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2374|       |
 2375|       |    /* Allocate memory for the decoded data */
 2376|      0|    dst->content.decoded.data = UA_new(type);
 2377|      0|    if(!dst->content.decoded.data)
  ------------------
  |  Branch (2377:8): [True: 0, False: 0]
  ------------------
 2378|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2379|      0|    dst->content.decoded.type = type;
 2380|      0|    dst->encoding = UA_EXTENSIONOBJECT_DECODED;
 2381|       |
 2382|      0|    decodeJsonSignature decodeType = decodeJsonJumpTable[type->typeKind];
 2383|      0|    if(bodyIndex != SIZE_MAX) {
  ------------------
  |  Branch (2383:8): [True: 0, False: 0]
  ------------------
 2384|      0|        decodeCtx.index = bodyIndex;
 2385|      0|        return decodeType(&decodeCtx, dst->content.decoded.data, type);
 2386|      0|    }
 2387|       |
 2388|       |    /* Only JSON structures without an explicit encoding can be in-situ. */
 2389|      0|    if(encoding != 0)
  ------------------
  |  Branch (2389:8): [True: 0, False: 0]
  ------------------
 2390|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2391|       |
 2392|      0|    decodeCtx.index = beginIndex;
 2393|      0|    if(type->typeKind == UA_DATATYPEKIND_STRUCTURE ||
  ------------------
  |  Branch (2393:8): [True: 0, False: 0]
  ------------------
 2394|      0|       type->typeKind == UA_DATATYPEKIND_OPTSTRUCT)
  ------------------
  |  Branch (2394:8): [True: 0, False: 0]
  ------------------
 2395|      0|        return decodeJsonStructureExtensionObject(
 2396|      0|            &decodeCtx, dst->content.decoded.data, type);
 2397|      0|    if(type->typeKind == UA_DATATYPEKIND_UNION)
  ------------------
  |  Branch (2397:8): [True: 0, False: 0]
  ------------------
 2398|      0|        return decodeJsonUnionExtensionObject(
 2399|      0|            &decodeCtx, dst->content.decoded.data, type);
 2400|      0|    return decodeType(&decodeCtx, dst->content.decoded.data, type);
 2401|      0|}
ua_types_encoding_json.c:scanObjectFields:
 1369|    195|scanObjectFields(ParseCtx *ctx, JsonFieldIndex *fields, size_t fieldsSize) {
 1370|    195|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  400|    195|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1370:5): [True: 195, False: 0]
  ------------------
 1371|    195|    size_t keyCount = (size_t)ctx->tokens[ctx->index].size / 2;
 1372|    195|    UA_STACKARRAY(size_t, keys, keyCount);
  ------------------
  |  |  376|    195|#  define UA_STACKARRAY(TYPE, NAME, SIZE) TYPE NAME[SIZE]
  ------------------
 1373|    195|    ctx->index++;
 1374|       |
 1375|    561|    for(size_t i = 0; i < keyCount; i++) {
  ------------------
  |  Branch (1375:23): [True: 373, False: 188]
  ------------------
 1376|    373|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  400|    373|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1376:9): [True: 373, False: 0]
  ------------------
 1377|    373|        const cj5_token *key = &ctx->tokens[ctx->index];
 1378|    373|        size_t keyLength = getTokenLength(key);
 1379|       |
 1380|       |        /* Duplicate names are invalid, including unknown in-situ Structure
 1381|       |         * fields of an ExtensionObject. */
 1382|    776|        for(size_t j = 0; j < i; j++) {
  ------------------
  |  Branch (1382:27): [True: 410, False: 366]
  ------------------
 1383|    410|            const cj5_token *previous = &ctx->tokens[keys[j]];
 1384|    410|            if(keyLength == getTokenLength(previous) &&
  ------------------
  |  Branch (1384:16): [True: 104, False: 306]
  ------------------
 1385|    104|               memcmp(&ctx->json5[key->start], &ctx->json5[previous->start],
  ------------------
  |  Branch (1385:16): [True: 7, False: 97]
  ------------------
 1386|    104|                      keyLength) == 0)
 1387|      7|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1388|    410|        }
 1389|    366|        keys[i] = ctx->index;
 1390|       |
 1391|       |        /* Record the value position of interesting fields. */
 1392|    366|        ctx->index++;
 1393|    366|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  400|    366|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1393:9): [True: 366, False: 0]
  ------------------
 1394|  1.19k|        for(size_t j = 0; j < fieldsSize; j++) {
  ------------------
  |  Branch (1394:27): [True: 929, False: 262]
  ------------------
 1395|    929|            if(jsoneq(ctx->json5, key, fields[j].fieldName) == 0) {
  ------------------
  |  Branch (1395:16): [True: 104, False: 825]
  ------------------
 1396|    104|                fields[j].valueIndex = ctx->index;
 1397|    104|                break;
 1398|    104|            }
 1399|    929|        }
 1400|       |
 1401|    366|        skipObject(ctx);
 1402|    366|    }
 1403|    188|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    188|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1404|    195|}
ua_types_encoding_json.c:tokenToByteString:
 2285|     16|tokenToByteString(ParseCtx *ctx, UA_ByteString *p) {
 2286|     16|    GET_TOKEN;
  ------------------
  |  | 1281|     16|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1282|     16|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1283|     16|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1283:17): [Folded, False: 16]
  |  |  ------------------
  ------------------
 2287|     16|    UA_StatusCode res = UA_ByteString_allocBuffer(p, tokenSize);
 2288|     16|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|     16|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2288:8): [True: 0, False: 16]
  ------------------
 2289|      0|        return res;
 2290|     16|    memcpy(p->data, tokenData, tokenSize);
 2291|     16|    skipObject(ctx);
 2292|     16|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     16|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2293|     16|}
ua_types_encoding_json.c:Array_decodeJson:
 2591|  6.29k|Array_decodeJson(ParseCtx *ctx, void *dst_, const UA_DataType *type) {
 2592|  6.29k|    void **dst = (void**)dst_;
 2593|       |
 2594|       |    /* Save the length of the array */
 2595|  6.29k|    size_t *size_ptr = (size_t*) dst - 1;
 2596|       |
 2597|       |    /* A null JSON array represents a null OPC UA array. */
 2598|  6.29k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2598:8): [True: 1, False: 6.29k]
  ------------------
 2599|      1|        *size_ptr = 0;
 2600|      1|        *dst = NULL;
 2601|      1|        ctx->index++;
 2602|      1|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2603|      1|    }
 2604|       |
 2605|  6.29k|    if(currentTokenType(ctx) != CJ5_TOKEN_ARRAY)
  ------------------
  |  Branch (2605:8): [True: 7, False: 6.28k]
  ------------------
 2606|      7|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2607|       |
 2608|  6.28k|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 2609|       |
 2610|  6.28k|    ctx->index++; /* Go to first array member or to the first element after
 2611|       |                   * the array (if empty) */
 2612|       |
 2613|       |    /* Return early for empty arrays */
 2614|  6.28k|    if(length == 0) {
  ------------------
  |  Branch (2614:8): [True: 950, False: 5.33k]
  ------------------
 2615|    950|        *size_ptr = length;
 2616|    950|        *dst = UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|    950|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2617|    950|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    950|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2618|    950|    }
 2619|       |
 2620|       |    /* Allocate memory */
 2621|  5.33k|    *dst = UA_calloc(length, type->memSize);
  ------------------
  |  |   20|  5.33k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2622|  5.33k|    if(*dst == NULL)
  ------------------
  |  Branch (2622:8): [True: 0, False: 5.33k]
  ------------------
 2623|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2624|       |
 2625|       |    /* Decode array members */
 2626|  5.33k|    decodeJsonSignature decodeFunc = decodeJsonJumpTable[type->typeKind];
 2627|  5.33k|    uintptr_t ptr = (uintptr_t)*dst;
 2628|  14.5M|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (2628:23): [True: 14.5M, False: 4.87k]
  ------------------
 2629|  14.5M|        if(ctx->tokens[ctx->index].type == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2629:12): [True: 12.1k, False: 14.5M]
  ------------------
 2630|  12.1k|            if(!isJsonNullable(type)) {
  ------------------
  |  Branch (2630:16): [True: 9, False: 12.1k]
  ------------------
 2631|      9|                UA_Array_delete(*dst, i, type);
 2632|      9|                *dst = NULL;
 2633|      9|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2634|      9|            }
 2635|  12.1k|            ptr += type->memSize;
 2636|  12.1k|            ctx->index++;
 2637|  12.1k|            continue;
 2638|  12.1k|        }
 2639|       |
 2640|  14.5M|        status ret = decodeFunc(ctx, (void*)ptr, type);
 2641|  14.5M|        ptr += type->memSize;
 2642|  14.5M|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  14.5M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2642:12): [True: 457, False: 14.5M]
  ------------------
 2643|    457|            UA_Array_delete(*dst, i+1, type);
 2644|    457|            *dst = NULL;
 2645|    457|            return ret;
 2646|    457|        }
 2647|  14.5M|    }
 2648|       |
 2649|  4.87k|    *size_ptr = length; /* All good, set the size */
 2650|  4.87k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.87k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2651|  5.33k|}
ua_types_encoding_json.c:DataValue_decodeJson:
 2245|   274k|DECODE_JSON(DataValue) {
 2246|   274k|    UA_DataValue *dst = (UA_DataValue*)p;
 2247|   274k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1310|   274k|#define CHECK_NULL_SKIP do {                         \
  |  | 1311|   274k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1311:8): [True: 0, False: 274k]
  |  |  ------------------
  |  | 1312|      0|        ctx->index++;                                \
  |  | 1313|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1314|   274k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1314:14): [Folded, False: 274k]
  |  |  ------------------
  ------------------
 2248|   274k|    CHECK_OBJECT;
  ------------------
  |  | 1305|   274k|#define CHECK_OBJECT do {                                \
  |  | 1306|   274k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1306:8): [True: 9, False: 274k]
  |  |  ------------------
  |  | 1307|      9|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1308|   274k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1308:14): [Folded, False: 274k]
  |  |  ------------------
  ------------------
 2249|       |
 2250|       |    /* Decode the Variant in-situ */
 2251|   274k|    size_t beginIndex = ctx->index;
 2252|   274k|    status ret = decodeJSONVariant(ctx, &dst->value, true);
 2253|   274k|    ctx->index = beginIndex;
 2254|   274k|    dst->hasValue = (dst->value.type != NULL);
 2255|   274k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|   274k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2255:8): [True: 61, False: 274k]
  ------------------
 2256|     61|        return ret;
 2257|       |
 2258|       |    /* Decode the other members (skip the Variant members) */
 2259|   274k|    DecodeEntry entries[8] = {
 2260|   274k|        {UA_JSONKEY_TYPE, NULL, NULL, false, NULL},
 2261|   274k|        {UA_JSONKEY_VALUE, NULL, NULL, false, NULL},
 2262|   274k|        {UA_JSONKEY_DIMENSIONS, NULL, NULL, false, NULL},
 2263|   274k|        {UA_JSONKEY_STATUS, &dst->status, NULL, false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  633|   274k|#define UA_TYPES_STATUSCODE 18
  ------------------
 2264|   274k|        {UA_JSONKEY_SOURCETIMESTAMP, &dst->sourceTimestamp, NULL,
 2265|   274k|         false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  429|   274k|#define UA_TYPES_DATETIME 12
  ------------------
 2266|   274k|        {UA_JSONKEY_SOURCEPICOSECONDS, &dst->sourcePicoseconds, NULL,
 2267|   274k|         false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  157|   274k|#define UA_TYPES_UINT16 4
  ------------------
 2268|   274k|        {UA_JSONKEY_SERVERTIMESTAMP, &dst->serverTimestamp, NULL,
 2269|   274k|         false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  429|   274k|#define UA_TYPES_DATETIME 12
  ------------------
 2270|   274k|        {UA_JSONKEY_SERVERPICOSECONDS, &dst->serverPicoseconds, NULL,
 2271|   274k|         false, &UA_TYPES[UA_TYPES_UINT16]}
  ------------------
  |  |  157|   274k|#define UA_TYPES_UINT16 4
  ------------------
 2272|   274k|    };
 2273|       |
 2274|   274k|    ret = decodeFields(ctx, entries, 8);
 2275|   274k|    dst->hasStatus = entries[3].found;
 2276|   274k|    dst->hasSourceTimestamp = entries[4].found;
 2277|   274k|    dst->hasSourcePicoseconds = entries[5].found;
 2278|   274k|    dst->hasServerTimestamp = entries[6].found;
 2279|   274k|    dst->hasServerPicoseconds = entries[7].found;
 2280|   274k|    return ret;
 2281|   274k|}
ua_types_encoding_json.c:decodeJSONVariant:
 2102|   452k|                  UA_Boolean insideDataValue) {
 2103|       |    /* Empty variant == null */
 2104|   452k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (2104:8): [True: 389k, False: 62.4k]
  ------------------
 2105|   389k|        ctx->index++;
 2106|   389k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   389k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2107|   389k|    }
 2108|       |
 2109|       |    /* Search the value field */
 2110|  62.4k|    size_t valueIndex = 0;
 2111|  62.4k|    lookAheadForKey(ctx, UA_JSONKEY_VALUE, &valueIndex);
 2112|       |
 2113|       |    /* Search for the dimensions field */
 2114|  62.4k|    size_t dimIndex = 0;
 2115|  62.4k|    lookAheadForKey(ctx, UA_JSONKEY_DIMENSIONS, &dimIndex);
 2116|       |
 2117|       |    /* Parse the type kind */
 2118|  62.4k|    size_t typeIndex = 0;
 2119|  62.4k|    lookAheadForKey(ctx, UA_JSONKEY_TYPE, &typeIndex);
 2120|  62.4k|    if(typeIndex == 0 || ctx->tokens[typeIndex].type != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (2120:8): [True: 169, False: 62.2k]
  |  Branch (2120:26): [True: 3, False: 62.2k]
  ------------------
 2121|    172|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    172|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2122|  62.2k|    UA_UInt64 typeKind = 0;
 2123|  62.2k|    size_t len = parseUInt64(&ctx->json5[ctx->tokens[typeIndex].start],
 2124|  62.2k|                             getTokenLength(&ctx->tokens[typeIndex]), &typeKind);
 2125|  62.2k|    if(len == 0)
  ------------------
  |  Branch (2125:8): [True: 23, False: 62.2k]
  ------------------
 2126|     23|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     23|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2127|       |
 2128|       |    /* Shift to get the datatype index. The type must be a builtin data type.
 2129|       |     * All not-builtin types are wrapped in an ExtensionObject. */
 2130|  62.2k|    typeKind--;
 2131|  62.2k|    if(typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (2131:8): [True: 304, False: 61.9k]
  ------------------
 2132|    304|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    304|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2133|  61.9k|    const UA_DataType *type = &UA_TYPES[typeKind];
 2134|       |
 2135|       |    /* These combinations are excluded by the Variant definition. */
 2136|  61.9k|    if(type->typeKind == UA_DATATYPEKIND_DIAGNOSTICINFO ||
  ------------------
  |  Branch (2136:8): [True: 1, False: 61.9k]
  ------------------
 2137|  61.9k|       (insideDataValue && type->typeKind == UA_DATATYPEKIND_DATAVALUE))
  ------------------
  |  Branch (2137:9): [True: 6.83k, False: 55.0k]
  |  Branch (2137:28): [True: 10, False: 6.82k]
  ------------------
 2138|     11|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     11|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2139|       |
 2140|       |    /* Value is an array? */
 2141|  61.9k|    UA_Boolean isArray =
 2142|  61.9k|        (valueIndex > 0 && ctx->tokens[valueIndex].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  Branch (2142:10): [True: 47.2k, False: 14.6k]
  |  Branch (2142:28): [True: 6.15k, False: 41.0k]
  ------------------
 2143|  61.9k|    if(type->typeKind == UA_DATATYPEKIND_VARIANT && !isArray)
  ------------------
  |  Branch (2143:8): [True: 435, False: 61.4k]
  |  Branch (2143:53): [True: 1, False: 434]
  ------------------
 2144|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2145|       |
 2146|       |    /* Adjust the depth and set the value index as current */
 2147|  61.9k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION)
  ------------------
  |  |   22|  61.9k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (2147:8): [True: 0, False: 61.9k]
  ------------------
 2148|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2149|  61.9k|    size_t beginIndex = ctx->index;
 2150|  61.9k|    ctx->index = valueIndex;
 2151|  61.9k|    ctx->depth++;
 2152|       |
 2153|       |    /* Decode the value */
 2154|  61.9k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  61.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2155|  61.9k|    if(!isArray) {
  ------------------
  |  Branch (2155:8): [True: 55.7k, False: 6.15k]
  ------------------
 2156|       |        /* Scalar with dimensions -> error */
 2157|  55.7k|        if(dimIndex > 0) {
  ------------------
  |  Branch (2157:12): [True: 9, False: 55.7k]
  ------------------
 2158|      9|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2159|      9|            goto out;
 2160|      9|        }
 2161|       |
 2162|       |        /* Missing values are only valid for nullable types. */
 2163|  55.7k|        if(valueIndex == 0 && !isJsonNullable(type)) {
  ------------------
  |  Branch (2163:12): [True: 14.6k, False: 41.0k]
  |  Branch (2163:31): [True: 50, False: 14.5k]
  ------------------
 2164|     50|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     50|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2165|     50|            goto out;
 2166|     50|        }
 2167|       |
 2168|       |        /* JSON null is only valid for nullable types. */
 2169|  55.6k|        if(valueIndex > 0 && ctx->tokens[valueIndex].type == CJ5_TOKEN_NULL &&
  ------------------
  |  Branch (2169:12): [True: 41.0k, False: 14.5k]
  |  Branch (2169:30): [True: 5, False: 41.0k]
  ------------------
 2170|      5|           !isJsonNullable(type)) {
  ------------------
  |  Branch (2170:12): [True: 1, False: 4]
  ------------------
 2171|      1|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2172|      1|            goto out;
 2173|      1|        }
 2174|       |
 2175|       |        /* Decode a value wrapped in an ExtensionObject */
 2176|  55.6k|        if(valueIndex > 0 && type->typeKind == UA_DATATYPEKIND_EXTENSIONOBJECT) {
  ------------------
  |  Branch (2176:12): [True: 41.0k, False: 14.5k]
  |  Branch (2176:30): [True: 74, False: 41.0k]
  ------------------
 2177|     74|            res = Variant_decodeJsonUnwrapExtensionObject(ctx, dst, NULL);
 2178|     74|            goto out;
 2179|     74|        }
 2180|       |
 2181|       |        /* Allocate memory for the value */
 2182|  55.6k|        dst->data = UA_new(type);
 2183|  55.6k|        if(!dst->data) {
  ------------------
  |  Branch (2183:12): [True: 0, False: 55.6k]
  ------------------
 2184|      0|            res = UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2185|      0|            goto out;
 2186|      0|        }
 2187|  55.6k|        dst->type = type;
 2188|       |
 2189|       |        /* Decode the value */
 2190|  55.6k|        if(valueIndex > 0 && ctx->tokens[valueIndex].type != CJ5_TOKEN_NULL)
  ------------------
  |  Branch (2190:12): [True: 41.0k, False: 14.5k]
  |  Branch (2190:30): [True: 41.0k, False: 3]
  ------------------
 2191|  41.0k|            res = decodeJsonJumpTable[type->typeKind](ctx, dst->data, type);
 2192|  55.6k|    } else {
 2193|       |        /* Decode an array. Try to unwrap ExtensionObjects in the array. The
 2194|       |         * members must all have the same type. */
 2195|  6.15k|        const UA_DataType *unwrapType = NULL;
 2196|  6.15k|        if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  735|  6.15k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (2196:12): [True: 1.67k, False: 4.48k]
  ------------------
 2197|  1.67k|            unwrapType = getArrayUnwrapType(ctx);
 2198|  6.15k|        if(unwrapType) {
  ------------------
  |  Branch (2198:12): [True: 0, False: 6.15k]
  ------------------
 2199|      0|            dst->type = unwrapType;
 2200|      0|            res = Array_decodeJsonUnwrapExtensionObject(ctx, &dst->data, unwrapType);
 2201|  6.15k|        } else {
 2202|  6.15k|            dst->type = type;
 2203|  6.15k|            res = Array_decodeJson(ctx, &dst->data, type);
 2204|  6.15k|        }
 2205|       |
 2206|       |        /* Decode array dimensions */
 2207|  6.15k|        if(dimIndex > 0) {
  ------------------
  |  Branch (2207:12): [True: 138, False: 6.02k]
  ------------------
 2208|    138|            ctx->index = dimIndex;
 2209|    138|            res |= Array_decodeJson(ctx, (void**)&dst->arrayDimensions,
 2210|    138|                                    &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  225|    138|#define UA_TYPES_UINT32 6
  ------------------
 2211|       |
 2212|       |            /* Help clang-analyzer */
 2213|    138|            UA_assert(dst->arrayDimensionsSize == 0 || dst->arrayDimensions);
  ------------------
  |  |  400|    138|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2213:13): [True: 30, False: 108]
  |  Branch (2213:13): [True: 108, False: 0]
  ------------------
 2214|       |
 2215|       |            /* Validate the dimensions */
 2216|    138|            if(res == UA_STATUSCODE_GOOD &&
  ------------------
  |  |   17|    276|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2216:16): [True: 110, False: 28]
  ------------------
 2217|    110|               !variantDimensionsValid(dst->arrayLength,
  ------------------
  |  Branch (2217:16): [True: 109, False: 1]
  ------------------
 2218|    110|                                       dst->arrayDimensionsSize,
 2219|    110|                                       dst->arrayDimensions))
 2220|    109|                res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    109|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2221|       |
 2222|       |            /* Only keep >= 2 dimensions */
 2223|    138|            if(dst->arrayDimensionsSize == 1) {
  ------------------
  |  Branch (2223:16): [True: 50, False: 88]
  ------------------
 2224|     50|                UA_free(dst->arrayDimensions);
  ------------------
  |  |   19|     50|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2225|     50|                dst->arrayDimensions = NULL;
 2226|     50|                dst->arrayDimensionsSize = 0;
 2227|     50|            }
 2228|    138|        }
 2229|  6.15k|    }
 2230|       |
 2231|  61.9k| out:
 2232|  61.9k|    ctx->index = beginIndex;
 2233|  61.9k|    skipObject(ctx);
 2234|  61.9k|    ctx->depth--;
 2235|  61.9k|    return res;
 2236|  61.9k|}
ua_types_encoding_json.c:Variant_decodeJsonUnwrapExtensionObject:
 2405|     74|                                        const UA_DataType *type) {
 2406|     74|    (void) type;
 2407|     74|    UA_Variant *dst = (UA_Variant*)p;
 2408|       |
 2409|       |    /* ExtensionObject with null body */
 2410|     74|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2410:8): [True: 1, False: 73]
  ------------------
 2411|      1|        dst->data = UA_ExtensionObject_new();
 2412|      1|        dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|      1|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2413|      1|        ctx->index++;
 2414|      1|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2415|      1|    }
 2416|       |
 2417|       |    /* Decode the ExtensionObject */
 2418|     73|    UA_ExtensionObject eo;
 2419|     73|    UA_ExtensionObject_init(&eo);
 2420|     73|    UA_StatusCode ret = ExtensionObject_decodeJson(ctx, &eo, NULL);
 2421|     73|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|     73|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2421:8): [True: 72, False: 1]
  ------------------
 2422|     72|        UA_ExtensionObject_clear(&eo); /* We don't have the global cleanup */
 2423|     72|        return ret;
 2424|     72|    }
 2425|       |
 2426|       |    /* The content is still encoded, cannot unwrap */
 2427|      1|    if(eo.encoding != UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2427:8): [True: 1, False: 0]
  ------------------
 2428|      1|        goto use_eo;
 2429|       |
 2430|       |    /* The content is a builtin type that could have been directly encoded in
 2431|       |     * the Variant, there was no need to wrap in an ExtensionObject. But this
 2432|       |     * means for us, that somebody made an extra effort to explicitly get an
 2433|       |     * ExtensionObject. So we keep it. As an added advantage we will generate
 2434|       |     * the same JSON again when encoding again. */
 2435|      0|    if(eo.content.decoded.type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (2435:8): [True: 0, False: 0]
  ------------------
 2436|      0|        goto use_eo;
 2437|       |
 2438|       |    /* Unwrap the ExtensionObject */
 2439|      0|    dst->data = eo.content.decoded.data;
 2440|      0|    dst->type = eo.content.decoded.type;
 2441|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2442|       |
 2443|      1| use_eo:
 2444|       |    /* Don't unwrap */
 2445|      1|    dst->data = UA_new(&UA_TYPES[UA_TYPES_EXTENSIONOBJECT]);
  ------------------
  |  |  735|      1|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2446|      1|    if(!dst->data) {
  ------------------
  |  Branch (2446:8): [True: 0, False: 1]
  ------------------
 2447|      0|        UA_ExtensionObject_clear(&eo);
 2448|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2449|      0|    }
 2450|      1|    dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|      1|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2451|      1|    *(UA_ExtensionObject*)dst->data = eo;
 2452|      1|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2453|      1|}
ua_types_encoding_json.c:getArrayUnwrapType:
 1978|  1.67k|getArrayUnwrapType(ParseCtx *ctx) {
 1979|  1.67k|    UA_assert(ctx->tokens[ctx->index].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  |  400|  1.67k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1979:5): [True: 1.67k, False: 0]
  ------------------
 1980|       |
 1981|       |    /* Return early for empty arrays */
 1982|  1.67k|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 1983|  1.67k|    if(length == 0)
  ------------------
  |  Branch (1983:8): [True: 12, False: 1.66k]
  ------------------
 1984|     12|        return NULL;
 1985|       |
 1986|       |    /* Save the original index and go to the first array member */
 1987|  1.66k|    size_t oldIndex = ctx->index;
 1988|  1.66k|    ctx->index++;
 1989|       |
 1990|       |    /* Lookup the type for the first array member */
 1991|  1.66k|    UA_NodeId typeId;
 1992|  1.66k|    UA_NodeId_init(&typeId);
 1993|  1.66k|    const UA_DataType *typeOfBody = getExtensionObjectType(ctx);
 1994|  1.66k|    if(!typeOfBody) {
  ------------------
  |  Branch (1994:8): [True: 1.66k, False: 0]
  ------------------
 1995|  1.66k|        ctx->index = oldIndex; /* Restore the index */
 1996|  1.66k|        return NULL;
 1997|  1.66k|    }
 1998|       |
 1999|       |    /* Get the TypeId encoding for faster comparison below.
 2000|       |     * Cannot fail as getExtensionObjectType already looked this up. */
 2001|      0|    size_t typeIdIndex = 0;
 2002|      0|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 2003|      0|    (void)ret;
 2004|      0|    UA_assert(ret == UA_STATUSCODE_GOOD);
  ------------------
  |  |  400|      0|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2004:5): [True: 0, False: 0]
  ------------------
 2005|      0|    const char* typeIdData = &ctx->json5[ctx->tokens[typeIdIndex].start];
 2006|      0|    size_t typeIdSize = getTokenLength(&ctx->tokens[typeIdIndex]);
 2007|       |
 2008|       |    /* Loop over all members and check whether they can be unwrapped. Don't skip
 2009|       |     * the first member. We still haven't checked the encoding type. */
 2010|      0|    for(size_t i = 0; i < length; i++) {
  ------------------
  |  Branch (2010:23): [True: 0, False: 0]
  ------------------
 2011|       |        /* Array element must be an object */
 2012|      0|        if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {
  ------------------
  |  Branch (2012:12): [True: 0, False: 0]
  ------------------
 2013|      0|            ctx->index = oldIndex; /* Restore the index */
 2014|      0|            return NULL;
 2015|      0|        }
 2016|       |
 2017|       |        /* Check for non-JSON encoding */
 2018|      0|        size_t encIndex = 0;
 2019|      0|        ret = lookAheadForKey(ctx, UA_JSONKEY_ENCODING, &encIndex);
 2020|      0|        if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2020:12): [True: 0, False: 0]
  ------------------
 2021|      0|            ctx->index = oldIndex; /* Restore the index */
 2022|      0|            return NULL;
 2023|      0|        }
 2024|       |
 2025|       |        /* Get the type NodeId index */
 2026|      0|        size_t memberTypeIdIndex = 0;
 2027|      0|        ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &memberTypeIdIndex);
 2028|      0|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2028:12): [True: 0, False: 0]
  ------------------
 2029|      0|            ctx->index = oldIndex; /* Restore the index */
 2030|      0|            return NULL;
 2031|      0|        }
 2032|       |
 2033|       |        /* Is it the same type? Compare raw NodeId string */
 2034|      0|        const char* memberTypeIdData = &ctx->json5[ctx->tokens[memberTypeIdIndex].start];
 2035|      0|        size_t memberTypeIdSize = getTokenLength(&ctx->tokens[memberTypeIdIndex]);
 2036|      0|        if(typeIdSize != memberTypeIdSize ||
  ------------------
  |  Branch (2036:12): [True: 0, False: 0]
  ------------------
 2037|      0|           memcmp(typeIdData, memberTypeIdData, typeIdSize) != 0) {
  ------------------
  |  Branch (2037:12): [True: 0, False: 0]
  ------------------
 2038|      0|            ctx->index = oldIndex; /* Restore the index */
 2039|      0|            return NULL;
 2040|      0|        }
 2041|       |
 2042|       |        /* Skip to the next array member */
 2043|      0|        skipObject(ctx);
 2044|      0|    }
 2045|       |
 2046|      0|    ctx->index = oldIndex; /* Restore the index */
 2047|      0|    return typeOfBody;
 2048|      0|}
ua_types_encoding_json.c:getExtensionObjectType:
 1946|  1.66k|getExtensionObjectType(ParseCtx *ctx) {
 1947|  1.66k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (1947:8): [True: 744, False: 922]
  ------------------
 1948|    744|        return NULL;
 1949|       |
 1950|       |    /* Get the type NodeId index */
 1951|    922|    size_t typeIdIndex = 0;
 1952|    922|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 1953|    922|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    922|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1953:8): [True: 858, False: 64]
  ------------------
 1954|    858|        return NULL;
 1955|       |
 1956|     64|    size_t oldIndex = ctx->index;
 1957|     64|    ctx->index = (UA_UInt16)typeIdIndex;
 1958|       |
 1959|       |    /* Decode the type NodeId */
 1960|     64|    UA_NodeId typeId;
 1961|     64|    UA_NodeId_init(&typeId);
 1962|     64|    ret = NodeId_decodeJson(ctx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|     64|#define UA_TYPES_NODEID 16
  ------------------
 1963|     64|    ctx->index = oldIndex;
 1964|     64|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|     64|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1964:8): [True: 47, False: 17]
  ------------------
 1965|     47|        UA_NodeId_clear(&typeId); /* We don't have the global cleanup */
 1966|     47|        return NULL;
 1967|     47|    }
 1968|       |
 1969|       |    /* Lookup an return */
 1970|     17|    const UA_DataType *type = UA_findDataTypeWithCustom(&typeId, ctx->customTypes);
 1971|     17|    UA_NodeId_clear(&typeId);
 1972|     17|    return type;
 1973|     64|}
ua_types_encoding_json.c:Variant_decodeJson:
 2238|   177k|DECODE_JSON(Variant) {
 2239|   177k|    UA_Variant *dst = (UA_Variant*)p;
 2240|   177k|    CHECK_NULL_SKIP; /* Treat null as an empty variant */
  ------------------
  |  | 1310|   177k|#define CHECK_NULL_SKIP do {                         \
  |  | 1311|   177k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1311:8): [True: 1, False: 177k]
  |  |  ------------------
  |  | 1312|      1|        ctx->index++;                                \
  |  | 1313|      1|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1314|   177k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1314:14): [Folded, False: 177k]
  |  |  ------------------
  ------------------
 2241|   177k|    CHECK_OBJECT;
  ------------------
  |  | 1305|   177k|#define CHECK_OBJECT do {                                \
  |  | 1306|   177k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1306:8): [True: 102, False: 177k]
  |  |  ------------------
  |  | 1307|    102|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|    102|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1308|   177k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1308:14): [Folded, False: 177k]
  |  |  ------------------
  ------------------
 2242|   177k|    return decodeJSONVariant(ctx, dst, false);
 2243|   177k|}

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

UA_Guid_parse:
   86|  1.33k|UA_Guid_parse(UA_Guid *guid, const UA_String str) {
   87|  1.33k|    UA_StatusCode res = parse_guid(guid, str.data, str.data + str.length);
   88|  1.33k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  1.33k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (88:8): [True: 35, False: 1.29k]
  ------------------
   89|     35|        *guid = UA_GUID_NULL;
   90|  1.33k|    return res;
   91|  1.33k|}
UA_NodeId_parseEx:
  323|  30.2k|                  const UA_NamespaceMapping *nsMapping) {
  324|  30.2k|    UA_StatusCode res =
  325|  30.2k|        parse_nodeid(id, str.data, str.data+str.length, UA_ESCAPING_NONE, nsMapping);
  326|  30.2k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  30.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (326:8): [True: 224, False: 30.0k]
  ------------------
  327|    224|        UA_NodeId_clear(id);
  328|  30.2k|    return res;
  329|  30.2k|}
UA_ExpandedNodeId_parseEx:
  671|  22.7k|                          size_t serverUrisSize, const UA_String *serverUris) {
  672|  22.7k|    UA_StatusCode res =
  673|  22.7k|        parse_expandednodeid(id, str.data, str.data + str.length, UA_ESCAPING_NONE,
  674|  22.7k|                             nsMapping, serverUrisSize, serverUris);
  675|  22.7k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  22.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (675:8): [True: 309, False: 22.4k]
  ------------------
  676|    309|        UA_ExpandedNodeId_clear(id);
  677|  22.7k|    return res;
  678|  22.7k|}
UA_QualifiedName_parseEx:
  831|  45.8k|                         const UA_NamespaceMapping *nsMapping) {
  832|  45.8k|    const u8 *pos = str.data;
  833|  45.8k|    const u8 *end = str.data + str.length;
  834|  45.8k|    UA_StatusCode res = parse_qn(qn, pos, end, UA_ESCAPING_NONE, nsMapping, 0);
  835|  45.8k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  45.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (835:8): [True: 0, False: 45.8k]
  ------------------
  836|      0|        UA_QualifiedName_clear(qn);
  837|  45.8k|    return res;
  838|  45.8k|}
ua_types_lex.c:parse_guid:
   50|  1.34k|parse_guid(UA_Guid *guid, const UA_Byte *s, const UA_Byte *e) {
   51|  1.34k|    size_t len = (size_t)(e - s);
   52|  1.34k|    if(len != 36 || s[8] != '-' || s[13] != '-' || s[23] != '-')
  ------------------
  |  Branch (52:8): [True: 9, False: 1.33k]
  |  Branch (52:21): [True: 11, False: 1.32k]
  |  Branch (52:36): [True: 3, False: 1.32k]
  |  Branch (52:52): [True: 3, False: 1.31k]
  ------------------
   53|     26|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     26|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   54|       |
   55|  1.31k|    UA_UInt32 tmp;
   56|  1.31k|    if(UA_readNumberWithBase(s, 8, &tmp, 16) != 8)
  ------------------
  |  Branch (56:8): [True: 7, False: 1.31k]
  ------------------
   57|      7|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   58|  1.31k|    guid->data1 = tmp;
   59|       |
   60|  1.31k|    if(UA_readNumberWithBase(&s[9], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (60:8): [True: 2, False: 1.30k]
  ------------------
   61|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   62|  1.30k|    guid->data2 = (UA_UInt16)tmp;
   63|       |
   64|  1.30k|    if(UA_readNumberWithBase(&s[14], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (64:8): [True: 3, False: 1.30k]
  ------------------
   65|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   66|  1.30k|    guid->data3 = (UA_UInt16)tmp;
   67|       |
   68|  1.30k|    if(UA_readNumberWithBase(&s[19], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (68:8): [True: 1, False: 1.30k]
  ------------------
   69|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   70|  1.30k|    guid->data4[0] = (UA_Byte)tmp;
   71|       |
   72|  1.30k|    if(UA_readNumberWithBase(&s[21], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (72:8): [True: 2, False: 1.30k]
  ------------------
   73|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   74|  1.30k|    guid->data4[1] = (UA_Byte)tmp;
   75|       |
   76|  9.10k|    for(size_t pos = 2, spos = 24; pos < 8; pos++, spos += 2) {
  ------------------
  |  Branch (76:36): [True: 7.80k, False: 1.29k]
  ------------------
   77|  7.80k|        if(UA_readNumberWithBase(&s[spos], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (77:12): [True: 6, False: 7.80k]
  ------------------
   78|      6|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   79|  7.80k|        guid->data4[pos] = (UA_Byte)tmp;
   80|  7.80k|    }
   81|       |
   82|  1.29k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.29k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   83|  1.30k|}
ua_types_lex.c:parse_nodeid:
  148|  30.2k|             UA_Escaping idEsc, const UA_NamespaceMapping *nsMapping) {
  149|  30.2k|    *id = UA_NODEID_NULL; /* Reset the NodeId */
  150|  30.2k|    LexContext context;
  151|  30.2k|    memset(&context, 0, sizeof(LexContext));
  152|  30.2k|    UA_Byte *begin = (UA_Byte*)(uintptr_t)pos;
  153|  30.2k|    const u8 *ns = NULL, *nsu = NULL, *body = NULL;
  154|       |
  155|       |    
  156|  30.2k|{
  157|  30.2k|	u8 yych;
  158|  30.2k|	yych = YYPEEK();
  ------------------
  |  |   33|  30.2k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  30.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  30.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 30.2k, False: 7]
  |  |  ------------------
  ------------------
  159|  30.2k|	switch (yych) {
  160|  1.93k|		case 'b':
  ------------------
  |  Branch (160:3): [True: 1.93k, False: 28.3k]
  ------------------
  161|  1.95k|		case 'g':
  ------------------
  |  Branch (161:3): [True: 14, False: 30.2k]
  ------------------
  162|  2.58k|		case 'i':
  ------------------
  |  Branch (162:3): [True: 636, False: 29.6k]
  ------------------
  163|  6.08k|		case 's':
  ------------------
  |  Branch (163:3): [True: 3.50k, False: 26.7k]
  ------------------
  164|  6.08k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  6.08k|#define YYSTAGN(t) t = NULL
  ------------------
  165|  6.08k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  6.08k|#define YYSTAGN(t) t = NULL
  ------------------
  166|  6.08k|			goto yy3;
  167|  24.1k|		case 'n': goto yy4;
  ------------------
  |  Branch (167:3): [True: 24.1k, False: 6.10k]
  ------------------
  168|     14|		default: goto yy1;
  ------------------
  |  Branch (168:3): [True: 14, False: 30.2k]
  ------------------
  169|  30.2k|	}
  170|     14|yy1:
  171|     14|	YYSKIP();
  ------------------
  |  |   35|     14|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|     14|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  172|    178|yy2:
  173|    178|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   44|    178|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  174|  6.08k|yy3:
  175|  6.08k|	YYSKIP();
  ------------------
  |  |   35|  6.08k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  6.08k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  176|  6.08k|	yych = YYPEEK();
  ------------------
  |  |   33|  6.08k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.08k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.08k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 6.08k, False: 8]
  |  |  ------------------
  ------------------
  177|  6.08k|	switch (yych) {
  178|  6.07k|		case '=': goto yy5;
  ------------------
  |  Branch (178:3): [True: 6.07k, False: 18]
  ------------------
  179|     18|		default: goto yy2;
  ------------------
  |  Branch (179:3): [True: 18, False: 6.07k]
  ------------------
  180|  6.08k|	}
  181|  24.1k|yy4:
  182|  24.1k|	YYSKIP();
  ------------------
  |  |   35|  24.1k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  24.1k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  183|  24.1k|	YYBACKUP();
  ------------------
  |  |   36|  24.1k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  24.1k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  24.1k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  184|  24.1k|	yych = YYPEEK();
  ------------------
  |  |   33|  24.1k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  24.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  24.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 24.1k, False: 3]
  |  |  ------------------
  ------------------
  185|  24.1k|	switch (yych) {
  186|  24.1k|		case 's': goto yy6;
  ------------------
  |  Branch (186:3): [True: 24.1k, False: 9]
  ------------------
  187|      9|		default: goto yy2;
  ------------------
  |  Branch (187:3): [True: 9, False: 24.1k]
  ------------------
  188|  24.1k|	}
  189|  30.0k|yy5:
  190|  30.0k|	YYSKIP();
  ------------------
  |  |   35|  30.0k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  30.0k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  191|  30.0k|	nsu = context.yyt2;
  192|  30.0k|	ns = context.yyt1;
  193|  30.0k|	YYSTAGP(body);
  ------------------
  |  |   38|  30.0k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  30.0k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  194|  30.0k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  30.0k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  195|  30.0k|	{ goto match; }
  196|  24.1k|yy6:
  197|  24.1k|	YYSKIP();
  ------------------
  |  |   35|  24.1k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  24.1k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  198|  24.1k|	yych = YYPEEK();
  ------------------
  |  |   33|  24.1k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  24.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  24.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 24.1k, False: 3]
  |  |  ------------------
  ------------------
  199|  24.1k|	switch (yych) {
  200|  23.9k|		case '=': goto yy8;
  ------------------
  |  Branch (200:3): [True: 23.9k, False: 172]
  ------------------
  201|    169|		case 'u': goto yy9;
  ------------------
  |  Branch (201:3): [True: 169, False: 23.9k]
  ------------------
  202|      3|		default: goto yy7;
  ------------------
  |  Branch (202:3): [True: 3, False: 24.1k]
  ------------------
  203|  24.1k|	}
  204|    137|yy7:
  205|    137|	YYRESTORE();
  ------------------
  |  |   37|    137|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|    137|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|    137|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  206|    137|	goto yy2;
  207|  23.9k|yy8:
  208|  23.9k|	YYSKIP();
  ------------------
  |  |   35|  23.9k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  23.9k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  209|  23.9k|	yych = YYPEEK();
  ------------------
  |  |   33|  23.9k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  23.9k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  23.9k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 23.9k, False: 3]
  |  |  ------------------
  ------------------
  210|  23.9k|	switch (yych) {
  211|    876|		case '0':
  ------------------
  |  Branch (211:3): [True: 876, False: 23.1k]
  ------------------
  212|  6.02k|		case '1':
  ------------------
  |  Branch (212:3): [True: 5.15k, False: 18.8k]
  ------------------
  213|  6.10k|		case '2':
  ------------------
  |  Branch (213:3): [True: 75, False: 23.9k]
  ------------------
  214|  22.9k|		case '3':
  ------------------
  |  Branch (214:3): [True: 16.8k, False: 7.14k]
  ------------------
  215|  23.7k|		case '4':
  ------------------
  |  Branch (215:3): [True: 763, False: 23.2k]
  ------------------
  216|  23.7k|		case '5':
  ------------------
  |  Branch (216:3): [True: 48, False: 23.9k]
  ------------------
  217|  23.7k|		case '6':
  ------------------
  |  Branch (217:3): [True: 47, False: 23.9k]
  ------------------
  218|  23.8k|		case '7':
  ------------------
  |  Branch (218:3): [True: 13, False: 23.9k]
  ------------------
  219|  23.9k|		case '8':
  ------------------
  |  Branch (219:3): [True: 106, False: 23.8k]
  ------------------
  220|  23.9k|		case '9':
  ------------------
  |  Branch (220:3): [True: 57, False: 23.9k]
  ------------------
  221|  23.9k|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|  23.9k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  23.9k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  222|  23.9k|			goto yy10;
  223|      8|		default: goto yy7;
  ------------------
  |  Branch (223:3): [True: 8, False: 23.9k]
  ------------------
  224|  23.9k|	}
  225|    169|yy9:
  226|    169|	YYSKIP();
  ------------------
  |  |   35|    169|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    169|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  227|    169|	yych = YYPEEK();
  ------------------
  |  |   33|    169|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    169|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    166|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 166, False: 3]
  |  |  ------------------
  ------------------
  228|    169|	switch (yych) {
  229|    153|		case '=': goto yy11;
  ------------------
  |  Branch (229:3): [True: 153, False: 16]
  ------------------
  230|     16|		default: goto yy7;
  ------------------
  |  Branch (230:3): [True: 16, False: 153]
  ------------------
  231|    169|	}
  232|   125k|yy10:
  233|   125k|	YYSKIP();
  ------------------
  |  |   35|   125k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|   125k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  234|   125k|	yych = YYPEEK();
  ------------------
  |  |   33|   125k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   125k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   125k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 125k, False: 72]
  |  |  ------------------
  ------------------
  235|   125k|	switch (yych) {
  236|  1.35k|		case '0':
  ------------------
  |  Branch (236:3): [True: 1.35k, False: 124k]
  ------------------
  237|  3.23k|		case '1':
  ------------------
  |  Branch (237:3): [True: 1.88k, False: 124k]
  ------------------
  238|  4.63k|		case '2':
  ------------------
  |  Branch (238:3): [True: 1.39k, False: 124k]
  ------------------
  239|  23.1k|		case '3':
  ------------------
  |  Branch (239:3): [True: 18.5k, False: 107k]
  ------------------
  240|  27.6k|		case '4':
  ------------------
  |  Branch (240:3): [True: 4.43k, False: 121k]
  ------------------
  241|  45.6k|		case '5':
  ------------------
  |  Branch (241:3): [True: 18.0k, False: 107k]
  ------------------
  242|  68.4k|		case '6':
  ------------------
  |  Branch (242:3): [True: 22.8k, False: 103k]
  ------------------
  243|  70.8k|		case '7':
  ------------------
  |  Branch (243:3): [True: 2.38k, False: 123k]
  ------------------
  244|  82.4k|		case '8':
  ------------------
  |  Branch (244:3): [True: 11.5k, False: 114k]
  ------------------
  245|   101k|		case '9': goto yy10;
  ------------------
  |  Branch (245:3): [True: 19.5k, False: 106k]
  ------------------
  246|  23.9k|		case ';':
  ------------------
  |  Branch (246:3): [True: 23.9k, False: 102k]
  ------------------
  247|  23.9k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  23.9k|#define YYSTAGN(t) t = NULL
  ------------------
  248|  23.9k|			goto yy12;
  249|     73|		default: goto yy7;
  ------------------
  |  Branch (249:3): [True: 73, False: 125k]
  ------------------
  250|   125k|	}
  251|    153|yy11:
  252|    153|	YYSKIP();
  ------------------
  |  |   35|    153|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    153|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  253|    153|	yych = YYPEEK();
  ------------------
  |  |   33|    153|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    153|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    152|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 152, False: 1]
  |  |  ------------------
  ------------------
  254|    153|	switch (yych) {
  255|      1|		case 0x00: goto yy7;
  ------------------
  |  Branch (255:3): [True: 1, False: 152]
  ------------------
  256|     25|		case ';':
  ------------------
  |  Branch (256:3): [True: 25, False: 128]
  ------------------
  257|     25|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|     25|#define YYSTAGN(t) t = NULL
  ------------------
  258|     25|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|     25|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|     25|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  259|     25|			goto yy12;
  260|    127|		default:
  ------------------
  |  Branch (260:3): [True: 127, False: 26]
  ------------------
  261|    127|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    127|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    127|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  262|    127|			goto yy13;
  263|    153|	}
  264|  24.0k|yy12:
  265|  24.0k|	YYSKIP();
  ------------------
  |  |   35|  24.0k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  24.0k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  266|  24.0k|	yych = YYPEEK();
  ------------------
  |  |   33|  24.0k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  24.0k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  24.0k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 24.0k, False: 5]
  |  |  ------------------
  ------------------
  267|  24.0k|	switch (yych) {
  268|  21.9k|		case 'b':
  ------------------
  |  Branch (268:3): [True: 21.9k, False: 2.11k]
  ------------------
  269|  21.9k|		case 'g':
  ------------------
  |  Branch (269:3): [True: 1, False: 24.0k]
  ------------------
  270|  23.8k|		case 'i':
  ------------------
  |  Branch (270:3): [True: 1.94k, False: 22.0k]
  ------------------
  271|  24.0k|		case 's': goto yy14;
  ------------------
  |  Branch (271:3): [True: 152, False: 23.8k]
  ------------------
  272|     11|		default: goto yy7;
  ------------------
  |  Branch (272:3): [True: 11, False: 24.0k]
  ------------------
  273|  24.0k|	}
  274|    900|yy13:
  275|    900|	YYSKIP();
  ------------------
  |  |   35|    900|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    900|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  276|    900|	yych = YYPEEK();
  ------------------
  |  |   33|    900|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    900|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    889|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 889, False: 11]
  |  |  ------------------
  ------------------
  277|    900|	switch (yych) {
  278|     11|		case 0x00: goto yy7;
  ------------------
  |  Branch (278:3): [True: 11, False: 889]
  ------------------
  279|    116|		case ';':
  ------------------
  |  Branch (279:3): [True: 116, False: 784]
  ------------------
  280|    116|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    116|#define YYSTAGN(t) t = NULL
  ------------------
  281|    116|			goto yy12;
  282|    773|		default: goto yy13;
  ------------------
  |  Branch (282:3): [True: 773, False: 127]
  ------------------
  283|    900|	}
  284|  24.0k|yy14:
  285|  24.0k|	YYSKIP();
  ------------------
  |  |   35|  24.0k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  24.0k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  286|  24.0k|	yych = YYPEEK();
  ------------------
  |  |   33|  24.0k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  24.0k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  24.0k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 24.0k, False: 4]
  |  |  ------------------
  ------------------
  287|  24.0k|	switch (yych) {
  288|  24.0k|		case '=': goto yy5;
  ------------------
  |  Branch (288:3): [True: 24.0k, False: 14]
  ------------------
  289|     14|		default: goto yy7;
  ------------------
  |  Branch (289:3): [True: 14, False: 24.0k]
  ------------------
  290|  24.0k|	}
  291|  24.0k|}
  292|       |
  293|       |
  294|  30.0k| match:
  295|  30.0k|    if(nsu) {
  ------------------
  |  Branch (295:8): [True: 126, False: 29.9k]
  ------------------
  296|       |        /* NamespaceUri */
  297|    126|        UA_String nsUri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  298|    126|        UA_StatusCode res = escapedUri2Index(nsUri, &id->namespaceIndex, nsMapping);
  299|    126|        if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|    126|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (299:12): [True: 126, False: 0]
  ------------------
  300|       |            /* Return the entire NodeId string s=... */
  301|    126|            UA_String total = {(size_t)((const UA_Byte*)end - begin), begin};
  302|    126|            id->identifierType = UA_NODEIDTYPE_STRING;
  303|    126|            return UA_String_copy(&total, &id->identifier.string);
  304|    126|        }
  305|  29.9k|    } else if(ns) {
  ------------------
  |  Branch (305:15): [True: 23.8k, False: 6.07k]
  ------------------
  306|       |        /* NamespaceIndex */
  307|  23.8k|        UA_UInt32 tmp;
  308|  23.8k|        size_t len = (size_t)(body - 1 - ns);
  309|  23.8k|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (309:12): [True: 0, False: 23.8k]
  ------------------
  310|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  311|  23.8k|        id->namespaceIndex = (UA_UInt16)tmp;
  312|  23.8k|        if(nsMapping)
  ------------------
  |  Branch (312:12): [True: 0, False: 23.8k]
  ------------------
  313|      0|            id->namespaceIndex =
  314|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->namespaceIndex);
  315|  23.8k|    }
  316|       |
  317|       |    /* From the current position until the end */
  318|  29.9k|    return parse_nodeid_body(id, body, end, idEsc);
  319|  30.0k|}
ua_types_lex.c:escapedUri2Index:
   95|  4.28k|                 const UA_NamespaceMapping *nsMapping) {
   96|  4.28k|    if(!nsMapping)
  ------------------
  |  Branch (96:8): [True: 4.28k, False: 0]
  ------------------
   97|  4.28k|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|  4.28k|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   98|      0|    UA_String tmp = uri; 
   99|      0|    status res = UA_String_unescape(&uri, true, UA_ESCAPING_PERCENT);
  100|      0|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (100:8): [True: 0, False: 0]
  ------------------
  101|      0|        return res;
  102|      0|    res = UA_NamespaceMapping_uri2Index(nsMapping, uri, nsIndex);
  103|      0|    if(tmp.data != uri.data)
  ------------------
  |  Branch (103:8): [True: 0, False: 0]
  ------------------
  104|      0|        UA_String_clear(&uri);
  105|      0|    return res;
  106|      0|}
ua_types_lex.c:parse_nodeid_body:
  109|  52.1k|parse_nodeid_body(UA_NodeId *id, const u8 *body, const u8 *end, UA_Escaping esc) {
  110|  52.1k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  52.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  111|  52.1k|    UA_String str = {(size_t)(end - (body+2)), (UA_Byte*)(uintptr_t)body + 2};
  112|  52.1k|    switch(*body) {
  113|  3.47k|    case 'i':
  ------------------
  |  Branch (113:5): [True: 3.47k, False: 48.6k]
  ------------------
  114|  3.47k|        id->identifierType = UA_NODEIDTYPE_NUMERIC;
  115|  3.47k|        if(UA_readNumber(str.data, str.length, &id->identifier.numeric) != str.length)
  ------------------
  |  Branch (115:12): [True: 56, False: 3.42k]
  ------------------
  116|     56|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     56|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  117|  3.47k|        break;
  118|  13.4k|    case 's':
  ------------------
  |  Branch (118:5): [True: 13.4k, False: 38.6k]
  ------------------
  119|  13.4k|        id->identifierType = UA_NODEIDTYPE_STRING;
  120|  13.4k|        res |= UA_String_copy(&str, &id->identifier.string);
  121|  13.4k|        res |= UA_String_unescape(&id->identifier.string, false, esc);
  122|  13.4k|        break;
  123|     12|    case 'g':
  ------------------
  |  Branch (123:5): [True: 12, False: 52.1k]
  ------------------
  124|     12|        id->identifierType = UA_NODEIDTYPE_GUID;
  125|     12|        res = parse_guid(&id->identifier.guid, str.data, end);
  126|     12|        break;
  127|  35.1k|    case 'b':
  ------------------
  |  Branch (127:5): [True: 35.1k, False: 16.9k]
  ------------------
  128|       |        /* For percent-escaping, base64url bytestring encoding is used. That
  129|       |         * doesn't need to be escaped here. The and-escaping is not applied to
  130|       |         * the NodeId identifier part. */
  131|  35.1k|        id->identifierType = UA_NODEIDTYPE_BYTESTRING;
  132|  35.1k|        id->identifier.byteString.data =
  133|  35.1k|            UA_unbase64(str.data, str.length, &id->identifier.byteString.length);
  134|  35.1k|        if(!id->identifier.byteString.data) {
  ------------------
  |  Branch (134:12): [True: 15, False: 35.1k]
  ------------------
  135|     15|            UA_assert(id->identifier.byteString.length == 0);
  ------------------
  |  |  400|     15|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (135:13): [True: 15, False: 0]
  ------------------
  136|     15|            res = UA_STATUSCODE_BADDECODINGERROR; /* Returned on error by UA_unbase64 */
  ------------------
  |  |   44|     15|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  137|     15|        }
  138|  35.1k|        break;
  139|  35.1k|    default:
  ------------------
  |  Branch (139:5): [True: 0, False: 52.1k]
  ------------------
  140|      0|        res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  141|      0|        break;
  142|  52.1k|    }
  143|  52.1k|    return res;
  144|  52.1k|}
ua_types_lex.c:parse_expandednodeid:
  339|  22.7k|                     size_t serverUrisSize, const UA_String *serverUris) {
  340|  22.7k|    *id = UA_EXPANDEDNODEID_NULL; /* Reset the NodeId */
  341|  22.7k|    LexContext context;
  342|  22.7k|    memset(&context, 0, sizeof(LexContext));
  343|  22.7k|    const u8 *svr = NULL, *sve = NULL, *svu = NULL,
  344|  22.7k|        *nsu = NULL, *ns = NULL, *body = NULL, *begin = pos;
  345|       |
  346|       |    
  347|  22.7k|{
  348|  22.7k|	u8 yych;
  349|  22.7k|	yych = YYPEEK();
  ------------------
  |  |   33|  22.7k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  22.7k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  22.7k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 22.7k, False: 5]
  |  |  ------------------
  ------------------
  350|  22.7k|	switch (yych) {
  351|  7.05k|		case 'b':
  ------------------
  |  Branch (351:3): [True: 7.05k, False: 15.6k]
  ------------------
  352|  7.05k|		case 'g':
  ------------------
  |  Branch (352:3): [True: 4, False: 22.7k]
  ------------------
  353|  7.66k|		case 'i':
  ------------------
  |  Branch (353:3): [True: 606, False: 22.1k]
  ------------------
  354|  7.66k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  7.66k|#define YYSTAGN(t) t = NULL
  ------------------
  355|  7.66k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  7.66k|#define YYSTAGN(t) t = NULL
  ------------------
  356|  7.66k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  7.66k|#define YYSTAGN(t) t = NULL
  ------------------
  357|  7.66k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  7.66k|#define YYSTAGN(t) t = NULL
  ------------------
  358|  7.66k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  7.66k|#define YYSTAGN(t) t = NULL
  ------------------
  359|  7.66k|			goto yy18;
  360|  6.39k|		case 'n':
  ------------------
  |  Branch (360:3): [True: 6.39k, False: 16.3k]
  ------------------
  361|  6.39k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  6.39k|#define YYSTAGN(t) t = NULL
  ------------------
  362|  6.39k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  6.39k|#define YYSTAGN(t) t = NULL
  ------------------
  363|  6.39k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  6.39k|#define YYSTAGN(t) t = NULL
  ------------------
  364|  6.39k|			goto yy19;
  365|  8.66k|		case 's':
  ------------------
  |  Branch (365:3): [True: 8.66k, False: 14.0k]
  ------------------
  366|  8.66k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  8.66k|#define YYSTAGN(t) t = NULL
  ------------------
  367|  8.66k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  8.66k|#define YYSTAGN(t) t = NULL
  ------------------
  368|  8.66k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  8.66k|#define YYSTAGN(t) t = NULL
  ------------------
  369|  8.66k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  8.66k|#define YYSTAGN(t) t = NULL
  ------------------
  370|  8.66k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  8.66k|#define YYSTAGN(t) t = NULL
  ------------------
  371|  8.66k|			goto yy20;
  372|     25|		default: goto yy16;
  ------------------
  |  Branch (372:3): [True: 25, False: 22.7k]
  ------------------
  373|  22.7k|	}
  374|     25|yy16:
  375|     25|	YYSKIP();
  ------------------
  |  |   35|     25|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|     25|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  376|    272|yy17:
  377|    272|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   44|    272|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  378|  7.66k|yy18:
  379|  7.66k|	YYSKIP();
  ------------------
  |  |   35|  7.66k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  7.66k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  380|  7.66k|	yych = YYPEEK();
  ------------------
  |  |   33|  7.66k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  7.66k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  7.66k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 7.66k, False: 4]
  |  |  ------------------
  ------------------
  381|  7.66k|	switch (yych) {
  382|  7.64k|		case '=': goto yy21;
  ------------------
  |  Branch (382:3): [True: 7.64k, False: 15]
  ------------------
  383|     15|		default: goto yy17;
  ------------------
  |  Branch (383:3): [True: 15, False: 7.64k]
  ------------------
  384|  7.66k|	}
  385|  6.39k|yy19:
  386|  6.39k|	YYSKIP();
  ------------------
  |  |   35|  6.39k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  6.39k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  387|  6.39k|	YYBACKUP();
  ------------------
  |  |   36|  6.39k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  6.39k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  6.39k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  388|  6.39k|	yych = YYPEEK();
  ------------------
  |  |   33|  6.39k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.39k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.38k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 6.38k, False: 1]
  |  |  ------------------
  ------------------
  389|  6.39k|	switch (yych) {
  390|  6.38k|		case 's': goto yy22;
  ------------------
  |  Branch (390:3): [True: 6.38k, False: 8]
  ------------------
  391|      8|		default: goto yy17;
  ------------------
  |  Branch (391:3): [True: 8, False: 6.38k]
  ------------------
  392|  6.39k|	}
  393|  8.66k|yy20:
  394|  8.66k|	YYSKIP();
  ------------------
  |  |   35|  8.66k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  8.66k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  395|  8.66k|	YYBACKUP();
  ------------------
  |  |   36|  8.66k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  8.66k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  8.66k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  396|  8.66k|	yych = YYPEEK();
  ------------------
  |  |   33|  8.66k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  8.66k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  8.66k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 8.66k, False: 1]
  |  |  ------------------
  ------------------
  397|  8.66k|	switch (yych) {
  398|  6.78k|		case '=': goto yy21;
  ------------------
  |  Branch (398:3): [True: 6.78k, False: 1.87k]
  ------------------
  399|  1.87k|		case 'v': goto yy24;
  ------------------
  |  Branch (399:3): [True: 1.87k, False: 6.78k]
  ------------------
  400|      2|		default: goto yy17;
  ------------------
  |  Branch (400:3): [True: 2, False: 8.66k]
  ------------------
  401|  8.66k|	}
  402|  22.4k|yy21:
  403|  22.4k|	YYSKIP();
  ------------------
  |  |   35|  22.4k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  22.4k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  404|  22.4k|	svr = context.yyt5;
  405|  22.4k|	svu = context.yyt1;
  406|  22.4k|	sve = context.yyt2;
  407|  22.4k|	ns = context.yyt3;
  408|  22.4k|	nsu = context.yyt4;
  409|  22.4k|	YYSTAGP(body);
  ------------------
  |  |   38|  22.4k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  22.4k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  410|  22.4k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  22.4k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  411|  22.4k|	{ goto match; }
  412|  6.38k|yy22:
  413|  6.38k|	YYSKIP();
  ------------------
  |  |   35|  6.38k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  6.38k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  414|  6.38k|	yych = YYPEEK();
  ------------------
  |  |   33|  6.38k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.38k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.38k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 6.38k, False: 2]
  |  |  ------------------
  ------------------
  415|  6.38k|	switch (yych) {
  416|  4.57k|		case '=': goto yy25;
  ------------------
  |  Branch (416:3): [True: 4.57k, False: 1.81k]
  ------------------
  417|  1.80k|		case 'u': goto yy26;
  ------------------
  |  Branch (417:3): [True: 1.80k, False: 4.57k]
  ------------------
  418|      2|		default: goto yy23;
  ------------------
  |  Branch (418:3): [True: 2, False: 6.38k]
  ------------------
  419|  6.38k|	}
  420|    222|yy23:
  421|    222|	YYRESTORE();
  ------------------
  |  |   37|    222|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|    222|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|    222|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  422|    222|	goto yy17;
  423|  1.87k|yy24:
  424|  1.87k|	YYSKIP();
  ------------------
  |  |   35|  1.87k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.87k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  425|  1.87k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.87k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.87k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.87k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.87k, False: 1]
  |  |  ------------------
  ------------------
  426|  1.87k|	switch (yych) {
  427|  1.52k|		case 'r': goto yy27;
  ------------------
  |  Branch (427:3): [True: 1.52k, False: 356]
  ------------------
  428|    355|		case 'u': goto yy28;
  ------------------
  |  Branch (428:3): [True: 355, False: 1.52k]
  ------------------
  429|      1|		default: goto yy23;
  ------------------
  |  Branch (429:3): [True: 1, False: 1.87k]
  ------------------
  430|  1.87k|	}
  431|  4.57k|yy25:
  432|  4.57k|	YYSKIP();
  ------------------
  |  |   35|  4.57k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  4.57k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  433|  4.57k|	yych = YYPEEK();
  ------------------
  |  |   33|  4.57k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.57k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.57k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 4.57k, False: 1]
  |  |  ------------------
  ------------------
  434|  4.57k|	switch (yych) {
  435|     33|		case '0':
  ------------------
  |  Branch (435:3): [True: 33, False: 4.54k]
  ------------------
  436|  4.17k|		case '1':
  ------------------
  |  Branch (436:3): [True: 4.13k, False: 435]
  ------------------
  437|  4.23k|		case '2':
  ------------------
  |  Branch (437:3): [True: 60, False: 4.51k]
  ------------------
  438|  4.32k|		case '3':
  ------------------
  |  Branch (438:3): [True: 89, False: 4.48k]
  ------------------
  439|  4.34k|		case '4':
  ------------------
  |  Branch (439:3): [True: 28, False: 4.54k]
  ------------------
  440|  4.36k|		case '5':
  ------------------
  |  Branch (440:3): [True: 17, False: 4.55k]
  ------------------
  441|  4.51k|		case '6':
  ------------------
  |  Branch (441:3): [True: 144, False: 4.43k]
  ------------------
  442|  4.55k|		case '7':
  ------------------
  |  Branch (442:3): [True: 41, False: 4.53k]
  ------------------
  443|  4.56k|		case '8':
  ------------------
  |  Branch (443:3): [True: 13, False: 4.56k]
  ------------------
  444|  4.57k|		case '9':
  ------------------
  |  Branch (444:3): [True: 9, False: 4.56k]
  ------------------
  445|  4.57k|			YYSTAGP(context.yyt3);
  ------------------
  |  |   38|  4.57k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  4.57k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  446|  4.57k|			goto yy29;
  447|      1|		default: goto yy23;
  ------------------
  |  Branch (447:3): [True: 1, False: 4.57k]
  ------------------
  448|  4.57k|	}
  449|  1.80k|yy26:
  450|  1.80k|	YYSKIP();
  ------------------
  |  |   35|  1.80k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.80k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  451|  1.80k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.80k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.80k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.80k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.80k, False: 1]
  |  |  ------------------
  ------------------
  452|  1.80k|	switch (yych) {
  453|  1.80k|		case '=': goto yy30;
  ------------------
  |  Branch (453:3): [True: 1.80k, False: 5]
  ------------------
  454|      5|		default: goto yy23;
  ------------------
  |  Branch (454:3): [True: 5, False: 1.80k]
  ------------------
  455|  1.80k|	}
  456|  1.52k|yy27:
  457|  1.52k|	YYSKIP();
  ------------------
  |  |   35|  1.52k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.52k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  458|  1.52k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.52k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.52k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.52k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.52k, False: 1]
  |  |  ------------------
  ------------------
  459|  1.52k|	switch (yych) {
  460|  1.51k|		case '=': goto yy31;
  ------------------
  |  Branch (460:3): [True: 1.51k, False: 9]
  ------------------
  461|      9|		default: goto yy23;
  ------------------
  |  Branch (461:3): [True: 9, False: 1.51k]
  ------------------
  462|  1.52k|	}
  463|    355|yy28:
  464|    355|	YYSKIP();
  ------------------
  |  |   35|    355|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    355|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  465|    355|	yych = YYPEEK();
  ------------------
  |  |   33|    355|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    355|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    354|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 354, False: 1]
  |  |  ------------------
  ------------------
  466|    355|	switch (yych) {
  467|    342|		case '=': goto yy32;
  ------------------
  |  Branch (467:3): [True: 342, False: 13]
  ------------------
  468|     13|		default: goto yy23;
  ------------------
  |  Branch (468:3): [True: 13, False: 342]
  ------------------
  469|    355|	}
  470|  20.1k|yy29:
  471|  20.1k|	YYSKIP();
  ------------------
  |  |   35|  20.1k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  20.1k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  472|  20.1k|	yych = YYPEEK();
  ------------------
  |  |   33|  20.1k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  20.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  20.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 20.1k, False: 70]
  |  |  ------------------
  ------------------
  473|  20.1k|	switch (yych) {
  474|    497|		case '0':
  ------------------
  |  Branch (474:3): [True: 497, False: 19.7k]
  ------------------
  475|    781|		case '1':
  ------------------
  |  Branch (475:3): [True: 284, False: 19.9k]
  ------------------
  476|  1.02k|		case '2':
  ------------------
  |  Branch (476:3): [True: 247, False: 19.9k]
  ------------------
  477|  1.31k|		case '3':
  ------------------
  |  Branch (477:3): [True: 289, False: 19.9k]
  ------------------
  478|  1.60k|		case '4':
  ------------------
  |  Branch (478:3): [True: 286, False: 19.9k]
  ------------------
  479|  1.90k|		case '5':
  ------------------
  |  Branch (479:3): [True: 297, False: 19.9k]
  ------------------
  480|  6.15k|		case '6':
  ------------------
  |  Branch (480:3): [True: 4.25k, False: 15.9k]
  ------------------
  481|  6.54k|		case '7':
  ------------------
  |  Branch (481:3): [True: 392, False: 19.8k]
  ------------------
  482|  15.1k|		case '8':
  ------------------
  |  Branch (482:3): [True: 8.58k, False: 11.6k]
  ------------------
  483|  15.6k|		case '9': goto yy29;
  ------------------
  |  Branch (483:3): [True: 501, False: 19.6k]
  ------------------
  484|  4.50k|		case ';':
  ------------------
  |  Branch (484:3): [True: 4.50k, False: 15.6k]
  ------------------
  485|  4.50k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  4.50k|#define YYSTAGN(t) t = NULL
  ------------------
  486|  4.50k|			goto yy33;
  487|     71|		default: goto yy23;
  ------------------
  |  Branch (487:3): [True: 71, False: 20.1k]
  ------------------
  488|  20.1k|	}
  489|  1.80k|yy30:
  490|  1.80k|	YYSKIP();
  ------------------
  |  |   35|  1.80k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.80k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  491|  1.80k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.80k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.80k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.80k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.80k, False: 1]
  |  |  ------------------
  ------------------
  492|  1.80k|	switch (yych) {
  493|      1|		case 0x00: goto yy23;
  ------------------
  |  Branch (493:3): [True: 1, False: 1.80k]
  ------------------
  494|    175|		case ';':
  ------------------
  |  Branch (494:3): [True: 175, False: 1.62k]
  ------------------
  495|    175|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    175|#define YYSTAGN(t) t = NULL
  ------------------
  496|    175|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|    175|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    175|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  497|    175|			goto yy33;
  498|  1.62k|		default:
  ------------------
  |  Branch (498:3): [True: 1.62k, False: 176]
  ------------------
  499|  1.62k|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|  1.62k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.62k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  500|  1.62k|			goto yy34;
  501|  1.80k|	}
  502|  1.51k|yy31:
  503|  1.51k|	YYSKIP();
  ------------------
  |  |   35|  1.51k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.51k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  504|  1.51k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.51k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.51k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.51k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.51k, False: 1]
  |  |  ------------------
  ------------------
  505|  1.51k|	switch (yych) {
  506|     63|		case '0':
  ------------------
  |  Branch (506:3): [True: 63, False: 1.44k]
  ------------------
  507|    396|		case '1':
  ------------------
  |  Branch (507:3): [True: 333, False: 1.17k]
  ------------------
  508|    435|		case '2':
  ------------------
  |  Branch (508:3): [True: 39, False: 1.47k]
  ------------------
  509|    735|		case '3':
  ------------------
  |  Branch (509:3): [True: 300, False: 1.21k]
  ------------------
  510|  1.18k|		case '4':
  ------------------
  |  Branch (510:3): [True: 449, False: 1.06k]
  ------------------
  511|  1.20k|		case '5':
  ------------------
  |  Branch (511:3): [True: 24, False: 1.48k]
  ------------------
  512|  1.23k|		case '6':
  ------------------
  |  Branch (512:3): [True: 31, False: 1.48k]
  ------------------
  513|  1.41k|		case '7':
  ------------------
  |  Branch (513:3): [True: 176, False: 1.33k]
  ------------------
  514|  1.48k|		case '8':
  ------------------
  |  Branch (514:3): [True: 70, False: 1.44k]
  ------------------
  515|  1.51k|		case '9':
  ------------------
  |  Branch (515:3): [True: 25, False: 1.48k]
  ------------------
  516|  1.51k|			YYSTAGP(context.yyt5);
  ------------------
  |  |   38|  1.51k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.51k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  517|  1.51k|			goto yy35;
  518|      2|		default: goto yy23;
  ------------------
  |  Branch (518:3): [True: 2, False: 1.51k]
  ------------------
  519|  1.51k|	}
  520|    342|yy32:
  521|    342|	YYSKIP();
  ------------------
  |  |   35|    342|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    342|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  522|    342|	yych = YYPEEK();
  ------------------
  |  |   33|    342|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    342|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    341|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 341, False: 1]
  |  |  ------------------
  ------------------
  523|    342|	switch (yych) {
  524|      1|		case 0x00: goto yy23;
  ------------------
  |  Branch (524:3): [True: 1, False: 341]
  ------------------
  525|      9|		case ';':
  ------------------
  |  Branch (525:3): [True: 9, False: 333]
  ------------------
  526|      9|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|      9|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|      9|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  527|      9|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|      9|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|      9|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  528|      9|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|      9|#define YYSTAGN(t) t = NULL
  ------------------
  529|      9|			goto yy37;
  530|    332|		default:
  ------------------
  |  Branch (530:3): [True: 332, False: 10]
  ------------------
  531|    332|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|    332|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    332|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  532|    332|			goto yy36;
  533|    342|	}
  534|  6.29k|yy33:
  535|  6.29k|	YYSKIP();
  ------------------
  |  |   35|  6.29k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  6.29k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  536|  6.29k|	yych = YYPEEK();
  ------------------
  |  |   33|  6.29k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.29k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  6.29k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 6.29k, False: 3]
  |  |  ------------------
  ------------------
  537|  6.29k|	switch (yych) {
  538|  4.21k|		case 'b':
  ------------------
  |  Branch (538:3): [True: 4.21k, False: 2.08k]
  ------------------
  539|  4.21k|		case 'g':
  ------------------
  |  Branch (539:3): [True: 1, False: 6.29k]
  ------------------
  540|  4.52k|		case 'i':
  ------------------
  |  Branch (540:3): [True: 304, False: 5.99k]
  ------------------
  541|  6.29k|		case 's': goto yy38;
  ------------------
  |  Branch (541:3): [True: 1.77k, False: 4.52k]
  ------------------
  542|      3|		default: goto yy23;
  ------------------
  |  Branch (542:3): [True: 3, False: 6.29k]
  ------------------
  543|  6.29k|	}
  544|   224k|yy34:
  545|   224k|	YYSKIP();
  ------------------
  |  |   35|   224k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|   224k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  546|   224k|	yych = YYPEEK();
  ------------------
  |  |   33|   224k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   224k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   224k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 224k, False: 6]
  |  |  ------------------
  ------------------
  547|   224k|	switch (yych) {
  548|      6|		case 0x00: goto yy23;
  ------------------
  |  Branch (548:3): [True: 6, False: 224k]
  ------------------
  549|  1.62k|		case ';':
  ------------------
  |  Branch (549:3): [True: 1.62k, False: 223k]
  ------------------
  550|  1.62k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  1.62k|#define YYSTAGN(t) t = NULL
  ------------------
  551|  1.62k|			goto yy33;
  552|   223k|		default: goto yy34;
  ------------------
  |  Branch (552:3): [True: 223k, False: 1.62k]
  ------------------
  553|   224k|	}
  554|  76.7k|yy35:
  555|  76.7k|	YYSKIP();
  ------------------
  |  |   35|  76.7k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  76.7k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  556|  76.7k|	yych = YYPEEK();
  ------------------
  |  |   33|  76.7k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  76.7k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  76.6k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 76.6k, False: 58]
  |  |  ------------------
  ------------------
  557|  76.7k|	switch (yych) {
  558|  69.5k|		case '0':
  ------------------
  |  Branch (558:3): [True: 69.5k, False: 7.21k]
  ------------------
  559|  69.9k|		case '1':
  ------------------
  |  Branch (559:3): [True: 419, False: 76.3k]
  ------------------
  560|  70.3k|		case '2':
  ------------------
  |  Branch (560:3): [True: 357, False: 76.3k]
  ------------------
  561|  70.6k|		case '3':
  ------------------
  |  Branch (561:3): [True: 374, False: 76.3k]
  ------------------
  562|  71.2k|		case '4':
  ------------------
  |  Branch (562:3): [True: 606, False: 76.1k]
  ------------------
  563|  71.6k|		case '5':
  ------------------
  |  Branch (563:3): [True: 389, False: 76.3k]
  ------------------
  564|  73.8k|		case '6':
  ------------------
  |  Branch (564:3): [True: 2.20k, False: 74.5k]
  ------------------
  565|  74.2k|		case '7':
  ------------------
  |  Branch (565:3): [True: 356, False: 76.3k]
  ------------------
  566|  74.6k|		case '8':
  ------------------
  |  Branch (566:3): [True: 456, False: 76.2k]
  ------------------
  567|  75.2k|		case '9': goto yy35;
  ------------------
  |  Branch (567:3): [True: 541, False: 76.2k]
  ------------------
  568|  1.44k|		case ';':
  ------------------
  |  Branch (568:3): [True: 1.44k, False: 75.2k]
  ------------------
  569|  1.44k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  1.44k|#define YYSTAGN(t) t = NULL
  ------------------
  570|  1.44k|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|  1.44k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  1.44k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  571|  1.44k|			goto yy37;
  572|     67|		default: goto yy23;
  ------------------
  |  Branch (572:3): [True: 67, False: 76.6k]
  ------------------
  573|  76.7k|	}
  574|  4.35M|yy36:
  575|  4.35M|	YYSKIP();
  ------------------
  |  |   35|  4.35M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  4.35M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  576|  4.35M|	yych = YYPEEK();
  ------------------
  |  |   33|  4.35M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.35M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.35M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 4.35M, False: 11]
  |  |  ------------------
  ------------------
  577|  4.35M|	switch (yych) {
  578|     11|		case 0x00: goto yy23;
  ------------------
  |  Branch (578:3): [True: 11, False: 4.35M]
  ------------------
  579|    321|		case ';':
  ------------------
  |  Branch (579:3): [True: 321, False: 4.35M]
  ------------------
  580|    321|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    321|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    321|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  581|    321|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    321|#define YYSTAGN(t) t = NULL
  ------------------
  582|    321|			goto yy37;
  583|  4.35M|		default: goto yy36;
  ------------------
  |  Branch (583:3): [True: 4.35M, False: 332]
  ------------------
  584|  4.35M|	}
  585|  1.77k|yy37:
  586|  1.77k|	YYSKIP();
  ------------------
  |  |   35|  1.77k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.77k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  587|  1.77k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.77k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.77k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.77k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.77k, False: 3]
  |  |  ------------------
  ------------------
  588|  1.77k|	switch (yych) {
  589|     83|		case 'b':
  ------------------
  |  Branch (589:3): [True: 83, False: 1.69k]
  ------------------
  590|     84|		case 'g':
  ------------------
  |  Branch (590:3): [True: 1, False: 1.77k]
  ------------------
  591|    103|		case 'i':
  ------------------
  |  Branch (591:3): [True: 19, False: 1.75k]
  ------------------
  592|  1.76k|		case 's':
  ------------------
  |  Branch (592:3): [True: 1.65k, False: 115]
  ------------------
  593|  1.76k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  1.76k|#define YYSTAGN(t) t = NULL
  ------------------
  594|  1.76k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  1.76k|#define YYSTAGN(t) t = NULL
  ------------------
  595|  1.76k|			goto yy38;
  596|      6|		case 'n': goto yy39;
  ------------------
  |  Branch (596:3): [True: 6, False: 1.76k]
  ------------------
  597|      6|		default: goto yy23;
  ------------------
  |  Branch (597:3): [True: 6, False: 1.76k]
  ------------------
  598|  1.77k|	}
  599|  8.05k|yy38:
  600|  8.05k|	YYSKIP();
  ------------------
  |  |   35|  8.05k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  8.05k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  601|  8.05k|	yych = YYPEEK();
  ------------------
  |  |   33|  8.05k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  8.05k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  8.04k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 8.04k, False: 8]
  |  |  ------------------
  ------------------
  602|  8.05k|	switch (yych) {
  603|  8.03k|		case '=': goto yy21;
  ------------------
  |  Branch (603:3): [True: 8.03k, False: 20]
  ------------------
  604|     20|		default: goto yy23;
  ------------------
  |  Branch (604:3): [True: 20, False: 8.03k]
  ------------------
  605|  8.05k|	}
  606|      6|yy39:
  607|      6|	YYSKIP();
  ------------------
  |  |   35|      6|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      6|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  608|      6|	yych = YYPEEK();
  ------------------
  |  |   33|      6|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      6|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      5|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 5, False: 1]
  |  |  ------------------
  ------------------
  609|      6|	switch (yych) {
  610|      3|		case 's': goto yy22;
  ------------------
  |  Branch (610:3): [True: 3, False: 3]
  ------------------
  611|      3|		default: goto yy23;
  ------------------
  |  Branch (611:3): [True: 3, False: 3]
  ------------------
  612|      6|	}
  613|      6|}
  614|       |
  615|       |
  616|  22.4k| match:
  617|  22.4k|    if(svu) {
  ------------------
  |  Branch (617:8): [True: 317, False: 22.1k]
  ------------------
  618|       |        /* ServerUri */
  619|    317|        UA_String serverUri = {(size_t)(sve - svu), (UA_Byte*)(uintptr_t)svu};
  620|    317|        size_t i = 0;
  621|    317|        for(; i < serverUrisSize; i++) {
  ------------------
  |  Branch (621:15): [True: 0, False: 317]
  ------------------
  622|      0|            if(UA_String_equal(&serverUri, &serverUris[i]))
  ------------------
  |  Branch (622:16): [True: 0, False: 0]
  ------------------
  623|      0|                break;
  624|      0|        }
  625|    317|        if(i == serverUrisSize) {
  ------------------
  |  Branch (625:12): [True: 317, False: 0]
  ------------------
  626|       |            /* The ServerUri cannot be mapped. Return the entire input as a
  627|       |             * string NodeId. */
  628|    317|            UA_String total = {(size_t)(end - begin), (UA_Byte*)(uintptr_t)begin};
  629|    317|            id->nodeId.identifierType = UA_NODEIDTYPE_STRING;
  630|    317|            return UA_String_copy(&total, &id->nodeId.identifier.string);
  631|    317|        }
  632|      0|        id->serverIndex = (UA_UInt32)i;
  633|  22.1k|    } else if(svr) {
  ------------------
  |  Branch (633:15): [True: 1.43k, False: 20.7k]
  ------------------
  634|       |        /* ServerIndex */
  635|  1.43k|        size_t len = (size_t)(sve - svr);
  636|  1.43k|        if(UA_readNumber((const UA_Byte*)svr, len, &id->serverIndex) != len)
  ------------------
  |  Branch (636:12): [True: 0, False: 1.43k]
  ------------------
  637|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  638|  1.43k|    }
  639|       |
  640|  22.1k|    if(nsu) {
  ------------------
  |  Branch (640:8): [True: 1.79k, False: 20.3k]
  ------------------
  641|       |        /* NamespaceUri */
  642|  1.79k|        UA_String nsuri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  643|  1.79k|        UA_StatusCode res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|  1.79k|#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|  1.79k|        if(id->serverIndex == 0)
  ------------------
  |  Branch (646:12): [True: 1.79k, False: 0]
  ------------------
  647|  1.79k|            res = escapedUri2Index(nsuri, &id->nodeId.namespaceIndex, nsMapping);
  648|  1.79k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  1.79k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (648:12): [True: 1.79k, False: 0]
  ------------------
  649|  1.79k|            res = UA_String_copy(&nsuri, &id->namespaceUri); /* Keep the Uri without mapping */
  650|  1.79k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  1.79k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (650:12): [True: 0, False: 1.79k]
  ------------------
  651|      0|            return res;
  652|  20.3k|    } else if(ns) {
  ------------------
  |  Branch (652:15): [True: 4.49k, False: 15.8k]
  ------------------
  653|       |        /* NamespaceIndex */
  654|  4.49k|        UA_UInt32 tmp;
  655|  4.49k|        size_t len = (size_t)(body - 1 - ns);
  656|  4.49k|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (656:12): [True: 0, False: 4.49k]
  ------------------
  657|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  658|  4.49k|        id->nodeId.namespaceIndex = (UA_UInt16)tmp;
  659|  4.49k|        if(nsMapping)
  ------------------
  |  Branch (659:12): [True: 0, False: 4.49k]
  ------------------
  660|      0|            id->nodeId.namespaceIndex =
  661|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->nodeId.namespaceIndex);
  662|  4.49k|    }
  663|       |
  664|       |    /* From the current position until the end */
  665|  22.1k|    return parse_nodeid_body(&id->nodeId, body, end, idEsc);
  666|  22.1k|}
ua_types_lex.c:parse_qn:
  707|  45.8k|         UA_UInt16 defaultNamespaceIndex) {
  708|  45.8k|    size_t len;
  709|  45.8k|    UA_UInt32 tmp;
  710|  45.8k|    UA_String str;
  711|  45.8k|    UA_StatusCode res;
  712|       |
  713|  45.8k|    LexContext context;
  714|  45.8k|    memset(&context, 0, sizeof(LexContext));
  715|       |
  716|  45.8k|    const u8 *begin = pos;
  717|  45.8k|    UA_QualifiedName_init(qn);
  718|  45.8k|    qn->namespaceIndex = defaultNamespaceIndex;
  719|       |
  720|       |    
  721|  45.8k|{
  722|  45.8k|	u8 yych;
  723|  45.8k|	yych = YYPEEK();
  ------------------
  |  |   33|  45.8k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  45.8k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  39.1k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 39.1k, False: 6.71k]
  |  |  ------------------
  ------------------
  724|  45.8k|	switch (yych) {
  725|  6.71k|		case 0x00:
  ------------------
  |  Branch (725:3): [True: 6.71k, False: 39.1k]
  ------------------
  726|  6.92k|		case ';': goto yy41;
  ------------------
  |  Branch (726:3): [True: 215, False: 45.6k]
  ------------------
  727|  15.9k|		case '0':
  ------------------
  |  Branch (727:3): [True: 15.9k, False: 29.9k]
  ------------------
  728|  16.7k|		case '1':
  ------------------
  |  Branch (728:3): [True: 844, False: 44.9k]
  ------------------
  729|  17.2k|		case '2':
  ------------------
  |  Branch (729:3): [True: 495, False: 45.3k]
  ------------------
  730|  18.0k|		case '3':
  ------------------
  |  Branch (730:3): [True: 813, False: 45.0k]
  ------------------
  731|  19.8k|		case '4':
  ------------------
  |  Branch (731:3): [True: 1.80k, False: 44.0k]
  ------------------
  732|  20.4k|		case '5':
  ------------------
  |  Branch (732:3): [True: 571, False: 45.2k]
  ------------------
  733|  21.3k|		case '6':
  ------------------
  |  Branch (733:3): [True: 870, False: 44.9k]
  ------------------
  734|  21.7k|		case '7':
  ------------------
  |  Branch (734:3): [True: 399, False: 45.4k]
  ------------------
  735|  21.9k|		case '8':
  ------------------
  |  Branch (735:3): [True: 259, False: 45.5k]
  ------------------
  736|  22.3k|		case '9': goto yy44;
  ------------------
  |  Branch (736:3): [True: 369, False: 45.4k]
  ------------------
  737|  16.5k|		default: goto yy43;
  ------------------
  |  Branch (737:3): [True: 16.5k, False: 29.2k]
  ------------------
  738|  45.8k|	}
  739|  6.92k|yy41:
  740|  6.92k|	YYSKIP();
  ------------------
  |  |   35|  6.92k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  6.92k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  741|  42.4k|yy42:
  742|  42.4k|	{ pos = begin; goto match_name; }
  743|  16.5k|yy43:
  744|  16.5k|	YYSKIP();
  ------------------
  |  |   35|  16.5k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  16.5k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  745|  16.5k|	YYBACKUP();
  ------------------
  |  |   36|  16.5k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  16.5k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  16.5k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  746|  16.5k|	yych = YYPEEK();
  ------------------
  |  |   33|  16.5k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  16.5k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  7.12k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 7.12k, False: 9.43k]
  |  |  ------------------
  ------------------
  747|  16.5k|	if (yych <= 0x00) goto yy42;
  ------------------
  |  Branch (747:6): [True: 9.43k, False: 7.12k]
  ------------------
  748|  7.12k|	goto yy46;
  749|  22.3k|yy44:
  750|  22.3k|	YYSKIP();
  ------------------
  |  |   35|  22.3k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  22.3k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  751|  22.3k|	YYBACKUP();
  ------------------
  |  |   36|  22.3k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  22.3k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  22.3k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  752|  22.3k|	yych = YYPEEK();
  ------------------
  |  |   33|  22.3k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  22.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  9.00k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 9.00k, False: 13.3k]
  |  |  ------------------
  ------------------
  753|  22.3k|	switch (yych) {
  754|  5.19k|		case '0':
  ------------------
  |  Branch (754:3): [True: 5.19k, False: 17.1k]
  ------------------
  755|  5.47k|		case '1':
  ------------------
  |  Branch (755:3): [True: 281, False: 22.0k]
  ------------------
  756|  5.77k|		case '2':
  ------------------
  |  Branch (756:3): [True: 300, False: 22.0k]
  ------------------
  757|  6.13k|		case '3':
  ------------------
  |  Branch (757:3): [True: 361, False: 21.9k]
  ------------------
  758|  6.35k|		case '4':
  ------------------
  |  Branch (758:3): [True: 221, False: 22.1k]
  ------------------
  759|  6.51k|		case '5':
  ------------------
  |  Branch (759:3): [True: 166, False: 22.1k]
  ------------------
  760|  6.62k|		case '6':
  ------------------
  |  Branch (760:3): [True: 105, False: 22.2k]
  ------------------
  761|  6.77k|		case '7':
  ------------------
  |  Branch (761:3): [True: 147, False: 22.1k]
  ------------------
  762|  6.83k|		case '8':
  ------------------
  |  Branch (762:3): [True: 65, False: 22.2k]
  ------------------
  763|  7.03k|		case '9':
  ------------------
  |  Branch (763:3): [True: 203, False: 22.1k]
  ------------------
  764|  7.75k|		case ':': goto yy50;
  ------------------
  |  Branch (764:3): [True: 719, False: 21.6k]
  ------------------
  765|  14.5k|		default: goto yy42;
  ------------------
  |  Branch (765:3): [True: 14.5k, False: 7.75k]
  ------------------
  766|  22.3k|	}
  767|  9.23M|yy45:
  768|  9.23M|	YYSKIP();
  ------------------
  |  |   35|  9.23M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  9.23M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  769|  9.23M|	yych = YYPEEK();
  ------------------
  |  |   33|  9.23M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  9.23M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  9.23M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 9.23M, False: 4.75k]
  |  |  ------------------
  ------------------
  770|  9.24M|yy46:
  771|  9.24M|	switch (yych) {
  772|  4.75k|		case 0x00: goto yy47;
  ------------------
  |  Branch (772:3): [True: 4.75k, False: 9.23M]
  ------------------
  773|  2.36k|		case ';': goto yy48;
  ------------------
  |  Branch (773:3): [True: 2.36k, False: 9.24M]
  ------------------
  774|  9.23M|		default: goto yy45;
  ------------------
  |  Branch (774:3): [True: 9.23M, False: 7.12k]
  ------------------
  775|  9.24M|	}
  776|  11.5k|yy47:
  777|  11.5k|	YYRESTORE();
  ------------------
  |  |   37|  11.5k|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|  11.5k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|  11.5k|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  778|  11.5k|	goto yy42;
  779|  2.36k|yy48:
  780|  2.36k|	YYSKIP();
  ------------------
  |  |   35|  2.36k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.36k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  781|  2.36k|	{ goto match_uri; }
  782|   133k|yy49:
  783|   133k|	YYSKIP();
  ------------------
  |  |   35|   133k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|   133k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  784|   133k|	yych = YYPEEK();
  ------------------
  |  |   33|   133k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   133k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   132k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 132k, False: 939]
  |  |  ------------------
  ------------------
  785|   141k|yy50:
  786|   141k|	switch (yych) {
  787|  48.4k|		case '0':
  ------------------
  |  Branch (787:3): [True: 48.4k, False: 92.8k]
  ------------------
  788|  52.9k|		case '1':
  ------------------
  |  Branch (788:3): [True: 4.54k, False: 136k]
  ------------------
  789|  66.7k|		case '2':
  ------------------
  |  Branch (789:3): [True: 13.7k, False: 127k]
  ------------------
  790|  72.9k|		case '3':
  ------------------
  |  Branch (790:3): [True: 6.27k, False: 134k]
  ------------------
  791|  88.1k|		case '4':
  ------------------
  |  Branch (791:3): [True: 15.1k, False: 126k]
  ------------------
  792|  95.0k|		case '5':
  ------------------
  |  Branch (792:3): [True: 6.89k, False: 134k]
  ------------------
  793|   109k|		case '6':
  ------------------
  |  Branch (793:3): [True: 14.5k, False: 126k]
  ------------------
  794|   114k|		case '7':
  ------------------
  |  Branch (794:3): [True: 4.71k, False: 136k]
  ------------------
  795|   119k|		case '8':
  ------------------
  |  Branch (795:3): [True: 4.72k, False: 136k]
  ------------------
  796|   133k|		case '9': goto yy49;
  ------------------
  |  Branch (796:3): [True: 14.4k, False: 126k]
  ------------------
  797|    995|		case ':': goto yy51;
  ------------------
  |  Branch (797:3): [True: 995, False: 140k]
  ------------------
  798|  6.76k|		default: goto yy47;
  ------------------
  |  Branch (798:3): [True: 6.76k, False: 134k]
  ------------------
  799|   141k|	}
  800|    995|yy51:
  801|    995|	YYSKIP();
  ------------------
  |  |   35|    995|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    995|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  802|    995|	{ goto match_index; }
  803|   141k|}
  804|       |
  805|       |
  806|    995| match_index:
  807|    995|    len = (size_t)(pos - 1 - begin);
  808|    995|    if(UA_readNumber((const UA_Byte*)begin, len, &tmp) != len)
  ------------------
  |  Branch (808:8): [True: 0, False: 995]
  ------------------
  809|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  810|    995|    qn->namespaceIndex = (UA_UInt16)tmp;
  811|    995|    goto match_name;
  812|       |
  813|  2.36k| match_uri:
  814|  2.36k|    str.length = (size_t)(pos - 1 - begin);
  815|  2.36k|    str.data = (UA_Byte*)(uintptr_t)begin;
  816|  2.36k|    res = escapedUri2Index(str, &qn->namespaceIndex, nsMapping);
  817|  2.36k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  2.36k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (817:8): [True: 2.36k, False: 0]
  ------------------
  818|  2.36k|        pos = begin; /* Use the entire string for the name */
  819|       |
  820|  45.8k| match_name:
  821|  45.8k|    str.length = (size_t)(end - pos);
  822|  45.8k|    str.data = (UA_Byte*)(uintptr_t)pos;
  823|  45.8k|    res = UA_String_copy(&str, &qn->name);
  824|  45.8k|    if(UA_LIKELY(res == UA_STATUSCODE_GOOD))
  ------------------
  |  |  579|  45.8k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (579:23): [True: 45.8k, False: 0]
  |  |  ------------------
  ------------------
  825|  45.8k|        res = UA_String_unescape(&qn->name, false, escName);
  826|  45.8k|    return res;
  827|  2.36k|}

UA_readNumberWithBase:
  111|  48.6k|UA_readNumberWithBase(const UA_Byte *buf, size_t buflen, UA_UInt32 *number, UA_Byte base) {
  112|  48.6k|    UA_assert(buf);
  ------------------
  |  |  400|  48.6k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (112:5): [True: 48.6k, False: 0]
  ------------------
  113|  48.6k|    UA_assert(number);
  ------------------
  |  |  400|  48.6k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (113:5): [True: 48.6k, False: 0]
  ------------------
  114|  48.6k|    u32 n = 0;
  115|  48.6k|    size_t progress = 0;
  116|       |    /* read numbers until the end or a non-number character appears */
  117|   310k|    while(progress < buflen) {
  ------------------
  |  Branch (117:11): [True: 261k, False: 48.5k]
  ------------------
  118|   261k|        u8 c = buf[progress];
  119|   261k|        if(c >= '0' && c <= '9' && c <= '0' + (base-1))
  ------------------
  |  Branch (119:12): [True: 261k, False: 16]
  |  Branch (119:24): [True: 261k, False: 315]
  |  Branch (119:36): [True: 261k, False: 0]
  ------------------
  120|   261k|           n = (n * base) + c - '0';
  121|    331|        else if(base > 9 && c >= 'a' && c <= 'z' && c <= 'a' + (base-11))
  ------------------
  |  Branch (121:17): [True: 331, False: 0]
  |  Branch (121:29): [True: 163, False: 168]
  |  Branch (121:41): [True: 142, False: 21]
  |  Branch (121:53): [True: 130, False: 12]
  ------------------
  122|    130|           n = (n * base) + c-'a' + 10;
  123|    201|        else if(base > 9 && c >= 'A' && c <= 'Z' && c <= 'A' + (base-11))
  ------------------
  |  Branch (123:17): [True: 201, False: 0]
  |  Branch (123:29): [True: 183, False: 18]
  |  Branch (123:41): [True: 148, False: 35]
  |  Branch (123:53): [True: 124, False: 24]
  ------------------
  124|    124|           n = (n * base) + c-'A' + 10;
  125|     77|        else
  126|     77|           break;
  127|   261k|        ++progress;
  128|   261k|    }
  129|  48.6k|    *number = n;
  130|  48.6k|    return progress;
  131|  48.6k|}
UA_readNumber:
  134|  34.2k|UA_readNumber(const UA_Byte *buf, size_t buflen, UA_UInt32 *number) {
  135|  34.2k|    return UA_readNumberWithBase(buf, buflen, number, 10);
  136|  34.2k|}
UA_String_unescape:
  803|  59.3k|UA_String_unescape(UA_String *str, UA_Boolean copyEscape, UA_Escaping esc) {
  804|  59.3k|    if(esc == UA_ESCAPING_NONE)
  ------------------
  |  Branch (804:8): [True: 59.3k, False: 0]
  ------------------
  805|  59.3k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  59.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  806|       |
  807|       |    /* Does the string need escaping? */
  808|      0|    UA_String tmp;
  809|      0|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  810|      0|    u8 *pos = str->data;
  811|      0|    u8 *end = str->data + str->length;
  812|      0|    u8 escape_char = (esc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (812:23): [True: 0, False: 0]
  ------------------
  813|      0|                      esc == UA_ESCAPING_PERCENT_EXTENDED) ? '%' : '&';
  ------------------
  |  Branch (813:23): [True: 0, False: 0]
  ------------------
  814|      0|    for(; pos < end; pos++) {
  ------------------
  |  Branch (814:11): [True: 0, False: 0]
  ------------------
  815|      0|        if(*pos == escape_char)
  ------------------
  |  Branch (815:12): [True: 0, False: 0]
  ------------------
  816|      0|            goto escape;
  817|      0|    }
  818|       |
  819|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  820|       |
  821|      0| escape:
  822|      0|    if(copyEscape) {
  ------------------
  |  Branch (822:8): [True: 0, False: 0]
  ------------------
  823|      0|        res = UA_String_copy(str, &tmp);
  824|      0|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (824:12): [True: 0, False: 0]
  ------------------
  825|      0|            return res;
  826|      0|        pos = tmp.data;
  827|      0|        end = tmp.data + tmp.length;
  828|      0|    }
  829|       |
  830|      0|    u8 byte = 0;
  831|      0|    u8 *writepos = pos;
  832|       |
  833|      0|    res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  834|      0|    if(esc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (834:8): [True: 0, False: 0]
  ------------------
  835|      0|       esc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (835:8): [True: 0, False: 0]
  ------------------
  836|       |        /* Percent-Escaping */
  837|      0|        for(; pos < end; pos++) {
  ------------------
  |  Branch (837:15): [True: 0, False: 0]
  ------------------
  838|      0|            if(*pos == '%') {
  ------------------
  |  Branch (838:16): [True: 0, False: 0]
  ------------------
  839|      0|                if(pos + 2 >= end || !isHex(pos[1]) || !isHex(pos[2]))
  ------------------
  |  Branch (839:20): [True: 0, False: 0]
  |  Branch (839:38): [True: 0, False: 0]
  |  Branch (839:56): [True: 0, False: 0]
  ------------------
  840|      0|                    goto out;
  841|      0|                if(pos[1] >= 'a')
  ------------------
  |  Branch (841:20): [True: 0, False: 0]
  ------------------
  842|      0|                    byte = pos[1] - ('a' - 10);
  843|      0|                else if(pos[1] >= 'A')
  ------------------
  |  Branch (843:25): [True: 0, False: 0]
  ------------------
  844|      0|                    byte = pos[1] - ('A' - 10);
  845|      0|                else
  846|      0|                    byte = pos[1] - '0';
  847|      0|                byte <<= 4;
  848|       |
  849|      0|                if(pos[2] >= 'a')
  ------------------
  |  Branch (849:20): [True: 0, False: 0]
  ------------------
  850|      0|                    byte += (u8)(pos[2] - ('a' - 10));
  851|      0|                else if(pos[2] >= 'A')
  ------------------
  |  Branch (851:25): [True: 0, False: 0]
  ------------------
  852|      0|                    byte += (u8)(pos[2] - ('A' - 10));
  853|      0|                else
  854|      0|                    byte += (u8)(pos[2] - '0');
  855|       |
  856|      0|                pos += 2;
  857|      0|                *writepos++ = byte;
  858|      0|                continue;
  859|      0|            }
  860|      0|            *writepos++ = *pos;
  861|      0|        }
  862|      0|    } else {
  863|       |        /* And-Escaping */
  864|      0|        for(; pos < end; pos++) {
  ------------------
  |  Branch (864:15): [True: 0, False: 0]
  ------------------
  865|      0|            if(*pos == '&') {
  ------------------
  |  Branch (865:16): [True: 0, False: 0]
  ------------------
  866|      0|                pos++;
  867|      0|                if(pos == end)
  ------------------
  |  Branch (867:20): [True: 0, False: 0]
  ------------------
  868|      0|                    goto out;
  869|      0|            }
  870|      0|            *writepos++ = *pos;
  871|      0|        }
  872|      0|    }
  873|      0|    res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  874|       |
  875|      0| out:
  876|      0|    if(copyEscape) {
  ------------------
  |  Branch (876:8): [True: 0, False: 0]
  ------------------
  877|      0|        tmp.length = (size_t)(writepos - tmp.data);
  878|      0|        if(tmp.length == 0)
  ------------------
  |  Branch (878:12): [True: 0, False: 0]
  ------------------
  879|      0|            UA_String_clear(&tmp);
  880|      0|        if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (880:12): [True: 0, False: 0]
  ------------------
  881|      0|            *str = tmp;
  882|      0|        else
  883|      0|            UA_String_clear(&tmp);
  884|      0|    } else if(res == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (884:15): [True: 0, False: 0]
  ------------------
  885|      0|        str->length = (size_t)(writepos - str->data);
  886|      0|    }
  887|      0|    return res;
  888|      0|}
UA_String_escapedSize:
  894|  23.1k|UA_String_escapedSize(const UA_String s, UA_Escaping esc) {
  895|       |    /* Find out the overhead from escaping */
  896|  23.1k|    size_t overhead = 0;
  897|  15.9M|    for(size_t j = 0; j < s.length; j++) {
  ------------------
  |  Branch (897:23): [True: 15.9M, False: 23.1k]
  ------------------
  898|  15.9M|        if(esc == UA_ESCAPING_AND_EXTENDED)
  ------------------
  |  Branch (898:12): [True: 0, False: 15.9M]
  ------------------
  899|      0|            overhead += isReservedAndExtended(s.data[j]);
  900|  15.9M|        else if(esc == UA_ESCAPING_AND)
  ------------------
  |  Branch (900:17): [True: 0, False: 15.9M]
  ------------------
  901|      0|            overhead += isReservedAnd(s.data[j]);
  902|  15.9M|        else if(esc == UA_ESCAPING_PERCENT)
  ------------------
  |  Branch (902:17): [True: 336k, False: 15.6M]
  ------------------
  903|   336k|            overhead += (isReservedPercent(s.data[j]) ? 2 : 0);
  ------------------
  |  Branch (903:26): [True: 0, False: 336k]
  ------------------
  904|  15.6M|        else /* if(esc == UA_ESCAPING_PERCENT_EXTENDED) */
  905|  15.6M|            overhead += (isReservedPercentExtended(s.data[j]) ? 2 : 0);
  ------------------
  |  Branch (905:26): [True: 1.92M, False: 13.6M]
  ------------------
  906|  15.9M|    }
  907|       |
  908|  23.1k|    return s.length + overhead;
  909|  23.1k|}
UA_String_escapeInsert:
  912|  23.1k|UA_String_escapeInsert(u8 *pos, const UA_String s2, UA_Escaping esc) {
  913|  23.1k|    u8 *begin = pos;
  914|       |
  915|  23.1k|    if(esc == UA_ESCAPING_NONE) {
  ------------------
  |  Branch (915:8): [True: 20.5k, False: 2.59k]
  ------------------
  916|  15.6M|        for(size_t j = 0; j < s2.length; j++)
  ------------------
  |  Branch (916:27): [True: 15.6M, False: 20.5k]
  ------------------
  917|  15.6M|            *pos++ = s2.data[j];
  918|  20.5k|    } else if(esc == UA_ESCAPING_PERCENT || esc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (918:15): [True: 2.59k, False: 0]
  |  Branch (918:45): [True: 0, False: 0]
  ------------------
  919|   339k|        for(size_t j = 0; j < s2.length; j++) {
  ------------------
  |  Branch (919:27): [True: 336k, False: 2.59k]
  ------------------
  920|   336k|            UA_Boolean reserved = (esc == UA_ESCAPING_PERCENT_EXTENDED) ?
  ------------------
  |  Branch (920:35): [True: 0, False: 336k]
  ------------------
  921|   336k|                isReservedPercentExtended(s2.data[j]) : isReservedPercent(s2.data[j]);
  922|   336k|            if(UA_LIKELY(!reserved)) {
  ------------------
  |  |  579|   336k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (579:23): [True: 336k, False: 0]
  |  |  ------------------
  ------------------
  923|   336k|                *pos++ = s2.data[j];
  924|   336k|            } else {
  925|      0|                *pos++ = '%';
  926|      0|                *pos++ = hexchars[s2.data[j] >> 4];
  927|      0|                *pos++ = hexchars[s2.data[j] & 0x0f];
  928|      0|            }
  929|   336k|        }
  930|  2.59k|    } else {
  931|      0|        for(size_t j = 0; j < s2.length; j++) {
  ------------------
  |  Branch (931:27): [True: 0, False: 0]
  ------------------
  932|      0|            UA_Boolean reserved = (esc == UA_ESCAPING_AND_EXTENDED) ?
  ------------------
  |  Branch (932:35): [True: 0, False: 0]
  ------------------
  933|      0|                isReservedAndExtended(s2.data[j]) : isReservedAnd(s2.data[j]);
  934|      0|            if(reserved)
  ------------------
  |  Branch (934:16): [True: 0, False: 0]
  ------------------
  935|      0|                *pos++ = '&';
  936|      0|            *pos++ = s2.data[j];
  937|      0|        }
  938|      0|    }
  939|       |
  940|  23.1k|    return (size_t)(pos - begin);
  941|  23.1k|}

ua_util.c:isReservedPercent:
   95|  16.2M|isReservedPercent(u8 c) {
   96|  16.2M|    return (c == ';'  || c == '%' || c <= ' ' || c == 127);
  ------------------
  |  Branch (96:13): [True: 2.48k, False: 16.2M]
  |  Branch (96:26): [True: 8.74k, False: 16.2M]
  |  Branch (96:38): [True: 67.3k, False: 16.1M]
  |  Branch (96:50): [True: 411, False: 16.1M]
  ------------------
   97|  16.2M|}
ua_util.c:isReservedPercentExtended:
  100|  15.6M|isReservedPercentExtended(u8 c) {
  101|  15.6M|    return (isReservedPercent(c) || c == ':' || c == '#' || c == '[' || c == ']' ||
  ------------------
  |  Branch (101:13): [True: 78.9k, False: 15.5M]
  |  Branch (101:37): [True: 4.66k, False: 15.5M]
  |  Branch (101:49): [True: 4.31k, False: 15.5M]
  |  Branch (101:61): [True: 4.34k, False: 15.5M]
  |  Branch (101:73): [True: 4.03k, False: 15.5M]
  ------------------
  102|  15.5M|            c == '&' || c == '(' || c == ')' || c == ',' || c == '<' || c == '>' ||
  ------------------
  |  Branch (102:13): [True: 1.60k, False: 15.5M]
  |  Branch (102:25): [True: 62.6k, False: 15.4M]
  |  Branch (102:37): [True: 2.62k, False: 15.4M]
  |  Branch (102:49): [True: 1.58M, False: 13.8M]
  |  Branch (102:61): [True: 2.84k, False: 13.8M]
  |  Branch (102:73): [True: 1.76k, False: 13.8M]
  ------------------
  103|  13.8M|            c == '`' || c == '/' || c == '\\' || c == '"' || c == '\'' );
  ------------------
  |  Branch (103:13): [True: 3.90k, False: 13.8M]
  |  Branch (103:25): [True: 63.0k, False: 13.7M]
  |  Branch (103:37): [True: 3.47k, False: 13.7M]
  |  Branch (103:50): [True: 103k, False: 13.6M]
  |  Branch (103:62): [True: 33, False: 13.6M]
  ------------------
  104|  15.6M|}

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

fuzz_json_decode_encode.cc:_ZL15UA_Variant_initP10UA_Variant:
  244|  9.86k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_json_decode_encode.cc:_ZL16UA_Variant_clearP10UA_Variant:
  244|  6.50k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_json_decode_encode.cc:_ZL19UA_ByteString_clearP9UA_String:
  244|  6.50k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_ByteString_init:
  244|   154k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_String_copy:
  244|  61.5k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_NodeId_clear:
  244|    224|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_ExpandedNodeId_clear:
  244|    309|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_QualifiedName_init:
  244|  45.8k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_clear:
  244|   246k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_init:
  244|     73|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_init:
  244|  98.9k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_init:
  244|  1.79k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_clear:
  244|    112|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_new:
  244|      1|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_clear:
  244|     72|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl

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

