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

cj5_parse:
  305|  5.90k|          cj5_options *options) {
  306|  5.90k|    cj5_result r;
  307|  5.90k|    cj5__parser parser;
  308|  5.90k|    memset(&parser, 0x0, sizeof(parser));
  309|  5.90k|    parser.curr_tok_idx = 0;
  310|  5.90k|    parser.json5 = json5;
  311|  5.90k|    parser.len = len;
  312|  5.90k|    parser.tokens = tokens;
  313|  5.90k|    parser.max_tokens = max_tokens;
  314|       |
  315|  5.90k|    if(options)
  ------------------
  |  Branch (315:8): [True: 5.90k, False: 0]
  ------------------
  316|  5.90k|        parser.stop_early = options->stop_early;
  317|       |
  318|  5.90k|    unsigned short depth = 0; // Nesting depth zero means "outside the root object"
  319|  5.90k|    char nesting[CJ5_MAX_NESTING]; // Contains either '\0', '{' or '[' for the
  320|       |                                   // type of nesting at each depth. '\0'
  321|       |                                   // indicates we are out of the root object.
  322|  5.90k|    char next[CJ5_MAX_NESTING];    // Next content to parse: 'k' (key), ':', 'v'
  323|       |                                   // (value) or ',' (comma).
  324|  5.90k|    next[0] = 'v';  // The root is a "value" (object, array or primitive). If we
  325|       |                    // detect a colon after the first value then everything is
  326|       |                    // wrapped into a "virtual root object" and the parsing is
  327|       |                    // restarted.
  328|  5.90k|    nesting[0] = 0; // Becomes '{' if there is a virtual root object
  329|       |
  330|  5.90k|    cj5_token *token = NULL; // The current token
  331|       |
  332|  6.93k| start_parsing:
  333|  95.8M|    for(; parser.pos < len; parser.pos++) {
  ------------------
  |  Branch (333:11): [True: 95.8M, False: 5.82k]
  ------------------
  334|  95.8M|        char c = json5[parser.pos];
  335|  95.8M|        switch(c) {
  336|  47.2k|        case '\n': // Skip newline and whitespace
  ------------------
  |  Branch (336:9): [True: 47.2k, False: 95.7M]
  ------------------
  337|  47.6k|        case '\r':
  ------------------
  |  Branch (337:9): [True: 437, False: 95.8M]
  ------------------
  338|  47.8k|        case '\t':
  ------------------
  |  Branch (338:9): [True: 160, False: 95.8M]
  ------------------
  339|  48.4k|        case ' ':
  ------------------
  |  Branch (339:9): [True: 571, False: 95.8M]
  ------------------
  340|  48.4k|            break;
  341|       |
  342|    156|        case '#': // Skip comment
  ------------------
  |  Branch (342:9): [True: 156, False: 95.8M]
  ------------------
  343|  21.0k|        case '/':
  ------------------
  |  Branch (343:9): [True: 20.8k, False: 95.8M]
  ------------------
  344|  21.0k|            cj5__skip_comment(&parser);
  345|  21.0k|            if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (345:16): [True: 18.1k, False: 2.89k]
  ------------------
  346|  18.1k|               parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (346:16): [True: 26, False: 18.1k]
  ------------------
  347|     26|                goto finish;
  348|  21.0k|            break;
  349|       |
  350|  3.68M|        case '{': // Open an object or array
  ------------------
  |  Branch (350:9): [True: 3.68M, False: 92.1M]
  ------------------
  351|  3.72M|        case '[':
  ------------------
  |  Branch (351:9): [True: 41.5k, False: 95.7M]
  ------------------
  352|       |            // Check the nesting depth
  353|  3.72M|            if(depth + 1 >= CJ5_MAX_NESTING) {
  ------------------
  |  |   52|  3.72M|#define CJ5_MAX_NESTING 32
  ------------------
  |  Branch (353:16): [True: 1, False: 3.72M]
  ------------------
  354|      1|                parser.error = CJ5_ERROR_INVALID;
  355|      1|                goto finish;
  356|      1|            }
  357|       |
  358|       |            // Correct next?
  359|  3.72M|            if(next[depth] != 'v') {
  ------------------
  |  Branch (359:16): [True: 9, False: 3.72M]
  ------------------
  360|      9|                parser.error = CJ5_ERROR_INVALID;
  361|      9|                goto finish;
  362|      9|            }
  363|       |
  364|  3.72M|            depth++; // Increase the nesting depth
  365|  3.72M|            nesting[depth] = c; // Set the nesting type
  366|  3.72M|            next[depth] = (c == '{') ? 'k' : 'v'; // next is either a key or a value
  ------------------
  |  Branch (366:27): [True: 3.68M, False: 41.5k]
  ------------------
  367|       |
  368|       |            // Create a token for the object or array
  369|  3.72M|            token = cj5__alloc_token(&parser);
  370|  3.72M|            if(token) {
  ------------------
  |  Branch (370:16): [True: 1.91M, False: 1.80M]
  ------------------
  371|  1.91M|                token->parent_id = parser.curr_tok_idx;
  372|  1.91M|                token->type = (c == '{') ? CJ5_TOKEN_OBJECT : CJ5_TOKEN_ARRAY;
  ------------------
  |  Branch (372:31): [True: 1.89M, False: 23.1k]
  ------------------
  373|  1.91M|                token->start = parser.pos;
  374|  1.91M|                token->size = 0;
  375|  1.91M|                parser.curr_tok_idx = parser.token_count - 1; // The new curr_tok_idx
  376|       |                                                              // is for this token
  377|  1.91M|            }
  378|  3.72M|            break;
  379|       |
  380|  3.68M|        case '}': // Close an object or array
  ------------------
  |  Branch (380:9): [True: 3.68M, False: 92.1M]
  ------------------
  381|  3.72M|        case ']':
  ------------------
  |  Branch (381:9): [True: 41.3k, False: 95.7M]
  ------------------
  382|       |            // Check the nesting depth. Note that a "virtual root object" at
  383|       |            // depth zero must not be closed.
  384|  3.72M|            if(depth == 0) {
  ------------------
  |  Branch (384:16): [True: 4, False: 3.72M]
  ------------------
  385|      4|                parser.error = CJ5_ERROR_INVALID;
  386|      4|                goto finish;
  387|      4|            }
  388|       |
  389|       |            // Check and adjust the nesting. Note that ']' - '[' == 2 and '}' -
  390|       |            // '{' == 2. Arrays can always be closed. Objects can only close
  391|       |            // when a key or a comma is expected.
  392|  3.72M|            if(c - nesting[depth] != 2 ||
  ------------------
  |  Branch (392:16): [True: 0, False: 3.72M]
  ------------------
  393|  3.72M|               (c == '}' && next[depth] != 'k' && next[depth] != ',')) {
  ------------------
  |  Branch (393:17): [True: 3.68M, False: 41.3k]
  |  Branch (393:29): [True: 1.68M, False: 1.99M]
  |  Branch (393:51): [True: 2, False: 1.68M]
  ------------------
  394|      2|                parser.error = CJ5_ERROR_INVALID;
  395|      2|                goto finish;
  396|      2|            }
  397|       |
  398|  3.72M|            if(token) {
  ------------------
  |  Branch (398:16): [True: 1.91M, False: 1.81M]
  ------------------
  399|       |                // Finalize the current token
  400|  1.91M|                token->end = parser.pos;
  401|       |
  402|       |                // Move to the parent and increase the parent size. Omit this
  403|       |                // when we leave the root (parent the same as the current
  404|       |                // token).
  405|  1.91M|                if(parser.curr_tok_idx != token->parent_id) {
  ------------------
  |  Branch (405:20): [True: 1.90M, False: 4.48k]
  ------------------
  406|  1.90M|                    parser.curr_tok_idx = token->parent_id;
  407|  1.90M|                    token = &tokens[token->parent_id];
  408|  1.90M|                    token->size++;
  409|  1.90M|                }
  410|  1.91M|            }
  411|       |
  412|       |            // Step one level up
  413|  3.72M|            depth--;
  414|  3.72M|            next[depth] = (depth == 0) ? 0 : ','; // zero if we step out the root
  ------------------
  |  Branch (414:27): [True: 4.84k, False: 3.71M]
  ------------------
  415|       |                                                  // object. then we do not look for
  416|       |                                                  // another element.
  417|       |
  418|       |            // The first element was successfully parsed. Stop early or try to
  419|       |            // parse the full input string?
  420|  3.72M|            if(depth == 0 && parser.stop_early)
  ------------------
  |  Branch (420:16): [True: 4.84k, False: 3.71M]
  |  Branch (420:30): [True: 0, False: 4.84k]
  ------------------
  421|      0|                goto finish;
  422|       |
  423|  3.72M|            break;
  424|       |
  425|  3.72M|        case ':': // Colon (between key and value)
  ------------------
  |  Branch (425:9): [True: 3.35M, False: 92.4M]
  ------------------
  426|  3.35M|            if(next[depth] != ':') {
  ------------------
  |  Branch (426:16): [True: 977, False: 3.34M]
  ------------------
  427|    977|                parser.error = CJ5_ERROR_INVALID;
  428|    977|                goto finish;
  429|    977|            }
  430|  3.34M|            next[depth] = 'v';
  431|  3.34M|            break;
  432|       |
  433|  41.8M|        case ',': // Comma
  ------------------
  |  Branch (433:9): [True: 41.8M, False: 54.0M]
  ------------------
  434|  41.8M|            if(next[depth] != ',') {
  ------------------
  |  Branch (434:16): [True: 11, False: 41.8M]
  ------------------
  435|     11|                parser.error = CJ5_ERROR_INVALID;
  436|     11|                goto finish;
  437|     11|            }
  438|  41.8M|            next[depth] = (nesting[depth] == '{') ? 'k' : 'v';
  ------------------
  |  Branch (438:27): [True: 1.66M, False: 40.1M]
  ------------------
  439|  41.8M|            break;
  440|       |
  441|  43.1M|        default: // Value or key
  ------------------
  |  Branch (441:9): [True: 43.1M, False: 52.6M]
  ------------------
  442|  43.1M|            if(next[depth] == 'v') {
  ------------------
  |  Branch (442:16): [True: 39.8M, False: 3.34M]
  ------------------
  443|  39.8M|                cj5__parse_primitive(&parser); // Parse primitive value
  444|  39.8M|                if(nesting[depth] != 0) {
  ------------------
  |  Branch (444:20): [True: 39.8M, False: 1.01k]
  ------------------
  445|       |                    // Parent is object or array
  446|  39.8M|                    if(token)
  ------------------
  |  Branch (446:24): [True: 37.9M, False: 1.83M]
  ------------------
  447|  37.9M|                        token->size++;
  448|  39.8M|                    next[depth] = ',';
  449|  39.8M|                } else {
  450|       |                    // The current value was the root element. Don't look for
  451|       |                    // any next element.
  452|  1.01k|                    next[depth] = 0;
  453|       |
  454|       |                    // The first element was successfully parsed. Stop early or try to
  455|       |                    // parse the full input string?
  456|  1.01k|                    if(parser.stop_early)
  ------------------
  |  Branch (456:24): [True: 0, False: 1.01k]
  ------------------
  457|      0|                        goto finish;
  458|  1.01k|                }
  459|  39.8M|            } else if(next[depth] == 'k') {
  ------------------
  |  Branch (459:23): [True: 3.34M, False: 35]
  ------------------
  460|  3.34M|                cj5__parse_key(&parser);
  461|  3.34M|                if(token)
  ------------------
  |  Branch (461:20): [True: 1.72M, False: 1.62M]
  ------------------
  462|  1.72M|                    token->size++; // Keys count towards the length
  463|  3.34M|                next[depth] = ':';
  464|  3.34M|            } else {
  465|     35|                parser.error = CJ5_ERROR_INVALID;
  466|     35|            }
  467|       |
  468|  43.1M|            if(parser.error && parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (468:16): [True: 21.6M, False: 21.5M]
  |  Branch (468:32): [True: 71, False: 21.6M]
  ------------------
  469|     71|                goto finish;
  470|       |
  471|  43.1M|            break;
  472|  95.8M|        }
  473|  95.8M|    }
  474|       |
  475|       |    // Are we back to the initial nesting depth?
  476|  5.82k|    if(depth != 0) {
  ------------------
  |  Branch (476:8): [True: 27, False: 5.80k]
  ------------------
  477|     27|        parser.error = CJ5_ERROR_INCOMPLETE;
  478|     27|        goto finish;
  479|     27|    }
  480|       |
  481|       |    // Close the virtual root object if there is one
  482|  5.80k|    if(nesting[0] == '{' && parser.error != CJ5_ERROR_OVERFLOW) {
  ------------------
  |  Branch (482:8): [True: 950, False: 4.85k]
  |  Branch (482:29): [True: 939, False: 11]
  ------------------
  483|       |        // Check the we end after a complete key-value pair (or dangling comma)
  484|    939|        if(next[0] != 'k' && next[0] != ',')
  ------------------
  |  Branch (484:12): [True: 935, False: 4]
  |  Branch (484:30): [True: 20, False: 915]
  ------------------
  485|     20|            parser.error = CJ5_ERROR_INVALID;
  486|    939|        tokens[0].end = parser.pos - 1;
  487|    939|    }
  488|       |
  489|  6.93k| finish:
  490|       |    // If parsing failed at the initial nesting depth, create a virtual root object
  491|       |    // and restart parsing.
  492|  6.93k|    if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (492:8): [True: 1.93k, False: 5.00k]
  ------------------
  493|  1.93k|       parser.error != CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (493:8): [True: 1.14k, False: 782]
  ------------------
  494|  1.14k|       depth == 0 && nesting[0] != '{') {
  ------------------
  |  Branch (494:8): [True: 1.08k, False: 64]
  |  Branch (494:22): [True: 1.02k, False: 63]
  ------------------
  495|  1.02k|        parser.token_count = 0;
  496|  1.02k|        token = cj5__alloc_token(&parser);
  497|  1.02k|        if(token) {
  ------------------
  |  Branch (497:12): [True: 1.02k, False: 0]
  ------------------
  498|  1.02k|            token->parent_id = 0;
  499|  1.02k|            token->type = CJ5_TOKEN_OBJECT;
  500|  1.02k|            token->start = 0;
  501|  1.02k|            token->size = 0;
  502|       |
  503|  1.02k|            nesting[0] = '{';
  504|  1.02k|            next[0] = 'k';
  505|       |
  506|  1.02k|            parser.curr_tok_idx = 0;
  507|  1.02k|            parser.pos = 0;
  508|  1.02k|            parser.error = CJ5_ERROR_NONE;
  509|  1.02k|            goto start_parsing;
  510|  1.02k|        }
  511|  1.02k|    }
  512|       |
  513|  5.90k|    memset(&r, 0x0, sizeof(r));
  514|  5.90k|    r.error = parser.error;
  515|  5.90k|    r.error_pos = parser.pos;
  516|  5.90k|    r.num_tokens = parser.token_count; // How many tokens (would) have been
  517|       |                                       // consumed by the parser?
  518|       |
  519|       |    // Not a single token was parsed -> return an error
  520|  5.90k|    if(r.num_tokens == 0)
  ------------------
  |  Branch (520:8): [True: 1, False: 5.90k]
  ------------------
  521|      1|        r.error = CJ5_ERROR_INCOMPLETE;
  522|       |
  523|       |    // Set the tokens and original string only if successfully parsed
  524|  5.90k|    if(r.error == CJ5_ERROR_NONE) {
  ------------------
  |  Branch (524:8): [True: 4.99k, False: 910]
  ------------------
  525|  4.99k|        r.tokens = tokens;
  526|  4.99k|        r.json5 = json5;
  527|  4.99k|    }
  528|       |
  529|  5.90k|    return r;
  530|  6.93k|}
cj5_get_str:
  628|  85.0k|            char *buf, unsigned int *buflen) {
  629|  85.0k|    const cj5_token *token = &r->tokens[tok_index];
  630|  85.0k|    if(token->type != CJ5_TOKEN_STRING)
  ------------------
  |  Branch (630:8): [True: 0, False: 85.0k]
  ------------------
  631|      0|        return CJ5_ERROR_INVALID;
  632|       |
  633|  85.0k|    const char *pos = &r->json5[token->start];
  634|  85.0k|    const char *end = &r->json5[token->end + 1];
  635|  85.0k|    unsigned int outpos = 0;
  636|  24.8M|    for(; pos < end; pos++) {
  ------------------
  |  Branch (636:11): [True: 24.7M, False: 85.0k]
  ------------------
  637|  24.7M|        uint8_t c = (uint8_t)*pos;
  638|       |        // Unprintable ascii characters must be escaped
  639|  24.7M|        if(c < ' ' || c == 127)
  ------------------
  |  Branch (639:12): [True: 9, False: 24.7M]
  |  Branch (639:23): [True: 2, False: 24.7M]
  ------------------
  640|     11|            return CJ5_ERROR_INVALID;
  641|       |
  642|       |        // Unescaped Ascii character or utf8 byte
  643|  24.7M|        if(c != '\\') {
  ------------------
  |  Branch (643:12): [True: 21.2M, False: 3.49M]
  ------------------
  644|  21.2M|            buf[outpos++] = (char)c;
  645|  21.2M|            continue;
  646|  21.2M|        }
  647|       |
  648|       |        // End of input before the escaped character
  649|  3.49M|        if(pos + 1 >= end)
  ------------------
  |  Branch (649:12): [True: 0, False: 3.49M]
  ------------------
  650|      0|            return CJ5_ERROR_INCOMPLETE;
  651|       |
  652|       |        // Process escaped character
  653|  3.49M|        pos++;
  654|  3.49M|        c = (uint8_t)*pos;
  655|  3.49M|        switch(c) {
  656|    869|        case 'b': buf[outpos++] = '\b'; break;
  ------------------
  |  Branch (656:9): [True: 869, False: 3.49M]
  ------------------
  657|  3.76k|        case 'f': buf[outpos++] = '\f'; break;
  ------------------
  |  Branch (657:9): [True: 3.76k, False: 3.48M]
  ------------------
  658|    832|        case 'r': buf[outpos++] = '\r'; break;
  ------------------
  |  Branch (658:9): [True: 832, False: 3.49M]
  ------------------
  659|  49.4k|        case 'n': buf[outpos++] = '\n'; break;
  ------------------
  |  Branch (659:9): [True: 49.4k, False: 3.44M]
  ------------------
  660|    810|        case 't': buf[outpos++] = '\t'; break;
  ------------------
  |  Branch (660:9): [True: 810, False: 3.49M]
  ------------------
  661|  2.63M|        default:  buf[outpos++] = (char)c; break;
  ------------------
  |  Branch (661:9): [True: 2.63M, False: 859k]
  ------------------
  662|   803k|        case 'u': {
  ------------------
  |  Branch (662:9): [True: 803k, False: 2.68M]
  ------------------
  663|       |            // Parse a unicode code point
  664|   803k|            if(pos + 4 >= end)
  ------------------
  |  Branch (664:16): [True: 4, False: 803k]
  ------------------
  665|      4|                return CJ5_ERROR_INCOMPLETE;
  666|   803k|            pos++;
  667|   803k|            uint32_t utf;
  668|   803k|            cj5_error_code err = parse_codepoint(pos, &utf);
  669|   803k|            if(err != CJ5_ERROR_NONE)
  ------------------
  |  Branch (669:16): [True: 5, False: 803k]
  ------------------
  670|      5|                return err;
  671|   803k|            pos += 3;
  672|       |
  673|       |            // Parse a surrogate pair
  674|   803k|            if(0xd800 <= utf && utf <= 0xdfff) {
  ------------------
  |  Branch (674:16): [True: 777, False: 802k]
  |  Branch (674:33): [True: 575, False: 202]
  ------------------
  675|    575|                if(pos + 6 >= end)
  ------------------
  |  Branch (675:20): [True: 3, False: 572]
  ------------------
  676|      3|                    return CJ5_ERROR_INVALID;
  677|    572|                if(pos[1] != '\\' && pos[2] != 'u')
  ------------------
  |  Branch (677:20): [True: 250, False: 322]
  |  Branch (677:38): [True: 3, False: 247]
  ------------------
  678|      3|                    return CJ5_ERROR_INVALID;
  679|    569|                pos += 3;
  680|    569|                uint32_t utf2;
  681|    569|                err = parse_codepoint(pos, &utf2);
  682|    569|                if(err != CJ5_ERROR_NONE)
  ------------------
  |  Branch (682:20): [True: 2, False: 567]
  ------------------
  683|      2|                    return err;
  684|    567|                pos += 3;
  685|       |                // High or low surrogate pair
  686|    567|                utf = (utf <= 0xdbff) ?
  ------------------
  |  Branch (686:23): [True: 272, False: 295]
  ------------------
  687|    272|                    (utf << 10) + utf2 + SURROGATE_OFFSET :
  688|    567|                    (utf2 << 10) + utf + SURROGATE_OFFSET;
  689|    567|            }
  690|       |
  691|       |            // Write the utf8 bytes of the code point
  692|   803k|            unsigned len = utf8_from_codepoint((unsigned char*)buf + outpos, utf);
  693|   803k|            if(len == 0)
  ------------------
  |  Branch (693:16): [True: 13, False: 803k]
  ------------------
  694|     13|                return CJ5_ERROR_INVALID; // Not a utf8 string
  695|   803k|            outpos += len;
  696|   803k|            break;
  697|   803k|        }
  698|  3.49M|        }
  699|  3.49M|    }
  700|       |
  701|       |    // Terminate with \0
  702|  85.0k|    buf[outpos] = 0;
  703|       |
  704|       |    // Set the output length
  705|  85.0k|    if(buflen)
  ------------------
  |  Branch (705:8): [True: 85.0k, False: 0]
  ------------------
  706|  85.0k|        *buflen = outpos;
  707|  85.0k|    return CJ5_ERROR_NONE;
  708|  85.0k|}
cj5.c:cj5__skip_comment:
  260|  21.0k|cj5__skip_comment(cj5__parser* parser) {
  261|  21.0k|    const char* json5 = parser->json5;
  262|       |
  263|       |    // Single-line comment
  264|  21.0k|    if(json5[parser->pos] == '#') {
  ------------------
  |  Branch (264:8): [True: 156, False: 20.8k]
  ------------------
  265|  20.7k|    skip_line:
  266|  4.66M|        while(parser->pos < parser->len) {
  ------------------
  |  Branch (266:15): [True: 4.66M, False: 66]
  ------------------
  267|  4.66M|            if(json5[parser->pos] == '\n') {
  ------------------
  |  Branch (267:16): [True: 20.7k, False: 4.64M]
  ------------------
  268|  20.7k|                parser->pos--; // Reparse the newline in the main parse loop
  269|  20.7k|                return;
  270|  20.7k|            }
  271|  4.64M|            parser->pos++;
  272|  4.64M|        }
  273|     66|        return;
  274|  20.7k|    }
  275|       |
  276|       |    // Comment begins with '/' but not enough space for another character
  277|  20.8k|    if(parser->pos + 1 >= parser->len) {
  ------------------
  |  Branch (277:8): [True: 14, False: 20.8k]
  ------------------
  278|     14|        parser->error = CJ5_ERROR_INVALID;
  279|     14|        return;
  280|     14|    }
  281|  20.8k|    parser->pos++;
  282|       |
  283|       |    // Comment begins with '//' -> single-line comment
  284|  20.8k|    if(json5[parser->pos] == '/')
  ------------------
  |  Branch (284:8): [True: 20.6k, False: 241]
  ------------------
  285|  20.6k|        goto skip_line;
  286|       |
  287|       |    // Multi-line comments begin with '/*' and end with '*/'
  288|    241|    if(json5[parser->pos] == '*') {
  ------------------
  |  Branch (288:8): [True: 236, False: 5]
  ------------------
  289|    236|        parser->pos++;
  290|   537k|        for(; parser->pos + 1 < parser->len; parser->pos++) {
  ------------------
  |  Branch (290:15): [True: 537k, False: 7]
  ------------------
  291|   537k|            if(json5[parser->pos] == '*' && json5[parser->pos + 1] == '/') {
  ------------------
  |  Branch (291:16): [True: 403, False: 537k]
  |  Branch (291:45): [True: 229, False: 174]
  ------------------
  292|    229|                parser->pos++;
  293|    229|                return;
  294|    229|            }
  295|   537k|        }
  296|    236|    }
  297|       |
  298|       |    // Unknown comment type or the multi-line comment is not terminated
  299|     12|    parser->error = CJ5_ERROR_INCOMPLETE;
  300|     12|}
cj5.c:cj5__alloc_token:
   88|  46.8M|cj5__alloc_token(cj5__parser *parser) {
   89|  46.8M|    cj5_token* token = NULL;
   90|  46.8M|    if(parser->token_count < parser->max_tokens) {
  ------------------
  |  Branch (90:8): [True: 23.4M, False: 23.4M]
  ------------------
   91|  23.4M|        token = &parser->tokens[parser->token_count];
   92|  23.4M|        memset(token, 0x0, sizeof(cj5_token));
   93|  23.4M|    } else {
   94|  23.4M|        parser->error = CJ5_ERROR_OVERFLOW;
   95|  23.4M|    }
   96|       |
   97|       |    // Always increase the index. So we know eventually how many token would be
   98|       |    // required (if there are not enough).
   99|  46.8M|    parser->token_count++;
  100|  46.8M|    return token;
  101|  46.8M|}
cj5.c:cj5__parse_primitive:
  152|  39.8M|cj5__parse_primitive(cj5__parser* parser) {
  153|  39.8M|    const char* json5 = parser->json5;
  154|  39.8M|    unsigned int len = parser->len;
  155|  39.8M|    unsigned int start = parser->pos;
  156|       |
  157|       |    // String value
  158|  39.8M|    if(json5[start] == '\"' ||
  ------------------
  |  Branch (158:8): [True: 6.16M, False: 33.6M]
  ------------------
  159|  33.6M|       json5[start] == '\'') {
  ------------------
  |  Branch (159:8): [True: 206k, False: 33.4M]
  ------------------
  160|  6.36M|        cj5__parse_string(parser);
  161|  6.36M|        return;
  162|  6.36M|    }
  163|       |
  164|       |    // Fast comparison of bool, and null.
  165|       |    // Make the comparison case-insensitive.
  166|  33.4M|    uint32_t fourcc = 0;
  167|  33.4M|    if(start + 3 < len) {
  ------------------
  |  Branch (167:8): [True: 33.4M, False: 3.09k]
  ------------------
  168|  33.4M|        fourcc += (unsigned char)json5[start] | 32U;
  169|  33.4M|        fourcc += ((unsigned char)json5[start+1] | 32U) << 8;
  170|  33.4M|        fourcc += ((unsigned char)json5[start+2] | 32U) << 16;
  171|  33.4M|        fourcc += ((unsigned char)json5[start+3] | 32U) << 24;
  172|  33.4M|    }
  173|       |    
  174|  33.4M|    cj5_token_type type;
  175|  33.4M|    if(fourcc == CJ5__NULL_FOURCC) {
  ------------------
  |  Branch (175:8): [True: 3.06M, False: 30.3M]
  ------------------
  176|  3.06M|        type = CJ5_TOKEN_NULL;
  177|  3.06M|        parser->pos += 3;
  178|  30.3M|    } else if(fourcc == CJ5__TRUE_FOURCC) {
  ------------------
  |  Branch (178:15): [True: 530, False: 30.3M]
  ------------------
  179|    530|        type = CJ5_TOKEN_BOOL;
  180|    530|        parser->pos += 3;
  181|  30.3M|    } else if(fourcc == CJ5__FALSE_FOURCC) {
  ------------------
  |  Branch (181:15): [True: 9.59k, False: 30.3M]
  ------------------
  182|       |        // "false" has five characters
  183|  9.59k|        type = CJ5_TOKEN_BOOL;
  184|  9.59k|        if(start + 4 >= len || (json5[start+4] | 32) != 'e') {
  ------------------
  |  Branch (184:12): [True: 0, False: 9.59k]
  |  Branch (184:32): [True: 3, False: 9.59k]
  ------------------
  185|      3|            parser->error = CJ5_ERROR_INVALID;
  186|      3|            return;
  187|      3|        }
  188|  9.59k|        parser->pos += 4;
  189|  30.3M|    } else {
  190|       |        // Numbers are checked for basic compatibility.
  191|       |        // But they are fully parsed only in the cj5_get_XXX functions.
  192|  30.3M|        type = CJ5_TOKEN_NUMBER;
  193|  92.3M|        for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (193:15): [True: 92.3M, False: 891]
  ------------------
  194|  92.3M|            if(!cj5__isnum(json5[parser->pos]) &&
  ------------------
  |  |   85|   184M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  ------------------
  |  Branch (194:16): [True: 35.3M, False: 57.0M]
  ------------------
  195|  35.3M|               !(json5[parser->pos] == '.') &&
  ------------------
  |  Branch (195:16): [True: 32.1M, False: 3.15M]
  ------------------
  196|  32.1M|               !cj5__islowerchar(json5[parser->pos]) && 
  ------------------
  |  |   84|   124M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  ------------------
  |  Branch (196:16): [True: 30.4M, False: 1.75M]
  ------------------
  197|  30.4M|               !cj5__isupperchar(json5[parser->pos]) &&
  ------------------
  |  |   83|   122M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  ------------------
  |  Branch (197:16): [True: 30.3M, False: 36.2k]
  ------------------
  198|  30.3M|               !(json5[parser->pos] == '+') && !(json5[parser->pos] == '-')) {
  ------------------
  |  Branch (198:16): [True: 30.3M, False: 2.09k]
  |  Branch (198:48): [True: 30.3M, False: 20.0k]
  ------------------
  199|  30.3M|                break;
  200|  30.3M|            }
  201|  92.3M|        }
  202|  30.3M|        parser->pos--; // Point to the last character that is still inside the
  203|       |                       // primitive value
  204|  30.3M|    }
  205|       |
  206|  33.4M|    cj5_token *token = cj5__alloc_token(parser);
  207|  33.4M|    if(token) {
  ------------------
  |  Branch (207:8): [True: 16.5M, False: 16.8M]
  ------------------
  208|  16.5M|        token->type = type;
  209|  16.5M|        token->start = start;
  210|  16.5M|        token->end = parser->pos;
  211|  16.5M|        token->size = parser->pos - start + 1;
  212|  16.5M|        token->parent_id = parser->curr_tok_idx;
  213|  16.5M|    }
  214|  33.4M|}
cj5.c:cj5__parse_string:
  104|  9.46M|cj5__parse_string(cj5__parser *parser) {
  105|  9.46M|    const char *json5 = parser->json5;
  106|  9.46M|    unsigned int len = parser->len;
  107|  9.46M|    unsigned int start = parser->pos;
  108|  9.46M|    char str_open = json5[start];
  109|       |
  110|  9.46M|    parser->pos++;
  111|  82.6M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (111:11): [True: 82.6M, False: 24]
  ------------------
  112|  82.6M|        char c = json5[parser->pos];
  113|       |
  114|       |        // End of string
  115|  82.6M|        if(str_open == c) {
  ------------------
  |  Branch (115:12): [True: 9.46M, False: 73.1M]
  ------------------
  116|  9.46M|            cj5_token *token = cj5__alloc_token(parser);
  117|  9.46M|            if(token) {
  ------------------
  |  Branch (117:16): [True: 4.80M, False: 4.66M]
  ------------------
  118|  4.80M|                token->type = CJ5_TOKEN_STRING;
  119|  4.80M|                token->start = start + 1;
  120|  4.80M|                token->end = parser->pos - 1;
  121|  4.80M|                token->size = token->end - token->start + 1;
  122|  4.80M|                token->parent_id = parser->curr_tok_idx;
  123|  4.80M|            } 
  124|  9.46M|            return;
  125|  9.46M|        }
  126|       |
  127|       |        // Unescaped newlines are forbidden
  128|  73.1M|        if(c == '\n') {
  ------------------
  |  Branch (128:12): [True: 0, False: 73.1M]
  ------------------
  129|      0|            parser->error = CJ5_ERROR_INVALID;
  130|      0|            return;
  131|      0|        }
  132|       |
  133|       |        // Skip escape character
  134|  73.1M|        if(c == '\\') {
  ------------------
  |  Branch (134:12): [True: 4.70M, False: 68.4M]
  ------------------
  135|  4.70M|            if(parser->pos + 1 >= len) {
  ------------------
  |  Branch (135:16): [True: 0, False: 4.70M]
  ------------------
  136|      0|                parser->error = CJ5_ERROR_INCOMPLETE;
  137|      0|                return;
  138|      0|            }
  139|  4.70M|            parser->pos++;
  140|  4.70M|        }
  141|  73.1M|    }
  142|       |
  143|       |    // The file has ended before the string terminates
  144|     24|    parser->error = CJ5_ERROR_INCOMPLETE;
  145|     24|}
cj5.c:cj5__isrange:
   79|   163M|cj5__isrange(char ch, char from, char to) {
   80|   163M|    return (uint8_t)(ch - from) <= (uint8_t)(to - from);
   81|   163M|}
cj5.c:cj5__parse_key:
  217|  3.34M|cj5__parse_key(cj5__parser* parser) {
  218|  3.34M|    const char* json5 = parser->json5;
  219|  3.34M|    unsigned int start = parser->pos;
  220|  3.34M|    cj5_token* token;
  221|       |
  222|       |    // Key is a a normal string
  223|  3.34M|    if(json5[start] == '\"' || json5[start] == '\'') {
  ------------------
  |  Branch (223:8): [True: 3.09M, False: 251k]
  |  Branch (223:32): [True: 433, False: 250k]
  ------------------
  224|  3.09M|        cj5__parse_string(parser);
  225|  3.09M|        return;
  226|  3.09M|    }
  227|       |
  228|       |    // An unquoted key. Must start with a-ZA-Z_$. Can contain numbers later on.
  229|   250k|    unsigned int len = parser->len;
  230|  3.70M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (230:11): [True: 3.70M, False: 33]
  ------------------
  231|  3.70M|        if(cj5__islowerchar(json5[parser->pos]) ||
  ------------------
  |  |   84|  7.41M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  |  |  ------------------
  |  |  |  Branch (84:30): [True: 2.84M, False: 858k]
  |  |  ------------------
  ------------------
  232|   858k|           cj5__isupperchar(json5[parser->pos]) ||
  ------------------
  |  |   83|  4.56M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  |  |  ------------------
  |  |  |  Branch (83:30): [True: 414k, False: 444k]
  |  |  ------------------
  ------------------
  233|   444k|           json5[parser->pos] == '_' || json5[parser->pos] == '$')
  ------------------
  |  Branch (233:12): [True: 815, False: 443k]
  |  Branch (233:41): [True: 713, False: 442k]
  ------------------
  234|  3.26M|            continue;
  235|   442k|        if(cj5__isnum(json5[parser->pos]) && parser->pos != start)
  ------------------
  |  |   85|   885k|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 191k, False: 250k]
  |  |  ------------------
  ------------------
  |  Branch (235:46): [True: 191k, False: 0]
  ------------------
  236|   191k|            continue;
  237|   250k|        break;
  238|   442k|    }
  239|       |
  240|       |    // An empty key is not allowed
  241|   250k|    if(parser->pos <= start) {
  ------------------
  |  Branch (241:8): [True: 9, False: 250k]
  ------------------
  242|      9|        parser->error = CJ5_ERROR_INVALID;
  243|      9|        return;
  244|      9|    }
  245|       |
  246|       |    // Move pos to the last character within the unquoted key
  247|   250k|    parser->pos--;
  248|       |
  249|   250k|    token = cj5__alloc_token(parser);
  250|   250k|    if(token) {
  ------------------
  |  Branch (250:8): [True: 137k, False: 113k]
  ------------------
  251|   137k|        token->type = CJ5_TOKEN_STRING;
  252|   137k|        token->start = start;
  253|   137k|        token->end = parser->pos;
  254|   137k|        token->size = parser->pos - start + 1;
  255|   137k|        token->parent_id = parser->curr_tok_idx;
  256|   137k|    }
  257|   250k|}
cj5.c:parse_codepoint:
  607|   803k|parse_codepoint(const char *pos, uint32_t *out_utf) {
  608|   803k|    uint32_t utf = 0;
  609|  4.01M|    for(unsigned int i = 0; i < 4; i++) {
  ------------------
  |  Branch (609:29): [True: 3.21M, False: 803k]
  ------------------
  610|  3.21M|        char byte = pos[i];
  611|  3.21M|        if(cj5__isnum(byte)) {
  ------------------
  |  |   85|  3.21M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 2.41M, False: 804k]
  |  |  ------------------
  ------------------
  612|  2.41M|            byte = (char)(byte - '0');
  613|  2.41M|        } else if(cj5__isrange(byte, 'a', 'f')) {
  ------------------
  |  Branch (613:19): [True: 802k, False: 2.65k]
  ------------------
  614|   802k|            byte = (char)(byte - ('a' - 10));
  615|   802k|        } else if(cj5__isrange(byte, 'A', 'F')) {
  ------------------
  |  Branch (615:19): [True: 2.64k, False: 7]
  ------------------
  616|  2.64k|            byte = (char)(byte - ('A' - 10));
  617|  2.64k|        } else {
  618|      7|            return CJ5_ERROR_INVALID;
  619|      7|        }
  620|  3.21M|        utf = (utf << 4) | ((uint8_t)byte & 0xF);
  621|  3.21M|    }
  622|   803k|    *out_utf = utf;
  623|   803k|    return CJ5_ERROR_NONE;
  624|   803k|}

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

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

musl_secs_to_tm:
   15|  30.6k|musl_secs_to_tm(long long t, struct musl_tm *tm) {
   16|  30.6k|    long long days, secs, years;
   17|  30.6k|    int remdays, remsecs, remyears;
   18|  30.6k|    int qc_cycles, c_cycles, q_cycles;
   19|  30.6k|    int months;
   20|  30.6k|    int wday, yday, leap;
   21|  30.6k|    static const char days_in_month[] = {31,30,31,30,31,31,30,31,30,31,31,29};
   22|       |
   23|       |    /* Reject time_t values whose year would overflow int */
   24|  30.6k|    if (t < INT_MIN * 31622400LL || t > INT_MAX * 31622400LL)
  ------------------
  |  Branch (24:9): [True: 0, False: 30.6k]
  |  Branch (24:37): [True: 0, False: 30.6k]
  ------------------
   25|      0|        return -1;
   26|       |
   27|  30.6k|    secs = t - LEAPOCH;
  ------------------
  |  |    8|  30.6k|#define LEAPOCH (946684800LL + 86400*(31+29))
  ------------------
   28|  30.6k|    days = secs / 86400LL;
   29|  30.6k|    remsecs = (int)(secs % 86400);
   30|  30.6k|    if (remsecs < 0) {
  ------------------
  |  Branch (30:9): [True: 18.3k, False: 12.2k]
  ------------------
   31|  18.3k|        remsecs += 86400;
   32|  18.3k|        --days;
   33|  18.3k|    }
   34|       |
   35|  30.6k|    wday = (int)((3+days)%7);
   36|  30.6k|    if (wday < 0) wday += 7;
  ------------------
  |  Branch (36:9): [True: 18.9k, False: 11.7k]
  ------------------
   37|       |
   38|  30.6k|    qc_cycles = (int)(days / DAYS_PER_400Y);
  ------------------
  |  |   10|  30.6k|#define DAYS_PER_400Y (365*400 + 97)
  ------------------
   39|  30.6k|    remdays = (int)(days % DAYS_PER_400Y);
  ------------------
  |  |   10|  30.6k|#define DAYS_PER_400Y (365*400 + 97)
  ------------------
   40|  30.6k|    if (remdays < 0) {
  ------------------
  |  Branch (40:9): [True: 22.6k, False: 7.97k]
  ------------------
   41|  22.6k|        remdays += DAYS_PER_400Y;
  ------------------
  |  |   10|  22.6k|#define DAYS_PER_400Y (365*400 + 97)
  ------------------
   42|  22.6k|        --qc_cycles;
   43|  22.6k|    }
   44|       |
   45|  30.6k|    c_cycles = remdays / DAYS_PER_100Y;
  ------------------
  |  |   11|  30.6k|#define DAYS_PER_100Y (365*100 + 24)
  ------------------
   46|  30.6k|    if (c_cycles == 4) --c_cycles;
  ------------------
  |  Branch (46:9): [True: 1.57k, False: 29.0k]
  ------------------
   47|  30.6k|    remdays -= c_cycles * DAYS_PER_100Y;
  ------------------
  |  |   11|  30.6k|#define DAYS_PER_100Y (365*100 + 24)
  ------------------
   48|       |
   49|  30.6k|    q_cycles = remdays / DAYS_PER_4Y;
  ------------------
  |  |   12|  30.6k|#define DAYS_PER_4Y   (365*4   + 1)
  ------------------
   50|  30.6k|    if (q_cycles == 25) --q_cycles;
  ------------------
  |  Branch (50:9): [True: 0, False: 30.6k]
  ------------------
   51|  30.6k|    remdays -= q_cycles * DAYS_PER_4Y;
  ------------------
  |  |   12|  30.6k|#define DAYS_PER_4Y   (365*4   + 1)
  ------------------
   52|       |
   53|  30.6k|    remyears = remdays / 365;
   54|  30.6k|    if (remyears == 4) --remyears;
  ------------------
  |  Branch (54:9): [True: 1.63k, False: 29.0k]
  ------------------
   55|  30.6k|    remdays -= remyears * 365;
   56|       |
   57|  30.6k|    leap = !remyears && (q_cycles || !c_cycles);
  ------------------
  |  Branch (57:12): [True: 13.5k, False: 17.0k]
  |  Branch (57:26): [True: 7.67k, False: 5.91k]
  |  Branch (57:38): [True: 5.88k, False: 30]
  ------------------
   58|  30.6k|    yday = remdays + 31 + 28 + leap;
   59|  30.6k|    if (yday >= 365+leap) yday -= 365+leap;
  ------------------
  |  Branch (59:9): [True: 15.0k, False: 15.6k]
  ------------------
   60|       |
   61|  30.6k|    years = remyears + 4*q_cycles + 100*c_cycles + 400LL*qc_cycles;
   62|       |
   63|   263k|    for (months=0; days_in_month[months] <= remdays; months++)
  ------------------
  |  Branch (63:20): [True: 232k, False: 30.6k]
  ------------------
   64|   232k|        remdays -= days_in_month[months];
   65|       |
   66|  30.6k|    if (months >= 10) {
  ------------------
  |  Branch (66:9): [True: 15.0k, False: 15.6k]
  ------------------
   67|  15.0k|        months -= 12;
   68|  15.0k|        years++;
   69|  15.0k|    }
   70|       |
   71|  30.6k|    if (years+100 > INT_MAX || years+100 < INT_MIN)
  ------------------
  |  Branch (71:9): [True: 0, False: 30.6k]
  |  Branch (71:32): [True: 0, False: 30.6k]
  ------------------
   72|      0|        return -1;
   73|       |
   74|  30.6k|    tm->tm_year = (int)(years + 100);
   75|  30.6k|    tm->tm_mon = months + 2;
   76|  30.6k|    tm->tm_mday = remdays + 1;
   77|  30.6k|    tm->tm_wday = wday;
   78|  30.6k|    tm->tm_yday = yday;
   79|       |
   80|  30.6k|    tm->tm_hour = remsecs / 3600;
   81|  30.6k|    tm->tm_min = remsecs / 60 % 60;
   82|  30.6k|    tm->tm_sec = remsecs % 60;
   83|       |
   84|  30.6k|    return 0;
   85|  30.6k|}
musl_tm_to_secs:
  149|  20.8k|musl_tm_to_secs(const struct musl_tm *tm) {
  150|  20.8k|    int is_leap;
  151|  20.8k|    long long year = tm->tm_year;
  152|  20.8k|    int month = tm->tm_mon;
  153|  20.8k|    if (month >= 12 || month < 0) {
  ------------------
  |  Branch (153:9): [True: 3.59k, False: 17.2k]
  |  Branch (153:24): [True: 1.58k, False: 15.6k]
  ------------------
  154|  5.18k|        int adj = month / 12;
  155|  5.18k|        month %= 12;
  156|  5.18k|        if (month < 0) {
  ------------------
  |  Branch (156:13): [True: 1.58k, False: 3.59k]
  ------------------
  157|  1.58k|            adj--;
  158|  1.58k|            month += 12;
  159|  1.58k|        }
  160|  5.18k|        year += adj;
  161|  5.18k|    }
  162|  20.8k|    long long t = musl_year_to_secs(year, &is_leap);
  163|  20.8k|    t += musl_month_to_secs(month, is_leap);
  164|  20.8k|    t += 86400LL * (tm->tm_mday-1);
  165|  20.8k|    t += 3600LL * tm->tm_hour;
  166|  20.8k|    t += 60LL * tm->tm_min;
  167|  20.8k|    t += tm->tm_sec;
  168|  20.8k|    return t;
  169|  20.8k|}
libc_time.c:musl_year_to_secs:
  101|  20.8k|musl_year_to_secs(const long long year, int *is_leap) {
  102|  20.8k|    if (year-2ULL <= 136) {
  ------------------
  |  Branch (102:9): [True: 2.29k, False: 18.5k]
  ------------------
  103|  2.29k|        int y = (int)year;
  104|  2.29k|        int leaps = (y-68)>>2;
  105|  2.29k|        if (!((y-68)&3)) {
  ------------------
  |  Branch (105:13): [True: 491, False: 1.80k]
  ------------------
  106|    491|            leaps--;
  107|    491|            if (is_leap) *is_leap = 1;
  ------------------
  |  Branch (107:17): [True: 491, False: 0]
  ------------------
  108|  1.80k|        } else if (is_leap) *is_leap = 0;
  ------------------
  |  Branch (108:20): [True: 1.80k, False: 0]
  ------------------
  109|  2.29k|        return 31536000*(y-70) + 86400*leaps;
  110|  2.29k|    }
  111|       |
  112|  18.5k|    int cycles, centuries, leaps, rem, dummy;
  113|       |
  114|  18.5k|    if (!is_leap) is_leap = &dummy;
  ------------------
  |  Branch (114:9): [True: 0, False: 18.5k]
  ------------------
  115|  18.5k|    cycles = (int)((year-100) / 400);
  116|  18.5k|    rem = (int)((year-100) % 400);
  117|  18.5k|    if (rem < 0) {
  ------------------
  |  Branch (117:9): [True: 12.7k, False: 5.80k]
  ------------------
  118|  12.7k|        cycles--;
  119|  12.7k|        rem += 400;
  120|  12.7k|    }
  121|  18.5k|    if (!rem) {
  ------------------
  |  Branch (121:9): [True: 2.03k, False: 16.4k]
  ------------------
  122|  2.03k|        *is_leap = 1;
  123|  2.03k|        centuries = 0;
  124|  2.03k|        leaps = 0;
  125|  16.4k|    } else {
  126|  16.4k|        if (rem >= 200) {
  ------------------
  |  Branch (126:13): [True: 7.88k, False: 8.60k]
  ------------------
  127|  7.88k|            if (rem >= 300) centuries = 3, rem -= 300;
  ------------------
  |  Branch (127:17): [True: 4.18k, False: 3.70k]
  ------------------
  128|  3.70k|            else centuries = 2, rem -= 200;
  129|  8.60k|        } else {
  130|  8.60k|            if (rem >= 100) centuries = 1, rem -= 100;
  ------------------
  |  Branch (130:17): [True: 3.42k, False: 5.18k]
  ------------------
  131|  5.18k|            else centuries = 0;
  132|  8.60k|        }
  133|  16.4k|        if (!rem) {
  ------------------
  |  Branch (133:13): [True: 223, False: 16.2k]
  ------------------
  134|    223|            *is_leap = 0;
  135|    223|            leaps = 0;
  136|  16.2k|        } else {
  137|  16.2k|            leaps = rem / 4;
  138|  16.2k|            rem %= 4;
  139|  16.2k|            *is_leap = !rem;
  140|  16.2k|        }
  141|  16.4k|    }
  142|       |
  143|  18.5k|    leaps += 97*cycles + 24*centuries - *is_leap;
  144|       |
  145|  18.5k|    return (year-100) * 31536000LL + leaps * 86400LL + 946684800 + 86400;
  146|  20.8k|}
libc_time.c:musl_month_to_secs:
   93|  20.8k|musl_month_to_secs(int month, int is_leap) {
   94|  20.8k|    int t = secs_through_month[month];
   95|  20.8k|    if (is_leap && month >= 2)
  ------------------
  |  Branch (95:9): [True: 6.58k, False: 14.2k]
  |  Branch (95:20): [True: 2.74k, False: 3.84k]
  ------------------
   96|  2.74k|        t+=86400;
   97|  20.8k|    return t;
   98|  20.8k|}

parseUInt64:
   30|  12.8M|parseUInt64(const char *str, size_t size, uint64_t *result) {
   31|  12.8M|    size_t i = 0;
   32|  12.8M|    uint64_t n = 0, prev = 0;
   33|       |
   34|       |    /* Hex */
   35|  12.8M|    if(size > 2 && str[0] == '0' && (str[1] | 32) == 'x') {
  ------------------
  |  Branch (35:8): [True: 29.2k, False: 12.8M]
  |  Branch (35:20): [True: 8.04k, False: 21.1k]
  |  Branch (35:37): [True: 348, False: 7.69k]
  ------------------
   36|    348|        i = 2;
   37|  62.4k|        for(; i < size; i++) {
  ------------------
  |  Branch (37:15): [True: 62.2k, False: 258]
  ------------------
   38|  62.2k|            uint8_t c = (uint8_t)str[i] | 32;
   39|  62.2k|            if(c >= '0' && c <= '9')
  ------------------
  |  Branch (39:16): [True: 62.2k, False: 4]
  |  Branch (39:28): [True: 32.3k, False: 29.8k]
  ------------------
   40|  32.3k|                c = (uint8_t)(c - '0');
   41|  29.8k|            else if(c >= 'a' && c <='f')
  ------------------
  |  Branch (41:21): [True: 29.8k, False: 4]
  |  Branch (41:33): [True: 29.8k, False: 85]
  ------------------
   42|  29.8k|                c = (uint8_t)(c - 'a' + 10);
   43|     89|            else if(c >= 'A' && c <='F')
  ------------------
  |  Branch (43:21): [True: 85, False: 4]
  |  Branch (43:33): [True: 0, False: 85]
  ------------------
   44|      0|                c = (uint8_t)(c - 'A' + 10);
   45|     89|            else
   46|     89|                break;
   47|  62.1k|            n = (n << 4) | (c & 0xF);
   48|  62.1k|            if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (48:16): [True: 1, False: 62.1k]
  ------------------
   49|      1|                return 0;
   50|  62.1k|            prev = n;
   51|  62.1k|        }
   52|    347|        *result = n;
   53|    347|        return (i > 2) ? i : 0; /* 2 -> No digit was parsed */
  ------------------
  |  Branch (53:16): [True: 347, False: 0]
  ------------------
   54|    348|    }
   55|       |
   56|       |    /* Decimal */
   57|  26.6M|    for(; i < size; i++) {
  ------------------
  |  Branch (57:11): [True: 13.8M, False: 12.8M]
  ------------------
   58|  13.8M|        if(str[i] < '0' || str[i] > '9')
  ------------------
  |  Branch (58:12): [True: 20.3k, False: 13.8M]
  |  Branch (58:28): [True: 1.06k, False: 13.8M]
  ------------------
   59|  21.3k|            break;
   60|       |        /* Fast multiplication: n*10 == (n*8) + (n*2) */
   61|  13.8M|        n = (n << 3) + (n << 1) + (uint8_t)(str[i] - '0');
   62|  13.8M|        if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (62:12): [True: 8, False: 13.8M]
  ------------------
   63|      8|            return 0;
   64|  13.8M|        prev = n;
   65|  13.8M|    }
   66|  12.8M|    *result = n;
   67|  12.8M|    return i;
   68|  12.8M|}
parseInt64:
   71|  5.34M|parseInt64(const char *str, size_t size, int64_t *result) {
   72|       |    /* Negative value? */
   73|  5.34M|    size_t i = 0;
   74|  5.34M|    bool neg = false;
   75|  5.34M|    if(*str == '-' || *str == '+') {
  ------------------
  |  Branch (75:8): [True: 11.3k, False: 5.32M]
  |  Branch (75:23): [True: 232, False: 5.32M]
  ------------------
   76|  11.5k|        neg = (*str == '-');
   77|  11.5k|        i++;
   78|  11.5k|    }
   79|       |
   80|       |    /* Parse as unsigned */
   81|  5.34M|    uint64_t n = 0;
   82|  5.34M|    size_t len = parseUInt64(&str[i], size - i, &n);
   83|  5.34M|    if(len == 0)
  ------------------
  |  Branch (83:8): [True: 17, False: 5.34M]
  ------------------
   84|     17|        return 0;
   85|       |
   86|       |    /* Check for overflow, adjust and return */
   87|  5.34M|    if(!neg) {
  ------------------
  |  Branch (87:8): [True: 5.32M, False: 11.3k]
  ------------------
   88|  5.32M|        if(n > 9223372036854775807UL)
  ------------------
  |  Branch (88:12): [True: 0, False: 5.32M]
  ------------------
   89|      0|            return 0;
   90|  5.32M|        *result = (int64_t)n;
   91|  5.32M|    } else {
   92|  11.3k|        if(n > 9223372036854775808UL)
  ------------------
  |  Branch (92:12): [True: 1, False: 11.3k]
  ------------------
   93|      1|            return 0;
   94|  11.3k|        *result = -(int64_t)n;
   95|  11.3k|    }
   96|  5.34M|    return len + i;
   97|  5.34M|}
parseDouble:
   99|  1.71M|size_t parseDouble(const char *str, size_t size, double *result) {
  100|  1.71M|    char buf[2000];
  101|  1.71M|    if(size >= 2000)
  ------------------
  |  Branch (101:8): [True: 1, False: 1.71M]
  ------------------
  102|      1|        return 0;
  103|  1.71M|    memcpy(buf, str, size);
  104|  1.71M|    buf[size] = 0;
  105|  1.71M|    errno = 0;
  106|  1.71M|    char *endptr;
  107|  1.71M|    *result = strtod(buf, &endptr);
  108|  1.71M|    if(errno != 0 && errno != ERANGE)
  ------------------
  |  Branch (108:8): [True: 2.95k, False: 1.70M]
  |  Branch (108:22): [True: 0, False: 2.95k]
  ------------------
  109|      0|        return 0;
  110|  1.71M|    return (uintptr_t)endptr - (uintptr_t)buf;
  111|  1.71M|}

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

UA_StatusCode_equalTop:
  215|  18.2k|UA_StatusCode_equalTop(UA_StatusCode s1, UA_StatusCode s2) {
  216|  18.2k|    return ((s1 & 0xFFFF0000) == (s2 & 0xFFFF0000));
  217|  18.2k|}
UA_STRING:
  220|  1.79k|UA_STRING(char *chars) {
  221|  1.79k|    UA_String s = {0, NULL};
  222|  1.79k|    if(!chars)
  ------------------
  |  Branch (222:8): [True: 0, False: 1.79k]
  ------------------
  223|      0|        return s;
  224|  1.79k|    s.length = strlen(chars);
  225|  1.79k|    s.data = (UA_Byte*)chars;
  226|  1.79k|    return s;
  227|  1.79k|}
UA_QualifiedName_printEx:
  405|  73.6k|                         const UA_NamespaceMapping *nsMapping) {
  406|       |    /* If the QualifiedName is NULL, return a NULL string */
  407|  73.6k|    if(qn->name.data == NULL && qn->namespaceIndex == 0) {
  ------------------
  |  Branch (407:8): [True: 5.82k, False: 67.8k]
  |  Branch (407:33): [True: 5.82k, False: 0]
  ------------------
  408|  5.82k|        UA_String_clear(output);
  409|  5.82k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  5.82k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  410|  5.82k|    }
  411|       |
  412|       |    /* Start tracking the output length */
  413|  67.8k|    size_t len = qn->name.length;
  414|       |
  415|       |    /* Try to map the NamespaceIndex to the Uri */
  416|  67.8k|    UA_String nsUri = UA_STRING_NULL;
  417|  67.8k|    if(qn->namespaceIndex > 0 && nsMapping) {
  ------------------
  |  Branch (417:8): [True: 1.26k, False: 66.5k]
  |  Branch (417:34): [True: 0, False: 1.26k]
  ------------------
  418|      0|        UA_NamespaceMapping_index2Uri(nsMapping, qn->namespaceIndex, &nsUri);
  419|      0|        if(nsUri.length > 0)
  ------------------
  |  Branch (419:12): [True: 0, False: 0]
  ------------------
  420|      0|            len += nsUri.length + 1;
  421|      0|    }
  422|       |
  423|       |    /* Print the NamespaceIndex */
  424|  67.8k|    char nsStr[6];
  425|  67.8k|    size_t nsStrSize = 0;
  426|  67.8k|    if(nsUri.length == 0 && qn->namespaceIndex > 0) {
  ------------------
  |  Branch (426:8): [True: 67.8k, False: 0]
  |  Branch (426:29): [True: 1.26k, False: 66.5k]
  ------------------
  427|  1.26k|        nsStrSize = itoaUnsigned(qn->namespaceIndex, nsStr, 10);
  428|  1.26k|        len += 1 + nsStrSize;
  429|  1.26k|    }
  430|       |
  431|       |    /* Allocate memory if required */
  432|  67.8k|    if(output->length == 0) {
  ------------------
  |  Branch (432:8): [True: 67.8k, False: 0]
  ------------------
  433|  67.8k|        UA_StatusCode res = UA_ByteString_allocBuffer((UA_ByteString*)output, len);
  434|  67.8k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  67.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (434:12): [True: 0, False: 67.8k]
  ------------------
  435|      0|            return res;
  436|  67.8k|    } else {
  437|      0|        if(output->length < len)
  ------------------
  |  Branch (437:12): [True: 0, False: 0]
  ------------------
  438|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  439|      0|        output->length = len;
  440|      0|    }
  441|       |
  442|       |    /* Print the namespace */
  443|  67.8k|    u8 *pos = output->data;
  444|  67.8k|    if(nsUri.length > 0) {
  ------------------
  |  Branch (444:8): [True: 0, False: 67.8k]
  ------------------
  445|      0|        memcpy(pos, nsUri.data, nsUri.length);
  446|      0|        pos += nsUri.length;
  447|      0|        *pos++ = ';';
  448|  67.8k|    } else if(qn->namespaceIndex > 0) {
  ------------------
  |  Branch (448:15): [True: 1.26k, False: 66.5k]
  ------------------
  449|  1.26k|        memcpy(pos, nsStr, nsStrSize);
  450|  1.26k|        pos += nsStrSize;
  451|  1.26k|        *pos++ = ':';
  452|  1.26k|    }
  453|       |
  454|       |    /* Print the name */
  455|  67.8k|    if(UA_LIKELY(qn->name.data != NULL))
  ------------------
  |  |  576|  67.8k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (576:23): [True: 67.8k, False: 0]
  |  |  ------------------
  ------------------
  456|  67.8k|        memcpy(pos, qn->name.data, qn->name.length);
  457|       |
  458|  67.8k|    UA_assert(output->length == (size_t)((UA_Byte*)pos + qn->name.length - output->data));
  ------------------
  |  |  397|  67.8k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (458:5): [True: 67.8k, False: 0]
  ------------------
  459|  67.8k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  67.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  460|  67.8k|}
UA_DateTime_toStruct:
  479|  30.6k|UA_DateTime_toStruct(UA_DateTime t) {
  480|       |    /* Divide, then subtract -> avoid underflow. Also, negative numbers are
  481|       |     * rounded up, not down. */
  482|  30.6k|    long long secSinceUnixEpoch = (long long)(t / UA_DATETIME_SEC)
  ------------------
  |  |  285|  30.6k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  30.6k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  30.6k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|  30.6k|        - (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC);
  ------------------
  |  |  327|  30.6k|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|  30.6k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  30.6k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  30.6k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      - (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC);
  ------------------
  |  |  285|  30.6k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  30.6k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  30.6k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  484|       |
  485|       |    /* Negative fractions of a second? Remove one full second from the epoch
  486|       |     * distance and allow only a positive fraction. */
  487|  30.6k|    UA_DateTime frac = t % UA_DATETIME_SEC;
  ------------------
  |  |  285|  30.6k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  30.6k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  30.6k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  488|  30.6k|    if(frac < 0) {
  ------------------
  |  Branch (488:8): [True: 2.34k, False: 28.3k]
  ------------------
  489|  2.34k|        secSinceUnixEpoch--;
  490|  2.34k|        frac += UA_DATETIME_SEC;
  ------------------
  |  |  285|  2.34k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  2.34k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  2.34k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  491|  2.34k|    }
  492|       |
  493|  30.6k|    struct musl_tm ts;
  494|  30.6k|    memset(&ts, 0, sizeof(struct musl_tm));
  495|  30.6k|    musl_secs_to_tm(secSinceUnixEpoch, &ts);
  496|       |
  497|  30.6k|    UA_DateTimeStruct dateTimeStruct;
  498|  30.6k|    dateTimeStruct.year   = (i16)(ts.tm_year + 1900);
  499|  30.6k|    dateTimeStruct.month  = (u16)(ts.tm_mon + 1);
  500|  30.6k|    dateTimeStruct.day    = (u16)ts.tm_mday;
  501|  30.6k|    dateTimeStruct.hour   = (u16)ts.tm_hour;
  502|  30.6k|    dateTimeStruct.min    = (u16)ts.tm_min;
  503|  30.6k|    dateTimeStruct.sec    = (u16)ts.tm_sec;
  504|  30.6k|    dateTimeStruct.milliSec = (u16)((frac % 10000000) / 10000);
  505|  30.6k|    dateTimeStruct.microSec = (u16)((frac % 10000) / 10);
  506|  30.6k|    dateTimeStruct.nanoSec  = (u16)((frac % 10) * 100);
  507|  30.6k|    return dateTimeStruct;
  508|  30.6k|}
UA_Guid_to_hex:
  710|  1.69k|UA_Guid_to_hex(const UA_Guid *guid, u8* out, UA_Boolean lower) {
  711|  1.69k|    const u8 *hexmap = (lower) ? hexmapLower : hexmapUpper;
  ------------------
  |  Branch (711:24): [True: 0, False: 1.69k]
  ------------------
  712|  1.69k|    size_t i = 0, j = 28;
  713|  15.2k|    for(; i<8;i++,j-=4)         /* pos 0-7, 4byte, (a) */
  ------------------
  |  Branch (713:11): [True: 13.5k, False: 1.69k]
  ------------------
  714|  13.5k|        out[i] = hexmap[(guid->data1 >> j) & 0x0Fu];
  715|  1.69k|    out[i++] = '-';             /* pos 8 */
  716|  8.49k|    for(j=12; i<13;i++,j-=4)    /* pos 9-12, 2byte, (b) */
  ------------------
  |  Branch (716:15): [True: 6.79k, False: 1.69k]
  ------------------
  717|  6.79k|        out[i] = hexmap[(uint16_t)(guid->data2 >> j) & 0x0Fu];
  718|  1.69k|    out[i++] = '-';             /* pos 13 */
  719|  8.49k|    for(j=12; i<18;i++,j-=4)    /* pos 14-17, 2byte (c) */
  ------------------
  |  Branch (719:15): [True: 6.79k, False: 1.69k]
  ------------------
  720|  6.79k|        out[i] = hexmap[(uint16_t)(guid->data3 >> j) & 0x0Fu];
  721|  1.69k|    out[i++] = '-';              /* pos 18 */
  722|  5.09k|    for(j=0;i<23;i+=2,j++) {     /* pos 19-22, 2byte (d) */
  ------------------
  |  Branch (722:13): [True: 3.39k, False: 1.69k]
  ------------------
  723|  3.39k|        out[i] = hexmap[(guid->data4[j] & 0xF0u) >> 4u];
  724|  3.39k|        out[i+1] = hexmap[guid->data4[j] & 0x0Fu];
  725|  3.39k|    }
  726|  1.69k|    out[i++] = '-';              /* pos 23 */
  727|  11.8k|    for(j=2; i<36;i+=2,j++) {    /* pos 24-35, 6byte (e) */
  ------------------
  |  Branch (727:14): [True: 10.1k, False: 1.69k]
  ------------------
  728|  10.1k|        out[i] = hexmap[(guid->data4[j] & 0xF0u) >> 4u];
  729|  10.1k|        out[i+1] = hexmap[guid->data4[j] & 0x0Fu];
  730|  10.1k|    }
  731|  1.69k|}
UA_ByteString_allocBuffer:
  758|   108k|UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length) {
  759|   108k|    UA_ByteString_init(bs);
  760|   108k|    if(length == 0) {
  ------------------
  |  Branch (760:8): [True: 9.93k, False: 98.9k]
  ------------------
  761|  9.93k|        bs->data = (u8*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  9.93k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  762|  9.93k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  9.93k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  763|  9.93k|    }
  764|  98.9k|    bs->data = (u8*)UA_calloc(1,length);
  ------------------
  |  |   20|  98.9k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  765|  98.9k|    if(UA_UNLIKELY(!bs->data))
  ------------------
  |  |  577|  98.9k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (577:25): [True: 0, False: 98.9k]
  |  |  ------------------
  ------------------
  766|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  767|  98.9k|    bs->length = length;
  768|  98.9k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  98.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  769|  98.9k|}
nodeId_printEscape:
 1022|  8.68k|                   const UA_NamespaceMapping *nsMapping, UA_Escaping idEsc) {
 1023|       |    /* Try to map the NamespaceIndex to the Uri */
 1024|  8.68k|    UA_String nsUri = UA_STRING_NULL;
 1025|  8.68k|    if(id->namespaceIndex > 0 && nsMapping)
  ------------------
  |  Branch (1025:8): [True: 564, False: 8.11k]
  |  Branch (1025:34): [True: 0, False: 564]
  ------------------
 1026|      0|        UA_NamespaceMapping_index2Uri(nsMapping, id->namespaceIndex, &nsUri);
 1027|       |
 1028|       |    /* Compute the string length and print numerical identifiers. */
 1029|  8.68k|    u8 nsStr[7];
 1030|  8.68k|    u8 numIdStr[12];
 1031|  8.68k|    size_t idLen = nodeIdSize(id, nsStr, numIdStr, nsUri, idEsc);
 1032|  8.68k|    if(idLen == 0)
  ------------------
  |  Branch (1032:8): [True: 0, False: 8.68k]
  ------------------
 1033|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 1034|       |
 1035|       |    /* Allocate memory if required */
 1036|  8.68k|    if(output->length == 0) {
  ------------------
  |  Branch (1036:8): [True: 8.68k, False: 0]
  ------------------
 1037|  8.68k|        UA_StatusCode res = UA_ByteString_allocBuffer((UA_ByteString*)output, idLen);
 1038|  8.68k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  8.68k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1038:12): [True: 0, False: 8.68k]
  ------------------
 1039|      0|            return res;
 1040|  8.68k|    } else {
 1041|      0|        if(output->length < idLen)
  ------------------
  |  Branch (1041:12): [True: 0, False: 0]
  ------------------
 1042|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
 1043|      0|        output->length = idLen;
 1044|      0|    }
 1045|       |
 1046|       |    /* Print the NodeId */
 1047|  8.68k|    u8 *pos = printNodeIdBody(id, nsUri, nsStr, numIdStr, output->data, nsMapping, idEsc);
 1048|  8.68k|    output->length = (size_t)(pos - output->data);
 1049|  8.68k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  8.68k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1050|  8.68k|}
UA_NodeId_printEx:
 1054|  8.68k|                  const UA_NamespaceMapping *nsMapping) {
 1055|  8.68k|    return nodeId_printEscape(id, output, nsMapping, UA_ESCAPING_NONE);
 1056|  8.68k|}
UA_ExpandedNodeId_printEx:
 1172|  28.3k|                          size_t serverUrisSize, const UA_String *serverUris) {
 1173|       |    /* Try to map the NamespaceIndex to the Uri */
 1174|  28.3k|    UA_String nsUri = eid->namespaceUri;
 1175|  28.3k|    if(nsUri.data == NULL && eid->nodeId.namespaceIndex > 0 && nsMapping)
  ------------------
  |  Branch (1175:8): [True: 27.4k, False: 897]
  |  Branch (1175:30): [True: 303, False: 27.1k]
  |  Branch (1175:64): [True: 0, False: 303]
  ------------------
 1176|      0|        UA_NamespaceMapping_index2Uri(nsMapping, eid->nodeId.namespaceIndex, &nsUri);
 1177|       |
 1178|       |    /* Try to map the ServerIndex to a Uri */
 1179|  28.3k|    UA_String srvUri = UA_STRING_NULL;
 1180|  28.3k|    if(eid->serverIndex > 0 && eid->serverIndex < serverUrisSize)
  ------------------
  |  Branch (1180:8): [True: 1.86k, False: 26.5k]
  |  Branch (1180:32): [True: 0, False: 1.86k]
  ------------------
 1181|      0|        srvUri = serverUris[eid->serverIndex];
 1182|       |
 1183|       |    /* No special escaping for ExpandedNodeIds */
 1184|  28.3k|    UA_Escaping idEsc = UA_ESCAPING_NONE;
 1185|       |
 1186|       |    /* Compute the NodeId string length */
 1187|  28.3k|    u8 nsStr[7];
 1188|  28.3k|    u8 numIdStr[12];
 1189|  28.3k|    char srvIdxStr[11];
 1190|  28.3k|    size_t srvIdxSize = 0;
 1191|  28.3k|    size_t idLen = nodeIdSize(&eid->nodeId, nsStr, numIdStr, nsUri, idEsc);
 1192|  28.3k|    if(idLen == 0)
  ------------------
  |  Branch (1192:8): [True: 0, False: 28.3k]
  ------------------
 1193|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 1194|  28.3k|    if(srvUri.length  > 0) {
  ------------------
  |  Branch (1194:8): [True: 0, False: 28.3k]
  ------------------
 1195|      0|        idLen += 5; /* svu=; */
 1196|      0|        idLen += UA_String_escapedSize(srvUri, UA_ESCAPING_PERCENT);
 1197|  28.3k|    } else if(eid->serverIndex > 0) {
  ------------------
  |  Branch (1197:15): [True: 1.86k, False: 26.5k]
  ------------------
 1198|  1.86k|        idLen += 5; /* svr=; */
 1199|  1.86k|        srvIdxSize = itoaUnsigned(eid->serverIndex, srvIdxStr, 10);
 1200|  1.86k|        idLen += srvIdxSize;
 1201|  1.86k|    }
 1202|       |
 1203|       |    /* Allocate memory if required */
 1204|  28.3k|    if(output->length == 0) {
  ------------------
  |  Branch (1204:8): [True: 28.3k, False: 0]
  ------------------
 1205|  28.3k|        UA_StatusCode res = UA_ByteString_allocBuffer((UA_ByteString*)output, idLen);
 1206|  28.3k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  28.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1206:12): [True: 0, False: 28.3k]
  ------------------
 1207|      0|            return res;
 1208|  28.3k|    } else {
 1209|      0|        if(output->length < idLen)
  ------------------
  |  Branch (1209:12): [True: 0, False: 0]
  ------------------
 1210|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
 1211|      0|        output->length = idLen;
 1212|      0|    }
 1213|       |
 1214|       |    /* Encode the ServerIndex or ServerUrl */
 1215|  28.3k|    u8 *pos = output->data;
 1216|  28.3k|    if(srvUri.length  > 0) {
  ------------------
  |  Branch (1216:8): [True: 0, False: 28.3k]
  ------------------
 1217|      0|        memcpy(pos, "svu=", 4);
 1218|      0|        pos += 4;
 1219|      0|        pos += UA_String_escapeInsert(pos, srvUri, UA_ESCAPING_PERCENT);
 1220|      0|        *pos++ = ';';
 1221|  28.3k|    } else if(eid->serverIndex > 0) {
  ------------------
  |  Branch (1221:15): [True: 1.86k, False: 26.5k]
  ------------------
 1222|  1.86k|        memcpy(pos, "svr=", 4);
 1223|  1.86k|        pos += 4;
 1224|  1.86k|        memcpy(pos, srvIdxStr, srvIdxSize);
 1225|  1.86k|        pos += srvIdxSize;
 1226|  1.86k|        *pos++ = ';';
 1227|  1.86k|    }
 1228|       |
 1229|       |    /* Print the NodeId */
 1230|  28.3k|    pos = printNodeIdBody(&eid->nodeId, nsUri, nsStr, numIdStr, pos, nsMapping, idEsc);
 1231|  28.3k|    output->length = (size_t)(pos - output->data);
 1232|  28.3k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  28.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1233|  28.3k|}
UA_Variant_isScalar:
 1349|  92.6k|UA_Variant_isScalar(const UA_Variant *v) {
 1350|  92.6k|    return (v->type != NULL && v->arrayLength == 0 &&
  ------------------
  |  Branch (1350:13): [True: 92.6k, False: 0]
  |  Branch (1350:32): [True: 86.5k, False: 6.05k]
  ------------------
 1351|  86.5k|            v->data > UA_EMPTY_ARRAY_SENTINEL);
  ------------------
  |  |  755|  86.5k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1351:13): [True: 80.7k, False: 5.80k]
  ------------------
 1352|  92.6k|}
UA_new:
 1893|  97.7k|UA_new(const UA_DataType *type) {
 1894|  97.7k|    void *p = UA_calloc(1, type->memSize);
  ------------------
  |  |   20|  97.7k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1895|  97.7k|    return p;
 1896|  97.7k|}
UA_copy:
 2059|  78.5k|UA_copy(const void *src, void *dst, const UA_DataType *type) {
 2060|  78.5k|    memset(dst, 0, type->memSize); /* init */
 2061|  78.5k|    UA_StatusCode retval = copyJumpTable[type->typeKind](src, dst, type);
 2062|  78.5k|    if(retval != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  78.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2062:8): [True: 0, False: 78.5k]
  ------------------
 2063|      0|        UA_clear(dst, type);
 2064|  78.5k|    return retval;
 2065|  78.5k|}
UA_clear:
 2162|  2.20M|UA_clear(void *p, const UA_DataType *type) {
 2163|  2.20M|    clearJumpTable[type->typeKind](p, type);
 2164|  2.20M|    memset(p, 0, type->memSize); /* init */
 2165|  2.20M|}
UA_order:
 2616|  2.00k|UA_Order UA_order(const void *p1, const void *p2, const UA_DataType *type) {
 2617|  2.00k|    return orderJumpTable[type->typeKind](p1, p2, type);
 2618|  2.00k|}
UA_Array_copy:
 2640|  78.5k|              void **dst, const UA_DataType *type) {
 2641|  78.5k|    if(size == 0) {
  ------------------
  |  Branch (2641:8): [True: 12.3k, False: 66.2k]
  ------------------
 2642|  12.3k|        if(src == NULL)
  ------------------
  |  Branch (2642:12): [True: 0, False: 12.3k]
  ------------------
 2643|      0|            *dst = NULL;
 2644|  12.3k|        else
 2645|  12.3k|            *dst= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  12.3k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2646|  12.3k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  12.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2647|  12.3k|    }
 2648|       |
 2649|       |    /* Check the array consistency -- defensive programming in case the user
 2650|       |     * manually created an inconsistent array */
 2651|  66.2k|    if(UA_UNLIKELY(!type || !src))
  ------------------
  |  |  577|   132k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (577:25): [True: 0, False: 66.2k]
  |  |  |  Branch (577:43): [True: 0, False: 66.2k]
  |  |  |  Branch (577:43): [True: 0, False: 66.2k]
  |  |  ------------------
  ------------------
 2652|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 2653|       |
 2654|       |    /* calloc, so we don't have to check retval in every iteration of copying */
 2655|  66.2k|    *dst = UA_calloc(size, type->memSize);
  ------------------
  |  |   20|  66.2k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2656|  66.2k|    if(!*dst)
  ------------------
  |  Branch (2656:8): [True: 0, False: 66.2k]
  ------------------
 2657|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2658|       |
 2659|  66.2k|    if(type->pointerFree) {
  ------------------
  |  Branch (2659:8): [True: 66.2k, False: 0]
  ------------------
 2660|  66.2k|        memcpy(*dst, src, type->memSize * size);
 2661|  66.2k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  66.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2662|  66.2k|    }
 2663|       |
 2664|      0|    uintptr_t ptrs = (uintptr_t)src;
 2665|      0|    uintptr_t ptrd = (uintptr_t)*dst;
 2666|      0|    UA_StatusCode retval = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2667|      0|    for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2667:23): [True: 0, False: 0]
  ------------------
 2668|      0|        retval |= UA_copy((void*)ptrs, (void*)ptrd, type);
 2669|      0|        ptrs += type->memSize;
 2670|      0|        ptrd += type->memSize;
 2671|      0|    }
 2672|      0|    if(retval != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2672:8): [True: 0, False: 0]
  ------------------
 2673|      0|        UA_Array_delete(*dst, size, type);
 2674|       |        *dst = NULL;
 2675|      0|    }
 2676|      0|    return retval;
 2677|  66.2k|}
UA_Array_delete:
 2768|  3.49M|UA_Array_delete(void *p, size_t size, const UA_DataType *type) {
 2769|  3.49M|    if(!type->pointerFree) {
  ------------------
  |  Branch (2769:8): [True: 22.3k, False: 3.47M]
  ------------------
 2770|  22.3k|        uintptr_t ptr = (uintptr_t)p;
 2771|  2.01M|        for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2771:27): [True: 1.99M, False: 22.3k]
  ------------------
 2772|  1.99M|            UA_clear((void*)ptr, type);
 2773|  1.99M|            ptr += type->memSize;
 2774|  1.99M|        }
 2775|  22.3k|    }
 2776|  3.49M|    UA_free((void*)((uintptr_t)p & ~(uintptr_t)UA_EMPTY_ARRAY_SENTINEL));
  ------------------
  |  |   19|  3.49M|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2777|  3.49M|}
UA_DataType_isNumeric:
 2823|  4.49M|UA_DataType_isNumeric(const UA_DataType *type) {
 2824|  4.49M|    switch(type->typeKind) {
 2825|      0|    case UA_DATATYPEKIND_SBYTE:
  ------------------
  |  Branch (2825:5): [True: 0, False: 4.49M]
  ------------------
 2826|      0|    case UA_DATATYPEKIND_BYTE:
  ------------------
  |  Branch (2826:5): [True: 0, False: 4.49M]
  ------------------
 2827|      0|    case UA_DATATYPEKIND_INT16:
  ------------------
  |  Branch (2827:5): [True: 0, False: 4.49M]
  ------------------
 2828|      0|    case UA_DATATYPEKIND_UINT16:
  ------------------
  |  Branch (2828:5): [True: 0, False: 4.49M]
  ------------------
 2829|      0|    case UA_DATATYPEKIND_INT32:
  ------------------
  |  Branch (2829:5): [True: 0, False: 4.49M]
  ------------------
 2830|  4.49M|    case UA_DATATYPEKIND_UINT32:
  ------------------
  |  Branch (2830:5): [True: 4.49M, False: 0]
  ------------------
 2831|  4.49M|    case UA_DATATYPEKIND_INT64:
  ------------------
  |  Branch (2831:5): [True: 0, False: 4.49M]
  ------------------
 2832|  4.49M|    case UA_DATATYPEKIND_UINT64:
  ------------------
  |  Branch (2832:5): [True: 0, False: 4.49M]
  ------------------
 2833|  4.49M|    case UA_DATATYPEKIND_FLOAT:
  ------------------
  |  Branch (2833:5): [True: 0, False: 4.49M]
  ------------------
 2834|  4.49M|    case UA_DATATYPEKIND_DOUBLE:
  ------------------
  |  Branch (2834:5): [True: 0, False: 4.49M]
  ------------------
 2835|       |    /* not implemented: UA_DATATYPEKIND_DECIMAL */
 2836|  4.49M|        return true;
 2837|      0|    default:
  ------------------
  |  Branch (2837:5): [True: 0, False: 4.49M]
  ------------------
 2838|       |        return false;
 2839|  4.49M|    }
 2840|  4.49M|}
ua_types.c:nodeIdSize:
  921|  37.0k|           UA_Escaping idEsc) {
  922|       |    /* Namespace length */
  923|  37.0k|    size_t len = 0;
  924|  37.0k|    if(nsUri.data != NULL) {
  ------------------
  |  Branch (924:8): [True: 897, False: 36.1k]
  ------------------
  925|    897|        len += 5; /* nsu=; */
  926|    897|        len += UA_String_escapedSize(nsUri, UA_ESCAPING_PERCENT);
  927|  36.1k|    } else if(id->namespaceIndex > 0) {
  ------------------
  |  Branch (927:15): [True: 867, False: 35.3k]
  ------------------
  928|    867|        len += 4; /* ns=; */
  929|    867|        size_t nsStrSize = itoaUnsigned(id->namespaceIndex, (char*)nsStr, 10);
  930|    867|        nsStr[nsStrSize] = 0;
  931|    867|        len += nsStrSize;
  932|    867|    }
  933|       |
  934|  37.0k|    len += 2; /* ?= */
  935|       |
  936|  37.0k|    switch (id->identifierType) {
  937|  4.67k|    case UA_NODEIDTYPE_NUMERIC: {
  ------------------
  |  Branch (937:5): [True: 4.67k, False: 32.3k]
  ------------------
  938|  4.67k|        size_t numIdStrSize = itoaUnsigned(id->identifier.numeric, (char*)numIdStr, 10);
  939|  4.67k|        numIdStr[numIdStrSize] = 0;
  940|  4.67k|        len += numIdStrSize;
  941|  4.67k|        break;
  942|      0|    }
  943|  20.4k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (943:5): [True: 20.4k, False: 16.6k]
  ------------------
  944|  20.4k|        len += UA_String_escapedSize(id->identifier.string, idEsc);
  945|  20.4k|        break;
  946|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (946:5): [True: 0, False: 37.0k]
  ------------------
  947|      0|        len += 36;
  948|      0|        break;
  949|  11.9k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (949:5): [True: 11.9k, False: 25.1k]
  ------------------
  950|  11.9k|        len += 4 * ((id->identifier.byteString.length + 2) / 3);
  951|  11.9k|        break;
  952|      0|    default:
  ------------------
  |  Branch (952:5): [True: 0, False: 37.0k]
  ------------------
  953|      0|        len = 0;
  954|  37.0k|    }
  955|  37.0k|    return len;
  956|  37.0k|}
ua_types.c:printNodeIdBody:
  960|  37.0k|                const UA_NamespaceMapping *nsMapping, UA_Escaping idEsc) {
  961|  37.0k|    size_t len;
  962|       |
  963|       |    /* Encode the namespace */
  964|  37.0k|    if(nsUri.data != NULL) {
  ------------------
  |  Branch (964:8): [True: 897, False: 36.1k]
  ------------------
  965|    897|        memcpy(pos, "nsu=", 4);
  966|    897|        pos += 4;
  967|    897|        pos += UA_String_escapeInsert(pos, nsUri, UA_ESCAPING_PERCENT);
  968|    897|        *pos++ = ';';
  969|  36.1k|    } else if(id->namespaceIndex > 0) {
  ------------------
  |  Branch (969:15): [True: 867, False: 35.3k]
  ------------------
  970|    867|        memcpy(pos, "ns=", 3);
  971|    867|        pos += 3;
  972|    867|        len = strlen((char*)nsStr);
  973|    867|        memcpy(pos, nsStr, len);
  974|    867|        pos += len;
  975|    867|        *pos++ = ';';
  976|    867|    }
  977|       |
  978|       |    /* Encode the identifier */
  979|  37.0k|    switch(id->identifierType) {
  ------------------
  |  Branch (979:12): [True: 37.0k, False: 0]
  ------------------
  980|  4.67k|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (980:5): [True: 4.67k, False: 32.3k]
  ------------------
  981|  4.67k|        memcpy(pos, "i=", 2);
  982|  4.67k|        pos += 2;
  983|  4.67k|        len = strlen((char*)numIdStr);
  984|  4.67k|        memcpy(pos, numIdStr, len);
  985|  4.67k|        pos += len;
  986|  4.67k|        break;
  987|  20.4k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (987:5): [True: 20.4k, False: 16.6k]
  ------------------
  988|  20.4k|        memcpy(pos, "s=", 2);
  989|  20.4k|        pos += 2;
  990|  20.4k|        pos += UA_String_escapeInsert(pos, id->identifier.string, idEsc);
  991|  20.4k|        break;
  992|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (992:5): [True: 0, False: 37.0k]
  ------------------
  993|      0|        memcpy(pos, "g=", 2);
  994|      0|        pos += 2;
  995|      0|        UA_Guid_to_hex(&id->identifier.guid, pos, true);
  996|      0|        pos += 36;
  997|      0|        break;
  998|  11.9k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (998:5): [True: 11.9k, False: 25.1k]
  ------------------
  999|  11.9k|        memcpy(pos, "b=", 2);
 1000|  11.9k|        pos += 2;
 1001|       |        /* Use base64url encoding for percent-escaping.
 1002|       |         * Replace +/ with -_ and remove the padding. */
 1003|  11.9k|        u8 *bpos = pos;
 1004|  11.9k|        pos += UA_base64_buf(id->identifier.byteString.data,
 1005|  11.9k|                             id->identifier.byteString.length, pos);
 1006|  11.9k|        if(idEsc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (1006:12): [True: 0, False: 11.9k]
  ------------------
 1007|  11.9k|           idEsc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (1007:12): [True: 0, False: 11.9k]
  ------------------
 1008|      0|            while(pos > bpos && pos[-1] == '=')
  ------------------
  |  Branch (1008:19): [True: 0, False: 0]
  |  Branch (1008:33): [True: 0, False: 0]
  ------------------
 1009|      0|                pos--;
 1010|      0|            for(; bpos < pos; bpos++) {
  ------------------
  |  Branch (1010:19): [True: 0, False: 0]
  ------------------
 1011|      0|                if(*bpos == '+') *bpos = '-';
  ------------------
  |  Branch (1011:20): [True: 0, False: 0]
  ------------------
 1012|      0|                else if(*bpos == '/') *bpos = '_';
  ------------------
  |  Branch (1012:25): [True: 0, False: 0]
  ------------------
 1013|      0|            }
 1014|      0|        }
 1015|  11.9k|        break;
 1016|  37.0k|    }
 1017|  37.0k|    return pos;
 1018|  37.0k|}
ua_types.c:Variant_clear:
 1370|   283k|Variant_clear(UA_Variant *p, const UA_DataType *_) {
 1371|       |    /* The content is "borrowed" */
 1372|   283k|    if(p->storageType == UA_VARIANT_DATA_NODELETE)
  ------------------
  |  Branch (1372:8): [True: 0, False: 283k]
  ------------------
 1373|      0|        return;
 1374|       |
 1375|       |    /* Delete the value */
 1376|   283k|    if(p->type && p->data > UA_EMPTY_ARRAY_SENTINEL) {
  ------------------
  |  |  755|   110k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1376:8): [True: 110k, False: 172k]
  |  Branch (1376:19): [True: 103k, False: 6.34k]
  ------------------
 1377|   103k|        if(p->arrayLength == 0)
  ------------------
  |  Branch (1377:12): [True: 97.7k, False: 6.08k]
  ------------------
 1378|  97.7k|            p->arrayLength = 1;
 1379|   103k|        UA_Array_delete(p->data, p->arrayLength, p->type);
 1380|   103k|        p->data = NULL;
 1381|   103k|    }
 1382|       |
 1383|       |    /* Delete the array dimensions */
 1384|   283k|    if((void*)p->arrayDimensions > UA_EMPTY_ARRAY_SENTINEL)
  ------------------
  |  |  755|   283k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1384:8): [True: 3.10k, False: 280k]
  ------------------
 1385|  3.10k|        UA_free(p->arrayDimensions);
  ------------------
  |  |   19|  3.10k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1386|   283k|}
ua_types.c:DataValue_clear:
 1828|   153k|DataValue_clear(UA_DataValue *p, const UA_DataType *_) {
 1829|       |    Variant_clear(&p->value, NULL);
 1830|   153k|}
ua_types.c:String_copy:
  281|  78.5k|String_copy(UA_String const *src, UA_String *dst, const UA_DataType *_) {
  282|  78.5k|    UA_StatusCode res =
  283|  78.5k|        UA_Array_copy(src->data, src->length, (void**)&dst->data,
  284|  78.5k|                      &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|  78.5k|#define UA_TYPES_BYTE 2
  ------------------
  285|  78.5k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  78.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (285:8): [True: 78.5k, False: 0]
  ------------------
  286|  78.5k|        dst->length = src->length;
  287|  78.5k|    return res;
  288|  78.5k|}
ua_types.c:String_clear:
  291|  3.38M|String_clear(UA_String *s, const UA_DataType *_) {
  292|  3.38M|    UA_Array_delete(s->data, s->length, &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|  3.38M|#define UA_TYPES_BYTE 2
  ------------------
  293|  3.38M|}
ua_types.c:NodeId_clear:
  773|   188k|NodeId_clear(UA_NodeId *p, const UA_DataType *_) {
  774|   188k|    switch(p->identifierType) {
  775|  13.7k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (775:5): [True: 13.7k, False: 174k]
  ------------------
  776|  21.7k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (776:5): [True: 8.06k, False: 180k]
  ------------------
  777|  21.7k|        String_clear(&p->identifier.string, NULL);
  778|  21.7k|        break;
  779|   166k|    default: break;
  ------------------
  |  Branch (779:5): [True: 166k, False: 21.7k]
  ------------------
  780|   188k|    }
  781|   188k|}
ua_types.c:ExpandedNodeId_clear:
 1071|  19.2k|ExpandedNodeId_clear(UA_ExpandedNodeId *p, const UA_DataType *_) {
 1072|  19.2k|    NodeId_clear(&p->nodeId, _);
 1073|       |    String_clear(&p->namespaceUri, NULL);
 1074|  19.2k|}
ua_types.c:QualifiedName_clear:
  393|  68.1k|QualifiedName_clear(UA_QualifiedName *p, const UA_DataType *_) {
  394|       |    String_clear(&p->name, NULL);
  395|  68.1k|}
ua_types.c:LocalizedText_clear:
 1813|  1.44M|LocalizedText_clear(UA_LocalizedText *p, const UA_DataType *_) {
 1814|  1.44M|    String_clear(&p->locale, NULL);
 1815|       |    String_clear(&p->text, NULL);
 1816|  1.44M|}
ua_types.c:ExtensionObject_clear:
 1242|   162k|ExtensionObject_clear(UA_ExtensionObject *p, const UA_DataType *_) {
 1243|   162k|    switch(p->encoding) {
 1244|   162k|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (1244:5): [True: 162k, False: 0]
  ------------------
 1245|   162k|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (1245:5): [True: 0, False: 162k]
  ------------------
 1246|   162k|    case UA_EXTENSIONOBJECT_ENCODED_XML:
  ------------------
  |  Branch (1246:5): [True: 0, False: 162k]
  ------------------
 1247|   162k|        NodeId_clear(&p->content.encoded.typeId, NULL);
 1248|   162k|        String_clear(&p->content.encoded.body, NULL);
 1249|   162k|        break;
 1250|      0|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (1250:5): [True: 0, False: 162k]
  ------------------
 1251|      0|        if(p->content.decoded.data)
  ------------------
  |  Branch (1251:12): [True: 0, False: 0]
  ------------------
 1252|      0|            UA_delete(p->content.decoded.data, p->content.decoded.type);
 1253|      0|        break;
 1254|      0|    default:
  ------------------
  |  Branch (1254:5): [True: 0, False: 162k]
  ------------------
 1255|      0|        break;
 1256|   162k|    }
 1257|   162k|}
ua_types.c:DiagnosticInfo_clear:
 1856|  1.34k|DiagnosticInfo_clear(UA_DiagnosticInfo *p, const UA_DataType *_) {
 1857|  1.34k|    String_clear(&p->additionalInfo, NULL);
 1858|  1.34k|    if(p->hasInnerDiagnosticInfo && p->innerDiagnosticInfo) {
  ------------------
  |  Branch (1858:8): [True: 0, False: 1.34k]
  |  Branch (1858:37): [True: 0, False: 0]
  ------------------
 1859|      0|        DiagnosticInfo_clear(p->innerDiagnosticInfo, NULL);
 1860|      0|        UA_free(p->innerDiagnosticInfo);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1861|      0|    }
 1862|  1.34k|}
ua_types.c:guidOrder:
 2217|    849|guidOrder(const UA_Guid *p1, const UA_Guid *p2, const UA_DataType *type) {
 2218|    849|    if(p1->data1 != p2->data1)
  ------------------
  |  Branch (2218:8): [True: 0, False: 849]
  ------------------
 2219|      0|        return (p1->data1 < p2->data1) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2219:16): [True: 0, False: 0]
  ------------------
 2220|    849|    if(p1->data2 != p2->data2)
  ------------------
  |  Branch (2220:8): [True: 0, False: 849]
  ------------------
 2221|      0|        return (p1->data2 < p2->data2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2221:16): [True: 0, False: 0]
  ------------------
 2222|    849|    if(p1->data3 != p2->data3)
  ------------------
  |  Branch (2222:8): [True: 0, False: 849]
  ------------------
 2223|      0|        return (p1->data3 < p2->data3) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2223:16): [True: 0, False: 0]
  ------------------
 2224|    849|    int cmp = memcmp(p1->data4, p2->data4, 8);
 2225|    849|    if(cmp != 0)
  ------------------
  |  Branch (2225:8): [True: 0, False: 849]
  ------------------
 2226|      0|        return (cmp < 0) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2226:16): [True: 0, False: 0]
  ------------------
 2227|    849|    return UA_ORDER_EQ;
 2228|    849|}
ua_types.c:nodeIdOrder:
 2246|  12.3k|nodeIdOrder(const UA_NodeId *p1, const UA_NodeId *p2, const UA_DataType *_) {
 2247|       |    /* Compare namespaceIndex */
 2248|  12.3k|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2248:8): [True: 0, False: 12.3k]
  ------------------
 2249|      0|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2249:16): [True: 0, False: 0]
  ------------------
 2250|       |
 2251|       |    /* Compare identifierType */
 2252|  12.3k|    if(p1->identifierType != p2->identifierType)
  ------------------
  |  Branch (2252:8): [True: 0, False: 12.3k]
  ------------------
 2253|      0|        return (p1->identifierType < p2->identifierType) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2253:16): [True: 0, False: 0]
  ------------------
 2254|       |
 2255|       |    /* Compare the identifier */
 2256|  12.3k|    switch(p1->identifierType) {
 2257|  1.55k|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (2257:5): [True: 1.55k, False: 10.7k]
  ------------------
 2258|  1.55k|    default:
  ------------------
  |  Branch (2258:5): [True: 0, False: 12.3k]
  ------------------
 2259|  1.55k|        if(p1->identifier.numeric != p2->identifier.numeric)
  ------------------
  |  Branch (2259:12): [True: 0, False: 1.55k]
  ------------------
 2260|      0|            return (p1->identifier.numeric < p2->identifier.numeric) ?
  ------------------
  |  Branch (2260:20): [True: 0, False: 0]
  ------------------
 2261|      0|                UA_ORDER_LESS : UA_ORDER_MORE;
 2262|  1.55k|        return UA_ORDER_EQ;
 2263|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (2263:5): [True: 0, False: 12.3k]
  ------------------
 2264|      0|        return guidOrder(&p1->identifier.guid, &p2->identifier.guid, NULL);
 2265|  6.80k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (2265:5): [True: 6.80k, False: 5.54k]
  ------------------
 2266|  10.7k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (2266:5): [True: 3.98k, False: 8.36k]
  ------------------
 2267|       |        return stringOrder(&p1->identifier.string, &p2->identifier.string, NULL);
 2268|  12.3k|    }
 2269|  12.3k|}
ua_types.c:expandedNodeIdOrder:
 2273|  9.46k|                    const UA_DataType *_) {
 2274|  9.46k|    if(p1->serverIndex != p2->serverIndex)
  ------------------
  |  Branch (2274:8): [True: 0, False: 9.46k]
  ------------------
 2275|      0|        return (p1->serverIndex < p2->serverIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2275:16): [True: 0, False: 0]
  ------------------
 2276|  9.46k|    UA_Order o = stringOrder(&p1->namespaceUri, &p2->namespaceUri, NULL);
 2277|  9.46k|    if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2277:8): [True: 0, False: 9.46k]
  ------------------
 2278|      0|        return o;
 2279|  9.46k|    return nodeIdOrder(&p1->nodeId, &p2->nodeId, NULL);
 2280|  9.46k|}
ua_types.c:booleanOrder:
 2179|  5.38k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2180|  5.38k|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2180:12): [True: 0, False: 5.38k]
  ------------------
 2181|  5.38k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2181:20): [True: 0, False: 0]
  ------------------
 2182|  5.38k|        return UA_ORDER_EQ;                                         \
 2183|  5.38k|    }
ua_types.c:sByteOrder:
 2179|   215k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2180|   215k|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2180:12): [True: 0, False: 215k]
  ------------------
 2181|   215k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2181:20): [True: 0, False: 0]
  ------------------
 2182|   215k|        return UA_ORDER_EQ;                                         \
 2183|   215k|    }
ua_types.c:byteOrder:
 2179|  4.89k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2180|  4.89k|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2180:12): [True: 0, False: 4.89k]
  ------------------
 2181|  4.89k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2181:20): [True: 0, False: 0]
  ------------------
 2182|  4.89k|        return UA_ORDER_EQ;                                         \
 2183|  4.89k|    }
ua_types.c:int16Order:
 2179|   100k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2180|   100k|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2180:12): [True: 0, False: 100k]
  ------------------
 2181|   100k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2181:20): [True: 0, False: 0]
  ------------------
 2182|   100k|        return UA_ORDER_EQ;                                         \
 2183|   100k|    }
ua_types.c:uInt16Order:
 2179|  22.0k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2180|  22.0k|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2180:12): [True: 0, False: 22.0k]
  ------------------
 2181|  22.0k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2181:20): [True: 0, False: 0]
  ------------------
 2182|  22.0k|        return UA_ORDER_EQ;                                         \
 2183|  22.0k|    }
ua_types.c:int32Order:
 2179|   631k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2180|   631k|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2180:12): [True: 0, False: 631k]
  ------------------
 2181|   631k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2181:20): [True: 0, False: 0]
  ------------------
 2182|   631k|        return UA_ORDER_EQ;                                         \
 2183|   631k|    }
ua_types.c:uInt32Order:
 2179|  1.49M|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2180|  1.49M|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2180:12): [True: 0, False: 1.49M]
  ------------------
 2181|  1.49M|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2181:20): [True: 0, False: 0]
  ------------------
 2182|  1.49M|        return UA_ORDER_EQ;                                         \
 2183|  1.49M|    }
ua_types.c:int64Order:
 2179|  1.18M|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2180|  1.18M|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2180:12): [True: 0, False: 1.18M]
  ------------------
 2181|  1.18M|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2181:20): [True: 0, False: 0]
  ------------------
 2182|  1.18M|        return UA_ORDER_EQ;                                         \
 2183|  1.18M|    }
ua_types.c:uInt64Order:
 2179|  1.86M|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2180|  1.86M|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2180:12): [True: 0, False: 1.86M]
  ------------------
 2181|  1.86M|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2181:20): [True: 0, False: 0]
  ------------------
 2182|  1.86M|        return UA_ORDER_EQ;                                         \
 2183|  1.86M|    }
ua_types.c:floatOrder:
 2197|   853k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2198|   853k|        if(*p1 != *p2) {                                            \
  ------------------
  |  Branch (2198:12): [True: 5.32k, False: 847k]
  ------------------
 2199|  5.32k|            /* p1 is NaN */                                         \
 2200|  5.32k|            if(*p1 != *p1) {                                        \
  ------------------
  |  Branch (2200:16): [True: 5.32k, False: 0]
  ------------------
 2201|  5.32k|                if(*p2 != *p2)                                      \
  ------------------
  |  Branch (2201:20): [True: 5.32k, False: 0]
  ------------------
 2202|  5.32k|                    return UA_ORDER_EQ;                             \
 2203|  5.32k|                return UA_ORDER_LESS;                               \
 2204|  5.32k|            }                                                       \
 2205|  5.32k|            /* p2 is NaN */                                         \
 2206|  5.32k|            if(*p2 != *p2)                                          \
  ------------------
  |  Branch (2206:16): [True: 0, False: 0]
  ------------------
 2207|      0|                return UA_ORDER_MORE;                               \
 2208|      0|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2208:20): [True: 0, False: 0]
  ------------------
 2209|      0|        }                                                           \
 2210|   853k|        return UA_ORDER_EQ;                                         \
 2211|   853k|    }
ua_types.c:doubleOrder:
 2197|  6.43k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2198|  6.43k|        if(*p1 != *p2) {                                            \
  ------------------
  |  Branch (2198:12): [True: 629, False: 5.80k]
  ------------------
 2199|    629|            /* p1 is NaN */                                         \
 2200|    629|            if(*p1 != *p1) {                                        \
  ------------------
  |  Branch (2200:16): [True: 629, False: 0]
  ------------------
 2201|    629|                if(*p2 != *p2)                                      \
  ------------------
  |  Branch (2201:20): [True: 629, False: 0]
  ------------------
 2202|    629|                    return UA_ORDER_EQ;                             \
 2203|    629|                return UA_ORDER_LESS;                               \
 2204|    629|            }                                                       \
 2205|    629|            /* p2 is NaN */                                         \
 2206|    629|            if(*p2 != *p2)                                          \
  ------------------
  |  Branch (2206:16): [True: 0, False: 0]
  ------------------
 2207|      0|                return UA_ORDER_MORE;                               \
 2208|      0|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2208:20): [True: 0, False: 0]
  ------------------
 2209|      0|        }                                                           \
 2210|  6.43k|        return UA_ORDER_EQ;                                         \
 2211|  6.43k|    }
ua_types.c:stringOrder:
 2231|  1.49M|stringOrder(const UA_String *p1, const UA_String *p2, const UA_DataType *type) {
 2232|  1.49M|    if(p1->length != p2->length)
  ------------------
  |  Branch (2232:8): [True: 0, False: 1.49M]
  ------------------
 2233|      0|        return (p1->length < p2->length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2233:16): [True: 0, False: 0]
  ------------------
 2234|       |    /* For zero-length arrays, every pointer not NULL is considered a
 2235|       |     * UA_EMPTY_ARRAY_SENTINEL. */
 2236|  1.49M|    if(p1->data == p2->data) return UA_ORDER_EQ;
  ------------------
  |  Branch (2236:8): [True: 1.47M, False: 26.4k]
  ------------------
 2237|  26.4k|    if(p1->data == NULL) return UA_ORDER_LESS;
  ------------------
  |  Branch (2237:8): [True: 0, False: 26.4k]
  ------------------
 2238|  26.4k|    if(p2->data == NULL) return UA_ORDER_MORE;
  ------------------
  |  Branch (2238:8): [True: 0, False: 26.4k]
  ------------------
 2239|  26.4k|    int cmp = memcmp((const char*)p1->data, (const char*)p2->data, p1->length);
 2240|  26.4k|    if(cmp != 0)
  ------------------
  |  Branch (2240:8): [True: 0, False: 26.4k]
  ------------------
 2241|      0|        return (cmp < 0) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2241:16): [True: 0, False: 0]
  ------------------
 2242|  26.4k|    return UA_ORDER_EQ;
 2243|  26.4k|}
ua_types.c:qualifiedNameOrder:
 2284|  24.5k|                   const UA_DataType *_) {
 2285|  24.5k|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2285:8): [True: 0, False: 24.5k]
  ------------------
 2286|      0|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2286:16): [True: 0, False: 0]
  ------------------
 2287|  24.5k|    return stringOrder(&p1->name, &p2->name, NULL);
 2288|  24.5k|}
ua_types.c:localizedTextOrder:
 2292|   724k|                   const UA_DataType *_) {
 2293|   724k|    UA_Order o = stringOrder(&p1->locale, &p2->locale, NULL);
 2294|   724k|    if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2294:8): [True: 0, False: 724k]
  ------------------
 2295|      0|        return o;
 2296|   724k|    return stringOrder(&p1->text, &p2->text, NULL);
 2297|   724k|}
ua_types.c:extensionObjectOrder:
 2301|  74.8k|                     const UA_DataType *_) {
 2302|  74.8k|    UA_ExtensionObjectEncoding enc1 = p1->encoding;
 2303|  74.8k|    UA_ExtensionObjectEncoding enc2 = p2->encoding;
 2304|  74.8k|    if(enc1 > UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2304:8): [True: 0, False: 74.8k]
  ------------------
 2305|      0|        enc1 = UA_EXTENSIONOBJECT_DECODED;
 2306|  74.8k|    if(enc2 > UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2306:8): [True: 0, False: 74.8k]
  ------------------
 2307|      0|        enc2 = UA_EXTENSIONOBJECT_DECODED;
 2308|  74.8k|    if(enc1 != enc2)
  ------------------
  |  Branch (2308:8): [True: 0, False: 74.8k]
  ------------------
 2309|      0|        return (enc1 < enc2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2309:16): [True: 0, False: 0]
  ------------------
 2310|       |
 2311|  74.8k|    switch(enc1) {
 2312|  74.8k|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (2312:5): [True: 74.8k, False: 0]
  ------------------
 2313|  74.8k|        return UA_ORDER_EQ;
 2314|       |
 2315|      0|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (2315:5): [True: 0, False: 74.8k]
  ------------------
 2316|      0|    case UA_EXTENSIONOBJECT_ENCODED_XML: {
  ------------------
  |  Branch (2316:5): [True: 0, False: 74.8k]
  ------------------
 2317|      0|            UA_Order o = nodeIdOrder(&p1->content.encoded.typeId,
 2318|      0|                                     &p2->content.encoded.typeId, NULL);
 2319|      0|            if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2319:16): [True: 0, False: 0]
  ------------------
 2320|      0|                return o;
 2321|      0|            return stringOrder((const UA_String*)&p1->content.encoded.body,
 2322|      0|                               (const UA_String*)&p2->content.encoded.body, NULL);
 2323|      0|        }
 2324|       |
 2325|      0|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (2325:5): [True: 0, False: 74.8k]
  ------------------
 2326|      0|    default: {
  ------------------
  |  Branch (2326:5): [True: 0, False: 74.8k]
  ------------------
 2327|      0|            const UA_DataType *type1 = p1->content.decoded.type;
 2328|      0|            const UA_DataType *type2 = p2->content.decoded.type;
 2329|      0|            if(type1 != type2)
  ------------------
  |  Branch (2329:16): [True: 0, False: 0]
  ------------------
 2330|      0|                return ((uintptr_t)type1 < (uintptr_t)type2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2330:24): [True: 0, False: 0]
  ------------------
 2331|      0|            if(!type1)
  ------------------
  |  Branch (2331:16): [True: 0, False: 0]
  ------------------
 2332|      0|                return UA_ORDER_EQ;
 2333|      0|            return orderJumpTable[type1->typeKind]
 2334|      0|                (p1->content.decoded.data, p2->content.decoded.data, type1);
 2335|      0|        }
 2336|  74.8k|    }
 2337|  74.8k|}
ua_types.c:dataValueOrder:
 2399|  69.0k|dataValueOrder(const UA_DataValue *p1, const UA_DataValue *p2, const UA_DataType *_) {
 2400|       |    /* Value */
 2401|  69.0k|    if(p1->hasValue != p2->hasValue)
  ------------------
  |  Branch (2401:8): [True: 0, False: 69.0k]
  ------------------
 2402|      0|        return (!p1->hasValue) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2402:16): [True: 0, False: 0]
  ------------------
 2403|  69.0k|    if(p1->hasValue) {
  ------------------
  |  Branch (2403:8): [True: 29.3k, False: 39.6k]
  ------------------
 2404|  29.3k|        UA_Order o = variantOrder(&p1->value, &p2->value, NULL);
 2405|  29.3k|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2405:12): [True: 0, False: 29.3k]
  ------------------
 2406|      0|            return o;
 2407|  29.3k|    }
 2408|       |
 2409|       |    /* Status */
 2410|  69.0k|    if(p1->hasStatus != p2->hasStatus)
  ------------------
  |  Branch (2410:8): [True: 0, False: 69.0k]
  ------------------
 2411|      0|        return (!p1->hasStatus) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2411:16): [True: 0, False: 0]
  ------------------
 2412|  69.0k|    if(p1->hasStatus && p1->status != p2->status)
  ------------------
  |  Branch (2412:8): [True: 7, False: 69.0k]
  |  Branch (2412:25): [True: 0, False: 7]
  ------------------
 2413|      0|        return (p1->status < p2->status) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2413:16): [True: 0, False: 0]
  ------------------
 2414|       |
 2415|       |    /* SourceTimestamp */
 2416|  69.0k|    if(p1->hasSourceTimestamp != p2->hasSourceTimestamp)
  ------------------
  |  Branch (2416:8): [True: 0, False: 69.0k]
  ------------------
 2417|      0|        return (!p1->hasSourceTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2417:16): [True: 0, False: 0]
  ------------------
 2418|  69.0k|    if(p1->hasSourceTimestamp && p1->sourceTimestamp != p2->sourceTimestamp)
  ------------------
  |  Branch (2418:8): [True: 0, False: 69.0k]
  |  Branch (2418:34): [True: 0, False: 0]
  ------------------
 2419|      0|        return (p1->sourceTimestamp < p2->sourceTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2419:16): [True: 0, False: 0]
  ------------------
 2420|       |
 2421|       |    /* ServerTimestamp */
 2422|  69.0k|    if(p1->hasServerTimestamp != p2->hasServerTimestamp)
  ------------------
  |  Branch (2422:8): [True: 0, False: 69.0k]
  ------------------
 2423|      0|        return (!p1->hasServerTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2423:16): [True: 0, False: 0]
  ------------------
 2424|  69.0k|    if(p1->hasServerTimestamp && p1->serverTimestamp != p2->serverTimestamp)
  ------------------
  |  Branch (2424:8): [True: 0, False: 69.0k]
  |  Branch (2424:34): [True: 0, False: 0]
  ------------------
 2425|      0|        return (p1->serverTimestamp < p2->serverTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2425:16): [True: 0, False: 0]
  ------------------
 2426|       |
 2427|       |    /* SourcePicoseconds */
 2428|  69.0k|    if(p1->hasSourcePicoseconds != p2->hasSourcePicoseconds)
  ------------------
  |  Branch (2428:8): [True: 0, False: 69.0k]
  ------------------
 2429|      0|        return (!p1->hasSourcePicoseconds) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2429:16): [True: 0, False: 0]
  ------------------
 2430|  69.0k|    if(p1->hasSourcePicoseconds && p1->sourcePicoseconds != p2->sourcePicoseconds)
  ------------------
  |  Branch (2430:8): [True: 0, False: 69.0k]
  |  Branch (2430:36): [True: 0, False: 0]
  ------------------
 2431|      0|        return (p1->sourcePicoseconds < p2->sourcePicoseconds) ?
  ------------------
  |  Branch (2431:16): [True: 0, False: 0]
  ------------------
 2432|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2433|       |
 2434|       |    /* ServerPicoseconds */
 2435|  69.0k|    if(p1->hasServerPicoseconds != p2->hasServerPicoseconds)
  ------------------
  |  Branch (2435:8): [True: 0, False: 69.0k]
  ------------------
 2436|      0|        return (!p1->hasServerPicoseconds) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2436:16): [True: 0, False: 0]
  ------------------
 2437|  69.0k|    if(p1->hasServerPicoseconds && p1->serverPicoseconds != p2->serverPicoseconds)
  ------------------
  |  Branch (2437:8): [True: 0, False: 69.0k]
  |  Branch (2437:36): [True: 0, False: 0]
  ------------------
 2438|      0|        return (p1->serverPicoseconds < p2->serverPicoseconds) ?
  ------------------
  |  Branch (2438:16): [True: 0, False: 0]
  ------------------
 2439|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2440|       |
 2441|  69.0k|    return UA_ORDER_EQ;
 2442|  69.0k|}
ua_types.c:variantOrder:
 2364|  89.6k|variantOrder(const UA_Variant *p1, const UA_Variant *p2, const UA_DataType *_) {
 2365|  89.6k|    if(p1->type != p2->type)
  ------------------
  |  Branch (2365:8): [True: 0, False: 89.6k]
  ------------------
 2366|      0|        return ((uintptr_t)p1->type < (uintptr_t)p2->type) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2366:16): [True: 0, False: 0]
  ------------------
 2367|       |
 2368|  89.6k|    UA_Order o;
 2369|  89.6k|    if(p1->type != NULL) {
  ------------------
  |  Branch (2369:8): [True: 46.3k, False: 43.3k]
  ------------------
 2370|       |        /* Check if both variants are scalars or arrays */
 2371|  46.3k|        UA_Boolean s1 = UA_Variant_isScalar(p1);
 2372|  46.3k|        UA_Boolean s2 = UA_Variant_isScalar(p2);
 2373|  46.3k|        if(s1 != s2)
  ------------------
  |  Branch (2373:12): [True: 0, False: 46.3k]
  ------------------
 2374|      0|            return s1 ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2374:20): [True: 0, False: 0]
  ------------------
 2375|  46.3k|        if(s1) {
  ------------------
  |  Branch (2375:12): [True: 40.3k, False: 5.93k]
  ------------------
 2376|  40.3k|            o = orderJumpTable[p1->type->typeKind](p1->data, p2->data, p1->type);
 2377|  40.3k|        } else {
 2378|       |            /* Mismatching array length? */
 2379|  5.93k|            if(p1->arrayLength != p2->arrayLength)
  ------------------
  |  Branch (2379:16): [True: 0, False: 5.93k]
  ------------------
 2380|      0|                return (p1->arrayLength < p2->arrayLength) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2380:24): [True: 0, False: 0]
  ------------------
 2381|  5.93k|            o = arrayOrder(p1->data, p1->arrayLength, p2->data, p2->arrayLength, p1->type);
 2382|  5.93k|        }
 2383|  46.3k|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2383:12): [True: 0, False: 46.3k]
  ------------------
 2384|      0|            return o;
 2385|  46.3k|    }
 2386|       |
 2387|  89.6k|    if(p1->arrayDimensionsSize != p2->arrayDimensionsSize)
  ------------------
  |  Branch (2387:8): [True: 0, False: 89.6k]
  ------------------
 2388|      0|        return (p1->arrayDimensionsSize < p2->arrayDimensionsSize) ?
  ------------------
  |  Branch (2388:16): [True: 0, False: 0]
  ------------------
 2389|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2390|  89.6k|    o = UA_ORDER_EQ;
 2391|  89.6k|    if(p1->arrayDimensionsSize > 0)
  ------------------
  |  Branch (2391:8): [True: 1.52k, False: 88.1k]
  ------------------
 2392|  1.52k|        o = arrayOrder(p1->arrayDimensions, p1->arrayDimensionsSize,
 2393|  1.52k|                       p2->arrayDimensions, p2->arrayDimensionsSize,
 2394|  1.52k|                       &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  225|  1.52k|#define UA_TYPES_UINT32 6
  ------------------
 2395|  89.6k|    return o;
 2396|  89.6k|}
ua_types.c:arrayOrder:
 2348|  7.45k|           const UA_DataType *type) {
 2349|  7.45k|    if(p1Length != p2Length)
  ------------------
  |  Branch (2349:8): [True: 0, False: 7.45k]
  ------------------
 2350|      0|        return (p1Length < p2Length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2350:16): [True: 0, False: 0]
  ------------------
 2351|  7.45k|    uintptr_t u1 = (uintptr_t)p1;
 2352|  7.45k|    uintptr_t u2 = (uintptr_t)p2;
 2353|  7.32M|    for(size_t i = 0; i < p1Length; i++) {
  ------------------
  |  Branch (2353:23): [True: 7.31M, False: 7.45k]
  ------------------
 2354|  7.31M|        UA_Order o = orderJumpTable[type->typeKind]((const void*)u1, (const void*)u2, type);
 2355|  7.31M|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2355:12): [True: 0, False: 7.31M]
  ------------------
 2356|      0|            return o;
 2357|  7.31M|        u1 += type->memSize;
 2358|  7.31M|        u2 += type->memSize;
 2359|  7.31M|    }
 2360|  7.45k|    return UA_ORDER_EQ;
 2361|  7.45k|}
ua_types.c:diagnosticInfoOrder:
 2446|    670|                    const UA_DataType *_) {
 2447|       |    /* SymbolicId */
 2448|    670|    if(p1->hasSymbolicId != p2->hasSymbolicId)
  ------------------
  |  Branch (2448:8): [True: 0, False: 670]
  ------------------
 2449|      0|        return (!p1->hasSymbolicId) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2449:16): [True: 0, False: 0]
  ------------------
 2450|    670|    if(p1->hasSymbolicId && p1->symbolicId != p2->symbolicId)
  ------------------
  |  Branch (2450:8): [True: 0, False: 670]
  |  Branch (2450:29): [True: 0, False: 0]
  ------------------
 2451|      0|        return (p1->symbolicId < p2->symbolicId) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2451:16): [True: 0, False: 0]
  ------------------
 2452|       |
 2453|       |    /* NamespaceUri */
 2454|    670|    if(p1->hasNamespaceUri != p2->hasNamespaceUri)
  ------------------
  |  Branch (2454:8): [True: 0, False: 670]
  ------------------
 2455|      0|        return (!p1->hasNamespaceUri) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2455:16): [True: 0, False: 0]
  ------------------
 2456|    670|    if(p1->hasNamespaceUri && p1->namespaceUri != p2->namespaceUri)
  ------------------
  |  Branch (2456:8): [True: 0, False: 670]
  |  Branch (2456:31): [True: 0, False: 0]
  ------------------
 2457|      0|        return (p1->namespaceUri < p2->namespaceUri) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2457:16): [True: 0, False: 0]
  ------------------
 2458|       |
 2459|       |    /* LocalizedText */
 2460|    670|    if(p1->hasLocalizedText != p2->hasLocalizedText)
  ------------------
  |  Branch (2460:8): [True: 0, False: 670]
  ------------------
 2461|      0|        return (!p1->hasLocalizedText) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2461:16): [True: 0, False: 0]
  ------------------
 2462|    670|    if(p1->hasLocalizedText && p1->localizedText != p2->localizedText)
  ------------------
  |  Branch (2462:8): [True: 0, False: 670]
  |  Branch (2462:32): [True: 0, False: 0]
  ------------------
 2463|      0|        return (p1->localizedText < p2->localizedText) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2463:16): [True: 0, False: 0]
  ------------------
 2464|       |
 2465|       |    /* Locale */
 2466|    670|    if(p1->hasLocale != p2->hasLocale)
  ------------------
  |  Branch (2466:8): [True: 0, False: 670]
  ------------------
 2467|      0|        return (!p1->hasLocale) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2467:16): [True: 0, False: 0]
  ------------------
 2468|    670|    if(p1->hasLocale && p1->locale != p2->locale)
  ------------------
  |  Branch (2468:8): [True: 0, False: 670]
  |  Branch (2468:25): [True: 0, False: 0]
  ------------------
 2469|      0|        return (p1->locale < p2->locale) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2469:16): [True: 0, False: 0]
  ------------------
 2470|       |
 2471|       |    /* AdditionalInfo */
 2472|    670|    if(p1->hasAdditionalInfo != p2->hasAdditionalInfo)
  ------------------
  |  Branch (2472:8): [True: 0, False: 670]
  ------------------
 2473|      0|        return (!p1->hasAdditionalInfo) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2473:16): [True: 0, False: 0]
  ------------------
 2474|    670|    if(p1->hasAdditionalInfo) {
  ------------------
  |  Branch (2474:8): [True: 0, False: 670]
  ------------------
 2475|      0|        UA_Order o = stringOrder(&p1->additionalInfo, &p2->additionalInfo, NULL);
 2476|      0|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2476:12): [True: 0, False: 0]
  ------------------
 2477|      0|            return o;
 2478|      0|    }
 2479|       |
 2480|       |    /* InnerStatusCode */
 2481|    670|    if(p1->hasInnerStatusCode != p2->hasInnerStatusCode)
  ------------------
  |  Branch (2481:8): [True: 0, False: 670]
  ------------------
 2482|      0|        return (!p1->hasInnerStatusCode) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2482:16): [True: 0, False: 0]
  ------------------
 2483|    670|    if(p1->hasInnerStatusCode && p1->innerStatusCode != p2->innerStatusCode)
  ------------------
  |  Branch (2483:8): [True: 0, False: 670]
  |  Branch (2483:34): [True: 0, False: 0]
  ------------------
 2484|      0|        return (p1->innerStatusCode < p2->innerStatusCode) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2484:16): [True: 0, False: 0]
  ------------------
 2485|       |
 2486|       |    /* InnerDiagnosticInfo */
 2487|    670|    if(p1->hasInnerDiagnosticInfo != p2->hasInnerDiagnosticInfo)
  ------------------
  |  Branch (2487:8): [True: 0, False: 670]
  ------------------
 2488|      0|        return (!p1->hasInnerDiagnosticInfo) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2488:16): [True: 0, False: 0]
  ------------------
 2489|    670|    if(p1->innerDiagnosticInfo == p2->innerDiagnosticInfo)
  ------------------
  |  Branch (2489:8): [True: 670, False: 0]
  ------------------
 2490|    670|        return UA_ORDER_EQ;
 2491|      0|    if(!p1->innerDiagnosticInfo || !p2->innerDiagnosticInfo)
  ------------------
  |  Branch (2491:8): [True: 0, False: 0]
  |  Branch (2491:36): [True: 0, False: 0]
  ------------------
 2492|      0|        return (!p1->innerDiagnosticInfo) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2492:16): [True: 0, False: 0]
  ------------------
 2493|      0|    return diagnosticInfoOrder(p1->innerDiagnosticInfo, p2->innerDiagnosticInfo, NULL);
 2494|      0|}

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

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

UA_Guid_parse:
   84|    897|UA_Guid_parse(UA_Guid *guid, const UA_String str) {
   85|    897|    UA_StatusCode res = parse_guid(guid, str.data, str.data + str.length);
   86|    897|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    897|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (86:8): [True: 46, False: 851]
  ------------------
   87|     46|        *guid = UA_GUID_NULL;
   88|    897|    return res;
   89|    897|}
UA_NodeId_parseEx:
  319|  5.34k|                  const UA_NamespaceMapping *nsMapping) {
  320|  5.34k|    UA_StatusCode res =
  321|  5.34k|        parse_nodeid(id, str.data, str.data+str.length, UA_ESCAPING_NONE, nsMapping);
  322|  5.34k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  5.34k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (322:8): [True: 107, False: 5.24k]
  ------------------
  323|    107|        UA_NodeId_clear(id);
  324|  5.34k|    return res;
  325|  5.34k|}
UA_ExpandedNodeId_parseEx:
  667|  18.5k|                          size_t serverUrisSize, const UA_String *serverUris) {
  668|  18.5k|    UA_StatusCode res =
  669|  18.5k|        parse_expandednodeid(id, str.data, str.data + str.length, UA_ESCAPING_NONE,
  670|  18.5k|                             nsMapping, serverUrisSize, serverUris);
  671|  18.5k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  18.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (671:8): [True: 104, False: 18.4k]
  ------------------
  672|    104|        UA_ExpandedNodeId_clear(id);
  673|  18.5k|    return res;
  674|  18.5k|}
UA_QualifiedName_parseEx:
  823|  64.2k|                         const UA_NamespaceMapping *nsMapping) {
  824|  64.2k|    const u8 *pos = str.data;
  825|  64.2k|    const u8 *end = str.data + str.length;
  826|  64.2k|    UA_StatusCode res = parse_qn(qn, pos, end, UA_ESCAPING_NONE, nsMapping, 0);
  827|  64.2k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  64.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (827:8): [True: 0, False: 64.2k]
  ------------------
  828|      0|        UA_QualifiedName_clear(qn);
  829|  64.2k|    return res;
  830|  64.2k|}
ua_types_lex.c:parse_guid:
   48|    901|parse_guid(UA_Guid *guid, const UA_Byte *s, const UA_Byte *e) {
   49|    901|    size_t len = (size_t)(e - s);
   50|    901|    if(len != 36 || s[8] != '-' || s[13] != '-' || s[23] != '-')
  ------------------
  |  Branch (50:8): [True: 10, False: 891]
  |  Branch (50:21): [True: 11, False: 880]
  |  Branch (50:36): [True: 6, False: 874]
  |  Branch (50:52): [True: 9, False: 865]
  ------------------
   51|     36|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     36|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   52|       |
   53|    865|    UA_UInt32 tmp;
   54|    865|    if(UA_readNumberWithBase(s, 8, &tmp, 16) != 8)
  ------------------
  |  Branch (54:8): [True: 2, False: 863]
  ------------------
   55|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   56|    863|    guid->data1 = tmp;
   57|       |
   58|    863|    if(UA_readNumberWithBase(&s[9], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (58:8): [True: 1, False: 862]
  ------------------
   59|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   60|    862|    guid->data2 = (UA_UInt16)tmp;
   61|       |
   62|    862|    if(UA_readNumberWithBase(&s[14], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (62:8): [True: 3, False: 859]
  ------------------
   63|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   64|    859|    guid->data3 = (UA_UInt16)tmp;
   65|       |
   66|    859|    if(UA_readNumberWithBase(&s[19], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (66:8): [True: 2, False: 857]
  ------------------
   67|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   68|    857|    guid->data4[0] = (UA_Byte)tmp;
   69|       |
   70|    857|    if(UA_readNumberWithBase(&s[21], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (70:8): [True: 2, False: 855]
  ------------------
   71|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   72|    855|    guid->data4[1] = (UA_Byte)tmp;
   73|       |
   74|  5.97k|    for(size_t pos = 2, spos = 24; pos < 8; pos++, spos += 2) {
  ------------------
  |  Branch (74:36): [True: 5.11k, False: 851]
  ------------------
   75|  5.11k|        if(UA_readNumberWithBase(&s[spos], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (75:12): [True: 4, False: 5.11k]
  ------------------
   76|      4|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   77|  5.11k|        guid->data4[pos] = (UA_Byte)tmp;
   78|  5.11k|    }
   79|       |
   80|    851|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    851|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   81|    855|}
ua_types_lex.c:parse_nodeid:
  144|  5.34k|             UA_Escaping idEsc, const UA_NamespaceMapping *nsMapping) {
  145|  5.34k|    *id = UA_NODEID_NULL; /* Reset the NodeId */
  146|  5.34k|    LexContext context;
  147|  5.34k|    memset(&context, 0, sizeof(LexContext));
  148|  5.34k|    UA_Byte *begin = (UA_Byte*)(uintptr_t)pos;
  149|  5.34k|    const u8 *ns = NULL, *nsu = NULL, *body = NULL;
  150|       |
  151|       |    
  152|  5.34k|{
  153|  5.34k|	u8 yych;
  154|  5.34k|	yych = YYPEEK();
  ------------------
  |  |   31|  5.34k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  5.34k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  5.34k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 5.34k, False: 3]
  |  |  ------------------
  ------------------
  155|  5.34k|	switch (yych) {
  156|  1.13k|		case 'b':
  ------------------
  |  Branch (156:3): [True: 1.13k, False: 4.21k]
  ------------------
  157|  1.13k|		case 'g':
  ------------------
  |  Branch (157:3): [True: 6, False: 5.34k]
  ------------------
  158|  1.82k|		case 'i':
  ------------------
  |  Branch (158:3): [True: 690, False: 4.65k]
  ------------------
  159|  4.83k|		case 's':
  ------------------
  |  Branch (159:3): [True: 3.00k, False: 2.34k]
  ------------------
  160|  4.83k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|  4.83k|#define YYSTAGN(t) t = NULL
  ------------------
  161|  4.83k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   37|  4.83k|#define YYSTAGN(t) t = NULL
  ------------------
  162|  4.83k|			goto yy3;
  163|    512|		case 'n': goto yy4;
  ------------------
  |  Branch (163:3): [True: 512, False: 4.83k]
  ------------------
  164|      5|		default: goto yy1;
  ------------------
  |  Branch (164:3): [True: 5, False: 5.34k]
  ------------------
  165|  5.34k|	}
  166|      5|yy1:
  167|      5|	YYSKIP();
  ------------------
  |  |   33|      5|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|      5|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  168|     62|yy2:
  169|     62|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   43|     62|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  170|  4.83k|yy3:
  171|  4.83k|	YYSKIP();
  ------------------
  |  |   33|  4.83k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  4.83k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  172|  4.83k|	yych = YYPEEK();
  ------------------
  |  |   31|  4.83k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  4.83k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  4.83k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 4.83k, False: 2]
  |  |  ------------------
  ------------------
  173|  4.83k|	switch (yych) {
  174|  4.82k|		case '=': goto yy5;
  ------------------
  |  Branch (174:3): [True: 4.82k, False: 4]
  ------------------
  175|      4|		default: goto yy2;
  ------------------
  |  Branch (175:3): [True: 4, False: 4.82k]
  ------------------
  176|  4.83k|	}
  177|    512|yy4:
  178|    512|	YYSKIP();
  ------------------
  |  |   33|    512|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    512|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  179|    512|	YYBACKUP();
  ------------------
  |  |   34|    512|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   30|    512|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    512|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  180|    512|	yych = YYPEEK();
  ------------------
  |  |   31|    512|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    512|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    510|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 510, False: 2]
  |  |  ------------------
  ------------------
  181|    512|	switch (yych) {
  182|    508|		case 's': goto yy6;
  ------------------
  |  Branch (182:3): [True: 508, False: 4]
  ------------------
  183|      4|		default: goto yy2;
  ------------------
  |  Branch (183:3): [True: 4, False: 508]
  ------------------
  184|    512|	}
  185|  5.28k|yy5:
  186|  5.28k|	YYSKIP();
  ------------------
  |  |   33|  5.28k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  5.28k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  187|  5.28k|	nsu = context.yyt2;
  188|  5.28k|	ns = context.yyt1;
  189|  5.28k|	YYSTAGP(body);
  ------------------
  |  |   36|  5.28k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  5.28k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  190|  5.28k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   38|  5.28k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  191|  5.28k|	{ goto match; }
  192|    508|yy6:
  193|    508|	YYSKIP();
  ------------------
  |  |   33|    508|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    508|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  194|    508|	yych = YYPEEK();
  ------------------
  |  |   31|    508|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    508|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    506|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 506, False: 2]
  |  |  ------------------
  ------------------
  195|    508|	switch (yych) {
  196|    417|		case '=': goto yy8;
  ------------------
  |  Branch (196:3): [True: 417, False: 91]
  ------------------
  197|     89|		case 'u': goto yy9;
  ------------------
  |  Branch (197:3): [True: 89, False: 419]
  ------------------
  198|      2|		default: goto yy7;
  ------------------
  |  Branch (198:3): [True: 2, False: 506]
  ------------------
  199|    508|	}
  200|     49|yy7:
  201|     49|	YYRESTORE();
  ------------------
  |  |   35|     49|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   29|     49|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   30|     49|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  202|     49|	goto yy2;
  203|    417|yy8:
  204|    417|	YYSKIP();
  ------------------
  |  |   33|    417|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    417|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  205|    417|	yych = YYPEEK();
  ------------------
  |  |   31|    417|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    417|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    415|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 415, False: 2]
  |  |  ------------------
  ------------------
  206|    417|	switch (yych) {
  207|    136|		case '0':
  ------------------
  |  Branch (207:3): [True: 136, False: 281]
  ------------------
  208|    165|		case '1':
  ------------------
  |  Branch (208:3): [True: 29, False: 388]
  ------------------
  209|    195|		case '2':
  ------------------
  |  Branch (209:3): [True: 30, False: 387]
  ------------------
  210|    207|		case '3':
  ------------------
  |  Branch (210:3): [True: 12, False: 405]
  ------------------
  211|    331|		case '4':
  ------------------
  |  Branch (211:3): [True: 124, False: 293]
  ------------------
  212|    336|		case '5':
  ------------------
  |  Branch (212:3): [True: 5, False: 412]
  ------------------
  213|    340|		case '6':
  ------------------
  |  Branch (213:3): [True: 4, False: 413]
  ------------------
  214|    345|		case '7':
  ------------------
  |  Branch (214:3): [True: 5, False: 412]
  ------------------
  215|    387|		case '8':
  ------------------
  |  Branch (215:3): [True: 42, False: 375]
  ------------------
  216|    413|		case '9':
  ------------------
  |  Branch (216:3): [True: 26, False: 391]
  ------------------
  217|    413|			YYSTAGP(context.yyt1);
  ------------------
  |  |   36|    413|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    413|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  218|    413|			goto yy10;
  219|      4|		default: goto yy7;
  ------------------
  |  Branch (219:3): [True: 4, False: 413]
  ------------------
  220|    417|	}
  221|     89|yy9:
  222|     89|	YYSKIP();
  ------------------
  |  |   33|     89|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|     89|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  223|     89|	yych = YYPEEK();
  ------------------
  |  |   31|     89|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     89|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     89|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 89, False: 0]
  |  |  ------------------
  ------------------
  224|     89|	switch (yych) {
  225|     85|		case '=': goto yy11;
  ------------------
  |  Branch (225:3): [True: 85, False: 4]
  ------------------
  226|      4|		default: goto yy7;
  ------------------
  |  Branch (226:3): [True: 4, False: 85]
  ------------------
  227|     89|	}
  228|  5.71k|yy10:
  229|  5.71k|	YYSKIP();
  ------------------
  |  |   33|  5.71k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  5.71k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  230|  5.71k|	yych = YYPEEK();
  ------------------
  |  |   31|  5.71k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  5.71k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  5.68k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 5.68k, False: 30]
  |  |  ------------------
  ------------------
  231|  5.71k|	switch (yych) {
  232|    921|		case '0':
  ------------------
  |  Branch (232:3): [True: 921, False: 4.79k]
  ------------------
  233|  1.37k|		case '1':
  ------------------
  |  Branch (233:3): [True: 454, False: 5.26k]
  ------------------
  234|  1.76k|		case '2':
  ------------------
  |  Branch (234:3): [True: 385, False: 5.33k]
  ------------------
  235|  2.18k|		case '3':
  ------------------
  |  Branch (235:3): [True: 423, False: 5.29k]
  ------------------
  236|  2.98k|		case '4':
  ------------------
  |  Branch (236:3): [True: 803, False: 4.91k]
  ------------------
  237|  3.37k|		case '5':
  ------------------
  |  Branch (237:3): [True: 392, False: 5.32k]
  ------------------
  238|  3.74k|		case '6':
  ------------------
  |  Branch (238:3): [True: 364, False: 5.35k]
  ------------------
  239|  4.34k|		case '7':
  ------------------
  |  Branch (239:3): [True: 605, False: 5.11k]
  ------------------
  240|  4.71k|		case '8':
  ------------------
  |  Branch (240:3): [True: 363, False: 5.35k]
  ------------------
  241|  5.30k|		case '9': goto yy10;
  ------------------
  |  Branch (241:3): [True: 595, False: 5.12k]
  ------------------
  242|    382|		case ';':
  ------------------
  |  Branch (242:3): [True: 382, False: 5.33k]
  ------------------
  243|    382|			YYSTAGN(context.yyt2);
  ------------------
  |  |   37|    382|#define YYSTAGN(t) t = NULL
  ------------------
  244|    382|			goto yy12;
  245|     31|		default: goto yy7;
  ------------------
  |  Branch (245:3): [True: 31, False: 5.68k]
  ------------------
  246|  5.71k|	}
  247|     85|yy11:
  248|     85|	YYSKIP();
  ------------------
  |  |   33|     85|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|     85|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  249|     85|	yych = YYPEEK();
  ------------------
  |  |   31|     85|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     85|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|     85|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 85, False: 0]
  |  |  ------------------
  ------------------
  250|     85|	switch (yych) {
  251|      0|		case 0x00: goto yy7;
  ------------------
  |  Branch (251:3): [True: 0, False: 85]
  ------------------
  252|      5|		case ';':
  ------------------
  |  Branch (252:3): [True: 5, False: 80]
  ------------------
  253|      5|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|      5|#define YYSTAGN(t) t = NULL
  ------------------
  254|      5|			YYSTAGP(context.yyt2);
  ------------------
  |  |   36|      5|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|      5|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  255|      5|			goto yy12;
  256|     80|		default:
  ------------------
  |  Branch (256:3): [True: 80, False: 5]
  ------------------
  257|     80|			YYSTAGP(context.yyt2);
  ------------------
  |  |   36|     80|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|     80|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  258|     80|			goto yy13;
  259|     85|	}
  260|    464|yy12:
  261|    464|	YYSKIP();
  ------------------
  |  |   33|    464|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    464|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  262|    464|	yych = YYPEEK();
  ------------------
  |  |   31|    464|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    464|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    462|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 462, False: 2]
  |  |  ------------------
  ------------------
  263|    464|	switch (yych) {
  264|     31|		case 'b':
  ------------------
  |  Branch (264:3): [True: 31, False: 433]
  ------------------
  265|     31|		case 'g':
  ------------------
  |  Branch (265:3): [True: 0, False: 464]
  ------------------
  266|    370|		case 'i':
  ------------------
  |  Branch (266:3): [True: 339, False: 125]
  ------------------
  267|    462|		case 's': goto yy14;
  ------------------
  |  Branch (267:3): [True: 92, False: 372]
  ------------------
  268|      2|		default: goto yy7;
  ------------------
  |  Branch (268:3): [True: 2, False: 462]
  ------------------
  269|    464|	}
  270|    486|yy13:
  271|    486|	YYSKIP();
  ------------------
  |  |   33|    486|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    486|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  272|    486|	yych = YYPEEK();
  ------------------
  |  |   31|    486|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    486|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    483|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 483, False: 3]
  |  |  ------------------
  ------------------
  273|    486|	switch (yych) {
  274|      3|		case 0x00: goto yy7;
  ------------------
  |  Branch (274:3): [True: 3, False: 483]
  ------------------
  275|     77|		case ';':
  ------------------
  |  Branch (275:3): [True: 77, False: 409]
  ------------------
  276|     77|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|     77|#define YYSTAGN(t) t = NULL
  ------------------
  277|     77|			goto yy12;
  278|    406|		default: goto yy13;
  ------------------
  |  Branch (278:3): [True: 406, False: 80]
  ------------------
  279|    486|	}
  280|    462|yy14:
  281|    462|	YYSKIP();
  ------------------
  |  |   33|    462|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    462|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  282|    462|	yych = YYPEEK();
  ------------------
  |  |   31|    462|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    462|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    462|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 462, False: 0]
  |  |  ------------------
  ------------------
  283|    462|	switch (yych) {
  284|    459|		case '=': goto yy5;
  ------------------
  |  Branch (284:3): [True: 459, False: 3]
  ------------------
  285|      3|		default: goto yy7;
  ------------------
  |  Branch (285:3): [True: 3, False: 459]
  ------------------
  286|    462|	}
  287|    462|}
  288|       |
  289|       |
  290|  5.28k| match:
  291|  5.28k|    if(nsu) {
  ------------------
  |  Branch (291:8): [True: 80, False: 5.20k]
  ------------------
  292|       |        /* NamespaceUri */
  293|     80|        UA_String nsUri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  294|     80|        UA_StatusCode res = escapedUri2Index(nsUri, &id->namespaceIndex, nsMapping);
  295|     80|        if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|     80|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (295:12): [True: 80, False: 0]
  ------------------
  296|       |            /* Return the entire NodeId string s=... */
  297|     80|            UA_String total = {(size_t)((const UA_Byte*)end - begin), begin};
  298|     80|            id->identifierType = UA_NODEIDTYPE_STRING;
  299|     80|            return UA_String_copy(&total, &id->identifier.string);
  300|     80|        }
  301|  5.20k|    } else if(ns) {
  ------------------
  |  Branch (301:15): [True: 379, False: 4.82k]
  ------------------
  302|       |        /* NamespaceIndex */
  303|    379|        UA_UInt32 tmp;
  304|    379|        size_t len = (size_t)(body - 1 - ns);
  305|    379|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (305:12): [True: 0, False: 379]
  ------------------
  306|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  307|    379|        id->namespaceIndex = (UA_UInt16)tmp;
  308|    379|        if(nsMapping)
  ------------------
  |  Branch (308:12): [True: 0, False: 379]
  ------------------
  309|      0|            id->namespaceIndex =
  310|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->namespaceIndex);
  311|    379|    }
  312|       |
  313|       |    /* From the current position until the end */
  314|  5.20k|    return parse_nodeid_body(id, body, end, idEsc);
  315|  5.28k|}
ua_types_lex.c:escapedUri2Index:
   93|    891|                 const UA_NamespaceMapping *nsMapping) {
   94|    891|    if(!nsMapping)
  ------------------
  |  Branch (94:8): [True: 891, False: 0]
  ------------------
   95|    891|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    891|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   96|      0|    UA_String tmp = uri; 
   97|      0|    status res = UA_String_unescape(&uri, true, UA_ESCAPING_PERCENT);
   98|      0|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (98:8): [True: 0, False: 0]
  ------------------
   99|      0|        return res;
  100|      0|    res = UA_NamespaceMapping_uri2Index(nsMapping, uri, nsIndex);
  101|      0|    if(tmp.data != uri.data)
  ------------------
  |  Branch (101:8): [True: 0, False: 0]
  ------------------
  102|      0|        UA_String_clear(&uri);
  103|      0|    return res;
  104|      0|}
ua_types_lex.c:parse_nodeid_body:
  107|  23.5k|parse_nodeid_body(UA_NodeId *id, const u8 *body, const u8 *end, UA_Escaping esc) {
  108|  23.5k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  23.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  109|  23.5k|    UA_String str = {(size_t)(end - (body+2)), (UA_Byte*)(uintptr_t)body + 2};
  110|  23.5k|    switch(*body) {
  111|  1.92k|    case 'i':
  ------------------
  |  Branch (111:5): [True: 1.92k, False: 21.5k]
  ------------------
  112|  1.92k|        id->identifierType = UA_NODEIDTYPE_NUMERIC;
  113|  1.92k|        if(UA_readNumber(str.data, str.length, &id->identifier.numeric) != str.length)
  ------------------
  |  Branch (113:12): [True: 39, False: 1.88k]
  ------------------
  114|     39|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     39|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  115|  1.92k|        break;
  116|  13.5k|    case 's':
  ------------------
  |  Branch (116:5): [True: 13.5k, False: 9.99k]
  ------------------
  117|  13.5k|        id->identifierType = UA_NODEIDTYPE_STRING;
  118|  13.5k|        res |= UA_String_copy(&str, &id->identifier.string);
  119|  13.5k|        res |= UA_String_unescape(&id->identifier.string, false, esc);
  120|  13.5k|        break;
  121|      4|    case 'g':
  ------------------
  |  Branch (121:5): [True: 4, False: 23.5k]
  ------------------
  122|      4|        id->identifierType = UA_NODEIDTYPE_GUID;
  123|      4|        res = parse_guid(&id->identifier.guid, str.data, end);
  124|      4|        break;
  125|  8.06k|    case 'b':
  ------------------
  |  Branch (125:5): [True: 8.06k, False: 15.4k]
  ------------------
  126|       |        /* For percent-escaping, base64url bytestring encoding is used. That
  127|       |         * doesn't need to be escaped here. The and-escaping is not applied to
  128|       |         * the NodeId identifier part. */
  129|  8.06k|        id->identifierType = UA_NODEIDTYPE_BYTESTRING;
  130|  8.06k|        id->identifier.byteString.data =
  131|  8.06k|            UA_unbase64(str.data, str.length, &id->identifier.byteString.length);
  132|  8.06k|        if(!id->identifier.byteString.data && str.length > 0)
  ------------------
  |  Branch (132:12): [True: 27, False: 8.03k]
  |  Branch (132:47): [True: 27, False: 0]
  ------------------
  133|     27|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     27|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  134|  8.06k|        break;
  135|      0|    default:
  ------------------
  |  Branch (135:5): [True: 0, False: 23.5k]
  ------------------
  136|      0|        res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  137|      0|        break;
  138|  23.5k|    }
  139|  23.5k|    return res;
  140|  23.5k|}
ua_types_lex.c:parse_expandednodeid:
  335|  18.5k|                     size_t serverUrisSize, const UA_String *serverUris) {
  336|  18.5k|    *id = UA_EXPANDEDNODEID_NULL; /* Reset the NodeId */
  337|  18.5k|    LexContext context;
  338|  18.5k|    memset(&context, 0, sizeof(LexContext));
  339|  18.5k|    const u8 *svr = NULL, *sve = NULL, *svu = NULL,
  340|  18.5k|        *nsu = NULL, *ns = NULL, *body = NULL, *begin = pos;
  341|       |
  342|       |    
  343|  18.5k|{
  344|  18.5k|	u8 yych;
  345|  18.5k|	yych = YYPEEK();
  ------------------
  |  |   31|  18.5k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  18.5k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  18.5k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 18.5k, False: 1]
  |  |  ------------------
  ------------------
  346|  18.5k|	switch (yych) {
  347|  6.82k|		case 'b':
  ------------------
  |  Branch (347:3): [True: 6.82k, False: 11.6k]
  ------------------
  348|  6.82k|		case 'g':
  ------------------
  |  Branch (348:3): [True: 0, False: 18.5k]
  ------------------
  349|  7.59k|		case 'i':
  ------------------
  |  Branch (349:3): [True: 771, False: 17.7k]
  ------------------
  350|  7.59k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|  7.59k|#define YYSTAGN(t) t = NULL
  ------------------
  351|  7.59k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   37|  7.59k|#define YYSTAGN(t) t = NULL
  ------------------
  352|  7.59k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   37|  7.59k|#define YYSTAGN(t) t = NULL
  ------------------
  353|  7.59k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   37|  7.59k|#define YYSTAGN(t) t = NULL
  ------------------
  354|  7.59k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   37|  7.59k|#define YYSTAGN(t) t = NULL
  ------------------
  355|  7.59k|			goto yy18;
  356|    855|		case 'n':
  ------------------
  |  Branch (356:3): [True: 855, False: 17.6k]
  ------------------
  357|    855|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|    855|#define YYSTAGN(t) t = NULL
  ------------------
  358|    855|			YYSTAGN(context.yyt2);
  ------------------
  |  |   37|    855|#define YYSTAGN(t) t = NULL
  ------------------
  359|    855|			YYSTAGN(context.yyt5);
  ------------------
  |  |   37|    855|#define YYSTAGN(t) t = NULL
  ------------------
  360|    855|			goto yy19;
  361|  10.0k|		case 's':
  ------------------
  |  Branch (361:3): [True: 10.0k, False: 8.45k]
  ------------------
  362|  10.0k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|  10.0k|#define YYSTAGN(t) t = NULL
  ------------------
  363|  10.0k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   37|  10.0k|#define YYSTAGN(t) t = NULL
  ------------------
  364|  10.0k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   37|  10.0k|#define YYSTAGN(t) t = NULL
  ------------------
  365|  10.0k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   37|  10.0k|#define YYSTAGN(t) t = NULL
  ------------------
  366|  10.0k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   37|  10.0k|#define YYSTAGN(t) t = NULL
  ------------------
  367|  10.0k|			goto yy20;
  368|      2|		default: goto yy16;
  ------------------
  |  Branch (368:3): [True: 2, False: 18.5k]
  ------------------
  369|  18.5k|	}
  370|      2|yy16:
  371|      2|	YYSKIP();
  ------------------
  |  |   33|      2|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|      2|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  372|     79|yy17:
  373|     79|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   43|     79|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  374|  7.59k|yy18:
  375|  7.59k|	YYSKIP();
  ------------------
  |  |   33|  7.59k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  7.59k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  376|  7.59k|	yych = YYPEEK();
  ------------------
  |  |   31|  7.59k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  7.59k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  7.59k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 7.59k, False: 0]
  |  |  ------------------
  ------------------
  377|  7.59k|	switch (yych) {
  378|  7.59k|		case '=': goto yy21;
  ------------------
  |  Branch (378:3): [True: 7.59k, False: 3]
  ------------------
  379|      3|		default: goto yy17;
  ------------------
  |  Branch (379:3): [True: 3, False: 7.59k]
  ------------------
  380|  7.59k|	}
  381|    855|yy19:
  382|    855|	YYSKIP();
  ------------------
  |  |   33|    855|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    855|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  383|    855|	YYBACKUP();
  ------------------
  |  |   34|    855|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   30|    855|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    855|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  384|    855|	yych = YYPEEK();
  ------------------
  |  |   31|    855|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    855|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    855|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 855, False: 0]
  |  |  ------------------
  ------------------
  385|    855|	switch (yych) {
  386|    851|		case 's': goto yy22;
  ------------------
  |  Branch (386:3): [True: 851, False: 4]
  ------------------
  387|      4|		default: goto yy17;
  ------------------
  |  Branch (387:3): [True: 4, False: 851]
  ------------------
  388|    855|	}
  389|  10.0k|yy20:
  390|  10.0k|	YYSKIP();
  ------------------
  |  |   33|  10.0k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  10.0k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  391|  10.0k|	YYBACKUP();
  ------------------
  |  |   34|  10.0k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   30|  10.0k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  10.0k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  392|  10.0k|	yych = YYPEEK();
  ------------------
  |  |   31|  10.0k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  10.0k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  10.0k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 10.0k, False: 0]
  |  |  ------------------
  ------------------
  393|  10.0k|	switch (yych) {
  394|  8.63k|		case '=': goto yy21;
  ------------------
  |  Branch (394:3): [True: 8.63k, False: 1.42k]
  ------------------
  395|  1.42k|		case 'v': goto yy24;
  ------------------
  |  Branch (395:3): [True: 1.42k, False: 8.63k]
  ------------------
  396|      0|		default: goto yy17;
  ------------------
  |  Branch (396:3): [True: 0, False: 10.0k]
  ------------------
  397|  10.0k|	}
  398|  18.4k|yy21:
  399|  18.4k|	YYSKIP();
  ------------------
  |  |   33|  18.4k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  18.4k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  400|  18.4k|	svr = context.yyt5;
  401|  18.4k|	svu = context.yyt1;
  402|  18.4k|	sve = context.yyt2;
  403|  18.4k|	ns = context.yyt3;
  404|  18.4k|	nsu = context.yyt4;
  405|  18.4k|	YYSTAGP(body);
  ------------------
  |  |   36|  18.4k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  18.4k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  406|  18.4k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   38|  18.4k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  407|  18.4k|	{ goto match; }
  408|    851|yy22:
  409|    851|	YYSKIP();
  ------------------
  |  |   33|    851|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    851|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  410|    851|	yych = YYPEEK();
  ------------------
  |  |   31|    851|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    851|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    851|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 851, False: 0]
  |  |  ------------------
  ------------------
  411|    851|	switch (yych) {
  412|    235|		case '=': goto yy25;
  ------------------
  |  Branch (412:3): [True: 235, False: 616]
  ------------------
  413|    616|		case 'u': goto yy26;
  ------------------
  |  Branch (413:3): [True: 616, False: 235]
  ------------------
  414|      0|		default: goto yy23;
  ------------------
  |  Branch (414:3): [True: 0, False: 851]
  ------------------
  415|    851|	}
  416|     70|yy23:
  417|     70|	YYRESTORE();
  ------------------
  |  |   35|     70|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   29|     70|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   30|     70|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  418|     70|	goto yy17;
  419|  1.42k|yy24:
  420|  1.42k|	YYSKIP();
  ------------------
  |  |   33|  1.42k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.42k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  421|  1.42k|	yych = YYPEEK();
  ------------------
  |  |   31|  1.42k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.42k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.42k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.42k, False: 0]
  |  |  ------------------
  ------------------
  422|  1.42k|	switch (yych) {
  423|  1.30k|		case 'r': goto yy27;
  ------------------
  |  Branch (423:3): [True: 1.30k, False: 121]
  ------------------
  424|    121|		case 'u': goto yy28;
  ------------------
  |  Branch (424:3): [True: 121, False: 1.30k]
  ------------------
  425|      0|		default: goto yy23;
  ------------------
  |  Branch (425:3): [True: 0, False: 1.42k]
  ------------------
  426|  1.42k|	}
  427|    235|yy25:
  428|    235|	YYSKIP();
  ------------------
  |  |   33|    235|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    235|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  429|    235|	yych = YYPEEK();
  ------------------
  |  |   31|    235|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    235|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    235|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 235, False: 0]
  |  |  ------------------
  ------------------
  430|    235|	switch (yych) {
  431|     39|		case '0':
  ------------------
  |  Branch (431:3): [True: 39, False: 196]
  ------------------
  432|     85|		case '1':
  ------------------
  |  Branch (432:3): [True: 46, False: 189]
  ------------------
  433|    127|		case '2':
  ------------------
  |  Branch (433:3): [True: 42, False: 193]
  ------------------
  434|    183|		case '3':
  ------------------
  |  Branch (434:3): [True: 56, False: 179]
  ------------------
  435|    193|		case '4':
  ------------------
  |  Branch (435:3): [True: 10, False: 225]
  ------------------
  436|    201|		case '5':
  ------------------
  |  Branch (436:3): [True: 8, False: 227]
  ------------------
  437|    203|		case '6':
  ------------------
  |  Branch (437:3): [True: 2, False: 233]
  ------------------
  438|    230|		case '7':
  ------------------
  |  Branch (438:3): [True: 27, False: 208]
  ------------------
  439|    234|		case '8':
  ------------------
  |  Branch (439:3): [True: 4, False: 231]
  ------------------
  440|    235|		case '9':
  ------------------
  |  Branch (440:3): [True: 1, False: 234]
  ------------------
  441|    235|			YYSTAGP(context.yyt3);
  ------------------
  |  |   36|    235|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    235|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  442|    235|			goto yy29;
  443|      0|		default: goto yy23;
  ------------------
  |  Branch (443:3): [True: 0, False: 235]
  ------------------
  444|    235|	}
  445|    616|yy26:
  446|    616|	YYSKIP();
  ------------------
  |  |   33|    616|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    616|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  447|    616|	yych = YYPEEK();
  ------------------
  |  |   31|    616|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    616|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    616|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 616, False: 0]
  |  |  ------------------
  ------------------
  448|    616|	switch (yych) {
  449|    616|		case '=': goto yy30;
  ------------------
  |  Branch (449:3): [True: 616, False: 0]
  ------------------
  450|      0|		default: goto yy23;
  ------------------
  |  Branch (450:3): [True: 0, False: 616]
  ------------------
  451|    616|	}
  452|  1.30k|yy27:
  453|  1.30k|	YYSKIP();
  ------------------
  |  |   33|  1.30k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.30k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  454|  1.30k|	yych = YYPEEK();
  ------------------
  |  |   31|  1.30k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.30k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.30k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.30k, False: 0]
  |  |  ------------------
  ------------------
  455|  1.30k|	switch (yych) {
  456|  1.30k|		case '=': goto yy31;
  ------------------
  |  Branch (456:3): [True: 1.30k, False: 0]
  ------------------
  457|      0|		default: goto yy23;
  ------------------
  |  Branch (457:3): [True: 0, False: 1.30k]
  ------------------
  458|  1.30k|	}
  459|    121|yy28:
  460|    121|	YYSKIP();
  ------------------
  |  |   33|    121|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    121|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  461|    121|	yych = YYPEEK();
  ------------------
  |  |   31|    121|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    121|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    121|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 121, False: 0]
  |  |  ------------------
  ------------------
  462|    121|	switch (yych) {
  463|    120|		case '=': goto yy32;
  ------------------
  |  Branch (463:3): [True: 120, False: 1]
  ------------------
  464|      1|		default: goto yy23;
  ------------------
  |  Branch (464:3): [True: 1, False: 120]
  ------------------
  465|    121|	}
  466|   266k|yy29:
  467|   266k|	YYSKIP();
  ------------------
  |  |   33|   266k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|   266k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  468|   266k|	yych = YYPEEK();
  ------------------
  |  |   31|   266k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   266k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   266k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 266k, False: 28]
  |  |  ------------------
  ------------------
  469|   266k|	switch (yych) {
  470|   244k|		case '0':
  ------------------
  |  Branch (470:3): [True: 244k, False: 22.2k]
  ------------------
  471|   247k|		case '1':
  ------------------
  |  Branch (471:3): [True: 3.04k, False: 263k]
  ------------------
  472|   248k|		case '2':
  ------------------
  |  Branch (472:3): [True: 794, False: 265k]
  ------------------
  473|   249k|		case '3':
  ------------------
  |  Branch (473:3): [True: 1.90k, False: 264k]
  ------------------
  474|   251k|		case '4':
  ------------------
  |  Branch (474:3): [True: 1.20k, False: 265k]
  ------------------
  475|   251k|		case '5':
  ------------------
  |  Branch (475:3): [True: 272, False: 266k]
  ------------------
  476|   261k|		case '6':
  ------------------
  |  Branch (476:3): [True: 10.4k, False: 255k]
  ------------------
  477|   262k|		case '7':
  ------------------
  |  Branch (477:3): [True: 546, False: 265k]
  ------------------
  478|   264k|		case '8':
  ------------------
  |  Branch (478:3): [True: 2.51k, False: 263k]
  ------------------
  479|   266k|		case '9': goto yy29;
  ------------------
  |  Branch (479:3): [True: 1.27k, False: 265k]
  ------------------
  480|    204|		case ';':
  ------------------
  |  Branch (480:3): [True: 204, False: 266k]
  ------------------
  481|    204|			YYSTAGN(context.yyt4);
  ------------------
  |  |   37|    204|#define YYSTAGN(t) t = NULL
  ------------------
  482|    204|			goto yy33;
  483|     31|		default: goto yy23;
  ------------------
  |  Branch (483:3): [True: 31, False: 266k]
  ------------------
  484|   266k|	}
  485|    616|yy30:
  486|    616|	YYSKIP();
  ------------------
  |  |   33|    616|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    616|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  487|    616|	yych = YYPEEK();
  ------------------
  |  |   31|    616|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    616|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    616|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 616, False: 0]
  |  |  ------------------
  ------------------
  488|    616|	switch (yych) {
  489|      0|		case 0x00: goto yy23;
  ------------------
  |  Branch (489:3): [True: 0, False: 616]
  ------------------
  490|      0|		case ';':
  ------------------
  |  Branch (490:3): [True: 0, False: 616]
  ------------------
  491|      0|			YYSTAGN(context.yyt3);
  ------------------
  |  |   37|      0|#define YYSTAGN(t) t = NULL
  ------------------
  492|      0|			YYSTAGP(context.yyt4);
  ------------------
  |  |   36|      0|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  493|      0|			goto yy33;
  494|    616|		default:
  ------------------
  |  Branch (494:3): [True: 616, False: 0]
  ------------------
  495|    616|			YYSTAGP(context.yyt4);
  ------------------
  |  |   36|    616|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    616|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  496|    616|			goto yy34;
  497|    616|	}
  498|  1.30k|yy31:
  499|  1.30k|	YYSKIP();
  ------------------
  |  |   33|  1.30k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.30k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  500|  1.30k|	yych = YYPEEK();
  ------------------
  |  |   31|  1.30k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.30k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.30k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.30k, False: 0]
  |  |  ------------------
  ------------------
  501|  1.30k|	switch (yych) {
  502|     53|		case '0':
  ------------------
  |  Branch (502:3): [True: 53, False: 1.25k]
  ------------------
  503|    322|		case '1':
  ------------------
  |  Branch (503:3): [True: 269, False: 1.03k]
  ------------------
  504|    354|		case '2':
  ------------------
  |  Branch (504:3): [True: 32, False: 1.27k]
  ------------------
  505|    590|		case '3':
  ------------------
  |  Branch (505:3): [True: 236, False: 1.06k]
  ------------------
  506|  1.02k|		case '4':
  ------------------
  |  Branch (506:3): [True: 436, False: 868]
  ------------------
  507|  1.04k|		case '5':
  ------------------
  |  Branch (507:3): [True: 23, False: 1.28k]
  ------------------
  508|  1.05k|		case '6':
  ------------------
  |  Branch (508:3): [True: 9, False: 1.29k]
  ------------------
  509|  1.23k|		case '7':
  ------------------
  |  Branch (509:3): [True: 180, False: 1.12k]
  ------------------
  510|  1.29k|		case '8':
  ------------------
  |  Branch (510:3): [True: 61, False: 1.24k]
  ------------------
  511|  1.30k|		case '9':
  ------------------
  |  Branch (511:3): [True: 4, False: 1.30k]
  ------------------
  512|  1.30k|			YYSTAGP(context.yyt5);
  ------------------
  |  |   36|  1.30k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  1.30k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  513|  1.30k|			goto yy35;
  514|      1|		default: goto yy23;
  ------------------
  |  Branch (514:3): [True: 1, False: 1.30k]
  ------------------
  515|  1.30k|	}
  516|    120|yy32:
  517|    120|	YYSKIP();
  ------------------
  |  |   33|    120|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    120|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  518|    120|	yych = YYPEEK();
  ------------------
  |  |   31|    120|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    120|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    120|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 120, False: 0]
  |  |  ------------------
  ------------------
  519|    120|	switch (yych) {
  520|      0|		case 0x00: goto yy23;
  ------------------
  |  Branch (520:3): [True: 0, False: 120]
  ------------------
  521|      0|		case ';':
  ------------------
  |  Branch (521:3): [True: 0, False: 120]
  ------------------
  522|      0|			YYSTAGP(context.yyt1);
  ------------------
  |  |   36|      0|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  523|      0|			YYSTAGP(context.yyt2);
  ------------------
  |  |   36|      0|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  524|      0|			YYSTAGN(context.yyt5);
  ------------------
  |  |   37|      0|#define YYSTAGN(t) t = NULL
  ------------------
  525|      0|			goto yy37;
  526|    120|		default:
  ------------------
  |  Branch (526:3): [True: 120, False: 0]
  ------------------
  527|    120|			YYSTAGP(context.yyt1);
  ------------------
  |  |   36|    120|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    120|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  528|    120|			goto yy36;
  529|    120|	}
  530|    820|yy33:
  531|    820|	YYSKIP();
  ------------------
  |  |   33|    820|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    820|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  532|    820|	yych = YYPEEK();
  ------------------
  |  |   31|    820|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    820|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    820|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 820, False: 0]
  |  |  ------------------
  ------------------
  533|    820|	switch (yych) {
  534|     75|		case 'b':
  ------------------
  |  Branch (534:3): [True: 75, False: 745]
  ------------------
  535|     75|		case 'g':
  ------------------
  |  Branch (535:3): [True: 0, False: 820]
  ------------------
  536|    202|		case 'i':
  ------------------
  |  Branch (536:3): [True: 127, False: 693]
  ------------------
  537|    819|		case 's': goto yy38;
  ------------------
  |  Branch (537:3): [True: 617, False: 203]
  ------------------
  538|      1|		default: goto yy23;
  ------------------
  |  Branch (538:3): [True: 1, False: 819]
  ------------------
  539|    820|	}
  540|  19.2k|yy34:
  541|  19.2k|	YYSKIP();
  ------------------
  |  |   33|  19.2k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  19.2k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  542|  19.2k|	yych = YYPEEK();
  ------------------
  |  |   31|  19.2k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  19.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  19.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 19.2k, False: 0]
  |  |  ------------------
  ------------------
  543|  19.2k|	switch (yych) {
  544|      0|		case 0x00: goto yy23;
  ------------------
  |  Branch (544:3): [True: 0, False: 19.2k]
  ------------------
  545|    616|		case ';':
  ------------------
  |  Branch (545:3): [True: 616, False: 18.6k]
  ------------------
  546|    616|			YYSTAGN(context.yyt3);
  ------------------
  |  |   37|    616|#define YYSTAGN(t) t = NULL
  ------------------
  547|    616|			goto yy33;
  548|  18.6k|		default: goto yy34;
  ------------------
  |  Branch (548:3): [True: 18.6k, False: 616]
  ------------------
  549|  19.2k|	}
  550|  7.29k|yy35:
  551|  7.29k|	YYSKIP();
  ------------------
  |  |   33|  7.29k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  7.29k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  552|  7.29k|	yych = YYPEEK();
  ------------------
  |  |   31|  7.29k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  7.29k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  7.27k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 7.27k, False: 16]
  |  |  ------------------
  ------------------
  553|  7.29k|	switch (yych) {
  554|  2.75k|		case '0':
  ------------------
  |  Branch (554:3): [True: 2.75k, False: 4.53k]
  ------------------
  555|  3.01k|		case '1':
  ------------------
  |  Branch (555:3): [True: 258, False: 7.03k]
  ------------------
  556|  3.27k|		case '2':
  ------------------
  |  Branch (556:3): [True: 264, False: 7.02k]
  ------------------
  557|  3.56k|		case '3':
  ------------------
  |  Branch (557:3): [True: 285, False: 7.00k]
  ------------------
  558|  3.85k|		case '4':
  ------------------
  |  Branch (558:3): [True: 295, False: 6.99k]
  ------------------
  559|  4.13k|		case '5':
  ------------------
  |  Branch (559:3): [True: 274, False: 7.01k]
  ------------------
  560|  4.54k|		case '6':
  ------------------
  |  Branch (560:3): [True: 410, False: 6.88k]
  ------------------
  561|  4.90k|		case '7':
  ------------------
  |  Branch (561:3): [True: 359, False: 6.93k]
  ------------------
  562|  5.15k|		case '8':
  ------------------
  |  Branch (562:3): [True: 256, False: 7.03k]
  ------------------
  563|  5.99k|		case '9': goto yy35;
  ------------------
  |  Branch (563:3): [True: 832, False: 6.46k]
  ------------------
  564|  1.27k|		case ';':
  ------------------
  |  Branch (564:3): [True: 1.27k, False: 6.02k]
  ------------------
  565|  1.27k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|  1.27k|#define YYSTAGN(t) t = NULL
  ------------------
  566|  1.27k|			YYSTAGP(context.yyt2);
  ------------------
  |  |   36|  1.27k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  1.27k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  567|  1.27k|			goto yy37;
  568|     30|		default: goto yy23;
  ------------------
  |  Branch (568:3): [True: 30, False: 7.26k]
  ------------------
  569|  7.29k|	}
  570|  3.57M|yy36:
  571|  3.57M|	YYSKIP();
  ------------------
  |  |   33|  3.57M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  3.57M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  572|  3.57M|	yych = YYPEEK();
  ------------------
  |  |   31|  3.57M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  3.57M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  3.57M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 3.57M, False: 3]
  |  |  ------------------
  ------------------
  573|  3.57M|	switch (yych) {
  574|      3|		case 0x00: goto yy23;
  ------------------
  |  Branch (574:3): [True: 3, False: 3.57M]
  ------------------
  575|    117|		case ';':
  ------------------
  |  Branch (575:3): [True: 117, False: 3.57M]
  ------------------
  576|    117|			YYSTAGP(context.yyt2);
  ------------------
  |  |   36|    117|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    117|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  577|    117|			YYSTAGN(context.yyt5);
  ------------------
  |  |   37|    117|#define YYSTAGN(t) t = NULL
  ------------------
  578|    117|			goto yy37;
  579|  3.57M|		default: goto yy36;
  ------------------
  |  Branch (579:3): [True: 3.57M, False: 120]
  ------------------
  580|  3.57M|	}
  581|  1.39k|yy37:
  582|  1.39k|	YYSKIP();
  ------------------
  |  |   33|  1.39k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.39k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  583|  1.39k|	yych = YYPEEK();
  ------------------
  |  |   31|  1.39k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.39k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.39k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.39k, False: 0]
  |  |  ------------------
  ------------------
  584|  1.39k|	switch (yych) {
  585|      0|		case 'b':
  ------------------
  |  Branch (585:3): [True: 0, False: 1.39k]
  ------------------
  586|      0|		case 'g':
  ------------------
  |  Branch (586:3): [True: 0, False: 1.39k]
  ------------------
  587|      2|		case 'i':
  ------------------
  |  Branch (587:3): [True: 2, False: 1.38k]
  ------------------
  588|  1.38k|		case 's':
  ------------------
  |  Branch (588:3): [True: 1.38k, False: 4]
  ------------------
  589|  1.38k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   37|  1.38k|#define YYSTAGN(t) t = NULL
  ------------------
  590|  1.38k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   37|  1.38k|#define YYSTAGN(t) t = NULL
  ------------------
  591|  1.38k|			goto yy38;
  592|      1|		case 'n': goto yy39;
  ------------------
  |  Branch (592:3): [True: 1, False: 1.38k]
  ------------------
  593|      1|		default: goto yy23;
  ------------------
  |  Branch (593:3): [True: 1, False: 1.38k]
  ------------------
  594|  1.39k|	}
  595|  2.20k|yy38:
  596|  2.20k|	YYSKIP();
  ------------------
  |  |   33|  2.20k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  2.20k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  597|  2.20k|	yych = YYPEEK();
  ------------------
  |  |   31|  2.20k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  2.20k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  2.20k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 2.20k, False: 0]
  |  |  ------------------
  ------------------
  598|  2.20k|	switch (yych) {
  599|  2.20k|		case '=': goto yy21;
  ------------------
  |  Branch (599:3): [True: 2.20k, False: 1]
  ------------------
  600|      1|		default: goto yy23;
  ------------------
  |  Branch (600:3): [True: 1, False: 2.20k]
  ------------------
  601|  2.20k|	}
  602|      1|yy39:
  603|      1|	YYSKIP();
  ------------------
  |  |   33|      1|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|      1|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  604|      1|	yych = YYPEEK();
  ------------------
  |  |   31|      1|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|      1|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|      1|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  605|      1|	switch (yych) {
  606|      0|		case 's': goto yy22;
  ------------------
  |  Branch (606:3): [True: 0, False: 1]
  ------------------
  607|      1|		default: goto yy23;
  ------------------
  |  Branch (607:3): [True: 1, False: 0]
  ------------------
  608|      1|	}
  609|      1|}
  610|       |
  611|       |
  612|  18.4k| match:
  613|  18.4k|    if(svu) {
  ------------------
  |  Branch (613:8): [True: 116, False: 18.3k]
  ------------------
  614|       |        /* ServerUri */
  615|    116|        UA_String serverUri = {(size_t)(sve - svu), (UA_Byte*)(uintptr_t)svu};
  616|    116|        size_t i = 0;
  617|    116|        for(; i < serverUrisSize; i++) {
  ------------------
  |  Branch (617:15): [True: 0, False: 116]
  ------------------
  618|      0|            if(UA_String_equal(&serverUri, &serverUris[i]))
  ------------------
  |  Branch (618:16): [True: 0, False: 0]
  ------------------
  619|      0|                break;
  620|      0|        }
  621|    116|        if(i == serverUrisSize) {
  ------------------
  |  Branch (621:12): [True: 116, False: 0]
  ------------------
  622|       |            /* The ServerUri cannot be mapped. Return the entire input as a
  623|       |             * string NodeId. */
  624|    116|            UA_String total = {(size_t)(end - begin), (UA_Byte*)(uintptr_t)begin};
  625|    116|            id->nodeId.identifierType = UA_NODEIDTYPE_STRING;
  626|    116|            return UA_String_copy(&total, &id->nodeId.identifier.string);
  627|    116|        }
  628|      0|        id->serverIndex = (UA_UInt32)i;
  629|  18.3k|    } else if(svr) {
  ------------------
  |  Branch (629:15): [True: 1.27k, False: 17.0k]
  ------------------
  630|       |        /* ServerIndex */
  631|  1.27k|        size_t len = (size_t)(sve - svr);
  632|  1.27k|        if(UA_readNumber((const UA_Byte*)svr, len, &id->serverIndex) != len)
  ------------------
  |  Branch (632:12): [True: 0, False: 1.27k]
  ------------------
  633|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  634|  1.27k|    }
  635|       |
  636|  18.3k|    if(nsu) {
  ------------------
  |  Branch (636:8): [True: 614, False: 17.7k]
  ------------------
  637|       |        /* NamespaceUri */
  638|    614|        UA_String nsuri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  639|    614|        UA_StatusCode res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    614|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  640|       |        /* Try to map the NamespaceUri to its NamespaceIndex for ServerIndex == 0.
  641|       |         * If this fails, keep the full NamespaceUri. */
  642|    614|        if(id->serverIndex == 0)
  ------------------
  |  Branch (642:12): [True: 614, False: 0]
  ------------------
  643|    614|            res = escapedUri2Index(nsuri, &id->nodeId.namespaceIndex, nsMapping);
  644|    614|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    614|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (644:12): [True: 614, False: 0]
  ------------------
  645|    614|            res = UA_String_copy(&nsuri, &id->namespaceUri); /* Keep the Uri without mapping */
  646|    614|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    614|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (646:12): [True: 0, False: 614]
  ------------------
  647|      0|            return res;
  648|  17.7k|    } else if(ns) {
  ------------------
  |  Branch (648:15): [True: 204, False: 17.4k]
  ------------------
  649|       |        /* NamespaceIndex */
  650|    204|        UA_UInt32 tmp;
  651|    204|        size_t len = (size_t)(body - 1 - ns);
  652|    204|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (652:12): [True: 0, False: 204]
  ------------------
  653|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  654|    204|        id->nodeId.namespaceIndex = (UA_UInt16)tmp;
  655|    204|        if(nsMapping)
  ------------------
  |  Branch (655:12): [True: 0, False: 204]
  ------------------
  656|      0|            id->nodeId.namespaceIndex =
  657|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->nodeId.namespaceIndex);
  658|    204|    }
  659|       |
  660|       |    /* From the current position until the end */
  661|  18.3k|    return parse_nodeid_body(&id->nodeId, body, end, idEsc);
  662|  18.3k|}
ua_types_lex.c:parse_qn:
  699|  64.2k|         UA_UInt16 defaultNamespaceIndex) {
  700|  64.2k|    size_t len;
  701|  64.2k|    UA_UInt32 tmp;
  702|  64.2k|    UA_String str;
  703|  64.2k|    UA_StatusCode res;
  704|       |
  705|  64.2k|    LexContext context;
  706|  64.2k|    memset(&context, 0, sizeof(LexContext));
  707|       |
  708|  64.2k|    const u8 *begin = pos;
  709|  64.2k|    UA_QualifiedName_init(qn);
  710|  64.2k|    qn->namespaceIndex = defaultNamespaceIndex;
  711|       |
  712|       |    
  713|  64.2k|{
  714|  64.2k|	u8 yych;
  715|  64.2k|	yych = YYPEEK();
  ------------------
  |  |   31|  64.2k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  64.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  57.5k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 57.5k, False: 6.64k]
  |  |  ------------------
  ------------------
  716|  64.2k|	switch (yych) {
  717|  6.64k|		case 0x00:
  ------------------
  |  Branch (717:3): [True: 6.64k, False: 57.5k]
  ------------------
  718|  6.86k|		case ';': goto yy41;
  ------------------
  |  Branch (718:3): [True: 223, False: 64.0k]
  ------------------
  719|  18.3k|		case '0':
  ------------------
  |  Branch (719:3): [True: 18.3k, False: 45.8k]
  ------------------
  720|  20.2k|		case '1':
  ------------------
  |  Branch (720:3): [True: 1.88k, False: 62.3k]
  ------------------
  721|  21.0k|		case '2':
  ------------------
  |  Branch (721:3): [True: 735, False: 63.4k]
  ------------------
  722|  22.1k|		case '3':
  ------------------
  |  Branch (722:3): [True: 1.19k, False: 63.0k]
  ------------------
  723|  27.8k|		case '4':
  ------------------
  |  Branch (723:3): [True: 5.65k, False: 58.5k]
  ------------------
  724|  28.3k|		case '5':
  ------------------
  |  Branch (724:3): [True: 520, False: 63.7k]
  ------------------
  725|  30.5k|		case '6':
  ------------------
  |  Branch (725:3): [True: 2.19k, False: 62.0k]
  ------------------
  726|  31.8k|		case '7':
  ------------------
  |  Branch (726:3): [True: 1.29k, False: 62.9k]
  ------------------
  727|  33.0k|		case '8':
  ------------------
  |  Branch (727:3): [True: 1.21k, False: 63.0k]
  ------------------
  728|  33.4k|		case '9': goto yy44;
  ------------------
  |  Branch (728:3): [True: 354, False: 63.8k]
  ------------------
  729|  23.9k|		default: goto yy43;
  ------------------
  |  Branch (729:3): [True: 23.9k, False: 40.2k]
  ------------------
  730|  64.2k|	}
  731|  6.86k|yy41:
  732|  6.86k|	YYSKIP();
  ------------------
  |  |   33|  6.86k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  6.86k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  733|  63.1k|yy42:
  734|  63.1k|	{ pos = begin; goto match_name; }
  735|  23.9k|yy43:
  736|  23.9k|	YYSKIP();
  ------------------
  |  |   33|  23.9k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  23.9k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  737|  23.9k|	YYBACKUP();
  ------------------
  |  |   34|  23.9k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   30|  23.9k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  23.9k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  738|  23.9k|	yych = YYPEEK();
  ------------------
  |  |   31|  23.9k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  23.9k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  14.5k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 14.5k, False: 9.39k]
  |  |  ------------------
  ------------------
  739|  23.9k|	if (yych <= 0x00) goto yy42;
  ------------------
  |  Branch (739:6): [True: 9.39k, False: 14.5k]
  ------------------
  740|  14.5k|	goto yy46;
  741|  33.4k|yy44:
  742|  33.4k|	YYSKIP();
  ------------------
  |  |   33|  33.4k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  33.4k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  743|  33.4k|	YYBACKUP();
  ------------------
  |  |   34|  33.4k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   30|  33.4k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  33.4k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  744|  33.4k|	yych = YYPEEK();
  ------------------
  |  |   31|  33.4k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  33.4k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  20.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 20.2k, False: 13.1k]
  |  |  ------------------
  ------------------
  745|  33.4k|	switch (yych) {
  746|  5.19k|		case '0':
  ------------------
  |  Branch (746:3): [True: 5.19k, False: 28.2k]
  ------------------
  747|  5.47k|		case '1':
  ------------------
  |  Branch (747:3): [True: 276, False: 33.1k]
  ------------------
  748|  6.02k|		case '2':
  ------------------
  |  Branch (748:3): [True: 551, False: 32.8k]
  ------------------
  749|  6.36k|		case '3':
  ------------------
  |  Branch (749:3): [True: 344, False: 33.0k]
  ------------------
  750|  10.9k|		case '4':
  ------------------
  |  Branch (750:3): [True: 4.60k, False: 28.8k]
  ------------------
  751|  11.9k|		case '5':
  ------------------
  |  Branch (751:3): [True: 967, False: 32.4k]
  ------------------
  752|  12.1k|		case '6':
  ------------------
  |  Branch (752:3): [True: 218, False: 33.2k]
  ------------------
  753|  13.0k|		case '7':
  ------------------
  |  Branch (753:3): [True: 922, False: 32.4k]
  ------------------
  754|  13.1k|		case '8':
  ------------------
  |  Branch (754:3): [True: 52, False: 33.3k]
  ------------------
  755|  13.3k|		case '9':
  ------------------
  |  Branch (755:3): [True: 182, False: 33.2k]
  ------------------
  756|  13.9k|		case ':': goto yy50;
  ------------------
  |  Branch (756:3): [True: 680, False: 32.7k]
  ------------------
  757|  19.4k|		default: goto yy42;
  ------------------
  |  Branch (757:3): [True: 19.4k, False: 13.9k]
  ------------------
  758|  33.4k|	}
  759|  6.56M|yy45:
  760|  6.56M|	YYSKIP();
  ------------------
  |  |   33|  6.56M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  6.56M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  761|  6.56M|	yych = YYPEEK();
  ------------------
  |  |   31|  6.56M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  6.56M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  6.55M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 6.55M, False: 14.3k]
  |  |  ------------------
  ------------------
  762|  6.58M|yy46:
  763|  6.58M|	switch (yych) {
  764|  14.3k|		case 0x00: goto yy47;
  ------------------
  |  Branch (764:3): [True: 14.3k, False: 6.56M]
  ------------------
  765|    197|		case ';': goto yy48;
  ------------------
  |  Branch (765:3): [True: 197, False: 6.58M]
  ------------------
  766|  6.56M|		default: goto yy45;
  ------------------
  |  Branch (766:3): [True: 6.56M, False: 14.5k]
  ------------------
  767|  6.58M|	}
  768|  27.4k|yy47:
  769|  27.4k|	YYRESTORE();
  ------------------
  |  |   35|  27.4k|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   29|  27.4k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   30|  27.4k|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  770|  27.4k|	goto yy42;
  771|    197|yy48:
  772|    197|	YYSKIP();
  ------------------
  |  |   33|    197|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    197|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  773|    197|	{ goto match_uri; }
  774|   153k|yy49:
  775|   153k|	YYSKIP();
  ------------------
  |  |   33|   153k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|   153k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  776|   153k|	yych = YYPEEK();
  ------------------
  |  |   31|   153k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   153k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   152k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 152k, False: 1.18k]
  |  |  ------------------
  ------------------
  777|   167k|yy50:
  778|   167k|	switch (yych) {
  779|  55.0k|		case '0':
  ------------------
  |  Branch (779:3): [True: 55.0k, False: 112k]
  ------------------
  780|  60.3k|		case '1':
  ------------------
  |  Branch (780:3): [True: 5.33k, False: 162k]
  ------------------
  781|  76.2k|		case '2':
  ------------------
  |  Branch (781:3): [True: 15.8k, False: 151k]
  ------------------
  782|  82.4k|		case '3':
  ------------------
  |  Branch (782:3): [True: 6.20k, False: 161k]
  ------------------
  783|   103k|		case '4':
  ------------------
  |  Branch (783:3): [True: 20.9k, False: 146k]
  ------------------
  784|   111k|		case '5':
  ------------------
  |  Branch (784:3): [True: 8.47k, False: 159k]
  ------------------
  785|   127k|		case '6':
  ------------------
  |  Branch (785:3): [True: 15.8k, False: 151k]
  ------------------
  786|   133k|		case '7':
  ------------------
  |  Branch (786:3): [True: 5.42k, False: 162k]
  ------------------
  787|   137k|		case '8':
  ------------------
  |  Branch (787:3): [True: 4.69k, False: 163k]
  ------------------
  788|   153k|		case '9': goto yy49;
  ------------------
  |  Branch (788:3): [True: 15.9k, False: 151k]
  ------------------
  789|    881|		case ':': goto yy51;
  ------------------
  |  Branch (789:3): [True: 881, False: 166k]
  ------------------
  790|  13.1k|		default: goto yy47;
  ------------------
  |  Branch (790:3): [True: 13.1k, False: 154k]
  ------------------
  791|   167k|	}
  792|    881|yy51:
  793|    881|	YYSKIP();
  ------------------
  |  |   33|    881|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    881|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  794|    881|	{ goto match_index; }
  795|   167k|}
  796|       |
  797|       |
  798|    881| match_index:
  799|    881|    len = (size_t)(pos - 1 - begin);
  800|    881|    if(UA_readNumber((const UA_Byte*)begin, len, &tmp) != len)
  ------------------
  |  Branch (800:8): [True: 0, False: 881]
  ------------------
  801|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  802|    881|    qn->namespaceIndex = (UA_UInt16)tmp;
  803|    881|    goto match_name;
  804|       |
  805|    197| match_uri:
  806|    197|    str.length = (size_t)(pos - 1 - begin);
  807|    197|    str.data = (UA_Byte*)(uintptr_t)begin;
  808|    197|    res = escapedUri2Index(str, &qn->namespaceIndex, nsMapping);
  809|    197|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    197|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (809:8): [True: 197, False: 0]
  ------------------
  810|    197|        pos = begin; /* Use the entire string for the name */
  811|       |
  812|  64.2k| match_name:
  813|  64.2k|    str.length = (size_t)(end - pos);
  814|  64.2k|    str.data = (UA_Byte*)(uintptr_t)pos;
  815|  64.2k|    res = UA_String_copy(&str, &qn->name);
  816|  64.2k|    if(UA_LIKELY(res == UA_STATUSCODE_GOOD))
  ------------------
  |  |  576|  64.2k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (576:23): [True: 64.2k, False: 0]
  |  |  ------------------
  ------------------
  817|  64.2k|        res = UA_String_unescape(&qn->name, false, escName);
  818|  64.2k|    return res;
  819|    197|}

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

ua_util.c:isReservedPercent:
   95|  14.8M|isReservedPercent(u8 c) {
   96|  14.8M|    return (c == ';'  || c == '%' || c <= ' ' || c == 127);
  ------------------
  |  Branch (96:13): [True: 2.63k, False: 14.8M]
  |  Branch (96:26): [True: 22.0k, False: 14.8M]
  |  Branch (96:38): [True: 112k, False: 14.7M]
  |  Branch (96:50): [True: 513, False: 14.7M]
  ------------------
   97|  14.8M|}
ua_util.c:isReservedPercentExtended:
  100|  14.8M|isReservedPercentExtended(u8 c) {
  101|  14.8M|    return (isReservedPercent(c) || c == ':' || c == '#' || c == '[' || c == ']' ||
  ------------------
  |  Branch (101:13): [True: 137k, False: 14.6M]
  |  Branch (101:37): [True: 8.05k, False: 14.6M]
  |  Branch (101:49): [True: 6.68k, False: 14.6M]
  |  Branch (101:61): [True: 5.74k, False: 14.6M]
  |  Branch (101:73): [True: 3.45k, False: 14.6M]
  ------------------
  102|  14.6M|            c == '&' || c == '(' || c == ')' || c == ',' || c == '<' || c == '>' ||
  ------------------
  |  Branch (102:13): [True: 4.17k, False: 14.6M]
  |  Branch (102:25): [True: 92.0k, False: 14.5M]
  |  Branch (102:37): [True: 7.72k, False: 14.5M]
  |  Branch (102:49): [True: 4.18M, False: 10.3M]
  |  Branch (102:61): [True: 4.44k, False: 10.3M]
  |  Branch (102:73): [True: 7.29k, False: 10.3M]
  ------------------
  103|  10.3M|            c == '`' || c == '/' || c == '\\' || c == '"' || c == '\'' );
  ------------------
  |  Branch (103:13): [True: 6.33k, False: 10.3M]
  |  Branch (103:25): [True: 33.9k, False: 10.3M]
  |  Branch (103:37): [True: 3.87k, False: 10.3M]
  |  Branch (103:50): [True: 131k, False: 10.1M]
  |  Branch (103:62): [True: 9, False: 10.1M]
  ------------------
  104|  14.8M|}
ua_types_encoding_json.c:isTrue:
  167|   104k|isTrue(uint8_t expr) {
  168|   104k|    return expr;
  169|   104k|}

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

fuzz_json_decode_encode.cc:_ZL15UA_Variant_initP10UA_Variant:
  241|  5.12k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_json_decode_encode.cc:_ZL16UA_Variant_clearP10UA_Variant:
  241|  4.01k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_json_decode_encode.cc:_ZL19UA_ByteString_clearP9UA_String:
  241|  4.01k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_String_clear:
  241|  5.82k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_ByteString_init:
  241|   108k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_String_copy:
  241|  78.5k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_NodeId_clear:
  241|    107|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_ExpandedNodeId_clear:
  241|    104|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_QualifiedName_init:
  241|  64.2k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_clear:
  241|   198k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_init:
  241|    106|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_init:
  241|  88.1k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_init:
  241|    396|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_clear:
  241|     62|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_new:
  241|    392|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_clear:
  241|    106|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl

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

