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

cj5_parse:
  305|  5.83k|          cj5_options *options) {
  306|  5.83k|    cj5_result r;
  307|  5.83k|    cj5__parser parser;
  308|  5.83k|    memset(&parser, 0x0, sizeof(parser));
  309|  5.83k|    parser.curr_tok_idx = 0;
  310|  5.83k|    parser.json5 = json5;
  311|  5.83k|    parser.len = len;
  312|  5.83k|    parser.tokens = tokens;
  313|  5.83k|    parser.max_tokens = max_tokens;
  314|       |
  315|  5.83k|    if(options)
  ------------------
  |  Branch (315:8): [True: 5.83k, False: 0]
  ------------------
  316|  5.83k|        parser.stop_early = options->stop_early;
  317|       |
  318|  5.83k|    unsigned short depth = 0; // Nesting depth zero means "outside the root object"
  319|  5.83k|    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.83k|    char next[CJ5_MAX_NESTING];    // Next content to parse: 'k' (key), ':', 'v'
  323|       |                                   // (value) or ',' (comma).
  324|  5.83k|    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.83k|    nesting[0] = 0; // Becomes '{' if there is a virtual root object
  329|       |
  330|  5.83k|    cj5_token *token = NULL; // The current token
  331|       |
  332|  6.78k| start_parsing:
  333|  74.2M|    for(; parser.pos < len; parser.pos++) {
  ------------------
  |  Branch (333:11): [True: 74.2M, False: 5.73k]
  ------------------
  334|  74.2M|        char c = json5[parser.pos];
  335|  74.2M|        switch(c) {
  336|  28.9k|        case '\n': // Skip newline and whitespace
  ------------------
  |  Branch (336:9): [True: 28.9k, False: 74.2M]
  ------------------
  337|  29.2k|        case '\r':
  ------------------
  |  Branch (337:9): [True: 320, False: 74.2M]
  ------------------
  338|  29.4k|        case '\t':
  ------------------
  |  Branch (338:9): [True: 152, False: 74.2M]
  ------------------
  339|  29.8k|        case ' ':
  ------------------
  |  Branch (339:9): [True: 375, False: 74.2M]
  ------------------
  340|  29.8k|            break;
  341|       |
  342|    138|        case '#': // Skip comment
  ------------------
  |  Branch (342:9): [True: 138, False: 74.2M]
  ------------------
  343|  13.2k|        case '/':
  ------------------
  |  Branch (343:9): [True: 13.1k, False: 74.2M]
  ------------------
  344|  13.2k|            cj5__skip_comment(&parser);
  345|  13.2k|            if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (345:16): [True: 10.4k, False: 2.75k]
  ------------------
  346|  10.4k|               parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (346:16): [True: 41, False: 10.4k]
  ------------------
  347|     41|                goto finish;
  348|  13.2k|            break;
  349|       |
  350|  3.95M|        case '{': // Open an object or array
  ------------------
  |  Branch (350:9): [True: 3.95M, False: 70.2M]
  ------------------
  351|  3.99M|        case '[':
  ------------------
  |  Branch (351:9): [True: 36.4k, False: 74.2M]
  ------------------
  352|       |            // Check the nesting depth
  353|  3.99M|            if(depth + 1 >= CJ5_MAX_NESTING) {
  ------------------
  |  |   52|  3.99M|#define CJ5_MAX_NESTING 32
  ------------------
  |  Branch (353:16): [True: 1, False: 3.99M]
  ------------------
  354|      1|                parser.error = CJ5_ERROR_INVALID;
  355|      1|                goto finish;
  356|      1|            }
  357|       |
  358|       |            // Correct next?
  359|  3.99M|            if(next[depth] != 'v') {
  ------------------
  |  Branch (359:16): [True: 10, False: 3.99M]
  ------------------
  360|     10|                parser.error = CJ5_ERROR_INVALID;
  361|     10|                goto finish;
  362|     10|            }
  363|       |
  364|  3.99M|            depth++; // Increase the nesting depth
  365|  3.99M|            nesting[depth] = c; // Set the nesting type
  366|  3.99M|            next[depth] = (c == '{') ? 'k' : 'v'; // next is either a key or a value
  ------------------
  |  Branch (366:27): [True: 3.95M, False: 36.3k]
  ------------------
  367|       |
  368|       |            // Create a token for the object or array
  369|  3.99M|            token = cj5__alloc_token(&parser);
  370|  3.99M|            if(token) {
  ------------------
  |  Branch (370:16): [True: 2.05M, False: 1.93M]
  ------------------
  371|  2.05M|                token->parent_id = parser.curr_tok_idx;
  372|  2.05M|                token->type = (c == '{') ? CJ5_TOKEN_OBJECT : CJ5_TOKEN_ARRAY;
  ------------------
  |  Branch (372:31): [True: 2.03M, False: 22.2k]
  ------------------
  373|  2.05M|                token->start = parser.pos;
  374|  2.05M|                token->size = 0;
  375|  2.05M|                parser.curr_tok_idx = parser.token_count - 1; // The new curr_tok_idx
  376|       |                                                              // is for this token
  377|  2.05M|            }
  378|  3.99M|            break;
  379|       |
  380|  3.95M|        case '}': // Close an object or array
  ------------------
  |  Branch (380:9): [True: 3.95M, False: 70.2M]
  ------------------
  381|  3.99M|        case ']':
  ------------------
  |  Branch (381:9): [True: 36.1k, False: 74.2M]
  ------------------
  382|       |            // Check the nesting depth. Note that a "virtual root object" at
  383|       |            // depth zero must not be closed.
  384|  3.99M|            if(depth == 0) {
  ------------------
  |  Branch (384:16): [True: 6, False: 3.99M]
  ------------------
  385|      6|                parser.error = CJ5_ERROR_INVALID;
  386|      6|                goto finish;
  387|      6|            }
  388|       |
  389|       |            // Check and adjust the nesting. Note that ']' - '[' == 2 and '}' -
  390|       |            // '{' == 2. Arrays can always be closed. Objects can only close
  391|       |            // when a key or a comma is expected.
  392|  3.99M|            if(c - nesting[depth] != 2 ||
  ------------------
  |  Branch (392:16): [True: 0, False: 3.99M]
  ------------------
  393|  3.99M|               (c == '}' && next[depth] != 'k' && next[depth] != ',')) {
  ------------------
  |  Branch (393:17): [True: 3.95M, False: 36.1k]
  |  Branch (393:29): [True: 1.85M, False: 2.10M]
  |  Branch (393:51): [True: 2, False: 1.85M]
  ------------------
  394|      2|                parser.error = CJ5_ERROR_INVALID;
  395|      2|                goto finish;
  396|      2|            }
  397|       |
  398|  3.99M|            if(token) {
  ------------------
  |  Branch (398:16): [True: 2.05M, False: 1.94M]
  ------------------
  399|       |                // Finalize the current token
  400|  2.05M|                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.05M|                if(parser.curr_tok_idx != token->parent_id) {
  ------------------
  |  Branch (405:20): [True: 2.04M, False: 4.45k]
  ------------------
  406|  2.04M|                    parser.curr_tok_idx = token->parent_id;
  407|  2.04M|                    token = &tokens[token->parent_id];
  408|  2.04M|                    token->size++;
  409|  2.04M|                }
  410|  2.05M|            }
  411|       |
  412|       |            // Step one level up
  413|  3.99M|            depth--;
  414|  3.99M|            next[depth] = (depth == 0) ? 0 : ','; // zero if we step out the root
  ------------------
  |  Branch (414:27): [True: 4.83k, False: 3.98M]
  ------------------
  415|       |                                                  // object. then we do not look for
  416|       |                                                  // another element.
  417|       |
  418|       |            // The first element was successfully parsed. Stop early or try to
  419|       |            // parse the full input string?
  420|  3.99M|            if(depth == 0 && parser.stop_early)
  ------------------
  |  Branch (420:16): [True: 4.83k, False: 3.98M]
  |  Branch (420:30): [True: 0, False: 4.83k]
  ------------------
  421|      0|                goto finish;
  422|       |
  423|  3.99M|            break;
  424|       |
  425|  3.99M|        case ':': // Colon (between key and value)
  ------------------
  |  Branch (425:9): [True: 3.78M, False: 70.4M]
  ------------------
  426|  3.78M|            if(next[depth] != ':') {
  ------------------
  |  Branch (426:16): [True: 901, False: 3.78M]
  ------------------
  427|    901|                parser.error = CJ5_ERROR_INVALID;
  428|    901|                goto finish;
  429|    901|            }
  430|  3.78M|            next[depth] = 'v';
  431|  3.78M|            break;
  432|       |
  433|  30.3M|        case ',': // Comma
  ------------------
  |  Branch (433:9): [True: 30.3M, False: 43.8M]
  ------------------
  434|  30.3M|            if(next[depth] != ',') {
  ------------------
  |  Branch (434:16): [True: 10, False: 30.3M]
  ------------------
  435|     10|                parser.error = CJ5_ERROR_INVALID;
  436|     10|                goto finish;
  437|     10|            }
  438|  30.3M|            next[depth] = (nesting[depth] == '{') ? 'k' : 'v';
  ------------------
  |  Branch (438:27): [True: 1.93M, False: 28.4M]
  ------------------
  439|  30.3M|            break;
  440|       |
  441|  32.0M|        default: // Value or key
  ------------------
  |  Branch (441:9): [True: 32.0M, False: 42.1M]
  ------------------
  442|  32.0M|            if(next[depth] == 'v') {
  ------------------
  |  Branch (442:16): [True: 28.2M, False: 3.78M]
  ------------------
  443|  28.2M|                cj5__parse_primitive(&parser); // Parse primitive value
  444|  28.2M|                if(nesting[depth] != 0) {
  ------------------
  |  Branch (444:20): [True: 28.2M, False: 943]
  ------------------
  445|       |                    // Parent is object or array
  446|  28.2M|                    if(token)
  ------------------
  |  Branch (446:24): [True: 26.3M, False: 1.89M]
  ------------------
  447|  26.3M|                        token->size++;
  448|  28.2M|                    next[depth] = ',';
  449|  28.2M|                } else {
  450|       |                    // The current value was the root element. Don't look for
  451|       |                    // any next element.
  452|    943|                    next[depth] = 0;
  453|       |
  454|       |                    // The first element was successfully parsed. Stop early or try to
  455|       |                    // parse the full input string?
  456|    943|                    if(parser.stop_early)
  ------------------
  |  Branch (456:24): [True: 0, False: 943]
  ------------------
  457|      0|                        goto finish;
  458|    943|                }
  459|  28.2M|            } else if(next[depth] == 'k') {
  ------------------
  |  Branch (459:23): [True: 3.78M, False: 44]
  ------------------
  460|  3.78M|                cj5__parse_key(&parser);
  461|  3.78M|                if(token)
  ------------------
  |  Branch (461:20): [True: 1.96M, False: 1.82M]
  ------------------
  462|  1.96M|                    token->size++; // Keys count towards the length
  463|  3.78M|                next[depth] = ':';
  464|  3.78M|            } else {
  465|     44|                parser.error = CJ5_ERROR_INVALID;
  466|     44|            }
  467|       |
  468|  32.0M|            if(parser.error && parser.error != CJ5_ERROR_OVERFLOW)
  ------------------
  |  Branch (468:16): [True: 16.0M, False: 15.9M]
  |  Branch (468:32): [True: 73, False: 16.0M]
  ------------------
  469|     73|                goto finish;
  470|       |
  471|  32.0M|            break;
  472|  74.2M|        }
  473|  74.2M|    }
  474|       |
  475|       |    // Are we back to the initial nesting depth?
  476|  5.73k|    if(depth != 0) {
  ------------------
  |  Branch (476:8): [True: 25, False: 5.71k]
  ------------------
  477|     25|        parser.error = CJ5_ERROR_INCOMPLETE;
  478|     25|        goto finish;
  479|     25|    }
  480|       |
  481|       |    // Close the virtual root object if there is one
  482|  5.71k|    if(nesting[0] == '{' && parser.error != CJ5_ERROR_OVERFLOW) {
  ------------------
  |  Branch (482:8): [True: 872, False: 4.84k]
  |  Branch (482:29): [True: 860, False: 12]
  ------------------
  483|       |        // Check the we end after a complete key-value pair (or dangling comma)
  484|    860|        if(next[0] != 'k' && next[0] != ',')
  ------------------
  |  Branch (484:12): [True: 855, False: 5]
  |  Branch (484:30): [True: 18, False: 837]
  ------------------
  485|     18|            parser.error = CJ5_ERROR_INVALID;
  486|    860|        tokens[0].end = parser.pos - 1;
  487|    860|    }
  488|       |
  489|  6.78k| finish:
  490|       |    // If parsing failed at the initial nesting depth, create a virtual root object
  491|       |    // and restart parsing.
  492|  6.78k|    if(parser.error != CJ5_ERROR_NONE &&
  ------------------
  |  Branch (492:8): [True: 1.82k, False: 4.96k]
  ------------------
  493|  1.82k|       parser.error != CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (493:8): [True: 1.08k, False: 735]
  ------------------
  494|  1.08k|       depth == 0 && nesting[0] != '{') {
  ------------------
  |  Branch (494:8): [True: 1.01k, False: 69]
  |  Branch (494:22): [True: 949, False: 69]
  ------------------
  495|    949|        parser.token_count = 0;
  496|    949|        token = cj5__alloc_token(&parser);
  497|    949|        if(token) {
  ------------------
  |  Branch (497:12): [True: 949, False: 0]
  ------------------
  498|    949|            token->parent_id = 0;
  499|    949|            token->type = CJ5_TOKEN_OBJECT;
  500|    949|            token->start = 0;
  501|    949|            token->size = 0;
  502|       |
  503|    949|            nesting[0] = '{';
  504|    949|            next[0] = 'k';
  505|       |
  506|    949|            parser.curr_tok_idx = 0;
  507|    949|            parser.pos = 0;
  508|    949|            parser.error = CJ5_ERROR_NONE;
  509|    949|            goto start_parsing;
  510|    949|        }
  511|    949|    }
  512|       |
  513|  5.83k|    memset(&r, 0x0, sizeof(r));
  514|  5.83k|    r.error = parser.error;
  515|  5.83k|    r.error_pos = parser.pos;
  516|  5.83k|    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.83k|    if(r.num_tokens == 0)
  ------------------
  |  Branch (520:8): [True: 2, False: 5.83k]
  ------------------
  521|      2|        r.error = CJ5_ERROR_INCOMPLETE;
  522|       |
  523|       |    // Set the tokens and original string only if successfully parsed
  524|  5.83k|    if(r.error == CJ5_ERROR_NONE) {
  ------------------
  |  Branch (524:8): [True: 4.95k, False: 875]
  ------------------
  525|  4.95k|        r.tokens = tokens;
  526|  4.95k|        r.json5 = json5;
  527|  4.95k|    }
  528|       |
  529|  5.83k|    return r;
  530|  6.78k|}
cj5_get_str:
  628|   192k|            char *buf, unsigned int *buflen) {
  629|   192k|    const cj5_token *token = &r->tokens[tok_index];
  630|   192k|    if(token->type != CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (630:8): [True: 0, False: 192k]
  ------------------
  631|      0|        buf[0] = 0;
  632|      0|        if(buflen)
  ------------------
  |  Branch (632:12): [True: 0, False: 0]
  ------------------
  633|      0|            *buflen = 0;
  634|      0|        return CJ5_ERROR_INVALID;
  635|      0|    }
  636|       |
  637|   192k|    const char *pos = &r->json5[token->start];
  638|   192k|    const char *end = &r->json5[token->end + 1];
  639|   192k|    unsigned int outpos = 0;
  640|   192k|    cj5_error_code error = CJ5_ERROR_NONE;
  641|  27.5M|    for(; pos < end; pos++) {
  ------------------
  |  Branch (641:11): [True: 27.3M, False: 192k]
  ------------------
  642|  27.3M|        uint8_t c = (uint8_t)*pos;
  643|       |        // Unprintable ascii characters must be escaped
  644|  27.3M|        if(c < ' ' || c == 127) {
  ------------------
  |  Branch (644:12): [True: 11, False: 27.3M]
  |  Branch (644:23): [True: 2, False: 27.3M]
  ------------------
  645|     13|            error = CJ5_ERROR_INVALID;
  646|     13|            goto done;
  647|     13|        }
  648|       |
  649|       |        // Unescaped Ascii character or utf8 byte
  650|  27.3M|        if(c != '\\') {
  ------------------
  |  Branch (650:12): [True: 22.6M, False: 4.66M]
  ------------------
  651|  22.6M|            buf[outpos++] = (char)c;
  652|  22.6M|            continue;
  653|  22.6M|        }
  654|       |
  655|       |        // End of input before the escaped character
  656|  4.66M|        if(pos + 1 >= end) {
  ------------------
  |  Branch (656:12): [True: 0, False: 4.66M]
  ------------------
  657|      0|            error = CJ5_ERROR_INCOMPLETE;
  658|      0|            goto done;
  659|      0|        }
  660|       |
  661|       |        // Process escaped character
  662|  4.66M|        pos++;
  663|  4.66M|        c = (uint8_t)*pos;
  664|  4.66M|        switch(c) {
  665|    273|        case 'b': buf[outpos++] = '\b'; break;
  ------------------
  |  Branch (665:9): [True: 273, False: 4.66M]
  ------------------
  666|  8.02k|        case 'f': buf[outpos++] = '\f'; break;
  ------------------
  |  Branch (666:9): [True: 8.02k, False: 4.66M]
  ------------------
  667|    239|        case 'r': buf[outpos++] = '\r'; break;
  ------------------
  |  Branch (667:9): [True: 239, False: 4.66M]
  ------------------
  668|  86.3k|        case 'n': buf[outpos++] = '\n'; break;
  ------------------
  |  Branch (668:9): [True: 86.3k, False: 4.58M]
  ------------------
  669|    189|        case 't': buf[outpos++] = '\t'; break;
  ------------------
  |  Branch (669:9): [True: 189, False: 4.66M]
  ------------------
  670|  3.56M|        default:  buf[outpos++] = (char)c; break;
  ------------------
  |  Branch (670:9): [True: 3.56M, False: 1.10M]
  ------------------
  671|  1.00M|        case 'u': {
  ------------------
  |  Branch (671:9): [True: 1.00M, False: 3.66M]
  ------------------
  672|       |            // Parse a unicode code point
  673|  1.00M|            if(pos + 4 >= end) {
  ------------------
  |  Branch (673:16): [True: 7, False: 1.00M]
  ------------------
  674|      7|                error = CJ5_ERROR_INCOMPLETE;
  675|      7|                goto done;
  676|      7|            }
  677|  1.00M|            pos++;
  678|  1.00M|            uint32_t utf;
  679|  1.00M|            error = parse_codepoint(pos, &utf);
  680|  1.00M|            if(error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (680:16): [True: 5, False: 1.00M]
  ------------------
  681|      5|                goto done;
  682|  1.00M|            pos += 3;
  683|       |
  684|       |            // Parse a surrogate pair
  685|  1.00M|            if(0xd800 <= utf && utf <= 0xdfff) {
  ------------------
  |  Branch (685:16): [True: 775, False: 1.00M]
  |  Branch (685:33): [True: 580, False: 195]
  ------------------
  686|    580|                if(pos + 6 >= end) {
  ------------------
  |  Branch (686:20): [True: 2, False: 578]
  ------------------
  687|      2|                    error = CJ5_ERROR_INVALID;
  688|      2|                    goto done;
  689|      2|                }
  690|    578|                if(pos[1] != '\\' && pos[2] != 'u') {
  ------------------
  |  Branch (690:20): [True: 243, False: 335]
  |  Branch (690:38): [True: 4, False: 239]
  ------------------
  691|      4|                    error = CJ5_ERROR_INVALID;
  692|      4|                    goto done;
  693|      4|                }
  694|    574|                pos += 3;
  695|    574|                uint32_t utf2;
  696|    574|                error = parse_codepoint(pos, &utf2);
  697|    574|                if(error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (697:20): [True: 4, False: 570]
  ------------------
  698|      4|                    goto done;
  699|    570|                pos += 3;
  700|       |                // High or low surrogate pair
  701|    570|                utf = (utf <= 0xdbff) ?
  ------------------
  |  Branch (701:23): [True: 259, False: 311]
  ------------------
  702|    259|                    (utf << 10) + utf2 + SURROGATE_OFFSET :
  703|    570|                    (utf2 << 10) + utf + SURROGATE_OFFSET;
  704|    570|            }
  705|       |
  706|       |            // Write the utf8 bytes of the code point
  707|  1.00M|            unsigned len = utf8_from_codepoint((unsigned char*)buf + outpos, utf);
  708|  1.00M|            if(len == 0) {
  ------------------
  |  Branch (708:16): [True: 10, False: 1.00M]
  ------------------
  709|     10|                error = CJ5_ERROR_INVALID; // Not a utf8 string
  710|     10|                goto done;
  711|     10|            }
  712|  1.00M|            outpos += len;
  713|  1.00M|            break;
  714|  1.00M|        }
  715|  4.66M|        }
  716|  4.66M|    }
  717|       |
  718|   192k| done:
  719|       |    // Always leave buf as a valid, NUL-terminated string, even when decoding
  720|       |    // fails midway. Callers still must check the returned error code.
  721|   192k|    buf[outpos] = 0;
  722|       |
  723|       |    // Set the output length
  724|   192k|    if(buflen)
  ------------------
  |  Branch (724:8): [True: 192k, False: 0]
  ------------------
  725|   192k|        *buflen = outpos;
  726|   192k|    return error;
  727|   192k|}
cj5.c:cj5__skip_comment:
  260|  13.2k|cj5__skip_comment(cj5__parser* parser) {
  261|  13.2k|    const char* json5 = parser->json5;
  262|       |
  263|       |    // Single-line comment
  264|  13.2k|    if(json5[parser->pos] == '#') {
  ------------------
  |  Branch (264:8): [True: 138, False: 13.1k]
  ------------------
  265|  12.7k|    skip_line:
  266|  4.17M|        while(parser->pos < parser->len) {
  ------------------
  |  Branch (266:15): [True: 4.17M, False: 60]
  ------------------
  267|  4.17M|            if(json5[parser->pos] == '\n') {
  ------------------
  |  Branch (267:16): [True: 12.6k, False: 4.16M]
  ------------------
  268|  12.6k|                parser->pos--; // Reparse the newline in the main parse loop
  269|  12.6k|                return;
  270|  12.6k|            }
  271|  4.16M|            parser->pos++;
  272|  4.16M|        }
  273|     60|        return;
  274|  12.7k|    }
  275|       |
  276|       |    // Comment begins with '/' but not enough space for another character
  277|  13.1k|    if(parser->pos + 1 >= parser->len) {
  ------------------
  |  Branch (277:8): [True: 12, False: 13.0k]
  ------------------
  278|     12|        parser->error = CJ5_ERROR_INVALID;
  279|     12|        return;
  280|     12|    }
  281|  13.0k|    parser->pos++;
  282|       |
  283|       |    // Comment begins with '//' -> single-line comment
  284|  13.0k|    if(json5[parser->pos] == '/')
  ------------------
  |  Branch (284:8): [True: 12.5k, False: 494]
  ------------------
  285|  12.5k|        goto skip_line;
  286|       |
  287|       |    // Multi-line comments begin with '/*' and end with '*/'
  288|    494|    if(json5[parser->pos] == '*') {
  ------------------
  |  Branch (288:8): [True: 483, False: 11]
  ------------------
  289|    483|        parser->pos++;
  290|  1.56M|        for(; parser->pos + 1 < parser->len; parser->pos++) {
  ------------------
  |  Branch (290:15): [True: 1.56M, False: 18]
  ------------------
  291|  1.56M|            if(json5[parser->pos] == '*' && json5[parser->pos + 1] == '/') {
  ------------------
  |  Branch (291:16): [True: 1.14k, False: 1.56M]
  |  Branch (291:45): [True: 465, False: 681]
  ------------------
  292|    465|                parser->pos++;
  293|    465|                return;
  294|    465|            }
  295|  1.56M|        }
  296|    483|    }
  297|       |
  298|       |    // Unknown comment type or the multi-line comment is not terminated
  299|     29|    parser->error = CJ5_ERROR_INCOMPLETE;
  300|     29|}
cj5.c:cj5__alloc_token:
   88|  36.0M|cj5__alloc_token(cj5__parser *parser) {
   89|  36.0M|    cj5_token* token = NULL;
   90|  36.0M|    if(parser->token_count < parser->max_tokens) {
  ------------------
  |  Branch (90:8): [True: 18.0M, False: 18.0M]
  ------------------
   91|  18.0M|        token = &parser->tokens[parser->token_count];
   92|  18.0M|        memset(token, 0x0, sizeof(cj5_token));
   93|  18.0M|    } else {
   94|  18.0M|        parser->error = CJ5_ERROR_OVERFLOW;
   95|  18.0M|    }
   96|       |
   97|       |    // Always increase the index. So we know eventually how many token would be
   98|       |    // required (if there are not enough).
   99|  36.0M|    parser->token_count++;
  100|  36.0M|    return token;
  101|  36.0M|}
cj5.c:cj5__parse_primitive:
  152|  28.2M|cj5__parse_primitive(cj5__parser* parser) {
  153|  28.2M|    const char* json5 = parser->json5;
  154|  28.2M|    unsigned int len = parser->len;
  155|  28.2M|    unsigned int start = parser->pos;
  156|       |
  157|       |    // String value
  158|  28.2M|    if(json5[start] == '\"' ||
  ------------------
  |  Branch (158:8): [True: 4.15M, False: 24.1M]
  ------------------
  159|  24.1M|       json5[start] == '\'') {
  ------------------
  |  Branch (159:8): [True: 280k, False: 23.8M]
  ------------------
  160|  4.44M|        cj5__parse_string(parser);
  161|  4.44M|        return;
  162|  4.44M|    }
  163|       |
  164|       |    // Fast comparison of bool, and null.
  165|       |    // Make the comparison case-insensitive.
  166|  23.8M|    uint32_t fourcc = 0;
  167|  23.8M|    if(start + 3 < len) {
  ------------------
  |  Branch (167:8): [True: 23.8M, False: 3.00k]
  ------------------
  168|  23.8M|        fourcc += (unsigned char)json5[start] | 32U;
  169|  23.8M|        fourcc += ((unsigned char)json5[start+1] | 32U) << 8;
  170|  23.8M|        fourcc += ((unsigned char)json5[start+2] | 32U) << 16;
  171|  23.8M|        fourcc += ((unsigned char)json5[start+3] | 32U) << 24;
  172|  23.8M|    }
  173|       |    
  174|  23.8M|    cj5_token_type type;
  175|  23.8M|    if(fourcc == CJ5__NULL_FOURCC) {
  ------------------
  |  Branch (175:8): [True: 3.37M, False: 20.4M]
  ------------------
  176|  3.37M|        type = CJ5_TOKEN_NULL;
  177|  3.37M|        parser->pos += 3;
  178|  20.4M|    } else if(fourcc == CJ5__TRUE_FOURCC) {
  ------------------
  |  Branch (178:15): [True: 518, False: 20.4M]
  ------------------
  179|    518|        type = CJ5_TOKEN_BOOL;
  180|    518|        parser->pos += 3;
  181|  20.4M|    } else if(fourcc == CJ5__FALSE_FOURCC) {
  ------------------
  |  Branch (181:15): [True: 5.82k, False: 20.4M]
  ------------------
  182|       |        // "false" has five characters
  183|  5.82k|        type = CJ5_TOKEN_BOOL;
  184|  5.82k|        if(start + 4 >= len || (json5[start+4] | 32) != 'e') {
  ------------------
  |  Branch (184:12): [True: 0, False: 5.82k]
  |  Branch (184:32): [True: 0, False: 5.82k]
  ------------------
  185|      0|            parser->error = CJ5_ERROR_INVALID;
  186|      0|            return;
  187|      0|        }
  188|  5.82k|        parser->pos += 4;
  189|  20.4M|    } else {
  190|       |        // Numbers are checked for basic compatibility.
  191|       |        // But they are fully parsed only in the cj5_get_XXX functions.
  192|  20.4M|        type = CJ5_TOKEN_NUMBER;
  193|  46.6M|        for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (193:15): [True: 46.6M, False: 837]
  ------------------
  194|  46.6M|            if(!cj5__isnum(json5[parser->pos]) &&
  ------------------
  |  |   85|  93.2M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  ------------------
  |  Branch (194:16): [True: 22.8M, False: 23.8M]
  ------------------
  195|  22.8M|               !(json5[parser->pos] == '.') &&
  ------------------
  |  Branch (195:16): [True: 22.0M, False: 794k]
  ------------------
  196|  22.0M|               !cj5__islowerchar(json5[parser->pos]) && 
  ------------------
  |  |   84|  68.6M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  ------------------
  |  Branch (196:16): [True: 20.4M, False: 1.53M]
  ------------------
  197|  20.4M|               !cj5__isupperchar(json5[parser->pos]) &&
  ------------------
  |  |   83|  67.0M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  ------------------
  |  Branch (197:16): [True: 20.4M, False: 15.4k]
  ------------------
  198|  20.4M|               !(json5[parser->pos] == '+') && !(json5[parser->pos] == '-')) {
  ------------------
  |  Branch (198:16): [True: 20.4M, False: 1.98k]
  |  Branch (198:48): [True: 20.4M, False: 14.5k]
  ------------------
  199|  20.4M|                break;
  200|  20.4M|            }
  201|  46.6M|        }
  202|  20.4M|        parser->pos--; // Point to the last character that is still inside the
  203|       |                       // primitive value
  204|  20.4M|    }
  205|       |
  206|  23.8M|    cj5_token *token = cj5__alloc_token(parser);
  207|  23.8M|    if(token) {
  ------------------
  |  Branch (207:8): [True: 11.7M, False: 12.0M]
  ------------------
  208|  11.7M|        token->type = type;
  209|  11.7M|        token->start = start;
  210|  11.7M|        token->end = parser->pos;
  211|  11.7M|        token->size = parser->pos - start + 1;
  212|  11.7M|        token->parent_id = parser->curr_tok_idx;
  213|  11.7M|    }
  214|  23.8M|}
cj5.c:cj5__parse_string:
  104|  7.97M|cj5__parse_string(cj5__parser *parser) {
  105|  7.97M|    const char *json5 = parser->json5;
  106|  7.97M|    unsigned int len = parser->len;
  107|  7.97M|    unsigned int start = parser->pos;
  108|  7.97M|    char str_open = json5[start];
  109|       |
  110|  7.97M|    parser->pos++;
  111|  84.0M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (111:11): [True: 84.0M, False: 22]
  ------------------
  112|  84.0M|        char c = json5[parser->pos];
  113|       |
  114|       |        // End of string
  115|  84.0M|        if(str_open == c) {
  ------------------
  |  Branch (115:12): [True: 7.97M, False: 76.1M]
  ------------------
  116|  7.97M|            cj5_token *token = cj5__alloc_token(parser);
  117|  7.97M|            if(token) {
  ------------------
  |  Branch (117:16): [True: 4.06M, False: 3.91M]
  ------------------
  118|  4.06M|                token->type = CJ5_TOKEN_STRING;
  119|  4.06M|                token->start = start + 1;
  120|  4.06M|                token->end = parser->pos - 1;
  121|  4.06M|                token->size = token->end - token->start + 1;
  122|  4.06M|                token->parent_id = parser->curr_tok_idx;
  123|  4.06M|            } 
  124|  7.97M|            return;
  125|  7.97M|        }
  126|       |
  127|       |        // Unescaped newlines are forbidden
  128|  76.1M|        if(c == '\n') {
  ------------------
  |  Branch (128:12): [True: 0, False: 76.1M]
  ------------------
  129|      0|            parser->error = CJ5_ERROR_INVALID;
  130|      0|            return;
  131|      0|        }
  132|       |
  133|       |        // Skip escape character
  134|  76.1M|        if(c == '\\') {
  ------------------
  |  Branch (134:12): [True: 6.43M, False: 69.6M]
  ------------------
  135|  6.43M|            if(parser->pos + 1 >= len) {
  ------------------
  |  Branch (135:16): [True: 0, False: 6.43M]
  ------------------
  136|      0|                parser->error = CJ5_ERROR_INCOMPLETE;
  137|      0|                return;
  138|      0|            }
  139|  6.43M|            parser->pos++;
  140|  6.43M|        }
  141|  76.1M|    }
  142|       |
  143|       |    // The file has ended before the string terminates
  144|     22|    parser->error = CJ5_ERROR_INCOMPLETE;
  145|     22|}
cj5.c:cj5__isrange:
   79|  98.7M|cj5__isrange(char ch, char from, char to) {
   80|  98.7M|    return (uint8_t)(ch - from) <= (uint8_t)(to - from);
   81|  98.7M|}
cj5.c:cj5__parse_key:
  217|  3.78M|cj5__parse_key(cj5__parser* parser) {
  218|  3.78M|    const char* json5 = parser->json5;
  219|  3.78M|    unsigned int start = parser->pos;
  220|  3.78M|    cj5_token* token;
  221|       |
  222|       |    // Key is a a normal string
  223|  3.78M|    if(json5[start] == '\"' || json5[start] == '\'') {
  ------------------
  |  Branch (223:8): [True: 3.53M, False: 249k]
  |  Branch (223:32): [True: 188, False: 249k]
  ------------------
  224|  3.53M|        cj5__parse_string(parser);
  225|  3.53M|        return;
  226|  3.53M|    }
  227|       |
  228|       |    // An unquoted key. Must start with a-ZA-Z_$. Can contain numbers later on.
  229|   249k|    unsigned int len = parser->len;
  230|  3.72M|    for(; parser->pos < len; parser->pos++) {
  ------------------
  |  Branch (230:11): [True: 3.72M, False: 32]
  ------------------
  231|  3.72M|        if(cj5__islowerchar(json5[parser->pos]) ||
  ------------------
  |  |   84|  7.45M|#define cj5__islowerchar(ch) cj5__isrange(ch, 'a', 'z')
  |  |  ------------------
  |  |  |  Branch (84:30): [True: 3.15M, False: 571k]
  |  |  ------------------
  ------------------
  232|   571k|           cj5__isupperchar(json5[parser->pos]) ||
  ------------------
  |  |   83|  4.29M|#define cj5__isupperchar(ch) cj5__isrange(ch, 'A', 'Z')
  |  |  ------------------
  |  |  |  Branch (83:30): [True: 307k, False: 264k]
  |  |  ------------------
  ------------------
  233|   264k|           json5[parser->pos] == '_' || json5[parser->pos] == '$')
  ------------------
  |  Branch (233:12): [True: 390, False: 264k]
  |  Branch (233:41): [True: 263, False: 263k]
  ------------------
  234|  3.46M|            continue;
  235|   263k|        if(cj5__isnum(json5[parser->pos]) && parser->pos != start)
  ------------------
  |  |   85|   527k|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 14.4k, False: 249k]
  |  |  ------------------
  ------------------
  |  Branch (235:46): [True: 14.4k, False: 0]
  ------------------
  236|  14.4k|            continue;
  237|   249k|        break;
  238|   263k|    }
  239|       |
  240|       |    // An empty key is not allowed
  241|   249k|    if(parser->pos <= start) {
  ------------------
  |  Branch (241:8): [True: 7, False: 249k]
  ------------------
  242|      7|        parser->error = CJ5_ERROR_INVALID;
  243|      7|        return;
  244|      7|    }
  245|       |
  246|       |    // Move pos to the last character within the unquoted key
  247|   249k|    parser->pos--;
  248|       |
  249|   249k|    token = cj5__alloc_token(parser);
  250|   249k|    if(token) {
  ------------------
  |  Branch (250:8): [True: 138k, False: 110k]
  ------------------
  251|   138k|        token->type = CJ5_TOKEN_STRING;
  252|   138k|        token->start = start;
  253|   138k|        token->end = parser->pos;
  254|   138k|        token->size = parser->pos - start + 1;
  255|   138k|        token->parent_id = parser->curr_tok_idx;
  256|   138k|    }
  257|   249k|}
cj5.c:parse_codepoint:
  607|  1.00M|parse_codepoint(const char *pos, uint32_t *out_utf) {
  608|  1.00M|    uint32_t utf = 0;
  609|  5.03M|    for(unsigned int i = 0; i < 4; i++) {
  ------------------
  |  Branch (609:29): [True: 4.02M, False: 1.00M]
  ------------------
  610|  4.02M|        char byte = pos[i];
  611|  4.02M|        if(cj5__isnum(byte)) {
  ------------------
  |  |   85|  4.02M|#define cj5__isnum(ch)       cj5__isrange(ch, '0', '9')
  |  |  ------------------
  |  |  |  Branch (85:30): [True: 3.01M, False: 1.00M]
  |  |  ------------------
  ------------------
  612|  3.01M|            byte = (char)(byte - '0');
  613|  3.01M|        } else if(cj5__isrange(byte, 'a', 'f')) {
  ------------------
  |  Branch (613:19): [True: 1.00M, False: 2.68k]
  ------------------
  614|  1.00M|            byte = (char)(byte - ('a' - 10));
  615|  1.00M|        } else if(cj5__isrange(byte, 'A', 'F')) {
  ------------------
  |  Branch (615:19): [True: 2.67k, False: 9]
  ------------------
  616|  2.67k|            byte = (char)(byte - ('A' - 10));
  617|  2.67k|        } else {
  618|      9|            return CJ5_ERROR_INVALID;
  619|      9|        }
  620|  4.02M|        utf = (utf << 4) | ((uint8_t)byte & 0xF);
  621|  4.02M|    }
  622|  1.00M|    *out_utf = utf;
  623|  1.00M|    return CJ5_ERROR_NONE;
  624|  1.00M|}

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

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

musl_secs_to_tm:
   15|  26.5k|musl_secs_to_tm(long long t, struct musl_tm *tm) {
   16|  26.5k|    long long days, secs, years;
   17|  26.5k|    int remdays, remsecs, remyears;
   18|  26.5k|    int qc_cycles, c_cycles, q_cycles;
   19|  26.5k|    int months;
   20|  26.5k|    int wday, yday, leap;
   21|  26.5k|    static const char days_in_month[] = {31,30,31,30,31,31,30,31,30,31,31,29};
   22|       |
   23|       |    /* Reject time_t values whose year would overflow int */
   24|  26.5k|    if (t < INT_MIN * 31622400LL || t > INT_MAX * 31622400LL)
  ------------------
  |  Branch (24:9): [True: 0, False: 26.5k]
  |  Branch (24:37): [True: 0, False: 26.5k]
  ------------------
   25|      0|        return -1;
   26|       |
   27|  26.5k|    secs = t - LEAPOCH;
  ------------------
  |  |    8|  26.5k|#define LEAPOCH (946684800LL + 86400*(31+29))
  ------------------
   28|  26.5k|    days = secs / 86400LL;
   29|  26.5k|    remsecs = (int)(secs % 86400);
   30|  26.5k|    if (remsecs < 0) {
  ------------------
  |  Branch (30:9): [True: 17.3k, False: 9.21k]
  ------------------
   31|  17.3k|        remsecs += 86400;
   32|  17.3k|        --days;
   33|  17.3k|    }
   34|       |
   35|  26.5k|    wday = (int)((3+days)%7);
   36|  26.5k|    if (wday < 0) wday += 7;
  ------------------
  |  Branch (36:9): [True: 17.7k, False: 8.88k]
  ------------------
   37|       |
   38|  26.5k|    qc_cycles = (int)(days / DAYS_PER_400Y);
  ------------------
  |  |   10|  26.5k|#define DAYS_PER_400Y (365*400 + 97)
  ------------------
   39|  26.5k|    remdays = (int)(days % DAYS_PER_400Y);
  ------------------
  |  |   10|  26.5k|#define DAYS_PER_400Y (365*400 + 97)
  ------------------
   40|  26.5k|    if (remdays < 0) {
  ------------------
  |  Branch (40:9): [True: 21.2k, False: 5.34k]
  ------------------
   41|  21.2k|        remdays += DAYS_PER_400Y;
  ------------------
  |  |   10|  21.2k|#define DAYS_PER_400Y (365*400 + 97)
  ------------------
   42|  21.2k|        --qc_cycles;
   43|  21.2k|    }
   44|       |
   45|  26.5k|    c_cycles = remdays / DAYS_PER_100Y;
  ------------------
  |  |   11|  26.5k|#define DAYS_PER_100Y (365*100 + 24)
  ------------------
   46|  26.5k|    if (c_cycles == 4) --c_cycles;
  ------------------
  |  Branch (46:9): [True: 2.67k, False: 23.9k]
  ------------------
   47|  26.5k|    remdays -= c_cycles * DAYS_PER_100Y;
  ------------------
  |  |   11|  26.5k|#define DAYS_PER_100Y (365*100 + 24)
  ------------------
   48|       |
   49|  26.5k|    q_cycles = remdays / DAYS_PER_4Y;
  ------------------
  |  |   12|  26.5k|#define DAYS_PER_4Y   (365*4   + 1)
  ------------------
   50|  26.5k|    if (q_cycles == 25) --q_cycles;
  ------------------
  |  Branch (50:9): [True: 0, False: 26.5k]
  ------------------
   51|  26.5k|    remdays -= q_cycles * DAYS_PER_4Y;
  ------------------
  |  |   12|  26.5k|#define DAYS_PER_4Y   (365*4   + 1)
  ------------------
   52|       |
   53|  26.5k|    remyears = remdays / 365;
   54|  26.5k|    if (remyears == 4) --remyears;
  ------------------
  |  Branch (54:9): [True: 2.75k, False: 23.8k]
  ------------------
   55|  26.5k|    remdays -= remyears * 365;
   56|       |
   57|  26.5k|    leap = !remyears && (q_cycles || !c_cycles);
  ------------------
  |  Branch (57:12): [True: 10.6k, False: 15.9k]
  |  Branch (57:26): [True: 5.80k, False: 4.81k]
  |  Branch (57:38): [True: 4.72k, False: 93]
  ------------------
   58|  26.5k|    yday = remdays + 31 + 28 + leap;
   59|  26.5k|    if (yday >= 365+leap) yday -= 365+leap;
  ------------------
  |  Branch (59:9): [True: 13.0k, False: 13.5k]
  ------------------
   60|       |
   61|  26.5k|    years = remyears + 4*q_cycles + 100*c_cycles + 400LL*qc_cycles;
   62|       |
   63|   230k|    for (months=0; days_in_month[months] <= remdays; months++)
  ------------------
  |  Branch (63:20): [True: 203k, False: 26.5k]
  ------------------
   64|   203k|        remdays -= days_in_month[months];
   65|       |
   66|  26.5k|    if (months >= 10) {
  ------------------
  |  Branch (66:9): [True: 13.0k, False: 13.5k]
  ------------------
   67|  13.0k|        months -= 12;
   68|  13.0k|        years++;
   69|  13.0k|    }
   70|       |
   71|  26.5k|    if (years+100 > INT_MAX || years+100 < INT_MIN)
  ------------------
  |  Branch (71:9): [True: 0, False: 26.5k]
  |  Branch (71:32): [True: 0, False: 26.5k]
  ------------------
   72|      0|        return -1;
   73|       |
   74|  26.5k|    tm->tm_year = (int)(years + 100);
   75|  26.5k|    tm->tm_mon = months + 2;
   76|  26.5k|    tm->tm_mday = remdays + 1;
   77|  26.5k|    tm->tm_wday = wday;
   78|  26.5k|    tm->tm_yday = yday;
   79|       |
   80|  26.5k|    tm->tm_hour = remsecs / 3600;
   81|  26.5k|    tm->tm_min = remsecs / 60 % 60;
   82|  26.5k|    tm->tm_sec = remsecs % 60;
   83|       |
   84|  26.5k|    return 0;
   85|  26.5k|}
musl_tm_to_secs:
  149|  18.8k|musl_tm_to_secs(const struct musl_tm *tm) {
  150|  18.8k|    int is_leap;
  151|  18.8k|    long long year = tm->tm_year;
  152|  18.8k|    int month = tm->tm_mon;
  153|  18.8k|    if (month >= 12 || month < 0) {
  ------------------
  |  Branch (153:9): [True: 3.28k, False: 15.5k]
  |  Branch (153:24): [True: 2.59k, False: 12.9k]
  ------------------
  154|  5.87k|        int adj = month / 12;
  155|  5.87k|        month %= 12;
  156|  5.87k|        if (month < 0) {
  ------------------
  |  Branch (156:13): [True: 2.59k, False: 3.28k]
  ------------------
  157|  2.59k|            adj--;
  158|  2.59k|            month += 12;
  159|  2.59k|        }
  160|  5.87k|        year += adj;
  161|  5.87k|    }
  162|  18.8k|    long long t = musl_year_to_secs(year, &is_leap);
  163|  18.8k|    t += musl_month_to_secs(month, is_leap);
  164|  18.8k|    t += 86400LL * (tm->tm_mday-1);
  165|  18.8k|    t += 3600LL * tm->tm_hour;
  166|  18.8k|    t += 60LL * tm->tm_min;
  167|  18.8k|    t += tm->tm_sec;
  168|  18.8k|    return t;
  169|  18.8k|}
libc_time.c:musl_year_to_secs:
  101|  18.8k|musl_year_to_secs(const long long year, int *is_leap) {
  102|  18.8k|    if (year-2ULL <= 136) {
  ------------------
  |  Branch (102:9): [True: 1.76k, False: 17.1k]
  ------------------
  103|  1.76k|        int y = (int)year;
  104|  1.76k|        int leaps = (y-68)>>2;
  105|  1.76k|        if (!((y-68)&3)) {
  ------------------
  |  Branch (105:13): [True: 325, False: 1.44k]
  ------------------
  106|    325|            leaps--;
  107|    325|            if (is_leap) *is_leap = 1;
  ------------------
  |  Branch (107:17): [True: 325, False: 0]
  ------------------
  108|  1.44k|        } else if (is_leap) *is_leap = 0;
  ------------------
  |  Branch (108:20): [True: 1.44k, False: 0]
  ------------------
  109|  1.76k|        return 31536000*(y-70) + 86400*leaps;
  110|  1.76k|    }
  111|       |
  112|  17.1k|    int cycles, centuries, leaps, rem, dummy;
  113|       |
  114|  17.1k|    if (!is_leap) is_leap = &dummy;
  ------------------
  |  Branch (114:9): [True: 0, False: 17.1k]
  ------------------
  115|  17.1k|    cycles = (int)((year-100) / 400);
  116|  17.1k|    rem = (int)((year-100) % 400);
  117|  17.1k|    if (rem < 0) {
  ------------------
  |  Branch (117:9): [True: 12.6k, False: 4.42k]
  ------------------
  118|  12.6k|        cycles--;
  119|  12.6k|        rem += 400;
  120|  12.6k|    }
  121|  17.1k|    if (!rem) {
  ------------------
  |  Branch (121:9): [True: 1.87k, False: 15.2k]
  ------------------
  122|  1.87k|        *is_leap = 1;
  123|  1.87k|        centuries = 0;
  124|  1.87k|        leaps = 0;
  125|  15.2k|    } else {
  126|  15.2k|        if (rem >= 200) {
  ------------------
  |  Branch (126:13): [True: 7.78k, False: 7.44k]
  ------------------
  127|  7.78k|            if (rem >= 300) centuries = 3, rem -= 300;
  ------------------
  |  Branch (127:17): [True: 4.84k, False: 2.94k]
  ------------------
  128|  2.94k|            else centuries = 2, rem -= 200;
  129|  7.78k|        } else {
  130|  7.44k|            if (rem >= 100) centuries = 1, rem -= 100;
  ------------------
  |  Branch (130:17): [True: 2.15k, False: 5.29k]
  ------------------
  131|  5.29k|            else centuries = 0;
  132|  7.44k|        }
  133|  15.2k|        if (!rem) {
  ------------------
  |  Branch (133:13): [True: 539, False: 14.6k]
  ------------------
  134|    539|            *is_leap = 0;
  135|    539|            leaps = 0;
  136|  14.6k|        } else {
  137|  14.6k|            leaps = rem / 4;
  138|  14.6k|            rem %= 4;
  139|  14.6k|            *is_leap = !rem;
  140|  14.6k|        }
  141|  15.2k|    }
  142|       |
  143|  17.1k|    leaps += 97*cycles + 24*centuries - *is_leap;
  144|       |
  145|  17.1k|    return (year-100) * 31536000LL + leaps * 86400LL + 946684800 + 86400;
  146|  18.8k|}
libc_time.c:musl_month_to_secs:
   93|  18.8k|musl_month_to_secs(int month, int is_leap) {
   94|  18.8k|    int t = secs_through_month[month];
   95|  18.8k|    if (is_leap && month >= 2)
  ------------------
  |  Branch (95:9): [True: 5.53k, False: 13.3k]
  |  Branch (95:20): [True: 2.51k, False: 3.02k]
  ------------------
   96|  2.51k|        t+=86400;
   97|  18.8k|    return t;
   98|  18.8k|}

parseUInt64:
   30|  9.02M|parseUInt64(const char *str, size_t size, uint64_t *result) {
   31|  9.02M|    size_t i = 0;
   32|  9.02M|    uint64_t n = 0, prev = 0;
   33|       |
   34|       |    /* Hex */
   35|  9.02M|    if(size > 2 && str[0] == '0' && (str[1] | 32) == 'x') {
  ------------------
  |  Branch (35:8): [True: 24.4k, False: 9.00M]
  |  Branch (35:20): [True: 8.90k, False: 15.5k]
  |  Branch (35:37): [True: 701, False: 8.20k]
  ------------------
   36|    701|        i = 2;
   37|  39.6k|        for(; i < size; i++) {
  ------------------
  |  Branch (37:15): [True: 39.3k, False: 260]
  ------------------
   38|  39.3k|            uint8_t c = (uint8_t)str[i] | 32;
   39|  39.3k|            if(c >= '0' && c <= '9')
  ------------------
  |  Branch (39:16): [True: 39.3k, False: 0]
  |  Branch (39:28): [True: 13.1k, False: 26.2k]
  ------------------
   40|  13.1k|                c = (uint8_t)(c - '0');
   41|  26.2k|            else if(c >= 'a' && c <='f')
  ------------------
  |  Branch (41:21): [True: 26.2k, False: 0]
  |  Branch (41:33): [True: 25.8k, False: 441]
  ------------------
   42|  25.8k|                c = (uint8_t)(c - 'a' + 10);
   43|    441|            else if(c >= 'A' && c <='F')
  ------------------
  |  Branch (43:21): [True: 441, False: 0]
  |  Branch (43:33): [True: 0, False: 441]
  ------------------
   44|      0|                c = (uint8_t)(c - 'A' + 10);
   45|    441|            else
   46|    441|                break;
   47|  38.9k|            n = (n << 4) | (c & 0xF);
   48|  38.9k|            if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (48:16): [True: 0, False: 38.9k]
  ------------------
   49|      0|                return 0;
   50|  38.9k|            prev = n;
   51|  38.9k|        }
   52|    701|        *result = n;
   53|    701|        return (i > 2) ? i : 0; /* 2 -> No digit was parsed */
  ------------------
  |  Branch (53:16): [True: 701, False: 0]
  ------------------
   54|    701|    }
   55|       |
   56|       |    /* Decimal */
   57|  18.5M|    for(; i < size; i++) {
  ------------------
  |  Branch (57:11): [True: 9.57M, False: 9.00M]
  ------------------
   58|  9.57M|        if(str[i] < '0' || str[i] > '9')
  ------------------
  |  Branch (58:12): [True: 18.8k, False: 9.55M]
  |  Branch (58:28): [True: 688, False: 9.55M]
  ------------------
   59|  19.5k|            break;
   60|       |        /* Fast multiplication: n*10 == (n*8) + (n*2) */
   61|  9.55M|        n = (n << 3) + (n << 1) + (uint8_t)(str[i] - '0');
   62|  9.55M|        if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (62:12): [True: 4, False: 9.55M]
  ------------------
   63|      4|            return 0;
   64|  9.55M|        prev = n;
   65|  9.55M|    }
   66|  9.02M|    *result = n;
   67|  9.02M|    return i;
   68|  9.02M|}
parseInt64:
   71|  3.61M|parseInt64(const char *str, size_t size, int64_t *result) {
   72|       |    /* Negative value? */
   73|  3.61M|    size_t i = 0;
   74|  3.61M|    bool neg = false;
   75|  3.61M|    if(*str == '-' || *str == '+') {
  ------------------
  |  Branch (75:8): [True: 5.65k, False: 3.61M]
  |  Branch (75:23): [True: 223, False: 3.61M]
  ------------------
   76|  5.87k|        neg = (*str == '-');
   77|  5.87k|        i++;
   78|  5.87k|    }
   79|       |
   80|       |    /* Parse as unsigned */
   81|  3.61M|    uint64_t n = 0;
   82|  3.61M|    size_t len = parseUInt64(&str[i], size - i, &n);
   83|  3.61M|    if(len == 0)
  ------------------
  |  Branch (83:8): [True: 12, False: 3.61M]
  ------------------
   84|     12|        return 0;
   85|       |
   86|       |    /* Check for overflow, adjust and return */
   87|  3.61M|    if(!neg) {
  ------------------
  |  Branch (87:8): [True: 3.61M, False: 5.64k]
  ------------------
   88|  3.61M|        if(n > 9223372036854775807UL)
  ------------------
  |  Branch (88:12): [True: 3, False: 3.61M]
  ------------------
   89|      3|            return 0;
   90|  3.61M|        *result = (int64_t)n;
   91|  3.61M|    } else {
   92|       |        /* n is unsigned, so 9223372036854775808UL == 2^63 fits without
   93|       |         * overflow. (int64_t)n would also fit for n in [0, 2^63], but
   94|       |         * the negation -(int64_t)(2^63) is undefined because the result
   95|       |         * (which is +2^63) cannot be represented. Use the unsigned
   96|       |         * representation and reinterpret as int64_t instead. */
   97|  5.64k|        if(n > 9223372036854775808UL)
  ------------------
  |  Branch (97:12): [True: 0, False: 5.64k]
  ------------------
   98|      0|            return 0;
   99|  5.64k|        *result = (n == 9223372036854775808UL)
  ------------------
  |  Branch (99:19): [True: 1.22k, False: 4.42k]
  ------------------
  100|  5.64k|            ? (int64_t)(-9223372036854775807LL - 1)
  101|  5.64k|            : -(int64_t)n;
  102|  5.64k|    }
  103|  3.61M|    return len + i;
  104|  3.61M|}
parseDouble:
  106|   746k|size_t parseDouble(const char *str, size_t size, double *result) {
  107|   746k|    char buf[2000];
  108|   746k|    if(size >= 2000)
  ------------------
  |  Branch (108:8): [True: 1, False: 746k]
  ------------------
  109|      1|        return 0;
  110|   746k|    memcpy(buf, str, size);
  111|   746k|    buf[size] = 0;
  112|   746k|    errno = 0;
  113|   746k|    char *endptr;
  114|   746k|    *result = strtod(buf, &endptr);
  115|   746k|    if(errno != 0 && errno != ERANGE)
  ------------------
  |  Branch (115:8): [True: 3.02k, False: 743k]
  |  Branch (115:22): [True: 0, False: 3.02k]
  ------------------
  116|      0|        return 0;
  117|   746k|    return (uintptr_t)endptr - (uintptr_t)buf;
  118|   746k|}

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

UA_StatusCode_equalTop:
  214|  23.8k|UA_StatusCode_equalTop(UA_StatusCode s1, UA_StatusCode s2) {
  215|  23.8k|    return ((s1 & 0xFFFF0000) == (s2 & 0xFFFF0000));
  216|  23.8k|}
UA_STRING:
  219|  1.83k|UA_STRING(char *chars) {
  220|  1.83k|    UA_String s = {0, NULL};
  221|  1.83k|    if(!chars)
  ------------------
  |  Branch (221:8): [True: 0, False: 1.83k]
  ------------------
  222|      0|        return s;
  223|  1.83k|    s.length = strlen(chars);
  224|  1.83k|    s.data = (UA_Byte*)chars;
  225|  1.83k|    return s;
  226|  1.83k|}
UA_QualifiedName_printEx:
  409|   184k|                         const UA_NamespaceMapping *nsMapping) {
  410|       |    /* Start tracking the output length */
  411|   184k|    size_t len = qn->name.length;
  412|       |
  413|       |    /* Try to map the NamespaceIndex to the Uri */
  414|   184k|    UA_String nsUri = UA_STRING_NULL;
  415|   184k|    if(qn->namespaceIndex > 0 && nsMapping) {
  ------------------
  |  Branch (415:8): [True: 1.26k, False: 182k]
  |  Branch (415:34): [True: 0, False: 1.26k]
  ------------------
  416|      0|        UA_NamespaceMapping_index2Uri(nsMapping, qn->namespaceIndex, &nsUri);
  417|      0|        if(nsUri.length > 0)
  ------------------
  |  Branch (417:12): [True: 0, False: 0]
  ------------------
  418|      0|            len += nsUri.length + 1;
  419|      0|    }
  420|       |
  421|       |    /* Print the NamespaceIndex */
  422|   184k|    char nsStr[6];
  423|   184k|    size_t nsStrSize = 0;
  424|   184k|    if(nsUri.length == 0 && qn->namespaceIndex > 0) {
  ------------------
  |  Branch (424:8): [True: 184k, False: 0]
  |  Branch (424:29): [True: 1.26k, False: 182k]
  ------------------
  425|  1.26k|        nsStrSize = itoaUnsigned(qn->namespaceIndex, nsStr, 10);
  426|  1.26k|        len += 1 + nsStrSize;
  427|  1.26k|    }
  428|       |
  429|       |    /* Allocate memory if required */
  430|   184k|    if(output->length == 0) {
  ------------------
  |  Branch (430:8): [True: 184k, False: 0]
  ------------------
  431|   184k|        UA_StatusCode res = UA_ByteString_allocBuffer((UA_ByteString*)output, len);
  432|   184k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|   184k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (432:12): [True: 0, False: 184k]
  ------------------
  433|      0|            return res;
  434|   184k|    } else {
  435|      0|        if(output->length < len)
  ------------------
  |  Branch (435:12): [True: 0, False: 0]
  ------------------
  436|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  437|      0|        output->length = len;
  438|      0|    }
  439|       |
  440|       |    /* Print the namespace */
  441|   184k|    u8 *pos = output->data;
  442|   184k|    if(nsUri.length > 0) {
  ------------------
  |  Branch (442:8): [True: 0, False: 184k]
  ------------------
  443|      0|        memcpy(pos, nsUri.data, nsUri.length);
  444|      0|        pos += nsUri.length;
  445|      0|        *pos++ = ';';
  446|   184k|    } else if(qn->namespaceIndex > 0) {
  ------------------
  |  Branch (446:15): [True: 1.26k, False: 182k]
  ------------------
  447|  1.26k|        memcpy(pos, nsStr, nsStrSize);
  448|  1.26k|        pos += nsStrSize;
  449|  1.26k|        *pos++ = ':';
  450|  1.26k|    }
  451|       |
  452|       |    /* Print the name */
  453|   184k|    if(UA_LIKELY(qn->name.data != NULL))
  ------------------
  |  |  578|   184k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (578:23): [True: 184k, False: 0]
  |  |  ------------------
  ------------------
  454|   184k|        memcpy(pos, qn->name.data, qn->name.length);
  455|       |
  456|   184k|    UA_assert(output->length == (size_t)((UA_Byte*)pos + qn->name.length - output->data));
  ------------------
  |  |  399|   184k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (456:5): [True: 184k, False: 0]
  ------------------
  457|   184k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   184k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  458|   184k|}
UA_DateTime_toStruct:
  477|  26.5k|UA_DateTime_toStruct(UA_DateTime t) {
  478|       |    /* Divide, then subtract -> avoid underflow. Also, negative numbers are
  479|       |     * rounded up, not down. */
  480|  26.5k|    long long secSinceUnixEpoch = (long long)(t / UA_DATETIME_SEC)
  ------------------
  |  |  285|  26.5k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  26.5k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  26.5k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  481|  26.5k|        - (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC);
  ------------------
  |  |  327|  26.5k|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|  26.5k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  26.5k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  26.5k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      - (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC);
  ------------------
  |  |  285|  26.5k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  26.5k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  26.5k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  482|       |
  483|       |    /* Negative fractions of a second? Remove one full second from the epoch
  484|       |     * distance and allow only a positive fraction. */
  485|  26.5k|    UA_DateTime frac = t % UA_DATETIME_SEC;
  ------------------
  |  |  285|  26.5k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  26.5k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  26.5k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  486|  26.5k|    if(frac < 0) {
  ------------------
  |  Branch (486:8): [True: 3.21k, False: 23.3k]
  ------------------
  487|  3.21k|        secSinceUnixEpoch--;
  488|  3.21k|        frac += UA_DATETIME_SEC;
  ------------------
  |  |  285|  3.21k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  3.21k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  3.21k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  489|  3.21k|    }
  490|       |
  491|  26.5k|    struct musl_tm ts;
  492|  26.5k|    memset(&ts, 0, sizeof(struct musl_tm));
  493|  26.5k|    musl_secs_to_tm(secSinceUnixEpoch, &ts);
  494|       |
  495|  26.5k|    UA_DateTimeStruct dateTimeStruct;
  496|  26.5k|    dateTimeStruct.year   = (i16)(ts.tm_year + 1900);
  497|  26.5k|    dateTimeStruct.month  = (u16)(ts.tm_mon + 1);
  498|  26.5k|    dateTimeStruct.day    = (u16)ts.tm_mday;
  499|  26.5k|    dateTimeStruct.hour   = (u16)ts.tm_hour;
  500|  26.5k|    dateTimeStruct.min    = (u16)ts.tm_min;
  501|  26.5k|    dateTimeStruct.sec    = (u16)ts.tm_sec;
  502|  26.5k|    dateTimeStruct.milliSec = (u16)((frac % 10000000) / 10000);
  503|  26.5k|    dateTimeStruct.microSec = (u16)((frac % 10000) / 10);
  504|  26.5k|    dateTimeStruct.nanoSec  = (u16)((frac % 10) * 100);
  505|  26.5k|    return dateTimeStruct;
  506|  26.5k|}
UA_Guid_to_hex:
  708|  2.31k|UA_Guid_to_hex(const UA_Guid *guid, u8* out, UA_Boolean lower) {
  709|  2.31k|    const u8 *hexmap = (lower) ? hexmapLower : hexmapUpper;
  ------------------
  |  Branch (709:24): [True: 0, False: 2.31k]
  ------------------
  710|  2.31k|    size_t i = 0, j = 28;
  711|  20.8k|    for(; i<8;i++,j-=4)         /* pos 0-7, 4byte, (a) */
  ------------------
  |  Branch (711:11): [True: 18.5k, False: 2.31k]
  ------------------
  712|  18.5k|        out[i] = hexmap[(guid->data1 >> j) & 0x0Fu];
  713|  2.31k|    out[i++] = '-';             /* pos 8 */
  714|  11.5k|    for(j=12; i<13;i++,j-=4)    /* pos 9-12, 2byte, (b) */
  ------------------
  |  Branch (714:15): [True: 9.25k, False: 2.31k]
  ------------------
  715|  9.25k|        out[i] = hexmap[(uint16_t)(guid->data2 >> j) & 0x0Fu];
  716|  2.31k|    out[i++] = '-';             /* pos 13 */
  717|  11.5k|    for(j=12; i<18;i++,j-=4)    /* pos 14-17, 2byte (c) */
  ------------------
  |  Branch (717:15): [True: 9.25k, False: 2.31k]
  ------------------
  718|  9.25k|        out[i] = hexmap[(uint16_t)(guid->data3 >> j) & 0x0Fu];
  719|  2.31k|    out[i++] = '-';              /* pos 18 */
  720|  6.94k|    for(j=0;i<23;i+=2,j++) {     /* pos 19-22, 2byte (d) */
  ------------------
  |  Branch (720:13): [True: 4.62k, False: 2.31k]
  ------------------
  721|  4.62k|        out[i] = hexmap[(guid->data4[j] & 0xF0u) >> 4u];
  722|  4.62k|        out[i+1] = hexmap[guid->data4[j] & 0x0Fu];
  723|  4.62k|    }
  724|  2.31k|    out[i++] = '-';              /* pos 23 */
  725|  16.1k|    for(j=2; i<36;i+=2,j++) {    /* pos 24-35, 6byte (e) */
  ------------------
  |  Branch (725:14): [True: 13.8k, False: 2.31k]
  ------------------
  726|  13.8k|        out[i] = hexmap[(guid->data4[j] & 0xF0u) >> 4u];
  727|  13.8k|        out[i+1] = hexmap[guid->data4[j] & 0x0Fu];
  728|  13.8k|    }
  729|  2.31k|}
UA_ByteString_allocBuffer:
  756|   259k|UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length) {
  757|   259k|    UA_ByteString_init(bs);
  758|   259k|    if(length == 0) {
  ------------------
  |  Branch (758:8): [True: 13.7k, False: 246k]
  ------------------
  759|  13.7k|        bs->data = (u8*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  13.7k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  760|  13.7k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  13.7k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  761|  13.7k|    }
  762|   246k|    bs->data = (u8*)UA_calloc(1,length);
  ------------------
  |  |   20|   246k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  763|   246k|    if(UA_UNLIKELY(!bs->data))
  ------------------
  |  |  579|   246k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (579:25): [True: 0, False: 246k]
  |  |  ------------------
  ------------------
  764|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  765|   246k|    bs->length = length;
  766|   246k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   246k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  767|   246k|}
nodeId_printEscape:
 1023|  34.6k|                   const UA_NamespaceMapping *nsMapping, UA_Escaping idEsc) {
 1024|       |    /* Try to map the NamespaceIndex to the Uri */
 1025|  34.6k|    UA_String nsUri = UA_STRING_NULL;
 1026|  34.6k|    if(id->namespaceIndex > 0 && nsMapping)
  ------------------
  |  Branch (1026:8): [True: 20.1k, False: 14.5k]
  |  Branch (1026:34): [True: 0, False: 20.1k]
  ------------------
 1027|      0|        UA_NamespaceMapping_index2Uri(nsMapping, id->namespaceIndex, &nsUri);
 1028|       |
 1029|       |    /* Compute the string length and print numerical identifiers. */
 1030|  34.6k|    u8 nsStr[7];
 1031|  34.6k|    u8 numIdStr[12];
 1032|  34.6k|    size_t idLen = nodeIdSize(id, nsStr, numIdStr, nsUri, idEsc);
 1033|  34.6k|    if(idLen == 0)
  ------------------
  |  Branch (1033:8): [True: 0, False: 34.6k]
  ------------------
 1034|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 1035|       |
 1036|       |    /* Allocate memory if required */
 1037|  34.6k|    if(output->length == 0) {
  ------------------
  |  Branch (1037:8): [True: 34.6k, False: 0]
  ------------------
 1038|  34.6k|        UA_StatusCode res = UA_ByteString_allocBuffer((UA_ByteString*)output, idLen);
 1039|  34.6k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  34.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1039:12): [True: 0, False: 34.6k]
  ------------------
 1040|      0|            return res;
 1041|  34.6k|    } else {
 1042|      0|        if(output->length < idLen)
  ------------------
  |  Branch (1042:12): [True: 0, False: 0]
  ------------------
 1043|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
 1044|      0|        output->length = idLen;
 1045|      0|    }
 1046|       |
 1047|       |    /* Print the NodeId */
 1048|  34.6k|    u8 *pos = printNodeIdBody(id, nsUri, nsStr, numIdStr, output->data, nsMapping, idEsc);
 1049|  34.6k|    output->length = (size_t)(pos - output->data);
 1050|  34.6k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  34.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1051|  34.6k|}
UA_NodeId_printEx:
 1055|  34.6k|                  const UA_NamespaceMapping *nsMapping) {
 1056|  34.6k|    return nodeId_printEscape(id, output, nsMapping, UA_ESCAPING_NONE);
 1057|  34.6k|}
UA_ExpandedNodeId_printEx:
 1175|  37.0k|                          size_t serverUrisSize, const UA_String *serverUris) {
 1176|       |    /* Try to map the NamespaceIndex to the Uri */
 1177|  37.0k|    UA_String nsUri = eid->namespaceUri;
 1178|  37.0k|    if(nsUri.data == NULL && eid->nodeId.namespaceIndex > 0 && nsMapping)
  ------------------
  |  Branch (1178:8): [True: 35.6k, False: 1.40k]
  |  Branch (1178:30): [True: 3.48k, False: 32.1k]
  |  Branch (1178:64): [True: 0, False: 3.48k]
  ------------------
 1179|      0|        UA_NamespaceMapping_index2Uri(nsMapping, eid->nodeId.namespaceIndex, &nsUri);
 1180|       |
 1181|       |    /* Try to map the ServerIndex to a Uri */
 1182|  37.0k|    UA_String srvUri = UA_STRING_NULL;
 1183|  37.0k|    if(eid->serverIndex > 0 && eid->serverIndex < serverUrisSize)
  ------------------
  |  Branch (1183:8): [True: 1.36k, False: 35.6k]
  |  Branch (1183:32): [True: 0, False: 1.36k]
  ------------------
 1184|      0|        srvUri = serverUris[eid->serverIndex];
 1185|       |
 1186|       |    /* No special escaping for ExpandedNodeIds */
 1187|  37.0k|    UA_Escaping idEsc = UA_ESCAPING_NONE;
 1188|       |
 1189|       |    /* Compute the NodeId string length */
 1190|  37.0k|    u8 nsStr[7];
 1191|  37.0k|    u8 numIdStr[12];
 1192|  37.0k|    char srvIdxStr[11];
 1193|  37.0k|    size_t srvIdxSize = 0;
 1194|  37.0k|    size_t idLen = nodeIdSize(&eid->nodeId, nsStr, numIdStr, nsUri, idEsc);
 1195|  37.0k|    if(idLen == 0)
  ------------------
  |  Branch (1195:8): [True: 0, False: 37.0k]
  ------------------
 1196|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 1197|  37.0k|    if(srvUri.length  > 0) {
  ------------------
  |  Branch (1197:8): [True: 0, False: 37.0k]
  ------------------
 1198|      0|        idLen += 5; /* svu=; */
 1199|      0|        idLen += UA_String_escapedSize(srvUri, UA_ESCAPING_PERCENT);
 1200|  37.0k|    } else if(eid->serverIndex > 0) {
  ------------------
  |  Branch (1200:15): [True: 1.36k, False: 35.6k]
  ------------------
 1201|  1.36k|        idLen += 5; /* svr=; */
 1202|  1.36k|        srvIdxSize = itoaUnsigned(eid->serverIndex, srvIdxStr, 10);
 1203|  1.36k|        idLen += srvIdxSize;
 1204|  1.36k|    }
 1205|       |
 1206|       |    /* Allocate memory if required */
 1207|  37.0k|    if(output->length == 0) {
  ------------------
  |  Branch (1207:8): [True: 37.0k, False: 0]
  ------------------
 1208|  37.0k|        UA_StatusCode res = UA_ByteString_allocBuffer((UA_ByteString*)output, idLen);
 1209|  37.0k|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  37.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1209:12): [True: 0, False: 37.0k]
  ------------------
 1210|      0|            return res;
 1211|  37.0k|    } else {
 1212|      0|        if(output->length < idLen)
  ------------------
  |  Branch (1212:12): [True: 0, False: 0]
  ------------------
 1213|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
 1214|      0|        output->length = idLen;
 1215|      0|    }
 1216|       |
 1217|       |    /* Encode the ServerIndex or ServerUrl */
 1218|  37.0k|    u8 *pos = output->data;
 1219|  37.0k|    if(srvUri.length  > 0) {
  ------------------
  |  Branch (1219:8): [True: 0, False: 37.0k]
  ------------------
 1220|      0|        memcpy(pos, "svu=", 4);
 1221|      0|        pos += 4;
 1222|      0|        pos += UA_String_escapeInsert(pos, srvUri, UA_ESCAPING_PERCENT);
 1223|      0|        *pos++ = ';';
 1224|  37.0k|    } else if(eid->serverIndex > 0) {
  ------------------
  |  Branch (1224:15): [True: 1.36k, False: 35.6k]
  ------------------
 1225|  1.36k|        memcpy(pos, "svr=", 4);
 1226|  1.36k|        pos += 4;
 1227|  1.36k|        memcpy(pos, srvIdxStr, srvIdxSize);
 1228|  1.36k|        pos += srvIdxSize;
 1229|  1.36k|        *pos++ = ';';
 1230|  1.36k|    }
 1231|       |
 1232|       |    /* Print the NodeId */
 1233|  37.0k|    pos = printNodeIdBody(&eid->nodeId, nsUri, nsStr, numIdStr, pos, nsMapping, idEsc);
 1234|  37.0k|    output->length = (size_t)(pos - output->data);
 1235|  37.0k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  37.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1236|  37.0k|}
UA_Variant_isScalar:
 1355|  82.1k|UA_Variant_isScalar(const UA_Variant *v) {
 1356|  82.1k|    return (v->type != NULL && v->arrayLength == 0 &&
  ------------------
  |  Branch (1356:13): [True: 82.1k, False: 0]
  |  Branch (1356:32): [True: 76.6k, False: 5.51k]
  ------------------
 1357|  76.6k|            v->data > UA_EMPTY_ARRAY_SENTINEL);
  ------------------
  |  |  755|  76.6k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1357:13): [True: 71.1k, False: 5.47k]
  ------------------
 1358|  82.1k|}
UA_new:
 1918|  74.9k|UA_new(const UA_DataType *type) {
 1919|  74.9k|    void *p = UA_calloc(1, type->memSize);
  ------------------
  |  |   20|  74.9k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1920|  74.9k|    return p;
 1921|  74.9k|}
UA_copy:
 2094|   169k|UA_copy(const void *src, void *dst, const UA_DataType *type) {
 2095|   169k|    memset(dst, 0, type->memSize); /* init */
 2096|   169k|    UA_StatusCode retval = copyJumpTable[type->typeKind](src, dst, type);
 2097|   169k|    if(retval != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|   169k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2097:8): [True: 0, False: 169k]
  ------------------
 2098|      0|        UA_clear(dst, type);
 2099|   169k|    return retval;
 2100|   169k|}
UA_clear:
 2197|  2.65M|UA_clear(void *p, const UA_DataType *type) {
 2198|  2.65M|    clearJumpTable[type->typeKind](p, type);
 2199|  2.65M|    memset(p, 0, type->memSize); /* init */
 2200|  2.65M|}
UA_order:
 2670|  2.02k|UA_Order UA_order(const void *p1, const void *p2, const UA_DataType *type) {
 2671|  2.02k|    return orderJumpTable[type->typeKind](p1, p2, type);
 2672|  2.02k|}
UA_Array_copy:
 2694|   169k|              void **dst, const UA_DataType *type) {
 2695|   169k|    if(size == 0) {
  ------------------
  |  Branch (2695:8): [True: 14.5k, False: 154k]
  ------------------
 2696|  14.5k|        if(src == NULL)
  ------------------
  |  Branch (2696:12): [True: 0, False: 14.5k]
  ------------------
 2697|      0|            *dst = NULL;
 2698|  14.5k|        else
 2699|  14.5k|            *dst= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  14.5k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2700|  14.5k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  14.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2701|  14.5k|    }
 2702|       |
 2703|       |    /* Check the array consistency -- defensive programming in case the user
 2704|       |     * manually created an inconsistent array */
 2705|   154k|    if(UA_UNLIKELY(!type || !src))
  ------------------
  |  |  579|   308k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (579:25): [True: 0, False: 154k]
  |  |  |  Branch (579:43): [True: 0, False: 154k]
  |  |  |  Branch (579:43): [True: 0, False: 154k]
  |  |  ------------------
  ------------------
 2706|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 2707|       |
 2708|       |    /* calloc, so we don't have to check retval in every iteration of copying */
 2709|   154k|    *dst = UA_calloc(size, type->memSize);
  ------------------
  |  |   20|   154k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2710|   154k|    if(!*dst)
  ------------------
  |  Branch (2710:8): [True: 0, False: 154k]
  ------------------
 2711|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2712|       |
 2713|   154k|    if(type->pointerFree) {
  ------------------
  |  Branch (2713:8): [True: 154k, False: 0]
  ------------------
 2714|   154k|        memcpy(*dst, src, type->memSize * size);
 2715|   154k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   154k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2716|   154k|    }
 2717|       |
 2718|      0|    uintptr_t ptrs = (uintptr_t)src;
 2719|      0|    uintptr_t ptrd = (uintptr_t)*dst;
 2720|      0|    UA_StatusCode retval = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2721|      0|    for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2721:23): [True: 0, False: 0]
  ------------------
 2722|      0|        retval |= UA_copy((void*)ptrs, (void*)ptrd, type);
 2723|      0|        ptrs += type->memSize;
 2724|      0|        ptrd += type->memSize;
 2725|      0|    }
 2726|      0|    if(retval != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2726:8): [True: 0, False: 0]
  ------------------
 2727|      0|        UA_Array_delete(*dst, size, type);
 2728|       |        *dst = NULL;
 2729|      0|    }
 2730|      0|    return retval;
 2731|   154k|}
UA_Array_delete:
 2822|  4.13M|UA_Array_delete(void *p, size_t size, const UA_DataType *type) {
 2823|  4.13M|    if(!type->pointerFree) {
  ------------------
  |  Branch (2823:8): [True: 37.7k, False: 4.09M]
  ------------------
 2824|  37.7k|        uintptr_t ptr = (uintptr_t)p;
 2825|  2.22M|        for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2825:27): [True: 2.18M, False: 37.7k]
  ------------------
 2826|  2.18M|            UA_clear((void*)ptr, type);
 2827|  2.18M|            ptr += type->memSize;
 2828|  2.18M|        }
 2829|  37.7k|    }
 2830|  4.13M|    UA_free((void*)((uintptr_t)p & ~(uintptr_t)UA_EMPTY_ARRAY_SENTINEL));
  ------------------
  |  |   19|  4.13M|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2831|  4.13M|}
UA_DataType_isNumeric:
 2877|  2.77M|UA_DataType_isNumeric(const UA_DataType *type) {
 2878|  2.77M|    switch(type->typeKind) {
 2879|      0|    case UA_DATATYPEKIND_SBYTE:
  ------------------
  |  Branch (2879:5): [True: 0, False: 2.77M]
  ------------------
 2880|      0|    case UA_DATATYPEKIND_BYTE:
  ------------------
  |  Branch (2880:5): [True: 0, False: 2.77M]
  ------------------
 2881|      0|    case UA_DATATYPEKIND_INT16:
  ------------------
  |  Branch (2881:5): [True: 0, False: 2.77M]
  ------------------
 2882|      0|    case UA_DATATYPEKIND_UINT16:
  ------------------
  |  Branch (2882:5): [True: 0, False: 2.77M]
  ------------------
 2883|      0|    case UA_DATATYPEKIND_INT32:
  ------------------
  |  Branch (2883:5): [True: 0, False: 2.77M]
  ------------------
 2884|  2.77M|    case UA_DATATYPEKIND_UINT32:
  ------------------
  |  Branch (2884:5): [True: 2.77M, False: 0]
  ------------------
 2885|  2.77M|    case UA_DATATYPEKIND_INT64:
  ------------------
  |  Branch (2885:5): [True: 0, False: 2.77M]
  ------------------
 2886|  2.77M|    case UA_DATATYPEKIND_UINT64:
  ------------------
  |  Branch (2886:5): [True: 0, False: 2.77M]
  ------------------
 2887|  2.77M|    case UA_DATATYPEKIND_FLOAT:
  ------------------
  |  Branch (2887:5): [True: 0, False: 2.77M]
  ------------------
 2888|  2.77M|    case UA_DATATYPEKIND_DOUBLE:
  ------------------
  |  Branch (2888:5): [True: 0, False: 2.77M]
  ------------------
 2889|       |    /* not implemented: UA_DATATYPEKIND_DECIMAL */
 2890|  2.77M|        return true;
 2891|      0|    default:
  ------------------
  |  Branch (2891:5): [True: 0, False: 2.77M]
  ------------------
 2892|       |        return false;
 2893|  2.77M|    }
 2894|  2.77M|}
ua_types.c:nodeIdSize:
  922|  71.6k|           UA_Escaping idEsc) {
  923|       |    /* Namespace length */
  924|  71.6k|    size_t len = 0;
  925|  71.6k|    if(nsUri.data != NULL) {
  ------------------
  |  Branch (925:8): [True: 1.40k, False: 70.2k]
  ------------------
  926|  1.40k|        len += 5; /* nsu=; */
  927|  1.40k|        len += UA_String_escapedSize(nsUri, UA_ESCAPING_PERCENT);
  928|  70.2k|    } else if(id->namespaceIndex > 0) {
  ------------------
  |  Branch (928:15): [True: 23.5k, False: 46.6k]
  ------------------
  929|  23.5k|        len += 4; /* ns=; */
  930|  23.5k|        size_t nsStrSize = itoaUnsigned(id->namespaceIndex, (char*)nsStr, 10);
  931|  23.5k|        nsStr[nsStrSize] = 0;
  932|  23.5k|        len += nsStrSize;
  933|  23.5k|    }
  934|       |
  935|  71.6k|    len += 2; /* ?= */
  936|       |
  937|  71.6k|    switch (id->identifierType) {
  938|  17.4k|    case UA_NODEIDTYPE_NUMERIC: {
  ------------------
  |  Branch (938:5): [True: 17.4k, False: 54.1k]
  ------------------
  939|  17.4k|        size_t numIdStrSize = itoaUnsigned(id->identifier.numeric, (char*)numIdStr, 10);
  940|  17.4k|        numIdStr[numIdStrSize] = 0;
  941|  17.4k|        len += numIdStrSize;
  942|  17.4k|        break;
  943|      0|    }
  944|  18.4k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (944:5): [True: 18.4k, False: 53.2k]
  ------------------
  945|  18.4k|        len += UA_String_escapedSize(id->identifier.string, idEsc);
  946|  18.4k|        break;
  947|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (947:5): [True: 0, False: 71.6k]
  ------------------
  948|      0|        len += 36;
  949|      0|        break;
  950|  35.7k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (950:5): [True: 35.7k, False: 35.9k]
  ------------------
  951|  35.7k|        len += 4 * ((id->identifier.byteString.length + 2) / 3);
  952|  35.7k|        break;
  953|      0|    default:
  ------------------
  |  Branch (953:5): [True: 0, False: 71.6k]
  ------------------
  954|      0|        len = 0;
  955|  71.6k|    }
  956|  71.6k|    return len;
  957|  71.6k|}
ua_types.c:printNodeIdBody:
  961|  71.6k|                const UA_NamespaceMapping *nsMapping, UA_Escaping idEsc) {
  962|  71.6k|    size_t len;
  963|       |
  964|       |    /* Encode the namespace */
  965|  71.6k|    if(nsUri.data != NULL) {
  ------------------
  |  Branch (965:8): [True: 1.40k, False: 70.2k]
  ------------------
  966|  1.40k|        memcpy(pos, "nsu=", 4);
  967|  1.40k|        pos += 4;
  968|  1.40k|        pos += UA_String_escapeInsert(pos, nsUri, UA_ESCAPING_PERCENT);
  969|  1.40k|        *pos++ = ';';
  970|  70.2k|    } else if(id->namespaceIndex > 0) {
  ------------------
  |  Branch (970:15): [True: 23.5k, False: 46.6k]
  ------------------
  971|  23.5k|        memcpy(pos, "ns=", 3);
  972|  23.5k|        pos += 3;
  973|  23.5k|        len = strlen((char*)nsStr);
  974|  23.5k|        memcpy(pos, nsStr, len);
  975|  23.5k|        pos += len;
  976|  23.5k|        *pos++ = ';';
  977|  23.5k|    }
  978|       |
  979|       |    /* Encode the identifier */
  980|  71.6k|    switch(id->identifierType) {
  ------------------
  |  Branch (980:12): [True: 71.6k, False: 0]
  ------------------
  981|  17.4k|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (981:5): [True: 17.4k, False: 54.1k]
  ------------------
  982|  17.4k|        memcpy(pos, "i=", 2);
  983|  17.4k|        pos += 2;
  984|  17.4k|        len = strlen((char*)numIdStr);
  985|  17.4k|        memcpy(pos, numIdStr, len);
  986|  17.4k|        pos += len;
  987|  17.4k|        break;
  988|  18.4k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (988:5): [True: 18.4k, False: 53.2k]
  ------------------
  989|  18.4k|        memcpy(pos, "s=", 2);
  990|  18.4k|        pos += 2;
  991|  18.4k|        pos += UA_String_escapeInsert(pos, id->identifier.string, idEsc);
  992|  18.4k|        break;
  993|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (993:5): [True: 0, False: 71.6k]
  ------------------
  994|      0|        memcpy(pos, "g=", 2);
  995|      0|        pos += 2;
  996|      0|        UA_Guid_to_hex(&id->identifier.guid, pos, true);
  997|      0|        pos += 36;
  998|      0|        break;
  999|  35.7k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (999:5): [True: 35.7k, False: 35.9k]
  ------------------
 1000|  35.7k|        memcpy(pos, "b=", 2);
 1001|  35.7k|        pos += 2;
 1002|       |        /* Use base64url encoding for percent-escaping.
 1003|       |         * Replace +/ with -_ and remove the padding. */
 1004|  35.7k|        u8 *bpos = pos;
 1005|  35.7k|        pos += UA_base64_buf(id->identifier.byteString.data,
 1006|  35.7k|                             id->identifier.byteString.length, pos);
 1007|  35.7k|        if(idEsc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (1007:12): [True: 0, False: 35.7k]
  ------------------
 1008|  35.7k|           idEsc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (1008:12): [True: 0, False: 35.7k]
  ------------------
 1009|      0|            while(pos > bpos && pos[-1] == '=')
  ------------------
  |  Branch (1009:19): [True: 0, False: 0]
  |  Branch (1009:33): [True: 0, False: 0]
  ------------------
 1010|      0|                pos--;
 1011|      0|            for(; bpos < pos; bpos++) {
  ------------------
  |  Branch (1011:19): [True: 0, False: 0]
  ------------------
 1012|      0|                if(*bpos == '+') *bpos = '-';
  ------------------
  |  Branch (1012:20): [True: 0, False: 0]
  ------------------
 1013|      0|                else if(*bpos == '/') *bpos = '_';
  ------------------
  |  Branch (1013:25): [True: 0, False: 0]
  ------------------
 1014|      0|            }
 1015|      0|        }
 1016|  35.7k|        break;
 1017|  71.6k|    }
 1018|  71.6k|    return pos;
 1019|  71.6k|}
ua_types.c:Variant_clear:
 1376|   292k|Variant_clear(void *p, const UA_DataType *_) {
 1377|   292k|    UA_Variant *v = (UA_Variant *)p;
 1378|       |
 1379|       |    /* The content is "borrowed" */
 1380|   292k|    if(v->storageType == UA_VARIANT_DATA_NODELETE)
  ------------------
  |  Branch (1380:8): [True: 0, False: 292k]
  ------------------
 1381|      0|        return;
 1382|       |
 1383|       |    /* Delete the value */
 1384|   292k|    if(v->type && v->data > UA_EMPTY_ARRAY_SENTINEL) {
  ------------------
  |  |  755|  86.5k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1384:8): [True: 86.5k, False: 205k]
  |  Branch (1384:19): [True: 80.4k, False: 6.08k]
  ------------------
 1385|  80.4k|        if(v->arrayLength == 0)
  ------------------
  |  Branch (1385:12): [True: 74.9k, False: 5.55k]
  ------------------
 1386|  74.9k|            v->arrayLength = 1;
 1387|  80.4k|        UA_Array_delete(v->data, v->arrayLength, v->type);
 1388|  80.4k|        v->data = NULL;
 1389|  80.4k|    }
 1390|       |
 1391|       |    /* Delete the array dimensions */
 1392|   292k|    if((void*)v->arrayDimensions > UA_EMPTY_ARRAY_SENTINEL)
  ------------------
  |  |  755|   292k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1392:8): [True: 2.99k, False: 289k]
  ------------------
 1393|  2.99k|        UA_free(v->arrayDimensions);
  ------------------
  |  |   19|  2.99k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1394|   292k|}
ua_types.c:DataValue_clear:
 1848|   111k|DataValue_clear(void *p, const UA_DataType *_) {
 1849|   111k|    UA_DataValue *dv = (UA_DataValue *)p;
 1850|       |    Variant_clear(&dv->value, NULL);
 1851|   111k|}
ua_types.c:String_copy:
  280|   169k|String_copy(const void *src, void *dst, const UA_DataType *_) {
  281|   169k|    const UA_String *srcS = (const UA_String*)src;
  282|   169k|    UA_String *dstS = (UA_String *)dst;
  283|   169k|    UA_StatusCode res =
  284|   169k|        UA_Array_copy(srcS->data, srcS->length, (void**)&dstS->data,
  285|   169k|                      &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|   169k|#define UA_TYPES_BYTE 2
  ------------------
  286|   169k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|   169k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (286:8): [True: 169k, False: 0]
  ------------------
  287|   169k|        dstS->length = srcS->length;
  288|   169k|    return res;
  289|   169k|}
ua_types.c:String_clear:
  292|  4.05M|String_clear(void *p, const UA_DataType *_) {
  293|  4.05M|    UA_String *s = (UA_String*)p;
  294|  4.05M|    UA_Array_delete(s->data, s->length, &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|  4.05M|#define UA_TYPES_BYTE 2
  ------------------
  295|  4.05M|}
ua_types.c:NodeId_clear:
  771|  52.7k|NodeId_clear(void *p, const UA_DataType *_) {
  772|  52.7k|    UA_NodeId *id = (UA_NodeId*)p;
  773|  52.7k|    switch(id->identifierType) {
  774|  12.3k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (774:5): [True: 12.3k, False: 40.3k]
  ------------------
  775|  36.6k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (775:5): [True: 24.2k, False: 28.4k]
  ------------------
  776|  36.6k|        String_clear(&id->identifier.string, NULL);
  777|  36.6k|        break;
  778|  16.1k|    default: break;
  ------------------
  |  Branch (778:5): [True: 16.1k, False: 36.6k]
  ------------------
  779|  52.7k|    }
  780|  52.7k|}
ua_types.c:ExpandedNodeId_clear:
 1072|  25.0k|ExpandedNodeId_clear(void *p, const UA_DataType *_) {
 1073|  25.0k|    UA_ExpandedNodeId *id = (UA_ExpandedNodeId*)p;
 1074|  25.0k|    NodeId_clear(&id->nodeId, NULL);
 1075|       |    String_clear(&id->namespaceUri, NULL);
 1076|  25.0k|}
ua_types.c:QualifiedName_clear:
  396|   157k|QualifiedName_clear(void *p, const UA_DataType *_) {
  397|   157k|    UA_QualifiedName *qn = (UA_QualifiedName*)p;
  398|       |    String_clear(&qn->name, NULL);
  399|   157k|}
ua_types.c:LocalizedText_clear:
 1831|  1.68M|LocalizedText_clear(void *p, const UA_DataType *_) {
 1832|  1.68M|    UA_LocalizedText *lt = (UA_LocalizedText *)p;
 1833|  1.68M|    String_clear(&lt->locale, NULL);
 1834|       |    String_clear(&lt->text, NULL);
 1835|  1.68M|}
ua_types.c:ExtensionObject_clear:
 1245|  3.74k|ExtensionObject_clear(void *p, const UA_DataType *_) {
 1246|  3.74k|    UA_ExtensionObject *eo = (UA_ExtensionObject *)p;
 1247|  3.74k|    switch(eo->encoding) {
 1248|  3.74k|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (1248:5): [True: 3.74k, False: 0]
  ------------------
 1249|  3.74k|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (1249:5): [True: 0, False: 3.74k]
  ------------------
 1250|  3.74k|    case UA_EXTENSIONOBJECT_ENCODED_XML:
  ------------------
  |  Branch (1250:5): [True: 0, False: 3.74k]
  ------------------
 1251|  3.74k|        NodeId_clear(&eo->content.encoded.typeId, NULL);
 1252|  3.74k|        String_clear(&eo->content.encoded.body, NULL);
 1253|  3.74k|        break;
 1254|      0|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (1254:5): [True: 0, False: 3.74k]
  ------------------
 1255|      0|        if(eo->content.decoded.data)
  ------------------
  |  Branch (1255:12): [True: 0, False: 0]
  ------------------
 1256|      0|            UA_delete(eo->content.decoded.data, eo->content.decoded.type);
 1257|      0|        break;
 1258|      0|    default:
  ------------------
  |  Branch (1258:5): [True: 0, False: 3.74k]
  ------------------
 1259|      0|        break;
 1260|  3.74k|    }
 1261|  3.74k|}
ua_types.c:DiagnosticInfo_clear:
 1878|  1.22k|DiagnosticInfo_clear(void *p, const UA_DataType *_) {
 1879|  1.22k|    UA_DiagnosticInfo *di = (UA_DiagnosticInfo *)p;
 1880|       |
 1881|  1.22k|    String_clear(&di->additionalInfo, NULL);
 1882|  1.22k|    if(di->hasInnerDiagnosticInfo && di->innerDiagnosticInfo) {
  ------------------
  |  Branch (1882:8): [True: 0, False: 1.22k]
  |  Branch (1882:38): [True: 0, False: 0]
  ------------------
 1883|      0|        DiagnosticInfo_clear(di->innerDiagnosticInfo, NULL);
 1884|      0|        UA_free(di->innerDiagnosticInfo);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1885|      0|    }
 1886|  1.22k|}
ua_types.c:guidOrder:
 2256|  1.15k|guidOrder(const void *p1_, const void *p2_, const UA_DataType *type) {
 2257|  1.15k|    const UA_Guid *p1 = (const UA_Guid*)p1_;
 2258|  1.15k|    const UA_Guid *p2 = (const UA_Guid*)p2_;
 2259|  1.15k|    if(p1->data1 != p2->data1)
  ------------------
  |  Branch (2259:8): [True: 0, False: 1.15k]
  ------------------
 2260|      0|        return (p1->data1 < p2->data1) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2260:16): [True: 0, False: 0]
  ------------------
 2261|  1.15k|    if(p1->data2 != p2->data2)
  ------------------
  |  Branch (2261:8): [True: 0, False: 1.15k]
  ------------------
 2262|      0|        return (p1->data2 < p2->data2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2262:16): [True: 0, False: 0]
  ------------------
 2263|  1.15k|    if(p1->data3 != p2->data3)
  ------------------
  |  Branch (2263:8): [True: 0, False: 1.15k]
  ------------------
 2264|      0|        return (p1->data3 < p2->data3) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2264:16): [True: 0, False: 0]
  ------------------
 2265|  1.15k|    int cmp = memcmp(p1->data4, p2->data4, 8);
 2266|  1.15k|    if(cmp != 0)
  ------------------
  |  Branch (2266:8): [True: 0, False: 1.15k]
  ------------------
 2267|      0|        return (cmp < 0) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2267:16): [True: 0, False: 0]
  ------------------
 2268|  1.15k|    return UA_ORDER_EQ;
 2269|  1.15k|}
ua_types.c:nodeIdOrder:
 2289|  23.8k|nodeIdOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2290|  23.8k|    const UA_NodeId *p1 = (const UA_NodeId*)p1_;
 2291|  23.8k|    const UA_NodeId *p2 = (const UA_NodeId*)p2_;
 2292|       |    /* Compare namespaceIndex */
 2293|  23.8k|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2293:8): [True: 0, False: 23.8k]
  ------------------
 2294|      0|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2294:16): [True: 0, False: 0]
  ------------------
 2295|       |
 2296|       |    /* Compare identifierType */
 2297|  23.8k|    if(p1->identifierType != p2->identifierType)
  ------------------
  |  Branch (2297:8): [True: 0, False: 23.8k]
  ------------------
 2298|      0|        return (p1->identifierType < p2->identifierType) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2298:16): [True: 0, False: 0]
  ------------------
 2299|       |
 2300|       |    /* Compare the identifier */
 2301|  23.8k|    switch(p1->identifierType) {
 2302|  5.83k|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (2302:5): [True: 5.83k, False: 18.0k]
  ------------------
 2303|  5.83k|    default:
  ------------------
  |  Branch (2303:5): [True: 0, False: 23.8k]
  ------------------
 2304|  5.83k|        if(p1->identifier.numeric != p2->identifier.numeric)
  ------------------
  |  Branch (2304:12): [True: 0, False: 5.83k]
  ------------------
 2305|      0|            return (p1->identifier.numeric < p2->identifier.numeric) ?
  ------------------
  |  Branch (2305:20): [True: 0, False: 0]
  ------------------
 2306|      0|                UA_ORDER_LESS : UA_ORDER_MORE;
 2307|  5.83k|        return UA_ORDER_EQ;
 2308|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (2308:5): [True: 0, False: 23.8k]
  ------------------
 2309|      0|        return guidOrder(&p1->identifier.guid, &p2->identifier.guid, NULL);
 2310|  6.15k|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (2310:5): [True: 6.15k, False: 17.7k]
  ------------------
 2311|  18.0k|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (2311:5): [True: 11.9k, False: 11.9k]
  ------------------
 2312|       |        return stringOrder(&p1->identifier.string, &p2->identifier.string, NULL);
 2313|  23.8k|    }
 2314|  23.8k|}
ua_types.c:expandedNodeIdOrder:
 2317|  12.3k|expandedNodeIdOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2318|  12.3k|    const UA_ExpandedNodeId *p1 = (const UA_ExpandedNodeId*)p1_;
 2319|  12.3k|    const UA_ExpandedNodeId *p2 = (const UA_ExpandedNodeId*)p2_;
 2320|  12.3k|    if(p1->serverIndex != p2->serverIndex)
  ------------------
  |  Branch (2320:8): [True: 0, False: 12.3k]
  ------------------
 2321|      0|        return (p1->serverIndex < p2->serverIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2321:16): [True: 0, False: 0]
  ------------------
 2322|  12.3k|    UA_Order o = stringOrder(&p1->namespaceUri, &p2->namespaceUri, NULL);
 2323|  12.3k|    if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2323:8): [True: 0, False: 12.3k]
  ------------------
 2324|      0|        return o;
 2325|  12.3k|    return nodeIdOrder(&p1->nodeId, &p2->nodeId, NULL);
 2326|  12.3k|}
ua_types.c:booleanOrder:
 2214|  3.49k|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2215|  3.49k|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2216|  3.49k|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2217|  3.49k|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2217:12): [True: 0, False: 3.49k]
  ------------------
 2218|  3.49k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2218:20): [True: 0, False: 0]
  ------------------
 2219|  3.49k|        return UA_ORDER_EQ;                                               \
 2220|  3.49k|    }
ua_types.c:sByteOrder:
 2214|  9.96k|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2215|  9.96k|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2216|  9.96k|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2217|  9.96k|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2217:12): [True: 0, False: 9.96k]
  ------------------
 2218|  9.96k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2218:20): [True: 0, False: 0]
  ------------------
 2219|  9.96k|        return UA_ORDER_EQ;                                               \
 2220|  9.96k|    }
ua_types.c:byteOrder:
 2214|  7.84k|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2215|  7.84k|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2216|  7.84k|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2217|  7.84k|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2217:12): [True: 0, False: 7.84k]
  ------------------
 2218|  7.84k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2218:20): [True: 0, False: 0]
  ------------------
 2219|  7.84k|        return UA_ORDER_EQ;                                               \
 2220|  7.84k|    }
ua_types.c:int16Order:
 2214|  4.82k|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2215|  4.82k|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2216|  4.82k|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2217|  4.82k|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2217:12): [True: 0, False: 4.82k]
  ------------------
 2218|  4.82k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2218:20): [True: 0, False: 0]
  ------------------
 2219|  4.82k|        return UA_ORDER_EQ;                                               \
 2220|  4.82k|    }
ua_types.c:uInt16Order:
 2214|  28.8k|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2215|  28.8k|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2216|  28.8k|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2217|  28.8k|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2217:12): [True: 0, False: 28.8k]
  ------------------
 2218|  28.8k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2218:20): [True: 0, False: 0]
  ------------------
 2219|  28.8k|        return UA_ORDER_EQ;                                               \
 2220|  28.8k|    }
ua_types.c:int32Order:
 2214|   784k|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2215|   784k|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2216|   784k|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2217|   784k|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2217:12): [True: 0, False: 784k]
  ------------------
 2218|   784k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2218:20): [True: 0, False: 0]
  ------------------
 2219|   784k|        return UA_ORDER_EQ;                                               \
 2220|   784k|    }
ua_types.c:uInt32Order:
 2214|   924k|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2215|   924k|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2216|   924k|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2217|   924k|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2217:12): [True: 0, False: 924k]
  ------------------
 2218|   924k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2218:20): [True: 0, False: 0]
  ------------------
 2219|   924k|        return UA_ORDER_EQ;                                               \
 2220|   924k|    }
ua_types.c:int64Order:
 2214|   690k|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2215|   690k|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2216|   690k|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2217|   690k|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2217:12): [True: 0, False: 690k]
  ------------------
 2218|   690k|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2218:20): [True: 0, False: 0]
  ------------------
 2219|   690k|        return UA_ORDER_EQ;                                               \
 2220|   690k|    }
ua_types.c:uInt64Order:
 2214|  1.31M|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2215|  1.31M|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2216|  1.31M|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2217|  1.31M|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2217:12): [True: 0, False: 1.31M]
  ------------------
 2218|  1.31M|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2218:20): [True: 0, False: 0]
  ------------------
 2219|  1.31M|        return UA_ORDER_EQ;                                               \
 2220|  1.31M|    }
ua_types.c:floatOrder:
 2234|  54.7k|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2235|  54.7k|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2236|  54.7k|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2237|  54.7k|        if(*p1 != *p2) {                                                  \
  ------------------
  |  Branch (2237:12): [True: 540, False: 54.1k]
  ------------------
 2238|    540|            /* p1 is NaN */                                         \
 2239|    540|            if(*p1 != *p1) {                                        \
  ------------------
  |  Branch (2239:16): [True: 540, False: 0]
  ------------------
 2240|    540|                if(*p2 != *p2)                                      \
  ------------------
  |  Branch (2240:20): [True: 540, False: 0]
  ------------------
 2241|    540|                    return UA_ORDER_EQ;                             \
 2242|    540|                return UA_ORDER_LESS;                               \
 2243|    540|            }                                                       \
 2244|    540|            /* p2 is NaN */                                         \
 2245|    540|            if(*p2 != *p2)                                          \
  ------------------
  |  Branch (2245:16): [True: 0, False: 0]
  ------------------
 2246|      0|                return UA_ORDER_MORE;                               \
 2247|      0|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2247:20): [True: 0, False: 0]
  ------------------
 2248|      0|        }                                                           \
 2249|  54.7k|        return UA_ORDER_EQ;                                         \
 2250|  54.7k|    }
ua_types.c:doubleOrder:
 2234|   319k|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2235|   319k|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2236|   319k|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2237|   319k|        if(*p1 != *p2) {                                                  \
  ------------------
  |  Branch (2237:12): [True: 280, False: 319k]
  ------------------
 2238|    280|            /* p1 is NaN */                                         \
 2239|    280|            if(*p1 != *p1) {                                        \
  ------------------
  |  Branch (2239:16): [True: 280, False: 0]
  ------------------
 2240|    280|                if(*p2 != *p2)                                      \
  ------------------
  |  Branch (2240:20): [True: 280, False: 0]
  ------------------
 2241|    280|                    return UA_ORDER_EQ;                             \
 2242|    280|                return UA_ORDER_LESS;                               \
 2243|    280|            }                                                       \
 2244|    280|            /* p2 is NaN */                                         \
 2245|    280|            if(*p2 != *p2)                                          \
  ------------------
  |  Branch (2245:16): [True: 0, False: 0]
  ------------------
 2246|      0|                return UA_ORDER_MORE;                               \
 2247|      0|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2247:20): [True: 0, False: 0]
  ------------------
 2248|      0|        }                                                           \
 2249|   319k|        return UA_ORDER_EQ;                                         \
 2250|   319k|    }
ua_types.c:stringOrder:
 2272|  1.77M|stringOrder(const void *p1_, const void *p2_, const UA_DataType *type) {
 2273|  1.77M|    const UA_String *p1 = (const UA_String*)p1_;
 2274|  1.77M|    const UA_String *p2 = (const UA_String*)p2_;
 2275|  1.77M|    if(p1->length != p2->length)
  ------------------
  |  Branch (2275:8): [True: 0, False: 1.77M]
  ------------------
 2276|      0|        return (p1->length < p2->length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2276:16): [True: 0, False: 0]
  ------------------
 2277|       |    /* For zero-length arrays, every pointer not NULL is considered a
 2278|       |     * UA_EMPTY_ARRAY_SENTINEL. */
 2279|  1.77M|    if(p1->data == p2->data) return UA_ORDER_EQ;
  ------------------
  |  Branch (2279:8): [True: 1.71M, False: 63.2k]
  ------------------
 2280|  63.2k|    if(p1->data == NULL) return UA_ORDER_LESS;
  ------------------
  |  Branch (2280:8): [True: 0, False: 63.2k]
  ------------------
 2281|  63.2k|    if(p2->data == NULL) return UA_ORDER_MORE;
  ------------------
  |  Branch (2281:8): [True: 0, False: 63.2k]
  ------------------
 2282|  63.2k|    int cmp = memcmp((const char*)p1->data, (const char*)p2->data, p1->length);
 2283|  63.2k|    if(cmp != 0)
  ------------------
  |  Branch (2283:8): [True: 0, False: 63.2k]
  ------------------
 2284|      0|        return (cmp < 0) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2284:16): [True: 0, False: 0]
  ------------------
 2285|  63.2k|    return UA_ORDER_EQ;
 2286|  63.2k|}
ua_types.c:qualifiedNameOrder:
 2329|  62.2k|qualifiedNameOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2330|  62.2k|    const UA_QualifiedName *p1 = (const UA_QualifiedName*)p1_;
 2331|  62.2k|    const UA_QualifiedName *p2 = (const UA_QualifiedName*)p2_;
 2332|  62.2k|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2332:8): [True: 0, False: 62.2k]
  ------------------
 2333|      0|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2333:16): [True: 0, False: 0]
  ------------------
 2334|  62.2k|    return stringOrder(&p1->name, &p2->name, NULL);
 2335|  62.2k|}
ua_types.c:localizedTextOrder:
 2338|   840k|localizedTextOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2339|   840k|    const UA_LocalizedText *p1 = (const UA_LocalizedText*)p1_;
 2340|   840k|    const UA_LocalizedText *p2 = (const UA_LocalizedText*)p2_;
 2341|   840k|    UA_Order o = stringOrder(&p1->locale, &p2->locale, NULL);
 2342|   840k|    if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2342:8): [True: 0, False: 840k]
  ------------------
 2343|      0|        return o;
 2344|   840k|    return stringOrder(&p1->text, &p2->text, NULL);
 2345|   840k|}
ua_types.c:extensionObjectOrder:
 2348|  1.76k|extensionObjectOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2349|  1.76k|    const UA_ExtensionObject *p1 = (const UA_ExtensionObject*)p1_;
 2350|  1.76k|    const UA_ExtensionObject *p2 = (const UA_ExtensionObject*)p2_;
 2351|  1.76k|    UA_ExtensionObjectEncoding enc1 = p1->encoding;
 2352|  1.76k|    UA_ExtensionObjectEncoding enc2 = p2->encoding;
 2353|  1.76k|    if(enc1 > UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2353:8): [True: 0, False: 1.76k]
  ------------------
 2354|      0|        enc1 = UA_EXTENSIONOBJECT_DECODED;
 2355|  1.76k|    if(enc2 > UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2355:8): [True: 0, False: 1.76k]
  ------------------
 2356|      0|        enc2 = UA_EXTENSIONOBJECT_DECODED;
 2357|  1.76k|    if(enc1 != enc2)
  ------------------
  |  Branch (2357:8): [True: 0, False: 1.76k]
  ------------------
 2358|      0|        return (enc1 < enc2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2358:16): [True: 0, False: 0]
  ------------------
 2359|       |
 2360|  1.76k|    switch(enc1) {
 2361|  1.76k|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (2361:5): [True: 1.76k, False: 0]
  ------------------
 2362|  1.76k|        return UA_ORDER_EQ;
 2363|       |
 2364|      0|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (2364:5): [True: 0, False: 1.76k]
  ------------------
 2365|      0|    case UA_EXTENSIONOBJECT_ENCODED_XML: {
  ------------------
  |  Branch (2365:5): [True: 0, False: 1.76k]
  ------------------
 2366|      0|            UA_Order o = nodeIdOrder(&p1->content.encoded.typeId,
 2367|      0|                                     &p2->content.encoded.typeId, NULL);
 2368|      0|            if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2368:16): [True: 0, False: 0]
  ------------------
 2369|      0|                return o;
 2370|      0|            return stringOrder((const UA_String*)&p1->content.encoded.body,
 2371|      0|                               (const UA_String*)&p2->content.encoded.body, NULL);
 2372|      0|        }
 2373|       |
 2374|      0|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (2374:5): [True: 0, False: 1.76k]
  ------------------
 2375|      0|    default: {
  ------------------
  |  Branch (2375:5): [True: 0, False: 1.76k]
  ------------------
 2376|      0|            const UA_DataType *type1 = p1->content.decoded.type;
 2377|      0|            const UA_DataType *type2 = p2->content.decoded.type;
 2378|      0|            if(type1 != type2)
  ------------------
  |  Branch (2378:16): [True: 0, False: 0]
  ------------------
 2379|      0|                return ((uintptr_t)type1 < (uintptr_t)type2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2379:24): [True: 0, False: 0]
  ------------------
 2380|      0|            if(!type1)
  ------------------
  |  Branch (2380:16): [True: 0, False: 0]
  ------------------
 2381|      0|                return UA_ORDER_EQ;
 2382|      0|            return orderJumpTable[type1->typeKind]
 2383|      0|                (p1->content.decoded.data, p2->content.decoded.data, type1);
 2384|      0|        }
 2385|  1.76k|    }
 2386|  1.76k|}
ua_types.c:dataValueOrder:
 2450|  55.2k|dataValueOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2451|  55.2k|    const UA_DataValue *p1 = (const UA_DataValue*)p1_;
 2452|  55.2k|    const UA_DataValue *p2 = (const UA_DataValue*)p2_;
 2453|       |    /* Value */
 2454|  55.2k|    if(p1->hasValue != p2->hasValue)
  ------------------
  |  Branch (2454:8): [True: 0, False: 55.2k]
  ------------------
 2455|      0|        return (!p1->hasValue) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2455:16): [True: 0, False: 0]
  ------------------
 2456|  55.2k|    if(p1->hasValue) {
  ------------------
  |  Branch (2456:8): [True: 19.3k, False: 35.9k]
  ------------------
 2457|  19.3k|        UA_Order o = variantOrder(&p1->value, &p2->value, NULL);
 2458|  19.3k|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2458:12): [True: 0, False: 19.3k]
  ------------------
 2459|      0|            return o;
 2460|  19.3k|    }
 2461|       |
 2462|       |    /* Status */
 2463|  55.2k|    if(p1->hasStatus != p2->hasStatus)
  ------------------
  |  Branch (2463:8): [True: 0, False: 55.2k]
  ------------------
 2464|      0|        return (!p1->hasStatus) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2464:16): [True: 0, False: 0]
  ------------------
 2465|  55.2k|    if(p1->hasStatus && p1->status != p2->status)
  ------------------
  |  Branch (2465:8): [True: 7, False: 55.2k]
  |  Branch (2465:25): [True: 0, False: 7]
  ------------------
 2466|      0|        return (p1->status < p2->status) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2466:16): [True: 0, False: 0]
  ------------------
 2467|       |
 2468|       |    /* SourceTimestamp */
 2469|  55.2k|    if(p1->hasSourceTimestamp != p2->hasSourceTimestamp)
  ------------------
  |  Branch (2469:8): [True: 0, False: 55.2k]
  ------------------
 2470|      0|        return (!p1->hasSourceTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2470:16): [True: 0, False: 0]
  ------------------
 2471|  55.2k|    if(p1->hasSourceTimestamp && p1->sourceTimestamp != p2->sourceTimestamp)
  ------------------
  |  Branch (2471:8): [True: 0, False: 55.2k]
  |  Branch (2471:34): [True: 0, False: 0]
  ------------------
 2472|      0|        return (p1->sourceTimestamp < p2->sourceTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2472:16): [True: 0, False: 0]
  ------------------
 2473|       |
 2474|       |    /* ServerTimestamp */
 2475|  55.2k|    if(p1->hasServerTimestamp != p2->hasServerTimestamp)
  ------------------
  |  Branch (2475:8): [True: 0, False: 55.2k]
  ------------------
 2476|      0|        return (!p1->hasServerTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2476:16): [True: 0, False: 0]
  ------------------
 2477|  55.2k|    if(p1->hasServerTimestamp && p1->serverTimestamp != p2->serverTimestamp)
  ------------------
  |  Branch (2477:8): [True: 0, False: 55.2k]
  |  Branch (2477:34): [True: 0, False: 0]
  ------------------
 2478|      0|        return (p1->serverTimestamp < p2->serverTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2478:16): [True: 0, False: 0]
  ------------------
 2479|       |
 2480|       |    /* SourcePicoseconds */
 2481|  55.2k|    if(p1->hasSourcePicoseconds != p2->hasSourcePicoseconds)
  ------------------
  |  Branch (2481:8): [True: 0, False: 55.2k]
  ------------------
 2482|      0|        return (!p1->hasSourcePicoseconds) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2482:16): [True: 0, False: 0]
  ------------------
 2483|  55.2k|    if(p1->hasSourcePicoseconds && p1->sourcePicoseconds != p2->sourcePicoseconds)
  ------------------
  |  Branch (2483:8): [True: 0, False: 55.2k]
  |  Branch (2483:36): [True: 0, False: 0]
  ------------------
 2484|      0|        return (p1->sourcePicoseconds < p2->sourcePicoseconds) ?
  ------------------
  |  Branch (2484:16): [True: 0, False: 0]
  ------------------
 2485|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2486|       |
 2487|       |    /* ServerPicoseconds */
 2488|  55.2k|    if(p1->hasServerPicoseconds != p2->hasServerPicoseconds)
  ------------------
  |  Branch (2488:8): [True: 0, False: 55.2k]
  ------------------
 2489|      0|        return (!p1->hasServerPicoseconds) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2489:16): [True: 0, False: 0]
  ------------------
 2490|  55.2k|    if(p1->hasServerPicoseconds && p1->serverPicoseconds != p2->serverPicoseconds)
  ------------------
  |  Branch (2490:8): [True: 0, False: 55.2k]
  |  Branch (2490:36): [True: 0, False: 0]
  ------------------
 2491|      0|        return (p1->serverPicoseconds < p2->serverPicoseconds) ?
  ------------------
  |  Branch (2491:16): [True: 0, False: 0]
  ------------------
 2492|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2493|       |
 2494|  55.2k|    return UA_ORDER_EQ;
 2495|  55.2k|}
ua_types.c:variantOrder:
 2413|   102k|variantOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2414|   102k|    const UA_Variant *p1 = (const UA_Variant*)p1_;
 2415|   102k|    const UA_Variant *p2 = (const UA_Variant*)p2_;
 2416|   102k|    if(p1->type != p2->type)
  ------------------
  |  Branch (2416:8): [True: 0, False: 102k]
  ------------------
 2417|      0|        return ((uintptr_t)p1->type < (uintptr_t)p2->type) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2417:16): [True: 0, False: 0]
  ------------------
 2418|       |
 2419|   102k|    UA_Order o;
 2420|   102k|    if(p1->type != NULL) {
  ------------------
  |  Branch (2420:8): [True: 41.0k, False: 61.3k]
  ------------------
 2421|       |        /* Check if both variants are scalars or arrays */
 2422|  41.0k|        UA_Boolean s1 = UA_Variant_isScalar(p1);
 2423|  41.0k|        UA_Boolean s2 = UA_Variant_isScalar(p2);
 2424|  41.0k|        if(s1 != s2)
  ------------------
  |  Branch (2424:12): [True: 0, False: 41.0k]
  ------------------
 2425|      0|            return s1 ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2425:20): [True: 0, False: 0]
  ------------------
 2426|  41.0k|        if(s1) {
  ------------------
  |  Branch (2426:12): [True: 35.5k, False: 5.49k]
  ------------------
 2427|  35.5k|            o = orderJumpTable[p1->type->typeKind](p1->data, p2->data, p1->type);
 2428|  35.5k|        } else {
 2429|       |            /* Mismatching array length? */
 2430|  5.49k|            if(p1->arrayLength != p2->arrayLength)
  ------------------
  |  Branch (2430:16): [True: 0, False: 5.49k]
  ------------------
 2431|      0|                return (p1->arrayLength < p2->arrayLength) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2431:24): [True: 0, False: 0]
  ------------------
 2432|  5.49k|            o = arrayOrder(p1->data, p1->arrayLength, p2->data, p2->arrayLength, p1->type);
 2433|  5.49k|        }
 2434|  41.0k|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2434:12): [True: 0, False: 41.0k]
  ------------------
 2435|      0|            return o;
 2436|  41.0k|    }
 2437|       |
 2438|   102k|    if(p1->arrayDimensionsSize != p2->arrayDimensionsSize)
  ------------------
  |  Branch (2438:8): [True: 0, False: 102k]
  ------------------
 2439|      0|        return (p1->arrayDimensionsSize < p2->arrayDimensionsSize) ?
  ------------------
  |  Branch (2439:16): [True: 0, False: 0]
  ------------------
 2440|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2441|   102k|    o = UA_ORDER_EQ;
 2442|   102k|    if(p1->arrayDimensionsSize > 0)
  ------------------
  |  Branch (2442:8): [True: 1.47k, False: 100k]
  ------------------
 2443|  1.47k|        o = arrayOrder(p1->arrayDimensions, p1->arrayDimensionsSize,
 2444|  1.47k|                       p2->arrayDimensions, p2->arrayDimensionsSize,
 2445|  1.47k|                       &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  225|  1.47k|#define UA_TYPES_UINT32 6
  ------------------
 2446|   102k|    return o;
 2447|   102k|}
ua_types.c:arrayOrder:
 2397|  6.96k|           const UA_DataType *type) {
 2398|  6.96k|    if(p1Length != p2Length)
  ------------------
  |  Branch (2398:8): [True: 0, False: 6.96k]
  ------------------
 2399|      0|        return (p1Length < p2Length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2399:16): [True: 0, False: 0]
  ------------------
 2400|  6.96k|    uintptr_t u1 = (uintptr_t)p1;
 2401|  6.96k|    uintptr_t u2 = (uintptr_t)p2;
 2402|  5.18M|    for(size_t i = 0; i < p1Length; i++) {
  ------------------
  |  Branch (2402:23): [True: 5.17M, False: 6.96k]
  ------------------
 2403|  5.17M|        UA_Order o = orderJumpTable[type->typeKind]((const void*)u1, (const void*)u2, type);
 2404|  5.17M|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2404:12): [True: 0, False: 5.17M]
  ------------------
 2405|      0|            return o;
 2406|  5.17M|        u1 += type->memSize;
 2407|  5.17M|        u2 += type->memSize;
 2408|  5.17M|    }
 2409|  6.96k|    return UA_ORDER_EQ;
 2410|  6.96k|}
ua_types.c:diagnosticInfoOrder:
 2498|    612|diagnosticInfoOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2499|    612|    const UA_DiagnosticInfo *p1 = (const UA_DiagnosticInfo*)p1_;
 2500|    612|    const UA_DiagnosticInfo *p2 = (const UA_DiagnosticInfo*)p2_;
 2501|       |    /* SymbolicId */
 2502|    612|    if(p1->hasSymbolicId != p2->hasSymbolicId)
  ------------------
  |  Branch (2502:8): [True: 0, False: 612]
  ------------------
 2503|      0|        return (!p1->hasSymbolicId) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2503:16): [True: 0, False: 0]
  ------------------
 2504|    612|    if(p1->hasSymbolicId && p1->symbolicId != p2->symbolicId)
  ------------------
  |  Branch (2504:8): [True: 0, False: 612]
  |  Branch (2504:29): [True: 0, False: 0]
  ------------------
 2505|      0|        return (p1->symbolicId < p2->symbolicId) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2505:16): [True: 0, False: 0]
  ------------------
 2506|       |
 2507|       |    /* NamespaceUri */
 2508|    612|    if(p1->hasNamespaceUri != p2->hasNamespaceUri)
  ------------------
  |  Branch (2508:8): [True: 0, False: 612]
  ------------------
 2509|      0|        return (!p1->hasNamespaceUri) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2509:16): [True: 0, False: 0]
  ------------------
 2510|    612|    if(p1->hasNamespaceUri && p1->namespaceUri != p2->namespaceUri)
  ------------------
  |  Branch (2510:8): [True: 0, False: 612]
  |  Branch (2510:31): [True: 0, False: 0]
  ------------------
 2511|      0|        return (p1->namespaceUri < p2->namespaceUri) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2511:16): [True: 0, False: 0]
  ------------------
 2512|       |
 2513|       |    /* LocalizedText */
 2514|    612|    if(p1->hasLocalizedText != p2->hasLocalizedText)
  ------------------
  |  Branch (2514:8): [True: 0, False: 612]
  ------------------
 2515|      0|        return (!p1->hasLocalizedText) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2515:16): [True: 0, False: 0]
  ------------------
 2516|    612|    if(p1->hasLocalizedText && p1->localizedText != p2->localizedText)
  ------------------
  |  Branch (2516:8): [True: 0, False: 612]
  |  Branch (2516:32): [True: 0, False: 0]
  ------------------
 2517|      0|        return (p1->localizedText < p2->localizedText) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2517:16): [True: 0, False: 0]
  ------------------
 2518|       |
 2519|       |    /* Locale */
 2520|    612|    if(p1->hasLocale != p2->hasLocale)
  ------------------
  |  Branch (2520:8): [True: 0, False: 612]
  ------------------
 2521|      0|        return (!p1->hasLocale) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2521:16): [True: 0, False: 0]
  ------------------
 2522|    612|    if(p1->hasLocale && p1->locale != p2->locale)
  ------------------
  |  Branch (2522:8): [True: 0, False: 612]
  |  Branch (2522:25): [True: 0, False: 0]
  ------------------
 2523|      0|        return (p1->locale < p2->locale) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2523:16): [True: 0, False: 0]
  ------------------
 2524|       |
 2525|       |    /* AdditionalInfo */
 2526|    612|    if(p1->hasAdditionalInfo != p2->hasAdditionalInfo)
  ------------------
  |  Branch (2526:8): [True: 0, False: 612]
  ------------------
 2527|      0|        return (!p1->hasAdditionalInfo) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2527:16): [True: 0, False: 0]
  ------------------
 2528|    612|    if(p1->hasAdditionalInfo) {
  ------------------
  |  Branch (2528:8): [True: 0, False: 612]
  ------------------
 2529|      0|        UA_Order o = stringOrder(&p1->additionalInfo, &p2->additionalInfo, NULL);
 2530|      0|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2530:12): [True: 0, False: 0]
  ------------------
 2531|      0|            return o;
 2532|      0|    }
 2533|       |
 2534|       |    /* InnerStatusCode */
 2535|    612|    if(p1->hasInnerStatusCode != p2->hasInnerStatusCode)
  ------------------
  |  Branch (2535:8): [True: 0, False: 612]
  ------------------
 2536|      0|        return (!p1->hasInnerStatusCode) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2536:16): [True: 0, False: 0]
  ------------------
 2537|    612|    if(p1->hasInnerStatusCode && p1->innerStatusCode != p2->innerStatusCode)
  ------------------
  |  Branch (2537:8): [True: 0, False: 612]
  |  Branch (2537:34): [True: 0, False: 0]
  ------------------
 2538|      0|        return (p1->innerStatusCode < p2->innerStatusCode) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2538:16): [True: 0, False: 0]
  ------------------
 2539|       |
 2540|       |    /* InnerDiagnosticInfo */
 2541|    612|    if(p1->hasInnerDiagnosticInfo != p2->hasInnerDiagnosticInfo)
  ------------------
  |  Branch (2541:8): [True: 0, False: 612]
  ------------------
 2542|      0|        return (!p1->hasInnerDiagnosticInfo) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2542:16): [True: 0, False: 0]
  ------------------
 2543|    612|    if(p1->innerDiagnosticInfo == p2->innerDiagnosticInfo)
  ------------------
  |  Branch (2543:8): [True: 612, False: 0]
  ------------------
 2544|    612|        return UA_ORDER_EQ;
 2545|      0|    if(!p1->innerDiagnosticInfo || !p2->innerDiagnosticInfo)
  ------------------
  |  Branch (2545:8): [True: 0, False: 0]
  |  Branch (2545:36): [True: 0, False: 0]
  ------------------
 2546|      0|        return (!p1->innerDiagnosticInfo) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2546:16): [True: 0, False: 0]
  ------------------
 2547|      0|    return diagnosticInfoOrder(p1->innerDiagnosticInfo, p2->innerDiagnosticInfo, NULL);
 2548|      0|}

writeJsonBeforeElement:
   80|  20.8M|writeJsonBeforeElement(CtxJson *ctx, UA_Boolean distinct) {
   81|  20.8M|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  20.8M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   82|       |    /* Comma if needed */
   83|  20.8M|    if(ctx->commaNeeded[ctx->depth])
  ------------------
  |  Branch (83:8): [True: 18.1M, False: 2.65M]
  ------------------
   84|  18.1M|        res |= writeChar(ctx, ',');
   85|  20.8M|    if(ctx->prettyPrint) {
  ------------------
  |  Branch (85:8): [True: 0, False: 20.8M]
  ------------------
   86|      0|        if(distinct) {
  ------------------
  |  Branch (86:12): [True: 0, False: 0]
  ------------------
   87|       |            /* Newline and indent if needed */
   88|      0|            res |= writeChar(ctx, '\n');
   89|      0|            for(size_t i = 0; i < ctx->depth; i++)
  ------------------
  |  Branch (89:31): [True: 0, False: 0]
  ------------------
   90|      0|                res |= writeChar(ctx, '\t');
   91|      0|        } else if(ctx->commaNeeded[ctx->depth]) {
  ------------------
  |  Branch (91:19): [True: 0, False: 0]
  ------------------
   92|       |            /* Space after the comma if no newline */
   93|      0|            res |= writeChar(ctx, ' ');
   94|      0|        }
   95|      0|    }
   96|  20.8M|    return res;
   97|  20.8M|}
writeJsonObjStart:
   99|  2.94M|WRITE_JSON_ELEMENT(ObjStart) {
  100|       |    /* Increase depth, save: before first key-value no comma needed. */
  101|  2.94M|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|  2.94M|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (101:8): [True: 0, False: 2.94M]
  ------------------
  102|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  103|  2.94M|    ctx->depth++;
  104|       |    ctx->commaNeeded[ctx->depth] = false;
  105|  2.94M|    return writeChar(ctx, '{');
  106|  2.94M|}
writeJsonObjEnd:
  108|  2.94M|WRITE_JSON_ELEMENT(ObjEnd) {
  109|  2.94M|    if(ctx->depth == 0)
  ------------------
  |  Branch (109:8): [True: 0, False: 2.94M]
  ------------------
  110|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  111|       |
  112|  2.94M|    UA_Boolean have_elem = ctx->commaNeeded[ctx->depth];
  113|  2.94M|    ctx->depth--;
  114|  2.94M|    ctx->commaNeeded[ctx->depth] = true;
  115|       |
  116|  2.94M|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  2.94M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  117|  2.94M|    if(ctx->prettyPrint && have_elem) {
  ------------------
  |  Branch (117:8): [True: 0, False: 2.94M]
  |  Branch (117:28): [True: 0, False: 0]
  ------------------
  118|      0|        res |= writeChar(ctx, '\n');
  119|      0|        for(size_t i = 0; i < ctx->depth; i++)
  ------------------
  |  Branch (119:27): [True: 0, False: 0]
  ------------------
  120|      0|            res |= writeChar(ctx, '\t');
  121|      0|    }
  122|  2.94M|    return res | writeChar(ctx, '}');
  123|  2.94M|}
writeJsonArrStart:
  125|  20.8k|WRITE_JSON_ELEMENT(ArrStart) {
  126|       |    /* Increase depth, save: before first array entry no comma needed. */
  127|  20.8k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|  20.8k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (127:8): [True: 0, False: 20.8k]
  ------------------
  128|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  129|  20.8k|    ctx->depth++;
  130|       |    ctx->commaNeeded[ctx->depth] = false;
  131|  20.8k|    return writeChar(ctx, '[');
  132|  20.8k|}
writeJsonArrEnd:
  135|  20.8k|writeJsonArrEnd(CtxJson *ctx, const UA_DataType *type) {
  136|  20.8k|    if(ctx->depth == 0)
  ------------------
  |  Branch (136:8): [True: 0, False: 20.8k]
  ------------------
  137|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  138|  20.8k|    UA_Boolean have_elem = ctx->commaNeeded[ctx->depth];
  139|  20.8k|    ctx->depth--;
  140|  20.8k|    ctx->commaNeeded[ctx->depth] = true;
  141|       |
  142|       |    /* If the array does not contain JSON objects (with a newline after), then
  143|       |     * add the closing ] on the same line */
  144|  20.8k|    UA_Boolean distinct = (!type || type->typeKind > UA_DATATYPEKIND_DOUBLE);
  ------------------
  |  Branch (144:28): [True: 0, False: 20.8k]
  |  Branch (144:37): [True: 6.87k, False: 14.0k]
  ------------------
  145|  20.8k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  20.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  146|  20.8k|    if(ctx->prettyPrint && have_elem && distinct) {
  ------------------
  |  Branch (146:8): [True: 0, False: 20.8k]
  |  Branch (146:28): [True: 0, False: 0]
  |  Branch (146:41): [True: 0, False: 0]
  ------------------
  147|      0|        res |= writeChar(ctx, '\n');
  148|      0|        for(size_t i = 0; i < ctx->depth; i++)
  ------------------
  |  Branch (148:27): [True: 0, False: 0]
  ------------------
  149|      0|            res |= writeChar(ctx, '\t');
  150|      0|    }
  151|  20.8k|    return res | writeChar(ctx, ']');
  152|  20.8k|}
writeJsonArrElm:
  156|  12.7M|                const UA_DataType *type) {
  157|  12.7M|    UA_Boolean distinct = (type->typeKind > UA_DATATYPEKIND_DOUBLE);
  158|  12.7M|    status ret = writeJsonBeforeElement(ctx, distinct);
  159|       |    ctx->commaNeeded[ctx->depth] = true;
  160|  12.7M|    return ret | encodeJsonJumpTable[type->typeKind](ctx, value, type);
  161|  12.7M|}
writeJsonKey:
  206|  5.29M|writeJsonKey(CtxJson *ctx, const char* key) {
  207|  5.29M|    status ret = writeJsonBeforeElement(ctx, true);
  208|  5.29M|    ctx->commaNeeded[ctx->depth] = true;
  209|  5.29M|    if(!ctx->unquotedKeys)
  ------------------
  |  Branch (209:8): [True: 5.29M, False: 0]
  ------------------
  210|  5.29M|        ret |= writeChar(ctx, '\"');
  211|  5.29M|    ret |= writeChars(ctx, key, strlen(key));
  212|  5.29M|    if(!ctx->unquotedKeys)
  ------------------
  |  Branch (212:8): [True: 5.29M, False: 0]
  ------------------
  213|  5.29M|        ret |= writeChar(ctx, '\"');
  214|  5.29M|    ret |= writeChar(ctx, ':');
  215|  5.29M|    if(ctx->prettyPrint)
  ------------------
  |  Branch (215:8): [True: 0, False: 5.29M]
  ------------------
  216|      0|        ret |= writeChar(ctx, ' ');
  217|  5.29M|    return ret;
  218|  5.29M|}
UA_encodeJson:
  926|  4.04k|              const UA_EncodeJsonOptions *options) {
  927|  4.04k|    if(!src || !type)
  ------------------
  |  Branch (927:8): [True: 0, False: 4.04k]
  |  Branch (927:16): [True: 0, False: 4.04k]
  ------------------
  928|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
  929|       |
  930|       |    /* Allocate buffer */
  931|  4.04k|    UA_Boolean allocated = false;
  932|  4.04k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.04k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  933|  4.04k|    if(outBuf->length == 0) {
  ------------------
  |  Branch (933:8): [True: 0, False: 4.04k]
  ------------------
  934|      0|        size_t len = UA_calcSizeJson(src, type, options);
  935|      0|        res = UA_ByteString_allocBuffer(outBuf, len);
  936|      0|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (936:12): [True: 0, False: 0]
  ------------------
  937|      0|            return res;
  938|      0|        allocated = true;
  939|      0|    }
  940|       |
  941|       |    /* Set up the context */
  942|  4.04k|    CtxJson ctx;
  943|  4.04k|    memset(&ctx, 0, sizeof(ctx));
  944|  4.04k|    ctx.pos = outBuf->data;
  945|  4.04k|    ctx.end = &outBuf->data[outBuf->length];
  946|  4.04k|    ctx.depth = 0;
  947|  4.04k|    ctx.calcOnly = false;
  948|  4.04k|    ctx.useReversible = true; /* default */
  949|  4.04k|    if(options) {
  ------------------
  |  Branch (949:8): [True: 0, False: 4.04k]
  ------------------
  950|      0|        ctx.namespaceMapping = options->namespaceMapping;
  951|      0|        ctx.serverUris = options->serverUris;
  952|      0|        ctx.serverUrisSize = options->serverUrisSize;
  953|      0|        ctx.useReversible = options->useReversible;
  954|      0|        ctx.prettyPrint = options->prettyPrint;
  955|      0|        ctx.unquotedKeys = options->unquotedKeys;
  956|      0|        ctx.stringNodeIds = options->stringNodeIds;
  957|      0|    }
  958|       |
  959|       |    /* Encode */
  960|  4.04k|    res = encodeJsonJumpTable[type->typeKind](&ctx, src, type);
  961|       |
  962|       |    /* Clean up */
  963|  4.04k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  4.04k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (963:8): [True: 4.04k, False: 0]
  ------------------
  964|  4.04k|        outBuf->length = (size_t)((uintptr_t)ctx.pos - (uintptr_t)outBuf->data);
  965|      0|    else if(allocated)
  ------------------
  |  Branch (965:13): [True: 0, False: 0]
  ------------------
  966|      0|        UA_ByteString_clear(outBuf);
  967|  4.04k|    return res;
  968|  4.04k|}
UA_calcSizeJson:
  993|  2.02k|                const UA_EncodeJsonOptions *options) {
  994|  2.02k|    if(!src || !type)
  ------------------
  |  Branch (994:8): [True: 0, False: 2.02k]
  |  Branch (994:16): [True: 0, False: 2.02k]
  ------------------
  995|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
  996|       |
  997|       |    /* Set up the context */
  998|  2.02k|    CtxJson ctx;
  999|  2.02k|    memset(&ctx, 0, sizeof(ctx));
 1000|  2.02k|    ctx.pos = (UA_Byte*)0x01;
 1001|  2.02k|    ctx.end = (const UA_Byte*)(uintptr_t)SIZE_MAX;
 1002|  2.02k|    ctx.depth = 0;
 1003|  2.02k|    ctx.useReversible = true; /* default */
 1004|  2.02k|    if(options) {
  ------------------
  |  Branch (1004:8): [True: 0, False: 2.02k]
  ------------------
 1005|      0|        ctx.namespaceMapping = options->namespaceMapping;
 1006|      0|        ctx.serverUris = options->serverUris;
 1007|      0|        ctx.serverUrisSize = options->serverUrisSize;
 1008|      0|        ctx.useReversible = options->useReversible;
 1009|      0|        ctx.prettyPrint = options->prettyPrint;
 1010|      0|        ctx.unquotedKeys = options->unquotedKeys;
 1011|      0|        ctx.stringNodeIds = options->stringNodeIds;
 1012|      0|    }
 1013|       |
 1014|  2.02k|    ctx.calcOnly = true;
 1015|       |
 1016|       |    /* Encode */
 1017|  2.02k|    status ret = encodeJsonJumpTable[type->typeKind](&ctx, src, type);
 1018|  2.02k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  2.02k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1018:8): [True: 0, False: 2.02k]
  ------------------
 1019|      0|        return 0;
 1020|  2.02k|    return ((size_t)ctx.pos) - 1u;
 1021|  2.02k|}
lookAheadForKey:
 1437|   260k|lookAheadForKey(ParseCtx *ctx, const char *key, size_t *resultIndex) {
 1438|       |    /* The current index must point to the beginning of an object.
 1439|       |     * This has to be ensured by the caller. */
 1440|   260k|    UA_assert(currentTokenType(ctx) == CJ5_TOKEN_OBJECT);
  ------------------
  |  |  399|   260k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1440:5): [True: 260k, False: 0]
  ------------------
 1441|       |
 1442|   260k|    status ret = UA_STATUSCODE_BADNOTFOUND;
  ------------------
  |  |  233|   260k|#define UA_STATUSCODE_BADNOTFOUND ((UA_StatusCode) 0x803E0000)
  ------------------
 1443|   260k|    size_t oldIndex = ctx->index; /* Save index for later restore */
 1444|   260k|    unsigned int end = ctx->tokens[ctx->index].end;
 1445|   260k|    ctx->index++; /* Move to the first key */
 1446|   608k|    while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1446:11): [True: 603k, False: 5.26k]
  ------------------
 1447|   603k|          ctx->tokens[ctx->index].start < end) {
  ------------------
  |  Branch (1447:11): [True: 501k, False: 102k]
  ------------------
 1448|       |        /* Key must be a string */
 1449|   501k|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  399|   501k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1449:9): [True: 501k, False: 0]
  ------------------
 1450|       |
 1451|       |        /* Move index to the value */
 1452|   501k|        ctx->index++;
 1453|       |
 1454|       |        /* Value for the key must exist */
 1455|   501k|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  399|   501k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1455:9): [True: 501k, False: 0]
  ------------------
 1456|       |
 1457|       |        /* Compare the key (previous index) */
 1458|   501k|        if(jsoneq(ctx->json5, &ctx->tokens[ctx->index-1], key) == 0) {
  ------------------
  |  Branch (1458:12): [True: 153k, False: 348k]
  ------------------
 1459|   153k|            *resultIndex = ctx->index; /* Point result to the current index */
 1460|   153k|            ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   153k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1461|   153k|            break;
 1462|   153k|        }
 1463|       |
 1464|   348k|        skipObject(ctx); /* Jump over the value (can also be an array or object) */
 1465|   348k|    }
 1466|   260k|    ctx->index = oldIndex; /* Restore the old index */
 1467|   260k|    return ret;
 1468|   260k|}
decodeFields:
 2256|  1.79M|decodeFields(ParseCtx *ctx, DecodeEntry *entries, size_t entryCount) {
 2257|  1.79M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|  1.79M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|  1.79M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 1.79M]
  |  |  ------------------
  |  | 1034|  1.79M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|  1.79M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 1.79M]
  |  |  ------------------
  ------------------
 2258|  1.79M|    CHECK_NULL_SKIP; /* null is treated like an empty object */
  ------------------
  |  | 1057|  1.79M|#define CHECK_NULL_SKIP do {                         \
  |  | 1058|  1.79M|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1058:8): [True: 0, False: 1.79M]
  |  |  ------------------
  |  | 1059|      0|        ctx->index++;                                \
  |  | 1060|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1061|  1.79M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1061:14): [Folded, False: 1.79M]
  |  |  ------------------
  ------------------
 2259|       |
 2260|  1.79M|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|  1.79M|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (2260:8): [True: 0, False: 1.79M]
  ------------------
 2261|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 2262|       |
 2263|       |    /* Keys and values are counted separately */
 2264|  1.79M|    CHECK_OBJECT;
  ------------------
  |  | 1052|  1.79M|#define CHECK_OBJECT do {                                \
  |  | 1053|  1.79M|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1053:8): [True: 0, False: 1.79M]
  |  |  ------------------
  |  | 1054|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1055|  1.79M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1055:14): [Folded, False: 1.79M]
  |  |  ------------------
  ------------------
 2265|  1.79M|    UA_assert(ctx->tokens[ctx->index].size % 2 == 0);
  ------------------
  |  |  399|  1.79M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2265:5): [True: 1.79M, False: 0]
  ------------------
 2266|  1.79M|    size_t keyCount = (size_t)(ctx->tokens[ctx->index].size) / 2;
 2267|       |
 2268|  1.79M|    ctx->index++; /* Go to first key - or jump after the empty object */
 2269|  1.79M|    ctx->depth++;
 2270|       |
 2271|  1.79M|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.79M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2272|  3.53M|    for(size_t key = 0; key < keyCount; key++) {
  ------------------
  |  Branch (2272:25): [True: 1.74M, False: 1.79M]
  ------------------
 2273|       |        /* Key must be a string */
 2274|  1.74M|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  399|  1.74M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2274:9): [True: 1.74M, False: 0]
  ------------------
 2275|  1.74M|        UA_assert(currentTokenType(ctx) == CJ5_TOKEN_STRING);
  ------------------
  |  |  399|  1.74M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2275:9): [True: 1.74M, False: 0]
  ------------------
 2276|       |
 2277|       |        /* Search for the decoding entry matching the key. Start at the key
 2278|       |         * index to speed-up the case where they key-order is the same as the
 2279|       |         * entry-order. */
 2280|  1.74M|        DecodeEntry *entry = NULL;
 2281|  1.76M|        for(size_t i = key; i < key + entryCount; i++) {
  ------------------
  |  Branch (2281:29): [True: 1.76M, False: 40]
  ------------------
 2282|  1.76M|            size_t ii = i;
 2283|  1.76M|            while(ii >= entryCount)
  ------------------
  |  Branch (2283:19): [True: 2.88k, False: 1.76M]
  ------------------
 2284|  2.88k|                ii -= entryCount;
 2285|       |
 2286|       |            /* Compare the key */
 2287|  1.76M|            if(jsoneq(ctx->json5, &ctx->tokens[ctx->index],
  ------------------
  |  Branch (2287:16): [True: 23.2k, False: 1.74M]
  ------------------
 2288|  1.76M|                      entries[ii].fieldName) != 0)
 2289|  23.2k|                continue;
 2290|       |
 2291|       |            /* Key was already used -> duplicate, abort */
 2292|  1.74M|            if(entries[ii].found) {
  ------------------
  |  Branch (2292:16): [True: 1, False: 1.74M]
  ------------------
 2293|      1|                ctx->depth--;
 2294|      1|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2295|      1|            }
 2296|       |
 2297|       |            /* Found the key */
 2298|  1.74M|            entries[ii].found = true;
 2299|  1.74M|            entry = &entries[ii];
 2300|  1.74M|            break;
 2301|  1.74M|        }
 2302|       |
 2303|       |        /* The key is unknown */
 2304|  1.74M|        if(!entry) {
  ------------------
  |  Branch (2304:12): [True: 40, False: 1.74M]
  ------------------
 2305|     40|            ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     40|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2306|     40|            break;
 2307|     40|        }
 2308|       |
 2309|       |        /* Go from key to value */
 2310|  1.74M|        ctx->index++;
 2311|  1.74M|        UA_assert(ctx->index < ctx->tokensSize);
  ------------------
  |  |  399|  1.74M|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (2311:9): [True: 1.74M, False: 0]
  ------------------
 2312|       |
 2313|       |        /* An entry that was expected but shall not be decoded.
 2314|       |         * Jump over the value. */
 2315|  1.74M|        if(!entry->function && !entry->type) {
  ------------------
  |  Branch (2315:12): [True: 1.74M, False: 0]
  |  Branch (2315:32): [True: 62.3k, False: 1.68M]
  ------------------
 2316|  62.3k|            skipObject(ctx);
 2317|  62.3k|            continue;
 2318|  62.3k|        }
 2319|       |
 2320|       |        /* A null-value, skip the decoding (the value is already initialized) */
 2321|  1.68M|        if(currentTokenType(ctx) == CJ5_TOKEN_NULL && !entry->function) {
  ------------------
  |  Branch (2321:12): [True: 1.68M, False: 86]
  |  Branch (2321:55): [True: 1.68M, False: 0]
  ------------------
 2322|  1.68M|            ctx->index++; /* skip null value */
 2323|  1.68M|            continue;
 2324|  1.68M|        }
 2325|       |
 2326|       |        /* Decode. This also moves to the next key or right after the object for
 2327|       |         * the last value. */
 2328|     86|        decodeJsonSignature decodeFunc = (entry->function) ?
  ------------------
  |  Branch (2328:42): [True: 0, False: 86]
  ------------------
 2329|     86|            entry->function : decodeJsonJumpTable[entry->type->typeKind];
 2330|     86|        ret = decodeFunc(ctx, entry->fieldPointer, entry->type);
 2331|     86|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|     86|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2331:12): [True: 4, False: 82]
  ------------------
 2332|      4|            break;
 2333|     86|    }
 2334|       |
 2335|  1.79M|    ctx->depth--;
 2336|  1.79M|    return ret;
 2337|  1.79M|}
tokenize:
 2470|  5.83k|         size_t *decodedLength) {
 2471|       |    /* Tokenize */
 2472|  5.83k|    cj5_options options;
 2473|  5.83k|    options.stop_early = (decodedLength != NULL);
 2474|  5.83k|    cj5_result r = cj5_parse((char*)src->data, (unsigned int)src->length,
 2475|  5.83k|                             ctx->tokens, (unsigned int)tokensSize, &options);
 2476|       |
 2477|       |    /* Handle overflow error by allocating the number of tokens the parser would
 2478|       |     * have needed */
 2479|  5.83k|    if(r.error == CJ5_ERROR_OVERFLOW &&
  ------------------
  |  Branch (2479:8): [True: 735, False: 5.09k]
  ------------------
 2480|    735|       tokensSize != r.num_tokens) {
  ------------------
  |  Branch (2480:8): [True: 735, False: 0]
  ------------------
 2481|    735|        ctx->tokens = (cj5_token*)
 2482|    735|            UA_malloc(sizeof(cj5_token) * r.num_tokens);
  ------------------
  |  |   18|    735|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 2483|    735|        if(!ctx->tokens)
  ------------------
  |  Branch (2483:12): [True: 0, False: 735]
  ------------------
 2484|      0|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2485|    735|        return tokenize(ctx, src, r.num_tokens, decodedLength);
 2486|    735|    }
 2487|       |
 2488|       |    /* Cannot recover from other errors */
 2489|  5.09k|    if(r.error != CJ5_ERROR_NONE)
  ------------------
  |  Branch (2489:8): [True: 140, False: 4.95k]
  ------------------
 2490|    140|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    140|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2491|       |
 2492|  4.95k|    if(decodedLength)
  ------------------
  |  Branch (2492:8): [True: 0, False: 4.95k]
  ------------------
 2493|      0|        *decodedLength = ctx->tokens[0].end + 1;
 2494|       |
 2495|       |    /* Set up the context */
 2496|  4.95k|    ctx->json5 = (char*)src->data;
 2497|  4.95k|    ctx->depth = 0;
 2498|  4.95k|    ctx->tokensSize = r.num_tokens;
 2499|  4.95k|    ctx->index = 0;
 2500|  4.95k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.95k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2501|  5.09k|}
UA_decodeJson:
 2505|  5.09k|              const UA_DecodeJsonOptions *options) {
 2506|  5.09k|    if(!dst || !src || !type)
  ------------------
  |  Branch (2506:8): [True: 0, False: 5.09k]
  |  Branch (2506:16): [True: 0, False: 5.09k]
  |  Branch (2506:24): [True: 0, False: 5.09k]
  ------------------
 2507|      0|        return UA_STATUSCODE_BADARGUMENTSMISSING;
  ------------------
  |  |  449|      0|#define UA_STATUSCODE_BADARGUMENTSMISSING ((UA_StatusCode) 0x80760000)
  ------------------
 2508|       |
 2509|       |    /* Set up the context */
 2510|  5.09k|    cj5_token tokens[UA_JSON_MAXTOKENCOUNT];
 2511|  5.09k|    ParseCtx ctx;
 2512|  5.09k|    memset(&ctx, 0, sizeof(ParseCtx));
 2513|  5.09k|    ctx.tokens = tokens;
 2514|       |
 2515|  5.09k|    if(options) {
  ------------------
  |  Branch (2515:8): [True: 0, False: 5.09k]
  ------------------
 2516|      0|        ctx.namespaceMapping = options->namespaceMapping;
 2517|      0|        ctx.serverUris = options->serverUris;
 2518|      0|        ctx.serverUrisSize = options->serverUrisSize;
 2519|      0|        ctx.customTypes = options->customTypes;
 2520|      0|    }
 2521|       |
 2522|       |    /* Decode */
 2523|  5.09k|    status ret = tokenize(&ctx, src, UA_JSON_MAXTOKENCOUNT,
  ------------------
  |  |   20|  5.09k|#define UA_JSON_MAXTOKENCOUNT 256
  ------------------
 2524|  5.09k|                          options ? options->decodedLength : NULL);
  ------------------
  |  Branch (2524:27): [True: 0, False: 5.09k]
  ------------------
 2525|  5.09k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  5.09k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2525:8): [True: 140, False: 4.95k]
  ------------------
 2526|    140|        goto cleanup;
 2527|       |
 2528|  4.95k|    memset(dst, 0, type->memSize); /* Initialize the value */
 2529|  4.95k|    ret = decodeJsonJumpTable[type->typeKind](&ctx, dst, type);
 2530|       |
 2531|       |    /* Sanity check if all tokens were processed */
 2532|  4.95k|    if(ctx.index != ctx.tokensSize &&
  ------------------
  |  Branch (2532:8): [True: 96, False: 4.86k]
  ------------------
 2533|     96|       ctx.index != ctx.tokensSize - 1)
  ------------------
  |  Branch (2533:8): [True: 74, False: 22]
  ------------------
 2534|     74|        ret = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     74|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2535|       |
 2536|  5.09k| cleanup:
 2537|       |
 2538|       |    /* Free token array on the heap */
 2539|  5.09k|    if(ctx.tokens != tokens)
  ------------------
  |  Branch (2539:8): [True: 735, False: 4.36k]
  ------------------
 2540|    735|        UA_free((void*)(uintptr_t)ctx.tokens);
  ------------------
  |  |   19|    735|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2541|       |
 2542|  5.09k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  5.09k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2542:8): [True: 1.05k, False: 4.04k]
  ------------------
 2543|  1.05k|        UA_clear(dst, type);
 2544|  5.09k|    return ret;
 2545|  4.95k|}
ua_types_encoding_json.c:writeChar:
   52|  40.5M|writeChar(CtxJson *ctx, char c) {
   53|  40.5M|    if(ctx->pos >= ctx->end)
  ------------------
  |  Branch (53:8): [True: 0, False: 40.5M]
  ------------------
   54|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
   55|  40.5M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (55:8): [True: 27.0M, False: 13.5M]
  ------------------
   56|  27.0M|        *ctx->pos = (UA_Byte)c;
   57|  40.5M|    ctx->pos++;
   58|  40.5M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  40.5M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   59|  40.5M|}
ua_types_encoding_json.c:writeChars:
   62|  10.3M|writeChars(CtxJson *ctx, const char *c, size_t len) {
   63|  10.3M|    if(ctx->pos + len > ctx->end)
  ------------------
  |  Branch (63:8): [True: 0, False: 10.3M]
  ------------------
   64|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
   65|  10.3M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (65:8): [True: 6.91M, False: 3.45M]
  ------------------
   66|  6.91M|        memcpy(ctx->pos, c, len);
   67|  10.3M|    ctx->pos += len;
   68|  10.3M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  10.3M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   69|  10.3M|}
ua_types_encoding_json.c:Boolean_encodeJson:
  230|  10.4k|ENCODE_JSON(Boolean) {
  231|  10.4k|    const UA_Boolean *src = (const UA_Boolean*)p;
  232|  10.4k|    if(*src == true)
  ------------------
  |  Branch (232:8): [True: 768, False: 9.72k]
  ------------------
  233|    768|        return writeChars(ctx, "true", 4);
  234|  9.72k|    return writeChars(ctx, "false", 5);
  235|  10.4k|}
ua_types_encoding_json.c:SByte_encodeJson:
  253|  29.8k|ENCODE_JSON(SByte) {
  254|  29.8k|    const UA_SByte *src = (const UA_SByte*)p;
  255|  29.8k|    char buf[5];
  256|  29.8k|    UA_UInt16 digits = itoaSigned(*src, buf);
  257|  29.8k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (257:8): [True: 0, False: 29.8k]
  ------------------
  258|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  259|  29.8k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (259:8): [True: 19.9k, False: 9.96k]
  ------------------
  260|  19.9k|        memcpy(ctx->pos, buf, digits);
  261|  29.8k|    ctx->pos += digits;
  262|  29.8k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  29.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  263|  29.8k|}
ua_types_encoding_json.c:Byte_encodeJson:
  237|  23.5k|ENCODE_JSON(Byte) {
  238|  23.5k|    const UA_Byte *src = (const UA_Byte*)p;
  239|  23.5k|    char buf[4];
  240|  23.5k|    UA_UInt16 digits = itoaUnsigned(*src, buf, 10);
  241|       |
  242|       |    /* Ensure destination can hold the data- */
  243|  23.5k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (243:8): [True: 0, False: 23.5k]
  ------------------
  244|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  245|       |
  246|       |    /* Copy digits to the output string/buffer. */
  247|  23.5k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (247:8): [True: 15.6k, False: 7.84k]
  ------------------
  248|  15.6k|        memcpy(ctx->pos, buf, digits);
  249|  23.5k|    ctx->pos += digits;
  250|  23.5k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  23.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  251|  23.5k|}
ua_types_encoding_json.c:Int16_encodeJson:
  277|  14.4k|ENCODE_JSON(Int16) {
  278|  14.4k|    const UA_Int16 *src = (const UA_Int16*)p;
  279|  14.4k|    char buf[7];
  280|  14.4k|    UA_UInt16 digits = itoaSigned(*src, buf);
  281|  14.4k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (281:8): [True: 0, False: 14.4k]
  ------------------
  282|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  283|  14.4k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (283:8): [True: 9.64k, False: 4.82k]
  ------------------
  284|  9.64k|        memcpy(ctx->pos, buf, digits);
  285|  14.4k|    ctx->pos += digits;
  286|  14.4k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  14.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  287|  14.4k|}
ua_types_encoding_json.c:UInt16_encodeJson:
  265|  86.4k|ENCODE_JSON(UInt16) {
  266|  86.4k|    const UA_UInt16 *src = (const UA_UInt16*)p;
  267|  86.4k|    char buf[6];
  268|  86.4k|    UA_UInt16 digits = itoaUnsigned(*src, buf, 10);
  269|  86.4k|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (269:8): [True: 0, False: 86.4k]
  ------------------
  270|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  271|  86.4k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (271:8): [True: 57.6k, False: 28.8k]
  ------------------
  272|  57.6k|        memcpy(ctx->pos, buf, digits);
  273|  86.4k|    ctx->pos += digits;
  274|  86.4k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  86.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  275|  86.4k|}
ua_types_encoding_json.c:Int32_encodeJson:
  301|  2.35M|ENCODE_JSON(Int32) {
  302|  2.35M|    const UA_Int32 *src = (const UA_Int32*)p;
  303|  2.35M|    char buf[12];
  304|  2.35M|    UA_UInt16 digits = itoaSigned(*src, buf);
  305|  2.35M|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (305:8): [True: 0, False: 2.35M]
  ------------------
  306|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  307|  2.35M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (307:8): [True: 1.56M, False: 784k]
  ------------------
  308|  1.56M|        memcpy(ctx->pos, buf, digits);
  309|  2.35M|    ctx->pos += digits;
  310|  2.35M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  2.35M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  311|  2.35M|}
ua_types_encoding_json.c:UInt32_encodeJson:
  289|  2.89M|ENCODE_JSON(UInt32) {
  290|  2.89M|    const UA_UInt32 *src = (const UA_UInt32*)p;
  291|  2.89M|    char buf[11];
  292|  2.89M|    UA_UInt16 digits = itoaUnsigned(*src, buf, 10);
  293|  2.89M|    if(ctx->pos + digits > ctx->end)
  ------------------
  |  Branch (293:8): [True: 0, False: 2.89M]
  ------------------
  294|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  295|  2.89M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (295:8): [True: 1.93M, False: 965k]
  ------------------
  296|  1.93M|        memcpy(ctx->pos, buf, digits);
  297|  2.89M|    ctx->pos += digits;
  298|  2.89M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  2.89M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  299|  2.89M|}
ua_types_encoding_json.c:Int64_encodeJson:
  328|  2.04M|ENCODE_JSON(Int64) {
  329|  2.04M|    const UA_Int64 *src = (const UA_Int64*)p;
  330|  2.04M|    char buf[23];
  331|  2.04M|    buf[0] = '\"';
  332|  2.04M|    UA_UInt16 digits = itoaSigned(*src, buf + 1);
  333|  2.04M|    buf[digits + 1] = '\"';
  334|  2.04M|    UA_UInt16 length = (UA_UInt16)(digits + 2);
  335|  2.04M|    if(ctx->pos + length > ctx->end)
  ------------------
  |  Branch (335:8): [True: 0, False: 2.04M]
  ------------------
  336|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  337|  2.04M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (337:8): [True: 1.36M, False: 681k]
  ------------------
  338|  1.36M|        memcpy(ctx->pos, buf, length);
  339|  2.04M|    ctx->pos += length;
  340|  2.04M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  2.04M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  341|  2.04M|}
ua_types_encoding_json.c:UInt64_encodeJson:
  313|  3.93M|ENCODE_JSON(UInt64) {
  314|  3.93M|    const UA_UInt64 *src = (const UA_UInt64*)p;
  315|  3.93M|    char buf[23];
  316|  3.93M|    buf[0] = '\"';
  317|  3.93M|    UA_UInt16 digits = itoaUnsigned(*src, buf + 1, 10);
  318|  3.93M|    buf[digits + 1] = '\"';
  319|  3.93M|    UA_UInt16 length = (UA_UInt16)(digits + 2);
  320|  3.93M|    if(ctx->pos + length > ctx->end)
  ------------------
  |  Branch (320:8): [True: 0, False: 3.93M]
  ------------------
  321|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  322|  3.93M|    if(!ctx->calcOnly)
  ------------------
  |  Branch (322:8): [True: 2.62M, False: 1.31M]
  ------------------
  323|  2.62M|        memcpy(ctx->pos, buf, length);
  324|  3.93M|    ctx->pos += length;
  325|  3.93M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  3.93M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  326|  3.93M|}
ua_types_encoding_json.c:Float_encodeJson:
  343|   164k|ENCODE_JSON(Float) {
  344|   164k|    const UA_Float *src = (const UA_Float*)p;
  345|   164k|    char buffer[32];
  346|   164k|    size_t len;
  347|   164k|    if(*src != *src)
  ------------------
  |  Branch (347:8): [True: 1.62k, False: 162k]
  ------------------
  348|  1.62k|        return writeChars(ctx, "\"NaN\"", 5);
  349|   162k|    if(*src == INFINITY)
  ------------------
  |  Branch (349:8): [True: 774, False: 161k]
  ------------------
  350|    774|        return writeChars(ctx, "\"Infinity\"", 10);
  351|   161k|    if(*src == -INFINITY)
  ------------------
  |  Branch (351:8): [True: 777, False: 160k]
  ------------------
  352|    777|        return writeChars(ctx, "\"-Infinity\"", 11);
  353|   160k|    len = dtoa((UA_Double)*src, buffer);
  354|   160k|    if(ctx->pos + len > ctx->end)
  ------------------
  |  Branch (354:8): [True: 0, False: 160k]
  ------------------
  355|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  356|   160k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (356:8): [True: 107k, False: 53.6k]
  ------------------
  357|   107k|        memcpy(ctx->pos, buffer, len);
  358|   160k|    ctx->pos += len;
  359|   160k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   160k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  360|   160k|}
ua_types_encoding_json.c:Double_encodeJson:
  362|   959k|ENCODE_JSON(Double) {
  363|   959k|    const UA_Double *src = (const UA_Double*)p;
  364|   959k|    char buffer[32];
  365|   959k|    size_t len;
  366|   959k|    if(*src != *src)
  ------------------
  |  Branch (366:8): [True: 840, False: 958k]
  ------------------
  367|    840|        return writeChars(ctx, "\"NaN\"", 5);
  368|   958k|    if(*src == INFINITY)
  ------------------
  |  Branch (368:8): [True: 786, False: 957k]
  ------------------
  369|    786|        return writeChars(ctx, "\"Infinity\"", 10);
  370|   957k|    if(*src == -INFINITY)
  ------------------
  |  Branch (370:8): [True: 789, False: 957k]
  ------------------
  371|    789|        return writeChars(ctx, "\"-Infinity\"", 11);
  372|   957k|    len = dtoa(*src, buffer);
  373|   957k|    if(ctx->pos + len > ctx->end)
  ------------------
  |  Branch (373:8): [True: 0, False: 957k]
  ------------------
  374|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  375|   957k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (375:8): [True: 638k, False: 319k]
  ------------------
  376|   638k|        memcpy(ctx->pos, buffer, len);
  377|   957k|    ctx->pos += len;
  378|   957k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   957k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  379|   957k|}
ua_types_encoding_json.c:String_encodeJson:
  408|  5.33M|ENCODE_JSON(String) {
  409|  5.33M|    const UA_String *src = (const UA_String*)p;
  410|  5.33M|    if(!src->data)
  ------------------
  |  Branch (410:8): [True: 5.04M, False: 285k]
  ------------------
  411|  5.04M|        return writeChars(ctx, "null", 4);
  412|       |
  413|   285k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   285k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  414|   285k|    if(src->length == 0) {
  ------------------
  |  Branch (414:8): [True: 13.7k, False: 272k]
  ------------------
  415|  13.7k|        ret |= writeJsonQuote(ctx);
  416|  13.7k|        ret |= writeJsonQuote(ctx);
  417|  13.7k|        return ret;
  418|  13.7k|    }
  419|       |
  420|   272k|    ret |= writeJsonQuote(ctx);
  421|       |
  422|   272k|    const unsigned char *end = src->data + src->length;
  423|  10.6M|    for(const unsigned char *pos = src->data; pos < end; pos++) {
  ------------------
  |  Branch (423:47): [True: 10.6M, False: 2.28k]
  ------------------
  424|       |        /* Skip to the first character that needs escaping */
  425|  10.6M|        const unsigned char *start = pos;
  426|  32.8M|        for(; pos < end; pos++) {
  ------------------
  |  Branch (426:15): [True: 32.5M, False: 269k]
  ------------------
  427|  32.5M|            if(*pos < ' ' || *pos == 127 || *pos == '\\' || *pos == '\"')
  ------------------
  |  Branch (427:16): [True: 3.18M, False: 29.3M]
  |  Branch (427:30): [True: 14.5k, False: 29.3M]
  |  Branch (427:45): [True: 22.3k, False: 29.3M]
  |  Branch (427:61): [True: 7.17M, False: 22.1M]
  ------------------
  428|  10.3M|                break;
  429|  32.5M|        }
  430|       |
  431|       |        /* Write out the unescaped sequence */
  432|  10.6M|        if(ctx->pos + (pos - start) > ctx->end)
  ------------------
  |  Branch (432:12): [True: 0, False: 10.6M]
  ------------------
  433|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  434|  10.6M|        if(!ctx->calcOnly)
  ------------------
  |  Branch (434:12): [True: 7.11M, False: 3.55M]
  ------------------
  435|  7.11M|            memcpy(ctx->pos, start, (size_t)(pos - start));
  436|  10.6M|        ctx->pos += pos - start;
  437|       |
  438|       |        /* The unescaped sequence reached the end */
  439|  10.6M|        if(pos == end)
  ------------------
  |  Branch (439:12): [True: 269k, False: 10.3M]
  ------------------
  440|   269k|            break;
  441|       |
  442|       |        /* Write an escaped character */
  443|  10.3M|        char *escape_text;
  444|  10.3M|        char escape_buf[6];
  445|  10.3M|        size_t escape_len = 2;
  446|  10.3M|        switch(*pos) {
  447|    396|        case '\b': escape_text = "\\b"; break;
  ------------------
  |  Branch (447:9): [True: 396, False: 10.3M]
  ------------------
  448|  8.60k|        case '\f': escape_text = "\\f"; break;
  ------------------
  |  Branch (448:9): [True: 8.60k, False: 10.3M]
  ------------------
  449|   173k|        case '\n': escape_text = "\\n"; break;
  ------------------
  |  Branch (449:9): [True: 173k, False: 10.2M]
  ------------------
  450|    336|        case '\r': escape_text = "\\r"; break;
  ------------------
  |  Branch (450:9): [True: 336, False: 10.3M]
  ------------------
  451|    297|        case '\t': escape_text = "\\t"; break;
  ------------------
  |  Branch (451:9): [True: 297, False: 10.3M]
  ------------------
  452|  10.2M|        default:
  ------------------
  |  Branch (452:9): [True: 10.2M, False: 183k]
  ------------------
  453|  10.2M|            escape_text = escape_buf;
  454|  10.2M|            if(*pos >= ' ' && *pos != 127) {
  ------------------
  |  Branch (454:16): [True: 7.21M, False: 3.00M]
  |  Branch (454:31): [True: 7.19M, False: 14.5k]
  ------------------
  455|       |                /* Escape \ or " */
  456|  7.19M|                escape_buf[0] = '\\';
  457|  7.19M|                escape_buf[1] = (char)*pos;
  458|  7.19M|            } else {
  459|       |                /* Unprintable characters need to be escaped */
  460|  3.01M|                escape_buf[0] = '\\';
  461|  3.01M|                escape_buf[1] = 'u';
  462|  3.01M|                escape_buf[2] = '0';
  463|  3.01M|                escape_buf[3] = '0';
  464|  3.01M|                escape_buf[4] = hexmap[*pos >> 4];
  465|  3.01M|                escape_buf[5] = hexmap[*pos & 0x0f];
  466|  3.01M|                escape_len = 6;
  467|  3.01M|            }
  468|  10.2M|            break;
  469|  10.3M|        }
  470|       |
  471|       |        /* Enough space? */
  472|  10.3M|        if(ctx->pos + escape_len > ctx->end)
  ------------------
  |  Branch (472:12): [True: 0, False: 10.3M]
  ------------------
  473|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  474|       |
  475|       |        /* Write the escaped character */
  476|  10.3M|        if(!ctx->calcOnly)
  ------------------
  |  Branch (476:12): [True: 6.93M, False: 3.46M]
  ------------------
  477|  6.93M|            memcpy(ctx->pos, escape_text, escape_len);
  478|  10.3M|        ctx->pos += escape_len;
  479|  10.3M|    }
  480|       |
  481|   272k|    return ret | writeJsonQuote(ctx);
  482|   272k|}
ua_types_encoding_json.c:writeJsonQuote:
   75|   582k|static WRITE_JSON_ELEMENT(Quote) {
   76|   582k|    return writeChar(ctx, '\"');
   77|   582k|}
ua_types_encoding_json.c:DateTime_encodeJson:
  530|  26.5k|ENCODE_JSON(DateTime) {
  531|  26.5k|    const UA_DateTime *src = (const UA_DateTime*)p;
  532|  26.5k|    UA_Byte buffer[40];
  533|  26.5k|    UA_String str = {40, buffer};
  534|  26.5k|    encodeDateTime(*src, &str);
  535|       |    return String_encodeJson(ctx, &str, NULL);
  536|  26.5k|}
ua_types_encoding_json.c:Guid_encodeJson:
  519|  3.47k|ENCODE_JSON(Guid) {
  520|  3.47k|    const UA_Guid *src = (const UA_Guid*)p;
  521|  3.47k|    if(ctx->pos + 38 > ctx->end) /* 36 + 2 (") */
  ------------------
  |  Branch (521:8): [True: 0, False: 3.47k]
  ------------------
  522|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  523|  3.47k|    status ret = writeJsonQuote(ctx);
  524|  3.47k|    if(!ctx->calcOnly)
  ------------------
  |  Branch (524:8): [True: 2.31k, False: 1.15k]
  ------------------
  525|  2.31k|        UA_Guid_to_hex(src, ctx->pos, false);
  526|  3.47k|    ctx->pos += 36;
  527|  3.47k|    return ret | writeJsonQuote(ctx);
  528|  3.47k|}
ua_types_encoding_json.c:ByteString_encodeJson:
  484|  4.04k|ENCODE_JSON(ByteString) {
  485|  4.04k|    const UA_ByteString *src = (const UA_ByteString*)p;
  486|  4.04k|    if(!src->data)
  ------------------
  |  Branch (486:8): [True: 1.90k, False: 2.13k]
  ------------------
  487|  1.90k|        return writeChars(ctx, "null", 4);
  488|       |
  489|  2.13k|    if(src->length == 0) {
  ------------------
  |  Branch (489:8): [True: 1.91k, False: 228]
  ------------------
  490|  1.91k|        status retval = writeJsonQuote(ctx);
  491|  1.91k|        retval |= writeJsonQuote(ctx);
  492|  1.91k|        return retval;
  493|  1.91k|    }
  494|       |
  495|    228|    status ret = writeJsonQuote(ctx);
  496|    228|    size_t flen = 0;
  497|    228|    unsigned char *ba64 = UA_base64(src->data, src->length, &flen);
  498|       |
  499|       |    /* Not converted, no mem */
  500|    228|    if(!ba64)
  ------------------
  |  Branch (500:8): [True: 0, False: 228]
  ------------------
  501|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  502|       |
  503|    228|    if(ctx->pos + flen > ctx->end) {
  ------------------
  |  Branch (503:8): [True: 0, False: 228]
  ------------------
  504|      0|        UA_free(ba64);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  505|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  506|      0|    }
  507|       |
  508|       |    /* Copy flen bytes to output stream. */
  509|    228|    if(!ctx->calcOnly)
  ------------------
  |  Branch (509:8): [True: 152, False: 76]
  ------------------
  510|    152|        memcpy(ctx->pos, ba64, flen);
  511|    228|    ctx->pos += flen;
  512|       |
  513|       |    /* Base64 result no longer needed */
  514|    228|    UA_free(ba64);
  ------------------
  |  |   19|    228|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  515|       |
  516|    228|    return ret | writeJsonQuote(ctx);
  517|    228|}
ua_types_encoding_json.c:NodeId_encodeJson:
  538|  34.6k|ENCODE_JSON(NodeId) {
  539|  34.6k|    const UA_NodeId *src = (const UA_NodeId*)p;
  540|  34.6k|    UA_String out = UA_STRING_NULL;
  541|  34.6k|    UA_StatusCode ret =
  542|  34.6k|        UA_NodeId_printEx(src, &out, ctx->namespaceMapping);
  543|       |    ret |= String_encodeJson(ctx, &out, NULL);
  544|  34.6k|    UA_String_clear(&out);
  545|  34.6k|    return ret;
  546|  34.6k|}
ua_types_encoding_json.c:ExpandedNodeId_encodeJson:
  548|  37.0k|ENCODE_JSON(ExpandedNodeId) {
  549|  37.0k|    const UA_ExpandedNodeId *src = (const UA_ExpandedNodeId*)p;
  550|  37.0k|    UA_String out = UA_STRING_NULL;
  551|  37.0k|    UA_StatusCode ret =
  552|  37.0k|        UA_ExpandedNodeId_printEx(src, &out, ctx->namespaceMapping,
  553|  37.0k|                                  ctx->serverUrisSize, ctx->serverUris);
  554|       |    ret |= String_encodeJson(ctx, &out, NULL);
  555|  37.0k|    UA_String_clear(&out);
  556|  37.0k|    return ret;
  557|  37.0k|}
ua_types_encoding_json.c:StatusCode_encodeJson:
  581|  1.83k|ENCODE_JSON(StatusCode) {
  582|  1.83k|    const UA_StatusCode *src = (const UA_StatusCode*)p;
  583|  1.83k|    const char *codename = UA_StatusCode_name(*src);
  584|  1.83k|    UA_String statusDescription = UA_STRING((char*)(uintptr_t)codename);
  585|  1.83k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.83k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  586|  1.83k|    ret |= writeJsonObjStart(ctx);
  587|  1.83k|    if(*src > UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  1.83k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (587:8): [True: 99, False: 1.73k]
  ------------------
  588|     99|        ret |= writeJsonKey(ctx, UA_JSONKEY_CODE);
  589|     99|        ret |= UInt32_encodeJson(ctx, src, NULL);
  590|     99|        if(codename) {
  ------------------
  |  Branch (590:12): [True: 99, False: 0]
  ------------------
  591|     99|            ret |= writeJsonKey(ctx, UA_JSONKEY_SYMBOL);
  592|       |            ret |= String_encodeJson(ctx, &statusDescription, NULL);
  593|     99|        }
  594|     99|    }
  595|  1.83k|    ret |= writeJsonObjEnd(ctx);
  596|  1.83k|    return ret;
  597|  1.83k|}
ua_types_encoding_json.c:QualifiedName_encodeJson:
  569|   186k|ENCODE_JSON(QualifiedName) {
  570|   186k|    const UA_QualifiedName *src = (const UA_QualifiedName*)p;
  571|   186k|    if(src->namespaceIndex == 0 && src->name.data == NULL)
  ------------------
  |  Branch (571:8): [True: 185k, False: 1.26k]
  |  Branch (571:36): [True: 2.43k, False: 182k]
  ------------------
  572|  2.43k|        return writeChars(ctx, "null", 4);
  573|   184k|    UA_String out = UA_STRING_NULL;
  574|   184k|    UA_StatusCode ret =
  575|   184k|        UA_QualifiedName_printEx(src, &out, ctx->namespaceMapping);
  576|       |    ret |= String_encodeJson(ctx, &out, NULL);
  577|   184k|    UA_String_clear(&out);
  578|   184k|    return ret;
  579|   186k|}
ua_types_encoding_json.c:LocalizedText_encodeJson:
  559|  2.52M|ENCODE_JSON(LocalizedText) {
  560|  2.52M|    const UA_LocalizedText *src = (const UA_LocalizedText*)p;
  561|  2.52M|    status ret = writeJsonObjStart(ctx);
  562|  2.52M|    ret |= writeJsonKey(ctx, UA_JSONKEY_LOCALE);
  563|  2.52M|    ret |= String_encodeJson(ctx, &src->locale, NULL);
  564|  2.52M|    ret |= writeJsonKey(ctx, UA_JSONKEY_TEXT);
  565|       |    ret |= String_encodeJson(ctx, &src->text, NULL);
  566|  2.52M|    return ret | writeJsonObjEnd(ctx);
  567|  2.52M|}
ua_types_encoding_json.c:ExtensionObject_encodeJson:
  599|  5.29k|ENCODE_JSON(ExtensionObject) {
  600|  5.29k|    const UA_ExtensionObject *src = (const UA_ExtensionObject*)p;
  601|  5.29k|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_NOBODY)
  ------------------
  |  Branch (601:8): [True: 5.29k, False: 0]
  ------------------
  602|  5.29k|        return writeChars(ctx, "null", 4);
  603|       |
  604|       |    /* Must have a type set if data is decoded */
  605|      0|    if(src->encoding != UA_EXTENSIONOBJECT_ENCODED_BYTESTRING &&
  ------------------
  |  Branch (605:8): [True: 0, False: 0]
  ------------------
  606|      0|       src->encoding != UA_EXTENSIONOBJECT_ENCODED_XML &&
  ------------------
  |  Branch (606:8): [True: 0, False: 0]
  ------------------
  607|      0|       !src->content.decoded.type)
  ------------------
  |  Branch (607:8): [True: 0, False: 0]
  ------------------
  608|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  609|       |
  610|      0|    status ret = writeJsonObjStart(ctx);
  611|       |
  612|       |    /* Write the type NodeId */
  613|      0|    ret |= writeJsonKey(ctx, UA_JSONKEY_TYPEID);
  614|      0|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_BYTESTRING ||
  ------------------
  |  Branch (614:8): [True: 0, False: 0]
  ------------------
  615|      0|       src->encoding == UA_EXTENSIONOBJECT_ENCODED_XML)
  ------------------
  |  Branch (615:8): [True: 0, False: 0]
  ------------------
  616|      0|        ret |= NodeId_encodeJson(ctx, &src->content.encoded.typeId, NULL);
  617|      0|    else
  618|      0|        ret |= NodeId_encodeJson(ctx, &src->content.decoded.type->typeId, NULL);
  619|       |
  620|       |    /* Write the encoding type and body if encoded */
  621|      0|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_BYTESTRING ||
  ------------------
  |  Branch (621:8): [True: 0, False: 0]
  ------------------
  622|      0|       src->encoding == UA_EXTENSIONOBJECT_ENCODED_XML) {
  ------------------
  |  Branch (622:8): [True: 0, False: 0]
  ------------------
  623|      0|        if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_BYTESTRING) {
  ------------------
  |  Branch (623:12): [True: 0, False: 0]
  ------------------
  624|      0|            ret |= writeJsonKey(ctx, UA_JSONKEY_ENCODING);
  625|      0|            ret |= writeChar(ctx, '1');
  626|      0|        } else {
  627|      0|            ret |= writeJsonKey(ctx, UA_JSONKEY_ENCODING);
  628|      0|            ret |= writeChar(ctx, '2');
  629|      0|        }
  630|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_BODY);
  631|      0|        ret |= String_encodeJson(ctx, &src->content.encoded.body, NULL);
  632|      0|        return ret | writeJsonObjEnd(ctx);
  633|      0|    }
  634|       |
  635|      0|    const UA_DataType *t = src->content.decoded.type;
  636|      0|    if(t->typeKind == UA_DATATYPEKIND_STRUCTURE) {
  ------------------
  |  Branch (636:8): [True: 0, False: 0]
  ------------------
  637|       |        /* Write structures in-situ.
  638|       |         * TODO: Structures with optional fields and unions */
  639|      0|        ret |= encodeJsonStructureContent(ctx, src->content.decoded.data, t);
  640|      0|    } else {
  641|       |        /* NON-STANDARD: The standard 1.05 doesn't let us print non-structure
  642|       |         * types in ExtensionObjects (e.g. enums). Print them in the body. */
  643|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_BODY);
  644|      0|        ret |= encodeJsonJumpTable[t->typeKind](ctx, src->content.decoded.data, t);
  645|      0|    }
  646|       |
  647|      0|    return ret | writeJsonObjEnd(ctx);
  648|      0|}
ua_types_encoding_json.c:encodeJsonArray:
  383|  4.41k|                const UA_DataType *type) {
  384|       |    /* Null-arrays (length -1) are written as empty arrays '[]'.
  385|       |     * TODO: Clarify the difference between length -1 and length 0 in JSON. */
  386|  4.41k|    status ret = writeJsonArrStart(ctx);
  387|  4.41k|    if(!ptr)
  ------------------
  |  Branch (387:8): [True: 0, False: 4.41k]
  ------------------
  388|      0|        return ret | writeJsonArrEnd(ctx, type);
  389|       |
  390|  4.41k|    uintptr_t uptr = (uintptr_t)ptr;
  391|  4.41k|    encodeJsonSignature encodeType = encodeJsonJumpTable[type->typeKind];
  392|  4.41k|    UA_Boolean distinct = (type->typeKind > UA_DATATYPEKIND_DOUBLE);
  393|  2.77M|    for(size_t i = 0; i < length && ret == UA_STATUSCODE_GOOD; ++i) {
  ------------------
  |  |   17|  2.77M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (393:23): [True: 2.77M, False: 4.41k]
  |  Branch (393:37): [True: 2.77M, False: 0]
  ------------------
  394|  2.77M|        ret |= writeJsonBeforeElement(ctx, distinct);
  395|  2.77M|        if(isNull((const void*)uptr, type))
  ------------------
  |  Branch (395:12): [True: 0, False: 2.77M]
  ------------------
  396|      0|            ret |= writeChars(ctx, "null", 4);
  397|  2.77M|        else
  398|  2.77M|            ret |= encodeType(ctx, (const void*)uptr, type);
  399|       |        ctx->commaNeeded[ctx->depth] = true;
  400|  2.77M|        uptr += type->memSize;
  401|  2.77M|    }
  402|  4.41k|    return ret | writeJsonArrEnd(ctx, type);
  403|  4.41k|}
ua_types_encoding_json.c:isNull:
  221|  2.77M|isNull(const void *p, const UA_DataType *type) {
  222|  2.77M|    if(UA_DataType_isNumeric(type) ||
  ------------------
  |  Branch (222:8): [True: 2.77M, False: 0]
  ------------------
  223|      0|       type->typeKind == UA_DATATYPEKIND_BOOLEAN)
  ------------------
  |  Branch (223:8): [True: 0, False: 0]
  ------------------
  224|  2.77M|        return false;
  225|      0|    UA_STACKARRAY(char, buf, type->memSize);
  ------------------
  |  |  375|      0|#  define UA_STACKARRAY(TYPE, NAME, SIZE) TYPE NAME[SIZE]
  ------------------
  226|      0|    memset(buf, 0, type->memSize);
  227|      0|    return UA_equal(buf, p, type);
  228|  2.77M|}
ua_types_encoding_json.c:DataValue_encodeJson:
  762|   165k|ENCODE_JSON(DataValue) {
  763|   165k|    const UA_DataValue *src = (const UA_DataValue*)p;
  764|   165k|    UA_Boolean hasValue = src->hasValue;
  765|   165k|    UA_Boolean hasStatus = src->hasStatus;
  766|   165k|    UA_Boolean hasSourceTimestamp = src->hasSourceTimestamp;
  767|   165k|    UA_Boolean hasSourcePicoseconds = src->hasSourcePicoseconds;
  768|   165k|    UA_Boolean hasServerTimestamp = src->hasServerTimestamp;
  769|   165k|    UA_Boolean hasServerPicoseconds = src->hasServerPicoseconds;
  770|       |
  771|   165k|    status ret = writeJsonObjStart(ctx);
  772|       |
  773|   165k|    if(hasValue)
  ------------------
  |  Branch (773:8): [True: 57.9k, False: 107k]
  ------------------
  774|  57.9k|        ret |= encodeVariantInner(ctx, &src->value);
  775|       |
  776|   165k|    if(hasStatus) {
  ------------------
  |  Branch (776:8): [True: 21, False: 165k]
  ------------------
  777|     21|        ret |= writeJsonKey(ctx, UA_JSONKEY_STATUS);
  778|     21|        ret |= StatusCode_encodeJson(ctx, &src->status, NULL);
  779|     21|    }
  780|       |
  781|   165k|    if(hasSourceTimestamp) {
  ------------------
  |  Branch (781:8): [True: 0, False: 165k]
  ------------------
  782|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SOURCETIMESTAMP);
  783|      0|        ret |= DateTime_encodeJson(ctx, &src->sourceTimestamp, NULL);
  784|      0|    }
  785|       |
  786|   165k|    if(hasSourcePicoseconds) {
  ------------------
  |  Branch (786:8): [True: 0, False: 165k]
  ------------------
  787|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SOURCEPICOSECONDS);
  788|      0|        ret |= UInt16_encodeJson(ctx, &src->sourcePicoseconds, NULL);
  789|      0|    }
  790|       |
  791|   165k|    if(hasServerTimestamp) {
  ------------------
  |  Branch (791:8): [True: 0, False: 165k]
  ------------------
  792|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SERVERTIMESTAMP);
  793|      0|        ret |= DateTime_encodeJson(ctx, &src->serverTimestamp, NULL);
  794|      0|    }
  795|       |
  796|   165k|    if(hasServerPicoseconds) {
  ------------------
  |  Branch (796:8): [True: 0, False: 165k]
  ------------------
  797|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SERVERPICOSECONDS);
  798|      0|        ret |= UInt16_encodeJson(ctx, &src->serverPicoseconds, NULL);
  799|      0|    }
  800|       |
  801|   165k|    return ret | writeJsonObjEnd(ctx);
  802|   165k|}
ua_types_encoding_json.c:encodeVariantInner:
  708|   307k|encodeVariantInner(CtxJson *ctx, const UA_Variant *src) {
  709|       |    /* If type is 0 (NULL) the Variant contains a NULL value and the containing
  710|       |     * JSON object shall be omitted or replaced by the JSON literal ‘null’ (when
  711|       |     * an element of a JSON array). */
  712|   307k|    if(!src->type)
  ------------------
  |  Branch (712:8): [True: 184k, False: 123k]
  ------------------
  713|   184k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   184k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  714|       |
  715|       |    /* Set the array type in the encoding mask */
  716|   123k|    const bool isArray = src->arrayLength > 0 || src->data <= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|   238k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (716:26): [True: 8.27k, False: 114k]
  |  Branch (716:50): [True: 8.20k, False: 106k]
  ------------------
  717|   123k|    const bool hasDimensions = isArray && src->arrayDimensionsSize > 1;
  ------------------
  |  Branch (717:32): [True: 16.4k, False: 106k]
  |  Branch (717:43): [True: 4.41k, False: 12.0k]
  ------------------
  718|       |
  719|       |    /* Wrap the value in an ExtensionObject if not builtin. We cannot directly
  720|       |     * encode a variant inside a variant (but arrays of variant are possible) */
  721|   123k|    UA_Boolean wrapEO = (src->type->typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO);
  722|   123k|    if(src->type == &UA_TYPES[UA_TYPES_VARIANT] && !isArray)
  ------------------
  |  |  803|   123k|#define UA_TYPES_VARIANT 23
  ------------------
  |  Branch (722:8): [True: 1.48k, False: 121k]
  |  Branch (722:52): [True: 0, False: 1.48k]
  ------------------
  723|      0|        wrapEO = true;
  724|       |
  725|   123k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   123k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  726|       |
  727|       |    /* Write the type number */
  728|   123k|    UA_UInt32 typeId = src->type->typeKind + 1;
  729|   123k|    if(wrapEO)
  ------------------
  |  Branch (729:8): [True: 0, False: 123k]
  ------------------
  730|      0|        typeId = UA_TYPES[UA_TYPES_EXTENSIONOBJECT].typeKind + 1;
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  731|   123k|    ret |= writeJsonKey(ctx, UA_JSONKEY_TYPE);
  732|   123k|    ret |= UInt32_encodeJson(ctx, &typeId, NULL);
  733|       |
  734|       |    /* Write the value */
  735|   123k|    ret |= writeJsonKey(ctx, UA_JSONKEY_VALUE);
  736|   123k|    if(!isArray) {
  ------------------
  |  Branch (736:8): [True: 106k, False: 16.4k]
  ------------------
  737|   106k|        ret |= encodeScalarJsonWrapExtensionObject(ctx, src);
  738|   106k|    } else {
  739|  16.4k|        ret |= encodeArrayJsonWrapExtensionObject(ctx, src->data,
  740|  16.4k|                                                  src->arrayLength, src->type);
  741|  16.4k|    }
  742|       |
  743|       |    /* Write the dimensions */
  744|   123k|    if(hasDimensions) {
  ------------------
  |  Branch (744:8): [True: 4.41k, False: 118k]
  ------------------
  745|  4.41k|        ret |= writeJsonKey(ctx, UA_JSONKEY_DIMENSIONS);
  746|  4.41k|        ret |= encodeJsonArray(ctx, src->arrayDimensions, src->arrayDimensionsSize,
  747|  4.41k|                               &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  225|  4.41k|#define UA_TYPES_UINT32 6
  ------------------
  748|  4.41k|    }
  749|       |
  750|   123k|    return ret;
  751|   307k|}
ua_types_encoding_json.c:encodeScalarJsonWrapExtensionObject:
  652|   106k|encodeScalarJsonWrapExtensionObject(CtxJson *ctx, const UA_Variant *src) {
  653|   106k|    const UA_Boolean isBuiltin =
  654|   106k|        (src->type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO);
  655|   106k|    const void *ptr = src->data;
  656|   106k|    const UA_DataType *type = src->type;
  657|       |
  658|       |    /* Set up a temporary ExtensionObject to wrap the data */
  659|   106k|    UA_ExtensionObject eo;
  660|   106k|    if(!isBuiltin) {
  ------------------
  |  Branch (660:8): [True: 0, False: 106k]
  ------------------
  661|      0|        UA_ExtensionObject_init(&eo);
  662|      0|        eo.encoding = UA_EXTENSIONOBJECT_DECODED;
  663|      0|        eo.content.decoded.type = src->type;
  664|      0|        eo.content.decoded.data = src->data;
  665|      0|        ptr = &eo;
  666|      0|        type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  667|      0|    }
  668|       |
  669|   106k|    return encodeJsonJumpTable[type->typeKind](ctx, ptr, type);
  670|   106k|}
ua_types_encoding_json.c:encodeArrayJsonWrapExtensionObject:
  675|  16.4k|                                   size_t size, const UA_DataType *type) {
  676|  16.4k|    if(size > UA_INT32_MAX)
  ------------------
  |  |  100|  16.4k|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (676:8): [True: 0, False: 16.4k]
  ------------------
  677|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  678|       |
  679|  16.4k|    status ret = writeJsonArrStart(ctx);
  680|       |
  681|  16.4k|    u16 memSize = type->memSize;
  682|  16.4k|    const UA_Boolean isBuiltin =
  683|  16.4k|        (type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO);
  684|  16.4k|    if(isBuiltin) {
  ------------------
  |  Branch (684:8): [True: 16.4k, False: 0]
  ------------------
  685|  16.4k|        uintptr_t ptr = (uintptr_t)data;
  686|  12.7M|        for(size_t i = 0; i < size && ret == UA_STATUSCODE_GOOD; ++i) {
  ------------------
  |  |   17|  12.7M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (686:27): [True: 12.7M, False: 16.4k]
  |  Branch (686:39): [True: 12.7M, False: 0]
  ------------------
  687|  12.7M|            ret |= writeJsonArrElm(ctx, (const void*)ptr, type);
  688|  12.7M|            ptr += memSize;
  689|  12.7M|        }
  690|  16.4k|    } else {
  691|       |        /* Set up a temporary ExtensionObject to wrap the data */
  692|      0|        UA_ExtensionObject eo;
  693|      0|        UA_ExtensionObject_init(&eo);
  694|      0|        eo.encoding = UA_EXTENSIONOBJECT_DECODED;
  695|      0|        eo.content.decoded.type = type;
  696|      0|        eo.content.decoded.data = (void*)(uintptr_t)data;
  697|      0|        for(size_t i = 0; i < size && ret == UA_STATUSCODE_GOOD; ++i) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (697:27): [True: 0, False: 0]
  |  Branch (697:39): [True: 0, False: 0]
  ------------------
  698|      0|            ret |= writeJsonArrElm(ctx, &eo, &UA_TYPES[UA_TYPES_EXTENSIONOBJECT]);
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  699|      0|            eo.content.decoded.data = (void*)
  700|      0|                ((uintptr_t)eo.content.decoded.data + memSize);
  701|      0|        }
  702|      0|    }
  703|       |
  704|  16.4k|    return ret | writeJsonArrEnd(ctx, type);
  705|  16.4k|}
ua_types_encoding_json.c:Variant_encodeJson:
  753|   249k|ENCODE_JSON(Variant) {
  754|   249k|    const UA_Variant *src = (const UA_Variant*)p;
  755|   249k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   249k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  756|   249k|    res |= writeJsonObjStart(ctx);
  757|   249k|    res |= encodeVariantInner(ctx, src);
  758|   249k|    res |= writeJsonObjEnd(ctx);
  759|   249k|    return res;
  760|   249k|}
ua_types_encoding_json.c:DiagnosticInfo_encodeJson:
  804|  1.83k|ENCODE_JSON(DiagnosticInfo) {
  805|  1.83k|    const UA_DiagnosticInfo *src = (const UA_DiagnosticInfo*)p;
  806|  1.83k|    status ret = writeJsonObjStart(ctx);
  807|       |
  808|  1.83k|    if(src->hasSymbolicId) {
  ------------------
  |  Branch (808:8): [True: 0, False: 1.83k]
  ------------------
  809|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_SYMBOLICID);
  810|      0|        ret |= Int32_encodeJson(ctx, &src->symbolicId, NULL);
  811|      0|    }
  812|       |
  813|  1.83k|    if(src->hasNamespaceUri) {
  ------------------
  |  Branch (813:8): [True: 0, False: 1.83k]
  ------------------
  814|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_NAMESPACEURI);
  815|      0|        ret |= Int32_encodeJson(ctx, &src->namespaceUri, NULL);
  816|      0|    }
  817|       |
  818|  1.83k|    if(src->hasLocalizedText) {
  ------------------
  |  Branch (818:8): [True: 0, False: 1.83k]
  ------------------
  819|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_LOCALIZEDTEXT);
  820|      0|        ret |= Int32_encodeJson(ctx, &src->localizedText, NULL);
  821|      0|    }
  822|       |
  823|  1.83k|    if(src->hasLocale) {
  ------------------
  |  Branch (823:8): [True: 0, False: 1.83k]
  ------------------
  824|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_LOCALE);
  825|      0|        ret |= Int32_encodeJson(ctx, &src->locale, NULL);
  826|      0|    }
  827|       |
  828|  1.83k|    if(src->hasAdditionalInfo) {
  ------------------
  |  Branch (828:8): [True: 0, False: 1.83k]
  ------------------
  829|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_ADDITIONALINFO);
  830|      0|        ret |= String_encodeJson(ctx, &src->additionalInfo, NULL);
  831|      0|    }
  832|       |
  833|  1.83k|    if(src->hasInnerStatusCode) {
  ------------------
  |  Branch (833:8): [True: 0, False: 1.83k]
  ------------------
  834|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_INNERSTATUSCODE);
  835|      0|        ret |= StatusCode_encodeJson(ctx, &src->innerStatusCode, NULL);
  836|      0|    }
  837|       |
  838|  1.83k|    if(src->hasInnerDiagnosticInfo && src->innerDiagnosticInfo) {
  ------------------
  |  Branch (838:8): [True: 0, False: 1.83k]
  |  Branch (838:39): [True: 0, False: 0]
  ------------------
  839|      0|        ret |= writeJsonKey(ctx, UA_JSONKEY_INNERDIAGNOSTICINFO);
  840|      0|        ret |= DiagnosticInfo_encodeJson(ctx, src->innerDiagnosticInfo, NULL);
  841|      0|    }
  842|       |
  843|  1.83k|    return ret | writeJsonObjEnd(ctx);
  844|  1.83k|}
ua_types_encoding_json.c:jsoneq:
 1088|  2.26M|jsoneq(const char *json, const cj5_token *tok, const char *searchKey) {
 1089|       |    /* TODO: necessary?
 1090|       |       if(json == NULL
 1091|       |            || tok == NULL
 1092|       |            || searchKey == NULL) {
 1093|       |        return -1;
 1094|       |    } */
 1095|       |
 1096|  2.26M|    size_t len = getTokenLength(tok);
 1097|  2.26M|    if(tok->type == CJ5_TOKEN_STRING &&
  ------------------
  |  Branch (1097:8): [True: 2.26M, False: 0]
  ------------------
 1098|  2.26M|       strlen(searchKey) ==  len &&
  ------------------
  |  Branch (1098:8): [True: 1.90M, False: 363k]
  ------------------
 1099|  1.90M|       strncmp(json + tok->start, (const char*)searchKey, len) == 0)
  ------------------
  |  Branch (1099:8): [True: 1.89M, False: 8.27k]
  ------------------
 1100|  1.89M|        return 0;
 1101|       |
 1102|   371k|    return -1;
 1103|  2.26M|}
ua_types_encoding_json.c:skipObject:
 1072|   497k|skipObject(ParseCtx *ctx) {
 1073|   497k|    unsigned int end = ctx->tokens[ctx->index].end;
 1074|  53.9M|    do {
 1075|  53.9M|        ctx->index++;
 1076|  53.9M|    } while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (1076:13): [True: 53.9M, False: 10.8k]
  ------------------
 1077|  53.9M|            ctx->tokens[ctx->index].start < end);
  ------------------
  |  Branch (1077:13): [True: 53.4M, False: 486k]
  ------------------
 1078|   497k|}
ua_types_encoding_json.c:DiagnosticInfo_decodeJson:
 2211|  1.22k|DECODE_JSON(DiagnosticInfo) {
 2212|  1.22k|    UA_DiagnosticInfo *dst = (UA_DiagnosticInfo*)p;
 2213|  1.22k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DiagnosticInfo */
  ------------------
  |  | 1057|  1.22k|#define CHECK_NULL_SKIP do {                         \
  |  | 1058|  1.22k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1058:8): [True: 0, False: 1.22k]
  |  |  ------------------
  |  | 1059|      0|        ctx->index++;                                \
  |  | 1060|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1061|  1.22k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1061:14): [Folded, False: 1.22k]
  |  |  ------------------
  ------------------
 2214|  1.22k|    CHECK_OBJECT;
  ------------------
  |  | 1052|  1.22k|#define CHECK_OBJECT do {                                \
  |  | 1053|  1.22k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1053:8): [True: 0, False: 1.22k]
  |  |  ------------------
  |  | 1054|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1055|  1.22k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1055:14): [Folded, False: 1.22k]
  |  |  ------------------
  ------------------
 2215|       |
 2216|  1.22k|    DecodeEntry entries[7] = {
 2217|  1.22k|        {UA_JSONKEY_SYMBOLICID, &dst->symbolicId, NULL,
 2218|  1.22k|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|  1.22k|#define UA_TYPES_INT32 5
  ------------------
 2219|  1.22k|        {UA_JSONKEY_NAMESPACEURI, &dst->namespaceUri, NULL,
 2220|  1.22k|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|  1.22k|#define UA_TYPES_INT32 5
  ------------------
 2221|  1.22k|        {UA_JSONKEY_LOCALIZEDTEXT, &dst->localizedText, NULL,
 2222|  1.22k|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|  1.22k|#define UA_TYPES_INT32 5
  ------------------
 2223|  1.22k|        {UA_JSONKEY_LOCALE, &dst->locale, NULL,
 2224|  1.22k|         false, &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  191|  1.22k|#define UA_TYPES_INT32 5
  ------------------
 2225|  1.22k|        {UA_JSONKEY_ADDITIONALINFO, &dst->additionalInfo, NULL,
 2226|  1.22k|         false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  395|  1.22k|#define UA_TYPES_STRING 11
  ------------------
 2227|  1.22k|        {UA_JSONKEY_INNERSTATUSCODE, &dst->innerStatusCode, NULL,
 2228|  1.22k|         false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  633|  1.22k|#define UA_TYPES_STATUSCODE 18
  ------------------
 2229|  1.22k|        {UA_JSONKEY_INNERDIAGNOSTICINFO, &dst->innerDiagnosticInfo,
 2230|  1.22k|         DiagnosticInfoInner_decodeJson, false, NULL}
 2231|  1.22k|    };
 2232|  1.22k|    status ret = decodeFields(ctx, entries, 7);
 2233|       |
 2234|  1.22k|    dst->hasSymbolicId = entries[0].found;
 2235|  1.22k|    dst->hasNamespaceUri = entries[1].found;
 2236|  1.22k|    dst->hasLocalizedText = entries[2].found;
 2237|  1.22k|    dst->hasLocale = entries[3].found;
 2238|  1.22k|    dst->hasAdditionalInfo = entries[4].found;
 2239|  1.22k|    dst->hasInnerStatusCode = entries[5].found;
 2240|  1.22k|    dst->hasInnerDiagnosticInfo = entries[6].found;
 2241|  1.22k|    return ret;
 2242|  1.22k|}
ua_types_encoding_json.c:Boolean_decodeJson:
 1105|  3.76k|DECODE_JSON(Boolean) {
 1106|  3.76k|    UA_Boolean *dst = (UA_Boolean*)p;
 1107|  3.76k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|  3.76k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|  3.76k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 3.76k]
  |  |  ------------------
  |  | 1034|  3.76k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|  3.76k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 3.76k]
  |  |  ------------------
  ------------------
 1108|  3.76k|    CHECK_BOOL;
  ------------------
  |  | 1042|  3.76k|#define CHECK_BOOL do {                                \
  |  | 1043|  3.76k|    if(currentTokenType(ctx) != CJ5_TOKEN_BOOL) {      \
  |  |  ------------------
  |  |  |  Branch (1043:8): [True: 9, False: 3.75k]
  |  |  ------------------
  |  | 1044|      9|        return UA_STATUSCODE_BADDECODINGERROR;         \
  |  |  ------------------
  |  |  |  |   44|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1045|  3.75k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1045:14): [Folded, False: 3.75k]
  |  |  ------------------
  ------------------
 1109|  3.75k|    GET_TOKEN;
  ------------------
  |  | 1028|  3.75k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|  3.75k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|  3.75k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 3.75k]
  |  |  ------------------
  ------------------
 1110|       |
 1111|  3.75k|    if(tokenSize == 4 &&
  ------------------
  |  Branch (1111:8): [True: 515, False: 3.24k]
  ------------------
 1112|    515|       (tokenData[0] | 32) == 't' && (tokenData[1] | 32) == 'r' &&
  ------------------
  |  Branch (1112:8): [True: 515, False: 0]
  |  Branch (1112:38): [True: 515, False: 0]
  ------------------
 1113|    515|       (tokenData[2] | 32) == 'u' && (tokenData[3] | 32) == 'e') {
  ------------------
  |  Branch (1113:8): [True: 515, False: 0]
  |  Branch (1113:38): [True: 515, False: 0]
  ------------------
 1114|    515|        *dst = true;
 1115|  3.24k|    } else if(tokenSize == 5 &&
  ------------------
  |  Branch (1115:15): [True: 3.24k, False: 0]
  ------------------
 1116|  3.24k|              (tokenData[0] | 32) == 'f' && (tokenData[1] | 32) == 'a' &&
  ------------------
  |  Branch (1116:15): [True: 3.24k, False: 0]
  |  Branch (1116:45): [True: 3.24k, False: 0]
  ------------------
 1117|  3.24k|              (tokenData[2] | 32) == 'l' && (tokenData[3] | 32) == 's' &&
  ------------------
  |  Branch (1117:15): [True: 3.24k, False: 0]
  |  Branch (1117:45): [True: 3.24k, False: 0]
  ------------------
 1118|  3.24k|              (tokenData[4] | 32) == 'e') {
  ------------------
  |  Branch (1118:15): [True: 3.24k, False: 0]
  ------------------
 1119|  3.24k|        *dst = false;
 1120|  3.24k|    } else {
 1121|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1122|      0|    }
 1123|       |
 1124|  3.75k|    ctx->index++;
 1125|  3.75k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  3.75k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1126|  3.75k|}
ua_types_encoding_json.c:SByte_decodeJson:
 1213|  34.5k|DECODE_JSON(SByte) {
 1214|  34.5k|    UA_SByte *dst = (UA_SByte*)p;
 1215|  34.5k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|  34.5k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|  34.5k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 34.5k]
  |  |  ------------------
  |  | 1034|  34.5k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|  34.5k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 34.5k]
  |  |  ------------------
  ------------------
 1216|  34.5k|    CHECK_NUMBER;
  ------------------
  |  | 1037|  34.5k|#define CHECK_NUMBER do {                                \
  |  | 1038|  34.5k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 3, False: 34.5k]
  |  |  ------------------
  |  | 1039|      3|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|  34.5k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 34.5k]
  |  |  ------------------
  ------------------
 1217|  34.5k|    GET_TOKEN;
  ------------------
  |  | 1028|  34.5k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|  34.5k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|  34.5k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 34.5k]
  |  |  ------------------
  ------------------
 1218|  34.5k|    UA_Int64 out = 0;
 1219|  34.5k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1220|  34.5k|    if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   17|  69.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   63|  69.1k|#define UA_SBYTE_MIN (-128)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   64|  34.5k|#define UA_SBYTE_MAX 127
  ------------------
  |  Branch (1220:8): [True: 15, False: 34.5k]
  |  Branch (1220:35): [True: 2, False: 34.5k]
  |  Branch (1220:57): [True: 3, False: 34.5k]
  ------------------
 1221|     20|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     20|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1222|  34.5k|    *dst = (UA_SByte)out;
 1223|  34.5k|    ctx->index++;
 1224|  34.5k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  34.5k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1225|  34.5k|}
ua_types_encoding_json.c:parseSignedInteger:
 1145|  3.59M|parseSignedInteger(const char *tokenData, size_t tokenSize, UA_Int64 *dst) {
 1146|  3.59M|    size_t len = parseInt64(tokenData, tokenSize, dst);
 1147|  3.59M|    if(len == 0)
  ------------------
  |  Branch (1147:8): [True: 8, False: 3.59M]
  ------------------
 1148|      8|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      8|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1149|       |
 1150|       |    /* There must only be whitespace between the end of the parsed number and
 1151|       |     * the end of the token */
 1152|  3.59M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1152:25): [True: 782, False: 3.59M]
  ------------------
 1153|    782|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1153:12): [True: 773, False: 9]
  |  Branch (1153:35): [True: 43, False: 730]
  ------------------
 1154|     43|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     43|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1155|    782|    }
 1156|       |
 1157|  3.59M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  3.59M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1158|  3.59M|}
ua_types_encoding_json.c:Byte_decodeJson:
 1160|   278k|DECODE_JSON(Byte) {
 1161|   278k|    UA_Byte *dst = (UA_Byte*)p;
 1162|   278k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|   278k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|   278k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 278k]
  |  |  ------------------
  |  | 1034|   278k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|   278k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 278k]
  |  |  ------------------
  ------------------
 1163|   278k|    CHECK_NUMBER;
  ------------------
  |  | 1037|   278k|#define CHECK_NUMBER do {                                \
  |  | 1038|   278k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 0, False: 278k]
  |  |  ------------------
  |  | 1039|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|   278k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 278k]
  |  |  ------------------
  ------------------
 1164|   278k|    GET_TOKEN;
  ------------------
  |  | 1028|   278k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|   278k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|   278k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 278k]
  |  |  ------------------
  ------------------
 1165|   278k|    UA_UInt64 out = 0;
 1166|   278k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1167|   278k|    if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   17|   557k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   73|   278k|#define UA_BYTE_MAX 255
  ------------------
  |  Branch (1167:8): [True: 13, False: 278k]
  |  Branch (1167:35): [True: 3, False: 278k]
  ------------------
 1168|     16|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     16|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1169|   278k|    *dst = (UA_Byte)out;
 1170|   278k|    ctx->index++;
 1171|   278k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   278k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1172|   278k|}
ua_types_encoding_json.c:parseUnsignedInteger:
 1129|  5.23M|parseUnsignedInteger(const char *tokenData, size_t tokenSize, UA_UInt64 *dst) {
 1130|  5.23M|    size_t len = parseUInt64(tokenData, tokenSize, dst);
 1131|  5.23M|    if(len == 0)
  ------------------
  |  Branch (1131:8): [True: 22, False: 5.23M]
  ------------------
 1132|     22|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     22|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1133|       |
 1134|       |    /* There must only be whitespace between the end of the parsed number and
 1135|       |     * the end of the token */
 1136|  5.23M|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1136:25): [True: 1.62k, False: 5.23M]
  ------------------
 1137|  1.62k|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1137:12): [True: 1.57k, False: 51]
  |  Branch (1137:35): [True: 51, False: 1.52k]
  ------------------
 1138|     51|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     51|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1139|  1.62k|    }
 1140|       |
 1141|  5.23M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  5.23M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1142|  5.23M|}
ua_types_encoding_json.c:Int16_decodeJson:
 1227|   268k|DECODE_JSON(Int16) {
 1228|   268k|    UA_Int16 *dst = (UA_Int16*)p;
 1229|   268k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|   268k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|   268k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 268k]
  |  |  ------------------
  |  | 1034|   268k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|   268k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 268k]
  |  |  ------------------
  ------------------
 1230|   268k|    CHECK_NUMBER;
  ------------------
  |  | 1037|   268k|#define CHECK_NUMBER do {                                \
  |  | 1038|   268k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 0, False: 268k]
  |  |  ------------------
  |  | 1039|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|   268k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 268k]
  |  |  ------------------
  ------------------
 1231|   268k|    GET_TOKEN;
  ------------------
  |  | 1028|   268k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|   268k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|   268k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 268k]
  |  |  ------------------
  ------------------
 1232|   268k|    UA_Int64 out = 0;
 1233|   268k|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1234|   268k|    if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   17|   537k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   81|   537k|#define UA_INT16_MIN (-32768)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   82|   268k|#define UA_INT16_MAX 32767
  ------------------
  |  Branch (1234:8): [True: 9, False: 268k]
  |  Branch (1234:35): [True: 0, False: 268k]
  |  Branch (1234:57): [True: 1, False: 268k]
  ------------------
 1235|     10|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     10|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1236|   268k|    *dst = (UA_Int16)out;
 1237|   268k|    ctx->index++;
 1238|   268k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   268k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1239|   268k|}
ua_types_encoding_json.c:UInt16_decodeJson:
 1174|   445k|DECODE_JSON(UInt16) {
 1175|   445k|    UA_UInt16 *dst = (UA_UInt16*)p;
 1176|   445k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|   445k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|   445k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 445k]
  |  |  ------------------
  |  | 1034|   445k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|   445k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 445k]
  |  |  ------------------
  ------------------
 1177|   445k|    CHECK_NUMBER;
  ------------------
  |  | 1037|   445k|#define CHECK_NUMBER do {                                \
  |  | 1038|   445k|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 0, False: 445k]
  |  |  ------------------
  |  | 1039|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|   445k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 445k]
  |  |  ------------------
  ------------------
 1178|   445k|    GET_TOKEN;
  ------------------
  |  | 1028|   445k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|   445k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|   445k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 445k]
  |  |  ------------------
  ------------------
 1179|   445k|    UA_UInt64 out = 0;
 1180|   445k|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1181|   445k|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   17|   890k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   91|   445k|#define UA_UINT16_MAX 65535
  ------------------
  |  Branch (1181:8): [True: 12, False: 445k]
  |  Branch (1181:35): [True: 8, False: 445k]
  ------------------
 1182|     20|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     20|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1183|   445k|    *dst = (UA_UInt16)out;
 1184|   445k|    ctx->index++;
 1185|   445k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   445k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1186|   445k|}
ua_types_encoding_json.c:Int32_decodeJson:
 1241|  1.80M|DECODE_JSON(Int32) {
 1242|  1.80M|    UA_Int32 *dst = (UA_Int32*)p;
 1243|  1.80M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|  1.80M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|  1.80M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 1.80M]
  |  |  ------------------
  |  | 1034|  1.80M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|  1.80M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 1.80M]
  |  |  ------------------
  ------------------
 1244|  1.80M|    CHECK_NUMBER;
  ------------------
  |  | 1037|  1.80M|#define CHECK_NUMBER do {                                \
  |  | 1038|  1.80M|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 0, False: 1.80M]
  |  |  ------------------
  |  | 1039|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|  1.80M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 1.80M]
  |  |  ------------------
  ------------------
 1245|  1.80M|    GET_TOKEN;
  ------------------
  |  | 1028|  1.80M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|  1.80M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|  1.80M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 1.80M]
  |  |  ------------------
  ------------------
 1246|  1.80M|    UA_Int64 out = 0;
 1247|  1.80M|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, &out);
 1248|  1.80M|    if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   17|  3.60M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   99|  3.60M|#define UA_INT32_MIN ((int32_t)-2147483648LL)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |  100|  1.80M|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (1248:8): [True: 5, False: 1.80M]
  |  Branch (1248:35): [True: 1, False: 1.80M]
  |  Branch (1248:57): [True: 2, False: 1.80M]
  ------------------
 1249|      8|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      8|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1250|  1.80M|    *dst = (UA_Int32)out;
 1251|  1.80M|    ctx->index++;
 1252|  1.80M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.80M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1253|  1.80M|}
ua_types_encoding_json.c:UInt32_decodeJson:
 1188|  1.88M|DECODE_JSON(UInt32) {
 1189|  1.88M|    UA_UInt32 *dst = (UA_UInt32*)p;
 1190|  1.88M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|  1.88M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|  1.88M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 1.88M]
  |  |  ------------------
  |  | 1034|  1.88M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|  1.88M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 1.88M]
  |  |  ------------------
  ------------------
 1191|  1.88M|    CHECK_NUMBER;
  ------------------
  |  | 1037|  1.88M|#define CHECK_NUMBER do {                                \
  |  | 1038|  1.88M|    if(currentTokenType(ctx) != CJ5_TOKEN_NUMBER) {      \
  |  |  ------------------
  |  |  |  Branch (1038:8): [True: 5, False: 1.88M]
  |  |  ------------------
  |  | 1039|      5|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1040|  1.88M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1040:14): [Folded, False: 1.88M]
  |  |  ------------------
  ------------------
 1192|  1.88M|    GET_TOKEN;
  ------------------
  |  | 1028|  1.88M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|  1.88M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|  1.88M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 1.88M]
  |  |  ------------------
  ------------------
 1193|  1.88M|    UA_UInt64 out = 0;
 1194|  1.88M|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, &out);
 1195|  1.88M|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |   17|  3.77M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |  109|  1.88M|#define UA_UINT32_MAX 4294967295UL
  ------------------
  |  Branch (1195:8): [True: 27, False: 1.88M]
  |  Branch (1195:35): [True: 12, False: 1.88M]
  ------------------
 1196|     39|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     39|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1197|  1.88M|    *dst = (UA_UInt32)out;
 1198|  1.88M|    ctx->index++;
 1199|  1.88M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.88M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1200|  1.88M|}
ua_types_encoding_json.c:Int64_decodeJson:
 1255|  1.49M|DECODE_JSON(Int64) {
 1256|  1.49M|    UA_Int64 *dst = (UA_Int64*)p;
 1257|  1.49M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|  1.49M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|  1.49M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 1.49M]
  |  |  ------------------
  |  | 1034|  1.49M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|  1.49M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 1.49M]
  |  |  ------------------
  ------------------
 1258|  1.49M|    GET_TOKEN;
  ------------------
  |  | 1028|  1.49M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|  1.49M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|  1.49M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 1.49M]
  |  |  ------------------
  ------------------
 1259|  1.49M|    UA_StatusCode s = parseSignedInteger(tokenData, tokenSize, dst);
 1260|  1.49M|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  1.49M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1260:8): [True: 22, False: 1.49M]
  ------------------
 1261|     22|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     22|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1262|  1.49M|    ctx->index++;
 1263|  1.49M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.49M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1264|  1.49M|}
ua_types_encoding_json.c:UInt64_decodeJson:
 1202|  2.62M|DECODE_JSON(UInt64) {
 1203|  2.62M|    UA_UInt64 *dst = (UA_UInt64*)p;
 1204|  2.62M|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|  2.62M|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|  2.62M|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 2.62M]
  |  |  ------------------
  |  | 1034|  2.62M|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|  2.62M|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 2.62M]
  |  |  ------------------
  ------------------
 1205|  2.62M|    GET_TOKEN;
  ------------------
  |  | 1028|  2.62M|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|  2.62M|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|  2.62M|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 2.62M]
  |  |  ------------------
  ------------------
 1206|  2.62M|    UA_StatusCode s = parseUnsignedInteger(tokenData, tokenSize, dst);
 1207|  2.62M|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  2.62M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1207:8): [True: 21, False: 2.62M]
  ------------------
 1208|     21|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     21|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1209|  2.62M|    ctx->index++;
 1210|  2.62M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  2.62M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1211|  2.62M|}
ua_types_encoding_json.c:Float_decodeJson:
 1327|   109k|DECODE_JSON(Float) {
 1328|   109k|    UA_Float *dst = (UA_Float*)p;
 1329|   109k|    UA_Double v = 0.0;
 1330|       |    UA_StatusCode res = Double_decodeJson(ctx, &v, NULL);
 1331|   109k|    *dst = (UA_Float)v;
 1332|   109k|    return res;
 1333|   109k|}
ua_types_encoding_json.c:Double_decodeJson:
 1267|   749k|DECODE_JSON(Double) {
 1268|   749k|    UA_Double *dst = (UA_Double*)p;
 1269|   749k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|   749k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|   749k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 749k]
  |  |  ------------------
  |  | 1034|   749k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|   749k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 749k]
  |  |  ------------------
  ------------------
 1270|   749k|    GET_TOKEN;
  ------------------
  |  | 1028|   749k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|   749k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|   749k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 749k]
  |  |  ------------------
  ------------------
 1271|       |
 1272|       |    /* https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/
 1273|       |     * Maximum digit counts for select IEEE floating-point formats: 1074
 1274|       |     * Sanity check.
 1275|       |     */
 1276|   749k|    if(tokenSize > 2000)
  ------------------
  |  Branch (1276:8): [True: 1, False: 749k]
  ------------------
 1277|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1278|       |
 1279|   749k|    cj5_token_type tokenType = currentTokenType(ctx);
 1280|       |
 1281|       |    /* It could be a String with Nan, Infinity */
 1282|   749k|    if(tokenType == CJ5_TOKEN_STRING) {
  ------------------
  |  Branch (1282:8): [True: 2.45k, False: 746k]
  ------------------
 1283|  2.45k|        ctx->index++;
 1284|       |
 1285|  2.45k|        if(tokenSize == 8 && memcmp(tokenData, "Infinity", 8) == 0) {
  ------------------
  |  Branch (1285:12): [True: 520, False: 1.93k]
  |  Branch (1285:30): [True: 520, False: 0]
  ------------------
 1286|    520|            *dst = INFINITY;
 1287|    520|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    520|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1288|    520|        }
 1289|       |
 1290|  1.93k|        if(tokenSize == 9 && memcmp(tokenData, "-Infinity", 9) == 0) {
  ------------------
  |  Branch (1290:12): [True: 522, False: 1.41k]
  |  Branch (1290:30): [True: 522, False: 0]
  ------------------
 1291|       |            /* workaround an MSVC 2013 issue */
 1292|    522|            *dst = -INFINITY;
 1293|    522|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    522|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1294|    522|        }
 1295|       |
 1296|  1.41k|        if(tokenSize == 3 && memcmp(tokenData, "NaN", 3) == 0) {
  ------------------
  |  Branch (1296:12): [True: 938, False: 477]
  |  Branch (1296:30): [True: 937, False: 1]
  ------------------
 1297|    937|            *dst = NAN;
 1298|    937|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    937|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1299|    937|        }
 1300|       |
 1301|    478|        if(tokenSize == 4 && memcmp(tokenData, "-NaN", 4) == 0) {
  ------------------
  |  Branch (1301:12): [True: 441, False: 37]
  |  Branch (1301:30): [True: 434, False: 7]
  ------------------
 1302|    434|            *dst = NAN;
 1303|    434|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    434|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1304|    434|        }
 1305|       |
 1306|     44|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     44|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1307|    478|    }
 1308|       |
 1309|   746k|    if(tokenType != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1309:8): [True: 2, False: 746k]
  ------------------
 1310|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1311|       |
 1312|   746k|    size_t len = parseDouble(tokenData, tokenSize, dst);
 1313|   746k|    if(len == 0)
  ------------------
  |  Branch (1313:8): [True: 2, False: 746k]
  ------------------
 1314|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1315|       |
 1316|       |    /* There must only be whitespace between the end of the parsed number and
 1317|       |     * the end of the token */
 1318|   746k|    for(size_t i = len; i < tokenSize; i++) {
  ------------------
  |  Branch (1318:25): [True: 6, False: 746k]
  ------------------
 1319|      6|        if(tokenData[i] != ' ' && tokenData[i] -'\t' >= 5)
  ------------------
  |  Branch (1319:12): [True: 6, False: 0]
  |  Branch (1319:35): [True: 6, False: 0]
  ------------------
 1320|      6|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1321|      6|    }
 1322|       |
 1323|   746k|    ctx->index++;
 1324|   746k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   746k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1325|   746k|}
ua_types_encoding_json.c:String_decodeJson:
 1345|   201k|DECODE_JSON(String) {
 1346|   201k|    UA_String *dst = (UA_String*)p;
 1347|   201k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|   201k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|   201k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 201k]
  |  |  ------------------
  |  | 1034|   201k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|   201k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 201k]
  |  |  ------------------
  ------------------
 1348|   201k|    CHECK_STRING;
  ------------------
  |  | 1047|   201k|#define CHECK_STRING do {                                \
  |  | 1048|   201k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1048:8): [True: 6, False: 201k]
  |  |  ------------------
  |  | 1049|      6|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1050|   201k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1050:14): [Folded, False: 201k]
  |  |  ------------------
  ------------------
 1349|   201k|    GET_TOKEN;
  ------------------
  |  | 1028|   201k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|   201k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|   201k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 201k]
  |  |  ------------------
  ------------------
 1350|   201k|    (void)tokenData;
 1351|       |
 1352|       |    /* Empty string? */
 1353|   201k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1353:8): [True: 9.21k, False: 192k]
  ------------------
 1354|  9.21k|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  9.21k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1355|  9.21k|        dst->length = 0;
 1356|  9.21k|        ctx->index++;
 1357|  9.21k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  9.21k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1358|  9.21k|    }
 1359|       |
 1360|       |    /* The decoded utf8 is at most of the same length as the source string */
 1361|   192k|    char *outBuf = (char*)UA_malloc(tokenSize+1);
  ------------------
  |  |   18|   192k|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 1362|   192k|    if(!outBuf)
  ------------------
  |  Branch (1362:8): [True: 0, False: 192k]
  ------------------
 1363|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1364|       |
 1365|       |    /* Decode the string */
 1366|   192k|    cj5_result r;
 1367|   192k|    r.tokens = ctx->tokens;
 1368|   192k|    r.num_tokens = (unsigned int)ctx->tokensSize;
 1369|   192k|    r.json5 = ctx->json5;
 1370|   192k|    unsigned int len = 0;
 1371|   192k|    cj5_error_code err = cj5_get_str(&r, (unsigned int)ctx->index, outBuf, &len);
 1372|   192k|    if(err != CJ5_ERROR_NONE) {
  ------------------
  |  Branch (1372:8): [True: 45, False: 192k]
  ------------------
 1373|     45|        UA_free(outBuf);
  ------------------
  |  |   19|     45|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1374|     45|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     45|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1375|     45|    }
 1376|       |
 1377|       |    /* Set the output */
 1378|   192k|    dst->length = len;
 1379|   192k|    if(dst->length > 0) {
  ------------------
  |  Branch (1379:8): [True: 192k, False: 0]
  ------------------
 1380|   192k|        dst->data = (UA_Byte*)outBuf;
 1381|   192k|    } else {
 1382|      0|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|      0|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1383|      0|        UA_free(outBuf);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1384|      0|    }
 1385|       |
 1386|   192k|    ctx->index++;
 1387|   192k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   192k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1388|   192k|}
ua_types_encoding_json.c:DateTime_decodeJson:
 1493|  18.9k|DECODE_JSON(DateTime) {
 1494|  18.9k|    UA_DateTime *dst = (UA_DateTime*)p;
 1495|  18.9k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|  18.9k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|  18.9k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 18.9k]
  |  |  ------------------
  |  | 1034|  18.9k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|  18.9k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 18.9k]
  |  |  ------------------
  ------------------
 1496|  18.9k|    CHECK_STRING;
  ------------------
  |  | 1047|  18.9k|#define CHECK_STRING do {                                \
  |  | 1048|  18.9k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1048:8): [True: 1, False: 18.9k]
  |  |  ------------------
  |  | 1049|      1|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1050|  18.9k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1050:14): [Folded, False: 18.9k]
  |  |  ------------------
  ------------------
 1497|  18.9k|    GET_TOKEN;
  ------------------
  |  | 1028|  18.9k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|  18.9k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|  18.9k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 18.9k]
  |  |  ------------------
  ------------------
 1498|       |
 1499|       |    /* The last character has to be 'Z'. We can omit some length checks later on
 1500|       |     * because we know the atoi functions stop before the 'Z'. */
 1501|  18.9k|    if(tokenSize == 0 || tokenData[tokenSize-1] != 'Z')
  ------------------
  |  Branch (1501:8): [True: 0, False: 18.9k]
  |  Branch (1501:26): [True: 7, False: 18.8k]
  ------------------
 1502|      7|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1503|       |
 1504|  18.8k|    struct musl_tm dts;
 1505|  18.8k|    memset(&dts, 0, sizeof(dts));
 1506|       |
 1507|  18.8k|    size_t pos = 0;
 1508|  18.8k|    size_t len;
 1509|       |
 1510|       |    /* Parse the year. The ISO standard asks for four digits. But we accept up
 1511|       |     * to five with an optional plus or minus in front due to the range of the
 1512|       |     * DateTime 64bit integer. But in that case we require the year and the
 1513|       |     * month to be separated by a '-'. Otherwise we cannot know where the month
 1514|       |     * starts. */
 1515|  18.8k|    if(tokenData[0] == '-' || tokenData[0] == '+')
  ------------------
  |  Branch (1515:8): [True: 3.40k, False: 15.4k]
  |  Branch (1515:31): [True: 551, False: 14.9k]
  ------------------
 1516|  3.95k|        pos++;
 1517|  18.8k|    UA_Int64 year = 0;
 1518|  18.8k|    len = parseInt64(&tokenData[pos], 5, &year);
 1519|  18.8k|    pos += len;
 1520|  18.8k|    if(len != 4 && tokenData[pos] != '-')
  ------------------
  |  Branch (1520:8): [True: 6.06k, False: 12.8k]
  |  Branch (1520:20): [True: 9, False: 6.05k]
  ------------------
 1521|      9|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      9|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1522|  18.8k|    if(tokenData[0] == '-')
  ------------------
  |  Branch (1522:8): [True: 3.40k, False: 15.4k]
  ------------------
 1523|  3.40k|        year = -year;
 1524|  18.8k|    dts.tm_year = (UA_Int16)year - 1900;
 1525|  18.8k|    if(tokenData[pos] == '-')
  ------------------
  |  Branch (1525:8): [True: 18.8k, False: 0]
  ------------------
 1526|  18.8k|        pos++;
 1527|       |
 1528|       |    /* Parse the month */
 1529|  18.8k|    UA_UInt64 month = 0;
 1530|  18.8k|    len = parseUInt64(&tokenData[pos], 2, &month);
 1531|  18.8k|    pos += len;
 1532|  18.8k|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|  18.8k|    do {                                                                                 \
  |  |  173|  18.8k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|  18.8k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 2, False: 18.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      2|            EVAL_ON_ERROR;                                                               \
  |  |  175|      2|        }                                                                                \
  |  |  176|  18.8k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 18.8k]
  |  |  ------------------
  ------------------
 1533|  18.8k|    dts.tm_mon = (UA_UInt16)month - 1;
 1534|  18.8k|    if(tokenData[pos] == '-')
  ------------------
  |  Branch (1534:8): [True: 8.87k, False: 10.0k]
  ------------------
 1535|  8.87k|        pos++;
 1536|       |
 1537|       |    /* Parse the day and check the T between date and time */
 1538|  18.8k|    UA_UInt64 day = 0;
 1539|  18.8k|    len = parseUInt64(&tokenData[pos], 2, &day);
 1540|  18.8k|    pos += len;
 1541|  18.8k|    UA_CHECK(len == 2 || tokenData[pos] != 'T',
  ------------------
  |  |  172|  18.8k|    do {                                                                                 \
  |  |  173|  18.8k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|  19.9k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 0, False: 18.8k]
  |  |  |  |  |  Branch (579:43): [True: 17.7k, False: 1.10k]
  |  |  |  |  |  Branch (579:43): [True: 1.10k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|  18.8k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 18.8k]
  |  |  ------------------
  ------------------
 1542|  18.8k|             return UA_STATUSCODE_BADDECODINGERROR);
 1543|  18.8k|    dts.tm_mday = (UA_UInt16)day;
 1544|  18.8k|    pos++;
 1545|       |
 1546|       |    /* Parse the hour */
 1547|  18.8k|    UA_UInt64 hour = 0;
 1548|  18.8k|    len = parseUInt64(&tokenData[pos], 2, &hour);
 1549|  18.8k|    pos += len;
 1550|  18.8k|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|  18.8k|    do {                                                                                 \
  |  |  173|  18.8k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|  18.8k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 6, False: 18.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      6|            EVAL_ON_ERROR;                                                               \
  |  |  175|      6|        }                                                                                \
  |  |  176|  18.8k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 18.8k]
  |  |  ------------------
  ------------------
 1551|  18.8k|    dts.tm_hour = (UA_UInt16)hour;
 1552|  18.8k|    if(tokenData[pos] == ':')
  ------------------
  |  Branch (1552:8): [True: 8.86k, False: 10.0k]
  ------------------
 1553|  8.86k|        pos++;
 1554|       |
 1555|       |    /* Parse the minute */
 1556|  18.8k|    UA_UInt64 min = 0;
 1557|  18.8k|    len = parseUInt64(&tokenData[pos], 2, &min);
 1558|  18.8k|    pos += len;
 1559|  18.8k|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|  18.8k|    do {                                                                                 \
  |  |  173|  18.8k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|  18.8k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 7, False: 18.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      7|            EVAL_ON_ERROR;                                                               \
  |  |  175|      7|        }                                                                                \
  |  |  176|  18.8k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 18.8k]
  |  |  ------------------
  ------------------
 1560|  18.8k|    dts.tm_min = (UA_UInt16)min;
 1561|  18.8k|    if(tokenData[pos] == ':')
  ------------------
  |  Branch (1561:8): [True: 8.86k, False: 10.0k]
  ------------------
 1562|  8.86k|        pos++;
 1563|       |
 1564|       |    /* Parse the second */
 1565|  18.8k|    UA_UInt64 sec = 0;
 1566|  18.8k|    len = parseUInt64(&tokenData[pos], 2, &sec);
 1567|  18.8k|    pos += len;
 1568|  18.8k|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|  18.8k|    do {                                                                                 \
  |  |  173|  18.8k|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|  18.8k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 2, False: 18.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      2|            EVAL_ON_ERROR;                                                               \
  |  |  175|      2|        }                                                                                \
  |  |  176|  18.8k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 18.8k]
  |  |  ------------------
  ------------------
 1569|  18.8k|    dts.tm_sec = (UA_UInt16)sec;
 1570|       |
 1571|       |    /* Compute the seconds since the Unix epoch */
 1572|  18.8k|    long long sinceunix = musl_tm_to_secs(&dts);
 1573|       |
 1574|       |    /* Are we within the range that can be represented? */
 1575|  18.8k|    long long sinceunix_min =
 1576|  18.8k|        (long long)(UA_INT64_MIN / UA_DATETIME_SEC) -
  ------------------
  |  |  119|  18.8k|#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
  |  |  ------------------
  |  |  |  |  118|  18.8k|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  |  |  ------------------
  ------------------
                      (long long)(UA_INT64_MIN / UA_DATETIME_SEC) -
  ------------------
  |  |  285|  18.8k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  18.8k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  18.8k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1577|  18.8k|        (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC) -
  ------------------
  |  |  327|  18.8k|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|  18.8k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  18.8k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  18.8k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC) -
  ------------------
  |  |  285|  18.8k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  18.8k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  18.8k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1578|  18.8k|        (long long)1; /* manual correction due to rounding */
 1579|  18.8k|    long long sinceunix_max = (long long)
 1580|  18.8k|        ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  118|  18.8k|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  ------------------
                      ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  327|  18.8k|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|  18.8k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  18.8k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  18.8k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  285|  18.8k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  18.8k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  18.8k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1581|  18.8k|    if(sinceunix < sinceunix_min || sinceunix > sinceunix_max)
  ------------------
  |  Branch (1581:8): [True: 2, False: 18.8k]
  |  Branch (1581:37): [True: 2, False: 18.8k]
  ------------------
 1582|      4|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1583|       |
 1584|       |    /* Convert to DateTime. Add or subtract one extra second here to prevent
 1585|       |     * underflow/overflow. This is reverted once the fractional part has been
 1586|       |     * added. */
 1587|  18.8k|    sinceunix -= (sinceunix > 0) ? 1 : -1;
  ------------------
  |  Branch (1587:18): [True: 4.34k, False: 14.5k]
  ------------------
 1588|  18.8k|    UA_DateTime dt = (UA_DateTime)
 1589|  18.8k|        (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  327|  18.8k|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|  18.8k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|  18.8k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|  18.8k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  285|  18.8k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  18.8k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  18.8k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  285|  18.8k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  18.8k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  18.8k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1590|       |
 1591|       |    /* Parse the fraction of the second if defined */
 1592|  18.8k|    if(tokenData[pos] == ',' || tokenData[pos] == '.') {
  ------------------
  |  Branch (1592:8): [True: 743, False: 18.1k]
  |  Branch (1592:33): [True: 5.59k, False: 12.5k]
  ------------------
 1593|  6.33k|        pos++;
 1594|  6.33k|        double frac = 0.0;
 1595|  6.33k|        double denom = 0.1;
 1596|  90.2k|        while(pos < tokenSize &&
  ------------------
  |  Branch (1596:15): [True: 90.2k, False: 0]
  ------------------
 1597|  90.2k|              tokenData[pos] >= '0' && tokenData[pos] <= '9') {
  ------------------
  |  Branch (1597:15): [True: 90.2k, False: 20]
  |  Branch (1597:40): [True: 83.8k, False: 6.31k]
  ------------------
 1598|  83.8k|            frac += denom * (tokenData[pos] - '0');
 1599|  83.8k|            denom *= 0.1;
 1600|  83.8k|            pos++;
 1601|  83.8k|        }
 1602|  6.33k|        frac += 0.00000005; /* Correct rounding when converting to integer */
 1603|  6.33k|        dt += (UA_DateTime)(frac * UA_DATETIME_SEC);
  ------------------
  |  |  285|  6.33k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  6.33k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  6.33k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1604|  6.33k|    }
 1605|       |
 1606|       |    /* Remove the underflow/overflow protection (see above) */
 1607|  18.8k|    if(sinceunix > 0) {
  ------------------
  |  Branch (1607:8): [True: 4.34k, False: 14.5k]
  ------------------
 1608|  4.34k|        if(dt > UA_INT64_MAX - UA_DATETIME_SEC)
  ------------------
  |  |  118|  4.34k|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  ------------------
                      if(dt > UA_INT64_MAX - UA_DATETIME_SEC)
  ------------------
  |  |  285|  4.34k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  4.34k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  4.34k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1608:12): [True: 0, False: 4.34k]
  ------------------
 1609|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1610|  4.34k|        dt += UA_DATETIME_SEC;
  ------------------
  |  |  285|  4.34k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  4.34k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  4.34k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1611|  14.5k|    } else {
 1612|  14.5k|        if(dt < UA_INT64_MIN + UA_DATETIME_SEC)
  ------------------
  |  |  119|  14.5k|#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
  |  |  ------------------
  |  |  |  |  118|  14.5k|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  |  |  ------------------
  ------------------
                      if(dt < UA_INT64_MIN + UA_DATETIME_SEC)
  ------------------
  |  |  285|  14.5k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  14.5k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  14.5k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1612:12): [True: 0, False: 14.5k]
  ------------------
 1613|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1614|  14.5k|        dt -= UA_DATETIME_SEC;
  ------------------
  |  |  285|  14.5k|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|  14.5k|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|  14.5k|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1615|  14.5k|    }
 1616|       |
 1617|       |    /* We must be at the end of the string (ending with 'Z' as checked above) */
 1618|  18.8k|    if(pos != tokenSize - 1)
  ------------------
  |  Branch (1618:8): [True: 48, False: 18.8k]
  ------------------
 1619|     48|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     48|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1620|       |
 1621|  18.8k|    *dst = dt;
 1622|       |
 1623|  18.8k|    ctx->index++;
 1624|  18.8k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  18.8k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1625|  18.8k|}
ua_types_encoding_json.c:Guid_decodeJson:
 1335|  1.20k|DECODE_JSON(Guid) {
 1336|  1.20k|    UA_Guid *dst = (UA_Guid*)p;
 1337|  1.20k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|  1.20k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|  1.20k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 1.20k]
  |  |  ------------------
  |  | 1034|  1.20k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|  1.20k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 1.20k]
  |  |  ------------------
  ------------------
 1338|  1.20k|    CHECK_STRING;
  ------------------
  |  | 1047|  1.20k|#define CHECK_STRING do {                                \
  |  | 1048|  1.20k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1048:8): [True: 0, False: 1.20k]
  |  |  ------------------
  |  | 1049|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1050|  1.20k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1050:14): [Folded, False: 1.20k]
  |  |  ------------------
  ------------------
 1339|  1.20k|    GET_TOKEN;
  ------------------
  |  | 1028|  1.20k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|  1.20k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|  1.20k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 1.20k]
  |  |  ------------------
  ------------------
 1340|  1.20k|    UA_String str = {tokenSize, (UA_Byte*)(uintptr_t)tokenData};
 1341|  1.20k|    ctx->index++;
 1342|  1.20k|    return UA_Guid_parse(dst, str);
 1343|  1.20k|}
ua_types_encoding_json.c:ByteString_decodeJson:
 1390|  1.62k|DECODE_JSON(ByteString) {
 1391|  1.62k|    UA_ByteString *dst = (UA_ByteString*)p;
 1392|  1.62k|    CHECK_TOKEN_BOUNDS;
  ------------------
  |  | 1032|  1.62k|#define CHECK_TOKEN_BOUNDS do {                   \
  |  | 1033|  1.62k|    if(ctx->index >= ctx->tokensSize)             \
  |  |  ------------------
  |  |  |  Branch (1033:8): [True: 0, False: 1.62k]
  |  |  ------------------
  |  | 1034|  1.62k|        return UA_STATUSCODE_BADDECODINGERROR;    \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1035|  1.62k|    } while(0)
  |  |  ------------------
  |  |  |  Branch (1035:13): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
 1393|  1.62k|    CHECK_STRING;
  ------------------
  |  | 1047|  1.62k|#define CHECK_STRING do {                                \
  |  | 1048|  1.62k|    if(currentTokenType(ctx) != CJ5_TOKEN_STRING) {      \
  |  |  ------------------
  |  |  |  Branch (1048:8): [True: 2, False: 1.62k]
  |  |  ------------------
  |  | 1049|      2|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1050|  1.62k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1050:14): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
 1394|  1.62k|    GET_TOKEN;
  ------------------
  |  | 1028|  1.62k|    size_t tokenSize = getTokenLength(&ctx->tokens[ctx->index]);        \
  |  | 1029|  1.62k|    const char* tokenData = &ctx->json5[ctx->tokens[ctx->index].start]; \
  |  | 1030|  1.62k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (1030:17): [Folded, False: 1.62k]
  |  |  ------------------
  ------------------
 1395|       |
 1396|       |    /* Empty bytestring? */
 1397|  1.62k|    if(tokenSize == 0) {
  ------------------
  |  Branch (1397:8): [True: 1.35k, False: 271]
  ------------------
 1398|  1.35k|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  1.35k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1399|  1.35k|        dst->length = 0;
 1400|  1.35k|    } else {
 1401|    271|        size_t flen = 0;
 1402|    271|        unsigned char* unB64 =
 1403|    271|            UA_unbase64((const unsigned char*)tokenData, tokenSize, &flen);
 1404|    271|        if(unB64 == 0)
  ------------------
  |  Branch (1404:12): [True: 20, False: 251]
  ------------------
 1405|     20|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     20|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1406|    251|        dst->data = (u8*)unB64;
 1407|    251|        dst->length = flen;
 1408|    251|    }
 1409|       |
 1410|  1.60k|    ctx->index++;
 1411|  1.60k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.60k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1412|  1.62k|}
ua_types_encoding_json.c:NodeId_decodeJson:
 1470|  21.2k|DECODE_JSON(NodeId) {
 1471|  21.2k|    UA_NodeId *dst = (UA_NodeId*)p;
 1472|  21.2k|    UA_String str;
 1473|  21.2k|    UA_String_init(&str);
 1474|  21.2k|    status res = String_decodeJson(ctx, &str, NULL);
 1475|  21.2k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  21.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1475:8): [True: 21.2k, False: 28]
  ------------------
 1476|  21.2k|        res = UA_NodeId_parseEx(dst, str, ctx->namespaceMapping);
 1477|  21.2k|    UA_String_clear(&str);
 1478|  21.2k|    return res;
 1479|  21.2k|}
ua_types_encoding_json.c:ExpandedNodeId_decodeJson:
 1481|  22.2k|DECODE_JSON(ExpandedNodeId) {
 1482|  22.2k|    UA_ExpandedNodeId *dst = (UA_ExpandedNodeId*)p;
 1483|  22.2k|    UA_String str;
 1484|  22.2k|    UA_String_init(&str);
 1485|  22.2k|    status res = String_decodeJson(ctx, &str, NULL);
 1486|  22.2k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  22.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1486:8): [True: 22.2k, False: 0]
  ------------------
 1487|  22.2k|        res = UA_ExpandedNodeId_parseEx(dst, str, ctx->namespaceMapping,
 1488|  22.2k|                                        ctx->serverUrisSize, ctx->serverUris);
 1489|  22.2k|    UA_String_clear(&str);
 1490|  22.2k|    return res;
 1491|  22.2k|}
ua_types_encoding_json.c:StatusCode_decodeJson:
 1627|  1.22k|DECODE_JSON(StatusCode) {
 1628|  1.22k|    UA_StatusCode *dst = (UA_StatusCode*)p;
 1629|  1.22k|    CHECK_OBJECT;
  ------------------
  |  | 1052|  1.22k|#define CHECK_OBJECT do {                                \
  |  | 1053|  1.22k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1053:8): [True: 0, False: 1.22k]
  |  |  ------------------
  |  | 1054|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1055|  1.22k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1055:14): [Folded, False: 1.22k]
  |  |  ------------------
  ------------------
 1630|  1.22k|    DecodeEntry entries[2] = {
 1631|  1.22k|        {UA_JSONKEY_CODE, dst, NULL, false, &UA_TYPES[UA_TYPES_UINT32]},
  ------------------
  |  |  225|  1.22k|#define UA_TYPES_UINT32 6
  ------------------
 1632|  1.22k|        {UA_JSONKEY_SYMBOL, NULL, NULL, false, NULL}
 1633|  1.22k|    };
 1634|  1.22k|    return decodeFields(ctx, entries, 2);
 1635|  1.22k|}
ua_types_encoding_json.c:QualifiedName_decodeJson:
 1424|   155k|DECODE_JSON(QualifiedName) {
 1425|   155k|    UA_QualifiedName *dst = (UA_QualifiedName*)p;
 1426|   155k|    CHECK_NULL_SKIP;
  ------------------
  |  | 1057|   155k|#define CHECK_NULL_SKIP do {                         \
  |  | 1058|   155k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1058:8): [True: 0, False: 155k]
  |  |  ------------------
  |  | 1059|      0|        ctx->index++;                                \
  |  | 1060|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1061|   155k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1061:14): [Folded, False: 155k]
  |  |  ------------------
  ------------------
 1427|   155k|    UA_String str;
 1428|   155k|    UA_String_init(&str);
 1429|   155k|    status res = String_decodeJson(ctx, &str, NULL);
 1430|   155k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|   155k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1430:8): [True: 155k, False: 19]
  ------------------
 1431|   155k|        res = UA_QualifiedName_parseEx(dst, str, ctx->namespaceMapping);
 1432|   155k|    UA_String_clear(&str);
 1433|   155k|    return res;
 1434|   155k|}
ua_types_encoding_json.c:LocalizedText_decodeJson:
 1414|  1.68M|DECODE_JSON(LocalizedText) {
 1415|  1.68M|    UA_LocalizedText *dst = (UA_LocalizedText*)p;
 1416|  1.68M|    CHECK_OBJECT;
  ------------------
  |  | 1052|  1.68M|#define CHECK_OBJECT do {                                \
  |  | 1053|  1.68M|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1053:8): [True: 0, False: 1.68M]
  |  |  ------------------
  |  | 1054|      0|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1055|  1.68M|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1055:14): [Folded, False: 1.68M]
  |  |  ------------------
  ------------------
 1417|  1.68M|    DecodeEntry entries[2] = {
 1418|  1.68M|        {UA_JSONKEY_LOCALE, &dst->locale, NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  395|  1.68M|#define UA_TYPES_STRING 11
  ------------------
 1419|  1.68M|        {UA_JSONKEY_TEXT, &dst->text, NULL, false, &UA_TYPES[UA_TYPES_STRING]}
  ------------------
  |  |  395|  1.68M|#define UA_TYPES_STRING 11
  ------------------
 1420|  1.68M|    };
 1421|  1.68M|    return decodeFields(ctx, entries, 2);
 1422|  1.68M|}
ua_types_encoding_json.c:ExtensionObject_decodeJson:
 2028|    804|DECODE_JSON(ExtensionObject) {
 2029|    804|    UA_ExtensionObject *dst = (UA_ExtensionObject*)p;
 2030|    804|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1057|    804|#define CHECK_NULL_SKIP do {                         \
  |  | 1058|    804|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1058:8): [True: 0, False: 804]
  |  |  ------------------
  |  | 1059|      0|        ctx->index++;                                \
  |  | 1060|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1061|    804|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1061:14): [Folded, False: 804]
  |  |  ------------------
  ------------------
 2031|    804|    CHECK_OBJECT;
  ------------------
  |  | 1052|    804|#define CHECK_OBJECT do {                                \
  |  | 1053|    804|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1053:8): [True: 3, False: 801]
  |  |  ------------------
  |  | 1054|      3|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1055|    801|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1055:14): [Folded, False: 801]
  |  |  ------------------
  ------------------
 2032|       |
 2033|       |    /* Empty object -> Null ExtensionObject */
 2034|    801|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (2034:8): [True: 680, False: 121]
  ------------------
 2035|    680|        ctx->index++; /* Skip the empty ExtensionObject */
 2036|    680|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    680|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2037|    680|    }
 2038|       |
 2039|       |    /* Store the index where the ExtensionObject begins */
 2040|    121|    size_t beginIndex = ctx->index;
 2041|       |
 2042|       |    /* Search for non-JSON encoding */
 2043|    121|    UA_UInt64 encoding = 0;
 2044|    121|    size_t encIndex = 0;
 2045|    121|    status ret = lookAheadForKey(ctx, UA_JSONKEY_ENCODING, &encIndex);
 2046|    121|    if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|    121|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2046:8): [True: 75, False: 46]
  ------------------
 2047|     75|        const char *extObjEncoding = &ctx->json5[ctx->tokens[encIndex].start];
 2048|     75|        size_t len = parseUInt64(extObjEncoding,
 2049|     75|                                 getTokenLength(&ctx->tokens[encIndex]),
 2050|     75|                                 &encoding);
 2051|     75|        if(len == 0 || encoding > 2)
  ------------------
  |  Branch (2051:12): [True: 0, False: 75]
  |  Branch (2051:24): [True: 75, False: 0]
  ------------------
 2052|     75|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     75|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2053|     75|    }
 2054|       |
 2055|       |    /* Get the type NodeId index */
 2056|     46|    size_t typeIdIndex = 0;
 2057|     46|    ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 2058|     46|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|     46|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2058:8): [True: 4, False: 42]
  ------------------
 2059|      4|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2060|       |
 2061|       |    /* Decode the type NodeId */
 2062|     42|    UA_NodeId typeId;
 2063|     42|    UA_NodeId_init(&typeId);
 2064|     42|    ctx->index = (UA_UInt16)typeIdIndex;
 2065|     42|    ret = NodeId_decodeJson(ctx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|     42|#define UA_TYPES_NODEID 16
  ------------------
 2066|     42|    ctx->index = beginIndex;
 2067|     42|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|     42|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2067:8): [True: 42, False: 0]
  ------------------
 2068|     42|        UA_NodeId_clear(&typeId); /* We don't have the global cleanup */
 2069|     42|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     42|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2070|     42|    }
 2071|       |
 2072|       |    /* Lookup the type */
 2073|      0|    type = UA_findDataTypeWithCustom(&typeId, ctx->customTypes);
 2074|       |
 2075|       |    /* Unknown body type */
 2076|      0|    if(!type) {
  ------------------
  |  Branch (2076:8): [True: 0, False: 0]
  ------------------
 2077|       |        /* FIXME: We need UA_EXTENSIONOBJECT_ENCODED_JSON when we parse an
 2078|       |         * unknown type in JSON. But it is not defined in the standard. */
 2079|      0|        dst->encoding = (encoding != 2) ?
  ------------------
  |  Branch (2079:25): [True: 0, False: 0]
  ------------------
 2080|      0|            UA_EXTENSIONOBJECT_ENCODED_BYTESTRING :
 2081|      0|            UA_EXTENSIONOBJECT_ENCODED_XML;
 2082|      0|        dst->content.encoded.typeId = typeId;
 2083|       |
 2084|       |        /* Get the body field index */
 2085|      0|        size_t bodyIndex = 0;
 2086|      0|        ret = lookAheadForKey(ctx, UA_JSONKEY_BODY, &bodyIndex);
 2087|      0|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2087:12): [True: 0, False: 0]
  ------------------
 2088|       |            /* Only JSON structures can be encoded in-situ */
 2089|      0|            if(encoding != 0)
  ------------------
  |  Branch (2089:16): [True: 0, False: 0]
  ------------------
 2090|      0|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2091|       |
 2092|       |            /* Extract the entire ExtensionObject object as the body */
 2093|      0|            size_t parentIndex = ctx->index;
 2094|      0|            ret = tokenToByteString(ctx, &dst->content.encoded.body);
 2095|      0|            if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2095:16): [True: 0, False: 0]
  ------------------
 2096|      0|                return ret;
 2097|       |
 2098|       |            /* Remove the UaEncoding and UaTypeId field from the encoding.
 2099|       |             * Remove the later field first. */
 2100|      0|            if(encIndex != 0 && encIndex > typeIdIndex)
  ------------------
  |  Branch (2100:16): [True: 0, False: 0]
  |  Branch (2100:33): [True: 0, False: 0]
  ------------------
 2101|      0|                removeFieldFromEncoding(ctx, &dst->content.encoded.body,
 2102|      0|                                        parentIndex, encIndex);
 2103|       |
 2104|      0|            removeFieldFromEncoding(ctx, &dst->content.encoded.body,
 2105|      0|                                    parentIndex, typeIdIndex);
 2106|       |
 2107|      0|            if(encIndex != 0 && encIndex < typeIdIndex)
  ------------------
  |  Branch (2107:16): [True: 0, False: 0]
  |  Branch (2107:33): [True: 0, False: 0]
  ------------------
 2108|      0|                removeFieldFromEncoding(ctx, &dst->content.encoded.body,
 2109|      0|                                        parentIndex, encIndex);
 2110|       |
 2111|      0|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2112|      0|        }
 2113|       |
 2114|      0|        ctx->index = bodyIndex;
 2115|      0|        if(encoding != 0) {
  ------------------
  |  Branch (2115:12): [True: 0, False: 0]
  ------------------
 2116|       |            /* Decode the body as a ByteString */
 2117|      0|            ret = ByteString_decodeJson(ctx, &dst->content.encoded.body, NULL);
 2118|      0|        } else {
 2119|       |            /* Use the JSON encoding directly */
 2120|      0|            ret = tokenToByteString(ctx, &dst->content.encoded.body);
 2121|      0|        }
 2122|      0|        ctx->index = beginIndex;
 2123|      0|        skipObject(ctx);
 2124|      0|        return ret;
 2125|      0|    }
 2126|       |
 2127|       |    /* No need to keep the TypeId */
 2128|      0|    UA_NodeId_clear(&typeId);
 2129|       |
 2130|       |    /* Disallow directly nested ExtensionObjects */
 2131|      0|    if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (2131:8): [True: 0, False: 0]
  ------------------
 2132|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2133|       |
 2134|       |    /* Allocate memory for the decoded data */
 2135|      0|    dst->content.decoded.data = UA_new(type);
 2136|      0|    if(!dst->content.decoded.data)
  ------------------
  |  Branch (2136:8): [True: 0, False: 0]
  ------------------
 2137|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2138|      0|    dst->content.decoded.type = type;
 2139|      0|    dst->encoding = UA_EXTENSIONOBJECT_DECODED;
 2140|       |
 2141|       |    /* Get the body field index */
 2142|      0|    decodeJsonSignature decodeType = decodeJsonJumpTable[type->typeKind];
 2143|      0|    size_t bodyIndex = ctx->index;
 2144|      0|    ret = lookAheadForKey(ctx, UA_JSONKEY_BODY, &bodyIndex); /* Can fail */
 2145|      0|    if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2145:8): [True: 0, False: 0]
  ------------------
 2146|      0|        ctx->index = bodyIndex;
 2147|      0|        ret = decodeType(ctx, dst->content.decoded.data, type);
 2148|      0|        ctx->index = beginIndex;
 2149|      0|        skipObject(ctx);
 2150|      0|        return ret;
 2151|      0|    }
 2152|       |
 2153|      0|    return decodeType(ctx, dst->content.decoded.data, type);
 2154|      0|}
ua_types_encoding_json.c:DataValue_decodeJson:
 1921|   111k|DECODE_JSON(DataValue) {
 1922|   111k|    UA_DataValue *dst = (UA_DataValue*)p;
 1923|   111k|    CHECK_NULL_SKIP; /* Treat a null value as an empty DataValue */
  ------------------
  |  | 1057|   111k|#define CHECK_NULL_SKIP do {                         \
  |  | 1058|   111k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1058:8): [True: 0, False: 111k]
  |  |  ------------------
  |  | 1059|      0|        ctx->index++;                                \
  |  | 1060|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1061|   111k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1061:14): [Folded, False: 111k]
  |  |  ------------------
  ------------------
 1924|   111k|    CHECK_OBJECT;
  ------------------
  |  | 1052|   111k|#define CHECK_OBJECT do {                                \
  |  | 1053|   111k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1053:8): [True: 6, False: 111k]
  |  |  ------------------
  |  | 1054|      6|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1055|   111k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1055:14): [Folded, False: 111k]
  |  |  ------------------
  ------------------
 1925|       |
 1926|       |    /* Decode the Variant in-situ */
 1927|   111k|    size_t beginIndex = ctx->index;
 1928|   111k|    status ret = decodeJSONVariant(ctx, &dst->value);
 1929|   111k|    ctx->index = beginIndex;
 1930|   111k|    dst->hasValue = (dst->value.type != NULL);
 1931|   111k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|   111k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1931:8): [True: 192, False: 111k]
  ------------------
 1932|    192|        return ret;
 1933|       |
 1934|       |    /* Decode the other members (skip the Variant members) */
 1935|   111k|    DecodeEntry entries[8] = {
 1936|   111k|        {UA_JSONKEY_TYPE, NULL, NULL, false, NULL},
 1937|   111k|        {UA_JSONKEY_VALUE, NULL, NULL, false, NULL},
 1938|   111k|        {UA_JSONKEY_DIMENSIONS, NULL, NULL, false, NULL},
 1939|   111k|        {UA_JSONKEY_STATUS, &dst->status, NULL, false, &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  633|   111k|#define UA_TYPES_STATUSCODE 18
  ------------------
 1940|   111k|        {UA_JSONKEY_SOURCETIMESTAMP, &dst->sourceTimestamp, NULL,
 1941|   111k|         false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  429|   111k|#define UA_TYPES_DATETIME 12
  ------------------
 1942|   111k|        {UA_JSONKEY_SOURCEPICOSECONDS, &dst->sourcePicoseconds, NULL,
 1943|   111k|         false, &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  157|   111k|#define UA_TYPES_UINT16 4
  ------------------
 1944|   111k|        {UA_JSONKEY_SERVERTIMESTAMP, &dst->serverTimestamp, NULL,
 1945|   111k|         false, &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  429|   111k|#define UA_TYPES_DATETIME 12
  ------------------
 1946|   111k|        {UA_JSONKEY_SERVERPICOSECONDS, &dst->serverPicoseconds, NULL,
 1947|   111k|         false, &UA_TYPES[UA_TYPES_UINT16]}
  ------------------
  |  |  157|   111k|#define UA_TYPES_UINT16 4
  ------------------
 1948|   111k|    };
 1949|       |
 1950|   111k|    ret = decodeFields(ctx, entries, 8);
 1951|   111k|    dst->hasStatus = entries[3].found;
 1952|   111k|    dst->hasSourceTimestamp = entries[4].found;
 1953|   111k|    dst->hasSourcePicoseconds = entries[5].found;
 1954|   111k|    dst->hasServerTimestamp = entries[6].found;
 1955|   111k|    dst->hasServerPicoseconds = entries[7].found;
 1956|   111k|    return ret;
 1957|   111k|}
ua_types_encoding_json.c:decodeJSONVariant:
 1791|   291k|decodeJSONVariant(ParseCtx *ctx, UA_Variant *dst) {
 1792|       |    /* Empty variant == null */
 1793|   291k|    if(ctx->tokens[ctx->index].size == 0) {
  ------------------
  |  Branch (1793:8): [True: 205k, False: 86.7k]
  ------------------
 1794|   205k|        ctx->index++;
 1795|   205k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|   205k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1796|   205k|    }
 1797|       |
 1798|       |    /* Search the value field */
 1799|  86.7k|    size_t valueIndex = 0;
 1800|  86.7k|    lookAheadForKey(ctx, UA_JSONKEY_VALUE, &valueIndex);
 1801|       |
 1802|       |    /* Search for the dimensions field */
 1803|  86.7k|    size_t dimIndex = 0;
 1804|  86.7k|    lookAheadForKey(ctx, UA_JSONKEY_DIMENSIONS, &dimIndex);
 1805|       |
 1806|       |    /* Parse the type kind */
 1807|  86.7k|    size_t typeIndex = 0;
 1808|  86.7k|    lookAheadForKey(ctx, UA_JSONKEY_TYPE, &typeIndex);
 1809|  86.7k|    if(typeIndex == 0 || ctx->tokens[typeIndex].type != CJ5_TOKEN_NUMBER)
  ------------------
  |  Branch (1809:8): [True: 65, False: 86.6k]
  |  Branch (1809:26): [True: 0, False: 86.6k]
  ------------------
 1810|     65|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     65|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1811|  86.6k|    UA_UInt64 typeKind = 0;
 1812|  86.6k|    size_t len = parseUInt64(&ctx->json5[ctx->tokens[typeIndex].start],
 1813|  86.6k|                             getTokenLength(&ctx->tokens[typeIndex]), &typeKind);
 1814|  86.6k|    if(len == 0)
  ------------------
  |  Branch (1814:8): [True: 1, False: 86.6k]
  ------------------
 1815|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1816|       |
 1817|       |    /* Shift to get the datatype index. The type must be a builtin data type.
 1818|       |     * All not-builtin types are wrapped in an ExtensionObject. */
 1819|  86.6k|    typeKind--;
 1820|  86.6k|    if(typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (1820:8): [True: 28, False: 86.6k]
  ------------------
 1821|     28|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     28|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1822|  86.6k|    const UA_DataType *type = &UA_TYPES[typeKind];
 1823|       |
 1824|       |    /* Value is an array? */
 1825|  86.6k|    UA_Boolean isArray =
 1826|  86.6k|        (valueIndex > 0 && ctx->tokens[valueIndex].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  Branch (1826:10): [True: 63.2k, False: 23.4k]
  |  Branch (1826:28): [True: 11.6k, False: 51.5k]
  ------------------
 1827|       |
 1828|       |    /* Adjust the depth and set the value index as current */
 1829|  86.6k|    if(ctx->depth >= UA_JSON_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   21|  86.6k|#define UA_JSON_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (1829:8): [True: 0, False: 86.6k]
  ------------------
 1830|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1831|  86.6k|    size_t beginIndex = ctx->index;
 1832|  86.6k|    ctx->index = valueIndex;
 1833|  86.6k|    ctx->depth++;
 1834|       |
 1835|       |    /* Decode the value */
 1836|  86.6k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  86.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1837|  86.6k|    if(!isArray) {
  ------------------
  |  Branch (1837:8): [True: 75.0k, False: 11.6k]
  ------------------
 1838|       |        /* Scalar with dimensions -> error */
 1839|  75.0k|        if(dimIndex > 0) {
  ------------------
  |  Branch (1839:12): [True: 3, False: 75.0k]
  ------------------
 1840|      3|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1841|      3|            goto out;
 1842|      3|        }
 1843|       |
 1844|       |        /* A variant cannot contain a variant. But it can contain an array of
 1845|       |         * variants */
 1846|  75.0k|        if(type->typeKind == UA_DATATYPEKIND_VARIANT) {
  ------------------
  |  Branch (1846:12): [True: 0, False: 75.0k]
  ------------------
 1847|      0|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1848|      0|            goto out;
 1849|      0|        }
 1850|       |
 1851|       |        /* Decode a value wrapped in an ExtensionObject */
 1852|  75.0k|        if(valueIndex > 0 && type->typeKind == UA_DATATYPEKIND_EXTENSIONOBJECT) {
  ------------------
  |  Branch (1852:12): [True: 51.5k, False: 23.4k]
  |  Branch (1852:30): [True: 459, False: 51.1k]
  ------------------
 1853|    459|            res = Variant_decodeJsonUnwrapExtensionObject(ctx, dst, NULL);
 1854|    459|            goto out;
 1855|    459|        }
 1856|       |
 1857|       |        /* Allocate memory for the value */
 1858|  74.5k|        dst->data = UA_new(type);
 1859|  74.5k|        if(!dst->data) {
  ------------------
  |  Branch (1859:12): [True: 0, False: 74.5k]
  ------------------
 1860|      0|            res = UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1861|      0|            goto out;
 1862|      0|        }
 1863|  74.5k|        dst->type = type;
 1864|       |
 1865|       |        /* Decode the value */
 1866|  74.5k|        if(valueIndex > 0 && ctx->tokens[valueIndex].type != CJ5_TOKEN_NULL)
  ------------------
  |  Branch (1866:12): [True: 51.1k, False: 23.4k]
  |  Branch (1866:30): [True: 49.6k, False: 1.48k]
  ------------------
 1867|  49.6k|            res = decodeJsonJumpTable[type->typeKind](ctx, dst->data, type);
 1868|  74.5k|    } else {
 1869|       |        /* Decode an array. Try to unwrap ExtensionObjects in the array. The
 1870|       |         * members must all have the same type. */
 1871|  11.6k|        const UA_DataType *unwrapType = NULL;
 1872|  11.6k|        if(type == &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  735|  11.6k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (1872:12): [True: 519, False: 11.1k]
  ------------------
 1873|    519|            unwrapType = getArrayUnwrapType(ctx);
 1874|  11.6k|        if(unwrapType) {
  ------------------
  |  Branch (1874:12): [True: 0, False: 11.6k]
  ------------------
 1875|      0|            dst->type = unwrapType;
 1876|      0|            res = Array_decodeJsonUnwrapExtensionObject(ctx, &dst->data, unwrapType);
 1877|  11.6k|        } else {
 1878|  11.6k|            dst->type = type;
 1879|  11.6k|            res = Array_decodeJson(ctx, &dst->data, type);
 1880|  11.6k|        }
 1881|       |
 1882|       |        /* Decode array dimensions */
 1883|  11.6k|        if(dimIndex > 0) {
  ------------------
  |  Branch (1883:12): [True: 3.06k, False: 8.56k]
  ------------------
 1884|  3.06k|            ctx->index = dimIndex;
 1885|  3.06k|            res |= Array_decodeJson(ctx, (void**)&dst->arrayDimensions,
 1886|  3.06k|                                    &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  225|  3.06k|#define UA_TYPES_UINT32 6
  ------------------
 1887|       |
 1888|       |            /* Help clang-analyzer */
 1889|  3.06k|            UA_assert(dst->arrayDimensionsSize == 0 || dst->arrayDimensions);
  ------------------
  |  |  399|  3.06k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1889:13): [True: 23, False: 3.04k]
  |  Branch (1889:13): [True: 3.04k, False: 0]
  ------------------
 1890|       |
 1891|       |            /* Validate the dimensions */
 1892|  3.06k|            size_t total = 1;
 1893|  1.85M|            for(size_t i = 0; i < dst->arrayDimensionsSize; i++)
  ------------------
  |  Branch (1893:31): [True: 1.84M, False: 3.06k]
  ------------------
 1894|  1.84M|                total *= dst->arrayDimensions[i];
 1895|  3.06k|            if(total != dst->arrayLength)
  ------------------
  |  Branch (1895:16): [True: 109, False: 2.95k]
  ------------------
 1896|    109|                res |= UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    109|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1897|       |
 1898|       |            /* Only keep >= 2 dimensions */
 1899|  3.06k|            if(dst->arrayDimensionsSize == 1) {
  ------------------
  |  Branch (1899:16): [True: 52, False: 3.01k]
  ------------------
 1900|     52|                UA_free(dst->arrayDimensions);
  ------------------
  |  |   19|     52|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1901|     52|                dst->arrayDimensions = NULL;
 1902|     52|                dst->arrayDimensionsSize = 0;
 1903|     52|            }
 1904|  3.06k|        }
 1905|  11.6k|    }
 1906|       |
 1907|  86.6k| out:
 1908|  86.6k|    ctx->index = beginIndex;
 1909|  86.6k|    skipObject(ctx);
 1910|  86.6k|    ctx->depth--;
 1911|  86.6k|    return res;
 1912|  86.6k|}
ua_types_encoding_json.c:Variant_decodeJsonUnwrapExtensionObject:
 2158|    459|                                        const UA_DataType *type) {
 2159|    459|    (void) type;
 2160|    459|    UA_Variant *dst = (UA_Variant*)p;
 2161|       |
 2162|       |    /* ExtensionObject with null body */
 2163|    459|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2163:8): [True: 382, False: 77]
  ------------------
 2164|    382|        dst->data = UA_ExtensionObject_new();
 2165|    382|        dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|    382|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2166|    382|        ctx->index++;
 2167|    382|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    382|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2168|    382|    }
 2169|       |
 2170|       |    /* Decode the ExtensionObject */
 2171|     77|    UA_ExtensionObject eo;
 2172|     77|    UA_ExtensionObject_init(&eo);
 2173|     77|    UA_StatusCode ret = ExtensionObject_decodeJson(ctx, &eo, NULL);
 2174|     77|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|     77|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2174:8): [True: 77, False: 0]
  ------------------
 2175|     77|        UA_ExtensionObject_clear(&eo); /* We don't have the global cleanup */
 2176|     77|        return ret;
 2177|     77|    }
 2178|       |
 2179|       |    /* The content is still encoded, cannot unwrap */
 2180|      0|    if(eo.encoding != UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2180:8): [True: 0, False: 0]
  ------------------
 2181|      0|        goto use_eo;
 2182|       |
 2183|       |    /* The content is a builtin type that could have been directly encoded in
 2184|       |     * the Variant, there was no need to wrap in an ExtensionObject. But this
 2185|       |     * means for us, that somebody made an extra effort to explicitly get an
 2186|       |     * ExtensionObject. So we keep it. As an added advantage we will generate
 2187|       |     * the same JSON again when encoding again. */
 2188|      0|    if(eo.content.decoded.type->typeKind <= UA_DATATYPEKIND_DIAGNOSTICINFO)
  ------------------
  |  Branch (2188:8): [True: 0, False: 0]
  ------------------
 2189|      0|        goto use_eo;
 2190|       |
 2191|       |    /* Unwrap the ExtensionObject */
 2192|      0|    dst->data = eo.content.decoded.data;
 2193|      0|    dst->type = eo.content.decoded.type;
 2194|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2195|       |
 2196|      0| use_eo:
 2197|       |    /* Don't unwrap */
 2198|      0|    dst->data = UA_new(&UA_TYPES[UA_TYPES_EXTENSIONOBJECT]);
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2199|      0|    if(!dst->data) {
  ------------------
  |  Branch (2199:8): [True: 0, False: 0]
  ------------------
 2200|      0|        UA_ExtensionObject_clear(&eo);
 2201|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2202|      0|    }
 2203|      0|    dst->type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
 2204|      0|    *(UA_ExtensionObject*)dst->data = eo;
 2205|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2206|      0|}
ua_types_encoding_json.c:getArrayUnwrapType:
 1672|    519|getArrayUnwrapType(ParseCtx *ctx) {
 1673|    519|    UA_assert(ctx->tokens[ctx->index].type == CJ5_TOKEN_ARRAY);
  ------------------
  |  |  399|    519|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1673:5): [True: 519, False: 0]
  ------------------
 1674|       |
 1675|       |    /* Return early for empty arrays */
 1676|    519|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 1677|    519|    if(length == 0)
  ------------------
  |  Branch (1677:8): [True: 197, False: 322]
  ------------------
 1678|    197|        return NULL;
 1679|       |
 1680|       |    /* Save the original index and go to the first array member */
 1681|    322|    size_t oldIndex = ctx->index;
 1682|    322|    ctx->index++;
 1683|       |
 1684|       |    /* Lookup the type for the first array member */
 1685|    322|    UA_NodeId typeId;
 1686|    322|    UA_NodeId_init(&typeId);
 1687|    322|    const UA_DataType *typeOfBody = getExtensionObjectType(ctx);
 1688|    322|    if(!typeOfBody) {
  ------------------
  |  Branch (1688:8): [True: 322, False: 0]
  ------------------
 1689|    322|        ctx->index = oldIndex; /* Restore the index */
 1690|    322|        return NULL;
 1691|    322|    }
 1692|       |
 1693|       |    /* Get the TypeId encoding for faster comparison below.
 1694|       |     * Cannot fail as getExtensionObjectType already looked this up. */
 1695|      0|    size_t typeIdIndex = 0;
 1696|      0|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 1697|      0|    (void)ret;
 1698|      0|    UA_assert(ret == UA_STATUSCODE_GOOD);
  ------------------
  |  |  399|      0|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1698:5): [True: 0, False: 0]
  ------------------
 1699|      0|    const char* typeIdData = &ctx->json5[ctx->tokens[typeIdIndex].start];
 1700|      0|    size_t typeIdSize = getTokenLength(&ctx->tokens[typeIdIndex]);
 1701|       |
 1702|       |    /* Loop over all members and check whether they can be unwrapped. Don't skip
 1703|       |     * the first member. We still haven't checked the encoding type. */
 1704|      0|    for(size_t i = 0; i < length; i++) {
  ------------------
  |  Branch (1704:23): [True: 0, False: 0]
  ------------------
 1705|       |        /* Array element must be an object */
 1706|      0|        if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {
  ------------------
  |  Branch (1706:12): [True: 0, False: 0]
  ------------------
 1707|      0|            ctx->index = oldIndex; /* Restore the index */
 1708|      0|            return NULL;
 1709|      0|        }
 1710|       |
 1711|       |        /* Check for non-JSON encoding */
 1712|      0|        size_t encIndex = 0;
 1713|      0|        ret = lookAheadForKey(ctx, UA_JSONKEY_ENCODING, &encIndex);
 1714|      0|        if(ret == UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1714:12): [True: 0, False: 0]
  ------------------
 1715|      0|            ctx->index = oldIndex; /* Restore the index */
 1716|      0|            return NULL;
 1717|      0|        }
 1718|       |
 1719|       |        /* Get the type NodeId index */
 1720|      0|        size_t memberTypeIdIndex = 0;
 1721|      0|        ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &memberTypeIdIndex);
 1722|      0|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1722:12): [True: 0, False: 0]
  ------------------
 1723|      0|            ctx->index = oldIndex; /* Restore the index */
 1724|      0|            return NULL;
 1725|      0|        }
 1726|       |
 1727|       |        /* Is it the same type? Compare raw NodeId string */
 1728|      0|        const char* memberTypeIdData = &ctx->json5[ctx->tokens[memberTypeIdIndex].start];
 1729|      0|        size_t memberTypeIdSize = getTokenLength(&ctx->tokens[memberTypeIdIndex]);
 1730|      0|        if(typeIdSize != memberTypeIdSize ||
  ------------------
  |  Branch (1730:12): [True: 0, False: 0]
  ------------------
 1731|      0|           memcmp(typeIdData, memberTypeIdData, typeIdSize) != 0) {
  ------------------
  |  Branch (1731:12): [True: 0, False: 0]
  ------------------
 1732|      0|            ctx->index = oldIndex; /* Restore the index */
 1733|      0|            return NULL;
 1734|      0|        }
 1735|       |
 1736|       |        /* Skip to the next array member */
 1737|      0|        skipObject(ctx);
 1738|      0|    }
 1739|       |
 1740|      0|    ctx->index = oldIndex; /* Restore the index */
 1741|      0|    return typeOfBody;
 1742|      0|}
ua_types_encoding_json.c:getExtensionObjectType:
 1640|    322|getExtensionObjectType(ParseCtx *ctx) {
 1641|    322|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT)
  ------------------
  |  Branch (1641:8): [True: 232, False: 90]
  ------------------
 1642|    232|        return NULL;
 1643|       |
 1644|       |    /* Get the type NodeId index */
 1645|     90|    size_t typeIdIndex = 0;
 1646|     90|    UA_StatusCode ret = lookAheadForKey(ctx, UA_JSONKEY_TYPEID, &typeIdIndex);
 1647|     90|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|     90|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1647:8): [True: 48, False: 42]
  ------------------
 1648|     48|        return NULL;
 1649|       |
 1650|     42|    size_t oldIndex = ctx->index;
 1651|     42|    ctx->index = (UA_UInt16)typeIdIndex;
 1652|       |
 1653|       |    /* Decode the type NodeId */
 1654|     42|    UA_NodeId typeId;
 1655|     42|    UA_NodeId_init(&typeId);
 1656|     42|    ret = NodeId_decodeJson(ctx, &typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|     42|#define UA_TYPES_NODEID 16
  ------------------
 1657|     42|    ctx->index = oldIndex;
 1658|     42|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|     42|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1658:8): [True: 42, False: 0]
  ------------------
 1659|     42|        UA_NodeId_clear(&typeId); /* We don't have the global cleanup */
 1660|     42|        return NULL;
 1661|     42|    }
 1662|       |
 1663|       |    /* Lookup an return */
 1664|      0|    const UA_DataType *type = UA_findDataTypeWithCustom(&typeId, ctx->customTypes);
 1665|      0|    UA_NodeId_clear(&typeId);
 1666|      0|    return type;
 1667|     42|}
ua_types_encoding_json.c:Array_decodeJson:
 2340|  14.7k|Array_decodeJson(ParseCtx *ctx, void *dst_, const UA_DataType *type) {
 2341|  14.7k|    void **dst = (void**)dst_;
 2342|       |
 2343|       |    /* Save the length of the array */
 2344|  14.7k|    size_t *size_ptr = (size_t*) dst - 1;
 2345|       |
 2346|  14.7k|    if(currentTokenType(ctx) != CJ5_TOKEN_ARRAY)
  ------------------
  |  Branch (2346:8): [True: 4, False: 14.6k]
  ------------------
 2347|      4|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2348|       |
 2349|  14.6k|    size_t length = (size_t)ctx->tokens[ctx->index].size;
 2350|       |
 2351|  14.6k|    ctx->index++; /* Go to first array member or to the first element after
 2352|       |                   * the array (if empty) */
 2353|       |
 2354|       |    /* Return early for empty arrays */
 2355|  14.6k|    if(length == 0) {
  ------------------
  |  Branch (2355:8): [True: 5.69k, False: 9.00k]
  ------------------
 2356|  5.69k|        *size_ptr = length;
 2357|  5.69k|        *dst = UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  5.69k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2358|  5.69k|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  5.69k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2359|  5.69k|    }
 2360|       |
 2361|       |    /* Allocate memory */
 2362|  9.00k|    *dst = UA_calloc(length, type->memSize);
  ------------------
  |  |   20|  9.00k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2363|  9.00k|    if(*dst == NULL)
  ------------------
  |  Branch (2363:8): [True: 0, False: 9.00k]
  ------------------
 2364|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2365|       |
 2366|       |    /* Decode array members */
 2367|  9.00k|    decodeJsonSignature decodeFunc = decodeJsonJumpTable[type->typeKind];
 2368|  9.00k|    uintptr_t ptr = (uintptr_t)*dst;
 2369|  11.7M|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (2369:23): [True: 11.7M, False: 8.59k]
  ------------------
 2370|  11.7M|        if(ctx->tokens[ctx->index].type == CJ5_TOKEN_NULL) {
  ------------------
  |  Branch (2370:12): [True: 8.40k, False: 11.7M]
  ------------------
 2371|  8.40k|            ptr += type->memSize;
 2372|  8.40k|            ctx->index++;
 2373|  8.40k|            continue;
 2374|  8.40k|        }
 2375|       |
 2376|  11.7M|        status ret = decodeFunc(ctx, (void*)ptr, type);
 2377|  11.7M|        ptr += type->memSize;
 2378|  11.7M|        if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|  11.7M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2378:12): [True: 406, False: 11.7M]
  ------------------
 2379|    406|            UA_Array_delete(*dst, i+1, type);
 2380|    406|            *dst = NULL;
 2381|    406|            return ret;
 2382|    406|        }
 2383|  11.7M|    }
 2384|       |
 2385|  8.59k|    *size_ptr = length; /* All good, set the size */
 2386|  8.59k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  8.59k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2387|  9.00k|}
ua_types_encoding_json.c:Variant_decodeJson:
 1914|   180k|DECODE_JSON(Variant) {
 1915|   180k|    UA_Variant *dst = (UA_Variant*)p;
 1916|   180k|    CHECK_NULL_SKIP; /* Treat null as an empty variant */
  ------------------
  |  | 1057|   180k|#define CHECK_NULL_SKIP do {                         \
  |  | 1058|   180k|    if(currentTokenType(ctx) == CJ5_TOKEN_NULL) {    \
  |  |  ------------------
  |  |  |  Branch (1058:8): [True: 0, False: 180k]
  |  |  ------------------
  |  | 1059|      0|        ctx->index++;                                \
  |  | 1060|      0|        return UA_STATUSCODE_GOOD;                   \
  |  |  ------------------
  |  |  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  |  |  ------------------
  |  | 1061|   180k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1061:14): [Folded, False: 180k]
  |  |  ------------------
  ------------------
 1917|   180k|    CHECK_OBJECT;
  ------------------
  |  | 1052|   180k|#define CHECK_OBJECT do {                                \
  |  | 1053|   180k|    if(currentTokenType(ctx) != CJ5_TOKEN_OBJECT) {      \
  |  |  ------------------
  |  |  |  Branch (1053:8): [True: 13, False: 180k]
  |  |  ------------------
  |  | 1054|     13|        return UA_STATUSCODE_BADDECODINGERROR;           \
  |  |  ------------------
  |  |  |  |   44|     13|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  | 1055|   180k|    }} while(0)
  |  |  ------------------
  |  |  |  Branch (1055:14): [Folded, False: 180k]
  |  |  ------------------
  ------------------
 1918|   180k|    return decodeJSONVariant(ctx, dst);
 1919|   180k|}

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

UA_Guid_parse:
   86|  1.20k|UA_Guid_parse(UA_Guid *guid, const UA_String str) {
   87|  1.20k|    UA_StatusCode res = parse_guid(guid, str.data, str.data + str.length);
   88|  1.20k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  1.20k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (88:8): [True: 48, False: 1.15k]
  ------------------
   89|     48|        *guid = UA_GUID_NULL;
   90|  1.20k|    return res;
   91|  1.20k|}
UA_NodeId_parseEx:
  323|  21.2k|                  const UA_NamespaceMapping *nsMapping) {
  324|  21.2k|    UA_StatusCode res =
  325|  21.2k|        parse_nodeid(id, str.data, str.data+str.length, UA_ESCAPING_NONE, nsMapping);
  326|  21.2k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  21.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (326:8): [True: 107, False: 21.1k]
  ------------------
  327|    107|        UA_NodeId_clear(id);
  328|  21.2k|    return res;
  329|  21.2k|}
UA_ExpandedNodeId_parseEx:
  671|  22.2k|                          size_t serverUrisSize, const UA_String *serverUris) {
  672|  22.2k|    UA_StatusCode res =
  673|  22.2k|        parse_expandednodeid(id, str.data, str.data + str.length, UA_ESCAPING_NONE,
  674|  22.2k|                             nsMapping, serverUrisSize, serverUris);
  675|  22.2k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  22.2k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (675:8): [True: 106, False: 22.1k]
  ------------------
  676|    106|        UA_ExpandedNodeId_clear(id);
  677|  22.2k|    return res;
  678|  22.2k|}
UA_QualifiedName_parseEx:
  831|   155k|                         const UA_NamespaceMapping *nsMapping) {
  832|   155k|    const u8 *pos = str.data;
  833|   155k|    const u8 *end = str.data + str.length;
  834|   155k|    UA_StatusCode res = parse_qn(qn, pos, end, UA_ESCAPING_NONE, nsMapping, 0);
  835|   155k|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|   155k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (835:8): [True: 0, False: 155k]
  ------------------
  836|      0|        UA_QualifiedName_clear(qn);
  837|   155k|    return res;
  838|   155k|}
ua_types_lex.c:parse_guid:
   50|  1.21k|parse_guid(UA_Guid *guid, const UA_Byte *s, const UA_Byte *e) {
   51|  1.21k|    size_t len = (size_t)(e - s);
   52|  1.21k|    if(len != 36 || s[8] != '-' || s[13] != '-' || s[23] != '-')
  ------------------
  |  Branch (52:8): [True: 17, False: 1.20k]
  |  Branch (52:21): [True: 10, False: 1.19k]
  |  Branch (52:36): [True: 3, False: 1.18k]
  |  Branch (52:52): [True: 8, False: 1.17k]
  ------------------
   53|     38|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     38|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   54|       |
   55|  1.17k|    UA_UInt32 tmp;
   56|  1.17k|    if(UA_readNumberWithBase(s, 8, &tmp, 16) != 8)
  ------------------
  |  Branch (56:8): [True: 8, False: 1.17k]
  ------------------
   57|      8|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      8|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   58|  1.17k|    guid->data1 = tmp;
   59|       |
   60|  1.17k|    if(UA_readNumberWithBase(&s[9], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (60:8): [True: 3, False: 1.16k]
  ------------------
   61|      3|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      3|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   62|  1.16k|    guid->data2 = (UA_UInt16)tmp;
   63|       |
   64|  1.16k|    if(UA_readNumberWithBase(&s[14], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (64:8): [True: 1, False: 1.16k]
  ------------------
   65|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   66|  1.16k|    guid->data3 = (UA_UInt16)tmp;
   67|       |
   68|  1.16k|    if(UA_readNumberWithBase(&s[19], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (68:8): [True: 1, False: 1.16k]
  ------------------
   69|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   70|  1.16k|    guid->data4[0] = (UA_Byte)tmp;
   71|       |
   72|  1.16k|    if(UA_readNumberWithBase(&s[21], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (72:8): [True: 1, False: 1.16k]
  ------------------
   73|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   74|  1.16k|    guid->data4[1] = (UA_Byte)tmp;
   75|       |
   76|  8.13k|    for(size_t pos = 2, spos = 24; pos < 8; pos++, spos += 2) {
  ------------------
  |  Branch (76:36): [True: 6.97k, False: 1.15k]
  ------------------
   77|  6.97k|        if(UA_readNumberWithBase(&s[spos], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (77:12): [True: 6, False: 6.96k]
  ------------------
   78|      6|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      6|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   79|  6.96k|        guid->data4[pos] = (UA_Byte)tmp;
   80|  6.96k|    }
   81|       |
   82|  1.15k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.15k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   83|  1.16k|}
ua_types_lex.c:parse_nodeid:
  148|  21.2k|             UA_Escaping idEsc, const UA_NamespaceMapping *nsMapping) {
  149|  21.2k|    *id = UA_NODEID_NULL; /* Reset the NodeId */
  150|  21.2k|    LexContext context;
  151|  21.2k|    memset(&context, 0, sizeof(LexContext));
  152|  21.2k|    UA_Byte *begin = (UA_Byte*)(uintptr_t)pos;
  153|  21.2k|    const u8 *ns = NULL, *nsu = NULL, *body = NULL;
  154|       |
  155|       |    
  156|  21.2k|{
  157|  21.2k|	u8 yych;
  158|  21.2k|	yych = YYPEEK();
  ------------------
  |  |   33|  21.2k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  21.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  21.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 21.2k, False: 3]
  |  |  ------------------
  ------------------
  159|  21.2k|	switch (yych) {
  160|  1.41k|		case 'b':
  ------------------
  |  Branch (160:3): [True: 1.41k, False: 19.7k]
  ------------------
  161|  1.42k|		case 'g':
  ------------------
  |  Branch (161:3): [True: 12, False: 21.2k]
  ------------------
  162|  3.90k|		case 'i':
  ------------------
  |  Branch (162:3): [True: 2.47k, False: 18.7k]
  ------------------
  163|  7.21k|		case 's':
  ------------------
  |  Branch (163:3): [True: 3.31k, False: 17.9k]
  ------------------
  164|  7.21k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  7.21k|#define YYSTAGN(t) t = NULL
  ------------------
  165|  7.21k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  7.21k|#define YYSTAGN(t) t = NULL
  ------------------
  166|  7.21k|			goto yy3;
  167|  13.9k|		case 'n': goto yy4;
  ------------------
  |  Branch (167:3): [True: 13.9k, False: 7.21k]
  ------------------
  168|      5|		default: goto yy1;
  ------------------
  |  Branch (168:3): [True: 5, False: 21.2k]
  ------------------
  169|  21.2k|	}
  170|      5|yy1:
  171|      5|	YYSKIP();
  ------------------
  |  |   35|      5|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      5|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  172|     77|yy2:
  173|     77|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   44|     77|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  174|  7.21k|yy3:
  175|  7.21k|	YYSKIP();
  ------------------
  |  |   35|  7.21k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  7.21k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  176|  7.21k|	yych = YYPEEK();
  ------------------
  |  |   33|  7.21k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  7.21k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  7.21k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 7.21k, False: 2]
  |  |  ------------------
  ------------------
  177|  7.21k|	switch (yych) {
  178|  7.20k|		case '=': goto yy5;
  ------------------
  |  Branch (178:3): [True: 7.20k, False: 4]
  ------------------
  179|      4|		default: goto yy2;
  ------------------
  |  Branch (179:3): [True: 4, False: 7.20k]
  ------------------
  180|  7.21k|	}
  181|  13.9k|yy4:
  182|  13.9k|	YYSKIP();
  ------------------
  |  |   35|  13.9k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  13.9k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  183|  13.9k|	YYBACKUP();
  ------------------
  |  |   36|  13.9k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  13.9k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  13.9k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  184|  13.9k|	yych = YYPEEK();
  ------------------
  |  |   33|  13.9k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  13.9k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  13.9k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 13.9k, False: 2]
  |  |  ------------------
  ------------------
  185|  13.9k|	switch (yych) {
  186|  13.9k|		case 's': goto yy6;
  ------------------
  |  Branch (186:3): [True: 13.9k, False: 6]
  ------------------
  187|      6|		default: goto yy2;
  ------------------
  |  Branch (187:3): [True: 6, False: 13.9k]
  ------------------
  188|  13.9k|	}
  189|  21.1k|yy5:
  190|  21.1k|	YYSKIP();
  ------------------
  |  |   35|  21.1k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  21.1k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  191|  21.1k|	nsu = context.yyt2;
  192|  21.1k|	ns = context.yyt1;
  193|  21.1k|	YYSTAGP(body);
  ------------------
  |  |   38|  21.1k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  21.1k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  194|  21.1k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  21.1k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  195|  21.1k|	{ goto match; }
  196|  13.9k|yy6:
  197|  13.9k|	YYSKIP();
  ------------------
  |  |   35|  13.9k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  13.9k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  198|  13.9k|	yych = YYPEEK();
  ------------------
  |  |   33|  13.9k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  13.9k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  13.9k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 13.9k, False: 2]
  |  |  ------------------
  ------------------
  199|  13.9k|	switch (yych) {
  200|  13.8k|		case '=': goto yy8;
  ------------------
  |  Branch (200:3): [True: 13.8k, False: 127]
  ------------------
  201|    125|		case 'u': goto yy9;
  ------------------
  |  Branch (201:3): [True: 125, False: 13.8k]
  ------------------
  202|      2|		default: goto yy7;
  ------------------
  |  Branch (202:3): [True: 2, False: 13.9k]
  ------------------
  203|  13.9k|	}
  204|     62|yy7:
  205|     62|	YYRESTORE();
  ------------------
  |  |   37|     62|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|     62|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|     62|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  206|     62|	goto yy2;
  207|  13.8k|yy8:
  208|  13.8k|	YYSKIP();
  ------------------
  |  |   35|  13.8k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  13.8k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  209|  13.8k|	yych = YYPEEK();
  ------------------
  |  |   33|  13.8k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  13.8k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  13.8k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 13.8k, False: 2]
  |  |  ------------------
  ------------------
  210|  13.8k|	switch (yych) {
  211|    350|		case '0':
  ------------------
  |  Branch (211:3): [True: 350, False: 13.5k]
  ------------------
  212|  3.38k|		case '1':
  ------------------
  |  Branch (212:3): [True: 3.03k, False: 10.8k]
  ------------------
  213|  3.41k|		case '2':
  ------------------
  |  Branch (213:3): [True: 31, False: 13.8k]
  ------------------
  214|  13.4k|		case '3':
  ------------------
  |  Branch (214:3): [True: 10.0k, False: 3.83k]
  ------------------
  215|  13.7k|		case '4':
  ------------------
  |  Branch (215:3): [True: 293, False: 13.5k]
  ------------------
  216|  13.7k|		case '5':
  ------------------
  |  Branch (216:3): [True: 18, False: 13.8k]
  ------------------
  217|  13.7k|		case '6':
  ------------------
  |  Branch (217:3): [True: 42, False: 13.8k]
  ------------------
  218|  13.8k|		case '7':
  ------------------
  |  Branch (218:3): [True: 9, False: 13.8k]
  ------------------
  219|  13.8k|		case '8':
  ------------------
  |  Branch (219:3): [True: 36, False: 13.8k]
  ------------------
  220|  13.8k|		case '9':
  ------------------
  |  Branch (220:3): [True: 14, False: 13.8k]
  ------------------
  221|  13.8k|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|  13.8k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  13.8k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  222|  13.8k|			goto yy10;
  223|      5|		default: goto yy7;
  ------------------
  |  Branch (223:3): [True: 5, False: 13.8k]
  ------------------
  224|  13.8k|	}
  225|    125|yy9:
  226|    125|	YYSKIP();
  ------------------
  |  |   35|    125|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    125|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  227|    125|	yych = YYPEEK();
  ------------------
  |  |   33|    125|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    125|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    123|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 123, False: 2]
  |  |  ------------------
  ------------------
  228|    125|	switch (yych) {
  229|    116|		case '=': goto yy11;
  ------------------
  |  Branch (229:3): [True: 116, False: 9]
  ------------------
  230|      9|		default: goto yy7;
  ------------------
  |  Branch (230:3): [True: 9, False: 116]
  ------------------
  231|    125|	}
  232|  71.8k|yy10:
  233|  71.8k|	YYSKIP();
  ------------------
  |  |   35|  71.8k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  71.8k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  234|  71.8k|	yych = YYPEEK();
  ------------------
  |  |   33|  71.8k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  71.8k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  71.8k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 71.8k, False: 31]
  |  |  ------------------
  ------------------
  235|  71.8k|	switch (yych) {
  236|    709|		case '0':
  ------------------
  |  Branch (236:3): [True: 709, False: 71.1k]
  ------------------
  237|  1.57k|		case '1':
  ------------------
  |  Branch (237:3): [True: 864, False: 70.9k]
  ------------------
  238|  2.30k|		case '2':
  ------------------
  |  Branch (238:3): [True: 733, False: 71.1k]
  ------------------
  239|  13.1k|		case '3':
  ------------------
  |  Branch (239:3): [True: 10.8k, False: 61.0k]
  ------------------
  240|  14.9k|		case '4':
  ------------------
  |  Branch (240:3): [True: 1.86k, False: 69.9k]
  ------------------
  241|  25.6k|		case '5':
  ------------------
  |  Branch (241:3): [True: 10.6k, False: 61.1k]
  ------------------
  242|  38.9k|		case '6':
  ------------------
  |  Branch (242:3): [True: 13.2k, False: 58.5k]
  ------------------
  243|  40.1k|		case '7':
  ------------------
  |  Branch (243:3): [True: 1.20k, False: 70.6k]
  ------------------
  244|  46.6k|		case '8':
  ------------------
  |  Branch (244:3): [True: 6.56k, False: 65.2k]
  ------------------
  245|  57.9k|		case '9': goto yy10;
  ------------------
  |  Branch (245:3): [True: 11.2k, False: 60.5k]
  ------------------
  246|  13.8k|		case ';':
  ------------------
  |  Branch (246:3): [True: 13.8k, False: 58.0k]
  ------------------
  247|  13.8k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  13.8k|#define YYSTAGN(t) t = NULL
  ------------------
  248|  13.8k|			goto yy12;
  249|     32|		default: goto yy7;
  ------------------
  |  Branch (249:3): [True: 32, False: 71.8k]
  ------------------
  250|  71.8k|	}
  251|    116|yy11:
  252|    116|	YYSKIP();
  ------------------
  |  |   35|    116|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    116|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  253|    116|	yych = YYPEEK();
  ------------------
  |  |   33|    116|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    116|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    116|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 116, False: 0]
  |  |  ------------------
  ------------------
  254|    116|	switch (yych) {
  255|      0|		case 0x00: goto yy7;
  ------------------
  |  Branch (255:3): [True: 0, False: 116]
  ------------------
  256|     14|		case ';':
  ------------------
  |  Branch (256:3): [True: 14, False: 102]
  ------------------
  257|     14|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|     14|#define YYSTAGN(t) t = NULL
  ------------------
  258|     14|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|     14|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|     14|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  259|     14|			goto yy12;
  260|    102|		default:
  ------------------
  |  Branch (260:3): [True: 102, False: 14]
  ------------------
  261|    102|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    102|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    102|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  262|    102|			goto yy13;
  263|    116|	}
  264|  13.9k|yy12:
  265|  13.9k|	YYSKIP();
  ------------------
  |  |   35|  13.9k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  13.9k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  266|  13.9k|	yych = YYPEEK();
  ------------------
  |  |   33|  13.9k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  13.9k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  13.9k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 13.9k, False: 2]
  |  |  ------------------
  ------------------
  267|  13.9k|	switch (yych) {
  268|  13.0k|		case 'b':
  ------------------
  |  Branch (268:3): [True: 13.0k, False: 856]
  ------------------
  269|  13.0k|		case 'g':
  ------------------
  |  Branch (269:3): [True: 0, False: 13.9k]
  ------------------
  270|  13.8k|		case 'i':
  ------------------
  |  Branch (270:3): [True: 735, False: 13.2k]
  ------------------
  271|  13.9k|		case 's': goto yy14;
  ------------------
  |  Branch (271:3): [True: 115, False: 13.8k]
  ------------------
  272|      6|		default: goto yy7;
  ------------------
  |  Branch (272:3): [True: 6, False: 13.9k]
  ------------------
  273|  13.9k|	}
  274|    625|yy13:
  275|    625|	YYSKIP();
  ------------------
  |  |   35|    625|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    625|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  276|    625|	yych = YYPEEK();
  ------------------
  |  |   33|    625|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    625|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    620|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 620, False: 5]
  |  |  ------------------
  ------------------
  277|    625|	switch (yych) {
  278|      5|		case 0x00: goto yy7;
  ------------------
  |  Branch (278:3): [True: 5, False: 620]
  ------------------
  279|     97|		case ';':
  ------------------
  |  Branch (279:3): [True: 97, False: 528]
  ------------------
  280|     97|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|     97|#define YYSTAGN(t) t = NULL
  ------------------
  281|     97|			goto yy12;
  282|    523|		default: goto yy13;
  ------------------
  |  Branch (282:3): [True: 523, False: 102]
  ------------------
  283|    625|	}
  284|  13.9k|yy14:
  285|  13.9k|	YYSKIP();
  ------------------
  |  |   35|  13.9k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  13.9k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  286|  13.9k|	yych = YYPEEK();
  ------------------
  |  |   33|  13.9k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  13.9k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  13.9k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 13.9k, False: 0]
  |  |  ------------------
  ------------------
  287|  13.9k|	switch (yych) {
  288|  13.9k|		case '=': goto yy5;
  ------------------
  |  Branch (288:3): [True: 13.9k, False: 3]
  ------------------
  289|      3|		default: goto yy7;
  ------------------
  |  Branch (289:3): [True: 3, False: 13.9k]
  ------------------
  290|  13.9k|	}
  291|  13.9k|}
  292|       |
  293|       |
  294|  21.1k| match:
  295|  21.1k|    if(nsu) {
  ------------------
  |  Branch (295:8): [True: 105, False: 21.0k]
  ------------------
  296|       |        /* NamespaceUri */
  297|    105|        UA_String nsUri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  298|    105|        UA_StatusCode res = escapedUri2Index(nsUri, &id->namespaceIndex, nsMapping);
  299|    105|        if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|    105|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (299:12): [True: 105, False: 0]
  ------------------
  300|       |            /* Return the entire NodeId string s=... */
  301|    105|            UA_String total = {(size_t)((const UA_Byte*)end - begin), begin};
  302|    105|            id->identifierType = UA_NODEIDTYPE_STRING;
  303|    105|            return UA_String_copy(&total, &id->identifier.string);
  304|    105|        }
  305|  21.0k|    } else if(ns) {
  ------------------
  |  Branch (305:15): [True: 13.8k, False: 7.20k]
  ------------------
  306|       |        /* NamespaceIndex */
  307|  13.8k|        UA_UInt32 tmp;
  308|  13.8k|        size_t len = (size_t)(body - 1 - ns);
  309|  13.8k|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (309:12): [True: 0, False: 13.8k]
  ------------------
  310|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  311|  13.8k|        id->namespaceIndex = (UA_UInt16)tmp;
  312|  13.8k|        if(nsMapping)
  ------------------
  |  Branch (312:12): [True: 0, False: 13.8k]
  ------------------
  313|      0|            id->namespaceIndex =
  314|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->namespaceIndex);
  315|  13.8k|    }
  316|       |
  317|       |    /* From the current position until the end */
  318|  21.0k|    return parse_nodeid_body(id, body, end, idEsc);
  319|  21.1k|}
ua_types_lex.c:escapedUri2Index:
   95|  1.25k|                 const UA_NamespaceMapping *nsMapping) {
   96|  1.25k|    if(!nsMapping)
  ------------------
  |  Branch (96:8): [True: 1.25k, False: 0]
  ------------------
   97|  1.25k|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|  1.25k|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   98|      0|    UA_String tmp = uri; 
   99|      0|    status res = UA_String_unescape(&uri, true, UA_ESCAPING_PERCENT);
  100|      0|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (100:8): [True: 0, False: 0]
  ------------------
  101|      0|        return res;
  102|      0|    res = UA_NamespaceMapping_uri2Index(nsMapping, uri, nsIndex);
  103|      0|    if(tmp.data != uri.data)
  ------------------
  |  Branch (103:8): [True: 0, False: 0]
  ------------------
  104|      0|        UA_String_clear(&uri);
  105|      0|    return res;
  106|      0|}
ua_types_lex.c:parse_nodeid_body:
  109|  43.0k|parse_nodeid_body(UA_NodeId *id, const u8 *body, const u8 *end, UA_Escaping esc) {
  110|  43.0k|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  43.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  111|  43.0k|    UA_String str = {(size_t)(end - (body+2)), (UA_Byte*)(uintptr_t)body + 2};
  112|  43.0k|    switch(*body) {
  113|  6.63k|    case 'i':
  ------------------
  |  Branch (113:5): [True: 6.63k, False: 36.4k]
  ------------------
  114|  6.63k|        id->identifierType = UA_NODEIDTYPE_NUMERIC;
  115|  6.63k|        if(UA_readNumber(str.data, str.length, &id->identifier.numeric) != str.length)
  ------------------
  |  Branch (115:12): [True: 22, False: 6.61k]
  ------------------
  116|     22|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     22|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  117|  6.63k|        break;
  118|  12.1k|    case 's':
  ------------------
  |  Branch (118:5): [True: 12.1k, False: 30.8k]
  ------------------
  119|  12.1k|        id->identifierType = UA_NODEIDTYPE_STRING;
  120|  12.1k|        res |= UA_String_copy(&str, &id->identifier.string);
  121|  12.1k|        res |= UA_String_unescape(&id->identifier.string, false, esc);
  122|  12.1k|        break;
  123|     10|    case 'g':
  ------------------
  |  Branch (123:5): [True: 10, False: 43.0k]
  ------------------
  124|     10|        id->identifierType = UA_NODEIDTYPE_GUID;
  125|     10|        res = parse_guid(&id->identifier.guid, str.data, end);
  126|     10|        break;
  127|  24.2k|    case 'b':
  ------------------
  |  Branch (127:5): [True: 24.2k, False: 18.7k]
  ------------------
  128|       |        /* For percent-escaping, base64url bytestring encoding is used. That
  129|       |         * doesn't need to be escaped here. The and-escaping is not applied to
  130|       |         * the NodeId identifier part. */
  131|  24.2k|        id->identifierType = UA_NODEIDTYPE_BYTESTRING;
  132|  24.2k|        id->identifier.byteString.data =
  133|  24.2k|            UA_unbase64(str.data, str.length, &id->identifier.byteString.length);
  134|  24.2k|        if(!id->identifier.byteString.data) {
  ------------------
  |  Branch (134:12): [True: 12, False: 24.2k]
  ------------------
  135|     12|            UA_assert(id->identifier.byteString.length == 0);
  ------------------
  |  |  399|     12|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (135:13): [True: 12, False: 0]
  ------------------
  136|     12|            res = UA_STATUSCODE_BADDECODINGERROR; /* Returned on error by UA_unbase64 */
  ------------------
  |  |   44|     12|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  137|     12|        }
  138|  24.2k|        break;
  139|  24.2k|    default:
  ------------------
  |  Branch (139:5): [True: 0, False: 43.0k]
  ------------------
  140|      0|        res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  141|      0|        break;
  142|  43.0k|    }
  143|  43.0k|    return res;
  144|  43.0k|}
ua_types_lex.c:parse_expandednodeid:
  339|  22.2k|                     size_t serverUrisSize, const UA_String *serverUris) {
  340|  22.2k|    *id = UA_EXPANDEDNODEID_NULL; /* Reset the NodeId */
  341|  22.2k|    LexContext context;
  342|  22.2k|    memset(&context, 0, sizeof(LexContext));
  343|  22.2k|    const u8 *svr = NULL, *sve = NULL, *svu = NULL,
  344|  22.2k|        *nsu = NULL, *ns = NULL, *body = NULL, *begin = pos;
  345|       |
  346|       |    
  347|  22.2k|{
  348|  22.2k|	u8 yych;
  349|  22.2k|	yych = YYPEEK();
  ------------------
  |  |   33|  22.2k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  22.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  22.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 22.2k, False: 1]
  |  |  ------------------
  ------------------
  350|  22.2k|	switch (yych) {
  351|  8.14k|		case 'b':
  ------------------
  |  Branch (351:3): [True: 8.14k, False: 14.0k]
  ------------------
  352|  8.14k|		case 'g':
  ------------------
  |  Branch (352:3): [True: 0, False: 22.2k]
  ------------------
  353|  10.8k|		case 'i':
  ------------------
  |  Branch (353:3): [True: 2.65k, False: 19.5k]
  ------------------
  354|  10.8k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  10.8k|#define YYSTAGN(t) t = NULL
  ------------------
  355|  10.8k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  10.8k|#define YYSTAGN(t) t = NULL
  ------------------
  356|  10.8k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  10.8k|#define YYSTAGN(t) t = NULL
  ------------------
  357|  10.8k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  10.8k|#define YYSTAGN(t) t = NULL
  ------------------
  358|  10.8k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  10.8k|#define YYSTAGN(t) t = NULL
  ------------------
  359|  10.8k|			goto yy18;
  360|  3.35k|		case 'n':
  ------------------
  |  Branch (360:3): [True: 3.35k, False: 18.8k]
  ------------------
  361|  3.35k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  3.35k|#define YYSTAGN(t) t = NULL
  ------------------
  362|  3.35k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  3.35k|#define YYSTAGN(t) t = NULL
  ------------------
  363|  3.35k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  3.35k|#define YYSTAGN(t) t = NULL
  ------------------
  364|  3.35k|			goto yy19;
  365|  8.06k|		case 's':
  ------------------
  |  Branch (365:3): [True: 8.06k, False: 14.1k]
  ------------------
  366|  8.06k|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|  8.06k|#define YYSTAGN(t) t = NULL
  ------------------
  367|  8.06k|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|  8.06k|#define YYSTAGN(t) t = NULL
  ------------------
  368|  8.06k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  8.06k|#define YYSTAGN(t) t = NULL
  ------------------
  369|  8.06k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  8.06k|#define YYSTAGN(t) t = NULL
  ------------------
  370|  8.06k|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|  8.06k|#define YYSTAGN(t) t = NULL
  ------------------
  371|  8.06k|			goto yy20;
  372|      4|		default: goto yy16;
  ------------------
  |  Branch (372:3): [True: 4, False: 22.2k]
  ------------------
  373|  22.2k|	}
  374|      4|yy16:
  375|      4|	YYSKIP();
  ------------------
  |  |   35|      4|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      4|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  376|     92|yy17:
  377|     92|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   44|     92|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  378|  10.8k|yy18:
  379|  10.8k|	YYSKIP();
  ------------------
  |  |   35|  10.8k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  10.8k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  380|  10.8k|	yych = YYPEEK();
  ------------------
  |  |   33|  10.8k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  10.8k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  10.8k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 10.8k, False: 0]
  |  |  ------------------
  ------------------
  381|  10.8k|	switch (yych) {
  382|  10.8k|		case '=': goto yy21;
  ------------------
  |  Branch (382:3): [True: 10.8k, False: 0]
  ------------------
  383|      0|		default: goto yy17;
  ------------------
  |  Branch (383:3): [True: 0, False: 10.8k]
  ------------------
  384|  10.8k|	}
  385|  3.35k|yy19:
  386|  3.35k|	YYSKIP();
  ------------------
  |  |   35|  3.35k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.35k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  387|  3.35k|	YYBACKUP();
  ------------------
  |  |   36|  3.35k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  3.35k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  3.35k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  388|  3.35k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.35k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.35k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.35k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.35k, False: 0]
  |  |  ------------------
  ------------------
  389|  3.35k|	switch (yych) {
  390|  3.35k|		case 's': goto yy22;
  ------------------
  |  Branch (390:3): [True: 3.35k, False: 3]
  ------------------
  391|      3|		default: goto yy17;
  ------------------
  |  Branch (391:3): [True: 3, False: 3.35k]
  ------------------
  392|  3.35k|	}
  393|  8.06k|yy20:
  394|  8.06k|	YYSKIP();
  ------------------
  |  |   35|  8.06k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  8.06k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  395|  8.06k|	YYBACKUP();
  ------------------
  |  |   36|  8.06k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  8.06k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  8.06k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  396|  8.06k|	yych = YYPEEK();
  ------------------
  |  |   33|  8.06k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  8.06k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  8.06k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 8.06k, False: 0]
  |  |  ------------------
  ------------------
  397|  8.06k|	switch (yych) {
  398|  6.99k|		case '=': goto yy21;
  ------------------
  |  Branch (398:3): [True: 6.99k, False: 1.06k]
  ------------------
  399|  1.06k|		case 'v': goto yy24;
  ------------------
  |  Branch (399:3): [True: 1.06k, False: 6.99k]
  ------------------
  400|      1|		default: goto yy17;
  ------------------
  |  Branch (400:3): [True: 1, False: 8.06k]
  ------------------
  401|  8.06k|	}
  402|  22.1k|yy21:
  403|  22.1k|	YYSKIP();
  ------------------
  |  |   35|  22.1k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  22.1k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  404|  22.1k|	svr = context.yyt5;
  405|  22.1k|	svu = context.yyt1;
  406|  22.1k|	sve = context.yyt2;
  407|  22.1k|	ns = context.yyt3;
  408|  22.1k|	nsu = context.yyt4;
  409|  22.1k|	YYSTAGP(body);
  ------------------
  |  |   38|  22.1k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  22.1k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  410|  22.1k|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|  22.1k|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  411|  22.1k|	{ goto match; }
  412|  3.35k|yy22:
  413|  3.35k|	YYSKIP();
  ------------------
  |  |   35|  3.35k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.35k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  414|  3.35k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.35k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.35k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.35k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.35k, False: 0]
  |  |  ------------------
  ------------------
  415|  3.35k|	switch (yych) {
  416|  2.39k|		case '=': goto yy25;
  ------------------
  |  Branch (416:3): [True: 2.39k, False: 952]
  ------------------
  417|    952|		case 'u': goto yy26;
  ------------------
  |  Branch (417:3): [True: 952, False: 2.39k]
  ------------------
  418|      0|		default: goto yy23;
  ------------------
  |  Branch (418:3): [True: 0, False: 3.35k]
  ------------------
  419|  3.35k|	}
  420|     84|yy23:
  421|     84|	YYRESTORE();
  ------------------
  |  |   37|     84|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|     84|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|     84|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  422|     84|	goto yy17;
  423|  1.06k|yy24:
  424|  1.06k|	YYSKIP();
  ------------------
  |  |   35|  1.06k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.06k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  425|  1.06k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.06k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.06k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.06k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.06k, False: 0]
  |  |  ------------------
  ------------------
  426|  1.06k|	switch (yych) {
  427|    945|		case 'r': goto yy27;
  ------------------
  |  Branch (427:3): [True: 945, False: 122]
  ------------------
  428|    122|		case 'u': goto yy28;
  ------------------
  |  Branch (428:3): [True: 122, False: 945]
  ------------------
  429|      0|		default: goto yy23;
  ------------------
  |  Branch (429:3): [True: 0, False: 1.06k]
  ------------------
  430|  1.06k|	}
  431|  2.39k|yy25:
  432|  2.39k|	YYSKIP();
  ------------------
  |  |   35|  2.39k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  2.39k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  433|  2.39k|	yych = YYPEEK();
  ------------------
  |  |   33|  2.39k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.39k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  2.39k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 2.39k, False: 0]
  |  |  ------------------
  ------------------
  434|  2.39k|	switch (yych) {
  435|     25|		case '0':
  ------------------
  |  Branch (435:3): [True: 25, False: 2.37k]
  ------------------
  436|  1.58k|		case '1':
  ------------------
  |  Branch (436:3): [True: 1.56k, False: 838]
  ------------------
  437|  1.62k|		case '2':
  ------------------
  |  Branch (437:3): [True: 35, False: 2.36k]
  ------------------
  438|  1.68k|		case '3':
  ------------------
  |  Branch (438:3): [True: 65, False: 2.33k]
  ------------------
  439|  1.69k|		case '4':
  ------------------
  |  Branch (439:3): [True: 5, False: 2.39k]
  ------------------
  440|  1.70k|		case '5':
  ------------------
  |  Branch (440:3): [True: 11, False: 2.38k]
  ------------------
  441|  2.35k|		case '6':
  ------------------
  |  Branch (441:3): [True: 649, False: 1.74k]
  ------------------
  442|  2.38k|		case '7':
  ------------------
  |  Branch (442:3): [True: 39, False: 2.35k]
  ------------------
  443|  2.39k|		case '8':
  ------------------
  |  Branch (443:3): [True: 6, False: 2.39k]
  ------------------
  444|  2.39k|		case '9':
  ------------------
  |  Branch (444:3): [True: 2, False: 2.39k]
  ------------------
  445|  2.39k|			YYSTAGP(context.yyt3);
  ------------------
  |  |   38|  2.39k|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  2.39k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  446|  2.39k|			goto yy29;
  447|      1|		default: goto yy23;
  ------------------
  |  Branch (447:3): [True: 1, False: 2.39k]
  ------------------
  448|  2.39k|	}
  449|    952|yy26:
  450|    952|	YYSKIP();
  ------------------
  |  |   35|    952|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    952|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  451|    952|	yych = YYPEEK();
  ------------------
  |  |   33|    952|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    952|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    952|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 952, False: 0]
  |  |  ------------------
  ------------------
  452|    952|	switch (yych) {
  453|    950|		case '=': goto yy30;
  ------------------
  |  Branch (453:3): [True: 950, False: 2]
  ------------------
  454|      2|		default: goto yy23;
  ------------------
  |  Branch (454:3): [True: 2, False: 950]
  ------------------
  455|    952|	}
  456|    945|yy27:
  457|    945|	YYSKIP();
  ------------------
  |  |   35|    945|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    945|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  458|    945|	yych = YYPEEK();
  ------------------
  |  |   33|    945|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    945|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    945|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 945, False: 0]
  |  |  ------------------
  ------------------
  459|    945|	switch (yych) {
  460|    944|		case '=': goto yy31;
  ------------------
  |  Branch (460:3): [True: 944, False: 1]
  ------------------
  461|      1|		default: goto yy23;
  ------------------
  |  Branch (461:3): [True: 1, False: 944]
  ------------------
  462|    945|	}
  463|    122|yy28:
  464|    122|	YYSKIP();
  ------------------
  |  |   35|    122|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    122|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  465|    122|	yych = YYPEEK();
  ------------------
  |  |   33|    122|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    122|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    122|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 122, False: 0]
  |  |  ------------------
  ------------------
  466|    122|	switch (yych) {
  467|    113|		case '=': goto yy32;
  ------------------
  |  Branch (467:3): [True: 113, False: 9]
  ------------------
  468|      9|		default: goto yy23;
  ------------------
  |  Branch (468:3): [True: 9, False: 113]
  ------------------
  469|    122|	}
  470|  13.2k|yy29:
  471|  13.2k|	YYSKIP();
  ------------------
  |  |   35|  13.2k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  13.2k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  472|  13.2k|	yych = YYPEEK();
  ------------------
  |  |   33|  13.2k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  13.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  13.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 13.2k, False: 29]
  |  |  ------------------
  ------------------
  473|  13.2k|	switch (yych) {
  474|  2.70k|		case '0':
  ------------------
  |  Branch (474:3): [True: 2.70k, False: 10.5k]
  ------------------
  475|  2.96k|		case '1':
  ------------------
  |  Branch (475:3): [True: 258, False: 12.9k]
  ------------------
  476|  3.17k|		case '2':
  ------------------
  |  Branch (476:3): [True: 216, False: 13.0k]
  ------------------
  477|  3.43k|		case '3':
  ------------------
  |  Branch (477:3): [True: 256, False: 12.9k]
  ------------------
  478|  3.68k|		case '4':
  ------------------
  |  Branch (478:3): [True: 249, False: 13.0k]
  ------------------
  479|  3.93k|		case '5':
  ------------------
  |  Branch (479:3): [True: 250, False: 13.0k]
  ------------------
  480|  5.38k|		case '6':
  ------------------
  |  Branch (480:3): [True: 1.44k, False: 11.8k]
  ------------------
  481|  5.95k|		case '7':
  ------------------
  |  Branch (481:3): [True: 576, False: 12.6k]
  ------------------
  482|  9.87k|		case '8':
  ------------------
  |  Branch (482:3): [True: 3.92k, False: 9.33k]
  ------------------
  483|  10.8k|		case '9': goto yy29;
  ------------------
  |  Branch (483:3): [True: 979, False: 12.2k]
  ------------------
  484|  2.36k|		case ';':
  ------------------
  |  Branch (484:3): [True: 2.36k, False: 10.8k]
  ------------------
  485|  2.36k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  2.36k|#define YYSTAGN(t) t = NULL
  ------------------
  486|  2.36k|			goto yy33;
  487|     32|		default: goto yy23;
  ------------------
  |  Branch (487:3): [True: 32, False: 13.2k]
  ------------------
  488|  13.2k|	}
  489|    950|yy30:
  490|    950|	YYSKIP();
  ------------------
  |  |   35|    950|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    950|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  491|    950|	yych = YYPEEK();
  ------------------
  |  |   33|    950|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    950|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    950|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 950, False: 0]
  |  |  ------------------
  ------------------
  492|    950|	switch (yych) {
  493|      0|		case 0x00: goto yy23;
  ------------------
  |  Branch (493:3): [True: 0, False: 950]
  ------------------
  494|     62|		case ';':
  ------------------
  |  Branch (494:3): [True: 62, False: 888]
  ------------------
  495|     62|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|     62|#define YYSTAGN(t) t = NULL
  ------------------
  496|     62|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|     62|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|     62|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  497|     62|			goto yy33;
  498|    888|		default:
  ------------------
  |  Branch (498:3): [True: 888, False: 62]
  ------------------
  499|    888|			YYSTAGP(context.yyt4);
  ------------------
  |  |   38|    888|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    888|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  500|    888|			goto yy34;
  501|    950|	}
  502|    944|yy31:
  503|    944|	YYSKIP();
  ------------------
  |  |   35|    944|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    944|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  504|    944|	yych = YYPEEK();
  ------------------
  |  |   33|    944|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    944|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    944|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 944, False: 0]
  |  |  ------------------
  ------------------
  505|    944|	switch (yych) {
  506|     36|		case '0':
  ------------------
  |  Branch (506:3): [True: 36, False: 908]
  ------------------
  507|    226|		case '1':
  ------------------
  |  Branch (507:3): [True: 190, False: 754]
  ------------------
  508|    252|		case '2':
  ------------------
  |  Branch (508:3): [True: 26, False: 918]
  ------------------
  509|    420|		case '3':
  ------------------
  |  Branch (509:3): [True: 168, False: 776]
  ------------------
  510|    756|		case '4':
  ------------------
  |  Branch (510:3): [True: 336, False: 608]
  ------------------
  511|    775|		case '5':
  ------------------
  |  Branch (511:3): [True: 19, False: 925]
  ------------------
  512|    784|		case '6':
  ------------------
  |  Branch (512:3): [True: 9, False: 935]
  ------------------
  513|    887|		case '7':
  ------------------
  |  Branch (513:3): [True: 103, False: 841]
  ------------------
  514|    934|		case '8':
  ------------------
  |  Branch (514:3): [True: 47, False: 897]
  ------------------
  515|    943|		case '9':
  ------------------
  |  Branch (515:3): [True: 9, False: 935]
  ------------------
  516|    943|			YYSTAGP(context.yyt5);
  ------------------
  |  |   38|    943|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    943|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  517|    943|			goto yy35;
  518|      1|		default: goto yy23;
  ------------------
  |  Branch (518:3): [True: 1, False: 943]
  ------------------
  519|    944|	}
  520|    113|yy32:
  521|    113|	YYSKIP();
  ------------------
  |  |   35|    113|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    113|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  522|    113|	yych = YYPEEK();
  ------------------
  |  |   33|    113|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    113|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|    113|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 113, False: 0]
  |  |  ------------------
  ------------------
  523|    113|	switch (yych) {
  524|      0|		case 0x00: goto yy23;
  ------------------
  |  Branch (524:3): [True: 0, False: 113]
  ------------------
  525|      0|		case ';':
  ------------------
  |  Branch (525:3): [True: 0, False: 113]
  ------------------
  526|      0|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|      0|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  527|      0|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|      0|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  528|      0|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|      0|#define YYSTAGN(t) t = NULL
  ------------------
  529|      0|			goto yy37;
  530|    113|		default:
  ------------------
  |  Branch (530:3): [True: 113, False: 0]
  ------------------
  531|    113|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|    113|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    113|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  532|    113|			goto yy36;
  533|    113|	}
  534|  3.31k|yy33:
  535|  3.31k|	YYSKIP();
  ------------------
  |  |   35|  3.31k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.31k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  536|  3.31k|	yych = YYPEEK();
  ------------------
  |  |   33|  3.31k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.31k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.31k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.31k, False: 0]
  |  |  ------------------
  ------------------
  537|  3.31k|	switch (yych) {
  538|  1.61k|		case 'b':
  ------------------
  |  Branch (538:3): [True: 1.61k, False: 1.70k]
  ------------------
  539|  1.61k|		case 'g':
  ------------------
  |  Branch (539:3): [True: 0, False: 3.31k]
  ------------------
  540|  2.38k|		case 'i':
  ------------------
  |  Branch (540:3): [True: 770, False: 2.54k]
  ------------------
  541|  3.31k|		case 's': goto yy38;
  ------------------
  |  Branch (541:3): [True: 930, False: 2.38k]
  ------------------
  542|      1|		default: goto yy23;
  ------------------
  |  Branch (542:3): [True: 1, False: 3.31k]
  ------------------
  543|  3.31k|	}
  544|   164k|yy34:
  545|   164k|	YYSKIP();
  ------------------
  |  |   35|   164k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|   164k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  546|   164k|	yych = YYPEEK();
  ------------------
  |  |   33|   164k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   164k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   164k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 164k, False: 1]
  |  |  ------------------
  ------------------
  547|   164k|	switch (yych) {
  548|      1|		case 0x00: goto yy23;
  ------------------
  |  Branch (548:3): [True: 1, False: 164k]
  ------------------
  549|    887|		case ';':
  ------------------
  |  Branch (549:3): [True: 887, False: 163k]
  ------------------
  550|    887|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|    887|#define YYSTAGN(t) t = NULL
  ------------------
  551|    887|			goto yy33;
  552|   163k|		default: goto yy34;
  ------------------
  |  Branch (552:3): [True: 163k, False: 888]
  ------------------
  553|   164k|	}
  554|  5.94k|yy35:
  555|  5.94k|	YYSKIP();
  ------------------
  |  |   35|  5.94k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  5.94k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  556|  5.94k|	yych = YYPEEK();
  ------------------
  |  |   33|  5.94k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  5.94k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  5.93k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 5.93k, False: 16]
  |  |  ------------------
  ------------------
  557|  5.94k|	switch (yych) {
  558|  1.90k|		case '0':
  ------------------
  |  Branch (558:3): [True: 1.90k, False: 4.04k]
  ------------------
  559|  2.17k|		case '1':
  ------------------
  |  Branch (559:3): [True: 277, False: 5.67k]
  ------------------
  560|  2.48k|		case '2':
  ------------------
  |  Branch (560:3): [True: 307, False: 5.64k]
  ------------------
  561|  2.76k|		case '3':
  ------------------
  |  Branch (561:3): [True: 282, False: 5.66k]
  ------------------
  562|  3.11k|		case '4':
  ------------------
  |  Branch (562:3): [True: 345, False: 5.60k]
  ------------------
  563|  3.39k|		case '5':
  ------------------
  |  Branch (563:3): [True: 286, False: 5.66k]
  ------------------
  564|  3.84k|		case '6':
  ------------------
  |  Branch (564:3): [True: 450, False: 5.49k]
  ------------------
  565|  4.11k|		case '7':
  ------------------
  |  Branch (565:3): [True: 266, False: 5.68k]
  ------------------
  566|  4.41k|		case '8':
  ------------------
  |  Branch (566:3): [True: 299, False: 5.64k]
  ------------------
  567|  5.00k|		case '9': goto yy35;
  ------------------
  |  Branch (567:3): [True: 591, False: 5.35k]
  ------------------
  568|    914|		case ';':
  ------------------
  |  Branch (568:3): [True: 914, False: 5.03k]
  ------------------
  569|    914|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|    914|#define YYSTAGN(t) t = NULL
  ------------------
  570|    914|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    914|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    914|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  571|    914|			goto yy37;
  572|     29|		default: goto yy23;
  ------------------
  |  Branch (572:3): [True: 29, False: 5.91k]
  ------------------
  573|  5.94k|	}
  574|  3.79M|yy36:
  575|  3.79M|	YYSKIP();
  ------------------
  |  |   35|  3.79M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  3.79M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  576|  3.79M|	yych = YYPEEK();
  ------------------
  |  |   33|  3.79M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.79M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  3.79M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 3.79M, False: 4]
  |  |  ------------------
  ------------------
  577|  3.79M|	switch (yych) {
  578|      4|		case 0x00: goto yy23;
  ------------------
  |  Branch (578:3): [True: 4, False: 3.79M]
  ------------------
  579|    109|		case ';':
  ------------------
  |  Branch (579:3): [True: 109, False: 3.79M]
  ------------------
  580|    109|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|    109|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|    109|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  581|    109|			YYSTAGN(context.yyt5);
  ------------------
  |  |   39|    109|#define YYSTAGN(t) t = NULL
  ------------------
  582|    109|			goto yy37;
  583|  3.79M|		default: goto yy36;
  ------------------
  |  Branch (583:3): [True: 3.79M, False: 113]
  ------------------
  584|  3.79M|	}
  585|  1.02k|yy37:
  586|  1.02k|	YYSKIP();
  ------------------
  |  |   35|  1.02k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  1.02k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  587|  1.02k|	yych = YYPEEK();
  ------------------
  |  |   33|  1.02k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.02k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  1.02k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 1.02k, False: 0]
  |  |  ------------------
  ------------------
  588|  1.02k|	switch (yych) {
  589|      5|		case 'b':
  ------------------
  |  Branch (589:3): [True: 5, False: 1.01k]
  ------------------
  590|      5|		case 'g':
  ------------------
  |  Branch (590:3): [True: 0, False: 1.02k]
  ------------------
  591|     15|		case 'i':
  ------------------
  |  Branch (591:3): [True: 10, False: 1.01k]
  ------------------
  592|  1.02k|		case 's':
  ------------------
  |  Branch (592:3): [True: 1.00k, False: 16]
  ------------------
  593|  1.02k|			YYSTAGN(context.yyt3);
  ------------------
  |  |   39|  1.02k|#define YYSTAGN(t) t = NULL
  ------------------
  594|  1.02k|			YYSTAGN(context.yyt4);
  ------------------
  |  |   39|  1.02k|#define YYSTAGN(t) t = NULL
  ------------------
  595|  1.02k|			goto yy38;
  596|      0|		case 'n': goto yy39;
  ------------------
  |  Branch (596:3): [True: 0, False: 1.02k]
  ------------------
  597|      1|		default: goto yy23;
  ------------------
  |  Branch (597:3): [True: 1, False: 1.02k]
  ------------------
  598|  1.02k|	}
  599|  4.33k|yy38:
  600|  4.33k|	YYSKIP();
  ------------------
  |  |   35|  4.33k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  4.33k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  601|  4.33k|	yych = YYPEEK();
  ------------------
  |  |   33|  4.33k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.33k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  4.33k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 4.33k, False: 0]
  |  |  ------------------
  ------------------
  602|  4.33k|	switch (yych) {
  603|  4.33k|		case '=': goto yy21;
  ------------------
  |  Branch (603:3): [True: 4.33k, False: 2]
  ------------------
  604|      2|		default: goto yy23;
  ------------------
  |  Branch (604:3): [True: 2, False: 4.33k]
  ------------------
  605|  4.33k|	}
  606|      0|yy39:
  607|      0|	YYSKIP();
  ------------------
  |  |   35|      0|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  608|      0|	yych = YYPEEK();
  ------------------
  |  |   33|      0|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  609|      0|	switch (yych) {
  610|      0|		case 's': goto yy22;
  ------------------
  |  Branch (610:3): [True: 0, False: 0]
  ------------------
  611|      0|		default: goto yy23;
  ------------------
  |  Branch (611:3): [True: 0, False: 0]
  ------------------
  612|      0|	}
  613|      0|}
  614|       |
  615|       |
  616|  22.1k| match:
  617|  22.1k|    if(svu) {
  ------------------
  |  Branch (617:8): [True: 108, False: 22.0k]
  ------------------
  618|       |        /* ServerUri */
  619|    108|        UA_String serverUri = {(size_t)(sve - svu), (UA_Byte*)(uintptr_t)svu};
  620|    108|        size_t i = 0;
  621|    108|        for(; i < serverUrisSize; i++) {
  ------------------
  |  Branch (621:15): [True: 0, False: 108]
  ------------------
  622|      0|            if(UA_String_equal(&serverUri, &serverUris[i]))
  ------------------
  |  Branch (622:16): [True: 0, False: 0]
  ------------------
  623|      0|                break;
  624|      0|        }
  625|    108|        if(i == serverUrisSize) {
  ------------------
  |  Branch (625:12): [True: 108, False: 0]
  ------------------
  626|       |            /* The ServerUri cannot be mapped. Return the entire input as a
  627|       |             * string NodeId. */
  628|    108|            UA_String total = {(size_t)(end - begin), (UA_Byte*)(uintptr_t)begin};
  629|    108|            id->nodeId.identifierType = UA_NODEIDTYPE_STRING;
  630|    108|            return UA_String_copy(&total, &id->nodeId.identifier.string);
  631|    108|        }
  632|      0|        id->serverIndex = (UA_UInt32)i;
  633|  22.0k|    } else if(svr) {
  ------------------
  |  Branch (633:15): [True: 913, False: 21.1k]
  ------------------
  634|       |        /* ServerIndex */
  635|    913|        size_t len = (size_t)(sve - svr);
  636|    913|        if(UA_readNumber((const UA_Byte*)svr, len, &id->serverIndex) != len)
  ------------------
  |  Branch (636:12): [True: 0, False: 913]
  ------------------
  637|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  638|    913|    }
  639|       |
  640|  22.0k|    if(nsu) {
  ------------------
  |  Branch (640:8): [True: 948, False: 21.0k]
  ------------------
  641|       |        /* NamespaceUri */
  642|    948|        UA_String nsuri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  643|    948|        UA_StatusCode res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    948|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  644|       |        /* Try to map the NamespaceUri to its NamespaceIndex for ServerIndex == 0.
  645|       |         * If this fails, keep the full NamespaceUri. */
  646|    948|        if(id->serverIndex == 0)
  ------------------
  |  Branch (646:12): [True: 948, False: 0]
  ------------------
  647|    948|            res = escapedUri2Index(nsuri, &id->nodeId.namespaceIndex, nsMapping);
  648|    948|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    948|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (648:12): [True: 948, False: 0]
  ------------------
  649|    948|            res = UA_String_copy(&nsuri, &id->namespaceUri); /* Keep the Uri without mapping */
  650|    948|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    948|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (650:12): [True: 0, False: 948]
  ------------------
  651|      0|            return res;
  652|  21.0k|    } else if(ns) {
  ------------------
  |  Branch (652:15): [True: 2.36k, False: 18.7k]
  ------------------
  653|       |        /* NamespaceIndex */
  654|  2.36k|        UA_UInt32 tmp;
  655|  2.36k|        size_t len = (size_t)(body - 1 - ns);
  656|  2.36k|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (656:12): [True: 0, False: 2.36k]
  ------------------
  657|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  658|  2.36k|        id->nodeId.namespaceIndex = (UA_UInt16)tmp;
  659|  2.36k|        if(nsMapping)
  ------------------
  |  Branch (659:12): [True: 0, False: 2.36k]
  ------------------
  660|      0|            id->nodeId.namespaceIndex =
  661|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->nodeId.namespaceIndex);
  662|  2.36k|    }
  663|       |
  664|       |    /* From the current position until the end */
  665|  22.0k|    return parse_nodeid_body(&id->nodeId, body, end, idEsc);
  666|  22.0k|}
ua_types_lex.c:parse_qn:
  707|   155k|         UA_UInt16 defaultNamespaceIndex) {
  708|   155k|    size_t len;
  709|   155k|    UA_UInt32 tmp;
  710|   155k|    UA_String str;
  711|   155k|    UA_StatusCode res;
  712|       |
  713|   155k|    LexContext context;
  714|   155k|    memset(&context, 0, sizeof(LexContext));
  715|       |
  716|   155k|    const u8 *begin = pos;
  717|   155k|    UA_QualifiedName_init(qn);
  718|   155k|    qn->namespaceIndex = defaultNamespaceIndex;
  719|       |
  720|       |    
  721|   155k|{
  722|   155k|	u8 yych;
  723|   155k|	yych = YYPEEK();
  ------------------
  |  |   33|   155k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   155k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   146k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 146k, False: 9.21k]
  |  |  ------------------
  ------------------
  724|   155k|	switch (yych) {
  725|  9.21k|		case 0x00:
  ------------------
  |  Branch (725:3): [True: 9.21k, False: 146k]
  ------------------
  726|  9.42k|		case ';': goto yy41;
  ------------------
  |  Branch (726:3): [True: 207, False: 155k]
  ------------------
  727|  35.6k|		case '0':
  ------------------
  |  Branch (727:3): [True: 35.6k, False: 120k]
  ------------------
  728|  42.1k|		case '1':
  ------------------
  |  Branch (728:3): [True: 6.53k, False: 149k]
  ------------------
  729|  44.1k|		case '2':
  ------------------
  |  Branch (729:3): [True: 1.98k, False: 153k]
  ------------------
  730|  46.9k|		case '3':
  ------------------
  |  Branch (730:3): [True: 2.82k, False: 152k]
  ------------------
  731|  69.3k|		case '4':
  ------------------
  |  Branch (731:3): [True: 22.3k, False: 133k]
  ------------------
  732|  69.9k|		case '5':
  ------------------
  |  Branch (732:3): [True: 642, False: 155k]
  ------------------
  733|  77.8k|		case '6':
  ------------------
  |  Branch (733:3): [True: 7.83k, False: 147k]
  ------------------
  734|  78.3k|		case '7':
  ------------------
  |  Branch (734:3): [True: 520, False: 155k]
  ------------------
  735|  82.7k|		case '8':
  ------------------
  |  Branch (735:3): [True: 4.38k, False: 151k]
  ------------------
  736|  83.0k|		case '9': goto yy44;
  ------------------
  |  Branch (736:3): [True: 356, False: 155k]
  ------------------
  737|  63.2k|		default: goto yy43;
  ------------------
  |  Branch (737:3): [True: 63.2k, False: 92.4k]
  ------------------
  738|   155k|	}
  739|  9.42k|yy41:
  740|  9.42k|	YYSKIP();
  ------------------
  |  |   35|  9.42k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  9.42k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  741|   154k|yy42:
  742|   154k|	{ pos = begin; goto match_name; }
  743|  63.2k|yy43:
  744|  63.2k|	YYSKIP();
  ------------------
  |  |   35|  63.2k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  63.2k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  745|  63.2k|	YYBACKUP();
  ------------------
  |  |   36|  63.2k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  63.2k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  63.2k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  746|  63.2k|	yych = YYPEEK();
  ------------------
  |  |   33|  63.2k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  63.2k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  49.0k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 49.0k, False: 14.2k]
  |  |  ------------------
  ------------------
  747|  63.2k|	if (yych <= 0x00) goto yy42;
  ------------------
  |  Branch (747:6): [True: 14.2k, False: 49.0k]
  ------------------
  748|  49.0k|	goto yy46;
  749|  83.0k|yy44:
  750|  83.0k|	YYSKIP();
  ------------------
  |  |   35|  83.0k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  83.0k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  751|  83.0k|	YYBACKUP();
  ------------------
  |  |   36|  83.0k|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|  83.0k|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|  83.0k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  752|  83.0k|	yych = YYPEEK();
  ------------------
  |  |   33|  83.0k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  83.0k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  64.3k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 64.3k, False: 18.6k]
  |  |  ------------------
  ------------------
  753|  83.0k|	switch (yych) {
  754|  7.73k|		case '0':
  ------------------
  |  Branch (754:3): [True: 7.73k, False: 75.3k]
  ------------------
  755|  7.99k|		case '1':
  ------------------
  |  Branch (755:3): [True: 263, False: 82.8k]
  ------------------
  756|  9.77k|		case '2':
  ------------------
  |  Branch (756:3): [True: 1.78k, False: 81.2k]
  ------------------
  757|  10.1k|		case '3':
  ------------------
  |  Branch (757:3): [True: 355, False: 82.7k]
  ------------------
  758|  33.1k|		case '4':
  ------------------
  |  Branch (758:3): [True: 22.9k, False: 60.0k]
  ------------------
  759|  37.4k|		case '5':
  ------------------
  |  Branch (759:3): [True: 4.28k, False: 78.7k]
  ------------------
  760|  37.5k|		case '6':
  ------------------
  |  Branch (760:3): [True: 184, False: 82.8k]
  ------------------
  761|  41.8k|		case '7':
  ------------------
  |  Branch (761:3): [True: 4.23k, False: 78.8k]
  ------------------
  762|  41.8k|		case '8':
  ------------------
  |  Branch (762:3): [True: 63, False: 83.0k]
  ------------------
  763|  42.0k|		case '9':
  ------------------
  |  Branch (763:3): [True: 188, False: 82.8k]
  ------------------
  764|  42.7k|		case ':': goto yy50;
  ------------------
  |  Branch (764:3): [True: 668, False: 82.3k]
  ------------------
  765|  40.3k|		default: goto yy42;
  ------------------
  |  Branch (765:3): [True: 40.3k, False: 42.7k]
  ------------------
  766|  83.0k|	}
  767|  7.37M|yy45:
  768|  7.37M|	YYSKIP();
  ------------------
  |  |   35|  7.37M|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|  7.37M|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  769|  7.37M|	yych = YYPEEK();
  ------------------
  |  |   33|  7.37M|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  7.37M|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|  7.32M|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 7.32M, False: 48.8k]
  |  |  ------------------
  ------------------
  770|  7.42M|yy46:
  771|  7.42M|	switch (yych) {
  772|  48.8k|		case 0x00: goto yy47;
  ------------------
  |  Branch (772:3): [True: 48.8k, False: 7.37M]
  ------------------
  773|    197|		case ';': goto yy48;
  ------------------
  |  Branch (773:3): [True: 197, False: 7.42M]
  ------------------
  774|  7.37M|		default: goto yy45;
  ------------------
  |  Branch (774:3): [True: 7.37M, False: 49.0k]
  ------------------
  775|  7.42M|	}
  776|  90.6k|yy47:
  777|  90.6k|	YYRESTORE();
  ------------------
  |  |   37|  90.6k|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|  90.6k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|  90.6k|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  778|  90.6k|	goto yy42;
  779|    197|yy48:
  780|    197|	YYSKIP();
  ------------------
  |  |   35|    197|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    197|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  781|    197|	{ goto match_uri; }
  782|   302k|yy49:
  783|   302k|	YYSKIP();
  ------------------
  |  |   35|   302k|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|   302k|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  784|   302k|	yych = YYPEEK();
  ------------------
  |  |   33|   302k|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   302k|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|   299k|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 299k, False: 2.48k]
  |  |  ------------------
  ------------------
  785|   344k|yy50:
  786|   344k|	switch (yych) {
  787|   106k|		case '0':
  ------------------
  |  Branch (787:3): [True: 106k, False: 238k]
  ------------------
  788|   116k|		case '1':
  ------------------
  |  Branch (788:3): [True: 10.6k, False: 334k]
  ------------------
  789|   147k|		case '2':
  ------------------
  |  Branch (789:3): [True: 30.9k, False: 313k]
  ------------------
  790|   156k|		case '3':
  ------------------
  |  Branch (790:3): [True: 8.89k, False: 335k]
  ------------------
  791|   209k|		case '4':
  ------------------
  |  Branch (791:3): [True: 52.7k, False: 292k]
  ------------------
  792|   227k|		case '5':
  ------------------
  |  Branch (792:3): [True: 18.3k, False: 326k]
  ------------------
  793|   255k|		case '6':
  ------------------
  |  Branch (793:3): [True: 28.0k, False: 316k]
  ------------------
  794|   266k|		case '7':
  ------------------
  |  Branch (794:3): [True: 10.8k, False: 334k]
  ------------------
  795|   273k|		case '8':
  ------------------
  |  Branch (795:3): [True: 6.90k, False: 337k]
  ------------------
  796|   302k|		case '9': goto yy49;
  ------------------
  |  Branch (796:3): [True: 28.6k, False: 316k]
  ------------------
  797|    878|		case ':': goto yy51;
  ------------------
  |  Branch (797:3): [True: 878, False: 343k]
  ------------------
  798|  41.8k|		default: goto yy47;
  ------------------
  |  Branch (798:3): [True: 41.8k, False: 303k]
  ------------------
  799|   344k|	}
  800|    878|yy51:
  801|    878|	YYSKIP();
  ------------------
  |  |   35|    878|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|    878|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  802|    878|	{ goto match_index; }
  803|   344k|}
  804|       |
  805|       |
  806|    878| match_index:
  807|    878|    len = (size_t)(pos - 1 - begin);
  808|    878|    if(UA_readNumber((const UA_Byte*)begin, len, &tmp) != len)
  ------------------
  |  Branch (808:8): [True: 0, False: 878]
  ------------------
  809|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  810|    878|    qn->namespaceIndex = (UA_UInt16)tmp;
  811|    878|    goto match_name;
  812|       |
  813|    197| match_uri:
  814|    197|    str.length = (size_t)(pos - 1 - begin);
  815|    197|    str.data = (UA_Byte*)(uintptr_t)begin;
  816|    197|    res = escapedUri2Index(str, &qn->namespaceIndex, nsMapping);
  817|    197|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    197|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (817:8): [True: 197, False: 0]
  ------------------
  818|    197|        pos = begin; /* Use the entire string for the name */
  819|       |
  820|   155k| match_name:
  821|   155k|    str.length = (size_t)(end - pos);
  822|   155k|    str.data = (UA_Byte*)(uintptr_t)pos;
  823|   155k|    res = UA_String_copy(&str, &qn->name);
  824|   155k|    if(UA_LIKELY(res == UA_STATUSCODE_GOOD))
  ------------------
  |  |  578|   155k|# define UA_LIKELY(x) __builtin_expect((x), 1)
  |  |  ------------------
  |  |  |  Branch (578:23): [True: 155k, False: 0]
  |  |  ------------------
  ------------------
  825|   155k|        res = UA_String_unescape(&qn->name, false, escName);
  826|   155k|    return res;
  827|    197|}

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

ua_util.c:isReservedPercent:
   95|  14.6M|isReservedPercent(u8 c) {
   96|  14.6M|    return (c == ';'  || c == '%' || c <= ' ' || c == 127);
  ------------------
  |  Branch (96:13): [True: 1.67k, False: 14.6M]
  |  Branch (96:26): [True: 10.4k, False: 14.6M]
  |  Branch (96:38): [True: 79.7k, False: 14.5M]
  |  Branch (96:50): [True: 453, False: 14.5M]
  ------------------
   97|  14.6M|}
ua_util.c:isReservedPercentExtended:
  100|  14.1M|isReservedPercentExtended(u8 c) {
  101|  14.1M|    return (isReservedPercent(c) || c == ':' || c == '#' || c == '[' || c == ']' ||
  ------------------
  |  Branch (101:13): [True: 92.3k, False: 14.0M]
  |  Branch (101:37): [True: 7.83k, False: 14.0M]
  |  Branch (101:49): [True: 3.08k, False: 14.0M]
  |  Branch (101:61): [True: 5.91k, False: 14.0M]
  |  Branch (101:73): [True: 6.06k, False: 14.0M]
  ------------------
  102|  14.0M|            c == '&' || c == '(' || c == ')' || c == ',' || c == '<' || c == '>' ||
  ------------------
  |  Branch (102:13): [True: 2.35k, False: 14.0M]
  |  Branch (102:25): [True: 63.6k, False: 13.9M]
  |  Branch (102:37): [True: 2.22k, False: 13.9M]
  |  Branch (102:49): [True: 1.58M, False: 12.3M]
  |  Branch (102:61): [True: 3.88k, False: 12.3M]
  |  Branch (102:73): [True: 1.50k, False: 12.3M]
  ------------------
  103|  12.3M|            c == '`' || c == '/' || c == '\\' || c == '"' || c == '\'' );
  ------------------
  |  Branch (103:13): [True: 3.52k, False: 12.3M]
  |  Branch (103:25): [True: 17.4k, False: 12.3M]
  |  Branch (103:37): [True: 5.90k, False: 12.3M]
  |  Branch (103:50): [True: 109k, False: 12.2M]
  |  Branch (103:62): [True: 36, False: 12.2M]
  ------------------
  104|  14.1M|}
ua_types_encoding_json.c:isTrue:
  167|  94.4k|isTrue(uint8_t expr) {
  168|  94.4k|    return expr;
  169|  94.4k|}

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

fuzz_json_decode_encode.cc:_ZL15UA_Variant_initP10UA_Variant:
  243|  5.09k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_json_decode_encode.cc:_ZL16UA_Variant_clearP10UA_Variant:
  243|  4.04k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_json_decode_encode.cc:_ZL19UA_ByteString_clearP9UA_String:
  243|  4.04k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_ByteString_init:
  243|   259k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_String_copy:
  243|   169k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_NodeId_clear:
  243|    107|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_ExpandedNodeId_clear:
  243|    106|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_lex.c:UA_QualifiedName_init:
  243|   155k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_clear:
  243|   455k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_init:
  243|     77|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_String_init:
  243|   199k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_init:
  243|    406|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_NodeId_clear:
  243|     84|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_new:
  243|    382|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_json.c:UA_ExtensionObject_clear:
  243|     77|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl

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

