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

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

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

parseUInt64:
   30|  1.77k|parseUInt64(const char *str, size_t size, uint64_t *result) {
   31|  1.77k|    size_t i = 0;
   32|  1.77k|    uint64_t n = 0, prev = 0;
   33|       |
   34|       |    /* Hex */
   35|  1.77k|    if(size > 2 && str[0] == '0' && (str[1] | 32) == 'x') {
  ------------------
  |  Branch (35:8): [True: 1.58k, False: 183]
  |  Branch (35:20): [True: 273, False: 1.31k]
  |  Branch (35:37): [True: 127, False: 146]
  ------------------
   36|    127|        i = 2;
   37|  1.72k|        for(; i < size; i++) {
  ------------------
  |  Branch (37:15): [True: 1.63k, False: 90]
  ------------------
   38|  1.63k|            uint8_t c = (uint8_t)str[i] | 32;
   39|  1.63k|            if(c >= '0' && c <= '9')
  ------------------
  |  Branch (39:16): [True: 1.62k, False: 7]
  |  Branch (39:28): [True: 1.01k, False: 610]
  ------------------
   40|  1.01k|                c = (uint8_t)(c - '0');
   41|    617|            else if(c >= 'a' && c <='f')
  ------------------
  |  Branch (41:21): [True: 607, False: 10]
  |  Branch (41:33): [True: 590, False: 17]
  ------------------
   42|    590|                c = (uint8_t)(c - 'a' + 10);
   43|     27|            else if(c >= 'A' && c <='F')
  ------------------
  |  Branch (43:21): [True: 18, False: 9]
  |  Branch (43:33): [True: 0, False: 18]
  ------------------
   44|      0|                c = (uint8_t)(c - 'A' + 10);
   45|     27|            else
   46|     27|                break;
   47|  1.60k|            n = (n << 4) | (c & 0xF);
   48|  1.60k|            if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (48:16): [True: 10, False: 1.59k]
  ------------------
   49|     10|                return 0;
   50|  1.59k|            prev = n;
   51|  1.59k|        }
   52|    117|        *result = n;
   53|    117|        return (i > 2) ? i : 0; /* 2 -> No digit was parsed */
  ------------------
  |  Branch (53:16): [True: 114, False: 3]
  ------------------
   54|    127|    }
   55|       |
   56|       |    /* Decimal */
   57|  24.3k|    for(; i < size; i++) {
  ------------------
  |  Branch (57:11): [True: 23.1k, False: 1.16k]
  ------------------
   58|  23.1k|        if(str[i] < '0' || str[i] > '9')
  ------------------
  |  Branch (58:12): [True: 409, False: 22.7k]
  |  Branch (58:28): [True: 72, False: 22.7k]
  ------------------
   59|    481|            break;
   60|       |        /* Fast multiplication: n*10 == (n*8) + (n*2) */
   61|  22.7k|        n = (n << 3) + (n << 1) + (uint8_t)(str[i] - '0');
   62|  22.7k|        if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (62:12): [True: 1, False: 22.7k]
  ------------------
   63|      1|            return 0;
   64|  22.7k|        prev = n;
   65|  22.7k|    }
   66|  1.64k|    *result = n;
   67|  1.64k|    return i;
   68|  1.64k|}
parseInt64:
   71|  1.19k|parseInt64(const char *str, size_t size, int64_t *result) {
   72|       |    /* Negative value? */
   73|  1.19k|    size_t i = 0;
   74|  1.19k|    bool neg = false;
   75|  1.19k|    if(*str == '-' || *str == '+') {
  ------------------
  |  Branch (75:8): [True: 426, False: 769]
  |  Branch (75:23): [True: 4, False: 765]
  ------------------
   76|    430|        neg = (*str == '-');
   77|    430|        i++;
   78|    430|    }
   79|       |
   80|       |    /* Parse as unsigned */
   81|  1.19k|    uint64_t n = 0;
   82|  1.19k|    size_t len = parseUInt64(&str[i], size - i, &n);
   83|  1.19k|    if(len == 0)
  ------------------
  |  Branch (83:8): [True: 71, False: 1.12k]
  ------------------
   84|     71|        return 0;
   85|       |
   86|       |    /* Check for overflow, adjust and return */
   87|  1.12k|    if(!neg) {
  ------------------
  |  Branch (87:8): [True: 707, False: 417]
  ------------------
   88|    707|        if(n > 9223372036854775807UL)
  ------------------
  |  Branch (88:12): [True: 62, False: 645]
  ------------------
   89|     62|            return 0;
   90|    645|        *result = (int64_t)n;
   91|    645|    } else {
   92|    417|        if(n > 9223372036854775808UL)
  ------------------
  |  Branch (92:12): [True: 6, False: 411]
  ------------------
   93|      6|            return 0;
   94|    411|        *result = -(int64_t)n;
   95|    411|    }
   96|  1.05k|    return len + i;
   97|  1.12k|}
parseDouble:
   99|  1.32k|size_t parseDouble(const char *str, size_t size, double *result) {
  100|  1.32k|    char buf[2000];
  101|  1.32k|    if(size >= 2000)
  ------------------
  |  Branch (101:8): [True: 0, False: 1.32k]
  ------------------
  102|      0|        return 0;
  103|  1.32k|    memcpy(buf, str, size);
  104|  1.32k|    buf[size] = 0;
  105|  1.32k|    errno = 0;
  106|  1.32k|    char *endptr;
  107|  1.32k|    *result = strtod(buf, &endptr);
  108|  1.32k|    if(errno != 0 && errno != ERANGE)
  ------------------
  |  Branch (108:8): [True: 244, False: 1.08k]
  |  Branch (108:22): [True: 0, False: 244]
  ------------------
  109|      0|        return 0;
  110|  1.32k|    return (uintptr_t)endptr - (uintptr_t)buf;
  111|  1.32k|}

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|   125M|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|   125M|	unsigned ch = (unsigned)(_ch+256) & 0xff;
  315|   125M|	if(!ch)
  ------------------
  |  Branch (315:5): [True: 6, False: 125M]
  ------------------
  316|      6|		return YXML_ESYN;
  317|   125M|	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|   125M|	if(x->ignore == ch) {
  ------------------
  |  Branch (323:5): [True: 2.62k, False: 125M]
  ------------------
  324|  2.62k|		x->ignore = 0;
  325|  2.62k|		return YXML_OK;
  326|  2.62k|	}
  327|   125M|	x->ignore = (ch == 0xd) * 0xa;
  328|   125M|	if(ch == 0xa || ch == 0xd) {
  ------------------
  |  Branch (328:5): [True: 7.05k, False: 125M]
  |  Branch (328:18): [True: 4.19M, False: 121M]
  ------------------
  329|  4.20M|		ch = 0xa;
  330|  4.20M|		x->line++;
  331|  4.20M|		x->byte = 0;
  332|  4.20M|	}
  333|   125M|	x->byte++;
  334|       |
  335|   125M|	switch((yxml_state_t)x->state) {
  ------------------
  |  Branch (335:9): [True: 125M, False: 0]
  ------------------
  336|  12.3k|	case YXMLS_string:
  ------------------
  |  Branch (336:2): [True: 12.3k, False: 125M]
  ------------------
  337|  12.3k|		if(ch == *x->string) {
  ------------------
  |  Branch (337:6): [True: 12.3k, False: 12]
  ------------------
  338|  12.3k|			x->string++;
  339|  12.3k|			if(!*x->string)
  ------------------
  |  Branch (339:7): [True: 2.30k, False: 10.0k]
  ------------------
  340|  2.30k|				x->state = x->nextstate;
  341|  12.3k|			return YXML_OK;
  342|  12.3k|		}
  343|     12|		break;
  344|  33.1M|	case YXMLS_attr0:
  ------------------
  |  Branch (344:2): [True: 33.1M, False: 92.4M]
  ------------------
  345|  33.1M|		if(yxml_isName(ch))
  ------------------
  |  |  107|  33.1M|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|  66.3M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  66.3M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 2.51M, False: 30.6M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 479, False: 30.6M]
  |  |  |  |  |  Branch (106:61): [True: 848, False: 30.6M]
  |  |  |  |  |  Branch (106:73): [True: 27.1M, False: 3.50M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|  36.6M|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 53.4k, False: 3.44M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 4.50k, False: 3.44M]
  |  |  |  Branch (107:77): [True: 950, False: 3.44M]
  |  |  ------------------
  ------------------
  346|  29.7M|			return yxml_attrname(x, ch);
  347|  3.44M|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  3.44M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 2.48M, False: 957k]
  |  |  |  Branch (101:36): [True: 321, False: 956k]
  |  |  |  Branch (101:49): [True: 499, False: 956k]
  |  |  ------------------
  ------------------
  348|  2.48M|			x->state = YXMLS_attr1;
  349|  2.48M|			return yxml_attrnameend(x, ch);
  350|  2.48M|		}
  351|   956k|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (351:6): [True: 956k, False: 22]
  ------------------
  352|   956k|			x->state = YXMLS_attr2;
  353|   956k|			return yxml_attrnameend(x, ch);
  354|   956k|		}
  355|     22|		break;
  356|  2.48M|	case YXMLS_attr1:
  ------------------
  |  Branch (356:2): [True: 2.48M, False: 123M]
  ------------------
  357|  2.48M|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  2.48M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 247, False: 2.48M]
  |  |  |  Branch (101:36): [True: 302, False: 2.48M]
  |  |  |  Branch (101:49): [True: 194, False: 2.48M]
  |  |  ------------------
  ------------------
  358|    743|			return YXML_OK;
  359|  2.48M|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (359:6): [True: 2.48M, False: 18]
  ------------------
  360|  2.48M|			x->state = YXMLS_attr2;
  361|  2.48M|			return YXML_OK;
  362|  2.48M|		}
  363|     18|		break;
  364|  3.44M|	case YXMLS_attr2:
  ------------------
  |  Branch (364:2): [True: 3.44M, False: 122M]
  ------------------
  365|  3.44M|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  3.44M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 248, False: 3.44M]
  |  |  |  Branch (101:36): [True: 219, False: 3.44M]
  |  |  |  Branch (101:49): [True: 223, False: 3.44M]
  |  |  ------------------
  ------------------
  366|    690|			return YXML_OK;
  367|  3.44M|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (367:6): [True: 953k, False: 2.49M]
  |  Branch (367:35): [True: 2.49M, False: 16]
  ------------------
  368|  3.44M|			x->state = YXMLS_attr3;
  369|  3.44M|			x->quote = ch;
  370|  3.44M|			return YXML_OK;
  371|  3.44M|		}
  372|     16|		break;
  373|  3.81M|	case YXMLS_attr3:
  ------------------
  |  Branch (373:2): [True: 3.81M, False: 121M]
  ------------------
  374|  3.81M|		if(yxml_isAttValue(ch))
  ------------------
  |  |  109|  3.81M|#define yxml_isAttValue(c) (yxml_isChar(c) && c != x->quote && c != '<' && c != '&')
  |  |  ------------------
  |  |  |  |   99|  7.63M|#define yxml_isChar(c) 1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:24): [True: 3.81M, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (109:47): [True: 371k, False: 3.44M]
  |  |  |  Branch (109:64): [True: 371k, False: 1]
  |  |  |  Branch (109:76): [True: 370k, False: 803]
  |  |  ------------------
  ------------------
  375|   370k|			return yxml_dataattr(x, ch);
  376|  3.44M|		if(ch == (unsigned char)'&') {
  ------------------
  |  Branch (376:6): [True: 803, False: 3.44M]
  ------------------
  377|    803|			x->state = YXMLS_attr4;
  378|    803|			return yxml_refstart(x, ch);
  379|    803|		}
  380|  3.44M|		if(x->quote == ch) {
  ------------------
  |  Branch (380:6): [True: 3.44M, False: 1]
  ------------------
  381|  3.44M|			x->state = YXMLS_elem2;
  382|  3.44M|			return yxml_attrvalend(x, ch);
  383|  3.44M|		}
  384|      1|		break;
  385|  3.22k|	case YXMLS_attr4:
  ------------------
  |  Branch (385:2): [True: 3.22k, False: 125M]
  ------------------
  386|  3.22k|		if(yxml_isRef(ch))
  ------------------
  |  |  113|  3.22k|#define yxml_isRef(c) (yxml_isNum(c) || yxml_isAlpha(c) || c == '#')
  |  |  ------------------
  |  |  |  |  103|  6.45k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 743, False: 2.48k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isRef(c) (yxml_isNum(c) || yxml_isAlpha(c) || c == '#')
  |  |  ------------------
  |  |  |  |  102|  5.71k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 1.22k, False: 1.26k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (113:60): [True: 501, False: 765]
  |  |  ------------------
  ------------------
  387|  2.46k|			return yxml_ref(x, ch);
  388|    765|		if(ch == (unsigned char)'\x3b') {
  ------------------
  |  Branch (388:6): [True: 750, False: 15]
  ------------------
  389|    750|			x->state = YXMLS_attr3;
  390|    750|			return yxml_refattrval(x, ch);
  391|    750|		}
  392|     15|		break;
  393|  7.73k|	case YXMLS_cd0:
  ------------------
  |  Branch (393:2): [True: 7.73k, False: 125M]
  ------------------
  394|  7.73k|		if(ch == (unsigned char)']') {
  ------------------
  |  Branch (394:6): [True: 1.01k, False: 6.72k]
  ------------------
  395|  1.01k|			x->state = YXMLS_cd1;
  396|  1.01k|			return YXML_OK;
  397|  1.01k|		}
  398|  6.72k|		if(yxml_isChar(ch))
  ------------------
  |  |   99|  6.72k|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 6.72k, Folded]
  |  |  ------------------
  ------------------
  399|  6.72k|			return yxml_datacontent(x, ch);
  400|      0|		break;
  401|  1.01k|	case YXMLS_cd1:
  ------------------
  |  Branch (401:2): [True: 1.01k, False: 125M]
  ------------------
  402|  1.01k|		if(ch == (unsigned char)']') {
  ------------------
  |  Branch (402:6): [True: 763, False: 249]
  ------------------
  403|    763|			x->state = YXMLS_cd2;
  404|    763|			return YXML_OK;
  405|    763|		}
  406|    249|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    249|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 249, Folded]
  |  |  ------------------
  ------------------
  407|    249|			x->state = YXMLS_cd0;
  408|    249|			return yxml_datacd1(x, ch);
  409|    249|		}
  410|      0|		break;
  411|  1.19k|	case YXMLS_cd2:
  ------------------
  |  Branch (411:2): [True: 1.19k, False: 125M]
  ------------------
  412|  1.19k|		if(ch == (unsigned char)']')
  ------------------
  |  Branch (412:6): [True: 451, False: 748]
  ------------------
  413|    451|			return yxml_datacontent(x, ch);
  414|    748|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (414:6): [True: 347, False: 401]
  ------------------
  415|    347|			x->state = YXMLS_misc2;
  416|    347|			return YXML_OK;
  417|    347|		}
  418|    401|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    401|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 401, Folded]
  |  |  ------------------
  ------------------
  419|    401|			x->state = YXMLS_cd0;
  420|    401|			return yxml_datacd2(x, ch);
  421|    401|		}
  422|      0|		break;
  423|    217|	case YXMLS_comment0:
  ------------------
  |  Branch (423:2): [True: 217, False: 125M]
  ------------------
  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.20k|	case YXMLS_comment1:
  ------------------
  |  Branch (429:2): [True: 1.20k, False: 125M]
  ------------------
  430|  1.20k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (430:6): [True: 1.19k, False: 11]
  ------------------
  431|  1.19k|			x->state = YXMLS_comment2;
  432|  1.19k|			return YXML_OK;
  433|  1.19k|		}
  434|     11|		break;
  435|  1.82k|	case YXMLS_comment2:
  ------------------
  |  Branch (435:2): [True: 1.82k, False: 125M]
  ------------------
  436|  1.82k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (436:6): [True: 1.54k, False: 285]
  ------------------
  437|  1.54k|			x->state = YXMLS_comment3;
  438|  1.54k|			return YXML_OK;
  439|  1.54k|		}
  440|    285|		if(yxml_isChar(ch))
  ------------------
  |  |   99|    285|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 285, Folded]
  |  |  ------------------
  ------------------
  441|    285|			return YXML_OK;
  442|      0|		break;
  443|  1.53k|	case YXMLS_comment3:
  ------------------
  |  Branch (443:2): [True: 1.53k, False: 125M]
  ------------------
  444|  1.53k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (444:6): [True: 1.14k, False: 389]
  ------------------
  445|  1.14k|			x->state = YXMLS_comment4;
  446|  1.14k|			return YXML_OK;
  447|  1.14k|		}
  448|    389|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    389|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 389, Folded]
  |  |  ------------------
  ------------------
  449|    389|			x->state = YXMLS_comment2;
  450|    389|			return YXML_OK;
  451|    389|		}
  452|      0|		break;
  453|  1.13k|	case YXMLS_comment4:
  ------------------
  |  Branch (453:2): [True: 1.13k, False: 125M]
  ------------------
  454|  1.13k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (454:6): [True: 1.12k, False: 10]
  ------------------
  455|  1.12k|			x->state = x->nextstate;
  456|  1.12k|			return YXML_OK;
  457|  1.12k|		}
  458|     10|		break;
  459|  1.95k|	case YXMLS_dt0:
  ------------------
  |  Branch (459:2): [True: 1.95k, False: 125M]
  ------------------
  460|  1.95k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (460:6): [True: 345, False: 1.61k]
  ------------------
  461|    345|			x->state = YXMLS_misc1;
  462|    345|			return YXML_OK;
  463|    345|		}
  464|  1.61k|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (464:6): [True: 247, False: 1.36k]
  |  Branch (464:35): [True: 351, False: 1.01k]
  ------------------
  465|    598|			x->state = YXMLS_dt1;
  466|    598|			x->quote = ch;
  467|    598|			x->nextstate = YXMLS_dt0;
  468|    598|			return YXML_OK;
  469|    598|		}
  470|  1.01k|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (470:6): [True: 790, False: 222]
  ------------------
  471|    790|			x->state = YXMLS_dt2;
  472|    790|			return YXML_OK;
  473|    790|		}
  474|    222|		if(yxml_isChar(ch))
  ------------------
  |  |   99|    222|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 222, Folded]
  |  |  ------------------
  ------------------
  475|    222|			return YXML_OK;
  476|      0|		break;
  477|  1.14k|	case YXMLS_dt1:
  ------------------
  |  Branch (477:2): [True: 1.14k, False: 125M]
  ------------------
  478|  1.14k|		if(x->quote == ch) {
  ------------------
  |  Branch (478:6): [True: 938, False: 202]
  ------------------
  479|    938|			x->state = x->nextstate;
  480|    938|			return YXML_OK;
  481|    938|		}
  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|    783|	case YXMLS_dt2:
  ------------------
  |  Branch (485:2): [True: 783, False: 125M]
  ------------------
  486|    783|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (486:6): [True: 194, False: 589]
  ------------------
  487|    194|			x->state = YXMLS_pi0;
  488|    194|			x->nextstate = YXMLS_dt0;
  489|    194|			return YXML_OK;
  490|    194|		}
  491|    589|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (491:6): [True: 588, False: 1]
  ------------------
  492|    588|			x->state = YXMLS_dt3;
  493|    588|			return YXML_OK;
  494|    588|		}
  495|      1|		break;
  496|    582|	case YXMLS_dt3:
  ------------------
  |  Branch (496:2): [True: 582, False: 125M]
  ------------------
  497|    582|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (497:6): [True: 194, False: 388]
  ------------------
  498|    194|			x->state = YXMLS_comment1;
  499|    194|			x->nextstate = YXMLS_dt0;
  500|    194|			return YXML_OK;
  501|    194|		}
  502|    388|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    388|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 388, Folded]
  |  |  ------------------
  ------------------
  503|    388|			x->state = YXMLS_dt4;
  504|    388|			return YXML_OK;
  505|    388|		}
  506|      0|		break;
  507|    932|	case YXMLS_dt4:
  ------------------
  |  Branch (507:2): [True: 932, False: 125M]
  ------------------
  508|    932|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (508:6): [True: 194, False: 738]
  |  Branch (508:35): [True: 194, False: 544]
  ------------------
  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|    544|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (514:6): [True: 342, False: 202]
  ------------------
  515|    342|			x->state = YXMLS_dt0;
  516|    342|			return YXML_OK;
  517|    342|		}
  518|    202|		if(yxml_isChar(ch))
  ------------------
  |  |   99|    202|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 202, Folded]
  |  |  ------------------
  ------------------
  519|    202|			return YXML_OK;
  520|      0|		break;
  521|  10.9M|	case YXMLS_elem0:
  ------------------
  |  Branch (521:2): [True: 10.9M, False: 114M]
  ------------------
  522|  10.9M|		if(yxml_isName(ch))
  ------------------
  |  |  107|  10.9M|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|  21.8M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  21.8M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 341k, False: 10.5M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 628, False: 10.5M]
  |  |  |  |  |  Branch (106:61): [True: 1.10k, False: 10.5M]
  |  |  |  |  |  Branch (106:73): [True: 128k, False: 10.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|  21.3M|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 8.44k, False: 10.4M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 751, False: 10.4M]
  |  |  |  Branch (107:77): [True: 1.25k, False: 10.4M]
  |  |  ------------------
  ------------------
  523|   481k|			return yxml_elemname(x, ch);
  524|  10.4M|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  10.4M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 697, False: 10.4M]
  |  |  |  Branch (101:36): [True: 396, False: 10.4M]
  |  |  |  Branch (101:49): [True: 1.50k, False: 10.4M]
  |  |  ------------------
  ------------------
  525|  2.60k|			x->state = YXMLS_elem1;
  526|  2.60k|			return yxml_elemnameend(x, ch);
  527|  2.60k|		}
  528|  10.4M|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (528:6): [True: 10.4M, False: 22.6k]
  ------------------
  529|  10.4M|			x->state = YXMLS_elem3;
  530|  10.4M|			return yxml_elemnameend(x, ch);
  531|  10.4M|		}
  532|  22.6k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (532:6): [True: 22.6k, False: 24]
  ------------------
  533|  22.6k|			x->state = YXMLS_misc2;
  534|  22.6k|			return yxml_elemnameend(x, ch);
  535|  22.6k|		}
  536|     24|		break;
  537|  3.44M|	case YXMLS_elem1:
  ------------------
  |  Branch (537:2): [True: 3.44M, False: 122M]
  ------------------
  538|  3.44M|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  3.44M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 1.46k, False: 3.44M]
  |  |  |  Branch (101:36): [True: 230, False: 3.44M]
  |  |  |  Branch (101:49): [True: 354, False: 3.44M]
  |  |  ------------------
  ------------------
  539|  2.05k|			return YXML_OK;
  540|  3.44M|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (540:6): [True: 756, False: 3.44M]
  ------------------
  541|    756|			x->state = YXMLS_elem3;
  542|    756|			return YXML_OK;
  543|    756|		}
  544|  3.44M|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (544:6): [True: 397, False: 3.44M]
  ------------------
  545|    397|			x->state = YXMLS_misc2;
  546|    397|			return YXML_OK;
  547|    397|		}
  548|  3.44M|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  3.44M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  6.88M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 1.24M, False: 2.19M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 765, False: 2.19M]
  |  |  |  Branch (106:61): [True: 485, False: 2.19M]
  |  |  |  Branch (106:73): [True: 2.19M, False: 21]
  |  |  ------------------
  ------------------
  549|  3.44M|			x->state = YXMLS_attr0;
  550|  3.44M|			return yxml_attrstart(x, ch);
  551|  3.44M|		}
  552|     21|		break;
  553|  3.44M|	case YXMLS_elem2:
  ------------------
  |  Branch (553:2): [True: 3.44M, False: 122M]
  ------------------
  554|  3.44M|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  3.44M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 952k, False: 2.49M]
  |  |  |  Branch (101:36): [True: 573, False: 2.49M]
  |  |  |  Branch (101:49): [True: 2.49M, False: 917]
  |  |  ------------------
  ------------------
  555|  3.44M|			x->state = YXMLS_elem1;
  556|  3.44M|			return YXML_OK;
  557|  3.44M|		}
  558|    917|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (558:6): [True: 685, False: 232]
  ------------------
  559|    685|			x->state = YXMLS_elem3;
  560|    685|			return YXML_OK;
  561|    685|		}
  562|    232|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (562:6): [True: 212, False: 20]
  ------------------
  563|    212|			x->state = YXMLS_misc2;
  564|    212|			return YXML_OK;
  565|    212|		}
  566|     20|		break;
  567|  10.4M|	case YXMLS_elem3:
  ------------------
  |  Branch (567:2): [True: 10.4M, False: 115M]
  ------------------
  568|  10.4M|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (568:6): [True: 10.4M, False: 10]
  ------------------
  569|  10.4M|			x->state = YXMLS_misc2;
  570|  10.4M|			return yxml_selfclose(x, ch);
  571|  10.4M|		}
  572|     10|		break;
  573|    786|	case YXMLS_enc0:
  ------------------
  |  Branch (573:2): [True: 786, False: 125M]
  ------------------
  574|    786|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    786|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 592]
  |  |  |  Branch (101:36): [True: 203, False: 389]
  |  |  |  Branch (101:49): [True: 194, False: 195]
  |  |  ------------------
  ------------------
  575|    591|			return YXML_OK;
  576|    195|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (576:6): [True: 188, False: 7]
  ------------------
  577|    188|			x->state = YXMLS_enc1;
  578|    188|			return YXML_OK;
  579|    188|		}
  580|      7|		break;
  581|    747|	case YXMLS_enc1:
  ------------------
  |  Branch (581:2): [True: 747, False: 125M]
  ------------------
  582|    747|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    747|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 196, False: 551]
  |  |  |  Branch (101:36): [True: 194, False: 357]
  |  |  |  Branch (101:49): [True: 194, False: 163]
  |  |  ------------------
  ------------------
  583|    584|			return YXML_OK;
  584|    163|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (584:6): [True: 35, False: 128]
  |  Branch (584:35): [True: 113, False: 15]
  ------------------
  585|    148|			x->state = YXMLS_enc2;
  586|    148|			x->quote = ch;
  587|    148|			return YXML_OK;
  588|    148|		}
  589|     15|		break;
  590|    146|	case YXMLS_enc2:
  ------------------
  |  Branch (590:2): [True: 146, False: 125M]
  ------------------
  591|    146|		if(yxml_isAlpha(ch)) {
  ------------------
  |  |  102|    146|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  ------------------
  |  |  |  Branch (102:25): [True: 137, False: 9]
  |  |  ------------------
  ------------------
  592|    137|			x->state = YXMLS_enc3;
  593|    137|			return YXML_OK;
  594|    137|		}
  595|      9|		break;
  596|  1.09k|	case YXMLS_enc3:
  ------------------
  |  Branch (596:2): [True: 1.09k, False: 125M]
  ------------------
  597|  1.09k|		if(yxml_isEncName(ch))
  ------------------
  |  |  105|  1.09k|#define yxml_isEncName(c) (yxml_isAlpha(c) || yxml_isNum(c) || c == '.' || c == '_' || c == '-')
  |  |  ------------------
  |  |  |  |  102|  2.19k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 214, False: 881]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isEncName(c) (yxml_isAlpha(c) || yxml_isNum(c) || c == '.' || c == '_' || c == '-')
  |  |  ------------------
  |  |  |  |  103|  1.97k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 201, False: 680]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:64): [True: 196, False: 484]
  |  |  |  Branch (105:76): [True: 197, False: 287]
  |  |  |  Branch (105:88): [True: 196, False: 91]
  |  |  ------------------
  ------------------
  598|  1.00k|			return YXML_OK;
  599|     91|		if(x->quote == ch) {
  ------------------
  |  Branch (599:6): [True: 72, False: 19]
  ------------------
  600|     72|			x->state = YXMLS_xmldecl6;
  601|     72|			return YXML_OK;
  602|     72|		}
  603|     19|		break;
  604|  21.1k|	case YXMLS_etag0:
  ------------------
  |  Branch (604:2): [True: 21.1k, False: 125M]
  ------------------
  605|  21.1k|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  21.1k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  42.3k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 11.5k, False: 9.60k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 559, False: 9.04k]
  |  |  |  Branch (106:61): [True: 548, False: 8.49k]
  |  |  |  Branch (106:73): [True: 8.47k, False: 16]
  |  |  ------------------
  ------------------
  606|  21.1k|			x->state = YXMLS_etag1;
  607|  21.1k|			return yxml_elemclose(x, ch);
  608|  21.1k|		}
  609|     16|		break;
  610|  68.1k|	case YXMLS_etag1:
  ------------------
  |  Branch (610:2): [True: 68.1k, False: 125M]
  ------------------
  611|  68.1k|		if(yxml_isName(ch))
  ------------------
  |  |  107|  68.1k|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|   136k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|   136k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 42.5k, False: 25.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 208, False: 25.3k]
  |  |  |  |  |  Branch (106:61): [True: 310, False: 25.0k]
  |  |  |  |  |  Branch (106:73): [True: 349, False: 24.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|  92.8k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 3.19k, False: 21.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 323, False: 21.2k]
  |  |  |  Branch (107:77): [True: 194, False: 21.0k]
  |  |  ------------------
  ------------------
  612|  47.1k|			return yxml_elemclose(x, ch);
  613|  21.0k|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  21.0k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 262, False: 20.7k]
  |  |  |  Branch (101:36): [True: 218, False: 20.5k]
  |  |  |  Branch (101:49): [True: 401, False: 20.1k]
  |  |  ------------------
  ------------------
  614|    881|			x->state = YXMLS_etag2;
  615|    881|			return yxml_elemcloseend(x, ch);
  616|    881|		}
  617|  20.1k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (617:6): [True: 20.1k, False: 20]
  ------------------
  618|  20.1k|			x->state = YXMLS_misc2;
  619|  20.1k|			return yxml_elemcloseend(x, ch);
  620|  20.1k|		}
  621|     20|		break;
  622|  1.44k|	case YXMLS_etag2:
  ------------------
  |  Branch (622:2): [True: 1.44k, False: 125M]
  ------------------
  623|  1.44k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.44k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 214, False: 1.22k]
  |  |  |  Branch (101:36): [True: 194, False: 1.03k]
  |  |  |  Branch (101:49): [True: 195, False: 838]
  |  |  ------------------
  ------------------
  624|    603|			return YXML_OK;
  625|    838|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (625:6): [True: 817, False: 21]
  ------------------
  626|    817|			x->state = YXMLS_misc2;
  627|    817|			return YXML_OK;
  628|    817|		}
  629|     21|		break;
  630|  8.07k|	case YXMLS_init:
  ------------------
  |  Branch (630:2): [True: 8.07k, False: 125M]
  ------------------
  631|  8.07k|		if(ch == (unsigned char)'\xef') {
  ------------------
  |  Branch (631:6): [True: 18, False: 8.06k]
  ------------------
  632|     18|			x->state = YXMLS_string;
  633|     18|			x->nextstate = YXMLS_misc0;
  634|     18|			x->string = (unsigned char *)"\xbb\xbf";
  635|     18|			return YXML_OK;
  636|     18|		}
  637|  8.06k|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  8.06k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 23, False: 8.03k]
  |  |  |  Branch (101:36): [True: 34, False: 8.00k]
  |  |  |  Branch (101:49): [True: 45, False: 7.95k]
  |  |  ------------------
  ------------------
  638|    102|			x->state = YXMLS_misc0;
  639|    102|			return YXML_OK;
  640|    102|		}
  641|  7.95k|		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.96k|	case YXMLS_le0:
  ------------------
  |  Branch (646:2): [True: 7.96k, False: 125M]
  ------------------
  647|  7.96k|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (647:6): [True: 292, False: 7.67k]
  ------------------
  648|    292|			x->state = YXMLS_lee1;
  649|    292|			return YXML_OK;
  650|    292|		}
  651|  7.67k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (651:6): [True: 1.22k, False: 6.44k]
  ------------------
  652|  1.22k|			x->state = YXMLS_leq0;
  653|  1.22k|			return YXML_OK;
  654|  1.22k|		}
  655|  6.44k|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  6.44k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  12.8k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 1.83k, False: 4.61k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 95, False: 4.51k]
  |  |  |  Branch (106:61): [True: 102, False: 4.41k]
  |  |  |  Branch (106:73): [True: 4.39k, False: 23]
  |  |  ------------------
  ------------------
  656|  6.42k|			x->state = YXMLS_elem0;
  657|  6.42k|			return yxml_elemstart(x, ch);
  658|  6.42k|		}
  659|     23|		break;
  660|  2.43k|	case YXMLS_le1:
  ------------------
  |  Branch (660:2): [True: 2.43k, False: 125M]
  ------------------
  661|  2.43k|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (661:6): [True: 764, False: 1.66k]
  ------------------
  662|    764|			x->state = YXMLS_lee1;
  663|    764|			return YXML_OK;
  664|    764|		}
  665|  1.66k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (665:6): [True: 1.45k, False: 211]
  ------------------
  666|  1.45k|			x->state = YXMLS_pi0;
  667|  1.45k|			x->nextstate = YXMLS_misc1;
  668|  1.45k|			return YXML_OK;
  669|  1.45k|		}
  670|    211|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|    211|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|    422|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 9, False: 202]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 4, False: 198]
  |  |  |  Branch (106:61): [True: 32, False: 166]
  |  |  |  Branch (106:73): [True: 151, False: 15]
  |  |  ------------------
  ------------------
  671|    196|			x->state = YXMLS_elem0;
  672|    196|			return yxml_elemstart(x, ch);
  673|    196|		}
  674|     15|		break;
  675|  10.4M|	case YXMLS_le2:
  ------------------
  |  Branch (675:2): [True: 10.4M, False: 115M]
  ------------------
  676|  10.4M|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (676:6): [True: 744, False: 10.4M]
  ------------------
  677|    744|			x->state = YXMLS_lee2;
  678|    744|			return YXML_OK;
  679|    744|		}
  680|  10.4M|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (680:6): [True: 1.59k, False: 10.4M]
  ------------------
  681|  1.59k|			x->state = YXMLS_pi0;
  682|  1.59k|			x->nextstate = YXMLS_misc2;
  683|  1.59k|			return YXML_OK;
  684|  1.59k|		}
  685|  10.4M|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (685:6): [True: 21.1k, False: 10.4M]
  ------------------
  686|  21.1k|			x->state = YXMLS_etag0;
  687|  21.1k|			return YXML_OK;
  688|  21.1k|		}
  689|  10.4M|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  10.4M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  20.8M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 31.9k, False: 10.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 1.00k, False: 10.3M]
  |  |  |  Branch (106:61): [True: 1.05k, False: 10.3M]
  |  |  |  Branch (106:73): [True: 10.3M, False: 24]
  |  |  ------------------
  ------------------
  690|  10.4M|			x->state = YXMLS_elem0;
  691|  10.4M|			return yxml_elemstart(x, ch);
  692|  10.4M|		}
  693|     24|		break;
  694|    669|	case YXMLS_le3:
  ------------------
  |  Branch (694:2): [True: 669, False: 125M]
  ------------------
  695|    669|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (695:6): [True: 222, False: 447]
  ------------------
  696|    222|			x->state = YXMLS_comment0;
  697|    222|			x->nextstate = YXMLS_misc3;
  698|    222|			return YXML_OK;
  699|    222|		}
  700|    447|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (700:6): [True: 430, False: 17]
  ------------------
  701|    430|			x->state = YXMLS_pi0;
  702|    430|			x->nextstate = YXMLS_misc3;
  703|    430|			return YXML_OK;
  704|    430|		}
  705|     17|		break;
  706|  1.04k|	case YXMLS_lee1:
  ------------------
  |  Branch (706:2): [True: 1.04k, False: 125M]
  ------------------
  707|  1.04k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (707:6): [True: 519, False: 529]
  ------------------
  708|    519|			x->state = YXMLS_comment1;
  709|    519|			x->nextstate = YXMLS_misc1;
  710|    519|			return YXML_OK;
  711|    519|		}
  712|    529|		if(ch == (unsigned char)'D') {
  ------------------
  |  Branch (712:6): [True: 515, False: 14]
  ------------------
  713|    515|			x->state = YXMLS_string;
  714|    515|			x->nextstate = YXMLS_dt0;
  715|    515|			x->string = (unsigned char *)"OCTYPE";
  716|    515|			return YXML_OK;
  717|    515|		}
  718|     14|		break;
  719|    739|	case YXMLS_lee2:
  ------------------
  |  Branch (719:2): [True: 739, False: 125M]
  ------------------
  720|    739|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (720:6): [True: 311, False: 428]
  ------------------
  721|    311|			x->state = YXMLS_comment1;
  722|    311|			x->nextstate = YXMLS_misc2;
  723|    311|			return YXML_OK;
  724|    311|		}
  725|    428|		if(ch == (unsigned char)'[') {
  ------------------
  |  Branch (725:6): [True: 413, False: 15]
  ------------------
  726|    413|			x->state = YXMLS_string;
  727|    413|			x->nextstate = YXMLS_cd0;
  728|    413|			x->string = (unsigned char *)"CDATA[";
  729|    413|			return YXML_OK;
  730|    413|		}
  731|     15|		break;
  732|  1.22k|	case YXMLS_leq0:
  ------------------
  |  Branch (732:2): [True: 1.22k, False: 125M]
  ------------------
  733|  1.22k|		if(ch == (unsigned char)'x') {
  ------------------
  |  Branch (733:6): [True: 905, False: 322]
  ------------------
  734|    905|			x->state = YXMLS_xmldecl0;
  735|    905|			x->nextstate = YXMLS_misc1;
  736|    905|			return yxml_pistart(x, ch);
  737|    905|		}
  738|    322|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|    322|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|    644|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 158, False: 164]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 20, False: 144]
  |  |  |  Branch (106:61): [True: 19, False: 125]
  |  |  |  Branch (106:73): [True: 108, False: 17]
  |  |  ------------------
  ------------------
  739|    305|			x->state = YXMLS_pi1;
  740|    305|			x->nextstate = YXMLS_misc1;
  741|    305|			return yxml_pistart(x, ch);
  742|    305|		}
  743|     17|		break;
  744|  1.19k|	case YXMLS_misc0:
  ------------------
  |  Branch (744:2): [True: 1.19k, False: 125M]
  ------------------
  745|  1.19k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.19k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 1.00k]
  |  |  |  Branch (101:36): [True: 194, False: 807]
  |  |  |  Branch (101:49): [True: 748, False: 59]
  |  |  ------------------
  ------------------
  746|  1.13k|			return YXML_OK;
  747|     59|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (747:6): [True: 37, False: 22]
  ------------------
  748|     37|			x->state = YXMLS_le0;
  749|     37|			return YXML_OK;
  750|     37|		}
  751|     22|		break;
  752|  3.04k|	case YXMLS_misc1:
  ------------------
  |  Branch (752:2): [True: 3.04k, False: 125M]
  ------------------
  753|  3.04k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  3.04k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 195, False: 2.84k]
  |  |  |  Branch (101:36): [True: 194, False: 2.65k]
  |  |  |  Branch (101:49): [True: 206, False: 2.44k]
  |  |  ------------------
  ------------------
  754|    595|			return YXML_OK;
  755|  2.44k|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (755:6): [True: 2.43k, False: 11]
  ------------------
  756|  2.43k|			x->state = YXMLS_le1;
  757|  2.43k|			return YXML_OK;
  758|  2.43k|		}
  759|     11|		break;
  760|  43.8M|	case YXMLS_misc2:
  ------------------
  |  Branch (760:2): [True: 43.8M, False: 81.8M]
  ------------------
  761|  43.8M|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (761:6): [True: 10.4M, False: 33.3M]
  ------------------
  762|  10.4M|			x->state = YXMLS_le2;
  763|  10.4M|			return YXML_OK;
  764|  10.4M|		}
  765|  33.3M|		if(ch == (unsigned char)'&') {
  ------------------
  |  Branch (765:6): [True: 2.52k, False: 33.3M]
  ------------------
  766|  2.52k|			x->state = YXMLS_misc2a;
  767|  2.52k|			return yxml_refstart(x, ch);
  768|  2.52k|		}
  769|  33.3M|		if(yxml_isChar(ch))
  ------------------
  |  |   99|  33.3M|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 33.3M, Folded]
  |  |  ------------------
  ------------------
  770|  33.3M|			return yxml_datacontent(x, ch);
  771|      0|		break;
  772|  11.3k|	case YXMLS_misc2a:
  ------------------
  |  Branch (772:2): [True: 11.3k, False: 125M]
  ------------------
  773|  11.3k|		if(yxml_isRef(ch))
  ------------------
  |  |  113|  11.3k|#define yxml_isRef(c) (yxml_isNum(c) || yxml_isAlpha(c) || c == '#')
  |  |  ------------------
  |  |  |  |  103|  22.7k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 3.05k, False: 8.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isRef(c) (yxml_isNum(c) || yxml_isAlpha(c) || c == '#')
  |  |  ------------------
  |  |  |  |  102|  19.6k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 4.25k, False: 4.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (113:60): [True: 1.56k, False: 2.47k]
  |  |  ------------------
  ------------------
  774|  8.87k|			return yxml_ref(x, ch);
  775|  2.47k|		if(ch == (unsigned char)'\x3b') {
  ------------------
  |  Branch (775:6): [True: 2.46k, False: 16]
  ------------------
  776|  2.46k|			x->state = YXMLS_misc2;
  777|  2.46k|			return yxml_refcontent(x, ch);
  778|  2.46k|		}
  779|     16|		break;
  780|  1.28k|	case YXMLS_misc3:
  ------------------
  |  Branch (780:2): [True: 1.28k, False: 125M]
  ------------------
  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: 195, False: 893]
  |  |  |  Branch (101:49): [True: 197, False: 696]
  |  |  ------------------
  ------------------
  782|    586|			return YXML_OK;
  783|    696|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (783:6): [True: 675, False: 21]
  ------------------
  784|    675|			x->state = YXMLS_le3;
  785|    675|			return YXML_OK;
  786|    675|		}
  787|     21|		break;
  788|  3.64k|	case YXMLS_pi0:
  ------------------
  |  Branch (788:2): [True: 3.64k, False: 125M]
  ------------------
  789|  3.64k|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  3.64k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  7.28k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 1.80k, False: 1.83k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 746, False: 1.09k]
  |  |  |  Branch (106:61): [True: 406, False: 684]
  |  |  |  Branch (106:73): [True: 671, False: 13]
  |  |  ------------------
  ------------------
  790|  3.63k|			x->state = YXMLS_pi1;
  791|  3.63k|			return yxml_pistart(x, ch);
  792|  3.63k|		}
  793|     13|		break;
  794|  9.20k|	case YXMLS_pi1:
  ------------------
  |  Branch (794:2): [True: 9.20k, False: 125M]
  ------------------
  795|  9.20k|		if(yxml_isName(ch))
  ------------------
  |  |  107|  9.20k|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|  18.4k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  18.4k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 2.37k, False: 6.82k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 194, False: 6.63k]
  |  |  |  |  |  Branch (106:61): [True: 393, False: 6.24k]
  |  |  |  |  |  Branch (106:73): [True: 1.46k, False: 4.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|  13.9k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 331, False: 4.44k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 196, False: 4.24k]
  |  |  |  Branch (107:77): [True: 282, False: 3.96k]
  |  |  ------------------
  ------------------
  796|  5.24k|			return yxml_piname(x, ch);
  797|  3.96k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (797:6): [True: 2.37k, False: 1.58k]
  ------------------
  798|  2.37k|			x->state = YXMLS_pi4;
  799|  2.37k|			return yxml_pinameend(x, ch);
  800|  2.37k|		}
  801|  1.58k|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  1.58k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 692, False: 897]
  |  |  |  Branch (101:36): [True: 278, False: 619]
  |  |  |  Branch (101:49): [True: 596, False: 23]
  |  |  ------------------
  ------------------
  802|  1.56k|			x->state = YXMLS_pi2;
  803|  1.56k|			return yxml_pinameend(x, ch);
  804|  1.56k|		}
  805|     23|		break;
  806|  33.0k|	case YXMLS_pi2:
  ------------------
  |  Branch (806:2): [True: 33.0k, False: 125M]
  ------------------
  807|  33.0k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (807:6): [True: 2.37k, False: 30.6k]
  ------------------
  808|  2.37k|			x->state = YXMLS_pi3;
  809|  2.37k|			return YXML_OK;
  810|  2.37k|		}
  811|  30.6k|		if(yxml_isChar(ch))
  ------------------
  |  |   99|  30.6k|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 30.6k, Folded]
  |  |  ------------------
  ------------------
  812|  30.6k|			return yxml_datapi1(x, ch);
  813|      0|		break;
  814|  2.36k|	case YXMLS_pi3:
  ------------------
  |  Branch (814:2): [True: 2.36k, False: 125M]
  ------------------
  815|  2.36k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (815:6): [True: 1.50k, False: 857]
  ------------------
  816|  1.50k|			x->state = x->nextstate;
  817|  1.50k|			return yxml_pivalend(x, ch);
  818|  1.50k|		}
  819|    857|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    857|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 857, Folded]
  |  |  ------------------
  ------------------
  820|    857|			x->state = YXMLS_pi2;
  821|    857|			return yxml_datapi2(x, ch);
  822|    857|		}
  823|      0|		break;
  824|  2.34k|	case YXMLS_pi4:
  ------------------
  |  Branch (824:2): [True: 2.34k, False: 125M]
  ------------------
  825|  2.34k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (825:6): [True: 2.33k, False: 12]
  ------------------
  826|  2.33k|			x->state = x->nextstate;
  827|  2.33k|			return yxml_pivalend(x, ch);
  828|  2.33k|		}
  829|     12|		break;
  830|    693|	case YXMLS_std0:
  ------------------
  |  Branch (830:2): [True: 693, False: 125M]
  ------------------
  831|    693|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    693|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 499]
  |  |  |  Branch (101:36): [True: 195, False: 304]
  |  |  |  Branch (101:49): [True: 194, False: 110]
  |  |  ------------------
  ------------------
  832|    583|			return YXML_OK;
  833|    110|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (833:6): [True: 99, False: 11]
  ------------------
  834|     99|			x->state = YXMLS_std1;
  835|     99|			return YXML_OK;
  836|     99|		}
  837|     11|		break;
  838|    656|	case YXMLS_std1:
  ------------------
  |  Branch (838:2): [True: 656, False: 125M]
  ------------------
  839|    656|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    656|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 462]
  |  |  |  Branch (101:36): [True: 194, False: 268]
  |  |  |  Branch (101:49): [True: 194, False: 74]
  |  |  ------------------
  ------------------
  840|    582|			return YXML_OK;
  841|     74|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (841:6): [True: 22, False: 52]
  |  Branch (841:35): [True: 43, False: 9]
  ------------------
  842|     65|			x->state = YXMLS_std2;
  843|     65|			x->quote = ch;
  844|     65|			return YXML_OK;
  845|     65|		}
  846|      9|		break;
  847|     63|	case YXMLS_std2:
  ------------------
  |  Branch (847:2): [True: 63, False: 125M]
  ------------------
  848|     63|		if(ch == (unsigned char)'y') {
  ------------------
  |  Branch (848:6): [True: 3, False: 60]
  ------------------
  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|     60|		if(ch == (unsigned char)'n') {
  ------------------
  |  Branch (854:6): [True: 47, False: 13]
  ------------------
  855|     47|			x->state = YXMLS_string;
  856|     47|			x->nextstate = YXMLS_std3;
  857|     47|			x->string = (unsigned char *)"o";
  858|     47|			return YXML_OK;
  859|     47|		}
  860|     13|		break;
  861|     47|	case YXMLS_std3:
  ------------------
  |  Branch (861:2): [True: 47, False: 125M]
  ------------------
  862|     47|		if(x->quote == ch) {
  ------------------
  |  Branch (862:6): [True: 46, False: 1]
  ------------------
  863|     46|			x->state = YXMLS_xmldecl8;
  864|     46|			return YXML_OK;
  865|     46|		}
  866|      1|		break;
  867|  1.09k|	case YXMLS_ver0:
  ------------------
  |  Branch (867:2): [True: 1.09k, False: 125M]
  ------------------
  868|  1.09k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.09k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 897]
  |  |  |  Branch (101:36): [True: 194, False: 703]
  |  |  |  Branch (101:49): [True: 194, False: 509]
  |  |  ------------------
  ------------------
  869|    582|			return YXML_OK;
  870|    509|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (870:6): [True: 501, False: 8]
  ------------------
  871|    501|			x->state = YXMLS_ver1;
  872|    501|			return YXML_OK;
  873|    501|		}
  874|      8|		break;
  875|  1.06k|	case YXMLS_ver1:
  ------------------
  |  Branch (875:2): [True: 1.06k, False: 125M]
  ------------------
  876|  1.06k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.06k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 196, False: 864]
  |  |  |  Branch (101:36): [True: 194, False: 670]
  |  |  |  Branch (101:49): [True: 194, False: 476]
  |  |  ------------------
  ------------------
  877|    584|			return YXML_OK;
  878|    476|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (878:6): [True: 4, False: 472]
  |  Branch (878:35): [True: 456, False: 16]
  ------------------
  879|    460|			x->state = YXMLS_string;
  880|    460|			x->quote = ch;
  881|    460|			x->nextstate = YXMLS_ver2;
  882|    460|			x->string = (unsigned char *)"1.";
  883|    460|			return YXML_OK;
  884|    460|		}
  885|     16|		break;
  886|    457|	case YXMLS_ver2:
  ------------------
  |  Branch (886:2): [True: 457, False: 125M]
  ------------------
  887|    457|		if(yxml_isNum(ch)) {
  ------------------
  |  |  103|    457|#define yxml_isNum(c) (c-'0' < 10)
  |  |  ------------------
  |  |  |  Branch (103:23): [True: 451, False: 6]
  |  |  ------------------
  ------------------
  888|    451|			x->state = YXMLS_ver3;
  889|    451|			return YXML_OK;
  890|    451|		}
  891|      6|		break;
  892|    636|	case YXMLS_ver3:
  ------------------
  |  Branch (892:2): [True: 636, False: 125M]
  ------------------
  893|    636|		if(yxml_isNum(ch))
  ------------------
  |  |  103|    636|#define yxml_isNum(c) (c-'0' < 10)
  |  |  ------------------
  |  |  |  Branch (103:23): [True: 194, False: 442]
  |  |  ------------------
  ------------------
  894|    194|			return YXML_OK;
  895|    442|		if(x->quote == ch) {
  ------------------
  |  Branch (895:6): [True: 431, False: 11]
  ------------------
  896|    431|			x->state = YXMLS_xmldecl4;
  897|    431|			return YXML_OK;
  898|    431|		}
  899|     11|		break;
  900|    904|	case YXMLS_xmldecl0:
  ------------------
  |  Branch (900:2): [True: 904, False: 125M]
  ------------------
  901|    904|		if(ch == (unsigned char)'m') {
  ------------------
  |  Branch (901:6): [True: 786, False: 118]
  ------------------
  902|    786|			x->state = YXMLS_xmldecl1;
  903|    786|			return yxml_piname(x, ch);
  904|    786|		}
  905|    118|		if(yxml_isName(ch)) {
  ------------------
  |  |  107|    118|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|    236|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    236|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 24, False: 94]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 4, False: 90]
  |  |  |  |  |  Branch (106:61): [True: 3, False: 87]
  |  |  |  |  |  Branch (106:73): [True: 14, False: 73]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|    191|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 5, False: 68]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 3, False: 65]
  |  |  |  Branch (107:77): [True: 3, False: 62]
  |  |  ------------------
  ------------------
  906|     56|			x->state = YXMLS_pi1;
  907|     56|			return yxml_piname(x, ch);
  908|     56|		}
  909|     62|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (909:6): [True: 19, False: 43]
  ------------------
  910|     19|			x->state = YXMLS_pi4;
  911|     19|			return yxml_pinameend(x, ch);
  912|     19|		}
  913|     43|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|     43|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 8, False: 35]
  |  |  |  Branch (101:36): [True: 3, False: 32]
  |  |  |  Branch (101:49): [True: 7, False: 25]
  |  |  ------------------
  ------------------
  914|     18|			x->state = YXMLS_pi2;
  915|     18|			return yxml_pinameend(x, ch);
  916|     18|		}
  917|     25|		break;
  918|    785|	case YXMLS_xmldecl1:
  ------------------
  |  Branch (918:2): [True: 785, False: 125M]
  ------------------
  919|    785|		if(ch == (unsigned char)'l') {
  ------------------
  |  Branch (919:6): [True: 707, False: 78]
  ------------------
  920|    707|			x->state = YXMLS_xmldecl2;
  921|    707|			return yxml_piname(x, ch);
  922|    707|		}
  923|     78|		if(yxml_isName(ch)) {
  ------------------
  |  |  107|     78|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|    156|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    156|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 13, False: 65]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 3, False: 62]
  |  |  |  |  |  Branch (106:61): [True: 3, False: 59]
  |  |  |  |  |  Branch (106:73): [True: 10, False: 49]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|    127|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 7, False: 42]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 3, False: 39]
  |  |  |  Branch (107:77): [True: 3, False: 36]
  |  |  ------------------
  ------------------
  924|     42|			x->state = YXMLS_pi1;
  925|     42|			return yxml_piname(x, ch);
  926|     42|		}
  927|     36|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (927:6): [True: 3, False: 33]
  ------------------
  928|      3|			x->state = YXMLS_pi4;
  929|      3|			return yxml_pinameend(x, ch);
  930|      3|		}
  931|     33|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|     33|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 3, False: 30]
  |  |  |  Branch (101:36): [True: 3, False: 27]
  |  |  |  Branch (101:49): [True: 4, False: 23]
  |  |  ------------------
  ------------------
  932|     10|			x->state = YXMLS_pi2;
  933|     10|			return yxml_pinameend(x, ch);
  934|     10|		}
  935|     23|		break;
  936|    706|	case YXMLS_xmldecl2:
  ------------------
  |  Branch (936:2): [True: 706, False: 125M]
  ------------------
  937|    706|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|    706|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 553, False: 153]
  |  |  |  Branch (101:36): [True: 9, False: 144]
  |  |  |  Branch (101:49): [True: 15, False: 129]
  |  |  ------------------
  ------------------
  938|    577|			x->state = YXMLS_xmldecl3;
  939|    577|			return yxml_piabort(x, ch);
  940|    577|		}
  941|    129|		if(yxml_isName(ch)) {
  ------------------
  |  |  107|    129|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|    258|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    258|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 11, False: 118]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 3, False: 115]
  |  |  |  |  |  Branch (106:61): [True: 3, False: 112]
  |  |  |  |  |  Branch (106:73): [True: 79, False: 33]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|    162|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 7, False: 26]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 4, False: 22]
  |  |  |  Branch (107:77): [True: 3, False: 19]
  |  |  ------------------
  ------------------
  942|    110|			x->state = YXMLS_pi1;
  943|    110|			return yxml_piname(x, ch);
  944|    110|		}
  945|     19|		break;
  946|  1.13k|	case YXMLS_xmldecl3:
  ------------------
  |  Branch (946:2): [True: 1.13k, False: 125M]
  ------------------
  947|  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: 938]
  |  |  |  Branch (101:36): [True: 194, False: 744]
  |  |  |  Branch (101:49): [True: 194, False: 550]
  |  |  ------------------
  ------------------
  948|    582|			return YXML_OK;
  949|    550|		if(ch == (unsigned char)'v') {
  ------------------
  |  Branch (949:6): [True: 536, False: 14]
  ------------------
  950|    536|			x->state = YXMLS_string;
  951|    536|			x->nextstate = YXMLS_ver0;
  952|    536|			x->string = (unsigned char *)"ersion";
  953|    536|			return YXML_OK;
  954|    536|		}
  955|     14|		break;
  956|    430|	case YXMLS_xmldecl4:
  ------------------
  |  Branch (956:2): [True: 430, False: 125M]
  ------------------
  957|    430|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|    430|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 344, False: 86]
  |  |  |  Branch (101:36): [True: 9, False: 77]
  |  |  |  Branch (101:49): [True: 46, False: 31]
  |  |  ------------------
  ------------------
  958|    399|			x->state = YXMLS_xmldecl5;
  959|    399|			return YXML_OK;
  960|    399|		}
  961|     31|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (961:6): [True: 16, False: 15]
  ------------------
  962|     16|			x->state = YXMLS_xmldecl9;
  963|     16|			return YXML_OK;
  964|     16|		}
  965|     15|		break;
  966|    954|	case YXMLS_xmldecl5:
  ------------------
  |  Branch (966:2): [True: 954, False: 125M]
  ------------------
  967|    954|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    954|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 760]
  |  |  |  Branch (101:36): [True: 194, False: 566]
  |  |  |  Branch (101:49): [True: 194, False: 372]
  |  |  ------------------
  ------------------
  968|    582|			return YXML_OK;
  969|    372|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (969:6): [True: 10, False: 362]
  ------------------
  970|     10|			x->state = YXMLS_xmldecl9;
  971|     10|			return YXML_OK;
  972|     10|		}
  973|    362|		if(ch == (unsigned char)'e') {
  ------------------
  |  Branch (973:6): [True: 220, False: 142]
  ------------------
  974|    220|			x->state = YXMLS_string;
  975|    220|			x->nextstate = YXMLS_enc0;
  976|    220|			x->string = (unsigned char *)"ncoding";
  977|    220|			return YXML_OK;
  978|    220|		}
  979|    142|		if(ch == (unsigned char)'s') {
  ------------------
  |  Branch (979:6): [True: 131, False: 11]
  ------------------
  980|    131|			x->state = YXMLS_string;
  981|    131|			x->nextstate = YXMLS_std0;
  982|    131|			x->string = (unsigned char *)"tandalone";
  983|    131|			return YXML_OK;
  984|    131|		}
  985|     11|		break;
  986|     71|	case YXMLS_xmldecl6:
  ------------------
  |  Branch (986:2): [True: 71, False: 125M]
  ------------------
  987|     71|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|     71|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 25, False: 46]
  |  |  |  Branch (101:36): [True: 13, False: 33]
  |  |  |  Branch (101:49): [True: 15, False: 18]
  |  |  ------------------
  ------------------
  988|     53|			x->state = YXMLS_xmldecl7;
  989|     53|			return YXML_OK;
  990|     53|		}
  991|     18|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (991:6): [True: 5, False: 13]
  ------------------
  992|      5|			x->state = YXMLS_xmldecl9;
  993|      5|			return YXML_OK;
  994|      5|		}
  995|     13|		break;
  996|    609|	case YXMLS_xmldecl7:
  ------------------
  |  Branch (996:2): [True: 609, False: 125M]
  ------------------
  997|    609|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    609|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 195, False: 414]
  |  |  |  Branch (101:36): [True: 194, False: 220]
  |  |  |  Branch (101:49): [True: 194, False: 26]
  |  |  ------------------
  ------------------
  998|    583|			return YXML_OK;
  999|     26|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (999:6): [True: 7, False: 19]
  ------------------
 1000|      7|			x->state = YXMLS_xmldecl9;
 1001|      7|			return YXML_OK;
 1002|      7|		}
 1003|     19|		if(ch == (unsigned char)'s') {
  ------------------
  |  Branch (1003:6): [True: 5, False: 14]
  ------------------
 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|     14|		break;
 1010|    609|	case YXMLS_xmldecl8:
  ------------------
  |  Branch (1010:2): [True: 609, False: 125M]
  ------------------
 1011|    609|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    609|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 200, False: 409]
  |  |  |  Branch (101:36): [True: 194, False: 215]
  |  |  |  Branch (101:49): [True: 194, False: 21]
  |  |  ------------------
  ------------------
 1012|    588|			return YXML_OK;
 1013|     21|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (1013:6): [True: 9, False: 12]
  ------------------
 1014|      9|			x->state = YXMLS_xmldecl9;
 1015|      9|			return YXML_OK;
 1016|      9|		}
 1017|     12|		break;
 1018|     42|	case YXMLS_xmldecl9:
  ------------------
  |  Branch (1018:2): [True: 42, False: 125M]
  ------------------
 1019|     42|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (1019:6): [True: 32, False: 10]
  ------------------
 1020|     32|			x->state = YXMLS_misc1;
 1021|     32|			return YXML_OK;
 1022|     32|		}
 1023|     10|		break;
 1024|   125M|	}
 1025|    801|	return YXML_ESYN;
 1026|   125M|}
yxml_eof:
 1028|  6.89k|yxml_ret_t yxml_eof(yxml_t *x) {
 1029|  6.89k|	if(x->state != YXMLS_misc3)
  ------------------
  |  Branch (1029:5): [True: 2.08k, False: 4.81k]
  ------------------
 1030|  2.08k|		return YXML_EEOF;
 1031|  4.81k|	return YXML_OK;
 1032|  6.89k|}
yxml.c:yxml_attrname:
  243|  29.7M|static inline yxml_ret_t yxml_attrname   (yxml_t *x, unsigned ch) { return yxml_pushstackc(x, ch); }
yxml.c:yxml_pushstackc:
  195|  30.2M|static yxml_ret_t yxml_pushstackc(yxml_t *x, unsigned ch) {
  196|  30.2M|	if(x->stacklen+1 >= x->stacksize)
  ------------------
  |  Branch (196:5): [True: 3, False: 30.2M]
  ------------------
  197|      3|		return YXML_ESTACK;
  198|  30.2M|	x->stack[x->stacklen] = (unsigned char)ch;
  199|  30.2M|	x->stacklen++;
  200|  30.2M|	x->stack[x->stacklen] = 0;
  201|  30.2M|	return YXML_OK;
  202|  30.2M|}
yxml.c:yxml_attrnameend:
  244|  3.44M|static inline yxml_ret_t yxml_attrnameend(yxml_t *x, unsigned ch) { return YXML_ATTRSTART; }
yxml.c:yxml_dataattr:
  177|   370k|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|   370k|	yxml_setchar(x->data, ch == 0x9 || ch == 0xa ? 0x20 : ch);
  ------------------
  |  Branch (179:24): [True: 7.09k, False: 363k]
  |  Branch (179:37): [True: 3.51k, False: 359k]
  ------------------
  180|   370k|	x->data[1] = 0;
  181|   370k|	return YXML_ATTRVAL;
  182|   370k|}
yxml.c:yxml_setchar:
  118|  33.7M|static inline void yxml_setchar(char *dest, unsigned ch) {
  119|  33.7M|	*(unsigned char *)dest = (unsigned char)ch;
  120|  33.7M|}
yxml.c:yxml_refstart:
  255|  3.32k|static inline yxml_ret_t yxml_refstart(yxml_t *x, unsigned ch) {
  256|  3.32k|	memset(x->data, 0, sizeof(x->data));
  257|  3.32k|	x->reflen = 0;
  258|  3.32k|	return YXML_OK;
  259|  3.32k|}
yxml.c:yxml_attrvalend:
  245|  3.44M|static inline yxml_ret_t yxml_attrvalend (yxml_t *x, unsigned ch) { yxml_popstack(x); return YXML_ATTREND; }
yxml.c:yxml_popstack:
  204|  13.8M|static void yxml_popstack(yxml_t *x) {
  205|  13.8M|	do
  206|  57.9M|		x->stacklen--;
  207|  57.9M|	while(x->stack[x->stacklen]);
  ------------------
  |  Branch (207:8): [True: 44.0M, False: 13.8M]
  ------------------
  208|  13.8M|}
yxml.c:yxml_ref:
  261|  11.3k|static yxml_ret_t yxml_ref(yxml_t *x, unsigned ch) {
  262|  11.3k|	if(x->reflen >= sizeof(x->data)-1)
  ------------------
  |  Branch (262:5): [True: 20, False: 11.3k]
  ------------------
  263|     20|		return YXML_EREF;
  264|  11.3k|	yxml_setchar(x->data+x->reflen, ch);
  265|  11.3k|	x->reflen++;
  266|  11.3k|	return YXML_OK;
  267|  11.3k|}
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.21k|static yxml_ret_t yxml_refend(yxml_t *x, yxml_ret_t ret) {
  270|  3.21k|	unsigned char *r = (unsigned char *)x->data;
  271|  3.21k|	unsigned ch = 0;
  272|  3.21k|	if(*r == '#') {
  ------------------
  |  Branch (272:5): [True: 1.98k, False: 1.22k]
  ------------------
  273|  1.98k|		if(r[1] == 'x')
  ------------------
  |  Branch (273:6): [True: 657, False: 1.32k]
  ------------------
  274|  2.28k|			for(r += 2; yxml_isHex((unsigned)*r); r++)
  ------------------
  |  |  104|  2.28k|#define yxml_isHex(c) (yxml_isNum(c) || (c|32)-'a' < 6)
  |  |  ------------------
  |  |  |  |  103|  4.56k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 508, False: 1.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (104:41): [True: 1.11k, False: 657]
  |  |  ------------------
  ------------------
  275|  1.62k|				ch = (ch<<4) + (*r <= '9' ? *r-'0' : (*r|32)-'a' + 10);
  ------------------
  |  Branch (275:21): [True: 508, False: 1.11k]
  ------------------
  276|  1.32k|		else
  277|  4.45k|			for(r++; yxml_isNum((unsigned)*r); r++)
  ------------------
  |  |  103|  4.45k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  ------------------
  |  |  |  Branch (103:23): [True: 3.12k, False: 1.32k]
  |  |  ------------------
  ------------------
  278|  3.12k|				ch = (ch*10) + (*r-'0');
  279|  1.98k|		if(*r)
  ------------------
  |  Branch (279:6): [True: 9, False: 1.97k]
  ------------------
  280|      9|			ch = 0;
  281|  1.98k|	} 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: 229, False: 998]
  ------------------
  285|  1.22k|			i == INTFROM5CHARS('g','t', 0,  0, 0) ? '>' :
  ------------------
  |  |  115|    998|#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: 196, False: 802]
  ------------------
  286|    998|			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.21k|	if(!ch || ch > 0x10FFFF || ch == 0xFFFE || ch == 0xFFFF || (ch-0xDFFF) < 0x7FF)
  ------------------
  |  Branch (292:5): [True: 184, False: 3.02k]
  |  Branch (292:12): [True: 0, False: 3.02k]
  |  Branch (292:29): [True: 1, False: 3.02k]
  |  Branch (292:45): [True: 1, False: 3.02k]
  |  Branch (292:61): [True: 6, False: 3.01k]
  ------------------
  293|    192|		return YXML_EREF;
  294|  3.01k|	yxml_setutf8(x->data, ch);
  295|  3.01k|	return ret;
  296|  3.21k|}
yxml.c:yxml_setutf8:
  124|  3.01k|static void yxml_setutf8(char *dest, unsigned ch) {
  125|  3.01k|	if(ch <= 0x007F)
  ------------------
  |  Branch (125:5): [True: 2.12k, False: 897]
  ------------------
  126|  2.12k|		yxml_setchar(dest++, ch);
  127|    897|	else if(ch <= 0x07FF) {
  ------------------
  |  Branch (127:10): [True: 213, False: 684]
  ------------------
  128|    213|		yxml_setchar(dest++, 0xC0 | (ch>>6));
  129|    213|		yxml_setchar(dest++, 0x80 | (ch & 0x3F));
  130|    684|	} else if(ch <= 0xFFFF) {
  ------------------
  |  Branch (130:12): [True: 292, False: 392]
  ------------------
  131|    292|		yxml_setchar(dest++, 0xE0 | (ch>>12));
  132|    292|		yxml_setchar(dest++, 0x80 | ((ch>>6) & 0x3F));
  133|    292|		yxml_setchar(dest++, 0x80 | (ch & 0x3F));
  134|    392|	} else {
  135|    392|		yxml_setchar(dest++, 0xF0 | (ch>>18));
  136|    392|		yxml_setchar(dest++, 0x80 | ((ch>>12) & 0x3F));
  137|    392|		yxml_setchar(dest++, 0x80 | ((ch>>6) & 0x3F));
  138|    392|		yxml_setchar(dest++, 0x80 | (ch & 0x3F));
  139|    392|	}
  140|  3.01k|	*dest = 0;
  141|  3.01k|}
yxml.c:yxml_datacontent:
  143|  33.3M|static inline yxml_ret_t yxml_datacontent(yxml_t *x, unsigned ch) {
  144|  33.3M|	yxml_setchar(x->data, ch);
  145|  33.3M|	x->data[1] = 0;
  146|  33.3M|	return YXML_CONTENT;
  147|  33.3M|}
yxml.c:yxml_datacd1:
  162|    249|static inline yxml_ret_t yxml_datacd1(yxml_t *x, unsigned ch) {
  163|    249|	x->data[0] = ']';
  164|    249|	yxml_setchar(x->data+1, ch);
  165|    249|	x->data[2] = 0;
  166|    249|	return YXML_CONTENT;
  167|    249|}
yxml.c:yxml_datacd2:
  169|    401|static inline yxml_ret_t yxml_datacd2(yxml_t *x, unsigned ch) {
  170|    401|	x->data[0] = ']';
  171|    401|	x->data[1] = ']';
  172|    401|	yxml_setchar(x->data+2, ch);
  173|    401|	x->data[3] = 0;
  174|    401|	return YXML_CONTENT;
  175|    401|}
yxml.c:yxml_elemname:
  211|   481k|static inline yxml_ret_t yxml_elemname   (yxml_t *x, unsigned ch) { return yxml_pushstackc(x, ch); }
yxml.c:yxml_elemnameend:
  212|  10.4M|static inline yxml_ret_t yxml_elemnameend(yxml_t *x, unsigned ch) { return YXML_ELEMSTART; }
yxml.c:yxml_attrstart:
  242|  3.44M|static inline yxml_ret_t yxml_attrstart  (yxml_t *x, unsigned ch) { return yxml_pushstack(x, &x->attr, ch); }
yxml.c:yxml_pushstack:
  184|  13.8M|static yxml_ret_t yxml_pushstack(yxml_t *x, char **res, unsigned ch) {
  185|  13.8M|	if(x->stacklen+2 >= x->stacksize)
  ------------------
  |  Branch (185:5): [True: 4, False: 13.8M]
  ------------------
  186|      4|		return YXML_ESTACK;
  187|  13.8M|	x->stacklen++;
  188|  13.8M|	*res = (char *)x->stack+x->stacklen;
  189|  13.8M|	x->stack[x->stacklen] = (unsigned char)ch;
  190|  13.8M|	x->stacklen++;
  191|  13.8M|	x->stack[x->stacklen] = 0;
  192|  13.8M|	return YXML_OK;
  193|  13.8M|}
yxml.c:yxml_selfclose:
  216|  10.4M|static yxml_ret_t yxml_selfclose(yxml_t *x, unsigned ch) {
  217|  10.4M|	yxml_popstack(x);
  218|  10.4M|	if(x->stacklen) {
  ------------------
  |  Branch (218:5): [True: 10.4M, False: 4.91k]
  ------------------
  219|  10.4M|		x->elem = (char *)x->stack+x->stacklen-1;
  220|  32.1M|		while(*(x->elem-1))
  ------------------
  |  Branch (220:9): [True: 21.6M, False: 10.4M]
  ------------------
  221|  21.6M|			x->elem--;
  222|  10.4M|		return YXML_ELEMEND;
  223|  10.4M|	}
  224|  4.91k|	x->elem = (char *)x->stack;
  225|  4.91k|	x->state = YXMLS_misc3;
  226|  4.91k|	return YXML_ELEMEND;
  227|  10.4M|}
yxml.c:yxml_elemclose:
  229|  68.2k|static inline yxml_ret_t yxml_elemclose(yxml_t *x, unsigned ch) {
  230|  68.2k|	if(*((unsigned char *)x->elem) != ch)
  ------------------
  |  Branch (230:5): [True: 95, False: 68.1k]
  ------------------
  231|     95|		return YXML_ECLOSE;
  232|  68.1k|	x->elem++;
  233|  68.1k|	return YXML_OK;
  234|  68.2k|}
yxml.c:yxml_elemcloseend:
  236|  21.0k|static inline yxml_ret_t yxml_elemcloseend(yxml_t *x, unsigned ch) {
  237|  21.0k|	if(*x->elem)
  ------------------
  |  Branch (237:5): [True: 1, False: 21.0k]
  ------------------
  238|      1|		return YXML_ECLOSE;
  239|  21.0k|	return yxml_selfclose(x, ch);
  240|  21.0k|}
yxml.c:yxml_elemstart:
  210|  10.4M|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.84k|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.46k|static inline yxml_ret_t yxml_refcontent(yxml_t *x, unsigned ch) { return yxml_refend(x, YXML_CONTENT); }
yxml.c:yxml_piname:
  248|  6.94k|static inline yxml_ret_t yxml_piname   (yxml_t *x, unsigned ch) { return yxml_pushstackc(x, ch); }
yxml.c:yxml_pinameend:
  250|  3.99k|static inline yxml_ret_t yxml_pinameend(yxml_t *x, unsigned ch) {
  251|  3.99k|	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.75k, False: 2.23k]
  |  Branch (251:33): [True: 953, False: 801]
  |  Branch (251:57): [True: 526, False: 427]
  |  Branch (251:81): [True: 14, False: 512]
  ------------------
  252|  3.99k|}
yxml.c:yxml_datapi1:
  149|  30.6k|static inline yxml_ret_t yxml_datapi1(yxml_t *x, unsigned ch) {
  150|  30.6k|	yxml_setchar(x->data, ch);
  151|  30.6k|	x->data[1] = 0;
  152|  30.6k|	return YXML_PICONTENT;
  153|  30.6k|}
yxml.c:yxml_pivalend:
  253|  3.84k|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|    857|static inline yxml_ret_t yxml_datapi2(yxml_t *x, unsigned ch) {
  156|    857|	x->data[0] = '?';
  157|    857|	yxml_setchar(x->data+1, ch);
  158|    857|	x->data[2] = 0;
  159|    857|	return YXML_PICONTENT;
  160|    857|}
yxml.c:yxml_piabort:
  249|    577|static inline yxml_ret_t yxml_piabort  (yxml_t *x, unsigned ch) { yxml_popstack(x); return YXML_OK; }

UA_STRING:
  220|    698|UA_STRING(char *chars) {
  221|    698|    UA_String s = {0, NULL};
  222|    698|    if(!chars)
  ------------------
  |  Branch (222:8): [True: 0, False: 698]
  ------------------
  223|      0|        return s;
  224|    698|    s.length = strlen(chars);
  225|    698|    s.data = (UA_Byte*)chars;
  226|    698|    return s;
  227|    698|}
UA_String_equal_ignorecase:
  269|    430|UA_String_equal_ignorecase(const UA_String *s1, const UA_String *s2) {
  270|    430|    if(s1->length != s2->length)
  ------------------
  |  Branch (270:8): [True: 83, False: 347]
  ------------------
  271|     83|        return false;
  272|    347|    if(s1->length == 0)
  ------------------
  |  Branch (272:8): [True: 0, False: 347]
  ------------------
  273|      0|        return true;
  274|    347|    if(s2->data == NULL)
  ------------------
  |  Branch (274:8): [True: 0, False: 347]
  ------------------
  275|      0|        return false;
  276|       |
  277|    347|    return casecmp(s1->data, s2->data, s1->length) == 0;
  278|    347|}
UA_DateTime_parse:
  537|     40|UA_DateTime_parse(UA_DateTime *dst, const UA_String str) {
  538|     40|    if(str.length == 0)
  ------------------
  |  Branch (538:8): [True: 40, False: 0]
  ------------------
  539|     40|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     40|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  540|       |
  541|      0|    struct musl_tm dts;
  542|      0|    memset(&dts, 0, sizeof(dts));
  543|       |
  544|       |    /* Parse the year. The ISO standard asks for four digits. But we accept up
  545|       |     * to five with an optional plus or minus in front due to the range of the
  546|       |     * DateTime 64bit integer. But in that case we require the year and the
  547|       |     * month to be separated by a '-'. Otherwise we cannot know where the month
  548|       |     * starts. */
  549|      0|    size_t pos = 0;
  550|      0|    if(str.data[0] == '-' || str.data[0] == '+')
  ------------------
  |  Branch (550:8): [True: 0, False: 0]
  |  Branch (550:30): [True: 0, False: 0]
  ------------------
  551|      0|        pos++;
  552|      0|    UA_Int64 year = 0;
  553|      0|    UA_CHECK(str.length - pos > 5, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  554|      0|    size_t len = parseInt64((char*)&str.data[pos], 5, &year);
  555|      0|    pos += len;
  556|      0|    UA_CHECK(len > 0 && pos < str.length, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 0, False: 0]
  |  |  |  |  |  Branch (575:43): [True: 0, False: 0]
  |  |  |  |  |  Branch (575:43): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  557|      0|    UA_CHECK(len == 4 || str.data[pos] == '-', return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 0, False: 0]
  |  |  |  |  |  Branch (575:43): [True: 0, False: 0]
  |  |  |  |  |  Branch (575:43): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  558|      0|    if(str.data[0] == '-')
  ------------------
  |  Branch (558:8): [True: 0, False: 0]
  ------------------
  559|      0|        year = -year;
  560|      0|    dts.tm_year = (UA_Int16)year - 1900;
  561|      0|    if(str.data[pos] == '-')
  ------------------
  |  Branch (561:8): [True: 0, False: 0]
  ------------------
  562|      0|        pos++;
  563|       |
  564|       |    /* Parse the month */
  565|      0|    UA_UInt64 month = 0;
  566|      0|    UA_CHECK(str.length - pos > 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  567|      0|    len = parseUInt64((char*)&str.data[pos], 2, &month);
  568|      0|    pos += len;
  569|      0|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  570|      0|    dts.tm_mon = (UA_UInt16)month - 1;
  571|      0|    if(str.data[pos] == '-')
  ------------------
  |  Branch (571:8): [True: 0, False: 0]
  ------------------
  572|      0|        pos++;
  573|       |
  574|       |    /* Parse the day and check the T between date and time */
  575|      0|    UA_UInt64 day = 0;
  576|      0|    UA_CHECK(str.length - pos > 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  577|      0|    len = parseUInt64((char*)&str.data[pos], 2, &day);
  578|      0|    pos += len;
  579|      0|    UA_CHECK(len == 2 || str.data[pos] != 'T',
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 0, False: 0]
  |  |  |  |  |  Branch (575:43): [True: 0, False: 0]
  |  |  |  |  |  Branch (575:43): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  580|      0|             return UA_STATUSCODE_BADDECODINGERROR);
  581|      0|    dts.tm_mday = (UA_UInt16)day;
  582|      0|    pos++;
  583|       |
  584|       |    /* Parse the hour */
  585|      0|    UA_UInt64 hour = 0;
  586|      0|    UA_CHECK(str.length - pos > 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  587|      0|    len = parseUInt64((char*)&str.data[pos], 2, &hour);
  588|      0|    pos += len;
  589|      0|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  590|      0|    dts.tm_hour = (UA_UInt16)hour;
  591|      0|    if(str.data[pos] == ':')
  ------------------
  |  Branch (591:8): [True: 0, False: 0]
  ------------------
  592|      0|        pos++;
  593|       |
  594|       |    /* Parse the minute */
  595|      0|    UA_UInt64 min = 0;
  596|      0|    UA_CHECK(str.length - pos > 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  597|      0|    len = parseUInt64((char*)&str.data[pos], 2, &min);
  598|      0|    pos += len;
  599|      0|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  600|      0|    dts.tm_min = (UA_UInt16)min;
  601|      0|    if(str.data[pos] == ':')
  ------------------
  |  Branch (601:8): [True: 0, False: 0]
  ------------------
  602|      0|        pos++;
  603|       |
  604|       |    /* Parse the second */
  605|      0|    UA_UInt64 sec = 0;
  606|      0|    UA_CHECK(str.length - pos >= 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  607|      0|    len = parseUInt64((char*)&str.data[pos], 2, &sec);
  608|      0|    pos += len;
  609|      0|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  610|      0|    dts.tm_sec = (UA_UInt16)sec;
  611|       |
  612|       |    /* Compute the seconds since the Unix epoch */
  613|      0|    long long sinceunix = musl_tm_to_secs(&dts);
  614|       |
  615|       |    /* Are we within the range that can be represented? */
  616|      0|    long long sinceunix_min =
  617|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  618|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  619|      0|        (long long)1; /* manual correction due to rounding */
  620|      0|    long long sinceunix_max = (long long)
  621|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  622|      0|    if(sinceunix < sinceunix_min || sinceunix > sinceunix_max)
  ------------------
  |  Branch (622:8): [True: 0, False: 0]
  |  Branch (622:37): [True: 0, False: 0]
  ------------------
  623|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  624|       |
  625|       |    /* Convert to DateTime. Add or subtract one extra second here to prevent
  626|       |     * underflow/overflow. This is reverted once the fractional part has been
  627|       |     * added. */
  628|      0|    sinceunix -= (sinceunix > 0) ? 1 : -1;
  ------------------
  |  Branch (628:18): [True: 0, False: 0]
  ------------------
  629|      0|    UA_DateTime dt = (UA_DateTime)
  630|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  631|       |
  632|       |    /* Parse the fraction of the second if defined */
  633|      0|    UA_CHECK(pos < str.length, goto finish);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  634|      0|    if(str.data[pos] == ',' || str.data[pos] == '.') {
  ------------------
  |  Branch (634:8): [True: 0, False: 0]
  |  Branch (634:32): [True: 0, False: 0]
  ------------------
  635|      0|        pos++;
  636|      0|        double frac = 0.0;
  637|      0|        double denom = 0.1;
  638|      0|        while(pos < str.length && str.data[pos] >= '0' && str.data[pos] <= '9') {
  ------------------
  |  Branch (638:15): [True: 0, False: 0]
  |  Branch (638:35): [True: 0, False: 0]
  |  Branch (638:59): [True: 0, False: 0]
  ------------------
  639|      0|            frac += denom * (str.data[pos] - '0');
  640|      0|            denom *= 0.1;
  641|      0|            pos++;
  642|      0|        }
  643|      0|        frac += 0.00000005; /* Correct rounding when converting to integer */
  644|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  645|      0|    }
  646|       |
  647|       |    /* Time zone handling */
  648|      0|    UA_CHECK(pos < str.length, goto finish);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  649|      0|    if(str.data[pos] == 'Z') {
  ------------------
  |  Branch (649:8): [True: 0, False: 0]
  ------------------
  650|      0|        pos++;
  651|      0|    } else if(str.data[pos] == '+' || str.data[pos] == '-') {
  ------------------
  |  Branch (651:15): [True: 0, False: 0]
  |  Branch (651:39): [True: 0, False: 0]
  ------------------
  652|      0|        UA_UInt64 tzHour = 0, tzMin = 0;
  653|      0|        UA_Int64 offsetSeconds = 0;
  654|      0|        UA_Byte tzSign = str.data[pos++];
  655|       |
  656|      0|        UA_CHECK(str.length - pos >= 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  657|      0|        len = parseUInt64((char*)&str.data[pos], 2, &tzHour);
  658|      0|        pos += len;
  659|      0|        UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  660|       |
  661|      0|        UA_CHECK(str.length > pos, goto finish); /* Allow missing tz minutes */
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  662|      0|        if(str.data[pos] == ':')
  ------------------
  |  Branch (662:12): [True: 0, False: 0]
  ------------------
  663|      0|            pos++;
  664|       |
  665|      0|        UA_CHECK(str.length - pos >= 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  666|      0|        len = parseUInt64((char*)&str.data[pos], 2, &tzMin);
  667|      0|        pos += len;
  668|      0|        UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  575|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (575:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  669|       |
  670|      0|        offsetSeconds = (tzHour * 3600) + (tzMin * 60);
  671|      0|        if(tzSign == '-')
  ------------------
  |  Branch (671:12): [True: 0, False: 0]
  ------------------
  672|      0|            offsetSeconds = -offsetSeconds;
  673|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  674|      0|    } else {
  675|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  676|      0|    }
  677|       |
  678|      0| finish:
  679|       |    /* Remove the underflow/overflow protection (see above) */
  680|      0|    if(sinceunix > 0) {
  ------------------
  |  Branch (680:8): [True: 0, False: 0]
  ------------------
  681|      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 (681:12): [True: 0, False: 0]
  ------------------
  682|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  683|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  684|      0|    } else {
  685|      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 (685:12): [True: 0, False: 0]
  ------------------
  686|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  687|      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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  688|      0|    }
  689|       |
  690|       |    /* We must be at the end of the string */
  691|      0|    if(pos != str.length)
  ------------------
  |  Branch (691:8): [True: 0, False: 0]
  ------------------
  692|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  693|       |
  694|      0|    *dst = dt;
  695|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  696|      0|}
UA_ByteString_allocBuffer:
  763|  2.47k|UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length) {
  764|  2.47k|    UA_ByteString_init(bs);
  765|  2.47k|    if(length == 0) {
  ------------------
  |  Branch (765:8): [True: 0, False: 2.47k]
  ------------------
  766|      0|        bs->data = (u8*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|      0|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  767|      0|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  768|      0|    }
  769|  2.47k|    bs->data = (u8*)UA_calloc(1,length);
  ------------------
  |  |   20|  2.47k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  770|  2.47k|    if(UA_UNLIKELY(!bs->data))
  ------------------
  |  |  575|  2.47k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (575:25): [True: 0, False: 2.47k]
  |  |  ------------------
  ------------------
  771|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  772|  2.47k|    bs->length = length;
  773|  2.47k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  2.47k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  774|  2.47k|}
nodeId_printEscape:
 1030|     97|                   const UA_NamespaceMapping *nsMapping, UA_Escaping idEsc) {
 1031|       |    /* Try to map the NamespaceIndex to the Uri */
 1032|     97|    UA_String nsUri = UA_STRING_NULL;
 1033|     97|    if(id->namespaceIndex > 0 && nsMapping)
  ------------------
  |  Branch (1033:8): [True: 0, False: 97]
  |  Branch (1033:34): [True: 0, False: 0]
  ------------------
 1034|      0|        UA_NamespaceMapping_index2Uri(nsMapping, id->namespaceIndex, &nsUri);
 1035|       |
 1036|       |    /* Compute the string length and print numerical identifiers. */
 1037|     97|    u8 nsStr[7];
 1038|     97|    u8 numIdStr[12];
 1039|     97|    size_t idLen = nodeIdSize(id, nsStr, numIdStr, nsUri, idEsc);
 1040|     97|    if(idLen == 0)
  ------------------
  |  Branch (1040:8): [True: 0, False: 97]
  ------------------
 1041|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 1042|       |
 1043|       |    /* Allocate memory if required */
 1044|     97|    if(output->length == 0) {
  ------------------
  |  Branch (1044:8): [True: 97, False: 0]
  ------------------
 1045|     97|        UA_StatusCode res = UA_ByteString_allocBuffer((UA_ByteString*)output, idLen);
 1046|     97|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|     97|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1046:12): [True: 0, False: 97]
  ------------------
 1047|      0|            return res;
 1048|     97|    } else {
 1049|      0|        if(output->length < idLen)
  ------------------
  |  Branch (1049:12): [True: 0, False: 0]
  ------------------
 1050|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
 1051|      0|        output->length = idLen;
 1052|      0|    }
 1053|       |
 1054|       |    /* Print the NodeId */
 1055|     97|    u8 *pos = printNodeIdBody(id, nsUri, nsStr, numIdStr, output->data, nsMapping, idEsc);
 1056|     97|    output->length = (size_t)(pos - output->data);
 1057|     97|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     97|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1058|     97|}
UA_NodeId_printEx:
 1062|     97|                  const UA_NamespaceMapping *nsMapping) {
 1063|     97|    return nodeId_printEscape(id, output, nsMapping, UA_ESCAPING_NONE);
 1064|     97|}
UA_ExtensionObject_setValue:
 1305|     97|                            const UA_DataType *type) {
 1306|     97|    UA_ExtensionObject_init(eo);
 1307|     97|    eo->content.decoded.data = p;
 1308|     97|    eo->content.decoded.type = type;
 1309|     97|    eo->encoding = UA_EXTENSIONOBJECT_DECODED;
 1310|     97|}
UA_Variant_isScalar:
 1362|  2.37k|UA_Variant_isScalar(const UA_Variant *v) {
 1363|  2.37k|    return (v->type != NULL && v->arrayLength == 0 &&
  ------------------
  |  Branch (1363:13): [True: 2.37k, False: 0]
  |  Branch (1363:32): [True: 2.37k, False: 0]
  ------------------
 1364|  2.37k|            v->data > UA_EMPTY_ARRAY_SENTINEL);
  ------------------
  |  |  755|  2.37k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1364:13): [True: 2.35k, False: 16]
  ------------------
 1365|  2.37k|}
UA_new:
 1917|  3.86k|UA_new(const UA_DataType *type) {
 1918|  3.86k|    void *p = UA_calloc(1, type->memSize);
  ------------------
  |  |   20|  3.86k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1919|  3.86k|    return p;
 1920|  3.86k|}
UA_copy:
 2093|     94|UA_copy(const void *src, void *dst, const UA_DataType *type) {
 2094|     94|    memset(dst, 0, type->memSize); /* init */
 2095|     94|    UA_StatusCode retval = copyJumpTable[type->typeKind](src, dst, type);
 2096|     94|    if(retval != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|     94|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2096:8): [True: 0, False: 94]
  ------------------
 2097|      0|        UA_clear(dst, type);
 2098|     94|    return retval;
 2099|     94|}
UA_clear:
 2196|  7.11k|UA_clear(void *p, const UA_DataType *type) {
 2197|  7.11k|    clearJumpTable[type->typeKind](p, type);
 2198|  7.11k|    memset(p, 0, type->memSize); /* init */
 2199|  7.11k|}
UA_order:
 2650|  9.28k|UA_Order UA_order(const void *p1, const void *p2, const UA_DataType *type) {
 2651|  9.28k|    return orderJumpTable[type->typeKind](p1, p2, type);
 2652|  9.28k|}
UA_Array_new:
 2664|     16|UA_Array_new(size_t size, const UA_DataType *type) {
 2665|     16|    if(size > UA_INT32_MAX)
  ------------------
  |  |  100|     16|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (2665:8): [True: 0, False: 16]
  ------------------
 2666|      0|        return NULL;
 2667|     16|    if(size == 0)
  ------------------
  |  Branch (2667:8): [True: 16, False: 0]
  ------------------
 2668|     16|        return UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|     16|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2669|      0|    return UA_calloc(size, type->memSize);
  ------------------
  |  |   20|      0|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2670|     16|}
UA_Array_copy:
 2674|     94|              void **dst, const UA_DataType *type) {
 2675|     94|    if(size == 0) {
  ------------------
  |  Branch (2675:8): [True: 0, False: 94]
  ------------------
 2676|      0|        if(src == NULL)
  ------------------
  |  Branch (2676:12): [True: 0, False: 0]
  ------------------
 2677|      0|            *dst = NULL;
 2678|      0|        else
 2679|      0|            *dst= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|      0|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2680|      0|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2681|      0|    }
 2682|       |
 2683|       |    /* Check the array consistency -- defensive programming in case the user
 2684|       |     * manually created an inconsistent array */
 2685|     94|    if(UA_UNLIKELY(!type || !src))
  ------------------
  |  |  575|    188|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (575:25): [True: 0, False: 94]
  |  |  |  Branch (575:43): [True: 0, False: 94]
  |  |  |  Branch (575:43): [True: 0, False: 94]
  |  |  ------------------
  ------------------
 2686|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 2687|       |
 2688|       |    /* calloc, so we don't have to check retval in every iteration of copying */
 2689|     94|    *dst = UA_calloc(size, type->memSize);
  ------------------
  |  |   20|     94|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2690|     94|    if(!*dst)
  ------------------
  |  Branch (2690:8): [True: 0, False: 94]
  ------------------
 2691|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2692|       |
 2693|     94|    if(type->pointerFree) {
  ------------------
  |  Branch (2693:8): [True: 94, False: 0]
  ------------------
 2694|     94|        memcpy(*dst, src, type->memSize * size);
 2695|     94|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     94|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2696|     94|    }
 2697|       |
 2698|      0|    uintptr_t ptrs = (uintptr_t)src;
 2699|      0|    uintptr_t ptrd = (uintptr_t)*dst;
 2700|      0|    UA_StatusCode retval = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2701|      0|    for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2701:23): [True: 0, False: 0]
  ------------------
 2702|      0|        retval |= UA_copy((void*)ptrs, (void*)ptrd, type);
 2703|      0|        ptrs += type->memSize;
 2704|      0|        ptrd += type->memSize;
 2705|      0|    }
 2706|      0|    if(retval != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2706:8): [True: 0, False: 0]
  ------------------
 2707|      0|        UA_Array_delete(*dst, size, type);
 2708|       |        *dst = NULL;
 2709|      0|    }
 2710|      0|    return retval;
 2711|     94|}
UA_Array_delete:
 2802|  6.82k|UA_Array_delete(void *p, size_t size, const UA_DataType *type) {
 2803|  6.82k|    if(!type->pointerFree) {
  ------------------
  |  Branch (2803:8): [True: 399, False: 6.42k]
  ------------------
 2804|    399|        uintptr_t ptr = (uintptr_t)p;
 2805|    751|        for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2805:27): [True: 352, False: 399]
  ------------------
 2806|    352|            UA_clear((void*)ptr, type);
 2807|    352|            ptr += type->memSize;
 2808|    352|        }
 2809|    399|    }
 2810|  6.82k|    UA_free((void*)((uintptr_t)p & ~(uintptr_t)UA_EMPTY_ARRAY_SENTINEL));
  ------------------
  |  |   19|  6.82k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2811|  6.82k|}
ua_types.c:casecmp:
  260|    347|casecmp(const UA_Byte *l, const UA_Byte *r, size_t n) {
  261|    347|    if(!n--) return 0;
  ------------------
  |  Branch (261:8): [True: 0, False: 347]
  ------------------
  262|    807|    for(; *l && *r && n && (*l == *r || lowercase(*l) == lowercase(*r)); l++, r++, n--);
  ------------------
  |  Branch (262:11): [True: 807, False: 0]
  |  Branch (262:17): [True: 807, False: 0]
  |  Branch (262:23): [True: 599, False: 208]
  |  Branch (262:29): [True: 437, False: 162]
  |  Branch (262:41): [True: 23, False: 139]
  ------------------
  263|    347|    return lowercase(*l) - lowercase(*r);
  264|    347|}
ua_types.c:lowercase:
  254|  1.01k|lowercase(UA_Byte c) {
  255|  1.01k|    if(((int)c) - 'A' < 26) return c | 32;
  ------------------
  |  Branch (255:8): [True: 710, False: 308]
  ------------------
  256|    308|    return c;
  257|  1.01k|}
ua_types.c:nodeIdSize:
  929|     97|           UA_Escaping idEsc) {
  930|       |    /* Namespace length */
  931|     97|    size_t len = 0;
  932|     97|    if(nsUri.data != NULL) {
  ------------------
  |  Branch (932:8): [True: 0, False: 97]
  ------------------
  933|      0|        len += 5; /* nsu=; */
  934|      0|        len += UA_String_escapedSize(nsUri, UA_ESCAPING_PERCENT);
  935|     97|    } else if(id->namespaceIndex > 0) {
  ------------------
  |  Branch (935:15): [True: 0, False: 97]
  ------------------
  936|      0|        len += 4; /* ns=; */
  937|      0|        size_t nsStrSize = itoaUnsigned(id->namespaceIndex, (char*)nsStr, 10);
  938|      0|        nsStr[nsStrSize] = 0;
  939|      0|        len += nsStrSize;
  940|      0|    }
  941|       |
  942|     97|    len += 2; /* ?= */
  943|       |
  944|     97|    switch (id->identifierType) {
  945|     97|    case UA_NODEIDTYPE_NUMERIC: {
  ------------------
  |  Branch (945:5): [True: 97, False: 0]
  ------------------
  946|     97|        size_t numIdStrSize = itoaUnsigned(id->identifier.numeric, (char*)numIdStr, 10);
  947|     97|        numIdStr[numIdStrSize] = 0;
  948|     97|        len += numIdStrSize;
  949|     97|        break;
  950|      0|    }
  951|      0|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (951:5): [True: 0, False: 97]
  ------------------
  952|      0|        len += UA_String_escapedSize(id->identifier.string, idEsc);
  953|      0|        break;
  954|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (954:5): [True: 0, False: 97]
  ------------------
  955|      0|        len += 36;
  956|      0|        break;
  957|      0|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (957:5): [True: 0, False: 97]
  ------------------
  958|      0|        len += 4 * ((id->identifier.byteString.length + 2) / 3);
  959|      0|        break;
  960|      0|    default:
  ------------------
  |  Branch (960:5): [True: 0, False: 97]
  ------------------
  961|      0|        len = 0;
  962|     97|    }
  963|     97|    return len;
  964|     97|}
ua_types.c:printNodeIdBody:
  968|     97|                const UA_NamespaceMapping *nsMapping, UA_Escaping idEsc) {
  969|     97|    size_t len;
  970|       |
  971|       |    /* Encode the namespace */
  972|     97|    if(nsUri.data != NULL) {
  ------------------
  |  Branch (972:8): [True: 0, False: 97]
  ------------------
  973|      0|        memcpy(pos, "nsu=", 4);
  974|      0|        pos += 4;
  975|      0|        pos += UA_String_escapeInsert(pos, nsUri, UA_ESCAPING_PERCENT);
  976|      0|        *pos++ = ';';
  977|     97|    } else if(id->namespaceIndex > 0) {
  ------------------
  |  Branch (977:15): [True: 0, False: 97]
  ------------------
  978|      0|        memcpy(pos, "ns=", 3);
  979|      0|        pos += 3;
  980|      0|        len = strlen((char*)nsStr);
  981|      0|        memcpy(pos, nsStr, len);
  982|      0|        pos += len;
  983|      0|        *pos++ = ';';
  984|      0|    }
  985|       |
  986|       |    /* Encode the identifier */
  987|     97|    switch(id->identifierType) {
  ------------------
  |  Branch (987:12): [True: 97, False: 0]
  ------------------
  988|     97|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (988:5): [True: 97, False: 0]
  ------------------
  989|     97|        memcpy(pos, "i=", 2);
  990|     97|        pos += 2;
  991|     97|        len = strlen((char*)numIdStr);
  992|     97|        memcpy(pos, numIdStr, len);
  993|     97|        pos += len;
  994|     97|        break;
  995|      0|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (995:5): [True: 0, False: 97]
  ------------------
  996|      0|        memcpy(pos, "s=", 2);
  997|      0|        pos += 2;
  998|      0|        pos += UA_String_escapeInsert(pos, id->identifier.string, idEsc);
  999|      0|        break;
 1000|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (1000:5): [True: 0, False: 97]
  ------------------
 1001|      0|        memcpy(pos, "g=", 2);
 1002|      0|        pos += 2;
 1003|      0|        UA_Guid_to_hex(&id->identifier.guid, pos, true);
 1004|      0|        pos += 36;
 1005|      0|        break;
 1006|      0|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (1006:5): [True: 0, False: 97]
  ------------------
 1007|      0|        memcpy(pos, "b=", 2);
 1008|      0|        pos += 2;
 1009|       |        /* Use base64url encoding for percent-escaping.
 1010|       |         * Replace +/ with -_ and remove the padding. */
 1011|      0|        u8 *bpos = pos;
 1012|      0|        pos += UA_base64_buf(id->identifier.byteString.data,
 1013|      0|                             id->identifier.byteString.length, pos);
 1014|      0|        if(idEsc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (1014:12): [True: 0, False: 0]
  ------------------
 1015|      0|           idEsc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (1015:12): [True: 0, False: 0]
  ------------------
 1016|      0|            while(pos > bpos && pos[-1] == '=')
  ------------------
  |  Branch (1016:19): [True: 0, False: 0]
  |  Branch (1016:33): [True: 0, False: 0]
  ------------------
 1017|      0|                pos--;
 1018|      0|            for(; bpos < pos; bpos++) {
  ------------------
  |  Branch (1018:19): [True: 0, False: 0]
  ------------------
 1019|      0|                if(*bpos == '+') *bpos = '-';
  ------------------
  |  Branch (1019:20): [True: 0, False: 0]
  ------------------
 1020|      0|                else if(*bpos == '/') *bpos = '_';
  ------------------
  |  Branch (1020:25): [True: 0, False: 0]
  ------------------
 1021|      0|            }
 1022|      0|        }
 1023|      0|        break;
 1024|     97|    }
 1025|     97|    return pos;
 1026|     97|}
ua_types.c:Variant_clear:
 1383|  4.28k|Variant_clear(void *p, const UA_DataType *_) {
 1384|  4.28k|    UA_Variant *v = (UA_Variant *)p;
 1385|       |
 1386|       |    /* The content is "borrowed" */
 1387|  4.28k|    if(v->storageType == UA_VARIANT_DATA_NODELETE)
  ------------------
  |  Branch (1387:8): [True: 0, False: 4.28k]
  ------------------
 1388|      0|        return;
 1389|       |
 1390|       |    /* Delete the value */
 1391|  4.28k|    if(v->type && v->data > UA_EMPTY_ARRAY_SENTINEL) {
  ------------------
  |  |  755|  3.88k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1391:8): [True: 3.88k, False: 403]
  |  Branch (1391:19): [True: 3.86k, False: 16]
  ------------------
 1392|  3.86k|        if(v->arrayLength == 0)
  ------------------
  |  Branch (1392:12): [True: 3.86k, False: 0]
  ------------------
 1393|  3.86k|            v->arrayLength = 1;
 1394|  3.86k|        UA_Array_delete(v->data, v->arrayLength, v->type);
 1395|  3.86k|        v->data = NULL;
 1396|  3.86k|    }
 1397|       |
 1398|       |    /* Delete the array dimensions */
 1399|  4.28k|    if((void*)v->arrayDimensions > UA_EMPTY_ARRAY_SENTINEL)
  ------------------
  |  |  755|  4.28k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1399:8): [True: 0, False: 4.28k]
  ------------------
 1400|      0|        UA_free(v->arrayDimensions);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1401|  4.28k|}
ua_types.c:DataValue_clear:
 1847|      2|DataValue_clear(void *p, const UA_DataType *_) {
 1848|      2|    UA_DataValue *dv = (UA_DataValue *)p;
 1849|       |    Variant_clear(&dv->value, NULL);
 1850|      2|}
ua_types.c:String_copy:
  281|     94|String_copy(const void *src, void *dst, const UA_DataType *_) {
  282|     94|    const UA_String *srcS = (const UA_String*)src;
  283|     94|    UA_String *dstS = (UA_String *)dst;
  284|     94|    UA_StatusCode res =
  285|     94|        UA_Array_copy(srcS->data, srcS->length, (void**)&dstS->data,
  286|     94|                      &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|     94|#define UA_TYPES_BYTE 2
  ------------------
  287|     94|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|     94|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (287:8): [True: 94, False: 0]
  ------------------
  288|     94|        dstS->length = srcS->length;
  289|     94|    return res;
  290|     94|}
ua_types.c:nopClear:
 2158|    330|static void nopClear(void *p, const UA_DataType *type) { }
ua_types.c:String_clear:
  293|  2.90k|String_clear(void *p, const UA_DataType *_) {
  294|  2.90k|    UA_String *s = (UA_String*)p;
  295|  2.90k|    UA_Array_delete(s->data, s->length, &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|  2.90k|#define UA_TYPES_BYTE 2
  ------------------
  296|  2.90k|}
ua_types.c:NodeId_clear:
  778|     49|NodeId_clear(void *p, const UA_DataType *_) {
  779|     49|    UA_NodeId *id = (UA_NodeId*)p;
  780|     49|    switch(id->identifierType) {
  781|      0|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (781:5): [True: 0, False: 49]
  ------------------
  782|      0|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (782:5): [True: 0, False: 49]
  ------------------
  783|      0|        String_clear(&id->identifier.string, NULL);
  784|      0|        break;
  785|     49|    default: break;
  ------------------
  |  Branch (785:5): [True: 49, False: 0]
  ------------------
  786|     49|    }
  787|     49|}
ua_types.c:ExpandedNodeId_clear:
 1079|      7|ExpandedNodeId_clear(void *p, const UA_DataType *_) {
 1080|      7|    UA_ExpandedNodeId *id = (UA_ExpandedNodeId*)p;
 1081|      7|    NodeId_clear(&id->nodeId, NULL);
 1082|       |    String_clear(&id->namespaceUri, NULL);
 1083|      7|}
ua_types.c:QualifiedName_clear:
  397|      7|QualifiedName_clear(void *p, const UA_DataType *_) {
  398|      7|    UA_QualifiedName *qn = (UA_QualifiedName*)p;
  399|       |    String_clear(&qn->name, NULL);
  400|      7|}
ua_types.c:LocalizedText_clear:
 1830|     18|LocalizedText_clear(void *p, const UA_DataType *_) {
 1831|     18|    UA_LocalizedText *lt = (UA_LocalizedText *)p;
 1832|     18|    String_clear(&lt->locale, NULL);
 1833|       |    String_clear(&lt->text, NULL);
 1834|     18|}
ua_types.c:ExtensionObject_clear:
 1252|     17|ExtensionObject_clear(void *p, const UA_DataType *_) {
 1253|     17|    UA_ExtensionObject *eo = (UA_ExtensionObject *)p;
 1254|     17|    switch(eo->encoding) {
 1255|     17|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (1255:5): [True: 17, False: 0]
  ------------------
 1256|     17|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (1256:5): [True: 0, False: 17]
  ------------------
 1257|     17|    case UA_EXTENSIONOBJECT_ENCODED_XML:
  ------------------
  |  Branch (1257:5): [True: 0, False: 17]
  ------------------
 1258|     17|        NodeId_clear(&eo->content.encoded.typeId, NULL);
 1259|     17|        String_clear(&eo->content.encoded.body, NULL);
 1260|     17|        break;
 1261|      0|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (1261:5): [True: 0, False: 17]
  ------------------
 1262|      0|        if(eo->content.decoded.data)
  ------------------
  |  Branch (1262:12): [True: 0, False: 0]
  ------------------
 1263|      0|            UA_delete(eo->content.decoded.data, eo->content.decoded.type);
 1264|      0|        break;
 1265|      0|    default:
  ------------------
  |  Branch (1265:5): [True: 0, False: 17]
  ------------------
 1266|      0|        break;
 1267|     17|    }
 1268|     17|}
ua_types.c:DiagnosticInfo_clear:
 1877|      2|DiagnosticInfo_clear(void *p, const UA_DataType *_) {
 1878|      2|    UA_DiagnosticInfo *di = (UA_DiagnosticInfo *)p;
 1879|       |
 1880|      2|    String_clear(&di->additionalInfo, NULL);
 1881|      2|    if(di->hasInnerDiagnosticInfo && di->innerDiagnosticInfo) {
  ------------------
  |  Branch (1881:8): [True: 0, False: 2]
  |  Branch (1881:38): [True: 0, False: 0]
  ------------------
 1882|      0|        DiagnosticInfo_clear(di->innerDiagnosticInfo, NULL);
 1883|      0|        UA_free(di->innerDiagnosticInfo);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1884|      0|    }
 1885|      2|}
ua_types.c:clearStructure:
 2102|    216|clearStructure(void *p, const UA_DataType *type) {
 2103|    216|    uintptr_t ptr = (uintptr_t)p;
 2104|    889|    for(size_t i = 0; i < type->membersSize; ++i) {
  ------------------
  |  Branch (2104:23): [True: 673, False: 216]
  ------------------
 2105|    673|        const UA_DataTypeMember *m = &type->members[i];
 2106|    673|        const UA_DataType *mt = m->memberType;
 2107|    673|        ptr += m->padding;
 2108|    673|        if(!m->isOptional) {
  ------------------
  |  Branch (2108:12): [True: 673, False: 0]
  ------------------
 2109|    673|            if(!m->isArray) {
  ------------------
  |  Branch (2109:16): [True: 621, False: 52]
  ------------------
 2110|    621|                clearJumpTable[mt->typeKind]((void*)ptr, mt);
 2111|    621|                ptr += mt->memSize;
 2112|    621|            } else {
 2113|     52|                size_t length = *(size_t*)ptr;
 2114|     52|                ptr += sizeof(size_t);
 2115|     52|                UA_Array_delete(*(void**)ptr, length, mt);
 2116|     52|                ptr += sizeof(void*);
 2117|     52|            }
 2118|    673|        } else { /* field is optional */
 2119|      0|            if(!m->isArray) {
  ------------------
  |  Branch (2119:16): [True: 0, False: 0]
  ------------------
 2120|       |                /* optional scalar field is contained */
 2121|      0|                if((*(void *const *)ptr != NULL))
  ------------------
  |  Branch (2121:20): [True: 0, False: 0]
  ------------------
 2122|      0|                    UA_Array_delete(*(void **)ptr, 1, mt);
 2123|      0|                ptr += sizeof(void *);
 2124|      0|            } else {
 2125|       |                /* optional array field is contained */
 2126|      0|                if((*(void *const *)(ptr + sizeof(size_t)) != NULL)) {
  ------------------
  |  Branch (2126:20): [True: 0, False: 0]
  ------------------
 2127|      0|                    size_t length = *(size_t *)ptr;
 2128|      0|                    ptr += sizeof(size_t);
 2129|      0|                    UA_Array_delete(*(void **)ptr, length, mt);
 2130|      0|                    ptr += sizeof(void *);
 2131|      0|                } else { /* optional array field not contained */
 2132|      0|                    ptr += sizeof(size_t);
 2133|      0|                    ptr += sizeof(void *);
 2134|      0|                }
 2135|      0|            }
 2136|      0|        }
 2137|    673|    }
 2138|    216|}
ua_types.c:booleanOrder:
 2213|      2|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2214|      2|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2214:12): [True: 0, False: 2]
  ------------------
 2215|      2|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2215:20): [True: 0, False: 0]
  ------------------
 2216|      2|        return UA_ORDER_EQ;                                         \
 2217|      2|    }
ua_types.c:int16Order:
 2213|     93|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2214|     93|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2214:12): [True: 0, False: 93]
  ------------------
 2215|     93|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2215:20): [True: 0, False: 0]
  ------------------
 2216|     93|        return UA_ORDER_EQ;                                         \
 2217|     93|    }
ua_types.c:uInt16Order:
 2213|     24|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2214|     24|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2214:12): [True: 0, False: 24]
  ------------------
 2215|     24|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2215:20): [True: 0, False: 0]
  ------------------
 2216|     24|        return UA_ORDER_EQ;                                         \
 2217|     24|    }
ua_types.c:int32Order:
 2213|     75|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2214|     75|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2214:12): [True: 0, False: 75]
  ------------------
 2215|     75|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2215:20): [True: 0, False: 0]
  ------------------
 2216|     75|        return UA_ORDER_EQ;                                         \
 2217|     75|    }
ua_types.c:uInt32Order:
 2213|     26|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2214|     26|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2214:12): [True: 0, False: 26]
  ------------------
 2215|     26|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2215:20): [True: 0, False: 0]
  ------------------
 2216|     26|        return UA_ORDER_EQ;                                         \
 2217|     26|    }
ua_types.c:int64Order:
 2213|    133|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2214|    133|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2214:12): [True: 0, False: 133]
  ------------------
 2215|    133|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2215:20): [True: 0, False: 0]
  ------------------
 2216|    133|        return UA_ORDER_EQ;                                         \
 2217|    133|    }
ua_types.c:uInt64Order:
 2213|    116|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2214|    116|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2214:12): [True: 0, False: 116]
  ------------------
 2215|    116|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2215:20): [True: 0, False: 0]
  ------------------
 2216|    116|        return UA_ORDER_EQ;                                         \
 2217|    116|    }
ua_types.c:doubleOrder:
 2231|    631|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2232|    631|        if(*p1 != *p2) {                                            \
  ------------------
  |  Branch (2232:12): [True: 3, False: 628]
  ------------------
 2233|      3|            /* p1 is NaN */                                         \
 2234|      3|            if(*p1 != *p1) {                                        \
  ------------------
  |  Branch (2234:16): [True: 3, False: 0]
  ------------------
 2235|      3|                if(*p2 != *p2)                                      \
  ------------------
  |  Branch (2235:20): [True: 3, False: 0]
  ------------------
 2236|      3|                    return UA_ORDER_EQ;                             \
 2237|      3|                return UA_ORDER_LESS;                               \
 2238|      3|            }                                                       \
 2239|      3|            /* p2 is NaN */                                         \
 2240|      3|            if(*p2 != *p2)                                          \
  ------------------
  |  Branch (2240:16): [True: 0, False: 0]
  ------------------
 2241|      0|                return UA_ORDER_MORE;                               \
 2242|      0|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2242:20): [True: 0, False: 0]
  ------------------
 2243|      0|        }                                                           \
 2244|    631|        return UA_ORDER_EQ;                                         \
 2245|    631|    }
ua_types.c:stringOrder:
 2265|  8.17k|stringOrder(const UA_String *p1, const UA_String *p2, const UA_DataType *type) {
 2266|  8.17k|    if(p1->length != p2->length)
  ------------------
  |  Branch (2266:8): [True: 2.07k, False: 6.10k]
  ------------------
 2267|  2.07k|        return (p1->length < p2->length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2267:16): [True: 1.88k, False: 191]
  ------------------
 2268|       |    /* For zero-length arrays, every pointer not NULL is considered a
 2269|       |     * UA_EMPTY_ARRAY_SENTINEL. */
 2270|  6.10k|    if(p1->data == p2->data) return UA_ORDER_EQ;
  ------------------
  |  Branch (2270:8): [True: 31, False: 6.07k]
  ------------------
 2271|  6.07k|    if(p1->data == NULL) return UA_ORDER_LESS;
  ------------------
  |  Branch (2271:8): [True: 0, False: 6.07k]
  ------------------
 2272|  6.07k|    if(p2->data == NULL) return UA_ORDER_MORE;
  ------------------
  |  Branch (2272:8): [True: 0, False: 6.07k]
  ------------------
 2273|  6.07k|    int cmp = memcmp((const char*)p1->data, (const char*)p2->data, p1->length);
 2274|  6.07k|    if(cmp != 0)
  ------------------
  |  Branch (2274:8): [True: 1.98k, False: 4.08k]
  ------------------
 2275|  1.98k|        return (cmp < 0) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2275:16): [True: 1.34k, False: 640]
  ------------------
 2276|  4.08k|    return UA_ORDER_EQ;
 2277|  6.07k|}
ua_types.c:extensionObjectOrder:
 2335|      1|                     const UA_DataType *_) {
 2336|      1|    UA_ExtensionObjectEncoding enc1 = p1->encoding;
 2337|      1|    UA_ExtensionObjectEncoding enc2 = p2->encoding;
 2338|      1|    if(enc1 > UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2338:8): [True: 0, False: 1]
  ------------------
 2339|      0|        enc1 = UA_EXTENSIONOBJECT_DECODED;
 2340|      1|    if(enc2 > UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (2340:8): [True: 0, False: 1]
  ------------------
 2341|      0|        enc2 = UA_EXTENSIONOBJECT_DECODED;
 2342|      1|    if(enc1 != enc2)
  ------------------
  |  Branch (2342:8): [True: 0, False: 1]
  ------------------
 2343|      0|        return (enc1 < enc2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2343:16): [True: 0, False: 0]
  ------------------
 2344|       |
 2345|      1|    switch(enc1) {
 2346|      1|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (2346:5): [True: 1, False: 0]
  ------------------
 2347|      1|        return UA_ORDER_EQ;
 2348|       |
 2349|      0|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (2349:5): [True: 0, False: 1]
  ------------------
 2350|      0|    case UA_EXTENSIONOBJECT_ENCODED_XML: {
  ------------------
  |  Branch (2350:5): [True: 0, False: 1]
  ------------------
 2351|      0|            UA_Order o = nodeIdOrder(&p1->content.encoded.typeId,
 2352|      0|                                     &p2->content.encoded.typeId, NULL);
 2353|      0|            if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2353:16): [True: 0, False: 0]
  ------------------
 2354|      0|                return o;
 2355|      0|            return stringOrder((const UA_String*)&p1->content.encoded.body,
 2356|      0|                               (const UA_String*)&p2->content.encoded.body, NULL);
 2357|      0|        }
 2358|       |
 2359|      0|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (2359:5): [True: 0, False: 1]
  ------------------
 2360|      0|    default: {
  ------------------
  |  Branch (2360:5): [True: 0, False: 1]
  ------------------
 2361|      0|            const UA_DataType *type1 = p1->content.decoded.type;
 2362|      0|            const UA_DataType *type2 = p2->content.decoded.type;
 2363|      0|            if(type1 != type2)
  ------------------
  |  Branch (2363:16): [True: 0, False: 0]
  ------------------
 2364|      0|                return ((uintptr_t)type1 < (uintptr_t)type2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2364:24): [True: 0, False: 0]
  ------------------
 2365|      0|            if(!type1)
  ------------------
  |  Branch (2365:16): [True: 0, False: 0]
  ------------------
 2366|      0|                return UA_ORDER_EQ;
 2367|      0|            return orderJumpTable[type1->typeKind]
 2368|      0|                (p1->content.decoded.data, p2->content.decoded.data, type1);
 2369|      0|        }
 2370|      1|    }
 2371|      1|}
ua_types.c:variantOrder:
 2398|  1.18k|variantOrder(const UA_Variant *p1, const UA_Variant *p2, const UA_DataType *_) {
 2399|  1.18k|    if(p1->type != p2->type)
  ------------------
  |  Branch (2399:8): [True: 0, False: 1.18k]
  ------------------
 2400|      0|        return ((uintptr_t)p1->type < (uintptr_t)p2->type) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2400:16): [True: 0, False: 0]
  ------------------
 2401|       |
 2402|  1.18k|    UA_Order o;
 2403|  1.18k|    if(p1->type != NULL) {
  ------------------
  |  Branch (2403:8): [True: 1.18k, False: 0]
  ------------------
 2404|       |        /* Check if both variants are scalars or arrays */
 2405|  1.18k|        UA_Boolean s1 = UA_Variant_isScalar(p1);
 2406|  1.18k|        UA_Boolean s2 = UA_Variant_isScalar(p2);
 2407|  1.18k|        if(s1 != s2)
  ------------------
  |  Branch (2407:12): [True: 0, False: 1.18k]
  ------------------
 2408|      0|            return s1 ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2408:20): [True: 0, False: 0]
  ------------------
 2409|  1.18k|        if(s1) {
  ------------------
  |  Branch (2409:12): [True: 1.17k, False: 8]
  ------------------
 2410|  1.17k|            o = orderJumpTable[p1->type->typeKind](p1->data, p2->data, p1->type);
 2411|  1.17k|        } else {
 2412|       |            /* Mismatching array length? */
 2413|      8|            if(p1->arrayLength != p2->arrayLength)
  ------------------
  |  Branch (2413:16): [True: 0, False: 8]
  ------------------
 2414|      0|                return (p1->arrayLength < p2->arrayLength) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2414:24): [True: 0, False: 0]
  ------------------
 2415|      8|            o = arrayOrder(p1->data, p1->arrayLength, p2->data, p2->arrayLength, p1->type);
 2416|      8|        }
 2417|  1.18k|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2417:12): [True: 0, False: 1.18k]
  ------------------
 2418|      0|            return o;
 2419|  1.18k|    }
 2420|       |
 2421|  1.18k|    if(p1->arrayDimensionsSize != p2->arrayDimensionsSize)
  ------------------
  |  Branch (2421:8): [True: 0, False: 1.18k]
  ------------------
 2422|      0|        return (p1->arrayDimensionsSize < p2->arrayDimensionsSize) ?
  ------------------
  |  Branch (2422:16): [True: 0, False: 0]
  ------------------
 2423|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2424|  1.18k|    o = UA_ORDER_EQ;
 2425|  1.18k|    if(p1->arrayDimensionsSize > 0)
  ------------------
  |  Branch (2425:8): [True: 0, False: 1.18k]
  ------------------
 2426|      0|        o = arrayOrder(p1->arrayDimensions, p1->arrayDimensionsSize,
 2427|      0|                       p2->arrayDimensions, p2->arrayDimensionsSize,
 2428|      0|                       &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  225|      0|#define UA_TYPES_UINT32 6
  ------------------
 2429|  1.18k|    return o;
 2430|  1.18k|}
ua_types.c:arrayOrder:
 2382|      8|           const UA_DataType *type) {
 2383|      8|    if(p1Length != p2Length)
  ------------------
  |  Branch (2383:8): [True: 0, False: 8]
  ------------------
 2384|      0|        return (p1Length < p2Length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2384:16): [True: 0, False: 0]
  ------------------
 2385|      8|    uintptr_t u1 = (uintptr_t)p1;
 2386|      8|    uintptr_t u2 = (uintptr_t)p2;
 2387|      8|    for(size_t i = 0; i < p1Length; i++) {
  ------------------
  |  Branch (2387:23): [True: 0, False: 8]
  ------------------
 2388|      0|        UA_Order o = orderJumpTable[type->typeKind]((const void*)u1, (const void*)u2, type);
 2389|      0|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2389:12): [True: 0, False: 0]
  ------------------
 2390|      0|            return o;
 2391|      0|        u1 += type->memSize;
 2392|      0|        u2 += type->memSize;
 2393|      0|    }
 2394|      8|    return UA_ORDER_EQ;
 2395|      8|}

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|   125M|    for(; pos < len; pos++) {
  ------------------
  |  Branch (64:11): [True: 125M, False: 6.89k]
  ------------------
   65|       |#ifdef __clang_analyzer__
   66|       |        UA_assert(stack[top] != NULL);
   67|       |#endif
   68|   125M|        yxml_ret_t xml_status = yxml_parse(&ctx, xml[pos]);
   69|   125M|        switch(xml_status) {
   70|      0|        case YXML_EEOF:
  ------------------
  |  Branch (70:9): [True: 0, False: 125M]
  ------------------
   71|    212|        case YXML_EREF:
  ------------------
  |  Branch (71:9): [True: 212, False: 125M]
  ------------------
   72|    308|        case YXML_ECLOSE:
  ------------------
  |  Branch (72:9): [True: 96, False: 125M]
  ------------------
   73|    315|        case YXML_ESTACK:
  ------------------
  |  Branch (73:9): [True: 7, False: 125M]
  ------------------
   74|  1.13k|        case YXML_ESYN:
  ------------------
  |  Branch (74:9): [True: 821, False: 125M]
  ------------------
   75|  1.13k|        default:
  ------------------
  |  Branch (75:9): [True: 0, False: 125M]
  ------------------
   76|  1.13k|            goto errout;
   77|  64.1M|        case YXML_OK:
  ------------------
  |  Branch (77:9): [True: 64.1M, False: 61.5M]
  ------------------
   78|  64.1M|            continue;
   79|  10.4M|        case YXML_ELEMSTART:
  ------------------
  |  Branch (79:9): [True: 10.4M, False: 115M]
  ------------------
   80|  13.8M|        case YXML_ATTRSTART: {
  ------------------
  |  Branch (80:9): [True: 3.44M, False: 122M]
  ------------------
   81|  13.8M|            if(xml_status == YXML_ELEMSTART) {
  ------------------
  |  Branch (81:16): [True: 10.4M, False: 3.44M]
  ------------------
   82|  10.4M|                stack[top]->children++;
   83|  10.4M|                stack[top]->content = UA_STRING_NULL; /* Only the leaf elements have content */
   84|  10.4M|            } else {
   85|  3.44M|                stack[top]->attributes++;
   86|  3.44M|            }
   87|  13.8M|            top++;
   88|  13.8M|            if(top >= 32)
  ------------------
  |  Branch (88:16): [True: 5, False: 13.8M]
  ------------------
   89|      5|                goto errout; /* nesting too deep */
   90|  13.8M|            stack[top] = (tokenPos < max_tokens) ? &tokens[tokenPos] : &backup_tokens[top];
  ------------------
  |  Branch (90:26): [True: 6.92M, False: 6.95M]
  ------------------
   91|  13.8M|            memset(stack[top], 0, sizeof(xml_token));
   92|  13.8M|            stack[top]->type = (xml_status == YXML_ELEMSTART) ? XML_TOKEN_ELEMENT : XML_TOKEN_ATTRIBUTE;
  ------------------
  |  Branch (92:32): [True: 10.4M, False: 3.44M]
  ------------------
   93|  13.8M|            stack[top]->name = backtrackName(xml, pos);
   94|  13.8M|            const char *start = xml + pos;
   95|  13.8M|            if(xml_status == YXML_ELEMSTART) {
  ------------------
  |  Branch (95:16): [True: 10.4M, False: 3.44M]
  ------------------
   96|  31.7M|                while(*start != '<')
  ------------------
  |  Branch (96:23): [True: 21.3M, False: 10.4M]
  ------------------
   97|  21.3M|                    start--;
   98|  10.4M|            }
   99|  13.8M|            stack[top]->start = (unsigned)(start - xml);
  100|  13.8M|            tokenPos++;
  101|  13.8M|            val_begin = 0; /* if the previous non-leaf element started to collect content */
  102|  13.8M|            break;
  103|  13.8M|        }
  104|  33.3M|        case YXML_CONTENT:
  ------------------
  |  Branch (104:9): [True: 33.3M, False: 92.2M]
  ------------------
  105|  33.7M|        case YXML_ATTRVAL:
  ------------------
  |  Branch (105:9): [True: 371k, False: 125M]
  ------------------
  106|  33.7M|            if(val_begin == 0)
  ------------------
  |  Branch (106:16): [True: 129k, False: 33.6M]
  ------------------
  107|   129k|                val_begin = pos;
  108|  33.7M|            stack[top]->end = pos;
  109|  33.7M|            break;
  110|  10.4M|        case YXML_ELEMEND:
  ------------------
  |  Branch (110:9): [True: 10.4M, False: 115M]
  ------------------
  111|  13.8M|        case YXML_ATTREND:
  ------------------
  |  Branch (111:9): [True: 3.44M, False: 122M]
  ------------------
  112|  13.8M|            if(top == 0)
  ------------------
  |  Branch (112:16): [True: 0, False: 13.8M]
  ------------------
  113|      0|                goto errout; /* more closes than opens */
  114|  13.8M|            if(val_begin > 0) {
  ------------------
  |  Branch (114:16): [True: 17.3k, False: 13.8M]
  ------------------
  115|  17.3k|                stack[top]->content.data = (UA_Byte*)(uintptr_t)xml + val_begin;
  116|  17.3k|                stack[top]->content.length = stack[top]->end + 1 - val_begin;
  117|  17.3k|            }
  118|  13.8M|            stack[top]->end = pos;
  119|  13.8M|            if(xml_status == YXML_ELEMEND) {
  ------------------
  |  Branch (119:16): [True: 10.4M, False: 3.44M]
  ------------------
  120|       |                /* Saw "</", looking for the closing ">" */
  121|  11.0M|                while(stack[top]->end < len && xml[stack[top]->end] != '>')
  ------------------
  |  Branch (121:23): [True: 11.0M, False: 43]
  |  Branch (121:48): [True: 601k, False: 10.4M]
  ------------------
  122|   601k|                    stack[top]->end++;
  123|  10.4M|                stack[top]->end++;
  124|  10.4M|                if(stack[top]->end > len)
  ------------------
  |  Branch (124:20): [True: 43, False: 10.4M]
  ------------------
  125|     43|                    goto errout;
  126|  10.4M|            }
  127|  13.8M|            val_begin = 0;
  128|  13.8M|            top--;
  129|  13.8M|            break;
  130|  3.97k|        case YXML_PISTART:
  ------------------
  |  Branch (130:9): [True: 3.97k, False: 125M]
  ------------------
  131|  35.4k|        case YXML_PICONTENT:
  ------------------
  |  Branch (131:9): [True: 31.4k, False: 125M]
  ------------------
  132|  39.3k|        case YXML_PIEND:
  ------------------
  |  Branch (132:9): [True: 3.84k, False: 125M]
  ------------------
  133|  39.3k|            continue; /* Ignore processing instructions */
  134|   125M|        }
  135|   125M|    }
  136|       |
  137|       |    /* Check that all elements were closed */
  138|  6.89k|    if(yxml_eof(&ctx) != YXML_OK)
  ------------------
  |  Branch (138:8): [True: 2.08k, False: 4.81k]
  ------------------
  139|  2.08k|        goto errout;
  140|       |
  141|  4.81k|    res.num_tokens = tokenPos;
  142|  4.81k|    if(tokenPos > max_tokens)
  ------------------
  |  Branch (142:8): [True: 538, False: 4.27k]
  ------------------
  143|    538|        res.error = XML_ERROR_OVERFLOW;
  144|  4.81k|    return res;
  145|       |
  146|  3.27k| errout:
  147|  3.27k|    res.error_pos = pos;
  148|  3.27k|    res.error = XML_ERROR_INVALID;
  149|  3.27k|    return res;
  150|  6.89k|}
UA_encodeXml:
  584|  2.37k|             const UA_EncodeXmlOptions *options) {
  585|  2.37k|    if(!src || !type)
  ------------------
  |  Branch (585:8): [True: 0, False: 2.37k]
  |  Branch (585:16): [True: 0, False: 2.37k]
  ------------------
  586|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
  587|       |
  588|       |    /* Allocate buffer */
  589|  2.37k|    UA_Boolean allocated = false;
  590|  2.37k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  2.37k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  591|  2.37k|    if(outBuf->length == 0) {
  ------------------
  |  Branch (591:8): [True: 0, False: 2.37k]
  ------------------
  592|      0|        size_t len = UA_calcSizeXml(src, type, options);
  593|      0|        res = UA_ByteString_allocBuffer(outBuf, len);
  594|      0|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (594:12): [True: 0, False: 0]
  ------------------
  595|      0|            return res;
  596|      0|        allocated = true;
  597|      0|    }
  598|       |
  599|       |    /* Set up the context */
  600|  2.37k|    CtxXml ctx;
  601|  2.37k|    memset(&ctx, 0, sizeof(ctx));
  602|  2.37k|    ctx.pos = outBuf->data;
  603|  2.37k|    ctx.end = &outBuf->data[outBuf->length];
  604|  2.37k|    ctx.depth = 0;
  605|  2.37k|    ctx.calcOnly = false;
  606|  2.37k|    if(options) {
  ------------------
  |  Branch (606:8): [True: 0, False: 2.37k]
  ------------------
  607|      0|        ctx.namespaceMapping = options->namespaceMapping;
  608|      0|        ctx.serverUris = options->serverUris;
  609|      0|        ctx.serverUrisSize = options->serverUrisSize;
  610|      0|    }
  611|       |
  612|       |    /* Encode */
  613|  2.37k|    res = writeXmlElement(&ctx, type->typeName, src, type);
  614|       |
  615|       |    /* Clean up */
  616|  2.37k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  2.37k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (616:8): [True: 2.37k, False: 0]
  ------------------
  617|  2.37k|        outBuf->length = (size_t)((uintptr_t)ctx.pos - (uintptr_t)outBuf->data);
  618|      0|    else if(allocated)
  ------------------
  |  Branch (618:13): [True: 0, False: 0]
  ------------------
  619|      0|        UA_ByteString_clear(outBuf);
  620|       |
  621|  2.37k|    return res;
  622|  2.37k|}
UA_calcSizeXml:
  630|  1.33k|               const UA_EncodeXmlOptions *options) {
  631|  1.33k|    if(!src || !type)
  ------------------
  |  Branch (631:8): [True: 0, False: 1.33k]
  |  Branch (631:16): [True: 0, False: 1.33k]
  ------------------
  632|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
  633|       |
  634|       |    /* Set up the context */
  635|  1.33k|    CtxXml ctx;
  636|  1.33k|    memset(&ctx, 0, sizeof(ctx));
  637|  1.33k|    ctx.pos = NULL;
  638|  1.33k|    ctx.end = (const UA_Byte*)(uintptr_t)SIZE_MAX;
  639|  1.33k|    ctx.depth = 0;
  640|  1.33k|    if(options) {
  ------------------
  |  Branch (640:8): [True: 0, False: 1.33k]
  ------------------
  641|      0|        ctx.namespaceMapping = options->namespaceMapping;
  642|      0|        ctx.serverUris = options->serverUris;
  643|      0|        ctx.serverUrisSize = options->serverUrisSize;
  644|      0|    }
  645|       |
  646|  1.33k|    ctx.calcOnly = true;
  647|       |
  648|       |    /* Encode */
  649|  1.33k|    status ret = writeXmlElement(&ctx, type->typeName, src, type);
  650|  1.33k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  1.33k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (650:8): [True: 151, False: 1.18k]
  ------------------
  651|    151|        return 0;
  652|  1.18k|    return (size_t)ctx.pos;
  653|  1.33k|}
UA_decodeXml:
 1526|  7.54k|             const UA_DecodeXmlOptions *options) {
 1527|  7.54k|    if(!dst || !src || !type)
  ------------------
  |  Branch (1527:8): [True: 0, False: 7.54k]
  |  Branch (1527:16): [True: 0, False: 7.54k]
  |  Branch (1527:24): [True: 0, False: 7.54k]
  ------------------
 1528|      0|        return UA_STATUSCODE_BADARGUMENTSMISSING;
  ------------------
  |  |  448|      0|#define UA_STATUSCODE_BADARGUMENTSMISSING ((UA_StatusCode) 0x80760000)
  ------------------
 1529|       |
 1530|       |    /* Tokenize. Add a fake wrapper element if options->unwrapped is enabled. */
 1531|  7.54k|    unsigned tokensSize = 63;
 1532|  7.54k|    xml_token tokenbuf[64];
 1533|  7.54k|    xml_token *tokens = tokenbuf;
 1534|       |
 1535|  7.54k|    xml_result res = xml_tokenize((char*)src->data, (unsigned)src->length,
 1536|  7.54k|                                  tokens + 1, tokensSize);
 1537|  7.54k|    if(res.error == XML_ERROR_OVERFLOW) {
  ------------------
  |  Branch (1537:8): [True: 538, False: 7.00k]
  ------------------
 1538|    538|        tokens = (xml_token*)UA_malloc(sizeof(xml_token) * (res.num_tokens + 1));
  ------------------
  |  |   18|    538|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 1539|    538|        if(!tokens)
  ------------------
  |  Branch (1539:12): [True: 0, False: 538]
  ------------------
 1540|      0|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1541|    538|        res = xml_tokenize((char*)src->data, (unsigned)src->length,
 1542|    538|                           tokens + 1, res.num_tokens);
 1543|    538|    }
 1544|       |
 1545|  7.54k|    if(res.error != XML_ERROR_NONE || res.num_tokens == 0) {
  ------------------
  |  Branch (1545:8): [True: 3.27k, False: 4.27k]
  |  Branch (1545:39): [True: 0, False: 4.27k]
  ------------------
 1546|  3.27k|        if(tokens != tokenbuf)
  ------------------
  |  Branch (1546:12): [True: 0, False: 3.27k]
  ------------------
 1547|      0|            UA_free(tokens);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1548|  3.27k|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|  3.27k|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1549|  3.27k|    }
 1550|       |
 1551|       |    /* Set up the context */
 1552|  4.27k|    ParseCtxXml ctx;
 1553|  4.27k|    memset(&ctx, 0, sizeof(ParseCtxXml));
 1554|  4.27k|    ctx.xml = (const char*)src->data;
 1555|  4.27k|    ctx.tokens = tokens;
 1556|  4.27k|    ctx.tokensSize = res.num_tokens;
 1557|  4.27k|    if(options) {
  ------------------
  |  Branch (1557:8): [True: 0, False: 4.27k]
  ------------------
 1558|      0|        ctx.customTypes = options->customTypes;
 1559|      0|        ctx.namespaceMapping = options->namespaceMapping;
 1560|      0|        ctx.serverUris = options->serverUris;
 1561|      0|        ctx.serverUrisSize = options->serverUrisSize;
 1562|      0|    }
 1563|       |
 1564|  4.27k|    if(options && options->unwrapped) {
  ------------------
  |  Branch (1564:8): [True: 0, False: 4.27k]
  |  Branch (1564:19): [True: 0, False: 0]
  ------------------
 1565|       |        /* Set up the fake wrapper element */
 1566|      0|        xml_token *tok = tokens;
 1567|      0|        memset(tok, 0, sizeof(xml_token));
 1568|      0|        tok->type = XML_TOKEN_ELEMENT;
 1569|      0|        tok->name = UA_STRING((char*)(uintptr_t)type->typeName);
 1570|      0|        tok->children = 1;
 1571|      0|        tok->start = 0;
 1572|      0|        tok->end = (unsigned)src->length;
 1573|      0|        ctx.tokensSize++;
 1574|  4.27k|    } else {
 1575|  4.27k|        ctx.tokens++; /* Skip the first token */
 1576|  4.27k|    }
 1577|       |
 1578|       |    /* Decode */
 1579|  4.27k|    memset(dst, 0, type->memSize); /* Initialize the value */
 1580|  4.27k|    UA_StatusCode ret = decodeXmlJumpTable[type->typeKind](&ctx, dst, type);
 1581|  4.27k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  4.27k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1581:8): [True: 1.74k, False: 2.52k]
  ------------------
 1582|  1.74k|        UA_clear(dst, type);
 1583|       |
 1584|       |    /* Clean up */
 1585|  4.27k|    if(tokens != tokenbuf)
  ------------------
  |  Branch (1585:8): [True: 538, False: 3.73k]
  ------------------
 1586|    538|        UA_free(tokens);
  ------------------
  |  |   19|    538|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1587|  4.27k|    return ret;
 1588|  7.54k|}
ua_types_encoding_xml.c:backtrackName:
   23|  13.8M|backtrackName(const char *xml, unsigned end) {
   24|  13.8M|    unsigned pos = end;
   25|  57.9M|    for(; pos > 0; pos--) {
  ------------------
  |  Branch (25:11): [True: 57.9M, False: 0]
  ------------------
   26|  57.9M|        unsigned char c = (unsigned char)xml[pos-1];
   27|  57.9M|        if(c >= 'a' && c <= 'z') continue; /* isAlpha */
  ------------------
  |  Branch (27:12): [True: 43.7M, False: 14.2M]
  |  Branch (27:24): [True: 3.81M, False: 39.8M]
  ------------------
   28|  54.1M|        if(c >= 'A' && c <= 'Z') continue; /* isAlpha */
  ------------------
  |  Branch (28:12): [True: 40.2M, False: 13.9M]
  |  Branch (28:24): [True: 316k, False: 39.8M]
  ------------------
   29|  53.8M|        if(c >= '0' && c <= '9') continue; /* isNum */
  ------------------
  |  Branch (29:12): [True: 50.3M, False: 3.44M]
  |  Branch (29:24): [True: 60.6k, False: 50.3M]
  ------------------
   30|  53.7M|        if(c == '_' || c >= 128 || c == '-'|| c == '.') continue;
  ------------------
  |  Branch (30:12): [True: 3.19k, False: 53.7M]
  |  Branch (30:24): [True: 39.8M, False: 13.8M]
  |  Branch (30:36): [True: 4.85k, False: 13.8M]
  |  Branch (30:47): [True: 1.69k, False: 13.8M]
  ------------------
   31|  13.8M|        break;
   32|  53.7M|    }
   33|  13.8M|    UA_String s = {end - pos, (UA_Byte*)(uintptr_t)xml + pos};
   34|  13.8M|    return s;
   35|  13.8M|}
ua_types_encoding_xml.c:Boolean_encodeXml:
  235|      6|ENCODE_XML(Boolean) {
  236|      6|    if(*src == true)
  ------------------
  |  Branch (236:8): [True: 3, False: 3]
  ------------------
  237|      3|        return xmlEncodeWriteChars(ctx, "true", 4);
  238|      3|    return xmlEncodeWriteChars(ctx, "false", 5);
  239|      6|}
ua_types_encoding_xml.c:xmlEncodeWriteChars:
  191|  72.0k|xmlEncodeWriteChars(CtxXml *ctx, const char *c, size_t len) {
  192|  72.0k|    if(ctx->pos + len > ctx->end)
  ------------------
  |  Branch (192:8): [True: 0, False: 72.0k]
  ------------------
  193|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  194|  72.0k|    if(!ctx->calcOnly && len)
  ------------------
  |  Branch (194:8): [True: 45.0k, False: 27.0k]
  |  Branch (194:26): [True: 45.0k, False: 22]
  ------------------
  195|  45.0k|        memcpy(ctx->pos, c, len);
  196|  72.0k|    ctx->pos += len;
  197|  72.0k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  72.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  198|  72.0k|}
ua_types_encoding_xml.c:encodeSigned:
  241|    903|static status encodeSigned(CtxXml *ctx, UA_Int64 value, char* buffer) {
  242|    903|    UA_UInt16 digits = itoaSigned(value, buffer);
  243|    903|    return xmlEncodeWriteChars(ctx, buffer, digits);
  244|    903|}
ua_types_encoding_xml.c:encodeUnsigned:
  246|    498|static status encodeUnsigned(CtxXml *ctx, UA_UInt64 value, char* buffer) {
  247|    498|    UA_UInt16 digits = itoaUnsigned(value, buffer, 10);
  248|    498|    return xmlEncodeWriteChars(ctx, buffer, digits);
  249|    498|}
ua_types_encoding_xml.c:Int16_encodeXml:
  264|    279|ENCODE_XML(Int16) {
  265|    279|    char buf[7];
  266|    279|    return encodeSigned(ctx, *src, buf);
  267|    279|}
ua_types_encoding_xml.c:UInt16_encodeXml:
  270|     72|ENCODE_XML(UInt16) {
  271|     72|    char buf[6];
  272|     72|    return encodeUnsigned(ctx, *src, buf);
  273|     72|}
ua_types_encoding_xml.c:Int32_encodeXml:
  276|    225|ENCODE_XML(Int32) {
  277|    225|    char buf[12];
  278|    225|    return encodeSigned(ctx, *src, buf);
  279|    225|}
ua_types_encoding_xml.c:UInt32_encodeXml:
  282|     78|ENCODE_XML(UInt32) {
  283|     78|    char buf[11];
  284|     78|    return encodeUnsigned(ctx, *src, buf);
  285|     78|}
ua_types_encoding_xml.c:Int64_encodeXml:
  288|    399|ENCODE_XML(Int64) {
  289|    399|    char buf[23];
  290|    399|    return encodeSigned(ctx, *src, buf);
  291|    399|}
ua_types_encoding_xml.c:UInt64_encodeXml:
  294|    348|ENCODE_XML(UInt64) {
  295|    348|    char buf[23];
  296|    348|    return encodeUnsigned(ctx, *src, buf);
  297|    348|}
ua_types_encoding_xml.c:Double_encodeXml:
  315|  1.89k|ENCODE_XML(Double) {
  316|  1.89k|    char buffer[32];
  317|  1.89k|    size_t len;
  318|  1.89k|    if(*src != *src)
  ------------------
  |  Branch (318:8): [True: 9, False: 1.88k]
  ------------------
  319|      9|        return xmlEncodeWriteChars(ctx, "NaN", 3);
  320|  1.88k|    if(*src == INFINITY)
  ------------------
  |  Branch (320:8): [True: 6, False: 1.87k]
  ------------------
  321|      6|        return xmlEncodeWriteChars(ctx, "INF", 3);
  322|  1.87k|    if(*src == -INFINITY)
  ------------------
  |  Branch (322:8): [True: 6, False: 1.87k]
  ------------------
  323|      6|        return xmlEncodeWriteChars(ctx, "-INF", 4);
  324|       |
  325|  1.87k|    len = dtoa(*src, buffer);
  326|  1.87k|    return xmlEncodeWriteChars(ctx, buffer, len);
  327|  1.87k|}
ua_types_encoding_xml.c:String_encodeXml:
  330|    271|ENCODE_XML(String) {
  331|    271|    return xmlEncodeWriteChars(ctx, (const char*)src->data, src->length);
  332|    271|}
ua_types_encoding_xml.c:ByteString_encodeXml:
  352|     60|ENCODE_XML(ByteString) {
  353|     60|    if(!src->data)
  ------------------
  |  Branch (353:8): [True: 0, False: 60]
  ------------------
  354|      0|        return xmlEncodeWriteChars(ctx, "null", 4);
  355|       |
  356|     60|    if(src->length == 0)
  ------------------
  |  Branch (356:8): [True: 60, False: 0]
  ------------------
  357|     60|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     60|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  358|       |
  359|      0|    size_t flen = 0;
  360|      0|    unsigned char *ba64 = UA_base64(src->data, src->length, &flen);
  361|       |
  362|       |    /* Not converted, no mem */
  363|      0|    if(!ba64)
  ------------------
  |  Branch (363:8): [True: 0, False: 0]
  ------------------
  364|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  365|       |
  366|      0|    if(ctx->pos + flen > ctx->end) {
  ------------------
  |  Branch (366:8): [True: 0, False: 0]
  ------------------
  367|      0|        UA_free(ba64);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  368|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  369|      0|    }
  370|       |
  371|       |    /* Copy flen bytes to output stream. */
  372|      0|    if(!ctx->calcOnly)
  ------------------
  |  Branch (372:8): [True: 0, False: 0]
  ------------------
  373|      0|        memcpy(ctx->pos, ba64, flen);
  374|      0|    ctx->pos += flen;
  375|       |
  376|       |    /* Base64 result no longer needed */
  377|      0|    UA_free(ba64);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  378|       |
  379|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  380|      0|}
ua_types_encoding_xml.c:encodeXmlNotImplemented:
  543|     97|encodeXmlNotImplemented(CtxXml *ctx, const void *src, const UA_DataType *type) {
  544|     97|    (void)ctx, (void)src, (void)type;
  545|     97|    return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  238|     97|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
  546|     97|}
ua_types_encoding_xml.c:NodeId_encodeXml:
  383|     97|ENCODE_XML(NodeId) {
  384|     97|    UA_StatusCode ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     97|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  385|     97|    UA_String out = UA_STRING_NULL;
  386|     97|    ret |= UA_NodeId_printEx(src, &out, ctx->namespaceMapping);
  387|     97|    ret |= writeXmlElement(ctx, UA_XML_NODEID_IDENTIFIER,
  ------------------
  |  |  168|     97|#define UA_XML_NODEID_IDENTIFIER "Identifier"
  ------------------
  388|     97|                           &out, &UA_TYPES[UA_TYPES_STRING]);
  ------------------
  |  |  395|     97|#define UA_TYPES_STRING 11
  ------------------
  389|     97|    UA_String_clear(&out);
  390|     97|    return ret;
  391|     97|}
ua_types_encoding_xml.c:ExtensionObject_encodeXml:
  438|    100|ENCODE_XML(ExtensionObject) {
  439|    100|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_NOBODY)
  ------------------
  |  Branch (439:8): [True: 3, False: 97]
  ------------------
  440|      3|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      3|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  441|       |
  442|       |    /* The body of the ExtensionObject contains a single element
  443|       |     * which is either a ByteString or XML encoded Structure:
  444|       |     * https://reference.opcfoundation.org/Core/Part6/v104/docs/5.3.1.16. */
  445|     97|    UA_StatusCode ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     97|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  446|     97|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_BYTESTRING ||
  ------------------
  |  Branch (446:8): [True: 0, False: 97]
  ------------------
  447|     97|       src->encoding == UA_EXTENSIONOBJECT_ENCODED_XML) {
  ------------------
  |  Branch (447:8): [True: 0, False: 97]
  ------------------
  448|       |        /* Write the type NodeId */
  449|      0|        ret = writeXmlElement(ctx, UA_XML_EXTENSIONOBJECT_TYPEID,
  ------------------
  |  |  175|      0|#define UA_XML_EXTENSIONOBJECT_TYPEID "TypeId"
  ------------------
  450|      0|                              &src->content.encoded.typeId,
  451|      0|                              &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|      0|#define UA_TYPES_NODEID 16
  ------------------
  452|       |
  453|       |        /* Write the body */
  454|      0|        ret |= writeXmlElemNameBegin(ctx, UA_XML_EXTENSIONOBJECT_BODY);
  ------------------
  |  |  176|      0|#define UA_XML_EXTENSIONOBJECT_BODY "Body"
  ------------------
  455|      0|        if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_BYTESTRING)
  ------------------
  |  Branch (455:12): [True: 0, False: 0]
  ------------------
  456|      0|           ret |= writeXmlElement(ctx, "ByteString", &src->content.encoded.body,
  457|      0|                                  &UA_TYPES[UA_TYPES_BYTESTRING]);
  ------------------
  |  |  497|      0|#define UA_TYPES_BYTESTRING 14
  ------------------
  458|      0|        else
  459|      0|            ret |= ENCODE_DIRECT_XML(&src->content.encoded.body, String);
  ------------------
  |  |  188|      0|    TYPE##_encodeXml(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  460|      0|        ret |= writeXmlElemNameEnd(ctx, UA_XML_EXTENSIONOBJECT_BODY);
  ------------------
  |  |  176|      0|#define UA_XML_EXTENSIONOBJECT_BODY "Body"
  ------------------
  461|     97|    } else {
  462|       |        /* Write the decoded value */
  463|     97|        const UA_DataType *decoded_type = src->content.decoded.type;
  464|       |
  465|       |        /* Write the type NodeId */
  466|     97|        ret = writeXmlElement(ctx, UA_XML_EXTENSIONOBJECT_TYPEID,
  ------------------
  |  |  175|     97|#define UA_XML_EXTENSIONOBJECT_TYPEID "TypeId"
  ------------------
  467|     97|                              &decoded_type->typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|     97|#define UA_TYPES_NODEID 16
  ------------------
  468|       |
  469|       |        /* Write the body */
  470|     97|        ret |= writeXmlElemNameBegin(ctx, UA_XML_EXTENSIONOBJECT_BODY);
  ------------------
  |  |  176|     97|#define UA_XML_EXTENSIONOBJECT_BODY "Body"
  ------------------
  471|     97|        ret |= writeXmlElement(ctx, decoded_type->typeName, src->content.decoded.data, decoded_type);
  472|     97|        ret |= writeXmlElemNameEnd(ctx, UA_XML_EXTENSIONOBJECT_BODY);
  ------------------
  |  |  176|     97|#define UA_XML_EXTENSIONOBJECT_BODY "Body"
  ------------------
  473|     97|    }
  474|       |
  475|     97|    return ret;
  476|    100|}
ua_types_encoding_xml.c:writeXmlElemNameBegin:
  201|  11.4k|writeXmlElemNameBegin(CtxXml *ctx, const char* name) {
  202|  11.4k|    if(ctx->depth >= UA_XML_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   15|  11.4k|#define UA_XML_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (202:8): [True: 0, False: 11.4k]
  ------------------
  203|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  204|  11.4k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  11.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  205|  11.4k|    ret |= xmlEncodeWriteChars(ctx, "<", 1);
  206|  11.4k|    ret |= xmlEncodeWriteChars(ctx, name, strlen(name));
  207|  11.4k|    ret |= xmlEncodeWriteChars(ctx, ">", 1);
  208|  11.4k|    ctx->depth++;
  209|  11.4k|    return ret;
  210|  11.4k|}
ua_types_encoding_xml.c:writeXmlElemNameEnd:
  213|  11.4k|writeXmlElemNameEnd(CtxXml *ctx, const char* name) {
  214|  11.4k|    if(ctx->depth == 0)
  ------------------
  |  Branch (214:8): [True: 0, False: 11.4k]
  ------------------
  215|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  216|  11.4k|    ctx->depth--;
  217|  11.4k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  11.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  218|  11.4k|    ret |= xmlEncodeWriteChars(ctx, "</", 2);
  219|  11.4k|    ret |= xmlEncodeWriteChars(ctx, name, strlen(name));
  220|  11.4k|    ret |= xmlEncodeWriteChars(ctx, ">", 1);
  221|  11.4k|    return ret;
  222|  11.4k|}
ua_types_encoding_xml.c:Variant_encodeXml:
  512|  3.71k|ENCODE_XML(Variant) {
  513|  3.71k|    if(!src->type)
  ------------------
  |  Branch (513:8): [True: 54, False: 3.65k]
  ------------------
  514|     54|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|     54|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  515|       |
  516|       |    /* Set the array type in the encoding mask */
  517|  3.65k|    const bool isArray = src->arrayLength > 0 || src->data <= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  7.31k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (517:26): [True: 0, False: 3.65k]
  |  Branch (517:50): [True: 24, False: 3.63k]
  ------------------
  518|       |
  519|  3.65k|    if(src->arrayDimensionsSize > 1)
  ------------------
  |  Branch (519:8): [True: 0, False: 3.65k]
  ------------------
  520|      0|        return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  238|      0|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
  521|       |
  522|  3.65k|    UA_StatusCode ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  3.65k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  523|  3.65k|    ret |= writeXmlElemNameBegin(ctx, UA_XML_VARIANT_VALUE);
  ------------------
  |  |  178|  3.65k|#define UA_XML_VARIANT_VALUE "Value"
  ------------------
  524|  3.65k|    if(!isArray) {
  ------------------
  |  Branch (524:8): [True: 3.63k, False: 24]
  ------------------
  525|  3.63k|        const UA_DataType *srctype = src->type;
  526|  3.63k|        void *ptr = src->data;
  527|  3.63k|        UA_ExtensionObject eo;
  528|  3.63k|        if(srctype->typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO) {
  ------------------
  |  Branch (528:12): [True: 97, False: 3.53k]
  ------------------
  529|       |            /* Wrap value in an ExtensionObject */
  530|     97|            UA_ExtensionObject_setValue(&eo, (void*)(uintptr_t)ptr, srctype);
  531|     97|            ptr = &eo;
  532|     97|            srctype = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|     97|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  533|     97|        }
  534|  3.63k|        ret |= writeXmlElement(ctx, srctype->typeName, ptr, srctype);
  535|  3.63k|    } else {
  536|     24|        ret |= Array_encodeXml(ctx, src->data, src->arrayLength, src->type);
  537|     24|    }
  538|  3.65k|    ret |= writeXmlElemNameEnd(ctx, UA_XML_VARIANT_VALUE);
  ------------------
  |  |  178|  3.65k|#define UA_XML_VARIANT_VALUE "Value"
  ------------------
  539|  3.65k|    return ret;
  540|  3.65k|}
ua_types_encoding_xml.c:Array_encodeXml:
  480|     24|                const UA_DataType *type) {
  481|     24|    char arrName[128];
  482|     24|    UA_ExtensionObject eo;
  483|       |
  484|     24|    UA_Boolean wrapEO = (type->typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO);
  485|     24|    if(wrapEO) {
  ------------------
  |  Branch (485:8): [True: 0, False: 24]
  ------------------
  486|      0|        UA_ExtensionObject_setValue(&eo, (void*)(uintptr_t)ptr, type);
  487|      0|        type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  488|      0|    }
  489|       |
  490|     24|    size_t arrNameLen = strlen("ListOf") + strlen(type->typeName);
  491|     24|    if(arrNameLen >= 128)
  ------------------
  |  Branch (491:8): [True: 0, False: 24]
  ------------------
  492|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  493|     24|    memcpy(arrName, "ListOf", strlen("ListOf"));
  494|     24|    memcpy(arrName + strlen("ListOf"), type->typeName, strlen(type->typeName));
  495|     24|    arrName[arrNameLen] = '\0';
  496|       |
  497|     24|    uintptr_t uptr = (uintptr_t)ptr;
  498|     24|    status ret = writeXmlElemNameBegin(ctx, arrName);
  499|     24|    for(size_t i = 0; i < length && ret == UA_STATUSCODE_GOOD; ++i) {
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (499:23): [True: 0, False: 24]
  |  Branch (499:37): [True: 0, False: 0]
  ------------------
  500|      0|        if(!wrapEO) {
  ------------------
  |  Branch (500:12): [True: 0, False: 0]
  ------------------
  501|      0|            ret |= writeXmlElement(ctx, type->typeName, (const void*)uptr, type);
  502|      0|        } else {
  503|      0|            eo.content.decoded.data = (void*)uptr;
  504|      0|            ret |= writeXmlElement(ctx, type->typeName, &eo, type);
  505|      0|        }
  506|      0|        uptr += type->memSize;
  507|      0|    }
  508|     24|    ret |= writeXmlElemNameEnd(ctx, arrName);
  509|     24|    return ret;
  510|     24|}
ua_types_encoding_xml.c:writeXmlElement:
  226|  7.63k|                const void *value, const UA_DataType *type) {
  227|  7.63k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  7.63k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  228|  7.63k|    ret |= writeXmlElemNameBegin(ctx, name);
  229|  7.63k|    ret |= encodeXmlJumpTable[type->typeKind](ctx, value, type);
  230|  7.63k|    ret |= writeXmlElemNameEnd(ctx, name);
  231|  7.63k|    return ret;
  232|  7.63k|}
ua_types_encoding_xml.c:Boolean_decodeXml:
  681|    111|DECODE_XML(Boolean) {
  682|    111|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  663|    111|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (663:8): [True: 0, False: 111]
  |  |  ------------------
  |  |  664|    111|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  665|    111|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (665:18): [Folded, False: 111]
  |  |  ------------------
  ------------------
  683|    111|    GET_ELEM_CONTENT;
  ------------------
  |  |  668|    111|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  669|    111|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  670|    111|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (670:17): [Folded, False: 111]
  |  |  ------------------
  ------------------
  684|    111|    skipXmlObject(ctx);
  685|       |
  686|    111|    if(length == 4 &&
  ------------------
  |  Branch (686:8): [True: 26, False: 85]
  ------------------
  687|     26|       data[0] == 't' && data[1] == 'r' &&
  ------------------
  |  Branch (687:8): [True: 22, False: 4]
  |  Branch (687:26): [True: 16, False: 6]
  ------------------
  688|     16|       data[2] == 'u' && data[3] == 'e') {
  ------------------
  |  Branch (688:8): [True: 9, False: 7]
  |  Branch (688:26): [True: 2, False: 7]
  ------------------
  689|      2|        *dst = true;
  690|    109|    } else if(length == 5 &&
  ------------------
  |  Branch (690:15): [True: 17, False: 92]
  ------------------
  691|     17|              data[0] == 'f' && data[1] == 'a' &&
  ------------------
  |  Branch (691:15): [True: 13, False: 4]
  |  Branch (691:33): [True: 6, False: 7]
  ------------------
  692|      6|              data[2] == 'l' && data[3] == 's' &&
  ------------------
  |  Branch (692:15): [True: 5, False: 1]
  |  Branch (692:33): [True: 3, False: 2]
  ------------------
  693|      3|              data[4] == 'e') {
  ------------------
  |  Branch (693:15): [True: 2, False: 1]
  ------------------
  694|      2|        *dst = false;
  695|    107|    } else {
  696|    107|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    107|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  697|    107|    }
  698|       |
  699|      4|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      4|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  700|    111|}
ua_types_encoding_xml.c:skipXmlObject:
  673|  3.79k|skipXmlObject(ParseCtxXml *ctx) {
  674|  3.79k|    size_t end_parent = ctx->tokens[ctx->index].end;
  675|  5.16M|    while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (675:11): [True: 5.15M, False: 3.72k]
  ------------------
  676|  5.15M|          ctx->tokens[ctx->index].end <= end_parent) {
  ------------------
  |  Branch (676:11): [True: 5.15M, False: 70]
  ------------------
  677|  5.15M|        ctx->index++;
  678|  5.15M|    }
  679|  3.79k|}
ua_types_encoding_xml.c:SByte_decodeXml:
  738|     31|DECODE_XML(SByte) {
  739|     31|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  663|     31|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (663:8): [True: 0, False: 31]
  |  |  ------------------
  |  |  664|     31|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  665|     31|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (665:18): [Folded, False: 31]
  |  |  ------------------
  ------------------
  740|     31|    GET_ELEM_CONTENT;
  ------------------
  |  |  668|     31|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  669|     31|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  670|     31|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (670:17): [Folded, False: 31]
  |  |  ------------------
  ------------------
  741|     31|    skipXmlObject(ctx);
  742|       |
  743|     31|    UA_Int64 out = 0;
  744|     31|    UA_StatusCode s = decodeSigned(data, length, &out);
  745|     31|    if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   16|     62|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   63|     31|#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 (745:8): [True: 31, False: 0]
  |  Branch (745:35): [True: 0, False: 0]
  |  Branch (745:57): [True: 0, False: 0]
  ------------------
  746|     31|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     31|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  747|       |
  748|      0|    *dst = (UA_SByte)out;
  749|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  750|     31|}
ua_types_encoding_xml.c:decodeSigned:
  703|  1.25k|decodeSigned(const UA_Byte *data, size_t dataSize, UA_Int64 *dst) {
  704|  1.25k|    if(!data || dataSize == 0)
  ------------------
  |  Branch (704:8): [True: 55, False: 1.19k]
  |  Branch (704:17): [True: 0, False: 1.19k]
  ------------------
  705|     55|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     55|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  706|  1.19k|    size_t len = parseInt64((const char*)data, dataSize, dst);
  707|  1.19k|    if(len == 0)
  ------------------
  |  Branch (707:8): [True: 139, False: 1.05k]
  ------------------
  708|    139|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    139|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  709|       |
  710|       |    /* There must only be whitespace between the end of the parsed number and
  711|       |     * the end of the XML section */
  712|  1.69k|    for(size_t i = len; i < dataSize; i++) {
  ------------------
  |  Branch (712:25): [True: 770, False: 925]
  ------------------
  713|    770|        if(data[i] != ' ' && data[i] - '\t' >= 5)
  ------------------
  |  Branch (713:12): [True: 672, False: 98]
  |  Branch (713:30): [True: 131, False: 541]
  ------------------
  714|    131|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    131|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  715|    770|    }
  716|       |
  717|    925|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    925|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  718|  1.05k|}
ua_types_encoding_xml.c:Byte_decodeXml:
  752|     39|DECODE_XML(Byte) {
  753|     39|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  663|     39|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (663:8): [True: 0, False: 39]
  |  |  ------------------
  |  |  664|     39|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  665|     39|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (665:18): [Folded, False: 39]
  |  |  ------------------
  ------------------
  754|     39|    GET_ELEM_CONTENT;
  ------------------
  |  |  668|     39|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  669|     39|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  670|     39|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (670:17): [Folded, False: 39]
  |  |  ------------------
  ------------------
  755|     39|    skipXmlObject(ctx);
  756|       |
  757|     39|    UA_UInt64 out = 0;
  758|     39|    UA_StatusCode s = decodeUnsigned(data, length, &out);
  759|     39|    if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   16|     78|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   73|      0|#define UA_BYTE_MAX 255
  ------------------
  |  Branch (759:8): [True: 39, False: 0]
  |  Branch (759:35): [True: 0, False: 0]
  ------------------
  760|     39|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     39|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  761|       |
  762|      0|    *dst = (UA_Byte)out;
  763|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  764|     39|}
ua_types_encoding_xml.c:decodeUnsigned:
  721|    654|decodeUnsigned(const UA_Byte *data, size_t dataSize, UA_UInt64 *dst) {
  722|    654|    if(!data || dataSize == 0)
  ------------------
  |  Branch (722:8): [True: 77, False: 577]
  |  Branch (722:17): [True: 0, False: 577]
  ------------------
  723|     77|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     77|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  724|    577|    size_t len = parseUInt64((const char*)data, dataSize, dst);
  725|    577|    if(len == 0)
  ------------------
  |  Branch (725:8): [True: 82, False: 495]
  ------------------
  726|     82|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     82|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  727|       |
  728|       |    /* There must only be whitespace between the end of the parsed number and
  729|       |     * the end of the XML section */
  730|  1.75k|    for(size_t i = len; i < dataSize; i++) {
  ------------------
  |  Branch (730:25): [True: 1.38k, False: 377]
  ------------------
  731|  1.38k|        if(data[i] != ' ' && data[i] - '\t' >= 5)
  ------------------
  |  Branch (731:12): [True: 1.11k, False: 270]
  |  Branch (731:30): [True: 118, False: 993]
  ------------------
  732|    118|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    118|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  733|  1.38k|    }
  734|       |
  735|    377|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    377|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  736|    495|}
ua_types_encoding_xml.c:Int16_decodeXml:
  766|    624|DECODE_XML(Int16) {
  767|    624|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  663|    624|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (663:8): [True: 0, False: 624]
  |  |  ------------------
  |  |  664|    624|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  665|    624|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (665:18): [Folded, False: 624]
  |  |  ------------------
  ------------------
  768|    624|    GET_ELEM_CONTENT;
  ------------------
  |  |  668|    624|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  669|    624|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  670|    624|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (670:17): [Folded, False: 624]
  |  |  ------------------
  ------------------
  769|    624|    skipXmlObject(ctx);
  770|       |
  771|    624|    UA_Int64 out = 0;
  772|    624|    UA_StatusCode s = decodeSigned(data, length, &out);
  773|    624|    if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   16|  1.24k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   81|  1.07k|#define UA_INT16_MIN (-32768)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   82|    312|#define UA_INT16_MAX 32767
  ------------------
  |  Branch (773:8): [True: 172, False: 452]
  |  Branch (773:35): [True: 140, False: 312]
  |  Branch (773:57): [True: 126, False: 186]
  ------------------
  774|    438|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    438|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  775|       |
  776|    186|    *dst = (UA_Int16)out;
  777|    186|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    186|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  778|    624|}
ua_types_encoding_xml.c:UInt16_decodeXml:
  780|    174|DECODE_XML(UInt16) {
  781|    174|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  663|    174|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (663:8): [True: 0, False: 174]
  |  |  ------------------
  |  |  664|    174|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  665|    174|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (665:18): [Folded, False: 174]
  |  |  ------------------
  ------------------
  782|    174|    GET_ELEM_CONTENT;
  ------------------
  |  |  668|    174|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  669|    174|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  670|    174|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (670:17): [Folded, False: 174]
  |  |  ------------------
  ------------------
  783|    174|    skipXmlObject(ctx);
  784|       |
  785|    174|    UA_UInt64 out = 0;
  786|    174|    UA_StatusCode s = decodeUnsigned(data, length, &out);
  787|    174|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   16|    348|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   91|     88|#define UA_UINT16_MAX 65535
  ------------------
  |  Branch (787:8): [True: 86, False: 88]
  |  Branch (787:35): [True: 40, False: 48]
  ------------------
  788|    126|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    126|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  789|       |
  790|     48|    *dst = (UA_UInt16)out;
  791|     48|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     48|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  792|    174|}
ua_types_encoding_xml.c:Int32_decodeXml:
  794|    273|DECODE_XML(Int32) {
  795|    273|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  663|    273|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (663:8): [True: 0, False: 273]
  |  |  ------------------
  |  |  664|    273|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  665|    273|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (665:18): [Folded, False: 273]
  |  |  ------------------
  ------------------
  796|    273|    GET_ELEM_CONTENT;
  ------------------
  |  |  668|    273|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  669|    273|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  670|    273|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (670:17): [Folded, False: 273]
  |  |  ------------------
  ------------------
  797|    273|    skipXmlObject(ctx);
  798|       |
  799|    273|    UA_Int64 out = 0;
  800|    273|    UA_StatusCode s = decodeSigned(data, length, &out);
  801|    273|    if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   16|    546|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   99|    480|#define UA_INT32_MIN ((int32_t)-2147483648LL)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |  100|    194|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (801:8): [True: 66, False: 207]
  |  Branch (801:35): [True: 13, False: 194]
  |  Branch (801:57): [True: 15, False: 179]
  ------------------
  802|     94|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     94|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  803|       |
  804|    179|    *dst = (UA_Int32)out;
  805|    179|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    179|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  806|    273|}
ua_types_encoding_xml.c:UInt32_decodeXml:
  808|    132|DECODE_XML(UInt32) {
  809|    132|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  663|    132|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (663:8): [True: 0, False: 132]
  |  |  ------------------
  |  |  664|    132|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  665|    132|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (665:18): [Folded, False: 132]
  |  |  ------------------
  ------------------
  810|    132|    GET_ELEM_CONTENT;
  ------------------
  |  |  668|    132|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  669|    132|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  670|    132|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (670:17): [Folded, False: 132]
  |  |  ------------------
  ------------------
  811|    132|    skipXmlObject(ctx);
  812|       |
  813|    132|    UA_UInt64 out = 0;
  814|    132|    UA_StatusCode s = decodeUnsigned(data, length, &out);
  815|    132|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |   16|    264|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |  109|     57|#define UA_UINT32_MAX 4294967295UL
  ------------------
  |  Branch (815:8): [True: 75, False: 57]
  |  Branch (815:35): [True: 5, False: 52]
  ------------------
  816|     80|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     80|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  817|       |
  818|     52|    *dst = (UA_UInt32)out;
  819|     52|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     52|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  820|    132|}
ua_types_encoding_xml.c:Int64_decodeXml:
  822|    322|DECODE_XML(Int64) {
  823|    322|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  663|    322|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (663:8): [True: 0, False: 322]
  |  |  ------------------
  |  |  664|    322|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  665|    322|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (665:18): [Folded, False: 322]
  |  |  ------------------
  ------------------
  824|    322|    GET_ELEM_CONTENT;
  ------------------
  |  |  668|    322|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  669|    322|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  670|    322|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (670:17): [Folded, False: 322]
  |  |  ------------------
  ------------------
  825|    322|    skipXmlObject(ctx);
  826|       |
  827|    322|    UA_Int64 out = 0;
  828|    322|    UA_StatusCode s = decodeSigned(data, length, &out);
  829|    322|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    322|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (829:8): [True: 56, False: 266]
  ------------------
  830|     56|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     56|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  831|       |
  832|    266|    *dst = (UA_Int64)out;
  833|    266|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    266|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  834|    322|}
ua_types_encoding_xml.c:UInt64_decodeXml:
  836|    309|DECODE_XML(UInt64) {
  837|    309|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  663|    309|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (663:8): [True: 0, False: 309]
  |  |  ------------------
  |  |  664|    309|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  665|    309|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (665:18): [Folded, False: 309]
  |  |  ------------------
  ------------------
  838|    309|    GET_ELEM_CONTENT;
  ------------------
  |  |  668|    309|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  669|    309|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  670|    309|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (670:17): [Folded, False: 309]
  |  |  ------------------
  ------------------
  839|    309|    skipXmlObject(ctx);
  840|       |
  841|    309|    UA_UInt64 out = 0;
  842|    309|    UA_StatusCode s = decodeUnsigned(data, length, &out);
  843|    309|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    309|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (843:8): [True: 77, False: 232]
  ------------------
  844|     77|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     77|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  845|       |
  846|    232|    *dst = (UA_UInt64)out;
  847|    232|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    232|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  848|    309|}
ua_types_encoding_xml.c:Float_decodeXml:
  898|      8|DECODE_XML(Float) {
  899|      8|    UA_Double v = 0.0;
  900|       |    UA_StatusCode res = Double_decodeXml(ctx, &v, NULL);
  901|      8|    *dst = (UA_Float)v;
  902|      8|    return res;
  903|      8|}
ua_types_encoding_xml.c:Double_decodeXml:
  850|  1.40k|DECODE_XML(Double) {
  851|  1.40k|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  663|  1.40k|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (663:8): [True: 0, False: 1.40k]
  |  |  ------------------
  |  |  664|  1.40k|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  665|  1.40k|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (665:18): [Folded, False: 1.40k]
  |  |  ------------------
  ------------------
  852|  1.40k|    GET_ELEM_CONTENT;
  ------------------
  |  |  668|  1.40k|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  669|  1.40k|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  670|  1.40k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (670:17): [Folded, False: 1.40k]
  |  |  ------------------
  ------------------
  853|  1.40k|    skipXmlObject(ctx);
  854|       |
  855|  1.40k|    if(!data || length == 0)
  ------------------
  |  Branch (855:8): [True: 44, False: 1.35k]
  |  Branch (855:17): [True: 0, False: 1.35k]
  ------------------
  856|     44|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     44|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  857|       |
  858|       |    /* https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/
  859|       |     * Maximum digit counts for select IEEE floating-point formats: 1074
  860|       |     * Sanity check. */
  861|  1.35k|    if(length > 1075)
  ------------------
  |  Branch (861:8): [True: 20, False: 1.33k]
  ------------------
  862|     20|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     20|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  863|       |
  864|  1.33k|    if(length == 3 && memcmp(data, "INF", 3) == 0) {
  ------------------
  |  Branch (864:8): [True: 91, False: 1.24k]
  |  Branch (864:23): [True: 3, False: 88]
  ------------------
  865|      3|        *dst = INFINITY;
  866|      3|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      3|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  867|      3|    }
  868|       |
  869|  1.33k|    if(length == 4 && memcmp(data, "-INF", 4) == 0) {
  ------------------
  |  Branch (869:8): [True: 57, False: 1.27k]
  |  Branch (869:23): [True: 3, False: 54]
  ------------------
  870|      3|        *dst = -INFINITY;
  871|      3|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      3|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  872|      3|    }
  873|       |
  874|  1.33k|    if(length == 3 && memcmp(data, "NaN", 3) == 0) {
  ------------------
  |  Branch (874:8): [True: 88, False: 1.24k]
  |  Branch (874:23): [True: 4, False: 84]
  ------------------
  875|      4|        *dst = NAN;
  876|      4|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      4|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  877|      4|    }
  878|       |
  879|  1.32k|    if(length == 3 && memcmp(data, "-NaN", 3) == 0) {
  ------------------
  |  Branch (879:8): [True: 84, False: 1.24k]
  |  Branch (879:23): [True: 1, False: 83]
  ------------------
  880|      1|        *dst = NAN;
  881|      1|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  882|      1|    }
  883|       |
  884|  1.32k|    size_t len = parseDouble((const char*)data, length, dst);
  885|  1.32k|    if(len == 0)
  ------------------
  |  Branch (885:8): [True: 40, False: 1.28k]
  ------------------
  886|     40|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     40|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  887|       |
  888|       |    /* There must only be whitespace between the end of the parsed number and
  889|       |     * the end of the token */
  890|  1.49k|    for(size_t i = len; i < length; i++) {
  ------------------
  |  Branch (890:25): [True: 248, False: 1.25k]
  ------------------
  891|    248|        if(data[i] != ' ' && data[i] -'\t' >= 5)
  ------------------
  |  Branch (891:12): [True: 238, False: 10]
  |  Branch (891:30): [True: 35, False: 203]
  ------------------
  892|     35|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     35|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  893|    248|    }
  894|       |
  895|  1.25k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.25k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  896|  1.28k|}
ua_types_encoding_xml.c:String_decodeXml:
  905|    116|DECODE_XML(String) {
  906|    116|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  663|    116|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (663:8): [True: 0, False: 116]
  |  |  ------------------
  |  |  664|    116|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  665|    116|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (665:18): [Folded, False: 116]
  |  |  ------------------
  ------------------
  907|    116|    GET_ELEM_CONTENT;
  ------------------
  |  |  668|    116|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  669|    116|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  670|    116|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (670:17): [Folded, False: 116]
  |  |  ------------------
  ------------------
  908|    116|    skipXmlObject(ctx);
  909|       |
  910|       |    /* Empty string? */
  911|    116|    if(length == 0) {
  ------------------
  |  Branch (911:8): [True: 22, False: 94]
  ------------------
  912|     22|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|     22|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  913|     22|        dst->length = 0;
  914|     22|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     22|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  915|     22|    }
  916|       |
  917|     94|    UA_String str = {length, (UA_Byte*)(uintptr_t)data};
  918|     94|    return UA_String_copy(&str, dst);
  919|    116|}
ua_types_encoding_xml.c:DateTime_decodeXml:
  921|     40|DECODE_XML(DateTime) {
  922|     40|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  663|     40|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (663:8): [True: 0, False: 40]
  |  |  ------------------
  |  |  664|     40|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  665|     40|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (665:18): [Folded, False: 40]
  |  |  ------------------
  ------------------
  923|     40|    GET_ELEM_CONTENT;
  ------------------
  |  |  668|     40|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  669|     40|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  670|     40|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (670:17): [Folded, False: 40]
  |  |  ------------------
  ------------------
  924|     40|    skipXmlObject(ctx);
  925|     40|    UA_String str = {length, (UA_Byte*)(uintptr_t)data};
  926|     40|    return UA_DateTime_parse(dst, str);
  927|     40|}
ua_types_encoding_xml.c:Guid_decodeXml:
 1021|     24|DECODE_XML(Guid) {
 1022|     24|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  663|     24|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (663:8): [True: 0, False: 24]
  |  |  ------------------
  |  |  664|     24|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  665|     24|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (665:18): [Folded, False: 24]
  |  |  ------------------
  ------------------
 1023|     24|    UA_String str;
 1024|     24|    UA_String_init(&str);
 1025|     24|    XmlDecodeEntry entry = {UA_STRING_STATIC(UA_XML_GUID_STRING), &str,
  ------------------
  |  |  223|     24|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1026|     24|                            NULL, false, &UA_TYPES[UA_TYPES_STRING]};
  ------------------
  |  |  395|     24|#define UA_TYPES_STRING 11
  ------------------
 1027|     24|    status ret = decodeXmlFields(ctx, &entry, 1);
 1028|     24|    ret |= UA_Guid_parse(dst, str);
 1029|     24|    UA_String_clear(&str);
 1030|     24|    return ret;
 1031|     24|}
ua_types_encoding_xml.c:decodeXmlFields:
  956|    256|decodeXmlFields(ParseCtxXml *ctx, XmlDecodeEntry *entries, size_t entryCount) {
  957|    256|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  663|    256|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (663:8): [True: 0, False: 256]
  |  |  ------------------
  |  |  664|    256|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  665|    256|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (665:18): [Folded, False: 256]
  |  |  ------------------
  ------------------
  958|       |
  959|    256|    if(ctx->depth >= UA_XML_ENCODING_MAX_RECURSION)
  ------------------
  |  |   15|    256|#define UA_XML_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (959:8): [True: 0, False: 256]
  ------------------
  960|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  961|       |
  962|    256|    size_t childCount = ctx->tokens[ctx->index].children;
  963|       |
  964|       |    /* Empty object */
  965|    256|    if(childCount == 0) {
  ------------------
  |  Branch (965:8): [True: 82, False: 174]
  ------------------
  966|     82|        skipXmlObject(ctx);
  967|     82|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     82|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  968|     82|    }
  969|       |
  970|       |    /* Go to first entry element */
  971|    174|    ctx->depth++;
  972|    174|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
  973|       |
  974|    174|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    174|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  975|    207|    for(size_t i = 0; i < childCount; i++) {
  ------------------
  |  Branch (975:23): [True: 197, False: 10]
  ------------------
  976|    197|        xml_token *elem = &ctx->tokens[ctx->index];
  977|    197|        XmlDecodeEntry *entry = NULL;
  978|    490|        for(size_t j = i; j < entryCount + i; j++) {
  ------------------
  |  Branch (978:27): [True: 430, False: 60]
  ------------------
  979|       |            /* Search for key, if found outer loop will be one less. Best case
  980|       |             * if objectCount is in order! */
  981|    430|            size_t index = j % entryCount;
  982|    430|            if(!UA_String_equal_ignorecase(&elem->name, &entries[index].name))
  ------------------
  |  Branch (982:16): [True: 293, False: 137]
  ------------------
  983|    293|                continue;
  984|    137|            entry = &entries[index];
  985|    137|            break;
  986|    430|        }
  987|       |
  988|       |        /* Unknown child element */
  989|    197|        if(!entry)
  ------------------
  |  Branch (989:12): [True: 60, False: 137]
  ------------------
  990|     60|            goto errout;
  991|       |
  992|       |        /* An entry that was expected, but shall not be decoded.
  993|       |         * Jump over it. */
  994|    137|        if(!entry->fieldPointer || (!entry->function && !entry->type)) {
  ------------------
  |  Branch (994:12): [True: 0, False: 137]
  |  Branch (994:37): [True: 137, False: 0]
  |  Branch (994:57): [True: 0, False: 137]
  ------------------
  995|      0|            skipXmlObject(ctx);
  996|      0|            continue;
  997|      0|        }
  998|       |
  999|       |        /* Duplicate child element */
 1000|    137|        if(entry->found)
  ------------------
  |  Branch (1000:12): [True: 4, False: 133]
  ------------------
 1001|      4|            goto errout;
 1002|    133|        entry->found = true;
 1003|       |
 1004|       |        /* Decode */
 1005|    133|        if(entry->function) /* Specialized decoding function */
  ------------------
  |  Branch (1005:12): [True: 0, False: 133]
  ------------------
 1006|      0|            ret = entry->function(ctx, entry->fieldPointer, entry->type);
 1007|    133|        else /* Decode by type-kind */
 1008|    133|            ret = decodeXmlJumpTable[entry->type->typeKind](ctx, entry->fieldPointer, entry->type);
 1009|    133|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    133|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1009:12): [True: 100, False: 33]
  ------------------
 1010|    100|            goto cleanup;
 1011|    133|    }
 1012|       |
 1013|    110|cleanup:
 1014|    110|    ctx->depth--;
 1015|    110|    return ret;
 1016|     64|errout:
 1017|     64|    ctx->depth--;
 1018|     64|    return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     64|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1019|    174|}
ua_types_encoding_xml.c:ByteString_decodeXml:
 1033|    144|DECODE_XML(ByteString) {
 1034|    144|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  663|    144|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (663:8): [True: 0, False: 144]
  |  |  ------------------
  |  |  664|    144|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  665|    144|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (665:18): [Folded, False: 144]
  |  |  ------------------
  ------------------
 1035|    144|    GET_ELEM_CONTENT;
  ------------------
  |  |  668|    144|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  669|    144|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  670|    144|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (670:17): [Folded, False: 144]
  |  |  ------------------
  ------------------
 1036|    144|    skipXmlObject(ctx);
 1037|       |
 1038|       |    /* Empty bytestring? */
 1039|    144|    if(length == 0) {
  ------------------
  |  Branch (1039:8): [True: 64, False: 80]
  ------------------
 1040|     64|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|     64|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1041|     64|        dst->length = 0;
 1042|     80|    } else {
 1043|     80|        size_t flen = 0;
 1044|     80|        unsigned char* unB64 = UA_unbase64((const unsigned char*)data, length, &flen);
 1045|     80|        if(!unB64)
  ------------------
  |  Branch (1045:12): [True: 71, False: 9]
  ------------------
 1046|     71|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     71|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1047|      9|        dst->data = (UA_Byte*)unB64;
 1048|      9|        dst->length = flen;
 1049|      9|    }
 1050|       |
 1051|     73|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     73|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1052|    144|}
ua_types_encoding_xml.c:decodeXmlNotImplemented:
 1485|      3|decodeXmlNotImplemented(ParseCtxXml *ctx, void *dst, const UA_DataType *type) {
 1486|      3|    (void)dst, (void)type, (void)ctx;
 1487|      3|    return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  238|      3|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
 1488|      3|}
ua_types_encoding_xml.c:NodeId_decodeXml:
 1054|      5|DECODE_XML(NodeId) {
 1055|      5|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  663|      5|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (663:8): [True: 0, False: 5]
  |  |  ------------------
  |  |  664|      5|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  665|      5|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (665:18): [Folded, False: 5]
  |  |  ------------------
  ------------------
 1056|      5|    UA_String str;
 1057|      5|    static UA_String identifier = UA_STRING_STATIC(UA_XML_NODEID_IDENTIFIER);
  ------------------
  |  |  223|      5|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1058|      5|    status ret = getChildContent(ctx, identifier, &str);
 1059|      5|    if(ret != UA_STATUSCODE_GOOD) return ret;
  ------------------
  |  |   16|      5|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1059:8): [True: 5, False: 0]
  ------------------
 1060|      0|    skipXmlObject(ctx);
 1061|      0|    return UA_NodeId_parseEx(dst, str, ctx->namespaceMapping);
 1062|      5|}
ua_types_encoding_xml.c:getChildContent:
  932|     19|getChildContent(ParseCtxXml *ctx, UA_String name, UA_String *out) {
  933|     19|    size_t oldIndex = ctx->index;
  934|     19|    size_t children = ctx->tokens[ctx->index].children;
  935|       |
  936|       |    /* Skip the attributes and go to the first child */
  937|     19|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
  938|       |
  939|       |    /* Find the child of the name */
  940|     19|    UA_StatusCode res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     19|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  941|     19|    for(size_t i = 0; i < children; i++) {
  ------------------
  |  Branch (941:23): [True: 0, False: 19]
  ------------------
  942|      0|        if(!UA_String_equal(&name, &ctx->tokens[ctx->index].name)) {
  ------------------
  |  Branch (942:12): [True: 0, False: 0]
  ------------------
  943|      0|            skipXmlObject(ctx);
  944|      0|            continue;
  945|      0|        }
  946|      0|        *out = ctx->tokens[ctx->index].content;
  947|      0|        res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  948|      0|        break;
  949|      0|    }
  950|       |
  951|     19|    ctx->index = oldIndex;
  952|     19|    return res;
  953|     19|}
ua_types_encoding_xml.c:ExpandedNodeId_decodeXml:
 1064|      1|DECODE_XML(ExpandedNodeId) {
 1065|      1|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  663|      1|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (663:8): [True: 0, False: 1]
  |  |  ------------------
  |  |  664|      1|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  665|      1|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (665:18): [Folded, False: 1]
  |  |  ------------------
  ------------------
 1066|      1|    UA_String str;
 1067|      1|    static UA_String expidentifier = UA_STRING_STATIC(UA_XML_EXPANDEDNODEID_IDENTIFIER);
  ------------------
  |  |  223|      1|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1068|      1|    status ret = getChildContent(ctx, expidentifier, &str);
 1069|      1|    if(ret != UA_STATUSCODE_GOOD) return ret;
  ------------------
  |  |   16|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1069:8): [True: 1, False: 0]
  ------------------
 1070|      0|    skipXmlObject(ctx);
 1071|      0|    return UA_ExpandedNodeId_parseEx(dst, str, ctx->namespaceMapping,
 1072|      0|                                     ctx->serverUrisSize, ctx->serverUris);
 1073|      1|}
ua_types_encoding_xml.c:StatusCode_decodeXml:
 1075|     13|DECODE_XML(StatusCode) {
 1076|     13|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  663|     13|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (663:8): [True: 0, False: 13]
  |  |  ------------------
  |  |  664|     13|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  665|     13|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (665:18): [Folded, False: 13]
  |  |  ------------------
  ------------------
 1077|     13|    UA_String str;
 1078|     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}
  ------------------
 1079|     13|    status ret = getChildContent(ctx, statusidentifier, &str);
 1080|     13|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|     13|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1080:8): [True: 13, False: 0]
  ------------------
 1081|     13|        return ret;
 1082|      0|    skipXmlObject(ctx);
 1083|      0|    UA_UInt64 out = 0;
 1084|      0|    ret = decodeUnsigned(str.data, str.length, &out);
 1085|      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 (1085:8): [True: 0, False: 0]
  |  Branch (1085:37): [True: 0, False: 0]
  ------------------
 1086|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1087|      0|    *dst = (UA_StatusCode)out;
 1088|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1089|      0|}
ua_types_encoding_xml.c:LocalizedText_decodeXml:
 1111|      4|DECODE_XML(LocalizedText) {
 1112|      4|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  663|      4|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (663:8): [True: 0, False: 4]
  |  |  ------------------
  |  |  664|      4|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  665|      4|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (665:18): [Folded, False: 4]
  |  |  ------------------
  ------------------
 1113|       |
 1114|      4|    XmlDecodeEntry entries[2] = {
 1115|      4|        {UA_STRING_STATIC(UA_XML_LOCALIZEDTEXT_LOCALE), &dst->locale,
  ------------------
  |  |  223|      4|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1116|      4|         NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  395|      4|#define UA_TYPES_STRING 11
  ------------------
 1117|      4|        {UA_STRING_STATIC(UA_XML_LOCALIZEDTEXT_TEXT), &dst->text,
  ------------------
  |  |  223|      4|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1118|      4|         NULL, false, &UA_TYPES[UA_TYPES_STRING]}
  ------------------
  |  |  395|      4|#define UA_TYPES_STRING 11
  ------------------
 1119|      4|    };
 1120|       |
 1121|      4|    return decodeXmlFields(ctx, entries, 2);
 1122|      4|}
ua_types_encoding_xml.c:ExtensionObject_decodeXml:
 1211|      2|DECODE_XML(ExtensionObject) {
 1212|      2|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  663|      2|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (663:8): [True: 0, False: 2]
  |  |  ------------------
  |  |  664|      2|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  665|      2|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (665:18): [Folded, False: 2]
  |  |  ------------------
  ------------------
 1213|      2|    xml_token *tok = &ctx->tokens[ctx->index];
 1214|      2|    if(tok->children == 0)
  ------------------
  |  Branch (1214:8): [True: 2, False: 0]
  ------------------
 1215|      2|        return UA_STATUSCODE_GOOD; /* _NO_BODY */
  ------------------
  |  |   16|      2|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1216|      0|    dst->encoding = UA_EXTENSIONOBJECT_ENCODED_XML; /* default so the typeId gets cleaned up */
 1217|      0|    XmlDecodeEntry entries[2] = {
 1218|      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}
  ------------------
 1219|      0|         NULL, false, &UA_TYPES[UA_TYPES_NODEID]},
  ------------------
  |  |  565|      0|#define UA_TYPES_NODEID 16
  ------------------
 1220|      0|        {UA_STRING_STATIC(UA_XML_EXTENSIONOBJECT_BODY), dst,
  ------------------
  |  |  223|      0|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1221|      0|         decodeExtensionObjectBody, false, NULL},
 1222|      0|    };
 1223|      0|    return decodeXmlFields(ctx, entries, 2);
 1224|      2|}
ua_types_encoding_xml.c:Variant_decodeXml:
 1372|  4.27k|DECODE_XML(Variant) {
 1373|  4.27k|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  663|  4.27k|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (663:8): [True: 0, False: 4.27k]
  |  |  ------------------
  |  |  664|  4.27k|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  665|  4.27k|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (665:18): [Folded, False: 4.27k]
  |  |  ------------------
  ------------------
 1374|       |
 1375|  4.27k|    if(ctx->depth >= UA_XML_ENCODING_MAX_RECURSION)
  ------------------
  |  |   15|  4.27k|#define UA_XML_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (1375:8): [True: 0, False: 4.27k]
  ------------------
 1376|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 1377|       |
 1378|  4.27k|    xml_token *tok = &ctx->tokens[ctx->index];
 1379|  4.27k|    if(tok->children == 0)
  ------------------
  |  Branch (1379:8): [True: 54, False: 4.22k]
  ------------------
 1380|     54|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     54|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1381|  4.22k|    if(tok->children != 1)
  ------------------
  |  Branch (1381:8): [True: 148, False: 4.07k]
  ------------------
 1382|    148|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    148|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1383|       |
 1384|       |    /* Move forward to the content */
 1385|  4.07k|    if(ctx->index + 2 >= ctx->tokensSize)
  ------------------
  |  Branch (1385:8): [True: 2, False: 4.07k]
  ------------------
 1386|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1387|       |
 1388|  4.07k|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
 1389|  4.07k|    tok = &ctx->tokens[ctx->index];
 1390|  4.07k|    static UA_String valName = UA_STRING_STATIC("Value");
  ------------------
  |  |  223|  4.07k|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1391|  4.07k|    if(!UA_String_equal(&tok->name, &valName))
  ------------------
  |  Branch (1391:8): [True: 33, False: 4.03k]
  ------------------
 1392|     33|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     33|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1393|  4.03k|    if(tok->children != 1)
  ------------------
  |  Branch (1393:8): [True: 10, False: 4.02k]
  ------------------
 1394|     10|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     10|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1395|       |
 1396|       |    /* Jump to the child of the <Value> token */
 1397|  4.02k|    ctx->depth++;
 1398|  4.02k|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
 1399|  4.02k|    tok = &ctx->tokens[ctx->index];
 1400|       |
 1401|       |    /* Special case for multi-dimensional arrays */
 1402|  4.02k|    static UA_String matrName = UA_STRING_STATIC("Matrix");
  ------------------
  |  |  223|  4.02k|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1403|  4.02k|    UA_StatusCode ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  4.02k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1404|  4.02k|    if(UA_String_equal(&tok->name, &matrName)) {
  ------------------
  |  Branch (1404:8): [True: 2, False: 4.02k]
  ------------------
 1405|      2|        ret = decodeMatrixVariant(ctx, dst);
 1406|      2|        unwrapVariantExtensionObject(dst, true);
 1407|      2|        ctx->depth--;
 1408|      2|        return ret;
 1409|      2|    }
 1410|       |
 1411|       |    /* Get the Data type / array type */
 1412|  4.02k|    UA_Boolean isArray = false;
 1413|  4.02k|    static char *lo = "ListOf";
 1414|  4.02k|    UA_String typeName = tok->name;
 1415|  4.02k|    if(tok->name.length > strlen(lo) &&
  ------------------
  |  Branch (1415:8): [True: 184, False: 3.84k]
  ------------------
 1416|    184|       strncmp((char*)tok->name.data, lo, strlen(lo)) == 0) {
  ------------------
  |  Branch (1416:8): [True: 17, False: 167]
  ------------------
 1417|     17|        isArray = true;
 1418|     17|        typeName.data += strlen(lo);
 1419|     17|        typeName.length -= strlen(lo);
 1420|     17|    }
 1421|       |
 1422|       |    /* Look up the DataType from the name */
 1423|  4.02k|    dst->type = lookupTypeByName(ctx, typeName);
 1424|  4.02k|    if(!dst->type) {
  ------------------
  |  Branch (1424:8): [True: 144, False: 3.88k]
  ------------------
 1425|    144|        ctx->depth--;
 1426|    144|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    144|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1427|    144|    }
 1428|       |
 1429|       |    /* Decode */
 1430|  3.88k|    if(!isArray) {
  ------------------
  |  Branch (1430:8): [True: 3.86k, False: 16]
  ------------------
 1431|  3.86k|        dst->data = UA_new(dst->type);
 1432|  3.86k|        if(!dst->data) {
  ------------------
  |  Branch (1432:12): [True: 0, False: 3.86k]
  ------------------
 1433|      0|            ctx->depth--;
 1434|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1435|      0|        }
 1436|  3.86k|        ret = decodeXmlJumpTable[dst->type->typeKind](ctx, dst->data, dst->type);
 1437|  3.86k|    } else {
 1438|     16|        ret = Array_decodeXml(ctx, &dst->arrayLength, dst->type);
 1439|     16|    }
 1440|       |
 1441|       |    /* Unwrap ExtensionObject values in the variant */
 1442|  3.88k|    unwrapVariantExtensionObject(dst, isArray);
 1443|       |
 1444|  3.88k|    ctx->depth--;
 1445|  3.88k|    return ret;
 1446|  3.88k|}
ua_types_encoding_xml.c:decodeMatrixVariant:
 1321|      2|decodeMatrixVariant(ParseCtxXml *ctx, UA_Variant *dst) {
 1322|       |    /* The <Matrix> token needs two children: <Dimensions> and <Elements> */
 1323|      2|    xml_token *tok = &ctx->tokens[ctx->index];
 1324|      2|    if(tok->children != 2)
  ------------------
  |  Branch (1324:8): [True: 1, False: 1]
  ------------------
 1325|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1326|       |
 1327|       |    /* Jump to the child of the <Matrix> token */
 1328|      1|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
 1329|      1|    tok = &ctx->tokens[ctx->index];
 1330|       |
 1331|      1|    UA_assert(tok->type == XML_TOKEN_ELEMENT);
  ------------------
  |  |  395|      1|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1331:5): [True: 1, False: 0]
  ------------------
 1332|      1|    static UA_String dimName = UA_STRING_STATIC("Dimensions");
  ------------------
  |  |  223|      1|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1333|      1|    if(!UA_String_equal(&tok->name, &dimName))
  ------------------
  |  Branch (1333:8): [True: 1, False: 0]
  ------------------
 1334|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1335|       |
 1336|      0|    UA_StatusCode ret =
 1337|      0|        Array_decodeXml(ctx, &dst->arrayDimensionsSize, &UA_TYPES[UA_TYPES_INT32]);
  ------------------
  |  |  191|      0|#define UA_TYPES_INT32 5
  ------------------
 1338|      0|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1338:8): [True: 0, False: 0]
  ------------------
 1339|      0|        return ret;
 1340|       |
 1341|      0|    UA_assert(tok->type == XML_TOKEN_ELEMENT);
  ------------------
  |  |  395|      0|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1341:5): [True: 0, False: 0]
  ------------------
 1342|      0|    static UA_String elemName = UA_STRING_STATIC("Elements");
  ------------------
  |  |  223|      0|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1343|      0|    tok = &ctx->tokens[ctx->index];
 1344|      0|    if(!UA_String_equal(&tok->name, &elemName))
  ------------------
  |  Branch (1344:8): [True: 0, False: 0]
  ------------------
 1345|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1346|       |
 1347|       |    /* Get the type of the first element */
 1348|      0|    size_t oldIndex = ctx->index;
 1349|      0|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
 1350|      0|    tok = &ctx->tokens[ctx->index];
 1351|      0|    UA_assert(tok->type == XML_TOKEN_ELEMENT);
  ------------------
  |  |  395|      0|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1351:5): [True: 0, False: 0]
  ------------------
 1352|       |
 1353|      0|    UA_String typeName = tok->name;
 1354|      0|    dst->type = lookupTypeByName(ctx, typeName);
 1355|      0|    if(!dst->type)
  ------------------
  |  Branch (1355:8): [True: 0, False: 0]
  ------------------
 1356|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1357|       |
 1358|       |    /* Decode the array */
 1359|      0|    ctx->index = oldIndex;
 1360|      0|    ret = Array_decodeXml(ctx, &dst->arrayLength, dst->type);
 1361|      0|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1361:8): [True: 0, False: 0]
  ------------------
 1362|      0|        return ret;
 1363|       |
 1364|       |    /* Check that the ArrayDimensions match */
 1365|      0|    size_t dimLen = 1;
 1366|      0|    for(size_t i = 0; i < dst->arrayDimensionsSize; i++)
  ------------------
  |  Branch (1366:23): [True: 0, False: 0]
  ------------------
 1367|      0|        dimLen *= dst->arrayDimensions[i];
 1368|       |
 1369|      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 (1369:12): [True: 0, False: 0]
  ------------------
 1370|      0|}
ua_types_encoding_xml.c:unwrapVariantExtensionObject:
 1273|  3.88k|unwrapVariantExtensionObject(UA_Variant *dst, UA_Boolean isArray) {
 1274|  3.88k|    if(dst->type != &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  735|  3.88k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (1274:8): [True: 3.87k, False: 4]
  ------------------
 1275|  3.87k|        return;
 1276|      4|    if(isArray && dst->arrayLength == 0)
  ------------------
  |  Branch (1276:8): [True: 2, False: 2]
  |  Branch (1276:19): [True: 2, False: 0]
  ------------------
 1277|      2|        return;
 1278|       |
 1279|      2|    UA_ExtensionObject *eo = (UA_ExtensionObject*)dst->data;
 1280|      2|    if(eo->encoding != UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (1280:8): [True: 2, False: 0]
  ------------------
 1281|      2|        return;
 1282|       |
 1283|      0|    const UA_DataType *type = eo->content.decoded.type;
 1284|       |
 1285|       |    /* Scalar */
 1286|      0|    if(!isArray) {
  ------------------
  |  Branch (1286:8): [True: 0, False: 0]
  ------------------
 1287|      0|        dst->data = eo->content.decoded.data;
 1288|      0|        dst->type = type;
 1289|      0|        UA_free(eo);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1290|      0|        return;
 1291|      0|    }
 1292|       |
 1293|       |    /* Array. Check that all members can be unpacked */
 1294|      0|    for(size_t i = 0; i < dst->arrayLength; i++, eo++) {
  ------------------
  |  Branch (1294:23): [True: 0, False: 0]
  ------------------
 1295|      0|        if(eo->encoding != UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (1295:12): [True: 0, False: 0]
  ------------------
 1296|      0|            return;
 1297|      0|        if(eo->content.decoded.type != type)
  ------------------
  |  Branch (1297:12): [True: 0, False: 0]
  ------------------
 1298|      0|            return;
 1299|      0|    }
 1300|       |
 1301|       |    /* Allocate the array */
 1302|      0|    void *unpacked = UA_calloc(dst->arrayLength, type->memSize);
  ------------------
  |  |   20|      0|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1303|      0|    if(!unpacked)
  ------------------
  |  Branch (1303:8): [True: 0, False: 0]
  ------------------
 1304|      0|        return;
 1305|       |
 1306|       |    /* Unpack the content and set the new array */
 1307|      0|    uintptr_t uptr = (uintptr_t)unpacked;
 1308|      0|    eo = (UA_ExtensionObject*)dst->data;
 1309|      0|    for(size_t i = 0; i < dst->arrayLength; i++, eo++) {
  ------------------
  |  Branch (1309:23): [True: 0, False: 0]
  ------------------
 1310|       |        /* Move the value content */
 1311|      0|        memcpy((void*)uptr, eo->content.decoded.data, type->memSize);
 1312|      0|        UA_free(eo->content.decoded.data); /* Free the old value location */
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1313|      0|        uptr += type->memSize;
 1314|      0|    }
 1315|      0|    UA_free(dst->data); /* Remove the old array of ExtensionObjects */
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1316|      0|    dst->data = unpacked;
 1317|      0|    dst->type = type;
 1318|      0|}
ua_types_encoding_xml.c:lookupTypeByName:
 1252|  4.02k|lookupTypeByName(ParseCtxXml *ctx, UA_String typeName) {
 1253|       |    /* Search in the builtin types */
 1254|   121k|    for(size_t i = 0; i < UA_TYPES_COUNT; ++i) {
  ------------------
  |  |   17|   121k|#define UA_TYPES_COUNT 388
  ------------------
  |  Branch (1254:23): [True: 121k, False: 144]
  ------------------
 1255|   121k|        if(strncmp((char*)typeName.data, UA_TYPES[i].typeName, typeName.length) == 0)
  ------------------
  |  Branch (1255:12): [True: 3.88k, False: 117k]
  ------------------
 1256|  3.88k|            return &UA_TYPES[i];
 1257|   121k|    }
 1258|       |
 1259|       |    /* Search in the customTypes */
 1260|    144|    const UA_DataTypeArray *customTypes = ctx->customTypes;
 1261|    144|    while(customTypes) {
  ------------------
  |  Branch (1261:11): [True: 0, False: 144]
  ------------------
 1262|      0|        for(size_t i = 0; i < customTypes->typesSize; ++i) {
  ------------------
  |  Branch (1262:27): [True: 0, False: 0]
  ------------------
 1263|      0|            const UA_DataType *type = &customTypes->types[i];
 1264|      0|            if(strncmp((char*)typeName.data, type->typeName, typeName.length) == 0)
  ------------------
  |  Branch (1264:16): [True: 0, False: 0]
  ------------------
 1265|      0|                return type;
 1266|      0|        }
 1267|      0|        customTypes = customTypes->next;
 1268|      0|    }
 1269|    144|    return NULL;
 1270|    144|}
ua_types_encoding_xml.c:Array_decodeXml:
 1227|     16|Array_decodeXml(ParseCtxXml *ctx, size_t *dstSize, const UA_DataType *type) {
 1228|       |    /* Allocate memory */
 1229|     16|    size_t length = ctx->tokens[ctx->index].children;
 1230|     16|    void **dst = (void**)((uintptr_t)dstSize + sizeof(void*));
 1231|     16|    *dst = UA_Array_new(length, type);
 1232|     16|    if(!*dst)
  ------------------
  |  Branch (1232:8): [True: 0, False: 16]
  ------------------
 1233|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1234|     16|    *dstSize = length;
 1235|       |
 1236|       |    /* Go to first array member. */
 1237|     16|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
 1238|       |
 1239|       |    /* Decode array members */
 1240|     16|    uintptr_t ptr = (uintptr_t)*dst;
 1241|     16|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (1241:23): [True: 0, False: 16]
  ------------------
 1242|      0|        status ret = decodeXmlJumpTable[type->typeKind](ctx, (void*)ptr, type);
 1243|      0|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1243:12): [True: 0, False: 0]
  ------------------
 1244|      0|            return ret;
 1245|      0|        ptr += type->memSize;
 1246|      0|    }
 1247|       |
 1248|     16|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     16|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1249|     16|}
ua_types_encoding_xml.c:decodeXmlStructure:
 1449|    228|decodeXmlStructure(ParseCtxXml *ctx, void *dst, const UA_DataType *type) {
 1450|       |    /* Check the recursion limit */
 1451|    228|    if(ctx->depth >= UA_XML_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   15|    228|#define UA_XML_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (1451:8): [True: 0, False: 228]
  ------------------
 1452|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 1453|    228|    ctx->depth++;
 1454|       |
 1455|    228|    uintptr_t ptr = (uintptr_t)dst;
 1456|    228|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    228|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1457|    228|    u8 membersSize = type->membersSize;
 1458|    228|    UA_STACKARRAY(XmlDecodeEntry, entries, membersSize);
  ------------------
  |  |  371|    228|#  define UA_STACKARRAY(TYPE, NAME, SIZE) TYPE NAME[SIZE]
  ------------------
 1459|    926|    for(size_t i = 0; i < membersSize; ++i) {
  ------------------
  |  Branch (1459:23): [True: 698, False: 228]
  ------------------
 1460|    698|        const UA_DataTypeMember *m = &type->members[i];
 1461|    698|        const UA_DataType *mt = m->memberType;
 1462|    698|        entries[i].type = mt;
 1463|    698|        entries[i].name = UA_STRING((char*)(uintptr_t)m->memberName);
 1464|    698|        entries[i].found = false;
 1465|    698|        ptr += m->padding;
 1466|    698|        entries[i].fieldPointer = (void*)ptr;
 1467|    698|        if(!m->isArray) {
  ------------------
  |  Branch (1467:12): [True: 656, False: 42]
  ------------------
 1468|    656|            entries[i].function = NULL;
 1469|    656|            ptr += mt->memSize;
 1470|    656|        } else {
 1471|     42|            entries[i].function = (decodeXmlSignature)Array_decodeXml;
 1472|     42|            ptr += sizeof(size_t) + sizeof(void*);
 1473|     42|        }
 1474|    698|    }
 1475|       |
 1476|    228|    ret = decodeXmlFields(ctx, entries, membersSize);
 1477|       |
 1478|    228|    if(ctx->depth == 0)
  ------------------
  |  Branch (1478:8): [True: 0, False: 228]
  ------------------
 1479|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 1480|    228|    ctx->depth--;
 1481|    228|    return ret;
 1482|    228|}

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

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

fuzz_xml_decode_encode.cc:_ZL15UA_Variant_initP10UA_Variant:
  239|  7.54k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_xml_decode_encode.cc:_ZL16UA_Variant_clearP10UA_Variant:
  239|  2.52k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_xml_decode_encode.cc:_ZL19UA_ByteString_clearP9UA_String:
  239|  2.37k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_ByteString_init:
  239|  2.47k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_ExtensionObject_init:
  239|     97|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_clear:
  239|    121|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_copy:
  239|     94|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_init:
  239|     24|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_equal:
  239|  8.09k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl

