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

cj5_parse:
  305|  5.82k|          cj5_options *options) {
  306|  5.82k|    cj5_result r;
  307|  5.82k|    cj5__parser parser;
  308|  5.82k|    memset(&parser, 0x0, sizeof(parser));
  309|  5.82k|    parser.curr_tok_idx = 0;
  310|  5.82k|    parser.json5 = json5;
  311|  5.82k|    parser.len = len;
  312|  5.82k|    parser.tokens = tokens;
  313|  5.82k|    parser.max_tokens = max_tokens;
  314|       |
  315|  5.82k|    if(options)
  ------------------
  |  Branch (315:8): [True: 5.82k, False: 0]
  ------------------
  316|  5.82k|        parser.stop_early = options->stop_early;
  317|       |
  318|  5.82k|    unsigned short depth = 0; // Nesting depth zero means "outside the root object"
  319|  5.82k|    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.82k|    char next[CJ5_MAX_NESTING];    // Next content to parse: 'k' (key), ':', 'v'
  323|       |                                   // (value) or ',' (comma).
  324|  5.82k|    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.82k|    nesting[0] = 0; // Becomes '{' if there is a virtual root object
  329|       |
  330|  5.82k|    cj5_token *token = NULL; // The current token
  331|       |
  332|  6.83k| start_parsing:
  333|  90.9M|    for(; parser.pos < len; parser.pos++) {
  ------------------
  |  Branch (333:11): [True: 90.9M, False: 5.73k]
  ------------------
  334|  90.9M|        char c = json5[parser.pos];
  335|  90.9M|        switch(c) {
  336|  59.2k|        case '\n': // Skip newline and whitespace
  ------------------
  |  Branch (336:9): [True: 59.2k, False: 90.8M]
  ------------------
  337|  59.5k|        case '\r':
  ------------------
  |  Branch (337:9): [True: 371, False: 90.9M]
  ------------------
  338|  59.7k|        case '\t':
  ------------------
  |  Branch (338:9): [True: 159, False: 90.9M]
  ------------------
  339|  60.3k|        case ' ':
  ------------------
  |  Branch (339:9): [True: 577, False: 90.9M]
  ------------------
  340|  60.3k|            break;
  341|       |
  342|    150|        case '#': // Skip comment
  ------------------
  |  Branch (342:9): [True: 150, False: 90.9M]
  ------------------
  343|  26.4k|        case '/':
  ------------------
  |  Branch (343:9): [True: 26.3k, False: 90.9M]
  ------------------
  344|  26.4k|            cj5__skip_comment(&parser);
  345|  26.4k|            if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (345:16): [True: 23.2k, False: 3.18k]
  ------------------
  346|  23.2k|               parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (346:16): [True: 38, False: 23.2k]
  ------------------
  347|     38|                goto finish;
  348|  26.4k|            break;
  349|       |
  350|  4.18M|        case '{': // Open an object or array
  ------------------
  |  Branch (350:9): [True: 4.18M, False: 86.7M]
  ------------------
  351|  4.23M|        case '[':
  ------------------
  |  Branch (351:9): [True: 49.7k, False: 90.8M]
  ------------------
  352|       |            // Check the nesting depth
  353|  4.23M|            if(depth + 1 >= CJ5_MAX_NESTING) {
  ------------------
  |  |   52|  4.23M|#define CJ5_MAX_NESTING 32
  ------------------
  |  Branch (353:16): [True: 1, False: 4.23M]
  ------------------
  354|      1|                parser.error = CJ5_ERROR_INVALID;
  355|      1|                goto finish;
  356|      1|            }
  357|       |
  358|       |            // Correct next?
  359|  4.23M|            if(next[depth] != 'v') {
  ------------------
  |  Branch (359:16): [True: 10, False: 4.23M]
  ------------------
  360|     10|                parser.error = CJ5_ERROR_INVALID;
  361|     10|                goto finish;
  362|     10|            }
  363|       |
  364|  4.23M|            depth++; // Increase the nesting depth
  365|  4.23M|            nesting[depth] = c; // Set the nesting type
  366|  4.23M|            next[depth] = (c == '{') ? 'k' : 'v'; // next is either a key or a value
  ------------------
  |  Branch (366:27): [True: 4.18M, False: 49.7k]
  ------------------
  367|       |
  368|       |            // Create a token for the object or array
  369|  4.23M|            token = cj5__alloc_token(&parser);
  370|  4.23M|            if(token) {
  ------------------
  |  Branch (370:16): [True: 2.16M, False: 2.06M]
  ------------------
  371|  2.16M|                token->parent_id = parser.curr_tok_idx;
  372|  2.16M|                token->type = (c == '{') ? CJ5_TOKEN_OBJECT : CJ5_TOKEN_ARRAY;
  ------------------
  |  Branch (372:31): [True: 2.13M, False: 26.3k]
  ------------------
  373|  2.16M|                token->start = parser.pos;
  374|  2.16M|                token->size = 0;
  375|  2.16M|                parser.curr_tok_idx = parser.token_count - 1; // The new curr_tok_idx
  376|       |                                                              // is for this token
  377|  2.16M|            }
  378|  4.23M|            break;
  379|       |
  380|  4.18M|        case '}': // Close an object or array
  ------------------
  |  Branch (380:9): [True: 4.18M, False: 86.7M]
  ------------------
  381|  4.23M|        case ']':
  ------------------
  |  Branch (381:9): [True: 49.5k, False: 90.8M]
  ------------------
  382|       |            // Check the nesting depth. Note that a "virtual root object" at
  383|       |            // depth zero must not be closed.
  384|  4.23M|            if(depth == 0) {
  ------------------
  |  Branch (384:16): [True: 4, False: 4.23M]
  ------------------
  385|      4|                parser.error = CJ5_ERROR_INVALID;
  386|      4|                goto finish;
  387|      4|            }
  388|       |
  389|       |            // Check and adjust the nesting. Note that ']' - '[' == 2 and '}' -
  390|       |            // '{' == 2. Arrays can always be closed. Objects can only close
  391|       |            // when a key or a comma is expected.
  392|  4.23M|            if(c - nesting[depth] != 2 ||
  ------------------
  |  Branch (392:16): [True: 0, False: 4.23M]
  ------------------
  393|  4.23M|               (c == '}' && next[depth] != 'k' && next[depth] != ',')) {
  ------------------
  |  Branch (393:17): [True: 4.18M, False: 49.5k]
  |  Branch (393:29): [True: 1.89M, False: 2.28M]
  |  Branch (393:51): [True: 2, False: 1.89M]
  ------------------
  394|      2|                parser.error = CJ5_ERROR_INVALID;
  395|      2|                goto finish;
  396|      2|            }
  397|       |
  398|  4.23M|            if(token) {
  ------------------
  |  Branch (398:16): [True: 2.16M, False: 2.06M]
  ------------------
  399|       |                // Finalize the current token
  400|  2.16M|                token->end = parser.pos;
  401|       |
  402|       |                // Move to the parent and increase the parent size. Omit this
  403|       |                // when we leave the root (parent the same as the current
  404|       |                // token).
  405|  2.16M|                if(parser.curr_tok_idx != token->parent_id) {
  ------------------
  |  Branch (405:20): [True: 2.15M, False: 4.43k]
  ------------------
  406|  2.15M|                    parser.curr_tok_idx = token->parent_id;
  407|  2.15M|                    token = &tokens[token->parent_id];
  408|  2.15M|                    token->size++;
  409|  2.15M|                }
  410|  2.16M|            }
  411|       |
  412|       |            // Step one level up
  413|  4.23M|            depth--;
  414|  4.23M|            next[depth] = (depth == 0) ? 0 : ','; // zero if we step out the root
  ------------------
  |  Branch (414:27): [True: 4.77k, False: 4.22M]
  ------------------
  415|       |                                                  // object. then we do not look for
  416|       |                                                  // another element.
  417|       |
  418|       |            // The first element was successfully parsed. Stop early or try to
  419|       |            // parse the full input string?
  420|  4.23M|            if(depth == 0 && parser.stop_early)
  ------------------
  |  Branch (420:16): [True: 4.77k, False: 4.22M]
  |  Branch (420:30): [True: 0, False: 4.77k]
  ------------------
  421|      0|                goto finish;
  422|       |
  423|  4.23M|            break;
  424|       |
  425|  4.23M|        case ':': // Colon (between key and value)
  ------------------
  |  Branch (425:9): [True: 3.86M, False: 87.0M]
  ------------------
  426|  3.86M|            if(next[depth] != ':') {
  ------------------
  |  Branch (426:16): [True: 960, False: 3.86M]
  ------------------
  427|    960|                parser.error = CJ5_ERROR_INVALID;
  428|    960|                goto finish;
  429|    960|            }
  430|  3.86M|            next[depth] = 'v';
  431|  3.86M|            break;
  432|       |
  433|  38.4M|        case ',': // Comma
  ------------------
  |  Branch (433:9): [True: 38.4M, False: 52.4M]
  ------------------
  434|  38.4M|            if(next[depth] != ',') {
  ------------------
  |  Branch (434:16): [True: 8, False: 38.4M]
  ------------------
  435|      8|                parser.error = CJ5_ERROR_INVALID;
  436|      8|                goto finish;
  437|      8|            }
  438|  38.4M|            next[depth] = (nesting[depth] == '{') ? 'k' : 'v';
  ------------------
  |  Branch (438:27): [True: 1.96M, False: 36.5M]
  ------------------
  439|  38.4M|            break;
  440|       |
  441|  40.0M|        default: // Value or key
  ------------------
  |  Branch (441:9): [True: 40.0M, False: 50.8M]
  ------------------
  442|  40.0M|            if(next[depth] == 'v') {
  ------------------
  |  Branch (442:16): [True: 36.1M, False: 3.86M]
  ------------------
  443|  36.1M|                cj5__parse_primitive(&parser); // Parse primitive value
  444|  36.1M|                if(nesting[depth] != 0) {
  ------------------
  |  Branch (444:20): [True: 36.1M, False: 1.00k]
  ------------------
  445|       |                    // Parent is object or array
  446|  36.1M|                    if(token)
  ------------------
  |  Branch (446:24): [True: 34.1M, False: 2.04M]
  ------------------
  447|  34.1M|                        token->size++;
  448|  36.1M|                    next[depth] = ',';
  449|  36.1M|                } else {
  450|       |                    // The current value was the root element. Don't look for
  451|       |                    // any next element.
  452|  1.00k|                    next[depth] = 0;
  453|       |
  454|       |                    // The first element was successfully parsed. Stop early or try to
  455|       |                    // parse the full input string?
  456|  1.00k|                    if(parser.stop_early)
  ------------------
  |  Branch (456:24): [True: 0, False: 1.00k]
  ------------------
  457|      0|                        goto finish;
  458|  1.00k|                }
  459|  36.1M|            } else if(next[depth] == 'k') {
  ------------------
  |  Branch (459:23): [True: 3.86M, False: 35]
  ------------------
  460|  3.86M|                cj5__parse_key(&parser);
  461|  3.86M|                if(token)
  ------------------
  |  Branch (461:20): [True: 1.98M, False: 1.88M]
  ------------------
  462|  1.98M|                    token->size++; // Keys count towards the length
  463|  3.86M|                next[depth] = ':';
  464|  3.86M|            } else {
  465|     35|                parser.error = CJ5_ERROR_INVALID;
  466|     35|            }
  467|       |
  468|  40.0M|            if(parser.error && parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (468:16): [True: 20.1M, False: 19.9M]
  |  Branch (468:32): [True: 77, False: 20.1M]
  ------------------
  469|     77|                goto finish;
  470|       |
  471|  40.0M|            break;
  472|  90.9M|        }
  473|  90.9M|    }
  474|       |
  475|       |    // Are we back to the initial nesting depth?
  476|  5.73k|    if(depth != 0) {
  ------------------
  |  Branch (476:8): [True: 27, False: 5.70k]
  ------------------
  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.70k|    if(nesting[0] == '{' && parser.error != CJ5_ERROR_OVERFLOW) {
  ------------------
  |  Branch (482:8): [True: 929, False: 4.78k]
  |  Branch (482:29): [True: 920, False: 9]
  ------------------
  483|       |        // Check the we end after a complete key-value pair (or dangling comma)
  484|    920|        if(next[0] != 'k' && next[0] != ',')
  ------------------
  |  Branch (484:12): [True: 916, False: 4]
  |  Branch (484:30): [True: 16, False: 900]
  ------------------
  485|     16|            parser.error = CJ5_ERROR_INVALID;
  486|    920|        tokens[0].end = parser.pos - 1;
  487|    920|    }
  488|       |
  489|  6.83k| finish:
  490|       |    // If parsing failed at the initial nesting depth, create a virtual root object
  491|       |    // and restart parsing.
  492|  6.83k|    if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (492:8): [True: 1.88k, False: 4.94k]
  ------------------
  493|  1.88k|       parser.error != CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (493:8): [True: 1.14k, False: 744]
  ------------------
  494|  1.14k|       depth == 0 && nesting[0] != '{') {
  ------------------
  |  Branch (494:8): [True: 1.07k, False: 66]
  |  Branch (494:22): [True: 1.00k, False: 69]
  ------------------
  495|  1.00k|        parser.token_count = 0;
  496|  1.00k|        token = cj5__alloc_token(&parser);
  497|  1.00k|        if(token) {
  ------------------
  |  Branch (497:12): [True: 1.00k, False: 0]
  ------------------
  498|  1.00k|            token->parent_id = 0;
  499|  1.00k|            token->type = CJ5_TOKEN_OBJECT;
  500|  1.00k|            token->start = 0;
  501|  1.00k|            token->size = 0;
  502|       |
  503|  1.00k|            nesting[0] = '{';
  504|  1.00k|            next[0] = 'k';
  505|       |
  506|  1.00k|            parser.curr_tok_idx = 0;
  507|  1.00k|            parser.pos = 0;
  508|  1.00k|            parser.error = CJ5_ERROR_NONE;
  509|  1.00k|            goto start_parsing;
  510|  1.00k|        }
  511|  1.00k|    }
  512|       |
  513|  5.82k|    memset(&r, 0x0, sizeof(r));
  514|  5.82k|    r.error = parser.error;
  515|  5.82k|    r.error_pos = parser.pos;
  516|  5.82k|    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.82k|    if(r.num_tokens == 0)
  ------------------
  |  Branch (520:8): [True: 1, False: 5.82k]
  ------------------
  521|      1|        r.error = CJ5_ERROR_INCOMPLETE;
  522|       |
  523|       |    // Set the tokens and original string only if successfully parsed
  524|  5.82k|    if(r.error == CJ5_ERROR_NONE) {
  ------------------
  |  Branch (524:8): [True: 4.94k, False: 880]
  ------------------
  525|  4.94k|        r.tokens = tokens;
  526|  4.94k|        r.json5 = json5;
  527|  4.94k|    }
  528|       |
  529|  5.82k|    return r;
  530|  6.83k|}
cj5_get_str:
  628|  96.1k|            char *buf, unsigned int *buflen) {
  629|  96.1k|    const cj5_token *token = &r->tokens[tok_index];
  630|  96.1k|    if(token->type != CJ5_TOKEN_STRING)
  ------------------
  |  Branch (630:8): [True: 0, False: 96.1k]
  ------------------
  631|      0|        return CJ5_ERROR_INVALID;
  632|       |
  633|  96.1k|    const char *pos = &r->json5[token->start];
  634|  96.1k|    const char *end = &r->json5[token->end + 1];
  635|  96.1k|    unsigned int outpos = 0;
  636|  24.6M|    for(; pos < end; pos++) {
  ------------------
  |  Branch (636:11): [True: 24.5M, False: 96.1k]
  ------------------
  637|  24.5M|        uint8_t c = (uint8_t)*pos;
  638|       |        // Unprintable ascii characters must be escaped
  639|  24.5M|        if(c < ' ' || c == 127)
  ------------------
  |  Branch (639:12): [True: 9, False: 24.5M]
  |  Branch (639:23): [True: 2, False: 24.5M]
  ------------------
  640|     11|            return CJ5_ERROR_INVALID;
  641|       |
  642|       |        // Unescaped Ascii character or utf8 byte
  643|  24.5M|        if(c != '\\') {
  ------------------
  |  Branch (643:12): [True: 21.0M, False: 3.50M]
  ------------------
  644|  21.0M|            buf[outpos++] = (char)c;
  645|  21.0M|            continue;
  646|  21.0M|        }
  647|       |
  648|       |        // End of input before the escaped character
  649|  3.50M|        if(pos + 1 >= end)
  ------------------
  |  Branch (649:12): [True: 0, False: 3.50M]
  ------------------
  650|      0|            return CJ5_ERROR_INCOMPLETE;
  651|       |
  652|       |        // Process escaped character
  653|  3.50M|        pos++;
  654|  3.50M|        c = (uint8_t)*pos;
  655|  3.50M|        switch(c) {
  656|    861|        case 'b': buf[outpos++] = '\b'; break;
  ------------------
  |  Branch (656:9): [True: 861, False: 3.50M]
  ------------------
  657|  4.08k|        case 'f': buf[outpos++] = '\f'; break;
  ------------------
  |  Branch (657:9): [True: 4.08k, False: 3.49M]
  ------------------
  658|    849|        case 'r': buf[outpos++] = '\r'; break;
  ------------------
  |  Branch (658:9): [True: 849, False: 3.50M]
  ------------------
  659|  50.8k|        case 'n': buf[outpos++] = '\n'; break;
  ------------------
  |  Branch (659:9): [True: 50.8k, False: 3.45M]
  ------------------
  660|    819|        case 't': buf[outpos++] = '\t'; break;
  ------------------
  |  Branch (660:9): [True: 819, False: 3.50M]
  ------------------
  661|  2.63M|        default:  buf[outpos++] = (char)c; break;
  ------------------
  |  Branch (661:9): [True: 2.63M, False: 862k]
  ------------------
  662|   805k|        case 'u': {
  ------------------
  |  Branch (662:9): [True: 805k, False: 2.69M]
  ------------------
  663|       |            // Parse a unicode code point
  664|   805k|            if(pos + 4 >= end)
  ------------------
  |  Branch (664:16): [True: 3, False: 805k]
  ------------------
  665|      3|                return CJ5_ERROR_INCOMPLETE;
  666|   805k|            pos++;
  667|   805k|            uint32_t utf;
  668|   805k|            cj5_error_code err = parse_codepoint(pos, &utf);
  669|   805k|            if(err != CJ5_ERROR_NONE)
  ------------------
  |  Branch (669:16): [True: 6, False: 805k]
  ------------------
  670|      6|                return err;
  671|   805k|            pos += 3;
  672|       |
  673|       |            // Parse a surrogate pair
  674|   805k|            if(0xd800 <= utf && utf <= 0xdfff) {
  ------------------
  |  Branch (674:16): [True: 763, False: 804k]
  |  Branch (674:33): [True: 568, False: 195]
  ------------------
  675|    568|                if(pos + 6 >= end)
  ------------------
  |  Branch (675:20): [True: 2, False: 566]
  ------------------
  676|      2|                    return CJ5_ERROR_INVALID;
  677|    566|                if(pos[1] != '\\' && pos[2] != 'u')
  ------------------
  |  Branch (677:20): [True: 251, False: 315]
  |  Branch (677:38): [True: 3, False: 248]
  ------------------
  678|      3|                    return CJ5_ERROR_INVALID;
  679|    563|                pos += 3;
  680|    563|                uint32_t utf2;
  681|    563|                err = parse_codepoint(pos, &utf2);
  682|    563|                if(err != CJ5_ERROR_NONE)
  ------------------
  |  Branch (682:20): [True: 3, False: 560]
  ------------------
  683|      3|                    return err;
  684|    560|                pos += 3;
  685|       |                // High or low surrogate pair
  686|    560|                utf = (utf <= 0xdbff) ?
  ------------------
  |  Branch (686:23): [True: 266, False: 294]
  ------------------
  687|    266|                    (utf << 10) + utf2 + SURROGATE_OFFSET :
  688|    560|                    (utf2 << 10) + utf + SURROGATE_OFFSET;
  689|    560|            }
  690|       |
  691|       |            // Write the utf8 bytes of the code point
  692|   804k|            unsigned len = utf8_from_codepoint((unsigned char*)buf + outpos, utf);
  693|   804k|            if(len == 0)
  ------------------
  |  Branch (693:16): [True: 11, False: 804k]
  ------------------
  694|     11|                return CJ5_ERROR_INVALID; // Not a utf8 string
  695|   804k|            outpos += len;
  696|   804k|            break;
  697|   804k|        }
  698|  3.50M|        }
  699|  3.50M|    }
  700|       |
  701|       |    // Terminate with \0
  702|  96.1k|    buf[outpos] = 0;
  703|       |
  704|       |    // Set the output length
  705|  96.1k|    if(buflen)
  ------------------
  |  Branch (705:8): [True: 96.1k, False: 0]
  ------------------
  706|  96.1k|        *buflen = outpos;
  707|  96.1k|    return CJ5_ERROR_NONE;
  708|  96.1k|}
cj5.c:cj5__skip_comment:
  260|  26.4k|cj5__skip_comment(cj5__parser* parser) {
  261|  26.4k|    const char* json5 = parser->json5;
  262|       |
  263|       |    // Single-line comment
  264|  26.4k|    if(json5[parser->pos] == '#') {
  ------------------
  |  Branch (264:8): [True: 150, False: 26.3k]
  ------------------
  265|  25.9k|    skip_line:
  266|  5.16M|        while(parser->pos < parser->len) {
  ------------------
  |  Branch (266:15): [True: 5.16M, False: 60]
  ------------------
  267|  5.16M|            if(json5[parser->pos] == '\n') {
  ------------------
  |  Branch (267:16): [True: 25.9k, False: 5.14M]
  ------------------
  268|  25.9k|                parser->pos--; // Reparse the newline in the main parse loop
  269|  25.9k|                return;
  270|  25.9k|            }
  271|  5.14M|            parser->pos++;
  272|  5.14M|        }
  273|     60|        return;
  274|  25.9k|    }
  275|       |
  276|       |    // Comment begins with '/' but not enough space for another character
  277|  26.3k|    if(parser->pos + 1 >= parser->len) {
  ------------------
  |  Branch (277:8): [True: 15, False: 26.3k]
  ------------------
  278|     15|        parser->error = CJ5_ERROR_INVALID;
  279|     15|        return;
  280|     15|    }
  281|  26.3k|    parser->pos++;
  282|       |
  283|       |    // Comment begins with '//' -> single-line comment
  284|  26.3k|    if(json5[parser->pos] == '/')
  ------------------
  |  Branch (284:8): [True: 25.8k, False: 473]
  ------------------
  285|  25.8k|        goto skip_line;
  286|       |
  287|       |    // Multi-line comments begin with '/*' and end with '*/'
  288|    473|    if(json5[parser->pos] == '*') {
  ------------------
  |  Branch (288:8): [True: 462, False: 11]
  ------------------
  289|    462|        parser->pos++;
  290|  1.05M|        for(; parser->pos + 1 < parser->len; parser->pos++) {
  ------------------
  |  Branch (290:15): [True: 1.05M, False: 12]
  ------------------
  291|  1.05M|            if(json5[parser->pos] == '*' && json5[parser->pos + 1] == '/') {
  ------------------
  |  Branch (291:16): [True: 740, False: 1.05M]
  |  Branch (291:45): [True: 450, False: 290]
  ------------------
  292|    450|                parser->pos++;
  293|    450|                return;
  294|    450|            }
  295|  1.05M|        }
  296|    462|    }
  297|       |
  298|       |    // Unknown comment type or the multi-line comment is not terminated
  299|     23|    parser->error = CJ5_ERROR_INCOMPLETE;
  300|     23|}
cj5.c:cj5__alloc_token:
   88|  44.2M|cj5__alloc_token(cj5__parser *parser) {
   89|  44.2M|    cj5_token* token = NULL;
   90|  44.2M|    if(parser->token_count < parser->max_tokens) {
  ------------------
  |  Branch (90:8): [True: 22.1M, False: 22.1M]
  ------------------
   91|  22.1M|        token = &parser->tokens[parser->token_count];
   92|  22.1M|        memset(token, 0x0, sizeof(cj5_token));
   93|  22.1M|    } else {
   94|  22.1M|        parser->error = CJ5_ERROR_OVERFLOW;
   95|  22.1M|    }
   96|       |
   97|       |    // Always increase the index. So we know eventually how many token would be
   98|       |    // required (if there are not enough).
   99|  44.2M|    parser->token_count++;
  100|  44.2M|    return token;
  101|  44.2M|}
cj5.c:cj5__parse_primitive:
  152|  36.1M|cj5__parse_primitive(cj5__parser* parser) {
  153|  36.1M|    const char* json5 = parser->json5;
  154|  36.1M|    unsigned int len = parser->len;
  155|  36.1M|    unsigned int start = parser->pos;
  156|       |
  157|       |    // String value
  158|  36.1M|    if(json5[start] == '\"' ||
  ------------------
  |  Branch (158:8): [True: 4.75M, False: 31.4M]
  ------------------
  159|  31.4M|       json5[start] == '\'') {
  ------------------
  |  Branch (159:8): [True: 221k, False: 31.2M]
  ------------------
  160|  4.97M|        cj5__parse_string(parser);
  161|  4.97M|        return;
  162|  4.97M|    }
  163|       |
  164|       |    // Fast comparison of bool, and null.
  165|       |    // Make the comparison case-insensitive.
  166|  31.2M|    uint32_t fourcc = 0;
  167|  31.2M|    if(start + 3 < len) {
  ------------------
  |  Branch (167:8): [True: 31.1M, False: 3.05k]
  ------------------
  168|  31.1M|        fourcc += (unsigned char)json5[start] | 32U;
  169|  31.1M|        fourcc += ((unsigned char)json5[start+1] | 32U) << 8;
  170|  31.1M|        fourcc += ((unsigned char)json5[start+2] | 32U) << 16;
  171|  31.1M|        fourcc += ((unsigned char)json5[start+3] | 32U) << 24;
  172|  31.1M|    }
  173|       |    
  174|  31.2M|    cj5_token_type type;
  175|  31.2M|    if(fourcc == CJ5__NULL_FOURCC) {
  ------------------
  |  Branch (175:8): [True: 3.66M, False: 27.5M]
  ------------------
  176|  3.66M|        type = CJ5_TOKEN_NULL;
  177|  3.66M|        parser->pos += 3;
  178|  27.5M|    } else if(fourcc == CJ5__TRUE_FOURCC) {
  ------------------
  |  Branch (178:15): [True: 527, False: 27.5M]
  ------------------
  179|    527|        type = CJ5_TOKEN_BOOL;
  180|    527|        parser->pos += 3;
  181|  27.5M|    } else if(fourcc == CJ5__FALSE_FOURCC) {
  ------------------
  |  Branch (181:15): [True: 6.03k, False: 27.5M]
  ------------------
  182|       |        // "false" has five characters
  183|  6.03k|        type = CJ5_TOKEN_BOOL;
  184|  6.03k|        if(start + 4 >= len || (json5[start+4] | 32) != 'e') {
  ------------------
  |  Branch (184:12): [True: 0, False: 6.03k]
  |  Branch (184:32): [True: 3, False: 6.03k]
  ------------------
  185|      3|            parser->error = CJ5_ERROR_INVALID;
  186|      3|            return;
  187|      3|        }
  188|  6.03k|        parser->pos += 4;
  189|  27.5M|    } else {
  190|       |        // Numbers are checked for basic compatibility.
  191|       |        // But they are fully parsed only in the cj5_get_XXX functions.
  192|  27.5M|        type = CJ5_TOKEN_NUMBER;
  193|  78.1M|        for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (193:15): [True: 78.1M, False: 877]
  ------------------
  194|  78.1M|            if(!cj5__isnum(json5[parser->pos]) &&
  ------------------
  |  |   85|   156M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  ------------------
  |  Branch (194:16): [True: 30.9M, False: 47.1M]
  ------------------
  195|  30.9M|               !(json5[parser->pos] == '.') &&
  ------------------
  |  Branch (195:16): [True: 28.7M, False: 2.24M]
  ------------------
  196|  28.7M|               !cj5__islowerchar(json5[parser->pos]) && 
  ------------------
  |  |   84|   106M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  ------------------
  |  Branch (196:16): [True: 27.5M, False: 1.12M]
  ------------------
  197|  27.5M|               !cj5__isupperchar(json5[parser->pos]) &&
  ------------------
  |  |   83|   105M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  ------------------
  |  Branch (197:16): [True: 27.5M, False: 33.1k]
  ------------------
  198|  27.5M|               !(json5[parser->pos] == '+') && !(json5[parser->pos] == '-')) {
  ------------------
  |  Branch (198:16): [True: 27.5M, False: 2.11k]
  |  Branch (198:48): [True: 27.5M, False: 19.9k]
  ------------------
  199|  27.5M|                break;
  200|  27.5M|            }
  201|  78.1M|        }
  202|  27.5M|        parser->pos--; // Point to the last character that is still inside the
  203|       |                       // primitive value
  204|  27.5M|    }
  205|       |
  206|  31.2M|    cj5_token *token = cj5__alloc_token(parser);
  207|  31.2M|    if(token) {
  ------------------
  |  Branch (207:8): [True: 15.4M, False: 15.7M]
  ------------------
  208|  15.4M|        token->type = type;
  209|  15.4M|        token->start = start;
  210|  15.4M|        token->end = parser->pos;
  211|  15.4M|        token->size = parser->pos - start + 1;
  212|  15.4M|        token->parent_id = parser->curr_tok_idx;
  213|  15.4M|    }
  214|  31.2M|}
cj5.c:cj5__parse_string:
  104|  8.65M|cj5__parse_string(cj5__parser *parser) {
  105|  8.65M|    const char *json5 = parser->json5;
  106|  8.65M|    unsigned int len = parser->len;
  107|  8.65M|    unsigned int start = parser->pos;
  108|  8.65M|    char str_open = json5[start];
  109|       |
  110|  8.65M|    parser->pos++;
  111|  84.2M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (111:11): [True: 84.2M, False: 26]
  ------------------
  112|  84.2M|        char c = json5[parser->pos];
  113|       |
  114|       |        // End of string
  115|  84.2M|        if(str_open == c) {
  ------------------
  |  Branch (115:12): [True: 8.65M, False: 75.6M]
  ------------------
  116|  8.65M|            cj5_token *token = cj5__alloc_token(parser);
  117|  8.65M|            if(token) {
  ------------------
  |  Branch (117:16): [True: 4.39M, False: 4.26M]
  ------------------
  118|  4.39M|                token->type = CJ5_TOKEN_STRING;
  119|  4.39M|                token->start = start + 1;
  120|  4.39M|                token->end = parser->pos - 1;
  121|  4.39M|                token->size = token->end - token->start + 1;
  122|  4.39M|                token->parent_id = parser->curr_tok_idx;
  123|  4.39M|            } 
  124|  8.65M|            return;
  125|  8.65M|        }
  126|       |
  127|       |        // Unescaped newlines are forbidden
  128|  75.6M|        if(c == '\n') {
  ------------------
  |  Branch (128:12): [True: 0, False: 75.6M]
  ------------------
  129|      0|            parser->error = CJ5_ERROR_INVALID;
  130|      0|            return;
  131|      0|        }
  132|       |
  133|       |        // Skip escape character
  134|  75.6M|        if(c == '\\') {
  ------------------
  |  Branch (134:12): [True: 4.73M, False: 70.8M]
  ------------------
  135|  4.73M|            if(parser->pos + 1 >= len) {
  ------------------
  |  Branch (135:16): [True: 0, False: 4.73M]
  ------------------
  136|      0|                parser->error = CJ5_ERROR_INCOMPLETE;
  137|      0|                return;
  138|      0|            }
  139|  4.73M|            parser->pos++;
  140|  4.73M|        }
  141|  75.6M|    }
  142|       |
  143|       |    // The file has ended before the string terminates
  144|     26|    parser->error = CJ5_ERROR_INCOMPLETE;
  145|     26|}
cj5.c:cj5__isrange:
   79|   142M|cj5__isrange(char ch, char from, char to) {
   80|   142M|    return (uint8_t)(ch - from) <= (uint8_t)(to - from);
   81|   142M|}
cj5.c:cj5__parse_key:
  217|  3.86M|cj5__parse_key(cj5__parser* parser) {
  218|  3.86M|    const char* json5 = parser->json5;
  219|  3.86M|    unsigned int start = parser->pos;
  220|  3.86M|    cj5_token* token;
  221|       |
  222|       |    // Key is a a normal string
  223|  3.86M|    if(json5[start] == '\"' || json5[start] == '\'') {
  ------------------
  |  Branch (223:8): [True: 3.68M, False: 183k]
  |  Branch (223:32): [True: 606, False: 182k]
  ------------------
  224|  3.68M|        cj5__parse_string(parser);
  225|  3.68M|        return;
  226|  3.68M|    }
  227|       |
  228|       |    // An unquoted key. Must start with a-ZA-Z_$. Can contain numbers later on.
  229|   182k|    unsigned int len = parser->len;
  230|  2.73M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (230:11): [True: 2.73M, False: 30]
  ------------------
  231|  2.73M|        if(cj5__islowerchar(json5[parser->pos]) ||
  ------------------
  |  |   84|  5.46M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  |  |  ------------------
  |  |  |  Branch (84:30): [True: 2.04M, False: 687k]
  |  |  ------------------
  ------------------
  232|   687k|           cj5__isupperchar(json5[parser->pos]) ||
  ------------------
  |  |   83|  3.41M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  |  |  ------------------
  |  |  |  Branch (83:30): [True: 272k, False: 415k]
  |  |  ------------------
  ------------------
  233|   415k|           json5[parser->pos] == '_' || json5[parser->pos] == '$')
  ------------------
  |  Branch (233:12): [True: 554, False: 415k]
  |  Branch (233:41): [True: 222, False: 415k]
  ------------------
  234|  2.31M|            continue;
  235|   415k|        if(cj5__isnum(json5[parser->pos]) && parser->pos != start)
  ------------------
  |  |   85|   830k|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 232k, False: 182k]
  |  |  ------------------
  ------------------
  |  Branch (235:46): [True: 232k, False: 0]
  ------------------
  236|   232k|            continue;
  237|   182k|        break;
  238|   415k|    }
  239|       |
  240|       |    // An empty key is not allowed
  241|   182k|    if(parser->pos <= start) {
  ------------------
  |  Branch (241:8): [True: 13, False: 182k]
  ------------------
  242|     13|        parser->error = CJ5_ERROR_INVALID;
  243|     13|        return;
  244|     13|    }
  245|       |
  246|       |    // Move pos to the last character within the unquoted key
  247|   182k|    parser->pos--;
  248|       |
  249|   182k|    token = cj5__alloc_token(parser);
  250|   182k|    if(token) {
  ------------------
  |  Branch (250:8): [True: 100k, False: 82.4k]
  ------------------
  251|   100k|        token->type = CJ5_TOKEN_STRING;
  252|   100k|        token->start = start;
  253|   100k|        token->end = parser->pos;
  254|   100k|        token->size = parser->pos - start + 1;
  255|   100k|        token->parent_id = parser->curr_tok_idx;
  256|   100k|    }
  257|   182k|}
cj5.c:parse_codepoint:
  607|   805k|parse_codepoint(const char *pos, uint32_t *out_utf) {
  608|   805k|    uint32_t utf = 0;
  609|  4.02M|    for(unsigned int i = 0; i < 4; i++) {
  ------------------
  |  Branch (609:29): [True: 3.22M, False: 805k]
  ------------------
  610|  3.22M|        char byte = pos[i];
  611|  3.22M|        if(cj5__isnum(byte)) {
  ------------------
  |  |   85|  3.22M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 2.41M, False: 805k]
  |  |  ------------------
  ------------------
  612|  2.41M|            byte = (char)(byte - '0');
  613|  2.41M|        } else if(cj5__isrange(byte, 'a', 'f')) {
  ------------------
  |  Branch (613:19): [True: 803k, False: 2.63k]
  ------------------
  614|   803k|            byte = (char)(byte - ('a' - 10));
  615|   803k|        } else if(cj5__isrange(byte, 'A', 'F')) {
  ------------------
  |  Branch (615:19): [True: 2.62k, False: 9]
  ------------------
  616|  2.62k|            byte = (char)(byte - ('A' - 10));
  617|  2.62k|        } else {
  618|      9|            return CJ5_ERROR_INVALID;
  619|      9|        }
  620|  3.22M|        utf = (utf << 4) | ((uint8_t)byte & 0xF);
  621|  3.22M|    }
  622|   805k|    *out_utf = utf;
  623|   805k|    return CJ5_ERROR_NONE;
  624|   805k|}

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

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

musl_secs_to_tm:
   15|  29.6k|musl_secs_to_tm(long long t, struct musl_tm *tm) {
   16|  29.6k|    long long days, secs, years;
   17|  29.6k|    int remdays, remsecs, remyears;
   18|  29.6k|    int qc_cycles, c_cycles, q_cycles;
   19|  29.6k|    int months;
   20|  29.6k|    int wday, yday, leap;
   21|  29.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|  29.6k|    if (t < INT_MIN * 31622400LL || t > INT_MAX * 31622400LL)
  ------------------
  |  Branch (24:9): [True: 0, False: 29.6k]
  |  Branch (24:37): [True: 0, False: 29.6k]
  ------------------
   25|      0|        return -1;
   26|       |
   27|  29.6k|    secs = t - LEAPOCH;
  ------------------
  |  |    8|  29.6k|#define LEAPOCH (946684800LL + 86400*(31+29))
  ------------------
   28|  29.6k|    days = secs / 86400LL;
   29|  29.6k|    remsecs = (int)(secs % 86400);
   30|  29.6k|    if (remsecs < 0) {
  ------------------
  |  Branch (30:9): [True: 17.5k, False: 12.1k]
  ------------------
   31|  17.5k|        remsecs += 86400;
   32|  17.5k|        --days;
   33|  17.5k|    }
   34|       |
   35|  29.6k|    wday = (int)((3+days)%7);
   36|  29.6k|    if (wday < 0) wday += 7;
  ------------------
  |  Branch (36:9): [True: 18.6k, False: 10.9k]
  ------------------
   37|       |
   38|  29.6k|    qc_cycles = (int)(days / DAYS_PER_400Y);
  ------------------
  |  |   10|  29.6k|#define DAYS_PER_400Y (365*400 + 97)
  ------------------
   39|  29.6k|    remdays = (int)(days % DAYS_PER_400Y);
  ------------------
  |  |   10|  29.6k|#define DAYS_PER_400Y (365*400 + 97)
  ------------------
   40|  29.6k|    if (remdays < 0) {
  ------------------
  |  Branch (40:9): [True: 22.0k, False: 7.62k]
  ------------------
   41|  22.0k|        remdays += DAYS_PER_400Y;
  ------------------
  |  |   10|  22.0k|#define DAYS_PER_400Y (365*400 + 97)
  ------------------
   42|  22.0k|        --qc_cycles;
   43|  22.0k|    }
   44|       |
   45|  29.6k|    c_cycles = remdays / DAYS_PER_100Y;
  ------------------
  |  |   11|  29.6k|#define DAYS_PER_100Y (365*100 + 24)
  ------------------
   46|  29.6k|    if (c_cycles == 4) --c_cycles;
  ------------------
  |  Branch (46:9): [True: 1.12k, False: 28.5k]
  ------------------
   47|  29.6k|    remdays -= c_cycles * DAYS_PER_100Y;
  ------------------
  |  |   11|  29.6k|#define DAYS_PER_100Y (365*100 + 24)
  ------------------
   48|       |
   49|  29.6k|    q_cycles = remdays / DAYS_PER_4Y;
  ------------------
  |  |   12|  29.6k|#define DAYS_PER_4Y   (365*4   + 1)
  ------------------
   50|  29.6k|    if (q_cycles == 25) --q_cycles;
  ------------------
  |  Branch (50:9): [True: 0, False: 29.6k]
  ------------------
   51|  29.6k|    remdays -= q_cycles * DAYS_PER_4Y;
  ------------------
  |  |   12|  29.6k|#define DAYS_PER_4Y   (365*4   + 1)
  ------------------
   52|       |
   53|  29.6k|    remyears = remdays / 365;
   54|  29.6k|    if (remyears == 4) --remyears;
  ------------------
  |  Branch (54:9): [True: 1.18k, False: 28.4k]
  ------------------
   55|  29.6k|    remdays -= remyears * 365;
   56|       |
   57|  29.6k|    leap = !remyears && (q_cycles || !c_cycles);
  ------------------
  |  Branch (57:12): [True: 13.3k, False: 16.2k]
  |  Branch (57:26): [True: 7.26k, False: 6.12k]
  |  Branch (57:38): [True: 6.02k, False: 99]
  ------------------
   58|  29.6k|    yday = remdays + 31 + 28 + leap;
   59|  29.6k|    if (yday >= 365+leap) yday -= 365+leap;
  ------------------
  |  Branch (59:9): [True: 14.4k, False: 15.2k]
  ------------------
   60|       |
   61|  29.6k|    years = remyears + 4*q_cycles + 100*c_cycles + 400LL*qc_cycles;
   62|       |
   63|   254k|    for (months=0; days_in_month[months] <= remdays; months++)
  ------------------
  |  Branch (63:20): [True: 225k, False: 29.6k]
  ------------------
   64|   225k|        remdays -= days_in_month[months];
   65|       |
   66|  29.6k|    if (months >= 10) {
  ------------------
  |  Branch (66:9): [True: 14.4k, False: 15.2k]
  ------------------
   67|  14.4k|        months -= 12;
   68|  14.4k|        years++;
   69|  14.4k|    }
   70|       |
   71|  29.6k|    if (years+100 > INT_MAX || years+100 < INT_MIN)
  ------------------
  |  Branch (71:9): [True: 0, False: 29.6k]
  |  Branch (71:32): [True: 0, False: 29.6k]
  ------------------
   72|      0|        return -1;
   73|       |
   74|  29.6k|    tm->tm_year = (int)(years + 100);
   75|  29.6k|    tm->tm_mon = months + 2;
   76|  29.6k|    tm->tm_mday = remdays + 1;
   77|  29.6k|    tm->tm_wday = wday;
   78|  29.6k|    tm->tm_yday = yday;
   79|       |
   80|  29.6k|    tm->tm_hour = remsecs / 3600;
   81|  29.6k|    tm->tm_min = remsecs / 60 % 60;
   82|  29.6k|    tm->tm_sec = remsecs % 60;
   83|       |
   84|  29.6k|    return 0;
   85|  29.6k|}
musl_tm_to_secs:
  149|  19.9k|musl_tm_to_secs(const struct musl_tm *tm) {
  150|  19.9k|    int is_leap;
  151|  19.9k|    long long year = tm->tm_year;
  152|  19.9k|    int month = tm->tm_mon;
  153|  19.9k|    if (month >= 12 || month < 0) {
  ------------------
  |  Branch (153:9): [True: 3.52k, False: 16.3k]
  |  Branch (153:24): [True: 1.30k, False: 15.0k]
  ------------------
  154|  4.82k|        int adj = month / 12;
  155|  4.82k|        month %= 12;
  156|  4.82k|        if (month < 0) {
  ------------------
  |  Branch (156:13): [True: 1.30k, False: 3.52k]
  ------------------
  157|  1.30k|            adj--;
  158|  1.30k|            month += 12;
  159|  1.30k|        }
  160|  4.82k|        year += adj;
  161|  4.82k|    }
  162|  19.9k|    long long t = musl_year_to_secs(year, &is_leap);
  163|  19.9k|    t += musl_month_to_secs(month, is_leap);
  164|  19.9k|    t += 86400LL * (tm->tm_mday-1);
  165|  19.9k|    t += 3600LL * tm->tm_hour;
  166|  19.9k|    t += 60LL * tm->tm_min;
  167|  19.9k|    t += tm->tm_sec;
  168|  19.9k|    return t;
  169|  19.9k|}
libc_time.c:musl_year_to_secs:
  101|  19.9k|musl_year_to_secs(const long long year, int *is_leap) {
  102|  19.9k|    if (year-2ULL <= 136) {
  ------------------
  |  Branch (102:9): [True: 2.35k, False: 17.5k]
  ------------------
  103|  2.35k|        int y = (int)year;
  104|  2.35k|        int leaps = (y-68)>>2;
  105|  2.35k|        if (!((y-68)&3)) {
  ------------------
  |  Branch (105:13): [True: 570, False: 1.78k]
  ------------------
  106|    570|            leaps--;
  107|    570|            if (is_leap) *is_leap = 1;
  ------------------
  |  Branch (107:17): [True: 570, False: 0]
  ------------------
  108|  1.78k|        } else if (is_leap) *is_leap = 0;
  ------------------
  |  Branch (108:20): [True: 1.78k, False: 0]
  ------------------
  109|  2.35k|        return 31536000*(y-70) + 86400*leaps;
  110|  2.35k|    }
  111|       |
  112|  17.5k|    int cycles, centuries, leaps, rem, dummy;
  113|       |
  114|  17.5k|    if (!is_leap) is_leap = &dummy;
  ------------------
  |  Branch (114:9): [True: 0, False: 17.5k]
  ------------------
  115|  17.5k|    cycles = (int)((year-100) / 400);
  116|  17.5k|    rem = (int)((year-100) % 400);
  117|  17.5k|    if (rem < 0) {
  ------------------
  |  Branch (117:9): [True: 12.3k, False: 5.21k]
  ------------------
  118|  12.3k|        cycles--;
  119|  12.3k|        rem += 400;
  120|  12.3k|    }
  121|  17.5k|    if (!rem) {
  ------------------
  |  Branch (121:9): [True: 1.78k, False: 15.7k]
  ------------------
  122|  1.78k|        *is_leap = 1;
  123|  1.78k|        centuries = 0;
  124|  1.78k|        leaps = 0;
  125|  15.7k|    } else {
  126|  15.7k|        if (rem >= 200) {
  ------------------
  |  Branch (126:13): [True: 7.76k, False: 8.01k]
  ------------------
  127|  7.76k|            if (rem >= 300) centuries = 3, rem -= 300;
  ------------------
  |  Branch (127:17): [True: 3.49k, False: 4.27k]
  ------------------
  128|  4.27k|            else centuries = 2, rem -= 200;
  129|  8.01k|        } else {
  130|  8.01k|            if (rem >= 100) centuries = 1, rem -= 100;
  ------------------
  |  Branch (130:17): [True: 3.17k, False: 4.83k]
  ------------------
  131|  4.83k|            else centuries = 0;
  132|  8.01k|        }
  133|  15.7k|        if (!rem) {
  ------------------
  |  Branch (133:13): [True: 244, False: 15.5k]
  ------------------
  134|    244|            *is_leap = 0;
  135|    244|            leaps = 0;
  136|  15.5k|        } else {
  137|  15.5k|            leaps = rem / 4;
  138|  15.5k|            rem %= 4;
  139|  15.5k|            *is_leap = !rem;
  140|  15.5k|        }
  141|  15.7k|    }
  142|       |
  143|  17.5k|    leaps += 97*cycles + 24*centuries - *is_leap;
  144|       |
  145|  17.5k|    return (year-100) * 31536000LL + leaps * 86400LL + 946684800 + 86400;
  146|  19.9k|}
libc_time.c:musl_month_to_secs:
   93|  19.9k|musl_month_to_secs(int month, int is_leap) {
   94|  19.9k|    int t = secs_through_month[month];
   95|  19.9k|    if (is_leap && month >= 2)
  ------------------
  |  Branch (95:9): [True: 6.08k, False: 13.8k]
  |  Branch (95:20): [True: 2.59k, False: 3.48k]
  ------------------
   96|  2.59k|        t+=86400;
   97|  19.9k|    return t;
   98|  19.9k|}

parseUInt64:
   30|  11.0M|parseUInt64(const char *str, size_t size, uint64_t *result) {
   31|  11.0M|    size_t i = 0;
   32|  11.0M|    uint64_t n = 0, prev = 0;
   33|       |
   34|       |    /* Hex */
   35|  11.0M|    if(size > 2 && str[0] == '0' && (str[1] | 32) == 'x') {
  ------------------
  |  Branch (35:8): [True: 28.7k, False: 11.0M]
  |  Branch (35:20): [True: 7.45k, False: 21.3k]
  |  Branch (35:37): [True: 333, False: 7.11k]
  ------------------
   36|    333|        i = 2;
   37|   103k|        for(; i < size; i++) {
  ------------------
  |  Branch (37:15): [True: 102k, False: 250]
  ------------------
   38|   102k|            uint8_t c = (uint8_t)str[i] | 32;
   39|   102k|            if(c >= '0' && c <= '9')
  ------------------
  |  Branch (39:16): [True: 102k, False: 3]
  |  Branch (39:28): [True: 36.4k, False: 66.5k]
  ------------------
   40|  36.4k|                c = (uint8_t)(c - '0');
   41|  66.5k|            else if(c >= 'a' && c <='f')
  ------------------
  |  Branch (41:21): [True: 66.5k, False: 3]
  |  Branch (41:33): [True: 66.4k, False: 79]
  ------------------
   42|  66.4k|                c = (uint8_t)(c - 'a' + 10);
   43|     82|            else if(c >= 'A' && c <='F')
  ------------------
  |  Branch (43:21): [True: 79, False: 3]
  |  Branch (43:33): [True: 0, False: 79]
  ------------------
   44|      0|                c = (uint8_t)(c - 'A' + 10);
   45|     82|            else
   46|     82|                break;
   47|   102k|            n = (n << 4) | (c & 0xF);
   48|   102k|            if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (48:16): [True: 1, False: 102k]
  ------------------
   49|      1|                return 0;
   50|   102k|            prev = n;
   51|   102k|        }
   52|    332|        *result = n;
   53|    332|        return (i > 2) ? i : 0; /* 2 -> No digit was parsed */
  ------------------
  |  Branch (53:16): [True: 332, False: 0]
  ------------------
   54|    333|    }
   55|       |
   56|       |    /* Decimal */
   57|  22.8M|    for(; i < size; i++) {
  ------------------
  |  Branch (57:11): [True: 11.8M, False: 11.0M]
  ------------------
   58|  11.8M|        if(str[i] < '0' || str[i] > '9')
  ------------------
  |  Branch (58:12): [True: 19.3k, False: 11.8M]
  |  Branch (58:28): [True: 1.28k, False: 11.8M]
  ------------------
   59|  20.6k|            break;
   60|       |        /* Fast multiplication: n*10 == (n*8) + (n*2) */
   61|  11.8M|        n = (n << 3) + (n << 1) + (uint8_t)(str[i] - '0');
   62|  11.8M|        if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (62:12): [True: 7, False: 11.8M]
  ------------------
   63|      7|            return 0;
   64|  11.8M|        prev = n;
   65|  11.8M|    }
   66|  11.0M|    *result = n;
   67|  11.0M|    return i;
   68|  11.0M|}
parseInt64:
   71|  4.64M|parseInt64(const char *str, size_t size, int64_t *result) {
   72|       |    /* Negative value? */
   73|  4.64M|    size_t i = 0;
   74|  4.64M|    bool neg = false;
   75|  4.64M|    if(*str == '-' || *str == '+') {
  ------------------
  |  Branch (75:8): [True: 11.4k, False: 4.63M]
  |  Branch (75:23): [True: 230, False: 4.63M]
  ------------------
   76|  11.6k|        neg = (*str == '-');
   77|  11.6k|        i++;
   78|  11.6k|    }
   79|       |
   80|       |    /* Parse as unsigned */
   81|  4.64M|    uint64_t n = 0;
   82|  4.64M|    size_t len = parseUInt64(&str[i], size - i, &n);
   83|  4.64M|    if(len == 0)
  ------------------
  |  Branch (83:8): [True: 13, False: 4.64M]
  ------------------
   84|     13|        return 0;
   85|       |
   86|       |    /* Check for overflow, adjust and return */
   87|  4.64M|    if(!neg) {
  ------------------
  |  Branch (87:8): [True: 4.63M, False: 11.4k]
  ------------------
   88|  4.63M|        if(n > 9223372036854775807UL)
  ------------------
  |  Branch (88:12): [True: 1, False: 4.63M]
  ------------------
   89|      1|            return 0;
   90|  4.63M|        *result = (int64_t)n;
   91|  4.63M|    } else {
   92|  11.4k|        if(n > 9223372036854775808UL)
  ------------------
  |  Branch (92:12): [True: 0, False: 11.4k]
  ------------------
   93|      0|            return 0;
   94|  11.4k|        *result = -(int64_t)n;
   95|  11.4k|    }
   96|  4.64M|    return len + i;
   97|  4.64M|}
parseDouble:
   99|  1.22M|size_t parseDouble(const char *str, size_t size, double *result) {
  100|  1.22M|    char buf[2000];
  101|  1.22M|    if(size >= 2000)
  ------------------
  |  Branch (101:8): [True: 1, False: 1.22M]
  ------------------
  102|      1|        return 0;
  103|  1.22M|    memcpy(buf, str, size);
  104|  1.22M|    buf[size] = 0;
  105|  1.22M|    errno = 0;
  106|  1.22M|    char *endptr;
  107|  1.22M|    *result = strtod(buf, &endptr);
  108|  1.22M|    if(errno != 0 && errno != ERANGE)
  ------------------
  |  Branch (108:8): [True: 2.89k, False: 1.21M]
  |  Branch (108:22): [True: 0, False: 2.89k]
  ------------------
  109|      0|        return 0;
  110|  1.22M|    return (uintptr_t)endptr - (uintptr_t)buf;
  111|  1.22M|}

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

UA_StatusCode_equalTop:
  214|  16.5k|UA_StatusCode_equalTop(UA_StatusCode s1, UA_StatusCode s2) {
  215|  16.5k|    return ((s1 & 0xFFFF0000) == (s2 & 0xFFFF0000));
  216|  16.5k|}
UA_STRING:
  219|  1.80k|UA_STRING(char *chars) {
  220|  1.80k|    UA_String s = {0, NULL};
  221|  1.80k|    if(!chars)
  ------------------
  |  Branch (221:8): [True: 0, False: 1.80k]
  ------------------
  222|      0|        return s;
  223|  1.80k|    s.length = strlen(chars);
  224|  1.80k|    s.data = (UA_Byte*)chars;
  225|  1.80k|    return s;
  226|  1.80k|}
UA_QualifiedName_printEx:
  404|  88.8k|                         const UA_NamespaceMapping *nsMapping) {
  405|       |    /* If the QualifiedName is NULL, return a NULL string */
  406|  88.8k|    if(qn->name.data == NULL && qn->namespaceIndex == 0) {
  ------------------
  |  Branch (406:8): [True: 7.80k, False: 81.0k]
  |  Branch (406:33): [True: 7.80k, False: 0]
  ------------------
  407|  7.80k|        UA_String_clear(output);
  408|  7.80k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  7.80k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  409|  7.80k|    }
  410|       |
  411|       |    /* Start tracking the output length */
  412|  81.0k|    size_t len = qn->name.length;
  413|       |
  414|       |    /* Try to map the NamespaceIndex to the Uri */
  415|  81.0k|    UA_String nsUri = UA_STRING_NULL;
  416|  81.0k|    if(qn->namespaceIndex > 0 && nsMapping) {
  ------------------
  |  Branch (416:8): [True: 1.33k, False: 79.7k]
  |  Branch (416:34): [True: 0, False: 1.33k]
  ------------------
  417|      0|        UA_NamespaceMapping_index2Uri(nsMapping, qn->namespaceIndex, &nsUri);
  418|      0|        if(nsUri.length > 0)
  ------------------
  |  Branch (418:12): [True: 0, False: 0]
  ------------------
  419|      0|            len += nsUri.length + 1;
  420|      0|    }
  421|       |
  422|       |    /* Print the NamespaceIndex */
  423|  81.0k|    char nsStr[6];
  424|  81.0k|    size_t nsStrSize = 0;
  425|  81.0k|    if(nsUri.length == 0 && qn->namespaceIndex > 0) {
  ------------------
  |  Branch (425:8): [True: 81.0k, False: 0]
  |  Branch (425:29): [True: 1.33k, False: 79.7k]
  ------------------
  426|  1.33k|        nsStrSize = itoaUnsigned(qn->namespaceIndex, nsStr, 10);
  427|  1.33k|        len += 1 + nsStrSize;
  428|  1.33k|    }
  429|       |
  430|       |    /* Allocate memory if required */
  431|  81.0k|    if(output->length == 0) {
  ------------------
  |  Branch (431:8): [True: 81.0k, False: 0]
  ------------------
  432|  81.0k|        UA_StatusCode res = UA_ByteString_allocBuffer((UA_ByteString*)output, len);
  433|  81.0k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  81.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (433:12): [True: 0, False: 81.0k]
  ------------------
  434|      0|            return res;
  435|  81.0k|    } else {
  436|      0|        if(output->length < len)
  ------------------
  |  Branch (436:12): [True: 0, False: 0]
  ------------------
  437|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  438|      0|        output->length = len;
  439|      0|    }
  440|       |
  441|       |    /* Print the namespace */
  442|  81.0k|    u8 *pos = output->data;
  443|  81.0k|    if(nsUri.length > 0) {
  ------------------
  |  Branch (443:8): [True: 0, False: 81.0k]
  ------------------
  444|      0|        memcpy(pos, nsUri.data, nsUri.length);
  445|      0|        pos += nsUri.length;
  446|      0|        *pos++ = ';';
  447|  81.0k|    } else if(qn->namespaceIndex > 0) {
  ------------------
  |  Branch (447:15): [True: 1.33k, False: 79.7k]
  ------------------
  448|  1.33k|        memcpy(pos, nsStr, nsStrSize);
  449|  1.33k|        pos += nsStrSize;
  450|  1.33k|        *pos++ = ':';
  451|  1.33k|    }
  452|       |
  453|       |    /* Print the name */
  454|  81.0k|    if(UA_LIKELY(qn->name.data != NULL))
  ------------------
  |  |  590|  81.0k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (590:23): [True: 81.0k, False: 0]
  |  |  ------------------
  ------------------
  455|  81.0k|        memcpy(pos, qn->name.data, qn->name.length);
  456|       |
  457|  81.0k|    UA_assert(output->length == (size_t)((UA_Byte*)pos + qn->name.length - output->data));
  ------------------
  |  |  411|  81.0k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (457:5): [True: 81.0k, False: 0]
  ------------------
  458|  81.0k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  81.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  459|  81.0k|}
UA_DateTime_toStruct:
  478|  29.6k|UA_DateTime_toStruct(UA_DateTime t) {
  479|       |    /* Divide, then subtract -> avoid underflow. Also, negative numbers are
  480|       |     * rounded up, not down. */
  481|  29.6k|    long long secSinceUnixEpoch = (long long)(t / UA_DATETIME_SEC)
  ------------------
  |  |  285|  29.6k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  29.6k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  29.6k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  482|  29.6k|        - (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC);
  ------------------
  |  |  327|  29.6k|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|  29.6k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  29.6k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  29.6k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      - (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC);
  ------------------
  |  |  285|  29.6k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  29.6k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  29.6k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|       |
  484|       |    /* Negative fractions of a second? Remove one full second from the epoch
  485|       |     * distance and allow only a positive fraction. */
  486|  29.6k|    UA_DateTime frac = t % UA_DATETIME_SEC;
  ------------------
  |  |  285|  29.6k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  29.6k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  29.6k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  487|  29.6k|    if(frac < 0) {
  ------------------
  |  Branch (487:8): [True: 2.10k, False: 27.5k]
  ------------------
  488|  2.10k|        secSinceUnixEpoch--;
  489|  2.10k|        frac += UA_DATETIME_SEC;
  ------------------
  |  |  285|  2.10k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  2.10k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  2.10k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  490|  2.10k|    }
  491|       |
  492|  29.6k|    struct musl_tm ts;
  493|  29.6k|    memset(&ts, 0, sizeof(struct musl_tm));
  494|  29.6k|    musl_secs_to_tm(secSinceUnixEpoch, &ts);
  495|       |
  496|  29.6k|    UA_DateTimeStruct dateTimeStruct;
  497|  29.6k|    dateTimeStruct.year   = (i16)(ts.tm_year + 1900);
  498|  29.6k|    dateTimeStruct.month  = (u16)(ts.tm_mon + 1);
  499|  29.6k|    dateTimeStruct.day    = (u16)ts.tm_mday;
  500|  29.6k|    dateTimeStruct.hour   = (u16)ts.tm_hour;
  501|  29.6k|    dateTimeStruct.min    = (u16)ts.tm_min;
  502|  29.6k|    dateTimeStruct.sec    = (u16)ts.tm_sec;
  503|  29.6k|    dateTimeStruct.milliSec = (u16)((frac % 10000000) / 10000);
  504|  29.6k|    dateTimeStruct.microSec = (u16)((frac % 10000) / 10);
  505|  29.6k|    dateTimeStruct.nanoSec  = (u16)((frac % 10) * 100);
  506|  29.6k|    return dateTimeStruct;
  507|  29.6k|}
UA_Guid_to_hex:
  709|  1.67k|UA_Guid_to_hex(const UA_Guid *guid, u8* out, UA_Boolean lower) {
  710|  1.67k|    const u8 *hexmap = (lower) ? hexmapLower : hexmapUpper;
  ------------------
  |  Branch (710:24): [True: 0, False: 1.67k]
  ------------------
  711|  1.67k|    size_t i = 0, j = 28;
  712|  15.0k|    for(; i<8;i++,j-=4)         /* pos 0-7, 4byte, (a) */
  ------------------
  |  Branch (712:11): [True: 13.3k, False: 1.67k]
  ------------------
  713|  13.3k|        out[i] = hexmap[(guid->data1 >> j) & 0x0Fu];
  714|  1.67k|    out[i++] = '-';             /* pos 8 */
  715|  8.35k|    for(j=12; i<13;i++,j-=4)    /* pos 9-12, 2byte, (b) */
  ------------------
  |  Branch (715:15): [True: 6.68k, False: 1.67k]
  ------------------
  716|  6.68k|        out[i] = hexmap[(uint16_t)(guid->data2 >> j) & 0x0Fu];
  717|  1.67k|    out[i++] = '-';             /* pos 13 */
  718|  8.35k|    for(j=12; i<18;i++,j-=4)    /* pos 14-17, 2byte (c) */
  ------------------
  |  Branch (718:15): [True: 6.68k, False: 1.67k]
  ------------------
  719|  6.68k|        out[i] = hexmap[(uint16_t)(guid->data3 >> j) & 0x0Fu];
  720|  1.67k|    out[i++] = '-';              /* pos 18 */
  721|  5.01k|    for(j=0;i<23;i+=2,j++) {     /* pos 19-22, 2byte (d) */
  ------------------
  |  Branch (721:13): [True: 3.34k, False: 1.67k]
  ------------------
  722|  3.34k|        out[i] = hexmap[(guid->data4[j] & 0xF0u) >> 4u];
  723|  3.34k|        out[i+1] = hexmap[guid->data4[j] & 0x0Fu];
  724|  3.34k|    }
  725|  1.67k|    out[i++] = '-';              /* pos 23 */
  726|  11.6k|    for(j=2; i<36;i+=2,j++) {    /* pos 24-35, 6byte (e) */
  ------------------
  |  Branch (726:14): [True: 10.0k, False: 1.67k]
  ------------------
  727|  10.0k|        out[i] = hexmap[(guid->data4[j] & 0xF0u) >> 4u];
  728|  10.0k|        out[i+1] = hexmap[guid->data4[j] & 0x0Fu];
  729|  10.0k|    }
  730|  1.67k|}
UA_ByteString_allocBuffer:
  757|   124k|UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length) {
  758|   124k|    UA_ByteString_init(bs);
  759|   124k|    if(length == 0) {
  ------------------
  |  Branch (759:8): [True: 9.93k, False: 114k]
  ------------------
  760|  9.93k|        bs->data = (u8*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  9.93k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  761|  9.93k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  9.93k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  762|  9.93k|    }
  763|   114k|    bs->data = (u8*)UA_calloc(1,length);
  ------------------
  |  |  352|   114k|# define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  764|   114k|    if(UA_UNLIKELY(!bs->data))
  ------------------
  |  |  591|   114k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (591:25): [True: 0, False: 114k]
  |  |  ------------------
  ------------------
  765|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  766|   114k|    bs->length = length;
  767|   114k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   114k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  768|   114k|}
nodeId_printEscape:
 1021|  9.29k|                   const UA_NamespaceMapping *nsMapping, UA_Escaping idEsc) {
 1022|       |    /* Try to map the NamespaceIndex to the Uri */
 1023|  9.29k|    UA_String nsUri = UA_STRING_NULL;
 1024|  9.29k|    if(id->namespaceIndex > 0 && nsMapping)
  ------------------
  |  Branch (1024:8): [True: 408, False: 8.88k]
  |  Branch (1024:34): [True: 0, False: 408]
  ------------------
 1025|      0|        UA_NamespaceMapping_index2Uri(nsMapping, id->namespaceIndex, &nsUri);
 1026|       |
 1027|       |    /* Compute the string length and print numerical identifiers. */
 1028|  9.29k|    u8 nsStr[7];
 1029|  9.29k|    u8 numIdStr[12];
 1030|  9.29k|    size_t idLen = nodeIdSize(id, nsStr, numIdStr, nsUri, idEsc);
 1031|  9.29k|    if(idLen == 0)
  ------------------
  |  Branch (1031:8): [True: 0, False: 9.29k]
  ------------------
 1032|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 1033|       |
 1034|       |    /* Allocate memory if required */
 1035|  9.29k|    if(output->length == 0) {
  ------------------
  |  Branch (1035:8): [True: 9.29k, False: 0]
  ------------------
 1036|  9.29k|        UA_StatusCode res = UA_ByteString_allocBuffer((UA_ByteString*)output, idLen);
 1037|  9.29k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  9.29k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1037:12): [True: 0, False: 9.29k]
  ------------------
 1038|      0|            return res;
 1039|  9.29k|    } else {
 1040|      0|        if(output->length < idLen)
  ------------------
  |  Branch (1040:12): [True: 0, False: 0]
  ------------------
 1041|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
 1042|      0|        output->length = idLen;
 1043|      0|    }
 1044|       |
 1045|       |    /* Print the NodeId */
 1046|  9.29k|    u8 *pos = printNodeIdBody(id, nsUri, nsStr, numIdStr, output->data, nsMapping, idEsc);
 1047|  9.29k|    output->length = (size_t)(pos - output->data);
 1048|  9.29k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  9.29k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1049|  9.29k|}
UA_NodeId_printEx:
 1053|  9.29k|                  const UA_NamespaceMapping *nsMapping) {
 1054|  9.29k|    return nodeId_printEscape(id, output, nsMapping, UA_ESCAPING_NONE);
 1055|  9.29k|}
UA_ExpandedNodeId_printEx:
 1171|  29.6k|                          size_t serverUrisSize, const UA_String *serverUris) {
 1172|       |    /* Try to map the NamespaceIndex to the Uri */
 1173|  29.6k|    UA_String nsUri = eid->namespaceUri;
 1174|  29.6k|    if(nsUri.data == NULL && eid->nodeId.namespaceIndex > 0 && nsMapping)
  ------------------
  |  Branch (1174:8): [True: 28.9k, False: 669]
  |  Branch (1174:30): [True: 306, False: 28.6k]
  |  Branch (1174:64): [True: 0, False: 306]
  ------------------
 1175|      0|        UA_NamespaceMapping_index2Uri(nsMapping, eid->nodeId.namespaceIndex, &nsUri);
 1176|       |
 1177|       |    /* Try to map the ServerIndex to a Uri */
 1178|  29.6k|    UA_String srvUri = UA_STRING_NULL;
 1179|  29.6k|    if(eid->serverIndex > 0 && eid->serverIndex < serverUrisSize)
  ------------------
  |  Branch (1179:8): [True: 1.35k, False: 28.3k]
  |  Branch (1179:32): [True: 0, False: 1.35k]
  ------------------
 1180|      0|        srvUri = serverUris[eid->serverIndex];
 1181|       |
 1182|       |    /* No special escaping for ExpandedNodeIds */
 1183|  29.6k|    UA_Escaping idEsc = UA_ESCAPING_NONE;
 1184|       |
 1185|       |    /* Compute the NodeId string length */
 1186|  29.6k|    u8 nsStr[7];
 1187|  29.6k|    u8 numIdStr[12];
 1188|  29.6k|    char srvIdxStr[11];
 1189|  29.6k|    size_t srvIdxSize = 0;
 1190|  29.6k|    size_t idLen = nodeIdSize(&eid->nodeId, nsStr, numIdStr, nsUri, idEsc);
 1191|  29.6k|    if(idLen == 0)
  ------------------
  |  Branch (1191:8): [True: 0, False: 29.6k]
  ------------------
 1192|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 1193|  29.6k|    if(srvUri.length  > 0) {
  ------------------
  |  Branch (1193:8): [True: 0, False: 29.6k]
  ------------------
 1194|      0|        idLen += 5; /* svu=; */
 1195|      0|        idLen += UA_String_escapedSize(srvUri, UA_ESCAPING_PERCENT);
 1196|  29.6k|    } else if(eid->serverIndex > 0) {
  ------------------
  |  Branch (1196:15): [True: 1.35k, False: 28.3k]
  ------------------
 1197|  1.35k|        idLen += 5; /* svr=; */
 1198|  1.35k|        srvIdxSize = itoaUnsigned(eid->serverIndex, srvIdxStr, 10);
 1199|  1.35k|        idLen += srvIdxSize;
 1200|  1.35k|    }
 1201|       |
 1202|       |    /* Allocate memory if required */
 1203|  29.6k|    if(output->length == 0) {
  ------------------
  |  Branch (1203:8): [True: 29.6k, False: 0]
  ------------------
 1204|  29.6k|        UA_StatusCode res = UA_ByteString_allocBuffer((UA_ByteString*)output, idLen);
 1205|  29.6k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  29.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1205:12): [True: 0, False: 29.6k]
  ------------------
 1206|      0|            return res;
 1207|  29.6k|    } else {
 1208|      0|        if(output->length < idLen)
  ------------------
  |  Branch (1208:12): [True: 0, False: 0]
  ------------------
 1209|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
 1210|      0|        output->length = idLen;
 1211|      0|    }
 1212|       |
 1213|       |    /* Encode the ServerIndex or ServerUrl */
 1214|  29.6k|    u8 *pos = output->data;
 1215|  29.6k|    if(srvUri.length  > 0) {
  ------------------
  |  Branch (1215:8): [True: 0, False: 29.6k]
  ------------------
 1216|      0|        memcpy(pos, "svu=", 4);
 1217|      0|        pos += 4;
 1218|      0|        pos += UA_String_escapeInsert(pos, srvUri, UA_ESCAPING_PERCENT);
 1219|      0|        *pos++ = ';';
 1220|  29.6k|    } else if(eid->serverIndex > 0) {
  ------------------
  |  Branch (1220:15): [True: 1.35k, False: 28.3k]
  ------------------
 1221|  1.35k|        memcpy(pos, "svr=", 4);
 1222|  1.35k|        pos += 4;
 1223|  1.35k|        memcpy(pos, srvIdxStr, srvIdxSize);
 1224|  1.35k|        pos += srvIdxSize;
 1225|  1.35k|        *pos++ = ';';
 1226|  1.35k|    }
 1227|       |
 1228|       |    /* Print the NodeId */
 1229|  29.6k|    pos = printNodeIdBody(&eid->nodeId, nsUri, nsStr, numIdStr, pos, nsMapping, idEsc);
 1230|  29.6k|    output->length = (size_t)(pos - output->data);
 1231|  29.6k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  29.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1232|  29.6k|}
UA_Variant_isScalar:
 1348|  69.4k|UA_Variant_isScalar(const UA_Variant *v) {
 1349|  69.4k|    return (v->type != NULL && v->arrayLength == 0 &&
  ------------------
  |  Branch (1349:13): [True: 69.4k, False: 0]
  |  Branch (1349:32): [True: 63.1k, False: 6.36k]
  ------------------
 1350|  63.1k|            v->data > UA_EMPTY_ARRAY_SENTINEL);
  ------------------
  |  |  755|  63.1k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1350:13): [True: 55.9k, False: 7.17k]
  ------------------
 1351|  69.4k|}
UA_new:
 1892|  58.3k|UA_new(const UA_DataType *type) {
 1893|  58.3k|    void *p = UA_calloc(1, type->memSize);
  ------------------
  |  |  352|  58.3k|# define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1894|  58.3k|    return p;
 1895|  58.3k|}
UA_copy:
 2058|  88.6k|UA_copy(const void *src, void *dst, const UA_DataType *type) {
 2059|  88.6k|    memset(dst, 0, type->memSize); /* init */
 2060|  88.6k|    UA_StatusCode retval = copyJumpTable[type->typeKind](src, dst, type);
 2061|  88.6k|    if(retval != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  88.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2061:8): [True: 0, False: 88.6k]
  ------------------
 2062|      0|        UA_clear(dst, type);
 2063|  88.6k|    return retval;
 2064|  88.6k|}
UA_clear:
 2161|  2.49M|UA_clear(void *p, const UA_DataType *type) {
 2162|  2.49M|    clearJumpTable[type->typeKind](p, type);
 2163|  2.49M|    memset(p, 0, type->memSize); /* init */
 2164|  2.49M|}
UA_order:
 2615|  2.00k|UA_Order UA_order(const void *p1, const void *p2, const UA_DataType *type) {
 2616|  2.00k|    return orderJumpTable[type->typeKind](p1, p2, type);
 2617|  2.00k|}
UA_Array_copy:
 2639|  88.6k|              void **dst, const UA_DataType *type) {
 2640|  88.6k|    if(size == 0) {
  ------------------
  |  Branch (2640:8): [True: 13.7k, False: 74.9k]
  ------------------
 2641|  13.7k|        if(src == NULL)
  ------------------
  |  Branch (2641:12): [True: 0, False: 13.7k]
  ------------------
 2642|      0|            *dst = NULL;
 2643|  13.7k|        else
 2644|  13.7k|            *dst= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  13.7k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2645|  13.7k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  13.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2646|  13.7k|    }
 2647|       |
 2648|       |    /* Check the array consistency -- defensive programming in case the user
 2649|       |     * manually created an inconsistent array */
 2650|  74.9k|    if(UA_UNLIKELY(!type || !src))
  ------------------
  |  |  591|   149k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (591:25): [True: 0, False: 74.9k]
  |  |  |  Branch (591:43): [True: 0, False: 74.9k]
  |  |  |  Branch (591:43): [True: 0, False: 74.9k]
  |  |  ------------------
  ------------------
 2651|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 2652|       |
 2653|       |    /* calloc, so we don't have to check retval in every iteration of copying */
 2654|  74.9k|    *dst = UA_calloc(size, type->memSize);
  ------------------
  |  |  352|  74.9k|# define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2655|  74.9k|    if(!*dst)
  ------------------
  |  Branch (2655:8): [True: 0, False: 74.9k]
  ------------------
 2656|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2657|       |
 2658|  74.9k|    if(type->pointerFree) {
  ------------------
  |  Branch (2658:8): [True: 74.9k, False: 0]
  ------------------
 2659|  74.9k|        memcpy(*dst, src, type->memSize * size);
 2660|  74.9k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  74.9k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2661|  74.9k|    }
 2662|       |
 2663|      0|    uintptr_t ptrs = (uintptr_t)src;
 2664|      0|    uintptr_t ptrd = (uintptr_t)*dst;
 2665|      0|    UA_StatusCode retval = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2666|      0|    for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2666:23): [True: 0, False: 0]
  ------------------
 2667|      0|        retval |= UA_copy((void*)ptrs, (void*)ptrd, type);
 2668|      0|        ptrs += type->memSize;
 2669|      0|        ptrd += type->memSize;
 2670|      0|    }
 2671|      0|    if(retval != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2671:8): [True: 0, False: 0]
  ------------------
 2672|      0|        UA_Array_delete(*dst, size, type);
 2673|       |        *dst = NULL;
 2674|      0|    }
 2675|      0|    return retval;
 2676|  74.9k|}
UA_Array_delete:
 2767|  4.09M|UA_Array_delete(void *p, size_t size, const UA_DataType *type) {
 2768|  4.09M|    if(!type->pointerFree) {
  ------------------
  |  Branch (2768:8): [True: 27.1k, False: 4.06M]
  ------------------
 2769|  27.1k|        uintptr_t ptr = (uintptr_t)p;
 2770|  2.27M|        for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2770:27): [True: 2.25M, False: 27.1k]
  ------------------
 2771|  2.25M|            UA_clear((void*)ptr, type);
 2772|  2.25M|            ptr += type->memSize;
 2773|  2.25M|        }
 2774|  27.1k|    }
 2775|  4.09M|    UA_free((void*)((uintptr_t)p & ~(uintptr_t)UA_EMPTY_ARRAY_SENTINEL));
  ------------------
  |  |  351|  4.09M|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2776|  4.09M|}
UA_DataType_isNumeric:
 2822|  3.48M|UA_DataType_isNumeric(const UA_DataType *type) {
 2823|  3.48M|    switch(type->typeKind) {
 2824|      0|    case UA_DATATYPEKIND_SBYTE:
  ------------------
  |  Branch (2824:5): [True: 0, False: 3.48M]
  ------------------
 2825|      0|    case UA_DATATYPEKIND_BYTE:
  ------------------
  |  Branch (2825:5): [True: 0, False: 3.48M]
  ------------------
 2826|      0|    case UA_DATATYPEKIND_INT16:
  ------------------
  |  Branch (2826:5): [True: 0, False: 3.48M]
  ------------------
 2827|      0|    case UA_DATATYPEKIND_UINT16:
  ------------------
  |  Branch (2827:5): [True: 0, False: 3.48M]
  ------------------
 2828|      0|    case UA_DATATYPEKIND_INT32:
  ------------------
  |  Branch (2828:5): [True: 0, False: 3.48M]
  ------------------
 2829|  3.48M|    case UA_DATATYPEKIND_UINT32:
  ------------------
  |  Branch (2829:5): [True: 3.48M, False: 0]
  ------------------
 2830|  3.48M|    case UA_DATATYPEKIND_INT64:
  ------------------
  |  Branch (2830:5): [True: 0, False: 3.48M]
  ------------------
 2831|  3.48M|    case UA_DATATYPEKIND_UINT64:
  ------------------
  |  Branch (2831:5): [True: 0, False: 3.48M]
  ------------------
 2832|  3.48M|    case UA_DATATYPEKIND_FLOAT:
  ------------------
  |  Branch (2832:5): [True: 0, False: 3.48M]
  ------------------
 2833|  3.48M|    case UA_DATATYPEKIND_DOUBLE:
  ------------------
  |  Branch (2833:5): [True: 0, False: 3.48M]
  ------------------
 2834|       |    /* not implemented: UA_DATATYPEKIND_DECIMAL */
 2835|  3.48M|        return true;
 2836|      0|    default:
  ------------------
  |  Branch (2836:5): [True: 0, False: 3.48M]
  ------------------
 2837|       |        return false;
 2838|  3.48M|    }
 2839|  3.48M|}
ua_types.c:nodeIdSize:
  920|  38.9k|           UA_Escaping idEsc) {
  921|       |    /* Namespace length */
  922|  38.9k|    size_t len = 0;
  923|  38.9k|    if(nsUri.data != NULL) {
  ------------------
  |  Branch (923:8): [True: 669, False: 38.2k]
  ------------------
  924|    669|        len += 5; /* nsu=; */
  925|    669|        len += UA_String_escapedSize(nsUri, UA_ESCAPING_PERCENT);
  926|  38.2k|    } else if(id->namespaceIndex > 0) {
  ------------------
  |  Branch (926:15): [True: 714, False: 37.5k]
  ------------------
  927|    714|        len += 4; /* ns=; */
  928|    714|        size_t nsStrSize = itoaUnsigned(id->namespaceIndex, (char*)nsStr, 10);
  929|    714|        nsStr[nsStrSize] = 0;
  930|    714|        len += nsStrSize;
  931|    714|    }
  932|       |
  933|  38.9k|    len += 2; /* ?= */
  934|       |
  935|  38.9k|    switch (id->identifierType) {
  936|  4.54k|    case UA_NODEIDTYPE_NUMERIC: {
  ------------------
  |  Branch (936:5): [True: 4.54k, False: 34.4k]
  ------------------
  937|  4.54k|        size_t numIdStrSize = itoaUnsigned(id->identifier.numeric, (char*)numIdStr, 10);
  938|  4.54k|        numIdStr[numIdStrSize] = 0;
  939|  4.54k|        len += numIdStrSize;
  940|  4.54k|        break;
  941|      0|    }
  942|  22.4k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (942:5): [True: 22.4k, False: 16.5k]
  ------------------
  943|  22.4k|        len += UA_String_escapedSize(id->identifier.string, idEsc);
  944|  22.4k|        break;
  945|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (945:5): [True: 0, False: 38.9k]
  ------------------
  946|      0|        len += 36;
  947|      0|        break;
  948|  12.0k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (948:5): [True: 12.0k, False: 26.9k]
  ------------------
  949|  12.0k|        len += 4 * ((id->identifier.byteString.length + 2) / 3);
  950|  12.0k|        break;
  951|      0|    default:
  ------------------
  |  Branch (951:5): [True: 0, False: 38.9k]
  ------------------
  952|      0|        len = 0;
  953|  38.9k|    }
  954|  38.9k|    return len;
  955|  38.9k|}
ua_types.c:printNodeIdBody:
  959|  38.9k|                const UA_NamespaceMapping *nsMapping, UA_Escaping idEsc) {
  960|  38.9k|    size_t len;
  961|       |
  962|       |    /* Encode the namespace */
  963|  38.9k|    if(nsUri.data != NULL) {
  ------------------
  |  Branch (963:8): [True: 669, False: 38.2k]
  ------------------
  964|    669|        memcpy(pos, "nsu=", 4);
  965|    669|        pos += 4;
  966|    669|        pos += UA_String_escapeInsert(pos, nsUri, UA_ESCAPING_PERCENT);
  967|    669|        *pos++ = ';';
  968|  38.2k|    } else if(id->namespaceIndex > 0) {
  ------------------
  |  Branch (968:15): [True: 714, False: 37.5k]
  ------------------
  969|    714|        memcpy(pos, "ns=", 3);
  970|    714|        pos += 3;
  971|    714|        len = strlen((char*)nsStr);
  972|    714|        memcpy(pos, nsStr, len);
  973|    714|        pos += len;
  974|    714|        *pos++ = ';';
  975|    714|    }
  976|       |
  977|       |    /* Encode the identifier */
  978|  38.9k|    switch(id->identifierType) {
  ------------------
  |  Branch (978:12): [True: 38.9k, False: 0]
  ------------------
  979|  4.54k|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (979:5): [True: 4.54k, False: 34.4k]
  ------------------
  980|  4.54k|        memcpy(pos, "i=", 2);
  981|  4.54k|        pos += 2;
  982|  4.54k|        len = strlen((char*)numIdStr);
  983|  4.54k|        memcpy(pos, numIdStr, len);
  984|  4.54k|        pos += len;
  985|  4.54k|        break;
  986|  22.4k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (986:5): [True: 22.4k, False: 16.5k]
  ------------------
  987|  22.4k|        memcpy(pos, "s=", 2);
  988|  22.4k|        pos += 2;
  989|  22.4k|        pos += UA_String_escapeInsert(pos, id->identifier.string, idEsc);
  990|  22.4k|        break;
  991|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (991:5): [True: 0, False: 38.9k]
  ------------------
  992|      0|        memcpy(pos, "g=", 2);
  993|      0|        pos += 2;
  994|      0|        UA_Guid_to_hex(&id->identifier.guid, pos, true);
  995|      0|        pos += 36;
  996|      0|        break;
  997|  12.0k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (997:5): [True: 12.0k, False: 26.9k]
  ------------------
  998|  12.0k|        memcpy(pos, "b=", 2);
  999|  12.0k|        pos += 2;
 1000|       |        /* Use base64url encoding for percent-escaping.
 1001|       |         * Replace +/ with -_ and remove the padding. */
 1002|  12.0k|        u8 *bpos = pos;
 1003|  12.0k|        pos += UA_base64_buf(id->identifier.byteString.data,
 1004|  12.0k|                             id->identifier.byteString.length, pos);
 1005|  12.0k|        if(idEsc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (1005:12): [True: 0, False: 12.0k]
  ------------------
 1006|  12.0k|           idEsc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (1006:12): [True: 0, False: 12.0k]
  ------------------
 1007|      0|            while(pos > bpos && pos[-1] == '=')
  ------------------
  |  Branch (1007:19): [True: 0, False: 0]
  |  Branch (1007:33): [True: 0, False: 0]
  ------------------
 1008|      0|                pos--;
 1009|      0|            for(; bpos < pos; bpos++) {
  ------------------
  |  Branch (1009:19): [True: 0, False: 0]
  ------------------
 1010|      0|                if(*bpos == '+') *bpos = '-';
  ------------------
  |  Branch (1010:20): [True: 0, False: 0]
  ------------------
 1011|      0|                else if(*bpos == '/') *bpos = '_';
  ------------------
  |  Branch (1011:25): [True: 0, False: 0]
  ------------------
 1012|      0|            }
 1013|      0|        }
 1014|  12.0k|        break;
 1015|  38.9k|    }
 1016|  38.9k|    return pos;
 1017|  38.9k|}
ua_types.c:Variant_clear:
 1369|   248k|Variant_clear(UA_Variant *p, const UA_DataType *_) {
 1370|       |    /* The content is "borrowed" */
 1371|   248k|    if(p->storageType == UA_VARIANT_DATA_NODELETE)
  ------------------
  |  Branch (1371:8): [True: 0, False: 248k]
  ------------------
 1372|      0|        return;
 1373|       |
 1374|       |    /* Delete the value */
 1375|   248k|    if(p->type && p->data > UA_EMPTY_ARRAY_SENTINEL) {
  ------------------
  |  |  755|  72.6k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1375:8): [True: 72.6k, False: 176k]
  |  Branch (1375:19): [True: 64.8k, False: 7.82k]
  ------------------
 1376|  64.8k|        if(p->arrayLength == 0)
  ------------------
  |  Branch (1376:12): [True: 58.3k, False: 6.49k]
  ------------------
 1377|  58.3k|            p->arrayLength = 1;
 1378|  64.8k|        UA_Array_delete(p->data, p->arrayLength, p->type);
 1379|  64.8k|        p->data = NULL;
 1380|  64.8k|    }
 1381|       |
 1382|       |    /* Delete the array dimensions */
 1383|   248k|    if((void*)p->arrayDimensions > UA_EMPTY_ARRAY_SENTINEL)
  ------------------
  |  |  755|   248k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1383:8): [True: 3.48k, False: 245k]
  ------------------
 1384|  3.48k|        UA_free(p->arrayDimensions);
  ------------------
  |  |  351|  3.48k|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1385|   248k|}
ua_types.c:DataValue_clear:
 1827|   107k|DataValue_clear(UA_DataValue *p, const UA_DataType *_) {
 1828|       |    Variant_clear(&p->value, NULL);
 1829|   107k|}
ua_types.c:String_copy:
  280|  88.6k|String_copy(UA_String const *src, UA_String *dst, const UA_DataType *_) {
  281|  88.6k|    UA_StatusCode res =
  282|  88.6k|        UA_Array_copy(src->data, src->length, (void**)&dst->data,
  283|  88.6k|                      &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|  88.6k|#define UA_TYPES_BYTE 2
  ------------------
  284|  88.6k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  88.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (284:8): [True: 88.6k, False: 0]
  ------------------
  285|  88.6k|        dst->length = src->length;
  286|  88.6k|    return res;
  287|  88.6k|}
ua_types.c:String_clear:
  290|  4.02M|String_clear(UA_String *s, const UA_DataType *_) {
  291|  4.02M|    UA_Array_delete(s->data, s->length, &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|  4.02M|#define UA_TYPES_BYTE 2
  ------------------
  292|  4.02M|}
ua_types.c:NodeId_clear:
  772|   151k|NodeId_clear(UA_NodeId *p, const UA_DataType *_) {
  773|   151k|    switch(p->identifierType) {
  774|  15.1k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (774:5): [True: 15.1k, False: 135k]
  ------------------
  775|  23.3k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (775:5): [True: 8.20k, False: 142k]
  ------------------
  776|  23.3k|        String_clear(&p->identifier.string, NULL);
  777|  23.3k|        break;
  778|   127k|    default: break;
  ------------------
  |  Branch (778:5): [True: 127k, False: 23.3k]
  ------------------
  779|   151k|    }
  780|   151k|}
ua_types.c:ExpandedNodeId_clear:
 1070|  20.3k|ExpandedNodeId_clear(UA_ExpandedNodeId *p, const UA_DataType *_) {
 1071|  20.3k|    NodeId_clear(&p->nodeId, _);
 1072|       |    String_clear(&p->namespaceUri, NULL);
 1073|  20.3k|}
ua_types.c:QualifiedName_clear:
  392|  78.2k|QualifiedName_clear(UA_QualifiedName *p, const UA_DataType *_) {
  393|       |    String_clear(&p->name, NULL);
  394|  78.2k|}
ua_types.c:LocalizedText_clear:
 1812|  1.76M|LocalizedText_clear(UA_LocalizedText *p, const UA_DataType *_) {
 1813|  1.76M|    String_clear(&p->locale, NULL);
 1814|       |    String_clear(&p->text, NULL);
 1815|  1.76M|}
ua_types.c:ExtensionObject_clear:
 1241|   124k|ExtensionObject_clear(UA_ExtensionObject *p, const UA_DataType *_) {
 1242|   124k|    switch(p->encoding) {
 1243|   124k|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (1243:5): [True: 124k, False: 0]
  ------------------
 1244|   124k|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (1244:5): [True: 0, False: 124k]
  ------------------
 1245|   124k|    case UA_EXTENSIONOBJECT_ENCODED_XML:
  ------------------
  |  Branch (1245:5): [True: 0, False: 124k]
  ------------------
 1246|   124k|        NodeId_clear(&p->content.encoded.typeId, NULL);
 1247|   124k|        String_clear(&p->content.encoded.body, NULL);
 1248|   124k|        break;
 1249|      0|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (1249:5): [True: 0, False: 124k]
  ------------------
 1250|      0|        if(p->content.decoded.data)
  ------------------
  |  Branch (1250:12): [True: 0, False: 0]
  ------------------
 1251|      0|            UA_delete(p->content.decoded.data, p->content.decoded.type);
 1252|      0|        break;
 1253|      0|    default:
  ------------------
  |  Branch (1253:5): [True: 0, False: 124k]
  ------------------
 1254|      0|        break;
 1255|   124k|    }
 1256|   124k|}
ua_types.c:DiagnosticInfo_clear:
 1855|  1.44k|DiagnosticInfo_clear(UA_DiagnosticInfo *p, const UA_DataType *_) {
 1856|  1.44k|    String_clear(&p->additionalInfo, NULL);
 1857|  1.44k|    if(p->hasInnerDiagnosticInfo && p->innerDiagnosticInfo) {
  ------------------
  |  Branch (1857:8): [True: 0, False: 1.44k]
  |  Branch (1857:37): [True: 0, False: 0]
  ------------------
 1858|      0|        DiagnosticInfo_clear(p->innerDiagnosticInfo, NULL);
 1859|      0|        UA_free(p->innerDiagnosticInfo);
  ------------------
  |  |  351|      0|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1860|      0|    }
 1861|  1.44k|}
ua_types.c:guidOrder:
 2216|    835|guidOrder(const UA_Guid *p1, const UA_Guid *p2, const UA_DataType *type) {
 2217|    835|    if(p1->data1 != p2->data1)
  ------------------
  |  Branch (2217:8): [True: 0, False: 835]
  ------------------
 2218|      0|        return (p1->data1 < p2->data1) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2218:16): [True: 0, False: 0]
  ------------------
 2219|    835|    if(p1->data2 != p2->data2)
  ------------------
  |  Branch (2219:8): [True: 0, False: 835]
  ------------------
 2220|      0|        return (p1->data2 < p2->data2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2220:16): [True: 0, False: 0]
  ------------------
 2221|    835|    if(p1->data3 != p2->data3)
  ------------------
  |  Branch (2221:8): [True: 0, False: 835]
  ------------------
 2222|      0|        return (p1->data3 < p2->data3) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2222:16): [True: 0, False: 0]
  ------------------
 2223|    835|    int cmp = memcmp(p1->data4, p2->data4, 8);
 2224|    835|    if(cmp != 0)
  ------------------
  |  Branch (2224:8): [True: 0, False: 835]
  ------------------
 2225|      0|        return (cmp < 0) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2225:16): [True: 0, False: 0]
  ------------------
 2226|    835|    return UA_ORDER_EQ;
 2227|    835|}
ua_types.c:nodeIdOrder:
 2245|  12.9k|nodeIdOrder(const UA_NodeId *p1, const UA_NodeId *p2, const UA_DataType *_) {
 2246|       |    /* Compare namespaceIndex */
 2247|  12.9k|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2247:8): [True: 0, False: 12.9k]
  ------------------
 2248|      0|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2248:16): [True: 0, False: 0]
  ------------------
 2249|       |
 2250|       |    /* Compare identifierType */
 2251|  12.9k|    if(p1->identifierType != p2->identifierType)
  ------------------
  |  Branch (2251:8): [True: 0, False: 12.9k]
  ------------------
 2252|      0|        return (p1->identifierType < p2->identifierType) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2252:16): [True: 0, False: 0]
  ------------------
 2253|       |
 2254|       |    /* Compare the identifier */
 2255|  12.9k|    switch(p1->identifierType) {
 2256|  1.51k|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (2256:5): [True: 1.51k, False: 11.4k]
  ------------------
 2257|  1.51k|    default:
  ------------------
  |  Branch (2257:5): [True: 0, False: 12.9k]
  ------------------
 2258|  1.51k|        if(p1->identifier.numeric != p2->identifier.numeric)
  ------------------
  |  Branch (2258:12): [True: 0, False: 1.51k]
  ------------------
 2259|      0|            return (p1->identifier.numeric < p2->identifier.numeric) ?
  ------------------
  |  Branch (2259:20): [True: 0, False: 0]
  ------------------
 2260|      0|                UA_ORDER_LESS : UA_ORDER_MORE;
 2261|  1.51k|        return UA_ORDER_EQ;
 2262|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (2262:5): [True: 0, False: 12.9k]
  ------------------
 2263|      0|        return guidOrder(&p1->identifier.guid, &p2->identifier.guid, NULL);
 2264|  7.46k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (2264:5): [True: 7.46k, False: 5.51k]
  ------------------
 2265|  11.4k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (2265:5): [True: 4.00k, False: 8.98k]
  ------------------
 2266|       |        return stringOrder(&p1->identifier.string, &p2->identifier.string, NULL);
 2267|  12.9k|    }
 2268|  12.9k|}
ua_types.c:expandedNodeIdOrder:
 2272|  9.88k|                    const UA_DataType *_) {
 2273|  9.88k|    if(p1->serverIndex != p2->serverIndex)
  ------------------
  |  Branch (2273:8): [True: 0, False: 9.88k]
  ------------------
 2274|      0|        return (p1->serverIndex < p2->serverIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2274:16): [True: 0, False: 0]
  ------------------
 2275|  9.88k|    UA_Order o = stringOrder(&p1->namespaceUri, &p2->namespaceUri, NULL);
 2276|  9.88k|    if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2276:8): [True: 0, False: 9.88k]
  ------------------
 2277|      0|        return o;
 2278|  9.88k|    return nodeIdOrder(&p1->nodeId, &p2->nodeId, NULL);
 2279|  9.88k|}
ua_types.c:booleanOrder:
 2178|  3.60k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2179|  3.60k|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2179:12): [True: 0, False: 3.60k]
  ------------------
 2180|  3.60k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2180:20): [True: 0, False: 0]
  ------------------
 2181|  3.60k|        return UA_ORDER_EQ;                                         \
 2182|  3.60k|    }
ua_types.c:sByteOrder:
 2178|   221k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2179|   221k|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2179:12): [True: 0, False: 221k]
  ------------------
 2180|   221k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2180:20): [True: 0, False: 0]
  ------------------
 2181|   221k|        return UA_ORDER_EQ;                                         \
 2182|   221k|    }
ua_types.c:byteOrder:
 2178|  2.81k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2179|  2.81k|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2179:12): [True: 0, False: 2.81k]
  ------------------
 2180|  2.81k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2180:20): [True: 0, False: 0]
  ------------------
 2181|  2.81k|        return UA_ORDER_EQ;                                         \
 2182|  2.81k|    }
ua_types.c:int16Order:
 2178|  76.8k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2179|  76.8k|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2179:12): [True: 0, False: 76.8k]
  ------------------
 2180|  76.8k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2180:20): [True: 0, False: 0]
  ------------------
 2181|  76.8k|        return UA_ORDER_EQ;                                         \
 2182|  76.8k|    }
ua_types.c:uInt16Order:
 2178|  37.0k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2179|  37.0k|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2179:12): [True: 0, False: 37.0k]
  ------------------
 2180|  37.0k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2180:20): [True: 0, False: 0]
  ------------------
 2181|  37.0k|        return UA_ORDER_EQ;                                         \
 2182|  37.0k|    }
ua_types.c:int32Order:
 2178|   790k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2179|   790k|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2179:12): [True: 0, False: 790k]
  ------------------
 2180|   790k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2180:20): [True: 0, False: 0]
  ------------------
 2181|   790k|        return UA_ORDER_EQ;                                         \
 2182|   790k|    }
ua_types.c:uInt32Order:
 2178|  1.16M|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2179|  1.16M|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2179:12): [True: 0, False: 1.16M]
  ------------------
 2180|  1.16M|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2180:20): [True: 0, False: 0]
  ------------------
 2181|  1.16M|        return UA_ORDER_EQ;                                         \
 2182|  1.16M|    }
ua_types.c:int64Order:
 2178|   697k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2179|   697k|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2179:12): [True: 0, False: 697k]
  ------------------
 2180|   697k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2180:20): [True: 0, False: 0]
  ------------------
 2181|   697k|        return UA_ORDER_EQ;                                         \
 2182|   697k|    }
ua_types.c:uInt64Order:
 2178|  1.64M|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2179|  1.64M|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2179:12): [True: 0, False: 1.64M]
  ------------------
 2180|  1.64M|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2180:20): [True: 0, False: 0]
  ------------------
 2181|  1.64M|        return UA_ORDER_EQ;                                         \
 2182|  1.64M|    }
ua_types.c:floatOrder:
 2196|   607k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2197|   607k|        if(*p1 != *p2) {                                            \
  ------------------
  |  Branch (2197:12): [True: 3.89k, False: 604k]
  ------------------
 2198|  3.89k|            /* p1 is NaN */                                         \
 2199|  3.89k|            if(*p1 != *p1) {                                        \
  ------------------
  |  Branch (2199:16): [True: 3.89k, False: 0]
  ------------------
 2200|  3.89k|                if(*p2 != *p2)                                      \
  ------------------
  |  Branch (2200:20): [True: 3.89k, False: 0]
  ------------------
 2201|  3.89k|                    return UA_ORDER_EQ;                             \
 2202|  3.89k|                return UA_ORDER_LESS;                               \
 2203|  3.89k|            }                                                       \
 2204|  3.89k|            /* p2 is NaN */                                         \
 2205|  3.89k|            if(*p2 != *p2)                                          \
  ------------------
  |  Branch (2205:16): [True: 0, False: 0]
  ------------------
 2206|      0|                return UA_ORDER_MORE;                               \
 2207|      0|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2207:20): [True: 0, False: 0]
  ------------------
 2208|      0|        }                                                           \
 2209|   607k|        return UA_ORDER_EQ;                                         \
 2210|   607k|    }
ua_types.c:doubleOrder:
 2196|  6.27k|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2197|  6.27k|        if(*p1 != *p2) {                                            \
  ------------------
  |  Branch (2197:12): [True: 627, False: 5.64k]
  ------------------
 2198|    627|            /* p1 is NaN */                                         \
 2199|    627|            if(*p1 != *p1) {                                        \
  ------------------
  |  Branch (2199:16): [True: 627, False: 0]
  ------------------
 2200|    627|                if(*p2 != *p2)                                      \
  ------------------
  |  Branch (2200:20): [True: 627, False: 0]
  ------------------
 2201|    627|                    return UA_ORDER_EQ;                             \
 2202|    627|                return UA_ORDER_LESS;                               \
 2203|    627|            }                                                       \
 2204|    627|            /* p2 is NaN */                                         \
 2205|    627|            if(*p2 != *p2)                                          \
  ------------------
  |  Branch (2205:16): [True: 0, False: 0]
  ------------------
 2206|      0|                return UA_ORDER_MORE;                               \
 2207|      0|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2207:20): [True: 0, False: 0]
  ------------------
 2208|      0|        }                                                           \
 2209|  6.27k|        return UA_ORDER_EQ;                                         \
 2210|  6.27k|    }
ua_types.c:stringOrder:
 2230|  1.82M|stringOrder(const UA_String *p1, const UA_String *p2, const UA_DataType *type) {
 2231|  1.82M|    if(p1->length != p2->length)
  ------------------
  |  Branch (2231:8): [True: 0, False: 1.82M]
  ------------------
 2232|      0|        return (p1->length < p2->length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2232:16): [True: 0, False: 0]
  ------------------
 2233|       |    /* For zero-length arrays, every pointer not NULL is considered a
 2234|       |     * UA_EMPTY_ARRAY_SENTINEL. */
 2235|  1.82M|    if(p1->data == p2->data) return UA_ORDER_EQ;
  ------------------
  |  Branch (2235:8): [True: 1.78M, False: 31.0k]
  ------------------
 2236|  31.0k|    if(p1->data == NULL) return UA_ORDER_LESS;
  ------------------
  |  Branch (2236:8): [True: 0, False: 31.0k]
  ------------------
 2237|  31.0k|    if(p2->data == NULL) return UA_ORDER_MORE;
  ------------------
  |  Branch (2237:8): [True: 0, False: 31.0k]
  ------------------
 2238|  31.0k|    int cmp = memcmp((const char*)p1->data, (const char*)p2->data, p1->length);
 2239|  31.0k|    if(cmp != 0)
  ------------------
  |  Branch (2239:8): [True: 0, False: 31.0k]
  ------------------
 2240|      0|        return (cmp < 0) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2240:16): [True: 0, False: 0]
  ------------------
 2241|  31.0k|    return UA_ORDER_EQ;
 2242|  31.0k|}
ua_types.c:qualifiedNameOrder:
 2283|  29.6k|                   const UA_DataType *_) {
 2284|  29.6k|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2284:8): [True: 0, False: 29.6k]
  ------------------
 2285|      0|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2285:16): [True: 0, False: 0]
  ------------------
 2286|  29.6k|    return stringOrder(&p1->name, &p2->name, NULL);
 2287|  29.6k|}
ua_types.c:localizedTextOrder:
 2291|   881k|                   const UA_DataType *_) {
 2292|   881k|    UA_Order o = stringOrder(&p1->locale, &p2->locale, NULL);
 2293|   881k|    if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2293:8): [True: 0, False: 881k]
  ------------------
 2294|      0|        return o;
 2295|   881k|    return stringOrder(&p1->text, &p2->text, NULL);
 2296|   881k|}
ua_types.c:extensionObjectOrder:
 2300|  55.6k|                     const UA_DataType *_) {
 2301|  55.6k|    UA_ExtensionObjectEncoding enc1 = p1->encoding;
 2302|  55.6k|    UA_ExtensionObjectEncoding enc2 = p2->encoding;
 2303|  55.6k|    if(enc1 > UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2303:8): [True: 0, False: 55.6k]
  ------------------
 2304|      0|        enc1 = UA_EXTENSIONOBJECT_DECODED;
 2305|  55.6k|    if(enc2 > UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2305:8): [True: 0, False: 55.6k]
  ------------------
 2306|      0|        enc2 = UA_EXTENSIONOBJECT_DECODED;
 2307|  55.6k|    if(enc1 != enc2)
  ------------------
  |  Branch (2307:8): [True: 0, False: 55.6k]
  ------------------
 2308|      0|        return (enc1 < enc2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2308:16): [True: 0, False: 0]
  ------------------
 2309|       |
 2310|  55.6k|    switch(enc1) {
 2311|  55.6k|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (2311:5): [True: 55.6k, False: 0]
  ------------------
 2312|  55.6k|        return UA_ORDER_EQ;
 2313|       |
 2314|      0|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (2314:5): [True: 0, False: 55.6k]
  ------------------
 2315|      0|    case UA_EXTENSIONOBJECT_ENCODED_XML: {
  ------------------
  |  Branch (2315:5): [True: 0, False: 55.6k]
  ------------------
 2316|      0|            UA_Order o = nodeIdOrder(&p1->content.encoded.typeId,
 2317|      0|                                     &p2->content.encoded.typeId, NULL);
 2318|      0|            if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2318:16): [True: 0, False: 0]
  ------------------
 2319|      0|                return o;
 2320|      0|            return stringOrder((const UA_String*)&p1->content.encoded.body,
 2321|      0|                               (const UA_String*)&p2->content.encoded.body, NULL);
 2322|      0|        }
 2323|       |
 2324|      0|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (2324:5): [True: 0, False: 55.6k]
  ------------------
 2325|      0|    default: {
  ------------------
  |  Branch (2325:5): [True: 0, False: 55.6k]
  ------------------
 2326|      0|            const UA_DataType *type1 = p1->content.decoded.type;
 2327|      0|            const UA_DataType *type2 = p2->content.decoded.type;
 2328|      0|            if(type1 != type2)
  ------------------
  |  Branch (2328:16): [True: 0, False: 0]
  ------------------
 2329|      0|                return ((uintptr_t)type1 < (uintptr_t)type2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2329:24): [True: 0, False: 0]
  ------------------
 2330|      0|            if(!type1)
  ------------------
  |  Branch (2330:16): [True: 0, False: 0]
  ------------------
 2331|      0|                return UA_ORDER_EQ;
 2332|      0|            return orderJumpTable[type1->typeKind]
 2333|      0|                (p1->content.decoded.data, p2->content.decoded.data, type1);
 2334|      0|        }
 2335|  55.6k|    }
 2336|  55.6k|}
ua_types.c:dataValueOrder:
 2398|  51.7k|dataValueOrder(const UA_DataValue *p1, const UA_DataValue *p2, const UA_DataType *_) {
 2399|       |    /* Value */
 2400|  51.7k|    if(p1->hasValue != p2->hasValue)
  ------------------
  |  Branch (2400:8): [True: 0, False: 51.7k]
  ------------------
 2401|      0|        return (!p1->hasValue) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2401:16): [True: 0, False: 0]
  ------------------
 2402|  51.7k|    if(p1->hasValue) {
  ------------------
  |  Branch (2402:8): [True: 14.0k, False: 37.7k]
  ------------------
 2403|  14.0k|        UA_Order o = variantOrder(&p1->value, &p2->value, NULL);
 2404|  14.0k|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2404:12): [True: 0, False: 14.0k]
  ------------------
 2405|      0|            return o;
 2406|  14.0k|    }
 2407|       |
 2408|       |    /* Status */
 2409|  51.7k|    if(p1->hasStatus != p2->hasStatus)
  ------------------
  |  Branch (2409:8): [True: 0, False: 51.7k]
  ------------------
 2410|      0|        return (!p1->hasStatus) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2410:16): [True: 0, False: 0]
  ------------------
 2411|  51.7k|    if(p1->hasStatus && p1->status != p2->status)
  ------------------
  |  Branch (2411:8): [True: 7, False: 51.7k]
  |  Branch (2411:25): [True: 0, False: 7]
  ------------------
 2412|      0|        return (p1->status < p2->status) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2412:16): [True: 0, False: 0]
  ------------------
 2413|       |
 2414|       |    /* SourceTimestamp */
 2415|  51.7k|    if(p1->hasSourceTimestamp != p2->hasSourceTimestamp)
  ------------------
  |  Branch (2415:8): [True: 0, False: 51.7k]
  ------------------
 2416|      0|        return (!p1->hasSourceTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2416:16): [True: 0, False: 0]
  ------------------
 2417|  51.7k|    if(p1->hasSourceTimestamp && p1->sourceTimestamp != p2->sourceTimestamp)
  ------------------
  |  Branch (2417:8): [True: 0, False: 51.7k]
  |  Branch (2417:34): [True: 0, False: 0]
  ------------------
 2418|      0|        return (p1->sourceTimestamp < p2->sourceTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2418:16): [True: 0, False: 0]
  ------------------
 2419|       |
 2420|       |    /* ServerTimestamp */
 2421|  51.7k|    if(p1->hasServerTimestamp != p2->hasServerTimestamp)
  ------------------
  |  Branch (2421:8): [True: 0, False: 51.7k]
  ------------------
 2422|      0|        return (!p1->hasServerTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2422:16): [True: 0, False: 0]
  ------------------
 2423|  51.7k|    if(p1->hasServerTimestamp && p1->serverTimestamp != p2->serverTimestamp)
  ------------------
  |  Branch (2423:8): [True: 0, False: 51.7k]
  |  Branch (2423:34): [True: 0, False: 0]
  ------------------
 2424|      0|        return (p1->serverTimestamp < p2->serverTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2424:16): [True: 0, False: 0]
  ------------------
 2425|       |
 2426|       |    /* SourcePicoseconds */
 2427|  51.7k|    if(p1->hasSourcePicoseconds != p2->hasSourcePicoseconds)
  ------------------
  |  Branch (2427:8): [True: 0, False: 51.7k]
  ------------------
 2428|      0|        return (!p1->hasSourcePicoseconds) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2428:16): [True: 0, False: 0]
  ------------------
 2429|  51.7k|    if(p1->hasSourcePicoseconds && p1->sourcePicoseconds != p2->sourcePicoseconds)
  ------------------
  |  Branch (2429:8): [True: 0, False: 51.7k]
  |  Branch (2429:36): [True: 0, False: 0]
  ------------------
 2430|      0|        return (p1->sourcePicoseconds < p2->sourcePicoseconds) ?
  ------------------
  |  Branch (2430:16): [True: 0, False: 0]
  ------------------
 2431|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2432|       |
 2433|       |    /* ServerPicoseconds */
 2434|  51.7k|    if(p1->hasServerPicoseconds != p2->hasServerPicoseconds)
  ------------------
  |  Branch (2434:8): [True: 0, False: 51.7k]
  ------------------
 2435|      0|        return (!p1->hasServerPicoseconds) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2435:16): [True: 0, False: 0]
  ------------------
 2436|  51.7k|    if(p1->hasServerPicoseconds && p1->serverPicoseconds != p2->serverPicoseconds)
  ------------------
  |  Branch (2436:8): [True: 0, False: 51.7k]
  |  Branch (2436:36): [True: 0, False: 0]
  ------------------
 2437|      0|        return (p1->serverPicoseconds < p2->serverPicoseconds) ?
  ------------------
  |  Branch (2437:16): [True: 0, False: 0]
  ------------------
 2438|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2439|       |
 2440|  51.7k|    return UA_ORDER_EQ;
 2441|  51.7k|}
ua_types.c:variantOrder:
 2363|  80.4k|variantOrder(const UA_Variant *p1, const UA_Variant *p2, const UA_DataType *_) {
 2364|  80.4k|    if(p1->type != p2->type)
  ------------------
  |  Branch (2364:8): [True: 0, False: 80.4k]
  ------------------
 2365|      0|        return ((uintptr_t)p1->type < (uintptr_t)p2->type) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2365:16): [True: 0, False: 0]
  ------------------
 2366|       |
 2367|  80.4k|    UA_Order o;
 2368|  80.4k|    if(p1->type != NULL) {
  ------------------
  |  Branch (2368:8): [True: 34.7k, False: 45.6k]
  ------------------
 2369|       |        /* Check if both variants are scalars or arrays */
 2370|  34.7k|        UA_Boolean s1 = UA_Variant_isScalar(p1);
 2371|  34.7k|        UA_Boolean s2 = UA_Variant_isScalar(p2);
 2372|  34.7k|        if(s1 != s2)
  ------------------
  |  Branch (2372:12): [True: 0, False: 34.7k]
  ------------------
 2373|      0|            return s1 ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2373:20): [True: 0, False: 0]
  ------------------
 2374|  34.7k|        if(s1) {
  ------------------
  |  Branch (2374:12): [True: 27.9k, False: 6.77k]
  ------------------
 2375|  27.9k|            o = orderJumpTable[p1->type->typeKind](p1->data, p2->data, p1->type);
 2376|  27.9k|        } else {
 2377|       |            /* Mismatching array length? */
 2378|  6.77k|            if(p1->arrayLength != p2->arrayLength)
  ------------------
  |  Branch (2378:16): [True: 0, False: 6.77k]
  ------------------
 2379|      0|                return (p1->arrayLength < p2->arrayLength) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2379:24): [True: 0, False: 0]
  ------------------
 2380|  6.77k|            o = arrayOrder(p1->data, p1->arrayLength, p2->data, p2->arrayLength, p1->type);
 2381|  6.77k|        }
 2382|  34.7k|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2382:12): [True: 0, False: 34.7k]
  ------------------
 2383|      0|            return o;
 2384|  34.7k|    }
 2385|       |
 2386|  80.4k|    if(p1->arrayDimensionsSize != p2->arrayDimensionsSize)
  ------------------
  |  Branch (2386:8): [True: 0, False: 80.4k]
  ------------------
 2387|      0|        return (p1->arrayDimensionsSize < p2->arrayDimensionsSize) ?
  ------------------
  |  Branch (2387:16): [True: 0, False: 0]
  ------------------
 2388|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2389|  80.4k|    o = UA_ORDER_EQ;
 2390|  80.4k|    if(p1->arrayDimensionsSize > 0)
  ------------------
  |  Branch (2390:8): [True: 1.65k, False: 78.7k]
  ------------------
 2391|  1.65k|        o = arrayOrder(p1->arrayDimensions, p1->arrayDimensionsSize,
 2392|  1.65k|                       p2->arrayDimensions, p2->arrayDimensionsSize,
 2393|  1.65k|                       &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  225|  1.65k|#define UA_TYPES_UINT32 6
  ------------------
 2394|  80.4k|    return o;
 2395|  80.4k|}
ua_types.c:arrayOrder:
 2347|  8.42k|           const UA_DataType *type) {
 2348|  8.42k|    if(p1Length != p2Length)
  ------------------
  |  Branch (2348:8): [True: 0, False: 8.42k]
  ------------------
 2349|      0|        return (p1Length < p2Length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2349:16): [True: 0, False: 0]
  ------------------
 2350|  8.42k|    uintptr_t u1 = (uintptr_t)p1;
 2351|  8.42k|    uintptr_t u2 = (uintptr_t)p2;
 2352|  6.33M|    for(size_t i = 0; i < p1Length; i++) {
  ------------------
  |  Branch (2352:23): [True: 6.32M, False: 8.42k]
  ------------------
 2353|  6.32M|        UA_Order o = orderJumpTable[type->typeKind]((const void*)u1, (const void*)u2, type);
 2354|  6.32M|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2354:12): [True: 0, False: 6.32M]
  ------------------
 2355|      0|            return o;
 2356|  6.32M|        u1 += type->memSize;
 2357|  6.32M|        u2 += type->memSize;
 2358|  6.32M|    }
 2359|  8.42k|    return UA_ORDER_EQ;
 2360|  8.42k|}
ua_types.c:diagnosticInfoOrder:
 2445|    718|                    const UA_DataType *_) {
 2446|       |    /* SymbolicId */
 2447|    718|    if(p1->hasSymbolicId != p2->hasSymbolicId)
  ------------------
  |  Branch (2447:8): [True: 0, False: 718]
  ------------------
 2448|      0|        return (!p1->hasSymbolicId) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2448:16): [True: 0, False: 0]
  ------------------
 2449|    718|    if(p1->hasSymbolicId && p1->symbolicId != p2->symbolicId)
  ------------------
  |  Branch (2449:8): [True: 0, False: 718]
  |  Branch (2449:29): [True: 0, False: 0]
  ------------------
 2450|      0|        return (p1->symbolicId < p2->symbolicId) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2450:16): [True: 0, False: 0]
  ------------------
 2451|       |
 2452|       |    /* NamespaceUri */
 2453|    718|    if(p1->hasNamespaceUri != p2->hasNamespaceUri)
  ------------------
  |  Branch (2453:8): [True: 0, False: 718]
  ------------------
 2454|      0|        return (!p1->hasNamespaceUri) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2454:16): [True: 0, False: 0]
  ------------------
 2455|    718|    if(p1->hasNamespaceUri && p1->namespaceUri != p2->namespaceUri)
  ------------------
  |  Branch (2455:8): [True: 1, False: 717]
  |  Branch (2455:31): [True: 0, False: 1]
  ------------------
 2456|      0|        return (p1->namespaceUri < p2->namespaceUri) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2456:16): [True: 0, False: 0]
  ------------------
 2457|       |
 2458|       |    /* LocalizedText */
 2459|    718|    if(p1->hasLocalizedText != p2->hasLocalizedText)
  ------------------
  |  Branch (2459:8): [True: 0, False: 718]
  ------------------
 2460|      0|        return (!p1->hasLocalizedText) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2460:16): [True: 0, False: 0]
  ------------------
 2461|    718|    if(p1->hasLocalizedText && p1->localizedText != p2->localizedText)
  ------------------
  |  Branch (2461:8): [True: 0, False: 718]
  |  Branch (2461:32): [True: 0, False: 0]
  ------------------
 2462|      0|        return (p1->localizedText < p2->localizedText) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2462:16): [True: 0, False: 0]
  ------------------
 2463|       |
 2464|       |    /* Locale */
 2465|    718|    if(p1->hasLocale != p2->hasLocale)
  ------------------
  |  Branch (2465:8): [True: 0, False: 718]
  ------------------
 2466|      0|        return (!p1->hasLocale) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2466:16): [True: 0, False: 0]
  ------------------
 2467|    718|    if(p1->hasLocale && p1->locale != p2->locale)
  ------------------
  |  Branch (2467:8): [True: 0, False: 718]
  |  Branch (2467:25): [True: 0, False: 0]
  ------------------
 2468|      0|        return (p1->locale < p2->locale) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2468:16): [True: 0, False: 0]
  ------------------
 2469|       |
 2470|       |    /* AdditionalInfo */
 2471|    718|    if(p1->hasAdditionalInfo != p2->hasAdditionalInfo)
  ------------------
  |  Branch (2471:8): [True: 0, False: 718]
  ------------------
 2472|      0|        return (!p1->hasAdditionalInfo) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2472:16): [True: 0, False: 0]
  ------------------
 2473|    718|    if(p1->hasAdditionalInfo) {
  ------------------
  |  Branch (2473:8): [True: 0, False: 718]
  ------------------
 2474|      0|        UA_Order o = stringOrder(&p1->additionalInfo, &p2->additionalInfo, NULL);
 2475|      0|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2475:12): [True: 0, False: 0]
  ------------------
 2476|      0|            return o;
 2477|      0|    }
 2478|       |
 2479|       |    /* InnerStatusCode */
 2480|    718|    if(p1->hasInnerStatusCode != p2->hasInnerStatusCode)
  ------------------
  |  Branch (2480:8): [True: 0, False: 718]
  ------------------
 2481|      0|        return (!p1->hasInnerStatusCode) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2481:16): [True: 0, False: 0]
  ------------------
 2482|    718|    if(p1->hasInnerStatusCode && p1->innerStatusCode != p2->innerStatusCode)
  ------------------
  |  Branch (2482:8): [True: 0, False: 718]
  |  Branch (2482:34): [True: 0, False: 0]
  ------------------
 2483|      0|        return (p1->innerStatusCode < p2->innerStatusCode) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2483:16): [True: 0, False: 0]
  ------------------
 2484|       |
 2485|       |    /* InnerDiagnosticInfo */
 2486|    718|    if(p1->hasInnerDiagnosticInfo != p2->hasInnerDiagnosticInfo)
  ------------------
  |  Branch (2486:8): [True: 0, False: 718]
  ------------------
 2487|      0|        return (!p1->hasInnerDiagnosticInfo) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2487:16): [True: 0, False: 0]
  ------------------
 2488|    718|    if(p1->innerDiagnosticInfo == p2->innerDiagnosticInfo)
  ------------------
  |  Branch (2488:8): [True: 718, False: 0]
  ------------------
 2489|    718|        return UA_ORDER_EQ;
 2490|      0|    if(!p1->innerDiagnosticInfo || !p2->innerDiagnosticInfo)
  ------------------
  |  Branch (2490:8): [True: 0, False: 0]
  |  Branch (2490:36): [True: 0, False: 0]
  ------------------
 2491|      0|        return (!p1->innerDiagnosticInfo) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2491:16): [True: 0, False: 0]
  ------------------
 2492|      0|    return diagnosticInfoOrder(p1->innerDiagnosticInfo, p2->innerDiagnosticInfo, NULL);
 2493|      0|}

writeJsonBeforeElement:
   82|  24.4M|writeJsonBeforeElement(CtxJson *ctx, UA_Boolean distinct) {
   83|  24.4M|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  24.4M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   84|       |    /* Comma if needed */
   85|  24.4M|    if(ctx->commaNeeded[ctx->depth])
  ------------------
  |  Branch (85:8): [True: 21.7M, False: 2.76M]
  ------------------
   86|  21.7M|        res |= writeChar(ctx, ',');
   87|  24.4M|    if(ctx->prettyPrint) {
  ------------------
  |  Branch (87:8): [True: 0, False: 24.4M]
  ------------------
   88|      0|        if(distinct) {
  ------------------
  |  Branch (88:12): [True: 0, False: 0]
  ------------------
   89|       |            /* Newline and indent if needed */
   90|      0|            res |= writeChar(ctx, '\n');
   91|      0|            for(size_t i = 0; i < ctx->depth; i++)
  ------------------
  |  Branch (91:31): [True: 0, False: 0]
  ------------------
   92|      0|                res |= writeChar(ctx, '\t');
   93|      0|        } else if(ctx->commaNeeded[ctx->depth]) {
  ------------------
  |  Branch (93:19): [True: 0, False: 0]
  ------------------
   94|       |            /* Space after the comma if no newline */
   95|      0|            res |= writeChar(ctx, ' ');
   96|      0|        }
   97|      0|    }
   98|  24.4M|    return res;
   99|  24.4M|}
writeJsonObjStart:
  101|  3.00M|WRITE_JSON_ELEMENT(ObjStart) {
  102|       |    /* increase depth, save: before first key-value no comma needed. */
  103|  3.00M|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|  3.00M|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (103:8): [True: 0, False: 3.00M]
  ------------------
  104|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  105|  3.00M|    ctx->depth++;
  106|       |    ctx->commaNeeded[ctx->depth] = false;
  107|  3.00M|    return writeChar(ctx, '{');
  108|  3.00M|}
writeJsonObjEnd:
  110|  3.00M|WRITE_JSON_ELEMENT(ObjEnd) {
  111|  3.00M|    if(ctx->depth == 0)
  ------------------
  |  Branch (111:8): [True: 0, False: 3.00M]
  ------------------
  112|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  113|       |
  114|  3.00M|    UA_Boolean have_elem = ctx->commaNeeded[ctx->depth];
  115|  3.00M|    ctx->depth--;
  116|  3.00M|    ctx->commaNeeded[ctx->depth] = true;
  117|       |
  118|  3.00M|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  3.00M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  119|  3.00M|    if(ctx->prettyPrint && have_elem) {
  ------------------
  |  Branch (119:8): [True: 0, False: 3.00M]
  |  Branch (119:28): [True: 0, False: 0]
  ------------------
  120|      0|        res |= writeChar(ctx, '\n');
  121|      0|        for(size_t i = 0; i < ctx->depth; i++)
  ------------------
  |  Branch (121:27): [True: 0, False: 0]
  ------------------
  122|      0|            res |= writeChar(ctx, '\t');
  123|      0|    }
  124|  3.00M|    return res | writeChar(ctx, '}');
  125|  3.00M|}
writeJsonArrStart:
  127|  25.2k|WRITE_JSON_ELEMENT(ArrStart) {
  128|       |    /* increase depth, save: before first array entry no comma needed. */
  129|  25.2k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|  25.2k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (129:8): [True: 0, False: 25.2k]
  ------------------
  130|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  131|  25.2k|    ctx->depth++;
  132|       |    ctx->commaNeeded[ctx->depth] = false;
  133|  25.2k|    return writeChar(ctx, '[');
  134|  25.2k|}
writeJsonArrEnd:
  137|  25.2k|writeJsonArrEnd(CtxJson *ctx, const UA_DataType *type) {
  138|  25.2k|    if(ctx->depth == 0)
  ------------------
  |  Branch (138:8): [True: 0, False: 25.2k]
  ------------------
  139|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  140|  25.2k|    UA_Boolean have_elem = ctx->commaNeeded[ctx->depth];
  141|  25.2k|    ctx->depth--;
  142|  25.2k|    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|  25.2k|    UA_Boolean distinct = (!type || type->typeKind > UA_DATATYPEKIND_DOUBLE);
  ------------------
  |  Branch (146:28): [True: 0, False: 25.2k]
  |  Branch (146:37): [True: 7.57k, False: 17.6k]
  ------------------
  147|  25.2k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  25.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  148|  25.2k|    if(ctx->prettyPrint && have_elem && distinct) {
  ------------------
  |  Branch (148:8): [True: 0, False: 25.2k]
  |  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|  25.2k|    return res | writeChar(ctx, ']');
  154|  25.2k|}
writeJsonArrElm:
  158|  15.4M|                const UA_DataType *type) {
  159|  15.4M|    UA_Boolean distinct = (type->typeKind > UA_DATATYPEKIND_DOUBLE);
  160|  15.4M|    status ret = writeJsonBeforeElement(ctx, distinct);
  161|       |    ctx->commaNeeded[ctx->depth] = true;
  162|  15.4M|    return ret | encodeJsonJumpTable[type->typeKind](ctx, value, type);
  163|  15.4M|}
writeJsonKey:
  210|  5.50M|writeJsonKey(CtxJson *ctx, const char* key) {
  211|  5.50M|    status ret = writeJsonBeforeElement(ctx, true);
  212|  5.50M|    ctx->commaNeeded[ctx->depth] = true;
  213|  5.50M|    if(!ctx->unquotedKeys)
  ------------------
  |  Branch (213:8): [True: 5.50M, False: 0]
  ------------------
  214|  5.50M|        ret |= writeChar(ctx, '\"');
  215|  5.50M|    ret |= writeChars(ctx, key, strlen(key));
  216|  5.50M|    if(!ctx->unquotedKeys)
  ------------------
  |  Branch (216:8): [True: 5.50M, False: 0]
  ------------------
  217|  5.50M|        ret |= writeChar(ctx, '\"');
  218|  5.50M|    ret |= writeChar(ctx, ':');
  219|  5.50M|    if(ctx->prettyPrint)
  ------------------
  |  Branch (219:8): [True: 0, False: 5.50M]
  ------------------
  220|      0|        ret |= writeChar(ctx, ' ');
  221|  5.50M|    return ret;
  222|  5.50M|}
UA_encodeJson:
  933|  4.00k|              const UA_EncodeJsonOptions *options) {
  934|  4.00k|    if(!src || !type)
  ------------------
  |  Branch (934:8): [True: 0, False: 4.00k]
  |  Branch (934:16): [True: 0, False: 4.00k]
  ------------------
  935|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
  936|       |
  937|       |    /* Allocate buffer */
  938|  4.00k|    UA_Boolean allocated = false;
  939|  4.00k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  4.00k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  940|  4.00k|    if(outBuf->length == 0) {
  ------------------
  |  Branch (940:8): [True: 0, False: 4.00k]
  ------------------
  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.00k|    CtxJson ctx;
  950|  4.00k|    memset(&ctx, 0, sizeof(ctx));
  951|  4.00k|    ctx.pos = outBuf->data;
  952|  4.00k|    ctx.end = &outBuf->data[outBuf->length];
  953|  4.00k|    ctx.depth = 0;
  954|  4.00k|    ctx.calcOnly = false;
  955|  4.00k|    ctx.useReversible = true; /* default */
  956|  4.00k|    if(options) {
  ------------------
  |  Branch (956:8): [True: 0, False: 4.00k]
  ------------------
  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.00k|    res = encodeJsonJumpTable[type->typeKind](&ctx, src, type);
  968|       |
  969|       |    /* Clean up */
  970|  4.00k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  4.00k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (970:8): [True: 4.00k, False: 0]
  ------------------
  971|  4.00k|        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.00k|    return res;
  975|  4.00k|}
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|   218k|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|   218k|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  411|   218k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1438:5): [True: 218k, False: 0]
  ------------------
 1439|       |
 1440|   218k|    status ret = UA_STATUSCODE_BADNOTFOUND;
  ------------------
  |  |  232|   218k|#define UA_STATUSCODE_BADNOTFOUND ((UA_StatusCode) 0x803E0000)
  ------------------
 1441|   218k|    size_t oldIndex = ctx->index; /* Save index for later restore */
 1442|   218k|    unsigned int end = ctx->tokens[ctx->index].end;
 1443|   218k|    ctx->index++; /* Move to the first key */
 1444|   517k|    while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1444:11): [True: 512k, False: 5.28k]
  ------------------
 1445|   512k|          ctx->tokens[ctx->index].start < end) {
  ------------------
  |  Branch (1445:11): [True: 428k, False: 84.1k]
  ------------------
 1446|       |        /* Key must be a string */
 1447|   428k|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  411|   428k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1447:9): [True: 428k, False: 0]
  ------------------
 1448|       |
 1449|       |        /* Move index to the value */
 1450|   428k|        ctx->index++;
 1451|       |
 1452|       |        /* Value for the key must exist */
 1453|   428k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  411|   428k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1453:9): [True: 428k, False: 0]
  ------------------
 1454|       |
 1455|       |        /* Compare the key (previous index) */
 1456|   428k|        if(jsoneq(ctx->json5, &ctx->tokens[ctx->index-1], key) == 0) {
  ------------------
  |  Branch (1456:12): [True: 129k, False: 299k]
  ------------------
 1457|   129k|            *resultIndex = ctx->index; /* Point result to the current index */
 1458|   129k|            ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   129k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1459|   129k|            break;
 1460|   129k|        }
 1461|       |
 1462|   299k|        skipObject(ctx); /* Jump over the value (can also be an array or object) */
 1463|   299k|    }
 1464|   218k|    ctx->index = oldIndex; /* Restore the old index */
 1465|   218k|    return ret;
 1466|   218k|}
decodeFields:
 2220|  1.87M|decodeFields(ParseCtx *ctx, DecodeEntry *entries, size_t entryCount) {
 2221|  1.87M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  1.87M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  1.87M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 1.87M]
  |  |  ------------------
  |  | 1038|  1.87M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  1.87M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 1.87M]
  |  |  ------------------
  ------------------
 2222|  1.87M|    CHECK_NULL_SKIP; /* null is treated like an empty object */
  ------------------
  |  | 1061|  1.87M|#define CHECK_NULL_SKIP do {                         \
  |  | 1062|  1.87M|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1062:8): [True: 0, False: 1.87M]
  |  |  ------------------
  |  | 1063|      0|        ctx->index++;                                \
  |  | 1064|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1065|  1.87M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1065:14): [Folded, False: 1.87M]
  |  |  ------------------
  ------------------
 2223|       |
 2224|  1.87M|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|  1.87M|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (2224:8): [True: 0, False: 1.87M]
  ------------------
 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.87M|    CHECK_OBJECT;
  ------------------
  |  | 1056|  1.87M|#define CHECK_OBJECT do {                                \
  |  | 1057|  1.87M|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1057:8): [True: 0, False: 1.87M]
  |  |  ------------------
  |  | 1058|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1059|  1.87M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1059:14): [Folded, False: 1.87M]
  |  |  ------------------
  ------------------
 2229|  1.87M|    UA_assert(ctx->tokens[ctx->index].size % 2 == 0);
  ------------------
  |  |  411|  1.87M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2229:5): [True: 1.87M, False: 0]
  ------------------
 2230|  1.87M|    size_t keyCount = (size_t)(ctx->tokens[ctx->index].size) / 2;
 2231|       |
 2232|  1.87M|    ctx->index++; /* Go to first key - or jump after the empty object */
 2233|  1.87M|    ctx->depth++;
 2234|       |
 2235|  1.87M|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.87M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2236|  3.68M|    for(size_t key = 0; key < keyCount; key++) {
  ------------------
  |  Branch (2236:25): [True: 1.81M, False: 1.87M]
  ------------------
 2237|       |        /* Key must be a string */
 2238|  1.81M|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  411|  1.81M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2238:9): [True: 1.81M, False: 0]
  ------------------
 2239|  1.81M|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  411|  1.81M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2239:9): [True: 1.81M, 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.81M|        DecodeEntry *entry = NULL;
 2245|  1.83M|        for(size_t i = key; i < key + entryCount; i++) {
  ------------------
  |  Branch (2245:29): [True: 1.83M, False: 56]
  ------------------
 2246|  1.83M|            size_t ii = i;
 2247|  1.84M|            while(ii >= entryCount)
  ------------------
  |  Branch (2247:19): [True: 3.20k, False: 1.83M]
  ------------------
 2248|  3.20k|                ii -= entryCount;
 2249|       |
 2250|       |            /* Compare the key */
 2251|  1.83M|            if(jsoneq(ctx->json5, &ctx->tokens[ctx->index],
  ------------------
  |  Branch (2251:16): [True: 25.9k, False: 1.81M]
  ------------------
 2252|  1.83M|                      entries[ii].fieldName) != 0)
 2253|  25.9k|                continue;
 2254|       |
 2255|       |            /* Key was already used -> duplicate, abort */
 2256|  1.81M|            if(entries[ii].found) {
  ------------------
  |  Branch (2256:16): [True: 1, False: 1.81M]
  ------------------
 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.81M|            entries[ii].found = true;
 2263|  1.81M|            entry = &entries[ii];
 2264|  1.81M|            break;
 2265|  1.81M|        }
 2266|       |
 2267|       |        /* The key is unknown */
 2268|  1.81M|        if(!entry) {
  ------------------
  |  Branch (2268:12): [True: 56, False: 1.81M]
  ------------------
 2269|     56|            ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     56|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2270|     56|            break;
 2271|     56|        }
 2272|       |
 2273|       |        /* Go from key to value */
 2274|  1.81M|        ctx->index++;
 2275|  1.81M|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  411|  1.81M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2275:9): [True: 1.81M, False: 0]
  ------------------
 2276|       |
 2277|       |        /* An entry that was expected but shall not be decoded.
 2278|       |         * Jump over the value. */
 2279|  1.81M|        if(!entry->function && !entry->type) {
  ------------------
  |  Branch (2279:12): [True: 1.81M, False: 0]
  |  Branch (2279:32): [True: 47.6k, False: 1.76M]
  ------------------
 2280|  47.6k|            skipObject(ctx);
 2281|  47.6k|            continue;
 2282|  47.6k|        }
 2283|       |
 2284|       |        /* A null-value, skip the decoding (the value is already initialized) */
 2285|  1.76M|        if(currentTokenType(ctx) == CJ5_TOKEN_NULL && !entry->function) {
  ------------------
  |  Branch (2285:12): [True: 1.76M, False: 72]
  |  Branch (2285:55): [True: 1.76M, False: 0]
  ------------------
 2286|  1.76M|            ctx->index++; /* skip null value */
 2287|  1.76M|            continue;
 2288|  1.76M|        }
 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.87M|    ctx->depth--;
 2300|  1.87M|    return ret;
 2301|  1.87M|}
tokenize:
 2429|  5.82k|         size_t *decodedLength) {
 2430|       |    /* Tokenize */
 2431|  5.82k|    cj5_options options;
 2432|  5.82k|    options.stop_early = (decodedLength != NULL);
 2433|  5.82k|    cj5_result r = cj5_parse((char*)src->data, (unsigned int)src->length,
 2434|  5.82k|                             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.82k|    if(r.error == CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (2438:8): [True: 744, False: 5.08k]
  ------------------
 2439|    744|       tokensSize != r.num_tokens) {
  ------------------
  |  Branch (2439:8): [True: 744, False: 0]
  ------------------
 2440|    744|        ctx->tokens = (cj5_token*)
 2441|    744|            UA_malloc(sizeof(cj5_token) * r.num_tokens);
  ------------------
  |  |  350|    744|# define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 2442|    744|        if(!ctx->tokens)
  ------------------
  |  Branch (2442:12): [True: 0, False: 744]
  ------------------
 2443|      0|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2444|    744|        return tokenize(ctx, src, r.num_tokens, decodedLength);
 2445|    744|    }
 2446|       |
 2447|       |    /* Cannot recover from other errors */
 2448|  5.08k|    if(r.error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (2448:8): [True: 136, False: 4.94k]
  ------------------
 2449|    136|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    136|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2450|       |
 2451|  4.94k|    if(decodedLength)
  ------------------
  |  Branch (2451:8): [True: 0, False: 4.94k]
  ------------------
 2452|      0|        *decodedLength = ctx->tokens[0].end + 1;
 2453|       |
 2454|       |    /* Set up the context */
 2455|  4.94k|    ctx->json5 = (char*)src->data;
 2456|  4.94k|    ctx->depth = 0;
 2457|  4.94k|    ctx->tokensSize = r.num_tokens;
 2458|  4.94k|    ctx->index = 0;
 2459|  4.94k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  4.94k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2460|  5.08k|}
UA_decodeJson:
 2464|  5.08k|              const UA_DecodeJsonOptions *options) {
 2465|  5.08k|    if(!dst || !src || !type)
  ------------------
  |  Branch (2465:8): [True: 0, False: 5.08k]
  |  Branch (2465:16): [True: 0, False: 5.08k]
  |  Branch (2465:24): [True: 0, False: 5.08k]
  ------------------
 2466|      0|        return UA_STATUSCODE_BADARGUMENTSMISSING;
  ------------------
  |  |  448|      0|#define UA_STATUSCODE_BADARGUMENTSMISSING ((UA_StatusCode) 0x80760000)
  ------------------
 2467|       |
 2468|       |    /* Set up the context */
 2469|  5.08k|    cj5_token tokens[UA_JSON_MAXTOKENCOUNT];
 2470|  5.08k|    ParseCtx ctx;
 2471|  5.08k|    memset(&ctx, 0, sizeof(ParseCtx));
 2472|  5.08k|    ctx.tokens = tokens;
 2473|       |
 2474|  5.08k|    if(options) {
  ------------------
  |  Branch (2474:8): [True: 0, False: 5.08k]
  ------------------
 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.08k|    status ret = tokenize(&ctx, src, UA_JSON_MAXTOKENCOUNT,
  ------------------
  |  |   20|  5.08k|#define UA_JSON_MAXTOKENCOUNT 256
  ------------------
 2483|  5.08k|                          options ? options->decodedLength : NULL);
  ------------------
  |  Branch (2483:27): [True: 0, False: 5.08k]
  ------------------
 2484|  5.08k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  5.08k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2484:8): [True: 136, False: 4.94k]
  ------------------
 2485|    136|        goto cleanup;
 2486|       |
 2487|  4.94k|    memset(dst, 0, type->memSize); /* Initialize the value */
 2488|  4.94k|    ret = decodeJsonJumpTable[type->typeKind](&ctx, dst, type);
 2489|       |
 2490|       |    /* Sanity check if all tokens were processed */
 2491|  4.94k|    if(ctx.index != ctx.tokensSize &&
  ------------------
  |  Branch (2491:8): [True: 91, False: 4.85k]
  ------------------
 2492|     91|       ctx.index != ctx.tokensSize - 1)
  ------------------
  |  Branch (2492:8): [True: 75, False: 16]
  ------------------
 2493|     75|        ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     75|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2494|       |
 2495|  5.08k| cleanup:
 2496|       |
 2497|       |    /* Free token array on the heap */
 2498|  5.08k|    if(ctx.tokens != tokens)
  ------------------
  |  Branch (2498:8): [True: 744, False: 4.34k]
  ------------------
 2499|    744|        UA_free((void*)(uintptr_t)ctx.tokens);
  ------------------
  |  |  351|    744|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2500|       |
 2501|  5.08k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  5.08k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2501:8): [True: 1.08k, False: 4.00k]
  ------------------
 2502|  1.08k|        UA_clear(dst, type);
 2503|  5.08k|    return ret;
 2504|  4.94k|}
ua_types_encoding_json.c:writeChar:
   54|  44.5M|writeChar(CtxJson *ctx, char c) {
   55|  44.5M|    if(ctx->pos >= ctx->end)
  ------------------
  |  Branch (55:8): [True: 0, False: 44.5M]
  ------------------
   56|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
   57|  44.5M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (57:8): [True: 29.7M, False: 14.8M]
  ------------------
   58|  29.7M|        *ctx->pos = (UA_Byte)c;
   59|  44.5M|    ctx->pos++;
   60|  44.5M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  44.5M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   61|  44.5M|}
ua_types_encoding_json.c:writeChars:
   64|  10.9M|writeChars(CtxJson *ctx, const char *c, size_t len) {
   65|  10.9M|    if(ctx->pos + len > ctx->end)
  ------------------
  |  Branch (65:8): [True: 0, False: 10.9M]
  ------------------
   66|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
   67|  10.9M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (67:8): [True: 7.32M, False: 3.66M]
  ------------------
   68|  7.32M|        memcpy(ctx->pos, c, len);
   69|  10.9M|    ctx->pos += len;
   70|  10.9M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  10.9M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   71|  10.9M|}
ua_types_encoding_json.c:Boolean_encodeJson:
  234|  10.8k|ENCODE_JSON(Boolean) {
  235|  10.8k|    if(*src == true)
  ------------------
  |  Branch (235:8): [True: 786, False: 10.0k]
  ------------------
  236|    786|        return writeChars(ctx, "true", 4);
  237|  10.0k|    return writeChars(ctx, "false", 5);
  238|  10.8k|}
ua_types_encoding_json.c:SByte_encodeJson:
  257|   663k|ENCODE_JSON(SByte) {
  258|   663k|    char buf[5];
  259|   663k|    UA_UInt16 digits = itoaSigned(*src, buf);
  260|   663k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (260:8): [True: 0, False: 663k]
  ------------------
  261|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  262|   663k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (262:8): [True: 442k, False: 221k]
  ------------------
  263|   442k|        memcpy(ctx->pos, buf, digits);
  264|   663k|    ctx->pos += digits;
  265|   663k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   663k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  266|   663k|}
ua_types_encoding_json.c:Byte_encodeJson:
  241|  8.44k|ENCODE_JSON(Byte) {
  242|  8.44k|    char buf[4];
  243|  8.44k|    UA_UInt16 digits = itoaUnsigned(*src, buf, 10);
  244|       |
  245|       |    /* Ensure destination can hold the data- */
  246|  8.44k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (246:8): [True: 0, False: 8.44k]
  ------------------
  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|  8.44k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (250:8): [True: 5.63k, False: 2.81k]
  ------------------
  251|  5.63k|        memcpy(ctx->pos, buf, digits);
  252|  8.44k|    ctx->pos += digits;
  253|  8.44k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  8.44k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  254|  8.44k|}
ua_types_encoding_json.c:Int16_encodeJson:
  283|   230k|ENCODE_JSON(Int16) {
  284|   230k|    char buf[7];
  285|   230k|    UA_UInt16 digits = itoaSigned(*src, buf);
  286|       |
  287|   230k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (287:8): [True: 0, False: 230k]
  ------------------
  288|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  289|       |
  290|   230k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (290:8): [True: 153k, False: 76.8k]
  ------------------
  291|   153k|        memcpy(ctx->pos, buf, digits);
  292|   230k|    ctx->pos += digits;
  293|   230k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   230k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  294|   230k|}
ua_types_encoding_json.c:UInt16_encodeJson:
  269|   111k|ENCODE_JSON(UInt16) {
  270|   111k|    char buf[6];
  271|   111k|    UA_UInt16 digits = itoaUnsigned(*src, buf, 10);
  272|       |
  273|   111k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (273:8): [True: 0, False: 111k]
  ------------------
  274|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  275|       |
  276|   111k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (276:8): [True: 74.0k, False: 37.0k]
  ------------------
  277|  74.0k|        memcpy(ctx->pos, buf, digits);
  278|   111k|    ctx->pos += digits;
  279|   111k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   111k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  280|   111k|}
ua_types_encoding_json.c:Int32_encodeJson:
  311|  2.37M|ENCODE_JSON(Int32) {
  312|  2.37M|    char buf[12];
  313|  2.37M|    UA_UInt16 digits = itoaSigned(*src, buf);
  314|       |
  315|  2.37M|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (315:8): [True: 0, False: 2.37M]
  ------------------
  316|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  317|       |
  318|  2.37M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (318:8): [True: 1.58M, False: 790k]
  ------------------
  319|  1.58M|        memcpy(ctx->pos, buf, digits);
  320|  2.37M|    ctx->pos += digits;
  321|  2.37M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  2.37M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  322|  2.37M|}
ua_types_encoding_json.c:UInt32_encodeJson:
  297|  3.58M|ENCODE_JSON(UInt32) {
  298|  3.58M|    char buf[11];
  299|  3.58M|    UA_UInt16 digits = itoaUnsigned(*src, buf, 10);
  300|       |
  301|  3.58M|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (301:8): [True: 0, False: 3.58M]
  ------------------
  302|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  303|       |
  304|  3.58M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (304:8): [True: 2.39M, False: 1.19M]
  ------------------
  305|  2.39M|        memcpy(ctx->pos, buf, digits);
  306|  3.58M|    ctx->pos += digits;
  307|  3.58M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  3.58M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  308|  3.58M|}
ua_types_encoding_json.c:Int64_encodeJson:
  342|  2.06M|ENCODE_JSON(Int64) {
  343|  2.06M|    char buf[23];
  344|  2.06M|    buf[0] = '\"';
  345|  2.06M|    UA_UInt16 digits = itoaSigned(*src, buf + 1);
  346|  2.06M|    buf[digits + 1] = '\"';
  347|  2.06M|    UA_UInt16 length = (UA_UInt16)(digits + 2);
  348|       |
  349|  2.06M|    if(ctx->pos + length > ctx->end)
  ------------------
  |  Branch (349:8): [True: 0, False: 2.06M]
  ------------------
  350|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  351|       |
  352|  2.06M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (352:8): [True: 1.37M, False: 687k]
  ------------------
  353|  1.37M|        memcpy(ctx->pos, buf, length);
  354|  2.06M|    ctx->pos += length;
  355|  2.06M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  2.06M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  356|  2.06M|}
ua_types_encoding_json.c:UInt64_encodeJson:
  325|  4.92M|ENCODE_JSON(UInt64) {
  326|  4.92M|    char buf[23];
  327|  4.92M|    buf[0] = '\"';
  328|  4.92M|    UA_UInt16 digits = itoaUnsigned(*src, buf + 1, 10);
  329|  4.92M|    buf[digits + 1] = '\"';
  330|  4.92M|    UA_UInt16 length = (UA_UInt16)(digits + 2);
  331|       |
  332|  4.92M|    if(ctx->pos + length > ctx->end)
  ------------------
  |  Branch (332:8): [True: 0, False: 4.92M]
  ------------------
  333|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  334|       |
  335|  4.92M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (335:8): [True: 3.28M, False: 1.64M]
  ------------------
  336|  3.28M|        memcpy(ctx->pos, buf, length);
  337|  4.92M|    ctx->pos += length;
  338|  4.92M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  4.92M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  339|  4.92M|}
ua_types_encoding_json.c:Float_encodeJson:
  358|  1.82M|ENCODE_JSON(Float) {
  359|  1.82M|    char buffer[32];
  360|  1.82M|    size_t len;
  361|  1.82M|    if(*src != *src) {
  ------------------
  |  Branch (361:8): [True: 11.6k, False: 1.81M]
  ------------------
  362|  11.6k|        strcpy(buffer, "\"NaN\"");
  363|  11.6k|        len = strlen(buffer);
  364|  1.81M|    } else if(*src == INFINITY) {
  ------------------
  |  Branch (364:15): [True: 1.55k, False: 1.81M]
  ------------------
  365|  1.55k|        strcpy(buffer, "\"Infinity\"");
  366|  1.55k|        len = strlen(buffer);
  367|  1.81M|    } else if(*src == -INFINITY) {
  ------------------
  |  Branch (367:15): [True: 1.53k, False: 1.80M]
  ------------------
  368|  1.53k|        strcpy(buffer, "\"-Infinity\"");
  369|  1.53k|        len = strlen(buffer);
  370|  1.80M|    } else {
  371|  1.80M|        len = dtoa((UA_Double)*src, buffer);
  372|  1.80M|    }
  373|       |
  374|  1.82M|    if(ctx->pos + len > ctx->end)
  ------------------
  |  Branch (374:8): [True: 0, False: 1.82M]
  ------------------
  375|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  376|       |
  377|  1.82M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (377:8): [True: 1.21M, False: 607k]
  ------------------
  378|  1.21M|        memcpy(ctx->pos, buffer, len);
  379|  1.82M|    ctx->pos += len;
  380|  1.82M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.82M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  381|  1.82M|}
ua_types_encoding_json.c:Double_encodeJson:
  383|  18.8k|ENCODE_JSON(Double) {
  384|  18.8k|    char buffer[32];
  385|  18.8k|    size_t len;
  386|  18.8k|    if(*src != *src) {
  ------------------
  |  Branch (386:8): [True: 1.88k, False: 16.9k]
  ------------------
  387|  1.88k|        strcpy(buffer, "\"NaN\"");
  388|  1.88k|        len = strlen(buffer);
  389|  16.9k|    } else if(*src == INFINITY) {
  ------------------
  |  Branch (389:15): [True: 993, False: 15.9k]
  ------------------
  390|    993|        strcpy(buffer, "\"Infinity\"");
  391|    993|        len = strlen(buffer);
  392|  15.9k|    } else if(*src == -INFINITY) {
  ------------------
  |  Branch (392:15): [True: 969, False: 14.9k]
  ------------------
  393|    969|        strcpy(buffer, "\"-Infinity\"");
  394|    969|        len = strlen(buffer);
  395|  14.9k|    } else {
  396|  14.9k|        len = dtoa(*src, buffer);
  397|  14.9k|    }
  398|       |
  399|  18.8k|    if(ctx->pos + len > ctx->end)
  ------------------
  |  Branch (399:8): [True: 0, False: 18.8k]
  ------------------
  400|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  401|       |
  402|  18.8k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (402:8): [True: 12.5k, False: 6.27k]
  ------------------
  403|  12.5k|        memcpy(ctx->pos, buffer, len);
  404|  18.8k|    ctx->pos += len;
  405|  18.8k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  18.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  406|  18.8k|}
ua_types_encoding_json.c:String_encodeJson:
  435|  5.46M|ENCODE_JSON(String) {
  436|  5.46M|    if(!src->data)
  ------------------
  |  Branch (436:8): [True: 5.30M, False: 156k]
  ------------------
  437|  5.30M|        return writeChars(ctx, "null", 4);
  438|       |
  439|   156k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   156k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  440|   156k|    if(src->length == 0) {
  ------------------
  |  Branch (440:8): [True: 9.98k, False: 146k]
  ------------------
  441|  9.98k|        ret |= writeJsonQuote(ctx);
  442|  9.98k|        ret |= writeJsonQuote(ctx);
  443|  9.98k|        return ret;
  444|  9.98k|    }
  445|       |
  446|   146k|    ret |= writeJsonQuote(ctx);
  447|       |
  448|   146k|    const unsigned char *end = src->data + src->length;
  449|  7.81M|    for(const unsigned char *pos = src->data; pos < end; pos++) {
  ------------------
  |  Branch (449:47): [True: 7.81M, False: 1.72k]
  ------------------
  450|       |        /* Skip to the first character that needs escaping */
  451|  7.81M|        const unsigned char *start = pos;
  452|  31.8M|        for(; pos < end; pos++) {
  ------------------
  |  Branch (452:15): [True: 31.7M, False: 144k]
  ------------------
  453|  31.7M|            if(*pos < ' ' || *pos == 127 || *pos == '\\' || *pos == '\"')
  ------------------
  |  Branch (453:16): [True: 2.45M, False: 29.2M]
  |  Branch (453:30): [True: 79.0k, False: 29.1M]
  |  Branch (453:45): [True: 10.4k, False: 29.1M]
  |  Branch (453:61): [True: 5.12M, False: 24.0M]
  ------------------
  454|  7.67M|                break;
  455|  31.7M|        }
  456|       |
  457|       |        /* Write out the unescaped sequence */
  458|  7.81M|        if(ctx->pos + (pos - start) > ctx->end)
  ------------------
  |  Branch (458:12): [True: 0, False: 7.81M]
  ------------------
  459|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  460|  7.81M|        if(!ctx->calcOnly)
  ------------------
  |  Branch (460:12): [True: 5.21M, False: 2.60M]
  ------------------
  461|  5.21M|            memcpy(ctx->pos, start, (size_t)(pos - start));
  462|  7.81M|        ctx->pos += pos - start;
  463|       |
  464|       |        /* The unescaped sequence reached the end */
  465|  7.81M|        if(pos == end)
  ------------------
  |  Branch (465:12): [True: 144k, False: 7.67M]
  ------------------
  466|   144k|            break;
  467|       |
  468|       |        /* Write an escaped character */
  469|  7.67M|        char *escape_text;
  470|  7.67M|        char escape_buf[6];
  471|  7.67M|        size_t escape_len = 2;
  472|  7.67M|        switch(*pos) {
  473|  1.29k|        case '\b': escape_text = "\\b"; break;
  ------------------
  |  Branch (473:9): [True: 1.29k, False: 7.67M]
  ------------------
  474|  3.99k|        case '\f': escape_text = "\\f"; break;
  ------------------
  |  Branch (474:9): [True: 3.99k, False: 7.66M]
  ------------------
  475|   111k|        case '\n': escape_text = "\\n"; break;
  ------------------
  |  Branch (475:9): [True: 111k, False: 7.56M]
  ------------------
  476|  1.32k|        case '\r': escape_text = "\\r"; break;
  ------------------
  |  Branch (476:9): [True: 1.32k, False: 7.67M]
  ------------------
  477|  1.28k|        case '\t': escape_text = "\\t"; break;
  ------------------
  |  Branch (477:9): [True: 1.28k, False: 7.67M]
  ------------------
  478|  7.55M|        default:
  ------------------
  |  Branch (478:9): [True: 7.55M, False: 119k]
  ------------------
  479|  7.55M|            escape_text = escape_buf;
  480|  7.55M|            if(*pos >= ' ' && *pos != 127) {
  ------------------
  |  Branch (480:16): [True: 5.21M, False: 2.33M]
  |  Branch (480:31): [True: 5.14M, False: 79.0k]
  ------------------
  481|       |                /* Escape \ or " */
  482|  5.14M|                escape_buf[0] = '\\';
  483|  5.14M|                escape_buf[1] = (char)*pos;
  484|  5.14M|            } else {
  485|       |                /* Unprintable characters need to be escaped */
  486|  2.41M|                escape_buf[0] = '\\';
  487|  2.41M|                escape_buf[1] = 'u';
  488|  2.41M|                escape_buf[2] = '0';
  489|  2.41M|                escape_buf[3] = '0';
  490|  2.41M|                escape_buf[4] = hexmap[*pos >> 4];
  491|  2.41M|                escape_buf[5] = hexmap[*pos & 0x0f];
  492|  2.41M|                escape_len = 6;
  493|  2.41M|            }
  494|  7.55M|            break;
  495|  7.67M|        }
  496|       |
  497|       |        /* Enough space? */
  498|  7.67M|        if(ctx->pos + escape_len > ctx->end)
  ------------------
  |  Branch (498:12): [True: 0, False: 7.67M]
  ------------------
  499|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  500|       |
  501|       |        /* Write the escaped character */
  502|  7.67M|        if(!ctx->calcOnly)
  ------------------
  |  Branch (502:12): [True: 5.11M, False: 2.55M]
  ------------------
  503|  5.11M|            memcpy(ctx->pos, escape_text, escape_len);
  504|  7.67M|        ctx->pos += escape_len;
  505|  7.67M|    }
  506|       |
  507|   146k|    return ret | writeJsonQuote(ctx);
  508|   146k|}
ua_types_encoding_json.c:writeJsonQuote:
   77|   322k|static WRITE_JSON_ELEMENT(Quote) {
   78|   322k|    return writeChar(ctx, '\"');
   79|   322k|}
ua_types_encoding_json.c:DateTime_encodeJson:
  556|  29.6k|ENCODE_JSON(DateTime) {
  557|  29.6k|    UA_Byte buffer[40];
  558|  29.6k|    UA_String str = {40, buffer};
  559|  29.6k|    encodeDateTime(*src, &str);
  560|       |    return ENCODE_DIRECT_JSON(&str, String);
  ------------------
  |  |   51|  29.6k|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  561|  29.6k|}
ua_types_encoding_json.c:Guid_encodeJson:
  545|  2.50k|ENCODE_JSON(Guid) {
  546|  2.50k|    if(ctx->pos + 38 > ctx->end) /* 36 + 2 (") */
  ------------------
  |  Branch (546:8): [True: 0, False: 2.50k]
  ------------------
  547|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  548|  2.50k|    status ret = writeJsonQuote(ctx);
  549|  2.50k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (549:8): [True: 1.67k, False: 835]
  ------------------
  550|  1.67k|        UA_Guid_to_hex(src, ctx->pos, false);
  551|  2.50k|    ctx->pos += 36;
  552|  2.50k|    return ret | writeJsonQuote(ctx);
  553|  2.50k|}
ua_types_encoding_json.c:ByteString_encodeJson:
  510|  3.11k|ENCODE_JSON(ByteString) {
  511|  3.11k|    if(!src->data)
  ------------------
  |  Branch (511:8): [True: 939, False: 2.17k]
  ------------------
  512|    939|        return writeChars(ctx, "null", 4);
  513|       |
  514|  2.17k|    if(src->length == 0) {
  ------------------
  |  Branch (514:8): [True: 1.92k, False: 246]
  ------------------
  515|  1.92k|        status retval = writeJsonQuote(ctx);
  516|  1.92k|        retval |= writeJsonQuote(ctx);
  517|  1.92k|        return retval;
  518|  1.92k|    }
  519|       |
  520|    246|    status ret = writeJsonQuote(ctx);
  521|    246|    size_t flen = 0;
  522|    246|    unsigned char *ba64 = UA_base64(src->data, src->length, &flen);
  523|       |
  524|       |    /* Not converted, no mem */
  525|    246|    if(!ba64)
  ------------------
  |  Branch (525:8): [True: 0, False: 246]
  ------------------
  526|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  527|       |
  528|    246|    if(ctx->pos + flen > ctx->end) {
  ------------------
  |  Branch (528:8): [True: 0, False: 246]
  ------------------
  529|      0|        UA_free(ba64);
  ------------------
  |  |  351|      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|    246|    if(!ctx->calcOnly)
  ------------------
  |  Branch (534:8): [True: 164, False: 82]
  ------------------
  535|    164|        memcpy(ctx->pos, ba64, flen);
  536|    246|    ctx->pos += flen;
  537|       |
  538|       |    /* Base64 result no longer needed */
  539|    246|    UA_free(ba64);
  ------------------
  |  |  351|    246|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  540|       |
  541|    246|    return ret | writeJsonQuote(ctx);
  542|    246|}
ua_types_encoding_json.c:NodeId_encodeJson:
  564|  9.29k|ENCODE_JSON(NodeId) {
  565|  9.29k|    UA_String out = UA_STRING_NULL;
  566|  9.29k|    UA_StatusCode ret = UA_NodeId_printEx(src, &out, ctx->namespaceMapping);
  567|       |    ret |= ENCODE_DIRECT_JSON(&out, String);
  ------------------
  |  |   51|  9.29k|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  568|  9.29k|    UA_String_clear(&out);
  569|  9.29k|    return ret;
  570|  9.29k|}
ua_types_encoding_json.c:ExpandedNodeId_encodeJson:
  573|  29.6k|ENCODE_JSON(ExpandedNodeId) {
  574|  29.6k|    UA_String out = UA_STRING_NULL;
  575|  29.6k|    UA_StatusCode ret = UA_ExpandedNodeId_printEx(src, &out, ctx->namespaceMapping,
  576|  29.6k|                                                  ctx->serverUrisSize, ctx->serverUris);
  577|       |    ret |= ENCODE_DIRECT_JSON(&out, String);
  ------------------
  |  |   51|  29.6k|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  578|  29.6k|    UA_String_clear(&out);
  579|  29.6k|    return ret;
  580|  29.6k|}
ua_types_encoding_json.c:StatusCode_encodeJson:
  600|  1.80k|ENCODE_JSON(StatusCode) {
  601|  1.80k|    const char *codename = UA_StatusCode_name(*src);
  602|  1.80k|    UA_String statusDescription = UA_STRING((char*)(uintptr_t)codename);
  603|       |
  604|  1.80k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.80k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  605|  1.80k|    ret |= writeJsonObjStart(ctx);
  606|  1.80k|    if(*src > UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  1.80k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (606:8): [True: 75, False: 1.73k]
  ------------------
  607|     75|        ret |= writeJsonKey(ctx, UA_JSONKEY_CODE);
  608|     75|        ret |= ENCODE_DIRECT_JSON(src, UInt32);
  ------------------
  |  |   51|     75|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  609|     75|        if(codename) {
  ------------------
  |  Branch (609:12): [True: 75, False: 0]
  ------------------
  610|     75|            ret |= writeJsonKey(ctx, UA_JSONKEY_SYMBOL);
  611|       |            ret |= ENCODE_DIRECT_JSON(&statusDescription, String);
  ------------------
  |  |   51|     75|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  612|     75|        }
  613|     75|    }
  614|  1.80k|    ret |= writeJsonObjEnd(ctx);
  615|  1.80k|    return ret;
  616|  1.80k|}
ua_types_encoding_json.c:QualifiedName_encodeJson:
  592|  88.8k|ENCODE_JSON(QualifiedName) {
  593|  88.8k|    UA_String out = UA_STRING_NULL;
  594|  88.8k|    UA_StatusCode ret = UA_QualifiedName_printEx(src, &out, ctx->namespaceMapping);
  595|       |    ret |= ENCODE_DIRECT_JSON(&out, String);
  ------------------
  |  |   51|  88.8k|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  596|  88.8k|    UA_String_clear(&out);
  597|  88.8k|    return ret;
  598|  88.8k|}
ua_types_encoding_json.c:LocalizedText_encodeJson:
  583|  2.64M|ENCODE_JSON(LocalizedText) {
  584|  2.64M|    status ret = writeJsonObjStart(ctx);
  585|  2.64M|    ret |= writeJsonKey(ctx, UA_JSONKEY_LOCALE);
  586|  2.64M|    ret |= ENCODE_DIRECT_JSON(&src->locale, String);
  ------------------
  |  |   51|  2.64M|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  587|  2.64M|    ret |= writeJsonKey(ctx, UA_JSONKEY_TEXT);
  588|       |    ret |= ENCODE_DIRECT_JSON(&src->text, String);
  ------------------
  |  |   51|  2.64M|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  589|  2.64M|    return ret | writeJsonObjEnd(ctx);
  590|  2.64M|}
ua_types_encoding_json.c:ExtensionObject_encodeJson:
  619|   166k|ENCODE_JSON(ExtensionObject) {
  620|   166k|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_NOBODY)
  ------------------
  |  Branch (620:8): [True: 166k, False: 0]
  ------------------
  621|   166k|        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.95k|                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.95k|    status ret = writeJsonArrStart(ctx);
  414|  4.95k|    if(!ptr)
  ------------------
  |  Branch (414:8): [True: 0, False: 4.95k]
  ------------------
  415|      0|        return ret | writeJsonArrEnd(ctx, type);
  416|       |
  417|  4.95k|    uintptr_t uptr = (uintptr_t)ptr;
  418|  4.95k|    encodeJsonSignature encodeType = encodeJsonJumpTable[type->typeKind];
  419|  4.95k|    UA_Boolean distinct = (type->typeKind > UA_DATATYPEKIND_DOUBLE);
  420|  3.48M|    for(size_t i = 0; i < length && ret == UA_STATUSCODE_GOOD; ++i) {
  ------------------
  |  |   16|  3.48M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (420:23): [True: 3.48M, False: 4.95k]
  |  Branch (420:37): [True: 3.48M, False: 0]
  ------------------
  421|  3.48M|        ret |= writeJsonBeforeElement(ctx, distinct);
  422|  3.48M|        if(isNull((const void*)uptr, type))
  ------------------
  |  Branch (422:12): [True: 0, False: 3.48M]
  ------------------
  423|      0|            ret |= writeChars(ctx, "null", 4);
  424|  3.48M|        else
  425|  3.48M|            ret |= encodeType(ctx, (const void*)uptr, type);
  426|       |        ctx->commaNeeded[ctx->depth] = true;
  427|  3.48M|        uptr += type->memSize;
  428|  3.48M|    }
  429|  4.95k|    return ret | writeJsonArrEnd(ctx, type);
  430|  4.95k|}
ua_types_encoding_json.c:isNull:
  225|  3.48M|isNull(const void *p, const UA_DataType *type) {
  226|  3.48M|    if(UA_DataType_isNumeric(type) || type->typeKind == UA_DATATYPEKIND_BOOLEAN)
  ------------------
  |  Branch (226:8): [True: 3.48M, False: 0]
  |  Branch (226:39): [True: 0, False: 0]
  ------------------
  227|  3.48M|        return false;
  228|      0|    UA_STACKARRAY(char, buf, type->memSize);
  ------------------
  |  |  387|      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|  3.48M|}
ua_types_encoding_json.c:DataValue_encodeJson:
  775|   155k|ENCODE_JSON(DataValue) {
  776|   155k|    UA_Boolean hasValue = src->hasValue;
  777|   155k|    UA_Boolean hasStatus = src->hasStatus;
  778|   155k|    UA_Boolean hasSourceTimestamp = src->hasSourceTimestamp;
  779|   155k|    UA_Boolean hasSourcePicoseconds = src->hasSourcePicoseconds;
  780|   155k|    UA_Boolean hasServerTimestamp = src->hasServerTimestamp;
  781|   155k|    UA_Boolean hasServerPicoseconds = src->hasServerPicoseconds;
  782|       |
  783|   155k|    status ret = writeJsonObjStart(ctx);
  784|       |
  785|   155k|    if(hasValue)
  ------------------
  |  Branch (785:8): [True: 42.1k, False: 113k]
  ------------------
  786|  42.1k|        ret |= encodeVariantInner(ctx, &src->value);
  787|       |
  788|   155k|    if(hasStatus) {
  ------------------
  |  Branch (788:8): [True: 21, False: 155k]
  ------------------
  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|   155k|    if(hasSourceTimestamp) {
  ------------------
  |  Branch (793:8): [True: 0, False: 155k]
  ------------------
  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|   155k|    if(hasSourcePicoseconds) {
  ------------------
  |  Branch (798:8): [True: 0, False: 155k]
  ------------------
  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|   155k|    if(hasServerTimestamp) {
  ------------------
  |  Branch (803:8): [True: 0, False: 155k]
  ------------------
  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|   155k|    if(hasServerPicoseconds) {
  ------------------
  |  Branch (808:8): [True: 0, False: 155k]
  ------------------
  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|   155k|    return ret | writeJsonObjEnd(ctx);
  814|   155k|}
ua_types_encoding_json.c:encodeVariantInner:
  725|   241k|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|   241k|    if(!src->type)
  ------------------
  |  Branch (729:8): [True: 137k, False: 104k]
  ------------------
  730|   137k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   137k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  731|       |
  732|       |    /* Set the array type in the encoding mask */
  733|   104k|    const bool isArray = src->arrayLength > 0 || src->data <= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|   198k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (733:26): [True: 9.54k, False: 94.6k]
  |  Branch (733:50): [True: 10.7k, False: 83.9k]
  ------------------
  734|   104k|    const bool hasDimensions = isArray && src->arrayDimensionsSize > 1;
  ------------------
  |  Branch (734:32): [True: 20.3k, False: 83.9k]
  |  Branch (734:43): [True: 4.95k, False: 15.3k]
  ------------------
  735|       |
  736|       |    /* Wrap the value in an ExtensionObject if not builtin. We cannot directly
  737|       |     * encode a variant inside a variant (but arrays of variant are possible) */
  738|   104k|    UA_Boolean wrapEO = (src->type->typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO);
  739|   104k|    if(src->type == &UA_TYPES[UA_TYPES_VARIANT] && !isArray)
  ------------------
  |  |  803|   104k|#define UA_TYPES_VARIANT 23
  ------------------
  |  Branch (739:8): [True: 1.45k, False: 102k]
  |  Branch (739:52): [True: 0, False: 1.45k]
  ------------------
  740|      0|        wrapEO = true;
  741|       |
  742|   104k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   104k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  743|       |
  744|       |    /* Write the type number */
  745|   104k|    UA_UInt32 typeId = src->type->typeKind + 1;
  746|   104k|    if(wrapEO)
  ------------------
  |  Branch (746:8): [True: 0, False: 104k]
  ------------------
  747|      0|        typeId = UA_TYPES[UA_TYPES_EXTENSIONOBJECT].typeKind + 1;
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  748|   104k|    ret |= writeJsonKey(ctx, UA_JSONKEY_TYPE);
  749|   104k|    ret |= ENCODE_DIRECT_JSON(&typeId, UInt32);
  ------------------
  |  |   51|   104k|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  750|       |
  751|       |    /* Write the value */
  752|   104k|    ret |= writeJsonKey(ctx, UA_JSONKEY_VALUE);
  753|   104k|    if(!isArray) {
  ------------------
  |  Branch (753:8): [True: 83.9k, False: 20.3k]
  ------------------
  754|  83.9k|        ret |= encodeScalarJsonWrapExtensionObject(ctx, src);
  755|  83.9k|    } else {
  756|  20.3k|        ret |= encodeArrayJsonWrapExtensionObject(ctx, src->data,
  757|  20.3k|                                                  src->arrayLength, src->type);
  758|  20.3k|    }
  759|       |
  760|       |    /* Write the dimensions */
  761|   104k|    if(hasDimensions) {
  ------------------
  |  Branch (761:8): [True: 4.95k, False: 99.2k]
  ------------------
  762|  4.95k|        ret |= writeJsonKey(ctx, UA_JSONKEY_DIMENSIONS);
  763|  4.95k|        ret |= encodeJsonArray(ctx, src->arrayDimensions, src->arrayDimensionsSize,
  764|  4.95k|                               &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  225|  4.95k|#define UA_TYPES_UINT32 6
  ------------------
  765|  4.95k|    }
  766|       |
  767|   104k|    return ret;
  768|   241k|}
ua_types_encoding_json.c:encodeScalarJsonWrapExtensionObject:
  671|  83.9k|encodeScalarJsonWrapExtensionObject(CtxJson *ctx, const UA_Variant *src) {
  672|  83.9k|    const UA_Boolean isBuiltin = (src->type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO);
  673|  83.9k|    const void *ptr = src->data;
  674|  83.9k|    const UA_DataType *type = src->type;
  675|       |
  676|       |    /* Set up a temporary ExtensionObject to wrap the data */
  677|  83.9k|    UA_ExtensionObject eo;
  678|  83.9k|    if(!isBuiltin) {
  ------------------
  |  Branch (678:8): [True: 0, False: 83.9k]
  ------------------
  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|  83.9k|    return encodeJsonJumpTable[type->typeKind](ctx, ptr, type);
  688|  83.9k|}
ua_types_encoding_json.c:encodeArrayJsonWrapExtensionObject:
  693|  20.3k|                                   size_t size, const UA_DataType *type) {
  694|  20.3k|    if(size > UA_INT32_MAX)
  ------------------
  |  |  100|  20.3k|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (694:8): [True: 0, False: 20.3k]
  ------------------
  695|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  696|       |
  697|  20.3k|    status ret = writeJsonArrStart(ctx);
  698|       |
  699|  20.3k|    u16 memSize = type->memSize;
  700|  20.3k|    const UA_Boolean isBuiltin = (type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO);
  701|  20.3k|    if(isBuiltin) {
  ------------------
  |  Branch (701:8): [True: 20.3k, False: 0]
  ------------------
  702|  20.3k|        uintptr_t ptr = (uintptr_t)data;
  703|  15.5M|        for(size_t i = 0; i < size && ret == UA_STATUSCODE_GOOD; ++i) {
  ------------------
  |  |   16|  15.4M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (703:27): [True: 15.4M, False: 20.3k]
  |  Branch (703:39): [True: 15.4M, False: 0]
  ------------------
  704|  15.4M|            ret |= writeJsonArrElm(ctx, (const void*)ptr, type);
  705|  15.4M|            ptr += memSize;
  706|  15.4M|        }
  707|  20.3k|    } 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|  20.3k|    return ret | writeJsonArrEnd(ctx, type);
  722|  20.3k|}
ua_types_encoding_json.c:Variant_encodeJson:
  770|   199k|ENCODE_JSON(Variant) {
  771|   199k|    return writeJsonObjStart(ctx) | encodeVariantInner(ctx, src) | writeJsonObjEnd(ctx);
  772|   199k|}
ua_types_encoding_json.c:DiagnosticInfo_encodeJson:
  817|  2.15k|ENCODE_JSON(DiagnosticInfo) {
  818|  2.15k|    status ret = writeJsonObjStart(ctx);
  819|       |
  820|  2.15k|    if(src->hasSymbolicId) {
  ------------------
  |  Branch (820:8): [True: 0, False: 2.15k]
  ------------------
  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.15k|    if(src->hasNamespaceUri) {
  ------------------
  |  Branch (825:8): [True: 3, False: 2.15k]
  ------------------
  826|      3|        ret |= writeJsonKey(ctx, UA_JSONKEY_NAMESPACEURI);
  827|      3|        ret |= ENCODE_DIRECT_JSON(&src->namespaceUri, Int32);
  ------------------
  |  |   51|      3|    TYPE##_encodeJson(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  828|      3|    }
  829|       |
  830|  2.15k|    if(src->hasLocalizedText) {
  ------------------
  |  Branch (830:8): [True: 0, False: 2.15k]
  ------------------
  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.15k|    if(src->hasLocale) {
  ------------------
  |  Branch (835:8): [True: 0, False: 2.15k]
  ------------------
  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.15k|    if(src->hasAdditionalInfo) {
  ------------------
  |  Branch (840:8): [True: 0, False: 2.15k]
  ------------------
  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.15k|    if(src->hasInnerStatusCode) {
  ------------------
  |  Branch (845:8): [True: 0, False: 2.15k]
  ------------------
  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.15k|    if(src->hasInnerDiagnosticInfo && src->innerDiagnosticInfo) {
  ------------------
  |  Branch (850:8): [True: 0, False: 2.15k]
  |  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.15k|    return ret | writeJsonObjEnd(ctx);
  857|  2.15k|}
ua_types_encoding_json.c:jsoneq:
 1091|  2.26M|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.26M|    size_t len = getTokenLength(tok);
 1100|  2.26M|    if(tok->type == CJ5_TOKEN_STRING &&
  ------------------
  |  Branch (1100:8): [True: 2.26M, False: 0]
  ------------------
 1101|  2.26M|       strlen(searchKey) ==  len &&
  ------------------
  |  Branch (1101:8): [True: 1.94M, False: 319k]
  ------------------
 1102|  1.94M|       strncmp(json + tok->start, (const char*)searchKey, len) == 0)
  ------------------
  |  Branch (1102:8): [True: 1.94M, False: 5.14k]
  ------------------
 1103|  1.94M|        return 0;
 1104|       |
 1105|   324k|    return -1;
 1106|  2.26M|}
ua_types_encoding_json.c:skipObject:
 1076|   419k|skipObject(ParseCtx *ctx) {
 1077|   419k|    unsigned int end = ctx->tokens[ctx->index].end;
 1078|  67.6M|    do {
 1079|  67.6M|        ctx->index++;
 1080|  67.6M|    } while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1080:13): [True: 67.6M, False: 10.8k]
  ------------------
 1081|  67.6M|            ctx->tokens[ctx->index].start < end);
  ------------------
  |  Branch (1081:13): [True: 67.2M, False: 408k]
  ------------------
 1082|   419k|}
ua_types_encoding_json.c:DiagnosticInfo_decodeJson:
 2183|  1.44k|DECODE_JSON(DiagnosticInfo) {
 2184|  1.44k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DiagnosticInfo */
  ------------------
  |  | 1061|  1.44k|#define CHECK_NULL_SKIP do {                         \
  |  | 1062|  1.44k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1062:8): [True: 0, False: 1.44k]
  |  |  ------------------
  |  | 1063|      0|        ctx->index++;                                \
  |  | 1064|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1065|  1.44k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1065:14): [Folded, False: 1.44k]
  |  |  ------------------
  ------------------
 2185|  1.44k|    CHECK_OBJECT;
  ------------------
  |  | 1056|  1.44k|#define CHECK_OBJECT do {                                \
  |  | 1057|  1.44k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1057:8): [True: 2, False: 1.44k]
  |  |  ------------------
  |  | 1058|      2|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1059|  1.44k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1059:14): [Folded, False: 1.44k]
  |  |  ------------------
  ------------------
 2186|       |
 2187|  1.44k|    DecodeEntry entries[7] = {
 2188|  1.44k|        {UA_JSONKEY_SYMBOLICID, &dst->symbolicId, NULL, false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|  1.44k|#define UA_TYPES_INT32 5
  ------------------
 2189|  1.44k|        {UA_JSONKEY_NAMESPACEURI, &dst->namespaceUri, NULL, false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|  1.44k|#define UA_TYPES_INT32 5
  ------------------
 2190|  1.44k|        {UA_JSONKEY_LOCALIZEDTEXT, &dst->localizedText, NULL, false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|  1.44k|#define UA_TYPES_INT32 5
  ------------------
 2191|  1.44k|        {UA_JSONKEY_LOCALE, &dst->locale, NULL, false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|  1.44k|#define UA_TYPES_INT32 5
  ------------------
 2192|  1.44k|        {UA_JSONKEY_ADDITIONALINFO, &dst->additionalInfo, NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  395|  1.44k|#define UA_TYPES_STRING 11
  ------------------
 2193|  1.44k|        {UA_JSONKEY_INNERSTATUSCODE, &dst->innerStatusCode, NULL, false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  633|  1.44k|#define UA_TYPES_STATUSCODE 18
  ------------------
 2194|  1.44k|        {UA_JSONKEY_INNERDIAGNOSTICINFO, &dst->innerDiagnosticInfo, DiagnosticInfoInner_decodeJson, false, NULL}
 2195|  1.44k|    };
 2196|  1.44k|    status ret = decodeFields(ctx, entries, 7);
 2197|       |
 2198|  1.44k|    dst->hasSymbolicId = entries[0].found;
 2199|  1.44k|    dst->hasNamespaceUri = entries[1].found;
 2200|  1.44k|    dst->hasLocalizedText = entries[2].found;
 2201|  1.44k|    dst->hasLocale = entries[3].found;
 2202|  1.44k|    dst->hasAdditionalInfo = entries[4].found;
 2203|  1.44k|    dst->hasInnerStatusCode = entries[5].found;
 2204|  1.44k|    dst->hasInnerDiagnosticInfo = entries[6].found;
 2205|  1.44k|    return ret;
 2206|  1.44k|}
ua_types_encoding_json.c:Boolean_decodeJson:
 1108|  3.89k|DECODE_JSON(Boolean) {
 1109|  3.89k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  3.89k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  3.89k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 3.89k]
  |  |  ------------------
  |  | 1038|  3.89k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  3.89k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 3.89k]
  |  |  ------------------
  ------------------
 1110|  3.89k|    CHECK_BOOL;
  ------------------
  |  | 1046|  3.89k|#define CHECK_BOOL do {                                \
  |  | 1047|  3.89k|    if(currentTokenType(ctx) != CJ5_TOKEN_BOOL) {      \
  |  |  ------------------
  |  |  |  Branch (1047:8): [True: 20, False: 3.87k]
  |  |  ------------------
  |  | 1048|     20|        return UA_STATUSCODE_BADDECODINGERROR;         \
  |  |  ------------------
  |  |  |  |   43|     20|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1049|  3.87k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1049:14): [Folded, False: 3.87k]
  |  |  ------------------
  ------------------
 1111|  3.87k|    GET_TOKEN;
  ------------------
  |  | 1032|  3.87k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|  3.87k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|  3.87k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 3.87k]
  |  |  ------------------
  ------------------
 1112|       |
 1113|  3.87k|    if(tokenSize == 4 &&
  ------------------
  |  Branch (1113:8): [True: 527, False: 3.34k]
  ------------------
 1114|    527|       (tokenData[0] | 32) == 't' && (tokenData[1] | 32) == 'r' &&
  ------------------
  |  Branch (1114:8): [True: 527, False: 0]
  |  Branch (1114:38): [True: 527, False: 0]
  ------------------
 1115|    527|       (tokenData[2] | 32) == 'u' && (tokenData[3] | 32) == 'e') {
  ------------------
  |  Branch (1115:8): [True: 527, False: 0]
  |  Branch (1115:38): [True: 527, False: 0]
  ------------------
 1116|    527|        *dst = true;
 1117|  3.34k|    } else if(tokenSize == 5 &&
  ------------------
  |  Branch (1117:15): [True: 3.34k, False: 0]
  ------------------
 1118|  3.34k|              (tokenData[0] | 32) == 'f' && (tokenData[1] | 32) == 'a' &&
  ------------------
  |  Branch (1118:15): [True: 3.34k, False: 0]
  |  Branch (1118:45): [True: 3.34k, False: 0]
  ------------------
 1119|  3.34k|              (tokenData[2] | 32) == 'l' && (tokenData[3] | 32) == 's' &&
  ------------------
  |  Branch (1119:15): [True: 3.34k, False: 0]
  |  Branch (1119:45): [True: 3.34k, False: 0]
  ------------------
 1120|  3.34k|              (tokenData[4] | 32) == 'e') {
  ------------------
  |  Branch (1120:15): [True: 3.34k, False: 0]
  ------------------
 1121|  3.34k|        *dst = false;
 1122|  3.34k|    } else {
 1123|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1124|      0|    }
 1125|       |
 1126|  3.87k|    ctx->index++;
 1127|  3.87k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  3.87k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1128|  3.87k|}
ua_types_encoding_json.c:SByte_decodeJson:
 1215|   508k|DECODE_JSON(SByte) {
 1216|   508k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|   508k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|   508k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 508k]
  |  |  ------------------
  |  | 1038|   508k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|   508k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 508k]
  |  |  ------------------
  ------------------
 1217|   508k|    CHECK_NUMBER;
  ------------------
  |  | 1041|   508k|#define CHECK_NUMBER do {                                \
  |  | 1042|   508k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1042:8): [True: 0, False: 508k]
  |  |  ------------------
  |  | 1043|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1044|   508k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1044:14): [Folded, False: 508k]
  |  |  ------------------
  ------------------
 1218|   508k|    GET_TOKEN;
  ------------------
  |  | 1032|   508k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|   508k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|   508k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 508k]
  |  |  ------------------
  ------------------
 1219|       |
 1220|   508k|    UA_Int64 out = 0;
 1221|   508k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1222|   508k|    if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   16|  1.01M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   63|  1.01M|#define UA_SBYTE_MIN (-128)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   64|   508k|#define UA_SBYTE_MAX 127
  ------------------
  |  Branch (1222:8): [True: 17, False: 508k]
  |  Branch (1222:35): [True: 1, False: 508k]
  |  Branch (1222:57): [True: 1, False: 508k]
  ------------------
 1223|     19|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     19|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1224|   508k|    *dst = (UA_SByte)out;
 1225|   508k|    ctx->index++;
 1226|   508k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   508k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1227|   508k|}
ua_types_encoding_json.c:parseSignedInteger:
 1147|  4.62M|parseSignedInteger(const char *tokenData, size_t tokenSize, UA_Int64 *dst) {
 1148|  4.62M|    size_t len = parseInt64(tokenData, tokenSize, dst);
 1149|  4.62M|    if(len == 0)
  ------------------
  |  Branch (1149:8): [True: 9, False: 4.62M]
  ------------------
 1150|      9|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1151|       |
 1152|       |    /* There must only be whitespace between the end of the parsed number and
 1153|       |     * the end of the token */
 1154|  4.63M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1154:25): [True: 719, False: 4.62M]
  ------------------
 1155|    719|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1155:12): [True: 688, False: 31]
  |  Branch (1155:35): [True: 54, False: 634]
  ------------------
 1156|     54|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     54|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1157|    719|    }
 1158|       |
 1159|  4.62M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  4.62M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1160|  4.62M|}
ua_types_encoding_json.c:Byte_decodeJson:
 1162|  4.08k|DECODE_JSON(Byte) {
 1163|  4.08k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  4.08k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  4.08k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 4.08k]
  |  |  ------------------
  |  | 1038|  4.08k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  4.08k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 4.08k]
  |  |  ------------------
  ------------------
 1164|  4.08k|    CHECK_NUMBER;
  ------------------
  |  | 1041|  4.08k|#define CHECK_NUMBER do {                                \
  |  | 1042|  4.08k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1042:8): [True: 0, False: 4.08k]
  |  |  ------------------
  |  | 1043|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1044|  4.08k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1044:14): [Folded, False: 4.08k]
  |  |  ------------------
  ------------------
 1165|  4.08k|    GET_TOKEN;
  ------------------
  |  | 1032|  4.08k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|  4.08k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|  4.08k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 4.08k]
  |  |  ------------------
  ------------------
 1166|       |
 1167|  4.08k|    UA_UInt64 out = 0;
 1168|  4.08k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1169|  4.08k|    if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   16|  8.17k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   73|  4.07k|#define UA_BYTE_MAX 255
  ------------------
  |  Branch (1169:8): [True: 7, False: 4.07k]
  |  Branch (1169:35): [True: 1, False: 4.07k]
  ------------------
 1170|      8|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      8|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1171|  4.07k|    *dst = (UA_Byte)out;
 1172|  4.07k|    ctx->index++;
 1173|  4.07k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  4.07k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1174|  4.08k|}
ua_types_encoding_json.c:parseUnsignedInteger:
 1131|  6.23M|parseUnsignedInteger(const char *tokenData, size_t tokenSize, UA_UInt64 *dst) {
 1132|  6.23M|    size_t len = parseUInt64(tokenData, tokenSize, dst);
 1133|  6.23M|    if(len == 0)
  ------------------
  |  Branch (1133:8): [True: 23, False: 6.23M]
  ------------------
 1134|     23|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     23|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1135|       |
 1136|       |    /* There must only be whitespace between the end of the parsed number and
 1137|       |     * the end of the token */
 1138|  6.23M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1138:25): [True: 735, False: 6.23M]
  ------------------
 1139|    735|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1139:12): [True: 702, False: 33]
  |  Branch (1139:35): [True: 41, False: 661]
  ------------------
 1140|     41|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     41|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1141|    735|    }
 1142|       |
 1143|  6.23M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  6.23M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1144|  6.23M|}
ua_types_encoding_json.c:Int16_decodeJson:
 1229|   868k|DECODE_JSON(Int16) {
 1230|   868k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|   868k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|   868k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 868k]
  |  |  ------------------
  |  | 1038|   868k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|   868k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 868k]
  |  |  ------------------
  ------------------
 1231|   868k|    CHECK_NUMBER;
  ------------------
  |  | 1041|   868k|#define CHECK_NUMBER do {                                \
  |  | 1042|   868k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1042:8): [True: 0, False: 868k]
  |  |  ------------------
  |  | 1043|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1044|   868k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1044:14): [Folded, False: 868k]
  |  |  ------------------
  ------------------
 1232|   868k|    GET_TOKEN;
  ------------------
  |  | 1032|   868k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|   868k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|   868k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 868k]
  |  |  ------------------
  ------------------
 1233|       |
 1234|   868k|    UA_Int64 out = 0;
 1235|   868k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1236|   868k|    if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   16|  1.73M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   81|  1.73M|#define UA_INT16_MIN (-32768)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   82|   868k|#define UA_INT16_MAX 32767
  ------------------
  |  Branch (1236:8): [True: 18, False: 868k]
  |  Branch (1236:35): [True: 4, False: 868k]
  |  Branch (1236:57): [True: 4, False: 868k]
  ------------------
 1237|     26|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     26|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1238|   868k|    *dst = (UA_Int16)out;
 1239|   868k|    ctx->index++;
 1240|   868k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   868k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1241|   868k|}
ua_types_encoding_json.c:UInt16_decodeJson:
 1176|   585k|DECODE_JSON(UInt16) {
 1177|   585k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|   585k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|   585k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 585k]
  |  |  ------------------
  |  | 1038|   585k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|   585k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 585k]
  |  |  ------------------
  ------------------
 1178|   585k|    CHECK_NUMBER;
  ------------------
  |  | 1041|   585k|#define CHECK_NUMBER do {                                \
  |  | 1042|   585k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1042:8): [True: 0, False: 585k]
  |  |  ------------------
  |  | 1043|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1044|   585k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1044:14): [Folded, False: 585k]
  |  |  ------------------
  ------------------
 1179|   585k|    GET_TOKEN;
  ------------------
  |  | 1032|   585k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|   585k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|   585k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 585k]
  |  |  ------------------
  ------------------
 1180|       |
 1181|   585k|    UA_UInt64 out = 0;
 1182|   585k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1183|   585k|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   16|  1.17M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   91|   585k|#define UA_UINT16_MAX 65535
  ------------------
  |  Branch (1183:8): [True: 12, False: 585k]
  |  Branch (1183:35): [True: 5, False: 585k]
  ------------------
 1184|     17|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     17|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1185|   585k|    *dst = (UA_UInt16)out;
 1186|   585k|    ctx->index++;
 1187|   585k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   585k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1188|   585k|}
ua_types_encoding_json.c:Int32_decodeJson:
 1243|  1.87M|DECODE_JSON(Int32) {
 1244|  1.87M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  1.87M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  1.87M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 1.87M]
  |  |  ------------------
  |  | 1038|  1.87M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  1.87M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 1.87M]
  |  |  ------------------
  ------------------
 1245|  1.87M|    CHECK_NUMBER;
  ------------------
  |  | 1041|  1.87M|#define CHECK_NUMBER do {                                \
  |  | 1042|  1.87M|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1042:8): [True: 1, False: 1.87M]
  |  |  ------------------
  |  | 1043|      1|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1044|  1.87M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1044:14): [Folded, False: 1.87M]
  |  |  ------------------
  ------------------
 1246|  1.87M|    GET_TOKEN;
  ------------------
  |  | 1032|  1.87M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|  1.87M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|  1.87M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 1.87M]
  |  |  ------------------
  ------------------
 1247|       |
 1248|  1.87M|    UA_Int64 out = 0;
 1249|  1.87M|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1250|  1.87M|    if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   16|  3.75M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   99|  3.75M|#define UA_INT32_MIN ((int32_t)-2147483648LL)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |  100|  1.87M|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (1250:8): [True: 11, False: 1.87M]
  |  Branch (1250:35): [True: 0, False: 1.87M]
  |  Branch (1250:57): [True: 2, False: 1.87M]
  ------------------
 1251|     13|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     13|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1252|  1.87M|    *dst = (UA_Int32)out;
 1253|  1.87M|    ctx->index++;
 1254|  1.87M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.87M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1255|  1.87M|}
ua_types_encoding_json.c:UInt32_decodeJson:
 1190|  2.32M|DECODE_JSON(UInt32) {
 1191|  2.32M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  2.32M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  2.32M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 2.32M]
  |  |  ------------------
  |  | 1038|  2.32M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  2.32M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 2.32M]
  |  |  ------------------
  ------------------
 1192|  2.32M|    CHECK_NUMBER;
  ------------------
  |  | 1041|  2.32M|#define CHECK_NUMBER do {                                \
  |  | 1042|  2.32M|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1042:8): [True: 7, False: 2.32M]
  |  |  ------------------
  |  | 1043|      7|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1044|  2.32M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1044:14): [Folded, False: 2.32M]
  |  |  ------------------
  ------------------
 1193|  2.32M|    GET_TOKEN;
  ------------------
  |  | 1032|  2.32M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|  2.32M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|  2.32M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 2.32M]
  |  |  ------------------
  ------------------
 1194|       |
 1195|  2.32M|    UA_UInt64 out = 0;
 1196|  2.32M|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1197|  2.32M|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |   16|  4.64M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |  109|  2.32M|#define UA_UINT32_MAX 4294967295UL
  ------------------
  |  Branch (1197:8): [True: 24, False: 2.32M]
  |  Branch (1197:35): [True: 3, False: 2.32M]
  ------------------
 1198|     27|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     27|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1199|  2.32M|    *dst = (UA_UInt32)out;
 1200|  2.32M|    ctx->index++;
 1201|  2.32M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  2.32M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1202|  2.32M|}
ua_types_encoding_json.c:Int64_decodeJson:
 1257|  1.37M|DECODE_JSON(Int64) {
 1258|  1.37M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  1.37M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  1.37M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 1.37M]
  |  |  ------------------
  |  | 1038|  1.37M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  1.37M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 1.37M]
  |  |  ------------------
  ------------------
 1259|  1.37M|    GET_TOKEN;
  ------------------
  |  | 1032|  1.37M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|  1.37M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|  1.37M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 1.37M]
  |  |  ------------------
  ------------------
 1260|       |
 1261|  1.37M|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, dst);
 1262|  1.37M|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  1.37M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1262:8): [True: 17, False: 1.37M]
  ------------------
 1263|     17|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     17|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1264|  1.37M|    ctx->index++;
 1265|  1.37M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.37M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1266|  1.37M|}
ua_types_encoding_json.c:UInt64_decodeJson:
 1204|  3.32M|DECODE_JSON(UInt64) {
 1205|  3.32M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  3.32M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  3.32M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 3.32M]
  |  |  ------------------
  |  | 1038|  3.32M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  3.32M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 3.32M]
  |  |  ------------------
  ------------------
 1206|  3.32M|    GET_TOKEN;
  ------------------
  |  | 1032|  3.32M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|  3.32M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|  3.32M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 3.32M]
  |  |  ------------------
  ------------------
 1207|       |
 1208|  3.32M|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, dst);
 1209|  3.32M|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  3.32M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1209:8): [True: 21, False: 3.32M]
  ------------------
 1210|     21|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     21|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1211|  3.32M|    ctx->index++;
 1212|  3.32M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  3.32M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1213|  3.32M|}
ua_types_encoding_json.c:Float_decodeJson:
 1328|  1.21M|DECODE_JSON(Float) {
 1329|  1.21M|    UA_Double v = 0.0;
 1330|       |    UA_StatusCode res = Double_decodeJson(ctx, &v, NULL);
 1331|  1.21M|    *dst = (UA_Float)v;
 1332|  1.21M|    return res;
 1333|  1.21M|}
ua_types_encoding_json.c:Double_decodeJson:
 1269|  1.22M|DECODE_JSON(Double) {
 1270|  1.22M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  1.22M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  1.22M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 1.22M]
  |  |  ------------------
  |  | 1038|  1.22M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  1.22M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 1.22M]
  |  |  ------------------
  ------------------
 1271|  1.22M|    GET_TOKEN;
  ------------------
  |  | 1032|  1.22M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|  1.22M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|  1.22M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 1.22M]
  |  |  ------------------
  ------------------
 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.22M|    if(tokenSize > 2000)
  ------------------
  |  Branch (1277:8): [True: 9, False: 1.22M]
  ------------------
 1278|      9|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1279|       |
 1280|  1.22M|    cj5_token_type tokenType = currentTokenType(ctx);
 1281|       |
 1282|       |    /* It could be a String with Nan, Infinity */
 1283|  1.22M|    if(tokenType == CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (1283:8): [True: 6.70k, False: 1.22M]
  ------------------
 1284|  6.70k|        ctx->index++;
 1285|       |
 1286|  6.70k|        if(tokenSize == 8 && memcmp(tokenData, "Infinity", 8) == 0) {
  ------------------
  |  Branch (1286:12): [True: 848, False: 5.85k]
  |  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|  5.85k|        if(tokenSize == 9 && memcmp(tokenData, "-Infinity", 9) == 0) {
  ------------------
  |  Branch (1291:12): [True: 835, False: 5.02k]
  |  Branch (1291:30): [True: 835, False: 0]
  ------------------
 1292|       |            /* workaround an MSVC 2013 issue */
 1293|    835|            *dst = -INFINITY;
 1294|    835|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    835|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1295|    835|        }
 1296|       |
 1297|  5.02k|        if(tokenSize == 3 && memcmp(tokenData, "NaN", 3) == 0) {
  ------------------
  |  Branch (1297:12): [True: 4.62k, False: 398]
  |  Branch (1297:30): [True: 4.62k, False: 1]
  ------------------
 1298|  4.62k|            *dst = NAN;
 1299|  4.62k|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  4.62k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1300|  4.62k|        }
 1301|       |
 1302|    399|        if(tokenSize == 4 && memcmp(tokenData, "-NaN", 4) == 0) {
  ------------------
  |  Branch (1302:12): [True: 374, False: 25]
  |  Branch (1302:30): [True: 373, False: 1]
  ------------------
 1303|    373|            *dst = NAN;
 1304|    373|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    373|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1305|    373|        }
 1306|       |
 1307|     26|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     26|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1308|    399|    }
 1309|       |
 1310|  1.22M|    if(tokenType != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1310:8): [True: 0, False: 1.22M]
  ------------------
 1311|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1312|       |
 1313|  1.22M|    size_t len = parseDouble(tokenData, tokenSize, dst);
 1314|  1.22M|    if(len == 0)
  ------------------
  |  Branch (1314:8): [True: 6, False: 1.22M]
  ------------------
 1315|      6|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      6|#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.22M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1319:25): [True: 13, False: 1.22M]
  ------------------
 1320|     13|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1320:12): [True: 13, False: 0]
  |  Branch (1320:35): [True: 13, False: 0]
  ------------------
 1321|     13|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     13|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1322|     13|    }
 1323|       |
 1324|  1.22M|    ctx->index++;
 1325|  1.22M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.22M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1326|  1.22M|}
ua_types_encoding_json.c:String_decodeJson:
 1346|   102k|DECODE_JSON(String) {
 1347|   102k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|   102k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|   102k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 102k]
  |  |  ------------------
  |  | 1038|   102k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|   102k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 102k]
  |  |  ------------------
  ------------------
 1348|   102k|    CHECK_STRING;
  ------------------
  |  | 1051|   102k|#define CHECK_STRING do {                                \
  |  | 1052|   102k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1052:8): [True: 6, False: 102k]
  |  |  ------------------
  |  | 1053|      6|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1054|   102k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1054:14): [Folded, False: 102k]
  |  |  ------------------
  ------------------
 1349|   102k|    GET_TOKEN;
  ------------------
  |  | 1032|   102k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|   102k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|   102k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 102k]
  |  |  ------------------
  ------------------
 1350|   102k|    (void)tokenData;
 1351|       |
 1352|       |    /* Empty string? */
 1353|   102k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1353:8): [True: 6.68k, False: 96.1k]
  ------------------
 1354|  6.68k|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  6.68k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1355|  6.68k|        dst->length = 0;
 1356|  6.68k|        ctx->index++;
 1357|  6.68k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  6.68k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1358|  6.68k|    }
 1359|       |
 1360|       |    /* The decoded utf8 is at most of the same length as the source string */
 1361|  96.1k|    char *outBuf = (char*)UA_malloc(tokenSize+1);
  ------------------
  |  |  350|  96.1k|# define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 1362|  96.1k|    if(!outBuf)
  ------------------
  |  Branch (1362:8): [True: 0, False: 96.1k]
  ------------------
 1363|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1364|       |
 1365|       |    /* Decode the string */
 1366|  96.1k|    cj5_result r;
 1367|  96.1k|    r.tokens = ctx->tokens;
 1368|  96.1k|    r.num_tokens = (unsigned int)ctx->tokensSize;
 1369|  96.1k|    r.json5 = ctx->json5;
 1370|  96.1k|    unsigned int len = 0;
 1371|  96.1k|    cj5_error_code err = cj5_get_str(&r, (unsigned int)ctx->index, outBuf, &len);
 1372|  96.1k|    if(err != CJ5_ERROR_NONE) {
  ------------------
  |  Branch (1372:8): [True: 39, False: 96.1k]
  ------------------
 1373|     39|        UA_free(outBuf);
  ------------------
  |  |  351|     39|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1374|     39|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     39|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1375|     39|    }
 1376|       |
 1377|       |    /* Set the output */
 1378|  96.1k|    dst->length = len;
 1379|  96.1k|    if(dst->length > 0) {
  ------------------
  |  Branch (1379:8): [True: 96.1k, False: 0]
  ------------------
 1380|  96.1k|        dst->data = (UA_Byte*)outBuf;
 1381|  96.1k|    } 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);
  ------------------
  |  |  351|      0|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1384|      0|    }
 1385|       |
 1386|  96.1k|    ctx->index++;
 1387|  96.1k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  96.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1388|  96.1k|}
ua_types_encoding_json.c:DateTime_decodeJson:
 1489|  19.9k|DECODE_JSON(DateTime) {
 1490|  19.9k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  19.9k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  19.9k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 19.9k]
  |  |  ------------------
  |  | 1038|  19.9k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  19.9k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 19.9k]
  |  |  ------------------
  ------------------
 1491|  19.9k|    CHECK_STRING;
  ------------------
  |  | 1051|  19.9k|#define CHECK_STRING do {                                \
  |  | 1052|  19.9k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1052:8): [True: 2, False: 19.9k]
  |  |  ------------------
  |  | 1053|      2|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1054|  19.9k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1054:14): [Folded, False: 19.9k]
  |  |  ------------------
  ------------------
 1492|  19.9k|    GET_TOKEN;
  ------------------
  |  | 1032|  19.9k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|  19.9k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|  19.9k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 19.9k]
  |  |  ------------------
  ------------------
 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|  19.9k|    if(tokenSize == 0 || tokenData[tokenSize-1] != 'Z')
  ------------------
  |  Branch (1496:8): [True: 0, False: 19.9k]
  |  Branch (1496:26): [True: 5, False: 19.9k]
  ------------------
 1497|      5|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1498|       |
 1499|  19.9k|    struct musl_tm dts;
 1500|  19.9k|    memset(&dts, 0, sizeof(dts));
 1501|       |
 1502|  19.9k|    size_t pos = 0;
 1503|  19.9k|    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|  19.9k|    if(tokenData[0] == '-' || tokenData[0] == '+')
  ------------------
  |  Branch (1510:8): [True: 3.40k, False: 16.5k]
  |  Branch (1510:31): [True: 67, False: 16.4k]
  ------------------
 1511|  3.46k|        pos++;
 1512|  19.9k|    UA_Int64 year = 0;
 1513|  19.9k|    len = parseInt64(&tokenData[pos], 5, &year);
 1514|  19.9k|    pos += len;
 1515|  19.9k|    if(len != 4 && tokenData[pos] != '-')
  ------------------
  |  Branch (1515:8): [True: 5.41k, False: 14.5k]
  |  Branch (1515:20): [True: 6, False: 5.40k]
  ------------------
 1516|      6|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1517|  19.9k|    if(tokenData[0] == '-')
  ------------------
  |  Branch (1517:8): [True: 3.40k, False: 16.5k]
  ------------------
 1518|  3.40k|        year = -year;
 1519|  19.9k|    dts.tm_year = (UA_Int16)year - 1900;
 1520|  19.9k|    if(tokenData[pos] == '-')
  ------------------
  |  Branch (1520:8): [True: 19.9k, False: 0]
  ------------------
 1521|  19.9k|        pos++;
 1522|       |
 1523|       |    /* Parse the month */
 1524|  19.9k|    UA_UInt64 month = 0;
 1525|  19.9k|    len = parseUInt64(&tokenData[pos], 2, &month);
 1526|  19.9k|    pos += len;
 1527|  19.9k|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|  19.9k|    do {                                                                                 \
  |  |  173|  19.9k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|  19.9k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 1, False: 19.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      1|            EVAL_ON_ERROR;                                                               \
  |  |  175|      1|        }                                                                                \
  |  |  176|  19.9k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 19.9k]
  |  |  ------------------
  ------------------
 1528|  19.9k|    dts.tm_mon = (UA_UInt16)month - 1;
 1529|  19.9k|    if(tokenData[pos] == '-')
  ------------------
  |  Branch (1529:8): [True: 9.89k, False: 10.0k]
  ------------------
 1530|  9.89k|        pos++;
 1531|       |
 1532|       |    /* Parse the day and check the T between date and time */
 1533|  19.9k|    UA_UInt64 day = 0;
 1534|  19.9k|    len = parseUInt64(&tokenData[pos], 2, &day);
 1535|  19.9k|    pos += len;
 1536|  19.9k|    UA_CHECK(len == 2 || tokenData[pos] != 'T',
  ------------------
  |  |  172|  19.9k|    do {                                                                                 \
  |  |  173|  19.9k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|  20.7k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 0, False: 19.9k]
  |  |  |  |  |  Branch (591:43): [True: 19.1k, False: 801]
  |  |  |  |  |  Branch (591:43): [True: 801, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|  19.9k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 19.9k]
  |  |  ------------------
  ------------------
 1537|  19.9k|             return UA_STATUSCODE_BADDECODINGERROR);
 1538|  19.9k|    dts.tm_mday = (UA_UInt16)day;
 1539|  19.9k|    pos++;
 1540|       |
 1541|       |    /* Parse the hour */
 1542|  19.9k|    UA_UInt64 hour = 0;
 1543|  19.9k|    len = parseUInt64(&tokenData[pos], 2, &hour);
 1544|  19.9k|    pos += len;
 1545|  19.9k|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|  19.9k|    do {                                                                                 \
  |  |  173|  19.9k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|  19.9k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 6, False: 19.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      6|            EVAL_ON_ERROR;                                                               \
  |  |  175|      6|        }                                                                                \
  |  |  176|  19.9k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 19.9k]
  |  |  ------------------
  ------------------
 1546|  19.9k|    dts.tm_hour = (UA_UInt16)hour;
 1547|  19.9k|    if(tokenData[pos] == ':')
  ------------------
  |  Branch (1547:8): [True: 9.89k, False: 10.0k]
  ------------------
 1548|  9.89k|        pos++;
 1549|       |
 1550|       |    /* Parse the minute */
 1551|  19.9k|    UA_UInt64 min = 0;
 1552|  19.9k|    len = parseUInt64(&tokenData[pos], 2, &min);
 1553|  19.9k|    pos += len;
 1554|  19.9k|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|  19.9k|    do {                                                                                 \
  |  |  173|  19.9k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|  19.9k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 6, False: 19.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      6|            EVAL_ON_ERROR;                                                               \
  |  |  175|      6|        }                                                                                \
  |  |  176|  19.9k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 19.9k]
  |  |  ------------------
  ------------------
 1555|  19.9k|    dts.tm_min = (UA_UInt16)min;
 1556|  19.9k|    if(tokenData[pos] == ':')
  ------------------
  |  Branch (1556:8): [True: 9.89k, False: 10.0k]
  ------------------
 1557|  9.89k|        pos++;
 1558|       |
 1559|       |    /* Parse the second */
 1560|  19.9k|    UA_UInt64 sec = 0;
 1561|  19.9k|    len = parseUInt64(&tokenData[pos], 2, &sec);
 1562|  19.9k|    pos += len;
 1563|  19.9k|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|  19.9k|    do {                                                                                 \
  |  |  173|  19.9k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|  19.9k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 0, False: 19.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|  19.9k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 19.9k]
  |  |  ------------------
  ------------------
 1564|  19.9k|    dts.tm_sec = (UA_UInt16)sec;
 1565|       |
 1566|       |    /* Compute the seconds since the Unix epoch */
 1567|  19.9k|    long long sinceunix = musl_tm_to_secs(&dts);
 1568|       |
 1569|       |    /* Are we within the range that can be represented? */
 1570|  19.9k|    long long sinceunix_min =
 1571|  19.9k|        (long long)(UA_INT64_MIN / UA_DATETIME_SEC) -
  ------------------
  |  |  119|  19.9k|#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
  |  |  ------------------
  |  |  |  |  118|  19.9k|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  |  |  ------------------
  ------------------
                      (long long)(UA_INT64_MIN / UA_DATETIME_SEC) -
  ------------------
  |  |  285|  19.9k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  19.9k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  19.9k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1572|  19.9k|        (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC) -
  ------------------
  |  |  327|  19.9k|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|  19.9k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  19.9k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  19.9k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC) -
  ------------------
  |  |  285|  19.9k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  19.9k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  19.9k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1573|  19.9k|        (long long)1; /* manual correction due to rounding */
 1574|  19.9k|    long long sinceunix_max = (long long)
 1575|  19.9k|        ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  118|  19.9k|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  ------------------
                      ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  327|  19.9k|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|  19.9k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  19.9k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  19.9k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  285|  19.9k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  19.9k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  19.9k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1576|  19.9k|    if(sinceunix < sinceunix_min || sinceunix > sinceunix_max)
  ------------------
  |  Branch (1576:8): [True: 2, False: 19.9k]
  |  Branch (1576:37): [True: 0, False: 19.9k]
  ------------------
 1577|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      2|#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|  19.9k|    sinceunix -= (sinceunix > 0) ? 1 : -1;
  ------------------
  |  Branch (1582:18): [True: 5.78k, False: 14.1k]
  ------------------
 1583|  19.9k|    UA_DateTime dt = (UA_DateTime)
 1584|  19.9k|        (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  327|  19.9k|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|  19.9k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  19.9k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  19.9k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  285|  19.9k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  19.9k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  19.9k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  285|  19.9k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  19.9k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  19.9k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1585|       |
 1586|       |    /* Parse the fraction of the second if defined */
 1587|  19.9k|    if(tokenData[pos] == ',' || tokenData[pos] == '.') {
  ------------------
  |  Branch (1587:8): [True: 352, False: 19.5k]
  |  Branch (1587:33): [True: 6.37k, False: 13.1k]
  ------------------
 1588|  6.72k|        pos++;
 1589|  6.72k|        double frac = 0.0;
 1590|  6.72k|        double denom = 0.1;
 1591|  54.1k|        while(pos < tokenSize &&
  ------------------
  |  Branch (1591:15): [True: 54.1k, False: 0]
  ------------------
 1592|  54.1k|              tokenData[pos] >= '0' && tokenData[pos] <= '9') {
  ------------------
  |  Branch (1592:15): [True: 54.1k, False: 21]
  |  Branch (1592:40): [True: 47.4k, False: 6.70k]
  ------------------
 1593|  47.4k|            frac += denom * (tokenData[pos] - '0');
 1594|  47.4k|            denom *= 0.1;
 1595|  47.4k|            pos++;
 1596|  47.4k|        }
 1597|  6.72k|        frac += 0.00000005; /* Correct rounding when converting to integer */
 1598|  6.72k|        dt += (UA_DateTime)(frac * UA_DATETIME_SEC);
  ------------------
  |  |  285|  6.72k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  6.72k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  6.72k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1599|  6.72k|    }
 1600|       |
 1601|       |    /* Remove the underflow/overflow protection (see above) */
 1602|  19.9k|    if(sinceunix > 0) {
  ------------------
  |  Branch (1602:8): [True: 5.78k, False: 14.1k]
  ------------------
 1603|  5.78k|        if(dt > UA_INT64_MAX - UA_DATETIME_SEC)
  ------------------
  |  |  118|  5.78k|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  ------------------
                      if(dt > UA_INT64_MAX - UA_DATETIME_SEC)
  ------------------
  |  |  285|  5.78k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  5.78k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  5.78k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1603:12): [True: 0, False: 5.78k]
  ------------------
 1604|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1605|  5.78k|        dt += UA_DATETIME_SEC;
  ------------------
  |  |  285|  5.78k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  5.78k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  5.78k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1606|  14.1k|    } else {
 1607|  14.1k|        if(dt < UA_INT64_MIN + UA_DATETIME_SEC)
  ------------------
  |  |  119|  14.1k|#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
  |  |  ------------------
  |  |  |  |  118|  14.1k|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  |  |  ------------------
  ------------------
                      if(dt < UA_INT64_MIN + UA_DATETIME_SEC)
  ------------------
  |  |  285|  14.1k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  14.1k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  14.1k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1607:12): [True: 0, False: 14.1k]
  ------------------
 1608|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1609|  14.1k|        dt -= UA_DATETIME_SEC;
  ------------------
  |  |  285|  14.1k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  14.1k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  14.1k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1610|  14.1k|    }
 1611|       |
 1612|       |    /* We must be at the end of the string (ending with 'Z' as checked above) */
 1613|  19.9k|    if(pos != tokenSize - 1)
  ------------------
  |  Branch (1613:8): [True: 45, False: 19.8k]
  ------------------
 1614|     45|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     45|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1615|       |
 1616|  19.8k|    *dst = dt;
 1617|       |
 1618|  19.8k|    ctx->index++;
 1619|  19.8k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  19.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1620|  19.9k|}
ua_types_encoding_json.c:Guid_decodeJson:
 1335|    878|DECODE_JSON(Guid) {
 1336|    878|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|    878|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|    878|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 878]
  |  |  ------------------
  |  | 1038|    878|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|    878|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 878]
  |  |  ------------------
  ------------------
 1337|    878|    CHECK_STRING;
  ------------------
  |  | 1051|    878|#define CHECK_STRING do {                                \
  |  | 1052|    878|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1052:8): [True: 0, False: 878]
  |  |  ------------------
  |  | 1053|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1054|    878|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1054:14): [Folded, False: 878]
  |  |  ------------------
  ------------------
 1338|    878|    GET_TOKEN;
  ------------------
  |  | 1032|    878|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|    878|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|    878|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 878]
  |  |  ------------------
  ------------------
 1339|       |
 1340|       |    /* Use the existing parsing routine if available */
 1341|    878|    UA_String str = {tokenSize, (UA_Byte*)(uintptr_t)tokenData};
 1342|    878|    ctx->index++;
 1343|    878|    return UA_Guid_parse(dst, str);
 1344|    878|}
ua_types_encoding_json.c:ByteString_decodeJson:
 1390|  1.62k|DECODE_JSON(ByteString) {
 1391|  1.62k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1036|  1.62k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1037|  1.62k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1037:8): [True: 0, False: 1.62k]
  |  |  ------------------
  |  | 1038|  1.62k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1039|  1.62k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1039:13): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
 1392|  1.62k|    CHECK_STRING;
  ------------------
  |  | 1051|  1.62k|#define CHECK_STRING do {                                \
  |  | 1052|  1.62k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1052:8): [True: 1, False: 1.62k]
  |  |  ------------------
  |  | 1053|      1|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1054|  1.62k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1054:14): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
 1393|  1.62k|    GET_TOKEN;
  ------------------
  |  | 1032|  1.62k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1033|  1.62k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1034|  1.62k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1034:17): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
 1394|       |
 1395|       |    /* Empty bytestring? */
 1396|  1.62k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1396:8): [True: 1.34k, False: 277]
  ------------------
 1397|  1.34k|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  1.34k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1398|  1.34k|        dst->length = 0;
 1399|  1.34k|    } else {
 1400|    277|        size_t flen = 0;
 1401|    277|        unsigned char* unB64 =
 1402|    277|            UA_unbase64((const unsigned char*)tokenData, tokenSize, &flen);
 1403|    277|        if(unB64 == 0)
  ------------------
  |  Branch (1403:12): [True: 38, False: 239]
  ------------------
 1404|     38|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     38|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1405|    239|        dst->data = (u8*)unB64;
 1406|    239|        dst->length = flen;
 1407|    239|    }
 1408|       |
 1409|  1.58k|    ctx->index++;
 1410|  1.58k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.58k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1411|  1.62k|}
ua_types_encoding_json.c:NodeId_decodeJson:
 1468|  5.72k|DECODE_JSON(NodeId) {
 1469|  5.72k|    UA_String str;
 1470|  5.72k|    UA_String_init(&str);
 1471|  5.72k|    status res = String_decodeJson(ctx, &str, NULL);
 1472|  5.72k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  5.72k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1472:8): [True: 5.71k, False: 19]
  ------------------
 1473|  5.71k|        res = UA_NodeId_parseEx(dst, str, ctx->namespaceMapping);
 1474|  5.72k|    UA_String_clear(&str);
 1475|  5.72k|    return res;
 1476|  5.72k|}
ua_types_encoding_json.c:ExpandedNodeId_decodeJson:
 1478|  19.6k|DECODE_JSON(ExpandedNodeId) {
 1479|  19.6k|    UA_String str;
 1480|  19.6k|    UA_String_init(&str);
 1481|  19.6k|    status res = String_decodeJson(ctx, &str, NULL);
 1482|  19.6k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  19.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1482:8): [True: 19.6k, False: 3]
  ------------------
 1483|  19.6k|        res = UA_ExpandedNodeId_parseEx(dst, str, ctx->namespaceMapping,
 1484|  19.6k|                                        ctx->serverUrisSize, ctx->serverUris);
 1485|  19.6k|    UA_String_clear(&str);
 1486|  19.6k|    return res;
 1487|  19.6k|}
ua_types_encoding_json.c:StatusCode_decodeJson:
 1622|  1.21k|DECODE_JSON(StatusCode) {
 1623|  1.21k|    CHECK_OBJECT;
  ------------------
  |  | 1056|  1.21k|#define CHECK_OBJECT do {                                \
  |  | 1057|  1.21k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1057:8): [True: 0, False: 1.21k]
  |  |  ------------------
  |  | 1058|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1059|  1.21k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1059:14): [Folded, False: 1.21k]
  |  |  ------------------
  ------------------
 1624|  1.21k|    DecodeEntry entries[2] = {
 1625|  1.21k|        {UA_JSONKEY_CODE, dst, NULL, false, &UA_TYPES[UA_TYPES_UINT32]},
  ------------------
  |  |  225|  1.21k|#define UA_TYPES_UINT32 6
  ------------------
 1626|  1.21k|        {UA_JSONKEY_SYMBOL, NULL, NULL, false, NULL}
 1627|  1.21k|    };
 1628|  1.21k|    return decodeFields(ctx, entries, 2);
 1629|  1.21k|}
ua_types_encoding_json.c:QualifiedName_decodeJson:
 1424|  73.0k|DECODE_JSON(QualifiedName) {
 1425|  73.0k|    UA_String str;
 1426|  73.0k|    UA_String_init(&str);
 1427|  73.0k|    status res = String_decodeJson(ctx, &str, NULL);
 1428|  73.0k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  73.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1428:8): [True: 73.0k, False: 19]
  ------------------
 1429|  73.0k|        res = UA_QualifiedName_parseEx(dst, str, ctx->namespaceMapping);
 1430|  73.0k|    UA_String_clear(&str);
 1431|  73.0k|    return res;
 1432|  73.0k|}
ua_types_encoding_json.c:LocalizedText_decodeJson:
 1413|  1.76M|DECODE_JSON(LocalizedText) {
 1414|  1.76M|    CHECK_OBJECT;
  ------------------
  |  | 1056|  1.76M|#define CHECK_OBJECT do {                                \
  |  | 1057|  1.76M|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1057:8): [True: 0, False: 1.76M]
  |  |  ------------------
  |  | 1058|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1059|  1.76M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1059:14): [Folded, False: 1.76M]
  |  |  ------------------
  ------------------
 1415|       |
 1416|  1.76M|    DecodeEntry entries[2] = {
 1417|  1.76M|        {UA_JSONKEY_LOCALE, &dst->locale, NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  395|  1.76M|#define UA_TYPES_STRING 11
  ------------------
 1418|  1.76M|        {UA_JSONKEY_TEXT, &dst->text, NULL, false, &UA_TYPES[UA_TYPES_STRING]}
  ------------------
  |  |  395|  1.76M|#define UA_TYPES_STRING 11
  ------------------
 1419|  1.76M|    };
 1420|       |
 1421|  1.76M|    return decodeFields(ctx, entries, 2);
 1422|  1.76M|}
ua_types_encoding_json.c:ExtensionObject_decodeJson:
 2014|  67.5k|DECODE_JSON(ExtensionObject) {
 2015|  67.5k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1061|  67.5k|#define CHECK_NULL_SKIP do {                         \
  |  | 1062|  67.5k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1062:8): [True: 0, False: 67.5k]
  |  |  ------------------
  |  | 1063|      0|        ctx->index++;                                \
  |  | 1064|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1065|  67.5k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1065:14): [Folded, False: 67.5k]
  |  |  ------------------
  ------------------
 2016|  67.5k|    CHECK_OBJECT;
  ------------------
  |  | 1056|  67.5k|#define CHECK_OBJECT do {                                \
  |  | 1057|  67.5k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1057:8): [True: 7, False: 67.5k]
  |  |  ------------------
  |  | 1058|      7|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1059|  67.5k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1059:14): [Folded, False: 67.5k]
  |  |  ------------------
  ------------------
 2017|       |
 2018|       |    /* Empty object -> Null ExtensionObject */
 2019|  67.5k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (2019:8): [True: 67.4k, False: 126]
  ------------------
 2020|  67.4k|        ctx->index++; /* Skip the empty ExtensionObject */
 2021|  67.4k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  67.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2022|  67.4k|    }
 2023|       |
 2024|       |    /* Store the index where the ExtensionObject begins */
 2025|    126|    size_t beginIndex = ctx->index;
 2026|       |
 2027|       |    /* Search for non-JSON encoding */
 2028|    126|    UA_UInt64 encoding = 0;
 2029|    126|    size_t encIndex = 0;
 2030|    126|    status ret = lookAheadForKey(ctx, UA_JSONKEY_ENCODING, &encIndex);
 2031|    126|    if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|    126|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2031:8): [True: 83, False: 43]
  ------------------
 2032|     83|        const char *extObjEncoding = &ctx->json5[ctx->tokens[encIndex].start];
 2033|     83|        size_t len = parseUInt64(extObjEncoding, getTokenLength(&ctx->tokens[encIndex]), &encoding);
 2034|     83|        if(len == 0 || encoding > 2)
  ------------------
  |  Branch (2034:12): [True: 0, False: 83]
  |  Branch (2034:24): [True: 83, False: 0]
  ------------------
 2035|     83|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     83|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2036|     83|    }
 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|   107k|DECODE_JSON(DataValue) {
 1913|   107k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1061|   107k|#define CHECK_NULL_SKIP do {                         \
  |  | 1062|   107k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1062:8): [True: 0, False: 107k]
  |  |  ------------------
  |  | 1063|      0|        ctx->index++;                                \
  |  | 1064|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1065|   107k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1065:14): [Folded, False: 107k]
  |  |  ------------------
  ------------------
 1914|   107k|    CHECK_OBJECT;
  ------------------
  |  | 1056|   107k|#define CHECK_OBJECT do {                                \
  |  | 1057|   107k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1057:8): [True: 6, False: 107k]
  |  |  ------------------
  |  | 1058|      6|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1059|   107k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1059:14): [Folded, False: 107k]
  |  |  ------------------
  ------------------
 1915|       |
 1916|       |    /* Decode the Variant in-situ */
 1917|   107k|    size_t beginIndex = ctx->index;
 1918|   107k|    status ret = decodeJSONVariant(ctx, &dst->value);
 1919|   107k|    ctx->index = beginIndex;
 1920|   107k|    dst->hasValue = (dst->value.type != NULL);
 1921|   107k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|   107k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1921:8): [True: 216, False: 107k]
  ------------------
 1922|    216|        return ret;
 1923|       |
 1924|       |    /* Decode the other members (skip the Variant members) */
 1925|   107k|    DecodeEntry entries[8] = {
 1926|   107k|        {UA_JSONKEY_TYPE, NULL, NULL, false, NULL},
 1927|   107k|        {UA_JSONKEY_VALUE, NULL, NULL, false, NULL},
 1928|   107k|        {UA_JSONKEY_DIMENSIONS, NULL, NULL, false, NULL},
 1929|   107k|        {UA_JSONKEY_STATUS, &dst->status, NULL, false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  633|   107k|#define UA_TYPES_STATUSCODE 18
  ------------------
 1930|   107k|        {UA_JSONKEY_SOURCETIMESTAMP, &dst->sourceTimestamp, NULL, false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  429|   107k|#define UA_TYPES_DATETIME 12
  ------------------
 1931|   107k|        {UA_JSONKEY_SOURCEPICOSECONDS, &dst->sourcePicoseconds, NULL, false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  157|   107k|#define UA_TYPES_UINT16 4
  ------------------
 1932|   107k|        {UA_JSONKEY_SERVERTIMESTAMP, &dst->serverTimestamp, NULL, false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  429|   107k|#define UA_TYPES_DATETIME 12
  ------------------
 1933|   107k|        {UA_JSONKEY_SERVERPICOSECONDS, &dst->serverPicoseconds, NULL, false, &UA_TYPES[UA_TYPES_UINT16]}
  ------------------
  |  |  157|   107k|#define UA_TYPES_UINT16 4
  ------------------
 1934|   107k|    };
 1935|       |
 1936|   107k|    ret = decodeFields(ctx, entries, 8);
 1937|   107k|    dst->hasStatus = entries[3].found;
 1938|   107k|    dst->hasSourceTimestamp = entries[4].found;
 1939|   107k|    dst->hasSourcePicoseconds = entries[5].found;
 1940|   107k|    dst->hasServerTimestamp = entries[6].found;
 1941|   107k|    dst->hasServerPicoseconds = entries[7].found;
 1942|   107k|    return ret;
 1943|   107k|}
ua_types_encoding_json.c:decodeJSONVariant:
 1784|   248k|decodeJSONVariant(ParseCtx *ctx, UA_Variant *dst) {
 1785|       |    /* Empty variant == null */
 1786|   248k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (1786:8): [True: 175k, False: 72.8k]
  ------------------
 1787|   175k|        ctx->index++;
 1788|   175k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|   175k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1789|   175k|    }
 1790|       |
 1791|       |    /* Search the value field */
 1792|  72.8k|    size_t valueIndex = 0;
 1793|  72.8k|    lookAheadForKey(ctx, UA_JSONKEY_VALUE, &valueIndex);
 1794|       |
 1795|       |    /* Search for the dimensions field */
 1796|  72.8k|    size_t dimIndex = 0;
 1797|  72.8k|    lookAheadForKey(ctx, UA_JSONKEY_DIMENSIONS, &dimIndex);
 1798|       |
 1799|       |    /* Parse the type kind */
 1800|  72.8k|    size_t typeIndex = 0;
 1801|  72.8k|    lookAheadForKey(ctx, UA_JSONKEY_TYPE, &typeIndex);
 1802|  72.8k|    if(typeIndex == 0 || ctx->tokens[typeIndex].type != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1802:8): [True: 81, False: 72.7k]
  |  Branch (1802:26): [True: 0, False: 72.7k]
  ------------------
 1803|     81|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     81|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1804|  72.7k|    UA_UInt64 typeKind = 0;
 1805|  72.7k|    size_t len = parseUInt64(&ctx->json5[ctx->tokens[typeIndex].start],
 1806|  72.7k|                             getTokenLength(&ctx->tokens[typeIndex]), &typeKind);
 1807|  72.7k|    if(len == 0)
  ------------------
  |  Branch (1807:8): [True: 2, False: 72.7k]
  ------------------
 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|  72.7k|    typeKind--;
 1813|  72.7k|    if(typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (1813:8): [True: 15, False: 72.7k]
  ------------------
 1814|     15|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     15|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1815|  72.7k|    const UA_DataType *type = &UA_TYPES[typeKind];
 1816|       |
 1817|       |    /* Value is an array? */
 1818|  72.7k|    UA_Boolean isArray =
 1819|  72.7k|        (valueIndex > 0 && ctx->tokens[valueIndex].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  Branch (1819:10): [True: 52.9k, False: 19.8k]
  |  Branch (1819:28): [True: 14.3k, False: 38.6k]
  ------------------
 1820|       |
 1821|       |    /* Adjust the depth and set the value index as current */
 1822|  72.7k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|  72.7k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (1822:8): [True: 0, False: 72.7k]
  ------------------
 1823|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1824|  72.7k|    size_t beginIndex = ctx->index;
 1825|  72.7k|    ctx->index = valueIndex;
 1826|  72.7k|    ctx->depth++;
 1827|       |
 1828|       |    /* Decode the value */
 1829|  72.7k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  72.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1830|  72.7k|    if(!isArray) {
  ------------------
  |  Branch (1830:8): [True: 58.4k, False: 14.3k]
  ------------------
 1831|       |        /* Scalar with dimensions -> error */
 1832|  58.4k|        if(dimIndex > 0) {
  ------------------
  |  Branch (1832:12): [True: 9, False: 58.4k]
  ------------------
 1833|      9|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1834|      9|            goto out;
 1835|      9|        }
 1836|       |
 1837|       |        /* A variant cannot contain a variant. But it can contain an array of
 1838|       |         * variants */
 1839|  58.4k|        if(type->typeKind == UA_DATATYPEKIND_VARIANT) {
  ------------------
  |  Branch (1839:12): [True: 1, False: 58.4k]
  ------------------
 1840|      1|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1841|      1|            goto out;
 1842|      1|        }
 1843|       |
 1844|       |        /* Decode a value wrapped in an ExtensionObject */
 1845|  58.4k|        if(valueIndex > 0 && type->typeKind == UA_DATATYPEKIND_EXTENSIONOBJECT) {
  ------------------
  |  Branch (1845:12): [True: 38.6k, False: 19.8k]
  |  Branch (1845:30): [True: 482, False: 38.1k]
  ------------------
 1846|    482|            res = Variant_decodeJsonUnwrapExtensionObject(ctx, dst, NULL);
 1847|    482|            goto out;
 1848|    482|        }
 1849|       |
 1850|       |        /* Allocate memory for the value */
 1851|  57.9k|        dst->data = UA_new(type);
 1852|  57.9k|        if(!dst->data) {
  ------------------
  |  Branch (1852:12): [True: 0, False: 57.9k]
  ------------------
 1853|      0|            res = UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1854|      0|            goto out;
 1855|      0|        }
 1856|  57.9k|        dst->type = type;
 1857|       |
 1858|       |        /* Decode the value */
 1859|  57.9k|        if(valueIndex > 0 && ctx->tokens[valueIndex].type != CJ5_TOKEN_NULL)
  ------------------
  |  Branch (1859:12): [True: 38.1k, False: 19.8k]
  |  Branch (1859:30): [True: 32.3k, False: 5.79k]
  ------------------
 1860|  32.3k|            res = decodeJsonJumpTable[type->typeKind](ctx, dst->data, type);
 1861|  57.9k|    } else {
 1862|       |        /* Decode an array. Try to unwrap ExtensionObjects in the array. The
 1863|       |         * members must all have the same type. */
 1864|  14.3k|        const UA_DataType *unwrapType = NULL;
 1865|  14.3k|        if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  735|  14.3k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (1865:12): [True: 525, False: 13.7k]
  ------------------
 1866|    525|            unwrapType = getArrayUnwrapType(ctx);
 1867|  14.3k|        if(unwrapType) {
  ------------------
  |  Branch (1867:12): [True: 0, False: 14.3k]
  ------------------
 1868|      0|            dst->type = unwrapType;
 1869|      0|            res = Array_decodeJsonUnwrapExtensionObject(ctx, &dst->data, unwrapType);
 1870|  14.3k|        } else {
 1871|  14.3k|            dst->type = type;
 1872|  14.3k|            res = Array_decodeJson(ctx, &dst->data, type);
 1873|  14.3k|        }
 1874|       |
 1875|       |        /* Decode array dimensions */
 1876|  14.3k|        if(dimIndex > 0) {
  ------------------
  |  Branch (1876:12): [True: 3.55k, False: 10.7k]
  ------------------
 1877|  3.55k|            ctx->index = dimIndex;
 1878|  3.55k|            res |= Array_decodeJson(ctx, (void**)&dst->arrayDimensions, &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  225|  3.55k|#define UA_TYPES_UINT32 6
  ------------------
 1879|       |
 1880|       |            /* Help clang-analyzer */
 1881|  3.55k|            UA_assert(dst->arrayDimensionsSize == 0 || dst->arrayDimensions);
  ------------------
  |  |  411|  3.55k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1881:13): [True: 28, False: 3.52k]
  |  Branch (1881:13): [True: 3.52k, False: 0]
  ------------------
 1882|       |
 1883|       |            /* Validate the dimensions */
 1884|  3.55k|            size_t total = 1;
 1885|  2.32M|            for(size_t i = 0; i < dst->arrayDimensionsSize; i++)
  ------------------
  |  Branch (1885:31): [True: 2.32M, False: 3.55k]
  ------------------
 1886|  2.32M|                total *= dst->arrayDimensions[i];
 1887|  3.55k|            if(total != dst->arrayLength)
  ------------------
  |  Branch (1887:16): [True: 113, False: 3.44k]
  ------------------
 1888|    113|                res |= UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    113|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1889|       |
 1890|       |            /* Only keep >= 2 dimensions */
 1891|  3.55k|            if(dst->arrayDimensionsSize == 1) {
  ------------------
  |  Branch (1891:16): [True: 47, False: 3.50k]
  ------------------
 1892|     47|                UA_free(dst->arrayDimensions);
  ------------------
  |  |  351|     47|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1893|     47|                dst->arrayDimensions = NULL;
 1894|     47|                dst->arrayDimensionsSize = 0;
 1895|     47|            }
 1896|  3.55k|        }
 1897|  14.3k|    }
 1898|       |
 1899|  72.7k| out:
 1900|  72.7k|    ctx->index = beginIndex;
 1901|  72.7k|    skipObject(ctx);
 1902|  72.7k|    ctx->depth--;
 1903|  72.7k|    return res;
 1904|  72.7k|}
ua_types_encoding_json.c:Variant_decodeJsonUnwrapExtensionObject:
 2130|    482|Variant_decodeJsonUnwrapExtensionObject(ParseCtx *ctx, void *p, const UA_DataType *type) {
 2131|    482|    (void) type;
 2132|    482|    UA_Variant *dst = (UA_Variant*)p;
 2133|       |
 2134|       |    /* ExtensionObject with null body */
 2135|    482|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2135:8): [True: 392, False: 90]
  ------------------
 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|     90|    UA_ExtensionObject eo;
 2144|     90|    UA_ExtensionObject_init(&eo);
 2145|     90|    UA_StatusCode ret = ExtensionObject_decodeJson(ctx, &eo, NULL);
 2146|     90|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|     90|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2146:8): [True: 90, False: 0]
  ------------------
 2147|     90|        UA_ExtensionObject_clear(&eo); /* We don't have the global cleanup */
 2148|     90|        return ret;
 2149|     90|    }
 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|    525|getArrayUnwrapType(ParseCtx *ctx) {
 1667|    525|    UA_assert(ctx->tokens[ctx->index].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  |  411|    525|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1667:5): [True: 525, False: 0]
  ------------------
 1668|       |
 1669|       |    /* Return early for empty arrays */
 1670|    525|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 1671|    525|    if(length == 0)
  ------------------
  |  Branch (1671:8): [True: 201, False: 324]
  ------------------
 1672|    201|        return NULL;
 1673|       |
 1674|       |    /* Save the original index and go to the first array member */
 1675|    324|    size_t oldIndex = ctx->index;
 1676|    324|    ctx->index++;
 1677|       |
 1678|       |    /* Lookup the type for the first array member */
 1679|    324|    UA_NodeId typeId;
 1680|    324|    UA_NodeId_init(&typeId);
 1681|    324|    const UA_DataType *typeOfBody = getExtensionObjectType(ctx);
 1682|    324|    if(!typeOfBody) {
  ------------------
  |  Branch (1682:8): [True: 324, False: 0]
  ------------------
 1683|    324|        ctx->index = oldIndex; /* Restore the index */
 1684|    324|        return NULL;
 1685|    324|    }
 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);
  ------------------
  |  |  411|      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|    324|getExtensionObjectType(ParseCtx *ctx) {
 1635|    324|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (1635:8): [True: 234, False: 90]
  ------------------
 1636|    234|        return NULL;
 1637|       |
 1638|       |    /* Get the type NodeId index */
 1639|     90|    size_t typeIdIndex = 0;
 1640|     90|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 1641|     90|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|     90|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1641:8): [True: 59, False: 31]
  ------------------
 1642|     59|        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|  17.8k|Array_decodeJson(ParseCtx *ctx, void **dst, const UA_DataType *type) {
 2305|       |    /* Save the length of the array */
 2306|  17.8k|    size_t *size_ptr = (size_t*) dst - 1;
 2307|       |
 2308|  17.8k|    if(currentTokenType(ctx) != CJ5_TOKEN_ARRAY)
  ------------------
  |  Branch (2308:8): [True: 5, False: 17.8k]
  ------------------
 2309|      5|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2310|       |
 2311|  17.8k|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 2312|       |
 2313|  17.8k|    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|  17.8k|    if(length == 0) {
  ------------------
  |  Branch (2317:8): [True: 7.42k, False: 10.4k]
  ------------------
 2318|  7.42k|        *size_ptr = length;
 2319|  7.42k|        *dst = UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  7.42k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2320|  7.42k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  7.42k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2321|  7.42k|    }
 2322|       |
 2323|       |    /* Allocate memory */
 2324|  10.4k|    *dst = UA_calloc(length, type->memSize);
  ------------------
  |  |  352|  10.4k|# define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2325|  10.4k|    if(*dst == NULL)
  ------------------
  |  Branch (2325:8): [True: 0, False: 10.4k]
  ------------------
 2326|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2327|       |
 2328|       |    /* Decode array members */
 2329|  10.4k|    uintptr_t ptr = (uintptr_t)*dst;
 2330|  14.3M|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (2330:23): [True: 14.3M, False: 10.0k]
  ------------------
 2331|  14.3M|        if(ctx->tokens[ctx->index].type != CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2331:12): [True: 14.2M, False: 67.7k]
  ------------------
 2332|  14.2M|            status ret = decodeJsonJumpTable[type->typeKind](ctx, (void*)ptr, type);
 2333|  14.2M|            if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  14.2M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2333:16): [True: 423, False: 14.2M]
  ------------------
 2334|    423|                UA_Array_delete(*dst, i+1, type);
 2335|    423|                *dst = NULL;
 2336|    423|                return ret;
 2337|    423|            }
 2338|  14.2M|        } else {
 2339|  67.7k|            ctx->index++;
 2340|  67.7k|        }
 2341|  14.3M|        ptr += type->memSize;
 2342|  14.3M|    }
 2343|       |
 2344|  10.0k|    *size_ptr = length; /* All good, set the size */
 2345|  10.0k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  10.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2346|  10.4k|}
ua_types_encoding_json.c:Variant_decodeJson:
 1906|   140k|DECODE_JSON(Variant) {
 1907|   140k|    CHECK_NULL_SKIP; /* Treat null as an empty variant */
  ------------------
  |  | 1061|   140k|#define CHECK_NULL_SKIP do {                         \
  |  | 1062|   140k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1062:8): [True: 0, False: 140k]
  |  |  ------------------
  |  | 1063|      0|        ctx->index++;                                \
  |  | 1064|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1065|   140k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1065:14): [Folded, False: 140k]
  |  |  ------------------
  ------------------
 1908|   140k|    CHECK_OBJECT;
  ------------------
  |  | 1056|   140k|#define CHECK_OBJECT do {                                \
  |  | 1057|   140k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1057:8): [True: 13, False: 140k]
  |  |  ------------------
  |  | 1058|     13|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   43|     13|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1059|   140k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1059:14): [Folded, False: 140k]
  |  |  ------------------
  ------------------
 1909|   140k|    return decodeJSONVariant(ctx, dst);
 1910|   140k|}

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

UA_Guid_parse:
   84|    878|UA_Guid_parse(UA_Guid *guid, const UA_String str) {
   85|    878|    UA_StatusCode res = parse_guid(guid, str.data, str.data + str.length);
   86|    878|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    878|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (86:8): [True: 41, False: 837]
  ------------------
   87|     41|        *guid = UA_GUID_NULL;
   88|    878|    return res;
   89|    878|}
UA_NodeId_parseEx:
  319|  5.71k|                  const UA_NamespaceMapping *nsMapping) {
  320|  5.71k|    UA_StatusCode res =
  321|  5.71k|        parse_nodeid(id, str.data, str.data+str.length, UA_ESCAPING_NONE, nsMapping);
  322|  5.71k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  5.71k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (322:8): [True: 95, False: 5.61k]
  ------------------
  323|     95|        UA_NodeId_clear(id);
  324|  5.71k|    return res;
  325|  5.71k|}
UA_ExpandedNodeId_parseEx:
  667|  19.6k|                          size_t serverUrisSize, const UA_String *serverUris) {
  668|  19.6k|    UA_StatusCode res =
  669|  19.6k|        parse_expandednodeid(id, str.data, str.data + str.length, UA_ESCAPING_NONE,
  670|  19.6k|                             nsMapping, serverUrisSize, serverUris);
  671|  19.6k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  19.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (671:8): [True: 98, False: 19.5k]
  ------------------
  672|     98|        UA_ExpandedNodeId_clear(id);
  673|  19.6k|    return res;
  674|  19.6k|}
UA_QualifiedName_parseEx:
  823|  73.0k|                         const UA_NamespaceMapping *nsMapping) {
  824|  73.0k|    const u8 *pos = str.data;
  825|  73.0k|    const u8 *end = str.data + str.length;
  826|  73.0k|    UA_StatusCode res = parse_qn(qn, pos, end, UA_ESCAPING_NONE, nsMapping, 0);
  827|  73.0k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  73.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (827:8): [True: 0, False: 73.0k]
  ------------------
  828|      0|        UA_QualifiedName_clear(qn);
  829|  73.0k|    return res;
  830|  73.0k|}
ua_types_lex.c:parse_guid:
   48|    880|parse_guid(UA_Guid *guid, const UA_Byte *s, const UA_Byte *e) {
   49|    880|    size_t len = (size_t)(e - s);
   50|    880|    if(len != 36 || s[8] != '-' || s[13] != '-' || s[23] != '-')
  ------------------
  |  Branch (50:8): [True: 18, False: 862]
  |  Branch (50:21): [True: 2, False: 860]
  |  Branch (50:36): [True: 1, False: 859]
  |  Branch (50:52): [True: 5, False: 854]
  ------------------
   51|     26|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     26|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   52|       |
   53|    854|    UA_UInt32 tmp;
   54|    854|    if(UA_readNumberWithBase(s, 8, &tmp, 16) != 8)
  ------------------
  |  Branch (54:8): [True: 3, False: 851]
  ------------------
   55|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   56|    851|    guid->data1 = tmp;
   57|       |
   58|    851|    if(UA_readNumberWithBase(&s[9], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (58:8): [True: 3, False: 848]
  ------------------
   59|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   60|    848|    guid->data2 = (UA_UInt16)tmp;
   61|       |
   62|    848|    if(UA_readNumberWithBase(&s[14], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (62:8): [True: 3, False: 845]
  ------------------
   63|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   64|    845|    guid->data3 = (UA_UInt16)tmp;
   65|       |
   66|    845|    if(UA_readNumberWithBase(&s[19], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (66:8): [True: 2, False: 843]
  ------------------
   67|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   68|    843|    guid->data4[0] = (UA_Byte)tmp;
   69|       |
   70|    843|    if(UA_readNumberWithBase(&s[21], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (70:8): [True: 1, False: 842]
  ------------------
   71|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   72|    842|    guid->data4[1] = (UA_Byte)tmp;
   73|       |
   74|  5.87k|    for(size_t pos = 2, spos = 24; pos < 8; pos++, spos += 2) {
  ------------------
  |  Branch (74:36): [True: 5.04k, False: 837]
  ------------------
   75|  5.04k|        if(UA_readNumberWithBase(&s[spos], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (75:12): [True: 5, False: 5.03k]
  ------------------
   76|      5|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   77|  5.03k|        guid->data4[pos] = (UA_Byte)tmp;
   78|  5.03k|    }
   79|       |
   80|    837|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    837|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   81|    842|}
ua_types_lex.c:parse_nodeid:
  144|  5.71k|             UA_Escaping idEsc, const UA_NamespaceMapping *nsMapping) {
  145|  5.71k|    *id = UA_NODEID_NULL; /* Reset the NodeId */
  146|  5.71k|    LexContext context;
  147|  5.71k|    memset(&context, 0, sizeof(LexContext));
  148|  5.71k|    UA_Byte *begin = (UA_Byte*)(uintptr_t)pos;
  149|  5.71k|    const u8 *ns = NULL, *nsu = NULL, *body = NULL;
  150|       |
  151|       |    
  152|  5.71k|{
  153|  5.71k|	u8 yych;
  154|  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.70k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 5.70k, False: 3]
  |  |  ------------------
  ------------------
  155|  5.71k|	switch (yych) {
  156|  1.26k|		case 'b':
  ------------------
  |  Branch (156:3): [True: 1.26k, False: 4.44k]
  ------------------
  157|  1.27k|		case 'g':
  ------------------
  |  Branch (157:3): [True: 4, False: 5.70k]
  ------------------
  158|  1.98k|		case 'i':
  ------------------
  |  Branch (158:3): [True: 714, False: 4.99k]
  ------------------
  159|  5.29k|		case 's':
  ------------------
  |  Branch (159:3): [True: 3.30k, False: 2.40k]
  ------------------
  160|  5.29k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|  5.29k|#define YYSTAGN(t) t = NULL
  ------------------
  161|  5.29k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   37|  5.29k|#define YYSTAGN(t) t = NULL
  ------------------
  162|  5.29k|			goto yy3;
  163|    409|		case 'n': goto yy4;
  ------------------
  |  Branch (163:3): [True: 409, False: 5.30k]
  ------------------
  164|      5|		default: goto yy1;
  ------------------
  |  Branch (164:3): [True: 5, False: 5.70k]
  ------------------
  165|  5.71k|	}
  166|      5|yy1:
  167|      5|	YYSKIP();
  ------------------
  |  |   33|      5|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|      5|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  168|     68|yy2:
  169|     68|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   43|     68|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  170|  5.29k|yy3:
  171|  5.29k|	YYSKIP();
  ------------------
  |  |   33|  5.29k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  5.29k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  172|  5.29k|	yych = YYPEEK();
  ------------------
  |  |   31|  5.29k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  5.29k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  5.29k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 5.29k, False: 2]
  |  |  ------------------
  ------------------
  173|  5.29k|	switch (yych) {
  174|  5.28k|		case '=': goto yy5;
  ------------------
  |  Branch (174:3): [True: 5.28k, False: 11]
  ------------------
  175|     11|		default: goto yy2;
  ------------------
  |  Branch (175:3): [True: 11, False: 5.28k]
  ------------------
  176|  5.29k|	}
  177|    409|yy4:
  178|    409|	YYSKIP();
  ------------------
  |  |   33|    409|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    409|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  179|    409|	YYBACKUP();
  ------------------
  |  |   34|    409|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   30|    409|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    409|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  180|    409|	yych = YYPEEK();
  ------------------
  |  |   31|    409|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    409|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    407|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 407, False: 2]
  |  |  ------------------
  ------------------
  181|    409|	switch (yych) {
  182|    405|		case 's': goto yy6;
  ------------------
  |  Branch (182:3): [True: 405, False: 4]
  ------------------
  183|      4|		default: goto yy2;
  ------------------
  |  Branch (183:3): [True: 4, False: 405]
  ------------------
  184|    409|	}
  185|  5.64k|yy5:
  186|  5.64k|	YYSKIP();
  ------------------
  |  |   33|  5.64k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  5.64k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  187|  5.64k|	nsu = context.yyt2;
  188|  5.64k|	ns = context.yyt1;
  189|  5.64k|	YYSTAGP(body);
  ------------------
  |  |   36|  5.64k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  5.64k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  190|  5.64k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   38|  5.64k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  191|  5.64k|	{ goto match; }
  192|    405|yy6:
  193|    405|	YYSKIP();
  ------------------
  |  |   33|    405|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    405|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  194|    405|	yych = YYPEEK();
  ------------------
  |  |   31|    405|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    405|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    403|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 403, False: 2]
  |  |  ------------------
  ------------------
  195|    405|	switch (yych) {
  196|    314|		case '=': goto yy8;
  ------------------
  |  Branch (196:3): [True: 314, False: 91]
  ------------------
  197|     89|		case 'u': goto yy9;
  ------------------
  |  Branch (197:3): [True: 89, False: 316]
  ------------------
  198|      2|		default: goto yy7;
  ------------------
  |  Branch (198:3): [True: 2, False: 403]
  ------------------
  199|    405|	}
  200|     48|yy7:
  201|     48|	YYRESTORE();
  ------------------
  |  |   35|     48|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   29|     48|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   30|     48|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  202|     48|	goto yy2;
  203|    314|yy8:
  204|    314|	YYSKIP();
  ------------------
  |  |   33|    314|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    314|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  205|    314|	yych = YYPEEK();
  ------------------
  |  |   31|    314|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    314|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    312|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 312, False: 2]
  |  |  ------------------
  ------------------
  206|    314|	switch (yych) {
  207|     91|		case '0':
  ------------------
  |  Branch (207:3): [True: 91, False: 223]
  ------------------
  208|    116|		case '1':
  ------------------
  |  Branch (208:3): [True: 25, False: 289]
  ------------------
  209|    135|		case '2':
  ------------------
  |  Branch (209:3): [True: 19, False: 295]
  ------------------
  210|    144|		case '3':
  ------------------
  |  Branch (210:3): [True: 9, False: 305]
  ------------------
  211|    223|		case '4':
  ------------------
  |  Branch (211:3): [True: 79, False: 235]
  ------------------
  212|    229|		case '5':
  ------------------
  |  Branch (212:3): [True: 6, False: 308]
  ------------------
  213|    233|		case '6':
  ------------------
  |  Branch (213:3): [True: 4, False: 310]
  ------------------
  214|    237|		case '7':
  ------------------
  |  Branch (214:3): [True: 4, False: 310]
  ------------------
  215|    280|		case '8':
  ------------------
  |  Branch (215:3): [True: 43, False: 271]
  ------------------
  216|    310|		case '9':
  ------------------
  |  Branch (216:3): [True: 30, False: 284]
  ------------------
  217|    310|			YYSTAGP(context.yyt1);
  ------------------
  |  |   36|    310|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    310|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  218|    310|			goto yy10;
  219|      4|		default: goto yy7;
  ------------------
  |  Branch (219:3): [True: 4, False: 310]
  ------------------
  220|    314|	}
  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|  4.11k|yy10:
  229|  4.11k|	YYSKIP();
  ------------------
  |  |   33|  4.11k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  4.11k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  230|  4.11k|	yych = YYPEEK();
  ------------------
  |  |   31|  4.11k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  4.11k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  4.08k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 4.08k, False: 30]
  |  |  ------------------
  ------------------
  231|  4.11k|	switch (yych) {
  232|    387|		case '0':
  ------------------
  |  Branch (232:3): [True: 387, False: 3.72k]
  ------------------
  233|    751|		case '1':
  ------------------
  |  Branch (233:3): [True: 364, False: 3.74k]
  ------------------
  234|  1.10k|		case '2':
  ------------------
  |  Branch (234:3): [True: 353, False: 3.76k]
  ------------------
  235|  1.44k|		case '3':
  ------------------
  |  Branch (235:3): [True: 338, False: 3.77k]
  ------------------
  236|  2.01k|		case '4':
  ------------------
  |  Branch (236:3): [True: 571, False: 3.54k]
  ------------------
  237|  2.33k|		case '5':
  ------------------
  |  Branch (237:3): [True: 318, False: 3.79k]
  ------------------
  238|  2.62k|		case '6':
  ------------------
  |  Branch (238:3): [True: 291, False: 3.82k]
  ------------------
  239|  3.04k|		case '7':
  ------------------
  |  Branch (239:3): [True: 424, False: 3.68k]
  ------------------
  240|  3.34k|		case '8':
  ------------------
  |  Branch (240:3): [True: 296, False: 3.81k]
  ------------------
  241|  3.80k|		case '9': goto yy10;
  ------------------
  |  Branch (241:3): [True: 461, False: 3.65k]
  ------------------
  242|    279|		case ';':
  ------------------
  |  Branch (242:3): [True: 279, False: 3.83k]
  ------------------
  243|    279|			YYSTAGN(context.yyt2);
  ------------------
  |  |   37|    279|#define YYSTAGN(t) t = NULL
  ------------------
  244|    279|			goto yy12;
  245|     31|		default: goto yy7;
  ------------------
  |  Branch (245:3): [True: 31, False: 4.08k]
  ------------------
  246|  4.11k|	}
  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|      1|		case ';':
  ------------------
  |  Branch (252:3): [True: 1, False: 84]
  ------------------
  253|      1|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|      1|#define YYSTAGN(t) t = NULL
  ------------------
  254|      1|			YYSTAGP(context.yyt2);
  ------------------
  |  |   36|      1|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|      1|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  255|      1|			goto yy12;
  256|     84|		default:
  ------------------
  |  Branch (256:3): [True: 84, False: 1]
  ------------------
  257|     84|			YYSTAGP(context.yyt2);
  ------------------
  |  |   36|     84|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|     84|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  258|     84|			goto yy13;
  259|     85|	}
  260|    361|yy12:
  261|    361|	YYSKIP();
  ------------------
  |  |   33|    361|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    361|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  262|    361|	yych = YYPEEK();
  ------------------
  |  |   31|    361|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    361|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    359|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 359, False: 2]
  |  |  ------------------
  ------------------
  263|    361|	switch (yych) {
  264|     22|		case 'b':
  ------------------
  |  Branch (264:3): [True: 22, False: 339]
  ------------------
  265|     22|		case 'g':
  ------------------
  |  Branch (265:3): [True: 0, False: 361]
  ------------------
  266|    272|		case 'i':
  ------------------
  |  Branch (266:3): [True: 250, False: 111]
  ------------------
  267|    359|		case 's': goto yy14;
  ------------------
  |  Branch (267:3): [True: 87, False: 274]
  ------------------
  268|      2|		default: goto yy7;
  ------------------
  |  Branch (268:3): [True: 2, False: 359]
  ------------------
  269|    361|	}
  270|    622|yy13:
  271|    622|	YYSKIP();
  ------------------
  |  |   33|    622|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    622|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  272|    622|	yych = YYPEEK();
  ------------------
  |  |   31|    622|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    622|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    619|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 619, False: 3]
  |  |  ------------------
  ------------------
  273|    622|	switch (yych) {
  274|      3|		case 0x00: goto yy7;
  ------------------
  |  Branch (274:3): [True: 3, False: 619]
  ------------------
  275|     81|		case ';':
  ------------------
  |  Branch (275:3): [True: 81, False: 541]
  ------------------
  276|     81|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|     81|#define YYSTAGN(t) t = NULL
  ------------------
  277|     81|			goto yy12;
  278|    538|		default: goto yy13;
  ------------------
  |  Branch (278:3): [True: 538, False: 84]
  ------------------
  279|    622|	}
  280|    359|yy14:
  281|    359|	YYSKIP();
  ------------------
  |  |   33|    359|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    359|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  282|    359|	yych = YYPEEK();
  ------------------
  |  |   31|    359|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    359|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    359|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 359, False: 0]
  |  |  ------------------
  ------------------
  283|    359|	switch (yych) {
  284|    357|		case '=': goto yy5;
  ------------------
  |  Branch (284:3): [True: 357, False: 2]
  ------------------
  285|      2|		default: goto yy7;
  ------------------
  |  Branch (285:3): [True: 2, False: 357]
  ------------------
  286|    359|	}
  287|    359|}
  288|       |
  289|       |
  290|  5.64k| match:
  291|  5.64k|    if(nsu) {
  ------------------
  |  Branch (291:8): [True: 81, False: 5.56k]
  ------------------
  292|       |        /* NamespaceUri */
  293|     81|        UA_String nsUri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  294|     81|        UA_StatusCode res = escapedUri2Index(nsUri, &id->namespaceIndex, nsMapping);
  295|     81|        if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|     81|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (295:12): [True: 81, False: 0]
  ------------------
  296|       |            /* Return the entire NodeId string s=... */
  297|     81|            UA_String total = {(size_t)((const UA_Byte*)end - begin), begin};
  298|     81|            id->identifierType = UA_NODEIDTYPE_STRING;
  299|     81|            return UA_String_copy(&total, &id->identifier.string);
  300|     81|        }
  301|  5.56k|    } else if(ns) {
  ------------------
  |  Branch (301:15): [True: 276, False: 5.28k]
  ------------------
  302|       |        /* NamespaceIndex */
  303|    276|        UA_UInt32 tmp;
  304|    276|        size_t len = (size_t)(body - 1 - ns);
  305|    276|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (305:12): [True: 0, False: 276]
  ------------------
  306|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  307|    276|        id->namespaceIndex = (UA_UInt16)tmp;
  308|    276|        if(nsMapping)
  ------------------
  |  Branch (308:12): [True: 0, False: 276]
  ------------------
  309|      0|            id->namespaceIndex =
  310|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->namespaceIndex);
  311|    276|    }
  312|       |
  313|       |    /* From the current position until the end */
  314|  5.56k|    return parse_nodeid_body(id, body, end, idEsc);
  315|  5.64k|}
ua_types_lex.c:escapedUri2Index:
   93|    771|                 const UA_NamespaceMapping *nsMapping) {
   94|    771|    if(!nsMapping)
  ------------------
  |  Branch (94:8): [True: 771, False: 0]
  ------------------
   95|    771|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    771|#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|  25.0k|parse_nodeid_body(UA_NodeId *id, const u8 *body, const u8 *end, UA_Escaping esc) {
  108|  25.0k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  25.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  109|  25.0k|    UA_String str = {(size_t)(end - (body+2)), (UA_Byte*)(uintptr_t)body + 2};
  110|  25.0k|    switch(*body) {
  111|  1.80k|    case 'i':
  ------------------
  |  Branch (111:5): [True: 1.80k, False: 23.2k]
  ------------------
  112|  1.80k|        id->identifierType = UA_NODEIDTYPE_NUMERIC;
  113|  1.80k|        if(UA_readNumber(str.data, str.length, &id->identifier.numeric) != str.length)
  ------------------
  |  Branch (113:12): [True: 28, False: 1.78k]
  ------------------
  114|     28|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     28|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  115|  1.80k|        break;
  116|  14.9k|    case 's':
  ------------------
  |  Branch (116:5): [True: 14.9k, False: 10.0k]
  ------------------
  117|  14.9k|        id->identifierType = UA_NODEIDTYPE_STRING;
  118|  14.9k|        res |= UA_String_copy(&str, &id->identifier.string);
  119|  14.9k|        res |= UA_String_unescape(&id->identifier.string, false, esc);
  120|  14.9k|        break;
  121|      2|    case 'g':
  ------------------
  |  Branch (121:5): [True: 2, False: 25.0k]
  ------------------
  122|      2|        id->identifierType = UA_NODEIDTYPE_GUID;
  123|      2|        res = parse_guid(&id->identifier.guid, str.data, end);
  124|      2|        break;
  125|  8.20k|    case 'b':
  ------------------
  |  Branch (125:5): [True: 8.20k, False: 16.8k]
  ------------------
  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.20k|        id->identifierType = UA_NODEIDTYPE_BYTESTRING;
  130|  8.20k|        id->identifier.byteString.data =
  131|  8.20k|            UA_unbase64(str.data, str.length, &id->identifier.byteString.length);
  132|  8.20k|        if(!id->identifier.byteString.data && str.length > 0)
  ------------------
  |  Branch (132:12): [True: 25, False: 8.18k]
  |  Branch (132:47): [True: 25, False: 0]
  ------------------
  133|     25|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     25|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  134|  8.20k|        break;
  135|      0|    default:
  ------------------
  |  Branch (135:5): [True: 0, False: 25.0k]
  ------------------
  136|      0|        res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  137|      0|        break;
  138|  25.0k|    }
  139|  25.0k|    return res;
  140|  25.0k|}
ua_types_lex.c:parse_expandednodeid:
  335|  19.6k|                     size_t serverUrisSize, const UA_String *serverUris) {
  336|  19.6k|    *id = UA_EXPANDEDNODEID_NULL; /* Reset the NodeId */
  337|  19.6k|    LexContext context;
  338|  19.6k|    memset(&context, 0, sizeof(LexContext));
  339|  19.6k|    const u8 *svr = NULL, *sve = NULL, *svu = NULL,
  340|  19.6k|        *nsu = NULL, *ns = NULL, *body = NULL, *begin = pos;
  341|       |
  342|       |    
  343|  19.6k|{
  344|  19.6k|	u8 yych;
  345|  19.6k|	yych = YYPEEK();
  ------------------
  |  |   31|  19.6k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  19.6k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  19.6k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 19.6k, False: 1]
  |  |  ------------------
  ------------------
  346|  19.6k|	switch (yych) {
  347|  6.80k|		case 'b':
  ------------------
  |  Branch (347:3): [True: 6.80k, False: 12.8k]
  ------------------
  348|  6.80k|		case 'g':
  ------------------
  |  Branch (348:3): [True: 0, False: 19.6k]
  ------------------
  349|  7.56k|		case 'i':
  ------------------
  |  Branch (349:3): [True: 759, False: 18.8k]
  ------------------
  350|  7.56k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|  7.56k|#define YYSTAGN(t) t = NULL
  ------------------
  351|  7.56k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   37|  7.56k|#define YYSTAGN(t) t = NULL
  ------------------
  352|  7.56k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   37|  7.56k|#define YYSTAGN(t) t = NULL
  ------------------
  353|  7.56k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   37|  7.56k|#define YYSTAGN(t) t = NULL
  ------------------
  354|  7.56k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   37|  7.56k|#define YYSTAGN(t) t = NULL
  ------------------
  355|  7.56k|			goto yy18;
  356|    737|		case 'n':
  ------------------
  |  Branch (356:3): [True: 737, False: 18.9k]
  ------------------
  357|    737|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|    737|#define YYSTAGN(t) t = NULL
  ------------------
  358|    737|			YYSTAGN(context.yyt2);
  ------------------
  |  |   37|    737|#define YYSTAGN(t) t = NULL
  ------------------
  359|    737|			YYSTAGN(context.yyt5);
  ------------------
  |  |   37|    737|#define YYSTAGN(t) t = NULL
  ------------------
  360|    737|			goto yy19;
  361|  11.3k|		case 's':
  ------------------
  |  Branch (361:3): [True: 11.3k, False: 8.30k]
  ------------------
  362|  11.3k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|  11.3k|#define YYSTAGN(t) t = NULL
  ------------------
  363|  11.3k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   37|  11.3k|#define YYSTAGN(t) t = NULL
  ------------------
  364|  11.3k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   37|  11.3k|#define YYSTAGN(t) t = NULL
  ------------------
  365|  11.3k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   37|  11.3k|#define YYSTAGN(t) t = NULL
  ------------------
  366|  11.3k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   37|  11.3k|#define YYSTAGN(t) t = NULL
  ------------------
  367|  11.3k|			goto yy20;
  368|      2|		default: goto yy16;
  ------------------
  |  Branch (368:3): [True: 2, False: 19.6k]
  ------------------
  369|  19.6k|	}
  370|      2|yy16:
  371|      2|	YYSKIP();
  ------------------
  |  |   33|      2|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|      2|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  372|     70|yy17:
  373|     70|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   43|     70|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  374|  7.56k|yy18:
  375|  7.56k|	YYSKIP();
  ------------------
  |  |   33|  7.56k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  7.56k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  376|  7.56k|	yych = YYPEEK();
  ------------------
  |  |   31|  7.56k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  7.56k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  7.56k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 7.56k, False: 0]
  |  |  ------------------
  ------------------
  377|  7.56k|	switch (yych) {
  378|  7.56k|		case '=': goto yy21;
  ------------------
  |  Branch (378:3): [True: 7.56k, False: 3]
  ------------------
  379|      3|		default: goto yy17;
  ------------------
  |  Branch (379:3): [True: 3, False: 7.56k]
  ------------------
  380|  7.56k|	}
  381|    737|yy19:
  382|    737|	YYSKIP();
  ------------------
  |  |   33|    737|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    737|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  383|    737|	YYBACKUP();
  ------------------
  |  |   34|    737|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   30|    737|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    737|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  384|    737|	yych = YYPEEK();
  ------------------
  |  |   31|    737|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    737|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    737|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 737, False: 0]
  |  |  ------------------
  ------------------
  385|    737|	switch (yych) {
  386|    735|		case 's': goto yy22;
  ------------------
  |  Branch (386:3): [True: 735, False: 2]
  ------------------
  387|      2|		default: goto yy17;
  ------------------
  |  Branch (387:3): [True: 2, False: 735]
  ------------------
  388|    737|	}
  389|  11.3k|yy20:
  390|  11.3k|	YYSKIP();
  ------------------
  |  |   33|  11.3k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  11.3k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  391|  11.3k|	YYBACKUP();
  ------------------
  |  |   34|  11.3k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   30|  11.3k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  11.3k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  392|  11.3k|	yych = YYPEEK();
  ------------------
  |  |   31|  11.3k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  11.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  11.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 11.3k, False: 0]
  |  |  ------------------
  ------------------
  393|  11.3k|	switch (yych) {
  394|  10.2k|		case '=': goto yy21;
  ------------------
  |  Branch (394:3): [True: 10.2k, False: 1.09k]
  ------------------
  395|  1.09k|		case 'v': goto yy24;
  ------------------
  |  Branch (395:3): [True: 1.09k, False: 10.2k]
  ------------------
  396|      0|		default: goto yy17;
  ------------------
  |  Branch (396:3): [True: 0, False: 11.3k]
  ------------------
  397|  11.3k|	}
  398|  19.5k|yy21:
  399|  19.5k|	YYSKIP();
  ------------------
  |  |   33|  19.5k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  19.5k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  400|  19.5k|	svr = context.yyt5;
  401|  19.5k|	svu = context.yyt1;
  402|  19.5k|	sve = context.yyt2;
  403|  19.5k|	ns = context.yyt3;
  404|  19.5k|	nsu = context.yyt4;
  405|  19.5k|	YYSTAGP(body);
  ------------------
  |  |   36|  19.5k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  19.5k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  406|  19.5k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   38|  19.5k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  407|  19.5k|	{ goto match; }
  408|    735|yy22:
  409|    735|	YYSKIP();
  ------------------
  |  |   33|    735|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    735|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  410|    735|	yych = YYPEEK();
  ------------------
  |  |   31|    735|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    735|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    735|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 735, False: 0]
  |  |  ------------------
  ------------------
  411|    735|	switch (yych) {
  412|    243|		case '=': goto yy25;
  ------------------
  |  Branch (412:3): [True: 243, False: 492]
  ------------------
  413|    491|		case 'u': goto yy26;
  ------------------
  |  Branch (413:3): [True: 491, False: 244]
  ------------------
  414|      1|		default: goto yy23;
  ------------------
  |  Branch (414:3): [True: 1, False: 734]
  ------------------
  415|    735|	}
  416|     63|yy23:
  417|     63|	YYRESTORE();
  ------------------
  |  |   35|     63|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   29|     63|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   30|     63|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  418|     63|	goto yy17;
  419|  1.09k|yy24:
  420|  1.09k|	YYSKIP();
  ------------------
  |  |   33|  1.09k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.09k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  421|  1.09k|	yych = YYPEEK();
  ------------------
  |  |   31|  1.09k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.09k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.09k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.09k, False: 0]
  |  |  ------------------
  ------------------
  422|  1.09k|	switch (yych) {
  423|    971|		case 'r': goto yy27;
  ------------------
  |  Branch (423:3): [True: 971, False: 121]
  ------------------
  424|    121|		case 'u': goto yy28;
  ------------------
  |  Branch (424:3): [True: 121, False: 971]
  ------------------
  425|      0|		default: goto yy23;
  ------------------
  |  Branch (425:3): [True: 0, False: 1.09k]
  ------------------
  426|  1.09k|	}
  427|    243|yy25:
  428|    243|	YYSKIP();
  ------------------
  |  |   33|    243|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    243|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  429|    243|	yych = YYPEEK();
  ------------------
  |  |   31|    243|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    243|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    243|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 243, False: 0]
  |  |  ------------------
  ------------------
  430|    243|	switch (yych) {
  431|     61|		case '0':
  ------------------
  |  Branch (431:3): [True: 61, False: 182]
  ------------------
  432|    102|		case '1':
  ------------------
  |  Branch (432:3): [True: 41, False: 202]
  ------------------
  433|    161|		case '2':
  ------------------
  |  Branch (433:3): [True: 59, False: 184]
  ------------------
  434|    205|		case '3':
  ------------------
  |  Branch (434:3): [True: 44, False: 199]
  ------------------
  435|    216|		case '4':
  ------------------
  |  Branch (435:3): [True: 11, False: 232]
  ------------------
  436|    222|		case '5':
  ------------------
  |  Branch (436:3): [True: 6, False: 237]
  ------------------
  437|    227|		case '6':
  ------------------
  |  Branch (437:3): [True: 5, False: 238]
  ------------------
  438|    237|		case '7':
  ------------------
  |  Branch (438:3): [True: 10, False: 233]
  ------------------
  439|    242|		case '8':
  ------------------
  |  Branch (439:3): [True: 5, False: 238]
  ------------------
  440|    243|		case '9':
  ------------------
  |  Branch (440:3): [True: 1, False: 242]
  ------------------
  441|    243|			YYSTAGP(context.yyt3);
  ------------------
  |  |   36|    243|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    243|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  442|    243|			goto yy29;
  443|      0|		default: goto yy23;
  ------------------
  |  Branch (443:3): [True: 0, False: 243]
  ------------------
  444|    243|	}
  445|    491|yy26:
  446|    491|	YYSKIP();
  ------------------
  |  |   33|    491|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    491|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  447|    491|	yych = YYPEEK();
  ------------------
  |  |   31|    491|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    491|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    491|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 491, False: 0]
  |  |  ------------------
  ------------------
  448|    491|	switch (yych) {
  449|    491|		case '=': goto yy30;
  ------------------
  |  Branch (449:3): [True: 491, False: 0]
  ------------------
  450|      0|		default: goto yy23;
  ------------------
  |  Branch (450:3): [True: 0, False: 491]
  ------------------
  451|    491|	}
  452|    971|yy27:
  453|    971|	YYSKIP();
  ------------------
  |  |   33|    971|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    971|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  454|    971|	yych = YYPEEK();
  ------------------
  |  |   31|    971|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    971|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    971|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 971, False: 0]
  |  |  ------------------
  ------------------
  455|    971|	switch (yych) {
  456|    970|		case '=': goto yy31;
  ------------------
  |  Branch (456:3): [True: 970, False: 1]
  ------------------
  457|      1|		default: goto yy23;
  ------------------
  |  Branch (457:3): [True: 1, False: 970]
  ------------------
  458|    971|	}
  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|    121|		case '=': goto yy32;
  ------------------
  |  Branch (463:3): [True: 121, False: 0]
  ------------------
  464|      0|		default: goto yy23;
  ------------------
  |  Branch (464:3): [True: 0, False: 121]
  ------------------
  465|    121|	}
  466|   319k|yy29:
  467|   319k|	YYSKIP();
  ------------------
  |  |   33|   319k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|   319k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  468|   319k|	yych = YYPEEK();
  ------------------
  |  |   31|   319k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   319k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   319k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 319k, False: 28]
  |  |  ------------------
  ------------------
  469|   319k|	switch (yych) {
  470|   287k|		case '0':
  ------------------
  |  Branch (470:3): [True: 287k, False: 32.1k]
  ------------------
  471|   291k|		case '1':
  ------------------
  |  Branch (471:3): [True: 4.51k, False: 315k]
  ------------------
  472|   293k|		case '2':
  ------------------
  |  Branch (472:3): [True: 1.08k, False: 318k]
  ------------------
  473|   295k|		case '3':
  ------------------
  |  Branch (473:3): [True: 2.73k, False: 316k]
  ------------------
  474|   297k|		case '4':
  ------------------
  |  Branch (474:3): [True: 1.68k, False: 317k]
  ------------------
  475|   297k|		case '5':
  ------------------
  |  Branch (475:3): [True: 318, False: 319k]
  ------------------
  476|   313k|		case '6':
  ------------------
  |  Branch (476:3): [True: 15.6k, False: 303k]
  ------------------
  477|   313k|		case '7':
  ------------------
  |  Branch (477:3): [True: 576, False: 319k]
  ------------------
  478|   317k|		case '8':
  ------------------
  |  Branch (478:3): [True: 3.64k, False: 315k]
  ------------------
  479|   319k|		case '9': goto yy29;
  ------------------
  |  Branch (479:3): [True: 1.70k, False: 317k]
  ------------------
  480|    206|		case ';':
  ------------------
  |  Branch (480:3): [True: 206, False: 319k]
  ------------------
  481|    206|			YYSTAGN(context.yyt4);
  ------------------
  |  |   37|    206|#define YYSTAGN(t) t = NULL
  ------------------
  482|    206|			goto yy33;
  483|     37|		default: goto yy23;
  ------------------
  |  Branch (483:3): [True: 37, False: 319k]
  ------------------
  484|   319k|	}
  485|    491|yy30:
  486|    491|	YYSKIP();
  ------------------
  |  |   33|    491|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    491|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  487|    491|	yych = YYPEEK();
  ------------------
  |  |   31|    491|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    491|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    491|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 491, False: 0]
  |  |  ------------------
  ------------------
  488|    491|	switch (yych) {
  489|      0|		case 0x00: goto yy23;
  ------------------
  |  Branch (489:3): [True: 0, False: 491]
  ------------------
  490|      0|		case ';':
  ------------------
  |  Branch (490:3): [True: 0, False: 491]
  ------------------
  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|    491|		default:
  ------------------
  |  Branch (494:3): [True: 491, False: 0]
  ------------------
  495|    491|			YYSTAGP(context.yyt4);
  ------------------
  |  |   36|    491|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    491|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  496|    491|			goto yy34;
  497|    491|	}
  498|    970|yy31:
  499|    970|	YYSKIP();
  ------------------
  |  |   33|    970|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    970|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  500|    970|	yych = YYPEEK();
  ------------------
  |  |   31|    970|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    970|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    970|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 970, False: 0]
  |  |  ------------------
  ------------------
  501|    970|	switch (yych) {
  502|     42|		case '0':
  ------------------
  |  Branch (502:3): [True: 42, False: 928]
  ------------------
  503|    254|		case '1':
  ------------------
  |  Branch (503:3): [True: 212, False: 758]
  ------------------
  504|    275|		case '2':
  ------------------
  |  Branch (504:3): [True: 21, False: 949]
  ------------------
  505|    467|		case '3':
  ------------------
  |  Branch (505:3): [True: 192, False: 778]
  ------------------
  506|    784|		case '4':
  ------------------
  |  Branch (506:3): [True: 317, False: 653]
  ------------------
  507|    795|		case '5':
  ------------------
  |  Branch (507:3): [True: 11, False: 959]
  ------------------
  508|    796|		case '6':
  ------------------
  |  Branch (508:3): [True: 1, False: 969]
  ------------------
  509|    925|		case '7':
  ------------------
  |  Branch (509:3): [True: 129, False: 841]
  ------------------
  510|    965|		case '8':
  ------------------
  |  Branch (510:3): [True: 40, False: 930]
  ------------------
  511|    970|		case '9':
  ------------------
  |  Branch (511:3): [True: 5, False: 965]
  ------------------
  512|    970|			YYSTAGP(context.yyt5);
  ------------------
  |  |   36|    970|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    970|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  513|    970|			goto yy35;
  514|      0|		default: goto yy23;
  ------------------
  |  Branch (514:3): [True: 0, False: 970]
  ------------------
  515|    970|	}
  516|    121|yy32:
  517|    121|	YYSKIP();
  ------------------
  |  |   33|    121|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    121|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  518|    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]
  |  |  ------------------
  ------------------
  519|    121|	switch (yych) {
  520|      0|		case 0x00: goto yy23;
  ------------------
  |  Branch (520:3): [True: 0, False: 121]
  ------------------
  521|      0|		case ';':
  ------------------
  |  Branch (521:3): [True: 0, False: 121]
  ------------------
  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|    121|		default:
  ------------------
  |  Branch (526:3): [True: 121, False: 0]
  ------------------
  527|    121|			YYSTAGP(context.yyt1);
  ------------------
  |  |   36|    121|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    121|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  528|    121|			goto yy36;
  529|    121|	}
  530|    697|yy33:
  531|    697|	YYSKIP();
  ------------------
  |  |   33|    697|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    697|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  532|    697|	yych = YYPEEK();
  ------------------
  |  |   31|    697|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    697|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|    697|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 697, False: 0]
  |  |  ------------------
  ------------------
  533|    697|	switch (yych) {
  534|    109|		case 'b':
  ------------------
  |  Branch (534:3): [True: 109, False: 588]
  ------------------
  535|    109|		case 'g':
  ------------------
  |  Branch (535:3): [True: 0, False: 697]
  ------------------
  536|    202|		case 'i':
  ------------------
  |  Branch (536:3): [True: 93, False: 604]
  ------------------
  537|    696|		case 's': goto yy38;
  ------------------
  |  Branch (537:3): [True: 494, False: 203]
  ------------------
  538|      1|		default: goto yy23;
  ------------------
  |  Branch (538:3): [True: 1, False: 696]
  ------------------
  539|    697|	}
  540|  1.58M|yy34:
  541|  1.58M|	YYSKIP();
  ------------------
  |  |   33|  1.58M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.58M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  542|  1.58M|	yych = YYPEEK();
  ------------------
  |  |   31|  1.58M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.58M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.58M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.58M, False: 0]
  |  |  ------------------
  ------------------
  543|  1.58M|	switch (yych) {
  544|      0|		case 0x00: goto yy23;
  ------------------
  |  Branch (544:3): [True: 0, False: 1.58M]
  ------------------
  545|    491|		case ';':
  ------------------
  |  Branch (545:3): [True: 491, False: 1.58M]
  ------------------
  546|    491|			YYSTAGN(context.yyt3);
  ------------------
  |  |   37|    491|#define YYSTAGN(t) t = NULL
  ------------------
  547|    491|			goto yy33;
  548|  1.58M|		default: goto yy34;
  ------------------
  |  Branch (548:3): [True: 1.58M, False: 491]
  ------------------
  549|  1.58M|	}
  550|  4.67k|yy35:
  551|  4.67k|	YYSKIP();
  ------------------
  |  |   33|  4.67k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  4.67k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  552|  4.67k|	yych = YYPEEK();
  ------------------
  |  |   31|  4.67k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  4.67k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  4.65k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 4.65k, False: 16]
  |  |  ------------------
  ------------------
  553|  4.67k|	switch (yych) {
  554|  1.11k|		case '0':
  ------------------
  |  Branch (554:3): [True: 1.11k, False: 3.56k]
  ------------------
  555|  1.35k|		case '1':
  ------------------
  |  Branch (555:3): [True: 239, False: 4.43k]
  ------------------
  556|  1.64k|		case '2':
  ------------------
  |  Branch (556:3): [True: 288, False: 4.38k]
  ------------------
  557|  1.91k|		case '3':
  ------------------
  |  Branch (557:3): [True: 271, False: 4.40k]
  ------------------
  558|  2.19k|		case '4':
  ------------------
  |  Branch (558:3): [True: 286, False: 4.38k]
  ------------------
  559|  2.44k|		case '5':
  ------------------
  |  Branch (559:3): [True: 248, False: 4.42k]
  ------------------
  560|  2.81k|		case '6':
  ------------------
  |  Branch (560:3): [True: 370, False: 4.30k]
  ------------------
  561|  3.17k|		case '7':
  ------------------
  |  Branch (561:3): [True: 364, False: 4.31k]
  ------------------
  562|  3.41k|		case '8':
  ------------------
  |  Branch (562:3): [True: 234, False: 4.44k]
  ------------------
  563|  3.70k|		case '9': goto yy35;
  ------------------
  |  Branch (563:3): [True: 291, False: 4.38k]
  ------------------
  564|    951|		case ';':
  ------------------
  |  Branch (564:3): [True: 951, False: 3.72k]
  ------------------
  565|    951|			YYSTAGN(context.yyt1);
  ------------------
  |  |   37|    951|#define YYSTAGN(t) t = NULL
  ------------------
  566|    951|			YYSTAGP(context.yyt2);
  ------------------
  |  |   36|    951|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    951|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  567|    951|			goto yy37;
  568|     19|		default: goto yy23;
  ------------------
  |  Branch (568:3): [True: 19, False: 4.65k]
  ------------------
  569|  4.67k|	}
  570|  4.03M|yy36:
  571|  4.03M|	YYSKIP();
  ------------------
  |  |   33|  4.03M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  4.03M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  572|  4.03M|	yych = YYPEEK();
  ------------------
  |  |   31|  4.03M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  4.03M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  4.03M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 4.03M, False: 3]
  |  |  ------------------
  ------------------
  573|  4.03M|	switch (yych) {
  574|      3|		case 0x00: goto yy23;
  ------------------
  |  Branch (574:3): [True: 3, False: 4.03M]
  ------------------
  575|    118|		case ';':
  ------------------
  |  Branch (575:3): [True: 118, False: 4.03M]
  ------------------
  576|    118|			YYSTAGP(context.yyt2);
  ------------------
  |  |   36|    118|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|    118|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  577|    118|			YYSTAGN(context.yyt5);
  ------------------
  |  |   37|    118|#define YYSTAGN(t) t = NULL
  ------------------
  578|    118|			goto yy37;
  579|  4.03M|		default: goto yy36;
  ------------------
  |  Branch (579:3): [True: 4.03M, False: 121]
  ------------------
  580|  4.03M|	}
  581|  1.06k|yy37:
  582|  1.06k|	YYSKIP();
  ------------------
  |  |   33|  1.06k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.06k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  583|  1.06k|	yych = YYPEEK();
  ------------------
  |  |   31|  1.06k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.06k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.06k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.06k, False: 0]
  |  |  ------------------
  ------------------
  584|  1.06k|	switch (yych) {
  585|      0|		case 'b':
  ------------------
  |  Branch (585:3): [True: 0, False: 1.06k]
  ------------------
  586|      0|		case 'g':
  ------------------
  |  Branch (586:3): [True: 0, False: 1.06k]
  ------------------
  587|      2|		case 'i':
  ------------------
  |  Branch (587:3): [True: 2, False: 1.06k]
  ------------------
  588|  1.06k|		case 's':
  ------------------
  |  Branch (588:3): [True: 1.06k, False: 2]
  ------------------
  589|  1.06k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   37|  1.06k|#define YYSTAGN(t) t = NULL
  ------------------
  590|  1.06k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   37|  1.06k|#define YYSTAGN(t) t = NULL
  ------------------
  591|  1.06k|			goto yy38;
  592|      0|		case 'n': goto yy39;
  ------------------
  |  Branch (592:3): [True: 0, False: 1.06k]
  ------------------
  593|      0|		default: goto yy23;
  ------------------
  |  Branch (593:3): [True: 0, False: 1.06k]
  ------------------
  594|  1.06k|	}
  595|  1.76k|yy38:
  596|  1.76k|	YYSKIP();
  ------------------
  |  |   33|  1.76k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  1.76k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  597|  1.76k|	yych = YYPEEK();
  ------------------
  |  |   31|  1.76k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.76k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  1.76k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 1.76k, False: 0]
  |  |  ------------------
  ------------------
  598|  1.76k|	switch (yych) {
  599|  1.76k|		case '=': goto yy21;
  ------------------
  |  Branch (599:3): [True: 1.76k, False: 1]
  ------------------
  600|      1|		default: goto yy23;
  ------------------
  |  Branch (600:3): [True: 1, False: 1.76k]
  ------------------
  601|  1.76k|	}
  602|      0|yy39:
  603|      0|	YYSKIP();
  ------------------
  |  |   33|      0|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  604|      0|	yych = YYPEEK();
  ------------------
  |  |   31|      0|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|      0|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|      0|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  605|      0|	switch (yych) {
  606|      0|		case 's': goto yy22;
  ------------------
  |  Branch (606:3): [True: 0, False: 0]
  ------------------
  607|      0|		default: goto yy23;
  ------------------
  |  Branch (607:3): [True: 0, False: 0]
  ------------------
  608|      0|	}
  609|      0|}
  610|       |
  611|       |
  612|  19.5k| match:
  613|  19.5k|    if(svu) {
  ------------------
  |  Branch (613:8): [True: 118, False: 19.4k]
  ------------------
  614|       |        /* ServerUri */
  615|    118|        UA_String serverUri = {(size_t)(sve - svu), (UA_Byte*)(uintptr_t)svu};
  616|    118|        size_t i = 0;
  617|    118|        for(; i < serverUrisSize; i++) {
  ------------------
  |  Branch (617:15): [True: 0, False: 118]
  ------------------
  618|      0|            if(UA_String_equal(&serverUri, &serverUris[i]))
  ------------------
  |  Branch (618:16): [True: 0, False: 0]
  ------------------
  619|      0|                break;
  620|      0|        }
  621|    118|        if(i == serverUrisSize) {
  ------------------
  |  Branch (621:12): [True: 118, False: 0]
  ------------------
  622|       |            /* The ServerUri cannot be mapped. Return the entire input as a
  623|       |             * string NodeId. */
  624|    118|            UA_String total = {(size_t)(end - begin), (UA_Byte*)(uintptr_t)begin};
  625|    118|            id->nodeId.identifierType = UA_NODEIDTYPE_STRING;
  626|    118|            return UA_String_copy(&total, &id->nodeId.identifier.string);
  627|    118|        }
  628|      0|        id->serverIndex = (UA_UInt32)i;
  629|  19.4k|    } else if(svr) {
  ------------------
  |  Branch (629:15): [True: 951, False: 18.4k]
  ------------------
  630|       |        /* ServerIndex */
  631|    951|        size_t len = (size_t)(sve - svr);
  632|    951|        if(UA_readNumber((const UA_Byte*)svr, len, &id->serverIndex) != len)
  ------------------
  |  Branch (632:12): [True: 0, False: 951]
  ------------------
  633|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  634|    951|    }
  635|       |
  636|  19.4k|    if(nsu) {
  ------------------
  |  Branch (636:8): [True: 489, False: 18.9k]
  ------------------
  637|       |        /* NamespaceUri */
  638|    489|        UA_String nsuri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  639|    489|        UA_StatusCode res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    489|#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|    489|        if(id->serverIndex == 0)
  ------------------
  |  Branch (642:12): [True: 489, False: 0]
  ------------------
  643|    489|            res = escapedUri2Index(nsuri, &id->nodeId.namespaceIndex, nsMapping);
  644|    489|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    489|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (644:12): [True: 489, False: 0]
  ------------------
  645|    489|            res = UA_String_copy(&nsuri, &id->namespaceUri); /* Keep the Uri without mapping */
  646|    489|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    489|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (646:12): [True: 0, False: 489]
  ------------------
  647|      0|            return res;
  648|  18.9k|    } else if(ns) {
  ------------------
  |  Branch (648:15): [True: 206, False: 18.7k]
  ------------------
  649|       |        /* NamespaceIndex */
  650|    206|        UA_UInt32 tmp;
  651|    206|        size_t len = (size_t)(body - 1 - ns);
  652|    206|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (652:12): [True: 0, False: 206]
  ------------------
  653|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  654|    206|        id->nodeId.namespaceIndex = (UA_UInt16)tmp;
  655|    206|        if(nsMapping)
  ------------------
  |  Branch (655:12): [True: 0, False: 206]
  ------------------
  656|      0|            id->nodeId.namespaceIndex =
  657|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->nodeId.namespaceIndex);
  658|    206|    }
  659|       |
  660|       |    /* From the current position until the end */
  661|  19.4k|    return parse_nodeid_body(&id->nodeId, body, end, idEsc);
  662|  19.4k|}
ua_types_lex.c:parse_qn:
  699|  73.0k|         UA_UInt16 defaultNamespaceIndex) {
  700|  73.0k|    size_t len;
  701|  73.0k|    UA_UInt32 tmp;
  702|  73.0k|    UA_String str;
  703|  73.0k|    UA_StatusCode res;
  704|       |
  705|  73.0k|    LexContext context;
  706|  73.0k|    memset(&context, 0, sizeof(LexContext));
  707|       |
  708|  73.0k|    const u8 *begin = pos;
  709|  73.0k|    UA_QualifiedName_init(qn);
  710|  73.0k|    qn->namespaceIndex = defaultNamespaceIndex;
  711|       |
  712|       |    
  713|  73.0k|{
  714|  73.0k|	u8 yych;
  715|  73.0k|	yych = YYPEEK();
  ------------------
  |  |   31|  73.0k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  73.0k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  66.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 66.3k, False: 6.64k]
  |  |  ------------------
  ------------------
  716|  73.0k|	switch (yych) {
  717|  6.64k|		case 0x00:
  ------------------
  |  Branch (717:3): [True: 6.64k, False: 66.3k]
  ------------------
  718|  6.84k|		case ';': goto yy41;
  ------------------
  |  Branch (718:3): [True: 203, False: 72.8k]
  ------------------
  719|  18.9k|		case '0':
  ------------------
  |  Branch (719:3): [True: 18.9k, False: 54.0k]
  ------------------
  720|  21.1k|		case '1':
  ------------------
  |  Branch (720:3): [True: 2.19k, False: 70.8k]
  ------------------
  721|  22.0k|		case '2':
  ------------------
  |  Branch (721:3): [True: 881, False: 72.1k]
  ------------------
  722|  23.2k|		case '3':
  ------------------
  |  Branch (722:3): [True: 1.28k, False: 71.7k]
  ------------------
  723|  29.6k|		case '4':
  ------------------
  |  Branch (723:3): [True: 6.39k, False: 66.6k]
  ------------------
  724|  30.2k|		case '5':
  ------------------
  |  Branch (724:3): [True: 530, False: 72.4k]
  ------------------
  725|  32.7k|		case '6':
  ------------------
  |  Branch (725:3): [True: 2.54k, False: 70.4k]
  ------------------
  726|  34.5k|		case '7':
  ------------------
  |  Branch (726:3): [True: 1.75k, False: 71.2k]
  ------------------
  727|  36.1k|		case '8':
  ------------------
  |  Branch (727:3): [True: 1.62k, False: 71.3k]
  ------------------
  728|  36.4k|		case '9': goto yy44;
  ------------------
  |  Branch (728:3): [True: 338, False: 72.6k]
  ------------------
  729|  29.6k|		default: goto yy43;
  ------------------
  |  Branch (729:3): [True: 29.6k, False: 43.3k]
  ------------------
  730|  73.0k|	}
  731|  6.84k|yy41:
  732|  6.84k|	YYSKIP();
  ------------------
  |  |   33|  6.84k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  6.84k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  733|  71.8k|yy42:
  734|  71.8k|	{ pos = begin; goto match_name; }
  735|  29.6k|yy43:
  736|  29.6k|	YYSKIP();
  ------------------
  |  |   33|  29.6k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  29.6k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  737|  29.6k|	YYBACKUP();
  ------------------
  |  |   34|  29.6k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   30|  29.6k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  29.6k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  738|  29.6k|	yych = YYPEEK();
  ------------------
  |  |   31|  29.6k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  29.6k|#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: 9.40k]
  |  |  ------------------
  ------------------
  739|  29.6k|	if (yych <= 0x00) goto yy42;
  ------------------
  |  Branch (739:6): [True: 9.40k, False: 20.2k]
  ------------------
  740|  20.2k|	goto yy46;
  741|  36.4k|yy44:
  742|  36.4k|	YYSKIP();
  ------------------
  |  |   33|  36.4k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  36.4k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  743|  36.4k|	YYBACKUP();
  ------------------
  |  |   34|  36.4k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   30|  36.4k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   29|  36.4k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  744|  36.4k|	yych = YYPEEK();
  ------------------
  |  |   31|  36.4k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  36.4k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  23.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 23.3k, False: 13.1k]
  |  |  ------------------
  ------------------
  745|  36.4k|	switch (yych) {
  746|  5.20k|		case '0':
  ------------------
  |  Branch (746:3): [True: 5.20k, False: 31.2k]
  ------------------
  747|  5.48k|		case '1':
  ------------------
  |  Branch (747:3): [True: 278, False: 36.1k]
  ------------------
  748|  6.18k|		case '2':
  ------------------
  |  Branch (748:3): [True: 708, False: 35.7k]
  ------------------
  749|  6.53k|		case '3':
  ------------------
  |  Branch (749:3): [True: 342, False: 36.1k]
  ------------------
  750|  12.1k|		case '4':
  ------------------
  |  Branch (750:3): [True: 5.62k, False: 30.8k]
  ------------------
  751|  13.2k|		case '5':
  ------------------
  |  Branch (751:3): [True: 1.05k, False: 35.4k]
  ------------------
  752|  13.4k|		case '6':
  ------------------
  |  Branch (752:3): [True: 214, False: 36.2k]
  ------------------
  753|  14.6k|		case '7':
  ------------------
  |  Branch (753:3): [True: 1.18k, False: 35.2k]
  ------------------
  754|  14.7k|		case '8':
  ------------------
  |  Branch (754:3): [True: 100, False: 36.3k]
  ------------------
  755|  14.8k|		case '9':
  ------------------
  |  Branch (755:3): [True: 182, False: 36.2k]
  ------------------
  756|  15.5k|		case ':': goto yy50;
  ------------------
  |  Branch (756:3): [True: 679, False: 35.7k]
  ------------------
  757|  20.9k|		default: goto yy42;
  ------------------
  |  Branch (757:3): [True: 20.9k, False: 15.5k]
  ------------------
  758|  36.4k|	}
  759|  6.16M|yy45:
  760|  6.16M|	YYSKIP();
  ------------------
  |  |   33|  6.16M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|  6.16M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  761|  6.16M|	yych = YYPEEK();
  ------------------
  |  |   31|  6.16M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  6.16M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|  6.13M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 6.13M, False: 20.0k]
  |  |  ------------------
  ------------------
  762|  6.18M|yy46:
  763|  6.18M|	switch (yych) {
  764|  20.0k|		case 0x00: goto yy47;
  ------------------
  |  Branch (764:3): [True: 20.0k, False: 6.16M]
  ------------------
  765|    201|		case ';': goto yy48;
  ------------------
  |  Branch (765:3): [True: 201, False: 6.18M]
  ------------------
  766|  6.16M|		default: goto yy45;
  ------------------
  |  Branch (766:3): [True: 6.16M, False: 20.2k]
  ------------------
  767|  6.18M|	}
  768|  34.7k|yy47:
  769|  34.7k|	YYRESTORE();
  ------------------
  |  |   35|  34.7k|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   29|  34.7k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   30|  34.7k|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  770|  34.7k|	goto yy42;
  771|    201|yy48:
  772|    201|	YYSKIP();
  ------------------
  |  |   33|    201|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    201|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  773|    201|	{ goto match_uri; }
  774|   159k|yy49:
  775|   159k|	YYSKIP();
  ------------------
  |  |   33|   159k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|   159k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  776|   159k|	yych = YYPEEK();
  ------------------
  |  |   31|   159k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   159k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   29|   157k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (31:18): [True: 157k, False: 1.31k]
  |  |  ------------------
  ------------------
  777|   174k|yy50:
  778|   174k|	switch (yych) {
  779|  56.5k|		case '0':
  ------------------
  |  Branch (779:3): [True: 56.5k, False: 118k]
  ------------------
  780|  61.9k|		case '1':
  ------------------
  |  Branch (780:3): [True: 5.45k, False: 169k]
  ------------------
  781|  78.4k|		case '2':
  ------------------
  |  Branch (781:3): [True: 16.4k, False: 158k]
  ------------------
  782|  84.7k|		case '3':
  ------------------
  |  Branch (782:3): [True: 6.26k, False: 168k]
  ------------------
  783|   107k|		case '4':
  ------------------
  |  Branch (783:3): [True: 22.3k, False: 152k]
  ------------------
  784|   115k|		case '5':
  ------------------
  |  Branch (784:3): [True: 8.73k, False: 165k]
  ------------------
  785|   132k|		case '6':
  ------------------
  |  Branch (785:3): [True: 16.2k, False: 158k]
  ------------------
  786|   137k|		case '7':
  ------------------
  |  Branch (786:3): [True: 5.70k, False: 168k]
  ------------------
  787|   142k|		case '8':
  ------------------
  |  Branch (787:3): [True: 4.79k, False: 169k]
  ------------------
  788|   159k|		case '9': goto yy49;
  ------------------
  |  Branch (788:3): [True: 16.5k, False: 158k]
  ------------------
  789|    929|		case ':': goto yy51;
  ------------------
  |  Branch (789:3): [True: 929, False: 173k]
  ------------------
  790|  14.6k|		default: goto yy47;
  ------------------
  |  Branch (790:3): [True: 14.6k, False: 159k]
  ------------------
  791|   174k|	}
  792|    929|yy51:
  793|    929|	YYSKIP();
  ------------------
  |  |   33|    929|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   29|    929|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  794|    929|	{ goto match_index; }
  795|   174k|}
  796|       |
  797|       |
  798|    929| match_index:
  799|    929|    len = (size_t)(pos - 1 - begin);
  800|    929|    if(UA_readNumber((const UA_Byte*)begin, len, &tmp) != len)
  ------------------
  |  Branch (800:8): [True: 0, False: 929]
  ------------------
  801|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  802|    929|    qn->namespaceIndex = (UA_UInt16)tmp;
  803|    929|    goto match_name;
  804|       |
  805|    201| match_uri:
  806|    201|    str.length = (size_t)(pos - 1 - begin);
  807|    201|    str.data = (UA_Byte*)(uintptr_t)begin;
  808|    201|    res = escapedUri2Index(str, &qn->namespaceIndex, nsMapping);
  809|    201|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    201|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (809:8): [True: 201, False: 0]
  ------------------
  810|    201|        pos = begin; /* Use the entire string for the name */
  811|       |
  812|  73.0k| match_name:
  813|  73.0k|    str.length = (size_t)(end - pos);
  814|  73.0k|    str.data = (UA_Byte*)(uintptr_t)pos;
  815|  73.0k|    res = UA_String_copy(&str, &qn->name);
  816|  73.0k|    if(UA_LIKELY(res == UA_STATUSCODE_GOOD))
  ------------------
  |  |  590|  73.0k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (590:23): [True: 73.0k, False: 0]
  |  |  ------------------
  ------------------
  817|  73.0k|        res = UA_String_unescape(&qn->name, false, escName);
  818|  73.0k|    return res;
  819|    201|}

UA_readNumberWithBase:
  110|  13.4k|UA_readNumberWithBase(const UA_Byte *buf, size_t buflen, UA_UInt32 *number, UA_Byte base) {
  111|  13.4k|    UA_assert(buf);
  ------------------
  |  |  411|  13.4k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (111:5): [True: 13.4k, False: 0]
  ------------------
  112|  13.4k|    UA_assert(number);
  ------------------
  |  |  411|  13.4k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (112:5): [True: 13.4k, False: 0]
  ------------------
  113|  13.4k|    u32 n = 0;
  114|  13.4k|    size_t progress = 0;
  115|       |    /* read numbers until the end or a non-number character appears */
  116|   318k|    while(progress < buflen) {
  ------------------
  |  Branch (116:11): [True: 304k, False: 13.4k]
  ------------------
  117|   304k|        u8 c = buf[progress];
  118|   304k|        if(c >= '0' && c <= '9' && c <= '0' + (base-1))
  ------------------
  |  Branch (118:12): [True: 304k, False: 9]
  |  Branch (118:24): [True: 304k, False: 237]
  |  Branch (118:36): [True: 304k, False: 0]
  ------------------
  119|   304k|           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: 90, False: 156]
  |  Branch (120:41): [True: 78, False: 12]
  |  Branch (120:53): [True: 69, False: 9]
  ------------------
  121|     69|           n = (n * base) + c-'a' + 10;
  122|    177|        else if(base > 9 && c >= 'A' && c <= 'Z' && c <= 'A' + (base-11))
  ------------------
  |  Branch (122:17): [True: 177, False: 0]
  |  Branch (122:29): [True: 162, False: 15]
  |  Branch (122:41): [True: 139, False: 23]
  |  Branch (122:53): [True: 132, False: 7]
  ------------------
  123|    132|           n = (n * base) + c-'A' + 10;
  124|     45|        else
  125|     45|           break;
  126|   304k|        ++progress;
  127|   304k|    }
  128|  13.4k|    *number = n;
  129|  13.4k|    return progress;
  130|  13.4k|}
UA_readNumber:
  133|  4.17k|UA_readNumber(const UA_Byte *buf, size_t buflen, UA_UInt32 *number) {
  134|  4.17k|    return UA_readNumberWithBase(buf, buflen, number, 10);
  135|  4.17k|}
encodeDateTime:
  369|  29.6k|encodeDateTime(const UA_DateTime dt, UA_String *output) {
  370|  29.6k|    char buffer[UA_DATETIME_LENGTH];
  371|  29.6k|    char *pos = buffer;
  372|       |
  373|  29.6k|    if(output->length > 0) {
  ------------------
  |  Branch (373:8): [True: 29.6k, False: 0]
  ------------------
  374|  29.6k|        if(output->length < UA_DATETIME_LENGTH)
  ------------------
  |  |  366|  29.6k|#define UA_DATETIME_LENGTH 40
  ------------------
  |  Branch (374:12): [True: 0, False: 29.6k]
  ------------------
  375|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  376|  29.6k|        pos = (char*)output->data;
  377|  29.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|  29.6k|    UA_DateTimeStruct tSt = UA_DateTime_toStruct(dt);
  382|  29.6k|    pos += printNum(tSt.year, pos, 4);
  383|  29.6k|    *(pos++) = '-';
  384|  29.6k|    pos += printNum(tSt.month, pos, 2);
  385|  29.6k|    *(pos++) = '-';
  386|  29.6k|    pos += printNum(tSt.day, pos, 2);
  387|  29.6k|    *(pos++) = 'T';
  388|  29.6k|    pos += printNum(tSt.hour, pos, 2);
  389|  29.6k|    *(pos++) = ':';
  390|  29.6k|    pos += printNum(tSt.min, pos, 2);
  391|  29.6k|    *(pos++) = ':';
  392|  29.6k|    pos += printNum(tSt.sec, pos, 2);
  393|  29.6k|    *(pos++) = '.';
  394|  29.6k|    pos += printNum(tSt.milliSec, pos, 3);
  395|  29.6k|    pos += printNum(tSt.microSec, pos, 3);
  396|  29.6k|    pos += printNum(tSt.nanoSec, pos, 3);
  397|       |
  398|       |    /* Remove trailing zeros */
  399|  29.6k|    pos--;
  400|   286k|    while(*pos == '0')
  ------------------
  |  Branch (400:11): [True: 256k, False: 29.6k]
  ------------------
  401|   256k|        pos--;
  402|  29.6k|    if(*pos == '.')
  ------------------
  |  Branch (402:8): [True: 27.5k, False: 2.13k]
  ------------------
  403|  27.5k|        pos--;
  404|       |
  405|  29.6k|    pos++;
  406|  29.6k|    *(pos++) = 'Z';
  407|       |
  408|  29.6k|    if(output->length > 0) {
  ------------------
  |  Branch (408:8): [True: 29.6k, False: 0]
  ------------------
  409|  29.6k|        output->length = (size_t)(pos - (char*)output->data);
  410|  29.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|  29.6k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  29.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  416|  29.6k|}
UA_String_unescape:
  810|  88.0k|UA_String_unescape(UA_String *str, UA_Boolean copyEscape, UA_Escaping esc) {
  811|  88.0k|    if(esc == UA_ESCAPING_NONE)
  ------------------
  |  Branch (811:8): [True: 88.0k, False: 0]
  ------------------
  812|  88.0k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  88.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  813|       |
  814|       |    /* Does the string need escaping? */
  815|      0|    UA_String tmp;
  816|      0|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  817|      0|    u8 *pos = str->data;
  818|      0|    u8 *end = str->data + str->length;
  819|      0|    u8 escape_char = (esc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (819:23): [True: 0, False: 0]
  ------------------
  820|      0|                      esc == UA_ESCAPING_PERCENT_EXTENDED) ? '%' : '&';
  ------------------
  |  Branch (820:23): [True: 0, False: 0]
  ------------------
  821|      0|    for(; pos < end; pos++) {
  ------------------
  |  Branch (821:11): [True: 0, False: 0]
  ------------------
  822|      0|        if(*pos == escape_char)
  ------------------
  |  Branch (822:12): [True: 0, False: 0]
  ------------------
  823|      0|            goto escape;
  824|      0|    }
  825|       |
  826|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  827|       |
  828|      0| escape:
  829|      0|    if(copyEscape) {
  ------------------
  |  Branch (829:8): [True: 0, False: 0]
  ------------------
  830|      0|        res = UA_String_copy(str, &tmp);
  831|      0|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (831:12): [True: 0, False: 0]
  ------------------
  832|      0|            return res;
  833|      0|        pos = tmp.data;
  834|      0|        end = tmp.data + tmp.length;
  835|      0|    }
  836|       |
  837|      0|    u8 byte = 0;
  838|      0|    u8 *writepos = pos;
  839|       |
  840|      0|    res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  841|      0|    if(esc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (841:8): [True: 0, False: 0]
  ------------------
  842|      0|       esc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (842:8): [True: 0, False: 0]
  ------------------
  843|       |        /* Percent-Escaping */
  844|      0|        for(; pos < end; pos++) {
  ------------------
  |  Branch (844:15): [True: 0, False: 0]
  ------------------
  845|      0|            if(*pos == '%') {
  ------------------
  |  Branch (845:16): [True: 0, False: 0]
  ------------------
  846|      0|                if(pos + 2 >= end || !isHex(pos[1]) || !isHex(pos[2]))
  ------------------
  |  Branch (846:20): [True: 0, False: 0]
  |  Branch (846:38): [True: 0, False: 0]
  |  Branch (846:56): [True: 0, False: 0]
  ------------------
  847|      0|                    goto out;
  848|      0|                if(pos[1] >= 'a')
  ------------------
  |  Branch (848:20): [True: 0, False: 0]
  ------------------
  849|      0|                    byte = pos[1] - ('a' - 10);
  850|      0|                else if(pos[1] >= 'A')
  ------------------
  |  Branch (850:25): [True: 0, False: 0]
  ------------------
  851|      0|                    byte = pos[1] - ('A' - 10);
  852|      0|                else
  853|      0|                    byte = pos[1] - '0';
  854|      0|                byte <<= 4;
  855|       |
  856|      0|                if(pos[2] >= 'a')
  ------------------
  |  Branch (856:20): [True: 0, False: 0]
  ------------------
  857|      0|                    byte += (u8)(pos[2] - ('a' - 10));
  858|      0|                else if(pos[2] >= 'A')
  ------------------
  |  Branch (858:25): [True: 0, False: 0]
  ------------------
  859|      0|                    byte += (u8)(pos[2] - ('A' - 10));
  860|      0|                else
  861|      0|                    byte += (u8)(pos[2] - '0');
  862|       |
  863|      0|                pos += 2;
  864|      0|                *writepos++ = byte;
  865|      0|                continue;
  866|      0|            }
  867|      0|            *writepos++ = *pos;
  868|      0|        }
  869|      0|    } else {
  870|       |        /* And-Escaping */
  871|      0|        for(; pos < end; pos++) {
  ------------------
  |  Branch (871:15): [True: 0, False: 0]
  ------------------
  872|      0|            if(*pos == '&') {
  ------------------
  |  Branch (872:16): [True: 0, False: 0]
  ------------------
  873|      0|                pos++;
  874|      0|                if(pos == end)
  ------------------
  |  Branch (874:20): [True: 0, False: 0]
  ------------------
  875|      0|                    goto out;
  876|      0|            }
  877|      0|            *writepos++ = *pos;
  878|      0|        }
  879|      0|    }
  880|      0|    res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  881|       |
  882|      0| out:
  883|      0|    if(copyEscape) {
  ------------------
  |  Branch (883:8): [True: 0, False: 0]
  ------------------
  884|      0|        tmp.length = (size_t)(writepos - tmp.data);
  885|      0|        if(tmp.length == 0)
  ------------------
  |  Branch (885:12): [True: 0, False: 0]
  ------------------
  886|      0|            UA_String_clear(&tmp);
  887|      0|        if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (887:12): [True: 0, False: 0]
  ------------------
  888|      0|            *str = tmp;
  889|      0|        else
  890|      0|            UA_String_clear(&tmp);
  891|      0|    } else if(res == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (891:15): [True: 0, False: 0]
  ------------------
  892|      0|        str->length = (size_t)(writepos - str->data);
  893|      0|    }
  894|      0|    return res;
  895|      0|}
UA_String_escapedSize:
  901|  23.0k|UA_String_escapedSize(const UA_String s, UA_Escaping esc) {
  902|       |    /* Find out the overhead from escaping */
  903|  23.0k|    size_t overhead = 0;
  904|  18.2M|    for(size_t j = 0; j < s.length; j++) {
  ------------------
  |  Branch (904:23): [True: 18.2M, False: 23.0k]
  ------------------
  905|  18.2M|        if(esc == UA_ESCAPING_AND_EXTENDED)
  ------------------
  |  Branch (905:12): [True: 0, False: 18.2M]
  ------------------
  906|      0|            overhead += isReservedAndExtended(s.data[j]);
  907|  18.2M|        else if(esc == UA_ESCAPING_AND)
  ------------------
  |  Branch (907:17): [True: 0, False: 18.2M]
  ------------------
  908|      0|            overhead += isReservedAnd(s.data[j]);
  909|  18.2M|        else if(esc == UA_ESCAPING_PERCENT)
  ------------------
  |  Branch (909:17): [True: 2.37M, False: 15.8M]
  ------------------
  910|  2.37M|            overhead += (isReservedPercent(s.data[j]) ? 2 : 0);
  ------------------
  |  Branch (910:26): [True: 0, False: 2.37M]
  ------------------
  911|  15.8M|        else /* if(esc == UA_ESCAPING_PERCENT_EXTENDED) */
  912|  15.8M|            overhead += (isReservedPercentExtended(s.data[j]) ? 2 : 0);
  ------------------
  |  Branch (912:26): [True: 4.64M, False: 11.1M]
  ------------------
  913|  18.2M|    }
  914|       |
  915|  23.0k|    return s.length + overhead;
  916|  23.0k|}
UA_String_escapeInsert:
  919|  23.0k|UA_String_escapeInsert(u8 *pos, const UA_String s2, UA_Escaping esc) {
  920|  23.0k|    u8 *begin = pos;
  921|       |
  922|  23.0k|    if(esc == UA_ESCAPING_NONE) {
  ------------------
  |  Branch (922:8): [True: 22.4k, False: 669]
  ------------------
  923|  15.8M|        for(size_t j = 0; j < s2.length; j++)
  ------------------
  |  Branch (923:27): [True: 15.8M, False: 22.4k]
  ------------------
  924|  15.8M|            *pos++ = s2.data[j];
  925|  22.4k|    } else if(esc == UA_ESCAPING_PERCENT || esc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (925:15): [True: 669, False: 0]
  |  Branch (925:45): [True: 0, False: 0]
  ------------------
  926|  2.37M|        for(size_t j = 0; j < s2.length; j++) {
  ------------------
  |  Branch (926:27): [True: 2.37M, False: 669]
  ------------------
  927|  2.37M|            UA_Boolean reserved = (esc == UA_ESCAPING_PERCENT_EXTENDED) ?
  ------------------
  |  Branch (927:35): [True: 0, False: 2.37M]
  ------------------
  928|  2.37M|                isReservedPercentExtended(s2.data[j]) : isReservedPercent(s2.data[j]);
  929|  2.37M|            if(UA_LIKELY(!reserved)) {
  ------------------
  |  |  590|  2.37M|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (590:23): [True: 2.37M, False: 0]
  |  |  ------------------
  ------------------
  930|  2.37M|                *pos++ = s2.data[j];
  931|  2.37M|            } else {
  932|      0|                *pos++ = '%';
  933|      0|                *pos++ = hexchars[s2.data[j] >> 4];
  934|      0|                *pos++ = hexchars[s2.data[j] & 0x0f];
  935|      0|            }
  936|  2.37M|        }
  937|    669|    } else {
  938|      0|        for(size_t j = 0; j < s2.length; j++) {
  ------------------
  |  Branch (938:27): [True: 0, False: 0]
  ------------------
  939|      0|            UA_Boolean reserved = (esc == UA_ESCAPING_AND_EXTENDED) ?
  ------------------
  |  Branch (939:35): [True: 0, False: 0]
  ------------------
  940|      0|                isReservedAndExtended(s2.data[j]) : isReservedAnd(s2.data[j]);
  941|      0|            if(reserved)
  ------------------
  |  Branch (941:16): [True: 0, False: 0]
  ------------------
  942|      0|                *pos++ = '&';
  943|      0|            *pos++ = s2.data[j];
  944|      0|        }
  945|      0|    }
  946|       |
  947|  23.0k|    return (size_t)(pos - begin);
  948|  23.0k|}
ua_util.c:printNum:
  344|   267k|printNum(i32 n, char *pos, u8 min_digits) {
  345|   267k|    char digits[10];
  346|   267k|    u8 len = 0;
  347|       |    /* Handle negative values */
  348|   267k|    if(n < 0) {
  ------------------
  |  Branch (348:8): [True: 6.09k, False: 260k]
  ------------------
  349|  6.09k|        pos[len++] = '-';
  350|  6.09k|        n = -n;
  351|  6.09k|    }
  352|       |
  353|       |    /* Extract the digits */
  354|   267k|    u8 i = 0;
  355|   950k|    for(; i < min_digits || n > 0; i++) {
  ------------------
  |  Branch (355:11): [True: 682k, False: 267k]
  |  Branch (355:29): [True: 645, False: 267k]
  ------------------
  356|   683k|        digits[i] = (char)((n % 10) + '0');
  357|   683k|        n /= 10;
  358|   683k|    }
  359|       |
  360|       |    /* Print in reverse order and return */
  361|   950k|    for(; i > 0; i--)
  ------------------
  |  Branch (361:11): [True: 683k, False: 267k]
  ------------------
  362|   683k|        pos[len++] = digits[i-1];
  363|   267k|    return len;
  364|   267k|}

ua_util.c:isReservedPercent:
   95|  20.5M|isReservedPercent(u8 c) {
   96|  20.5M|    return (c == ';'  || c == '%' || c <= ' ' || c == 127);
  ------------------
  |  Branch (96:13): [True: 1.89k, False: 20.5M]
  |  Branch (96:26): [True: 4.82k, False: 20.5M]
  |  Branch (96:38): [True: 112k, False: 20.4M]
  |  Branch (96:50): [True: 543, False: 20.4M]
  ------------------
   97|  20.5M|}
ua_util.c:isReservedPercentExtended:
  100|  15.8M|isReservedPercentExtended(u8 c) {
  101|  15.8M|    return (isReservedPercent(c) || c == ':' || c == '#' || c == '[' || c == ']' ||
  ------------------
  |  Branch (101:13): [True: 119k, False: 15.7M]
  |  Branch (101:37): [True: 7.68k, False: 15.7M]
  |  Branch (101:49): [True: 6.23k, False: 15.7M]
  |  Branch (101:61): [True: 5.64k, False: 15.7M]
  |  Branch (101:73): [True: 3.35k, False: 15.7M]
  ------------------
  102|  15.7M|            c == '&' || c == '(' || c == ')' || c == ',' || c == '<' || c == '>' ||
  ------------------
  |  Branch (102:13): [True: 1.97k, False: 15.7M]
  |  Branch (102:25): [True: 98.2k, False: 15.6M]
  |  Branch (102:37): [True: 8.78k, False: 15.5M]
  |  Branch (102:49): [True: 4.22M, False: 11.3M]
  |  Branch (102:61): [True: 2.86k, False: 11.3M]
  |  Branch (102:73): [True: 7.62k, False: 11.3M]
  ------------------
  103|  11.3M|            c == '`' || c == '/' || c == '\\' || c == '"' || c == '\'' );
  ------------------
  |  Branch (103:13): [True: 3.23k, False: 11.3M]
  |  Branch (103:25): [True: 19.2k, False: 11.3M]
  |  Branch (103:37): [True: 3.84k, False: 11.3M]
  |  Branch (103:50): [True: 136k, False: 11.1M]
  |  Branch (103:62): [True: 9, False: 11.1M]
  ------------------
  104|  15.8M|}
ua_types_encoding_json.c:isTrue:
  167|  99.6k|isTrue(uint8_t expr) {
  168|  99.6k|    return expr;
  169|  99.6k|}

LLVMFuzzerTestOneInput:
   13|  3.08k|LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
   14|  3.08k|    UA_ByteString buf;
   15|  3.08k|    buf.data = (UA_Byte*)data;
   16|  3.08k|    buf.length = size;
   17|       |
   18|  3.08k|    UA_Variant value;
   19|  3.08k|    UA_Variant_init(&value);
   20|       |
   21|  3.08k|    UA_StatusCode retval = UA_decodeJson(&buf, &value, &UA_TYPES[UA_TYPES_VARIANT], NULL);
  ------------------
  |  |  803|  3.08k|#define UA_TYPES_VARIANT 23
  ------------------
   22|  3.08k|    if(retval != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  3.08k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (22:8): [True: 1.08k, False: 2.00k]
  ------------------
   23|  1.08k|        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);
  ------------------
  |  |  411|  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);
  ------------------
  |  |  411|  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);
  ------------------
  |  |  411|  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);
  ------------------
  |  |  411|  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);
  ------------------
  |  |  411|  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);
  ------------------
  |  |  411|  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:
  222|  5.08k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_json_decode_encode.cc:_ZL16UA_Variant_clearP10UA_Variant:
  222|  4.00k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_json_decode_encode.cc:_ZL19UA_ByteString_clearP9UA_String:
  222|  4.00k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_String_clear:
  222|  7.80k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_ByteString_init:
  222|   124k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_String_copy:
  222|  88.6k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_NodeId_clear:
  222|     95|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_ExpandedNodeId_clear:
  222|     98|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_QualifiedName_init:
  222|  73.0k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_clear:
  222|   226k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_init:
  222|     90|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_init:
  222|  98.4k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_init:
  222|    386|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_clear:
  222|     62|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_new:
  222|    392|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_clear:
  222|     90|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl

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

