UA_unbase64:
   75|     41|UA_unbase64(const unsigned char *src, size_t len, size_t *out_len) {
   76|       |    /* Empty base64 results in an empty byte-string */
   77|     41|    if(len == 0) {
  ------------------
  |  Branch (77:8): [True: 0, False: 41]
  ------------------
   78|      0|        *out_len = 0;
   79|      0|        return (unsigned char*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|      0|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
   80|      0|    }
   81|       |
   82|       |    /* Allocate the output string. Append four bytes to allow missing padding */
   83|     41|    size_t olen = (len / 4 * 3) + 4;
   84|     41|    unsigned char *out = (unsigned char*)UA_malloc(olen);
  ------------------
  |  |  350|     41|# define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
   85|     41|    if(!out)
  ------------------
  |  Branch (85:8): [True: 0, False: 41]
  ------------------
   86|      0|        return NULL;
   87|       |
   88|       |    /* Iterate over the input */
   89|     41|    size_t pad = 0;
   90|     41|    unsigned char count = 0;
   91|     41|    unsigned char block[4];
   92|     41|    unsigned char *pos = out;
   93|  2.56k|    for(size_t i = 0; i < len; i++) {
  ------------------
  |  Branch (93:23): [True: 2.55k, False: 3]
  ------------------
   94|  2.55k|        if(src[i] & 0x80)
  ------------------
  |  Branch (94:12): [True: 28, False: 2.53k]
  ------------------
   95|     28|            goto error; /* Non-ASCII input */
   96|  2.53k|        unsigned char tmp = dtable[src[i]];
   97|  2.53k|        if(tmp == 0x80)
  ------------------
  |  Branch (97:12): [True: 6, False: 2.52k]
  ------------------
   98|      6|            goto error; /* Not an allowed character */
   99|  2.52k|        if(tmp == 0x7f)
  ------------------
  |  Branch (99:12): [True: 1.08k, False: 1.44k]
  ------------------
  100|  1.08k|            continue; /* Whitespace is ignored to accomodate RFC 2045, used in
  101|       |                       * XML for xs:base64Binary. */
  102|  1.44k|        block[count++] = tmp;
  103|       |
  104|       |        /* Padding */
  105|  1.44k|        if(src[i] == '=') {
  ------------------
  |  Branch (105:12): [True: 7, False: 1.43k]
  ------------------
  106|      7|            if(count < 3) /* Padding can only be the last two bytes of a block */
  ------------------
  |  Branch (106:16): [True: 3, False: 4]
  ------------------
  107|      3|                goto error;
  108|      4|            block[count-1] = 0;
  109|      4|            pad++;
  110|  1.43k|        } else if(pad > 0) {
  ------------------
  |  Branch (110:19): [True: 1, False: 1.43k]
  ------------------
  111|      1|            goto error; /* Padding not terminated correctly */
  112|      1|        }
  113|       |
  114|       |        /* Write three output characters for four characters of input */
  115|  1.43k|        if(count == 4) {
  ------------------
  |  Branch (115:12): [True: 352, False: 1.08k]
  ------------------
  116|    352|            if(pad > 2)
  ------------------
  |  Branch (116:16): [True: 0, False: 352]
  ------------------
  117|      0|                goto error; /* Invalid padding */
  118|    352|            *pos++ = (block[0] << 2) | (block[1] >> 4);
  119|    352|            *pos++ = (block[1] << 4) | (block[2] >> 2);
  120|    352|            *pos++ = (block[2] << 6) | block[3];
  121|    352|            count = 0;
  122|    352|            pos -= pad;
  123|    352|            pad = 0;
  124|    352|        }
  125|  1.43k|    }
  126|       |
  127|       |    /* Input length not a multiple of four */
  128|      3|    if(count > 0)
  ------------------
  |  Branch (128:8): [True: 1, False: 2]
  ------------------
  129|      1|        goto error;
  130|       |
  131|      2|    *out_len = (size_t)(pos - out);
  132|      2|    if(*out_len == 0) {
  ------------------
  |  Branch (132:8): [True: 1, False: 1]
  ------------------
  133|      1|        UA_free(out);
  ------------------
  |  |  351|      1|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  134|      1|        return (unsigned char*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|      1|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  135|      1|    }
  136|      1|    return out;
  137|       |
  138|     39| error:
  139|     39|    UA_free(out);
  ------------------
  |  |  351|     39|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  140|       |    return NULL;
  141|      2|}

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

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

parseUInt64:
   30|  1.79k|parseUInt64(const char *str, size_t size, uint64_t *result) {
   31|  1.79k|    size_t i = 0;
   32|  1.79k|    uint64_t n = 0, prev = 0;
   33|       |
   34|       |    /* Hex */
   35|  1.79k|    if(size > 2 && str[0] == '0' && (str[1] | 32) == 'x') {
  ------------------
  |  Branch (35:8): [True: 1.67k, False: 128]
  |  Branch (35:20): [True: 374, False: 1.29k]
  |  Branch (35:37): [True: 149, False: 225]
  ------------------
   36|    149|        i = 2;
   37|  2.31k|        for(; i < size; i++) {
  ------------------
  |  Branch (37:15): [True: 2.21k, False: 97]
  ------------------
   38|  2.21k|            uint8_t c = (uint8_t)str[i] | 32;
   39|  2.21k|            if(c >= '0' && c <= '9')
  ------------------
  |  Branch (39:16): [True: 2.19k, False: 16]
  |  Branch (39:28): [True: 1.50k, False: 691]
  ------------------
   40|  1.50k|                c = (uint8_t)(c - '0');
   41|    707|            else if(c >= 'a' && c <='f')
  ------------------
  |  Branch (41:21): [True: 685, False: 22]
  |  Branch (41:33): [True: 662, False: 23]
  ------------------
   42|    662|                c = (uint8_t)(c - 'a' + 10);
   43|     45|            else if(c >= 'A' && c <='F')
  ------------------
  |  Branch (43:21): [True: 25, False: 20]
  |  Branch (43:33): [True: 0, False: 25]
  ------------------
   44|      0|                c = (uint8_t)(c - 'A' + 10);
   45|     45|            else
   46|     45|                break;
   47|  2.16k|            n = (n << 4) | (c & 0xF);
   48|  2.16k|            if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (48:16): [True: 7, False: 2.16k]
  ------------------
   49|      7|                return 0;
   50|  2.16k|            prev = n;
   51|  2.16k|        }
   52|    142|        *result = n;
   53|    142|        return (i > 2) ? i : 0; /* 2 -> No digit was parsed */
  ------------------
  |  Branch (53:16): [True: 138, False: 4]
  ------------------
   54|    149|    }
   55|       |
   56|       |    /* Decimal */
   57|  22.3k|    for(; i < size; i++) {
  ------------------
  |  Branch (57:11): [True: 21.1k, False: 1.11k]
  ------------------
   58|  21.1k|        if(str[i] < '0' || str[i] > '9')
  ------------------
  |  Branch (58:12): [True: 465, False: 20.7k]
  |  Branch (58:28): [True: 70, False: 20.6k]
  ------------------
   59|    535|            break;
   60|       |        /* Fast multiplication: n*10 == (n*8) + (n*2) */
   61|  20.6k|        n = (n << 3) + (n << 1) + (uint8_t)(str[i] - '0');
   62|  20.6k|        if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (62:12): [True: 2, False: 20.6k]
  ------------------
   63|      2|            return 0;
   64|  20.6k|        prev = n;
   65|  20.6k|    }
   66|  1.64k|    *result = n;
   67|  1.64k|    return i;
   68|  1.64k|}
parseInt64:
   71|  1.26k|parseInt64(const char *str, size_t size, int64_t *result) {
   72|       |    /* Negative value? */
   73|  1.26k|    size_t i = 0;
   74|  1.26k|    bool neg = false;
   75|  1.26k|    if(*str == '-' || *str == '+') {
  ------------------
  |  Branch (75:8): [True: 597, False: 663]
  |  Branch (75:23): [True: 8, False: 655]
  ------------------
   76|    605|        neg = (*str == '-');
   77|    605|        i++;
   78|    605|    }
   79|       |
   80|       |    /* Parse as unsigned */
   81|  1.26k|    uint64_t n = 0;
   82|  1.26k|    size_t len = parseUInt64(&str[i], size - i, &n);
   83|  1.26k|    if(len == 0)
  ------------------
  |  Branch (83:8): [True: 83, False: 1.17k]
  ------------------
   84|     83|        return 0;
   85|       |
   86|       |    /* Check for overflow, adjust and return */
   87|  1.17k|    if(!neg) {
  ------------------
  |  Branch (87:8): [True: 591, False: 586]
  ------------------
   88|    591|        if(n > 9223372036854775807UL)
  ------------------
  |  Branch (88:12): [True: 69, False: 522]
  ------------------
   89|     69|            return 0;
   90|    522|        *result = (int64_t)n;
   91|    586|    } else {
   92|    586|        if(n > 9223372036854775808UL)
  ------------------
  |  Branch (92:12): [True: 6, False: 580]
  ------------------
   93|      6|            return 0;
   94|    580|        *result = -(int64_t)n;
   95|    580|    }
   96|  1.10k|    return len + i;
   97|  1.17k|}
parseDouble:
   99|  1.23k|size_t parseDouble(const char *str, size_t size, double *result) {
  100|  1.23k|    char buf[2000];
  101|  1.23k|    if(size >= 2000)
  ------------------
  |  Branch (101:8): [True: 0, False: 1.23k]
  ------------------
  102|      0|        return 0;
  103|  1.23k|    memcpy(buf, str, size);
  104|  1.23k|    buf[size] = 0;
  105|  1.23k|    errno = 0;
  106|  1.23k|    char *endptr;
  107|  1.23k|    *result = strtod(buf, &endptr);
  108|  1.23k|    if(errno != 0 && errno != ERANGE)
  ------------------
  |  Branch (108:8): [True: 351, False: 883]
  |  Branch (108:22): [True: 0, False: 351]
  ------------------
  109|      0|        return 0;
  110|  1.23k|    return (uintptr_t)endptr - (uintptr_t)buf;
  111|  1.23k|}

yxml_init:
  301|  8.08k|void yxml_init(yxml_t *x, void *stack, size_t stacksize) {
  302|  8.08k|	memset(x, 0, sizeof(*x));
  303|  8.08k|	x->line = 1;
  304|  8.08k|	x->stack = (unsigned char*)stack;
  305|  8.08k|	x->stacksize = stacksize;
  306|  8.08k|	*x->stack = 0;
  307|  8.08k|	x->elem = x->pi = x->attr = (char *)x->stack;
  308|  8.08k|	x->state = YXMLS_init;
  309|  8.08k|}
yxml_parse:
  311|   127M|yxml_ret_t yxml_parse(yxml_t *x, int _ch) {
  312|       |	/* Ensure that characters are in the range of 0..255 rather than -126..125.
  313|       |	 * All character comparisons are done with positive integers. */
  314|   127M|	unsigned ch = (unsigned)(_ch+256) & 0xff;
  315|   127M|	if(!ch)
  ------------------
  |  Branch (315:5): [True: 4, False: 127M]
  ------------------
  316|      4|		return YXML_ESYN;
  317|   127M|	x->total++;
  318|       |
  319|       |	/* End-of-Line normalization, "\rX", "\r\n" and "\n" are recognized and
  320|       |	 * normalized to a single '\n' as per XML 1.0 section 2.11. XML 1.1 adds
  321|       |	 * some non-ASCII character sequences to this list, but we can only handle
  322|       |	 * ASCII here without making assumptions about the input encoding. */
  323|   127M|	if(x->ignore == ch) {
  ------------------
  |  Branch (323:5): [True: 1.07k, False: 127M]
  ------------------
  324|  1.07k|		x->ignore = 0;
  325|  1.07k|		return YXML_OK;
  326|  1.07k|	}
  327|   127M|	x->ignore = (ch == 0xd) * 0xa;
  328|   127M|	if(ch == 0xa || ch == 0xd) {
  ------------------
  |  Branch (328:5): [True: 12.1k, False: 127M]
  |  Branch (328:18): [True: 4.30M, False: 123M]
  ------------------
  329|  4.31M|		ch = 0xa;
  330|  4.31M|		x->line++;
  331|  4.31M|		x->byte = 0;
  332|  4.31M|	}
  333|   127M|	x->byte++;
  334|       |
  335|   127M|	switch((yxml_state_t)x->state) {
  ------------------
  |  Branch (335:9): [True: 127M, False: 0]
  ------------------
  336|  12.3k|	case YXMLS_string:
  ------------------
  |  Branch (336:2): [True: 12.3k, False: 127M]
  ------------------
  337|  12.3k|		if(ch == *x->string) {
  ------------------
  |  Branch (337:6): [True: 12.3k, False: 11]
  ------------------
  338|  12.3k|			x->string++;
  339|  12.3k|			if(!*x->string)
  ------------------
  |  Branch (339:7): [True: 2.31k, False: 10.0k]
  ------------------
  340|  2.31k|				x->state = x->nextstate;
  341|  12.3k|			return YXML_OK;
  342|  12.3k|		}
  343|     11|		break;
  344|  40.6M|	case YXMLS_attr0:
  ------------------
  |  Branch (344:2): [True: 40.6M, False: 87.0M]
  ------------------
  345|  40.6M|		if(yxml_isName(ch))
  ------------------
  |  |  107|  40.6M|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|  81.3M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  81.3M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 3.11M, False: 37.5M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 609, False: 37.5M]
  |  |  |  |  |  Branch (106:61): [True: 262, False: 37.5M]
  |  |  |  |  |  Branch (106:73): [True: 33.3M, False: 4.20M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|  44.8M|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 66.2k, False: 4.13M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 965, False: 4.13M]
  |  |  |  Branch (107:77): [True: 1.08k, False: 4.13M]
  |  |  ------------------
  ------------------
  346|  36.5M|			return yxml_attrname(x, ch);
  347|  4.13M|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  4.13M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 3.09M, False: 1.04M]
  |  |  |  Branch (101:36): [True: 220, False: 1.04M]
  |  |  |  Branch (101:49): [True: 776, False: 1.04M]
  |  |  ------------------
  ------------------
  348|  3.09M|			x->state = YXMLS_attr1;
  349|  3.09M|			return yxml_attrnameend(x, ch);
  350|  3.09M|		}
  351|  1.04M|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (351:6): [True: 1.04M, False: 27]
  ------------------
  352|  1.04M|			x->state = YXMLS_attr2;
  353|  1.04M|			return yxml_attrnameend(x, ch);
  354|  1.04M|		}
  355|     27|		break;
  356|  3.09M|	case YXMLS_attr1:
  ------------------
  |  Branch (356:2): [True: 3.09M, False: 124M]
  ------------------
  357|  3.09M|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  3.09M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 221, False: 3.09M]
  |  |  |  Branch (101:36): [True: 194, False: 3.09M]
  |  |  |  Branch (101:49): [True: 194, False: 3.09M]
  |  |  ------------------
  ------------------
  358|    609|			return YXML_OK;
  359|  3.09M|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (359:6): [True: 3.09M, False: 15]
  ------------------
  360|  3.09M|			x->state = YXMLS_attr2;
  361|  3.09M|			return YXML_OK;
  362|  3.09M|		}
  363|     15|		break;
  364|  4.13M|	case YXMLS_attr2:
  ------------------
  |  Branch (364:2): [True: 4.13M, False: 123M]
  ------------------
  365|  4.13M|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  4.13M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 242, False: 4.13M]
  |  |  |  Branch (101:36): [True: 219, False: 4.13M]
  |  |  |  Branch (101:49): [True: 223, False: 4.13M]
  |  |  ------------------
  ------------------
  366|    684|			return YXML_OK;
  367|  4.13M|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (367:6): [True: 1.04M, False: 3.09M]
  |  Branch (367:35): [True: 3.09M, False: 18]
  ------------------
  368|  4.13M|			x->state = YXMLS_attr3;
  369|  4.13M|			x->quote = ch;
  370|  4.13M|			return YXML_OK;
  371|  4.13M|		}
  372|     18|		break;
  373|  4.46M|	case YXMLS_attr3:
  ------------------
  |  Branch (373:2): [True: 4.46M, False: 123M]
  ------------------
  374|  4.46M|		if(yxml_isAttValue(ch))
  ------------------
  |  |  109|  4.46M|#define yxml_isAttValue(c) (yxml_isChar(c) && c != x->quote && c != '<' && c != '&')
  |  |  ------------------
  |  |  |  |   99|  8.92M|#define yxml_isChar(c) 1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:24): [True: 4.46M, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (109:47): [True: 328k, False: 4.13M]
  |  |  |  Branch (109:64): [True: 328k, False: 1]
  |  |  |  Branch (109:76): [True: 327k, False: 803]
  |  |  ------------------
  ------------------
  375|   327k|			return yxml_dataattr(x, ch);
  376|  4.13M|		if(ch == (unsigned char)'&') {
  ------------------
  |  Branch (376:6): [True: 803, False: 4.13M]
  ------------------
  377|    803|			x->state = YXMLS_attr4;
  378|    803|			return yxml_refstart(x, ch);
  379|    803|		}
  380|  4.13M|		if(x->quote == ch) {
  ------------------
  |  Branch (380:6): [True: 4.13M, False: 1]
  ------------------
  381|  4.13M|			x->state = YXMLS_elem2;
  382|  4.13M|			return yxml_attrvalend(x, ch);
  383|  4.13M|		}
  384|      1|		break;
  385|  3.23k|	case YXMLS_attr4:
  ------------------
  |  Branch (385:2): [True: 3.23k, False: 127M]
  ------------------
  386|  3.23k|		if(yxml_isRef(ch))
  ------------------
  |  |  113|  3.23k|#define yxml_isRef(c) (yxml_isNum(c) || yxml_isAlpha(c) || c == '#')
  |  |  ------------------
  |  |  |  |  103|  6.47k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 746, False: 2.48k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isRef(c) (yxml_isNum(c) || yxml_isAlpha(c) || c == '#')
  |  |  ------------------
  |  |  |  |  102|  5.72k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 1.22k, False: 1.26k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (113:60): [True: 501, False: 763]
  |  |  ------------------
  ------------------
  387|  2.47k|			return yxml_ref(x, ch);
  388|    763|		if(ch == (unsigned char)'\x3b') {
  ------------------
  |  Branch (388:6): [True: 750, False: 13]
  ------------------
  389|    750|			x->state = YXMLS_attr3;
  390|    750|			return yxml_refattrval(x, ch);
  391|    750|		}
  392|     13|		break;
  393|  5.33k|	case YXMLS_cd0:
  ------------------
  |  Branch (393:2): [True: 5.33k, False: 127M]
  ------------------
  394|  5.33k|		if(ch == (unsigned char)']') {
  ------------------
  |  Branch (394:6): [True: 909, False: 4.43k]
  ------------------
  395|    909|			x->state = YXMLS_cd1;
  396|    909|			return YXML_OK;
  397|    909|		}
  398|  4.43k|		if(yxml_isChar(ch))
  ------------------
  |  |   99|  4.43k|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 4.43k, Folded]
  |  |  ------------------
  ------------------
  399|  4.43k|			return yxml_datacontent(x, ch);
  400|      0|		break;
  401|    903|	case YXMLS_cd1:
  ------------------
  |  Branch (401:2): [True: 903, False: 127M]
  ------------------
  402|    903|		if(ch == (unsigned char)']') {
  ------------------
  |  Branch (402:6): [True: 653, False: 250]
  ------------------
  403|    653|			x->state = YXMLS_cd2;
  404|    653|			return YXML_OK;
  405|    653|		}
  406|    250|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    250|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 250, Folded]
  |  |  ------------------
  ------------------
  407|    250|			x->state = YXMLS_cd0;
  408|    250|			return yxml_datacd1(x, ch);
  409|    250|		}
  410|      0|		break;
  411|    993|	case YXMLS_cd2:
  ------------------
  |  Branch (411:2): [True: 993, False: 127M]
  ------------------
  412|    993|		if(ch == (unsigned char)']')
  ------------------
  |  Branch (412:6): [True: 354, False: 639]
  ------------------
  413|    354|			return yxml_datacontent(x, ch);
  414|    639|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (414:6): [True: 299, False: 340]
  ------------------
  415|    299|			x->state = YXMLS_misc2;
  416|    299|			return YXML_OK;
  417|    299|		}
  418|    340|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    340|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 340, Folded]
  |  |  ------------------
  ------------------
  419|    340|			x->state = YXMLS_cd0;
  420|    340|			return yxml_datacd2(x, ch);
  421|    340|		}
  422|      0|		break;
  423|    217|	case YXMLS_comment0:
  ------------------
  |  Branch (423:2): [True: 217, False: 127M]
  ------------------
  424|    217|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (424:6): [True: 207, False: 10]
  ------------------
  425|    207|			x->state = YXMLS_comment1;
  426|    207|			return YXML_OK;
  427|    207|		}
  428|     10|		break;
  429|  1.09k|	case YXMLS_comment1:
  ------------------
  |  Branch (429:2): [True: 1.09k, False: 127M]
  ------------------
  430|  1.09k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (430:6): [True: 1.08k, False: 11]
  ------------------
  431|  1.08k|			x->state = YXMLS_comment2;
  432|  1.08k|			return YXML_OK;
  433|  1.08k|		}
  434|     11|		break;
  435|  1.75k|	case YXMLS_comment2:
  ------------------
  |  Branch (435:2): [True: 1.75k, False: 127M]
  ------------------
  436|  1.75k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (436:6): [True: 1.43k, False: 315]
  ------------------
  437|  1.43k|			x->state = YXMLS_comment3;
  438|  1.43k|			return YXML_OK;
  439|  1.43k|		}
  440|    315|		if(yxml_isChar(ch))
  ------------------
  |  |   99|    315|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 315, Folded]
  |  |  ------------------
  ------------------
  441|    315|			return YXML_OK;
  442|      0|		break;
  443|  1.42k|	case YXMLS_comment3:
  ------------------
  |  Branch (443:2): [True: 1.42k, False: 127M]
  ------------------
  444|  1.42k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (444:6): [True: 1.03k, False: 390]
  ------------------
  445|  1.03k|			x->state = YXMLS_comment4;
  446|  1.03k|			return YXML_OK;
  447|  1.03k|		}
  448|    390|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    390|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 390, Folded]
  |  |  ------------------
  ------------------
  449|    390|			x->state = YXMLS_comment2;
  450|    390|			return YXML_OK;
  451|    390|		}
  452|      0|		break;
  453|  1.03k|	case YXMLS_comment4:
  ------------------
  |  Branch (453:2): [True: 1.03k, False: 127M]
  ------------------
  454|  1.03k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (454:6): [True: 1.02k, False: 9]
  ------------------
  455|  1.02k|			x->state = x->nextstate;
  456|  1.02k|			return YXML_OK;
  457|  1.02k|		}
  458|      9|		break;
  459|  2.66k|	case YXMLS_dt0:
  ------------------
  |  Branch (459:2): [True: 2.66k, False: 127M]
  ------------------
  460|  2.66k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (460:6): [True: 314, False: 2.35k]
  ------------------
  461|    314|			x->state = YXMLS_misc1;
  462|    314|			return YXML_OK;
  463|    314|		}
  464|  2.35k|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (464:6): [True: 345, False: 2.00k]
  |  Branch (464:35): [True: 346, False: 1.66k]
  ------------------
  465|    691|			x->state = YXMLS_dt1;
  466|    691|			x->quote = ch;
  467|    691|			x->nextstate = YXMLS_dt0;
  468|    691|			return YXML_OK;
  469|    691|		}
  470|  1.66k|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (470:6): [True: 762, False: 900]
  ------------------
  471|    762|			x->state = YXMLS_dt2;
  472|    762|			return YXML_OK;
  473|    762|		}
  474|    900|		if(yxml_isChar(ch))
  ------------------
  |  |   99|    900|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 900, Folded]
  |  |  ------------------
  ------------------
  475|    900|			return YXML_OK;
  476|      0|		break;
  477|  1.23k|	case YXMLS_dt1:
  ------------------
  |  Branch (477:2): [True: 1.23k, False: 127M]
  ------------------
  478|  1.23k|		if(x->quote == ch) {
  ------------------
  |  Branch (478:6): [True: 1.03k, False: 202]
  ------------------
  479|  1.03k|			x->state = x->nextstate;
  480|  1.03k|			return YXML_OK;
  481|  1.03k|		}
  482|    202|		if(yxml_isChar(ch))
  ------------------
  |  |   99|    202|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 202, Folded]
  |  |  ------------------
  ------------------
  483|    202|			return YXML_OK;
  484|      0|		break;
  485|    756|	case YXMLS_dt2:
  ------------------
  |  Branch (485:2): [True: 756, False: 127M]
  ------------------
  486|    756|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (486:6): [True: 194, False: 562]
  ------------------
  487|    194|			x->state = YXMLS_pi0;
  488|    194|			x->nextstate = YXMLS_dt0;
  489|    194|			return YXML_OK;
  490|    194|		}
  491|    562|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (491:6): [True: 559, False: 3]
  ------------------
  492|    559|			x->state = YXMLS_dt3;
  493|    559|			return YXML_OK;
  494|    559|		}
  495|      3|		break;
  496|    553|	case YXMLS_dt3:
  ------------------
  |  Branch (496:2): [True: 553, False: 127M]
  ------------------
  497|    553|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (497:6): [True: 194, False: 359]
  ------------------
  498|    194|			x->state = YXMLS_comment1;
  499|    194|			x->nextstate = YXMLS_dt0;
  500|    194|			return YXML_OK;
  501|    194|		}
  502|    359|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    359|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 359, Folded]
  |  |  ------------------
  ------------------
  503|    359|			x->state = YXMLS_dt4;
  504|    359|			return YXML_OK;
  505|    359|		}
  506|      0|		break;
  507|    903|	case YXMLS_dt4:
  ------------------
  |  Branch (507:2): [True: 903, False: 127M]
  ------------------
  508|    903|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (508:6): [True: 194, False: 709]
  |  Branch (508:35): [True: 194, False: 515]
  ------------------
  509|    388|			x->state = YXMLS_dt1;
  510|    388|			x->quote = ch;
  511|    388|			x->nextstate = YXMLS_dt4;
  512|    388|			return YXML_OK;
  513|    388|		}
  514|    515|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (514:6): [True: 311, False: 204]
  ------------------
  515|    311|			x->state = YXMLS_dt0;
  516|    311|			return YXML_OK;
  517|    311|		}
  518|    204|		if(yxml_isChar(ch))
  ------------------
  |  |   99|    204|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 204, Folded]
  |  |  ------------------
  ------------------
  519|    204|			return YXML_OK;
  520|      0|		break;
  521|  11.0M|	case YXMLS_elem0:
  ------------------
  |  Branch (521:2): [True: 11.0M, False: 116M]
  ------------------
  522|  11.0M|		if(yxml_isName(ch))
  ------------------
  |  |  107|  11.0M|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|  22.1M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  22.1M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 350k, False: 10.7M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 616, False: 10.7M]
  |  |  |  |  |  Branch (106:61): [True: 2.12k, False: 10.7M]
  |  |  |  |  |  Branch (106:73): [True: 141k, False: 10.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|  21.6M|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 8.91k, False: 10.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 631, False: 10.5M]
  |  |  |  Branch (107:77): [True: 1.99k, False: 10.5M]
  |  |  ------------------
  ------------------
  523|   506k|			return yxml_elemname(x, ch);
  524|  10.5M|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  10.5M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 811, False: 10.5M]
  |  |  |  Branch (101:36): [True: 410, False: 10.5M]
  |  |  |  Branch (101:49): [True: 1.68k, False: 10.5M]
  |  |  ------------------
  ------------------
  525|  2.90k|			x->state = YXMLS_elem1;
  526|  2.90k|			return yxml_elemnameend(x, ch);
  527|  2.90k|		}
  528|  10.5M|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (528:6): [True: 10.5M, False: 36.0k]
  ------------------
  529|  10.5M|			x->state = YXMLS_elem3;
  530|  10.5M|			return yxml_elemnameend(x, ch);
  531|  10.5M|		}
  532|  36.0k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (532:6): [True: 36.0k, False: 27]
  ------------------
  533|  36.0k|			x->state = YXMLS_misc2;
  534|  36.0k|			return yxml_elemnameend(x, ch);
  535|  36.0k|		}
  536|     27|		break;
  537|  4.13M|	case YXMLS_elem1:
  ------------------
  |  Branch (537:2): [True: 4.13M, False: 123M]
  ------------------
  538|  4.13M|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  4.13M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 2.13k, False: 4.13M]
  |  |  |  Branch (101:36): [True: 298, False: 4.13M]
  |  |  |  Branch (101:49): [True: 347, False: 4.13M]
  |  |  ------------------
  ------------------
  539|  2.77k|			return YXML_OK;
  540|  4.13M|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (540:6): [True: 856, False: 4.13M]
  ------------------
  541|    856|			x->state = YXMLS_elem3;
  542|    856|			return YXML_OK;
  543|    856|		}
  544|  4.13M|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (544:6): [True: 434, False: 4.13M]
  ------------------
  545|    434|			x->state = YXMLS_misc2;
  546|    434|			return YXML_OK;
  547|    434|		}
  548|  4.13M|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  4.13M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  8.26M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 1.54M, False: 2.58M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 737, False: 2.58M]
  |  |  |  Branch (106:61): [True: 611, False: 2.58M]
  |  |  |  Branch (106:73): [True: 2.58M, False: 27]
  |  |  ------------------
  ------------------
  549|  4.13M|			x->state = YXMLS_attr0;
  550|  4.13M|			return yxml_attrstart(x, ch);
  551|  4.13M|		}
  552|     27|		break;
  553|  4.13M|	case YXMLS_elem2:
  ------------------
  |  Branch (553:2): [True: 4.13M, False: 123M]
  ------------------
  554|  4.13M|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  4.13M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 1.03M, False: 3.09M]
  |  |  |  Branch (101:36): [True: 582, False: 3.09M]
  |  |  |  Branch (101:49): [True: 3.09M, False: 1.05k]
  |  |  ------------------
  ------------------
  555|  4.13M|			x->state = YXMLS_elem1;
  556|  4.13M|			return YXML_OK;
  557|  4.13M|		}
  558|  1.05k|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (558:6): [True: 827, False: 228]
  ------------------
  559|    827|			x->state = YXMLS_elem3;
  560|    827|			return YXML_OK;
  561|    827|		}
  562|    228|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (562:6): [True: 212, False: 16]
  ------------------
  563|    212|			x->state = YXMLS_misc2;
  564|    212|			return YXML_OK;
  565|    212|		}
  566|     16|		break;
  567|  10.5M|	case YXMLS_elem3:
  ------------------
  |  Branch (567:2): [True: 10.5M, False: 117M]
  ------------------
  568|  10.5M|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (568:6): [True: 10.5M, False: 5]
  ------------------
  569|  10.5M|			x->state = YXMLS_misc2;
  570|  10.5M|			return yxml_selfclose(x, ch);
  571|  10.5M|		}
  572|      5|		break;
  573|    787|	case YXMLS_enc0:
  ------------------
  |  Branch (573:2): [True: 787, False: 127M]
  ------------------
  574|    787|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    787|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 593]
  |  |  |  Branch (101:36): [True: 194, False: 399]
  |  |  |  Branch (101:49): [True: 194, False: 205]
  |  |  ------------------
  ------------------
  575|    582|			return YXML_OK;
  576|    205|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (576:6): [True: 190, False: 15]
  ------------------
  577|    190|			x->state = YXMLS_enc1;
  578|    190|			return YXML_OK;
  579|    190|		}
  580|     15|		break;
  581|    747|	case YXMLS_enc1:
  ------------------
  |  Branch (581:2): [True: 747, False: 127M]
  ------------------
  582|    747|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    747|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 553]
  |  |  |  Branch (101:36): [True: 194, False: 359]
  |  |  |  Branch (101:49): [True: 194, False: 165]
  |  |  ------------------
  ------------------
  583|    582|			return YXML_OK;
  584|    165|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (584:6): [True: 35, False: 130]
  |  Branch (584:35): [True: 115, False: 15]
  ------------------
  585|    150|			x->state = YXMLS_enc2;
  586|    150|			x->quote = ch;
  587|    150|			return YXML_OK;
  588|    150|		}
  589|     15|		break;
  590|    148|	case YXMLS_enc2:
  ------------------
  |  Branch (590:2): [True: 148, False: 127M]
  ------------------
  591|    148|		if(yxml_isAlpha(ch)) {
  ------------------
  |  |  102|    148|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  ------------------
  |  |  |  Branch (102:25): [True: 140, False: 8]
  |  |  ------------------
  ------------------
  592|    140|			x->state = YXMLS_enc3;
  593|    140|			return YXML_OK;
  594|    140|		}
  595|      8|		break;
  596|  1.07k|	case YXMLS_enc3:
  ------------------
  |  Branch (596:2): [True: 1.07k, False: 127M]
  ------------------
  597|  1.07k|		if(yxml_isEncName(ch))
  ------------------
  |  |  105|  1.07k|#define yxml_isEncName(c) (yxml_isAlpha(c) || yxml_isNum(c) || c == '.' || c == '_' || c == '-')
  |  |  ------------------
  |  |  |  |  102|  2.15k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 201, False: 874]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isEncName(c) (yxml_isAlpha(c) || yxml_isNum(c) || c == '.' || c == '_' || c == '-')
  |  |  ------------------
  |  |  |  |  103|  1.94k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 197, False: 677]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:64): [True: 194, False: 483]
  |  |  |  Branch (105:76): [True: 194, False: 289]
  |  |  |  Branch (105:88): [True: 197, False: 92]
  |  |  ------------------
  ------------------
  598|    983|			return YXML_OK;
  599|     92|		if(x->quote == ch) {
  ------------------
  |  Branch (599:6): [True: 77, False: 15]
  ------------------
  600|     77|			x->state = YXMLS_xmldecl6;
  601|     77|			return YXML_OK;
  602|     77|		}
  603|     15|		break;
  604|  34.3k|	case YXMLS_etag0:
  ------------------
  |  Branch (604:2): [True: 34.3k, False: 127M]
  ------------------
  605|  34.3k|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  34.3k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  68.7k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 11.0k, False: 23.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 607, False: 22.6k]
  |  |  |  Branch (106:61): [True: 560, False: 22.1k]
  |  |  |  Branch (106:73): [True: 22.1k, False: 15]
  |  |  ------------------
  ------------------
  606|  34.3k|			x->state = YXMLS_etag1;
  607|  34.3k|			return yxml_elemclose(x, ch);
  608|  34.3k|		}
  609|     15|		break;
  610|  81.7k|	case YXMLS_etag1:
  ------------------
  |  Branch (610:2): [True: 81.7k, False: 127M]
  ------------------
  611|  81.7k|		if(yxml_isName(ch))
  ------------------
  |  |  107|  81.7k|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|   163k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|   163k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 42.0k, False: 39.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 194, False: 39.4k]
  |  |  |  |  |  Branch (106:61): [True: 477, False: 38.9k]
  |  |  |  |  |  Branch (106:73): [True: 336, False: 38.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|   120k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 4.01k, False: 34.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 196, False: 34.4k]
  |  |  |  Branch (107:77): [True: 194, False: 34.2k]
  |  |  ------------------
  ------------------
  612|  47.4k|			return yxml_elemclose(x, ch);
  613|  34.2k|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  34.2k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 256, False: 33.9k]
  |  |  |  Branch (101:36): [True: 213, False: 33.7k]
  |  |  |  Branch (101:49): [True: 421, False: 33.3k]
  |  |  ------------------
  ------------------
  614|    890|			x->state = YXMLS_etag2;
  615|    890|			return yxml_elemcloseend(x, ch);
  616|    890|		}
  617|  33.3k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (617:6): [True: 33.3k, False: 20]
  ------------------
  618|  33.3k|			x->state = YXMLS_misc2;
  619|  33.3k|			return yxml_elemcloseend(x, ch);
  620|  33.3k|		}
  621|     20|		break;
  622|  1.47k|	case YXMLS_etag2:
  ------------------
  |  Branch (622:2): [True: 1.47k, False: 127M]
  ------------------
  623|  1.47k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.47k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 195, False: 1.27k]
  |  |  |  Branch (101:36): [True: 194, False: 1.08k]
  |  |  |  Branch (101:49): [True: 240, False: 841]
  |  |  ------------------
  ------------------
  624|    629|			return YXML_OK;
  625|    841|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (625:6): [True: 827, False: 14]
  ------------------
  626|    827|			x->state = YXMLS_misc2;
  627|    827|			return YXML_OK;
  628|    827|		}
  629|     14|		break;
  630|  8.08k|	case YXMLS_init:
  ------------------
  |  Branch (630:2): [True: 8.08k, False: 127M]
  ------------------
  631|  8.08k|		if(ch == (unsigned char)'\xef') {
  ------------------
  |  Branch (631:6): [True: 17, False: 8.06k]
  ------------------
  632|     17|			x->state = YXMLS_string;
  633|     17|			x->nextstate = YXMLS_misc0;
  634|     17|			x->string = (unsigned char *)"\xbb\xbf";
  635|     17|			return YXML_OK;
  636|     17|		}
  637|  8.06k|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  8.06k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 25, False: 8.04k]
  |  |  |  Branch (101:36): [True: 33, False: 8.00k]
  |  |  |  Branch (101:49): [True: 46, False: 7.96k]
  |  |  ------------------
  ------------------
  638|    104|			x->state = YXMLS_misc0;
  639|    104|			return YXML_OK;
  640|    104|		}
  641|  7.96k|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (641:6): [True: 7.93k, False: 29]
  ------------------
  642|  7.93k|			x->state = YXMLS_le0;
  643|  7.93k|			return YXML_OK;
  644|  7.93k|		}
  645|     29|		break;
  646|  7.97k|	case YXMLS_le0:
  ------------------
  |  Branch (646:2): [True: 7.97k, False: 127M]
  ------------------
  647|  7.97k|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (647:6): [True: 295, False: 7.67k]
  ------------------
  648|    295|			x->state = YXMLS_lee1;
  649|    295|			return YXML_OK;
  650|    295|		}
  651|  7.67k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (651:6): [True: 1.32k, False: 6.35k]
  ------------------
  652|  1.32k|			x->state = YXMLS_leq0;
  653|  1.32k|			return YXML_OK;
  654|  1.32k|		}
  655|  6.35k|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  6.35k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  12.7k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 1.83k, False: 4.52k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 97, False: 4.42k]
  |  |  |  Branch (106:61): [True: 111, False: 4.31k]
  |  |  |  Branch (106:73): [True: 4.29k, False: 23]
  |  |  ------------------
  ------------------
  656|  6.33k|			x->state = YXMLS_elem0;
  657|  6.33k|			return yxml_elemstart(x, ch);
  658|  6.33k|		}
  659|     23|		break;
  660|  2.29k|	case YXMLS_le1:
  ------------------
  |  Branch (660:2): [True: 2.29k, False: 127M]
  ------------------
  661|  2.29k|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (661:6): [True: 733, False: 1.55k]
  ------------------
  662|    733|			x->state = YXMLS_lee1;
  663|    733|			return YXML_OK;
  664|    733|		}
  665|  1.55k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (665:6): [True: 1.32k, False: 229]
  ------------------
  666|  1.32k|			x->state = YXMLS_pi0;
  667|  1.32k|			x->nextstate = YXMLS_misc1;
  668|  1.32k|			return YXML_OK;
  669|  1.32k|		}
  670|    229|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|    229|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|    458|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 13, False: 216]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 4, False: 212]
  |  |  |  Branch (106:61): [True: 31, False: 181]
  |  |  |  Branch (106:73): [True: 166, False: 15]
  |  |  ------------------
  ------------------
  671|    214|			x->state = YXMLS_elem0;
  672|    214|			return yxml_elemstart(x, ch);
  673|    214|		}
  674|     15|		break;
  675|  10.6M|	case YXMLS_le2:
  ------------------
  |  Branch (675:2): [True: 10.6M, False: 117M]
  ------------------
  676|  10.6M|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (676:6): [True: 590, False: 10.6M]
  ------------------
  677|    590|			x->state = YXMLS_lee2;
  678|    590|			return YXML_OK;
  679|    590|		}
  680|  10.6M|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (680:6): [True: 1.39k, False: 10.6M]
  ------------------
  681|  1.39k|			x->state = YXMLS_pi0;
  682|  1.39k|			x->nextstate = YXMLS_misc2;
  683|  1.39k|			return YXML_OK;
  684|  1.39k|		}
  685|  10.6M|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (685:6): [True: 34.3k, False: 10.5M]
  ------------------
  686|  34.3k|			x->state = YXMLS_etag0;
  687|  34.3k|			return YXML_OK;
  688|  34.3k|		}
  689|  10.5M|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  10.5M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  21.1M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 32.4k, False: 10.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 1.01k, False: 10.5M]
  |  |  |  Branch (106:61): [True: 1.11k, False: 10.5M]
  |  |  |  Branch (106:73): [True: 10.5M, False: 25]
  |  |  ------------------
  ------------------
  690|  10.5M|			x->state = YXMLS_elem0;
  691|  10.5M|			return yxml_elemstart(x, ch);
  692|  10.5M|		}
  693|     25|		break;
  694|    668|	case YXMLS_le3:
  ------------------
  |  Branch (694:2): [True: 668, False: 127M]
  ------------------
  695|    668|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (695:6): [True: 222, False: 446]
  ------------------
  696|    222|			x->state = YXMLS_comment0;
  697|    222|			x->nextstate = YXMLS_misc3;
  698|    222|			return YXML_OK;
  699|    222|		}
  700|    446|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (700:6): [True: 430, False: 16]
  ------------------
  701|    430|			x->state = YXMLS_pi0;
  702|    430|			x->nextstate = YXMLS_misc3;
  703|    430|			return YXML_OK;
  704|    430|		}
  705|     16|		break;
  706|  1.02k|	case YXMLS_lee1:
  ------------------
  |  Branch (706:2): [True: 1.02k, False: 127M]
  ------------------
  707|  1.02k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (707:6): [True: 519, False: 501]
  ------------------
  708|    519|			x->state = YXMLS_comment1;
  709|    519|			x->nextstate = YXMLS_misc1;
  710|    519|			return YXML_OK;
  711|    519|		}
  712|    501|		if(ch == (unsigned char)'D') {
  ------------------
  |  Branch (712:6): [True: 486, False: 15]
  ------------------
  713|    486|			x->state = YXMLS_string;
  714|    486|			x->nextstate = YXMLS_dt0;
  715|    486|			x->string = (unsigned char *)"OCTYPE";
  716|    486|			return YXML_OK;
  717|    486|		}
  718|     15|		break;
  719|    585|	case YXMLS_lee2:
  ------------------
  |  Branch (719:2): [True: 585, False: 127M]
  ------------------
  720|    585|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (720:6): [True: 207, False: 378]
  ------------------
  721|    207|			x->state = YXMLS_comment1;
  722|    207|			x->nextstate = YXMLS_misc2;
  723|    207|			return YXML_OK;
  724|    207|		}
  725|    378|		if(ch == (unsigned char)'[') {
  ------------------
  |  Branch (725:6): [True: 367, False: 11]
  ------------------
  726|    367|			x->state = YXMLS_string;
  727|    367|			x->nextstate = YXMLS_cd0;
  728|    367|			x->string = (unsigned char *)"CDATA[";
  729|    367|			return YXML_OK;
  730|    367|		}
  731|     11|		break;
  732|  1.31k|	case YXMLS_leq0:
  ------------------
  |  Branch (732:2): [True: 1.31k, False: 127M]
  ------------------
  733|  1.31k|		if(ch == (unsigned char)'x') {
  ------------------
  |  Branch (733:6): [True: 971, False: 348]
  ------------------
  734|    971|			x->state = YXMLS_xmldecl0;
  735|    971|			x->nextstate = YXMLS_misc1;
  736|    971|			return yxml_pistart(x, ch);
  737|    971|		}
  738|    348|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|    348|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|    696|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 171, False: 177]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 23, False: 154]
  |  |  |  Branch (106:61): [True: 23, False: 131]
  |  |  |  Branch (106:73): [True: 115, False: 16]
  |  |  ------------------
  ------------------
  739|    332|			x->state = YXMLS_pi1;
  740|    332|			x->nextstate = YXMLS_misc1;
  741|    332|			return yxml_pistart(x, ch);
  742|    332|		}
  743|     16|		break;
  744|  1.20k|	case YXMLS_misc0:
  ------------------
  |  Branch (744:2): [True: 1.20k, False: 127M]
  ------------------
  745|  1.20k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.20k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 199, False: 1.00k]
  |  |  |  Branch (101:36): [True: 195, False: 807]
  |  |  |  Branch (101:49): [True: 746, False: 61]
  |  |  ------------------
  ------------------
  746|  1.14k|			return YXML_OK;
  747|     61|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (747:6): [True: 40, False: 21]
  ------------------
  748|     40|			x->state = YXMLS_le0;
  749|     40|			return YXML_OK;
  750|     40|		}
  751|     21|		break;
  752|  2.90k|	case YXMLS_misc1:
  ------------------
  |  Branch (752:2): [True: 2.90k, False: 127M]
  ------------------
  753|  2.90k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  2.90k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 195, False: 2.71k]
  |  |  |  Branch (101:36): [True: 194, False: 2.52k]
  |  |  |  Branch (101:49): [True: 206, False: 2.31k]
  |  |  ------------------
  ------------------
  754|    595|			return YXML_OK;
  755|  2.31k|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (755:6): [True: 2.29k, False: 15]
  ------------------
  756|  2.29k|			x->state = YXMLS_le1;
  757|  2.29k|			return YXML_OK;
  758|  2.29k|		}
  759|     15|		break;
  760|  34.4M|	case YXMLS_misc2:
  ------------------
  |  Branch (760:2): [True: 34.4M, False: 93.1M]
  ------------------
  761|  34.4M|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (761:6): [True: 10.6M, False: 23.8M]
  ------------------
  762|  10.6M|			x->state = YXMLS_le2;
  763|  10.6M|			return YXML_OK;
  764|  10.6M|		}
  765|  23.8M|		if(ch == (unsigned char)'&') {
  ------------------
  |  Branch (765:6): [True: 2.53k, False: 23.8M]
  ------------------
  766|  2.53k|			x->state = YXMLS_misc2a;
  767|  2.53k|			return yxml_refstart(x, ch);
  768|  2.53k|		}
  769|  23.8M|		if(yxml_isChar(ch))
  ------------------
  |  |   99|  23.8M|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 23.8M, Folded]
  |  |  ------------------
  ------------------
  770|  23.8M|			return yxml_datacontent(x, ch);
  771|      0|		break;
  772|  11.4k|	case YXMLS_misc2a:
  ------------------
  |  Branch (772:2): [True: 11.4k, False: 127M]
  ------------------
  773|  11.4k|		if(yxml_isRef(ch))
  ------------------
  |  |  113|  11.4k|#define yxml_isRef(c) (yxml_isNum(c) || yxml_isAlpha(c) || c == '#')
  |  |  ------------------
  |  |  |  |  103|  22.9k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 3.10k, False: 8.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isRef(c) (yxml_isNum(c) || yxml_isAlpha(c) || c == '#')
  |  |  ------------------
  |  |  |  |  102|  19.8k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 4.27k, False: 4.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (113:60): [True: 1.58k, False: 2.49k]
  |  |  ------------------
  ------------------
  774|  8.95k|			return yxml_ref(x, ch);
  775|  2.49k|		if(ch == (unsigned char)'\x3b') {
  ------------------
  |  Branch (775:6): [True: 2.47k, False: 19]
  ------------------
  776|  2.47k|			x->state = YXMLS_misc2;
  777|  2.47k|			return yxml_refcontent(x, ch);
  778|  2.47k|		}
  779|     19|		break;
  780|  1.28k|	case YXMLS_misc3:
  ------------------
  |  Branch (780:2): [True: 1.28k, False: 127M]
  ------------------
  781|  1.28k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.28k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 1.08k]
  |  |  |  Branch (101:36): [True: 198, False: 891]
  |  |  |  Branch (101:49): [True: 196, False: 695]
  |  |  ------------------
  ------------------
  782|    588|			return YXML_OK;
  783|    695|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (783:6): [True: 674, False: 21]
  ------------------
  784|    674|			x->state = YXMLS_le3;
  785|    674|			return YXML_OK;
  786|    674|		}
  787|     21|		break;
  788|  3.31k|	case YXMLS_pi0:
  ------------------
  |  Branch (788:2): [True: 3.31k, False: 127M]
  ------------------
  789|  3.31k|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  3.31k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  6.63k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 1.74k, False: 1.57k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 739, False: 835]
  |  |  |  Branch (106:61): [True: 286, False: 549]
  |  |  |  Branch (106:73): [True: 530, False: 19]
  |  |  ------------------
  ------------------
  790|  3.29k|			x->state = YXMLS_pi1;
  791|  3.29k|			return yxml_pistart(x, ch);
  792|  3.29k|		}
  793|     19|		break;
  794|  8.32k|	case YXMLS_pi1:
  ------------------
  |  Branch (794:2): [True: 8.32k, False: 127M]
  ------------------
  795|  8.32k|		if(yxml_isName(ch))
  ------------------
  |  |  107|  8.32k|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|  16.6k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  16.6k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 2.12k, False: 6.19k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 194, False: 6.00k]
  |  |  |  |  |  Branch (106:61): [True: 239, False: 5.76k]
  |  |  |  |  |  Branch (106:73): [True: 1.38k, False: 4.37k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|  12.7k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 301, False: 4.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 195, False: 3.88k]
  |  |  |  Branch (107:77): [True: 212, False: 3.67k]
  |  |  ------------------
  ------------------
  796|  4.65k|			return yxml_piname(x, ch);
  797|  3.67k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (797:6): [True: 2.34k, False: 1.33k]
  ------------------
  798|  2.34k|			x->state = YXMLS_pi4;
  799|  2.34k|			return yxml_pinameend(x, ch);
  800|  2.34k|		}
  801|  1.33k|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  1.33k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 411, False: 919]
  |  |  |  Branch (101:36): [True: 290, False: 629]
  |  |  |  Branch (101:49): [True: 608, False: 21]
  |  |  ------------------
  ------------------
  802|  1.30k|			x->state = YXMLS_pi2;
  803|  1.30k|			return yxml_pinameend(x, ch);
  804|  1.30k|		}
  805|     21|		break;
  806|   122k|	case YXMLS_pi2:
  ------------------
  |  Branch (806:2): [True: 122k, False: 127M]
  ------------------
  807|   122k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (807:6): [True: 1.69k, False: 121k]
  ------------------
  808|  1.69k|			x->state = YXMLS_pi3;
  809|  1.69k|			return YXML_OK;
  810|  1.69k|		}
  811|   121k|		if(yxml_isChar(ch))
  ------------------
  |  |   99|   121k|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 121k, Folded]
  |  |  ------------------
  ------------------
  812|   121k|			return yxml_datapi1(x, ch);
  813|      0|		break;
  814|  1.68k|	case YXMLS_pi3:
  ------------------
  |  Branch (814:2): [True: 1.68k, False: 127M]
  ------------------
  815|  1.68k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (815:6): [True: 1.23k, False: 450]
  ------------------
  816|  1.23k|			x->state = x->nextstate;
  817|  1.23k|			return yxml_pivalend(x, ch);
  818|  1.23k|		}
  819|    450|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    450|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 450, Folded]
  |  |  ------------------
  ------------------
  820|    450|			x->state = YXMLS_pi2;
  821|    450|			return yxml_datapi2(x, ch);
  822|    450|		}
  823|      0|		break;
  824|  2.30k|	case YXMLS_pi4:
  ------------------
  |  Branch (824:2): [True: 2.30k, False: 127M]
  ------------------
  825|  2.30k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (825:6): [True: 2.29k, False: 11]
  ------------------
  826|  2.29k|			x->state = x->nextstate;
  827|  2.29k|			return yxml_pivalend(x, ch);
  828|  2.29k|		}
  829|     11|		break;
  830|    700|	case YXMLS_std0:
  ------------------
  |  Branch (830:2): [True: 700, False: 127M]
  ------------------
  831|    700|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    700|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 506]
  |  |  |  Branch (101:36): [True: 194, False: 312]
  |  |  |  Branch (101:49): [True: 194, False: 118]
  |  |  ------------------
  ------------------
  832|    582|			return YXML_OK;
  833|    118|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (833:6): [True: 101, False: 17]
  ------------------
  834|    101|			x->state = YXMLS_std1;
  835|    101|			return YXML_OK;
  836|    101|		}
  837|     17|		break;
  838|    658|	case YXMLS_std1:
  ------------------
  |  Branch (838:2): [True: 658, False: 127M]
  ------------------
  839|    658|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    658|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 464]
  |  |  |  Branch (101:36): [True: 194, False: 270]
  |  |  |  Branch (101:49): [True: 194, False: 76]
  |  |  ------------------
  ------------------
  840|    582|			return YXML_OK;
  841|     76|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (841:6): [True: 23, False: 53]
  |  Branch (841:35): [True: 41, False: 12]
  ------------------
  842|     64|			x->state = YXMLS_std2;
  843|     64|			x->quote = ch;
  844|     64|			return YXML_OK;
  845|     64|		}
  846|     12|		break;
  847|     62|	case YXMLS_std2:
  ------------------
  |  Branch (847:2): [True: 62, False: 127M]
  ------------------
  848|     62|		if(ch == (unsigned char)'y') {
  ------------------
  |  Branch (848:6): [True: 3, False: 59]
  ------------------
  849|      3|			x->state = YXMLS_string;
  850|      3|			x->nextstate = YXMLS_std3;
  851|      3|			x->string = (unsigned char *)"es";
  852|      3|			return YXML_OK;
  853|      3|		}
  854|     59|		if(ch == (unsigned char)'n') {
  ------------------
  |  Branch (854:6): [True: 46, False: 13]
  ------------------
  855|     46|			x->state = YXMLS_string;
  856|     46|			x->nextstate = YXMLS_std3;
  857|     46|			x->string = (unsigned char *)"o";
  858|     46|			return YXML_OK;
  859|     46|		}
  860|     13|		break;
  861|     46|	case YXMLS_std3:
  ------------------
  |  Branch (861:2): [True: 46, False: 127M]
  ------------------
  862|     46|		if(x->quote == ch) {
  ------------------
  |  Branch (862:6): [True: 45, False: 1]
  ------------------
  863|     45|			x->state = YXMLS_xmldecl8;
  864|     45|			return YXML_OK;
  865|     45|		}
  866|      1|		break;
  867|  1.13k|	case YXMLS_ver0:
  ------------------
  |  Branch (867:2): [True: 1.13k, False: 127M]
  ------------------
  868|  1.13k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.13k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 936]
  |  |  |  Branch (101:36): [True: 194, False: 742]
  |  |  |  Branch (101:49): [True: 194, False: 548]
  |  |  ------------------
  ------------------
  869|    582|			return YXML_OK;
  870|    548|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (870:6): [True: 538, False: 10]
  ------------------
  871|    538|			x->state = YXMLS_ver1;
  872|    538|			return YXML_OK;
  873|    538|		}
  874|     10|		break;
  875|  1.09k|	case YXMLS_ver1:
  ------------------
  |  Branch (875:2): [True: 1.09k, False: 127M]
  ------------------
  876|  1.09k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.09k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 196, False: 901]
  |  |  |  Branch (101:36): [True: 194, False: 707]
  |  |  |  Branch (101:49): [True: 194, False: 513]
  |  |  ------------------
  ------------------
  877|    584|			return YXML_OK;
  878|    513|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (878:6): [True: 5, False: 508]
  |  Branch (878:35): [True: 489, False: 19]
  ------------------
  879|    494|			x->state = YXMLS_string;
  880|    494|			x->quote = ch;
  881|    494|			x->nextstate = YXMLS_ver2;
  882|    494|			x->string = (unsigned char *)"1.";
  883|    494|			return YXML_OK;
  884|    494|		}
  885|     19|		break;
  886|    491|	case YXMLS_ver2:
  ------------------
  |  Branch (886:2): [True: 491, False: 127M]
  ------------------
  887|    491|		if(yxml_isNum(ch)) {
  ------------------
  |  |  103|    491|#define yxml_isNum(c) (c-'0' < 10)
  |  |  ------------------
  |  |  |  Branch (103:23): [True: 479, False: 12]
  |  |  ------------------
  ------------------
  888|    479|			x->state = YXMLS_ver3;
  889|    479|			return YXML_OK;
  890|    479|		}
  891|     12|		break;
  892|    663|	case YXMLS_ver3:
  ------------------
  |  Branch (892:2): [True: 663, False: 127M]
  ------------------
  893|    663|		if(yxml_isNum(ch))
  ------------------
  |  |  103|    663|#define yxml_isNum(c) (c-'0' < 10)
  |  |  ------------------
  |  |  |  Branch (103:23): [True: 197, False: 466]
  |  |  ------------------
  ------------------
  894|    197|			return YXML_OK;
  895|    466|		if(x->quote == ch) {
  ------------------
  |  Branch (895:6): [True: 454, False: 12]
  ------------------
  896|    454|			x->state = YXMLS_xmldecl4;
  897|    454|			return YXML_OK;
  898|    454|		}
  899|     12|		break;
  900|    970|	case YXMLS_xmldecl0:
  ------------------
  |  Branch (900:2): [True: 970, False: 127M]
  ------------------
  901|    970|		if(ch == (unsigned char)'m') {
  ------------------
  |  Branch (901:6): [True: 855, False: 115]
  ------------------
  902|    855|			x->state = YXMLS_xmldecl1;
  903|    855|			return yxml_piname(x, ch);
  904|    855|		}
  905|    115|		if(yxml_isName(ch)) {
  ------------------
  |  |  107|    115|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|    230|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    230|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 24, False: 91]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 4, False: 87]
  |  |  |  |  |  Branch (106:61): [True: 3, False: 84]
  |  |  |  |  |  Branch (106:73): [True: 14, False: 70]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|    185|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 6, False: 64]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 3, False: 61]
  |  |  |  Branch (107:77): [True: 4, False: 57]
  |  |  ------------------
  ------------------
  906|     58|			x->state = YXMLS_pi1;
  907|     58|			return yxml_piname(x, ch);
  908|     58|		}
  909|     57|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (909:6): [True: 18, False: 39]
  ------------------
  910|     18|			x->state = YXMLS_pi4;
  911|     18|			return yxml_pinameend(x, ch);
  912|     18|		}
  913|     39|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|     39|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 6, False: 33]
  |  |  |  Branch (101:36): [True: 7, False: 26]
  |  |  |  Branch (101:49): [True: 6, False: 20]
  |  |  ------------------
  ------------------
  914|     19|			x->state = YXMLS_pi2;
  915|     19|			return yxml_pinameend(x, ch);
  916|     19|		}
  917|     20|		break;
  918|    854|	case YXMLS_xmldecl1:
  ------------------
  |  Branch (918:2): [True: 854, False: 127M]
  ------------------
  919|    854|		if(ch == (unsigned char)'l') {
  ------------------
  |  Branch (919:6): [True: 762, False: 92]
  ------------------
  920|    762|			x->state = YXMLS_xmldecl2;
  921|    762|			return yxml_piname(x, ch);
  922|    762|		}
  923|     92|		if(yxml_isName(ch)) {
  ------------------
  |  |  107|     92|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|    184|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    184|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 16, False: 76]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 4, False: 72]
  |  |  |  |  |  Branch (106:61): [True: 3, False: 69]
  |  |  |  |  |  Branch (106:73): [True: 11, False: 58]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|    150|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 7, False: 51]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 3, False: 48]
  |  |  |  Branch (107:77): [True: 4, False: 44]
  |  |  ------------------
  ------------------
  924|     48|			x->state = YXMLS_pi1;
  925|     48|			return yxml_piname(x, ch);
  926|     48|		}
  927|     44|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (927:6): [True: 4, False: 40]
  ------------------
  928|      4|			x->state = YXMLS_pi4;
  929|      4|			return yxml_pinameend(x, ch);
  930|      4|		}
  931|     40|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|     40|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 3, False: 37]
  |  |  |  Branch (101:36): [True: 5, False: 32]
  |  |  |  Branch (101:49): [True: 4, False: 28]
  |  |  ------------------
  ------------------
  932|     12|			x->state = YXMLS_pi2;
  933|     12|			return yxml_pinameend(x, ch);
  934|     12|		}
  935|     28|		break;
  936|    761|	case YXMLS_xmldecl2:
  ------------------
  |  Branch (936:2): [True: 761, False: 127M]
  ------------------
  937|    761|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|    761|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 587, False: 174]
  |  |  |  Branch (101:36): [True: 18, False: 156]
  |  |  |  Branch (101:49): [True: 18, False: 138]
  |  |  ------------------
  ------------------
  938|    623|			x->state = YXMLS_xmldecl3;
  939|    623|			return yxml_piabort(x, ch);
  940|    623|		}
  941|    138|		if(yxml_isName(ch)) {
  ------------------
  |  |  107|    138|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|    276|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    276|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 17, False: 121]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 4, False: 117]
  |  |  |  |  |  Branch (106:61): [True: 3, False: 114]
  |  |  |  |  |  Branch (106:73): [True: 82, False: 32]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|    170|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 7, False: 25]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 3, False: 22]
  |  |  |  Branch (107:77): [True: 3, False: 19]
  |  |  ------------------
  ------------------
  942|    119|			x->state = YXMLS_pi1;
  943|    119|			return yxml_piname(x, ch);
  944|    119|		}
  945|     19|		break;
  946|  1.17k|	case YXMLS_xmldecl3:
  ------------------
  |  Branch (946:2): [True: 1.17k, False: 127M]
  ------------------
  947|  1.17k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.17k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 984]
  |  |  |  Branch (101:36): [True: 194, False: 790]
  |  |  |  Branch (101:49): [True: 194, False: 596]
  |  |  ------------------
  ------------------
  948|    582|			return YXML_OK;
  949|    596|		if(ch == (unsigned char)'v') {
  ------------------
  |  Branch (949:6): [True: 575, False: 21]
  ------------------
  950|    575|			x->state = YXMLS_string;
  951|    575|			x->nextstate = YXMLS_ver0;
  952|    575|			x->string = (unsigned char *)"ersion";
  953|    575|			return YXML_OK;
  954|    575|		}
  955|     21|		break;
  956|    453|	case YXMLS_xmldecl4:
  ------------------
  |  Branch (956:2): [True: 453, False: 127M]
  ------------------
  957|    453|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|    453|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 374, False: 79]
  |  |  |  Branch (101:36): [True: 11, False: 68]
  |  |  |  Branch (101:49): [True: 43, False: 25]
  |  |  ------------------
  ------------------
  958|    428|			x->state = YXMLS_xmldecl5;
  959|    428|			return YXML_OK;
  960|    428|		}
  961|     25|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (961:6): [True: 10, False: 15]
  ------------------
  962|     10|			x->state = YXMLS_xmldecl9;
  963|     10|			return YXML_OK;
  964|     10|		}
  965|     15|		break;
  966|    983|	case YXMLS_xmldecl5:
  ------------------
  |  Branch (966:2): [True: 983, False: 127M]
  ------------------
  967|    983|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    983|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 789]
  |  |  |  Branch (101:36): [True: 194, False: 595]
  |  |  |  Branch (101:49): [True: 194, False: 401]
  |  |  ------------------
  ------------------
  968|    582|			return YXML_OK;
  969|    401|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (969:6): [True: 7, False: 394]
  ------------------
  970|      7|			x->state = YXMLS_xmldecl9;
  971|      7|			return YXML_OK;
  972|      7|		}
  973|    394|		if(ch == (unsigned char)'e') {
  ------------------
  |  Branch (973:6): [True: 230, False: 164]
  ------------------
  974|    230|			x->state = YXMLS_string;
  975|    230|			x->nextstate = YXMLS_enc0;
  976|    230|			x->string = (unsigned char *)"ncoding";
  977|    230|			return YXML_OK;
  978|    230|		}
  979|    164|		if(ch == (unsigned char)'s') {
  ------------------
  |  Branch (979:6): [True: 139, False: 25]
  ------------------
  980|    139|			x->state = YXMLS_string;
  981|    139|			x->nextstate = YXMLS_std0;
  982|    139|			x->string = (unsigned char *)"tandalone";
  983|    139|			return YXML_OK;
  984|    139|		}
  985|     25|		break;
  986|     76|	case YXMLS_xmldecl6:
  ------------------
  |  Branch (986:2): [True: 76, False: 127M]
  ------------------
  987|     76|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|     76|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 30, False: 46]
  |  |  |  Branch (101:36): [True: 16, False: 30]
  |  |  |  Branch (101:49): [True: 17, False: 13]
  |  |  ------------------
  ------------------
  988|     63|			x->state = YXMLS_xmldecl7;
  989|     63|			return YXML_OK;
  990|     63|		}
  991|     13|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (991:6): [True: 5, False: 8]
  ------------------
  992|      5|			x->state = YXMLS_xmldecl9;
  993|      5|			return YXML_OK;
  994|      5|		}
  995|      8|		break;
  996|    619|	case YXMLS_xmldecl7:
  ------------------
  |  Branch (996:2): [True: 619, False: 127M]
  ------------------
  997|    619|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    619|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 425]
  |  |  |  Branch (101:36): [True: 195, False: 230]
  |  |  |  Branch (101:49): [True: 194, False: 36]
  |  |  ------------------
  ------------------
  998|    583|			return YXML_OK;
  999|     36|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (999:6): [True: 7, False: 29]
  ------------------
 1000|      7|			x->state = YXMLS_xmldecl9;
 1001|      7|			return YXML_OK;
 1002|      7|		}
 1003|     29|		if(ch == (unsigned char)'s') {
  ------------------
  |  Branch (1003:6): [True: 5, False: 24]
  ------------------
 1004|      5|			x->state = YXMLS_string;
 1005|      5|			x->nextstate = YXMLS_std0;
 1006|      5|			x->string = (unsigned char *)"tandalone";
 1007|      5|			return YXML_OK;
 1008|      5|		}
 1009|     24|		break;
 1010|    603|	case YXMLS_xmldecl8:
  ------------------
  |  Branch (1010:2): [True: 603, False: 127M]
  ------------------
 1011|    603|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    603|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 409]
  |  |  |  Branch (101:36): [True: 194, False: 215]
  |  |  |  Branch (101:49): [True: 195, False: 20]
  |  |  ------------------
  ------------------
 1012|    583|			return YXML_OK;
 1013|     20|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (1013:6): [True: 9, False: 11]
  ------------------
 1014|      9|			x->state = YXMLS_xmldecl9;
 1015|      9|			return YXML_OK;
 1016|      9|		}
 1017|     11|		break;
 1018|     33|	case YXMLS_xmldecl9:
  ------------------
  |  Branch (1018:2): [True: 33, False: 127M]
  ------------------
 1019|     33|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (1019:6): [True: 32, False: 1]
  ------------------
 1020|     32|			x->state = YXMLS_misc1;
 1021|     32|			return YXML_OK;
 1022|     32|		}
 1023|      1|		break;
 1024|   127M|	}
 1025|    840|	return YXML_ESYN;
 1026|   127M|}
yxml_eof:
 1028|  6.85k|yxml_ret_t yxml_eof(yxml_t *x) {
 1029|  6.85k|	if(x->state != YXMLS_misc3)
  ------------------
  |  Branch (1029:5): [True: 2.16k, False: 4.69k]
  ------------------
 1030|  2.16k|		return YXML_EEOF;
 1031|  4.69k|	return YXML_OK;
 1032|  6.85k|}
yxml.c:yxml_attrname:
  243|  36.5M|static inline yxml_ret_t yxml_attrname   (yxml_t *x, unsigned ch) { return yxml_pushstackc(x, ch); }
yxml.c:yxml_pushstackc:
  195|  37.0M|static yxml_ret_t yxml_pushstackc(yxml_t *x, unsigned ch) {
  196|  37.0M|	if(x->stacklen+1 >= x->stacksize)
  ------------------
  |  Branch (196:5): [True: 3, False: 37.0M]
  ------------------
  197|      3|		return YXML_ESTACK;
  198|  37.0M|	x->stack[x->stacklen] = (unsigned char)ch;
  199|  37.0M|	x->stacklen++;
  200|  37.0M|	x->stack[x->stacklen] = 0;
  201|  37.0M|	return YXML_OK;
  202|  37.0M|}
yxml.c:yxml_attrnameend:
  244|  4.13M|static inline yxml_ret_t yxml_attrnameend(yxml_t *x, unsigned ch) { return YXML_ATTRSTART; }
yxml.c:yxml_dataattr:
  177|   327k|static inline yxml_ret_t yxml_dataattr(yxml_t *x, unsigned ch) {
  178|       |	/* Normalize attribute values according to the XML spec section 3.3.3. */
  179|   327k|	yxml_setchar(x->data, ch == 0x9 || ch == 0xa ? 0x20 : ch);
  ------------------
  |  Branch (179:24): [True: 12.9k, False: 315k]
  |  Branch (179:37): [True: 1.14k, False: 313k]
  ------------------
  180|   327k|	x->data[1] = 0;
  181|   327k|	return YXML_ATTRVAL;
  182|   327k|}
yxml.c:yxml_setchar:
  118|  24.3M|static inline void yxml_setchar(char *dest, unsigned ch) {
  119|  24.3M|	*(unsigned char *)dest = (unsigned char)ch;
  120|  24.3M|}
yxml.c:yxml_refstart:
  255|  3.33k|static inline yxml_ret_t yxml_refstart(yxml_t *x, unsigned ch) {
  256|  3.33k|	memset(x->data, 0, sizeof(x->data));
  257|  3.33k|	x->reflen = 0;
  258|  3.33k|	return YXML_OK;
  259|  3.33k|}
yxml.c:yxml_attrvalend:
  245|  4.13M|static inline yxml_ret_t yxml_attrvalend (yxml_t *x, unsigned ch) { yxml_popstack(x); return YXML_ATTREND; }
yxml.c:yxml_popstack:
  204|  14.7M|static void yxml_popstack(yxml_t *x) {
  205|  14.7M|	do
  206|  66.4M|		x->stacklen--;
  207|  66.4M|	while(x->stack[x->stacklen]);
  ------------------
  |  Branch (207:8): [True: 51.7M, False: 14.7M]
  ------------------
  208|  14.7M|}
yxml.c:yxml_ref:
  261|  11.4k|static yxml_ret_t yxml_ref(yxml_t *x, unsigned ch) {
  262|  11.4k|	if(x->reflen >= sizeof(x->data)-1)
  ------------------
  |  Branch (262:5): [True: 20, False: 11.4k]
  ------------------
  263|     20|		return YXML_EREF;
  264|  11.4k|	yxml_setchar(x->data+x->reflen, ch);
  265|  11.4k|	x->reflen++;
  266|  11.4k|	return YXML_OK;
  267|  11.4k|}
yxml.c:yxml_refattrval:
  299|    750|static inline yxml_ret_t yxml_refattrval(yxml_t *x, unsigned ch) { return yxml_refend(x, YXML_ATTRVAL); }
yxml.c:yxml_refend:
  269|  3.22k|static yxml_ret_t yxml_refend(yxml_t *x, yxml_ret_t ret) {
  270|  3.22k|	unsigned char *r = (unsigned char *)x->data;
  271|  3.22k|	unsigned ch = 0;
  272|  3.22k|	if(*r == '#') {
  ------------------
  |  Branch (272:5): [True: 1.99k, False: 1.22k]
  ------------------
  273|  1.99k|		if(r[1] == 'x')
  ------------------
  |  Branch (273:6): [True: 666, False: 1.33k]
  ------------------
  274|  2.30k|			for(r += 2; yxml_isHex((unsigned)*r); r++)
  ------------------
  |  |  104|  2.30k|#define yxml_isHex(c) (yxml_isNum(c) || (c|32)-'a' < 6)
  |  |  ------------------
  |  |  |  |  103|  4.61k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 529, False: 1.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (104:41): [True: 1.11k, False: 666]
  |  |  ------------------
  ------------------
  275|  1.64k|				ch = (ch<<4) + (*r <= '9' ? *r-'0' : (*r|32)-'a' + 10);
  ------------------
  |  Branch (275:21): [True: 529, False: 1.11k]
  ------------------
  276|  1.33k|		else
  277|  4.50k|			for(r++; yxml_isNum((unsigned)*r); r++)
  ------------------
  |  |  103|  4.50k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  ------------------
  |  |  |  Branch (103:23): [True: 3.16k, False: 1.33k]
  |  |  ------------------
  ------------------
  278|  3.16k|				ch = (ch*10) + (*r-'0');
  279|  1.99k|		if(*r)
  ------------------
  |  Branch (279:6): [True: 8, False: 1.99k]
  ------------------
  280|      8|			ch = 0;
  281|  1.99k|	} else {
  282|  1.22k|		uint64_t i = INTFROM5CHARS(r[0], r[1], r[2], r[3], r[4]);
  ------------------
  |  |  115|  1.22k|#define INTFROM5CHARS(a, b, c, d, e) ((((uint64_t)(a))<<32) | (((uint64_t)(b))<<24) | (((uint64_t)(c))<<16) | (((uint64_t)(d))<<8) | (uint64_t)(e))
  ------------------
  283|  1.22k|		ch =
  284|  1.22k|			i == INTFROM5CHARS('l','t', 0,  0, 0) ? '<' :
  ------------------
  |  |  115|  1.22k|#define INTFROM5CHARS(a, b, c, d, e) ((((uint64_t)(a))<<32) | (((uint64_t)(b))<<24) | (((uint64_t)(c))<<16) | (((uint64_t)(d))<<8) | (uint64_t)(e))
  ------------------
  |  Branch (284:4): [True: 232, False: 996]
  ------------------
  285|  1.22k|			i == INTFROM5CHARS('g','t', 0,  0, 0) ? '>' :
  ------------------
  |  |  115|    996|#define INTFROM5CHARS(a, b, c, d, e) ((((uint64_t)(a))<<32) | (((uint64_t)(b))<<24) | (((uint64_t)(c))<<16) | (((uint64_t)(d))<<8) | (uint64_t)(e))
  ------------------
  |  Branch (285:4): [True: 194, False: 802]
  ------------------
  286|    996|			i == INTFROM5CHARS('a','m','p', 0, 0) ? '&' :
  ------------------
  |  |  115|    802|#define INTFROM5CHARS(a, b, c, d, e) ((((uint64_t)(a))<<32) | (((uint64_t)(b))<<24) | (((uint64_t)(c))<<16) | (((uint64_t)(d))<<8) | (uint64_t)(e))
  ------------------
  |  Branch (286:4): [True: 194, False: 608]
  ------------------
  287|    802|			i == INTFROM5CHARS('a','p','o','s',0) ? '\'':
  ------------------
  |  |  115|    608|#define INTFROM5CHARS(a, b, c, d, e) ((((uint64_t)(a))<<32) | (((uint64_t)(b))<<24) | (((uint64_t)(c))<<16) | (((uint64_t)(d))<<8) | (uint64_t)(e))
  ------------------
  |  Branch (287:4): [True: 194, False: 414]
  ------------------
  288|    608|			i == INTFROM5CHARS('q','u','o','t',0) ? '"' : 0;
  ------------------
  |  |  115|    414|#define INTFROM5CHARS(a, b, c, d, e) ((((uint64_t)(a))<<32) | (((uint64_t)(b))<<24) | (((uint64_t)(c))<<16) | (((uint64_t)(d))<<8) | (uint64_t)(e))
  ------------------
  |  Branch (288:4): [True: 256, False: 158]
  ------------------
  289|  1.22k|	}
  290|       |
  291|       |	/* Codepoints not allowed in the XML 1.1 definition of a Char */
  292|  3.22k|	if(!ch || ch > 0x10FFFF || ch == 0xFFFE || ch == 0xFFFF || (ch-0xDFFF) < 0x7FF)
  ------------------
  |  Branch (292:5): [True: 185, False: 3.04k]
  |  Branch (292:12): [True: 0, False: 3.04k]
  |  Branch (292:29): [True: 1, False: 3.04k]
  |  Branch (292:45): [True: 1, False: 3.04k]
  |  Branch (292:61): [True: 5, False: 3.03k]
  ------------------
  293|    192|		return YXML_EREF;
  294|  3.03k|	yxml_setutf8(x->data, ch);
  295|  3.03k|	return ret;
  296|  3.22k|}
yxml.c:yxml_setutf8:
  124|  3.03k|static void yxml_setutf8(char *dest, unsigned ch) {
  125|  3.03k|	if(ch <= 0x007F)
  ------------------
  |  Branch (125:5): [True: 2.11k, False: 918]
  ------------------
  126|  2.11k|		yxml_setchar(dest++, ch);
  127|    918|	else if(ch <= 0x07FF) {
  ------------------
  |  Branch (127:10): [True: 232, False: 686]
  ------------------
  128|    232|		yxml_setchar(dest++, 0xC0 | (ch>>6));
  129|    232|		yxml_setchar(dest++, 0x80 | (ch & 0x3F));
  130|    686|	} else if(ch <= 0xFFFF) {
  ------------------
  |  Branch (130:12): [True: 293, False: 393]
  ------------------
  131|    293|		yxml_setchar(dest++, 0xE0 | (ch>>12));
  132|    293|		yxml_setchar(dest++, 0x80 | ((ch>>6) & 0x3F));
  133|    293|		yxml_setchar(dest++, 0x80 | (ch & 0x3F));
  134|    393|	} else {
  135|    393|		yxml_setchar(dest++, 0xF0 | (ch>>18));
  136|    393|		yxml_setchar(dest++, 0x80 | ((ch>>12) & 0x3F));
  137|    393|		yxml_setchar(dest++, 0x80 | ((ch>>6) & 0x3F));
  138|    393|		yxml_setchar(dest++, 0x80 | (ch & 0x3F));
  139|    393|	}
  140|  3.03k|	*dest = 0;
  141|  3.03k|}
yxml.c:yxml_datacontent:
  143|  23.8M|static inline yxml_ret_t yxml_datacontent(yxml_t *x, unsigned ch) {
  144|  23.8M|	yxml_setchar(x->data, ch);
  145|  23.8M|	x->data[1] = 0;
  146|  23.8M|	return YXML_CONTENT;
  147|  23.8M|}
yxml.c:yxml_datacd1:
  162|    250|static inline yxml_ret_t yxml_datacd1(yxml_t *x, unsigned ch) {
  163|    250|	x->data[0] = ']';
  164|    250|	yxml_setchar(x->data+1, ch);
  165|    250|	x->data[2] = 0;
  166|    250|	return YXML_CONTENT;
  167|    250|}
yxml.c:yxml_datacd2:
  169|    340|static inline yxml_ret_t yxml_datacd2(yxml_t *x, unsigned ch) {
  170|    340|	x->data[0] = ']';
  171|    340|	x->data[1] = ']';
  172|    340|	yxml_setchar(x->data+2, ch);
  173|    340|	x->data[3] = 0;
  174|    340|	return YXML_CONTENT;
  175|    340|}
yxml.c:yxml_elemname:
  211|   506k|static inline yxml_ret_t yxml_elemname   (yxml_t *x, unsigned ch) { return yxml_pushstackc(x, ch); }
yxml.c:yxml_elemnameend:
  212|  10.5M|static inline yxml_ret_t yxml_elemnameend(yxml_t *x, unsigned ch) { return YXML_ELEMSTART; }
yxml.c:yxml_attrstart:
  242|  4.13M|static inline yxml_ret_t yxml_attrstart  (yxml_t *x, unsigned ch) { return yxml_pushstack(x, &x->attr, ch); }
yxml.c:yxml_pushstack:
  184|  14.7M|static yxml_ret_t yxml_pushstack(yxml_t *x, char **res, unsigned ch) {
  185|  14.7M|	if(x->stacklen+2 >= x->stacksize)
  ------------------
  |  Branch (185:5): [True: 4, False: 14.7M]
  ------------------
  186|      4|		return YXML_ESTACK;
  187|  14.7M|	x->stacklen++;
  188|  14.7M|	*res = (char *)x->stack+x->stacklen;
  189|  14.7M|	x->stack[x->stacklen] = (unsigned char)ch;
  190|  14.7M|	x->stacklen++;
  191|  14.7M|	x->stack[x->stacklen] = 0;
  192|  14.7M|	return YXML_OK;
  193|  14.7M|}
yxml.c:yxml_selfclose:
  216|  10.5M|static yxml_ret_t yxml_selfclose(yxml_t *x, unsigned ch) {
  217|  10.5M|	yxml_popstack(x);
  218|  10.5M|	if(x->stacklen) {
  ------------------
  |  Branch (218:5): [True: 10.5M, False: 4.80k]
  ------------------
  219|  10.5M|		x->elem = (char *)x->stack+x->stacklen-1;
  220|  36.1M|		while(*(x->elem-1))
  ------------------
  |  Branch (220:9): [True: 25.5M, False: 10.5M]
  ------------------
  221|  25.5M|			x->elem--;
  222|  10.5M|		return YXML_ELEMEND;
  223|  10.5M|	}
  224|  4.80k|	x->elem = (char *)x->stack;
  225|  4.80k|	x->state = YXMLS_misc3;
  226|  4.80k|	return YXML_ELEMEND;
  227|  10.5M|}
yxml.c:yxml_elemclose:
  229|  81.8k|static inline yxml_ret_t yxml_elemclose(yxml_t *x, unsigned ch) {
  230|  81.8k|	if(*((unsigned char *)x->elem) != ch)
  ------------------
  |  Branch (230:5): [True: 89, False: 81.7k]
  ------------------
  231|     89|		return YXML_ECLOSE;
  232|  81.7k|	x->elem++;
  233|  81.7k|	return YXML_OK;
  234|  81.8k|}
yxml.c:yxml_elemcloseend:
  236|  34.2k|static inline yxml_ret_t yxml_elemcloseend(yxml_t *x, unsigned ch) {
  237|  34.2k|	if(*x->elem)
  ------------------
  |  Branch (237:5): [True: 8, False: 34.2k]
  ------------------
  238|      8|		return YXML_ECLOSE;
  239|  34.2k|	return yxml_selfclose(x, ch);
  240|  34.2k|}
yxml.c:yxml_elemstart:
  210|  10.5M|static inline yxml_ret_t yxml_elemstart  (yxml_t *x, unsigned ch) { return yxml_pushstack(x, &x->elem, ch); }
yxml.c:yxml_pistart:
  247|  4.60k|static inline yxml_ret_t yxml_pistart  (yxml_t *x, unsigned ch) { return yxml_pushstack(x, &x->pi, ch); }
yxml.c:yxml_refcontent:
  298|  2.47k|static inline yxml_ret_t yxml_refcontent(yxml_t *x, unsigned ch) { return yxml_refend(x, YXML_CONTENT); }
yxml.c:yxml_piname:
  248|  6.49k|static inline yxml_ret_t yxml_piname   (yxml_t *x, unsigned ch) { return yxml_pushstackc(x, ch); }
yxml.c:yxml_pinameend:
  250|  3.70k|static inline yxml_ret_t yxml_pinameend(yxml_t *x, unsigned ch) {
  251|  3.70k|	return (x->pi[0]|32) == 'x' && (x->pi[1]|32) == 'm' && (x->pi[2]|32) == 'l' && !x->pi[3] ? YXML_ESYN : YXML_PISTART;
  ------------------
  |  Branch (251:9): [True: 1.71k, False: 1.98k]
  |  Branch (251:33): [True: 963, False: 753]
  |  Branch (251:57): [True: 529, False: 434]
  |  Branch (251:81): [True: 15, False: 514]
  ------------------
  252|  3.70k|}
yxml.c:yxml_datapi1:
  149|   121k|static inline yxml_ret_t yxml_datapi1(yxml_t *x, unsigned ch) {
  150|   121k|	yxml_setchar(x->data, ch);
  151|   121k|	x->data[1] = 0;
  152|   121k|	return YXML_PICONTENT;
  153|   121k|}
yxml.c:yxml_pivalend:
  253|  3.53k|static inline yxml_ret_t yxml_pivalend (yxml_t *x, unsigned ch) { yxml_popstack(x); x->pi = (char *)x->stack; return YXML_PIEND; }
yxml.c:yxml_datapi2:
  155|    450|static inline yxml_ret_t yxml_datapi2(yxml_t *x, unsigned ch) {
  156|    450|	x->data[0] = '?';
  157|    450|	yxml_setchar(x->data+1, ch);
  158|    450|	x->data[2] = 0;
  159|    450|	return YXML_PICONTENT;
  160|    450|}
yxml.c:yxml_piabort:
  249|    623|static inline yxml_ret_t yxml_piabort  (yxml_t *x, unsigned ch) { yxml_popstack(x); return YXML_OK; }

UA_STRING:
  219|    520|UA_STRING(char *chars) {
  220|    520|    UA_String s = {0, NULL};
  221|    520|    if(!chars)
  ------------------
  |  Branch (221:8): [True: 0, False: 520]
  ------------------
  222|      0|        return s;
  223|    520|    s.length = strlen(chars);
  224|    520|    s.data = (UA_Byte*)chars;
  225|    520|    return s;
  226|    520|}
UA_String_equal_ignorecase:
  268|    240|UA_String_equal_ignorecase(const UA_String *s1, const UA_String *s2) {
  269|    240|    if(s1->length != s2->length)
  ------------------
  |  Branch (269:8): [True: 30, False: 210]
  ------------------
  270|     30|        return false;
  271|    210|    if(s1->length == 0)
  ------------------
  |  Branch (271:8): [True: 0, False: 210]
  ------------------
  272|      0|        return true;
  273|    210|    if(s2->data == NULL)
  ------------------
  |  Branch (273:8): [True: 0, False: 210]
  ------------------
  274|      0|        return false;
  275|       |
  276|    210|    return casecmp(s1->data, s2->data, s1->length) == 0;
  277|    210|}
UA_DateTime_parse:
  531|     39|UA_DateTime_parse(UA_DateTime *dst, const UA_String str) {
  532|     39|    if(str.length == 0)
  ------------------
  |  Branch (532:8): [True: 39, False: 0]
  ------------------
  533|     39|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     39|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  534|       |
  535|      0|    struct musl_tm dts;
  536|      0|    memset(&dts, 0, sizeof(dts));
  537|       |
  538|       |    /* Parse the year. The ISO standard asks for four digits. But we accept up
  539|       |     * to five with an optional plus or minus in front due to the range of the
  540|       |     * DateTime 64bit integer. But in that case we require the year and the
  541|       |     * month to be separated by a '-'. Otherwise we cannot know where the month
  542|       |     * starts. */
  543|      0|    size_t pos = 0;
  544|      0|    if(str.data[0] == '-' || str.data[0] == '+')
  ------------------
  |  Branch (544:8): [True: 0, False: 0]
  |  Branch (544:30): [True: 0, False: 0]
  ------------------
  545|      0|        pos++;
  546|      0|    UA_Int64 year = 0;
  547|      0|    UA_CHECK(str.length - pos > 5, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  548|      0|    size_t len = parseInt64((char*)&str.data[pos], 5, &year);
  549|      0|    pos += len;
  550|      0|    UA_CHECK(len > 0 && pos < str.length, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 0, False: 0]
  |  |  |  |  |  Branch (591:43): [True: 0, False: 0]
  |  |  |  |  |  Branch (591:43): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  551|      0|    UA_CHECK(len == 4 || str.data[pos] == '-', return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 0, False: 0]
  |  |  |  |  |  Branch (591:43): [True: 0, False: 0]
  |  |  |  |  |  Branch (591:43): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  552|      0|    if(str.data[0] == '-')
  ------------------
  |  Branch (552:8): [True: 0, False: 0]
  ------------------
  553|      0|        year = -year;
  554|      0|    dts.tm_year = (UA_Int16)year - 1900;
  555|      0|    if(str.data[pos] == '-')
  ------------------
  |  Branch (555:8): [True: 0, False: 0]
  ------------------
  556|      0|        pos++;
  557|       |
  558|       |    /* Parse the month */
  559|      0|    UA_UInt64 month = 0;
  560|      0|    UA_CHECK(str.length - pos > 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  561|      0|    len = parseUInt64((char*)&str.data[pos], 2, &month);
  562|      0|    pos += len;
  563|      0|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  564|      0|    dts.tm_mon = (UA_UInt16)month - 1;
  565|      0|    if(str.data[pos] == '-')
  ------------------
  |  Branch (565:8): [True: 0, False: 0]
  ------------------
  566|      0|        pos++;
  567|       |
  568|       |    /* Parse the day and check the T between date and time */
  569|      0|    UA_UInt64 day = 0;
  570|      0|    UA_CHECK(str.length - pos > 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  571|      0|    len = parseUInt64((char*)&str.data[pos], 2, &day);
  572|      0|    pos += len;
  573|      0|    UA_CHECK(len == 2 || str.data[pos] != 'T',
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 0, False: 0]
  |  |  |  |  |  Branch (591:43): [True: 0, False: 0]
  |  |  |  |  |  Branch (591:43): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  574|      0|             return UA_STATUSCODE_BADDECODINGERROR);
  575|      0|    dts.tm_mday = (UA_UInt16)day;
  576|      0|    pos++;
  577|       |
  578|       |    /* Parse the hour */
  579|      0|    UA_UInt64 hour = 0;
  580|      0|    UA_CHECK(str.length - pos > 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  581|      0|    len = parseUInt64((char*)&str.data[pos], 2, &hour);
  582|      0|    pos += len;
  583|      0|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  584|      0|    dts.tm_hour = (UA_UInt16)hour;
  585|      0|    if(str.data[pos] == ':')
  ------------------
  |  Branch (585:8): [True: 0, False: 0]
  ------------------
  586|      0|        pos++;
  587|       |
  588|       |    /* Parse the minute */
  589|      0|    UA_UInt64 min = 0;
  590|      0|    UA_CHECK(str.length - pos > 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  591|      0|    len = parseUInt64((char*)&str.data[pos], 2, &min);
  592|      0|    pos += len;
  593|      0|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  594|      0|    dts.tm_min = (UA_UInt16)min;
  595|      0|    if(str.data[pos] == ':')
  ------------------
  |  Branch (595:8): [True: 0, False: 0]
  ------------------
  596|      0|        pos++;
  597|       |
  598|       |    /* Parse the second */
  599|      0|    UA_UInt64 sec = 0;
  600|      0|    UA_CHECK(str.length - pos >= 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  601|      0|    len = parseUInt64((char*)&str.data[pos], 2, &sec);
  602|      0|    pos += len;
  603|      0|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  604|      0|    dts.tm_sec = (UA_UInt16)sec;
  605|       |
  606|       |    /* Compute the seconds since the Unix epoch */
  607|      0|    long long sinceunix = musl_tm_to_secs(&dts);
  608|       |
  609|       |    /* Are we within the range that can be represented? */
  610|      0|    long long sinceunix_min =
  611|      0|        (long long)(UA_INT64_MIN / UA_DATETIME_SEC) -
  ------------------
  |  |  119|      0|#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
  |  |  ------------------
  |  |  |  |  118|      0|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  |  |  ------------------
  ------------------
                      (long long)(UA_INT64_MIN / UA_DATETIME_SEC) -
  ------------------
  |  |  285|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  612|      0|        (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC) -
  ------------------
  |  |  327|      0|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC) -
  ------------------
  |  |  285|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  613|      0|        (long long)1; /* manual correction due to rounding */
  614|      0|    long long sinceunix_max = (long long)
  615|      0|        ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  118|      0|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  ------------------
                      ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  327|      0|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  285|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  616|      0|    if(sinceunix < sinceunix_min || sinceunix > sinceunix_max)
  ------------------
  |  Branch (616:8): [True: 0, False: 0]
  |  Branch (616:37): [True: 0, False: 0]
  ------------------
  617|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  618|       |
  619|       |    /* Convert to DateTime. Add or subtract one extra second here to prevent
  620|       |     * underflow/overflow. This is reverted once the fractional part has been
  621|       |     * added. */
  622|      0|    sinceunix -= (sinceunix > 0) ? 1 : -1;
  ------------------
  |  Branch (622:18): [True: 0, False: 0]
  ------------------
  623|      0|    UA_DateTime dt = (UA_DateTime)
  624|      0|        (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  327|      0|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  285|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  283|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  285|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  285|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  625|       |
  626|       |    /* Parse the fraction of the second if defined */
  627|      0|    UA_CHECK(pos < str.length, goto finish);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  628|      0|    if(str.data[pos] == ',' || str.data[pos] == '.') {
  ------------------
  |  Branch (628:8): [True: 0, False: 0]
  |  Branch (628:32): [True: 0, False: 0]
  ------------------
  629|      0|        pos++;
  630|      0|        double frac = 0.0;
  631|      0|        double denom = 0.1;
  632|      0|        while(pos < str.length && str.data[pos] >= '0' && str.data[pos] <= '9') {
  ------------------
  |  Branch (632:15): [True: 0, False: 0]
  |  Branch (632:35): [True: 0, False: 0]
  |  Branch (632:59): [True: 0, False: 0]
  ------------------
  633|      0|            frac += denom * (str.data[pos] - '0');
  634|      0|            denom *= 0.1;
  635|      0|            pos++;
  636|      0|        }
  637|      0|        frac += 0.00000005; /* Correct rounding when converting to integer */
  638|      0|        dt += (UA_DateTime)(frac * UA_DATETIME_SEC);
  ------------------
  |  |  285|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  639|      0|    }
  640|       |
  641|       |    /* Time zone handling */
  642|      0|    UA_CHECK(pos < str.length, goto finish);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  643|      0|    if(str.data[pos] == 'Z') {
  ------------------
  |  Branch (643:8): [True: 0, False: 0]
  ------------------
  644|      0|        pos++;
  645|      0|    } else if(str.data[pos] == '+' || str.data[pos] == '-') {
  ------------------
  |  Branch (645:15): [True: 0, False: 0]
  |  Branch (645:39): [True: 0, False: 0]
  ------------------
  646|      0|        UA_UInt64 tzHour = 0, tzMin = 0;
  647|      0|        UA_Int64 offsetSeconds = 0;
  648|      0|        UA_Byte tzSign = str.data[pos++];
  649|       |
  650|      0|        UA_CHECK(str.length - pos >= 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  651|      0|        len = parseUInt64((char*)&str.data[pos], 2, &tzHour);
  652|      0|        pos += len;
  653|      0|        UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  654|       |
  655|      0|        UA_CHECK(str.length > pos, goto finish); /* Allow missing tz minutes */
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  656|      0|        if(str.data[pos] == ':')
  ------------------
  |  Branch (656:12): [True: 0, False: 0]
  ------------------
  657|      0|            pos++;
  658|       |
  659|      0|        UA_CHECK(str.length - pos >= 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  660|      0|        len = parseUInt64((char*)&str.data[pos], 2, &tzMin);
  661|      0|        pos += len;
  662|      0|        UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  591|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (591:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  663|       |
  664|      0|        offsetSeconds = (tzHour * 3600) + (tzMin * 60);
  665|      0|        if(tzSign == '-')
  ------------------
  |  Branch (665:12): [True: 0, False: 0]
  ------------------
  666|      0|            offsetSeconds = -offsetSeconds;
  667|      0|        dt -= (UA_DateTime)(offsetSeconds * UA_DATETIME_SEC);
  ------------------
  |  |  285|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  668|      0|    } else {
  669|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  670|      0|    }
  671|       |
  672|      0| finish:
  673|       |    /* Remove the underflow/overflow protection (see above) */
  674|      0|    if(sinceunix > 0) {
  ------------------
  |  Branch (674:8): [True: 0, False: 0]
  ------------------
  675|      0|        if(dt > UA_INT64_MAX - UA_DATETIME_SEC)
  ------------------
  |  |  118|      0|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  ------------------
                      if(dt > UA_INT64_MAX - UA_DATETIME_SEC)
  ------------------
  |  |  285|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (675:12): [True: 0, False: 0]
  ------------------
  676|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  677|      0|        dt += UA_DATETIME_SEC;
  ------------------
  |  |  285|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  678|      0|    } else {
  679|      0|        if(dt < UA_INT64_MIN + UA_DATETIME_SEC)
  ------------------
  |  |  119|      0|#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
  |  |  ------------------
  |  |  |  |  118|      0|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  |  |  ------------------
  ------------------
                      if(dt < UA_INT64_MIN + UA_DATETIME_SEC)
  ------------------
  |  |  285|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (679:12): [True: 0, False: 0]
  ------------------
  680|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  681|      0|        dt -= UA_DATETIME_SEC;
  ------------------
  |  |  285|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  284|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  283|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  682|      0|    }
  683|       |
  684|       |    /* We must be at the end of the string */
  685|      0|    if(pos != str.length)
  ------------------
  |  Branch (685:8): [True: 0, False: 0]
  ------------------
  686|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  687|       |
  688|      0|    *dst = dt;
  689|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  690|      0|}
UA_ByteString_allocBuffer:
  757|  2.51k|UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length) {
  758|  2.51k|    UA_ByteString_init(bs);
  759|  2.51k|    if(length == 0) {
  ------------------
  |  Branch (759:8): [True: 0, False: 2.51k]
  ------------------
  760|      0|        bs->data = (u8*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|      0|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  761|      0|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  762|      0|    }
  763|  2.51k|    bs->data = (u8*)UA_calloc(1,length);
  ------------------
  |  |  352|  2.51k|# define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  764|  2.51k|    if(UA_UNLIKELY(!bs->data))
  ------------------
  |  |  591|  2.51k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (591:25): [True: 0, False: 2.51k]
  |  |  ------------------
  ------------------
  765|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  766|  2.51k|    bs->length = length;
  767|  2.51k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  2.51k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  768|  2.51k|}
nodeId_printEscape:
 1021|     50|                   const UA_NamespaceMapping *nsMapping, UA_Escaping idEsc) {
 1022|       |    /* Try to map the NamespaceIndex to the Uri */
 1023|     50|    UA_String nsUri = UA_STRING_NULL;
 1024|     50|    if(id->namespaceIndex > 0 && nsMapping)
  ------------------
  |  Branch (1024:8): [True: 0, False: 50]
  |  Branch (1024:34): [True: 0, False: 0]
  ------------------
 1025|      0|        UA_NamespaceMapping_index2Uri(nsMapping, id->namespaceIndex, &nsUri);
 1026|       |
 1027|       |    /* Compute the string length and print numerical identifiers. */
 1028|     50|    u8 nsStr[7];
 1029|     50|    u8 numIdStr[12];
 1030|     50|    size_t idLen = nodeIdSize(id, nsStr, numIdStr, nsUri, idEsc);
 1031|     50|    if(idLen == 0)
  ------------------
  |  Branch (1031:8): [True: 0, False: 50]
  ------------------
 1032|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 1033|       |
 1034|       |    /* Allocate memory if required */
 1035|     50|    if(output->length == 0) {
  ------------------
  |  Branch (1035:8): [True: 50, False: 0]
  ------------------
 1036|     50|        UA_StatusCode res = UA_ByteString_allocBuffer((UA_ByteString*)output, idLen);
 1037|     50|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|     50|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1037:12): [True: 0, False: 50]
  ------------------
 1038|      0|            return res;
 1039|     50|    } else {
 1040|      0|        if(output->length < idLen)
  ------------------
  |  Branch (1040:12): [True: 0, False: 0]
  ------------------
 1041|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
 1042|      0|        output->length = idLen;
 1043|      0|    }
 1044|       |
 1045|       |    /* Print the NodeId */
 1046|     50|    u8 *pos = printNodeIdBody(id, nsUri, nsStr, numIdStr, output->data, nsMapping, idEsc);
 1047|     50|    output->length = (size_t)(pos - output->data);
 1048|     50|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     50|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1049|     50|}
UA_NodeId_printEx:
 1053|     50|                  const UA_NamespaceMapping *nsMapping) {
 1054|     50|    return nodeId_printEscape(id, output, nsMapping, UA_ESCAPING_NONE);
 1055|     50|}
UA_ExtensionObject_setValue:
 1291|     50|                            const UA_DataType *type) {
 1292|     50|    UA_ExtensionObject_init(eo);
 1293|     50|    eo->content.decoded.data = p;
 1294|     50|    eo->content.decoded.type = type;
 1295|     50|    eo->encoding = UA_EXTENSIONOBJECT_DECODED;
 1296|     50|}
UA_Variant_isScalar:
 1348|  2.46k|UA_Variant_isScalar(const UA_Variant *v) {
 1349|  2.46k|    return (v->type != NULL && v->arrayLength == 0 &&
  ------------------
  |  Branch (1349:13): [True: 2.46k, False: 0]
  |  Branch (1349:32): [True: 2.46k, False: 0]
  ------------------
 1350|  2.46k|            v->data > UA_EMPTY_ARRAY_SENTINEL);
  ------------------
  |  |  755|  2.46k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1350:13): [True: 2.45k, False: 14]
  ------------------
 1351|  2.46k|}
UA_new:
 1892|  3.79k|UA_new(const UA_DataType *type) {
 1893|  3.79k|    void *p = UA_calloc(1, type->memSize);
  ------------------
  |  |  352|  3.79k|# define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1894|  3.79k|    return p;
 1895|  3.79k|}
UA_copy:
 2058|     96|UA_copy(const void *src, void *dst, const UA_DataType *type) {
 2059|     96|    memset(dst, 0, type->memSize); /* init */
 2060|     96|    UA_StatusCode retval = copyJumpTable[type->typeKind](src, dst, type);
 2061|     96|    if(retval != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|     96|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2061:8): [True: 0, False: 96]
  ------------------
 2062|      0|        UA_clear(dst, type);
 2063|     96|    return retval;
 2064|     96|}
UA_clear:
 2161|  7.05k|UA_clear(void *p, const UA_DataType *type) {
 2162|  7.05k|    clearJumpTable[type->typeKind](p, type);
 2163|  7.05k|    memset(p, 0, type->memSize); /* init */
 2164|  7.05k|}
UA_order:
 2615|  9.13k|UA_Order UA_order(const void *p1, const void *p2, const UA_DataType *type) {
 2616|  9.13k|    return orderJumpTable[type->typeKind](p1, p2, type);
 2617|  9.13k|}
UA_Array_new:
 2629|     14|UA_Array_new(size_t size, const UA_DataType *type) {
 2630|     14|    if(size > UA_INT32_MAX)
  ------------------
  |  |  100|     14|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (2630:8): [True: 0, False: 14]
  ------------------
 2631|      0|        return NULL;
 2632|     14|    if(size == 0)
  ------------------
  |  Branch (2632:8): [True: 14, False: 0]
  ------------------
 2633|     14|        return UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|     14|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2634|      0|    return UA_calloc(size, type->memSize);
  ------------------
  |  |  352|      0|# define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2635|     14|}
UA_Array_copy:
 2639|     96|              void **dst, const UA_DataType *type) {
 2640|     96|    if(size == 0) {
  ------------------
  |  Branch (2640:8): [True: 0, False: 96]
  ------------------
 2641|      0|        if(src == NULL)
  ------------------
  |  Branch (2641:12): [True: 0, False: 0]
  ------------------
 2642|      0|            *dst = NULL;
 2643|      0|        else
 2644|      0|            *dst= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|      0|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2645|      0|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2646|      0|    }
 2647|       |
 2648|       |    /* Check the array consistency -- defensive programming in case the user
 2649|       |     * manually created an inconsistent array */
 2650|     96|    if(UA_UNLIKELY(!type || !src))
  ------------------
  |  |  591|    192|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (591:25): [True: 0, False: 96]
  |  |  |  Branch (591:43): [True: 0, False: 96]
  |  |  |  Branch (591:43): [True: 0, False: 96]
  |  |  ------------------
  ------------------
 2651|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 2652|       |
 2653|       |    /* calloc, so we don't have to check retval in every iteration of copying */
 2654|     96|    *dst = UA_calloc(size, type->memSize);
  ------------------
  |  |  352|     96|# define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2655|     96|    if(!*dst)
  ------------------
  |  Branch (2655:8): [True: 0, False: 96]
  ------------------
 2656|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2657|       |
 2658|     96|    if(type->pointerFree) {
  ------------------
  |  Branch (2658:8): [True: 96, False: 0]
  ------------------
 2659|     96|        memcpy(*dst, src, type->memSize * size);
 2660|     96|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     96|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2661|     96|    }
 2662|       |
 2663|      0|    uintptr_t ptrs = (uintptr_t)src;
 2664|      0|    uintptr_t ptrd = (uintptr_t)*dst;
 2665|      0|    UA_StatusCode retval = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2666|      0|    for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2666:23): [True: 0, False: 0]
  ------------------
 2667|      0|        retval |= UA_copy((void*)ptrs, (void*)ptrd, type);
 2668|      0|        ptrs += type->memSize;
 2669|      0|        ptrd += type->memSize;
 2670|      0|    }
 2671|      0|    if(retval != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2671:8): [True: 0, False: 0]
  ------------------
 2672|      0|        UA_Array_delete(*dst, size, type);
 2673|       |        *dst = NULL;
 2674|      0|    }
 2675|      0|    return retval;
 2676|     96|}
UA_Array_delete:
 2767|  6.77k|UA_Array_delete(void *p, size_t size, const UA_DataType *type) {
 2768|  6.77k|    if(!type->pointerFree) {
  ------------------
  |  Branch (2768:8): [True: 380, False: 6.39k]
  ------------------
 2769|    380|        uintptr_t ptr = (uintptr_t)p;
 2770|    714|        for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2770:27): [True: 334, False: 380]
  ------------------
 2771|    334|            UA_clear((void*)ptr, type);
 2772|    334|            ptr += type->memSize;
 2773|    334|        }
 2774|    380|    }
 2775|  6.77k|    UA_free((void*)((uintptr_t)p & ~(uintptr_t)UA_EMPTY_ARRAY_SENTINEL));
  ------------------
  |  |  351|  6.77k|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2776|  6.77k|}
ua_types.c:casecmp:
  259|    210|casecmp(const UA_Byte *l, const UA_Byte *r, size_t n) {
  260|    210|    if(!n--) return 0;
  ------------------
  |  Branch (260:8): [True: 0, False: 210]
  ------------------
  261|    418|    for(; *l && *r && n && (*l == *r || lowercase(*l) == lowercase(*r)); l++, r++, n--);
  ------------------
  |  Branch (261:11): [True: 418, False: 0]
  |  Branch (261:17): [True: 418, False: 0]
  |  Branch (261:23): [True: 282, False: 136]
  |  Branch (261:29): [True: 207, False: 75]
  |  Branch (261:41): [True: 1, False: 74]
  ------------------
  262|    210|    return lowercase(*l) - lowercase(*r);
  263|    210|}
ua_types.c:lowercase:
  253|    570|lowercase(UA_Byte c) {
  254|    570|    if(((int)c) - 'A' < 26) return c | 32;
  ------------------
  |  Branch (254:8): [True: 402, False: 168]
  ------------------
  255|    168|    return c;
  256|    570|}
ua_types.c:nodeIdSize:
  920|     50|           UA_Escaping idEsc) {
  921|       |    /* Namespace length */
  922|     50|    size_t len = 0;
  923|     50|    if(nsUri.data != NULL) {
  ------------------
  |  Branch (923:8): [True: 0, False: 50]
  ------------------
  924|      0|        len += 5; /* nsu=; */
  925|      0|        len += UA_String_escapedSize(nsUri, UA_ESCAPING_PERCENT);
  926|     50|    } else if(id->namespaceIndex > 0) {
  ------------------
  |  Branch (926:15): [True: 0, False: 50]
  ------------------
  927|      0|        len += 4; /* ns=; */
  928|      0|        size_t nsStrSize = itoaUnsigned(id->namespaceIndex, (char*)nsStr, 10);
  929|      0|        nsStr[nsStrSize] = 0;
  930|      0|        len += nsStrSize;
  931|      0|    }
  932|       |
  933|     50|    len += 2; /* ?= */
  934|       |
  935|     50|    switch (id->identifierType) {
  936|     50|    case UA_NODEIDTYPE_NUMERIC: {
  ------------------
  |  Branch (936:5): [True: 50, False: 0]
  ------------------
  937|     50|        size_t numIdStrSize = itoaUnsigned(id->identifier.numeric, (char*)numIdStr, 10);
  938|     50|        numIdStr[numIdStrSize] = 0;
  939|     50|        len += numIdStrSize;
  940|     50|        break;
  941|      0|    }
  942|      0|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (942:5): [True: 0, False: 50]
  ------------------
  943|      0|        len += UA_String_escapedSize(id->identifier.string, idEsc);
  944|      0|        break;
  945|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (945:5): [True: 0, False: 50]
  ------------------
  946|      0|        len += 36;
  947|      0|        break;
  948|      0|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (948:5): [True: 0, False: 50]
  ------------------
  949|      0|        len += 4 * ((id->identifier.byteString.length + 2) / 3);
  950|      0|        break;
  951|      0|    default:
  ------------------
  |  Branch (951:5): [True: 0, False: 50]
  ------------------
  952|      0|        len = 0;
  953|     50|    }
  954|     50|    return len;
  955|     50|}
ua_types.c:printNodeIdBody:
  959|     50|                const UA_NamespaceMapping *nsMapping, UA_Escaping idEsc) {
  960|     50|    size_t len;
  961|       |
  962|       |    /* Encode the namespace */
  963|     50|    if(nsUri.data != NULL) {
  ------------------
  |  Branch (963:8): [True: 0, False: 50]
  ------------------
  964|      0|        memcpy(pos, "nsu=", 4);
  965|      0|        pos += 4;
  966|      0|        pos += UA_String_escapeInsert(pos, nsUri, UA_ESCAPING_PERCENT);
  967|      0|        *pos++ = ';';
  968|     50|    } else if(id->namespaceIndex > 0) {
  ------------------
  |  Branch (968:15): [True: 0, False: 50]
  ------------------
  969|      0|        memcpy(pos, "ns=", 3);
  970|      0|        pos += 3;
  971|      0|        len = strlen((char*)nsStr);
  972|      0|        memcpy(pos, nsStr, len);
  973|      0|        pos += len;
  974|      0|        *pos++ = ';';
  975|      0|    }
  976|       |
  977|       |    /* Encode the identifier */
  978|     50|    switch(id->identifierType) {
  ------------------
  |  Branch (978:12): [True: 50, False: 0]
  ------------------
  979|     50|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (979:5): [True: 50, False: 0]
  ------------------
  980|     50|        memcpy(pos, "i=", 2);
  981|     50|        pos += 2;
  982|     50|        len = strlen((char*)numIdStr);
  983|     50|        memcpy(pos, numIdStr, len);
  984|     50|        pos += len;
  985|     50|        break;
  986|      0|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (986:5): [True: 0, False: 50]
  ------------------
  987|      0|        memcpy(pos, "s=", 2);
  988|      0|        pos += 2;
  989|      0|        pos += UA_String_escapeInsert(pos, id->identifier.string, idEsc);
  990|      0|        break;
  991|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (991:5): [True: 0, False: 50]
  ------------------
  992|      0|        memcpy(pos, "g=", 2);
  993|      0|        pos += 2;
  994|      0|        UA_Guid_to_hex(&id->identifier.guid, pos, true);
  995|      0|        pos += 36;
  996|      0|        break;
  997|      0|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (997:5): [True: 0, False: 50]
  ------------------
  998|      0|        memcpy(pos, "b=", 2);
  999|      0|        pos += 2;
 1000|       |        /* Use base64url encoding for percent-escaping.
 1001|       |         * Replace +/ with -_ and remove the padding. */
 1002|      0|        u8 *bpos = pos;
 1003|      0|        pos += UA_base64_buf(id->identifier.byteString.data,
 1004|      0|                             id->identifier.byteString.length, pos);
 1005|      0|        if(idEsc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (1005:12): [True: 0, False: 0]
  ------------------
 1006|      0|           idEsc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (1006:12): [True: 0, False: 0]
  ------------------
 1007|      0|            while(pos > bpos && pos[-1] == '=')
  ------------------
  |  Branch (1007:19): [True: 0, False: 0]
  |  Branch (1007:33): [True: 0, False: 0]
  ------------------
 1008|      0|                pos--;
 1009|      0|            for(; bpos < pos; bpos++) {
  ------------------
  |  Branch (1009:19): [True: 0, False: 0]
  ------------------
 1010|      0|                if(*bpos == '+') *bpos = '-';
  ------------------
  |  Branch (1010:20): [True: 0, False: 0]
  ------------------
 1011|      0|                else if(*bpos == '/') *bpos = '_';
  ------------------
  |  Branch (1011:25): [True: 0, False: 0]
  ------------------
 1012|      0|            }
 1013|      0|        }
 1014|      0|        break;
 1015|     50|    }
 1016|     50|    return pos;
 1017|     50|}
ua_types.c:Variant_clear:
 1369|  4.19k|Variant_clear(UA_Variant *p, const UA_DataType *_) {
 1370|       |    /* The content is "borrowed" */
 1371|  4.19k|    if(p->storageType == UA_VARIANT_DATA_NODELETE)
  ------------------
  |  Branch (1371:8): [True: 0, False: 4.19k]
  ------------------
 1372|      0|        return;
 1373|       |
 1374|       |    /* Delete the value */
 1375|  4.19k|    if(p->type && p->data > UA_EMPTY_ARRAY_SENTINEL) {
  ------------------
  |  |  755|  3.80k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1375:8): [True: 3.80k, False: 393]
  |  Branch (1375:19): [True: 3.79k, False: 14]
  ------------------
 1376|  3.79k|        if(p->arrayLength == 0)
  ------------------
  |  Branch (1376:12): [True: 3.79k, False: 0]
  ------------------
 1377|  3.79k|            p->arrayLength = 1;
 1378|  3.79k|        UA_Array_delete(p->data, p->arrayLength, p->type);
 1379|  3.79k|        p->data = NULL;
 1380|  3.79k|    }
 1381|       |
 1382|       |    /* Delete the array dimensions */
 1383|  4.19k|    if((void*)p->arrayDimensions > UA_EMPTY_ARRAY_SENTINEL)
  ------------------
  |  |  755|  4.19k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1383:8): [True: 0, False: 4.19k]
  ------------------
 1384|      0|        UA_free(p->arrayDimensions);
  ------------------
  |  |  351|      0|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1385|  4.19k|}
ua_types.c:DataValue_clear:
 1827|      2|DataValue_clear(UA_DataValue *p, const UA_DataType *_) {
 1828|       |    Variant_clear(&p->value, NULL);
 1829|      2|}
ua_types.c:String_copy:
  280|     96|String_copy(UA_String const *src, UA_String *dst, const UA_DataType *_) {
  281|     96|    UA_StatusCode res =
  282|     96|        UA_Array_copy(src->data, src->length, (void**)&dst->data,
  283|     96|                      &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|     96|#define UA_TYPES_BYTE 2
  ------------------
  284|     96|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|     96|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (284:8): [True: 96, False: 0]
  ------------------
  285|     96|        dst->length = src->length;
  286|     96|    return res;
  287|     96|}
ua_types.c:nopClear:
 2123|    270|static void nopClear(void *p, const UA_DataType *type) { }
ua_types.c:String_clear:
  290|  2.92k|String_clear(UA_String *s, const UA_DataType *_) {
  291|  2.92k|    UA_Array_delete(s->data, s->length, &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|  2.92k|#define UA_TYPES_BYTE 2
  ------------------
  292|  2.92k|}
ua_types.c:NodeId_clear:
  772|     57|NodeId_clear(UA_NodeId *p, const UA_DataType *_) {
  773|     57|    switch(p->identifierType) {
  774|      0|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (774:5): [True: 0, False: 57]
  ------------------
  775|      0|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (775:5): [True: 0, False: 57]
  ------------------
  776|      0|        String_clear(&p->identifier.string, NULL);
  777|      0|        break;
  778|     57|    default: break;
  ------------------
  |  Branch (778:5): [True: 57, False: 0]
  ------------------
  779|     57|    }
  780|     57|}
ua_types.c:ExpandedNodeId_clear:
 1070|     14|ExpandedNodeId_clear(UA_ExpandedNodeId *p, const UA_DataType *_) {
 1071|     14|    NodeId_clear(&p->nodeId, _);
 1072|       |    String_clear(&p->namespaceUri, NULL);
 1073|     14|}
ua_types.c:QualifiedName_clear:
  392|      8|QualifiedName_clear(UA_QualifiedName *p, const UA_DataType *_) {
  393|       |    String_clear(&p->name, NULL);
  394|      8|}
ua_types.c:LocalizedText_clear:
 1812|     14|LocalizedText_clear(UA_LocalizedText *p, const UA_DataType *_) {
 1813|     14|    String_clear(&p->locale, NULL);
 1814|       |    String_clear(&p->text, NULL);
 1815|     14|}
ua_types.c:ExtensionObject_clear:
 1241|     18|ExtensionObject_clear(UA_ExtensionObject *p, const UA_DataType *_) {
 1242|     18|    switch(p->encoding) {
 1243|     18|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (1243:5): [True: 18, False: 0]
  ------------------
 1244|     18|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (1244:5): [True: 0, False: 18]
  ------------------
 1245|     18|    case UA_EXTENSIONOBJECT_ENCODED_XML:
  ------------------
  |  Branch (1245:5): [True: 0, False: 18]
  ------------------
 1246|     18|        NodeId_clear(&p->content.encoded.typeId, NULL);
 1247|     18|        String_clear(&p->content.encoded.body, NULL);
 1248|     18|        break;
 1249|      0|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (1249:5): [True: 0, False: 18]
  ------------------
 1250|      0|        if(p->content.decoded.data)
  ------------------
  |  Branch (1250:12): [True: 0, False: 0]
  ------------------
 1251|      0|            UA_delete(p->content.decoded.data, p->content.decoded.type);
 1252|      0|        break;
 1253|      0|    default:
  ------------------
  |  Branch (1253:5): [True: 0, False: 18]
  ------------------
 1254|      0|        break;
 1255|     18|    }
 1256|     18|}
ua_types.c:DiagnosticInfo_clear:
 1855|      3|DiagnosticInfo_clear(UA_DiagnosticInfo *p, const UA_DataType *_) {
 1856|      3|    String_clear(&p->additionalInfo, NULL);
 1857|      3|    if(p->hasInnerDiagnosticInfo && p->innerDiagnosticInfo) {
  ------------------
  |  Branch (1857:8): [True: 0, False: 3]
  |  Branch (1857:37): [True: 0, False: 0]
  ------------------
 1858|      0|        DiagnosticInfo_clear(p->innerDiagnosticInfo, NULL);
 1859|      0|        UA_free(p->innerDiagnosticInfo);
  ------------------
  |  |  351|      0|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1860|      0|    }
 1861|      3|}
ua_types.c:clearStructure:
 2067|    150|clearStructure(void *p, const UA_DataType *type) {
 2068|    150|    uintptr_t ptr = (uintptr_t)p;
 2069|    705|    for(size_t i = 0; i < type->membersSize; ++i) {
  ------------------
  |  Branch (2069:23): [True: 555, False: 150]
  ------------------
 2070|    555|        const UA_DataTypeMember *m = &type->members[i];
 2071|    555|        const UA_DataType *mt = m->memberType;
 2072|    555|        ptr += m->padding;
 2073|    555|        if(!m->isOptional) {
  ------------------
  |  Branch (2073:12): [True: 555, False: 0]
  ------------------
 2074|    555|            if(!m->isArray) {
  ------------------
  |  Branch (2074:16): [True: 503, False: 52]
  ------------------
 2075|    503|                clearJumpTable[mt->typeKind]((void*)ptr, mt);
 2076|    503|                ptr += mt->memSize;
 2077|    503|            } else {
 2078|     52|                size_t length = *(size_t*)ptr;
 2079|     52|                ptr += sizeof(size_t);
 2080|     52|                UA_Array_delete(*(void**)ptr, length, mt);
 2081|     52|                ptr += sizeof(void*);
 2082|     52|            }
 2083|    555|        } else { /* field is optional */
 2084|      0|            if(!m->isArray) {
  ------------------
  |  Branch (2084:16): [True: 0, False: 0]
  ------------------
 2085|       |                /* optional scalar field is contained */
 2086|      0|                if((*(void *const *)ptr != NULL))
  ------------------
  |  Branch (2086:20): [True: 0, False: 0]
  ------------------
 2087|      0|                    UA_Array_delete(*(void **)ptr, 1, mt);
 2088|      0|                ptr += sizeof(void *);
 2089|      0|            } else {
 2090|       |                /* optional array field is contained */
 2091|      0|                if((*(void *const *)(ptr + sizeof(size_t)) != NULL)) {
  ------------------
  |  Branch (2091:20): [True: 0, False: 0]
  ------------------
 2092|      0|                    size_t length = *(size_t *)ptr;
 2093|      0|                    ptr += sizeof(size_t);
 2094|      0|                    UA_Array_delete(*(void **)ptr, length, mt);
 2095|      0|                    ptr += sizeof(void *);
 2096|      0|                } else { /* optional array field not contained */
 2097|      0|                    ptr += sizeof(size_t);
 2098|      0|                    ptr += sizeof(void *);
 2099|      0|                }
 2100|      0|            }
 2101|      0|        }
 2102|    555|    }
 2103|    150|}
ua_types.c:booleanOrder:
 2178|      2|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2179|      2|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2179:12): [True: 0, False: 2]
  ------------------
 2180|      2|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2180:20): [True: 0, False: 0]
  ------------------
 2181|      2|        return UA_ORDER_EQ;                                         \
 2182|      2|    }
ua_types.c:int16Order:
 2178|     62|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2179|     62|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2179:12): [True: 0, False: 62]
  ------------------
 2180|     62|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2180:20): [True: 0, False: 0]
  ------------------
 2181|     62|        return UA_ORDER_EQ;                                         \
 2182|     62|    }
ua_types.c:uInt16Order:
 2178|     10|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2179|     10|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2179:12): [True: 0, False: 10]
  ------------------
 2180|     10|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2180:20): [True: 0, False: 0]
  ------------------
 2181|     10|        return UA_ORDER_EQ;                                         \
 2182|     10|    }
ua_types.c:int32Order:
 2178|    115|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2179|    115|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2179:12): [True: 0, False: 115]
  ------------------
 2180|    115|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2180:20): [True: 0, False: 0]
  ------------------
 2181|    115|        return UA_ORDER_EQ;                                         \
 2182|    115|    }
ua_types.c:uInt32Order:
 2178|     40|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2179|     40|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2179:12): [True: 0, False: 40]
  ------------------
 2180|     40|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2180:20): [True: 0, False: 0]
  ------------------
 2181|     40|        return UA_ORDER_EQ;                                         \
 2182|     40|    }
ua_types.c:int64Order:
 2178|    194|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2179|    194|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2179:12): [True: 0, False: 194]
  ------------------
 2180|    194|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2180:20): [True: 0, False: 0]
  ------------------
 2181|    194|        return UA_ORDER_EQ;                                         \
 2182|    194|    }
ua_types.c:uInt64Order:
 2178|    103|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2179|    103|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2179:12): [True: 0, False: 103]
  ------------------
 2180|    103|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2180:20): [True: 0, False: 0]
  ------------------
 2181|    103|        return UA_ORDER_EQ;                                         \
 2182|    103|    }
ua_types.c:doubleOrder:
 2196|    593|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2197|    593|        if(*p1 != *p2) {                                            \
  ------------------
  |  Branch (2197:12): [True: 3, False: 590]
  ------------------
 2198|      3|            /* p1 is NaN */                                         \
 2199|      3|            if(*p1 != *p1) {                                        \
  ------------------
  |  Branch (2199:16): [True: 3, False: 0]
  ------------------
 2200|      3|                if(*p2 != *p2)                                      \
  ------------------
  |  Branch (2200:20): [True: 3, False: 0]
  ------------------
 2201|      3|                    return UA_ORDER_EQ;                             \
 2202|      3|                return UA_ORDER_LESS;                               \
 2203|      3|            }                                                       \
 2204|      3|            /* p2 is NaN */                                         \
 2205|      3|            if(*p2 != *p2)                                          \
  ------------------
  |  Branch (2205:16): [True: 0, False: 0]
  ------------------
 2206|      0|                return UA_ORDER_MORE;                               \
 2207|      0|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2207:20): [True: 0, False: 0]
  ------------------
 2208|      0|        }                                                           \
 2209|    593|        return UA_ORDER_EQ;                                         \
 2210|    593|    }
ua_types.c:stringOrder:
 2230|  8.00k|stringOrder(const UA_String *p1, const UA_String *p2, const UA_DataType *type) {
 2231|  8.00k|    if(p1->length != p2->length)
  ------------------
  |  Branch (2231:8): [True: 2.01k, False: 5.99k]
  ------------------
 2232|  2.01k|        return (p1->length < p2->length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2232:16): [True: 1.83k, False: 178]
  ------------------
 2233|       |    /* For zero-length arrays, every pointer not NULL is considered a
 2234|       |     * UA_EMPTY_ARRAY_SENTINEL. */
 2235|  5.99k|    if(p1->data == p2->data) return UA_ORDER_EQ;
  ------------------
  |  Branch (2235:8): [True: 57, False: 5.93k]
  ------------------
 2236|  5.93k|    if(p1->data == NULL) return UA_ORDER_LESS;
  ------------------
  |  Branch (2236:8): [True: 0, False: 5.93k]
  ------------------
 2237|  5.93k|    if(p2->data == NULL) return UA_ORDER_MORE;
  ------------------
  |  Branch (2237:8): [True: 0, False: 5.93k]
  ------------------
 2238|  5.93k|    int cmp = memcmp((const char*)p1->data, (const char*)p2->data, p1->length);
 2239|  5.93k|    if(cmp != 0)
  ------------------
  |  Branch (2239:8): [True: 1.96k, False: 3.97k]
  ------------------
 2240|  1.96k|        return (cmp < 0) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2240:16): [True: 1.29k, False: 668]
  ------------------
 2241|  3.97k|    return UA_ORDER_EQ;
 2242|  5.93k|}
ua_types.c:extensionObjectOrder:
 2300|      1|                     const UA_DataType *_) {
 2301|      1|    UA_ExtensionObjectEncoding enc1 = p1->encoding;
 2302|      1|    UA_ExtensionObjectEncoding enc2 = p2->encoding;
 2303|      1|    if(enc1 > UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2303:8): [True: 0, False: 1]
  ------------------
 2304|      0|        enc1 = UA_EXTENSIONOBJECT_DECODED;
 2305|      1|    if(enc2 > UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2305:8): [True: 0, False: 1]
  ------------------
 2306|      0|        enc2 = UA_EXTENSIONOBJECT_DECODED;
 2307|      1|    if(enc1 != enc2)
  ------------------
  |  Branch (2307:8): [True: 0, False: 1]
  ------------------
 2308|      0|        return (enc1 < enc2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2308:16): [True: 0, False: 0]
  ------------------
 2309|       |
 2310|      1|    switch(enc1) {
 2311|      1|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (2311:5): [True: 1, False: 0]
  ------------------
 2312|      1|        return UA_ORDER_EQ;
 2313|       |
 2314|      0|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (2314:5): [True: 0, False: 1]
  ------------------
 2315|      0|    case UA_EXTENSIONOBJECT_ENCODED_XML: {
  ------------------
  |  Branch (2315:5): [True: 0, False: 1]
  ------------------
 2316|      0|            UA_Order o = nodeIdOrder(&p1->content.encoded.typeId,
 2317|      0|                                     &p2->content.encoded.typeId, NULL);
 2318|      0|            if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2318:16): [True: 0, False: 0]
  ------------------
 2319|      0|                return o;
 2320|      0|            return stringOrder((const UA_String*)&p1->content.encoded.body,
 2321|      0|                               (const UA_String*)&p2->content.encoded.body, NULL);
 2322|      0|        }
 2323|       |
 2324|      0|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (2324:5): [True: 0, False: 1]
  ------------------
 2325|      0|    default: {
  ------------------
  |  Branch (2325:5): [True: 0, False: 1]
  ------------------
 2326|      0|            const UA_DataType *type1 = p1->content.decoded.type;
 2327|      0|            const UA_DataType *type2 = p2->content.decoded.type;
 2328|      0|            if(type1 != type2)
  ------------------
  |  Branch (2328:16): [True: 0, False: 0]
  ------------------
 2329|      0|                return ((uintptr_t)type1 < (uintptr_t)type2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2329:24): [True: 0, False: 0]
  ------------------
 2330|      0|            if(!type1)
  ------------------
  |  Branch (2330:16): [True: 0, False: 0]
  ------------------
 2331|      0|                return UA_ORDER_EQ;
 2332|      0|            return orderJumpTable[type1->typeKind]
 2333|      0|                (p1->content.decoded.data, p2->content.decoded.data, type1);
 2334|      0|        }
 2335|      1|    }
 2336|      1|}
ua_types.c:variantOrder:
 2363|  1.23k|variantOrder(const UA_Variant *p1, const UA_Variant *p2, const UA_DataType *_) {
 2364|  1.23k|    if(p1->type != p2->type)
  ------------------
  |  Branch (2364:8): [True: 0, False: 1.23k]
  ------------------
 2365|      0|        return ((uintptr_t)p1->type < (uintptr_t)p2->type) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2365:16): [True: 0, False: 0]
  ------------------
 2366|       |
 2367|  1.23k|    UA_Order o;
 2368|  1.23k|    if(p1->type != NULL) {
  ------------------
  |  Branch (2368:8): [True: 1.23k, False: 0]
  ------------------
 2369|       |        /* Check if both variants are scalars or arrays */
 2370|  1.23k|        UA_Boolean s1 = UA_Variant_isScalar(p1);
 2371|  1.23k|        UA_Boolean s2 = UA_Variant_isScalar(p2);
 2372|  1.23k|        if(s1 != s2)
  ------------------
  |  Branch (2372:12): [True: 0, False: 1.23k]
  ------------------
 2373|      0|            return s1 ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2373:20): [True: 0, False: 0]
  ------------------
 2374|  1.23k|        if(s1) {
  ------------------
  |  Branch (2374:12): [True: 1.22k, False: 7]
  ------------------
 2375|  1.22k|            o = orderJumpTable[p1->type->typeKind](p1->data, p2->data, p1->type);
 2376|  1.22k|        } else {
 2377|       |            /* Mismatching array length? */
 2378|      7|            if(p1->arrayLength != p2->arrayLength)
  ------------------
  |  Branch (2378:16): [True: 0, False: 7]
  ------------------
 2379|      0|                return (p1->arrayLength < p2->arrayLength) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2379:24): [True: 0, False: 0]
  ------------------
 2380|      7|            o = arrayOrder(p1->data, p1->arrayLength, p2->data, p2->arrayLength, p1->type);
 2381|      7|        }
 2382|  1.23k|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2382:12): [True: 0, False: 1.23k]
  ------------------
 2383|      0|            return o;
 2384|  1.23k|    }
 2385|       |
 2386|  1.23k|    if(p1->arrayDimensionsSize != p2->arrayDimensionsSize)
  ------------------
  |  Branch (2386:8): [True: 0, False: 1.23k]
  ------------------
 2387|      0|        return (p1->arrayDimensionsSize < p2->arrayDimensionsSize) ?
  ------------------
  |  Branch (2387:16): [True: 0, False: 0]
  ------------------
 2388|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2389|  1.23k|    o = UA_ORDER_EQ;
 2390|  1.23k|    if(p1->arrayDimensionsSize > 0)
  ------------------
  |  Branch (2390:8): [True: 0, False: 1.23k]
  ------------------
 2391|      0|        o = arrayOrder(p1->arrayDimensions, p1->arrayDimensionsSize,
 2392|      0|                       p2->arrayDimensions, p2->arrayDimensionsSize,
 2393|      0|                       &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  225|      0|#define UA_TYPES_UINT32 6
  ------------------
 2394|  1.23k|    return o;
 2395|  1.23k|}
ua_types.c:arrayOrder:
 2347|      7|           const UA_DataType *type) {
 2348|      7|    if(p1Length != p2Length)
  ------------------
  |  Branch (2348:8): [True: 0, False: 7]
  ------------------
 2349|      0|        return (p1Length < p2Length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2349:16): [True: 0, False: 0]
  ------------------
 2350|      7|    uintptr_t u1 = (uintptr_t)p1;
 2351|      7|    uintptr_t u2 = (uintptr_t)p2;
 2352|      7|    for(size_t i = 0; i < p1Length; i++) {
  ------------------
  |  Branch (2352:23): [True: 0, False: 7]
  ------------------
 2353|      0|        UA_Order o = orderJumpTable[type->typeKind]((const void*)u1, (const void*)u2, type);
 2354|      0|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2354:12): [True: 0, False: 0]
  ------------------
 2355|      0|            return o;
 2356|      0|        u1 += type->memSize;
 2357|      0|        u2 += type->memSize;
 2358|      0|    }
 2359|      7|    return UA_ORDER_EQ;
 2360|      7|}

xml_tokenize:
   39|  8.08k|             xml_token *tokens, unsigned int max_tokens) {
   40|  8.08k|    xml_result res;
   41|  8.08k|    memset(&res, 0, sizeof(xml_result));
   42|  8.08k|    res.tokens = tokens;
   43|       |
   44|  8.08k|    yxml_t ctx;
   45|  8.08k|    char buf[512];
   46|  8.08k|    yxml_init(&ctx, buf, 512);
   47|       |
   48|  8.08k|    unsigned char top = 0;
   49|  8.08k|    unsigned tokenPos = 0;
   50|  8.08k|    xml_token *stack[32]; /* Max nesting depth is 32 */
   51|  8.08k|    xml_token backup_tokens[32]; /* To be used when the tokens run out */
   52|       |
   53|       |    /* Help clang-analyzer */
   54|       |#ifdef __clang_analyzer__
   55|       |    memset(stack, 0, 32 * sizeof(void*));
   56|       |    memset(backup_tokens, 0, 32 * sizeof(xml_token));
   57|       |#endif
   58|       |
   59|  8.08k|    stack[top] = &backup_tokens[top];
   60|  8.08k|    memset(stack[top], 0, sizeof(xml_token));
   61|       |
   62|  8.08k|    unsigned val_begin = 0;
   63|  8.08k|    unsigned pos = 0;
   64|   127M|    for(; pos < len; pos++) {
  ------------------
  |  Branch (64:11): [True: 127M, False: 6.85k]
  ------------------
   65|       |#ifdef __clang_analyzer__
   66|       |        UA_assert(stack[top] != NULL);
   67|       |#endif
   68|   127M|        yxml_ret_t xml_status = yxml_parse(&ctx, xml[pos]);
   69|   127M|        switch(xml_status) {
   70|      0|        case YXML_EEOF:
  ------------------
  |  Branch (70:9): [True: 0, False: 127M]
  ------------------
   71|    212|        case YXML_EREF:
  ------------------
  |  Branch (71:9): [True: 212, False: 127M]
  ------------------
   72|    309|        case YXML_ECLOSE:
  ------------------
  |  Branch (72:9): [True: 97, False: 127M]
  ------------------
   73|    316|        case YXML_ESTACK:
  ------------------
  |  Branch (73:9): [True: 7, False: 127M]
  ------------------
   74|  1.17k|        case YXML_ESYN:
  ------------------
  |  Branch (74:9): [True: 859, False: 127M]
  ------------------
   75|  1.17k|        default:
  ------------------
  |  Branch (75:9): [True: 0, False: 127M]
  ------------------
   76|  1.17k|            goto errout;
   77|  73.9M|        case YXML_OK:
  ------------------
  |  Branch (77:9): [True: 73.9M, False: 53.7M]
  ------------------
   78|  73.9M|            continue;
   79|  10.5M|        case YXML_ELEMSTART:
  ------------------
  |  Branch (79:9): [True: 10.5M, False: 117M]
  ------------------
   80|  14.7M|        case YXML_ATTRSTART: {
  ------------------
  |  Branch (80:9): [True: 4.13M, False: 123M]
  ------------------
   81|  14.7M|            if(xml_status == YXML_ELEMSTART) {
  ------------------
  |  Branch (81:16): [True: 10.5M, False: 4.13M]
  ------------------
   82|  10.5M|                stack[top]->children++;
   83|  10.5M|                stack[top]->content = UA_STRING_NULL; /* Only the leaf elements have content */
   84|  10.5M|            } else {
   85|  4.13M|                stack[top]->attributes++;
   86|  4.13M|            }
   87|  14.7M|            top++;
   88|  14.7M|            if(top >= 32)
  ------------------
  |  Branch (88:16): [True: 5, False: 14.7M]
  ------------------
   89|      5|                goto errout; /* nesting too deep */
   90|  14.7M|            stack[top] = (tokenPos < max_tokens) ? &tokens[tokenPos] : &backup_tokens[top];
  ------------------
  |  Branch (90:26): [True: 7.22M, False: 7.48M]
  ------------------
   91|  14.7M|            memset(stack[top], 0, sizeof(xml_token));
   92|  14.7M|            stack[top]->type = (xml_status == YXML_ELEMSTART) ? XML_TOKEN_ELEMENT : XML_TOKEN_ATTRIBUTE;
  ------------------
  |  Branch (92:32): [True: 10.5M, False: 4.13M]
  ------------------
   93|  14.7M|            stack[top]->name = backtrackName(xml, pos);
   94|  14.7M|            const char *start = xml + pos;
   95|  14.7M|            if(xml_status == YXML_ELEMSTART) {
  ------------------
  |  Branch (95:16): [True: 10.5M, False: 4.13M]
  ------------------
   96|  32.2M|                while(*start != '<')
  ------------------
  |  Branch (96:23): [True: 21.6M, False: 10.5M]
  ------------------
   97|  21.6M|                    start--;
   98|  10.5M|            }
   99|  14.7M|            stack[top]->start = (unsigned)(start - xml);
  100|  14.7M|            tokenPos++;
  101|  14.7M|            val_begin = 0; /* if the previous non-leaf element started to collect content */
  102|  14.7M|            break;
  103|  14.7M|        }
  104|  23.8M|        case YXML_CONTENT:
  ------------------
  |  Branch (104:9): [True: 23.8M, False: 103M]
  ------------------
  105|  24.2M|        case YXML_ATTRVAL:
  ------------------
  |  Branch (105:9): [True: 328k, False: 127M]
  ------------------
  106|  24.2M|            if(val_begin == 0)
  ------------------
  |  Branch (106:16): [True: 233k, False: 23.9M]
  ------------------
  107|   233k|                val_begin = pos;
  108|  24.2M|            stack[top]->end = pos;
  109|  24.2M|            break;
  110|  10.5M|        case YXML_ELEMEND:
  ------------------
  |  Branch (110:9): [True: 10.5M, False: 117M]
  ------------------
  111|  14.7M|        case YXML_ATTREND:
  ------------------
  |  Branch (111:9): [True: 4.13M, False: 123M]
  ------------------
  112|  14.7M|            if(val_begin > 0) {
  ------------------
  |  Branch (112:16): [True: 19.0k, False: 14.6M]
  ------------------
  113|  19.0k|                stack[top]->content.data = (UA_Byte*)(uintptr_t)xml + val_begin;
  114|  19.0k|                stack[top]->content.length = stack[top]->end + 1 - val_begin;
  115|  19.0k|            }
  116|  14.7M|            stack[top]->end = pos;
  117|  14.7M|            if(xml_status == YXML_ELEMEND) {
  ------------------
  |  Branch (117:16): [True: 10.5M, False: 4.13M]
  ------------------
  118|       |                /* Saw "</", looking for the closing ">" */
  119|  11.1M|                while(stack[top]->end < len && xml[stack[top]->end] != '>')
  ------------------
  |  Branch (119:23): [True: 11.1M, False: 46]
  |  Branch (119:48): [True: 609k, False: 10.5M]
  ------------------
  120|   609k|                    stack[top]->end++;
  121|  10.5M|                stack[top]->end++;
  122|  10.5M|                if(stack[top]->end > len)
  ------------------
  |  Branch (122:20): [True: 46, False: 10.5M]
  ------------------
  123|     46|                    goto errout;
  124|  10.5M|            }
  125|  14.7M|            val_begin = 0;
  126|  14.7M|            top--;
  127|  14.7M|            break;
  128|  3.68k|        case YXML_PISTART:
  ------------------
  |  Branch (128:9): [True: 3.68k, False: 127M]
  ------------------
  129|   125k|        case YXML_PICONTENT:
  ------------------
  |  Branch (129:9): [True: 121k, False: 127M]
  ------------------
  130|   128k|        case YXML_PIEND:
  ------------------
  |  Branch (130:9): [True: 3.53k, False: 127M]
  ------------------
  131|   128k|            continue; /* Ignore processing instructions */
  132|   127M|        }
  133|   127M|    }
  134|       |
  135|       |    /* Check that all elements were closed */
  136|  6.85k|    if(yxml_eof(&ctx) != YXML_OK)
  ------------------
  |  Branch (136:8): [True: 2.16k, False: 4.69k]
  ------------------
  137|  2.16k|        goto errout;
  138|       |
  139|  4.69k|    res.num_tokens = tokenPos;
  140|  4.69k|    if(tokenPos > max_tokens)
  ------------------
  |  Branch (140:8): [True: 511, False: 4.18k]
  ------------------
  141|    511|        res.error = XML_ERROR_OVERFLOW;
  142|  4.69k|    return res;
  143|       |
  144|  3.38k| errout:
  145|  3.38k|    res.error_pos = pos;
  146|  3.38k|    res.error = XML_ERROR_INVALID;
  147|  3.38k|    return res;
  148|  6.85k|}
UA_encodeXml:
  590|  2.46k|             const UA_EncodeXmlOptions *options) {
  591|  2.46k|    if(!src || !type)
  ------------------
  |  Branch (591:8): [True: 0, False: 2.46k]
  |  Branch (591:16): [True: 0, False: 2.46k]
  ------------------
  592|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
  593|       |
  594|       |    /* Allocate buffer */
  595|  2.46k|    UA_Boolean allocated = false;
  596|  2.46k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  2.46k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  597|  2.46k|    if(outBuf->length == 0) {
  ------------------
  |  Branch (597:8): [True: 0, False: 2.46k]
  ------------------
  598|      0|        size_t len = UA_calcSizeXml(src, type, options);
  599|      0|        res = UA_ByteString_allocBuffer(outBuf, len);
  600|      0|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (600:12): [True: 0, False: 0]
  ------------------
  601|      0|            return res;
  602|      0|        allocated = true;
  603|      0|    }
  604|       |
  605|       |    /* Set up the context */
  606|  2.46k|    CtxXml ctx;
  607|  2.46k|    memset(&ctx, 0, sizeof(ctx));
  608|  2.46k|    ctx.pos = outBuf->data;
  609|  2.46k|    ctx.end = &outBuf->data[outBuf->length];
  610|  2.46k|    ctx.depth = 0;
  611|  2.46k|    ctx.calcOnly = false;
  612|  2.46k|    if(options) {
  ------------------
  |  Branch (612:8): [True: 0, False: 2.46k]
  ------------------
  613|      0|        ctx.namespaceMapping = options->namespaceMapping;
  614|      0|        ctx.serverUris = options->serverUris;
  615|      0|        ctx.serverUrisSize = options->serverUrisSize;
  616|      0|    }
  617|       |
  618|       |    /* Encode */
  619|  2.46k|    res = writeXmlElement(&ctx, type->typeName, src, type);
  620|       |
  621|       |    /* Clean up */
  622|  2.46k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  2.46k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (622:8): [True: 2.46k, False: 0]
  ------------------
  623|  2.46k|        outBuf->length = (size_t)((uintptr_t)ctx.pos - (uintptr_t)outBuf->data);
  624|      0|    else if(allocated)
  ------------------
  |  Branch (624:13): [True: 0, False: 0]
  ------------------
  625|      0|        UA_ByteString_clear(outBuf);
  626|       |
  627|  2.46k|    return res;
  628|  2.46k|}
UA_calcSizeXml:
  636|  1.33k|               const UA_EncodeXmlOptions *options) {
  637|  1.33k|    if(!src || !type)
  ------------------
  |  Branch (637:8): [True: 0, False: 1.33k]
  |  Branch (637:16): [True: 0, False: 1.33k]
  ------------------
  638|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
  639|       |
  640|       |    /* Set up the context */
  641|  1.33k|    CtxXml ctx;
  642|  1.33k|    memset(&ctx, 0, sizeof(ctx));
  643|  1.33k|    ctx.pos = NULL;
  644|  1.33k|    ctx.end = (const UA_Byte*)(uintptr_t)SIZE_MAX;
  645|  1.33k|    ctx.depth = 0;
  646|  1.33k|    if(options) {
  ------------------
  |  Branch (646:8): [True: 0, False: 1.33k]
  ------------------
  647|      0|        ctx.namespaceMapping = options->namespaceMapping;
  648|      0|        ctx.serverUris = options->serverUris;
  649|      0|        ctx.serverUrisSize = options->serverUrisSize;
  650|      0|    }
  651|       |
  652|  1.33k|    ctx.calcOnly = true;
  653|       |
  654|       |    /* Encode */
  655|  1.33k|    status ret = writeXmlElement(&ctx, type->typeName, src, type);
  656|  1.33k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  1.33k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (656:8): [True: 106, False: 1.23k]
  ------------------
  657|    106|        return 0;
  658|  1.23k|    return (size_t)ctx.pos;
  659|  1.33k|}
UA_decodeXml:
 1532|  7.57k|             const UA_DecodeXmlOptions *options) {
 1533|  7.57k|    if(!dst || !src || !type)
  ------------------
  |  Branch (1533:8): [True: 0, False: 7.57k]
  |  Branch (1533:16): [True: 0, False: 7.57k]
  |  Branch (1533:24): [True: 0, False: 7.57k]
  ------------------
 1534|      0|        return UA_STATUSCODE_BADARGUMENTSMISSING;
  ------------------
  |  |  448|      0|#define UA_STATUSCODE_BADARGUMENTSMISSING ((UA_StatusCode) 0x80760000)
  ------------------
 1535|       |
 1536|       |    /* Tokenize. Add a fake wrapper element if options->unwrapped is enabled. */
 1537|  7.57k|    unsigned tokensSize = 63;
 1538|  7.57k|    xml_token tokenbuf[64];
 1539|  7.57k|    xml_token *tokens = tokenbuf;
 1540|       |
 1541|  7.57k|    xml_result res = xml_tokenize((char*)src->data, (unsigned)src->length,
 1542|  7.57k|                                  tokens + 1, tokensSize);
 1543|  7.57k|    if(res.error == XML_ERROR_OVERFLOW) {
  ------------------
  |  Branch (1543:8): [True: 511, False: 7.06k]
  ------------------
 1544|    511|        tokens = (xml_token*)UA_malloc(sizeof(xml_token) * (res.num_tokens + 1));
  ------------------
  |  |  350|    511|# define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 1545|    511|        if(!tokens)
  ------------------
  |  Branch (1545:12): [True: 0, False: 511]
  ------------------
 1546|      0|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1547|    511|        res = xml_tokenize((char*)src->data, (unsigned)src->length,
 1548|    511|                           tokens + 1, res.num_tokens);
 1549|    511|    }
 1550|       |
 1551|  7.57k|    if(res.error != XML_ERROR_NONE || res.num_tokens == 0) {
  ------------------
  |  Branch (1551:8): [True: 3.38k, False: 4.18k]
  |  Branch (1551:39): [True: 0, False: 4.18k]
  ------------------
 1552|  3.38k|        if(tokens != tokenbuf)
  ------------------
  |  Branch (1552:12): [True: 0, False: 3.38k]
  ------------------
 1553|      0|            UA_free(tokens);
  ------------------
  |  |  351|      0|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1554|  3.38k|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|  3.38k|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1555|  3.38k|    }
 1556|       |
 1557|       |    /* Set up the context */
 1558|  4.18k|    ParseCtxXml ctx;
 1559|  4.18k|    memset(&ctx, 0, sizeof(ParseCtxXml));
 1560|  4.18k|    ctx.xml = (const char*)src->data;
 1561|  4.18k|    ctx.tokens = tokens;
 1562|  4.18k|    ctx.tokensSize = res.num_tokens;
 1563|  4.18k|    if(options) {
  ------------------
  |  Branch (1563:8): [True: 0, False: 4.18k]
  ------------------
 1564|      0|        ctx.customTypes = options->customTypes;
 1565|      0|        ctx.namespaceMapping = options->namespaceMapping;
 1566|      0|        ctx.serverUris = options->serverUris;
 1567|      0|        ctx.serverUrisSize = options->serverUrisSize;
 1568|      0|    }
 1569|       |
 1570|  4.18k|    if(options && options->unwrapped) {
  ------------------
  |  Branch (1570:8): [True: 0, False: 4.18k]
  |  Branch (1570:19): [True: 0, False: 0]
  ------------------
 1571|       |        /* Set up the fake wrapper element */
 1572|      0|        xml_token *tok = tokens;
 1573|      0|        memset(tok, 0, sizeof(xml_token));
 1574|      0|        tok->type = XML_TOKEN_ELEMENT;
 1575|      0|        tok->name = UA_STRING((char*)(uintptr_t)type->typeName);
 1576|      0|        tok->children = 1;
 1577|      0|        tok->start = 0;
 1578|      0|        tok->end = (unsigned)src->length;
 1579|      0|        ctx.tokensSize++;
 1580|  4.18k|    } else {
 1581|  4.18k|        ctx.tokens++; /* Skip the first token */
 1582|  4.18k|    }
 1583|       |
 1584|       |    /* Decode */
 1585|  4.18k|    memset(dst, 0, type->memSize); /* Initialize the value */
 1586|  4.18k|    UA_StatusCode ret = decodeXmlJumpTable[type->typeKind](&ctx, dst, type);
 1587|  4.18k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  4.18k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1587:8): [True: 1.61k, False: 2.57k]
  ------------------
 1588|  1.61k|        UA_clear(dst, type);
 1589|       |
 1590|       |    /* Clean up */
 1591|  4.18k|    if(tokens != tokenbuf)
  ------------------
  |  Branch (1591:8): [True: 511, False: 3.67k]
  ------------------
 1592|    511|        UA_free(tokens);
  ------------------
  |  |  351|    511|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1593|  4.18k|    return ret;
 1594|  7.57k|}
ua_types_encoding_xml.c:backtrackName:
   23|  14.7M|backtrackName(const char *xml, unsigned end) {
   24|  14.7M|    unsigned pos = end;
   25|  66.4M|    for(; pos > 0; pos--) {
  ------------------
  |  Branch (25:11): [True: 66.4M, False: 0]
  ------------------
   26|  66.4M|        unsigned char c = (unsigned char)xml[pos-1];
   27|  66.4M|        if(c >= 'a' && c <= 'z') continue; /* isAlpha */
  ------------------
  |  Branch (27:12): [True: 51.3M, False: 15.1M]
  |  Branch (27:24): [True: 4.72M, False: 46.6M]
  ------------------
   28|  61.7M|        if(c >= 'A' && c <= 'Z') continue; /* isAlpha */
  ------------------
  |  Branch (28:12): [True: 46.9M, False: 14.7M]
  |  Branch (28:24): [True: 323k, False: 46.6M]
  ------------------
   29|  61.3M|        if(c >= '0' && c <= '9') continue; /* isNum */
  ------------------
  |  Branch (29:12): [True: 57.2M, False: 4.13M]
  |  Branch (29:24): [True: 73.9k, False: 57.1M]
  ------------------
   30|  61.3M|        if(c == '_' || c >= 128 || c == '-'|| c == '.') continue;
  ------------------
  |  Branch (30:12): [True: 3.84k, False: 61.3M]
  |  Branch (30:24): [True: 46.6M, False: 14.7M]
  |  Branch (30:36): [True: 1.20k, False: 14.7M]
  |  Branch (30:47): [True: 2.56k, False: 14.7M]
  ------------------
   31|  14.7M|        break;
   32|  61.3M|    }
   33|  14.7M|    UA_String s = {end - pos, (UA_Byte*)(uintptr_t)xml + pos};
   34|  14.7M|    return s;
   35|  14.7M|}
ua_types_encoding_xml.c:Boolean_encodeXml:
  233|      6|ENCODE_XML(Boolean) {
  234|      6|    if(*src == true)
  ------------------
  |  Branch (234:8): [True: 3, False: 3]
  ------------------
  235|      3|        return xmlEncodeWriteChars(ctx, "true", 4);
  236|      3|    return xmlEncodeWriteChars(ctx, "false", 5);
  237|      6|}
ua_types_encoding_xml.c:xmlEncodeWriteChars:
  189|  72.6k|xmlEncodeWriteChars(CtxXml *ctx, const char *c, size_t len) {
  190|  72.6k|    if(ctx->pos + len > ctx->end)
  ------------------
  |  Branch (190:8): [True: 0, False: 72.6k]
  ------------------
  191|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  192|  72.6k|    if(!ctx->calcOnly && len)
  ------------------
  |  Branch (192:8): [True: 46.7k, False: 25.8k]
  |  Branch (192:26): [True: 46.6k, False: 62]
  ------------------
  193|  46.6k|        memcpy(ctx->pos, c, len);
  194|  72.6k|    ctx->pos += len;
  195|  72.6k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  72.6k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  196|  72.6k|}
ua_types_encoding_xml.c:encodeSigned:
  239|  1.11k|static status encodeSigned(CtxXml *ctx, UA_Int64 value, char* buffer) {
  240|  1.11k|    UA_UInt16 digits = itoaSigned(value, buffer);
  241|  1.11k|    return xmlEncodeWriteChars(ctx, buffer, digits);
  242|  1.11k|}
ua_types_encoding_xml.c:encodeUnsigned:
  244|    459|static status encodeUnsigned(CtxXml *ctx, UA_UInt64 value, char* buffer) {
  245|    459|    UA_UInt16 digits = itoaUnsigned(value, buffer, 10);
  246|    459|    return xmlEncodeWriteChars(ctx, buffer, digits);
  247|    459|}
ua_types_encoding_xml.c:Int16_encodeXml:
  262|    186|ENCODE_XML(Int16) {
  263|    186|    char buf[7];
  264|    186|    return encodeSigned(ctx, *src, buf);
  265|    186|}
ua_types_encoding_xml.c:UInt16_encodeXml:
  268|     30|ENCODE_XML(UInt16) {
  269|     30|    char buf[6];
  270|     30|    return encodeUnsigned(ctx, *src, buf);
  271|     30|}
ua_types_encoding_xml.c:Int32_encodeXml:
  274|    345|ENCODE_XML(Int32) {
  275|    345|    char buf[12];
  276|    345|    return encodeSigned(ctx, *src, buf);
  277|    345|}
ua_types_encoding_xml.c:UInt32_encodeXml:
  280|    120|ENCODE_XML(UInt32) {
  281|    120|    char buf[11];
  282|    120|    return encodeUnsigned(ctx, *src, buf);
  283|    120|}
ua_types_encoding_xml.c:Int64_encodeXml:
  286|    582|ENCODE_XML(Int64) {
  287|    582|    char buf[23];
  288|    582|    return encodeSigned(ctx, *src, buf);
  289|    582|}
ua_types_encoding_xml.c:UInt64_encodeXml:
  292|    309|ENCODE_XML(UInt64) {
  293|    309|    char buf[23];
  294|    309|    return encodeUnsigned(ctx, *src, buf);
  295|    309|}
ua_types_encoding_xml.c:Double_encodeXml:
  317|  1.77k|ENCODE_XML(Double) {
  318|  1.77k|    char buffer[32];
  319|  1.77k|    size_t len;
  320|  1.77k|    if(*src != *src) {
  ------------------
  |  Branch (320:8): [True: 9, False: 1.77k]
  ------------------
  321|      9|        strcpy(buffer, "NaN");
  322|      9|        len = strlen(buffer);
  323|  1.77k|    } else if(*src == INFINITY) {
  ------------------
  |  Branch (323:15): [True: 6, False: 1.76k]
  ------------------
  324|      6|        strcpy(buffer, "INF");
  325|      6|        len = strlen(buffer);
  326|  1.76k|    } else if(*src == -INFINITY) {
  ------------------
  |  Branch (326:15): [True: 6, False: 1.75k]
  ------------------
  327|      6|        strcpy(buffer, "-INF");
  328|      6|        len = strlen(buffer);
  329|  1.75k|    } else {
  330|  1.75k|        len = dtoa(*src, buffer);
  331|  1.75k|    }
  332|  1.77k|    return xmlEncodeWriteChars(ctx, buffer, len);
  333|  1.77k|}
ua_types_encoding_xml.c:String_encodeXml:
  336|    287|ENCODE_XML(String) {
  337|    287|    return xmlEncodeWriteChars(ctx, (const char*)src->data, src->length);
  338|    287|}
ua_types_encoding_xml.c:ByteString_encodeXml:
  358|     78|ENCODE_XML(ByteString) {
  359|     78|    if(!src->data)
  ------------------
  |  Branch (359:8): [True: 0, False: 78]
  ------------------
  360|      0|        return xmlEncodeWriteChars(ctx, "null", 4);
  361|       |
  362|     78|    if(src->length == 0)
  ------------------
  |  Branch (362:8): [True: 78, False: 0]
  ------------------
  363|     78|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     78|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  364|       |
  365|      0|    size_t flen = 0;
  366|      0|    unsigned char *ba64 = UA_base64(src->data, src->length, &flen);
  367|       |
  368|       |    /* Not converted, no mem */
  369|      0|    if(!ba64)
  ------------------
  |  Branch (369:8): [True: 0, False: 0]
  ------------------
  370|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  371|       |
  372|      0|    if(ctx->pos + flen > ctx->end) {
  ------------------
  |  Branch (372:8): [True: 0, False: 0]
  ------------------
  373|      0|        UA_free(ba64);
  ------------------
  |  |  351|      0|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  374|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  375|      0|    }
  376|       |
  377|       |    /* Copy flen bytes to output stream. */
  378|      0|    if(!ctx->calcOnly)
  ------------------
  |  Branch (378:8): [True: 0, False: 0]
  ------------------
  379|      0|        memcpy(ctx->pos, ba64, flen);
  380|      0|    ctx->pos += flen;
  381|       |
  382|       |    /* Base64 result no longer needed */
  383|      0|    UA_free(ba64);
  ------------------
  |  |  351|      0|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  384|       |
  385|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  386|      0|}
ua_types_encoding_xml.c:encodeXmlNotImplemented:
  549|     50|encodeXmlNotImplemented(CtxXml *ctx, const void *src, const UA_DataType *type) {
  550|     50|    (void)ctx, (void)src, (void)type;
  551|     50|    return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  238|     50|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
  552|     50|}
ua_types_encoding_xml.c:NodeId_encodeXml:
  389|     50|ENCODE_XML(NodeId) {
  390|     50|    UA_StatusCode ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     50|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  391|     50|    UA_String out = UA_STRING_NULL;
  392|     50|    ret |= UA_NodeId_printEx(src, &out, ctx->namespaceMapping);
  393|     50|    ret |= writeXmlElement(ctx, UA_XML_NODEID_IDENTIFIER,
  ------------------
  |  |  166|     50|#define UA_XML_NODEID_IDENTIFIER "Identifier"
  ------------------
  394|     50|                           &out, &UA_TYPES[UA_TYPES_STRING]);
  ------------------
  |  |  395|     50|#define UA_TYPES_STRING 11
  ------------------
  395|     50|    UA_String_clear(&out);
  396|     50|    return ret;
  397|     50|}
ua_types_encoding_xml.c:ExtensionObject_encodeXml:
  444|     53|ENCODE_XML(ExtensionObject) {
  445|     53|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_NOBODY)
  ------------------
  |  Branch (445:8): [True: 3, False: 50]
  ------------------
  446|      3|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      3|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  447|       |
  448|       |    /* The body of the ExtensionObject contains a single element
  449|       |     * which is either a ByteString or XML encoded Structure:
  450|       |     * https://reference.opcfoundation.org/Core/Part6/v104/docs/5.3.1.16. */
  451|     50|    UA_StatusCode ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     50|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  452|     50|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_BYTESTRING ||
  ------------------
  |  Branch (452:8): [True: 0, False: 50]
  ------------------
  453|     50|       src->encoding == UA_EXTENSIONOBJECT_ENCODED_XML) {
  ------------------
  |  Branch (453:8): [True: 0, False: 50]
  ------------------
  454|       |        /* Write the type NodeId */
  455|      0|        ret = writeXmlElement(ctx, UA_XML_EXTENSIONOBJECT_TYPEID,
  ------------------
  |  |  173|      0|#define UA_XML_EXTENSIONOBJECT_TYPEID "TypeId"
  ------------------
  456|      0|                              &src->content.encoded.typeId,
  457|      0|                              &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|      0|#define UA_TYPES_NODEID 16
  ------------------
  458|       |
  459|       |        /* Write the body */
  460|      0|        ret |= writeXmlElemNameBegin(ctx, UA_XML_EXTENSIONOBJECT_BODY);
  ------------------
  |  |  174|      0|#define UA_XML_EXTENSIONOBJECT_BODY "Body"
  ------------------
  461|      0|        if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_BYTESTRING)
  ------------------
  |  Branch (461:12): [True: 0, False: 0]
  ------------------
  462|      0|           ret |= writeXmlElement(ctx, "ByteString", &src->content.encoded.body,
  463|      0|                                  &UA_TYPES[UA_TYPES_BYTESTRING]);
  ------------------
  |  |  497|      0|#define UA_TYPES_BYTESTRING 14
  ------------------
  464|      0|        else
  465|      0|            ret |= ENCODE_DIRECT_XML(&src->content.encoded.body, String);
  ------------------
  |  |  186|      0|    TYPE##_encodeXml(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  466|      0|        ret |= writeXmlElemNameEnd(ctx, UA_XML_EXTENSIONOBJECT_BODY);
  ------------------
  |  |  174|      0|#define UA_XML_EXTENSIONOBJECT_BODY "Body"
  ------------------
  467|     50|    } else {
  468|       |        /* Write the decoded value */
  469|     50|        const UA_DataType *decoded_type = src->content.decoded.type;
  470|       |
  471|       |        /* Write the type NodeId */
  472|     50|        ret = writeXmlElement(ctx, UA_XML_EXTENSIONOBJECT_TYPEID,
  ------------------
  |  |  173|     50|#define UA_XML_EXTENSIONOBJECT_TYPEID "TypeId"
  ------------------
  473|     50|                              &decoded_type->typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|     50|#define UA_TYPES_NODEID 16
  ------------------
  474|       |
  475|       |        /* Write the body */
  476|     50|        ret |= writeXmlElemNameBegin(ctx, UA_XML_EXTENSIONOBJECT_BODY);
  ------------------
  |  |  174|     50|#define UA_XML_EXTENSIONOBJECT_BODY "Body"
  ------------------
  477|     50|        ret |= writeXmlElement(ctx, decoded_type->typeName, src->content.decoded.data, decoded_type);
  478|     50|        ret |= writeXmlElemNameEnd(ctx, UA_XML_EXTENSIONOBJECT_BODY);
  ------------------
  |  |  174|     50|#define UA_XML_EXTENSIONOBJECT_BODY "Body"
  ------------------
  479|     50|    }
  480|       |
  481|     50|    return ret;
  482|     53|}
ua_types_encoding_xml.c:writeXmlElemNameBegin:
  199|  11.4k|writeXmlElemNameBegin(CtxXml *ctx, const char* name) {
  200|  11.4k|    if(ctx->depth >= UA_XML_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   15|  11.4k|#define UA_XML_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (200:8): [True: 0, False: 11.4k]
  ------------------
  201|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  202|  11.4k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  11.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  203|  11.4k|    ret |= xmlEncodeWriteChars(ctx, "<", 1);
  204|  11.4k|    ret |= xmlEncodeWriteChars(ctx, name, strlen(name));
  205|  11.4k|    ret |= xmlEncodeWriteChars(ctx, ">", 1);
  206|  11.4k|    ctx->depth++;
  207|  11.4k|    return ret;
  208|  11.4k|}
ua_types_encoding_xml.c:writeXmlElemNameEnd:
  211|  11.4k|writeXmlElemNameEnd(CtxXml *ctx, const char* name) {
  212|  11.4k|    if(ctx->depth == 0)
  ------------------
  |  Branch (212:8): [True: 0, False: 11.4k]
  ------------------
  213|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  214|  11.4k|    ctx->depth--;
  215|  11.4k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  11.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  216|  11.4k|    ret |= xmlEncodeWriteChars(ctx, "</", 2);
  217|  11.4k|    ret |= xmlEncodeWriteChars(ctx, name, strlen(name));
  218|  11.4k|    ret |= xmlEncodeWriteChars(ctx, ">", 1);
  219|  11.4k|    return ret;
  220|  11.4k|}
ua_types_encoding_xml.c:Variant_encodeXml:
  518|  3.80k|ENCODE_XML(Variant) {
  519|  3.80k|    if(!src->type)
  ------------------
  |  Branch (519:8): [True: 56, False: 3.74k]
  ------------------
  520|     56|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|     56|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  521|       |
  522|       |    /* Set the array type in the encoding mask */
  523|  3.74k|    const bool isArray = src->arrayLength > 0 || src->data <= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  7.49k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (523:26): [True: 0, False: 3.74k]
  |  Branch (523:50): [True: 21, False: 3.72k]
  ------------------
  524|       |
  525|  3.74k|    if(src->arrayDimensionsSize > 1)
  ------------------
  |  Branch (525:8): [True: 0, False: 3.74k]
  ------------------
  526|      0|        return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  238|      0|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
  527|       |
  528|  3.74k|    UA_StatusCode ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  3.74k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  529|  3.74k|    ret |= writeXmlElemNameBegin(ctx, UA_XML_VARIANT_VALUE);
  ------------------
  |  |  176|  3.74k|#define UA_XML_VARIANT_VALUE "Value"
  ------------------
  530|  3.74k|    if(!isArray) {
  ------------------
  |  Branch (530:8): [True: 3.72k, False: 21]
  ------------------
  531|  3.72k|        const UA_DataType *srctype = src->type;
  532|  3.72k|        void *ptr = src->data;
  533|  3.72k|        UA_ExtensionObject eo;
  534|  3.72k|        if(srctype->typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO) {
  ------------------
  |  Branch (534:12): [True: 50, False: 3.67k]
  ------------------
  535|       |            /* Wrap value in an ExtensionObject */
  536|     50|            UA_ExtensionObject_setValue(&eo, (void*)(uintptr_t)ptr, srctype);
  537|     50|            ptr = &eo;
  538|     50|            srctype = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|     50|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  539|     50|        }
  540|  3.72k|        ret |= writeXmlElement(ctx, srctype->typeName, ptr, srctype);
  541|  3.72k|    } else {
  542|     21|        ret |= Array_encodeXml(ctx, src->data, src->arrayLength, src->type);
  543|     21|    }
  544|  3.74k|    ret |= writeXmlElemNameEnd(ctx, UA_XML_VARIANT_VALUE);
  ------------------
  |  |  176|  3.74k|#define UA_XML_VARIANT_VALUE "Value"
  ------------------
  545|  3.74k|    return ret;
  546|  3.74k|}
ua_types_encoding_xml.c:Array_encodeXml:
  486|     21|                const UA_DataType *type) {
  487|     21|    char arrName[128];
  488|     21|    UA_ExtensionObject eo;
  489|       |
  490|     21|    UA_Boolean wrapEO = (type->typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO);
  491|     21|    if(wrapEO) {
  ------------------
  |  Branch (491:8): [True: 0, False: 21]
  ------------------
  492|      0|        UA_ExtensionObject_setValue(&eo, (void*)(uintptr_t)ptr, type);
  493|      0|        type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  494|      0|    }
  495|       |
  496|     21|    size_t arrNameLen = strlen("ListOf") + strlen(type->typeName);
  497|     21|    if(arrNameLen >= 128)
  ------------------
  |  Branch (497:8): [True: 0, False: 21]
  ------------------
  498|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  499|     21|    memcpy(arrName, "ListOf", strlen("ListOf"));
  500|     21|    memcpy(arrName + strlen("ListOf"), type->typeName, strlen(type->typeName));
  501|     21|    arrName[arrNameLen] = '\0';
  502|       |
  503|     21|    uintptr_t uptr = (uintptr_t)ptr;
  504|     21|    status ret = writeXmlElemNameBegin(ctx, arrName);
  505|     21|    for(size_t i = 0; i < length && ret == UA_STATUSCODE_GOOD; ++i) {
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (505:23): [True: 0, False: 21]
  |  Branch (505:37): [True: 0, False: 0]
  ------------------
  506|      0|        if(!wrapEO) {
  ------------------
  |  Branch (506:12): [True: 0, False: 0]
  ------------------
  507|      0|            ret |= writeXmlElement(ctx, type->typeName, (const void*)uptr, type);
  508|      0|        } else {
  509|      0|            eo.content.decoded.data = (void*)uptr;
  510|      0|            ret |= writeXmlElement(ctx, type->typeName, &eo, type);
  511|      0|        }
  512|      0|        uptr += type->memSize;
  513|      0|    }
  514|     21|    ret |= writeXmlElemNameEnd(ctx, arrName);
  515|     21|    return ret;
  516|     21|}
ua_types_encoding_xml.c:writeXmlElement:
  224|  7.67k|                const void *value, const UA_DataType *type) {
  225|  7.67k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  7.67k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  226|  7.67k|    ret |= writeXmlElemNameBegin(ctx, name);
  227|  7.67k|    ret |= encodeXmlJumpTable[type->typeKind](ctx, value, type);
  228|  7.67k|    ret |= writeXmlElemNameEnd(ctx, name);
  229|  7.67k|    return ret;
  230|  7.67k|}
ua_types_encoding_xml.c:Boolean_decodeXml:
  687|    109|DECODE_XML(Boolean) {
  688|    109|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|    109|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 109]
  |  |  ------------------
  |  |  670|    109|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|    109|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 109]
  |  |  ------------------
  ------------------
  689|    109|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|    109|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|    109|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|    109|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 109]
  |  |  ------------------
  ------------------
  690|    109|    skipXmlObject(ctx);
  691|       |
  692|    109|    if(length == 4 &&
  ------------------
  |  Branch (692:8): [True: 25, False: 84]
  ------------------
  693|     25|       data[0] == 't' && data[1] == 'r' &&
  ------------------
  |  Branch (693:8): [True: 16, False: 9]
  |  Branch (693:26): [True: 12, False: 4]
  ------------------
  694|     12|       data[2] == 'u' && data[3] == 'e') {
  ------------------
  |  Branch (694:8): [True: 10, False: 2]
  |  Branch (694:26): [True: 2, False: 8]
  ------------------
  695|      2|        *dst = true;
  696|    107|    } else if(length == 5 &&
  ------------------
  |  Branch (696:15): [True: 35, False: 72]
  ------------------
  697|     35|              data[0] == 'f' && data[1] == 'a' &&
  ------------------
  |  Branch (697:15): [True: 25, False: 10]
  |  Branch (697:33): [True: 21, False: 4]
  ------------------
  698|     21|              data[2] == 'l' && data[3] == 's' &&
  ------------------
  |  Branch (698:15): [True: 18, False: 3]
  |  Branch (698:33): [True: 9, False: 9]
  ------------------
  699|      9|              data[4] == 'e') {
  ------------------
  |  Branch (699:15): [True: 2, False: 7]
  ------------------
  700|      2|        *dst = false;
  701|    105|    } else {
  702|    105|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    105|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  703|    105|    }
  704|       |
  705|      4|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      4|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  706|    109|}
ua_types_encoding_xml.c:skipXmlObject:
  679|  3.73k|skipXmlObject(ParseCtxXml *ctx) {
  680|  3.73k|    size_t end_parent = ctx->tokens[ctx->index].end;
  681|  5.32M|    while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (681:11): [True: 5.32M, False: 3.67k]
  ------------------
  682|  5.32M|          ctx->tokens[ctx->index].end <= end_parent) {
  ------------------
  |  Branch (682:11): [True: 5.32M, False: 66]
  ------------------
  683|  5.32M|        ctx->index++;
  684|  5.32M|    }
  685|  3.73k|}
ua_types_encoding_xml.c:SByte_decodeXml:
  744|     34|DECODE_XML(SByte) {
  745|     34|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|     34|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 34]
  |  |  ------------------
  |  |  670|     34|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|     34|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 34]
  |  |  ------------------
  ------------------
  746|     34|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|     34|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|     34|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|     34|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 34]
  |  |  ------------------
  ------------------
  747|     34|    skipXmlObject(ctx);
  748|       |
  749|     34|    UA_Int64 out = 0;
  750|     34|    UA_StatusCode s = decodeSigned(data, length, &out);
  751|     34|    if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   16|     68|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   63|     34|#define UA_SBYTE_MIN (-128)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   64|      0|#define UA_SBYTE_MAX 127
  ------------------
  |  Branch (751:8): [True: 34, False: 0]
  |  Branch (751:35): [True: 0, False: 0]
  |  Branch (751:57): [True: 0, False: 0]
  ------------------
  752|     34|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     34|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  753|       |
  754|      0|    *dst = (UA_SByte)out;
  755|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  756|     34|}
ua_types_encoding_xml.c:decodeSigned:
  709|  1.33k|decodeSigned(const UA_Byte *data, size_t dataSize, UA_Int64 *dst) {
  710|  1.33k|    if(!data || dataSize == 0)
  ------------------
  |  Branch (710:8): [True: 74, False: 1.26k]
  |  Branch (710:17): [True: 0, False: 1.26k]
  ------------------
  711|     74|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     74|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  712|  1.26k|    size_t len = parseInt64((const char*)data, dataSize, dst);
  713|  1.26k|    if(len == 0)
  ------------------
  |  Branch (713:8): [True: 158, False: 1.10k]
  ------------------
  714|    158|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    158|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  715|       |
  716|       |    /* There must only be whitespace between the end of the parsed number and
  717|       |     * the end of the XML section */
  718|  1.82k|    for(size_t i = len; i < dataSize; i++) {
  ------------------
  |  Branch (718:25): [True: 873, False: 953]
  ------------------
  719|    873|        if(data[i] != ' ' && data[i] - '\t' >= 5)
  ------------------
  |  Branch (719:12): [True: 776, False: 97]
  |  Branch (719:30): [True: 149, False: 627]
  ------------------
  720|    149|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    149|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  721|    873|    }
  722|       |
  723|    953|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    953|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  724|  1.10k|}
ua_types_encoding_xml.c:Byte_decodeXml:
  758|     37|DECODE_XML(Byte) {
  759|     37|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|     37|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 37]
  |  |  ------------------
  |  |  670|     37|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|     37|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 37]
  |  |  ------------------
  ------------------
  760|     37|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|     37|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|     37|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|     37|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 37]
  |  |  ------------------
  ------------------
  761|     37|    skipXmlObject(ctx);
  762|       |
  763|     37|    UA_UInt64 out = 0;
  764|     37|    UA_StatusCode s = decodeUnsigned(data, length, &out);
  765|     37|    if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   16|     74|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   73|      0|#define UA_BYTE_MAX 255
  ------------------
  |  Branch (765:8): [True: 37, False: 0]
  |  Branch (765:35): [True: 0, False: 0]
  ------------------
  766|     37|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     37|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  767|       |
  768|      0|    *dst = (UA_Byte)out;
  769|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  770|     37|}
ua_types_encoding_xml.c:decodeUnsigned:
  727|    629|decodeUnsigned(const UA_Byte *data, size_t dataSize, UA_UInt64 *dst) {
  728|    629|    if(!data || dataSize == 0)
  ------------------
  |  Branch (728:8): [True: 91, False: 538]
  |  Branch (728:17): [True: 0, False: 538]
  ------------------
  729|     91|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     91|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  730|    538|    size_t len = parseUInt64((const char*)data, dataSize, dst);
  731|    538|    if(len == 0)
  ------------------
  |  Branch (731:8): [True: 44, False: 494]
  ------------------
  732|     44|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     44|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  733|       |
  734|       |    /* There must only be whitespace between the end of the parsed number and
  735|       |     * the end of the XML section */
  736|  1.93k|    for(size_t i = len; i < dataSize; i++) {
  ------------------
  |  Branch (736:25): [True: 1.53k, False: 401]
  ------------------
  737|  1.53k|        if(data[i] != ' ' && data[i] - '\t' >= 5)
  ------------------
  |  Branch (737:12): [True: 1.17k, False: 359]
  |  Branch (737:30): [True: 93, False: 1.08k]
  ------------------
  738|     93|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     93|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  739|  1.53k|    }
  740|       |
  741|    401|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    401|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  742|    494|}
ua_types_encoding_xml.c:Int16_decodeXml:
  772|    377|DECODE_XML(Int16) {
  773|    377|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|    377|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 377]
  |  |  ------------------
  |  |  670|    377|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|    377|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 377]
  |  |  ------------------
  ------------------
  774|    377|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|    377|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|    377|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|    377|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 377]
  |  |  ------------------
  ------------------
  775|    377|    skipXmlObject(ctx);
  776|       |
  777|    377|    UA_Int64 out = 0;
  778|    377|    UA_StatusCode s = decodeSigned(data, length, &out);
  779|    377|    if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   16|    754|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   81|    643|#define UA_INT16_MIN (-32768)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   82|    181|#define UA_INT16_MAX 32767
  ------------------
  |  Branch (779:8): [True: 111, False: 266]
  |  Branch (779:35): [True: 85, False: 181]
  |  Branch (779:57): [True: 57, False: 124]
  ------------------
  780|    253|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    253|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  781|       |
  782|    124|    *dst = (UA_Int16)out;
  783|    124|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    124|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  784|    377|}
ua_types_encoding_xml.c:UInt16_decodeXml:
  786|    152|DECODE_XML(UInt16) {
  787|    152|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|    152|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 152]
  |  |  ------------------
  |  |  670|    152|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|    152|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 152]
  |  |  ------------------
  ------------------
  788|    152|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|    152|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|    152|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|    152|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 152]
  |  |  ------------------
  ------------------
  789|    152|    skipXmlObject(ctx);
  790|       |
  791|    152|    UA_UInt64 out = 0;
  792|    152|    UA_StatusCode s = decodeUnsigned(data, length, &out);
  793|    152|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   16|    304|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   91|     76|#define UA_UINT16_MAX 65535
  ------------------
  |  Branch (793:8): [True: 76, False: 76]
  |  Branch (793:35): [True: 56, False: 20]
  ------------------
  794|    132|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    132|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  795|       |
  796|     20|    *dst = (UA_UInt16)out;
  797|     20|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     20|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  798|    152|}
ua_types_encoding_xml.c:Int32_decodeXml:
  800|    433|DECODE_XML(Int32) {
  801|    433|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|    433|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 433]
  |  |  ------------------
  |  |  670|    433|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|    433|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 433]
  |  |  ------------------
  ------------------
  802|    433|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|    433|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|    433|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|    433|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 433]
  |  |  ------------------
  ------------------
  803|    433|    skipXmlObject(ctx);
  804|       |
  805|    433|    UA_Int64 out = 0;
  806|    433|    UA_StatusCode s = decodeSigned(data, length, &out);
  807|    433|    if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   16|    866|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   99|    732|#define UA_INT32_MIN ((int32_t)-2147483648LL)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |  100|    236|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (807:8): [True: 134, False: 299]
  |  Branch (807:35): [True: 63, False: 236]
  |  Branch (807:57): [True: 6, False: 230]
  ------------------
  808|    203|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    203|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  809|       |
  810|    230|    *dst = (UA_Int32)out;
  811|    230|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    230|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  812|    433|}
ua_types_encoding_xml.c:UInt32_decodeXml:
  814|    181|DECODE_XML(UInt32) {
  815|    181|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|    181|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 181]
  |  |  ------------------
  |  |  670|    181|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|    181|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 181]
  |  |  ------------------
  ------------------
  816|    181|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|    181|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|    181|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|    181|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 181]
  |  |  ------------------
  ------------------
  817|    181|    skipXmlObject(ctx);
  818|       |
  819|    181|    UA_UInt64 out = 0;
  820|    181|    UA_StatusCode s = decodeUnsigned(data, length, &out);
  821|    181|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |   16|    362|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |  109|    119|#define UA_UINT32_MAX 4294967295UL
  ------------------
  |  Branch (821:8): [True: 62, False: 119]
  |  Branch (821:35): [True: 39, False: 80]
  ------------------
  822|    101|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    101|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  823|       |
  824|     80|    *dst = (UA_UInt32)out;
  825|     80|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     80|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  826|    181|}
ua_types_encoding_xml.c:Int64_decodeXml:
  828|    490|DECODE_XML(Int64) {
  829|    490|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|    490|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 490]
  |  |  ------------------
  |  |  670|    490|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|    490|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 490]
  |  |  ------------------
  ------------------
  830|    490|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|    490|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|    490|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|    490|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 490]
  |  |  ------------------
  ------------------
  831|    490|    skipXmlObject(ctx);
  832|       |
  833|    490|    UA_Int64 out = 0;
  834|    490|    UA_StatusCode s = decodeSigned(data, length, &out);
  835|    490|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    490|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (835:8): [True: 102, False: 388]
  ------------------
  836|    102|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    102|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  837|       |
  838|    388|    *dst = (UA_Int64)out;
  839|    388|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    388|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  840|    490|}
ua_types_encoding_xml.c:UInt64_decodeXml:
  842|    259|DECODE_XML(UInt64) {
  843|    259|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|    259|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 259]
  |  |  ------------------
  |  |  670|    259|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|    259|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 259]
  |  |  ------------------
  ------------------
  844|    259|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|    259|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|    259|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|    259|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 259]
  |  |  ------------------
  ------------------
  845|    259|    skipXmlObject(ctx);
  846|       |
  847|    259|    UA_UInt64 out = 0;
  848|    259|    UA_StatusCode s = decodeUnsigned(data, length, &out);
  849|    259|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    259|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (849:8): [True: 53, False: 206]
  ------------------
  850|     53|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     53|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  851|       |
  852|    206|    *dst = (UA_UInt64)out;
  853|    206|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    206|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  854|    259|}
ua_types_encoding_xml.c:Float_decodeXml:
  904|      7|DECODE_XML(Float) {
  905|      7|    UA_Double v = 0.0;
  906|       |    UA_StatusCode res = Double_decodeXml(ctx, &v, NULL);
  907|      7|    *dst = (UA_Float)v;
  908|      7|    return res;
  909|      7|}
ua_types_encoding_xml.c:Double_decodeXml:
  856|  1.30k|DECODE_XML(Double) {
  857|  1.30k|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|  1.30k|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 1.30k]
  |  |  ------------------
  |  |  670|  1.30k|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|  1.30k|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 1.30k]
  |  |  ------------------
  ------------------
  858|  1.30k|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|  1.30k|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|  1.30k|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|  1.30k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 1.30k]
  |  |  ------------------
  ------------------
  859|  1.30k|    skipXmlObject(ctx);
  860|       |
  861|  1.30k|    if(!data || length == 0)
  ------------------
  |  Branch (861:8): [True: 35, False: 1.26k]
  |  Branch (861:17): [True: 0, False: 1.26k]
  ------------------
  862|     35|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     35|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  863|       |
  864|       |    /* https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/
  865|       |     * Maximum digit counts for select IEEE floating-point formats: 1074
  866|       |     * Sanity check. */
  867|  1.26k|    if(length > 1075)
  ------------------
  |  Branch (867:8): [True: 20, False: 1.24k]
  ------------------
  868|     20|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     20|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  869|       |
  870|  1.24k|    if(length == 3 && memcmp(data, "INF", 3) == 0) {
  ------------------
  |  Branch (870:8): [True: 83, False: 1.16k]
  |  Branch (870:23): [True: 3, False: 80]
  ------------------
  871|      3|        *dst = INFINITY;
  872|      3|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      3|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  873|      3|    }
  874|       |
  875|  1.24k|    if(length == 4 && memcmp(data, "-INF", 4) == 0) {
  ------------------
  |  Branch (875:8): [True: 49, False: 1.19k]
  |  Branch (875:23): [True: 3, False: 46]
  ------------------
  876|      3|        *dst = -INFINITY;
  877|      3|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      3|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  878|      3|    }
  879|       |
  880|  1.24k|    if(length == 3 && memcmp(data, "NaN", 3) == 0) {
  ------------------
  |  Branch (880:8): [True: 80, False: 1.16k]
  |  Branch (880:23): [True: 4, False: 76]
  ------------------
  881|      4|        *dst = NAN;
  882|      4|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      4|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  883|      4|    }
  884|       |
  885|  1.23k|    if(length == 3 && memcmp(data, "-NaN", 3) == 0) {
  ------------------
  |  Branch (885:8): [True: 76, False: 1.16k]
  |  Branch (885:23): [True: 2, False: 74]
  ------------------
  886|      2|        *dst = NAN;
  887|      2|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      2|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  888|      2|    }
  889|       |
  890|  1.23k|    size_t len = parseDouble((const char*)data, length, dst);
  891|  1.23k|    if(len == 0)
  ------------------
  |  Branch (891:8): [True: 45, False: 1.18k]
  ------------------
  892|     45|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     45|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  893|       |
  894|       |    /* There must only be whitespace between the end of the parsed number and
  895|       |     * the end of the token */
  896|  1.42k|    for(size_t i = len; i < length; i++) {
  ------------------
  |  Branch (896:25): [True: 247, False: 1.17k]
  ------------------
  897|    247|        if(data[i] != ' ' && data[i] -'\t' >= 5)
  ------------------
  |  Branch (897:12): [True: 227, False: 20]
  |  Branch (897:30): [True: 15, False: 212]
  ------------------
  898|     15|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     15|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  899|    247|    }
  900|       |
  901|  1.17k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.17k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  902|  1.18k|}
ua_types_encoding_xml.c:String_decodeXml:
  911|    158|DECODE_XML(String) {
  912|    158|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|    158|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 158]
  |  |  ------------------
  |  |  670|    158|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|    158|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 158]
  |  |  ------------------
  ------------------
  913|    158|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|    158|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|    158|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|    158|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 158]
  |  |  ------------------
  ------------------
  914|    158|    skipXmlObject(ctx);
  915|       |
  916|       |    /* Empty string? */
  917|    158|    if(length == 0) {
  ------------------
  |  Branch (917:8): [True: 62, False: 96]
  ------------------
  918|     62|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|     62|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  919|     62|        dst->length = 0;
  920|     62|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     62|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  921|     62|    }
  922|       |
  923|     96|    UA_String str = {length, (UA_Byte*)(uintptr_t)data};
  924|     96|    return UA_String_copy(&str, dst);
  925|    158|}
ua_types_encoding_xml.c:DateTime_decodeXml:
  927|     39|DECODE_XML(DateTime) {
  928|     39|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|     39|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 39]
  |  |  ------------------
  |  |  670|     39|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|     39|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 39]
  |  |  ------------------
  ------------------
  929|     39|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|     39|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|     39|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|     39|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 39]
  |  |  ------------------
  ------------------
  930|     39|    skipXmlObject(ctx);
  931|     39|    UA_String str = {length, (UA_Byte*)(uintptr_t)data};
  932|     39|    return UA_DateTime_parse(dst, str);
  933|     39|}
ua_types_encoding_xml.c:Guid_decodeXml:
 1027|     19|DECODE_XML(Guid) {
 1028|     19|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|     19|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 19]
  |  |  ------------------
  |  |  670|     19|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|     19|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 19]
  |  |  ------------------
  ------------------
 1029|     19|    UA_String str;
 1030|     19|    UA_String_init(&str);
 1031|     19|    XmlDecodeEntry entry = {UA_STRING_STATIC(UA_XML_GUID_STRING), &str,
  ------------------
  |  |  223|     19|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1032|     19|                            NULL, false, &UA_TYPES[UA_TYPES_STRING]};
  ------------------
  |  |  395|     19|#define UA_TYPES_STRING 11
  ------------------
 1033|     19|    status ret = decodeXmlFields(ctx, &entry, 1);
 1034|     19|    ret |= UA_Guid_parse(dst, str);
 1035|     19|    UA_String_clear(&str);
 1036|     19|    return ret;
 1037|     19|}
ua_types_encoding_xml.c:decodeXmlFields:
  962|    165|decodeXmlFields(ParseCtxXml *ctx, XmlDecodeEntry *entries, size_t entryCount) {
  963|    165|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|    165|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 165]
  |  |  ------------------
  |  |  670|    165|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|    165|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 165]
  |  |  ------------------
  ------------------
  964|       |
  965|    165|    if(ctx->depth >= UA_XML_ENCODING_MAX_RECURSION)
  ------------------
  |  |   15|    165|#define UA_XML_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (965:8): [True: 0, False: 165]
  ------------------
  966|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  967|       |
  968|    165|    size_t childCount = ctx->tokens[ctx->index].children;
  969|       |
  970|       |    /* Empty object */
  971|    165|    if(childCount == 0) {
  ------------------
  |  Branch (971:8): [True: 68, False: 97]
  ------------------
  972|     68|        skipXmlObject(ctx);
  973|     68|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     68|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  974|     68|    }
  975|       |
  976|       |    /* Go to first entry element */
  977|     97|    ctx->depth++;
  978|     97|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
  979|       |
  980|     97|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     97|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  981|    106|    for(size_t i = 0; i < childCount; i++) {
  ------------------
  |  Branch (981:23): [True: 105, False: 1]
  ------------------
  982|    105|        xml_token *elem = &ctx->tokens[ctx->index];
  983|    105|        XmlDecodeEntry *entry = NULL;
  984|    272|        for(size_t j = i; j < entryCount + i; j++) {
  ------------------
  |  Branch (984:27): [True: 240, False: 32]
  ------------------
  985|       |            /* Search for key, if found outer loop will be one less. Best case
  986|       |             * if objectCount is in order! */
  987|    240|            size_t index = j % entryCount;
  988|    240|            if(!UA_String_equal_ignorecase(&elem->name, &entries[index].name))
  ------------------
  |  Branch (988:16): [True: 167, False: 73]
  ------------------
  989|    167|                continue;
  990|     73|            entry = &entries[index];
  991|     73|            break;
  992|    240|        }
  993|       |
  994|       |        /* Unknown child element */
  995|    105|        if(!entry)
  ------------------
  |  Branch (995:12): [True: 32, False: 73]
  ------------------
  996|     32|            goto errout;
  997|       |
  998|       |        /* An entry that was expected, but shall not be decoded.
  999|       |         * Jump over it. */
 1000|     73|        if(!entry->fieldPointer || (!entry->function && !entry->type)) {
  ------------------
  |  Branch (1000:12): [True: 0, False: 73]
  |  Branch (1000:37): [True: 73, False: 0]
  |  Branch (1000:57): [True: 0, False: 73]
  ------------------
 1001|      0|            skipXmlObject(ctx);
 1002|      0|            continue;
 1003|      0|        }
 1004|       |
 1005|       |        /* Duplicate child element */
 1006|     73|        if(entry->found)
  ------------------
  |  Branch (1006:12): [True: 1, False: 72]
  ------------------
 1007|      1|            goto errout;
 1008|     72|        entry->found = true;
 1009|       |
 1010|       |        /* Decode */
 1011|     72|        if(entry->function) /* Specialized decoding function */
  ------------------
  |  Branch (1011:12): [True: 0, False: 72]
  ------------------
 1012|      0|            ret = entry->function(ctx, entry->fieldPointer, entry->type);
 1013|     72|        else /* Decode by type-kind */
 1014|     72|            ret = decodeXmlJumpTable[entry->type->typeKind](ctx, entry->fieldPointer, entry->type);
 1015|     72|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|     72|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1015:12): [True: 63, False: 9]
  ------------------
 1016|     63|            goto cleanup;
 1017|     72|    }
 1018|       |
 1019|     64|cleanup:
 1020|     64|    ctx->depth--;
 1021|     64|    return ret;
 1022|     33|errout:
 1023|     33|    ctx->depth--;
 1024|     33|    return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     33|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1025|     97|}
ua_types_encoding_xml.c:ByteString_decodeXml:
 1039|    100|DECODE_XML(ByteString) {
 1040|    100|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|    100|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 100]
  |  |  ------------------
  |  |  670|    100|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|    100|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 100]
  |  |  ------------------
  ------------------
 1041|    100|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|    100|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|    100|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|    100|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 100]
  |  |  ------------------
  ------------------
 1042|    100|    skipXmlObject(ctx);
 1043|       |
 1044|       |    /* Empty bytestring? */
 1045|    100|    if(length == 0) {
  ------------------
  |  Branch (1045:8): [True: 59, False: 41]
  ------------------
 1046|     59|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|     59|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1047|     59|        dst->length = 0;
 1048|     59|    } else {
 1049|     41|        size_t flen = 0;
 1050|     41|        unsigned char* unB64 = UA_unbase64((const unsigned char*)data, length, &flen);
 1051|     41|        if(!unB64)
  ------------------
  |  Branch (1051:12): [True: 39, False: 2]
  ------------------
 1052|     39|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     39|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1053|      2|        dst->data = (UA_Byte*)unB64;
 1054|      2|        dst->length = flen;
 1055|      2|    }
 1056|       |
 1057|     61|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     61|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1058|    100|}
ua_types_encoding_xml.c:decodeXmlNotImplemented:
 1491|      3|decodeXmlNotImplemented(ParseCtxXml *ctx, void *dst, const UA_DataType *type) {
 1492|      3|    (void)dst, (void)type, (void)ctx;
 1493|      3|    return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  238|      3|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
 1494|      3|}
ua_types_encoding_xml.c:NodeId_decodeXml:
 1060|      2|DECODE_XML(NodeId) {
 1061|      2|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|      2|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 2]
  |  |  ------------------
  |  |  670|      2|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|      2|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 2]
  |  |  ------------------
  ------------------
 1062|      2|    UA_String str;
 1063|      2|    static UA_String identifier = UA_STRING_STATIC(UA_XML_NODEID_IDENTIFIER);
  ------------------
  |  |  223|      2|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1064|      2|    status ret = getChildContent(ctx, identifier, &str);
 1065|      2|    if(ret != UA_STATUSCODE_GOOD) return ret;
  ------------------
  |  |   16|      2|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1065:8): [True: 2, False: 0]
  ------------------
 1066|      0|    skipXmlObject(ctx);
 1067|      0|    return UA_NodeId_parseEx(dst, str, ctx->namespaceMapping);
 1068|      2|}
ua_types_encoding_xml.c:getChildContent:
  938|     23|getChildContent(ParseCtxXml *ctx, UA_String name, UA_String *out) {
  939|     23|    size_t oldIndex = ctx->index;
  940|     23|    size_t children = ctx->tokens[ctx->index].children;
  941|       |
  942|       |    /* Skip the attributes and go to the first child */
  943|     23|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
  944|       |
  945|       |    /* Find the child of the name */
  946|     23|    UA_StatusCode res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     23|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  947|     23|    for(size_t i = 0; i < children; i++) {
  ------------------
  |  Branch (947:23): [True: 0, False: 23]
  ------------------
  948|      0|        if(!UA_String_equal(&name, &ctx->tokens[ctx->index].name)) {
  ------------------
  |  Branch (948:12): [True: 0, False: 0]
  ------------------
  949|      0|            skipXmlObject(ctx);
  950|      0|            continue;
  951|      0|        }
  952|      0|        *out = ctx->tokens[ctx->index].content;
  953|      0|        res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  954|      0|        break;
  955|      0|    }
  956|       |
  957|     23|    ctx->index = oldIndex;
  958|     23|    return res;
  959|     23|}
ua_types_encoding_xml.c:ExpandedNodeId_decodeXml:
 1070|      8|DECODE_XML(ExpandedNodeId) {
 1071|      8|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|      8|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 8]
  |  |  ------------------
  |  |  670|      8|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|      8|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 8]
  |  |  ------------------
  ------------------
 1072|      8|    UA_String str;
 1073|      8|    static UA_String expidentifier = UA_STRING_STATIC(UA_XML_EXPANDEDNODEID_IDENTIFIER);
  ------------------
  |  |  223|      8|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1074|      8|    status ret = getChildContent(ctx, expidentifier, &str);
 1075|      8|    if(ret != UA_STATUSCODE_GOOD) return ret;
  ------------------
  |  |   16|      8|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1075:8): [True: 8, False: 0]
  ------------------
 1076|      0|    skipXmlObject(ctx);
 1077|      0|    return UA_ExpandedNodeId_parseEx(dst, str, ctx->namespaceMapping,
 1078|      0|                                     ctx->serverUrisSize, ctx->serverUris);
 1079|      8|}
ua_types_encoding_xml.c:StatusCode_decodeXml:
 1081|     13|DECODE_XML(StatusCode) {
 1082|     13|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|     13|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 13]
  |  |  ------------------
  |  |  670|     13|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|     13|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 13]
  |  |  ------------------
  ------------------
 1083|     13|    UA_String str;
 1084|     13|    static UA_String statusidentifier = UA_STRING_STATIC(UA_XML_STATUSCODE_CODE);
  ------------------
  |  |  223|     13|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1085|     13|    status ret = getChildContent(ctx, statusidentifier, &str);
 1086|     13|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|     13|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1086:8): [True: 13, False: 0]
  ------------------
 1087|     13|        return ret;
 1088|      0|    skipXmlObject(ctx);
 1089|      0|    UA_UInt64 out = 0;
 1090|      0|    ret = decodeUnsigned(str.data, str.length, &out);
 1091|      0|    if(ret != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(ret != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |  109|      0|#define UA_UINT32_MAX 4294967295UL
  ------------------
  |  Branch (1091:8): [True: 0, False: 0]
  |  Branch (1091:37): [True: 0, False: 0]
  ------------------
 1092|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1093|      0|    *dst = (UA_StatusCode)out;
 1094|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1095|      0|}
ua_types_encoding_xml.c:ExtensionObject_decodeXml:
 1217|      2|DECODE_XML(ExtensionObject) {
 1218|      2|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|      2|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 2]
  |  |  ------------------
  |  |  670|      2|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|      2|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 2]
  |  |  ------------------
  ------------------
 1219|      2|    xml_token *tok = &ctx->tokens[ctx->index];
 1220|      2|    if(tok->children == 0)
  ------------------
  |  Branch (1220:8): [True: 2, False: 0]
  ------------------
 1221|      2|        return UA_STATUSCODE_GOOD; /* _NO_BODY */
  ------------------
  |  |   16|      2|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1222|      0|    dst->encoding = UA_EXTENSIONOBJECT_ENCODED_XML; /* default so the typeId gets cleaned up */
 1223|      0|    XmlDecodeEntry entries[2] = {
 1224|      0|        {UA_STRING_STATIC(UA_XML_EXTENSIONOBJECT_TYPEID), &dst->content.encoded.typeId,
  ------------------
  |  |  223|      0|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1225|      0|         NULL, false, &UA_TYPES[UA_TYPES_NODEID]},
  ------------------
  |  |  565|      0|#define UA_TYPES_NODEID 16
  ------------------
 1226|      0|        {UA_STRING_STATIC(UA_XML_EXTENSIONOBJECT_BODY), dst,
  ------------------
  |  |  223|      0|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1227|      0|         decodeExtensionObjectBody, false, NULL},
 1228|      0|    };
 1229|      0|    return decodeXmlFields(ctx, entries, 2);
 1230|      2|}
ua_types_encoding_xml.c:Variant_decodeXml:
 1378|  4.18k|DECODE_XML(Variant) {
 1379|  4.18k|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|  4.18k|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 4.18k]
  |  |  ------------------
  |  |  670|  4.18k|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|  4.18k|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 4.18k]
  |  |  ------------------
  ------------------
 1380|       |
 1381|  4.18k|    if(ctx->depth >= UA_XML_ENCODING_MAX_RECURSION)
  ------------------
  |  |   15|  4.18k|#define UA_XML_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (1381:8): [True: 0, False: 4.18k]
  ------------------
 1382|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 1383|       |
 1384|  4.18k|    xml_token *tok = &ctx->tokens[ctx->index];
 1385|  4.18k|    if(tok->children == 0)
  ------------------
  |  Branch (1385:8): [True: 56, False: 4.13k]
  ------------------
 1386|     56|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     56|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1387|  4.13k|    if(tok->children != 1)
  ------------------
  |  Branch (1387:8): [True: 146, False: 3.98k]
  ------------------
 1388|    146|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    146|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1389|       |
 1390|       |    /* Move forward to the content */
 1391|  3.98k|    if(ctx->index + 2 >= ctx->tokensSize)
  ------------------
  |  Branch (1391:8): [True: 2, False: 3.98k]
  ------------------
 1392|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1393|       |
 1394|  3.98k|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
 1395|  3.98k|    tok = &ctx->tokens[ctx->index];
 1396|  3.98k|    static UA_String valName = UA_STRING_STATIC("Value");
  ------------------
  |  |  223|  3.98k|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1397|  3.98k|    if(!UA_String_equal(&tok->name, &valName))
  ------------------
  |  Branch (1397:8): [True: 58, False: 3.92k]
  ------------------
 1398|     58|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     58|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1399|  3.92k|    if(tok->children != 1)
  ------------------
  |  Branch (1399:8): [True: 8, False: 3.91k]
  ------------------
 1400|      8|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      8|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1401|       |
 1402|       |    /* Jump to the child of the <Value> token */
 1403|  3.91k|    ctx->depth++;
 1404|  3.91k|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
 1405|  3.91k|    tok = &ctx->tokens[ctx->index];
 1406|       |
 1407|       |    /* Special case for multi-dimensional arrays */
 1408|  3.91k|    static UA_String matrName = UA_STRING_STATIC("Matrix");
  ------------------
  |  |  223|  3.91k|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1409|  3.91k|    UA_StatusCode ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  3.91k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1410|  3.91k|    if(UA_String_equal(&tok->name, &matrName)) {
  ------------------
  |  Branch (1410:8): [True: 1, False: 3.91k]
  ------------------
 1411|      1|        ret = decodeMatrixVariant(ctx, dst);
 1412|      1|        unwrapVariantExtensionObject(dst, true);
 1413|      1|        ctx->depth--;
 1414|      1|        return ret;
 1415|      1|    }
 1416|       |
 1417|       |    /* Get the Data type / array type */
 1418|  3.91k|    UA_Boolean isArray = false;
 1419|  3.91k|    static char *lo = "ListOf";
 1420|  3.91k|    UA_String typeName = tok->name;
 1421|  3.91k|    if(tok->name.length > strlen(lo) &&
  ------------------
  |  Branch (1421:8): [True: 166, False: 3.75k]
  ------------------
 1422|    166|       strncmp((char*)tok->name.data, lo, strlen(lo)) == 0) {
  ------------------
  |  Branch (1422:8): [True: 15, False: 151]
  ------------------
 1423|     15|        isArray = true;
 1424|     15|        typeName.data += strlen(lo);
 1425|     15|        typeName.length -= strlen(lo);
 1426|     15|    }
 1427|       |
 1428|       |    /* Look up the DataType from the name */
 1429|  3.91k|    dst->type = lookupTypeByName(ctx, typeName);
 1430|  3.91k|    if(!dst->type) {
  ------------------
  |  Branch (1430:8): [True: 111, False: 3.80k]
  ------------------
 1431|    111|        ctx->depth--;
 1432|    111|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    111|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1433|    111|    }
 1434|       |
 1435|       |    /* Decode */
 1436|  3.80k|    if(!isArray) {
  ------------------
  |  Branch (1436:8): [True: 3.79k, False: 14]
  ------------------
 1437|  3.79k|        dst->data = UA_new(dst->type);
 1438|  3.79k|        if(!dst->data) {
  ------------------
  |  Branch (1438:12): [True: 0, False: 3.79k]
  ------------------
 1439|      0|            ctx->depth--;
 1440|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1441|      0|        }
 1442|  3.79k|        ret = decodeXmlJumpTable[dst->type->typeKind](ctx, dst->data, dst->type);
 1443|  3.79k|    } else {
 1444|     14|        ret = Array_decodeXml(ctx, &dst->arrayLength, dst->type);
 1445|     14|    }
 1446|       |
 1447|       |    /* Unwrap ExtensionObject values in the variant */
 1448|  3.80k|    unwrapVariantExtensionObject(dst, isArray);
 1449|       |
 1450|  3.80k|    ctx->depth--;
 1451|  3.80k|    return ret;
 1452|  3.80k|}
ua_types_encoding_xml.c:decodeMatrixVariant:
 1327|      1|decodeMatrixVariant(ParseCtxXml *ctx, UA_Variant *dst) {
 1328|       |    /* The <Matrix> token needs two children: <Dimensions> and <Elements> */
 1329|      1|    xml_token *tok = &ctx->tokens[ctx->index];
 1330|      1|    if(tok->children != 2)
  ------------------
  |  Branch (1330:8): [True: 1, False: 0]
  ------------------
 1331|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1332|       |
 1333|       |    /* Jump to the child of the <Matrix> token */
 1334|      0|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
 1335|      0|    tok = &ctx->tokens[ctx->index];
 1336|       |
 1337|      0|    UA_assert(tok->type == XML_TOKEN_ELEMENT);
  ------------------
  |  |  411|      0|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1337:5): [True: 0, False: 0]
  ------------------
 1338|      0|    static UA_String dimName = UA_STRING_STATIC("Dimensions");
  ------------------
  |  |  223|      0|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1339|      0|    if(!UA_String_equal(&tok->name, &dimName))
  ------------------
  |  Branch (1339:8): [True: 0, False: 0]
  ------------------
 1340|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1341|       |
 1342|      0|    UA_StatusCode ret =
 1343|      0|        Array_decodeXml(ctx, &dst->arrayDimensionsSize, &UA_TYPES[UA_TYPES_INT32]);
  ------------------
  |  |  191|      0|#define UA_TYPES_INT32 5
  ------------------
 1344|      0|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1344:8): [True: 0, False: 0]
  ------------------
 1345|      0|        return ret;
 1346|       |
 1347|      0|    UA_assert(tok->type == XML_TOKEN_ELEMENT);
  ------------------
  |  |  411|      0|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1347:5): [True: 0, False: 0]
  ------------------
 1348|      0|    static UA_String elemName = UA_STRING_STATIC("Elements");
  ------------------
  |  |  223|      0|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1349|      0|    tok = &ctx->tokens[ctx->index];
 1350|      0|    if(!UA_String_equal(&tok->name, &elemName))
  ------------------
  |  Branch (1350:8): [True: 0, False: 0]
  ------------------
 1351|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1352|       |
 1353|       |    /* Get the type of the first element */
 1354|      0|    size_t oldIndex = ctx->index;
 1355|      0|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
 1356|      0|    tok = &ctx->tokens[ctx->index];
 1357|      0|    UA_assert(tok->type == XML_TOKEN_ELEMENT);
  ------------------
  |  |  411|      0|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1357:5): [True: 0, False: 0]
  ------------------
 1358|       |
 1359|      0|    UA_String typeName = tok->name;
 1360|      0|    dst->type = lookupTypeByName(ctx, typeName);
 1361|      0|    if(!dst->type)
  ------------------
  |  Branch (1361:8): [True: 0, False: 0]
  ------------------
 1362|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1363|       |
 1364|       |    /* Decode the array */
 1365|      0|    ctx->index = oldIndex;
 1366|      0|    ret = Array_decodeXml(ctx, &dst->arrayLength, dst->type);
 1367|      0|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1367:8): [True: 0, False: 0]
  ------------------
 1368|      0|        return ret;
 1369|       |
 1370|       |    /* Check that the ArrayDimensions match */
 1371|      0|    size_t dimLen = 1;
 1372|      0|    for(size_t i = 0; i < dst->arrayDimensionsSize; i++)
  ------------------
  |  Branch (1372:23): [True: 0, False: 0]
  ------------------
 1373|      0|        dimLen *= dst->arrayDimensions[i];
 1374|       |
 1375|      0|    return (dimLen == dst->arrayLength) ? UA_STATUSCODE_GOOD : UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  return (dimLen == dst->arrayLength) ? UA_STATUSCODE_GOOD : UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  |  Branch (1375:12): [True: 0, False: 0]
  ------------------
 1376|      0|}
ua_types_encoding_xml.c:unwrapVariantExtensionObject:
 1279|  3.80k|unwrapVariantExtensionObject(UA_Variant *dst, UA_Boolean isArray) {
 1280|  3.80k|    if(dst->type != &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  735|  3.80k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (1280:8): [True: 3.80k, False: 4]
  ------------------
 1281|  3.80k|        return;
 1282|      4|    if(isArray && dst->arrayLength == 0)
  ------------------
  |  Branch (1282:8): [True: 2, False: 2]
  |  Branch (1282:19): [True: 2, False: 0]
  ------------------
 1283|      2|        return;
 1284|       |
 1285|      2|    UA_ExtensionObject *eo = (UA_ExtensionObject*)dst->data;
 1286|      2|    if(eo->encoding != UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (1286:8): [True: 2, False: 0]
  ------------------
 1287|      2|        return;
 1288|       |
 1289|      0|    const UA_DataType *type = eo->content.decoded.type;
 1290|       |
 1291|       |    /* Scalar */
 1292|      0|    if(!isArray) {
  ------------------
  |  Branch (1292:8): [True: 0, False: 0]
  ------------------
 1293|      0|        dst->data = eo->content.decoded.data;
 1294|      0|        dst->type = type;
 1295|      0|        UA_free(eo);
  ------------------
  |  |  351|      0|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1296|      0|        return;
 1297|      0|    }
 1298|       |
 1299|       |    /* Array. Check that all members can be unpacked */
 1300|      0|    for(size_t i = 0; i < dst->arrayLength; i++, eo++) {
  ------------------
  |  Branch (1300:23): [True: 0, False: 0]
  ------------------
 1301|      0|        if(eo->encoding != UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (1301:12): [True: 0, False: 0]
  ------------------
 1302|      0|            return;
 1303|      0|        if(eo->content.decoded.type != type)
  ------------------
  |  Branch (1303:12): [True: 0, False: 0]
  ------------------
 1304|      0|            return;
 1305|      0|    }
 1306|       |
 1307|       |    /* Allocate the array */
 1308|      0|    void *unpacked = UA_calloc(dst->arrayLength, type->memSize);
  ------------------
  |  |  352|      0|# define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1309|      0|    if(!unpacked)
  ------------------
  |  Branch (1309:8): [True: 0, False: 0]
  ------------------
 1310|      0|        return;
 1311|       |
 1312|       |    /* Unpack the content and set the new array */
 1313|      0|    uintptr_t uptr = (uintptr_t)unpacked;
 1314|      0|    eo = (UA_ExtensionObject*)dst->data;
 1315|      0|    for(size_t i = 0; i < dst->arrayLength; i++, eo++) {
  ------------------
  |  Branch (1315:23): [True: 0, False: 0]
  ------------------
 1316|       |        /* Move the value content */
 1317|      0|        memcpy((void*)uptr, eo->content.decoded.data, type->memSize);
 1318|      0|        UA_free(eo->content.decoded.data); /* Free the old value location */
  ------------------
  |  |  351|      0|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1319|      0|        uptr += type->memSize;
 1320|      0|    }
 1321|      0|    UA_free(dst->data); /* Remove the old array of ExtensionObjects */
  ------------------
  |  |  351|      0|# define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1322|      0|    dst->data = unpacked;
 1323|      0|    dst->type = type;
 1324|      0|}
ua_types_encoding_xml.c:lookupTypeByName:
 1258|  3.91k|lookupTypeByName(ParseCtxXml *ctx, UA_String typeName) {
 1259|       |    /* Search in the builtin types */
 1260|  96.8k|    for(size_t i = 0; i < UA_TYPES_COUNT; ++i) {
  ------------------
  |  |   17|  96.8k|#define UA_TYPES_COUNT 388
  ------------------
  |  Branch (1260:23): [True: 96.7k, False: 111]
  ------------------
 1261|  96.7k|        if(strncmp((char*)typeName.data, UA_TYPES[i].typeName, typeName.length) == 0)
  ------------------
  |  Branch (1261:12): [True: 3.80k, False: 92.8k]
  ------------------
 1262|  3.80k|            return &UA_TYPES[i];
 1263|  96.7k|    }
 1264|       |
 1265|       |    /* Search in the customTypes */
 1266|    111|    const UA_DataTypeArray *customTypes = ctx->customTypes;
 1267|    111|    while(customTypes) {
  ------------------
  |  Branch (1267:11): [True: 0, False: 111]
  ------------------
 1268|      0|        for(size_t i = 0; i < customTypes->typesSize; ++i) {
  ------------------
  |  Branch (1268:27): [True: 0, False: 0]
  ------------------
 1269|      0|            const UA_DataType *type = &customTypes->types[i];
 1270|      0|            if(strncmp((char*)typeName.data, type->typeName, typeName.length) == 0)
  ------------------
  |  Branch (1270:16): [True: 0, False: 0]
  ------------------
 1271|      0|                return type;
 1272|      0|        }
 1273|      0|        customTypes = customTypes->next;
 1274|      0|    }
 1275|    111|    return NULL;
 1276|    111|}
ua_types_encoding_xml.c:Array_decodeXml:
 1233|     14|Array_decodeXml(ParseCtxXml *ctx, size_t *dstSize, const UA_DataType *type) {
 1234|       |    /* Allocate memory */
 1235|     14|    size_t length = ctx->tokens[ctx->index].children;
 1236|     14|    void **dst = (void**)((uintptr_t)dstSize + sizeof(void*));
 1237|     14|    *dst = UA_Array_new(length, type);
 1238|     14|    if(!*dst)
  ------------------
  |  Branch (1238:8): [True: 0, False: 14]
  ------------------
 1239|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1240|     14|    *dstSize = length;
 1241|       |
 1242|       |    /* Go to first array member. */
 1243|     14|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
 1244|       |
 1245|       |    /* Decode array members */
 1246|     14|    uintptr_t ptr = (uintptr_t)*dst;
 1247|     14|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (1247:23): [True: 0, False: 14]
  ------------------
 1248|      0|        status ret = decodeXmlJumpTable[type->typeKind](ctx, (void*)ptr, type);
 1249|      0|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1249:12): [True: 0, False: 0]
  ------------------
 1250|      0|            return ret;
 1251|      0|        ptr += type->memSize;
 1252|      0|    }
 1253|       |
 1254|     14|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     14|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1255|     14|}
ua_types_encoding_xml.c:decodeXmlStructure:
 1455|    146|decodeXmlStructure(ParseCtxXml *ctx, void *dst, const UA_DataType *type) {
 1456|       |    /* Check the recursion limit */
 1457|    146|    if(ctx->depth >= UA_XML_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   15|    146|#define UA_XML_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (1457:8): [True: 0, False: 146]
  ------------------
 1458|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 1459|    146|    ctx->depth++;
 1460|       |
 1461|    146|    uintptr_t ptr = (uintptr_t)dst;
 1462|    146|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    146|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1463|    146|    u8 membersSize = type->membersSize;
 1464|    146|    UA_STACKARRAY(XmlDecodeEntry, entries, membersSize);
  ------------------
  |  |  387|    146|#  define UA_STACKARRAY(TYPE, NAME, SIZE) TYPE NAME[SIZE]
  ------------------
 1465|    666|    for(size_t i = 0; i < membersSize; ++i) {
  ------------------
  |  Branch (1465:23): [True: 520, False: 146]
  ------------------
 1466|    520|        const UA_DataTypeMember *m = &type->members[i];
 1467|    520|        const UA_DataType *mt = m->memberType;
 1468|    520|        entries[i].type = mt;
 1469|    520|        entries[i].name = UA_STRING((char*)(uintptr_t)m->memberName);
 1470|    520|        entries[i].found = false;
 1471|    520|        ptr += m->padding;
 1472|    520|        entries[i].fieldPointer = (void*)ptr;
 1473|    520|        if(!m->isArray) {
  ------------------
  |  Branch (1473:12): [True: 478, False: 42]
  ------------------
 1474|    478|            entries[i].function = NULL;
 1475|    478|            ptr += mt->memSize;
 1476|    478|        } else {
 1477|     42|            entries[i].function = (decodeXmlSignature)Array_decodeXml;
 1478|     42|            ptr += sizeof(size_t) + sizeof(void*);
 1479|     42|        }
 1480|    520|    }
 1481|       |
 1482|    146|    ret = decodeXmlFields(ctx, entries, membersSize);
 1483|       |
 1484|    146|    if(ctx->depth == 0)
  ------------------
  |  Branch (1484:8): [True: 0, False: 146]
  ------------------
 1485|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 1486|    146|    ctx->depth--;
 1487|    146|    return ret;
 1488|    146|}

UA_Guid_parse:
   84|     19|UA_Guid_parse(UA_Guid *guid, const UA_String str) {
   85|     19|    UA_StatusCode res = parse_guid(guid, str.data, str.data + str.length);
   86|     19|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|     19|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (86:8): [True: 19, False: 0]
  ------------------
   87|     19|        *guid = UA_GUID_NULL;
   88|     19|    return res;
   89|     19|}
ua_types_lex.c:parse_guid:
   48|     19|parse_guid(UA_Guid *guid, const UA_Byte *s, const UA_Byte *e) {
   49|     19|    size_t len = (size_t)(e - s);
   50|     19|    if(len != 36 || s[8] != '-' || s[13] != '-' || s[23] != '-')
  ------------------
  |  Branch (50:8): [True: 19, False: 0]
  |  Branch (50:21): [True: 0, False: 0]
  |  Branch (50:36): [True: 0, False: 0]
  |  Branch (50:52): [True: 0, False: 0]
  ------------------
   51|     19|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     19|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   52|       |
   53|      0|    UA_UInt32 tmp;
   54|      0|    if(UA_readNumberWithBase(s, 8, &tmp, 16) != 8)
  ------------------
  |  Branch (54:8): [True: 0, False: 0]
  ------------------
   55|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   56|      0|    guid->data1 = tmp;
   57|       |
   58|      0|    if(UA_readNumberWithBase(&s[9], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (58:8): [True: 0, False: 0]
  ------------------
   59|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   60|      0|    guid->data2 = (UA_UInt16)tmp;
   61|       |
   62|      0|    if(UA_readNumberWithBase(&s[14], 4, &tmp, 16) != 4)
  ------------------
  |  Branch (62:8): [True: 0, False: 0]
  ------------------
   63|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   64|      0|    guid->data3 = (UA_UInt16)tmp;
   65|       |
   66|      0|    if(UA_readNumberWithBase(&s[19], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (66:8): [True: 0, False: 0]
  ------------------
   67|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   68|      0|    guid->data4[0] = (UA_Byte)tmp;
   69|       |
   70|      0|    if(UA_readNumberWithBase(&s[21], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (70:8): [True: 0, False: 0]
  ------------------
   71|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   72|      0|    guid->data4[1] = (UA_Byte)tmp;
   73|       |
   74|      0|    for(size_t pos = 2, spos = 24; pos < 8; pos++, spos += 2) {
  ------------------
  |  Branch (74:36): [True: 0, False: 0]
  ------------------
   75|      0|        if(UA_readNumberWithBase(&s[spos], 2, &tmp, 16) != 2)
  ------------------
  |  Branch (75:12): [True: 0, False: 0]
  ------------------
   76|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
   77|      0|        guid->data4[pos] = (UA_Byte)tmp;
   78|      0|    }
   79|       |
   80|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   81|      0|}

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

fuzz_xml_decode_encode.cc:_ZL15UA_Variant_initP10UA_Variant:
  222|  7.57k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_xml_decode_encode.cc:_ZL16UA_Variant_clearP10UA_Variant:
  222|  2.57k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_xml_decode_encode.cc:_ZL19UA_ByteString_clearP9UA_String:
  222|  2.46k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_ByteString_init:
  222|  2.51k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_ExtensionObject_init:
  222|     50|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_clear:
  222|     69|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_copy:
  222|     96|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_init:
  222|     19|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_equal:
  222|  7.90k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl

