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

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

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

parseUInt64:
   30|  1.75k|parseUInt64(const char *str, size_t size, uint64_t *result) {
   31|  1.75k|    size_t i = 0;
   32|  1.75k|    uint64_t n = 0, prev = 0;
   33|       |
   34|       |    /* Hex */
   35|  1.75k|    if(size > 2 && str[0] == '0' && (str[1] | 32) == 'x') {
  ------------------
  |  Branch (35:8): [True: 1.60k, False: 154]
  |  Branch (35:20): [True: 283, False: 1.31k]
  |  Branch (35:37): [True: 144, False: 139]
  ------------------
   36|    144|        i = 2;
   37|  2.00k|        for(; i < size; i++) {
  ------------------
  |  Branch (37:15): [True: 1.88k, False: 114]
  ------------------
   38|  1.88k|            uint8_t c = (uint8_t)str[i] | 32;
   39|  1.88k|            if(c >= '0' && c <= '9')
  ------------------
  |  Branch (39:16): [True: 1.88k, False: 8]
  |  Branch (39:28): [True: 1.35k, False: 524]
  ------------------
   40|  1.35k|                c = (uint8_t)(c - '0');
   41|    532|            else if(c >= 'a' && c <='f')
  ------------------
  |  Branch (41:21): [True: 522, False: 10]
  |  Branch (41:33): [True: 511, False: 11]
  ------------------
   42|    511|                c = (uint8_t)(c - 'a' + 10);
   43|     21|            else if(c >= 'A' && c <='F')
  ------------------
  |  Branch (43:21): [True: 12, False: 9]
  |  Branch (43:33): [True: 0, False: 12]
  ------------------
   44|      0|                c = (uint8_t)(c - 'A' + 10);
   45|     21|            else
   46|     21|                break;
   47|  1.86k|            n = (n << 4) | (c & 0xF);
   48|  1.86k|            if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (48:16): [True: 9, False: 1.85k]
  ------------------
   49|      9|                return 0;
   50|  1.85k|            prev = n;
   51|  1.85k|        }
   52|    135|        *result = n;
   53|    135|        return (i > 2) ? i : 0; /* 2 -> No digit was parsed */
  ------------------
  |  Branch (53:16): [True: 132, False: 3]
  ------------------
   54|    144|    }
   55|       |
   56|       |    /* Decimal */
   57|  25.3k|    for(; i < size; i++) {
  ------------------
  |  Branch (57:11): [True: 24.2k, False: 1.09k]
  ------------------
   58|  24.2k|        if(str[i] < '0' || str[i] > '9')
  ------------------
  |  Branch (58:12): [True: 448, False: 23.7k]
  |  Branch (58:28): [True: 65, False: 23.7k]
  ------------------
   59|    513|            break;
   60|       |        /* Fast multiplication: n*10 == (n*8) + (n*2) */
   61|  23.7k|        n = (n << 3) + (n << 1) + (uint8_t)(str[i] - '0');
   62|  23.7k|        if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (62:12): [True: 2, False: 23.7k]
  ------------------
   63|      2|            return 0;
   64|  23.7k|        prev = n;
   65|  23.7k|    }
   66|  1.60k|    *result = n;
   67|  1.60k|    return i;
   68|  1.61k|}
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: 518, False: 674]
  |  Branch (75:23): [True: 6, False: 668]
  ------------------
   76|    524|        neg = (*str == '-');
   77|    524|        i++;
   78|    524|    }
   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: 78, False: 1.11k]
  ------------------
   84|     78|        return 0;
   85|       |
   86|       |    /* Check for overflow, adjust and return */
   87|  1.11k|    if(!neg) {
  ------------------
  |  Branch (87:8): [True: 613, False: 501]
  ------------------
   88|    613|        if(n > 9223372036854775807UL)
  ------------------
  |  Branch (88:12): [True: 67, False: 546]
  ------------------
   89|     67|            return 0;
   90|    546|        *result = (int64_t)n;
   91|    546|    } else {
   92|    501|        if(n > 9223372036854775808UL)
  ------------------
  |  Branch (92:12): [True: 21, False: 480]
  ------------------
   93|     21|            return 0;
   94|    480|        *result = -(int64_t)n;
   95|    480|    }
   96|  1.02k|    return len + i;
   97|  1.11k|}
parseDouble:
   99|  1.23k|size_t parseDouble(const char *str, size_t size, double *result) {
  100|  1.23k|    char buf[2000];
  101|  1.23k|    if(size >= 2000)
  ------------------
  |  Branch (101:8): [True: 0, False: 1.23k]
  ------------------
  102|      0|        return 0;
  103|  1.23k|    memcpy(buf, str, size);
  104|  1.23k|    buf[size] = 0;
  105|  1.23k|    errno = 0;
  106|  1.23k|    char *endptr;
  107|  1.23k|    *result = strtod(buf, &endptr);
  108|  1.23k|    if(errno != 0 && errno != ERANGE)
  ------------------
  |  Branch (108:8): [True: 304, False: 933]
  |  Branch (108:22): [True: 0, False: 304]
  ------------------
  109|      0|        return 0;
  110|  1.23k|    return (uintptr_t)endptr - (uintptr_t)buf;
  111|  1.23k|}

yxml_init:
  301|  7.99k|void yxml_init(yxml_t *x, void *stack, size_t stacksize) {
  302|  7.99k|	memset(x, 0, sizeof(*x));
  303|  7.99k|	x->line = 1;
  304|  7.99k|	x->stack = (unsigned char*)stack;
  305|  7.99k|	x->stacksize = stacksize;
  306|  7.99k|	*x->stack = 0;
  307|  7.99k|	x->elem = x->pi = x->attr = (char *)x->stack;
  308|  7.99k|	x->state = YXMLS_init;
  309|  7.99k|}
yxml_parse:
  311|   126M|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|   126M|	unsigned ch = (unsigned)(_ch+256) & 0xff;
  315|   126M|	if(!ch)
  ------------------
  |  Branch (315:5): [True: 4, False: 126M]
  ------------------
  316|      4|		return YXML_ESYN;
  317|   126M|	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|   126M|	if(x->ignore == ch) {
  ------------------
  |  Branch (323:5): [True: 1.85k, False: 126M]
  ------------------
  324|  1.85k|		x->ignore = 0;
  325|  1.85k|		return YXML_OK;
  326|  1.85k|	}
  327|   126M|	x->ignore = (ch == 0xd) * 0xa;
  328|   126M|	if(ch == 0xa || ch == 0xd) {
  ------------------
  |  Branch (328:5): [True: 12.0k, False: 126M]
  |  Branch (328:18): [True: 4.15M, False: 122M]
  ------------------
  329|  4.16M|		ch = 0xa;
  330|  4.16M|		x->line++;
  331|  4.16M|		x->byte = 0;
  332|  4.16M|	}
  333|   126M|	x->byte++;
  334|       |
  335|   126M|	switch((yxml_state_t)x->state) {
  ------------------
  |  Branch (335:9): [True: 126M, False: 0]
  ------------------
  336|  12.2k|	case YXMLS_string:
  ------------------
  |  Branch (336:2): [True: 12.2k, False: 126M]
  ------------------
  337|  12.2k|		if(ch == *x->string) {
  ------------------
  |  Branch (337:6): [True: 12.2k, False: 11]
  ------------------
  338|  12.2k|			x->string++;
  339|  12.2k|			if(!*x->string)
  ------------------
  |  Branch (339:7): [True: 2.30k, False: 9.98k]
  ------------------
  340|  2.30k|				x->state = x->nextstate;
  341|  12.2k|			return YXML_OK;
  342|  12.2k|		}
  343|     11|		break;
  344|  38.0M|	case YXMLS_attr0:
  ------------------
  |  Branch (344:2): [True: 38.0M, False: 88.1M]
  ------------------
  345|  38.0M|		if(yxml_isName(ch))
  ------------------
  |  |  107|  38.0M|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|  76.1M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  76.1M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 2.86M, False: 35.2M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 603, False: 35.2M]
  |  |  |  |  |  Branch (106:61): [True: 262, False: 35.2M]
  |  |  |  |  |  Branch (106:73): [True: 31.2M, False: 4.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|  42.1M|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 57.2k, False: 3.97M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 5.44k, False: 3.96M]
  |  |  |  Branch (107:77): [True: 1.43k, False: 3.96M]
  |  |  ------------------
  ------------------
  346|  34.1M|			return yxml_attrname(x, ch);
  347|  3.96M|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  3.96M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 2.84M, False: 1.12M]
  |  |  |  Branch (101:36): [True: 293, False: 1.12M]
  |  |  |  Branch (101:49): [True: 776, False: 1.12M]
  |  |  ------------------
  ------------------
  348|  2.84M|			x->state = YXMLS_attr1;
  349|  2.84M|			return yxml_attrnameend(x, ch);
  350|  2.84M|		}
  351|  1.12M|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (351:6): [True: 1.12M, False: 25]
  ------------------
  352|  1.12M|			x->state = YXMLS_attr2;
  353|  1.12M|			return yxml_attrnameend(x, ch);
  354|  1.12M|		}
  355|     25|		break;
  356|  2.84M|	case YXMLS_attr1:
  ------------------
  |  Branch (356:2): [True: 2.84M, False: 123M]
  ------------------
  357|  2.84M|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  2.84M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 219, False: 2.84M]
  |  |  |  Branch (101:36): [True: 194, False: 2.84M]
  |  |  |  Branch (101:49): [True: 194, False: 2.84M]
  |  |  ------------------
  ------------------
  358|    607|			return YXML_OK;
  359|  2.84M|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (359:6): [True: 2.84M, False: 14]
  ------------------
  360|  2.84M|			x->state = YXMLS_attr2;
  361|  2.84M|			return YXML_OK;
  362|  2.84M|		}
  363|     14|		break;
  364|  3.96M|	case YXMLS_attr2:
  ------------------
  |  Branch (364:2): [True: 3.96M, False: 122M]
  ------------------
  365|  3.96M|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  3.96M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 250, False: 3.96M]
  |  |  |  Branch (101:36): [True: 219, False: 3.96M]
  |  |  |  Branch (101:49): [True: 223, False: 3.96M]
  |  |  ------------------
  ------------------
  366|    692|			return YXML_OK;
  367|  3.96M|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (367:6): [True: 1.11M, False: 2.84M]
  |  Branch (367:35): [True: 2.84M, False: 18]
  ------------------
  368|  3.96M|			x->state = YXMLS_attr3;
  369|  3.96M|			x->quote = ch;
  370|  3.96M|			return YXML_OK;
  371|  3.96M|		}
  372|     18|		break;
  373|  4.38M|	case YXMLS_attr3:
  ------------------
  |  Branch (373:2): [True: 4.38M, False: 121M]
  ------------------
  374|  4.38M|		if(yxml_isAttValue(ch))
  ------------------
  |  |  109|  4.38M|#define yxml_isAttValue(c) (yxml_isChar(c) && c != x->quote && c != '<' && c != '&')
  |  |  ------------------
  |  |  |  |   99|  8.76M|#define yxml_isChar(c) 1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:24): [True: 4.38M, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (109:47): [True: 420k, False: 3.96M]
  |  |  |  Branch (109:64): [True: 420k, False: 1]
  |  |  |  Branch (109:76): [True: 419k, False: 803]
  |  |  ------------------
  ------------------
  375|   419k|			return yxml_dataattr(x, ch);
  376|  3.96M|		if(ch == (unsigned char)'&') {
  ------------------
  |  Branch (376:6): [True: 803, False: 3.96M]
  ------------------
  377|    803|			x->state = YXMLS_attr4;
  378|    803|			return yxml_refstart(x, ch);
  379|    803|		}
  380|  3.96M|		if(x->quote == ch) {
  ------------------
  |  Branch (380:6): [True: 3.96M, False: 1]
  ------------------
  381|  3.96M|			x->state = YXMLS_elem2;
  382|  3.96M|			return yxml_attrvalend(x, ch);
  383|  3.96M|		}
  384|      1|		break;
  385|  3.23k|	case YXMLS_attr4:
  ------------------
  |  Branch (385:2): [True: 3.23k, False: 126M]
  ------------------
  386|  3.23k|		if(yxml_isRef(ch))
  ------------------
  |  |  113|  3.23k|#define yxml_isRef(c) (yxml_isNum(c) || yxml_isAlpha(c) || c == '#')
  |  |  ------------------
  |  |  |  |  103|  6.47k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 742, False: 2.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isRef(c) (yxml_isNum(c) || yxml_isAlpha(c) || c == '#')
  |  |  ------------------
  |  |  |  |  102|  5.72k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 1.22k, False: 1.26k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (113:60): [True: 504, False: 763]
  |  |  ------------------
  ------------------
  387|  2.47k|			return yxml_ref(x, ch);
  388|    763|		if(ch == (unsigned char)'\x3b') {
  ------------------
  |  Branch (388:6): [True: 750, False: 13]
  ------------------
  389|    750|			x->state = YXMLS_attr3;
  390|    750|			return yxml_refattrval(x, ch);
  391|    750|		}
  392|     13|		break;
  393|  4.93k|	case YXMLS_cd0:
  ------------------
  |  Branch (393:2): [True: 4.93k, False: 126M]
  ------------------
  394|  4.93k|		if(ch == (unsigned char)']') {
  ------------------
  |  Branch (394:6): [True: 891, False: 4.04k]
  ------------------
  395|    891|			x->state = YXMLS_cd1;
  396|    891|			return YXML_OK;
  397|    891|		}
  398|  4.04k|		if(yxml_isChar(ch))
  ------------------
  |  |   99|  4.04k|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 4.04k, Folded]
  |  |  ------------------
  ------------------
  399|  4.04k|			return yxml_datacontent(x, ch);
  400|      0|		break;
  401|    885|	case YXMLS_cd1:
  ------------------
  |  Branch (401:2): [True: 885, False: 126M]
  ------------------
  402|    885|		if(ch == (unsigned char)']') {
  ------------------
  |  Branch (402:6): [True: 635, False: 250]
  ------------------
  403|    635|			x->state = YXMLS_cd2;
  404|    635|			return YXML_OK;
  405|    635|		}
  406|    250|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    250|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 250, Folded]
  |  |  ------------------
  ------------------
  407|    250|			x->state = YXMLS_cd0;
  408|    250|			return yxml_datacd1(x, ch);
  409|    250|		}
  410|      0|		break;
  411|    959|	case YXMLS_cd2:
  ------------------
  |  Branch (411:2): [True: 959, False: 126M]
  ------------------
  412|    959|		if(ch == (unsigned char)']')
  ------------------
  |  Branch (412:6): [True: 338, False: 621]
  ------------------
  413|    338|			return yxml_datacontent(x, ch);
  414|    621|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (414:6): [True: 291, False: 330]
  ------------------
  415|    291|			x->state = YXMLS_misc2;
  416|    291|			return YXML_OK;
  417|    291|		}
  418|    330|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    330|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 330, Folded]
  |  |  ------------------
  ------------------
  419|    330|			x->state = YXMLS_cd0;
  420|    330|			return yxml_datacd2(x, ch);
  421|    330|		}
  422|      0|		break;
  423|    217|	case YXMLS_comment0:
  ------------------
  |  Branch (423:2): [True: 217, False: 126M]
  ------------------
  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.15k|	case YXMLS_comment1:
  ------------------
  |  Branch (429:2): [True: 1.15k, False: 126M]
  ------------------
  430|  1.15k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (430:6): [True: 1.14k, False: 10]
  ------------------
  431|  1.14k|			x->state = YXMLS_comment2;
  432|  1.14k|			return YXML_OK;
  433|  1.14k|		}
  434|     10|		break;
  435|  1.80k|	case YXMLS_comment2:
  ------------------
  |  Branch (435:2): [True: 1.80k, False: 126M]
  ------------------
  436|  1.80k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (436:6): [True: 1.49k, False: 315]
  ------------------
  437|  1.49k|			x->state = YXMLS_comment3;
  438|  1.49k|			return YXML_OK;
  439|  1.49k|		}
  440|    315|		if(yxml_isChar(ch))
  ------------------
  |  |   99|    315|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 315, Folded]
  |  |  ------------------
  ------------------
  441|    315|			return YXML_OK;
  442|      0|		break;
  443|  1.48k|	case YXMLS_comment3:
  ------------------
  |  Branch (443:2): [True: 1.48k, False: 126M]
  ------------------
  444|  1.48k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (444:6): [True: 1.09k, False: 389]
  ------------------
  445|  1.09k|			x->state = YXMLS_comment4;
  446|  1.09k|			return YXML_OK;
  447|  1.09k|		}
  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.08k|	case YXMLS_comment4:
  ------------------
  |  Branch (453:2): [True: 1.08k, False: 126M]
  ------------------
  454|  1.08k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (454:6): [True: 1.07k, False: 10]
  ------------------
  455|  1.07k|			x->state = x->nextstate;
  456|  1.07k|			return YXML_OK;
  457|  1.07k|		}
  458|     10|		break;
  459|  1.89k|	case YXMLS_dt0:
  ------------------
  |  Branch (459:2): [True: 1.89k, False: 126M]
  ------------------
  460|  1.89k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (460:6): [True: 314, False: 1.58k]
  ------------------
  461|    314|			x->state = YXMLS_misc1;
  462|    314|			return YXML_OK;
  463|    314|		}
  464|  1.58k|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (464:6): [True: 268, False: 1.31k]
  |  Branch (464:35): [True: 330, False: 982]
  ------------------
  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|    982|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (470:6): [True: 762, False: 220]
  ------------------
  471|    762|			x->state = YXMLS_dt2;
  472|    762|			return YXML_OK;
  473|    762|		}
  474|    220|		if(yxml_isChar(ch))
  ------------------
  |  |   99|    220|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 220, Folded]
  |  |  ------------------
  ------------------
  475|    220|			return YXML_OK;
  476|      0|		break;
  477|  1.14k|	case YXMLS_dt1:
  ------------------
  |  Branch (477:2): [True: 1.14k, False: 126M]
  ------------------
  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|    756|	case YXMLS_dt2:
  ------------------
  |  Branch (485:2): [True: 756, False: 126M]
  ------------------
  486|    756|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (486:6): [True: 194, False: 562]
  ------------------
  487|    194|			x->state = YXMLS_pi0;
  488|    194|			x->nextstate = YXMLS_dt0;
  489|    194|			return YXML_OK;
  490|    194|		}
  491|    562|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (491:6): [True: 559, False: 3]
  ------------------
  492|    559|			x->state = YXMLS_dt3;
  493|    559|			return YXML_OK;
  494|    559|		}
  495|      3|		break;
  496|    553|	case YXMLS_dt3:
  ------------------
  |  Branch (496:2): [True: 553, False: 126M]
  ------------------
  497|    553|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (497:6): [True: 194, False: 359]
  ------------------
  498|    194|			x->state = YXMLS_comment1;
  499|    194|			x->nextstate = YXMLS_dt0;
  500|    194|			return YXML_OK;
  501|    194|		}
  502|    359|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    359|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 359, Folded]
  |  |  ------------------
  ------------------
  503|    359|			x->state = YXMLS_dt4;
  504|    359|			return YXML_OK;
  505|    359|		}
  506|      0|		break;
  507|    903|	case YXMLS_dt4:
  ------------------
  |  Branch (507:2): [True: 903, False: 126M]
  ------------------
  508|    903|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (508:6): [True: 194, False: 709]
  |  Branch (508:35): [True: 194, False: 515]
  ------------------
  509|    388|			x->state = YXMLS_dt1;
  510|    388|			x->quote = ch;
  511|    388|			x->nextstate = YXMLS_dt4;
  512|    388|			return YXML_OK;
  513|    388|		}
  514|    515|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (514:6): [True: 311, False: 204]
  ------------------
  515|    311|			x->state = YXMLS_dt0;
  516|    311|			return YXML_OK;
  517|    311|		}
  518|    204|		if(yxml_isChar(ch))
  ------------------
  |  |   99|    204|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 204, Folded]
  |  |  ------------------
  ------------------
  519|    204|			return YXML_OK;
  520|      0|		break;
  521|  11.0M|	case YXMLS_elem0:
  ------------------
  |  Branch (521:2): [True: 11.0M, False: 115M]
  ------------------
  522|  11.0M|		if(yxml_isName(ch))
  ------------------
  |  |  107|  11.0M|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|  22.1M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  22.1M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 347k, False: 10.7M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 633, False: 10.7M]
  |  |  |  |  |  Branch (106:61): [True: 2.31k, False: 10.7M]
  |  |  |  |  |  Branch (106:73): [True: 139k, False: 10.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|  21.6M|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 8.90k, False: 10.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 681, False: 10.5M]
  |  |  |  Branch (107:77): [True: 1.65k, False: 10.5M]
  |  |  ------------------
  ------------------
  523|   501k|			return yxml_elemname(x, ch);
  524|  10.5M|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  10.5M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 824, False: 10.5M]
  |  |  |  Branch (101:36): [True: 423, False: 10.5M]
  |  |  |  Branch (101:49): [True: 1.66k, False: 10.5M]
  |  |  ------------------
  ------------------
  525|  2.91k|			x->state = YXMLS_elem1;
  526|  2.91k|			return yxml_elemnameend(x, ch);
  527|  2.91k|		}
  528|  10.5M|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (528:6): [True: 10.5M, False: 35.7k]
  ------------------
  529|  10.5M|			x->state = YXMLS_elem3;
  530|  10.5M|			return yxml_elemnameend(x, ch);
  531|  10.5M|		}
  532|  35.7k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (532:6): [True: 35.6k, False: 28]
  ------------------
  533|  35.6k|			x->state = YXMLS_misc2;
  534|  35.6k|			return yxml_elemnameend(x, ch);
  535|  35.6k|		}
  536|     28|		break;
  537|  3.96M|	case YXMLS_elem1:
  ------------------
  |  Branch (537:2): [True: 3.96M, False: 122M]
  ------------------
  538|  3.96M|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  3.96M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 2.12k, False: 3.96M]
  |  |  |  Branch (101:36): [True: 265, False: 3.96M]
  |  |  |  Branch (101:49): [True: 333, False: 3.96M]
  |  |  ------------------
  ------------------
  539|  2.71k|			return YXML_OK;
  540|  3.96M|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (540:6): [True: 937, False: 3.96M]
  ------------------
  541|    937|			x->state = YXMLS_elem3;
  542|    937|			return YXML_OK;
  543|    937|		}
  544|  3.96M|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (544:6): [True: 426, False: 3.96M]
  ------------------
  545|    426|			x->state = YXMLS_misc2;
  546|    426|			return YXML_OK;
  547|    426|		}
  548|  3.96M|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  3.96M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  7.92M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 1.42M, False: 2.54M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 783, False: 2.53M]
  |  |  |  Branch (106:61): [True: 590, False: 2.53M]
  |  |  |  Branch (106:73): [True: 2.53M, False: 26]
  |  |  ------------------
  ------------------
  549|  3.96M|			x->state = YXMLS_attr0;
  550|  3.96M|			return yxml_attrstart(x, ch);
  551|  3.96M|		}
  552|     26|		break;
  553|  3.96M|	case YXMLS_elem2:
  ------------------
  |  Branch (553:2): [True: 3.96M, False: 122M]
  ------------------
  554|  3.96M|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  3.96M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 1.11M, False: 2.84M]
  |  |  |  Branch (101:36): [True: 558, False: 2.84M]
  |  |  |  Branch (101:49): [True: 2.84M, False: 997]
  |  |  ------------------
  ------------------
  555|  3.96M|			x->state = YXMLS_elem1;
  556|  3.96M|			return YXML_OK;
  557|  3.96M|		}
  558|    997|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (558:6): [True: 772, False: 225]
  ------------------
  559|    772|			x->state = YXMLS_elem3;
  560|    772|			return YXML_OK;
  561|    772|		}
  562|    225|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (562:6): [True: 212, False: 13]
  ------------------
  563|    212|			x->state = YXMLS_misc2;
  564|    212|			return YXML_OK;
  565|    212|		}
  566|     13|		break;
  567|  10.5M|	case YXMLS_elem3:
  ------------------
  |  Branch (567:2): [True: 10.5M, False: 115M]
  ------------------
  568|  10.5M|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (568:6): [True: 10.5M, False: 3]
  ------------------
  569|  10.5M|			x->state = YXMLS_misc2;
  570|  10.5M|			return yxml_selfclose(x, ch);
  571|  10.5M|		}
  572|      3|		break;
  573|    787|	case YXMLS_enc0:
  ------------------
  |  Branch (573:2): [True: 787, False: 126M]
  ------------------
  574|    787|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    787|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 593]
  |  |  |  Branch (101:36): [True: 194, False: 399]
  |  |  |  Branch (101:49): [True: 194, False: 205]
  |  |  ------------------
  ------------------
  575|    582|			return YXML_OK;
  576|    205|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (576:6): [True: 191, False: 14]
  ------------------
  577|    191|			x->state = YXMLS_enc1;
  578|    191|			return YXML_OK;
  579|    191|		}
  580|     14|		break;
  581|    748|	case YXMLS_enc1:
  ------------------
  |  Branch (581:2): [True: 748, False: 126M]
  ------------------
  582|    748|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    748|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 554]
  |  |  |  Branch (101:36): [True: 194, False: 360]
  |  |  |  Branch (101:49): [True: 194, False: 166]
  |  |  ------------------
  ------------------
  583|    582|			return YXML_OK;
  584|    166|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (584:6): [True: 32, False: 134]
  |  Branch (584:35): [True: 119, False: 15]
  ------------------
  585|    151|			x->state = YXMLS_enc2;
  586|    151|			x->quote = ch;
  587|    151|			return YXML_OK;
  588|    151|		}
  589|     15|		break;
  590|    149|	case YXMLS_enc2:
  ------------------
  |  Branch (590:2): [True: 149, False: 126M]
  ------------------
  591|    149|		if(yxml_isAlpha(ch)) {
  ------------------
  |  |  102|    149|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  ------------------
  |  |  |  Branch (102:25): [True: 141, False: 8]
  |  |  ------------------
  ------------------
  592|    141|			x->state = YXMLS_enc3;
  593|    141|			return YXML_OK;
  594|    141|		}
  595|      8|		break;
  596|  1.07k|	case YXMLS_enc3:
  ------------------
  |  Branch (596:2): [True: 1.07k, False: 126M]
  ------------------
  597|  1.07k|		if(yxml_isEncName(ch))
  ------------------
  |  |  105|  1.07k|#define yxml_isEncName(c) (yxml_isAlpha(c) || yxml_isNum(c) || c == '.' || c == '_' || c == '-')
  |  |  ------------------
  |  |  |  |  102|  2.15k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 201, False: 875]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isEncName(c) (yxml_isAlpha(c) || yxml_isNum(c) || c == '.' || c == '_' || c == '-')
  |  |  ------------------
  |  |  |  |  103|  1.95k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 198, False: 677]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:64): [True: 194, False: 483]
  |  |  |  Branch (105:76): [True: 194, False: 289]
  |  |  |  Branch (105:88): [True: 197, False: 92]
  |  |  ------------------
  ------------------
  598|    984|			return YXML_OK;
  599|     92|		if(x->quote == ch) {
  ------------------
  |  Branch (599:6): [True: 78, False: 14]
  ------------------
  600|     78|			x->state = YXMLS_xmldecl6;
  601|     78|			return YXML_OK;
  602|     78|		}
  603|     14|		break;
  604|  34.1k|	case YXMLS_etag0:
  ------------------
  |  Branch (604:2): [True: 34.1k, False: 126M]
  ------------------
  605|  34.1k|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  34.1k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  68.2k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 10.8k, False: 23.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 633, False: 22.6k]
  |  |  |  Branch (106:61): [True: 556, False: 22.1k]
  |  |  |  Branch (106:73): [True: 22.0k, False: 14]
  |  |  ------------------
  ------------------
  606|  34.0k|			x->state = YXMLS_etag1;
  607|  34.0k|			return yxml_elemclose(x, ch);
  608|  34.0k|		}
  609|     14|		break;
  610|  80.1k|	case YXMLS_etag1:
  ------------------
  |  Branch (610:2): [True: 80.1k, False: 126M]
  ------------------
  611|  80.1k|		if(yxml_isName(ch))
  ------------------
  |  |  107|  80.1k|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|   160k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|   160k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 41.2k, False: 38.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 211, False: 38.7k]
  |  |  |  |  |  Branch (106:61): [True: 466, False: 38.2k]
  |  |  |  |  |  Branch (106:73): [True: 337, False: 37.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|   118k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 3.55k, False: 34.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 194, False: 34.1k]
  |  |  |  Branch (107:77): [True: 194, False: 33.9k]
  |  |  ------------------
  ------------------
  612|  46.1k|			return yxml_elemclose(x, ch);
  613|  33.9k|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  33.9k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 257, False: 33.7k]
  |  |  |  Branch (101:36): [True: 213, False: 33.5k]
  |  |  |  Branch (101:49): [True: 427, False: 33.0k]
  |  |  ------------------
  ------------------
  614|    897|			x->state = YXMLS_etag2;
  615|    897|			return yxml_elemcloseend(x, ch);
  616|    897|		}
  617|  33.0k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (617:6): [True: 33.0k, False: 21]
  ------------------
  618|  33.0k|			x->state = YXMLS_misc2;
  619|  33.0k|			return yxml_elemcloseend(x, ch);
  620|  33.0k|		}
  621|     21|		break;
  622|  1.48k|	case YXMLS_etag2:
  ------------------
  |  Branch (622:2): [True: 1.48k, False: 126M]
  ------------------
  623|  1.48k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.48k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 195, False: 1.28k]
  |  |  |  Branch (101:36): [True: 194, False: 1.09k]
  |  |  |  Branch (101:49): [True: 246, False: 849]
  |  |  ------------------
  ------------------
  624|    635|			return YXML_OK;
  625|    849|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (625:6): [True: 835, False: 14]
  ------------------
  626|    835|			x->state = YXMLS_misc2;
  627|    835|			return YXML_OK;
  628|    835|		}
  629|     14|		break;
  630|  7.99k|	case YXMLS_init:
  ------------------
  |  Branch (630:2): [True: 7.99k, False: 126M]
  ------------------
  631|  7.99k|		if(ch == (unsigned char)'\xef') {
  ------------------
  |  Branch (631:6): [True: 17, False: 7.97k]
  ------------------
  632|     17|			x->state = YXMLS_string;
  633|     17|			x->nextstate = YXMLS_misc0;
  634|     17|			x->string = (unsigned char *)"\xbb\xbf";
  635|     17|			return YXML_OK;
  636|     17|		}
  637|  7.97k|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  7.97k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 23, False: 7.95k]
  |  |  |  Branch (101:36): [True: 31, False: 7.92k]
  |  |  |  Branch (101:49): [True: 44, False: 7.88k]
  |  |  ------------------
  ------------------
  638|     98|			x->state = YXMLS_misc0;
  639|     98|			return YXML_OK;
  640|     98|		}
  641|  7.88k|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (641:6): [True: 7.85k, False: 30]
  ------------------
  642|  7.85k|			x->state = YXMLS_le0;
  643|  7.85k|			return YXML_OK;
  644|  7.85k|		}
  645|     30|		break;
  646|  7.88k|	case YXMLS_le0:
  ------------------
  |  Branch (646:2): [True: 7.88k, False: 126M]
  ------------------
  647|  7.88k|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (647:6): [True: 293, False: 7.59k]
  ------------------
  648|    293|			x->state = YXMLS_lee1;
  649|    293|			return YXML_OK;
  650|    293|		}
  651|  7.59k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (651:6): [True: 1.32k, False: 6.26k]
  ------------------
  652|  1.32k|			x->state = YXMLS_leq0;
  653|  1.32k|			return YXML_OK;
  654|  1.32k|		}
  655|  6.26k|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  6.26k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  12.5k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 1.79k, False: 4.47k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 107, False: 4.36k]
  |  |  |  Branch (106:61): [True: 104, False: 4.26k]
  |  |  |  Branch (106:73): [True: 4.23k, False: 21]
  |  |  ------------------
  ------------------
  656|  6.24k|			x->state = YXMLS_elem0;
  657|  6.24k|			return yxml_elemstart(x, ch);
  658|  6.24k|		}
  659|     21|		break;
  660|  2.29k|	case YXMLS_le1:
  ------------------
  |  Branch (660:2): [True: 2.29k, False: 126M]
  ------------------
  661|  2.29k|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (661:6): [True: 733, False: 1.55k]
  ------------------
  662|    733|			x->state = YXMLS_lee1;
  663|    733|			return YXML_OK;
  664|    733|		}
  665|  1.55k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (665:6): [True: 1.32k, False: 230]
  ------------------
  666|  1.32k|			x->state = YXMLS_pi0;
  667|  1.32k|			x->nextstate = YXMLS_misc1;
  668|  1.32k|			return YXML_OK;
  669|  1.32k|		}
  670|    230|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|    230|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|    460|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 14, False: 216]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 4, False: 212]
  |  |  |  Branch (106:61): [True: 29, False: 183]
  |  |  |  Branch (106:73): [True: 167, False: 16]
  |  |  ------------------
  ------------------
  671|    214|			x->state = YXMLS_elem0;
  672|    214|			return yxml_elemstart(x, ch);
  673|    214|		}
  674|     16|		break;
  675|  10.6M|	case YXMLS_le2:
  ------------------
  |  Branch (675:2): [True: 10.6M, False: 115M]
  ------------------
  676|  10.6M|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (676:6): [True: 638, False: 10.6M]
  ------------------
  677|    638|			x->state = YXMLS_lee2;
  678|    638|			return YXML_OK;
  679|    638|		}
  680|  10.6M|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (680:6): [True: 1.36k, False: 10.6M]
  ------------------
  681|  1.36k|			x->state = YXMLS_pi0;
  682|  1.36k|			x->nextstate = YXMLS_misc2;
  683|  1.36k|			return YXML_OK;
  684|  1.36k|		}
  685|  10.6M|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (685:6): [True: 34.1k, False: 10.5M]
  ------------------
  686|  34.1k|			x->state = YXMLS_etag0;
  687|  34.1k|			return YXML_OK;
  688|  34.1k|		}
  689|  10.5M|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  10.5M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  21.1M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 32.4k, False: 10.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 1.07k, False: 10.5M]
  |  |  |  Branch (106:61): [True: 1.06k, False: 10.5M]
  |  |  |  Branch (106:73): [True: 10.5M, False: 24]
  |  |  ------------------
  ------------------
  690|  10.5M|			x->state = YXMLS_elem0;
  691|  10.5M|			return yxml_elemstart(x, ch);
  692|  10.5M|		}
  693|     24|		break;
  694|    668|	case YXMLS_le3:
  ------------------
  |  Branch (694:2): [True: 668, False: 126M]
  ------------------
  695|    668|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (695:6): [True: 222, False: 446]
  ------------------
  696|    222|			x->state = YXMLS_comment0;
  697|    222|			x->nextstate = YXMLS_misc3;
  698|    222|			return YXML_OK;
  699|    222|		}
  700|    446|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (700:6): [True: 430, False: 16]
  ------------------
  701|    430|			x->state = YXMLS_pi0;
  702|    430|			x->nextstate = YXMLS_misc3;
  703|    430|			return YXML_OK;
  704|    430|		}
  705|     16|		break;
  706|  1.01k|	case YXMLS_lee1:
  ------------------
  |  Branch (706:2): [True: 1.01k, False: 126M]
  ------------------
  707|  1.01k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (707:6): [True: 518, False: 500]
  ------------------
  708|    518|			x->state = YXMLS_comment1;
  709|    518|			x->nextstate = YXMLS_misc1;
  710|    518|			return YXML_OK;
  711|    518|		}
  712|    500|		if(ch == (unsigned char)'D') {
  ------------------
  |  Branch (712:6): [True: 485, False: 15]
  ------------------
  713|    485|			x->state = YXMLS_string;
  714|    485|			x->nextstate = YXMLS_dt0;
  715|    485|			x->string = (unsigned char *)"OCTYPE";
  716|    485|			return YXML_OK;
  717|    485|		}
  718|     15|		break;
  719|    633|	case YXMLS_lee2:
  ------------------
  |  Branch (719:2): [True: 633, False: 126M]
  ------------------
  720|    633|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (720:6): [True: 263, False: 370]
  ------------------
  721|    263|			x->state = YXMLS_comment1;
  722|    263|			x->nextstate = YXMLS_misc2;
  723|    263|			return YXML_OK;
  724|    263|		}
  725|    370|		if(ch == (unsigned char)'[') {
  ------------------
  |  Branch (725:6): [True: 359, False: 11]
  ------------------
  726|    359|			x->state = YXMLS_string;
  727|    359|			x->nextstate = YXMLS_cd0;
  728|    359|			x->string = (unsigned char *)"CDATA[";
  729|    359|			return YXML_OK;
  730|    359|		}
  731|     11|		break;
  732|  1.32k|	case YXMLS_leq0:
  ------------------
  |  Branch (732:2): [True: 1.32k, False: 126M]
  ------------------
  733|  1.32k|		if(ch == (unsigned char)'x') {
  ------------------
  |  Branch (733:6): [True: 969, False: 351]
  ------------------
  734|    969|			x->state = YXMLS_xmldecl0;
  735|    969|			x->nextstate = YXMLS_misc1;
  736|    969|			return yxml_pistart(x, ch);
  737|    969|		}
  738|    351|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|    351|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|    702|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 173, False: 178]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 19, False: 159]
  |  |  |  Branch (106:61): [True: 22, False: 137]
  |  |  |  Branch (106:73): [True: 119, False: 18]
  |  |  ------------------
  ------------------
  739|    333|			x->state = YXMLS_pi1;
  740|    333|			x->nextstate = YXMLS_misc1;
  741|    333|			return yxml_pistart(x, ch);
  742|    333|		}
  743|     18|		break;
  744|  1.21k|	case YXMLS_misc0:
  ------------------
  |  Branch (744:2): [True: 1.21k, False: 126M]
  ------------------
  745|  1.21k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.21k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 224, False: 995]
  |  |  |  Branch (101:36): [True: 194, False: 801]
  |  |  |  Branch (101:49): [True: 746, False: 55]
  |  |  ------------------
  ------------------
  746|  1.16k|			return YXML_OK;
  747|     55|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (747:6): [True: 34, False: 21]
  ------------------
  748|     34|			x->state = YXMLS_le0;
  749|     34|			return YXML_OK;
  750|     34|		}
  751|     21|		break;
  752|  2.92k|	case YXMLS_misc1:
  ------------------
  |  Branch (752:2): [True: 2.92k, False: 126M]
  ------------------
  753|  2.92k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  2.92k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 203, False: 2.71k]
  |  |  |  Branch (101:36): [True: 194, False: 2.52k]
  |  |  |  Branch (101:49): [True: 206, False: 2.31k]
  |  |  ------------------
  ------------------
  754|    603|			return YXML_OK;
  755|  2.31k|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (755:6): [True: 2.30k, False: 17]
  ------------------
  756|  2.30k|			x->state = YXMLS_le1;
  757|  2.30k|			return YXML_OK;
  758|  2.30k|		}
  759|     17|		break;
  760|  36.5M|	case YXMLS_misc2:
  ------------------
  |  Branch (760:2): [True: 36.5M, False: 89.7M]
  ------------------
  761|  36.5M|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (761:6): [True: 10.6M, False: 25.8M]
  ------------------
  762|  10.6M|			x->state = YXMLS_le2;
  763|  10.6M|			return YXML_OK;
  764|  10.6M|		}
  765|  25.8M|		if(ch == (unsigned char)'&') {
  ------------------
  |  Branch (765:6): [True: 2.52k, False: 25.8M]
  ------------------
  766|  2.52k|			x->state = YXMLS_misc2a;
  767|  2.52k|			return yxml_refstart(x, ch);
  768|  2.52k|		}
  769|  25.8M|		if(yxml_isChar(ch))
  ------------------
  |  |   99|  25.8M|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 25.8M, Folded]
  |  |  ------------------
  ------------------
  770|  25.8M|			return yxml_datacontent(x, ch);
  771|      0|		break;
  772|  11.3k|	case YXMLS_misc2a:
  ------------------
  |  Branch (772:2): [True: 11.3k, False: 126M]
  ------------------
  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.04k, False: 8.31k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #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.27k, False: 4.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (113:60): [True: 1.56k, False: 2.48k]
  |  |  ------------------
  ------------------
  774|  8.88k|			return yxml_ref(x, ch);
  775|  2.48k|		if(ch == (unsigned char)'\x3b') {
  ------------------
  |  Branch (775:6): [True: 2.46k, False: 20]
  ------------------
  776|  2.46k|			x->state = YXMLS_misc2;
  777|  2.46k|			return yxml_refcontent(x, ch);
  778|  2.46k|		}
  779|     20|		break;
  780|  1.27k|	case YXMLS_misc3:
  ------------------
  |  Branch (780:2): [True: 1.27k, False: 126M]
  ------------------
  781|  1.27k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.27k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 1.08k]
  |  |  |  Branch (101:36): [True: 195, False: 888]
  |  |  |  Branch (101:49): [True: 196, False: 692]
  |  |  ------------------
  ------------------
  782|    585|			return YXML_OK;
  783|    692|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (783:6): [True: 674, False: 18]
  ------------------
  784|    674|			x->state = YXMLS_le3;
  785|    674|			return YXML_OK;
  786|    674|		}
  787|     18|		break;
  788|  3.29k|	case YXMLS_pi0:
  ------------------
  |  Branch (788:2): [True: 3.29k, False: 126M]
  ------------------
  789|  3.29k|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  3.29k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  6.58k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 1.72k, False: 1.56k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 731, False: 834]
  |  |  |  Branch (106:61): [True: 286, False: 548]
  |  |  |  Branch (106:73): [True: 530, False: 18]
  |  |  ------------------
  ------------------
  790|  3.27k|			x->state = YXMLS_pi1;
  791|  3.27k|			return yxml_pistart(x, ch);
  792|  3.27k|		}
  793|     18|		break;
  794|  7.95k|	case YXMLS_pi1:
  ------------------
  |  Branch (794:2): [True: 7.95k, False: 126M]
  ------------------
  795|  7.95k|		if(yxml_isName(ch))
  ------------------
  |  |  107|  7.95k|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|  15.9k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  15.9k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 1.88k, False: 6.07k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 197, False: 5.87k]
  |  |  |  |  |  Branch (106:61): [True: 242, False: 5.63k]
  |  |  |  |  |  Branch (106:73): [True: 1.19k, False: 4.44k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|  12.3k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 311, False: 4.12k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 195, False: 3.93k]
  |  |  |  Branch (107:77): [True: 281, False: 3.65k]
  |  |  ------------------
  ------------------
  796|  4.30k|			return yxml_piname(x, ch);
  797|  3.65k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (797:6): [True: 2.37k, False: 1.28k]
  ------------------
  798|  2.37k|			x->state = YXMLS_pi4;
  799|  2.37k|			return yxml_pinameend(x, ch);
  800|  2.37k|		}
  801|  1.28k|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  1.28k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 399, False: 883]
  |  |  |  Branch (101:36): [True: 283, False: 600]
  |  |  |  Branch (101:49): [True: 579, False: 21]
  |  |  ------------------
  ------------------
  802|  1.26k|			x->state = YXMLS_pi2;
  803|  1.26k|			return yxml_pinameend(x, ch);
  804|  1.26k|		}
  805|     21|		break;
  806|  10.0k|	case YXMLS_pi2:
  ------------------
  |  Branch (806:2): [True: 10.0k, False: 126M]
  ------------------
  807|  10.0k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (807:6): [True: 1.64k, False: 8.37k]
  ------------------
  808|  1.64k|			x->state = YXMLS_pi3;
  809|  1.64k|			return YXML_OK;
  810|  1.64k|		}
  811|  8.37k|		if(yxml_isChar(ch))
  ------------------
  |  |   99|  8.37k|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 8.37k, Folded]
  |  |  ------------------
  ------------------
  812|  8.37k|			return yxml_datapi1(x, ch);
  813|      0|		break;
  814|  1.63k|	case YXMLS_pi3:
  ------------------
  |  Branch (814:2): [True: 1.63k, False: 126M]
  ------------------
  815|  1.63k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (815:6): [True: 1.18k, False: 454]
  ------------------
  816|  1.18k|			x->state = x->nextstate;
  817|  1.18k|			return yxml_pivalend(x, ch);
  818|  1.18k|		}
  819|    454|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    454|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 454, Folded]
  |  |  ------------------
  ------------------
  820|    454|			x->state = YXMLS_pi2;
  821|    454|			return yxml_datapi2(x, ch);
  822|    454|		}
  823|      0|		break;
  824|  2.33k|	case YXMLS_pi4:
  ------------------
  |  Branch (824:2): [True: 2.33k, False: 126M]
  ------------------
  825|  2.33k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (825:6): [True: 2.32k, False: 13]
  ------------------
  826|  2.32k|			x->state = x->nextstate;
  827|  2.32k|			return yxml_pivalend(x, ch);
  828|  2.32k|		}
  829|     13|		break;
  830|    698|	case YXMLS_std0:
  ------------------
  |  Branch (830:2): [True: 698, False: 126M]
  ------------------
  831|    698|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    698|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 504]
  |  |  |  Branch (101:36): [True: 194, False: 310]
  |  |  |  Branch (101:49): [True: 194, False: 116]
  |  |  ------------------
  ------------------
  832|    582|			return YXML_OK;
  833|    116|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (833:6): [True: 99, False: 17]
  ------------------
  834|     99|			x->state = YXMLS_std1;
  835|     99|			return YXML_OK;
  836|     99|		}
  837|     17|		break;
  838|    656|	case YXMLS_std1:
  ------------------
  |  Branch (838:2): [True: 656, False: 126M]
  ------------------
  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: 21, False: 53]
  |  Branch (841:35): [True: 41, False: 12]
  ------------------
  842|     62|			x->state = YXMLS_std2;
  843|     62|			x->quote = ch;
  844|     62|			return YXML_OK;
  845|     62|		}
  846|     12|		break;
  847|     60|	case YXMLS_std2:
  ------------------
  |  Branch (847:2): [True: 60, False: 126M]
  ------------------
  848|     60|		if(ch == (unsigned char)'y') {
  ------------------
  |  Branch (848:6): [True: 3, False: 57]
  ------------------
  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|     57|		if(ch == (unsigned char)'n') {
  ------------------
  |  Branch (854:6): [True: 46, False: 11]
  ------------------
  855|     46|			x->state = YXMLS_string;
  856|     46|			x->nextstate = YXMLS_std3;
  857|     46|			x->string = (unsigned char *)"o";
  858|     46|			return YXML_OK;
  859|     46|		}
  860|     11|		break;
  861|     46|	case YXMLS_std3:
  ------------------
  |  Branch (861:2): [True: 46, False: 126M]
  ------------------
  862|     46|		if(x->quote == ch) {
  ------------------
  |  Branch (862:6): [True: 45, False: 1]
  ------------------
  863|     45|			x->state = YXMLS_xmldecl8;
  864|     45|			return YXML_OK;
  865|     45|		}
  866|      1|		break;
  867|  1.12k|	case YXMLS_ver0:
  ------------------
  |  Branch (867:2): [True: 1.12k, False: 126M]
  ------------------
  868|  1.12k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.12k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 935]
  |  |  |  Branch (101:36): [True: 194, False: 741]
  |  |  |  Branch (101:49): [True: 194, False: 547]
  |  |  ------------------
  ------------------
  869|    582|			return YXML_OK;
  870|    547|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (870:6): [True: 537, False: 10]
  ------------------
  871|    537|			x->state = YXMLS_ver1;
  872|    537|			return YXML_OK;
  873|    537|		}
  874|     10|		break;
  875|  1.09k|	case YXMLS_ver1:
  ------------------
  |  Branch (875:2): [True: 1.09k, False: 126M]
  ------------------
  876|  1.09k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.09k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 196, False: 900]
  |  |  |  Branch (101:36): [True: 194, False: 706]
  |  |  |  Branch (101:49): [True: 194, False: 512]
  |  |  ------------------
  ------------------
  877|    584|			return YXML_OK;
  878|    512|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (878:6): [True: 6, False: 506]
  |  Branch (878:35): [True: 485, False: 21]
  ------------------
  879|    491|			x->state = YXMLS_string;
  880|    491|			x->quote = ch;
  881|    491|			x->nextstate = YXMLS_ver2;
  882|    491|			x->string = (unsigned char *)"1.";
  883|    491|			return YXML_OK;
  884|    491|		}
  885|     21|		break;
  886|    488|	case YXMLS_ver2:
  ------------------
  |  Branch (886:2): [True: 488, False: 126M]
  ------------------
  887|    488|		if(yxml_isNum(ch)) {
  ------------------
  |  |  103|    488|#define yxml_isNum(c) (c-'0' < 10)
  |  |  ------------------
  |  |  |  Branch (103:23): [True: 476, False: 12]
  |  |  ------------------
  ------------------
  888|    476|			x->state = YXMLS_ver3;
  889|    476|			return YXML_OK;
  890|    476|		}
  891|     12|		break;
  892|    662|	case YXMLS_ver3:
  ------------------
  |  Branch (892:2): [True: 662, False: 126M]
  ------------------
  893|    662|		if(yxml_isNum(ch))
  ------------------
  |  |  103|    662|#define yxml_isNum(c) (c-'0' < 10)
  |  |  ------------------
  |  |  |  Branch (103:23): [True: 200, False: 462]
  |  |  ------------------
  ------------------
  894|    200|			return YXML_OK;
  895|    462|		if(x->quote == ch) {
  ------------------
  |  Branch (895:6): [True: 450, False: 12]
  ------------------
  896|    450|			x->state = YXMLS_xmldecl4;
  897|    450|			return YXML_OK;
  898|    450|		}
  899|     12|		break;
  900|    968|	case YXMLS_xmldecl0:
  ------------------
  |  Branch (900:2): [True: 968, False: 126M]
  ------------------
  901|    968|		if(ch == (unsigned char)'m') {
  ------------------
  |  Branch (901:6): [True: 850, False: 118]
  ------------------
  902|    850|			x->state = YXMLS_xmldecl1;
  903|    850|			return yxml_piname(x, ch);
  904|    850|		}
  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: 5, False: 89]
  |  |  |  |  |  Branch (106:61): [True: 3, False: 86]
  |  |  |  |  |  Branch (106:73): [True: 14, False: 72]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|    190|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 5, False: 67]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 6, False: 61]
  |  |  |  Branch (107:77): [True: 3, False: 58]
  |  |  ------------------
  ------------------
  906|     60|			x->state = YXMLS_pi1;
  907|     60|			return yxml_piname(x, ch);
  908|     60|		}
  909|     58|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (909:6): [True: 19, False: 39]
  ------------------
  910|     19|			x->state = YXMLS_pi4;
  911|     19|			return yxml_pinameend(x, ch);
  912|     19|		}
  913|     39|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|     39|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 4, False: 35]
  |  |  |  Branch (101:36): [True: 7, False: 28]
  |  |  |  Branch (101:49): [True: 7, False: 21]
  |  |  ------------------
  ------------------
  914|     18|			x->state = YXMLS_pi2;
  915|     18|			return yxml_pinameend(x, ch);
  916|     18|		}
  917|     21|		break;
  918|    849|	case YXMLS_xmldecl1:
  ------------------
  |  Branch (918:2): [True: 849, False: 126M]
  ------------------
  919|    849|		if(ch == (unsigned char)'l') {
  ------------------
  |  Branch (919:6): [True: 758, False: 91]
  ------------------
  920|    758|			x->state = YXMLS_xmldecl2;
  921|    758|			return yxml_piname(x, ch);
  922|    758|		}
  923|     91|		if(yxml_isName(ch)) {
  ------------------
  |  |  107|     91|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|    182|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    182|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 17, False: 74]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 4, False: 70]
  |  |  |  |  |  Branch (106:61): [True: 3, False: 67]
  |  |  |  |  |  Branch (106:73): [True: 14, False: 53]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|    144|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 8, False: 45]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 3, False: 42]
  |  |  |  Branch (107:77): [True: 3, False: 39]
  |  |  ------------------
  ------------------
  924|     52|			x->state = YXMLS_pi1;
  925|     52|			return yxml_piname(x, ch);
  926|     52|		}
  927|     39|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (927:6): [True: 3, False: 36]
  ------------------
  928|      3|			x->state = YXMLS_pi4;
  929|      3|			return yxml_pinameend(x, ch);
  930|      3|		}
  931|     36|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|     36|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 3, False: 33]
  |  |  |  Branch (101:36): [True: 3, False: 30]
  |  |  |  Branch (101:49): [True: 4, False: 26]
  |  |  ------------------
  ------------------
  932|     10|			x->state = YXMLS_pi2;
  933|     10|			return yxml_pinameend(x, ch);
  934|     10|		}
  935|     26|		break;
  936|    757|	case YXMLS_xmldecl2:
  ------------------
  |  Branch (936:2): [True: 757, False: 126M]
  ------------------
  937|    757|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|    757|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 590, False: 167]
  |  |  |  Branch (101:36): [True: 8, False: 159]
  |  |  |  Branch (101:49): [True: 24, False: 135]
  |  |  ------------------
  ------------------
  938|    622|			x->state = YXMLS_xmldecl3;
  939|    622|			return yxml_piabort(x, ch);
  940|    622|		}
  941|    135|		if(yxml_isName(ch)) {
  ------------------
  |  |  107|    135|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|    270|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    270|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 11, False: 124]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 5, False: 119]
  |  |  |  |  |  Branch (106:61): [True: 4, False: 115]
  |  |  |  |  |  Branch (106:73): [True: 85, False: 30]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|    165|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 7, False: 23]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 3, False: 20]
  |  |  |  Branch (107:77): [True: 3, False: 17]
  |  |  ------------------
  ------------------
  942|    118|			x->state = YXMLS_pi1;
  943|    118|			return yxml_piname(x, ch);
  944|    118|		}
  945|     17|		break;
  946|  1.17k|	case YXMLS_xmldecl3:
  ------------------
  |  Branch (946:2): [True: 1.17k, False: 126M]
  ------------------
  947|  1.17k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.17k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 983]
  |  |  |  Branch (101:36): [True: 194, False: 789]
  |  |  |  Branch (101:49): [True: 194, False: 595]
  |  |  ------------------
  ------------------
  948|    582|			return YXML_OK;
  949|    595|		if(ch == (unsigned char)'v') {
  ------------------
  |  Branch (949:6): [True: 574, False: 21]
  ------------------
  950|    574|			x->state = YXMLS_string;
  951|    574|			x->nextstate = YXMLS_ver0;
  952|    574|			x->string = (unsigned char *)"ersion";
  953|    574|			return YXML_OK;
  954|    574|		}
  955|     21|		break;
  956|    449|	case YXMLS_xmldecl4:
  ------------------
  |  Branch (956:2): [True: 449, False: 126M]
  ------------------
  957|    449|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|    449|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 373, False: 76]
  |  |  |  Branch (101:36): [True: 8, False: 68]
  |  |  |  Branch (101:49): [True: 44, False: 24]
  |  |  ------------------
  ------------------
  958|    425|			x->state = YXMLS_xmldecl5;
  959|    425|			return YXML_OK;
  960|    425|		}
  961|     24|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (961:6): [True: 10, False: 14]
  ------------------
  962|     10|			x->state = YXMLS_xmldecl9;
  963|     10|			return YXML_OK;
  964|     10|		}
  965|     14|		break;
  966|    980|	case YXMLS_xmldecl5:
  ------------------
  |  Branch (966:2): [True: 980, False: 126M]
  ------------------
  967|    980|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    980|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 786]
  |  |  |  Branch (101:36): [True: 194, False: 592]
  |  |  |  Branch (101:49): [True: 194, False: 398]
  |  |  ------------------
  ------------------
  968|    582|			return YXML_OK;
  969|    398|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (969:6): [True: 7, False: 391]
  ------------------
  970|      7|			x->state = YXMLS_xmldecl9;
  971|      7|			return YXML_OK;
  972|      7|		}
  973|    391|		if(ch == (unsigned char)'e') {
  ------------------
  |  Branch (973:6): [True: 230, False: 161]
  ------------------
  974|    230|			x->state = YXMLS_string;
  975|    230|			x->nextstate = YXMLS_enc0;
  976|    230|			x->string = (unsigned char *)"ncoding";
  977|    230|			return YXML_OK;
  978|    230|		}
  979|    161|		if(ch == (unsigned char)'s') {
  ------------------
  |  Branch (979:6): [True: 137, False: 24]
  ------------------
  980|    137|			x->state = YXMLS_string;
  981|    137|			x->nextstate = YXMLS_std0;
  982|    137|			x->string = (unsigned char *)"tandalone";
  983|    137|			return YXML_OK;
  984|    137|		}
  985|     24|		break;
  986|     77|	case YXMLS_xmldecl6:
  ------------------
  |  Branch (986:2): [True: 77, False: 126M]
  ------------------
  987|     77|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|     77|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 29, False: 48]
  |  |  |  Branch (101:36): [True: 17, False: 31]
  |  |  |  Branch (101:49): [True: 18, False: 13]
  |  |  ------------------
  ------------------
  988|     64|			x->state = YXMLS_xmldecl7;
  989|     64|			return YXML_OK;
  990|     64|		}
  991|     13|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (991:6): [True: 5, False: 8]
  ------------------
  992|      5|			x->state = YXMLS_xmldecl9;
  993|      5|			return YXML_OK;
  994|      5|		}
  995|      8|		break;
  996|    623|	case YXMLS_xmldecl7:
  ------------------
  |  Branch (996:2): [True: 623, False: 126M]
  ------------------
  997|    623|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    623|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 429]
  |  |  |  Branch (101:36): [True: 194, False: 235]
  |  |  |  Branch (101:49): [True: 198, False: 37]
  |  |  ------------------
  ------------------
  998|    586|			return YXML_OK;
  999|     37|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (999:6): [True: 7, False: 30]
  ------------------
 1000|      7|			x->state = YXMLS_xmldecl9;
 1001|      7|			return YXML_OK;
 1002|      7|		}
 1003|     30|		if(ch == (unsigned char)'s') {
  ------------------
  |  Branch (1003:6): [True: 5, False: 25]
  ------------------
 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|     25|		break;
 1010|    604|	case YXMLS_xmldecl8:
  ------------------
  |  Branch (1010:2): [True: 604, False: 126M]
  ------------------
 1011|    604|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    604|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 195, False: 409]
  |  |  |  Branch (101:36): [True: 194, False: 215]
  |  |  |  Branch (101:49): [True: 195, False: 20]
  |  |  ------------------
  ------------------
 1012|    584|			return YXML_OK;
 1013|     20|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (1013:6): [True: 9, False: 11]
  ------------------
 1014|      9|			x->state = YXMLS_xmldecl9;
 1015|      9|			return YXML_OK;
 1016|      9|		}
 1017|     11|		break;
 1018|     33|	case YXMLS_xmldecl9:
  ------------------
  |  Branch (1018:2): [True: 33, False: 126M]
  ------------------
 1019|     33|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (1019:6): [True: 32, False: 1]
  ------------------
 1020|     32|			x->state = YXMLS_misc1;
 1021|     32|			return YXML_OK;
 1022|     32|		}
 1023|      1|		break;
 1024|   126M|	}
 1025|    828|	return YXML_ESYN;
 1026|   126M|}
yxml_eof:
 1028|  6.78k|yxml_ret_t yxml_eof(yxml_t *x) {
 1029|  6.78k|	if(x->state != YXMLS_misc3)
  ------------------
  |  Branch (1029:5): [True: 2.15k, False: 4.63k]
  ------------------
 1030|  2.15k|		return YXML_EEOF;
 1031|  4.63k|	return YXML_OK;
 1032|  6.78k|}
yxml.c:yxml_attrname:
  243|  34.1M|static inline yxml_ret_t yxml_attrname   (yxml_t *x, unsigned ch) { return yxml_pushstackc(x, ch); }
yxml.c:yxml_pushstackc:
  195|  34.6M|static yxml_ret_t yxml_pushstackc(yxml_t *x, unsigned ch) {
  196|  34.6M|	if(x->stacklen+1 >= x->stacksize)
  ------------------
  |  Branch (196:5): [True: 4, False: 34.6M]
  ------------------
  197|      4|		return YXML_ESTACK;
  198|  34.6M|	x->stack[x->stacklen] = (unsigned char)ch;
  199|  34.6M|	x->stacklen++;
  200|  34.6M|	x->stack[x->stacklen] = 0;
  201|  34.6M|	return YXML_OK;
  202|  34.6M|}
yxml.c:yxml_attrnameend:
  244|  3.96M|static inline yxml_ret_t yxml_attrnameend(yxml_t *x, unsigned ch) { return YXML_ATTRSTART; }
yxml.c:yxml_dataattr:
  177|   419k|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|   419k|	yxml_setchar(x->data, ch == 0x9 || ch == 0xa ? 0x20 : ch);
  ------------------
  |  Branch (179:24): [True: 11.2k, False: 408k]
  |  Branch (179:37): [True: 3.63k, False: 404k]
  ------------------
  180|   419k|	x->data[1] = 0;
  181|   419k|	return YXML_ATTRVAL;
  182|   419k|}
yxml.c:yxml_setchar:
  118|  26.3M|static inline void yxml_setchar(char *dest, unsigned ch) {
  119|  26.3M|	*(unsigned char *)dest = (unsigned char)ch;
  120|  26.3M|}
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.96M|static inline yxml_ret_t yxml_attrvalend (yxml_t *x, unsigned ch) { yxml_popstack(x); return YXML_ATTREND; }
yxml.c:yxml_popstack:
  204|  14.5M|static void yxml_popstack(yxml_t *x) {
  205|  14.5M|	do
  206|  63.7M|		x->stacklen--;
  207|  63.7M|	while(x->stack[x->stacklen]);
  ------------------
  |  Branch (207:8): [True: 49.1M, False: 14.5M]
  ------------------
  208|  14.5M|}
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: 665, False: 1.31k]
  ------------------
  274|  2.30k|			for(r += 2; yxml_isHex((unsigned)*r); r++)
  ------------------
  |  |  104|  2.30k|#define yxml_isHex(c) (yxml_isNum(c) || (c|32)-'a' < 6)
  |  |  ------------------
  |  |  |  |  103|  4.60k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 522, False: 1.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (104:41): [True: 1.11k, False: 665]
  |  |  ------------------
  ------------------
  275|  1.63k|				ch = (ch<<4) + (*r <= '9' ? *r-'0' : (*r|32)-'a' + 10);
  ------------------
  |  Branch (275:21): [True: 522, False: 1.11k]
  ------------------
  276|  1.31k|		else
  277|  4.43k|			for(r++; yxml_isNum((unsigned)*r); r++)
  ------------------
  |  |  103|  4.43k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  ------------------
  |  |  |  Branch (103:23): [True: 3.11k, False: 1.31k]
  |  |  ------------------
  ------------------
  278|  3.11k|				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: 232, False: 996]
  ------------------
  285|  1.22k|			i == INTFROM5CHARS('g','t', 0,  0, 0) ? '>' :
  ------------------
  |  |  115|    996|#define INTFROM5CHARS(a, b, c, d, e) ((((uint64_t)(a))<<32) | (((uint64_t)(b))<<24) | (((uint64_t)(c))<<16) | (((uint64_t)(d))<<8) | (uint64_t)(e))
  ------------------
  |  Branch (285:4): [True: 195, False: 801]
  ------------------
  286|    996|			i == INTFROM5CHARS('a','m','p', 0, 0) ? '&' :
  ------------------
  |  |  115|    801|#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: 607]
  ------------------
  287|    801|			i == INTFROM5CHARS('a','p','o','s',0) ? '\'':
  ------------------
  |  |  115|    607|#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: 413]
  ------------------
  288|    607|			i == INTFROM5CHARS('q','u','o','t',0) ? '"' : 0;
  ------------------
  |  |  115|    413|#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: 157]
  ------------------
  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: 183, 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: 5, False: 3.02k]
  ------------------
  293|    190|		return YXML_EREF;
  294|  3.02k|	yxml_setutf8(x->data, ch);
  295|  3.02k|	return ret;
  296|  3.21k|}
yxml.c:yxml_setutf8:
  124|  3.02k|static void yxml_setutf8(char *dest, unsigned ch) {
  125|  3.02k|	if(ch <= 0x007F)
  ------------------
  |  Branch (125:5): [True: 2.11k, False: 906]
  ------------------
  126|  2.11k|		yxml_setchar(dest++, ch);
  127|    906|	else if(ch <= 0x07FF) {
  ------------------
  |  Branch (127:10): [True: 222, False: 684]
  ------------------
  128|    222|		yxml_setchar(dest++, 0xC0 | (ch>>6));
  129|    222|		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.02k|	*dest = 0;
  141|  3.02k|}
yxml.c:yxml_datacontent:
  143|  25.8M|static inline yxml_ret_t yxml_datacontent(yxml_t *x, unsigned ch) {
  144|  25.8M|	yxml_setchar(x->data, ch);
  145|  25.8M|	x->data[1] = 0;
  146|  25.8M|	return YXML_CONTENT;
  147|  25.8M|}
yxml.c:yxml_datacd1:
  162|    250|static inline yxml_ret_t yxml_datacd1(yxml_t *x, unsigned ch) {
  163|    250|	x->data[0] = ']';
  164|    250|	yxml_setchar(x->data+1, ch);
  165|    250|	x->data[2] = 0;
  166|    250|	return YXML_CONTENT;
  167|    250|}
yxml.c:yxml_datacd2:
  169|    330|static inline yxml_ret_t yxml_datacd2(yxml_t *x, unsigned ch) {
  170|    330|	x->data[0] = ']';
  171|    330|	x->data[1] = ']';
  172|    330|	yxml_setchar(x->data+2, ch);
  173|    330|	x->data[3] = 0;
  174|    330|	return YXML_CONTENT;
  175|    330|}
yxml.c:yxml_elemname:
  211|   501k|static inline yxml_ret_t yxml_elemname   (yxml_t *x, unsigned ch) { return yxml_pushstackc(x, ch); }
yxml.c:yxml_elemnameend:
  212|  10.5M|static inline yxml_ret_t yxml_elemnameend(yxml_t *x, unsigned ch) { return YXML_ELEMSTART; }
yxml.c:yxml_attrstart:
  242|  3.96M|static inline yxml_ret_t yxml_attrstart  (yxml_t *x, unsigned ch) { return yxml_pushstack(x, &x->attr, ch); }
yxml.c:yxml_pushstack:
  184|  14.5M|static yxml_ret_t yxml_pushstack(yxml_t *x, char **res, unsigned ch) {
  185|  14.5M|	if(x->stacklen+2 >= x->stacksize)
  ------------------
  |  Branch (185:5): [True: 4, False: 14.5M]
  ------------------
  186|      4|		return YXML_ESTACK;
  187|  14.5M|	x->stacklen++;
  188|  14.5M|	*res = (char *)x->stack+x->stacklen;
  189|  14.5M|	x->stack[x->stacklen] = (unsigned char)ch;
  190|  14.5M|	x->stacklen++;
  191|  14.5M|	x->stack[x->stacklen] = 0;
  192|  14.5M|	return YXML_OK;
  193|  14.5M|}
yxml.c:yxml_selfclose:
  216|  10.5M|static yxml_ret_t yxml_selfclose(yxml_t *x, unsigned ch) {
  217|  10.5M|	yxml_popstack(x);
  218|  10.5M|	if(x->stacklen) {
  ------------------
  |  Branch (218:5): [True: 10.5M, False: 4.73k]
  ------------------
  219|  10.5M|		x->elem = (char *)x->stack+x->stacklen-1;
  220|  34.8M|		while(*(x->elem-1))
  ------------------
  |  Branch (220:9): [True: 24.3M, False: 10.5M]
  ------------------
  221|  24.3M|			x->elem--;
  222|  10.5M|		return YXML_ELEMEND;
  223|  10.5M|	}
  224|  4.73k|	x->elem = (char *)x->stack;
  225|  4.73k|	x->state = YXMLS_misc3;
  226|  4.73k|	return YXML_ELEMEND;
  227|  10.5M|}
yxml.c:yxml_elemclose:
  229|  80.2k|static inline yxml_ret_t yxml_elemclose(yxml_t *x, unsigned ch) {
  230|  80.2k|	if(*((unsigned char *)x->elem) != ch)
  ------------------
  |  Branch (230:5): [True: 88, False: 80.1k]
  ------------------
  231|     88|		return YXML_ECLOSE;
  232|  80.1k|	x->elem++;
  233|  80.1k|	return YXML_OK;
  234|  80.2k|}
yxml.c:yxml_elemcloseend:
  236|  33.9k|static inline yxml_ret_t yxml_elemcloseend(yxml_t *x, unsigned ch) {
  237|  33.9k|	if(*x->elem)
  ------------------
  |  Branch (237:5): [True: 8, False: 33.9k]
  ------------------
  238|      8|		return YXML_ECLOSE;
  239|  33.9k|	return yxml_selfclose(x, ch);
  240|  33.9k|}
yxml.c:yxml_elemstart:
  210|  10.5M|static inline yxml_ret_t yxml_elemstart  (yxml_t *x, unsigned ch) { return yxml_pushstack(x, &x->elem, ch); }
yxml.c:yxml_pistart:
  247|  4.57k|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.14k|static inline yxml_ret_t yxml_piname   (yxml_t *x, unsigned ch) { return yxml_pushstackc(x, ch); }
yxml.c:yxml_pinameend:
  250|  3.68k|static inline yxml_ret_t yxml_pinameend(yxml_t *x, unsigned ch) {
  251|  3.68k|	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.68k, False: 2.00k]
  |  Branch (251:33): [True: 932, False: 748]
  |  Branch (251:57): [True: 495, False: 437]
  |  Branch (251:81): [True: 14, False: 481]
  ------------------
  252|  3.68k|}
yxml.c:yxml_datapi1:
  149|  8.37k|static inline yxml_ret_t yxml_datapi1(yxml_t *x, unsigned ch) {
  150|  8.37k|	yxml_setchar(x->data, ch);
  151|  8.37k|	x->data[1] = 0;
  152|  8.37k|	return YXML_PICONTENT;
  153|  8.37k|}
yxml.c:yxml_pivalend:
  253|  3.51k|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|    454|static inline yxml_ret_t yxml_datapi2(yxml_t *x, unsigned ch) {
  156|    454|	x->data[0] = '?';
  157|    454|	yxml_setchar(x->data+1, ch);
  158|    454|	x->data[2] = 0;
  159|    454|	return YXML_PICONTENT;
  160|    454|}
yxml.c:yxml_piabort:
  249|    622|static inline yxml_ret_t yxml_piabort  (yxml_t *x, unsigned ch) { yxml_popstack(x); return YXML_OK; }

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

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

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

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

fuzz_xml_decode_encode.cc:_ZL15UA_Variant_initP10UA_Variant:
  241|  7.48k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_xml_decode_encode.cc:_ZL16UA_Variant_clearP10UA_Variant:
  241|  2.42k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_xml_decode_encode.cc:_ZL19UA_ByteString_clearP9UA_String:
  241|  2.31k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_ByteString_init:
  241|  2.36k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_ExtensionObject_init:
  241|     57|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_clear:
  241|     73|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_copy:
  241|     84|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_init:
  241|     16|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_equal:
  241|  7.78k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl

