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

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

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

parseUInt64:
   30|  1.83k|parseUInt64(const char *str, size_t size, uint64_t *result) {
   31|  1.83k|    size_t i = 0;
   32|  1.83k|    uint64_t n = 0, prev = 0;
   33|       |
   34|       |    /* Hex */
   35|  1.83k|    if(size > 2 && str[0] == '0' && (str[1] | 32) == 'x') {
  ------------------
  |  Branch (35:8): [True: 1.68k, False: 153]
  |  Branch (35:20): [True: 343, False: 1.33k]
  |  Branch (35:37): [True: 156, False: 187]
  ------------------
   36|    156|        i = 2;
   37|  2.16k|        for(; i < size; i++) {
  ------------------
  |  Branch (37:15): [True: 2.04k, False: 112]
  ------------------
   38|  2.04k|            uint8_t c = (uint8_t)str[i] | 32;
   39|  2.04k|            if(c >= '0' && c <= '9')
  ------------------
  |  Branch (39:16): [True: 2.03k, False: 13]
  |  Branch (39:28): [True: 1.44k, False: 592]
  ------------------
   40|  1.44k|                c = (uint8_t)(c - '0');
   41|    605|            else if(c >= 'a' && c <='f')
  ------------------
  |  Branch (41:21): [True: 586, False: 19]
  |  Branch (41:33): [True: 567, False: 19]
  ------------------
   42|    567|                c = (uint8_t)(c - 'a' + 10);
   43|     38|            else if(c >= 'A' && c <='F')
  ------------------
  |  Branch (43:21): [True: 21, False: 17]
  |  Branch (43:33): [True: 0, False: 21]
  ------------------
   44|      0|                c = (uint8_t)(c - 'A' + 10);
   45|     38|            else
   46|     38|                break;
   47|  2.01k|            n = (n << 4) | (c & 0xF);
   48|  2.01k|            if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (48:16): [True: 6, False: 2.00k]
  ------------------
   49|      6|                return 0;
   50|  2.00k|            prev = n;
   51|  2.00k|        }
   52|    150|        *result = n;
   53|    150|        return (i > 2) ? i : 0; /* 2 -> No digit was parsed */
  ------------------
  |  Branch (53:16): [True: 148, False: 2]
  ------------------
   54|    156|    }
   55|       |
   56|       |    /* Decimal */
   57|  25.0k|    for(; i < size; i++) {
  ------------------
  |  Branch (57:11): [True: 23.8k, False: 1.12k]
  ------------------
   58|  23.8k|        if(str[i] < '0' || str[i] > '9')
  ------------------
  |  Branch (58:12): [True: 487, False: 23.4k]
  |  Branch (58:28): [True: 63, False: 23.3k]
  ------------------
   59|    550|            break;
   60|       |        /* Fast multiplication: n*10 == (n*8) + (n*2) */
   61|  23.3k|        n = (n << 3) + (n << 1) + (uint8_t)(str[i] - '0');
   62|  23.3k|        if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (62:12): [True: 3, False: 23.3k]
  ------------------
   63|      3|            return 0;
   64|  23.3k|        prev = n;
   65|  23.3k|    }
   66|  1.67k|    *result = n;
   67|  1.67k|    return i;
   68|  1.67k|}
parseInt64:
   71|  1.24k|parseInt64(const char *str, size_t size, int64_t *result) {
   72|       |    /* Negative value? */
   73|  1.24k|    size_t i = 0;
   74|  1.24k|    bool neg = false;
   75|  1.24k|    if(*str == '-' || *str == '+') {
  ------------------
  |  Branch (75:8): [True: 548, False: 695]
  |  Branch (75:23): [True: 5, False: 690]
  ------------------
   76|    553|        neg = (*str == '-');
   77|    553|        i++;
   78|    553|    }
   79|       |
   80|       |    /* Parse as unsigned */
   81|  1.24k|    uint64_t n = 0;
   82|  1.24k|    size_t len = parseUInt64(&str[i], size - i, &n);
   83|  1.24k|    if(len == 0)
  ------------------
  |  Branch (83:8): [True: 71, False: 1.17k]
  ------------------
   84|     71|        return 0;
   85|       |
   86|       |    /* Check for overflow, adjust and return */
   87|  1.17k|    if(!neg) {
  ------------------
  |  Branch (87:8): [True: 637, False: 535]
  ------------------
   88|    637|        if(n > 9223372036854775807UL)
  ------------------
  |  Branch (88:12): [True: 68, False: 569]
  ------------------
   89|     68|            return 0;
   90|    569|        *result = (int64_t)n;
   91|    569|    } else {
   92|    535|        if(n > 9223372036854775808UL)
  ------------------
  |  Branch (92:12): [True: 10, False: 525]
  ------------------
   93|     10|            return 0;
   94|    525|        *result = -(int64_t)n;
   95|    525|    }
   96|  1.09k|    return len + i;
   97|  1.17k|}
parseDouble:
   99|  1.30k|size_t parseDouble(const char *str, size_t size, double *result) {
  100|  1.30k|    char buf[2000];
  101|  1.30k|    if(size >= 2000)
  ------------------
  |  Branch (101:8): [True: 0, False: 1.30k]
  ------------------
  102|      0|        return 0;
  103|  1.30k|    memcpy(buf, str, size);
  104|  1.30k|    buf[size] = 0;
  105|  1.30k|    errno = 0;
  106|  1.30k|    char *endptr;
  107|  1.30k|    *result = strtod(buf, &endptr);
  108|  1.30k|    if(errno != 0 && errno != ERANGE)
  ------------------
  |  Branch (108:8): [True: 333, False: 967]
  |  Branch (108:22): [True: 0, False: 333]
  ------------------
  109|      0|        return 0;
  110|  1.30k|    return (uintptr_t)endptr - (uintptr_t)buf;
  111|  1.30k|}

yxml_init:
  301|  8.28k|void yxml_init(yxml_t *x, void *stack, size_t stacksize) {
  302|  8.28k|	memset(x, 0, sizeof(*x));
  303|  8.28k|	x->line = 1;
  304|  8.28k|	x->stack = (unsigned char*)stack;
  305|  8.28k|	x->stacksize = stacksize;
  306|  8.28k|	*x->stack = 0;
  307|  8.28k|	x->elem = x->pi = x->attr = (char *)x->stack;
  308|  8.28k|	x->state = YXMLS_init;
  309|  8.28k|}
yxml_parse:
  311|   129M|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|   129M|	unsigned ch = (unsigned)(_ch+256) & 0xff;
  315|   129M|	if(!ch)
  ------------------
  |  Branch (315:5): [True: 4, False: 129M]
  ------------------
  316|      4|		return YXML_ESYN;
  317|   129M|	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|   129M|	if(x->ignore == ch) {
  ------------------
  |  Branch (323:5): [True: 1.92k, False: 129M]
  ------------------
  324|  1.92k|		x->ignore = 0;
  325|  1.92k|		return YXML_OK;
  326|  1.92k|	}
  327|   129M|	x->ignore = (ch == 0xd) * 0xa;
  328|   129M|	if(ch == 0xa || ch == 0xd) {
  ------------------
  |  Branch (328:5): [True: 11.8k, False: 129M]
  |  Branch (328:18): [True: 4.31M, False: 125M]
  ------------------
  329|  4.32M|		ch = 0xa;
  330|  4.32M|		x->line++;
  331|  4.32M|		x->byte = 0;
  332|  4.32M|	}
  333|   129M|	x->byte++;
  334|       |
  335|   129M|	switch((yxml_state_t)x->state) {
  ------------------
  |  Branch (335:9): [True: 129M, False: 0]
  ------------------
  336|  12.4k|	case YXMLS_string:
  ------------------
  |  Branch (336:2): [True: 12.4k, False: 129M]
  ------------------
  337|  12.4k|		if(ch == *x->string) {
  ------------------
  |  Branch (337:6): [True: 12.4k, False: 11]
  ------------------
  338|  12.4k|			x->string++;
  339|  12.4k|			if(!*x->string)
  ------------------
  |  Branch (339:7): [True: 2.33k, False: 10.1k]
  ------------------
  340|  2.33k|				x->state = x->nextstate;
  341|  12.4k|			return YXML_OK;
  342|  12.4k|		}
  343|     11|		break;
  344|  39.0M|	case YXMLS_attr0:
  ------------------
  |  Branch (344:2): [True: 39.0M, False: 90.6M]
  ------------------
  345|  39.0M|		if(yxml_isName(ch))
  ------------------
  |  |  107|  39.0M|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|  78.0M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  78.0M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 2.94M, False: 36.0M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 595, False: 36.0M]
  |  |  |  |  |  Branch (106:61): [True: 258, False: 36.0M]
  |  |  |  |  |  Branch (106:73): [True: 31.9M, False: 4.11M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|  43.1M|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 56.3k, False: 4.05M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 5.74k, False: 4.05M]
  |  |  |  Branch (107:77): [True: 1.02k, False: 4.05M]
  |  |  ------------------
  ------------------
  346|  34.9M|			return yxml_attrname(x, ch);
  347|  4.05M|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  4.05M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 2.91M, False: 1.14M]
  |  |  |  Branch (101:36): [True: 302, False: 1.14M]
  |  |  |  Branch (101:49): [True: 776, False: 1.13M]
  |  |  ------------------
  ------------------
  348|  2.91M|			x->state = YXMLS_attr1;
  349|  2.91M|			return yxml_attrnameend(x, ch);
  350|  2.91M|		}
  351|  1.13M|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (351:6): [True: 1.13M, False: 28]
  ------------------
  352|  1.13M|			x->state = YXMLS_attr2;
  353|  1.13M|			return yxml_attrnameend(x, ch);
  354|  1.13M|		}
  355|     28|		break;
  356|  2.91M|	case YXMLS_attr1:
  ------------------
  |  Branch (356:2): [True: 2.91M, False: 126M]
  ------------------
  357|  2.91M|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  2.91M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 219, False: 2.91M]
  |  |  |  Branch (101:36): [True: 194, False: 2.91M]
  |  |  |  Branch (101:49): [True: 194, False: 2.91M]
  |  |  ------------------
  ------------------
  358|    607|			return YXML_OK;
  359|  2.91M|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (359:6): [True: 2.91M, False: 16]
  ------------------
  360|  2.91M|			x->state = YXMLS_attr2;
  361|  2.91M|			return YXML_OK;
  362|  2.91M|		}
  363|     16|		break;
  364|  4.05M|	case YXMLS_attr2:
  ------------------
  |  Branch (364:2): [True: 4.05M, False: 125M]
  ------------------
  365|  4.05M|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  4.05M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 242, False: 4.05M]
  |  |  |  Branch (101:36): [True: 219, False: 4.05M]
  |  |  |  Branch (101:49): [True: 223, False: 4.05M]
  |  |  ------------------
  ------------------
  366|    684|			return YXML_OK;
  367|  4.05M|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (367:6): [True: 1.13M, False: 2.91M]
  |  Branch (367:35): [True: 2.91M, False: 19]
  ------------------
  368|  4.05M|			x->state = YXMLS_attr3;
  369|  4.05M|			x->quote = ch;
  370|  4.05M|			return YXML_OK;
  371|  4.05M|		}
  372|     19|		break;
  373|  4.45M|	case YXMLS_attr3:
  ------------------
  |  Branch (373:2): [True: 4.45M, False: 125M]
  ------------------
  374|  4.45M|		if(yxml_isAttValue(ch))
  ------------------
  |  |  109|  4.45M|#define yxml_isAttValue(c) (yxml_isChar(c) && c != x->quote && c != '<' && c != '&')
  |  |  ------------------
  |  |  |  |   99|  8.91M|#define yxml_isChar(c) 1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:24): [True: 4.45M, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (109:47): [True: 403k, False: 4.05M]
  |  |  |  Branch (109:64): [True: 403k, False: 1]
  |  |  |  Branch (109:76): [True: 403k, False: 804]
  |  |  ------------------
  ------------------
  375|   403k|			return yxml_dataattr(x, ch);
  376|  4.05M|		if(ch == (unsigned char)'&') {
  ------------------
  |  Branch (376:6): [True: 804, False: 4.05M]
  ------------------
  377|    804|			x->state = YXMLS_attr4;
  378|    804|			return yxml_refstart(x, ch);
  379|    804|		}
  380|  4.05M|		if(x->quote == ch) {
  ------------------
  |  Branch (380:6): [True: 4.05M, False: 1]
  ------------------
  381|  4.05M|			x->state = YXMLS_elem2;
  382|  4.05M|			return yxml_attrvalend(x, ch);
  383|  4.05M|		}
  384|      1|		break;
  385|  3.23k|	case YXMLS_attr4:
  ------------------
  |  Branch (385:2): [True: 3.23k, False: 129M]
  ------------------
  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: 741, False: 2.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isRef(c) (yxml_isNum(c) || yxml_isAlpha(c) || c == '#')
  |  |  ------------------
  |  |  |  |  102|  5.73k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 1.23k, False: 1.26k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (113:60): [True: 499, False: 763]
  |  |  ------------------
  ------------------
  387|  2.47k|			return yxml_ref(x, ch);
  388|    763|		if(ch == (unsigned char)'\x3b') {
  ------------------
  |  Branch (388:6): [True: 750, False: 13]
  ------------------
  389|    750|			x->state = YXMLS_attr3;
  390|    750|			return yxml_refattrval(x, ch);
  391|    750|		}
  392|     13|		break;
  393|  5.33k|	case YXMLS_cd0:
  ------------------
  |  Branch (393:2): [True: 5.33k, False: 129M]
  ------------------
  394|  5.33k|		if(ch == (unsigned char)']') {
  ------------------
  |  Branch (394:6): [True: 909, False: 4.43k]
  ------------------
  395|    909|			x->state = YXMLS_cd1;
  396|    909|			return YXML_OK;
  397|    909|		}
  398|  4.43k|		if(yxml_isChar(ch))
  ------------------
  |  |   99|  4.43k|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 4.43k, Folded]
  |  |  ------------------
  ------------------
  399|  4.43k|			return yxml_datacontent(x, ch);
  400|      0|		break;
  401|    903|	case YXMLS_cd1:
  ------------------
  |  Branch (401:2): [True: 903, False: 129M]
  ------------------
  402|    903|		if(ch == (unsigned char)']') {
  ------------------
  |  Branch (402:6): [True: 653, False: 250]
  ------------------
  403|    653|			x->state = YXMLS_cd2;
  404|    653|			return YXML_OK;
  405|    653|		}
  406|    250|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    250|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 250, Folded]
  |  |  ------------------
  ------------------
  407|    250|			x->state = YXMLS_cd0;
  408|    250|			return yxml_datacd1(x, ch);
  409|    250|		}
  410|      0|		break;
  411|    993|	case YXMLS_cd2:
  ------------------
  |  Branch (411:2): [True: 993, False: 129M]
  ------------------
  412|    993|		if(ch == (unsigned char)']')
  ------------------
  |  Branch (412:6): [True: 354, False: 639]
  ------------------
  413|    354|			return yxml_datacontent(x, ch);
  414|    639|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (414:6): [True: 299, False: 340]
  ------------------
  415|    299|			x->state = YXMLS_misc2;
  416|    299|			return YXML_OK;
  417|    299|		}
  418|    340|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    340|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 340, Folded]
  |  |  ------------------
  ------------------
  419|    340|			x->state = YXMLS_cd0;
  420|    340|			return yxml_datacd2(x, ch);
  421|    340|		}
  422|      0|		break;
  423|    219|	case YXMLS_comment0:
  ------------------
  |  Branch (423:2): [True: 219, False: 129M]
  ------------------
  424|    219|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (424:6): [True: 207, False: 12]
  ------------------
  425|    207|			x->state = YXMLS_comment1;
  426|    207|			return YXML_OK;
  427|    207|		}
  428|     12|		break;
  429|  1.14k|	case YXMLS_comment1:
  ------------------
  |  Branch (429:2): [True: 1.14k, False: 129M]
  ------------------
  430|  1.14k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (430:6): [True: 1.13k, False: 11]
  ------------------
  431|  1.13k|			x->state = YXMLS_comment2;
  432|  1.13k|			return YXML_OK;
  433|  1.13k|		}
  434|     11|		break;
  435|  1.80k|	case YXMLS_comment2:
  ------------------
  |  Branch (435:2): [True: 1.80k, False: 129M]
  ------------------
  436|  1.80k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (436:6): [True: 1.48k, False: 316]
  ------------------
  437|  1.48k|			x->state = YXMLS_comment3;
  438|  1.48k|			return YXML_OK;
  439|  1.48k|		}
  440|    316|		if(yxml_isChar(ch))
  ------------------
  |  |   99|    316|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 316, Folded]
  |  |  ------------------
  ------------------
  441|    316|			return YXML_OK;
  442|      0|		break;
  443|  1.47k|	case YXMLS_comment3:
  ------------------
  |  Branch (443:2): [True: 1.47k, False: 129M]
  ------------------
  444|  1.47k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (444:6): [True: 1.08k, False: 390]
  ------------------
  445|  1.08k|			x->state = YXMLS_comment4;
  446|  1.08k|			return YXML_OK;
  447|  1.08k|		}
  448|    390|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    390|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 390, Folded]
  |  |  ------------------
  ------------------
  449|    390|			x->state = YXMLS_comment2;
  450|    390|			return YXML_OK;
  451|    390|		}
  452|      0|		break;
  453|  1.08k|	case YXMLS_comment4:
  ------------------
  |  Branch (453:2): [True: 1.08k, False: 129M]
  ------------------
  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: 129M]
  ------------------
  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: 265, False: 1.32k]
  |  Branch (464:35): [True: 333, False: 987]
  ------------------
  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|    987|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (470:6): [True: 766, False: 221]
  ------------------
  471|    766|			x->state = YXMLS_dt2;
  472|    766|			return YXML_OK;
  473|    766|		}
  474|    221|		if(yxml_isChar(ch))
  ------------------
  |  |   99|    221|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 221, Folded]
  |  |  ------------------
  ------------------
  475|    221|			return YXML_OK;
  476|      0|		break;
  477|  1.14k|	case YXMLS_dt1:
  ------------------
  |  Branch (477:2): [True: 1.14k, False: 129M]
  ------------------
  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|    760|	case YXMLS_dt2:
  ------------------
  |  Branch (485:2): [True: 760, False: 129M]
  ------------------
  486|    760|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (486:6): [True: 194, False: 566]
  ------------------
  487|    194|			x->state = YXMLS_pi0;
  488|    194|			x->nextstate = YXMLS_dt0;
  489|    194|			return YXML_OK;
  490|    194|		}
  491|    566|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (491:6): [True: 562, False: 4]
  ------------------
  492|    562|			x->state = YXMLS_dt3;
  493|    562|			return YXML_OK;
  494|    562|		}
  495|      4|		break;
  496|    556|	case YXMLS_dt3:
  ------------------
  |  Branch (496:2): [True: 556, False: 129M]
  ------------------
  497|    556|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (497:6): [True: 194, False: 362]
  ------------------
  498|    194|			x->state = YXMLS_comment1;
  499|    194|			x->nextstate = YXMLS_dt0;
  500|    194|			return YXML_OK;
  501|    194|		}
  502|    362|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    362|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 362, Folded]
  |  |  ------------------
  ------------------
  503|    362|			x->state = YXMLS_dt4;
  504|    362|			return YXML_OK;
  505|    362|		}
  506|      0|		break;
  507|    905|	case YXMLS_dt4:
  ------------------
  |  Branch (507:2): [True: 905, False: 129M]
  ------------------
  508|    905|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (508:6): [True: 194, False: 711]
  |  Branch (508:35): [True: 194, False: 517]
  ------------------
  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|    517|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (514:6): [True: 311, False: 206]
  ------------------
  515|    311|			x->state = YXMLS_dt0;
  516|    311|			return YXML_OK;
  517|    311|		}
  518|    206|		if(yxml_isChar(ch))
  ------------------
  |  |   99|    206|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 206, Folded]
  |  |  ------------------
  ------------------
  519|    206|			return YXML_OK;
  520|      0|		break;
  521|  11.1M|	case YXMLS_elem0:
  ------------------
  |  Branch (521:2): [True: 11.1M, False: 118M]
  ------------------
  522|  11.1M|		if(yxml_isName(ch))
  ------------------
  |  |  107|  11.1M|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|  22.2M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  22.2M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 358k, False: 10.7M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 619, False: 10.7M]
  |  |  |  |  |  Branch (106:61): [True: 2.01k, False: 10.7M]
  |  |  |  |  |  Branch (106:73): [True: 143k, False: 10.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|  21.7M|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 8.61k, False: 10.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 640, False: 10.6M]
  |  |  |  Branch (107:77): [True: 1.98k, False: 10.6M]
  |  |  ------------------
  ------------------
  523|   515k|			return yxml_elemname(x, ch);
  524|  10.6M|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  10.6M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 837, False: 10.6M]
  |  |  |  Branch (101:36): [True: 427, False: 10.6M]
  |  |  |  Branch (101:49): [True: 1.69k, False: 10.6M]
  |  |  ------------------
  ------------------
  525|  2.96k|			x->state = YXMLS_elem1;
  526|  2.96k|			return yxml_elemnameend(x, ch);
  527|  2.96k|		}
  528|  10.6M|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (528:6): [True: 10.5M, False: 36.3k]
  ------------------
  529|  10.5M|			x->state = YXMLS_elem3;
  530|  10.5M|			return yxml_elemnameend(x, ch);
  531|  10.5M|		}
  532|  36.3k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (532:6): [True: 36.2k, False: 29]
  ------------------
  533|  36.2k|			x->state = YXMLS_misc2;
  534|  36.2k|			return yxml_elemnameend(x, ch);
  535|  36.2k|		}
  536|     29|		break;
  537|  4.05M|	case YXMLS_elem1:
  ------------------
  |  Branch (537:2): [True: 4.05M, False: 125M]
  ------------------
  538|  4.05M|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  4.05M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 1.94k, False: 4.05M]
  |  |  |  Branch (101:36): [True: 290, False: 4.05M]
  |  |  |  Branch (101:49): [True: 343, False: 4.05M]
  |  |  ------------------
  ------------------
  539|  2.57k|			return YXML_OK;
  540|  4.05M|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (540:6): [True: 912, False: 4.05M]
  ------------------
  541|    912|			x->state = YXMLS_elem3;
  542|    912|			return YXML_OK;
  543|    912|		}
  544|  4.05M|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (544:6): [True: 430, False: 4.05M]
  ------------------
  545|    430|			x->state = YXMLS_misc2;
  546|    430|			return YXML_OK;
  547|    430|		}
  548|  4.05M|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  4.05M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  8.10M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 1.45M, False: 2.59M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 766, False: 2.59M]
  |  |  |  Branch (106:61): [True: 604, False: 2.59M]
  |  |  |  Branch (106:73): [True: 2.59M, False: 28]
  |  |  ------------------
  ------------------
  549|  4.05M|			x->state = YXMLS_attr0;
  550|  4.05M|			return yxml_attrstart(x, ch);
  551|  4.05M|		}
  552|     28|		break;
  553|  4.05M|	case YXMLS_elem2:
  ------------------
  |  Branch (553:2): [True: 4.05M, False: 125M]
  ------------------
  554|  4.05M|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  4.05M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 1.13M, False: 2.91M]
  |  |  |  Branch (101:36): [True: 560, False: 2.91M]
  |  |  |  Branch (101:49): [True: 2.91M, False: 1.05k]
  |  |  ------------------
  ------------------
  555|  4.05M|			x->state = YXMLS_elem1;
  556|  4.05M|			return YXML_OK;
  557|  4.05M|		}
  558|  1.05k|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (558:6): [True: 824, False: 227]
  ------------------
  559|    824|			x->state = YXMLS_elem3;
  560|    824|			return YXML_OK;
  561|    824|		}
  562|    227|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (562:6): [True: 212, False: 15]
  ------------------
  563|    212|			x->state = YXMLS_misc2;
  564|    212|			return YXML_OK;
  565|    212|		}
  566|     15|		break;
  567|  10.5M|	case YXMLS_elem3:
  ------------------
  |  Branch (567:2): [True: 10.5M, False: 119M]
  ------------------
  568|  10.5M|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (568:6): [True: 10.5M, False: 8]
  ------------------
  569|  10.5M|			x->state = YXMLS_misc2;
  570|  10.5M|			return yxml_selfclose(x, ch);
  571|  10.5M|		}
  572|      8|		break;
  573|    789|	case YXMLS_enc0:
  ------------------
  |  Branch (573:2): [True: 789, False: 129M]
  ------------------
  574|    789|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    789|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 595]
  |  |  |  Branch (101:36): [True: 194, False: 401]
  |  |  |  Branch (101:49): [True: 194, False: 207]
  |  |  ------------------
  ------------------
  575|    582|			return YXML_OK;
  576|    207|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (576:6): [True: 192, False: 15]
  ------------------
  577|    192|			x->state = YXMLS_enc1;
  578|    192|			return YXML_OK;
  579|    192|		}
  580|     15|		break;
  581|    749|	case YXMLS_enc1:
  ------------------
  |  Branch (581:2): [True: 749, False: 129M]
  ------------------
  582|    749|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    749|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 555]
  |  |  |  Branch (101:36): [True: 194, False: 361]
  |  |  |  Branch (101:49): [True: 194, False: 167]
  |  |  ------------------
  ------------------
  583|    582|			return YXML_OK;
  584|    167|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (584:6): [True: 34, False: 133]
  |  Branch (584:35): [True: 117, False: 16]
  ------------------
  585|    151|			x->state = YXMLS_enc2;
  586|    151|			x->quote = ch;
  587|    151|			return YXML_OK;
  588|    151|		}
  589|     16|		break;
  590|    149|	case YXMLS_enc2:
  ------------------
  |  Branch (590:2): [True: 149, False: 129M]
  ------------------
  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: 129M]
  ------------------
  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: 197, False: 678]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:64): [True: 194, False: 484]
  |  |  |  Branch (105:76): [True: 194, False: 290]
  |  |  |  Branch (105:88): [True: 197, False: 93]
  |  |  ------------------
  ------------------
  598|    983|			return YXML_OK;
  599|     93|		if(x->quote == ch) {
  ------------------
  |  Branch (599:6): [True: 78, False: 15]
  ------------------
  600|     78|			x->state = YXMLS_xmldecl6;
  601|     78|			return YXML_OK;
  602|     78|		}
  603|     15|		break;
  604|  34.6k|	case YXMLS_etag0:
  ------------------
  |  Branch (604:2): [True: 34.6k, False: 129M]
  ------------------
  605|  34.6k|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  34.6k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  69.2k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 11.2k, False: 23.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 616, False: 22.7k]
  |  |  |  Branch (106:61): [True: 561, False: 22.2k]
  |  |  |  Branch (106:73): [True: 22.2k, False: 14]
  |  |  ------------------
  ------------------
  606|  34.6k|			x->state = YXMLS_etag1;
  607|  34.6k|			return yxml_elemclose(x, ch);
  608|  34.6k|		}
  609|     14|		break;
  610|  82.8k|	case YXMLS_etag1:
  ------------------
  |  Branch (610:2): [True: 82.8k, False: 129M]
  ------------------
  611|  82.8k|		if(yxml_isName(ch))
  ------------------
  |  |  107|  82.8k|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|   165k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|   165k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 43.1k, False: 39.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 196, False: 39.5k]
  |  |  |  |  |  Branch (106:61): [True: 474, False: 39.0k]
  |  |  |  |  |  Branch (106:73): [True: 339, False: 38.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|   121k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 3.79k, False: 34.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 194, False: 34.7k]
  |  |  |  Branch (107:77): [True: 194, False: 34.5k]
  |  |  ------------------
  ------------------
  612|  48.3k|			return yxml_elemclose(x, ch);
  613|  34.5k|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  34.5k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 257, False: 34.2k]
  |  |  |  Branch (101:36): [True: 211, False: 34.0k]
  |  |  |  Branch (101:49): [True: 430, False: 33.6k]
  |  |  ------------------
  ------------------
  614|    898|			x->state = YXMLS_etag2;
  615|    898|			return yxml_elemcloseend(x, ch);
  616|    898|		}
  617|  33.6k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (617:6): [True: 33.5k, False: 22]
  ------------------
  618|  33.5k|			x->state = YXMLS_misc2;
  619|  33.5k|			return yxml_elemcloseend(x, ch);
  620|  33.5k|		}
  621|     22|		break;
  622|  1.47k|	case YXMLS_etag2:
  ------------------
  |  Branch (622:2): [True: 1.47k, False: 129M]
  ------------------
  623|  1.47k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.47k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 195, False: 1.28k]
  |  |  |  Branch (101:36): [True: 194, False: 1.08k]
  |  |  |  Branch (101:49): [True: 240, False: 848]
  |  |  ------------------
  ------------------
  624|    629|			return YXML_OK;
  625|    848|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (625:6): [True: 834, False: 14]
  ------------------
  626|    834|			x->state = YXMLS_misc2;
  627|    834|			return YXML_OK;
  628|    834|		}
  629|     14|		break;
  630|  8.28k|	case YXMLS_init:
  ------------------
  |  Branch (630:2): [True: 8.28k, False: 129M]
  ------------------
  631|  8.28k|		if(ch == (unsigned char)'\xef') {
  ------------------
  |  Branch (631:6): [True: 17, False: 8.26k]
  ------------------
  632|     17|			x->state = YXMLS_string;
  633|     17|			x->nextstate = YXMLS_misc0;
  634|     17|			x->string = (unsigned char *)"\xbb\xbf";
  635|     17|			return YXML_OK;
  636|     17|		}
  637|  8.26k|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  8.26k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 24, False: 8.24k]
  |  |  |  Branch (101:36): [True: 35, False: 8.20k]
  |  |  |  Branch (101:49): [True: 47, False: 8.15k]
  |  |  ------------------
  ------------------
  638|    106|			x->state = YXMLS_misc0;
  639|    106|			return YXML_OK;
  640|    106|		}
  641|  8.15k|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (641:6): [True: 8.12k, False: 31]
  ------------------
  642|  8.12k|			x->state = YXMLS_le0;
  643|  8.12k|			return YXML_OK;
  644|  8.12k|		}
  645|     31|		break;
  646|  8.16k|	case YXMLS_le0:
  ------------------
  |  Branch (646:2): [True: 8.16k, False: 129M]
  ------------------
  647|  8.16k|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (647:6): [True: 304, False: 7.86k]
  ------------------
  648|    304|			x->state = YXMLS_lee1;
  649|    304|			return YXML_OK;
  650|    304|		}
  651|  7.86k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (651:6): [True: 1.35k, False: 6.50k]
  ------------------
  652|  1.35k|			x->state = YXMLS_leq0;
  653|  1.35k|			return YXML_OK;
  654|  1.35k|		}
  655|  6.50k|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  6.50k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  13.0k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 1.86k, False: 4.64k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 109, False: 4.53k]
  |  |  |  Branch (106:61): [True: 115, False: 4.41k]
  |  |  |  Branch (106:73): [True: 4.39k, False: 24]
  |  |  ------------------
  ------------------
  656|  6.47k|			x->state = YXMLS_elem0;
  657|  6.47k|			return yxml_elemstart(x, ch);
  658|  6.47k|		}
  659|     24|		break;
  660|  2.29k|	case YXMLS_le1:
  ------------------
  |  Branch (660:2): [True: 2.29k, False: 129M]
  ------------------
  661|  2.29k|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (661:6): [True: 733, False: 1.56k]
  ------------------
  662|    733|			x->state = YXMLS_lee1;
  663|    733|			return YXML_OK;
  664|    733|		}
  665|  1.56k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (665:6): [True: 1.32k, False: 234]
  ------------------
  666|  1.32k|			x->state = YXMLS_pi0;
  667|  1.32k|			x->nextstate = YXMLS_misc1;
  668|  1.32k|			return YXML_OK;
  669|  1.32k|		}
  670|    234|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|    234|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|    468|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 15, False: 219]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 4, False: 215]
  |  |  |  Branch (106:61): [True: 31, False: 184]
  |  |  |  Branch (106:73): [True: 169, False: 15]
  |  |  ------------------
  ------------------
  671|    219|			x->state = YXMLS_elem0;
  672|    219|			return yxml_elemstart(x, ch);
  673|    219|		}
  674|     15|		break;
  675|  10.6M|	case YXMLS_le2:
  ------------------
  |  Branch (675:2): [True: 10.6M, False: 119M]
  ------------------
  676|  10.6M|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (676:6): [True: 641, False: 10.6M]
  ------------------
  677|    641|			x->state = YXMLS_lee2;
  678|    641|			return YXML_OK;
  679|    641|		}
  680|  10.6M|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (680:6): [True: 1.33k, False: 10.6M]
  ------------------
  681|  1.33k|			x->state = YXMLS_pi0;
  682|  1.33k|			x->nextstate = YXMLS_misc2;
  683|  1.33k|			return YXML_OK;
  684|  1.33k|		}
  685|  10.6M|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (685:6): [True: 34.6k, False: 10.6M]
  ------------------
  686|  34.6k|			x->state = YXMLS_etag0;
  687|  34.6k|			return YXML_OK;
  688|  34.6k|		}
  689|  10.6M|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  10.6M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  21.2M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 32.6k, False: 10.5M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 1.10k, False: 10.5M]
  |  |  |  Branch (106:61): [True: 1.11k, False: 10.5M]
  |  |  |  Branch (106:73): [True: 10.5M, False: 25]
  |  |  ------------------
  ------------------
  690|  10.6M|			x->state = YXMLS_elem0;
  691|  10.6M|			return yxml_elemstart(x, ch);
  692|  10.6M|		}
  693|     25|		break;
  694|    670|	case YXMLS_le3:
  ------------------
  |  Branch (694:2): [True: 670, False: 129M]
  ------------------
  695|    670|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (695:6): [True: 224, False: 446]
  ------------------
  696|    224|			x->state = YXMLS_comment0;
  697|    224|			x->nextstate = YXMLS_misc3;
  698|    224|			return YXML_OK;
  699|    224|		}
  700|    446|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (700:6): [True: 430, False: 16]
  ------------------
  701|    430|			x->state = YXMLS_pi0;
  702|    430|			x->nextstate = YXMLS_misc3;
  703|    430|			return YXML_OK;
  704|    430|		}
  705|     16|		break;
  706|  1.02k|	case YXMLS_lee1:
  ------------------
  |  Branch (706:2): [True: 1.02k, False: 129M]
  ------------------
  707|  1.02k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (707:6): [True: 521, False: 508]
  ------------------
  708|    521|			x->state = YXMLS_comment1;
  709|    521|			x->nextstate = YXMLS_misc1;
  710|    521|			return YXML_OK;
  711|    521|		}
  712|    508|		if(ch == (unsigned char)'D') {
  ------------------
  |  Branch (712:6): [True: 490, False: 18]
  ------------------
  713|    490|			x->state = YXMLS_string;
  714|    490|			x->nextstate = YXMLS_dt0;
  715|    490|			x->string = (unsigned char *)"OCTYPE";
  716|    490|			return YXML_OK;
  717|    490|		}
  718|     18|		break;
  719|    636|	case YXMLS_lee2:
  ------------------
  |  Branch (719:2): [True: 636, False: 129M]
  ------------------
  720|    636|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (720:6): [True: 255, False: 381]
  ------------------
  721|    255|			x->state = YXMLS_comment1;
  722|    255|			x->nextstate = YXMLS_misc2;
  723|    255|			return YXML_OK;
  724|    255|		}
  725|    381|		if(ch == (unsigned char)'[') {
  ------------------
  |  Branch (725:6): [True: 367, False: 14]
  ------------------
  726|    367|			x->state = YXMLS_string;
  727|    367|			x->nextstate = YXMLS_cd0;
  728|    367|			x->string = (unsigned char *)"CDATA[";
  729|    367|			return YXML_OK;
  730|    367|		}
  731|     14|		break;
  732|  1.35k|	case YXMLS_leq0:
  ------------------
  |  Branch (732:2): [True: 1.35k, False: 129M]
  ------------------
  733|  1.35k|		if(ch == (unsigned char)'x') {
  ------------------
  |  Branch (733:6): [True: 997, False: 360]
  ------------------
  734|    997|			x->state = YXMLS_xmldecl0;
  735|    997|			x->nextstate = YXMLS_misc1;
  736|    997|			return yxml_pistart(x, ch);
  737|    997|		}
  738|    360|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|    360|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|    720|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 159, False: 201]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 19, False: 182]
  |  |  |  Branch (106:61): [True: 26, False: 156]
  |  |  |  Branch (106:73): [True: 138, False: 18]
  |  |  ------------------
  ------------------
  739|    342|			x->state = YXMLS_pi1;
  740|    342|			x->nextstate = YXMLS_misc1;
  741|    342|			return yxml_pistart(x, ch);
  742|    342|		}
  743|     18|		break;
  744|  1.20k|	case YXMLS_misc0:
  ------------------
  |  Branch (744:2): [True: 1.20k, False: 129M]
  ------------------
  745|  1.20k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.20k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 199, False: 1.00k]
  |  |  |  Branch (101:36): [True: 195, False: 812]
  |  |  |  Branch (101:49): [True: 750, False: 62]
  |  |  ------------------
  ------------------
  746|  1.14k|			return YXML_OK;
  747|     62|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (747:6): [True: 39, False: 23]
  ------------------
  748|     39|			x->state = YXMLS_le0;
  749|     39|			return YXML_OK;
  750|     39|		}
  751|     23|		break;
  752|  2.92k|	case YXMLS_misc1:
  ------------------
  |  Branch (752:2): [True: 2.92k, False: 129M]
  ------------------
  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: 16]
  ------------------
  756|  2.30k|			x->state = YXMLS_le1;
  757|  2.30k|			return YXML_OK;
  758|  2.30k|		}
  759|     16|		break;
  760|  38.5M|	case YXMLS_misc2:
  ------------------
  |  Branch (760:2): [True: 38.5M, False: 91.1M]
  ------------------
  761|  38.5M|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (761:6): [True: 10.6M, False: 27.9M]
  ------------------
  762|  10.6M|			x->state = YXMLS_le2;
  763|  10.6M|			return YXML_OK;
  764|  10.6M|		}
  765|  27.9M|		if(ch == (unsigned char)'&') {
  ------------------
  |  Branch (765:6): [True: 2.52k, False: 27.9M]
  ------------------
  766|  2.52k|			x->state = YXMLS_misc2a;
  767|  2.52k|			return yxml_refstart(x, ch);
  768|  2.52k|		}
  769|  27.9M|		if(yxml_isChar(ch))
  ------------------
  |  |   99|  27.9M|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 27.9M, Folded]
  |  |  ------------------
  ------------------
  770|  27.9M|			return yxml_datacontent(x, ch);
  771|      0|		break;
  772|  11.4k|	case YXMLS_misc2a:
  ------------------
  |  Branch (772:2): [True: 11.4k, False: 129M]
  ------------------
  773|  11.4k|		if(yxml_isRef(ch))
  ------------------
  |  |  113|  11.4k|#define yxml_isRef(c) (yxml_isNum(c) || yxml_isAlpha(c) || c == '#')
  |  |  ------------------
  |  |  |  |  103|  22.8k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 3.06k, False: 8.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isRef(c) (yxml_isNum(c) || yxml_isAlpha(c) || c == '#')
  |  |  ------------------
  |  |  |  |  102|  19.7k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 4.29k, False: 4.05k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (113:60): [True: 1.57k, False: 2.48k]
  |  |  ------------------
  ------------------
  774|  8.92k|			return yxml_ref(x, ch);
  775|  2.48k|		if(ch == (unsigned char)'\x3b') {
  ------------------
  |  Branch (775:6): [True: 2.46k, False: 19]
  ------------------
  776|  2.46k|			x->state = YXMLS_misc2;
  777|  2.46k|			return yxml_refcontent(x, ch);
  778|  2.46k|		}
  779|     19|		break;
  780|  1.28k|	case YXMLS_misc3:
  ------------------
  |  Branch (780:2): [True: 1.28k, False: 129M]
  ------------------
  781|  1.28k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.28k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 1.08k]
  |  |  |  Branch (101:36): [True: 196, False: 890]
  |  |  |  Branch (101:49): [True: 196, False: 694]
  |  |  ------------------
  ------------------
  782|    586|			return YXML_OK;
  783|    694|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (783:6): [True: 676, False: 18]
  ------------------
  784|    676|			x->state = YXMLS_le3;
  785|    676|			return YXML_OK;
  786|    676|		}
  787|     18|		break;
  788|  3.25k|	case YXMLS_pi0:
  ------------------
  |  Branch (788:2): [True: 3.25k, False: 129M]
  ------------------
  789|  3.25k|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  3.25k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  6.50k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 1.68k, False: 1.56k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 739, False: 830]
  |  |  |  Branch (106:61): [True: 286, False: 544]
  |  |  |  Branch (106:73): [True: 526, False: 18]
  |  |  ------------------
  ------------------
  790|  3.23k|			x->state = YXMLS_pi1;
  791|  3.23k|			return yxml_pistart(x, ch);
  792|  3.23k|		}
  793|     18|		break;
  794|  7.82k|	case YXMLS_pi1:
  ------------------
  |  Branch (794:2): [True: 7.82k, False: 129M]
  ------------------
  795|  7.82k|		if(yxml_isName(ch))
  ------------------
  |  |  107|  7.82k|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|  15.6k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  15.6k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 1.83k, False: 5.99k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 197, False: 5.79k]
  |  |  |  |  |  Branch (106:61): [True: 242, False: 5.55k]
  |  |  |  |  |  Branch (106:73): [True: 1.17k, False: 4.37k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|  12.2k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 279, False: 4.09k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 195, False: 3.90k]
  |  |  |  Branch (107:77): [True: 281, False: 3.62k]
  |  |  ------------------
  ------------------
  796|  4.20k|			return yxml_piname(x, ch);
  797|  3.62k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (797:6): [True: 2.35k, False: 1.27k]
  ------------------
  798|  2.35k|			x->state = YXMLS_pi4;
  799|  2.35k|			return yxml_pinameend(x, ch);
  800|  2.35k|		}
  801|  1.27k|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  1.27k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 390, False: 883]
  |  |  |  Branch (101:36): [True: 289, False: 594]
  |  |  |  Branch (101:49): [True: 569, False: 25]
  |  |  ------------------
  ------------------
  802|  1.24k|			x->state = YXMLS_pi2;
  803|  1.24k|			return yxml_pinameend(x, ch);
  804|  1.24k|		}
  805|     25|		break;
  806|  8.97k|	case YXMLS_pi2:
  ------------------
  |  Branch (806:2): [True: 8.97k, False: 129M]
  ------------------
  807|  8.97k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (807:6): [True: 1.60k, False: 7.37k]
  ------------------
  808|  1.60k|			x->state = YXMLS_pi3;
  809|  1.60k|			return YXML_OK;
  810|  1.60k|		}
  811|  7.37k|		if(yxml_isChar(ch))
  ------------------
  |  |   99|  7.37k|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 7.37k, Folded]
  |  |  ------------------
  ------------------
  812|  7.37k|			return yxml_datapi1(x, ch);
  813|      0|		break;
  814|  1.59k|	case YXMLS_pi3:
  ------------------
  |  Branch (814:2): [True: 1.59k, False: 129M]
  ------------------
  815|  1.59k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (815:6): [True: 1.17k, False: 427]
  ------------------
  816|  1.17k|			x->state = x->nextstate;
  817|  1.17k|			return yxml_pivalend(x, ch);
  818|  1.17k|		}
  819|    427|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    427|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 427, Folded]
  |  |  ------------------
  ------------------
  820|    427|			x->state = YXMLS_pi2;
  821|    427|			return yxml_datapi2(x, ch);
  822|    427|		}
  823|      0|		break;
  824|  2.31k|	case YXMLS_pi4:
  ------------------
  |  Branch (824:2): [True: 2.31k, False: 129M]
  ------------------
  825|  2.31k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (825:6): [True: 2.30k, False: 12]
  ------------------
  826|  2.30k|			x->state = x->nextstate;
  827|  2.30k|			return yxml_pivalend(x, ch);
  828|  2.30k|		}
  829|     12|		break;
  830|    699|	case YXMLS_std0:
  ------------------
  |  Branch (830:2): [True: 699, False: 129M]
  ------------------
  831|    699|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    699|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 505]
  |  |  |  Branch (101:36): [True: 194, False: 311]
  |  |  |  Branch (101:49): [True: 194, False: 117]
  |  |  ------------------
  ------------------
  832|    582|			return YXML_OK;
  833|    117|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (833:6): [True: 100, False: 17]
  ------------------
  834|    100|			x->state = YXMLS_std1;
  835|    100|			return YXML_OK;
  836|    100|		}
  837|     17|		break;
  838|    657|	case YXMLS_std1:
  ------------------
  |  Branch (838:2): [True: 657, False: 129M]
  ------------------
  839|    657|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    657|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 463]
  |  |  |  Branch (101:36): [True: 194, False: 269]
  |  |  |  Branch (101:49): [True: 194, False: 75]
  |  |  ------------------
  ------------------
  840|    582|			return YXML_OK;
  841|     75|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (841:6): [True: 21, False: 54]
  |  Branch (841:35): [True: 42, False: 12]
  ------------------
  842|     63|			x->state = YXMLS_std2;
  843|     63|			x->quote = ch;
  844|     63|			return YXML_OK;
  845|     63|		}
  846|     12|		break;
  847|     61|	case YXMLS_std2:
  ------------------
  |  Branch (847:2): [True: 61, False: 129M]
  ------------------
  848|     61|		if(ch == (unsigned char)'y') {
  ------------------
  |  Branch (848:6): [True: 3, False: 58]
  ------------------
  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|     58|		if(ch == (unsigned char)'n') {
  ------------------
  |  Branch (854:6): [True: 46, False: 12]
  ------------------
  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|     12|		break;
  861|     46|	case YXMLS_std3:
  ------------------
  |  Branch (861:2): [True: 46, False: 129M]
  ------------------
  862|     46|		if(x->quote == ch) {
  ------------------
  |  Branch (862:6): [True: 45, False: 1]
  ------------------
  863|     45|			x->state = YXMLS_xmldecl8;
  864|     45|			return YXML_OK;
  865|     45|		}
  866|      1|		break;
  867|  1.13k|	case YXMLS_ver0:
  ------------------
  |  Branch (867:2): [True: 1.13k, False: 129M]
  ------------------
  868|  1.13k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.13k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 945]
  |  |  |  Branch (101:36): [True: 194, False: 751]
  |  |  |  Branch (101:49): [True: 194, False: 557]
  |  |  ------------------
  ------------------
  869|    582|			return YXML_OK;
  870|    557|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (870:6): [True: 545, False: 12]
  ------------------
  871|    545|			x->state = YXMLS_ver1;
  872|    545|			return YXML_OK;
  873|    545|		}
  874|     12|		break;
  875|  1.10k|	case YXMLS_ver1:
  ------------------
  |  Branch (875:2): [True: 1.10k, False: 129M]
  ------------------
  876|  1.10k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.10k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 196, False: 908]
  |  |  |  Branch (101:36): [True: 194, False: 714]
  |  |  |  Branch (101:49): [True: 194, False: 520]
  |  |  ------------------
  ------------------
  877|    584|			return YXML_OK;
  878|    520|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (878:6): [True: 5, False: 515]
  |  Branch (878:35): [True: 495, False: 20]
  ------------------
  879|    500|			x->state = YXMLS_string;
  880|    500|			x->quote = ch;
  881|    500|			x->nextstate = YXMLS_ver2;
  882|    500|			x->string = (unsigned char *)"1.";
  883|    500|			return YXML_OK;
  884|    500|		}
  885|     20|		break;
  886|    497|	case YXMLS_ver2:
  ------------------
  |  Branch (886:2): [True: 497, False: 129M]
  ------------------
  887|    497|		if(yxml_isNum(ch)) {
  ------------------
  |  |  103|    497|#define yxml_isNum(c) (c-'0' < 10)
  |  |  ------------------
  |  |  |  Branch (103:23): [True: 485, False: 12]
  |  |  ------------------
  ------------------
  888|    485|			x->state = YXMLS_ver3;
  889|    485|			return YXML_OK;
  890|    485|		}
  891|     12|		break;
  892|    668|	case YXMLS_ver3:
  ------------------
  |  Branch (892:2): [True: 668, False: 129M]
  ------------------
  893|    668|		if(yxml_isNum(ch))
  ------------------
  |  |  103|    668|#define yxml_isNum(c) (c-'0' < 10)
  |  |  ------------------
  |  |  |  Branch (103:23): [True: 197, False: 471]
  |  |  ------------------
  ------------------
  894|    197|			return YXML_OK;
  895|    471|		if(x->quote == ch) {
  ------------------
  |  Branch (895:6): [True: 456, False: 15]
  ------------------
  896|    456|			x->state = YXMLS_xmldecl4;
  897|    456|			return YXML_OK;
  898|    456|		}
  899|     15|		break;
  900|    996|	case YXMLS_xmldecl0:
  ------------------
  |  Branch (900:2): [True: 996, False: 129M]
  ------------------
  901|    996|		if(ch == (unsigned char)'m') {
  ------------------
  |  Branch (901:6): [True: 873, False: 123]
  ------------------
  902|    873|			x->state = YXMLS_xmldecl1;
  903|    873|			return yxml_piname(x, ch);
  904|    873|		}
  905|    123|		if(yxml_isName(ch)) {
  ------------------
  |  |  107|    123|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|    246|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    246|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 27, False: 96]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 3, False: 93]
  |  |  |  |  |  Branch (106:61): [True: 3, False: 90]
  |  |  |  |  |  Branch (106:73): [True: 18, False: 72]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|    195|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 7, False: 65]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 4, False: 61]
  |  |  |  Branch (107:77): [True: 4, False: 57]
  |  |  ------------------
  ------------------
  906|     66|			x->state = YXMLS_pi1;
  907|     66|			return yxml_piname(x, ch);
  908|     66|		}
  909|     57|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (909:6): [True: 17, False: 40]
  ------------------
  910|     17|			x->state = YXMLS_pi4;
  911|     17|			return yxml_pinameend(x, ch);
  912|     17|		}
  913|     40|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|     40|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 8, False: 32]
  |  |  |  Branch (101:36): [True: 7, False: 25]
  |  |  |  Branch (101:49): [True: 4, False: 21]
  |  |  ------------------
  ------------------
  914|     19|			x->state = YXMLS_pi2;
  915|     19|			return yxml_pinameend(x, ch);
  916|     19|		}
  917|     21|		break;
  918|    872|	case YXMLS_xmldecl1:
  ------------------
  |  Branch (918:2): [True: 872, False: 129M]
  ------------------
  919|    872|		if(ch == (unsigned char)'l') {
  ------------------
  |  Branch (919:6): [True: 772, False: 100]
  ------------------
  920|    772|			x->state = YXMLS_xmldecl2;
  921|    772|			return yxml_piname(x, ch);
  922|    772|		}
  923|    100|		if(yxml_isName(ch)) {
  ------------------
  |  |  107|    100|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|    200|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    200|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 22, False: 78]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 3, False: 75]
  |  |  |  |  |  Branch (106:61): [True: 3, False: 72]
  |  |  |  |  |  Branch (106:73): [True: 12, False: 60]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|    160|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 9, False: 51]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 3, False: 48]
  |  |  |  Branch (107:77): [True: 3, False: 45]
  |  |  ------------------
  ------------------
  924|     55|			x->state = YXMLS_pi1;
  925|     55|			return yxml_piname(x, ch);
  926|     55|		}
  927|     45|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (927:6): [True: 3, False: 42]
  ------------------
  928|      3|			x->state = YXMLS_pi4;
  929|      3|			return yxml_pinameend(x, ch);
  930|      3|		}
  931|     42|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|     42|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 3, False: 39]
  |  |  |  Branch (101:36): [True: 5, False: 34]
  |  |  |  Branch (101:49): [True: 4, False: 30]
  |  |  ------------------
  ------------------
  932|     12|			x->state = YXMLS_pi2;
  933|     12|			return yxml_pinameend(x, ch);
  934|     12|		}
  935|     30|		break;
  936|    771|	case YXMLS_xmldecl2:
  ------------------
  |  Branch (936:2): [True: 771, False: 129M]
  ------------------
  937|    771|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|    771|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 604, False: 167]
  |  |  |  Branch (101:36): [True: 13, False: 154]
  |  |  |  Branch (101:49): [True: 17, False: 137]
  |  |  ------------------
  ------------------
  938|    634|			x->state = YXMLS_xmldecl3;
  939|    634|			return yxml_piabort(x, ch);
  940|    634|		}
  941|    137|		if(yxml_isName(ch)) {
  ------------------
  |  |  107|    137|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|    274|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    274|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 13, False: 124]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 3, False: 121]
  |  |  |  |  |  Branch (106:61): [True: 4, False: 117]
  |  |  |  |  |  Branch (106:73): [True: 83, False: 34]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|    171|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 9, False: 25]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 3, False: 22]
  |  |  |  Branch (107:77): [True: 3, False: 19]
  |  |  ------------------
  ------------------
  942|    118|			x->state = YXMLS_pi1;
  943|    118|			return yxml_piname(x, ch);
  944|    118|		}
  945|     19|		break;
  946|  1.18k|	case YXMLS_xmldecl3:
  ------------------
  |  Branch (946:2): [True: 1.18k, False: 129M]
  ------------------
  947|  1.18k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.18k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 995]
  |  |  |  Branch (101:36): [True: 194, False: 801]
  |  |  |  Branch (101:49): [True: 194, False: 607]
  |  |  ------------------
  ------------------
  948|    582|			return YXML_OK;
  949|    607|		if(ch == (unsigned char)'v') {
  ------------------
  |  Branch (949:6): [True: 584, False: 23]
  ------------------
  950|    584|			x->state = YXMLS_string;
  951|    584|			x->nextstate = YXMLS_ver0;
  952|    584|			x->string = (unsigned char *)"ersion";
  953|    584|			return YXML_OK;
  954|    584|		}
  955|     23|		break;
  956|    455|	case YXMLS_xmldecl4:
  ------------------
  |  Branch (956:2): [True: 455, False: 129M]
  ------------------
  957|    455|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|    455|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 375, False: 80]
  |  |  |  Branch (101:36): [True: 11, False: 69]
  |  |  |  Branch (101:49): [True: 44, False: 25]
  |  |  ------------------
  ------------------
  958|    430|			x->state = YXMLS_xmldecl5;
  959|    430|			return YXML_OK;
  960|    430|		}
  961|     25|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (961:6): [True: 10, False: 15]
  ------------------
  962|     10|			x->state = YXMLS_xmldecl9;
  963|     10|			return YXML_OK;
  964|     10|		}
  965|     15|		break;
  966|    985|	case YXMLS_xmldecl5:
  ------------------
  |  Branch (966:2): [True: 985, False: 129M]
  ------------------
  967|    985|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    985|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 791]
  |  |  |  Branch (101:36): [True: 194, False: 597]
  |  |  |  Branch (101:49): [True: 194, False: 403]
  |  |  ------------------
  ------------------
  968|    582|			return YXML_OK;
  969|    403|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (969:6): [True: 7, False: 396]
  ------------------
  970|      7|			x->state = YXMLS_xmldecl9;
  971|      7|			return YXML_OK;
  972|      7|		}
  973|    396|		if(ch == (unsigned char)'e') {
  ------------------
  |  Branch (973:6): [True: 232, False: 164]
  ------------------
  974|    232|			x->state = YXMLS_string;
  975|    232|			x->nextstate = YXMLS_enc0;
  976|    232|			x->string = (unsigned char *)"ncoding";
  977|    232|			return YXML_OK;
  978|    232|		}
  979|    164|		if(ch == (unsigned char)'s') {
  ------------------
  |  Branch (979:6): [True: 138, False: 26]
  ------------------
  980|    138|			x->state = YXMLS_string;
  981|    138|			x->nextstate = YXMLS_std0;
  982|    138|			x->string = (unsigned char *)"tandalone";
  983|    138|			return YXML_OK;
  984|    138|		}
  985|     26|		break;
  986|     77|	case YXMLS_xmldecl6:
  ------------------
  |  Branch (986:2): [True: 77, False: 129M]
  ------------------
  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: 15, False: 33]
  |  |  |  Branch (101:49): [True: 20, 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|    636|	case YXMLS_xmldecl7:
  ------------------
  |  Branch (996:2): [True: 636, False: 129M]
  ------------------
  997|    636|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    636|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 442]
  |  |  |  Branch (101:36): [True: 195, False: 247]
  |  |  |  Branch (101:49): [True: 210, False: 37]
  |  |  ------------------
  ------------------
  998|    599|			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|    603|	case YXMLS_xmldecl8:
  ------------------
  |  Branch (1010:2): [True: 603, False: 129M]
  ------------------
 1011|    603|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    603|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 409]
  |  |  |  Branch (101:36): [True: 194, False: 215]
  |  |  |  Branch (101:49): [True: 195, False: 20]
  |  |  ------------------
  ------------------
 1012|    583|			return YXML_OK;
 1013|     20|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (1013:6): [True: 9, False: 11]
  ------------------
 1014|      9|			x->state = YXMLS_xmldecl9;
 1015|      9|			return YXML_OK;
 1016|      9|		}
 1017|     11|		break;
 1018|     33|	case YXMLS_xmldecl9:
  ------------------
  |  Branch (1018:2): [True: 33, False: 129M]
  ------------------
 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|   129M|	}
 1025|    881|	return YXML_ESYN;
 1026|   129M|}
yxml_eof:
 1028|  7.01k|yxml_ret_t yxml_eof(yxml_t *x) {
 1029|  7.01k|	if(x->state != YXMLS_misc3)
  ------------------
  |  Branch (1029:5): [True: 2.19k, False: 4.82k]
  ------------------
 1030|  2.19k|		return YXML_EEOF;
 1031|  4.82k|	return YXML_OK;
 1032|  7.01k|}
yxml.c:yxml_attrname:
  243|  34.9M|static inline yxml_ret_t yxml_attrname   (yxml_t *x, unsigned ch) { return yxml_pushstackc(x, ch); }
yxml.c:yxml_pushstackc:
  195|  35.4M|static yxml_ret_t yxml_pushstackc(yxml_t *x, unsigned ch) {
  196|  35.4M|	if(x->stacklen+1 >= x->stacksize)
  ------------------
  |  Branch (196:5): [True: 4, False: 35.4M]
  ------------------
  197|      4|		return YXML_ESTACK;
  198|  35.4M|	x->stack[x->stacklen] = (unsigned char)ch;
  199|  35.4M|	x->stacklen++;
  200|  35.4M|	x->stack[x->stacklen] = 0;
  201|  35.4M|	return YXML_OK;
  202|  35.4M|}
yxml.c:yxml_attrnameend:
  244|  4.05M|static inline yxml_ret_t yxml_attrnameend(yxml_t *x, unsigned ch) { return YXML_ATTRSTART; }
yxml.c:yxml_dataattr:
  177|   403k|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|   403k|	yxml_setchar(x->data, ch == 0x9 || ch == 0xa ? 0x20 : ch);
  ------------------
  |  Branch (179:24): [True: 11.3k, False: 391k]
  |  Branch (179:37): [True: 1.99k, False: 389k]
  ------------------
  180|   403k|	x->data[1] = 0;
  181|   403k|	return YXML_ATTRVAL;
  182|   403k|}
yxml.c:yxml_setchar:
  118|  28.3M|static inline void yxml_setchar(char *dest, unsigned ch) {
  119|  28.3M|	*(unsigned char *)dest = (unsigned char)ch;
  120|  28.3M|}
yxml.c:yxml_refstart:
  255|  3.33k|static inline yxml_ret_t yxml_refstart(yxml_t *x, unsigned ch) {
  256|  3.33k|	memset(x->data, 0, sizeof(x->data));
  257|  3.33k|	x->reflen = 0;
  258|  3.33k|	return YXML_OK;
  259|  3.33k|}
yxml.c:yxml_attrvalend:
  245|  4.05M|static inline yxml_ret_t yxml_attrvalend (yxml_t *x, unsigned ch) { yxml_popstack(x); return YXML_ATTREND; }
yxml.c:yxml_popstack:
  204|  14.6M|static void yxml_popstack(yxml_t *x) {
  205|  14.6M|	do
  206|  64.7M|		x->stacklen--;
  207|  64.7M|	while(x->stack[x->stacklen]);
  ------------------
  |  Branch (207:8): [True: 50.1M, False: 14.6M]
  ------------------
  208|  14.6M|}
yxml.c:yxml_ref:
  261|  11.4k|static yxml_ret_t yxml_ref(yxml_t *x, unsigned ch) {
  262|  11.4k|	if(x->reflen >= sizeof(x->data)-1)
  ------------------
  |  Branch (262:5): [True: 20, False: 11.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.4k|}
yxml.c:yxml_refattrval:
  299|    750|static inline yxml_ret_t yxml_refattrval(yxml_t *x, unsigned ch) { return yxml_refend(x, YXML_ATTRVAL); }
yxml.c:yxml_refend:
  269|  3.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.23k]
  ------------------
  273|  1.98k|		if(r[1] == 'x')
  ------------------
  |  Branch (273:6): [True: 668, False: 1.32k]
  ------------------
  274|  2.31k|			for(r += 2; yxml_isHex((unsigned)*r); r++)
  ------------------
  |  |  104|  2.31k|#define yxml_isHex(c) (yxml_isNum(c) || (c|32)-'a' < 6)
  |  |  ------------------
  |  |  |  |  103|  4.62k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 528, False: 1.78k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (104:41): [True: 1.11k, False: 668]
  |  |  ------------------
  ------------------
  275|  1.64k|				ch = (ch<<4) + (*r <= '9' ? *r-'0' : (*r|32)-'a' + 10);
  ------------------
  |  Branch (275:21): [True: 528, False: 1.11k]
  ------------------
  276|  1.32k|		else
  277|  4.44k|			for(r++; yxml_isNum((unsigned)*r); r++)
  ------------------
  |  |  103|  4.44k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  ------------------
  |  |  |  Branch (103:23): [True: 3.12k, False: 1.32k]
  |  |  ------------------
  ------------------
  278|  3.12k|				ch = (ch*10) + (*r-'0');
  279|  1.98k|		if(*r)
  ------------------
  |  Branch (279:6): [True: 8, False: 1.98k]
  ------------------
  280|      8|			ch = 0;
  281|  1.98k|	} else {
  282|  1.23k|		uint64_t i = INTFROM5CHARS(r[0], r[1], r[2], r[3], r[4]);
  ------------------
  |  |  115|  1.23k|#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.23k|		ch =
  284|  1.23k|			i == INTFROM5CHARS('l','t', 0,  0, 0) ? '<' :
  ------------------
  |  |  115|  1.23k|#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: 233, False: 998]
  ------------------
  285|  1.23k|			i == INTFROM5CHARS('g','t', 0,  0, 0) ? '>' :
  ------------------
  |  |  115|    998|#define INTFROM5CHARS(a, b, c, d, e) ((((uint64_t)(a))<<32) | (((uint64_t)(b))<<24) | (((uint64_t)(c))<<16) | (((uint64_t)(d))<<8) | (uint64_t)(e))
  ------------------
  |  Branch (285:4): [True: 195, False: 803]
  ------------------
  286|    998|			i == INTFROM5CHARS('a','m','p', 0, 0) ? '&' :
  ------------------
  |  |  115|    803|#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: 609]
  ------------------
  287|    803|			i == INTFROM5CHARS('a','p','o','s',0) ? '\'':
  ------------------
  |  |  115|    609|#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: 415]
  ------------------
  288|    609|			i == INTFROM5CHARS('q','u','o','t',0) ? '"' : 0;
  ------------------
  |  |  115|    415|#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: 159]
  ------------------
  289|  1.23k|	}
  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: 185, False: 3.03k]
  |  Branch (292:12): [True: 0, False: 3.03k]
  |  Branch (292:29): [True: 1, False: 3.03k]
  |  Branch (292:45): [True: 1, False: 3.03k]
  |  Branch (292:61): [True: 5, False: 3.02k]
  ------------------
  293|    192|		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: 908]
  ------------------
  126|  2.11k|		yxml_setchar(dest++, ch);
  127|    908|	else if(ch <= 0x07FF) {
  ------------------
  |  Branch (127:10): [True: 222, False: 686]
  ------------------
  128|    222|		yxml_setchar(dest++, 0xC0 | (ch>>6));
  129|    222|		yxml_setchar(dest++, 0x80 | (ch & 0x3F));
  130|    686|	} else if(ch <= 0xFFFF) {
  ------------------
  |  Branch (130:12): [True: 292, False: 394]
  ------------------
  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|    394|	} else {
  135|    394|		yxml_setchar(dest++, 0xF0 | (ch>>18));
  136|    394|		yxml_setchar(dest++, 0x80 | ((ch>>12) & 0x3F));
  137|    394|		yxml_setchar(dest++, 0x80 | ((ch>>6) & 0x3F));
  138|    394|		yxml_setchar(dest++, 0x80 | (ch & 0x3F));
  139|    394|	}
  140|  3.02k|	*dest = 0;
  141|  3.02k|}
yxml.c:yxml_datacontent:
  143|  27.9M|static inline yxml_ret_t yxml_datacontent(yxml_t *x, unsigned ch) {
  144|  27.9M|	yxml_setchar(x->data, ch);
  145|  27.9M|	x->data[1] = 0;
  146|  27.9M|	return YXML_CONTENT;
  147|  27.9M|}
yxml.c:yxml_datacd1:
  162|    250|static inline yxml_ret_t yxml_datacd1(yxml_t *x, unsigned ch) {
  163|    250|	x->data[0] = ']';
  164|    250|	yxml_setchar(x->data+1, ch);
  165|    250|	x->data[2] = 0;
  166|    250|	return YXML_CONTENT;
  167|    250|}
yxml.c:yxml_datacd2:
  169|    340|static inline yxml_ret_t yxml_datacd2(yxml_t *x, unsigned ch) {
  170|    340|	x->data[0] = ']';
  171|    340|	x->data[1] = ']';
  172|    340|	yxml_setchar(x->data+2, ch);
  173|    340|	x->data[3] = 0;
  174|    340|	return YXML_CONTENT;
  175|    340|}
yxml.c:yxml_elemname:
  211|   515k|static inline yxml_ret_t yxml_elemname   (yxml_t *x, unsigned ch) { return yxml_pushstackc(x, ch); }
yxml.c:yxml_elemnameend:
  212|  10.6M|static inline yxml_ret_t yxml_elemnameend(yxml_t *x, unsigned ch) { return YXML_ELEMSTART; }
yxml.c:yxml_attrstart:
  242|  4.05M|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.6M|static yxml_ret_t yxml_pushstack(yxml_t *x, char **res, unsigned ch) {
  185|  14.6M|	if(x->stacklen+2 >= x->stacksize)
  ------------------
  |  Branch (185:5): [True: 4, False: 14.6M]
  ------------------
  186|      4|		return YXML_ESTACK;
  187|  14.6M|	x->stacklen++;
  188|  14.6M|	*res = (char *)x->stack+x->stacklen;
  189|  14.6M|	x->stack[x->stacklen] = (unsigned char)ch;
  190|  14.6M|	x->stacklen++;
  191|  14.6M|	x->stack[x->stacklen] = 0;
  192|  14.6M|	return YXML_OK;
  193|  14.6M|}
yxml.c:yxml_selfclose:
  216|  10.6M|static yxml_ret_t yxml_selfclose(yxml_t *x, unsigned ch) {
  217|  10.6M|	yxml_popstack(x);
  218|  10.6M|	if(x->stacklen) {
  ------------------
  |  Branch (218:5): [True: 10.6M, False: 4.93k]
  ------------------
  219|  10.6M|		x->elem = (char *)x->stack+x->stacklen-1;
  220|  38.1M|		while(*(x->elem-1))
  ------------------
  |  Branch (220:9): [True: 27.5M, False: 10.6M]
  ------------------
  221|  27.5M|			x->elem--;
  222|  10.6M|		return YXML_ELEMEND;
  223|  10.6M|	}
  224|  4.93k|	x->elem = (char *)x->stack;
  225|  4.93k|	x->state = YXMLS_misc3;
  226|  4.93k|	return YXML_ELEMEND;
  227|  10.6M|}
yxml.c:yxml_elemclose:
  229|  82.9k|static inline yxml_ret_t yxml_elemclose(yxml_t *x, unsigned ch) {
  230|  82.9k|	if(*((unsigned char *)x->elem) != ch)
  ------------------
  |  Branch (230:5): [True: 87, False: 82.8k]
  ------------------
  231|     87|		return YXML_ECLOSE;
  232|  82.8k|	x->elem++;
  233|  82.8k|	return YXML_OK;
  234|  82.9k|}
yxml.c:yxml_elemcloseend:
  236|  34.4k|static inline yxml_ret_t yxml_elemcloseend(yxml_t *x, unsigned ch) {
  237|  34.4k|	if(*x->elem)
  ------------------
  |  Branch (237:5): [True: 8, False: 34.4k]
  ------------------
  238|      8|		return YXML_ECLOSE;
  239|  34.4k|	return yxml_selfclose(x, ch);
  240|  34.4k|}
yxml.c:yxml_elemstart:
  210|  10.6M|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.08k|static inline yxml_ret_t yxml_piname   (yxml_t *x, unsigned ch) { return yxml_pushstackc(x, ch); }
yxml.c:yxml_pinameend:
  250|  3.64k|static inline yxml_ret_t yxml_pinameend(yxml_t *x, unsigned ch) {
  251|  3.64k|	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.67k, False: 1.97k]
  |  Branch (251:33): [True: 926, False: 747]
  |  Branch (251:57): [True: 490, False: 436]
  |  Branch (251:81): [True: 14, False: 476]
  ------------------
  252|  3.64k|}
yxml.c:yxml_datapi1:
  149|  7.37k|static inline yxml_ret_t yxml_datapi1(yxml_t *x, unsigned ch) {
  150|  7.37k|	yxml_setchar(x->data, ch);
  151|  7.37k|	x->data[1] = 0;
  152|  7.37k|	return YXML_PICONTENT;
  153|  7.37k|}
yxml.c:yxml_pivalend:
  253|  3.47k|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|    427|static inline yxml_ret_t yxml_datapi2(yxml_t *x, unsigned ch) {
  156|    427|	x->data[0] = '?';
  157|    427|	yxml_setchar(x->data+1, ch);
  158|    427|	x->data[2] = 0;
  159|    427|	return YXML_PICONTENT;
  160|    427|}
yxml.c:yxml_piabort:
  249|    634|static inline yxml_ret_t yxml_piabort  (yxml_t *x, unsigned ch) { yxml_popstack(x); return YXML_OK; }

UA_STRING:
  220|    620|UA_STRING(char *chars) {
  221|    620|    UA_String s = {0, NULL};
  222|    620|    if(!chars)
  ------------------
  |  Branch (222:8): [True: 0, False: 620]
  ------------------
  223|      0|        return s;
  224|    620|    s.length = strlen(chars);
  225|    620|    s.data = (UA_Byte*)chars;
  226|    620|    return s;
  227|    620|}
UA_String_equal_ignorecase:
  269|    330|UA_String_equal_ignorecase(const UA_String *s1, const UA_String *s2) {
  270|    330|    if(s1->length != s2->length)
  ------------------
  |  Branch (270:8): [True: 38, False: 292]
  ------------------
  271|     38|        return false;
  272|    292|    if(s1->length == 0)
  ------------------
  |  Branch (272:8): [True: 0, False: 292]
  ------------------
  273|      0|        return true;
  274|    292|    if(s2->data == NULL)
  ------------------
  |  Branch (274:8): [True: 0, False: 292]
  ------------------
  275|      0|        return false;
  276|       |
  277|    292|    return casecmp(s1->data, s2->data, s1->length) == 0;
  278|    292|}
UA_DateTime_parse:
  532|     39|UA_DateTime_parse(UA_DateTime *dst, const UA_String str) {
  533|     39|    if(str.length == 0)
  ------------------
  |  Branch (533:8): [True: 39, False: 0]
  ------------------
  534|     39|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     39|#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))) {                                                    \
  |  |  ------------------
  |  |  |  |  565|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (565: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))) {                                                    \
  |  |  ------------------
  |  |  |  |  565|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (565:25): [True: 0, False: 0]
  |  |  |  |  |  Branch (565:43): [True: 0, False: 0]
  |  |  |  |  |  Branch (565: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))) {                                                    \
  |  |  ------------------
  |  |  |  |  565|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (565:25): [True: 0, False: 0]
  |  |  |  |  |  Branch (565:43): [True: 0, False: 0]
  |  |  |  |  |  Branch (565: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))) {                                                    \
  |  |  ------------------
  |  |  |  |  565|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (565: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))) {                                                    \
  |  |  ------------------
  |  |  |  |  565|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (565: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))) {                                                    \
  |  |  ------------------
  |  |  |  |  565|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (565: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))) {                                                    \
  |  |  ------------------
  |  |  |  |  565|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (565:25): [True: 0, False: 0]
  |  |  |  |  |  Branch (565:43): [True: 0, False: 0]
  |  |  |  |  |  Branch (565: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))) {                                                    \
  |  |  ------------------
  |  |  |  |  565|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (565: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))) {                                                    \
  |  |  ------------------
  |  |  |  |  565|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (565: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))) {                                                    \
  |  |  ------------------
  |  |  |  |  565|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (565: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))) {                                                    \
  |  |  ------------------
  |  |  |  |  565|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (565: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))) {                                                    \
  |  |  ------------------
  |  |  |  |  565|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (565: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))) {                                                    \
  |  |  ------------------
  |  |  |  |  565|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (565: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))) {                                                    \
  |  |  ------------------
  |  |  |  |  565|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (565: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))) {                                                    \
  |  |  ------------------
  |  |  |  |  565|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (565: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))) {                                                    \
  |  |  ------------------
  |  |  |  |  565|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (565: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))) {                                                    \
  |  |  ------------------
  |  |  |  |  565|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (565: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))) {                                                    \
  |  |  ------------------
  |  |  |  |  565|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (565: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))) {                                                    \
  |  |  ------------------
  |  |  |  |  565|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (565: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))) {                                                    \
  |  |  ------------------
  |  |  |  |  565|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (565: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.50k|UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length) {
  759|  2.50k|    UA_ByteString_init(bs);
  760|  2.50k|    if(length == 0) {
  ------------------
  |  Branch (760:8): [True: 0, False: 2.50k]
  ------------------
  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.50k|    bs->data = (u8*)UA_calloc(1,length);
  ------------------
  |  |   20|  2.50k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  765|  2.50k|    if(UA_UNLIKELY(!bs->data))
  ------------------
  |  |  565|  2.50k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (565:25): [True: 0, False: 2.50k]
  |  |  ------------------
  ------------------
  766|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  767|  2.50k|    bs->length = length;
  768|  2.50k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  2.50k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  769|  2.50k|}
nodeId_printEscape:
 1022|     58|                   const UA_NamespaceMapping *nsMapping, UA_Escaping idEsc) {
 1023|       |    /* Try to map the NamespaceIndex to the Uri */
 1024|     58|    UA_String nsUri = UA_STRING_NULL;
 1025|     58|    if(id->namespaceIndex > 0 && nsMapping)
  ------------------
  |  Branch (1025:8): [True: 0, False: 58]
  |  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|     58|    u8 nsStr[7];
 1030|     58|    u8 numIdStr[12];
 1031|     58|    size_t idLen = nodeIdSize(id, nsStr, numIdStr, nsUri, idEsc);
 1032|     58|    if(idLen == 0)
  ------------------
  |  Branch (1032:8): [True: 0, False: 58]
  ------------------
 1033|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 1034|       |
 1035|       |    /* Allocate memory if required */
 1036|     58|    if(output->length == 0) {
  ------------------
  |  Branch (1036:8): [True: 58, False: 0]
  ------------------
 1037|     58|        UA_StatusCode res = UA_ByteString_allocBuffer((UA_ByteString*)output, idLen);
 1038|     58|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|     58|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1038:12): [True: 0, False: 58]
  ------------------
 1039|      0|            return res;
 1040|     58|    } 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|     58|    u8 *pos = printNodeIdBody(id, nsUri, nsStr, numIdStr, output->data, nsMapping, idEsc);
 1048|     58|    output->length = (size_t)(pos - output->data);
 1049|     58|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     58|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1050|     58|}
UA_NodeId_printEx:
 1054|     58|                  const UA_NamespaceMapping *nsMapping) {
 1055|     58|    return nodeId_printEscape(id, output, nsMapping, UA_ESCAPING_NONE);
 1056|     58|}
UA_ExtensionObject_setValue:
 1292|     58|                            const UA_DataType *type) {
 1293|     58|    UA_ExtensionObject_init(eo);
 1294|     58|    eo->content.decoded.data = p;
 1295|     58|    eo->content.decoded.type = type;
 1296|     58|    eo->encoding = UA_EXTENSIONOBJECT_DECODED;
 1297|     58|}
UA_Variant_isScalar:
 1349|  2.44k|UA_Variant_isScalar(const UA_Variant *v) {
 1350|  2.44k|    return (v->type != NULL && v->arrayLength == 0 &&
  ------------------
  |  Branch (1350:13): [True: 2.44k, False: 0]
  |  Branch (1350:32): [True: 2.44k, False: 0]
  ------------------
 1351|  2.44k|            v->data > UA_EMPTY_ARRAY_SENTINEL);
  ------------------
  |  |  755|  2.44k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1351:13): [True: 2.42k, False: 16]
  ------------------
 1352|  2.44k|}
UA_new:
 1893|  3.93k|UA_new(const UA_DataType *type) {
 1894|  3.93k|    void *p = UA_calloc(1, type->memSize);
  ------------------
  |  |   20|  3.93k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1895|  3.93k|    return p;
 1896|  3.93k|}
UA_copy:
 2059|     90|UA_copy(const void *src, void *dst, const UA_DataType *type) {
 2060|     90|    memset(dst, 0, type->memSize); /* init */
 2061|     90|    UA_StatusCode retval = copyJumpTable[type->typeKind](src, dst, type);
 2062|     90|    if(retval != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|     90|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2062:8): [True: 0, False: 90]
  ------------------
 2063|      0|        UA_clear(dst, type);
 2064|     90|    return retval;
 2065|     90|}
UA_clear:
 2162|  7.20k|UA_clear(void *p, const UA_DataType *type) {
 2163|  7.20k|    clearJumpTable[type->typeKind](p, type);
 2164|  7.20k|    memset(p, 0, type->memSize); /* init */
 2165|  7.20k|}
UA_order:
 2616|  9.37k|UA_Order UA_order(const void *p1, const void *p2, const UA_DataType *type) {
 2617|  9.37k|    return orderJumpTable[type->typeKind](p1, p2, type);
 2618|  9.37k|}
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|     90|              void **dst, const UA_DataType *type) {
 2641|     90|    if(size == 0) {
  ------------------
  |  Branch (2641:8): [True: 0, False: 90]
  ------------------
 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|     90|    if(UA_UNLIKELY(!type || !src))
  ------------------
  |  |  565|    180|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (565:25): [True: 0, False: 90]
  |  |  |  Branch (565:43): [True: 0, False: 90]
  |  |  |  Branch (565:43): [True: 0, False: 90]
  |  |  ------------------
  ------------------
 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|     90|    *dst = UA_calloc(size, type->memSize);
  ------------------
  |  |   20|     90|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2656|     90|    if(!*dst)
  ------------------
  |  Branch (2656:8): [True: 0, False: 90]
  ------------------
 2657|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2658|       |
 2659|     90|    if(type->pointerFree) {
  ------------------
  |  Branch (2659:8): [True: 90, False: 0]
  ------------------
 2660|     90|        memcpy(*dst, src, type->memSize * size);
 2661|     90|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     90|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2662|     90|    }
 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|     90|}
UA_Array_delete:
 2768|  6.94k|UA_Array_delete(void *p, size_t size, const UA_DataType *type) {
 2769|  6.94k|    if(!type->pointerFree) {
  ------------------
  |  Branch (2769:8): [True: 427, False: 6.51k]
  ------------------
 2770|    427|        uintptr_t ptr = (uintptr_t)p;
 2771|    805|        for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2771:27): [True: 378, False: 427]
  ------------------
 2772|    378|            UA_clear((void*)ptr, type);
 2773|    378|            ptr += type->memSize;
 2774|    378|        }
 2775|    427|    }
 2776|  6.94k|    UA_free((void*)((uintptr_t)p & ~(uintptr_t)UA_EMPTY_ARRAY_SENTINEL));
  ------------------
  |  |   19|  6.94k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2777|  6.94k|}
ua_types.c:casecmp:
  260|    292|casecmp(const UA_Byte *l, const UA_Byte *r, size_t n) {
  261|    292|    if(!n--) return 0;
  ------------------
  |  Branch (261:8): [True: 0, False: 292]
  ------------------
  262|    632|    for(; *l && *r && n && (*l == *r || lowercase(*l) == lowercase(*r)); l++, r++, n--);
  ------------------
  |  Branch (262:11): [True: 632, False: 0]
  |  Branch (262:17): [True: 632, False: 0]
  |  Branch (262:23): [True: 466, False: 166]
  |  Branch (262:29): [True: 319, False: 147]
  |  Branch (262:41): [True: 21, False: 126]
  ------------------
  263|    292|    return lowercase(*l) - lowercase(*r);
  264|    292|}
ua_types.c:lowercase:
  254|    878|lowercase(UA_Byte c) {
  255|    878|    if(((int)c) - 'A' < 26) return c | 32;
  ------------------
  |  Branch (255:8): [True: 593, False: 285]
  ------------------
  256|    285|    return c;
  257|    878|}
ua_types.c:nodeIdSize:
  921|     58|           UA_Escaping idEsc) {
  922|       |    /* Namespace length */
  923|     58|    size_t len = 0;
  924|     58|    if(nsUri.data != NULL) {
  ------------------
  |  Branch (924:8): [True: 0, False: 58]
  ------------------
  925|      0|        len += 5; /* nsu=; */
  926|      0|        len += UA_String_escapedSize(nsUri, UA_ESCAPING_PERCENT);
  927|     58|    } else if(id->namespaceIndex > 0) {
  ------------------
  |  Branch (927:15): [True: 0, False: 58]
  ------------------
  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|     58|    len += 2; /* ?= */
  935|       |
  936|     58|    switch (id->identifierType) {
  937|     58|    case UA_NODEIDTYPE_NUMERIC: {
  ------------------
  |  Branch (937:5): [True: 58, False: 0]
  ------------------
  938|     58|        size_t numIdStrSize = itoaUnsigned(id->identifier.numeric, (char*)numIdStr, 10);
  939|     58|        numIdStr[numIdStrSize] = 0;
  940|     58|        len += numIdStrSize;
  941|     58|        break;
  942|      0|    }
  943|      0|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (943:5): [True: 0, False: 58]
  ------------------
  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: 58]
  ------------------
  947|      0|        len += 36;
  948|      0|        break;
  949|      0|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (949:5): [True: 0, False: 58]
  ------------------
  950|      0|        len += 4 * ((id->identifier.byteString.length + 2) / 3);
  951|      0|        break;
  952|      0|    default:
  ------------------
  |  Branch (952:5): [True: 0, False: 58]
  ------------------
  953|      0|        len = 0;
  954|     58|    }
  955|     58|    return len;
  956|     58|}
ua_types.c:printNodeIdBody:
  960|     58|                const UA_NamespaceMapping *nsMapping, UA_Escaping idEsc) {
  961|     58|    size_t len;
  962|       |
  963|       |    /* Encode the namespace */
  964|     58|    if(nsUri.data != NULL) {
  ------------------
  |  Branch (964:8): [True: 0, False: 58]
  ------------------
  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|     58|    } else if(id->namespaceIndex > 0) {
  ------------------
  |  Branch (969:15): [True: 0, False: 58]
  ------------------
  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|     58|    switch(id->identifierType) {
  ------------------
  |  Branch (979:12): [True: 58, False: 0]
  ------------------
  980|     58|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (980:5): [True: 58, False: 0]
  ------------------
  981|     58|        memcpy(pos, "i=", 2);
  982|     58|        pos += 2;
  983|     58|        len = strlen((char*)numIdStr);
  984|     58|        memcpy(pos, numIdStr, len);
  985|     58|        pos += len;
  986|     58|        break;
  987|      0|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (987:5): [True: 0, False: 58]
  ------------------
  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: 58]
  ------------------
  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: 58]
  ------------------
  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|     58|    }
 1017|     58|    return pos;
 1018|     58|}
ua_types.c:Variant_clear:
 1370|  4.32k|Variant_clear(UA_Variant *p, const UA_DataType *_) {
 1371|       |    /* The content is "borrowed" */
 1372|  4.32k|    if(p->storageType == UA_VARIANT_DATA_NODELETE)
  ------------------
  |  Branch (1372:8): [True: 0, False: 4.32k]
  ------------------
 1373|      0|        return;
 1374|       |
 1375|       |    /* Delete the value */
 1376|  4.32k|    if(p->type && p->data > UA_EMPTY_ARRAY_SENTINEL) {
  ------------------
  |  |  755|  3.94k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1376:8): [True: 3.94k, False: 377]
  |  Branch (1376:19): [True: 3.93k, False: 16]
  ------------------
 1377|  3.93k|        if(p->arrayLength == 0)
  ------------------
  |  Branch (1377:12): [True: 3.93k, False: 0]
  ------------------
 1378|  3.93k|            p->arrayLength = 1;
 1379|  3.93k|        UA_Array_delete(p->data, p->arrayLength, p->type);
 1380|  3.93k|        p->data = NULL;
 1381|  3.93k|    }
 1382|       |
 1383|       |    /* Delete the array dimensions */
 1384|  4.32k|    if((void*)p->arrayDimensions > UA_EMPTY_ARRAY_SENTINEL)
  ------------------
  |  |  755|  4.32k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1384:8): [True: 0, False: 4.32k]
  ------------------
 1385|      0|        UA_free(p->arrayDimensions);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1386|  4.32k|}
ua_types.c:DataValue_clear:
 1828|      2|DataValue_clear(UA_DataValue *p, const UA_DataType *_) {
 1829|       |    Variant_clear(&p->value, NULL);
 1830|      2|}
ua_types.c:String_copy:
  281|     90|String_copy(UA_String const *src, UA_String *dst, const UA_DataType *_) {
  282|     90|    UA_StatusCode res =
  283|     90|        UA_Array_copy(src->data, src->length, (void**)&dst->data,
  284|     90|                      &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|     90|#define UA_TYPES_BYTE 2
  ------------------
  285|     90|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|     90|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (285:8): [True: 90, False: 0]
  ------------------
  286|     90|        dst->length = src->length;
  287|     90|    return res;
  288|     90|}
ua_types.c:nopClear:
 2124|    317|static void nopClear(void *p, const UA_DataType *type) { }
ua_types.c:String_clear:
  291|  2.95k|String_clear(UA_String *s, const UA_DataType *_) {
  292|  2.95k|    UA_Array_delete(s->data, s->length, &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   89|  2.95k|#define UA_TYPES_BYTE 2
  ------------------
  293|  2.95k|}
ua_types.c:NodeId_clear:
  773|     57|NodeId_clear(UA_NodeId *p, const UA_DataType *_) {
  774|     57|    switch(p->identifierType) {
  775|      0|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (775:5): [True: 0, False: 57]
  ------------------
  776|      0|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (776:5): [True: 0, False: 57]
  ------------------
  777|      0|        String_clear(&p->identifier.string, NULL);
  778|      0|        break;
  779|     57|    default: break;
  ------------------
  |  Branch (779:5): [True: 57, False: 0]
  ------------------
  780|     57|    }
  781|     57|}
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|      8|QualifiedName_clear(UA_QualifiedName *p, const UA_DataType *_) {
  394|       |    String_clear(&p->name, NULL);
  395|      8|}
ua_types.c:LocalizedText_clear:
 1813|     13|LocalizedText_clear(UA_LocalizedText *p, const UA_DataType *_) {
 1814|     13|    String_clear(&p->locale, NULL);
 1815|       |    String_clear(&p->text, NULL);
 1816|     13|}
ua_types.c:ExtensionObject_clear:
 1242|     18|ExtensionObject_clear(UA_ExtensionObject *p, const UA_DataType *_) {
 1243|     18|    switch(p->encoding) {
 1244|     18|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (1244:5): [True: 18, False: 0]
  ------------------
 1245|     18|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (1245:5): [True: 0, False: 18]
  ------------------
 1246|     18|    case UA_EXTENSIONOBJECT_ENCODED_XML:
  ------------------
  |  Branch (1246:5): [True: 0, False: 18]
  ------------------
 1247|     18|        NodeId_clear(&p->content.encoded.typeId, NULL);
 1248|     18|        String_clear(&p->content.encoded.body, NULL);
 1249|     18|        break;
 1250|      0|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (1250:5): [True: 0, False: 18]
  ------------------
 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: 18]
  ------------------
 1255|      0|        break;
 1256|     18|    }
 1257|     18|}
ua_types.c:DiagnosticInfo_clear:
 1856|      3|DiagnosticInfo_clear(UA_DiagnosticInfo *p, const UA_DataType *_) {
 1857|      3|    String_clear(&p->additionalInfo, NULL);
 1858|      3|    if(p->hasInnerDiagnosticInfo && p->innerDiagnosticInfo) {
  ------------------
  |  Branch (1858:8): [True: 0, False: 3]
  |  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|      3|}
ua_types.c:clearStructure:
 2068|    199|clearStructure(void *p, const UA_DataType *type) {
 2069|    199|    uintptr_t ptr = (uintptr_t)p;
 2070|    855|    for(size_t i = 0; i < type->membersSize; ++i) {
  ------------------
  |  Branch (2070:23): [True: 656, False: 199]
  ------------------
 2071|    656|        const UA_DataTypeMember *m = &type->members[i];
 2072|    656|        const UA_DataType *mt = m->memberType;
 2073|    656|        ptr += m->padding;
 2074|    656|        if(!m->isOptional) {
  ------------------
  |  Branch (2074:12): [True: 656, False: 0]
  ------------------
 2075|    656|            if(!m->isArray) {
  ------------------
  |  Branch (2075:16): [True: 602, False: 54]
  ------------------
 2076|    602|                clearJumpTable[mt->typeKind]((void*)ptr, mt);
 2077|    602|                ptr += mt->memSize;
 2078|    602|            } else {
 2079|     54|                size_t length = *(size_t*)ptr;
 2080|     54|                ptr += sizeof(size_t);
 2081|     54|                UA_Array_delete(*(void**)ptr, length, mt);
 2082|     54|                ptr += sizeof(void*);
 2083|     54|            }
 2084|    656|        } 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|    656|    }
 2104|    199|}
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|     77|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2180|     77|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2180:12): [True: 0, False: 77]
  ------------------
 2181|     77|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2181:20): [True: 0, False: 0]
  ------------------
 2182|     77|        return UA_ORDER_EQ;                                         \
 2183|     77|    }
ua_types.c:uInt16Order:
 2179|     15|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2180|     15|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2180:12): [True: 0, False: 15]
  ------------------
 2181|     15|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2181:20): [True: 0, False: 0]
  ------------------
 2182|     15|        return UA_ORDER_EQ;                                         \
 2183|     15|    }
ua_types.c:int32Order:
 2179|    108|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2180|    108|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2180:12): [True: 0, False: 108]
  ------------------
 2181|    108|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2181:20): [True: 0, False: 0]
  ------------------
 2182|    108|        return UA_ORDER_EQ;                                         \
 2183|    108|    }
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|    140|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2180|    140|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2180:12): [True: 0, False: 140]
  ------------------
 2181|    140|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2181:20): [True: 0, False: 0]
  ------------------
 2182|    140|        return UA_ORDER_EQ;                                         \
 2183|    140|    }
ua_types.c:uInt64Order:
 2179|    108|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2180|    108|        if(*p1 != *p2)                                              \
  ------------------
  |  Branch (2180:12): [True: 0, False: 108]
  ------------------
 2181|    108|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2181:20): [True: 0, False: 0]
  ------------------
 2182|    108|        return UA_ORDER_EQ;                                         \
 2183|    108|    }
ua_types.c:doubleOrder:
 2197|    619|    NAME(const TYPE *p1, const TYPE *p2, const UA_DataType *type) { \
 2198|    619|        if(*p1 != *p2) {                                            \
  ------------------
  |  Branch (2198:12): [True: 3, False: 616]
  ------------------
 2199|      3|            /* p1 is NaN */                                         \
 2200|      3|            if(*p1 != *p1) {                                        \
  ------------------
  |  Branch (2200:16): [True: 3, False: 0]
  ------------------
 2201|      3|                if(*p2 != *p2)                                      \
  ------------------
  |  Branch (2201:20): [True: 3, False: 0]
  ------------------
 2202|      3|                    return UA_ORDER_EQ;                             \
 2203|      3|                return UA_ORDER_LESS;                               \
 2204|      3|            }                                                       \
 2205|      3|            /* p2 is NaN */                                         \
 2206|      3|            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|    619|        return UA_ORDER_EQ;                                         \
 2211|    619|    }
ua_types.c:stringOrder:
 2231|  8.25k|stringOrder(const UA_String *p1, const UA_String *p2, const UA_DataType *type) {
 2232|  8.25k|    if(p1->length != p2->length)
  ------------------
  |  Branch (2232:8): [True: 2.02k, False: 6.22k]
  ------------------
 2233|  2.02k|        return (p1->length < p2->length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2233:16): [True: 1.85k, False: 170]
  ------------------
 2234|       |    /* For zero-length arrays, every pointer not NULL is considered a
 2235|       |     * UA_EMPTY_ARRAY_SENTINEL. */
 2236|  6.22k|    if(p1->data == p2->data) return UA_ORDER_EQ;
  ------------------
  |  Branch (2236:8): [True: 58, False: 6.16k]
  ------------------
 2237|  6.16k|    if(p1->data == NULL) return UA_ORDER_LESS;
  ------------------
  |  Branch (2237:8): [True: 0, False: 6.16k]
  ------------------
 2238|  6.16k|    if(p2->data == NULL) return UA_ORDER_MORE;
  ------------------
  |  Branch (2238:8): [True: 0, False: 6.16k]
  ------------------
 2239|  6.16k|    int cmp = memcmp((const char*)p1->data, (const char*)p2->data, p1->length);
 2240|  6.16k|    if(cmp != 0)
  ------------------
  |  Branch (2240:8): [True: 2.07k, False: 4.09k]
  ------------------
 2241|  2.07k|        return (cmp < 0) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2241:16): [True: 1.36k, False: 712]
  ------------------
 2242|  4.09k|    return UA_ORDER_EQ;
 2243|  6.16k|}
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.22k|variantOrder(const UA_Variant *p1, const UA_Variant *p2, const UA_DataType *_) {
 2365|  1.22k|    if(p1->type != p2->type)
  ------------------
  |  Branch (2365:8): [True: 0, False: 1.22k]
  ------------------
 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.22k|    UA_Order o;
 2369|  1.22k|    if(p1->type != NULL) {
  ------------------
  |  Branch (2369:8): [True: 1.22k, False: 0]
  ------------------
 2370|       |        /* Check if both variants are scalars or arrays */
 2371|  1.22k|        UA_Boolean s1 = UA_Variant_isScalar(p1);
 2372|  1.22k|        UA_Boolean s2 = UA_Variant_isScalar(p2);
 2373|  1.22k|        if(s1 != s2)
  ------------------
  |  Branch (2373:12): [True: 0, False: 1.22k]
  ------------------
 2374|      0|            return s1 ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2374:20): [True: 0, False: 0]
  ------------------
 2375|  1.22k|        if(s1) {
  ------------------
  |  Branch (2375:12): [True: 1.21k, False: 8]
  ------------------
 2376|  1.21k|            o = orderJumpTable[p1->type->typeKind](p1->data, p2->data, p1->type);
 2377|  1.21k|        } 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.22k|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2383:12): [True: 0, False: 1.22k]
  ------------------
 2384|      0|            return o;
 2385|  1.22k|    }
 2386|       |
 2387|  1.22k|    if(p1->arrayDimensionsSize != p2->arrayDimensionsSize)
  ------------------
  |  Branch (2387:8): [True: 0, False: 1.22k]
  ------------------
 2388|      0|        return (p1->arrayDimensionsSize < p2->arrayDimensionsSize) ?
  ------------------
  |  Branch (2388:16): [True: 0, False: 0]
  ------------------
 2389|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2390|  1.22k|    o = UA_ORDER_EQ;
 2391|  1.22k|    if(p1->arrayDimensionsSize > 0)
  ------------------
  |  Branch (2391:8): [True: 0, False: 1.22k]
  ------------------
 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.22k|    return o;
 2396|  1.22k|}
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|  8.28k|             xml_token *tokens, unsigned int max_tokens) {
   40|  8.28k|    xml_result res;
   41|  8.28k|    memset(&res, 0, sizeof(xml_result));
   42|  8.28k|    res.tokens = tokens;
   43|       |
   44|  8.28k|    yxml_t ctx;
   45|  8.28k|    char buf[512];
   46|  8.28k|    yxml_init(&ctx, buf, 512);
   47|       |
   48|  8.28k|    unsigned char top = 0;
   49|  8.28k|    unsigned tokenPos = 0;
   50|  8.28k|    xml_token *stack[32]; /* Max nesting depth is 32 */
   51|  8.28k|    xml_token backup_tokens[32]; /* To be used when the tokens run out */
   52|       |
   53|       |    /* Help clang-analyzer */
   54|       |#ifdef __clang_analyzer__
   55|       |    memset(stack, 0, 32 * sizeof(void*));
   56|       |    memset(backup_tokens, 0, 32 * sizeof(xml_token));
   57|       |#endif
   58|       |
   59|  8.28k|    stack[top] = &backup_tokens[top];
   60|  8.28k|    memset(stack[top], 0, sizeof(xml_token));
   61|       |
   62|  8.28k|    unsigned val_begin = 0;
   63|  8.28k|    unsigned pos = 0;
   64|   129M|    for(; pos < len; pos++) {
  ------------------
  |  Branch (64:11): [True: 129M, False: 7.01k]
  ------------------
   65|       |#ifdef __clang_analyzer__
   66|       |        UA_assert(stack[top] != NULL);
   67|       |#endif
   68|   129M|        yxml_ret_t xml_status = yxml_parse(&ctx, xml[pos]);
   69|   129M|        switch(xml_status) {
   70|      0|        case YXML_EEOF:
  ------------------
  |  Branch (70:9): [True: 0, False: 129M]
  ------------------
   71|    212|        case YXML_EREF:
  ------------------
  |  Branch (71:9): [True: 212, False: 129M]
  ------------------
   72|    307|        case YXML_ECLOSE:
  ------------------
  |  Branch (72:9): [True: 95, False: 129M]
  ------------------
   73|    315|        case YXML_ESTACK:
  ------------------
  |  Branch (73:9): [True: 8, False: 129M]
  ------------------
   74|  1.21k|        case YXML_ESYN:
  ------------------
  |  Branch (74:9): [True: 899, False: 129M]
  ------------------
   75|  1.21k|        default:
  ------------------
  |  Branch (75:9): [True: 0, False: 129M]
  ------------------
   76|  1.21k|            goto errout;
   77|  72.0M|        case YXML_OK:
  ------------------
  |  Branch (77:9): [True: 72.0M, False: 57.6M]
  ------------------
   78|  72.0M|            continue;
   79|  10.6M|        case YXML_ELEMSTART:
  ------------------
  |  Branch (79:9): [True: 10.6M, False: 119M]
  ------------------
   80|  14.6M|        case YXML_ATTRSTART: {
  ------------------
  |  Branch (80:9): [True: 4.05M, False: 125M]
  ------------------
   81|  14.6M|            if(xml_status == YXML_ELEMSTART) {
  ------------------
  |  Branch (81:16): [True: 10.6M, False: 4.05M]
  ------------------
   82|  10.6M|                stack[top]->children++;
   83|  10.6M|                stack[top]->content = UA_STRING_NULL; /* Only the leaf elements have content */
   84|  10.6M|            } else {
   85|  4.05M|                stack[top]->attributes++;
   86|  4.05M|            }
   87|  14.6M|            top++;
   88|  14.6M|            if(top >= 32)
  ------------------
  |  Branch (88:16): [True: 5, False: 14.6M]
  ------------------
   89|      5|                goto errout; /* nesting too deep */
   90|  14.6M|            stack[top] = (tokenPos < max_tokens) ? &tokens[tokenPos] : &backup_tokens[top];
  ------------------
  |  Branch (90:26): [True: 7.20M, False: 7.45M]
  ------------------
   91|  14.6M|            memset(stack[top], 0, sizeof(xml_token));
   92|  14.6M|            stack[top]->type = (xml_status == YXML_ELEMSTART) ? XML_TOKEN_ELEMENT : XML_TOKEN_ATTRIBUTE;
  ------------------
  |  Branch (92:32): [True: 10.6M, False: 4.05M]
  ------------------
   93|  14.6M|            stack[top]->name = backtrackName(xml, pos);
   94|  14.6M|            const char *start = xml + pos;
   95|  14.6M|            if(xml_status == YXML_ELEMSTART) {
  ------------------
  |  Branch (95:16): [True: 10.6M, False: 4.05M]
  ------------------
   96|  32.3M|                while(*start != '<')
  ------------------
  |  Branch (96:23): [True: 21.7M, False: 10.6M]
  ------------------
   97|  21.7M|                    start--;
   98|  10.6M|            }
   99|  14.6M|            stack[top]->start = (unsigned)(start - xml);
  100|  14.6M|            tokenPos++;
  101|  14.6M|            val_begin = 0; /* if the previous non-leaf element started to collect content */
  102|  14.6M|            break;
  103|  14.6M|        }
  104|  27.9M|        case YXML_CONTENT:
  ------------------
  |  Branch (104:9): [True: 27.9M, False: 101M]
  ------------------
  105|  28.3M|        case YXML_ATTRVAL:
  ------------------
  |  Branch (105:9): [True: 403k, False: 129M]
  ------------------
  106|  28.3M|            if(val_begin == 0)
  ------------------
  |  Branch (106:16): [True: 235k, False: 28.0M]
  ------------------
  107|   235k|                val_begin = pos;
  108|  28.3M|            stack[top]->end = pos;
  109|  28.3M|            break;
  110|  10.6M|        case YXML_ELEMEND:
  ------------------
  |  Branch (110:9): [True: 10.6M, False: 119M]
  ------------------
  111|  14.6M|        case YXML_ATTREND:
  ------------------
  |  Branch (111:9): [True: 4.05M, False: 125M]
  ------------------
  112|  14.6M|            if(val_begin > 0) {
  ------------------
  |  Branch (112:16): [True: 20.2k, False: 14.6M]
  ------------------
  113|  20.2k|                stack[top]->content.data = (UA_Byte*)(uintptr_t)xml + val_begin;
  114|  20.2k|                stack[top]->content.length = stack[top]->end + 1 - val_begin;
  115|  20.2k|            }
  116|  14.6M|            stack[top]->end = pos;
  117|  14.6M|            if(xml_status == YXML_ELEMEND) {
  ------------------
  |  Branch (117:16): [True: 10.6M, False: 4.05M]
  ------------------
  118|       |                /* Saw "</", looking for the closing ">" */
  119|  11.2M|                while(stack[top]->end < len && xml[stack[top]->end] != '>')
  ------------------
  |  Branch (119:23): [True: 11.2M, False: 47]
  |  Branch (119:48): [True: 609k, False: 10.6M]
  ------------------
  120|   609k|                    stack[top]->end++;
  121|  10.6M|                stack[top]->end++;
  122|  10.6M|                if(stack[top]->end > len)
  ------------------
  |  Branch (122:20): [True: 47, False: 10.6M]
  ------------------
  123|     47|                    goto errout;
  124|  10.6M|            }
  125|  14.6M|            val_begin = 0;
  126|  14.6M|            top--;
  127|  14.6M|            break;
  128|  3.63k|        case YXML_PISTART:
  ------------------
  |  Branch (128:9): [True: 3.63k, False: 129M]
  ------------------
  129|  11.4k|        case YXML_PICONTENT:
  ------------------
  |  Branch (129:9): [True: 7.80k, False: 129M]
  ------------------
  130|  14.9k|        case YXML_PIEND:
  ------------------
  |  Branch (130:9): [True: 3.47k, False: 129M]
  ------------------
  131|  14.9k|            continue; /* Ignore processing instructions */
  132|   129M|        }
  133|   129M|    }
  134|       |
  135|       |    /* Check that all elements were closed */
  136|  7.01k|    if(yxml_eof(&ctx) != YXML_OK)
  ------------------
  |  Branch (136:8): [True: 2.19k, False: 4.82k]
  ------------------
  137|  2.19k|        goto errout;
  138|       |
  139|  4.82k|    res.num_tokens = tokenPos;
  140|  4.82k|    if(tokenPos > max_tokens)
  ------------------
  |  Branch (140:8): [True: 516, False: 4.31k]
  ------------------
  141|    516|        res.error = XML_ERROR_OVERFLOW;
  142|  4.82k|    return res;
  143|       |
  144|  3.45k| errout:
  145|  3.45k|    res.error_pos = pos;
  146|  3.45k|    res.error = XML_ERROR_INVALID;
  147|  3.45k|    return res;
  148|  7.01k|}
UA_encodeXml:
  590|  2.44k|             const UA_EncodeXmlOptions *options) {
  591|  2.44k|    if(!src || !type)
  ------------------
  |  Branch (591:8): [True: 0, False: 2.44k]
  |  Branch (591:16): [True: 0, False: 2.44k]
  ------------------
  592|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
  593|       |
  594|       |    /* Allocate buffer */
  595|  2.44k|    UA_Boolean allocated = false;
  596|  2.44k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  2.44k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  597|  2.44k|    if(outBuf->length == 0) {
  ------------------
  |  Branch (597:8): [True: 0, False: 2.44k]
  ------------------
  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.44k|    CtxXml ctx;
  607|  2.44k|    memset(&ctx, 0, sizeof(ctx));
  608|  2.44k|    ctx.pos = outBuf->data;
  609|  2.44k|    ctx.end = &outBuf->data[outBuf->length];
  610|  2.44k|    ctx.depth = 0;
  611|  2.44k|    ctx.calcOnly = false;
  612|  2.44k|    if(options) {
  ------------------
  |  Branch (612:8): [True: 0, False: 2.44k]
  ------------------
  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.44k|    res = writeXmlElement(&ctx, type->typeName, src, type);
  620|       |
  621|       |    /* Clean up */
  622|  2.44k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  2.44k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (622:8): [True: 2.44k, False: 0]
  ------------------
  623|  2.44k|        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.44k|    return res;
  628|  2.44k|}
UA_calcSizeXml:
  636|  1.33k|               const UA_EncodeXmlOptions *options) {
  637|  1.33k|    if(!src || !type)
  ------------------
  |  Branch (637:8): [True: 0, False: 1.33k]
  |  Branch (637:16): [True: 0, False: 1.33k]
  ------------------
  638|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   28|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
  639|       |
  640|       |    /* Set up the context */
  641|  1.33k|    CtxXml ctx;
  642|  1.33k|    memset(&ctx, 0, sizeof(ctx));
  643|  1.33k|    ctx.pos = NULL;
  644|  1.33k|    ctx.end = (const UA_Byte*)(uintptr_t)SIZE_MAX;
  645|  1.33k|    ctx.depth = 0;
  646|  1.33k|    if(options) {
  ------------------
  |  Branch (646:8): [True: 0, False: 1.33k]
  ------------------
  647|      0|        ctx.namespaceMapping = options->namespaceMapping;
  648|      0|        ctx.serverUris = options->serverUris;
  649|      0|        ctx.serverUrisSize = options->serverUrisSize;
  650|      0|    }
  651|       |
  652|  1.33k|    ctx.calcOnly = true;
  653|       |
  654|       |    /* Encode */
  655|  1.33k|    status ret = writeXmlElement(&ctx, type->typeName, src, type);
  656|  1.33k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  1.33k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (656:8): [True: 111, False: 1.22k]
  ------------------
  657|    111|        return 0;
  658|  1.22k|    return (size_t)ctx.pos;
  659|  1.33k|}
UA_decodeXml:
 1532|  7.76k|             const UA_DecodeXmlOptions *options) {
 1533|  7.76k|    if(!dst || !src || !type)
  ------------------
  |  Branch (1533:8): [True: 0, False: 7.76k]
  |  Branch (1533:16): [True: 0, False: 7.76k]
  |  Branch (1533:24): [True: 0, False: 7.76k]
  ------------------
 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.76k|    unsigned tokensSize = 63;
 1538|  7.76k|    xml_token tokenbuf[64];
 1539|  7.76k|    xml_token *tokens = tokenbuf;
 1540|       |
 1541|  7.76k|    xml_result res = xml_tokenize((char*)src->data, (unsigned)src->length,
 1542|  7.76k|                                  tokens + 1, tokensSize);
 1543|  7.76k|    if(res.error == XML_ERROR_OVERFLOW) {
  ------------------
  |  Branch (1543:8): [True: 516, False: 7.25k]
  ------------------
 1544|    516|        tokens = (xml_token*)UA_malloc(sizeof(xml_token) * (res.num_tokens + 1));
  ------------------
  |  |   18|    516|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 1545|    516|        if(!tokens)
  ------------------
  |  Branch (1545:12): [True: 0, False: 516]
  ------------------
 1546|      0|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   31|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1547|    516|        res = xml_tokenize((char*)src->data, (unsigned)src->length,
 1548|    516|                           tokens + 1, res.num_tokens);
 1549|    516|    }
 1550|       |
 1551|  7.76k|    if(res.error != XML_ERROR_NONE || res.num_tokens == 0) {
  ------------------
  |  Branch (1551:8): [True: 3.45k, False: 4.31k]
  |  Branch (1551:39): [True: 0, False: 4.31k]
  ------------------
 1552|  3.45k|        if(tokens != tokenbuf)
  ------------------
  |  Branch (1552:12): [True: 0, False: 3.45k]
  ------------------
 1553|      0|            UA_free(tokens);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1554|  3.45k|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|  3.45k|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1555|  3.45k|    }
 1556|       |
 1557|       |    /* Set up the context */
 1558|  4.31k|    ParseCtxXml ctx;
 1559|  4.31k|    memset(&ctx, 0, sizeof(ParseCtxXml));
 1560|  4.31k|    ctx.xml = (const char*)src->data;
 1561|  4.31k|    ctx.tokens = tokens;
 1562|  4.31k|    ctx.tokensSize = res.num_tokens;
 1563|  4.31k|    if(options) {
  ------------------
  |  Branch (1563:8): [True: 0, False: 4.31k]
  ------------------
 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.31k|    if(options && options->unwrapped) {
  ------------------
  |  Branch (1570:8): [True: 0, False: 4.31k]
  |  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.31k|    } else {
 1581|  4.31k|        ctx.tokens++; /* Skip the first token */
 1582|  4.31k|    }
 1583|       |
 1584|       |    /* Decode */
 1585|  4.31k|    memset(dst, 0, type->memSize); /* Initialize the value */
 1586|  4.31k|    UA_StatusCode ret = decodeXmlJumpTable[type->typeKind](&ctx, dst, type);
 1587|  4.31k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  4.31k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1587:8): [True: 1.75k, False: 2.55k]
  ------------------
 1588|  1.75k|        UA_clear(dst, type);
 1589|       |
 1590|       |    /* Clean up */
 1591|  4.31k|    if(tokens != tokenbuf)
  ------------------
  |  Branch (1591:8): [True: 516, False: 3.79k]
  ------------------
 1592|    516|        UA_free(tokens);
  ------------------
  |  |   19|    516|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1593|  4.31k|    return ret;
 1594|  7.76k|}
ua_types_encoding_xml.c:backtrackName:
   23|  14.6M|backtrackName(const char *xml, unsigned end) {
   24|  14.6M|    unsigned pos = end;
   25|  64.7M|    for(; pos > 0; pos--) {
  ------------------
  |  Branch (25:11): [True: 64.7M, False: 0]
  ------------------
   26|  64.7M|        unsigned char c = (unsigned char)xml[pos-1];
   27|  64.7M|        if(c >= 'a' && c <= 'z') continue; /* isAlpha */
  ------------------
  |  Branch (27:12): [True: 49.7M, False: 15.0M]
  |  Branch (27:24): [True: 4.45M, False: 45.2M]
  ------------------
   28|  60.3M|        if(c >= 'A' && c <= 'Z') continue; /* isAlpha */
  ------------------
  |  Branch (28:12): [True: 45.5M, False: 14.7M]
  |  Branch (28:24): [True: 332k, False: 45.2M]
  ------------------
   29|  59.9M|        if(c >= '0' && c <= '9') continue; /* isNum */
  ------------------
  |  Branch (29:12): [True: 55.9M, False: 4.05M]
  |  Branch (29:24): [True: 63.7k, False: 55.8M]
  ------------------
   30|  59.9M|        if(c == '_' || c >= 128 || c == '-'|| c == '.') continue;
  ------------------
  |  Branch (30:12): [True: 3.71k, False: 59.9M]
  |  Branch (30:24): [True: 45.2M, False: 14.6M]
  |  Branch (30:36): [True: 5.99k, False: 14.6M]
  |  Branch (30:47): [True: 2.55k, False: 14.6M]
  ------------------
   31|  14.6M|        break;
   32|  59.9M|    }
   33|  14.6M|    UA_String s = {end - pos, (UA_Byte*)(uintptr_t)xml + pos};
   34|  14.6M|    return s;
   35|  14.6M|}
ua_types_encoding_xml.c:Boolean_encodeXml:
  233|      6|ENCODE_XML(Boolean) {
  234|      6|    if(*src == true)
  ------------------
  |  Branch (234:8): [True: 3, False: 3]
  ------------------
  235|      3|        return xmlEncodeWriteChars(ctx, "true", 4);
  236|      3|    return xmlEncodeWriteChars(ctx, "false", 5);
  237|      6|}
ua_types_encoding_xml.c:xmlEncodeWriteChars:
  189|  72.3k|xmlEncodeWriteChars(CtxXml *ctx, const char *c, size_t len) {
  190|  72.3k|    if(ctx->pos + len > ctx->end)
  ------------------
  |  Branch (190:8): [True: 0, False: 72.3k]
  ------------------
  191|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   46|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  192|  72.3k|    if(!ctx->calcOnly && len)
  ------------------
  |  Branch (192:8): [True: 46.3k, False: 26.0k]
  |  Branch (192:26): [True: 46.3k, False: 66]
  ------------------
  193|  46.3k|        memcpy(ctx->pos, c, len);
  194|  72.3k|    ctx->pos += len;
  195|  72.3k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  72.3k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  196|  72.3k|}
ua_types_encoding_xml.c:encodeSigned:
  239|    975|static status encodeSigned(CtxXml *ctx, UA_Int64 value, char* buffer) {
  240|    975|    UA_UInt16 digits = itoaSigned(value, buffer);
  241|    975|    return xmlEncodeWriteChars(ctx, buffer, digits);
  242|    975|}
ua_types_encoding_xml.c:encodeUnsigned:
  244|    492|static status encodeUnsigned(CtxXml *ctx, UA_UInt64 value, char* buffer) {
  245|    492|    UA_UInt16 digits = itoaUnsigned(value, buffer, 10);
  246|    492|    return xmlEncodeWriteChars(ctx, buffer, digits);
  247|    492|}
ua_types_encoding_xml.c:Int16_encodeXml:
  262|    231|ENCODE_XML(Int16) {
  263|    231|    char buf[7];
  264|    231|    return encodeSigned(ctx, *src, buf);
  265|    231|}
ua_types_encoding_xml.c:UInt16_encodeXml:
  268|     45|ENCODE_XML(UInt16) {
  269|     45|    char buf[6];
  270|     45|    return encodeUnsigned(ctx, *src, buf);
  271|     45|}
ua_types_encoding_xml.c:Int32_encodeXml:
  274|    324|ENCODE_XML(Int32) {
  275|    324|    char buf[12];
  276|    324|    return encodeSigned(ctx, *src, buf);
  277|    324|}
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|    420|ENCODE_XML(Int64) {
  287|    420|    char buf[23];
  288|    420|    return encodeSigned(ctx, *src, buf);
  289|    420|}
ua_types_encoding_xml.c:UInt64_encodeXml:
  292|    324|ENCODE_XML(UInt64) {
  293|    324|    char buf[23];
  294|    324|    return encodeUnsigned(ctx, *src, buf);
  295|    324|}
ua_types_encoding_xml.c:Double_encodeXml:
  317|  1.85k|ENCODE_XML(Double) {
  318|  1.85k|    char buffer[32];
  319|  1.85k|    size_t len;
  320|  1.85k|    if(*src != *src) {
  ------------------
  |  Branch (320:8): [True: 9, False: 1.84k]
  ------------------
  321|      9|        strcpy(buffer, "NaN");
  322|      9|        len = strlen(buffer);
  323|  1.84k|    } else if(*src == INFINITY) {
  ------------------
  |  Branch (323:15): [True: 6, False: 1.84k]
  ------------------
  324|      6|        strcpy(buffer, "INF");
  325|      6|        len = strlen(buffer);
  326|  1.84k|    } else if(*src == -INFINITY) {
  ------------------
  |  Branch (326:15): [True: 6, False: 1.83k]
  ------------------
  327|      6|        strcpy(buffer, "-INF");
  328|      6|        len = strlen(buffer);
  329|  1.83k|    } else {
  330|  1.83k|        len = dtoa(*src, buffer);
  331|  1.83k|    }
  332|  1.85k|    return xmlEncodeWriteChars(ctx, buffer, len);
  333|  1.85k|}
ua_types_encoding_xml.c:String_encodeXml:
  336|    292|ENCODE_XML(String) {
  337|    292|    return xmlEncodeWriteChars(ctx, (const char*)src->data, src->length);
  338|    292|}
ua_types_encoding_xml.c:ByteString_encodeXml:
  358|     75|ENCODE_XML(ByteString) {
  359|     75|    if(!src->data)
  ------------------
  |  Branch (359:8): [True: 0, False: 75]
  ------------------
  360|      0|        return xmlEncodeWriteChars(ctx, "null", 4);
  361|       |
  362|     75|    if(src->length == 0)
  ------------------
  |  Branch (362:8): [True: 75, False: 0]
  ------------------
  363|     75|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     75|#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|     58|encodeXmlNotImplemented(CtxXml *ctx, const void *src, const UA_DataType *type) {
  550|     58|    (void)ctx, (void)src, (void)type;
  551|     58|    return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  238|     58|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
  552|     58|}
ua_types_encoding_xml.c:NodeId_encodeXml:
  389|     58|ENCODE_XML(NodeId) {
  390|     58|    UA_StatusCode ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     58|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  391|     58|    UA_String out = UA_STRING_NULL;
  392|     58|    ret |= UA_NodeId_printEx(src, &out, ctx->namespaceMapping);
  393|     58|    ret |= writeXmlElement(ctx, UA_XML_NODEID_IDENTIFIER,
  ------------------
  |  |  166|     58|#define UA_XML_NODEID_IDENTIFIER "Identifier"
  ------------------
  394|     58|                           &out, &UA_TYPES[UA_TYPES_STRING]);
  ------------------
  |  |  395|     58|#define UA_TYPES_STRING 11
  ------------------
  395|     58|    UA_String_clear(&out);
  396|     58|    return ret;
  397|     58|}
ua_types_encoding_xml.c:ExtensionObject_encodeXml:
  444|     61|ENCODE_XML(ExtensionObject) {
  445|     61|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_NOBODY)
  ------------------
  |  Branch (445:8): [True: 3, False: 58]
  ------------------
  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|     58|    UA_StatusCode ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     58|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  452|     58|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_BYTESTRING ||
  ------------------
  |  Branch (452:8): [True: 0, False: 58]
  ------------------
  453|     58|       src->encoding == UA_EXTENSIONOBJECT_ENCODED_XML) {
  ------------------
  |  Branch (453:8): [True: 0, False: 58]
  ------------------
  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|     58|    } else {
  468|       |        /* Write the decoded value */
  469|     58|        const UA_DataType *decoded_type = src->content.decoded.type;
  470|       |
  471|       |        /* Write the type NodeId */
  472|     58|        ret = writeXmlElement(ctx, UA_XML_EXTENSIONOBJECT_TYPEID,
  ------------------
  |  |  173|     58|#define UA_XML_EXTENSIONOBJECT_TYPEID "TypeId"
  ------------------
  473|     58|                              &decoded_type->typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  565|     58|#define UA_TYPES_NODEID 16
  ------------------
  474|       |
  475|       |        /* Write the body */
  476|     58|        ret |= writeXmlElemNameBegin(ctx, UA_XML_EXTENSIONOBJECT_BODY);
  ------------------
  |  |  174|     58|#define UA_XML_EXTENSIONOBJECT_BODY "Body"
  ------------------
  477|     58|        ret |= writeXmlElement(ctx, decoded_type->typeName, src->content.decoded.data, decoded_type);
  478|     58|        ret |= writeXmlElemNameEnd(ctx, UA_XML_EXTENSIONOBJECT_BODY);
  ------------------
  |  |  174|     58|#define UA_XML_EXTENSIONOBJECT_BODY "Body"
  ------------------
  479|     58|    }
  480|       |
  481|     58|    return ret;
  482|     61|}
ua_types_encoding_xml.c:writeXmlElemNameBegin:
  199|  11.4k|writeXmlElemNameBegin(CtxXml *ctx, const char* name) {
  200|  11.4k|    if(ctx->depth >= UA_XML_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   15|  11.4k|#define UA_XML_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (200:8): [True: 0, False: 11.4k]
  ------------------
  201|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  202|  11.4k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  11.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  203|  11.4k|    ret |= xmlEncodeWriteChars(ctx, "<", 1);
  204|  11.4k|    ret |= xmlEncodeWriteChars(ctx, name, strlen(name));
  205|  11.4k|    ret |= xmlEncodeWriteChars(ctx, ">", 1);
  206|  11.4k|    ctx->depth++;
  207|  11.4k|    return ret;
  208|  11.4k|}
ua_types_encoding_xml.c:writeXmlElemNameEnd:
  211|  11.4k|writeXmlElemNameEnd(CtxXml *ctx, const char* name) {
  212|  11.4k|    if(ctx->depth == 0)
  ------------------
  |  Branch (212:8): [True: 0, False: 11.4k]
  ------------------
  213|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  214|  11.4k|    ctx->depth--;
  215|  11.4k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  11.4k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  216|  11.4k|    ret |= xmlEncodeWriteChars(ctx, "</", 2);
  217|  11.4k|    ret |= xmlEncodeWriteChars(ctx, name, strlen(name));
  218|  11.4k|    ret |= xmlEncodeWriteChars(ctx, ">", 1);
  219|  11.4k|    return ret;
  220|  11.4k|}
ua_types_encoding_xml.c:Variant_encodeXml:
  518|  3.77k|ENCODE_XML(Variant) {
  519|  3.77k|    if(!src->type)
  ------------------
  |  Branch (519:8): [True: 53, False: 3.72k]
  ------------------
  520|     53|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|     53|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  521|       |
  522|       |    /* Set the array type in the encoding mask */
  523|  3.72k|    const bool isArray = src->arrayLength > 0 || src->data <= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|  7.45k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (523:26): [True: 0, False: 3.72k]
  |  Branch (523:50): [True: 24, False: 3.70k]
  ------------------
  524|       |
  525|  3.72k|    if(src->arrayDimensionsSize > 1)
  ------------------
  |  Branch (525:8): [True: 0, False: 3.72k]
  ------------------
  526|      0|        return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  238|      0|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
  527|       |
  528|  3.72k|    UA_StatusCode ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  3.72k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  529|  3.72k|    ret |= writeXmlElemNameBegin(ctx, UA_XML_VARIANT_VALUE);
  ------------------
  |  |  176|  3.72k|#define UA_XML_VARIANT_VALUE "Value"
  ------------------
  530|  3.72k|    if(!isArray) {
  ------------------
  |  Branch (530:8): [True: 3.70k, False: 24]
  ------------------
  531|  3.70k|        const UA_DataType *srctype = src->type;
  532|  3.70k|        void *ptr = src->data;
  533|  3.70k|        UA_ExtensionObject eo;
  534|  3.70k|        if(srctype->typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO) {
  ------------------
  |  Branch (534:12): [True: 58, False: 3.64k]
  ------------------
  535|       |            /* Wrap value in an ExtensionObject */
  536|     58|            UA_ExtensionObject_setValue(&eo, (void*)(uintptr_t)ptr, srctype);
  537|     58|            ptr = &eo;
  538|     58|            srctype = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  735|     58|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  539|     58|        }
  540|  3.70k|        ret |= writeXmlElement(ctx, srctype->typeName, ptr, srctype);
  541|  3.70k|    } else {
  542|     24|        ret |= Array_encodeXml(ctx, src->data, src->arrayLength, src->type);
  543|     24|    }
  544|  3.72k|    ret |= writeXmlElemNameEnd(ctx, UA_XML_VARIANT_VALUE);
  ------------------
  |  |  176|  3.72k|#define UA_XML_VARIANT_VALUE "Value"
  ------------------
  545|  3.72k|    return ret;
  546|  3.72k|}
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.65k|                const void *value, const UA_DataType *type) {
  225|  7.65k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  7.65k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  226|  7.65k|    ret |= writeXmlElemNameBegin(ctx, name);
  227|  7.65k|    ret |= encodeXmlJumpTable[type->typeKind](ctx, value, type);
  228|  7.65k|    ret |= writeXmlElemNameEnd(ctx, name);
  229|  7.65k|    return ret;
  230|  7.65k|}
ua_types_encoding_xml.c:Boolean_decodeXml:
  687|    108|DECODE_XML(Boolean) {
  688|    108|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|    108|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 108]
  |  |  ------------------
  |  |  670|    108|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|    108|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 108]
  |  |  ------------------
  ------------------
  689|    108|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|    108|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|    108|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|    108|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 108]
  |  |  ------------------
  ------------------
  690|    108|    skipXmlObject(ctx);
  691|       |
  692|    108|    if(length == 4 &&
  ------------------
  |  Branch (692:8): [True: 25, False: 83]
  ------------------
  693|     25|       data[0] == 't' && data[1] == 'r' &&
  ------------------
  |  Branch (693:8): [True: 14, False: 11]
  |  Branch (693:26): [True: 11, False: 3]
  ------------------
  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|    106|    } else if(length == 5 &&
  ------------------
  |  Branch (696:15): [True: 33, False: 73]
  ------------------
  697|     33|              data[0] == 'f' && data[1] == 'a' &&
  ------------------
  |  Branch (697:15): [True: 24, False: 9]
  |  Branch (697:33): [True: 20, False: 4]
  ------------------
  698|     20|              data[2] == 'l' && data[3] == 's' &&
  ------------------
  |  Branch (698:15): [True: 18, False: 2]
  |  Branch (698:33): [True: 10, False: 8]
  ------------------
  699|     10|              data[4] == 'e') {
  ------------------
  |  Branch (699:15): [True: 2, False: 8]
  ------------------
  700|      2|        *dst = false;
  701|    104|    } else {
  702|    104|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    104|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  703|    104|    }
  704|       |
  705|      4|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      4|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  706|    108|}
ua_types_encoding_xml.c:skipXmlObject:
  679|  3.86k|skipXmlObject(ParseCtxXml *ctx) {
  680|  3.86k|    size_t end_parent = ctx->tokens[ctx->index].end;
  681|  5.32M|    while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (681:11): [True: 5.31M, False: 3.81k]
  ------------------
  682|  5.31M|          ctx->tokens[ctx->index].end <= end_parent) {
  ------------------
  |  Branch (682:11): [True: 5.31M, False: 50]
  ------------------
  683|  5.31M|        ctx->index++;
  684|  5.31M|    }
  685|  3.86k|}
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.31k|decodeSigned(const UA_Byte *data, size_t dataSize, UA_Int64 *dst) {
  710|  1.31k|    if(!data || dataSize == 0)
  ------------------
  |  Branch (710:8): [True: 73, False: 1.24k]
  |  Branch (710:17): [True: 0, False: 1.24k]
  ------------------
  711|     73|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     73|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  712|  1.24k|    size_t len = parseInt64((const char*)data, dataSize, dst);
  713|  1.24k|    if(len == 0)
  ------------------
  |  Branch (713:8): [True: 149, False: 1.09k]
  ------------------
  714|    149|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    149|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  715|       |
  716|       |    /* There must only be whitespace between the end of the parsed number and
  717|       |     * the end of the XML section */
  718|  1.82k|    for(size_t i = len; i < dataSize; i++) {
  ------------------
  |  Branch (718:25): [True: 869, False: 952]
  ------------------
  719|    869|        if(data[i] != ' ' && data[i] - '\t' >= 5)
  ------------------
  |  Branch (719:12): [True: 770, False: 99]
  |  Branch (719:30): [True: 142, False: 628]
  ------------------
  720|    142|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    142|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  721|    869|    }
  722|       |
  723|    952|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    952|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  724|  1.09k|}
ua_types_encoding_xml.c:Byte_decodeXml:
  758|     37|DECODE_XML(Byte) {
  759|     37|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|     37|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 37]
  |  |  ------------------
  |  |  670|     37|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|     37|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 37]
  |  |  ------------------
  ------------------
  760|     37|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|     37|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|     37|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|     37|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 37]
  |  |  ------------------
  ------------------
  761|     37|    skipXmlObject(ctx);
  762|       |
  763|     37|    UA_UInt64 out = 0;
  764|     37|    UA_StatusCode s = decodeUnsigned(data, length, &out);
  765|     37|    if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   16|     74|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   73|      0|#define UA_BYTE_MAX 255
  ------------------
  |  Branch (765:8): [True: 37, False: 0]
  |  Branch (765:35): [True: 0, False: 0]
  ------------------
  766|     37|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     37|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  767|       |
  768|      0|    *dst = (UA_Byte)out;
  769|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  770|     37|}
ua_types_encoding_xml.c:decodeUnsigned:
  727|    677|decodeUnsigned(const UA_Byte *data, size_t dataSize, UA_UInt64 *dst) {
  728|    677|    if(!data || dataSize == 0)
  ------------------
  |  Branch (728:8): [True: 87, False: 590]
  |  Branch (728:17): [True: 0, False: 590]
  ------------------
  729|     87|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     87|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  730|    590|    size_t len = parseUInt64((const char*)data, dataSize, dst);
  731|    590|    if(len == 0)
  ------------------
  |  Branch (731:8): [True: 50, False: 540]
  ------------------
  732|     50|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     50|#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.29k|    for(size_t i = len; i < dataSize; i++) {
  ------------------
  |  Branch (736:25): [True: 1.85k, False: 438]
  ------------------
  737|  1.85k|        if(data[i] != ' ' && data[i] - '\t' >= 5)
  ------------------
  |  Branch (737:12): [True: 1.55k, False: 306]
  |  Branch (737:30): [True: 102, False: 1.44k]
  ------------------
  738|    102|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    102|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  739|  1.85k|    }
  740|       |
  741|    438|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    438|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  742|    540|}
ua_types_encoding_xml.c:Int16_decodeXml:
  772|    541|DECODE_XML(Int16) {
  773|    541|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|    541|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 541]
  |  |  ------------------
  |  |  670|    541|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|    541|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 541]
  |  |  ------------------
  ------------------
  774|    541|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|    541|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|    541|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|    541|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 541]
  |  |  ------------------
  ------------------
  775|    541|    skipXmlObject(ctx);
  776|       |
  777|    541|    UA_Int64 out = 0;
  778|    541|    UA_StatusCode s = decodeSigned(data, length, &out);
  779|    541|    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|    931|#define UA_INT16_MIN (-32768)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   82|    242|#define UA_INT16_MAX 32767
  ------------------
  |  Branch (779:8): [True: 151, False: 390]
  |  Branch (779:35): [True: 148, False: 242]
  |  Branch (779:57): [True: 88, False: 154]
  ------------------
  780|    387|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    387|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  781|       |
  782|    154|    *dst = (UA_Int16)out;
  783|    154|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    154|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  784|    541|}
ua_types_encoding_xml.c:UInt16_decodeXml:
  786|    167|DECODE_XML(UInt16) {
  787|    167|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|    167|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 167]
  |  |  ------------------
  |  |  670|    167|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|    167|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 167]
  |  |  ------------------
  ------------------
  788|    167|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|    167|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|    167|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|    167|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 167]
  |  |  ------------------
  ------------------
  789|    167|    skipXmlObject(ctx);
  790|       |
  791|    167|    UA_UInt64 out = 0;
  792|    167|    UA_StatusCode s = decodeUnsigned(data, length, &out);
  793|    167|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   16|    334|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   91|     94|#define UA_UINT16_MAX 65535
  ------------------
  |  Branch (793:8): [True: 73, False: 94]
  |  Branch (793:35): [True: 64, False: 30]
  ------------------
  794|    137|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    137|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  795|       |
  796|     30|    *dst = (UA_UInt16)out;
  797|     30|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     30|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  798|    167|}
ua_types_encoding_xml.c:Int32_decodeXml:
  800|    392|DECODE_XML(Int32) {
  801|    392|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|    392|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 392]
  |  |  ------------------
  |  |  670|    392|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|    392|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 392]
  |  |  ------------------
  ------------------
  802|    392|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|    392|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|    392|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|    392|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 392]
  |  |  ------------------
  ------------------
  803|    392|    skipXmlObject(ctx);
  804|       |
  805|    392|    UA_Int64 out = 0;
  806|    392|    UA_StatusCode s = decodeSigned(data, length, &out);
  807|    392|    if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   16|    784|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   99|    674|#define UA_INT32_MIN ((int32_t)-2147483648LL)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |  100|    223|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (807:8): [True: 110, False: 282]
  |  Branch (807:35): [True: 59, False: 223]
  |  Branch (807:57): [True: 7, False: 216]
  ------------------
  808|    176|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    176|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  809|       |
  810|    216|    *dst = (UA_Int32)out;
  811|    216|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    216|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  812|    392|}
ua_types_encoding_xml.c:UInt32_decodeXml:
  814|    185|DECODE_XML(UInt32) {
  815|    185|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|    185|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 185]
  |  |  ------------------
  |  |  670|    185|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|    185|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 185]
  |  |  ------------------
  ------------------
  816|    185|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|    185|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|    185|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|    185|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 185]
  |  |  ------------------
  ------------------
  817|    185|    skipXmlObject(ctx);
  818|       |
  819|    185|    UA_UInt64 out = 0;
  820|    185|    UA_StatusCode s = decodeUnsigned(data, length, &out);
  821|    185|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |   16|    370|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |  109|    128|#define UA_UINT32_MAX 4294967295UL
  ------------------
  |  Branch (821:8): [True: 57, False: 128]
  |  Branch (821:35): [True: 46, False: 82]
  ------------------
  822|    103|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    103|#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|    185|}
ua_types_encoding_xml.c:Int64_decodeXml:
  828|    349|DECODE_XML(Int64) {
  829|    349|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|    349|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 349]
  |  |  ------------------
  |  |  670|    349|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|    349|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 349]
  |  |  ------------------
  ------------------
  830|    349|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|    349|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|    349|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|    349|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 349]
  |  |  ------------------
  ------------------
  831|    349|    skipXmlObject(ctx);
  832|       |
  833|    349|    UA_Int64 out = 0;
  834|    349|    UA_StatusCode s = decodeSigned(data, length, &out);
  835|    349|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    349|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (835:8): [True: 69, False: 280]
  ------------------
  836|     69|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     69|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  837|       |
  838|    280|    *dst = (UA_Int64)out;
  839|    280|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    280|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  840|    349|}
ua_types_encoding_xml.c:UInt64_decodeXml:
  842|    288|DECODE_XML(UInt64) {
  843|    288|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|    288|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 288]
  |  |  ------------------
  |  |  670|    288|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|    288|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 288]
  |  |  ------------------
  ------------------
  844|    288|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|    288|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|    288|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|    288|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 288]
  |  |  ------------------
  ------------------
  845|    288|    skipXmlObject(ctx);
  846|       |
  847|    288|    UA_UInt64 out = 0;
  848|    288|    UA_StatusCode s = decodeUnsigned(data, length, &out);
  849|    288|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    288|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (849:8): [True: 72, False: 216]
  ------------------
  850|     72|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     72|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  851|       |
  852|    216|    *dst = (UA_UInt64)out;
  853|    216|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    216|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  854|    288|}
ua_types_encoding_xml.c:Float_decodeXml:
  904|      7|DECODE_XML(Float) {
  905|      7|    UA_Double v = 0.0;
  906|       |    UA_StatusCode res = Double_decodeXml(ctx, &v, NULL);
  907|      7|    *dst = (UA_Float)v;
  908|      7|    return res;
  909|      7|}
ua_types_encoding_xml.c:Double_decodeXml:
  856|  1.37k|DECODE_XML(Double) {
  857|  1.37k|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|  1.37k|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 1.37k]
  |  |  ------------------
  |  |  670|  1.37k|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|  1.37k|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 1.37k]
  |  |  ------------------
  ------------------
  858|  1.37k|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|  1.37k|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|  1.37k|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|  1.37k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 1.37k]
  |  |  ------------------
  ------------------
  859|  1.37k|    skipXmlObject(ctx);
  860|       |
  861|  1.37k|    if(!data || length == 0)
  ------------------
  |  Branch (861:8): [True: 38, False: 1.33k]
  |  Branch (861:17): [True: 0, False: 1.33k]
  ------------------
  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.33k|    if(length > 1075)
  ------------------
  |  Branch (867:8): [True: 20, False: 1.31k]
  ------------------
  868|     20|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     20|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  869|       |
  870|  1.31k|    if(length == 3 && memcmp(data, "INF", 3) == 0) {
  ------------------
  |  Branch (870:8): [True: 113, False: 1.19k]
  |  Branch (870:23): [True: 3, False: 110]
  ------------------
  871|      3|        *dst = INFINITY;
  872|      3|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      3|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  873|      3|    }
  874|       |
  875|  1.30k|    if(length == 4 && memcmp(data, "-INF", 4) == 0) {
  ------------------
  |  Branch (875:8): [True: 59, False: 1.25k]
  |  Branch (875:23): [True: 3, False: 56]
  ------------------
  876|      3|        *dst = -INFINITY;
  877|      3|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      3|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  878|      3|    }
  879|       |
  880|  1.30k|    if(length == 3 && memcmp(data, "NaN", 3) == 0) {
  ------------------
  |  Branch (880:8): [True: 110, False: 1.19k]
  |  Branch (880:23): [True: 4, False: 106]
  ------------------
  881|      4|        *dst = NAN;
  882|      4|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      4|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  883|      4|    }
  884|       |
  885|  1.30k|    if(length == 3 && memcmp(data, "-NaN", 3) == 0) {
  ------------------
  |  Branch (885:8): [True: 106, False: 1.19k]
  |  Branch (885:23): [True: 2, False: 104]
  ------------------
  886|      2|        *dst = NAN;
  887|      2|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|      2|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  888|      2|    }
  889|       |
  890|  1.30k|    size_t len = parseDouble((const char*)data, length, dst);
  891|  1.30k|    if(len == 0)
  ------------------
  |  Branch (891:8): [True: 39, False: 1.26k]
  ------------------
  892|     39|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     39|#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.50k|    for(size_t i = len; i < length; i++) {
  ------------------
  |  Branch (896:25): [True: 275, False: 1.22k]
  ------------------
  897|    275|        if(data[i] != ' ' && data[i] -'\t' >= 5)
  ------------------
  |  Branch (897:12): [True: 260, False: 15]
  |  Branch (897:30): [True: 35, False: 225]
  ------------------
  898|     35|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     35|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  899|    275|    }
  900|       |
  901|  1.22k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  1.22k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  902|  1.26k|}
ua_types_encoding_xml.c:String_decodeXml:
  911|    156|DECODE_XML(String) {
  912|    156|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|    156|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 156]
  |  |  ------------------
  |  |  670|    156|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|    156|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 156]
  |  |  ------------------
  ------------------
  913|    156|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|    156|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|    156|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|    156|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 156]
  |  |  ------------------
  ------------------
  914|    156|    skipXmlObject(ctx);
  915|       |
  916|       |    /* Empty string? */
  917|    156|    if(length == 0) {
  ------------------
  |  Branch (917:8): [True: 66, False: 90]
  ------------------
  918|     66|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|     66|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  919|     66|        dst->length = 0;
  920|     66|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     66|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  921|     66|    }
  922|       |
  923|     90|    UA_String str = {length, (UA_Byte*)(uintptr_t)data};
  924|     90|    return UA_String_copy(&str, dst);
  925|    156|}
ua_types_encoding_xml.c:DateTime_decodeXml:
  927|     39|DECODE_XML(DateTime) {
  928|     39|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|     39|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 39]
  |  |  ------------------
  |  |  670|     39|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|     39|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 39]
  |  |  ------------------
  ------------------
  929|     39|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|     39|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|     39|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|     39|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 39]
  |  |  ------------------
  ------------------
  930|     39|    skipXmlObject(ctx);
  931|     39|    UA_String str = {length, (UA_Byte*)(uintptr_t)data};
  932|     39|    return UA_DateTime_parse(dst, str);
  933|     39|}
ua_types_encoding_xml.c:Guid_decodeXml:
 1027|     17|DECODE_XML(Guid) {
 1028|     17|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|     17|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 17]
  |  |  ------------------
  |  |  670|     17|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|     17|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 17]
  |  |  ------------------
  ------------------
 1029|     17|    UA_String str;
 1030|     17|    UA_String_init(&str);
 1031|     17|    XmlDecodeEntry entry = {UA_STRING_STATIC(UA_XML_GUID_STRING), &str,
  ------------------
  |  |  223|     17|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1032|     17|                            NULL, false, &UA_TYPES[UA_TYPES_STRING]};
  ------------------
  |  |  395|     17|#define UA_TYPES_STRING 11
  ------------------
 1033|     17|    status ret = decodeXmlFields(ctx, &entry, 1);
 1034|     17|    ret |= UA_Guid_parse(dst, str);
 1035|     17|    UA_String_clear(&str);
 1036|     17|    return ret;
 1037|     17|}
ua_types_encoding_xml.c:decodeXmlFields:
  962|    211|decodeXmlFields(ParseCtxXml *ctx, XmlDecodeEntry *entries, size_t entryCount) {
  963|    211|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|    211|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 211]
  |  |  ------------------
  |  |  670|    211|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|    211|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 211]
  |  |  ------------------
  ------------------
  964|       |
  965|    211|    if(ctx->depth >= UA_XML_ENCODING_MAX_RECURSION)
  ------------------
  |  |   15|    211|#define UA_XML_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (965:8): [True: 0, False: 211]
  ------------------
  966|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  967|       |
  968|    211|    size_t childCount = ctx->tokens[ctx->index].children;
  969|       |
  970|       |    /* Empty object */
  971|    211|    if(childCount == 0) {
  ------------------
  |  Branch (971:8): [True: 68, False: 143]
  ------------------
  972|     68|        skipXmlObject(ctx);
  973|     68|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     68|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  974|     68|    }
  975|       |
  976|       |    /* Go to first entry element */
  977|    143|    ctx->depth++;
  978|    143|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
  979|       |
  980|    143|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    143|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  981|    156|    for(size_t i = 0; i < childCount; i++) {
  ------------------
  |  Branch (981:23): [True: 149, False: 7]
  ------------------
  982|    149|        xml_token *elem = &ctx->tokens[ctx->index];
  983|    149|        XmlDecodeEntry *entry = NULL;
  984|    377|        for(size_t j = i; j < entryCount + i; j++) {
  ------------------
  |  Branch (984:27): [True: 330, False: 47]
  ------------------
  985|       |            /* Search for key, if found outer loop will be one less. Best case
  986|       |             * if objectCount is in order! */
  987|    330|            size_t index = j % entryCount;
  988|    330|            if(!UA_String_equal_ignorecase(&elem->name, &entries[index].name))
  ------------------
  |  Branch (988:16): [True: 228, False: 102]
  ------------------
  989|    228|                continue;
  990|    102|            entry = &entries[index];
  991|    102|            break;
  992|    330|        }
  993|       |
  994|       |        /* Unknown child element */
  995|    149|        if(!entry)
  ------------------
  |  Branch (995:12): [True: 47, False: 102]
  ------------------
  996|     47|            goto errout;
  997|       |
  998|       |        /* An entry that was expected, but shall not be decoded.
  999|       |         * Jump over it. */
 1000|    102|        if(!entry->fieldPointer || (!entry->function && !entry->type)) {
  ------------------
  |  Branch (1000:12): [True: 0, False: 102]
  |  Branch (1000:37): [True: 102, False: 0]
  |  Branch (1000:57): [True: 0, False: 102]
  ------------------
 1001|      0|            skipXmlObject(ctx);
 1002|      0|            continue;
 1003|      0|        }
 1004|       |
 1005|       |        /* Duplicate child element */
 1006|    102|        if(entry->found)
  ------------------
  |  Branch (1006:12): [True: 1, False: 101]
  ------------------
 1007|      1|            goto errout;
 1008|    101|        entry->found = true;
 1009|       |
 1010|       |        /* Decode */
 1011|    101|        if(entry->function) /* Specialized decoding function */
  ------------------
  |  Branch (1011:12): [True: 0, False: 101]
  ------------------
 1012|      0|            ret = entry->function(ctx, entry->fieldPointer, entry->type);
 1013|    101|        else /* Decode by type-kind */
 1014|    101|            ret = decodeXmlJumpTable[entry->type->typeKind](ctx, entry->fieldPointer, entry->type);
 1015|    101|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|    101|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1015:12): [True: 88, False: 13]
  ------------------
 1016|     88|            goto cleanup;
 1017|    101|    }
 1018|       |
 1019|     95|cleanup:
 1020|     95|    ctx->depth--;
 1021|     95|    return ret;
 1022|     48|errout:
 1023|     48|    ctx->depth--;
 1024|     48|    return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     48|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1025|    143|}
ua_types_encoding_xml.c:ByteString_decodeXml:
 1039|    127|DECODE_XML(ByteString) {
 1040|    127|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|    127|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 127]
  |  |  ------------------
  |  |  670|    127|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|    127|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 127]
  |  |  ------------------
  ------------------
 1041|    127|    GET_ELEM_CONTENT;
  ------------------
  |  |  674|    127|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  675|    127|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  676|    127|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (676:17): [Folded, False: 127]
  |  |  ------------------
  ------------------
 1042|    127|    skipXmlObject(ctx);
 1043|       |
 1044|       |    /* Empty bytestring? */
 1045|    127|    if(length == 0) {
  ------------------
  |  Branch (1045:8): [True: 57, False: 70]
  ------------------
 1046|     57|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  755|     57|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1047|     57|        dst->length = 0;
 1048|     70|    } else {
 1049|     70|        size_t flen = 0;
 1050|     70|        unsigned char* unB64 = UA_unbase64((const unsigned char*)data, length, &flen);
 1051|     70|        if(!unB64)
  ------------------
  |  Branch (1051:12): [True: 64, False: 6]
  ------------------
 1052|     64|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     64|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1053|      6|        dst->data = (UA_Byte*)unB64;
 1054|      6|        dst->length = flen;
 1055|      6|    }
 1056|       |
 1057|     63|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     63|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1058|    127|}
ua_types_encoding_xml.c:decodeXmlNotImplemented:
 1491|      3|decodeXmlNotImplemented(ParseCtxXml *ctx, void *dst, const UA_DataType *type) {
 1492|      3|    (void)dst, (void)type, (void)ctx;
 1493|      3|    return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  238|      3|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
 1494|      3|}
ua_types_encoding_xml.c:NodeId_decodeXml:
 1060|      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: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.31k|DECODE_XML(Variant) {
 1379|  4.31k|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  669|  4.31k|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (669:8): [True: 0, False: 4.31k]
  |  |  ------------------
  |  |  670|  4.31k|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  671|  4.31k|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (671:18): [Folded, False: 4.31k]
  |  |  ------------------
  ------------------
 1380|       |
 1381|  4.31k|    if(ctx->depth >= UA_XML_ENCODING_MAX_RECURSION)
  ------------------
  |  |   15|  4.31k|#define UA_XML_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (1381:8): [True: 0, False: 4.31k]
  ------------------
 1382|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 1383|       |
 1384|  4.31k|    xml_token *tok = &ctx->tokens[ctx->index];
 1385|  4.31k|    if(tok->children == 0)
  ------------------
  |  Branch (1385:8): [True: 53, False: 4.26k]
  ------------------
 1386|     53|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|     53|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1387|  4.26k|    if(tok->children != 1)
  ------------------
  |  Branch (1387:8): [True: 149, False: 4.11k]
  ------------------
 1388|    149|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|    149|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1389|       |
 1390|       |    /* Move forward to the content */
 1391|  4.11k|    if(ctx->index + 2 >= ctx->tokensSize)
  ------------------
  |  Branch (1391:8): [True: 2, False: 4.10k]
  ------------------
 1392|      2|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      2|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1393|       |
 1394|  4.10k|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
 1395|  4.10k|    tok = &ctx->tokens[ctx->index];
 1396|  4.10k|    static UA_String valName = UA_STRING_STATIC("Value");
  ------------------
  |  |  223|  4.10k|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1397|  4.10k|    if(!UA_String_equal(&tok->name, &valName))
  ------------------
  |  Branch (1397:8): [True: 62, False: 4.04k]
  ------------------
 1398|     62|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     62|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1399|  4.04k|    if(tok->children != 1)
  ------------------
  |  Branch (1399:8): [True: 7, False: 4.04k]
  ------------------
 1400|      7|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      7|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1401|       |
 1402|       |    /* Jump to the child of the <Value> token */
 1403|  4.04k|    ctx->depth++;
 1404|  4.04k|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
 1405|  4.04k|    tok = &ctx->tokens[ctx->index];
 1406|       |
 1407|       |    /* Special case for multi-dimensional arrays */
 1408|  4.04k|    static UA_String matrName = UA_STRING_STATIC("Matrix");
  ------------------
  |  |  223|  4.04k|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1409|  4.04k|    UA_StatusCode ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|  4.04k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1410|  4.04k|    if(UA_String_equal(&tok->name, &matrName)) {
  ------------------
  |  Branch (1410:8): [True: 1, False: 4.03k]
  ------------------
 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|  4.03k|    UA_Boolean isArray = false;
 1419|  4.03k|    static char *lo = "ListOf";
 1420|  4.03k|    UA_String typeName = tok->name;
 1421|  4.03k|    if(tok->name.length > strlen(lo) &&
  ------------------
  |  Branch (1421:8): [True: 156, False: 3.88k]
  ------------------
 1422|    156|       strncmp((char*)tok->name.data, lo, strlen(lo)) == 0) {
  ------------------
  |  Branch (1422:8): [True: 17, False: 139]
  ------------------
 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|  4.03k|    dst->type = lookupTypeByName(ctx, typeName);
 1430|  4.03k|    if(!dst->type) {
  ------------------
  |  Branch (1430:8): [True: 92, False: 3.94k]
  ------------------
 1431|     92|        ctx->depth--;
 1432|     92|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     92|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1433|     92|    }
 1434|       |
 1435|       |    /* Decode */
 1436|  3.94k|    if(!isArray) {
  ------------------
  |  Branch (1436:8): [True: 3.93k, False: 16]
  ------------------
 1437|  3.93k|        dst->data = UA_new(dst->type);
 1438|  3.93k|        if(!dst->data) {
  ------------------
  |  Branch (1438:12): [True: 0, False: 3.93k]
  ------------------
 1439|      0|            ctx->depth--;
 1440|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1441|      0|        }
 1442|  3.93k|        ret = decodeXmlJumpTable[dst->type->typeKind](ctx, dst->data, dst->type);
 1443|  3.93k|    } else {
 1444|     16|        ret = Array_decodeXml(ctx, &dst->arrayLength, dst->type);
 1445|     16|    }
 1446|       |
 1447|       |    /* Unwrap ExtensionObject values in the variant */
 1448|  3.94k|    unwrapVariantExtensionObject(dst, isArray);
 1449|       |
 1450|  3.94k|    ctx->depth--;
 1451|  3.94k|    return ret;
 1452|  3.94k|}
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);
  ------------------
  |  |  385|      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);
  ------------------
  |  |  385|      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);
  ------------------
  |  |  385|      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.94k|unwrapVariantExtensionObject(UA_Variant *dst, UA_Boolean isArray) {
 1280|  3.94k|    if(dst->type != &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  735|  3.94k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (1280:8): [True: 3.94k, False: 4]
  ------------------
 1281|  3.94k|        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|  4.03k|lookupTypeByName(ParseCtxXml *ctx, UA_String typeName) {
 1259|       |    /* Search in the builtin types */
 1260|  92.2k|    for(size_t i = 0; i < UA_TYPES_COUNT; ++i) {
  ------------------
  |  |   17|  92.2k|#define UA_TYPES_COUNT 388
  ------------------
  |  Branch (1260:23): [True: 92.1k, False: 92]
  ------------------
 1261|  92.1k|        if(strncmp((char*)typeName.data, UA_TYPES[i].typeName, typeName.length) == 0)
  ------------------
  |  Branch (1261:12): [True: 3.94k, False: 88.2k]
  ------------------
 1262|  3.94k|            return &UA_TYPES[i];
 1263|  92.1k|    }
 1264|       |
 1265|       |    /* Search in the customTypes */
 1266|     92|    const UA_DataTypeArray *customTypes = ctx->customTypes;
 1267|     92|    while(customTypes) {
  ------------------
  |  Branch (1267:11): [True: 0, False: 92]
  ------------------
 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|     92|    return NULL;
 1276|     92|}
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|    194|decodeXmlStructure(ParseCtxXml *ctx, void *dst, const UA_DataType *type) {
 1456|       |    /* Check the recursion limit */
 1457|    194|    if(ctx->depth >= UA_XML_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   15|    194|#define UA_XML_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (1457:8): [True: 0, False: 194]
  ------------------
 1458|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 1459|    194|    ctx->depth++;
 1460|       |
 1461|    194|    uintptr_t ptr = (uintptr_t)dst;
 1462|    194|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   16|    194|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1463|    194|    u8 membersSize = type->membersSize;
 1464|    194|    UA_STACKARRAY(XmlDecodeEntry, entries, membersSize);
  ------------------
  |  |  361|    194|#  define UA_STACKARRAY(TYPE, NAME, SIZE) TYPE NAME[SIZE]
  ------------------
 1465|    814|    for(size_t i = 0; i < membersSize; ++i) {
  ------------------
  |  Branch (1465:23): [True: 620, False: 194]
  ------------------
 1466|    620|        const UA_DataTypeMember *m = &type->members[i];
 1467|    620|        const UA_DataType *mt = m->memberType;
 1468|    620|        entries[i].type = mt;
 1469|    620|        entries[i].name = UA_STRING((char*)(uintptr_t)m->memberName);
 1470|    620|        entries[i].found = false;
 1471|    620|        ptr += m->padding;
 1472|    620|        entries[i].fieldPointer = (void*)ptr;
 1473|    620|        if(!m->isArray) {
  ------------------
  |  Branch (1473:12): [True: 576, False: 44]
  ------------------
 1474|    576|            entries[i].function = NULL;
 1475|    576|            ptr += mt->memSize;
 1476|    576|        } else {
 1477|     44|            entries[i].function = (decodeXmlSignature)Array_decodeXml;
 1478|     44|            ptr += sizeof(size_t) + sizeof(void*);
 1479|     44|        }
 1480|    620|    }
 1481|       |
 1482|    194|    ret = decodeXmlFields(ctx, entries, membersSize);
 1483|       |
 1484|    194|    if(ctx->depth == 0)
  ------------------
  |  Branch (1484:8): [True: 0, False: 194]
  ------------------
 1485|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   40|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 1486|    194|    ctx->depth--;
 1487|    194|    return ret;
 1488|    194|}

UA_Guid_parse:
   84|     17|UA_Guid_parse(UA_Guid *guid, const UA_String str) {
   85|     17|    UA_StatusCode res = parse_guid(guid, str.data, str.data + str.length);
   86|     17|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|     17|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (86:8): [True: 17, False: 0]
  ------------------
   87|     17|        *guid = UA_GUID_NULL;
   88|     17|    return res;
   89|     17|}
ua_types_lex.c:parse_guid:
   48|     17|parse_guid(UA_Guid *guid, const UA_Byte *s, const UA_Byte *e) {
   49|     17|    size_t len = (size_t)(e - s);
   50|     17|    if(len != 36 || s[8] != '-' || s[13] != '-' || s[23] != '-')
  ------------------
  |  Branch (50:8): [True: 17, False: 0]
  |  Branch (50:21): [True: 0, False: 0]
  |  Branch (50:36): [True: 0, False: 0]
  |  Branch (50:52): [True: 0, False: 0]
  ------------------
   51|     17|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   43|     17|#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.54k|LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
   14|  6.54k|    UA_ByteString buf;
   15|  6.54k|    buf.data = (UA_Byte*)data;
   16|  6.54k|    buf.length = size;
   17|       |
   18|  6.54k|    UA_Variant value;
   19|  6.54k|    UA_Variant_init(&value);
   20|       |
   21|  6.54k|    UA_StatusCode retval = UA_decodeXml(&buf, &value, &UA_TYPES[UA_TYPES_VARIANT], NULL);
  ------------------
  |  |  803|  6.54k|#define UA_TYPES_VARIANT 23
  ------------------
   22|  6.54k|    if(retval != UA_STATUSCODE_GOOD)
  ------------------
  |  |   16|  6.54k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (22:8): [True: 5.21k, False: 1.33k]
  ------------------
   23|  5.21k|        return 0;
   24|       |
   25|       |    /* This can fail for now. For example length limits are not always computed
   26|       |     * 100% identical between encoding and decoding. */
   27|  1.33k|    size_t xmlSize = UA_calcSizeXml(&value, &UA_TYPES[UA_TYPES_VARIANT], NULL);
  ------------------
  |  |  803|  1.33k|#define UA_TYPES_VARIANT 23
  ------------------
   28|  1.33k|    if(xmlSize == 0) {
  ------------------
  |  Branch (28:8): [True: 111, False: 1.22k]
  ------------------
   29|    111|        UA_Variant_clear(&value);
   30|    111|        return 0;
   31|    111|    }
   32|       |
   33|  1.22k|    UA_ByteString buf2 = UA_BYTESTRING_NULL;
   34|  1.22k|    retval = UA_ByteString_allocBuffer(&buf2, xmlSize);
   35|  1.22k|    if(retval != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  1.22k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (35:8): [True: 0, False: 1.22k]
  ------------------
   36|      0|        UA_Variant_clear(&value);
   37|      0|        return 0;
   38|      0|    }
   39|       |
   40|  1.22k|    retval = UA_encodeXml(&value, &UA_TYPES[UA_TYPES_VARIANT], &buf2, NULL);
  ------------------
  |  |  803|  1.22k|#define UA_TYPES_VARIANT 23
  ------------------
   41|  1.22k|    UA_assert(retval == UA_STATUSCODE_GOOD);
  ------------------
  |  |  385|  1.22k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (41:5): [True: 1.22k, False: 0]
  ------------------
   42|       |
   43|  1.22k|    UA_Variant value2;
   44|  1.22k|    UA_Variant_init(&value2);
   45|  1.22k|    retval = UA_decodeXml(&buf2, &value2, &UA_TYPES[UA_TYPES_VARIANT], NULL);
  ------------------
  |  |  803|  1.22k|#define UA_TYPES_VARIANT 23
  ------------------
   46|  1.22k|    if(retval == UA_STATUSCODE_BADOUTOFMEMORY) {
  ------------------
  |  |   31|  1.22k|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  |  Branch (46:8): [True: 0, False: 1.22k]
  ------------------
   47|      0|        UA_Variant_clear(&value);
   48|      0|        UA_ByteString_clear(&buf2);
   49|      0|        return 0;
   50|      0|    }
   51|  1.22k|    UA_assert(retval == UA_STATUSCODE_GOOD);
  ------------------
  |  |  385|  1.22k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (51:5): [True: 1.22k, False: 0]
  ------------------
   52|       |
   53|  1.22k|    UA_assert(UA_order(&value, &value2, &UA_TYPES[UA_TYPES_VARIANT]) == UA_ORDER_EQ);
  ------------------
  |  |  385|  1.22k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (53:5): [True: 1.22k, False: 0]
  ------------------
   54|       |
   55|  1.22k|    UA_ByteString buf3 = UA_BYTESTRING_NULL;
   56|  1.22k|    retval = UA_ByteString_allocBuffer(&buf3, xmlSize);
   57|  1.22k|    if(retval != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   16|  1.22k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (57:8): [True: 0, False: 1.22k]
  ------------------
   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.22k|    retval = UA_encodeXml(&value2, &UA_TYPES[UA_TYPES_VARIANT], &buf3, NULL);
  ------------------
  |  |  803|  1.22k|#define UA_TYPES_VARIANT 23
  ------------------
   65|  1.22k|    UA_assert(retval == UA_STATUSCODE_GOOD);
  ------------------
  |  |  385|  1.22k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (65:5): [True: 1.22k, False: 0]
  ------------------
   66|       |
   67|  1.22k|    UA_assert(buf2.length == buf3.length);
  ------------------
  |  |  385|  1.22k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (67:5): [True: 1.22k, False: 0]
  ------------------
   68|  1.22k|    UA_assert(memcmp(buf2.data, buf3.data, buf2.length) == 0);
  ------------------
  |  |  385|  1.22k|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (68:5): [True: 1.22k, False: 0]
  ------------------
   69|       |
   70|  1.22k|    UA_Variant_clear(&value);
   71|  1.22k|    UA_Variant_clear(&value2);
   72|  1.22k|    UA_ByteString_clear(&buf2);
   73|  1.22k|    UA_ByteString_clear(&buf3);
   74|  1.22k|    return 0;
   75|  1.22k|}

fuzz_xml_decode_encode.cc:_ZL15UA_Variant_initP10UA_Variant:
  224|  7.76k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_xml_decode_encode.cc:_ZL16UA_Variant_clearP10UA_Variant:
  224|  2.55k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_xml_decode_encode.cc:_ZL19UA_ByteString_clearP9UA_String:
  224|  2.44k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_ByteString_init:
  224|  2.50k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_ExtensionObject_init:
  224|     58|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_clear:
  224|     75|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_copy:
  224|     90|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_init:
  224|     17|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_equal:
  224|  8.14k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl

