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

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

itoaUnsigned:
   42|    631|UA_UInt16 itoaUnsigned(UA_UInt64 value, char* buffer, UA_Byte base) {
   43|       |    /* consider absolute value of number */
   44|    631|    UA_UInt64 n = value;
   45|       |
   46|    631|    UA_UInt16 i = 0;
   47|  7.72k|    while (n) {
  ------------------
  |  Branch (47:12): [True: 7.09k, False: 631]
  ------------------
   48|  7.09k|        UA_UInt64 r = n % base;
   49|       |
   50|  7.09k|        if (r >= 10)
  ------------------
  |  Branch (50:13): [True: 0, False: 7.09k]
  ------------------
   51|      0|            buffer[i++] = (char)(65 + (r - 10));
   52|  7.09k|        else
   53|  7.09k|            buffer[i++] = (char)(48 + r);
   54|       |
   55|  7.09k|        n = n / base;
   56|  7.09k|    }
   57|       |    /* if number is 0 */
   58|    631|    if (i == 0)
  ------------------
  |  Branch (58:9): [True: 18, False: 613]
  ------------------
   59|     18|        buffer[i++] = '0';
   60|       |
   61|    631|    buffer[i] = '\0'; /* null terminate string */
   62|    631|    i--;
   63|       |    /* reverse the string */
   64|    631|    reverse(buffer, 0, i);
   65|    631|    i++;
   66|    631|    return i;
   67|    631|}
itoaSigned:
   70|  1.02k|UA_UInt16 itoaSigned(UA_Int64 value, char* buffer) {
   71|       |    /* Special case for UA_INT64_MIN which can not simply be negated */
   72|       |    /* it will cause a signed integer overflow */
   73|  1.02k|    UA_UInt64 n;
   74|  1.02k|    if(value == UA_INT64_MIN) {
  ------------------
  |  |  119|  1.02k|#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
  |  |  ------------------
  |  |  |  |  118|  1.02k|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  |  |  ------------------
  ------------------
  |  Branch (74:8): [True: 3, False: 1.02k]
  ------------------
   75|      3|        n = (UA_UInt64)UA_INT64_MAX + 1;
  ------------------
  |  |  118|      3|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  ------------------
   76|  1.02k|    } else {
   77|  1.02k|        n = (UA_UInt64)value;
   78|  1.02k|        if(value < 0){
  ------------------
  |  Branch (78:12): [True: 375, False: 651]
  ------------------
   79|    375|            n = (UA_UInt64)-value;
   80|    375|        }
   81|  1.02k|    }
   82|       |
   83|  1.02k|    UA_UInt16 i = 0;
   84|  10.3k|    while(n) {
  ------------------
  |  Branch (84:11): [True: 9.34k, False: 1.02k]
  ------------------
   85|  9.34k|        UA_UInt64 r = n % 10;
   86|  9.34k|        buffer[i++] = (char)('0' + r);
   87|  9.34k|        n = n / 10;
   88|  9.34k|    }
   89|       |
   90|  1.02k|    if(i == 0)
  ------------------
  |  Branch (90:8): [True: 27, False: 1.00k]
  ------------------
   91|     27|        buffer[i++] = '0'; /* if number is 0 */
   92|  1.02k|    if(value < 0)
  ------------------
  |  Branch (92:8): [True: 378, False: 651]
  ------------------
   93|    378|        buffer[i++] = '-';
   94|  1.02k|    buffer[i] = '\0'; /* null terminate string */
   95|  1.02k|    i--;
   96|  1.02k|    reverse(buffer, 0, i); /* reverse the string and return it */
   97|  1.02k|    i++;
   98|  1.02k|    return i;
   99|  1.02k|}
itoa.c:reverse:
   34|  1.66k|static char* reverse(char *buffer, UA_UInt16 i, UA_UInt16 j) {
   35|  9.64k|    while (i < j)
  ------------------
  |  Branch (35:12): [True: 7.98k, False: 1.66k]
  ------------------
   36|  7.98k|        swap(&buffer[i++], &buffer[j--]);
   37|       |
   38|  1.66k|    return buffer;
   39|  1.66k|}
itoa.c:swap:
   27|  7.98k|static void swap(char *x, char *y) {
   28|  7.98k|    char t = *x;
   29|  7.98k|    *x = *y;
   30|  7.98k|    *y = t;
   31|  7.98k|}

parseUInt64:
   30|  2.02k|parseUInt64(const char *str, size_t size, uint64_t *result) {
   31|  2.02k|    size_t i = 0;
   32|  2.02k|    uint64_t n = 0, prev = 0;
   33|       |
   34|       |    /* Hex */
   35|  2.02k|    if(size > 2 && str[0] == '0' && (str[1] | 32) == 'x') {
  ------------------
  |  Branch (35:8): [True: 1.84k, False: 188]
  |  Branch (35:20): [True: 318, False: 1.52k]
  |  Branch (35:37): [True: 181, False: 137]
  ------------------
   36|    181|        i = 2;
   37|  2.29k|        for(; i < size; i++) {
  ------------------
  |  Branch (37:15): [True: 2.15k, False: 137]
  ------------------
   38|  2.15k|            uint8_t c = (uint8_t)str[i] | 32;
   39|  2.15k|            if(c >= '0' && c <= '9')
  ------------------
  |  Branch (39:16): [True: 2.14k, False: 13]
  |  Branch (39:28): [True: 1.48k, False: 659]
  ------------------
   40|  1.48k|                c = (uint8_t)(c - '0');
   41|    672|            else if(c >= 'a' && c <='f')
  ------------------
  |  Branch (41:21): [True: 655, False: 17]
  |  Branch (41:33): [True: 635, False: 20]
  ------------------
   42|    635|                c = (uint8_t)(c - 'a' + 10);
   43|     37|            else if(c >= 'A' && c <='F')
  ------------------
  |  Branch (43:21): [True: 22, False: 15]
  |  Branch (43:33): [True: 0, False: 22]
  ------------------
   44|      0|                c = (uint8_t)(c - 'A' + 10);
   45|     37|            else
   46|     37|                break;
   47|  2.11k|            n = (n << 4) | (c & 0xF);
   48|  2.11k|            if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (48:16): [True: 7, False: 2.11k]
  ------------------
   49|      7|                return 0;
   50|  2.11k|            prev = n;
   51|  2.11k|        }
   52|    174|        *result = n;
   53|    174|        return (i > 2) ? i : 0; /* 2 -> No digit was parsed */
  ------------------
  |  Branch (53:16): [True: 168, False: 6]
  ------------------
   54|    181|    }
   55|       |
   56|       |    /* Decimal */
   57|  28.0k|    for(; i < size; i++) {
  ------------------
  |  Branch (57:11): [True: 26.7k, False: 1.29k]
  ------------------
   58|  26.7k|        if(str[i] < '0' || str[i] > '9')
  ------------------
  |  Branch (58:12): [True: 482, False: 26.2k]
  |  Branch (58:28): [True: 70, False: 26.1k]
  ------------------
   59|    552|            break;
   60|       |        /* Fast multiplication: n*10 == (n*8) + (n*2) */
   61|  26.1k|        n = (n << 3) + (n << 1) + (uint8_t)(str[i] - '0');
   62|  26.1k|        if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (62:12): [True: 1, False: 26.1k]
  ------------------
   63|      1|            return 0;
   64|  26.1k|        prev = n;
   65|  26.1k|    }
   66|  1.84k|    *result = n;
   67|  1.84k|    return i;
   68|  1.84k|}
parseInt64:
   71|  1.34k|parseInt64(const char *str, size_t size, int64_t *result) {
   72|       |    /* Negative value? */
   73|  1.34k|    size_t i = 0;
   74|  1.34k|    bool neg = false;
   75|  1.34k|    if(*str == '-' || *str == '+') {
  ------------------
  |  Branch (75:8): [True: 560, False: 780]
  |  Branch (75:23): [True: 8, False: 772]
  ------------------
   76|    568|        neg = (*str == '-');
   77|    568|        i++;
   78|    568|    }
   79|       |
   80|       |    /* Parse as unsigned */
   81|  1.34k|    uint64_t n = 0;
   82|  1.34k|    size_t len = parseUInt64(&str[i], size - i, &n);
   83|  1.34k|    if(len == 0)
  ------------------
  |  Branch (83:8): [True: 78, False: 1.26k]
  ------------------
   84|     78|        return 0;
   85|       |
   86|       |    /* Check for overflow, adjust and return */
   87|  1.26k|    if(!neg) {
  ------------------
  |  Branch (87:8): [True: 714, False: 548]
  ------------------
   88|    714|        if(n > 9223372036854775807UL)
  ------------------
  |  Branch (88:12): [True: 66, False: 648]
  ------------------
   89|     66|            return 0;
   90|    648|        *result = (int64_t)n;
   91|    648|    } else {
   92|    548|        if(n > 9223372036854775808UL)
  ------------------
  |  Branch (92:12): [True: 10, False: 538]
  ------------------
   93|     10|            return 0;
   94|    538|        *result = -(int64_t)n;
   95|    538|    }
   96|  1.18k|    return len + i;
   97|  1.26k|}
parseDouble:
   99|  1.37k|size_t parseDouble(const char *str, size_t size, double *result) {
  100|  1.37k|    char buf[2000];
  101|  1.37k|    if(size >= 2000)
  ------------------
  |  Branch (101:8): [True: 0, False: 1.37k]
  ------------------
  102|      0|        return 0;
  103|  1.37k|    memcpy(buf, str, size);
  104|  1.37k|    buf[size] = 0;
  105|  1.37k|    errno = 0;
  106|  1.37k|    char *endptr;
  107|  1.37k|    *result = strtod(buf, &endptr);
  108|  1.37k|    if(errno != 0 && errno != ERANGE)
  ------------------
  |  Branch (108:8): [True: 314, False: 1.05k]
  |  Branch (108:22): [True: 0, False: 314]
  ------------------
  109|      0|        return 0;
  110|  1.37k|    return (uintptr_t)endptr - (uintptr_t)buf;
  111|  1.37k|}

yxml_init:
  301|  8.63k|void yxml_init(yxml_t *x, void *stack, size_t stacksize) {
  302|  8.63k|	memset(x, 0, sizeof(*x));
  303|  8.63k|	x->line = 1;
  304|  8.63k|	x->stack = (unsigned char*)stack;
  305|  8.63k|	x->stacksize = stacksize;
  306|  8.63k|	*x->stack = 0;
  307|  8.63k|	x->elem = x->pi = x->attr = (char *)x->stack;
  308|  8.63k|	x->state = YXMLS_init;
  309|  8.63k|}
yxml_parse:
  311|   111M|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|   111M|	unsigned ch = (unsigned)(_ch+256) & 0xff;
  315|   111M|	if(!ch)
  ------------------
  |  Branch (315:5): [True: 4, False: 111M]
  ------------------
  316|      4|		return YXML_ESYN;
  317|   111M|	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|   111M|	if(x->ignore == ch) {
  ------------------
  |  Branch (323:5): [True: 1.68k, False: 111M]
  ------------------
  324|  1.68k|		x->ignore = 0;
  325|  1.68k|		return YXML_OK;
  326|  1.68k|	}
  327|   111M|	x->ignore = (ch == 0xd) * 0xa;
  328|   111M|	if(ch == 0xa || ch == 0xd) {
  ------------------
  |  Branch (328:5): [True: 9.32k, False: 111M]
  |  Branch (328:18): [True: 3.75M, False: 107M]
  ------------------
  329|  3.76M|		ch = 0xa;
  330|  3.76M|		x->line++;
  331|  3.76M|		x->byte = 0;
  332|  3.76M|	}
  333|   111M|	x->byte++;
  334|       |
  335|   111M|	switch((yxml_state_t)x->state) {
  ------------------
  |  Branch (335:9): [True: 111M, False: 0]
  ------------------
  336|  12.8k|	case YXMLS_string:
  ------------------
  |  Branch (336:2): [True: 12.8k, False: 111M]
  ------------------
  337|  12.8k|		if(ch == *x->string) {
  ------------------
  |  Branch (337:6): [True: 12.8k, False: 13]
  ------------------
  338|  12.8k|			x->string++;
  339|  12.8k|			if(!*x->string)
  ------------------
  |  Branch (339:7): [True: 2.39k, False: 10.4k]
  ------------------
  340|  2.39k|				x->state = x->nextstate;
  341|  12.8k|			return YXML_OK;
  342|  12.8k|		}
  343|     13|		break;
  344|  31.4M|	case YXMLS_attr0:
  ------------------
  |  Branch (344:2): [True: 31.4M, False: 80.2M]
  ------------------
  345|  31.4M|		if(yxml_isName(ch))
  ------------------
  |  |  107|  31.4M|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|  62.8M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  62.8M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 2.37M, False: 29.0M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 456, False: 29.0M]
  |  |  |  |  |  Branch (106:61): [True: 290, False: 29.0M]
  |  |  |  |  |  Branch (106:73): [True: 25.7M, False: 3.30M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|  34.7M|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 46.0k, False: 3.25M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 5.40k, False: 3.24M]
  |  |  |  Branch (107:77): [True: 963, False: 3.24M]
  |  |  ------------------
  ------------------
  346|  28.1M|			return yxml_attrname(x, ch);
  347|  3.24M|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  3.24M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 2.35M, False: 892k]
  |  |  |  Branch (101:36): [True: 296, False: 892k]
  |  |  |  Branch (101:49): [True: 655, False: 891k]
  |  |  ------------------
  ------------------
  348|  2.35M|			x->state = YXMLS_attr1;
  349|  2.35M|			return yxml_attrnameend(x, ch);
  350|  2.35M|		}
  351|   891k|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (351:6): [True: 891k, False: 24]
  ------------------
  352|   891k|			x->state = YXMLS_attr2;
  353|   891k|			return yxml_attrnameend(x, ch);
  354|   891k|		}
  355|     24|		break;
  356|  2.35M|	case YXMLS_attr1:
  ------------------
  |  Branch (356:2): [True: 2.35M, False: 109M]
  ------------------
  357|  2.35M|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  2.35M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 209, False: 2.35M]
  |  |  |  Branch (101:36): [True: 194, False: 2.35M]
  |  |  |  Branch (101:49): [True: 194, False: 2.35M]
  |  |  ------------------
  ------------------
  358|    597|			return YXML_OK;
  359|  2.35M|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (359:6): [True: 2.35M, False: 23]
  ------------------
  360|  2.35M|			x->state = YXMLS_attr2;
  361|  2.35M|			return YXML_OK;
  362|  2.35M|		}
  363|     23|		break;
  364|  3.24M|	case YXMLS_attr2:
  ------------------
  |  Branch (364:2): [True: 3.24M, False: 108M]
  ------------------
  365|  3.24M|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  3.24M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 250, False: 3.24M]
  |  |  |  Branch (101:36): [True: 219, False: 3.24M]
  |  |  |  Branch (101:49): [True: 227, False: 3.24M]
  |  |  ------------------
  ------------------
  366|    696|			return YXML_OK;
  367|  3.24M|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (367:6): [True: 888k, False: 2.35M]
  |  Branch (367:35): [True: 2.35M, False: 20]
  ------------------
  368|  3.24M|			x->state = YXMLS_attr3;
  369|  3.24M|			x->quote = ch;
  370|  3.24M|			return YXML_OK;
  371|  3.24M|		}
  372|     20|		break;
  373|  3.60M|	case YXMLS_attr3:
  ------------------
  |  Branch (373:2): [True: 3.60M, False: 108M]
  ------------------
  374|  3.60M|		if(yxml_isAttValue(ch))
  ------------------
  |  |  109|  3.60M|#define yxml_isAttValue(c) (yxml_isChar(c) && c != x->quote && c != '<' && c != '&')
  |  |  ------------------
  |  |  |  |   99|  7.21M|#define yxml_isChar(c) 1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:24): [True: 3.60M, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (109:47): [True: 358k, False: 3.24M]
  |  |  |  Branch (109:64): [True: 358k, False: 1]
  |  |  |  Branch (109:76): [True: 357k, False: 812]
  |  |  ------------------
  ------------------
  375|   357k|			return yxml_dataattr(x, ch);
  376|  3.24M|		if(ch == (unsigned char)'&') {
  ------------------
  |  Branch (376:6): [True: 812, False: 3.24M]
  ------------------
  377|    812|			x->state = YXMLS_attr4;
  378|    812|			return yxml_refstart(x, ch);
  379|    812|		}
  380|  3.24M|		if(x->quote == ch) {
  ------------------
  |  Branch (380:6): [True: 3.24M, False: 1]
  ------------------
  381|  3.24M|			x->state = YXMLS_elem2;
  382|  3.24M|			return yxml_attrvalend(x, ch);
  383|  3.24M|		}
  384|      1|		break;
  385|  3.25k|	case YXMLS_attr4:
  ------------------
  |  Branch (385:2): [True: 3.25k, False: 111M]
  ------------------
  386|  3.25k|		if(yxml_isRef(ch))
  ------------------
  |  |  113|  3.25k|#define yxml_isRef(c) (yxml_isNum(c) || yxml_isAlpha(c) || c == '#')
  |  |  ------------------
  |  |  |  |  103|  6.51k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 748, False: 2.50k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isRef(c) (yxml_isNum(c) || yxml_isAlpha(c) || c == '#')
  |  |  ------------------
  |  |  |  |  102|  5.76k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 1.23k, False: 1.27k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (113:60): [True: 507, False: 769]
  |  |  ------------------
  ------------------
  387|  2.48k|			return yxml_ref(x, ch);
  388|    769|		if(ch == (unsigned char)'\x3b') {
  ------------------
  |  Branch (388:6): [True: 751, False: 18]
  ------------------
  389|    751|			x->state = YXMLS_attr3;
  390|    751|			return yxml_refattrval(x, ch);
  391|    751|		}
  392|     18|		break;
  393|  8.94k|	case YXMLS_cd0:
  ------------------
  |  Branch (393:2): [True: 8.94k, False: 111M]
  ------------------
  394|  8.94k|		if(ch == (unsigned char)']') {
  ------------------
  |  Branch (394:6): [True: 1.08k, False: 7.85k]
  ------------------
  395|  1.08k|			x->state = YXMLS_cd1;
  396|  1.08k|			return YXML_OK;
  397|  1.08k|		}
  398|  7.85k|		if(yxml_isChar(ch))
  ------------------
  |  |   99|  7.85k|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 7.85k, Folded]
  |  |  ------------------
  ------------------
  399|  7.85k|			return yxml_datacontent(x, ch);
  400|      0|		break;
  401|  1.08k|	case YXMLS_cd1:
  ------------------
  |  Branch (401:2): [True: 1.08k, False: 111M]
  ------------------
  402|  1.08k|		if(ch == (unsigned char)']') {
  ------------------
  |  Branch (402:6): [True: 812, False: 269]
  ------------------
  403|    812|			x->state = YXMLS_cd2;
  404|    812|			return YXML_OK;
  405|    812|		}
  406|    269|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    269|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 269, Folded]
  |  |  ------------------
  ------------------
  407|    269|			x->state = YXMLS_cd0;
  408|    269|			return yxml_datacd1(x, ch);
  409|    269|		}
  410|      0|		break;
  411|  1.26k|	case YXMLS_cd2:
  ------------------
  |  Branch (411:2): [True: 1.26k, False: 111M]
  ------------------
  412|  1.26k|		if(ch == (unsigned char)']')
  ------------------
  |  Branch (412:6): [True: 470, False: 797]
  ------------------
  413|    470|			return yxml_datacontent(x, ch);
  414|    797|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (414:6): [True: 360, False: 437]
  ------------------
  415|    360|			x->state = YXMLS_misc2;
  416|    360|			return YXML_OK;
  417|    360|		}
  418|    437|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    437|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 437, Folded]
  |  |  ------------------
  ------------------
  419|    437|			x->state = YXMLS_cd0;
  420|    437|			return yxml_datacd2(x, ch);
  421|    437|		}
  422|      0|		break;
  423|    219|	case YXMLS_comment0:
  ------------------
  |  Branch (423:2): [True: 219, False: 111M]
  ------------------
  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.16k|	case YXMLS_comment1:
  ------------------
  |  Branch (429:2): [True: 1.16k, False: 111M]
  ------------------
  430|  1.16k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (430:6): [True: 1.15k, False: 11]
  ------------------
  431|  1.15k|			x->state = YXMLS_comment2;
  432|  1.15k|			return YXML_OK;
  433|  1.15k|		}
  434|     11|		break;
  435|  1.81k|	case YXMLS_comment2:
  ------------------
  |  Branch (435:2): [True: 1.81k, False: 111M]
  ------------------
  436|  1.81k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (436:6): [True: 1.49k, False: 317]
  ------------------
  437|  1.49k|			x->state = YXMLS_comment3;
  438|  1.49k|			return YXML_OK;
  439|  1.49k|		}
  440|    317|		if(yxml_isChar(ch))
  ------------------
  |  |   99|    317|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 317, Folded]
  |  |  ------------------
  ------------------
  441|    317|			return YXML_OK;
  442|      0|		break;
  443|  1.48k|	case YXMLS_comment3:
  ------------------
  |  Branch (443:2): [True: 1.48k, False: 111M]
  ------------------
  444|  1.48k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (444:6): [True: 1.09k, False: 392]
  ------------------
  445|  1.09k|			x->state = YXMLS_comment4;
  446|  1.09k|			return YXML_OK;
  447|  1.09k|		}
  448|    392|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    392|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 392, Folded]
  |  |  ------------------
  ------------------
  449|    392|			x->state = YXMLS_comment2;
  450|    392|			return YXML_OK;
  451|    392|		}
  452|      0|		break;
  453|  1.08k|	case YXMLS_comment4:
  ------------------
  |  Branch (453:2): [True: 1.08k, False: 111M]
  ------------------
  454|  1.08k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (454:6): [True: 1.07k, False: 11]
  ------------------
  455|  1.07k|			x->state = x->nextstate;
  456|  1.07k|			return YXML_OK;
  457|  1.07k|		}
  458|     11|		break;
  459|  1.92k|	case YXMLS_dt0:
  ------------------
  |  Branch (459:2): [True: 1.92k, False: 111M]
  ------------------
  460|  1.92k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (460:6): [True: 315, False: 1.60k]
  ------------------
  461|    315|			x->state = YXMLS_misc1;
  462|    315|			return YXML_OK;
  463|    315|		}
  464|  1.60k|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (464:6): [True: 258, False: 1.34k]
  |  Branch (464:35): [True: 343, False: 1.00k]
  ------------------
  465|    601|			x->state = YXMLS_dt1;
  466|    601|			x->quote = ch;
  467|    601|			x->nextstate = YXMLS_dt0;
  468|    601|			return YXML_OK;
  469|    601|		}
  470|  1.00k|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (470:6): [True: 764, False: 241]
  ------------------
  471|    764|			x->state = YXMLS_dt2;
  472|    764|			return YXML_OK;
  473|    764|		}
  474|    241|		if(yxml_isChar(ch))
  ------------------
  |  |   99|    241|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 241, Folded]
  |  |  ------------------
  ------------------
  475|    241|			return YXML_OK;
  476|      0|		break;
  477|  1.14k|	case YXMLS_dt1:
  ------------------
  |  Branch (477:2): [True: 1.14k, False: 111M]
  ------------------
  478|  1.14k|		if(x->quote == ch) {
  ------------------
  |  Branch (478:6): [True: 938, False: 205]
  ------------------
  479|    938|			x->state = x->nextstate;
  480|    938|			return YXML_OK;
  481|    938|		}
  482|    205|		if(yxml_isChar(ch))
  ------------------
  |  |   99|    205|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 205, Folded]
  |  |  ------------------
  ------------------
  483|    205|			return YXML_OK;
  484|      0|		break;
  485|    757|	case YXMLS_dt2:
  ------------------
  |  Branch (485:2): [True: 757, False: 111M]
  ------------------
  486|    757|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (486:6): [True: 194, False: 563]
  ------------------
  487|    194|			x->state = YXMLS_pi0;
  488|    194|			x->nextstate = YXMLS_dt0;
  489|    194|			return YXML_OK;
  490|    194|		}
  491|    563|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (491:6): [True: 560, False: 3]
  ------------------
  492|    560|			x->state = YXMLS_dt3;
  493|    560|			return YXML_OK;
  494|    560|		}
  495|      3|		break;
  496|    554|	case YXMLS_dt3:
  ------------------
  |  Branch (496:2): [True: 554, False: 111M]
  ------------------
  497|    554|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (497:6): [True: 194, False: 360]
  ------------------
  498|    194|			x->state = YXMLS_comment1;
  499|    194|			x->nextstate = YXMLS_dt0;
  500|    194|			return YXML_OK;
  501|    194|		}
  502|    360|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    360|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 360, Folded]
  |  |  ------------------
  ------------------
  503|    360|			x->state = YXMLS_dt4;
  504|    360|			return YXML_OK;
  505|    360|		}
  506|      0|		break;
  507|    905|	case YXMLS_dt4:
  ------------------
  |  Branch (507:2): [True: 905, False: 111M]
  ------------------
  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: 312, False: 205]
  ------------------
  515|    312|			x->state = YXMLS_dt0;
  516|    312|			return YXML_OK;
  517|    312|		}
  518|    205|		if(yxml_isChar(ch))
  ------------------
  |  |   99|    205|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 205, Folded]
  |  |  ------------------
  ------------------
  519|    205|			return YXML_OK;
  520|      0|		break;
  521|  9.78M|	case YXMLS_elem0:
  ------------------
  |  Branch (521:2): [True: 9.78M, False: 101M]
  ------------------
  522|  9.78M|		if(yxml_isName(ch))
  ------------------
  |  |  107|  9.78M|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|  19.5M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  19.5M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 301k, False: 9.47M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 625, False: 9.47M]
  |  |  |  |  |  Branch (106:61): [True: 1.09k, False: 9.47M]
  |  |  |  |  |  Branch (106:73): [True: 124k, False: 9.35M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|  19.1M|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 9.78k, False: 9.34M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 649, False: 9.34M]
  |  |  |  Branch (107:77): [True: 1.19k, False: 9.34M]
  |  |  ------------------
  ------------------
  523|   439k|			return yxml_elemname(x, ch);
  524|  9.34M|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  9.34M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 818, False: 9.33M]
  |  |  |  Branch (101:36): [True: 412, False: 9.33M]
  |  |  |  Branch (101:49): [True: 1.63k, False: 9.33M]
  |  |  ------------------
  ------------------
  525|  2.86k|			x->state = YXMLS_elem1;
  526|  2.86k|			return yxml_elemnameend(x, ch);
  527|  2.86k|		}
  528|  9.33M|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (528:6): [True: 9.30M, False: 30.1k]
  ------------------
  529|  9.30M|			x->state = YXMLS_elem3;
  530|  9.30M|			return yxml_elemnameend(x, ch);
  531|  9.30M|		}
  532|  30.1k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (532:6): [True: 30.1k, False: 30]
  ------------------
  533|  30.1k|			x->state = YXMLS_misc2;
  534|  30.1k|			return yxml_elemnameend(x, ch);
  535|  30.1k|		}
  536|     30|		break;
  537|  3.25M|	case YXMLS_elem1:
  ------------------
  |  Branch (537:2): [True: 3.25M, False: 108M]
  ------------------
  538|  3.25M|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  3.25M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 1.16k, False: 3.24M]
  |  |  |  Branch (101:36): [True: 229, False: 3.24M]
  |  |  |  Branch (101:49): [True: 341, False: 3.24M]
  |  |  ------------------
  ------------------
  539|  1.73k|			return YXML_OK;
  540|  3.24M|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (540:6): [True: 884, False: 3.24M]
  ------------------
  541|    884|			x->state = YXMLS_elem3;
  542|    884|			return YXML_OK;
  543|    884|		}
  544|  3.24M|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (544:6): [True: 447, False: 3.24M]
  ------------------
  545|    447|			x->state = YXMLS_misc2;
  546|    447|			return YXML_OK;
  547|    447|		}
  548|  3.24M|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  3.24M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  6.49M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 1.18M, False: 2.06M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 650, False: 2.06M]
  |  |  |  Branch (106:61): [True: 604, False: 2.06M]
  |  |  |  Branch (106:73): [True: 2.06M, False: 21]
  |  |  ------------------
  ------------------
  549|  3.24M|			x->state = YXMLS_attr0;
  550|  3.24M|			return yxml_attrstart(x, ch);
  551|  3.24M|		}
  552|     21|		break;
  553|  3.24M|	case YXMLS_elem2:
  ------------------
  |  Branch (553:2): [True: 3.24M, False: 108M]
  ------------------
  554|  3.24M|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  3.24M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 887k, False: 2.36M]
  |  |  |  Branch (101:36): [True: 566, False: 2.35M]
  |  |  |  Branch (101:49): [True: 2.35M, False: 960]
  |  |  ------------------
  ------------------
  555|  3.24M|			x->state = YXMLS_elem1;
  556|  3.24M|			return YXML_OK;
  557|  3.24M|		}
  558|    960|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (558:6): [True: 726, False: 234]
  ------------------
  559|    726|			x->state = YXMLS_elem3;
  560|    726|			return YXML_OK;
  561|    726|		}
  562|    234|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (562:6): [True: 212, False: 22]
  ------------------
  563|    212|			x->state = YXMLS_misc2;
  564|    212|			return YXML_OK;
  565|    212|		}
  566|     22|		break;
  567|  9.30M|	case YXMLS_elem3:
  ------------------
  |  Branch (567:2): [True: 9.30M, False: 102M]
  ------------------
  568|  9.30M|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (568:6): [True: 9.30M, False: 14]
  ------------------
  569|  9.30M|			x->state = YXMLS_misc2;
  570|  9.30M|			return yxml_selfclose(x, ch);
  571|  9.30M|		}
  572|     14|		break;
  573|    789|	case YXMLS_enc0:
  ------------------
  |  Branch (573:2): [True: 789, False: 111M]
  ------------------
  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: 198, False: 9]
  ------------------
  577|    198|			x->state = YXMLS_enc1;
  578|    198|			return YXML_OK;
  579|    198|		}
  580|      9|		break;
  581|    755|	case YXMLS_enc1:
  ------------------
  |  Branch (581:2): [True: 755, False: 111M]
  ------------------
  582|    755|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    755|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 561]
  |  |  |  Branch (101:36): [True: 194, False: 367]
  |  |  |  Branch (101:49): [True: 194, False: 173]
  |  |  ------------------
  ------------------
  583|    582|			return YXML_OK;
  584|    173|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (584:6): [True: 34, False: 139]
  |  Branch (584:35): [True: 120, False: 19]
  ------------------
  585|    154|			x->state = YXMLS_enc2;
  586|    154|			x->quote = ch;
  587|    154|			return YXML_OK;
  588|    154|		}
  589|     19|		break;
  590|    152|	case YXMLS_enc2:
  ------------------
  |  Branch (590:2): [True: 152, False: 111M]
  ------------------
  591|    152|		if(yxml_isAlpha(ch)) {
  ------------------
  |  |  102|    152|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  ------------------
  |  |  |  Branch (102:25): [True: 143, False: 9]
  |  |  ------------------
  ------------------
  592|    143|			x->state = YXMLS_enc3;
  593|    143|			return YXML_OK;
  594|    143|		}
  595|      9|		break;
  596|  1.13k|	case YXMLS_enc3:
  ------------------
  |  Branch (596:2): [True: 1.13k, False: 111M]
  ------------------
  597|  1.13k|		if(yxml_isEncName(ch))
  ------------------
  |  |  105|  1.13k|#define yxml_isEncName(c) (yxml_isAlpha(c) || yxml_isNum(c) || c == '.' || c == '_' || c == '-')
  |  |  ------------------
  |  |  |  |  102|  2.26k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 223, False: 911]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isEncName(c) (yxml_isAlpha(c) || yxml_isNum(c) || c == '.' || c == '_' || c == '-')
  |  |  ------------------
  |  |  |  |  103|  2.04k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 204, False: 707]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:64): [True: 206, False: 501]
  |  |  |  Branch (105:76): [True: 208, False: 293]
  |  |  |  Branch (105:88): [True: 196, False: 97]
  |  |  ------------------
  ------------------
  598|  1.03k|			return YXML_OK;
  599|     97|		if(x->quote == ch) {
  ------------------
  |  Branch (599:6): [True: 79, False: 18]
  ------------------
  600|     79|			x->state = YXMLS_xmldecl6;
  601|     79|			return YXML_OK;
  602|     79|		}
  603|     18|		break;
  604|  28.5k|	case YXMLS_etag0:
  ------------------
  |  Branch (604:2): [True: 28.5k, False: 111M]
  ------------------
  605|  28.5k|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  28.5k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  57.1k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 11.8k, False: 16.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 548, False: 16.1k]
  |  |  |  Branch (106:61): [True: 546, False: 15.6k]
  |  |  |  Branch (106:73): [True: 15.5k, False: 19]
  |  |  ------------------
  ------------------
  606|  28.5k|			x->state = YXMLS_etag1;
  607|  28.5k|			return yxml_elemclose(x, ch);
  608|  28.5k|		}
  609|     19|		break;
  610|  78.1k|	case YXMLS_etag1:
  ------------------
  |  Branch (610:2): [True: 78.1k, False: 111M]
  ------------------
  611|  78.1k|		if(yxml_isName(ch))
  ------------------
  |  |  107|  78.1k|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|   156k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|   156k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 44.6k, False: 33.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 202, False: 33.2k]
  |  |  |  |  |  Branch (106:61): [True: 462, False: 32.7k]
  |  |  |  |  |  Branch (106:73): [True: 348, False: 32.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|   110k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 3.59k, False: 28.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 195, False: 28.6k]
  |  |  |  Branch (107:77): [True: 194, False: 28.4k]
  |  |  ------------------
  ------------------
  612|  49.6k|			return yxml_elemclose(x, ch);
  613|  28.4k|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  28.4k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 279, False: 28.1k]
  |  |  |  Branch (101:36): [True: 215, False: 27.9k]
  |  |  |  Branch (101:49): [True: 395, False: 27.5k]
  |  |  ------------------
  ------------------
  614|    889|			x->state = YXMLS_etag2;
  615|    889|			return yxml_elemcloseend(x, ch);
  616|    889|		}
  617|  27.5k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (617:6): [True: 27.5k, False: 21]
  ------------------
  618|  27.5k|			x->state = YXMLS_misc2;
  619|  27.5k|			return yxml_elemcloseend(x, ch);
  620|  27.5k|		}
  621|     21|		break;
  622|  1.43k|	case YXMLS_etag2:
  ------------------
  |  Branch (622:2): [True: 1.43k, False: 111M]
  ------------------
  623|  1.43k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.43k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 199, False: 1.23k]
  |  |  |  Branch (101:36): [True: 194, False: 1.03k]
  |  |  |  Branch (101:49): [True: 198, False: 840]
  |  |  ------------------
  ------------------
  624|    591|			return YXML_OK;
  625|    840|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (625:6): [True: 819, False: 21]
  ------------------
  626|    819|			x->state = YXMLS_misc2;
  627|    819|			return YXML_OK;
  628|    819|		}
  629|     21|		break;
  630|  8.63k|	case YXMLS_init:
  ------------------
  |  Branch (630:2): [True: 8.63k, False: 111M]
  ------------------
  631|  8.63k|		if(ch == (unsigned char)'\xef') {
  ------------------
  |  Branch (631:6): [True: 21, False: 8.61k]
  ------------------
  632|     21|			x->state = YXMLS_string;
  633|     21|			x->nextstate = YXMLS_misc0;
  634|     21|			x->string = (unsigned char *)"\xbb\xbf";
  635|     21|			return YXML_OK;
  636|     21|		}
  637|  8.61k|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  8.61k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 24, False: 8.59k]
  |  |  |  Branch (101:36): [True: 34, False: 8.55k]
  |  |  |  Branch (101:49): [True: 47, False: 8.50k]
  |  |  ------------------
  ------------------
  638|    105|			x->state = YXMLS_misc0;
  639|    105|			return YXML_OK;
  640|    105|		}
  641|  8.50k|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (641:6): [True: 8.47k, False: 38]
  ------------------
  642|  8.47k|			x->state = YXMLS_le0;
  643|  8.47k|			return YXML_OK;
  644|  8.47k|		}
  645|     38|		break;
  646|  8.50k|	case YXMLS_le0:
  ------------------
  |  Branch (646:2): [True: 8.50k, False: 111M]
  ------------------
  647|  8.50k|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (647:6): [True: 310, False: 8.19k]
  ------------------
  648|    310|			x->state = YXMLS_lee1;
  649|    310|			return YXML_OK;
  650|    310|		}
  651|  8.19k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (651:6): [True: 1.31k, False: 6.87k]
  ------------------
  652|  1.31k|			x->state = YXMLS_leq0;
  653|  1.31k|			return YXML_OK;
  654|  1.31k|		}
  655|  6.87k|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  6.87k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  13.7k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 1.96k, False: 4.91k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 113, False: 4.79k]
  |  |  |  Branch (106:61): [True: 108, False: 4.69k]
  |  |  |  Branch (106:73): [True: 4.66k, False: 25]
  |  |  ------------------
  ------------------
  656|  6.85k|			x->state = YXMLS_elem0;
  657|  6.85k|			return yxml_elemstart(x, ch);
  658|  6.85k|		}
  659|     25|		break;
  660|  2.27k|	case YXMLS_le1:
  ------------------
  |  Branch (660:2): [True: 2.27k, False: 111M]
  ------------------
  661|  2.27k|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (661:6): [True: 733, False: 1.54k]
  ------------------
  662|    733|			x->state = YXMLS_lee1;
  663|    733|			return YXML_OK;
  664|    733|		}
  665|  1.54k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (665:6): [True: 1.32k, False: 215]
  ------------------
  666|  1.32k|			x->state = YXMLS_pi0;
  667|  1.32k|			x->nextstate = YXMLS_misc1;
  668|  1.32k|			return YXML_OK;
  669|  1.32k|		}
  670|    215|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|    215|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|    430|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 10, False: 205]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 4, False: 201]
  |  |  |  Branch (106:61): [True: 29, False: 172]
  |  |  |  Branch (106:73): [True: 155, False: 17]
  |  |  ------------------
  ------------------
  671|    198|			x->state = YXMLS_elem0;
  672|    198|			return yxml_elemstart(x, ch);
  673|    198|		}
  674|     17|		break;
  675|  9.36M|	case YXMLS_le2:
  ------------------
  |  Branch (675:2): [True: 9.36M, False: 102M]
  ------------------
  676|  9.36M|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (676:6): [True: 718, False: 9.36M]
  ------------------
  677|    718|			x->state = YXMLS_lee2;
  678|    718|			return YXML_OK;
  679|    718|		}
  680|  9.36M|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (680:6): [True: 1.38k, False: 9.36M]
  ------------------
  681|  1.38k|			x->state = YXMLS_pi0;
  682|  1.38k|			x->nextstate = YXMLS_misc2;
  683|  1.38k|			return YXML_OK;
  684|  1.38k|		}
  685|  9.36M|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (685:6): [True: 28.5k, False: 9.33M]
  ------------------
  686|  28.5k|			x->state = YXMLS_etag0;
  687|  28.5k|			return YXML_OK;
  688|  28.5k|		}
  689|  9.33M|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  9.33M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  18.6M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 30.1k, False: 9.30M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 998, False: 9.30M]
  |  |  |  Branch (106:61): [True: 1.02k, False: 9.30M]
  |  |  |  Branch (106:73): [True: 9.30M, False: 25]
  |  |  ------------------
  ------------------
  690|  9.33M|			x->state = YXMLS_elem0;
  691|  9.33M|			return yxml_elemstart(x, ch);
  692|  9.33M|		}
  693|     25|		break;
  694|    674|	case YXMLS_le3:
  ------------------
  |  Branch (694:2): [True: 674, False: 111M]
  ------------------
  695|    674|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (695:6): [True: 224, False: 450]
  ------------------
  696|    224|			x->state = YXMLS_comment0;
  697|    224|			x->nextstate = YXMLS_misc3;
  698|    224|			return YXML_OK;
  699|    224|		}
  700|    450|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (700:6): [True: 430, False: 20]
  ------------------
  701|    430|			x->state = YXMLS_pi0;
  702|    430|			x->nextstate = YXMLS_misc3;
  703|    430|			return YXML_OK;
  704|    430|		}
  705|     20|		break;
  706|  1.03k|	case YXMLS_lee1:
  ------------------
  |  Branch (706:2): [True: 1.03k, False: 111M]
  ------------------
  707|  1.03k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (707:6): [True: 525, False: 510]
  ------------------
  708|    525|			x->state = YXMLS_comment1;
  709|    525|			x->nextstate = YXMLS_misc1;
  710|    525|			return YXML_OK;
  711|    525|		}
  712|    510|		if(ch == (unsigned char)'D') {
  ------------------
  |  Branch (712:6): [True: 492, False: 18]
  ------------------
  713|    492|			x->state = YXMLS_string;
  714|    492|			x->nextstate = YXMLS_dt0;
  715|    492|			x->string = (unsigned char *)"OCTYPE";
  716|    492|			return YXML_OK;
  717|    492|		}
  718|     18|		break;
  719|    713|	case YXMLS_lee2:
  ------------------
  |  Branch (719:2): [True: 713, False: 111M]
  ------------------
  720|    713|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (720:6): [True: 263, False: 450]
  ------------------
  721|    263|			x->state = YXMLS_comment1;
  722|    263|			x->nextstate = YXMLS_misc2;
  723|    263|			return YXML_OK;
  724|    263|		}
  725|    450|		if(ch == (unsigned char)'[') {
  ------------------
  |  Branch (725:6): [True: 432, False: 18]
  ------------------
  726|    432|			x->state = YXMLS_string;
  727|    432|			x->nextstate = YXMLS_cd0;
  728|    432|			x->string = (unsigned char *)"CDATA[";
  729|    432|			return YXML_OK;
  730|    432|		}
  731|     18|		break;
  732|  1.31k|	case YXMLS_leq0:
  ------------------
  |  Branch (732:2): [True: 1.31k, False: 111M]
  ------------------
  733|  1.31k|		if(ch == (unsigned char)'x') {
  ------------------
  |  Branch (733:6): [True: 969, False: 343]
  ------------------
  734|    969|			x->state = YXMLS_xmldecl0;
  735|    969|			x->nextstate = YXMLS_misc1;
  736|    969|			return yxml_pistart(x, ch);
  737|    969|		}
  738|    343|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|    343|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|    686|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 175, False: 168]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 19, False: 149]
  |  |  |  Branch (106:61): [True: 19, False: 130]
  |  |  |  Branch (106:73): [True: 111, False: 19]
  |  |  ------------------
  ------------------
  739|    324|			x->state = YXMLS_pi1;
  740|    324|			x->nextstate = YXMLS_misc1;
  741|    324|			return yxml_pistart(x, ch);
  742|    324|		}
  743|     19|		break;
  744|  1.22k|	case YXMLS_misc0:
  ------------------
  |  Branch (744:2): [True: 1.22k, False: 111M]
  ------------------
  745|  1.22k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.22k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 221, False: 1.00k]
  |  |  |  Branch (101:36): [True: 195, False: 812]
  |  |  |  Branch (101:49): [True: 752, False: 60]
  |  |  ------------------
  ------------------
  746|  1.16k|			return YXML_OK;
  747|     60|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (747:6): [True: 33, False: 27]
  ------------------
  748|     33|			x->state = YXMLS_le0;
  749|     33|			return YXML_OK;
  750|     33|		}
  751|     27|		break;
  752|  2.89k|	case YXMLS_misc1:
  ------------------
  |  Branch (752:2): [True: 2.89k, False: 111M]
  ------------------
  753|  2.89k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  2.89k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 195, False: 2.69k]
  |  |  |  Branch (101:36): [True: 194, False: 2.50k]
  |  |  |  Branch (101:49): [True: 207, False: 2.29k]
  |  |  ------------------
  ------------------
  754|    596|			return YXML_OK;
  755|  2.29k|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (755:6): [True: 2.28k, False: 14]
  ------------------
  756|  2.28k|			x->state = YXMLS_le1;
  757|  2.28k|			return YXML_OK;
  758|  2.28k|		}
  759|     14|		break;
  760|  35.8M|	case YXMLS_misc2:
  ------------------
  |  Branch (760:2): [True: 35.8M, False: 75.8M]
  ------------------
  761|  35.8M|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (761:6): [True: 9.36M, False: 26.4M]
  ------------------
  762|  9.36M|			x->state = YXMLS_le2;
  763|  9.36M|			return YXML_OK;
  764|  9.36M|		}
  765|  26.4M|		if(ch == (unsigned char)'&') {
  ------------------
  |  Branch (765:6): [True: 2.54k, False: 26.4M]
  ------------------
  766|  2.54k|			x->state = YXMLS_misc2a;
  767|  2.54k|			return yxml_refstart(x, ch);
  768|  2.54k|		}
  769|  26.4M|		if(yxml_isChar(ch))
  ------------------
  |  |   99|  26.4M|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 26.4M, Folded]
  |  |  ------------------
  ------------------
  770|  26.4M|			return yxml_datacontent(x, ch);
  771|      0|		break;
  772|  11.4k|	case YXMLS_misc2a:
  ------------------
  |  Branch (772:2): [True: 11.4k, False: 111M]
  ------------------
  773|  11.4k|		if(yxml_isRef(ch))
  ------------------
  |  |  113|  11.4k|#define yxml_isRef(c) (yxml_isNum(c) || yxml_isAlpha(c) || c == '#')
  |  |  ------------------
  |  |  |  |  103|  22.9k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 3.08k, False: 8.41k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isRef(c) (yxml_isNum(c) || yxml_isAlpha(c) || c == '#')
  |  |  ------------------
  |  |  |  |  102|  19.9k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 4.32k, False: 4.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (113:60): [True: 1.58k, False: 2.50k]
  |  |  ------------------
  ------------------
  774|  8.98k|			return yxml_ref(x, ch);
  775|  2.50k|		if(ch == (unsigned char)'\x3b') {
  ------------------
  |  Branch (775:6): [True: 2.48k, False: 21]
  ------------------
  776|  2.48k|			x->state = YXMLS_misc2;
  777|  2.48k|			return yxml_refcontent(x, ch);
  778|  2.48k|		}
  779|     21|		break;
  780|  1.29k|	case YXMLS_misc3:
  ------------------
  |  Branch (780:2): [True: 1.29k, False: 111M]
  ------------------
  781|  1.29k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.29k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 196, False: 1.09k]
  |  |  |  Branch (101:36): [True: 197, False: 901]
  |  |  |  Branch (101:49): [True: 196, False: 705]
  |  |  ------------------
  ------------------
  782|    589|			return YXML_OK;
  783|    705|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (783:6): [True: 680, False: 25]
  ------------------
  784|    680|			x->state = YXMLS_le3;
  785|    680|			return YXML_OK;
  786|    680|		}
  787|     25|		break;
  788|  3.30k|	case YXMLS_pi0:
  ------------------
  |  Branch (788:2): [True: 3.30k, False: 111M]
  ------------------
  789|  3.30k|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  3.30k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  6.60k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 1.74k, False: 1.56k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 735, False: 827]
  |  |  |  Branch (106:61): [True: 282, False: 545]
  |  |  |  Branch (106:73): [True: 531, False: 14]
  |  |  ------------------
  ------------------
  790|  3.28k|			x->state = YXMLS_pi1;
  791|  3.28k|			return yxml_pistart(x, ch);
  792|  3.28k|		}
  793|     14|		break;
  794|  8.47k|	case YXMLS_pi1:
  ------------------
  |  Branch (794:2): [True: 8.47k, False: 111M]
  ------------------
  795|  8.47k|		if(yxml_isName(ch))
  ------------------
  |  |  107|  8.47k|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|  16.9k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  16.9k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 2.01k, False: 6.45k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 199, False: 6.25k]
  |  |  |  |  |  Branch (106:61): [True: 200, False: 6.05k]
  |  |  |  |  |  Branch (106:73): [True: 1.63k, False: 4.41k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|  12.8k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 311, False: 4.10k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 195, False: 3.91k]
  |  |  |  Branch (107:77): [True: 276, False: 3.63k]
  |  |  ------------------
  ------------------
  796|  4.83k|			return yxml_piname(x, ch);
  797|  3.63k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (797:6): [True: 2.35k, False: 1.28k]
  ------------------
  798|  2.35k|			x->state = YXMLS_pi4;
  799|  2.35k|			return yxml_pinameend(x, ch);
  800|  2.35k|		}
  801|  1.28k|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  1.28k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 383, False: 897]
  |  |  |  Branch (101:36): [True: 287, False: 610]
  |  |  |  Branch (101:49): [True: 584, False: 26]
  |  |  ------------------
  ------------------
  802|  1.25k|			x->state = YXMLS_pi2;
  803|  1.25k|			return yxml_pinameend(x, ch);
  804|  1.25k|		}
  805|     26|		break;
  806|  9.98k|	case YXMLS_pi2:
  ------------------
  |  Branch (806:2): [True: 9.98k, False: 111M]
  ------------------
  807|  9.98k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (807:6): [True: 1.64k, False: 8.33k]
  ------------------
  808|  1.64k|			x->state = YXMLS_pi3;
  809|  1.64k|			return YXML_OK;
  810|  1.64k|		}
  811|  8.33k|		if(yxml_isChar(ch))
  ------------------
  |  |   99|  8.33k|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 8.33k, Folded]
  |  |  ------------------
  ------------------
  812|  8.33k|			return yxml_datapi1(x, ch);
  813|      0|		break;
  814|  1.64k|	case YXMLS_pi3:
  ------------------
  |  Branch (814:2): [True: 1.64k, False: 111M]
  ------------------
  815|  1.64k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (815:6): [True: 1.19k, False: 450]
  ------------------
  816|  1.19k|			x->state = x->nextstate;
  817|  1.19k|			return yxml_pivalend(x, ch);
  818|  1.19k|		}
  819|    450|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    450|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 450, Folded]
  |  |  ------------------
  ------------------
  820|    450|			x->state = YXMLS_pi2;
  821|    450|			return yxml_datapi2(x, ch);
  822|    450|		}
  823|      0|		break;
  824|  2.32k|	case YXMLS_pi4:
  ------------------
  |  Branch (824:2): [True: 2.32k, False: 111M]
  ------------------
  825|  2.32k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (825:6): [True: 2.31k, False: 15]
  ------------------
  826|  2.31k|			x->state = x->nextstate;
  827|  2.31k|			return yxml_pivalend(x, ch);
  828|  2.31k|		}
  829|     15|		break;
  830|    706|	case YXMLS_std0:
  ------------------
  |  Branch (830:2): [True: 706, False: 111M]
  ------------------
  831|    706|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    706|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 512]
  |  |  |  Branch (101:36): [True: 194, False: 318]
  |  |  |  Branch (101:49): [True: 194, False: 124]
  |  |  ------------------
  ------------------
  832|    582|			return YXML_OK;
  833|    124|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (833:6): [True: 108, False: 16]
  ------------------
  834|    108|			x->state = YXMLS_std1;
  835|    108|			return YXML_OK;
  836|    108|		}
  837|     16|		break;
  838|    667|	case YXMLS_std1:
  ------------------
  |  Branch (838:2): [True: 667, False: 111M]
  ------------------
  839|    667|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    667|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 473]
  |  |  |  Branch (101:36): [True: 194, False: 279]
  |  |  |  Branch (101:49): [True: 196, False: 83]
  |  |  ------------------
  ------------------
  840|    584|			return YXML_OK;
  841|     83|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (841:6): [True: 22, False: 61]
  |  Branch (841:35): [True: 46, False: 15]
  ------------------
  842|     68|			x->state = YXMLS_std2;
  843|     68|			x->quote = ch;
  844|     68|			return YXML_OK;
  845|     68|		}
  846|     15|		break;
  847|     66|	case YXMLS_std2:
  ------------------
  |  Branch (847:2): [True: 66, False: 111M]
  ------------------
  848|     66|		if(ch == (unsigned char)'y') {
  ------------------
  |  Branch (848:6): [True: 3, False: 63]
  ------------------
  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|     63|		if(ch == (unsigned char)'n') {
  ------------------
  |  Branch (854:6): [True: 53, False: 10]
  ------------------
  855|     53|			x->state = YXMLS_string;
  856|     53|			x->nextstate = YXMLS_std3;
  857|     53|			x->string = (unsigned char *)"o";
  858|     53|			return YXML_OK;
  859|     53|		}
  860|     10|		break;
  861|     53|	case YXMLS_std3:
  ------------------
  |  Branch (861:2): [True: 53, False: 111M]
  ------------------
  862|     53|		if(x->quote == ch) {
  ------------------
  |  Branch (862:6): [True: 52, False: 1]
  ------------------
  863|     52|			x->state = YXMLS_xmldecl8;
  864|     52|			return YXML_OK;
  865|     52|		}
  866|      1|		break;
  867|  1.12k|	case YXMLS_ver0:
  ------------------
  |  Branch (867:2): [True: 1.12k, False: 111M]
  ------------------
  868|  1.12k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.12k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 929]
  |  |  |  Branch (101:36): [True: 194, False: 735]
  |  |  |  Branch (101:49): [True: 194, False: 541]
  |  |  ------------------
  ------------------
  869|    582|			return YXML_OK;
  870|    541|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (870:6): [True: 532, False: 9]
  ------------------
  871|    532|			x->state = YXMLS_ver1;
  872|    532|			return YXML_OK;
  873|    532|		}
  874|      9|		break;
  875|  1.09k|	case YXMLS_ver1:
  ------------------
  |  Branch (875:2): [True: 1.09k, False: 111M]
  ------------------
  876|  1.09k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.09k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 196, False: 895]
  |  |  |  Branch (101:36): [True: 194, False: 701]
  |  |  |  Branch (101:49): [True: 194, False: 507]
  |  |  ------------------
  ------------------
  877|    584|			return YXML_OK;
  878|    507|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (878:6): [True: 5, False: 502]
  |  Branch (878:35): [True: 483, False: 19]
  ------------------
  879|    488|			x->state = YXMLS_string;
  880|    488|			x->quote = ch;
  881|    488|			x->nextstate = YXMLS_ver2;
  882|    488|			x->string = (unsigned char *)"1.";
  883|    488|			return YXML_OK;
  884|    488|		}
  885|     19|		break;
  886|    485|	case YXMLS_ver2:
  ------------------
  |  Branch (886:2): [True: 485, False: 111M]
  ------------------
  887|    485|		if(yxml_isNum(ch)) {
  ------------------
  |  |  103|    485|#define yxml_isNum(c) (c-'0' < 10)
  |  |  ------------------
  |  |  |  Branch (103:23): [True: 479, False: 6]
  |  |  ------------------
  ------------------
  888|    479|			x->state = YXMLS_ver3;
  889|    479|			return YXML_OK;
  890|    479|		}
  891|      6|		break;
  892|    685|	case YXMLS_ver3:
  ------------------
  |  Branch (892:2): [True: 685, False: 111M]
  ------------------
  893|    685|		if(yxml_isNum(ch))
  ------------------
  |  |  103|    685|#define yxml_isNum(c) (c-'0' < 10)
  |  |  ------------------
  |  |  |  Branch (103:23): [True: 215, False: 470]
  |  |  ------------------
  ------------------
  894|    215|			return YXML_OK;
  895|    470|		if(x->quote == ch) {
  ------------------
  |  Branch (895:6): [True: 459, False: 11]
  ------------------
  896|    459|			x->state = YXMLS_xmldecl4;
  897|    459|			return YXML_OK;
  898|    459|		}
  899|     11|		break;
  900|    968|	case YXMLS_xmldecl0:
  ------------------
  |  Branch (900:2): [True: 968, False: 111M]
  ------------------
  901|    968|		if(ch == (unsigned char)'m') {
  ------------------
  |  Branch (901:6): [True: 837, False: 131]
  ------------------
  902|    837|			x->state = YXMLS_xmldecl1;
  903|    837|			return yxml_piname(x, ch);
  904|    837|		}
  905|    131|		if(yxml_isName(ch)) {
  ------------------
  |  |  107|    131|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|    262|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    262|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 26, False: 105]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 5, False: 100]
  |  |  |  |  |  Branch (106:61): [True: 3, False: 97]
  |  |  |  |  |  Branch (106:73): [True: 16, False: 81]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|    212|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 9, False: 72]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 3, False: 69]
  |  |  |  Branch (107:77): [True: 3, False: 66]
  |  |  ------------------
  ------------------
  906|     65|			x->state = YXMLS_pi1;
  907|     65|			return yxml_piname(x, ch);
  908|     65|		}
  909|     66|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (909:6): [True: 19, False: 47]
  ------------------
  910|     19|			x->state = YXMLS_pi4;
  911|     19|			return yxml_pinameend(x, ch);
  912|     19|		}
  913|     47|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|     47|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 8, False: 39]
  |  |  |  Branch (101:36): [True: 3, False: 36]
  |  |  |  Branch (101:49): [True: 5, False: 31]
  |  |  ------------------
  ------------------
  914|     16|			x->state = YXMLS_pi2;
  915|     16|			return yxml_pinameend(x, ch);
  916|     16|		}
  917|     31|		break;
  918|    836|	case YXMLS_xmldecl1:
  ------------------
  |  Branch (918:2): [True: 836, False: 111M]
  ------------------
  919|    836|		if(ch == (unsigned char)'l') {
  ------------------
  |  Branch (919:6): [True: 743, False: 93]
  ------------------
  920|    743|			x->state = YXMLS_xmldecl2;
  921|    743|			return yxml_piname(x, ch);
  922|    743|		}
  923|     93|		if(yxml_isName(ch)) {
  ------------------
  |  |  107|     93|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|    186|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    186|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 12, False: 81]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 4, False: 77]
  |  |  |  |  |  Branch (106:61): [True: 3, False: 74]
  |  |  |  |  |  Branch (106:73): [True: 17, False: 57]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|    150|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 6, False: 51]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 3, False: 48]
  |  |  |  Branch (107:77): [True: 3, False: 45]
  |  |  ------------------
  ------------------
  924|     48|			x->state = YXMLS_pi1;
  925|     48|			return yxml_piname(x, ch);
  926|     48|		}
  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: 3, False: 36]
  |  |  |  Branch (101:49): [True: 6, False: 30]
  |  |  ------------------
  ------------------
  932|     12|			x->state = YXMLS_pi2;
  933|     12|			return yxml_pinameend(x, ch);
  934|     12|		}
  935|     30|		break;
  936|    742|	case YXMLS_xmldecl2:
  ------------------
  |  Branch (936:2): [True: 742, False: 111M]
  ------------------
  937|    742|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|    742|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 573, False: 169]
  |  |  |  Branch (101:36): [True: 12, False: 157]
  |  |  |  Branch (101:49): [True: 27, False: 130]
  |  |  ------------------
  ------------------
  938|    612|			x->state = YXMLS_xmldecl3;
  939|    612|			return yxml_piabort(x, ch);
  940|    612|		}
  941|    130|		if(yxml_isName(ch)) {
  ------------------
  |  |  107|    130|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|    260|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    260|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 13, False: 117]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 3, False: 114]
  |  |  |  |  |  Branch (106:61): [True: 4, False: 110]
  |  |  |  |  |  Branch (106:73): [True: 76, False: 34]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|    164|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 7, False: 27]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 3, False: 24]
  |  |  |  Branch (107:77): [True: 3, False: 21]
  |  |  ------------------
  ------------------
  942|    109|			x->state = YXMLS_pi1;
  943|    109|			return yxml_piname(x, ch);
  944|    109|		}
  945|     21|		break;
  946|  1.16k|	case YXMLS_xmldecl3:
  ------------------
  |  Branch (946:2): [True: 1.16k, False: 111M]
  ------------------
  947|  1.16k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.16k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 973]
  |  |  |  Branch (101:36): [True: 194, False: 779]
  |  |  |  Branch (101:49): [True: 194, False: 585]
  |  |  ------------------
  ------------------
  948|    582|			return YXML_OK;
  949|    585|		if(ch == (unsigned char)'v') {
  ------------------
  |  Branch (949:6): [True: 568, False: 17]
  ------------------
  950|    568|			x->state = YXMLS_string;
  951|    568|			x->nextstate = YXMLS_ver0;
  952|    568|			x->string = (unsigned char *)"ersion";
  953|    568|			return YXML_OK;
  954|    568|		}
  955|     17|		break;
  956|    458|	case YXMLS_xmldecl4:
  ------------------
  |  Branch (956:2): [True: 458, False: 111M]
  ------------------
  957|    458|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|    458|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 369, False: 89]
  |  |  |  Branch (101:36): [True: 10, False: 79]
  |  |  |  Branch (101:49): [True: 49, False: 30]
  |  |  ------------------
  ------------------
  958|    428|			x->state = YXMLS_xmldecl5;
  959|    428|			return YXML_OK;
  960|    428|		}
  961|     30|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (961:6): [True: 13, False: 17]
  ------------------
  962|     13|			x->state = YXMLS_xmldecl9;
  963|     13|			return YXML_OK;
  964|     13|		}
  965|     17|		break;
  966|    986|	case YXMLS_xmldecl5:
  ------------------
  |  Branch (966:2): [True: 986, False: 111M]
  ------------------
  967|    986|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    986|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 197, False: 789]
  |  |  |  Branch (101:36): [True: 194, False: 595]
  |  |  |  Branch (101:49): [True: 194, False: 401]
  |  |  ------------------
  ------------------
  968|    585|			return YXML_OK;
  969|    401|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (969:6): [True: 12, False: 389]
  ------------------
  970|     12|			x->state = YXMLS_xmldecl9;
  971|     12|			return YXML_OK;
  972|     12|		}
  973|    389|		if(ch == (unsigned char)'e') {
  ------------------
  |  Branch (973:6): [True: 232, False: 157]
  ------------------
  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|    157|		if(ch == (unsigned char)'s') {
  ------------------
  |  Branch (979:6): [True: 145, False: 12]
  ------------------
  980|    145|			x->state = YXMLS_string;
  981|    145|			x->nextstate = YXMLS_std0;
  982|    145|			x->string = (unsigned char *)"tandalone";
  983|    145|			return YXML_OK;
  984|    145|		}
  985|     12|		break;
  986|     78|	case YXMLS_xmldecl6:
  ------------------
  |  Branch (986:2): [True: 78, False: 111M]
  ------------------
  987|     78|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|     78|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 25, False: 53]
  |  |  |  Branch (101:36): [True: 13, False: 40]
  |  |  |  Branch (101:49): [True: 19, False: 21]
  |  |  ------------------
  ------------------
  988|     57|			x->state = YXMLS_xmldecl7;
  989|     57|			return YXML_OK;
  990|     57|		}
  991|     21|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (991:6): [True: 5, False: 16]
  ------------------
  992|      5|			x->state = YXMLS_xmldecl9;
  993|      5|			return YXML_OK;
  994|      5|		}
  995|     16|		break;
  996|    613|	case YXMLS_xmldecl7:
  ------------------
  |  Branch (996:2): [True: 613, False: 111M]
  ------------------
  997|    613|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    613|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 419]
  |  |  |  Branch (101:36): [True: 194, False: 225]
  |  |  |  Branch (101:49): [True: 195, False: 30]
  |  |  ------------------
  ------------------
  998|    583|			return YXML_OK;
  999|     30|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (999:6): [True: 7, False: 23]
  ------------------
 1000|      7|			x->state = YXMLS_xmldecl9;
 1001|      7|			return YXML_OK;
 1002|      7|		}
 1003|     23|		if(ch == (unsigned char)'s') {
  ------------------
  |  Branch (1003:6): [True: 5, False: 18]
  ------------------
 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|     18|		break;
 1010|    623|	case YXMLS_xmldecl8:
  ------------------
  |  Branch (1010:2): [True: 623, False: 111M]
  ------------------
 1011|    623|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    623|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 196, False: 427]
  |  |  |  Branch (101:36): [True: 195, False: 232]
  |  |  |  Branch (101:49): [True: 205, False: 27]
  |  |  ------------------
  ------------------
 1012|    596|			return YXML_OK;
 1013|     27|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (1013:6): [True: 13, False: 14]
  ------------------
 1014|     13|			x->state = YXMLS_xmldecl9;
 1015|     13|			return YXML_OK;
 1016|     13|		}
 1017|     14|		break;
 1018|     45|	case YXMLS_xmldecl9:
  ------------------
  |  Branch (1018:2): [True: 45, False: 111M]
  ------------------
 1019|     45|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (1019:6): [True: 34, False: 11]
  ------------------
 1020|     34|			x->state = YXMLS_misc1;
 1021|     34|			return YXML_OK;
 1022|     34|		}
 1023|     11|		break;
 1024|   111M|	}
 1025|    935|	return YXML_ESYN;
 1026|   111M|}
yxml_eof:
 1028|  7.30k|yxml_ret_t yxml_eof(yxml_t *x) {
 1029|  7.30k|	if(x->state != YXMLS_misc3)
  ------------------
  |  Branch (1029:5): [True: 2.17k, False: 5.12k]
  ------------------
 1030|  2.17k|		return YXML_EEOF;
 1031|  5.12k|	return YXML_OK;
 1032|  7.30k|}
yxml.c:yxml_attrname:
  243|  28.1M|static inline yxml_ret_t yxml_attrname   (yxml_t *x, unsigned ch) { return yxml_pushstackc(x, ch); }
yxml.c:yxml_pushstackc:
  195|  28.6M|static yxml_ret_t yxml_pushstackc(yxml_t *x, unsigned ch) {
  196|  28.6M|	if(x->stacklen+1 >= x->stacksize)
  ------------------
  |  Branch (196:5): [True: 3, False: 28.6M]
  ------------------
  197|      3|		return YXML_ESTACK;
  198|  28.6M|	x->stack[x->stacklen] = (unsigned char)ch;
  199|  28.6M|	x->stacklen++;
  200|  28.6M|	x->stack[x->stacklen] = 0;
  201|  28.6M|	return YXML_OK;
  202|  28.6M|}
yxml.c:yxml_attrnameend:
  244|  3.24M|static inline yxml_ret_t yxml_attrnameend(yxml_t *x, unsigned ch) { return YXML_ATTRSTART; }
yxml.c:yxml_dataattr:
  177|   357k|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|   357k|	yxml_setchar(x->data, ch == 0x9 || ch == 0xa ? 0x20 : ch);
  ------------------
  |  Branch (179:24): [True: 7.61k, False: 350k]
  |  Branch (179:37): [True: 3.54k, False: 346k]
  ------------------
  180|   357k|	x->data[1] = 0;
  181|   357k|	return YXML_ATTRVAL;
  182|   357k|}
yxml.c:yxml_setchar:
  118|  26.8M|static inline void yxml_setchar(char *dest, unsigned ch) {
  119|  26.8M|	*(unsigned char *)dest = (unsigned char)ch;
  120|  26.8M|}
yxml.c:yxml_refstart:
  255|  3.36k|static inline yxml_ret_t yxml_refstart(yxml_t *x, unsigned ch) {
  256|  3.36k|	memset(x->data, 0, sizeof(x->data));
  257|  3.36k|	x->reflen = 0;
  258|  3.36k|	return YXML_OK;
  259|  3.36k|}
yxml.c:yxml_attrvalend:
  245|  3.24M|static inline yxml_ret_t yxml_attrvalend (yxml_t *x, unsigned ch) { yxml_popstack(x); return YXML_ATTREND; }
yxml.c:yxml_popstack:
  204|  12.5M|static void yxml_popstack(yxml_t *x) {
  205|  12.5M|	do
  206|  53.7M|		x->stacklen--;
  207|  53.7M|	while(x->stack[x->stacklen]);
  ------------------
  |  Branch (207:8): [True: 41.1M, False: 12.5M]
  ------------------
  208|  12.5M|}
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: 21, False: 11.4k]
  ------------------
  263|     21|		return YXML_EREF;
  264|  11.4k|	yxml_setchar(x->data+x->reflen, ch);
  265|  11.4k|	x->reflen++;
  266|  11.4k|	return YXML_OK;
  267|  11.4k|}
yxml.c:yxml_refattrval:
  299|    751|static inline yxml_ret_t yxml_refattrval(yxml_t *x, unsigned ch) { return yxml_refend(x, YXML_ATTRVAL); }
yxml.c:yxml_refend:
  269|  3.23k|static yxml_ret_t yxml_refend(yxml_t *x, yxml_ret_t ret) {
  270|  3.23k|	unsigned char *r = (unsigned char *)x->data;
  271|  3.23k|	unsigned ch = 0;
  272|  3.23k|	if(*r == '#') {
  ------------------
  |  Branch (272:5): [True: 2.00k, False: 1.23k]
  ------------------
  273|  2.00k|		if(r[1] == 'x')
  ------------------
  |  Branch (273:6): [True: 672, False: 1.32k]
  ------------------
  274|  2.33k|			for(r += 2; yxml_isHex((unsigned)*r); r++)
  ------------------
  |  |  104|  2.33k|#define yxml_isHex(c) (yxml_isNum(c) || (c|32)-'a' < 6)
  |  |  ------------------
  |  |  |  |  103|  4.66k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 530, False: 1.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (104:41): [True: 1.13k, False: 672]
  |  |  ------------------
  ------------------
  275|  1.66k|				ch = (ch<<4) + (*r <= '9' ? *r-'0' : (*r|32)-'a' + 10);
  ------------------
  |  Branch (275:21): [True: 530, False: 1.13k]
  ------------------
  276|  1.32k|		else
  277|  4.45k|			for(r++; yxml_isNum((unsigned)*r); r++)
  ------------------
  |  |  103|  4.45k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  ------------------
  |  |  |  Branch (103:23): [True: 3.12k, False: 1.32k]
  |  |  ------------------
  ------------------
  278|  3.12k|				ch = (ch*10) + (*r-'0');
  279|  2.00k|		if(*r)
  ------------------
  |  Branch (279:6): [True: 12, False: 1.98k]
  ------------------
  280|     12|			ch = 0;
  281|  2.00k|	} 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: 231, False: 1.00k]
  ------------------
  285|  1.23k|			i == INTFROM5CHARS('g','t', 0,  0, 0) ? '>' :
  ------------------
  |  |  115|  1.00k|#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: 809]
  ------------------
  286|  1.00k|			i == INTFROM5CHARS('a','m','p', 0, 0) ? '&' :
  ------------------
  |  |  115|    809|#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: 615]
  ------------------
  287|    809|			i == INTFROM5CHARS('a','p','o','s',0) ? '\'':
  ------------------
  |  |  115|    615|#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: 421]
  ------------------
  288|    615|			i == INTFROM5CHARS('q','u','o','t',0) ? '"' : 0;
  ------------------
  |  |  115|    421|#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: 165]
  ------------------
  289|  1.23k|	}
  290|       |
  291|       |	/* Codepoints not allowed in the XML 1.1 definition of a Char */
  292|  3.23k|	if(!ch || ch > 0x10FFFF || ch == 0xFFFE || ch == 0xFFFF || (ch-0xDFFF) < 0x7FF)
  ------------------
  |  Branch (292:5): [True: 196, False: 3.04k]
  |  Branch (292:12): [True: 0, False: 3.04k]
  |  Branch (292:29): [True: 1, False: 3.03k]
  |  Branch (292:45): [True: 1, False: 3.03k]
  |  Branch (292:61): [True: 6, False: 3.03k]
  ------------------
  293|    204|		return YXML_EREF;
  294|  3.03k|	yxml_setutf8(x->data, ch);
  295|  3.03k|	return ret;
  296|  3.23k|}
yxml.c:yxml_setutf8:
  124|  3.03k|static void yxml_setutf8(char *dest, unsigned ch) {
  125|  3.03k|	if(ch <= 0x007F)
  ------------------
  |  Branch (125:5): [True: 2.12k, False: 906]
  ------------------
  126|  2.12k|		yxml_setchar(dest++, ch);
  127|    906|	else if(ch <= 0x07FF) {
  ------------------
  |  Branch (127:10): [True: 217, False: 689]
  ------------------
  128|    217|		yxml_setchar(dest++, 0xC0 | (ch>>6));
  129|    217|		yxml_setchar(dest++, 0x80 | (ch & 0x3F));
  130|    689|	} else if(ch <= 0xFFFF) {
  ------------------
  |  Branch (130:12): [True: 293, False: 396]
  ------------------
  131|    293|		yxml_setchar(dest++, 0xE0 | (ch>>12));
  132|    293|		yxml_setchar(dest++, 0x80 | ((ch>>6) & 0x3F));
  133|    293|		yxml_setchar(dest++, 0x80 | (ch & 0x3F));
  134|    396|	} else {
  135|    396|		yxml_setchar(dest++, 0xF0 | (ch>>18));
  136|    396|		yxml_setchar(dest++, 0x80 | ((ch>>12) & 0x3F));
  137|    396|		yxml_setchar(dest++, 0x80 | ((ch>>6) & 0x3F));
  138|    396|		yxml_setchar(dest++, 0x80 | (ch & 0x3F));
  139|    396|	}
  140|  3.03k|	*dest = 0;
  141|  3.03k|}
yxml.c:yxml_datacontent:
  143|  26.4M|static inline yxml_ret_t yxml_datacontent(yxml_t *x, unsigned ch) {
  144|  26.4M|	yxml_setchar(x->data, ch);
  145|  26.4M|	x->data[1] = 0;
  146|  26.4M|	return YXML_CONTENT;
  147|  26.4M|}
yxml.c:yxml_datacd1:
  162|    269|static inline yxml_ret_t yxml_datacd1(yxml_t *x, unsigned ch) {
  163|    269|	x->data[0] = ']';
  164|    269|	yxml_setchar(x->data+1, ch);
  165|    269|	x->data[2] = 0;
  166|    269|	return YXML_CONTENT;
  167|    269|}
yxml.c:yxml_datacd2:
  169|    437|static inline yxml_ret_t yxml_datacd2(yxml_t *x, unsigned ch) {
  170|    437|	x->data[0] = ']';
  171|    437|	x->data[1] = ']';
  172|    437|	yxml_setchar(x->data+2, ch);
  173|    437|	x->data[3] = 0;
  174|    437|	return YXML_CONTENT;
  175|    437|}
yxml.c:yxml_elemname:
  211|   439k|static inline yxml_ret_t yxml_elemname   (yxml_t *x, unsigned ch) { return yxml_pushstackc(x, ch); }
yxml.c:yxml_elemnameend:
  212|  9.34M|static inline yxml_ret_t yxml_elemnameend(yxml_t *x, unsigned ch) { return YXML_ELEMSTART; }
yxml.c:yxml_attrstart:
  242|  3.24M|static inline yxml_ret_t yxml_attrstart  (yxml_t *x, unsigned ch) { return yxml_pushstack(x, &x->attr, ch); }
yxml.c:yxml_pushstack:
  184|  12.5M|static yxml_ret_t yxml_pushstack(yxml_t *x, char **res, unsigned ch) {
  185|  12.5M|	if(x->stacklen+2 >= x->stacksize)
  ------------------
  |  Branch (185:5): [True: 4, False: 12.5M]
  ------------------
  186|      4|		return YXML_ESTACK;
  187|  12.5M|	x->stacklen++;
  188|  12.5M|	*res = (char *)x->stack+x->stacklen;
  189|  12.5M|	x->stack[x->stacklen] = (unsigned char)ch;
  190|  12.5M|	x->stacklen++;
  191|  12.5M|	x->stack[x->stacklen] = 0;
  192|  12.5M|	return YXML_OK;
  193|  12.5M|}
yxml.c:yxml_selfclose:
  216|  9.33M|static yxml_ret_t yxml_selfclose(yxml_t *x, unsigned ch) {
  217|  9.33M|	yxml_popstack(x);
  218|  9.33M|	if(x->stacklen) {
  ------------------
  |  Branch (218:5): [True: 9.33M, False: 5.24k]
  ------------------
  219|  9.33M|		x->elem = (char *)x->stack+x->stacklen-1;
  220|  32.1M|		while(*(x->elem-1))
  ------------------
  |  Branch (220:9): [True: 22.8M, False: 9.33M]
  ------------------
  221|  22.8M|			x->elem--;
  222|  9.33M|		return YXML_ELEMEND;
  223|  9.33M|	}
  224|  5.24k|	x->elem = (char *)x->stack;
  225|  5.24k|	x->state = YXMLS_misc3;
  226|  5.24k|	return YXML_ELEMEND;
  227|  9.33M|}
yxml.c:yxml_elemclose:
  229|  78.2k|static inline yxml_ret_t yxml_elemclose(yxml_t *x, unsigned ch) {
  230|  78.2k|	if(*((unsigned char *)x->elem) != ch)
  ------------------
  |  Branch (230:5): [True: 98, False: 78.1k]
  ------------------
  231|     98|		return YXML_ECLOSE;
  232|  78.1k|	x->elem++;
  233|  78.1k|	return YXML_OK;
  234|  78.2k|}
yxml.c:yxml_elemcloseend:
  236|  28.4k|static inline yxml_ret_t yxml_elemcloseend(yxml_t *x, unsigned ch) {
  237|  28.4k|	if(*x->elem)
  ------------------
  |  Branch (237:5): [True: 1, False: 28.4k]
  ------------------
  238|      1|		return YXML_ECLOSE;
  239|  28.4k|	return yxml_selfclose(x, ch);
  240|  28.4k|}
yxml.c:yxml_elemstart:
  210|  9.34M|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.58k|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.48k|static inline yxml_ret_t yxml_refcontent(yxml_t *x, unsigned ch) { return yxml_refend(x, YXML_CONTENT); }
yxml.c:yxml_piname:
  248|  6.63k|static inline yxml_ret_t yxml_piname   (yxml_t *x, unsigned ch) { return yxml_pushstackc(x, ch); }
yxml.c:yxml_pinameend:
  250|  3.66k|static inline yxml_ret_t yxml_pinameend(yxml_t *x, unsigned ch) {
  251|  3.66k|	return (x->pi[0]|32) == 'x' && (x->pi[1]|32) == 'm' && (x->pi[2]|32) == 'l' && !x->pi[3] ? YXML_ESYN : YXML_PISTART;
  ------------------
  |  Branch (251:9): [True: 1.68k, False: 1.98k]
  |  Branch (251:33): [True: 926, False: 754]
  |  Branch (251:57): [True: 497, False: 429]
  |  Branch (251:81): [True: 14, False: 483]
  ------------------
  252|  3.66k|}
yxml.c:yxml_datapi1:
  149|  8.33k|static inline yxml_ret_t yxml_datapi1(yxml_t *x, unsigned ch) {
  150|  8.33k|	yxml_setchar(x->data, ch);
  151|  8.33k|	x->data[1] = 0;
  152|  8.33k|	return YXML_PICONTENT;
  153|  8.33k|}
yxml.c:yxml_pivalend:
  253|  3.50k|static inline yxml_ret_t yxml_pivalend (yxml_t *x, unsigned ch) { yxml_popstack(x); x->pi = (char *)x->stack; return YXML_PIEND; }
yxml.c:yxml_datapi2:
  155|    450|static inline yxml_ret_t yxml_datapi2(yxml_t *x, unsigned ch) {
  156|    450|	x->data[0] = '?';
  157|    450|	yxml_setchar(x->data+1, ch);
  158|    450|	x->data[2] = 0;
  159|    450|	return YXML_PICONTENT;
  160|    450|}
yxml.c:yxml_piabort:
  249|    612|static inline yxml_ret_t yxml_piabort  (yxml_t *x, unsigned ch) { yxml_popstack(x); return YXML_OK; }

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

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

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

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

fuzz_xml_decode_encode.cc:_ZL15UA_Variant_initP10UA_Variant:
  241|  8.12k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_xml_decode_encode.cc:_ZL16UA_Variant_clearP10UA_Variant:
  241|  2.69k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_xml_decode_encode.cc:_ZL19UA_ByteString_clearP9UA_String:
  241|  2.57k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_ByteString_init:
  241|  2.63k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_ExtensionObject_init:
  241|     67|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_clear:
  241|     81|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_copy:
  241|     80|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_init:
  241|     14|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_equal:
  241|  8.76k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl

