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

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

parseUInt64:
   30|  1.81k|parseUInt64(const char *str, size_t size, uint64_t *result) {
   31|  1.81k|    size_t i = 0;
   32|  1.81k|    uint64_t n = 0, prev = 0;
   33|       |
   34|       |    /* Hex */
   35|  1.81k|    if(size > 2 && str[0] == '0' && (str[1] | 32) == 'x') {
  ------------------
  |  Branch (35:8): [True: 1.56k, False: 249]
  |  Branch (35:20): [True: 373, False: 1.19k]
  |  Branch (35:37): [True: 241, False: 132]
  ------------------
   36|    241|        i = 2;
   37|  3.45k|        for(; i < size; i++) {
  ------------------
  |  Branch (37:15): [True: 3.25k, False: 202]
  ------------------
   38|  3.25k|            uint8_t c = (uint8_t)str[i] | 32;
   39|  3.25k|            if(c >= '0' && c <= '9')
  ------------------
  |  Branch (39:16): [True: 3.24k, False: 17]
  |  Branch (39:28): [True: 1.05k, False: 2.18k]
  ------------------
   40|  1.05k|                c = (uint8_t)(c - '0');
   41|  2.20k|            else if(c >= 'a' && c <='f')
  ------------------
  |  Branch (41:21): [True: 2.18k, False: 20]
  |  Branch (41:33): [True: 2.17k, False: 14]
  ------------------
   42|  2.17k|                c = (uint8_t)(c - 'a' + 10);
   43|     34|            else if(c >= 'A' && c <='F')
  ------------------
  |  Branch (43:21): [True: 17, False: 17]
  |  Branch (43:33): [True: 0, False: 17]
  ------------------
   44|      0|                c = (uint8_t)(c - 'A' + 10);
   45|     34|            else
   46|     34|                break;
   47|  3.22k|            n = (n << 4) | (c & 0xF);
   48|  3.22k|            if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (48:16): [True: 5, False: 3.21k]
  ------------------
   49|      5|                return 0;
   50|  3.21k|            prev = n;
   51|  3.21k|        }
   52|    236|        *result = n;
   53|    236|        return (i > 2) ? i : 0; /* 2 -> No digit was parsed */
  ------------------
  |  Branch (53:16): [True: 231, False: 5]
  ------------------
   54|    241|    }
   55|       |
   56|       |    /* Decimal */
   57|  17.0k|    for(; i < size; i++) {
  ------------------
  |  Branch (57:11): [True: 15.8k, False: 1.15k]
  ------------------
   58|  15.8k|        if(str[i] < '0' || str[i] > '9')
  ------------------
  |  Branch (58:12): [True: 352, False: 15.5k]
  |  Branch (58:28): [True: 71, False: 15.4k]
  ------------------
   59|    423|            break;
   60|       |        /* Fast multiplication: n*10 == (n*8) + (n*2) */
   61|  15.4k|        n = (n << 3) + (n << 1) + (uint8_t)(str[i] - '0');
   62|  15.4k|        if(n < prev) /* Check for overflow */
  ------------------
  |  Branch (62:12): [True: 2, False: 15.4k]
  ------------------
   63|      2|            return 0;
   64|  15.4k|        prev = n;
   65|  15.4k|    }
   66|  1.57k|    *result = n;
   67|  1.57k|    return i;
   68|  1.57k|}
parseInt64:
   71|  1.24k|parseInt64(const char *str, size_t size, int64_t *result) {
   72|       |    /* Negative value? */
   73|  1.24k|    size_t i = 0;
   74|  1.24k|    bool neg = false;
   75|  1.24k|    if(*str == '-' || *str == '+') {
  ------------------
  |  Branch (75:8): [True: 487, False: 755]
  |  Branch (75:23): [True: 2, False: 753]
  ------------------
   76|    489|        neg = (*str == '-');
   77|    489|        i++;
   78|    489|    }
   79|       |
   80|       |    /* Parse as unsigned */
   81|  1.24k|    uint64_t n = 0;
   82|  1.24k|    size_t len = parseUInt64(&str[i], size - i, &n);
   83|  1.24k|    if(len == 0)
  ------------------
  |  Branch (83:8): [True: 76, False: 1.16k]
  ------------------
   84|     76|        return 0;
   85|       |
   86|       |    /* Check for overflow, adjust and return */
   87|  1.16k|    if(!neg) {
  ------------------
  |  Branch (87:8): [True: 684, False: 482]
  ------------------
   88|    684|        if(n > 9223372036854775807UL)
  ------------------
  |  Branch (88:12): [True: 62, False: 622]
  ------------------
   89|     62|            return 0;
   90|    622|        *result = (int64_t)n;
   91|    622|    } else {
   92|       |        /* n is unsigned, so 9223372036854775808UL == 2^63 fits without
   93|       |         * overflow. (int64_t)n would also fit for n in [0, 2^63], but
   94|       |         * the negation -(int64_t)(2^63) is undefined because the result
   95|       |         * (which is +2^63) cannot be represented. Use the unsigned
   96|       |         * representation and reinterpret as int64_t instead. */
   97|    482|        if(n > 9223372036854775808UL)
  ------------------
  |  Branch (97:12): [True: 5, False: 477]
  ------------------
   98|      5|            return 0;
   99|    477|        *result = (n == 9223372036854775808UL)
  ------------------
  |  Branch (99:19): [True: 4, False: 473]
  ------------------
  100|    477|            ? (int64_t)(-9223372036854775807LL - 1)
  101|    477|            : -(int64_t)n;
  102|    477|    }
  103|  1.09k|    return len + i;
  104|  1.16k|}
parseDouble:
  106|  1.14k|size_t parseDouble(const char *str, size_t size, double *result) {
  107|  1.14k|    char buf[2000];
  108|  1.14k|    if(size >= 2000)
  ------------------
  |  Branch (108:8): [True: 0, False: 1.14k]
  ------------------
  109|      0|        return 0;
  110|  1.14k|    memcpy(buf, str, size);
  111|  1.14k|    buf[size] = 0;
  112|  1.14k|    errno = 0;
  113|  1.14k|    char *endptr;
  114|  1.14k|    *result = strtod(buf, &endptr);
  115|  1.14k|    if(errno != 0 && errno != ERANGE)
  ------------------
  |  Branch (115:8): [True: 316, False: 826]
  |  Branch (115:22): [True: 0, False: 316]
  ------------------
  116|      0|        return 0;
  117|  1.14k|    return (uintptr_t)endptr - (uintptr_t)buf;
  118|  1.14k|}

yxml_init:
  302|  8.63k|void yxml_init(yxml_t *x, void *stack, size_t stacksize) {
  303|  8.63k|	memset(x, 0, sizeof(*x));
  304|  8.63k|	x->line = 1;
  305|  8.63k|	x->stack = (unsigned char*)stack;
  306|  8.63k|	x->stacksize = stacksize;
  307|  8.63k|	*x->stack = 0;
  308|  8.63k|	x->elem = x->pi = x->attr = (char *)x->stack;
  309|  8.63k|	x->state = YXMLS_init;
  310|  8.63k|}
yxml_init_content:
  312|    337|void yxml_init_content(yxml_t *x, void *stack, size_t stacksize) {
  313|    337|	yxml_init(x, stack, stacksize);
  314|       |	x->contentmode = true;
  315|    337|	x->state = YXMLS_misc2;
  316|    337|}
yxml_parse:
  318|   187M|yxml_ret_t yxml_parse(yxml_t *x, int _ch) {
  319|   187M|	x->isReference = false;
  320|       |
  321|       |	/* Ensure that characters are in the range of 0..255 rather than -126..125.
  322|       |	 * All character comparisons are done with positive integers. */
  323|   187M|	unsigned ch = (unsigned)(_ch+256) & 0xff;
  324|   187M|	if(!ch)
  ------------------
  |  Branch (324:5): [True: 7, False: 187M]
  ------------------
  325|      7|		return YXML_ESYN;
  326|   187M|	x->total++;
  327|       |
  328|       |	/* End-of-Line normalization, "\rX", "\r\n" and "\n" are recognized and
  329|       |	 * normalized to a single '\n' as per XML 1.0 section 2.11. XML 1.1 adds
  330|       |	 * some non-ASCII character sequences to this list, but we can only handle
  331|       |	 * ASCII here without making assumptions about the input encoding. */
  332|   187M|	if(x->ignore == ch) {
  ------------------
  |  Branch (332:5): [True: 22.2k, False: 187M]
  ------------------
  333|  22.2k|		x->ignore = 0;
  334|  22.2k|		return YXML_OK;
  335|  22.2k|	}
  336|   187M|	x->ignore = (ch == 0xd) * 0xa;
  337|   187M|	if(ch == 0xa || ch == 0xd) {
  ------------------
  |  Branch (337:5): [True: 992k, False: 186M]
  |  Branch (337:18): [True: 3.00M, False: 183M]
  ------------------
  338|  4.00M|		ch = 0xa;
  339|  4.00M|		x->line++;
  340|  4.00M|		x->byte = 0;
  341|  4.00M|	}
  342|   187M|	x->byte++;
  343|       |
  344|   187M|	switch((yxml_state_t)x->state) {
  ------------------
  |  Branch (344:9): [True: 187M, False: 0]
  ------------------
  345|  11.7k|	case YXMLS_string:
  ------------------
  |  Branch (345:2): [True: 11.7k, False: 187M]
  ------------------
  346|  11.7k|		if(ch == *x->string) {
  ------------------
  |  Branch (346:6): [True: 11.7k, False: 11]
  ------------------
  347|  11.7k|			x->string++;
  348|  11.7k|			if(!*x->string)
  ------------------
  |  Branch (348:7): [True: 2.20k, False: 9.53k]
  ------------------
  349|  2.20k|				x->state = x->nextstate;
  350|  11.7k|			return YXML_OK;
  351|  11.7k|		}
  352|     11|		break;
  353|  30.6M|	case YXMLS_attr0:
  ------------------
  |  Branch (353:2): [True: 30.6M, False: 156M]
  ------------------
  354|  30.6M|		if(yxml_isName(ch))
  ------------------
  |  |  107|  30.6M|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|  61.3M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  61.3M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 10.4M, False: 20.2M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 24.7k, False: 20.2M]
  |  |  |  |  |  Branch (106:61): [True: 2.03k, False: 20.2M]
  |  |  |  |  |  Branch (106:73): [True: 19.1M, False: 1.10M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|  31.7M|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 89.9k, False: 1.01M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 15.5k, False: 1.00M]
  |  |  |  Branch (107:77): [True: 1.80k, False: 1.00M]
  |  |  ------------------
  ------------------
  355|  29.6M|			return yxml_attrname(x, ch);
  356|  1.00M|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  1.00M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 738k, False: 263k]
  |  |  |  Branch (101:36): [True: 206, False: 262k]
  |  |  |  Branch (101:49): [True: 413, False: 262k]
  |  |  ------------------
  ------------------
  357|   739k|			x->state = YXMLS_attr1;
  358|   739k|			return yxml_attrnameend(x, ch);
  359|   739k|		}
  360|   262k|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (360:6): [True: 262k, False: 23]
  ------------------
  361|   262k|			x->state = YXMLS_attr2;
  362|   262k|			return yxml_attrnameend(x, ch);
  363|   262k|		}
  364|     23|		break;
  365|   739k|	case YXMLS_attr1:
  ------------------
  |  Branch (365:2): [True: 739k, False: 186M]
  ------------------
  366|   739k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|   739k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 203, False: 739k]
  |  |  |  Branch (101:36): [True: 194, False: 739k]
  |  |  |  Branch (101:49): [True: 194, False: 738k]
  |  |  ------------------
  ------------------
  367|    591|			return YXML_OK;
  368|   738k|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (368:6): [True: 738k, False: 18]
  ------------------
  369|   738k|			x->state = YXMLS_attr2;
  370|   738k|			return YXML_OK;
  371|   738k|		}
  372|     18|		break;
  373|  1.00M|	case YXMLS_attr2:
  ------------------
  |  Branch (373:2): [True: 1.00M, False: 186M]
  ------------------
  374|  1.00M|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.00M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 199, False: 1.00M]
  |  |  |  Branch (101:36): [True: 194, False: 1.00M]
  |  |  |  Branch (101:49): [True: 195, False: 1.00M]
  |  |  ------------------
  ------------------
  375|    588|			return YXML_OK;
  376|  1.00M|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (376:6): [True: 258k, False: 743k]
  |  Branch (376:35): [True: 743k, False: 17]
  ------------------
  377|  1.00M|			x->state = YXMLS_attr3;
  378|  1.00M|			x->quote = ch;
  379|  1.00M|			return YXML_OK;
  380|  1.00M|		}
  381|     17|		break;
  382|  3.94M|	case YXMLS_attr3:
  ------------------
  |  Branch (382:2): [True: 3.94M, False: 183M]
  ------------------
  383|  3.94M|		if(yxml_isAttValue(ch))
  ------------------
  |  |  109|  3.94M|#define yxml_isAttValue(c) (yxml_isChar(c) && c != x->quote && c != '<' && c != '&')
  |  |  ------------------
  |  |  |  |   99|  7.88M|#define yxml_isChar(c) 1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (99:24): [True: 3.94M, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (109:47): [True: 2.94M, False: 1.00M]
  |  |  |  Branch (109:64): [True: 2.94M, False: 1]
  |  |  |  Branch (109:76): [True: 2.94M, False: 873]
  |  |  ------------------
  ------------------
  384|  2.94M|			return yxml_dataattr(x, ch);
  385|  1.00M|		if(ch == (unsigned char)'&') {
  ------------------
  |  Branch (385:6): [True: 873, False: 1.00M]
  ------------------
  386|    873|			x->state = YXMLS_attr4;
  387|    873|			return yxml_refstart(x, ch);
  388|    873|		}
  389|  1.00M|		if(x->quote == ch) {
  ------------------
  |  Branch (389:6): [True: 1.00M, False: 1]
  ------------------
  390|  1.00M|			x->state = YXMLS_elem2;
  391|  1.00M|			return yxml_attrvalend(x, ch);
  392|  1.00M|		}
  393|      1|		break;
  394|  3.18k|	case YXMLS_attr4:
  ------------------
  |  Branch (394:2): [True: 3.18k, False: 187M]
  ------------------
  395|  3.18k|		if(yxml_isRef(ch))
  ------------------
  |  |  113|  3.18k|#define yxml_isRef(c) (yxml_isNum(c) || yxml_isAlpha(c) || c == '#')
  |  |  ------------------
  |  |  |  |  103|  6.36k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 937, False: 2.24k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isRef(c) (yxml_isNum(c) || yxml_isAlpha(c) || c == '#')
  |  |  ------------------
  |  |  |  |  102|  5.42k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 712, False: 1.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (113:60): [True: 702, False: 832]
  |  |  ------------------
  ------------------
  396|  2.35k|			return yxml_ref(x, ch);
  397|    832|		if(ch == (unsigned char)'\x3b') {
  ------------------
  |  Branch (397:6): [True: 815, False: 17]
  ------------------
  398|    815|			x->state = YXMLS_attr3;
  399|    815|			return yxml_refattrval(x, ch);
  400|    815|		}
  401|     17|		break;
  402|  1.94k|	case YXMLS_cd0:
  ------------------
  |  Branch (402:2): [True: 1.94k, False: 187M]
  ------------------
  403|  1.94k|		if(ch == (unsigned char)']') {
  ------------------
  |  Branch (403:6): [True: 725, False: 1.22k]
  ------------------
  404|    725|			x->state = YXMLS_cd1;
  405|    725|			return YXML_OK;
  406|    725|		}
  407|  1.22k|		if(yxml_isChar(ch))
  ------------------
  |  |   99|  1.22k|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 1.22k, Folded]
  |  |  ------------------
  ------------------
  408|  1.22k|			return yxml_datacontent(x, ch);
  409|      0|		break;
  410|    719|	case YXMLS_cd1:
  ------------------
  |  Branch (410:2): [True: 719, False: 187M]
  ------------------
  411|    719|		if(ch == (unsigned char)']') {
  ------------------
  |  Branch (411:6): [True: 477, False: 242]
  ------------------
  412|    477|			x->state = YXMLS_cd2;
  413|    477|			return YXML_OK;
  414|    477|		}
  415|    242|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    242|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 242, Folded]
  |  |  ------------------
  ------------------
  416|    242|			x->state = YXMLS_cd0;
  417|    242|			return yxml_datacd1(x, ch);
  418|    242|		}
  419|      0|		break;
  420|    685|	case YXMLS_cd2:
  ------------------
  |  Branch (420:2): [True: 685, False: 187M]
  ------------------
  421|    685|		if(ch == (unsigned char)']')
  ------------------
  |  Branch (421:6): [True: 222, False: 463]
  ------------------
  422|    222|			return yxml_datacontent(x, ch);
  423|    463|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (423:6): [True: 230, False: 233]
  ------------------
  424|    230|			x->state = YXMLS_misc2;
  425|    230|			return YXML_OK;
  426|    230|		}
  427|    233|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    233|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 233, Folded]
  |  |  ------------------
  ------------------
  428|    233|			x->state = YXMLS_cd0;
  429|    233|			return yxml_datacd2(x, ch);
  430|    233|		}
  431|      0|		break;
  432|    217|	case YXMLS_comment0:
  ------------------
  |  Branch (432:2): [True: 217, False: 187M]
  ------------------
  433|    217|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (433:6): [True: 207, False: 10]
  ------------------
  434|    207|			x->state = YXMLS_comment1;
  435|    207|			return YXML_OK;
  436|    207|		}
  437|     10|		break;
  438|  4.30k|	case YXMLS_comment1:
  ------------------
  |  Branch (438:2): [True: 4.30k, False: 187M]
  ------------------
  439|  4.30k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (439:6): [True: 4.29k, False: 9]
  ------------------
  440|  4.29k|			x->state = YXMLS_comment2;
  441|  4.29k|			return YXML_OK;
  442|  4.29k|		}
  443|      9|		break;
  444|  6.17k|	case YXMLS_comment2:
  ------------------
  |  Branch (444:2): [True: 6.17k, False: 187M]
  ------------------
  445|  6.17k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (445:6): [True: 4.64k, False: 1.53k]
  ------------------
  446|  4.64k|			x->state = YXMLS_comment3;
  447|  4.64k|			return YXML_OK;
  448|  4.64k|		}
  449|  1.53k|		if(yxml_isChar(ch))
  ------------------
  |  |   99|  1.53k|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 1.53k, Folded]
  |  |  ------------------
  ------------------
  450|  1.53k|			return YXML_OK;
  451|      0|		break;
  452|  4.63k|	case YXMLS_comment3:
  ------------------
  |  Branch (452:2): [True: 4.63k, False: 187M]
  ------------------
  453|  4.63k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (453:6): [True: 4.24k, False: 387]
  ------------------
  454|  4.24k|			x->state = YXMLS_comment4;
  455|  4.24k|			return YXML_OK;
  456|  4.24k|		}
  457|    387|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    387|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 387, Folded]
  |  |  ------------------
  ------------------
  458|    387|			x->state = YXMLS_comment2;
  459|    387|			return YXML_OK;
  460|    387|		}
  461|      0|		break;
  462|  4.24k|	case YXMLS_comment4:
  ------------------
  |  Branch (462:2): [True: 4.24k, False: 187M]
  ------------------
  463|  4.24k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (463:6): [True: 4.23k, False: 4]
  ------------------
  464|  4.23k|			x->state = x->nextstate;
  465|  4.23k|			return YXML_OK;
  466|  4.23k|		}
  467|      4|		break;
  468|  1.95k|	case YXMLS_dt0:
  ------------------
  |  Branch (468:2): [True: 1.95k, False: 187M]
  ------------------
  469|  1.95k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (469:6): [True: 345, False: 1.61k]
  ------------------
  470|    345|			x->state = YXMLS_misc1;
  471|    345|			return YXML_OK;
  472|    345|		}
  473|  1.61k|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (473:6): [True: 265, False: 1.34k]
  |  Branch (473:35): [True: 326, False: 1.01k]
  ------------------
  474|    591|			x->state = YXMLS_dt1;
  475|    591|			x->quote = ch;
  476|    591|			x->nextstate = YXMLS_dt0;
  477|    591|			return YXML_OK;
  478|    591|		}
  479|  1.01k|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (479:6): [True: 805, False: 214]
  ------------------
  480|    805|			x->state = YXMLS_dt2;
  481|    805|			return YXML_OK;
  482|    805|		}
  483|    214|		if(yxml_isChar(ch))
  ------------------
  |  |   99|    214|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 214, Folded]
  |  |  ------------------
  ------------------
  484|    214|			return YXML_OK;
  485|      0|		break;
  486|  1.13k|	case YXMLS_dt1:
  ------------------
  |  Branch (486:2): [True: 1.13k, False: 187M]
  ------------------
  487|  1.13k|		if(x->quote == ch) {
  ------------------
  |  Branch (487:6): [True: 938, False: 195]
  ------------------
  488|    938|			x->state = x->nextstate;
  489|    938|			return YXML_OK;
  490|    938|		}
  491|    195|		if(yxml_isChar(ch))
  ------------------
  |  |   99|    195|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 195, Folded]
  |  |  ------------------
  ------------------
  492|    195|			return YXML_OK;
  493|      0|		break;
  494|    798|	case YXMLS_dt2:
  ------------------
  |  Branch (494:2): [True: 798, False: 187M]
  ------------------
  495|    798|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (495:6): [True: 194, False: 604]
  ------------------
  496|    194|			x->state = YXMLS_pi0;
  497|    194|			x->nextstate = YXMLS_dt0;
  498|    194|			return YXML_OK;
  499|    194|		}
  500|    604|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (500:6): [True: 589, False: 15]
  ------------------
  501|    589|			x->state = YXMLS_dt3;
  502|    589|			return YXML_OK;
  503|    589|		}
  504|     15|		break;
  505|    583|	case YXMLS_dt3:
  ------------------
  |  Branch (505:2): [True: 583, False: 187M]
  ------------------
  506|    583|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (506:6): [True: 194, False: 389]
  ------------------
  507|    194|			x->state = YXMLS_comment1;
  508|    194|			x->nextstate = YXMLS_dt0;
  509|    194|			return YXML_OK;
  510|    194|		}
  511|    389|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    389|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 389, Folded]
  |  |  ------------------
  ------------------
  512|    389|			x->state = YXMLS_dt4;
  513|    389|			return YXML_OK;
  514|    389|		}
  515|      0|		break;
  516|    937|	case YXMLS_dt4:
  ------------------
  |  Branch (516:2): [True: 937, False: 187M]
  ------------------
  517|    937|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (517:6): [True: 194, False: 743]
  |  Branch (517:35): [True: 195, False: 548]
  ------------------
  518|    389|			x->state = YXMLS_dt1;
  519|    389|			x->quote = ch;
  520|    389|			x->nextstate = YXMLS_dt4;
  521|    389|			return YXML_OK;
  522|    389|		}
  523|    548|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (523:6): [True: 343, False: 205]
  ------------------
  524|    343|			x->state = YXMLS_dt0;
  525|    343|			return YXML_OK;
  526|    343|		}
  527|    205|		if(yxml_isChar(ch))
  ------------------
  |  |   99|    205|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 205, Folded]
  |  |  ------------------
  ------------------
  528|    205|			return YXML_OK;
  529|      0|		break;
  530|  13.5M|	case YXMLS_elem0:
  ------------------
  |  Branch (530:2): [True: 13.5M, False: 173M]
  ------------------
  531|  13.5M|		if(yxml_isName(ch))
  ------------------
  |  |  107|  13.5M|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|  27.1M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  27.1M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 300k, False: 13.2M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 754, False: 13.2M]
  |  |  |  |  |  Branch (106:61): [True: 1.22k, False: 13.2M]
  |  |  |  |  |  Branch (106:73): [True: 158k, False: 13.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|  26.6M|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 12.4k, False: 13.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 908, False: 13.0M]
  |  |  |  Branch (107:77): [True: 634, False: 13.0M]
  |  |  ------------------
  ------------------
  532|   474k|			return yxml_elemname(x, ch);
  533|  13.0M|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  13.0M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 763, False: 13.0M]
  |  |  |  Branch (101:36): [True: 409, False: 13.0M]
  |  |  |  Branch (101:49): [True: 1.36k, False: 13.0M]
  |  |  ------------------
  ------------------
  534|  2.53k|			x->state = YXMLS_elem1;
  535|  2.53k|			return yxml_elemnameend(x, ch);
  536|  2.53k|		}
  537|  13.0M|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (537:6): [True: 13.0M, False: 32.4k]
  ------------------
  538|  13.0M|			x->state = YXMLS_elem3;
  539|  13.0M|			return yxml_elemnameend(x, ch);
  540|  13.0M|		}
  541|  32.4k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (541:6): [True: 32.4k, False: 23]
  ------------------
  542|  32.4k|			x->state = YXMLS_misc2;
  543|  32.4k|			return yxml_elemnameend(x, ch);
  544|  32.4k|		}
  545|     23|		break;
  546|  1.71M|	case YXMLS_elem1:
  ------------------
  |  Branch (546:2): [True: 1.71M, False: 185M]
  ------------------
  547|  1.71M|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.71M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 631k, False: 1.08M]
  |  |  |  Branch (101:36): [True: 634, False: 1.08M]
  |  |  |  Branch (101:49): [True: 80.2k, False: 1.00M]
  |  |  ------------------
  ------------------
  548|   712k|			return YXML_OK;
  549|  1.00M|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (549:6): [True: 1.00k, False: 1.00M]
  ------------------
  550|  1.00k|			x->state = YXMLS_elem3;
  551|  1.00k|			return YXML_OK;
  552|  1.00k|		}
  553|  1.00M|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (553:6): [True: 435, False: 1.00M]
  ------------------
  554|    435|			x->state = YXMLS_misc2;
  555|    435|			return YXML_OK;
  556|    435|		}
  557|  1.00M|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  1.00M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  2.00M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 379k, False: 621k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 566, False: 621k]
  |  |  |  Branch (106:61): [True: 715, False: 620k]
  |  |  |  Branch (106:73): [True: 620k, False: 25]
  |  |  ------------------
  ------------------
  558|  1.00M|			x->state = YXMLS_attr0;
  559|  1.00M|			return yxml_attrstart(x, ch);
  560|  1.00M|		}
  561|     25|		break;
  562|  1.00M|	case YXMLS_elem2:
  ------------------
  |  Branch (562:2): [True: 1.00M, False: 186M]
  ------------------
  563|  1.00M|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  1.00M|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 258k, False: 742k]
  |  |  |  Branch (101:36): [True: 667, False: 741k]
  |  |  |  Branch (101:49): [True: 741k, False: 569]
  |  |  ------------------
  ------------------
  564|  1.00M|			x->state = YXMLS_elem1;
  565|  1.00M|			return YXML_OK;
  566|  1.00M|		}
  567|    569|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (567:6): [True: 337, False: 232]
  ------------------
  568|    337|			x->state = YXMLS_elem3;
  569|    337|			return YXML_OK;
  570|    337|		}
  571|    232|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (571:6): [True: 216, False: 16]
  ------------------
  572|    216|			x->state = YXMLS_misc2;
  573|    216|			return YXML_OK;
  574|    216|		}
  575|     16|		break;
  576|  13.0M|	case YXMLS_elem3:
  ------------------
  |  Branch (576:2): [True: 13.0M, False: 174M]
  ------------------
  577|  13.0M|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (577:6): [True: 13.0M, False: 8]
  ------------------
  578|  13.0M|			x->state = YXMLS_misc2;
  579|  13.0M|			return yxml_selfclose(x, ch);
  580|  13.0M|		}
  581|      8|		break;
  582|    794|	case YXMLS_enc0:
  ------------------
  |  Branch (582:2): [True: 794, False: 187M]
  ------------------
  583|    794|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    794|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 195, False: 599]
  |  |  |  Branch (101:36): [True: 200, False: 399]
  |  |  |  Branch (101:49): [True: 194, False: 205]
  |  |  ------------------
  ------------------
  584|    589|			return YXML_OK;
  585|    205|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (585:6): [True: 186, False: 19]
  ------------------
  586|    186|			x->state = YXMLS_enc1;
  587|    186|			return YXML_OK;
  588|    186|		}
  589|     19|		break;
  590|    743|	case YXMLS_enc1:
  ------------------
  |  Branch (590:2): [True: 743, False: 187M]
  ------------------
  591|    743|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    743|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 549]
  |  |  |  Branch (101:36): [True: 194, False: 355]
  |  |  |  Branch (101:49): [True: 194, False: 161]
  |  |  ------------------
  ------------------
  592|    582|			return YXML_OK;
  593|    161|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (593:6): [True: 62, False: 99]
  |  Branch (593:35): [True: 85, False: 14]
  ------------------
  594|    147|			x->state = YXMLS_enc2;
  595|    147|			x->quote = ch;
  596|    147|			return YXML_OK;
  597|    147|		}
  598|     14|		break;
  599|    145|	case YXMLS_enc2:
  ------------------
  |  Branch (599:2): [True: 145, False: 187M]
  ------------------
  600|    145|		if(yxml_isAlpha(ch)) {
  ------------------
  |  |  102|    145|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  ------------------
  |  |  |  Branch (102:25): [True: 138, False: 7]
  |  |  ------------------
  ------------------
  601|    138|			x->state = YXMLS_enc3;
  602|    138|			return YXML_OK;
  603|    138|		}
  604|      7|		break;
  605|  1.07k|	case YXMLS_enc3:
  ------------------
  |  Branch (605:2): [True: 1.07k, False: 187M]
  ------------------
  606|  1.07k|		if(yxml_isEncName(ch))
  ------------------
  |  |  105|  1.07k|#define yxml_isEncName(c) (yxml_isAlpha(c) || yxml_isNum(c) || c == '.' || c == '_' || c == '-')
  |  |  ------------------
  |  |  |  |  102|  2.15k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 200, False: 877]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isEncName(c) (yxml_isAlpha(c) || yxml_isNum(c) || c == '.' || c == '_' || c == '-')
  |  |  ------------------
  |  |  |  |  103|  1.95k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 199, False: 678]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (105:64): [True: 195, False: 483]
  |  |  |  Branch (105:76): [True: 194, False: 289]
  |  |  |  Branch (105:88): [True: 196, False: 93]
  |  |  ------------------
  ------------------
  607|    984|			return YXML_OK;
  608|     93|		if(x->quote == ch) {
  ------------------
  |  Branch (608:6): [True: 80, False: 13]
  ------------------
  609|     80|			x->state = YXMLS_xmldecl6;
  610|     80|			return YXML_OK;
  611|     80|		}
  612|     13|		break;
  613|  31.2k|	case YXMLS_etag0:
  ------------------
  |  Branch (613:2): [True: 31.2k, False: 187M]
  ------------------
  614|  31.2k|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  31.2k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  62.5k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 12.6k, False: 18.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 305, False: 18.3k]
  |  |  |  Branch (106:61): [True: 355, False: 17.9k]
  |  |  |  Branch (106:73): [True: 17.9k, False: 13]
  |  |  ------------------
  ------------------
  615|  31.2k|			x->state = YXMLS_etag1;
  616|  31.2k|			return yxml_elemclose(x, ch);
  617|  31.2k|		}
  618|     13|		break;
  619|  91.8k|	case YXMLS_etag1:
  ------------------
  |  Branch (619:2): [True: 91.8k, False: 186M]
  ------------------
  620|  91.8k|		if(yxml_isName(ch))
  ------------------
  |  |  107|  91.8k|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|   183k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|   183k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 54.9k, False: 36.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 194, False: 36.7k]
  |  |  |  |  |  Branch (106:61): [True: 309, False: 36.4k]
  |  |  |  |  |  Branch (106:73): [True: 346, False: 36.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|   127k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 4.38k, False: 31.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 327, False: 31.3k]
  |  |  |  Branch (107:77): [True: 194, False: 31.1k]
  |  |  ------------------
  ------------------
  621|  60.6k|			return yxml_elemclose(x, ch);
  622|  31.1k|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  31.1k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 258, False: 30.8k]
  |  |  |  Branch (101:36): [True: 1.18k, False: 29.7k]
  |  |  |  Branch (101:49): [True: 247, False: 29.4k]
  |  |  ------------------
  ------------------
  623|  1.69k|			x->state = YXMLS_etag2;
  624|  1.69k|			return yxml_elemcloseend(x, ch);
  625|  1.69k|		}
  626|  29.4k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (626:6): [True: 29.4k, False: 19]
  ------------------
  627|  29.4k|			x->state = YXMLS_misc2;
  628|  29.4k|			return yxml_elemcloseend(x, ch);
  629|  29.4k|		}
  630|     19|		break;
  631|  16.9k|	case YXMLS_etag2:
  ------------------
  |  Branch (631:2): [True: 16.9k, False: 187M]
  ------------------
  632|  16.9k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  16.9k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 16.7k]
  |  |  |  Branch (101:36): [True: 15.0k, False: 1.70k]
  |  |  |  Branch (101:49): [True: 380, False: 1.32k]
  |  |  ------------------
  ------------------
  633|  15.6k|			return YXML_OK;
  634|  1.32k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (634:6): [True: 1.30k, False: 13]
  ------------------
  635|  1.30k|			x->state = YXMLS_misc2;
  636|  1.30k|			return YXML_OK;
  637|  1.30k|		}
  638|     13|		break;
  639|  8.29k|	case YXMLS_init:
  ------------------
  |  Branch (639:2): [True: 8.29k, False: 187M]
  ------------------
  640|  8.29k|		if(ch == (unsigned char)'\xef') {
  ------------------
  |  Branch (640:6): [True: 17, False: 8.28k]
  ------------------
  641|     17|			x->state = YXMLS_string;
  642|     17|			x->nextstate = YXMLS_misc0;
  643|     17|			x->string = (unsigned char *)"\xbb\xbf";
  644|     17|			return YXML_OK;
  645|     17|		}
  646|  8.28k|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  8.28k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 42, False: 8.23k]
  |  |  |  Branch (101:36): [True: 21, False: 8.21k]
  |  |  |  Branch (101:49): [True: 48, False: 8.16k]
  |  |  ------------------
  ------------------
  647|    111|			x->state = YXMLS_misc0;
  648|    111|			return YXML_OK;
  649|    111|		}
  650|  8.16k|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (650:6): [True: 8.14k, False: 28]
  ------------------
  651|  8.14k|			x->state = YXMLS_le0;
  652|  8.14k|			return YXML_OK;
  653|  8.14k|		}
  654|     28|		break;
  655|  8.18k|	case YXMLS_le0:
  ------------------
  |  Branch (655:2): [True: 8.18k, False: 187M]
  ------------------
  656|  8.18k|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (656:6): [True: 277, False: 7.90k]
  ------------------
  657|    277|			x->state = YXMLS_lee1;
  658|    277|			return YXML_OK;
  659|    277|		}
  660|  7.90k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (660:6): [True: 1.21k, False: 6.69k]
  ------------------
  661|  1.21k|			x->state = YXMLS_leq0;
  662|  1.21k|			return YXML_OK;
  663|  1.21k|		}
  664|  6.69k|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  6.69k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  13.3k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 2.18k, False: 4.50k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 99, False: 4.40k]
  |  |  |  Branch (106:61): [True: 79, False: 4.32k]
  |  |  |  Branch (106:73): [True: 4.30k, False: 22]
  |  |  ------------------
  ------------------
  665|  6.66k|			x->state = YXMLS_elem0;
  666|  6.66k|			return yxml_elemstart(x, ch);
  667|  6.66k|		}
  668|     22|		break;
  669|  2.40k|	case YXMLS_le1:
  ------------------
  |  Branch (669:2): [True: 2.40k, False: 187M]
  ------------------
  670|  2.40k|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (670:6): [True: 764, False: 1.64k]
  ------------------
  671|    764|			x->state = YXMLS_lee1;
  672|    764|			return YXML_OK;
  673|    764|		}
  674|  1.64k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (674:6): [True: 1.45k, False: 186]
  ------------------
  675|  1.45k|			x->state = YXMLS_pi0;
  676|  1.45k|			x->nextstate = YXMLS_misc1;
  677|  1.45k|			return YXML_OK;
  678|  1.45k|		}
  679|    186|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|    186|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|    372|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 12, False: 174]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 3, False: 171]
  |  |  |  Branch (106:61): [True: 31, False: 140]
  |  |  |  Branch (106:73): [True: 127, False: 13]
  |  |  ------------------
  ------------------
  680|    173|			x->state = YXMLS_elem0;
  681|    173|			return yxml_elemstart(x, ch);
  682|    173|		}
  683|     13|		break;
  684|  13.1M|	case YXMLS_le2:
  ------------------
  |  Branch (684:2): [True: 13.1M, False: 173M]
  ------------------
  685|  13.1M|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (685:6): [True: 3.73k, False: 13.1M]
  ------------------
  686|  3.73k|			x->state = YXMLS_lee2;
  687|  3.73k|			return YXML_OK;
  688|  3.73k|		}
  689|  13.1M|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (689:6): [True: 1.44k, False: 13.1M]
  ------------------
  690|  1.44k|			x->state = YXMLS_pi0;
  691|  1.44k|			x->nextstate = YXMLS_misc2;
  692|  1.44k|			return YXML_OK;
  693|  1.44k|		}
  694|  13.1M|		if(ch == (unsigned char)'/') {
  ------------------
  |  Branch (694:6): [True: 31.2k, False: 13.0M]
  ------------------
  695|  31.2k|			x->state = YXMLS_etag0;
  696|  31.2k|			return YXML_OK;
  697|  31.2k|		}
  698|  13.0M|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  13.0M|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  26.1M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 38.8k, False: 13.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 555, False: 13.0M]
  |  |  |  Branch (106:61): [True: 896, False: 13.0M]
  |  |  |  Branch (106:73): [True: 13.0M, False: 21]
  |  |  ------------------
  ------------------
  699|  13.0M|			x->state = YXMLS_elem0;
  700|  13.0M|			return yxml_elemstart(x, ch);
  701|  13.0M|		}
  702|     21|		break;
  703|    621|	case YXMLS_le3:
  ------------------
  |  Branch (703:2): [True: 621, False: 187M]
  ------------------
  704|    621|		if(ch == (unsigned char)'!') {
  ------------------
  |  Branch (704:6): [True: 222, False: 399]
  ------------------
  705|    222|			x->state = YXMLS_comment0;
  706|    222|			x->nextstate = YXMLS_misc3;
  707|    222|			return YXML_OK;
  708|    222|		}
  709|    399|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (709:6): [True: 388, False: 11]
  ------------------
  710|    388|			x->state = YXMLS_pi0;
  711|    388|			x->nextstate = YXMLS_misc3;
  712|    388|			return YXML_OK;
  713|    388|		}
  714|     11|		break;
  715|  1.03k|	case YXMLS_lee1:
  ------------------
  |  Branch (715:2): [True: 1.03k, False: 187M]
  ------------------
  716|  1.03k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (716:6): [True: 509, False: 524]
  ------------------
  717|    509|			x->state = YXMLS_comment1;
  718|    509|			x->nextstate = YXMLS_misc1;
  719|    509|			return YXML_OK;
  720|    509|		}
  721|    524|		if(ch == (unsigned char)'D') {
  ------------------
  |  Branch (721:6): [True: 514, False: 10]
  ------------------
  722|    514|			x->state = YXMLS_string;
  723|    514|			x->nextstate = YXMLS_dt0;
  724|    514|			x->string = (unsigned char *)"OCTYPE";
  725|    514|			return YXML_OK;
  726|    514|		}
  727|     10|		break;
  728|  3.72k|	case YXMLS_lee2:
  ------------------
  |  Branch (728:2): [True: 3.72k, False: 187M]
  ------------------
  729|  3.72k|		if(ch == (unsigned char)'-') {
  ------------------
  |  Branch (729:6): [True: 3.42k, False: 305]
  ------------------
  730|  3.42k|			x->state = YXMLS_comment1;
  731|  3.42k|			x->nextstate = YXMLS_misc2;
  732|  3.42k|			return YXML_OK;
  733|  3.42k|		}
  734|    305|		if(ch == (unsigned char)'[') {
  ------------------
  |  Branch (734:6): [True: 292, False: 13]
  ------------------
  735|    292|			x->state = YXMLS_string;
  736|    292|			x->nextstate = YXMLS_cd0;
  737|    292|			x->string = (unsigned char *)"CDATA[";
  738|    292|			return YXML_OK;
  739|    292|		}
  740|     13|		break;
  741|  1.21k|	case YXMLS_leq0:
  ------------------
  |  Branch (741:2): [True: 1.21k, False: 187M]
  ------------------
  742|  1.21k|		if(ch == (unsigned char)'x') {
  ------------------
  |  Branch (742:6): [True: 894, False: 324]
  ------------------
  743|    894|			x->state = YXMLS_xmldecl0;
  744|    894|			x->nextstate = YXMLS_misc1;
  745|    894|			return yxml_pistart(x, ch);
  746|    894|		}
  747|    324|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|    324|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|    648|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 156, False: 168]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 22, False: 146]
  |  |  |  Branch (106:61): [True: 21, False: 125]
  |  |  |  Branch (106:73): [True: 112, False: 13]
  |  |  ------------------
  ------------------
  748|    311|			x->state = YXMLS_pi1;
  749|    311|			x->nextstate = YXMLS_misc1;
  750|    311|			return yxml_pistart(x, ch);
  751|    311|		}
  752|     13|		break;
  753|  1.25k|	case YXMLS_misc0:
  ------------------
  |  Branch (753:2): [True: 1.25k, False: 187M]
  ------------------
  754|  1.25k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.25k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 1.05k]
  |  |  |  Branch (101:36): [True: 194, False: 863]
  |  |  |  Branch (101:49): [True: 796, False: 67]
  |  |  ------------------
  ------------------
  755|  1.18k|			return YXML_OK;
  756|     67|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (756:6): [True: 47, False: 20]
  ------------------
  757|     47|			x->state = YXMLS_le0;
  758|     47|			return YXML_OK;
  759|     47|		}
  760|     20|		break;
  761|  3.02k|	case YXMLS_misc1:
  ------------------
  |  Branch (761:2): [True: 3.02k, False: 187M]
  ------------------
  762|  3.02k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  3.02k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 2.82k]
  |  |  |  Branch (101:36): [True: 194, False: 2.63k]
  |  |  |  Branch (101:49): [True: 204, False: 2.42k]
  |  |  ------------------
  ------------------
  763|    592|			return YXML_OK;
  764|  2.42k|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (764:6): [True: 2.41k, False: 17]
  ------------------
  765|  2.41k|			x->state = YXMLS_le1;
  766|  2.41k|			return YXML_OK;
  767|  2.41k|		}
  768|     17|		break;
  769|  97.8M|	case YXMLS_misc2:
  ------------------
  |  Branch (769:2): [True: 97.8M, False: 89.2M]
  ------------------
  770|  97.8M|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (770:6): [True: 13.1M, False: 84.7M]
  ------------------
  771|  13.1M|			x->state = YXMLS_le2;
  772|  13.1M|			return YXML_OK;
  773|  13.1M|		}
  774|  84.7M|		if(ch == (unsigned char)'&') {
  ------------------
  |  Branch (774:6): [True: 2.06M, False: 82.6M]
  ------------------
  775|  2.06M|			x->state = YXMLS_misc2a;
  776|  2.06M|			return yxml_refstart(x, ch);
  777|  2.06M|		}
  778|  82.6M|		if(yxml_isChar(ch))
  ------------------
  |  |   99|  82.6M|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 82.6M, Folded]
  |  |  ------------------
  ------------------
  779|  82.6M|			return yxml_datacontent(x, ch);
  780|      0|		break;
  781|  10.2M|	case YXMLS_misc2a:
  ------------------
  |  Branch (781:2): [True: 10.2M, False: 176M]
  ------------------
  782|  10.2M|		if(yxml_isRef(ch))
  ------------------
  |  |  113|  10.2M|#define yxml_isRef(c) (yxml_isNum(c) || yxml_isAlpha(c) || c == '#')
  |  |  ------------------
  |  |  |  |  103|  20.4M|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 5.31k, False: 10.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isRef(c) (yxml_isNum(c) || yxml_isAlpha(c) || c == '#')
  |  |  ------------------
  |  |  |  |  102|  20.4M|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 8.13M, False: 2.06M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (113:60): [True: 3.26k, False: 2.06M]
  |  |  ------------------
  ------------------
  783|  8.14M|			return yxml_ref(x, ch);
  784|  2.06M|		if(ch == (unsigned char)'\x3b') {
  ------------------
  |  Branch (784:6): [True: 2.06M, False: 15]
  ------------------
  785|  2.06M|			x->state = YXMLS_misc2;
  786|  2.06M|			return yxml_refcontent(x, ch);
  787|  2.06M|		}
  788|     15|		break;
  789|  1.22k|	case YXMLS_misc3:
  ------------------
  |  Branch (789:2): [True: 1.22k, False: 187M]
  ------------------
  790|  1.22k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.22k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 1.03k]
  |  |  |  Branch (101:36): [True: 194, False: 840]
  |  |  |  Branch (101:49): [True: 196, False: 644]
  |  |  ------------------
  ------------------
  791|    584|			return YXML_OK;
  792|    644|		if(ch == (unsigned char)'<') {
  ------------------
  |  Branch (792:6): [True: 627, False: 17]
  ------------------
  793|    627|			x->state = YXMLS_le3;
  794|    627|			return YXML_OK;
  795|    627|		}
  796|     17|		break;
  797|  3.44k|	case YXMLS_pi0:
  ------------------
  |  Branch (797:2): [True: 3.44k, False: 187M]
  ------------------
  798|  3.44k|		if(yxml_isNameStart(ch)) {
  ------------------
  |  |  106|  3.44k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  ------------------
  |  |  |  |  102|  6.89k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (102:25): [True: 1.81k, False: 1.63k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (106:49): [True: 676, False: 955]
  |  |  |  Branch (106:61): [True: 413, False: 542]
  |  |  |  Branch (106:73): [True: 525, False: 17]
  |  |  ------------------
  ------------------
  799|  3.43k|			x->state = YXMLS_pi1;
  800|  3.43k|			return yxml_pistart(x, ch);
  801|  3.43k|		}
  802|     17|		break;
  803|  8.91k|	case YXMLS_pi1:
  ------------------
  |  Branch (803:2): [True: 8.91k, False: 187M]
  ------------------
  804|  8.91k|		if(yxml_isName(ch))
  ------------------
  |  |  107|  8.91k|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|  17.8k|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|  17.8k|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 2.53k, False: 6.37k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 221, False: 6.15k]
  |  |  |  |  |  Branch (106:61): [True: 235, False: 5.91k]
  |  |  |  |  |  Branch (106:73): [True: 1.21k, False: 4.70k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|  13.6k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 280, False: 4.42k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 200, False: 4.22k]
  |  |  |  Branch (107:77): [True: 458, False: 3.76k]
  |  |  ------------------
  ------------------
  805|  5.14k|			return yxml_piname(x, ch);
  806|  3.76k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (806:6): [True: 2.35k, False: 1.41k]
  ------------------
  807|  2.35k|			x->state = YXMLS_pi4;
  808|  2.35k|			return yxml_pinameend(x, ch);
  809|  2.35k|		}
  810|  1.41k|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|  1.41k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 463, False: 947]
  |  |  |  Branch (101:36): [True: 294, False: 653]
  |  |  |  Branch (101:49): [True: 630, False: 23]
  |  |  ------------------
  ------------------
  811|  1.38k|			x->state = YXMLS_pi2;
  812|  1.38k|			return yxml_pinameend(x, ch);
  813|  1.38k|		}
  814|     23|		break;
  815|  4.79k|	case YXMLS_pi2:
  ------------------
  |  Branch (815:2): [True: 4.79k, False: 187M]
  ------------------
  816|  4.79k|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (816:6): [True: 1.71k, False: 3.07k]
  ------------------
  817|  1.71k|			x->state = YXMLS_pi3;
  818|  1.71k|			return YXML_OK;
  819|  1.71k|		}
  820|  3.07k|		if(yxml_isChar(ch))
  ------------------
  |  |   99|  3.07k|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 3.07k, Folded]
  |  |  ------------------
  ------------------
  821|  3.07k|			return yxml_datapi1(x, ch);
  822|      0|		break;
  823|  1.70k|	case YXMLS_pi3:
  ------------------
  |  Branch (823:2): [True: 1.70k, False: 187M]
  ------------------
  824|  1.70k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (824:6): [True: 1.31k, False: 393]
  ------------------
  825|  1.31k|			x->state = x->nextstate;
  826|  1.31k|			return yxml_pivalend(x, ch);
  827|  1.31k|		}
  828|    393|		if(yxml_isChar(ch)) {
  ------------------
  |  |   99|    393|#define yxml_isChar(c) 1
  |  |  ------------------
  |  |  |  Branch (99:24): [True: 393, Folded]
  |  |  ------------------
  ------------------
  829|    393|			x->state = YXMLS_pi2;
  830|    393|			return yxml_datapi2(x, ch);
  831|    393|		}
  832|      0|		break;
  833|  2.31k|	case YXMLS_pi4:
  ------------------
  |  Branch (833:2): [True: 2.31k, False: 187M]
  ------------------
  834|  2.31k|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (834:6): [True: 2.31k, False: 2]
  ------------------
  835|  2.31k|			x->state = x->nextstate;
  836|  2.31k|			return yxml_pivalend(x, ch);
  837|  2.31k|		}
  838|      2|		break;
  839|    690|	case YXMLS_std0:
  ------------------
  |  Branch (839:2): [True: 690, False: 187M]
  ------------------
  840|    690|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    690|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 496]
  |  |  |  Branch (101:36): [True: 195, False: 301]
  |  |  |  Branch (101:49): [True: 194, False: 107]
  |  |  ------------------
  ------------------
  841|    583|			return YXML_OK;
  842|    107|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (842:6): [True: 95, False: 12]
  ------------------
  843|     95|			x->state = YXMLS_std1;
  844|     95|			return YXML_OK;
  845|     95|		}
  846|     12|		break;
  847|    653|	case YXMLS_std1:
  ------------------
  |  Branch (847:2): [True: 653, False: 187M]
  ------------------
  848|    653|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    653|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 459]
  |  |  |  Branch (101:36): [True: 194, False: 265]
  |  |  |  Branch (101:49): [True: 195, False: 70]
  |  |  ------------------
  ------------------
  849|    583|			return YXML_OK;
  850|     70|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (850:6): [True: 17, False: 53]
  |  Branch (850:35): [True: 46, False: 7]
  ------------------
  851|     63|			x->state = YXMLS_std2;
  852|     63|			x->quote = ch;
  853|     63|			return YXML_OK;
  854|     63|		}
  855|      7|		break;
  856|     61|	case YXMLS_std2:
  ------------------
  |  Branch (856:2): [True: 61, False: 187M]
  ------------------
  857|     61|		if(ch == (unsigned char)'y') {
  ------------------
  |  Branch (857:6): [True: 3, False: 58]
  ------------------
  858|      3|			x->state = YXMLS_string;
  859|      3|			x->nextstate = YXMLS_std3;
  860|      3|			x->string = (unsigned char *)"es";
  861|      3|			return YXML_OK;
  862|      3|		}
  863|     58|		if(ch == (unsigned char)'n') {
  ------------------
  |  Branch (863:6): [True: 51, False: 7]
  ------------------
  864|     51|			x->state = YXMLS_string;
  865|     51|			x->nextstate = YXMLS_std3;
  866|     51|			x->string = (unsigned char *)"o";
  867|     51|			return YXML_OK;
  868|     51|		}
  869|      7|		break;
  870|     51|	case YXMLS_std3:
  ------------------
  |  Branch (870:2): [True: 51, False: 187M]
  ------------------
  871|     51|		if(x->quote == ch) {
  ------------------
  |  Branch (871:6): [True: 50, False: 1]
  ------------------
  872|     50|			x->state = YXMLS_xmldecl8;
  873|     50|			return YXML_OK;
  874|     50|		}
  875|      1|		break;
  876|  1.10k|	case YXMLS_ver0:
  ------------------
  |  Branch (876:2): [True: 1.10k, False: 187M]
  ------------------
  877|  1.10k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.10k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 195, False: 906]
  |  |  |  Branch (101:36): [True: 195, False: 711]
  |  |  |  Branch (101:49): [True: 194, False: 517]
  |  |  ------------------
  ------------------
  878|    584|			return YXML_OK;
  879|    517|		if(ch == (unsigned char)'=') {
  ------------------
  |  Branch (879:6): [True: 502, False: 15]
  ------------------
  880|    502|			x->state = YXMLS_ver1;
  881|    502|			return YXML_OK;
  882|    502|		}
  883|     15|		break;
  884|  1.06k|	case YXMLS_ver1:
  ------------------
  |  Branch (884:2): [True: 1.06k, False: 187M]
  ------------------
  885|  1.06k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.06k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 196, False: 865]
  |  |  |  Branch (101:36): [True: 194, False: 671]
  |  |  |  Branch (101:49): [True: 194, False: 477]
  |  |  ------------------
  ------------------
  886|    584|			return YXML_OK;
  887|    477|		if(ch == (unsigned char)'\'' || ch == (unsigned char)'"') {
  ------------------
  |  Branch (887:6): [True: 4, False: 473]
  |  Branch (887:35): [True: 457, False: 16]
  ------------------
  888|    461|			x->state = YXMLS_string;
  889|    461|			x->quote = ch;
  890|    461|			x->nextstate = YXMLS_ver2;
  891|    461|			x->string = (unsigned char *)"1.";
  892|    461|			return YXML_OK;
  893|    461|		}
  894|     16|		break;
  895|    458|	case YXMLS_ver2:
  ------------------
  |  Branch (895:2): [True: 458, False: 187M]
  ------------------
  896|    458|		if(yxml_isNum(ch)) {
  ------------------
  |  |  103|    458|#define yxml_isNum(c) (c-'0' < 10)
  |  |  ------------------
  |  |  |  Branch (103:23): [True: 451, False: 7]
  |  |  ------------------
  ------------------
  897|    451|			x->state = YXMLS_ver3;
  898|    451|			return YXML_OK;
  899|    451|		}
  900|      7|		break;
  901|    636|	case YXMLS_ver3:
  ------------------
  |  Branch (901:2): [True: 636, False: 187M]
  ------------------
  902|    636|		if(yxml_isNum(ch))
  ------------------
  |  |  103|    636|#define yxml_isNum(c) (c-'0' < 10)
  |  |  ------------------
  |  |  |  Branch (103:23): [True: 194, False: 442]
  |  |  ------------------
  ------------------
  903|    194|			return YXML_OK;
  904|    442|		if(x->quote == ch) {
  ------------------
  |  Branch (904:6): [True: 432, False: 10]
  ------------------
  905|    432|			x->state = YXMLS_xmldecl4;
  906|    432|			return YXML_OK;
  907|    432|		}
  908|     10|		break;
  909|    893|	case YXMLS_xmldecl0:
  ------------------
  |  Branch (909:2): [True: 893, False: 187M]
  ------------------
  910|    893|		if(ch == (unsigned char)'m') {
  ------------------
  |  Branch (910:6): [True: 780, False: 113]
  ------------------
  911|    780|			x->state = YXMLS_xmldecl1;
  912|    780|			return yxml_piname(x, ch);
  913|    780|		}
  914|    113|		if(yxml_isName(ch)) {
  ------------------
  |  |  107|    113|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|    226|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    226|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 27, False: 86]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 4, False: 82]
  |  |  |  |  |  Branch (106:61): [True: 3, False: 79]
  |  |  |  |  |  Branch (106:73): [True: 12, False: 67]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|    180|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 6, False: 61]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 3, False: 58]
  |  |  |  Branch (107:77): [True: 3, False: 55]
  |  |  ------------------
  ------------------
  915|     58|			x->state = YXMLS_pi1;
  916|     58|			return yxml_piname(x, ch);
  917|     58|		}
  918|     55|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (918:6): [True: 10, False: 45]
  ------------------
  919|     10|			x->state = YXMLS_pi4;
  920|     10|			return yxml_pinameend(x, ch);
  921|     10|		}
  922|     45|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|     45|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 9, False: 36]
  |  |  |  Branch (101:36): [True: 4, False: 32]
  |  |  |  Branch (101:49): [True: 7, False: 25]
  |  |  ------------------
  ------------------
  923|     20|			x->state = YXMLS_pi2;
  924|     20|			return yxml_pinameend(x, ch);
  925|     20|		}
  926|     25|		break;
  927|    779|	case YXMLS_xmldecl1:
  ------------------
  |  Branch (927:2): [True: 779, False: 187M]
  ------------------
  928|    779|		if(ch == (unsigned char)'l') {
  ------------------
  |  Branch (928:6): [True: 694, False: 85]
  ------------------
  929|    694|			x->state = YXMLS_xmldecl2;
  930|    694|			return yxml_piname(x, ch);
  931|    694|		}
  932|     85|		if(yxml_isName(ch)) {
  ------------------
  |  |  107|     85|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|    170|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    170|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 15, False: 70]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 4, False: 66]
  |  |  |  |  |  Branch (106:61): [True: 5, False: 61]
  |  |  |  |  |  Branch (106:73): [True: 14, False: 47]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|    132|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 6, False: 41]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 4, False: 37]
  |  |  |  Branch (107:77): [True: 3, False: 34]
  |  |  ------------------
  ------------------
  933|     51|			x->state = YXMLS_pi1;
  934|     51|			return yxml_piname(x, ch);
  935|     51|		}
  936|     34|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (936:6): [True: 3, False: 31]
  ------------------
  937|      3|			x->state = YXMLS_pi4;
  938|      3|			return yxml_pinameend(x, ch);
  939|      3|		}
  940|     31|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|     31|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 3, False: 28]
  |  |  |  Branch (101:36): [True: 3, False: 25]
  |  |  |  Branch (101:49): [True: 4, False: 21]
  |  |  ------------------
  ------------------
  941|     10|			x->state = YXMLS_pi2;
  942|     10|			return yxml_pinameend(x, ch);
  943|     10|		}
  944|     21|		break;
  945|    693|	case YXMLS_xmldecl2:
  ------------------
  |  Branch (945:2): [True: 693, False: 187M]
  ------------------
  946|    693|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|    693|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 562, False: 131]
  |  |  |  Branch (101:36): [True: 16, False: 115]
  |  |  |  Branch (101:49): [True: 9, False: 106]
  |  |  ------------------
  ------------------
  947|    587|			x->state = YXMLS_xmldecl3;
  948|    587|			return yxml_piabort(x, ch);
  949|    587|		}
  950|    106|		if(yxml_isName(ch)) {
  ------------------
  |  |  107|    106|#define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  106|    212|#define yxml_isNameStart(c) (yxml_isAlpha(c) || c == ':' || c == '_' || c >= 128)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    212|#define yxml_isAlpha(c) ((c|32)-'a' < 26)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (102:25): [True: 15, False: 91]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (106:49): [True: 4, False: 87]
  |  |  |  |  |  Branch (106:61): [True: 4, False: 83]
  |  |  |  |  |  Branch (106:73): [True: 59, False: 24]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define yxml_isName(c) (yxml_isNameStart(c) || yxml_isNum(c) || c == '-' || c == '.')
  |  |  ------------------
  |  |  |  |  103|    130|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 5, False: 19]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (107:65): [True: 3, False: 16]
  |  |  |  Branch (107:77): [True: 3, False: 13]
  |  |  ------------------
  ------------------
  951|     93|			x->state = YXMLS_pi1;
  952|     93|			return yxml_piname(x, ch);
  953|     93|		}
  954|     13|		break;
  955|  1.14k|	case YXMLS_xmldecl3:
  ------------------
  |  Branch (955:2): [True: 1.14k, False: 187M]
  ------------------
  956|  1.14k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.14k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 195, False: 948]
  |  |  |  Branch (101:36): [True: 194, False: 754]
  |  |  |  Branch (101:49): [True: 194, False: 560]
  |  |  ------------------
  ------------------
  957|    583|			return YXML_OK;
  958|    560|		if(ch == (unsigned char)'v') {
  ------------------
  |  Branch (958:6): [True: 542, False: 18]
  ------------------
  959|    542|			x->state = YXMLS_string;
  960|    542|			x->nextstate = YXMLS_ver0;
  961|    542|			x->string = (unsigned char *)"ersion";
  962|    542|			return YXML_OK;
  963|    542|		}
  964|     18|		break;
  965|    431|	case YXMLS_xmldecl4:
  ------------------
  |  Branch (965:2): [True: 431, False: 187M]
  ------------------
  966|    431|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|    431|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 350, False: 81]
  |  |  |  Branch (101:36): [True: 10, False: 71]
  |  |  |  Branch (101:49): [True: 49, False: 22]
  |  |  ------------------
  ------------------
  967|    409|			x->state = YXMLS_xmldecl5;
  968|    409|			return YXML_OK;
  969|    409|		}
  970|     22|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (970:6): [True: 12, False: 10]
  ------------------
  971|     12|			x->state = YXMLS_xmldecl9;
  972|     12|			return YXML_OK;
  973|     12|		}
  974|     10|		break;
  975|  1.03k|	case YXMLS_xmldecl5:
  ------------------
  |  Branch (975:2): [True: 1.03k, False: 187M]
  ------------------
  976|  1.03k|		if(yxml_isSP(ch))
  ------------------
  |  |  101|  1.03k|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 844]
  |  |  |  Branch (101:36): [True: 195, False: 649]
  |  |  |  Branch (101:49): [True: 267, False: 382]
  |  |  ------------------
  ------------------
  977|    656|			return YXML_OK;
  978|    382|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (978:6): [True: 7, False: 375]
  ------------------
  979|      7|			x->state = YXMLS_xmldecl9;
  980|      7|			return YXML_OK;
  981|      7|		}
  982|    375|		if(ch == (unsigned char)'e') {
  ------------------
  |  Branch (982:6): [True: 230, False: 145]
  ------------------
  983|    230|			x->state = YXMLS_string;
  984|    230|			x->nextstate = YXMLS_enc0;
  985|    230|			x->string = (unsigned char *)"ncoding";
  986|    230|			return YXML_OK;
  987|    230|		}
  988|    145|		if(ch == (unsigned char)'s') {
  ------------------
  |  Branch (988:6): [True: 128, False: 17]
  ------------------
  989|    128|			x->state = YXMLS_string;
  990|    128|			x->nextstate = YXMLS_std0;
  991|    128|			x->string = (unsigned char *)"tandalone";
  992|    128|			return YXML_OK;
  993|    128|		}
  994|     17|		break;
  995|     79|	case YXMLS_xmldecl6:
  ------------------
  |  Branch (995:2): [True: 79, False: 187M]
  ------------------
  996|     79|		if(yxml_isSP(ch)) {
  ------------------
  |  |  101|     79|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 24, False: 55]
  |  |  |  Branch (101:36): [True: 12, False: 43]
  |  |  |  Branch (101:49): [True: 20, False: 23]
  |  |  ------------------
  ------------------
  997|     56|			x->state = YXMLS_xmldecl7;
  998|     56|			return YXML_OK;
  999|     56|		}
 1000|     23|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (1000:6): [True: 5, False: 18]
  ------------------
 1001|      5|			x->state = YXMLS_xmldecl9;
 1002|      5|			return YXML_OK;
 1003|      5|		}
 1004|     18|		break;
 1005|    617|	case YXMLS_xmldecl7:
  ------------------
  |  Branch (1005:2): [True: 617, False: 187M]
  ------------------
 1006|    617|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    617|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 196, False: 421]
  |  |  |  Branch (101:36): [True: 196, False: 225]
  |  |  |  Branch (101:49): [True: 196, False: 29]
  |  |  ------------------
  ------------------
 1007|    588|			return YXML_OK;
 1008|     29|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (1008:6): [True: 7, False: 22]
  ------------------
 1009|      7|			x->state = YXMLS_xmldecl9;
 1010|      7|			return YXML_OK;
 1011|      7|		}
 1012|     22|		if(ch == (unsigned char)'s') {
  ------------------
  |  Branch (1012:6): [True: 5, False: 17]
  ------------------
 1013|      5|			x->state = YXMLS_string;
 1014|      5|			x->nextstate = YXMLS_std0;
 1015|      5|			x->string = (unsigned char *)"tandalone";
 1016|      5|			return YXML_OK;
 1017|      5|		}
 1018|     17|		break;
 1019|    629|	case YXMLS_xmldecl8:
  ------------------
  |  Branch (1019:2): [True: 629, False: 187M]
  ------------------
 1020|    629|		if(yxml_isSP(ch))
  ------------------
  |  |  101|    629|#define yxml_isSP(c) (c == 0x20 || c == 0x09 || c == 0x0a)
  |  |  ------------------
  |  |  |  Branch (101:23): [True: 194, False: 435]
  |  |  |  Branch (101:36): [True: 205, False: 230]
  |  |  |  Branch (101:49): [True: 205, False: 25]
  |  |  ------------------
  ------------------
 1021|    604|			return YXML_OK;
 1022|     25|		if(ch == (unsigned char)'?') {
  ------------------
  |  Branch (1022:6): [True: 9, False: 16]
  ------------------
 1023|      9|			x->state = YXMLS_xmldecl9;
 1024|      9|			return YXML_OK;
 1025|      9|		}
 1026|     16|		break;
 1027|     35|	case YXMLS_xmldecl9:
  ------------------
  |  Branch (1027:2): [True: 35, False: 187M]
  ------------------
 1028|     35|		if(ch == (unsigned char)'>') {
  ------------------
  |  Branch (1028:6): [True: 31, False: 4]
  ------------------
 1029|     31|			x->state = YXMLS_misc1;
 1030|     31|			return YXML_OK;
 1031|     31|		}
 1032|      4|		break;
 1033|   187M|	}
 1034|    771|	return YXML_ESYN;
 1035|   187M|}
yxml_eof:
 1037|  7.48k|yxml_ret_t yxml_eof(yxml_t *x) {
 1038|  7.48k|	if(x->state != YXMLS_misc3 &&
  ------------------
  |  Branch (1038:5): [True: 2.36k, False: 5.11k]
  ------------------
 1039|  2.36k|	   !(x->contentmode && x->state == YXMLS_misc2 && x->stacklen == 0))
  ------------------
  |  Branch (1039:7): [True: 337, False: 2.03k]
  |  Branch (1039:25): [True: 337, False: 0]
  |  Branch (1039:52): [True: 337, False: 0]
  ------------------
 1040|  2.03k|		return YXML_EEOF;
 1041|  5.45k|	return YXML_OK;
 1042|  7.48k|}
yxml.c:yxml_attrname:
  243|  29.6M|static inline yxml_ret_t yxml_attrname   (yxml_t *x, unsigned ch) { return yxml_pushstackc(x, ch); }
yxml.c:yxml_pushstackc:
  195|  30.1M|static yxml_ret_t yxml_pushstackc(yxml_t *x, unsigned ch) {
  196|  30.1M|	if(x->stacklen+1 >= x->stacksize)
  ------------------
  |  Branch (196:5): [True: 4, False: 30.1M]
  ------------------
  197|      4|		return YXML_ESTACK;
  198|  30.1M|	x->stack[x->stacklen] = (unsigned char)ch;
  199|  30.1M|	x->stacklen++;
  200|  30.1M|	x->stack[x->stacklen] = 0;
  201|  30.1M|	return YXML_OK;
  202|  30.1M|}
yxml.c:yxml_attrnameend:
  244|  1.00M|static inline yxml_ret_t yxml_attrnameend(yxml_t *x, unsigned ch) { return YXML_ATTRSTART; }
yxml.c:yxml_dataattr:
  177|  2.94M|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|  2.94M|	yxml_setchar(x->data, ch == 0x9 || ch == 0xa ? 0x20 : ch);
  ------------------
  |  Branch (179:24): [True: 721, False: 2.94M]
  |  Branch (179:37): [True: 148k, False: 2.79M]
  ------------------
  180|  2.94M|	x->data[1] = 0;
  181|  2.94M|	return YXML_ATTRVAL;
  182|  2.94M|}
yxml.c:yxml_setchar:
  118|  95.8M|static inline void yxml_setchar(char *dest, unsigned ch) {
  119|  95.8M|	*(unsigned char *)dest = (unsigned char)ch;
  120|  95.8M|}
yxml.c:yxml_refstart:
  255|  2.06M|static inline yxml_ret_t yxml_refstart(yxml_t *x, unsigned ch) {
  256|  2.06M|	memset(x->data, 0, sizeof(x->data));
  257|  2.06M|	x->reflen = 0;
  258|  2.06M|	return YXML_OK;
  259|  2.06M|}
yxml.c:yxml_attrvalend:
  245|  1.00M|static inline yxml_ret_t yxml_attrvalend (yxml_t *x, unsigned ch) { yxml_popstack(x); return YXML_ATTREND; }
yxml.c:yxml_popstack:
  204|  14.0M|static void yxml_popstack(yxml_t *x) {
  205|  14.0M|	do
  206|  58.2M|		x->stacklen--;
  207|  58.2M|	while(x->stack[x->stacklen]);
  ------------------
  |  Branch (207:8): [True: 44.2M, False: 14.0M]
  ------------------
  208|  14.0M|}
yxml.c:yxml_ref:
  261|  8.14M|static yxml_ret_t yxml_ref(yxml_t *x, unsigned ch) {
  262|  8.14M|	if(x->reflen >= sizeof(x->data)-1)
  ------------------
  |  Branch (262:5): [True: 20, False: 8.14M]
  ------------------
  263|     20|		return YXML_EREF;
  264|  8.14M|	yxml_setchar(x->data+x->reflen, ch);
  265|  8.14M|	x->reflen++;
  266|  8.14M|	return YXML_OK;
  267|  8.14M|}
yxml.c:yxml_refattrval:
  300|    815|static inline yxml_ret_t yxml_refattrval(yxml_t *x, unsigned ch) { return yxml_refend(x, YXML_ATTRVAL); }
yxml.c:yxml_refend:
  269|  2.06M|static yxml_ret_t yxml_refend(yxml_t *x, yxml_ret_t ret) {
  270|  2.06M|	unsigned char *r = (unsigned char *)x->data;
  271|  2.06M|	unsigned ch = 0;
  272|  2.06M|	if(*r == '#') {
  ------------------
  |  Branch (272:5): [True: 3.86k, False: 2.06M]
  ------------------
  273|  3.86k|		if(r[1] == 'x')
  ------------------
  |  Branch (273:6): [True: 681, False: 3.18k]
  ------------------
  274|  2.36k|			for(r += 2; yxml_isHex((unsigned)*r); r++)
  ------------------
  |  |  104|  2.36k|#define yxml_isHex(c) (yxml_isNum(c) || (c|32)-'a' < 6)
  |  |  ------------------
  |  |  |  |  103|  4.73k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (103:23): [True: 547, False: 1.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (104:41): [True: 1.13k, False: 681]
  |  |  ------------------
  ------------------
  275|  1.68k|				ch = (ch<<4) + (*r <= '9' ? *r-'0' : (*r|32)-'a' + 10);
  ------------------
  |  Branch (275:21): [True: 547, False: 1.13k]
  ------------------
  276|  3.18k|		else
  277|  8.72k|			for(r++; yxml_isNum((unsigned)*r); r++)
  ------------------
  |  |  103|  8.72k|#define yxml_isNum(c) (c-'0' < 10)
  |  |  ------------------
  |  |  |  Branch (103:23): [True: 5.54k, False: 3.18k]
  |  |  ------------------
  ------------------
  278|  5.54k|				ch = (ch*10) + (*r-'0');
  279|  3.86k|		if(*r)
  ------------------
  |  Branch (279:6): [True: 11, False: 3.85k]
  ------------------
  280|     11|			ch = 0;
  281|  2.06M|	} else {
  282|  2.06M|		uint64_t i = INTFROM5CHARS(r[0], r[1], r[2], r[3], r[4]);
  ------------------
  |  |  115|  2.06M|#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|  2.06M|		ch =
  284|  2.06M|			i == INTFROM5CHARS('l','t', 0,  0, 0) ? '<' :
  ------------------
  |  |  115|  2.06M|#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: 278, False: 2.05M]
  ------------------
  285|  2.06M|			i == INTFROM5CHARS('g','t', 0,  0, 0) ? '>' :
  ------------------
  |  |  115|  2.05M|#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: 54.4k, False: 2.00M]
  ------------------
  286|  2.05M|			i == INTFROM5CHARS('a','m','p', 0, 0) ? '&' :
  ------------------
  |  |  115|  2.00M|#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: 226, False: 2.00M]
  ------------------
  287|  2.00M|			i == INTFROM5CHARS('a','p','o','s',0) ? '\'':
  ------------------
  |  |  115|  2.00M|#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: 341k, False: 1.66M]
  ------------------
  288|  2.00M|			i == INTFROM5CHARS('q','u','o','t',0) ? '"' : 0;
  ------------------
  |  |  115|  1.66M|#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: 1.66M, False: 154]
  ------------------
  289|  2.06M|	}
  290|       |
  291|       |	/* Codepoints not allowed in the XML 1.1 definition of a Char */
  292|  2.06M|	if(!ch || ch > 0x10FFFF || ch == 0xFFFE || ch == 0xFFFF || (ch-0xDFFF) < 0x7FF)
  ------------------
  |  Branch (292:5): [True: 182, False: 2.06M]
  |  Branch (292:12): [True: 0, False: 2.06M]
  |  Branch (292:29): [True: 1, False: 2.06M]
  |  Branch (292:45): [True: 1, False: 2.06M]
  |  Branch (292:61): [True: 8, False: 2.06M]
  ------------------
  293|    192|		return YXML_EREF;
  294|  2.06M|	yxml_setutf8(x->data, ch);
  295|       |	x->isReference = true;
  296|  2.06M|	return ret;
  297|  2.06M|}
yxml.c:yxml_setutf8:
  124|  2.06M|static void yxml_setutf8(char *dest, unsigned ch) {
  125|  2.06M|	if(ch <= 0x007F)
  ------------------
  |  Branch (125:5): [True: 2.06M, False: 970]
  ------------------
  126|  2.06M|		yxml_setchar(dest++, ch);
  127|    970|	else if(ch <= 0x07FF) {
  ------------------
  |  Branch (127:10): [True: 259, False: 711]
  ------------------
  128|    259|		yxml_setchar(dest++, 0xC0 | (ch>>6));
  129|    259|		yxml_setchar(dest++, 0x80 | (ch & 0x3F));
  130|    711|	} else if(ch <= 0xFFFF) {
  ------------------
  |  Branch (130:12): [True: 330, False: 381]
  ------------------
  131|    330|		yxml_setchar(dest++, 0xE0 | (ch>>12));
  132|    330|		yxml_setchar(dest++, 0x80 | ((ch>>6) & 0x3F));
  133|    330|		yxml_setchar(dest++, 0x80 | (ch & 0x3F));
  134|    381|	} else {
  135|    381|		yxml_setchar(dest++, 0xF0 | (ch>>18));
  136|    381|		yxml_setchar(dest++, 0x80 | ((ch>>12) & 0x3F));
  137|    381|		yxml_setchar(dest++, 0x80 | ((ch>>6) & 0x3F));
  138|    381|		yxml_setchar(dest++, 0x80 | (ch & 0x3F));
  139|    381|	}
  140|  2.06M|	*dest = 0;
  141|  2.06M|}
yxml.c:yxml_datacontent:
  143|  82.6M|static inline yxml_ret_t yxml_datacontent(yxml_t *x, unsigned ch) {
  144|  82.6M|	yxml_setchar(x->data, ch);
  145|  82.6M|	x->data[1] = 0;
  146|  82.6M|	return YXML_CONTENT;
  147|  82.6M|}
yxml.c:yxml_datacd1:
  162|    242|static inline yxml_ret_t yxml_datacd1(yxml_t *x, unsigned ch) {
  163|    242|	x->data[0] = ']';
  164|    242|	yxml_setchar(x->data+1, ch);
  165|    242|	x->data[2] = 0;
  166|    242|	return YXML_CONTENT;
  167|    242|}
yxml.c:yxml_datacd2:
  169|    233|static inline yxml_ret_t yxml_datacd2(yxml_t *x, unsigned ch) {
  170|    233|	x->data[0] = ']';
  171|    233|	x->data[1] = ']';
  172|    233|	yxml_setchar(x->data+2, ch);
  173|    233|	x->data[3] = 0;
  174|    233|	return YXML_CONTENT;
  175|    233|}
yxml.c:yxml_elemname:
  211|   474k|static inline yxml_ret_t yxml_elemname   (yxml_t *x, unsigned ch) { return yxml_pushstackc(x, ch); }
yxml.c:yxml_elemnameend:
  212|  13.0M|static inline yxml_ret_t yxml_elemnameend(yxml_t *x, unsigned ch) { return YXML_ELEMSTART; }
yxml.c:yxml_attrstart:
  242|  1.00M|static inline yxml_ret_t yxml_attrstart  (yxml_t *x, unsigned ch) { return yxml_pushstack(x, &x->attr, ch); }
yxml.c:yxml_pushstack:
  184|  14.0M|static yxml_ret_t yxml_pushstack(yxml_t *x, char **res, unsigned ch) {
  185|  14.0M|	if(x->stacklen+2 >= x->stacksize)
  ------------------
  |  Branch (185:5): [True: 5, False: 14.0M]
  ------------------
  186|      5|		return YXML_ESTACK;
  187|  14.0M|	x->stacklen++;
  188|  14.0M|	*res = (char *)x->stack+x->stacklen;
  189|  14.0M|	x->stack[x->stacklen] = (unsigned char)ch;
  190|  14.0M|	x->stacklen++;
  191|  14.0M|	x->stack[x->stacklen] = 0;
  192|  14.0M|	return YXML_OK;
  193|  14.0M|}
yxml.c:yxml_selfclose:
  216|  13.0M|static yxml_ret_t yxml_selfclose(yxml_t *x, unsigned ch) {
  217|  13.0M|	yxml_popstack(x);
  218|  13.0M|	if(x->stacklen) {
  ------------------
  |  Branch (218:5): [True: 13.0M, False: 26.7k]
  ------------------
  219|  13.0M|		x->elem = (char *)x->stack+x->stacklen-1;
  220|  58.2M|		while(*(x->elem-1))
  ------------------
  |  Branch (220:9): [True: 45.2M, False: 13.0M]
  ------------------
  221|  45.2M|			x->elem--;
  222|  13.0M|		return YXML_ELEMEND;
  223|  13.0M|	}
  224|  26.7k|	x->elem = (char *)x->stack;
  225|  26.7k|	x->state = x->contentmode ? YXMLS_misc2 : YXMLS_misc3;
  ------------------
  |  Branch (225:13): [True: 21.5k, False: 5.20k]
  ------------------
  226|  26.7k|	return YXML_ELEMEND;
  227|  13.0M|}
yxml.c:yxml_elemclose:
  229|  91.9k|static inline yxml_ret_t yxml_elemclose(yxml_t *x, unsigned ch) {
  230|  91.9k|	if(*((unsigned char *)x->elem) != ch)
  ------------------
  |  Branch (230:5): [True: 96, False: 91.8k]
  ------------------
  231|     96|		return YXML_ECLOSE;
  232|  91.8k|	x->elem++;
  233|  91.8k|	return YXML_OK;
  234|  91.9k|}
yxml.c:yxml_elemcloseend:
  236|  31.1k|static inline yxml_ret_t yxml_elemcloseend(yxml_t *x, unsigned ch) {
  237|  31.1k|	if(*x->elem)
  ------------------
  |  Branch (237:5): [True: 2, False: 31.1k]
  ------------------
  238|      2|		return YXML_ECLOSE;
  239|  31.1k|	return yxml_selfclose(x, ch);
  240|  31.1k|}
yxml.c:yxml_elemstart:
  210|  13.0M|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.63k|static inline yxml_ret_t yxml_pistart  (yxml_t *x, unsigned ch) { return yxml_pushstack(x, &x->pi, ch); }
yxml.c:yxml_refcontent:
  299|  2.06M|static inline yxml_ret_t yxml_refcontent(yxml_t *x, unsigned ch) { return yxml_refend(x, YXML_CONTENT); }
yxml.c:yxml_piname:
  248|  6.82k|static inline yxml_ret_t yxml_piname   (yxml_t *x, unsigned ch) { return yxml_pushstackc(x, ch); }
yxml.c:yxml_pinameend:
  250|  3.78k|static inline yxml_ret_t yxml_pinameend(yxml_t *x, unsigned ch) {
  251|  3.78k|	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.78k, False: 2.00k]
  |  Branch (251:33): [True: 990, False: 793]
  |  Branch (251:57): [True: 556, False: 434]
  |  Branch (251:81): [True: 14, False: 542]
  ------------------
  252|  3.78k|}
yxml.c:yxml_datapi1:
  149|  3.07k|static inline yxml_ret_t yxml_datapi1(yxml_t *x, unsigned ch) {
  150|  3.07k|	yxml_setchar(x->data, ch);
  151|  3.07k|	x->data[1] = 0;
  152|  3.07k|	return YXML_PICONTENT;
  153|  3.07k|}
yxml.c:yxml_pivalend:
  253|  3.62k|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|    393|static inline yxml_ret_t yxml_datapi2(yxml_t *x, unsigned ch) {
  156|    393|	x->data[0] = '?';
  157|    393|	yxml_setchar(x->data+1, ch);
  158|    393|	x->data[2] = 0;
  159|    393|	return YXML_PICONTENT;
  160|    393|}
yxml.c:yxml_piabort:
  249|    587|static inline yxml_ret_t yxml_piabort  (yxml_t *x, unsigned ch) { yxml_popstack(x); return YXML_OK; }

UA_STRING:
  223|    776|UA_STRING(char *chars) {
  224|    776|    UA_String s = {0, NULL};
  225|    776|    if(!chars)
  ------------------
  |  Branch (225:8): [True: 0, False: 776]
  ------------------
  226|      0|        return s;
  227|    776|    s.length = strlen(chars);
  228|    776|    s.data = (UA_Byte*)chars;
  229|    776|    return s;
  230|    776|}
UA_String_equal_ignorecase:
  272|    152|UA_String_equal_ignorecase(const UA_String *s1, const UA_String *s2) {
  273|    152|    if(s1->length != s2->length)
  ------------------
  |  Branch (273:8): [True: 0, False: 152]
  ------------------
  274|      0|        return false;
  275|    152|    if(s1->length == 0)
  ------------------
  |  Branch (275:8): [True: 0, False: 152]
  ------------------
  276|      0|        return true;
  277|    152|    if(s2->data == NULL)
  ------------------
  |  Branch (277:8): [True: 0, False: 152]
  ------------------
  278|      0|        return false;
  279|       |
  280|    152|    return casecmp(s1->data, s2->data, s1->length) == 0;
  281|    152|}
UA_DateTime_parse:
  536|     20|UA_DateTime_parse(UA_DateTime *dst, const UA_String str) {
  537|     20|    if(str.length == 0)
  ------------------
  |  Branch (537:8): [True: 20, False: 0]
  ------------------
  538|     20|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     20|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  539|       |
  540|      0|    struct musl_tm dts;
  541|      0|    memset(&dts, 0, sizeof(dts));
  542|       |
  543|       |    /* Parse the year. The ISO standard asks for four digits. But we accept up
  544|       |     * to five with an optional plus or minus in front due to the range of the
  545|       |     * DateTime 64bit integer. But in that case we require the year and the
  546|       |     * month to be separated by a '-'. Otherwise we cannot know where the month
  547|       |     * starts. */
  548|      0|    size_t pos = 0;
  549|      0|    if(str.data[0] == '-' || str.data[0] == '+')
  ------------------
  |  Branch (549:8): [True: 0, False: 0]
  |  Branch (549:30): [True: 0, False: 0]
  ------------------
  550|      0|        pos++;
  551|      0|    UA_Int64 year = 0;
  552|      0|    UA_CHECK(str.length - pos > 5, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  553|      0|    size_t len = parseInt64((char*)&str.data[pos], 5, &year);
  554|      0|    pos += len;
  555|      0|    UA_CHECK(len > 0 && pos < str.length, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 0, False: 0]
  |  |  |  |  |  Branch (579:43): [True: 0, False: 0]
  |  |  |  |  |  Branch (579:43): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  556|      0|    UA_CHECK(len == 4 || str.data[pos] == '-', return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 0, False: 0]
  |  |  |  |  |  Branch (579:43): [True: 0, False: 0]
  |  |  |  |  |  Branch (579:43): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  557|      0|    if(str.data[0] == '-')
  ------------------
  |  Branch (557:8): [True: 0, False: 0]
  ------------------
  558|      0|        year = -year;
  559|      0|    dts.tm_year = (UA_Int16)year - 1900;
  560|      0|    if(str.data[pos] == '-')
  ------------------
  |  Branch (560:8): [True: 0, False: 0]
  ------------------
  561|      0|        pos++;
  562|       |
  563|       |    /* Parse the month */
  564|      0|    UA_UInt64 month = 0;
  565|      0|    UA_CHECK(str.length - pos > 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  566|      0|    len = parseUInt64((char*)&str.data[pos], 2, &month);
  567|      0|    pos += len;
  568|      0|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  569|      0|    dts.tm_mon = (UA_UInt16)month - 1;
  570|      0|    if(str.data[pos] == '-')
  ------------------
  |  Branch (570:8): [True: 0, False: 0]
  ------------------
  571|      0|        pos++;
  572|       |
  573|       |    /* Parse the day and check the T between date and time */
  574|      0|    UA_UInt64 day = 0;
  575|      0|    UA_CHECK(str.length - pos > 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  576|      0|    len = parseUInt64((char*)&str.data[pos], 2, &day);
  577|      0|    pos += len;
  578|      0|    UA_CHECK(len == 2 || str.data[pos] != 'T',
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 0, False: 0]
  |  |  |  |  |  Branch (579:43): [True: 0, False: 0]
  |  |  |  |  |  Branch (579:43): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  579|      0|             return UA_STATUSCODE_BADDECODINGERROR);
  580|      0|    dts.tm_mday = (UA_UInt16)day;
  581|      0|    pos++;
  582|       |
  583|       |    /* Parse the hour */
  584|      0|    UA_UInt64 hour = 0;
  585|      0|    UA_CHECK(str.length - pos > 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  586|      0|    len = parseUInt64((char*)&str.data[pos], 2, &hour);
  587|      0|    pos += len;
  588|      0|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  589|      0|    dts.tm_hour = (UA_UInt16)hour;
  590|      0|    if(str.data[pos] == ':')
  ------------------
  |  Branch (590:8): [True: 0, False: 0]
  ------------------
  591|      0|        pos++;
  592|       |
  593|       |    /* Parse the minute */
  594|      0|    UA_UInt64 min = 0;
  595|      0|    UA_CHECK(str.length - pos > 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  596|      0|    len = parseUInt64((char*)&str.data[pos], 2, &min);
  597|      0|    pos += len;
  598|      0|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  599|      0|    dts.tm_min = (UA_UInt16)min;
  600|      0|    if(str.data[pos] == ':')
  ------------------
  |  Branch (600:8): [True: 0, False: 0]
  ------------------
  601|      0|        pos++;
  602|       |
  603|       |    /* Parse the second */
  604|      0|    UA_UInt64 sec = 0;
  605|      0|    UA_CHECK(str.length - pos >= 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  606|      0|    len = parseUInt64((char*)&str.data[pos], 2, &sec);
  607|      0|    pos += len;
  608|      0|    UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  609|      0|    dts.tm_sec = (UA_UInt16)sec;
  610|       |
  611|       |    /* Compute the seconds since the Unix epoch */
  612|      0|    long long sinceunix = musl_tm_to_secs(&dts);
  613|       |
  614|       |    /* Are we within the range that can be represented? */
  615|      0|    long long sinceunix_min =
  616|      0|        (long long)(UA_INT64_MIN / UA_DATETIME_SEC) -
  ------------------
  |  |  120|      0|#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
  |  |  ------------------
  |  |  |  |  119|      0|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  |  |  ------------------
  ------------------
                      (long long)(UA_INT64_MIN / UA_DATETIME_SEC) -
  ------------------
  |  |  286|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  285|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  617|      0|        (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC) -
  ------------------
  |  |  328|      0|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  286|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  285|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  284|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (long long)(UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC) -
  ------------------
  |  |  286|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  285|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  618|      0|        (long long)1; /* manual correction due to rounding */
  619|      0|    long long sinceunix_max = (long long)
  620|      0|        ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  119|      0|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  ------------------
                      ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  328|      0|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  286|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  285|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  284|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      ((UA_INT64_MAX - UA_DATETIME_UNIX_EPOCH) / UA_DATETIME_SEC);
  ------------------
  |  |  286|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  285|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  621|      0|    if(sinceunix < sinceunix_min || sinceunix > sinceunix_max)
  ------------------
  |  Branch (621:8): [True: 0, False: 0]
  |  Branch (621:37): [True: 0, False: 0]
  ------------------
  622|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  623|       |
  624|       |    /* Convert to DateTime. Add or subtract one extra second here to prevent
  625|       |     * underflow/overflow. This is reverted once the fractional part has been
  626|       |     * added. */
  627|      0|    sinceunix -= (sinceunix > 0) ? 1 : -1;
  ------------------
  |  Branch (627:18): [True: 0, False: 0]
  ------------------
  628|      0|    UA_DateTime dt = (UA_DateTime)
  629|      0|        (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  328|      0|#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_DATETIME_SEC)
  |  |  ------------------
  |  |  |  |  286|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  285|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  284|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  286|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  285|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (sinceunix + (UA_DATETIME_UNIX_EPOCH / UA_DATETIME_SEC)) * UA_DATETIME_SEC;
  ------------------
  |  |  286|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  285|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  630|       |
  631|       |    /* Parse the fraction of the second if defined */
  632|      0|    UA_CHECK(pos < str.length, goto finish);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  633|      0|    if(str.data[pos] == ',' || str.data[pos] == '.') {
  ------------------
  |  Branch (633:8): [True: 0, False: 0]
  |  Branch (633:32): [True: 0, False: 0]
  ------------------
  634|      0|        pos++;
  635|      0|        double frac = 0.0;
  636|      0|        double denom = 0.1;
  637|      0|        while(pos < str.length && str.data[pos] >= '0' && str.data[pos] <= '9') {
  ------------------
  |  Branch (637:15): [True: 0, False: 0]
  |  Branch (637:35): [True: 0, False: 0]
  |  Branch (637:59): [True: 0, False: 0]
  ------------------
  638|      0|            frac += denom * (str.data[pos] - '0');
  639|      0|            denom *= 0.1;
  640|      0|            pos++;
  641|      0|        }
  642|      0|        frac += 0.00000005; /* Correct rounding when converting to integer */
  643|      0|        dt += (UA_DateTime)(frac * UA_DATETIME_SEC);
  ------------------
  |  |  286|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  285|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  644|      0|    }
  645|       |
  646|       |    /* Time zone handling */
  647|      0|    UA_CHECK(pos < str.length, goto finish);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  648|      0|    if(str.data[pos] == 'Z') {
  ------------------
  |  Branch (648:8): [True: 0, False: 0]
  ------------------
  649|      0|        pos++;
  650|      0|    } else if(str.data[pos] == '+' || str.data[pos] == '-') {
  ------------------
  |  Branch (650:15): [True: 0, False: 0]
  |  Branch (650:39): [True: 0, False: 0]
  ------------------
  651|      0|        UA_UInt64 tzHour = 0, tzMin = 0;
  652|      0|        UA_Int64 offsetSeconds = 0;
  653|      0|        UA_Byte tzSign = str.data[pos++];
  654|       |
  655|      0|        UA_CHECK(str.length - pos >= 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  656|      0|        len = parseUInt64((char*)&str.data[pos], 2, &tzHour);
  657|      0|        pos += len;
  658|      0|        UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  659|       |
  660|      0|        UA_CHECK(str.length > pos, goto finish); /* Allow missing tz minutes */
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  661|      0|        if(str.data[pos] == ':')
  ------------------
  |  Branch (661:12): [True: 0, False: 0]
  ------------------
  662|      0|            pos++;
  663|       |
  664|      0|        UA_CHECK(str.length - pos >= 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  665|      0|        len = parseUInt64((char*)&str.data[pos], 2, &tzMin);
  666|      0|        pos += len;
  667|      0|        UA_CHECK(len == 2, return UA_STATUSCODE_BADDECODINGERROR);
  ------------------
  |  |  172|      0|    do {                                                                                 \
  |  |  173|      0|        if(UA_UNLIKELY(!isTrue(A))) {                                                    \
  |  |  ------------------
  |  |  |  |  579|      0|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (579:25): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  174|      0|            EVAL_ON_ERROR;                                                               \
  |  |  175|      0|        }                                                                                \
  |  |  176|      0|    } while(0)
  |  |  ------------------
  |  |  |  Branch (176:13): [Folded, False: 0]
  |  |  ------------------
  ------------------
  668|       |
  669|      0|        offsetSeconds = (tzHour * 3600) + (tzMin * 60);
  670|      0|        if(tzSign == '-')
  ------------------
  |  Branch (670:12): [True: 0, False: 0]
  ------------------
  671|      0|            offsetSeconds = -offsetSeconds;
  672|      0|        dt -= (UA_DateTime)(offsetSeconds * UA_DATETIME_SEC);
  ------------------
  |  |  286|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  285|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  673|      0|    } else {
  674|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  675|      0|    }
  676|       |
  677|      0| finish:
  678|       |    /* Remove the underflow/overflow protection (see above) */
  679|      0|    if(sinceunix > 0) {
  ------------------
  |  Branch (679:8): [True: 0, False: 0]
  ------------------
  680|      0|        if(dt > UA_INT64_MAX - UA_DATETIME_SEC)
  ------------------
  |  |  119|      0|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  ------------------
                      if(dt > UA_INT64_MAX - UA_DATETIME_SEC)
  ------------------
  |  |  286|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  285|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (680:12): [True: 0, False: 0]
  ------------------
  681|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  682|      0|        dt += UA_DATETIME_SEC;
  ------------------
  |  |  286|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  285|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  683|      0|    } else {
  684|      0|        if(dt < UA_INT64_MIN + UA_DATETIME_SEC)
  ------------------
  |  |  120|      0|#define UA_INT64_MIN ((int64_t)-UA_INT64_MAX-1LL)
  |  |  ------------------
  |  |  |  |  119|      0|#define UA_INT64_MAX (int64_t)9223372036854775807LL
  |  |  ------------------
  ------------------
                      if(dt < UA_INT64_MIN + UA_DATETIME_SEC)
  ------------------
  |  |  286|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  285|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (684:12): [True: 0, False: 0]
  ------------------
  685|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  686|      0|        dt -= UA_DATETIME_SEC;
  ------------------
  |  |  286|      0|#define UA_DATETIME_SEC (UA_DATETIME_MSEC * 1000LL)
  |  |  ------------------
  |  |  |  |  285|      0|#define UA_DATETIME_MSEC (UA_DATETIME_USEC * 1000LL)
  |  |  |  |  ------------------
  |  |  |  |  |  |  284|      0|#define UA_DATETIME_USEC 10LL
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  687|      0|    }
  688|       |
  689|       |    /* We must be at the end of the string */
  690|      0|    if(pos != str.length)
  ------------------
  |  Branch (690:8): [True: 0, False: 0]
  ------------------
  691|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  692|       |
  693|      0|    *dst = dt;
  694|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  695|      0|}
UA_ByteString_allocBuffer:
  762|  3.67k|UA_ByteString_allocBuffer(UA_ByteString *bs, size_t length) {
  763|  3.67k|    UA_ByteString_init(bs);
  764|  3.67k|    if(length == 0) {
  ------------------
  |  Branch (764:8): [True: 56, False: 3.61k]
  ------------------
  765|     56|        bs->data = (u8*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|     56|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  766|     56|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     56|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  767|     56|    }
  768|  3.61k|    bs->data = (u8*)UA_calloc(1,length);
  ------------------
  |  |   20|  3.61k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
  769|  3.61k|    if(UA_UNLIKELY(!bs->data))
  ------------------
  |  |  579|  3.61k|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (579:25): [True: 0, False: 3.61k]
  |  |  ------------------
  ------------------
  770|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
  771|  3.61k|    bs->length = length;
  772|  3.61k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  3.61k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  773|  3.61k|}
UA_NodeId_isNull:
  814|     76|UA_NodeId_isNull(const UA_NodeId *p) {
  815|     76|    if(p->namespaceIndex != 0)
  ------------------
  |  Branch (815:8): [True: 0, False: 76]
  ------------------
  816|      0|        return false;
  817|     76|    switch (p->identifierType) {
  ------------------
  |  Branch (817:13): [True: 76, False: 0]
  ------------------
  818|     76|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (818:5): [True: 76, False: 0]
  ------------------
  819|     76|        return (p->identifier.numeric == 0);
  820|      0|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (820:5): [True: 0, False: 76]
  ------------------
  821|      0|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (821:5): [True: 0, False: 76]
  ------------------
  822|      0|        return (p->identifier.string.length == 0); /* Null and empty string */
  823|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (823:5): [True: 0, False: 76]
  ------------------
  824|      0|        return (guidOrder(&p->identifier.guid, &UA_GUID_NULL, NULL) == UA_ORDER_EQ);
  825|     76|    }
  826|      0|    return false;
  827|     76|}
nodeId_printEscape:
 1029|    228|                   const UA_NamespaceMapping *nsMapping, UA_Escaping idEsc) {
 1030|       |    /* Try to map the NamespaceIndex to the Uri */
 1031|    228|    UA_String nsUri = UA_STRING_NULL;
 1032|    228|    if(id->namespaceIndex > 0 && nsMapping)
  ------------------
  |  Branch (1032:8): [True: 0, False: 228]
  |  Branch (1032:34): [True: 0, False: 0]
  ------------------
 1033|      0|        UA_NamespaceMapping_index2Uri(nsMapping, id->namespaceIndex, &nsUri);
 1034|       |
 1035|       |    /* Compute the string length and print numerical identifiers. */
 1036|    228|    u8 nsStr[7];
 1037|    228|    u8 numIdStr[12];
 1038|    228|    size_t idLen = nodeIdSize(id, nsStr, numIdStr, nsUri, idEsc);
 1039|    228|    if(idLen == 0)
  ------------------
  |  Branch (1039:8): [True: 0, False: 228]
  ------------------
 1040|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 1041|       |
 1042|       |    /* Allocate memory if required */
 1043|    228|    if(output->length == 0) {
  ------------------
  |  Branch (1043:8): [True: 228, False: 0]
  ------------------
 1044|    228|        UA_StatusCode res = UA_ByteString_allocBuffer((UA_ByteString*)output, idLen);
 1045|    228|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    228|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1045:12): [True: 0, False: 228]
  ------------------
 1046|      0|            return res;
 1047|    228|    } else {
 1048|      0|        if(output->length < idLen)
  ------------------
  |  Branch (1048:12): [True: 0, False: 0]
  ------------------
 1049|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
 1050|      0|        output->length = idLen;
 1051|      0|    }
 1052|       |
 1053|       |    /* Print the NodeId */
 1054|    228|    u8 *pos = printNodeIdBody(id, nsUri, nsStr, numIdStr, output->data, nsMapping, idEsc);
 1055|    228|    output->length = (size_t)(pos - output->data);
 1056|    228|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    228|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1057|    228|}
UA_NodeId_printEx:
 1061|    228|                  const UA_NamespaceMapping *nsMapping) {
 1062|    228|    return nodeId_printEscape(id, output, nsMapping, UA_ESCAPING_NONE);
 1063|    228|}
UA_ExtensionObject_setValue:
 1306|    304|                            const UA_DataType *type) {
 1307|    304|    UA_ExtensionObject_init(eo);
 1308|    304|    eo->content.decoded.data = p;
 1309|    304|    eo->content.decoded.type = type;
 1310|    304|    eo->encoding = UA_EXTENSIONOBJECT_DECODED;
 1311|    304|}
UA_Variant_isScalar:
 1363|  3.13k|UA_Variant_isScalar(const UA_Variant *v) {
 1364|  3.13k|    return (v->type != NULL && v->arrayLength == 0 &&
  ------------------
  |  Branch (1364:13): [True: 3.13k, False: 0]
  |  Branch (1364:32): [True: 3.13k, False: 0]
  ------------------
 1365|  3.13k|            v->data > UA_EMPTY_ARRAY_SENTINEL);
  ------------------
  |  |  756|  3.13k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1365:13): [True: 3.12k, False: 10]
  ------------------
 1366|  3.13k|}
UA_new:
 1926|  4.21k|UA_new(const UA_DataType *type) {
 1927|  4.21k|    void *p = UA_calloc(1, type->memSize);
  ------------------
  |  |   20|  4.21k|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 1928|  4.21k|    return p;
 1929|  4.21k|}
UA_copy:
 2102|    476|UA_copy(const void *src, void *dst, const UA_DataType *type) {
 2103|    476|    memset(dst, 0, type->memSize); /* init */
 2104|    476|    UA_StatusCode retval = copyJumpTable[type->typeKind](src, dst, type);
 2105|    476|    if(retval != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    476|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2105:8): [True: 0, False: 476]
  ------------------
 2106|      0|        UA_clear(dst, type);
 2107|    476|    return retval;
 2108|    476|}
UA_clear:
 2205|  9.01k|UA_clear(void *p, const UA_DataType *type) {
 2206|  9.01k|    clearJumpTable[type->typeKind](p, type);
 2207|  9.01k|    memset(p, 0, type->memSize); /* init */
 2208|  9.01k|}
UA_order:
 2679|  49.0k|UA_Order UA_order(const void *p1, const void *p2, const UA_DataType *type) {
 2680|  49.0k|    return orderJumpTable[type->typeKind](p1, p2, type);
 2681|  49.0k|}
UA_equal:
 2684|    963|UA_equal(const void *p1, const void *p2, const UA_DataType *type) {
 2685|    963|    return (UA_order(p1, p2, type) == UA_ORDER_EQ);
 2686|    963|}
UA_Array_new:
 2693|     37|UA_Array_new(size_t size, const UA_DataType *type) {
 2694|     37|    if(size > UA_INT32_MAX)
  ------------------
  |  |  101|     37|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (2694:8): [True: 0, False: 37]
  ------------------
 2695|      0|        return NULL;
 2696|     37|    if(size == 0)
  ------------------
  |  Branch (2696:8): [True: 10, False: 27]
  ------------------
 2697|     10|        return UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|     10|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2698|     27|    if(size > SIZE_MAX / type->memSize)
  ------------------
  |  Branch (2698:8): [True: 0, False: 27]
  ------------------
 2699|      0|        return NULL;
 2700|     27|    return UA_calloc(size, type->memSize);
  ------------------
  |  |   20|     27|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2701|     27|}
UA_Array_copy:
 2705|    476|              void **dst, const UA_DataType *type) {
 2706|    476|    if(size == 0) {
  ------------------
  |  Branch (2706:8): [True: 0, False: 476]
  ------------------
 2707|      0|        if(src == NULL)
  ------------------
  |  Branch (2707:12): [True: 0, False: 0]
  ------------------
 2708|      0|            *dst = NULL;
 2709|      0|        else
 2710|      0|            *dst= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|      0|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 2711|      0|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2712|      0|    }
 2713|       |
 2714|       |    /* Check the array consistency -- defensive programming in case the user
 2715|       |     * manually created an inconsistent array */
 2716|    476|    if(UA_UNLIKELY(!type || !src))
  ------------------
  |  |  579|    952|# define UA_UNLIKELY(x) __builtin_expect((x), 0)
  |  |  ------------------
  |  |  |  Branch (579:25): [True: 0, False: 476]
  |  |  |  Branch (579:43): [True: 0, False: 476]
  |  |  |  Branch (579:43): [True: 0, False: 476]
  |  |  ------------------
  ------------------
 2717|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
 2718|       |
 2719|    476|    if(size > SIZE_MAX / type->memSize)
  ------------------
  |  Branch (2719:8): [True: 0, False: 476]
  ------------------
 2720|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2721|    476|    size_t byteSize = size * type->memSize;
 2722|       |
 2723|       |    /* calloc, so we don't have to check retval in every iteration of copying */
 2724|    476|    *dst = UA_calloc(size, type->memSize);
  ------------------
  |  |   20|    476|#define UA_calloc(num, size) UA_callocSingleton(num, size)
  ------------------
 2725|    476|    if(!*dst)
  ------------------
  |  Branch (2725:8): [True: 0, False: 476]
  ------------------
 2726|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2727|       |
 2728|    476|    if(type->pointerFree) {
  ------------------
  |  Branch (2728:8): [True: 476, False: 0]
  ------------------
 2729|    476|        memcpy(*dst, src, byteSize);
 2730|    476|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    476|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2731|    476|    }
 2732|       |
 2733|      0|    uintptr_t ptrs = (uintptr_t)src;
 2734|      0|    uintptr_t ptrd = (uintptr_t)*dst;
 2735|      0|    UA_StatusCode retval = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 2736|      0|    for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2736:23): [True: 0, False: 0]
  ------------------
 2737|      0|        retval |= UA_copy((void*)ptrs, (void*)ptrd, type);
 2738|      0|        ptrs += type->memSize;
 2739|      0|        ptrd += type->memSize;
 2740|      0|    }
 2741|      0|    if(retval != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2741:8): [True: 0, False: 0]
  ------------------
 2742|      0|        UA_Array_delete(*dst, size, type);
 2743|       |        *dst = NULL;
 2744|      0|    }
 2745|      0|    return retval;
 2746|    476|}
UA_Array_delete:
 2848|  8.93k|UA_Array_delete(void *p, size_t size, const UA_DataType *type) {
 2849|  8.93k|    if(!type->pointerFree) {
  ------------------
  |  Branch (2849:8): [True: 1.15k, False: 7.78k]
  ------------------
 2850|  1.15k|        uintptr_t ptr = (uintptr_t)p;
 2851|  2.15k|        for(size_t i = 0; i < size; ++i) {
  ------------------
  |  Branch (2851:27): [True: 1.00k, False: 1.15k]
  ------------------
 2852|  1.00k|            UA_clear((void*)ptr, type);
 2853|  1.00k|            ptr += type->memSize;
 2854|  1.00k|        }
 2855|  1.15k|    }
 2856|  8.93k|    UA_free((void*)((uintptr_t)p & ~(uintptr_t)UA_EMPTY_ARRAY_SENTINEL));
  ------------------
  |  |   19|  8.93k|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2857|  8.93k|}
ua_types.c:casecmp:
  263|    152|casecmp(const UA_Byte *l, const UA_Byte *r, size_t n) {
  264|    152|    if(!n--) return 0;
  ------------------
  |  Branch (264:8): [True: 0, False: 152]
  ------------------
  265|    760|    for(; *l && *r && n && (*l == *r || lowercase(*l) == lowercase(*r)); l++, r++, n--);
  ------------------
  |  Branch (265:11): [True: 760, False: 0]
  |  Branch (265:17): [True: 760, False: 0]
  |  Branch (265:23): [True: 608, False: 152]
  |  Branch (265:29): [True: 608, False: 0]
  |  Branch (265:41): [True: 0, False: 0]
  ------------------
  266|    152|    return lowercase(*l) - lowercase(*r);
  267|    152|}
ua_types.c:lowercase:
  257|    304|lowercase(UA_Byte c) {
  258|    304|    if(((int)c) - 'A' < 26) return c | 32;
  ------------------
  |  Branch (258:8): [True: 0, False: 304]
  ------------------
  259|    304|    return c;
  260|    304|}
ua_types.c:nodeIdSize:
  928|    228|           UA_Escaping idEsc) {
  929|       |    /* Namespace length */
  930|    228|    size_t len = 0;
  931|    228|    if(nsUri.data != NULL) {
  ------------------
  |  Branch (931:8): [True: 0, False: 228]
  ------------------
  932|      0|        len += 5; /* nsu=; */
  933|      0|        len += UA_String_escapedSize(nsUri, UA_ESCAPING_PERCENT);
  934|    228|    } else if(id->namespaceIndex > 0) {
  ------------------
  |  Branch (934:15): [True: 0, False: 228]
  ------------------
  935|      0|        len += 4; /* ns=; */
  936|      0|        size_t nsStrSize = itoaUnsigned(id->namespaceIndex, (char*)nsStr, 10);
  937|      0|        nsStr[nsStrSize] = 0;
  938|      0|        len += nsStrSize;
  939|      0|    }
  940|       |
  941|    228|    len += 2; /* ?= */
  942|       |
  943|    228|    switch (id->identifierType) {
  944|    228|    case UA_NODEIDTYPE_NUMERIC: {
  ------------------
  |  Branch (944:5): [True: 228, False: 0]
  ------------------
  945|    228|        size_t numIdStrSize = itoaUnsigned(id->identifier.numeric, (char*)numIdStr, 10);
  946|    228|        numIdStr[numIdStrSize] = 0;
  947|    228|        len += numIdStrSize;
  948|    228|        break;
  949|      0|    }
  950|      0|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (950:5): [True: 0, False: 228]
  ------------------
  951|      0|        len += UA_String_escapedSize(id->identifier.string, idEsc);
  952|      0|        break;
  953|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (953:5): [True: 0, False: 228]
  ------------------
  954|      0|        len += 36;
  955|      0|        break;
  956|      0|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (956:5): [True: 0, False: 228]
  ------------------
  957|      0|        len += 4 * ((id->identifier.byteString.length + 2) / 3);
  958|      0|        break;
  959|      0|    default:
  ------------------
  |  Branch (959:5): [True: 0, False: 228]
  ------------------
  960|      0|        len = 0;
  961|    228|    }
  962|    228|    return len;
  963|    228|}
ua_types.c:printNodeIdBody:
  967|    228|                const UA_NamespaceMapping *nsMapping, UA_Escaping idEsc) {
  968|    228|    size_t len;
  969|       |
  970|       |    /* Encode the namespace */
  971|    228|    if(nsUri.data != NULL) {
  ------------------
  |  Branch (971:8): [True: 0, False: 228]
  ------------------
  972|      0|        memcpy(pos, "nsu=", 4);
  973|      0|        pos += 4;
  974|      0|        pos += UA_String_escapeInsert(pos, nsUri, UA_ESCAPING_PERCENT);
  975|      0|        *pos++ = ';';
  976|    228|    } else if(id->namespaceIndex > 0) {
  ------------------
  |  Branch (976:15): [True: 0, False: 228]
  ------------------
  977|      0|        memcpy(pos, "ns=", 3);
  978|      0|        pos += 3;
  979|      0|        len = strlen((char*)nsStr);
  980|      0|        memcpy(pos, nsStr, len);
  981|      0|        pos += len;
  982|      0|        *pos++ = ';';
  983|      0|    }
  984|       |
  985|       |    /* Encode the identifier */
  986|    228|    switch(id->identifierType) {
  ------------------
  |  Branch (986:12): [True: 228, False: 0]
  ------------------
  987|    228|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (987:5): [True: 228, False: 0]
  ------------------
  988|    228|        memcpy(pos, "i=", 2);
  989|    228|        pos += 2;
  990|    228|        len = strlen((char*)numIdStr);
  991|    228|        memcpy(pos, numIdStr, len);
  992|    228|        pos += len;
  993|    228|        break;
  994|      0|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (994:5): [True: 0, False: 228]
  ------------------
  995|      0|        memcpy(pos, "s=", 2);
  996|      0|        pos += 2;
  997|      0|        pos += UA_String_escapeInsert(pos, id->identifier.string, idEsc);
  998|      0|        break;
  999|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (999:5): [True: 0, False: 228]
  ------------------
 1000|      0|        memcpy(pos, "g=", 2);
 1001|      0|        pos += 2;
 1002|      0|        UA_Guid_to_hex(&id->identifier.guid, pos, true);
 1003|      0|        pos += 36;
 1004|      0|        break;
 1005|      0|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (1005:5): [True: 0, False: 228]
  ------------------
 1006|      0|        memcpy(pos, "b=", 2);
 1007|      0|        pos += 2;
 1008|       |        /* Use base64url encoding for percent-escaping.
 1009|       |         * Replace +/ with -_ and remove the padding. */
 1010|      0|        u8 *bpos = pos;
 1011|      0|        pos += UA_base64_buf(id->identifier.byteString.data,
 1012|      0|                             id->identifier.byteString.length, pos);
 1013|      0|        if(idEsc == UA_ESCAPING_PERCENT ||
  ------------------
  |  Branch (1013:12): [True: 0, False: 0]
  ------------------
 1014|      0|           idEsc == UA_ESCAPING_PERCENT_EXTENDED) {
  ------------------
  |  Branch (1014:12): [True: 0, False: 0]
  ------------------
 1015|      0|            while(pos > bpos && pos[-1] == '=')
  ------------------
  |  Branch (1015:19): [True: 0, False: 0]
  |  Branch (1015:33): [True: 0, False: 0]
  ------------------
 1016|      0|                pos--;
 1017|      0|            for(; bpos < pos; bpos++) {
  ------------------
  |  Branch (1017:19): [True: 0, False: 0]
  ------------------
 1018|      0|                if(*bpos == '+') *bpos = '-';
  ------------------
  |  Branch (1018:20): [True: 0, False: 0]
  ------------------
 1019|      0|                else if(*bpos == '/') *bpos = '_';
  ------------------
  |  Branch (1019:25): [True: 0, False: 0]
  ------------------
 1020|      0|            }
 1021|      0|        }
 1022|      0|        break;
 1023|    228|    }
 1024|    228|    return pos;
 1025|    228|}
ua_types.c:Variant_clear:
 1384|  4.59k|Variant_clear(void *p, const UA_DataType *_) {
 1385|  4.59k|    UA_Variant *v = (UA_Variant *)p;
 1386|       |
 1387|       |    /* The content is "borrowed" */
 1388|  4.59k|    if(v->storageType == UA_VARIANT_DATA_NODELETE)
  ------------------
  |  Branch (1388:8): [True: 0, False: 4.59k]
  ------------------
 1389|      0|        return;
 1390|       |
 1391|       |    /* Delete the value */
 1392|  4.59k|    if(v->type && v->data > UA_EMPTY_ARRAY_SENTINEL) {
  ------------------
  |  |  756|  4.17k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1392:8): [True: 4.17k, False: 412]
  |  Branch (1392:19): [True: 4.16k, False: 10]
  ------------------
 1393|  4.16k|        if(v->arrayLength == 0)
  ------------------
  |  Branch (1393:12): [True: 4.14k, False: 27]
  ------------------
 1394|  4.14k|            v->arrayLength = 1;
 1395|  4.16k|        UA_Array_delete(v->data, v->arrayLength, v->type);
 1396|  4.16k|        v->data = NULL;
 1397|  4.16k|    }
 1398|       |
 1399|       |    /* Delete the array dimensions */
 1400|  4.59k|    if((void*)v->arrayDimensions > UA_EMPTY_ARRAY_SENTINEL)
  ------------------
  |  |  756|  4.59k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (1400:8): [True: 0, False: 4.59k]
  ------------------
 1401|      0|        UA_free(v->arrayDimensions);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1402|  4.59k|}
ua_types.c:DataValue_clear:
 1856|      8|DataValue_clear(void *p, const UA_DataType *_) {
 1857|      8|    UA_DataValue *dv = (UA_DataValue *)p;
 1858|       |    Variant_clear(&dv->value, NULL);
 1859|      8|}
ua_types.c:String_copy:
  284|    476|String_copy(const void *src, void *dst, const UA_DataType *_) {
  285|    476|    const UA_String *srcS = (const UA_String*)src;
  286|    476|    UA_String *dstS = (UA_String *)dst;
  287|    476|    UA_StatusCode res =
  288|    476|        UA_Array_copy(srcS->data, srcS->length, (void**)&dstS->data,
  289|    476|                      &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   96|    476|#define UA_TYPES_BYTE 2
  ------------------
  290|    476|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    476|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (290:8): [True: 476, False: 0]
  ------------------
  291|    476|        dstS->length = srcS->length;
  292|    476|    return res;
  293|    476|}
ua_types.c:nopClear:
 2167|    521|static void nopClear(void *p, const UA_DataType *type) { }
ua_types.c:String_clear:
  296|  4.59k|String_clear(void *p, const UA_DataType *_) {
  297|  4.59k|    UA_String *s = (UA_String*)p;
  298|  4.59k|    UA_Array_delete(s->data, s->length, &UA_TYPES[UA_TYPES_BYTE]);
  ------------------
  |  |   96|  4.59k|#define UA_TYPES_BYTE 2
  ------------------
  299|  4.59k|}
ua_types.c:NodeId_clear:
  777|    198|NodeId_clear(void *p, const UA_DataType *_) {
  778|    198|    UA_NodeId *id = (UA_NodeId*)p;
  779|    198|    switch(id->identifierType) {
  780|      0|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (780:5): [True: 0, False: 198]
  ------------------
  781|      0|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (781:5): [True: 0, False: 198]
  ------------------
  782|      0|        String_clear(&id->identifier.string, NULL);
  783|      0|        break;
  784|    198|    default: break;
  ------------------
  |  Branch (784:5): [True: 198, False: 0]
  ------------------
  785|    198|    }
  786|    198|}
ua_types.c:ExpandedNodeId_clear:
 1078|      9|ExpandedNodeId_clear(void *p, const UA_DataType *_) {
 1079|      9|    UA_ExpandedNodeId *id = (UA_ExpandedNodeId*)p;
 1080|      9|    NodeId_clear(&id->nodeId, NULL);
 1081|       |    String_clear(&id->namespaceUri, NULL);
 1082|      9|}
ua_types.c:QualifiedName_clear:
  402|      6|QualifiedName_clear(void *p, const UA_DataType *_) {
  403|      6|    UA_QualifiedName *qn = (UA_QualifiedName*)p;
  404|       |    String_clear(&qn->name, NULL);
  405|      6|}
ua_types.c:LocalizedText_clear:
 1839|     36|LocalizedText_clear(void *p, const UA_DataType *_) {
 1840|     36|    UA_LocalizedText *lt = (UA_LocalizedText *)p;
 1841|     36|    String_clear(&lt->locale, NULL);
 1842|       |    String_clear(&lt->text, NULL);
 1843|     36|}
ua_types.c:ExtensionObject_clear:
 1251|    126|ExtensionObject_clear(void *p, const UA_DataType *_) {
 1252|    126|    UA_ExtensionObject *eo = (UA_ExtensionObject *)p;
 1253|    126|    switch(eo->encoding) {
 1254|     50|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (1254:5): [True: 50, False: 76]
  ------------------
 1255|     50|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (1255:5): [True: 0, False: 126]
  ------------------
 1256|    126|    case UA_EXTENSIONOBJECT_ENCODED_XML:
  ------------------
  |  Branch (1256:5): [True: 76, False: 50]
  ------------------
 1257|    126|    case UA_EXTENSIONOBJECT_ENCODED_JSON:
  ------------------
  |  Branch (1257:5): [True: 0, False: 126]
  ------------------
 1258|    126|        NodeId_clear(&eo->content.encoded.typeId, NULL);
 1259|    126|        String_clear(&eo->content.encoded.body, NULL);
 1260|    126|        break;
 1261|      0|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (1261:5): [True: 0, False: 126]
  ------------------
 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: 126]
  ------------------
 1266|      0|        break;
 1267|    126|    }
 1268|    126|}
ua_types.c:DiagnosticInfo_clear:
 1886|     12|DiagnosticInfo_clear(void *p, const UA_DataType *_) {
 1887|     12|    UA_DiagnosticInfo *di = (UA_DiagnosticInfo *)p;
 1888|       |
 1889|     12|    String_clear(&di->additionalInfo, NULL);
 1890|     12|    if(di->hasInnerDiagnosticInfo && di->innerDiagnosticInfo) {
  ------------------
  |  Branch (1890:8): [True: 0, False: 12]
  |  Branch (1890:38): [True: 0, False: 0]
  ------------------
 1891|      0|        DiagnosticInfo_clear(di->innerDiagnosticInfo, NULL);
 1892|      0|        UA_free(di->innerDiagnosticInfo);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1893|      0|    }
 1894|     12|}
ua_types.c:clearStructure:
 2111|    252|clearStructure(void *p, const UA_DataType *type) {
 2112|    252|    uintptr_t ptr = (uintptr_t)p;
 2113|  1.39k|    for(size_t i = 0; i < type->membersSize; ++i) {
  ------------------
  |  Branch (2113:23): [True: 1.14k, False: 252]
  ------------------
 2114|  1.14k|        const UA_DataTypeMember *m = &type->members[i];
 2115|  1.14k|        const UA_DataType *mt = m->memberType;
 2116|  1.14k|        ptr += m->padding;
 2117|  1.14k|        if(!m->isOptional) {
  ------------------
  |  Branch (2117:12): [True: 1.14k, False: 0]
  ------------------
 2118|  1.14k|            if(!m->isArray) {
  ------------------
  |  Branch (2118:16): [True: 970, False: 170]
  ------------------
 2119|    970|                clearJumpTable[mt->typeKind]((void*)ptr, mt);
 2120|    970|                ptr += mt->memSize;
 2121|    970|            } else {
 2122|    170|                size_t length = *(size_t*)ptr;
 2123|    170|                ptr += sizeof(size_t);
 2124|    170|                UA_Array_delete(*(void**)ptr, length, mt);
 2125|    170|                ptr += sizeof(void*);
 2126|    170|            }
 2127|  1.14k|        } else { /* field is optional */
 2128|      0|            if(!m->isArray) {
  ------------------
  |  Branch (2128:16): [True: 0, False: 0]
  ------------------
 2129|       |                /* optional scalar field is contained */
 2130|      0|                if((*(void *const *)ptr != NULL))
  ------------------
  |  Branch (2130:20): [True: 0, False: 0]
  ------------------
 2131|      0|                    UA_Array_delete(*(void **)ptr, 1, mt);
 2132|      0|                ptr += sizeof(void *);
 2133|      0|            } else {
 2134|       |                /* optional array field is contained */
 2135|      0|                if((*(void *const *)(ptr + sizeof(size_t)) != NULL)) {
  ------------------
  |  Branch (2135:20): [True: 0, False: 0]
  ------------------
 2136|      0|                    size_t length = *(size_t *)ptr;
 2137|      0|                    ptr += sizeof(size_t);
 2138|      0|                    UA_Array_delete(*(void **)ptr, length, mt);
 2139|      0|                    ptr += sizeof(void *);
 2140|      0|                } else { /* optional array field not contained */
 2141|      0|                    ptr += sizeof(size_t);
 2142|      0|                    ptr += sizeof(void *);
 2143|      0|                }
 2144|      0|            }
 2145|      0|        }
 2146|  1.14k|    }
 2147|    252|}
ua_types.c:guidOrder:
 2264|     12|guidOrder(const void *p1_, const void *p2_, const UA_DataType *type) {
 2265|     12|    const UA_Guid *p1 = (const UA_Guid*)p1_;
 2266|     12|    const UA_Guid *p2 = (const UA_Guid*)p2_;
 2267|     12|    if(p1->data1 != p2->data1)
  ------------------
  |  Branch (2267:8): [True: 0, False: 12]
  ------------------
 2268|      0|        return (p1->data1 < p2->data1) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2268:16): [True: 0, False: 0]
  ------------------
 2269|     12|    if(p1->data2 != p2->data2)
  ------------------
  |  Branch (2269:8): [True: 0, False: 12]
  ------------------
 2270|      0|        return (p1->data2 < p2->data2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2270:16): [True: 0, False: 0]
  ------------------
 2271|     12|    if(p1->data3 != p2->data3)
  ------------------
  |  Branch (2271:8): [True: 0, False: 12]
  ------------------
 2272|      0|        return (p1->data3 < p2->data3) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2272:16): [True: 0, False: 0]
  ------------------
 2273|     12|    int cmp = memcmp(p1->data4, p2->data4, 8);
 2274|     12|    if(cmp != 0)
  ------------------
  |  Branch (2274:8): [True: 0, False: 12]
  ------------------
 2275|      0|        return (cmp < 0) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2275:16): [True: 0, False: 0]
  ------------------
 2276|     12|    return UA_ORDER_EQ;
 2277|     12|}
ua_types.c:nodeIdOrder:
 2297|  37.8k|nodeIdOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2298|  37.8k|    const UA_NodeId *p1 = (const UA_NodeId*)p1_;
 2299|  37.8k|    const UA_NodeId *p2 = (const UA_NodeId*)p2_;
 2300|       |    /* Compare namespaceIndex */
 2301|  37.8k|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2301:8): [True: 0, False: 37.8k]
  ------------------
 2302|      0|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2302:16): [True: 0, False: 0]
  ------------------
 2303|       |
 2304|       |    /* Compare identifierType */
 2305|  37.8k|    if(p1->identifierType != p2->identifierType)
  ------------------
  |  Branch (2305:8): [True: 0, False: 37.8k]
  ------------------
 2306|      0|        return (p1->identifierType < p2->identifierType) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2306:16): [True: 0, False: 0]
  ------------------
 2307|       |
 2308|       |    /* Compare the identifier */
 2309|  37.8k|    switch(p1->identifierType) {
 2310|  37.8k|    case UA_NODEIDTYPE_NUMERIC:
  ------------------
  |  Branch (2310:5): [True: 37.8k, False: 0]
  ------------------
 2311|  37.8k|    default:
  ------------------
  |  Branch (2311:5): [True: 0, False: 37.8k]
  ------------------
 2312|  37.8k|        if(p1->identifier.numeric != p2->identifier.numeric)
  ------------------
  |  Branch (2312:12): [True: 37.5k, False: 216]
  ------------------
 2313|  37.5k|            return (p1->identifier.numeric < p2->identifier.numeric) ?
  ------------------
  |  Branch (2313:20): [True: 12.5k, False: 25.0k]
  ------------------
 2314|  25.0k|                UA_ORDER_LESS : UA_ORDER_MORE;
 2315|    216|        return UA_ORDER_EQ;
 2316|      0|    case UA_NODEIDTYPE_GUID:
  ------------------
  |  Branch (2316:5): [True: 0, False: 37.8k]
  ------------------
 2317|      0|        return guidOrder(&p1->identifier.guid, &p2->identifier.guid, NULL);
 2318|      0|    case UA_NODEIDTYPE_STRING:
  ------------------
  |  Branch (2318:5): [True: 0, False: 37.8k]
  ------------------
 2319|      0|    case UA_NODEIDTYPE_BYTESTRING:
  ------------------
  |  Branch (2319:5): [True: 0, False: 37.8k]
  ------------------
 2320|       |        return stringOrder(&p1->identifier.string, &p2->identifier.string, NULL);
 2321|  37.8k|    }
 2322|  37.8k|}
ua_types.c:expandedNodeIdOrder:
 2325|     16|expandedNodeIdOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2326|     16|    const UA_ExpandedNodeId *p1 = (const UA_ExpandedNodeId*)p1_;
 2327|     16|    const UA_ExpandedNodeId *p2 = (const UA_ExpandedNodeId*)p2_;
 2328|     16|    if(p1->serverIndex != p2->serverIndex)
  ------------------
  |  Branch (2328:8): [True: 0, False: 16]
  ------------------
 2329|      0|        return (p1->serverIndex < p2->serverIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2329:16): [True: 0, False: 0]
  ------------------
 2330|     16|    UA_Order o = stringOrder(&p1->namespaceUri, &p2->namespaceUri, NULL);
 2331|     16|    if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2331:8): [True: 0, False: 16]
  ------------------
 2332|      0|        return o;
 2333|     16|    return nodeIdOrder(&p1->nodeId, &p2->nodeId, NULL);
 2334|     16|}
ua_types.c:booleanOrder:
 2222|     54|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2223|     54|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2224|     54|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2225|     54|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2225:12): [True: 0, False: 54]
  ------------------
 2226|     54|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2226:20): [True: 0, False: 0]
  ------------------
 2227|     54|        return UA_ORDER_EQ;                                               \
 2228|     54|    }
ua_types.c:sByteOrder:
 2222|     25|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2223|     25|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2224|     25|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2225|     25|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2225:12): [True: 0, False: 25]
  ------------------
 2226|     25|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2226:20): [True: 0, False: 0]
  ------------------
 2227|     25|        return UA_ORDER_EQ;                                               \
 2228|     25|    }
ua_types.c:byteOrder:
 2222|     39|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2223|     39|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2224|     39|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2225|     39|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2225:12): [True: 0, False: 39]
  ------------------
 2226|     39|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2226:20): [True: 0, False: 0]
  ------------------
 2227|     39|        return UA_ORDER_EQ;                                               \
 2228|     39|    }
ua_types.c:int16Order:
 2222|     58|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2223|     58|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2224|     58|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2225|     58|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2225:12): [True: 0, False: 58]
  ------------------
 2226|     58|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2226:20): [True: 0, False: 0]
  ------------------
 2227|     58|        return UA_ORDER_EQ;                                               \
 2228|     58|    }
ua_types.c:uInt16Order:
 2222|     35|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2223|     35|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2224|     35|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2225|     35|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2225:12): [True: 0, False: 35]
  ------------------
 2226|     35|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2226:20): [True: 0, False: 0]
  ------------------
 2227|     35|        return UA_ORDER_EQ;                                               \
 2228|     35|    }
ua_types.c:int32Order:
 2222|    139|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2223|    139|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2224|    139|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2225|    139|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2225:12): [True: 0, False: 139]
  ------------------
 2226|    139|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2226:20): [True: 0, False: 0]
  ------------------
 2227|    139|        return UA_ORDER_EQ;                                               \
 2228|    139|    }
ua_types.c:uInt32Order:
 2222|    810|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2223|    810|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2224|    810|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2225|    810|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2225:12): [True: 0, False: 810]
  ------------------
 2226|    810|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2226:20): [True: 0, False: 0]
  ------------------
 2227|    810|        return UA_ORDER_EQ;                                               \
 2228|    810|    }
ua_types.c:int64Order:
 2222|    327|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2223|    327|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2224|    327|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2225|    327|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2225:12): [True: 0, False: 327]
  ------------------
 2226|    327|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2226:20): [True: 0, False: 0]
  ------------------
 2227|    327|        return UA_ORDER_EQ;                                               \
 2228|    327|    }
ua_types.c:uInt64Order:
 2222|     19|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2223|     19|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2224|     19|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2225|     19|        if(*p1 != *p2)                                                    \
  ------------------
  |  Branch (2225:12): [True: 0, False: 19]
  ------------------
 2226|     19|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;           \
  ------------------
  |  Branch (2226:20): [True: 0, False: 0]
  ------------------
 2227|     19|        return UA_ORDER_EQ;                                               \
 2228|     19|    }
ua_types.c:floatOrder:
 2242|     12|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2243|     12|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2244|     12|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2245|     12|        if(*p1 != *p2) {                                                  \
  ------------------
  |  Branch (2245:12): [True: 0, False: 12]
  ------------------
 2246|      0|            /* p1 is NaN */                                         \
 2247|      0|            if(*p1 != *p1) {                                        \
  ------------------
  |  Branch (2247:16): [True: 0, False: 0]
  ------------------
 2248|      0|                if(*p2 != *p2)                                      \
  ------------------
  |  Branch (2248:20): [True: 0, False: 0]
  ------------------
 2249|      0|                    return UA_ORDER_EQ;                             \
 2250|      0|                return UA_ORDER_LESS;                               \
 2251|      0|            }                                                       \
 2252|      0|            /* p2 is NaN */                                         \
 2253|      0|            if(*p2 != *p2)                                          \
  ------------------
  |  Branch (2253:16): [True: 0, False: 0]
  ------------------
 2254|      0|                return UA_ORDER_MORE;                               \
 2255|      0|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2255:20): [True: 0, False: 0]
  ------------------
 2256|      0|        }                                                           \
 2257|     12|        return UA_ORDER_EQ;                                         \
 2258|     12|    }
ua_types.c:doubleOrder:
 2242|    678|    NAME(const void *p1_, const void *p2_, const UA_DataType *type) {     \
 2243|    678|        const TYPE *p1 = (const TYPE*)p1_;                                \
 2244|    678|        const TYPE *p2 = (const TYPE*)p2_;                                \
 2245|    678|        if(*p1 != *p2) {                                                  \
  ------------------
  |  Branch (2245:12): [True: 3, False: 675]
  ------------------
 2246|      3|            /* p1 is NaN */                                         \
 2247|      3|            if(*p1 != *p1) {                                        \
  ------------------
  |  Branch (2247:16): [True: 3, False: 0]
  ------------------
 2248|      3|                if(*p2 != *p2)                                      \
  ------------------
  |  Branch (2248:20): [True: 3, False: 0]
  ------------------
 2249|      3|                    return UA_ORDER_EQ;                             \
 2250|      3|                return UA_ORDER_LESS;                               \
 2251|      3|            }                                                       \
 2252|      3|            /* p2 is NaN */                                         \
 2253|      3|            if(*p2 != *p2)                                          \
  ------------------
  |  Branch (2253:16): [True: 0, False: 0]
  ------------------
 2254|      0|                return UA_ORDER_MORE;                               \
 2255|      0|            return (*p1 < *p2) ? UA_ORDER_LESS : UA_ORDER_MORE;     \
  ------------------
  |  Branch (2255:20): [True: 0, False: 0]
  ------------------
 2256|      0|        }                                                           \
 2257|    678|        return UA_ORDER_EQ;                                         \
 2258|    678|    }
ua_types.c:stringOrder:
 2280|  9.78k|stringOrder(const void *p1_, const void *p2_, const UA_DataType *type) {
 2281|  9.78k|    const UA_String *p1 = (const UA_String*)p1_;
 2282|  9.78k|    const UA_String *p2 = (const UA_String*)p2_;
 2283|  9.78k|    if(p1->length != p2->length)
  ------------------
  |  Branch (2283:8): [True: 2.31k, False: 7.47k]
  ------------------
 2284|  2.31k|        return (p1->length < p2->length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2284:16): [True: 1.49k, False: 818]
  ------------------
 2285|       |    /* For zero-length arrays, every pointer not NULL is considered a
 2286|       |     * UA_EMPTY_ARRAY_SENTINEL. */
 2287|  7.47k|    if(p1->data == p2->data) return UA_ORDER_EQ;
  ------------------
  |  Branch (2287:8): [True: 540, False: 6.93k]
  ------------------
 2288|  6.93k|    if(p1->data == NULL) return UA_ORDER_LESS;
  ------------------
  |  Branch (2288:8): [True: 0, False: 6.93k]
  ------------------
 2289|  6.93k|    if(p2->data == NULL) return UA_ORDER_MORE;
  ------------------
  |  Branch (2289:8): [True: 0, False: 6.93k]
  ------------------
 2290|  6.93k|    int cmp = memcmp((const char*)p1->data, (const char*)p2->data, p1->length);
 2291|  6.93k|    if(cmp != 0)
  ------------------
  |  Branch (2291:8): [True: 2.15k, False: 4.78k]
  ------------------
 2292|  2.15k|        return (cmp < 0) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2292:16): [True: 1.19k, False: 953]
  ------------------
 2293|  4.78k|    return UA_ORDER_EQ;
 2294|  6.93k|}
ua_types.c:qualifiedNameOrder:
 2337|     12|qualifiedNameOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2338|     12|    const UA_QualifiedName *p1 = (const UA_QualifiedName*)p1_;
 2339|     12|    const UA_QualifiedName *p2 = (const UA_QualifiedName*)p2_;
 2340|     12|    if(p1->namespaceIndex != p2->namespaceIndex)
  ------------------
  |  Branch (2340:8): [True: 0, False: 12]
  ------------------
 2341|      0|        return (p1->namespaceIndex < p2->namespaceIndex) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2341:16): [True: 0, False: 0]
  ------------------
 2342|     12|    return stringOrder(&p1->name, &p2->name, NULL);
 2343|     12|}
ua_types.c:localizedTextOrder:
 2346|     69|localizedTextOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2347|     69|    const UA_LocalizedText *p1 = (const UA_LocalizedText*)p1_;
 2348|     69|    const UA_LocalizedText *p2 = (const UA_LocalizedText*)p2_;
 2349|     69|    UA_Order o = stringOrder(&p1->locale, &p2->locale, NULL);
 2350|     69|    if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2350:8): [True: 0, False: 69]
  ------------------
 2351|      0|        return o;
 2352|     69|    return stringOrder(&p1->text, &p2->text, NULL);
 2353|     69|}
ua_types.c:extensionObjectOrder:
 2356|     97|extensionObjectOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2357|     97|    const UA_ExtensionObject *p1 = (const UA_ExtensionObject*)p1_;
 2358|     97|    const UA_ExtensionObject *p2 = (const UA_ExtensionObject*)p2_;
 2359|     97|    UA_ExtensionObjectEncoding enc1 = p1->encoding;
 2360|     97|    UA_ExtensionObjectEncoding enc2 = p2->encoding;
 2361|     97|    if(enc1 == UA_EXTENSIONOBJECT_DECODED_NODELETE)
  ------------------
  |  Branch (2361:8): [True: 0, False: 97]
  ------------------
 2362|      0|        enc1 = UA_EXTENSIONOBJECT_DECODED;
 2363|     97|    if(enc2 == UA_EXTENSIONOBJECT_DECODED_NODELETE)
  ------------------
  |  Branch (2363:8): [True: 0, False: 97]
  ------------------
 2364|      0|        enc2 = UA_EXTENSIONOBJECT_DECODED;
 2365|     97|    if(enc1 != enc2)
  ------------------
  |  Branch (2365:8): [True: 0, False: 97]
  ------------------
 2366|      0|        return (enc1 < enc2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2366:16): [True: 0, False: 0]
  ------------------
 2367|       |
 2368|     97|    switch(enc1) {
 2369|     97|    case UA_EXTENSIONOBJECT_ENCODED_NOBODY:
  ------------------
  |  Branch (2369:5): [True: 97, False: 0]
  ------------------
 2370|     97|        return UA_ORDER_EQ;
 2371|       |
 2372|      0|    case UA_EXTENSIONOBJECT_ENCODED_BYTESTRING:
  ------------------
  |  Branch (2372:5): [True: 0, False: 97]
  ------------------
 2373|      0|    case UA_EXTENSIONOBJECT_ENCODED_XML:
  ------------------
  |  Branch (2373:5): [True: 0, False: 97]
  ------------------
 2374|      0|    case UA_EXTENSIONOBJECT_ENCODED_JSON: {
  ------------------
  |  Branch (2374:5): [True: 0, False: 97]
  ------------------
 2375|      0|            UA_Order o = nodeIdOrder(&p1->content.encoded.typeId,
 2376|      0|                                     &p2->content.encoded.typeId, NULL);
 2377|      0|            if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2377:16): [True: 0, False: 0]
  ------------------
 2378|      0|                return o;
 2379|      0|            return stringOrder((const UA_String*)&p1->content.encoded.body,
 2380|      0|                               (const UA_String*)&p2->content.encoded.body, NULL);
 2381|      0|        }
 2382|       |
 2383|      0|    case UA_EXTENSIONOBJECT_DECODED:
  ------------------
  |  Branch (2383:5): [True: 0, False: 97]
  ------------------
 2384|      0|    default: {
  ------------------
  |  Branch (2384:5): [True: 0, False: 97]
  ------------------
 2385|      0|            const UA_DataType *type1 = p1->content.decoded.type;
 2386|      0|            const UA_DataType *type2 = p2->content.decoded.type;
 2387|      0|            if(type1 != type2)
  ------------------
  |  Branch (2387:16): [True: 0, False: 0]
  ------------------
 2388|      0|                return ((uintptr_t)type1 < (uintptr_t)type2) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2388:24): [True: 0, False: 0]
  ------------------
 2389|      0|            if(!type1)
  ------------------
  |  Branch (2389:16): [True: 0, False: 0]
  ------------------
 2390|      0|                return UA_ORDER_EQ;
 2391|      0|            return orderJumpTable[type1->typeKind]
 2392|      0|                (p1->content.decoded.data, p2->content.decoded.data, type1);
 2393|      0|        }
 2394|     97|    }
 2395|     97|}
ua_types.c:dataValueOrder:
 2459|     13|dataValueOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2460|     13|    const UA_DataValue *p1 = (const UA_DataValue*)p1_;
 2461|     13|    const UA_DataValue *p2 = (const UA_DataValue*)p2_;
 2462|       |    /* Value */
 2463|     13|    if(p1->hasValue != p2->hasValue)
  ------------------
  |  Branch (2463:8): [True: 0, False: 13]
  ------------------
 2464|      0|        return (!p1->hasValue) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2464:16): [True: 0, False: 0]
  ------------------
 2465|     13|    if(p1->hasValue) {
  ------------------
  |  Branch (2465:8): [True: 0, False: 13]
  ------------------
 2466|      0|        UA_Order o = variantOrder(&p1->value, &p2->value, NULL);
 2467|      0|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2467:12): [True: 0, False: 0]
  ------------------
 2468|      0|            return o;
 2469|      0|    }
 2470|       |
 2471|       |    /* Status */
 2472|     13|    if(p1->hasStatus != p2->hasStatus)
  ------------------
  |  Branch (2472:8): [True: 0, False: 13]
  ------------------
 2473|      0|        return (!p1->hasStatus) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2473:16): [True: 0, False: 0]
  ------------------
 2474|     13|    if(p1->hasStatus && p1->status != p2->status)
  ------------------
  |  Branch (2474:8): [True: 0, False: 13]
  |  Branch (2474:25): [True: 0, False: 0]
  ------------------
 2475|      0|        return (p1->status < p2->status) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2475:16): [True: 0, False: 0]
  ------------------
 2476|       |
 2477|       |    /* SourceTimestamp */
 2478|     13|    if(p1->hasSourceTimestamp != p2->hasSourceTimestamp)
  ------------------
  |  Branch (2478:8): [True: 0, False: 13]
  ------------------
 2479|      0|        return (!p1->hasSourceTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2479:16): [True: 0, False: 0]
  ------------------
 2480|     13|    if(p1->hasSourceTimestamp && p1->sourceTimestamp != p2->sourceTimestamp)
  ------------------
  |  Branch (2480:8): [True: 0, False: 13]
  |  Branch (2480:34): [True: 0, False: 0]
  ------------------
 2481|      0|        return (p1->sourceTimestamp < p2->sourceTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2481:16): [True: 0, False: 0]
  ------------------
 2482|       |
 2483|       |    /* ServerTimestamp */
 2484|     13|    if(p1->hasServerTimestamp != p2->hasServerTimestamp)
  ------------------
  |  Branch (2484:8): [True: 0, False: 13]
  ------------------
 2485|      0|        return (!p1->hasServerTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2485:16): [True: 0, False: 0]
  ------------------
 2486|     13|    if(p1->hasServerTimestamp && p1->serverTimestamp != p2->serverTimestamp)
  ------------------
  |  Branch (2486:8): [True: 0, False: 13]
  |  Branch (2486:34): [True: 0, False: 0]
  ------------------
 2487|      0|        return (p1->serverTimestamp < p2->serverTimestamp) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2487:16): [True: 0, False: 0]
  ------------------
 2488|       |
 2489|       |    /* SourcePicoseconds */
 2490|     13|    if(p1->hasSourcePicoseconds != p2->hasSourcePicoseconds)
  ------------------
  |  Branch (2490:8): [True: 0, False: 13]
  ------------------
 2491|      0|        return (!p1->hasSourcePicoseconds) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2491:16): [True: 0, False: 0]
  ------------------
 2492|     13|    if(p1->hasSourcePicoseconds && p1->sourcePicoseconds != p2->sourcePicoseconds)
  ------------------
  |  Branch (2492:8): [True: 0, False: 13]
  |  Branch (2492:36): [True: 0, False: 0]
  ------------------
 2493|      0|        return (p1->sourcePicoseconds < p2->sourcePicoseconds) ?
  ------------------
  |  Branch (2493:16): [True: 0, False: 0]
  ------------------
 2494|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2495|       |
 2496|       |    /* ServerPicoseconds */
 2497|     13|    if(p1->hasServerPicoseconds != p2->hasServerPicoseconds)
  ------------------
  |  Branch (2497:8): [True: 0, False: 13]
  ------------------
 2498|      0|        return (!p1->hasServerPicoseconds) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2498:16): [True: 0, False: 0]
  ------------------
 2499|     13|    if(p1->hasServerPicoseconds && p1->serverPicoseconds != p2->serverPicoseconds)
  ------------------
  |  Branch (2499:8): [True: 0, False: 13]
  |  Branch (2499:36): [True: 0, False: 0]
  ------------------
 2500|      0|        return (p1->serverPicoseconds < p2->serverPicoseconds) ?
  ------------------
  |  Branch (2500:16): [True: 0, False: 0]
  ------------------
 2501|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2502|       |
 2503|     13|    return UA_ORDER_EQ;
 2504|     13|}
ua_types.c:variantOrder:
 2422|  1.57k|variantOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2423|  1.57k|    const UA_Variant *p1 = (const UA_Variant*)p1_;
 2424|  1.57k|    const UA_Variant *p2 = (const UA_Variant*)p2_;
 2425|  1.57k|    if(p1->type != p2->type)
  ------------------
  |  Branch (2425:8): [True: 0, False: 1.57k]
  ------------------
 2426|      0|        return ((uintptr_t)p1->type < (uintptr_t)p2->type) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2426:16): [True: 0, False: 0]
  ------------------
 2427|       |
 2428|  1.57k|    UA_Order o;
 2429|  1.57k|    if(p1->type != NULL) {
  ------------------
  |  Branch (2429:8): [True: 1.56k, False: 8]
  ------------------
 2430|       |        /* Check if both variants are scalars or arrays */
 2431|  1.56k|        UA_Boolean s1 = UA_Variant_isScalar(p1);
 2432|  1.56k|        UA_Boolean s2 = UA_Variant_isScalar(p2);
 2433|  1.56k|        if(s1 != s2)
  ------------------
  |  Branch (2433:12): [True: 0, False: 1.56k]
  ------------------
 2434|      0|            return s1 ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2434:20): [True: 0, False: 0]
  ------------------
 2435|  1.56k|        if(s1) {
  ------------------
  |  Branch (2435:12): [True: 1.56k, False: 5]
  ------------------
 2436|  1.56k|            o = orderJumpTable[p1->type->typeKind](p1->data, p2->data, p1->type);
 2437|  1.56k|        } else {
 2438|       |            /* Mismatching array length? */
 2439|      5|            if(p1->arrayLength != p2->arrayLength)
  ------------------
  |  Branch (2439:16): [True: 0, False: 5]
  ------------------
 2440|      0|                return (p1->arrayLength < p2->arrayLength) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2440:24): [True: 0, False: 0]
  ------------------
 2441|      5|            o = arrayOrder(p1->data, p1->arrayLength, p2->data, p2->arrayLength, p1->type);
 2442|      5|        }
 2443|  1.56k|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2443:12): [True: 0, False: 1.56k]
  ------------------
 2444|      0|            return o;
 2445|  1.56k|    }
 2446|       |
 2447|  1.57k|    if(p1->arrayDimensionsSize != p2->arrayDimensionsSize)
  ------------------
  |  Branch (2447:8): [True: 0, False: 1.57k]
  ------------------
 2448|      0|        return (p1->arrayDimensionsSize < p2->arrayDimensionsSize) ?
  ------------------
  |  Branch (2448:16): [True: 0, False: 0]
  ------------------
 2449|      0|            UA_ORDER_LESS : UA_ORDER_MORE;
 2450|  1.57k|    o = UA_ORDER_EQ;
 2451|  1.57k|    if(p1->arrayDimensionsSize > 0)
  ------------------
  |  Branch (2451:8): [True: 0, False: 1.57k]
  ------------------
 2452|      0|        o = arrayOrder(p1->arrayDimensions, p1->arrayDimensionsSize,
 2453|      0|                       p2->arrayDimensions, p2->arrayDimensionsSize,
 2454|      0|                       &UA_TYPES[UA_TYPES_UINT32]);
  ------------------
  |  |  232|      0|#define UA_TYPES_UINT32 6
  ------------------
 2455|  1.57k|    return o;
 2456|  1.57k|}
ua_types.c:arrayOrder:
 2406|    144|           const UA_DataType *type) {
 2407|    144|    if(p1Length != p2Length)
  ------------------
  |  Branch (2407:8): [True: 0, False: 144]
  ------------------
 2408|      0|        return (p1Length < p2Length) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2408:16): [True: 0, False: 0]
  ------------------
 2409|    144|    uintptr_t u1 = (uintptr_t)p1;
 2410|    144|    uintptr_t u2 = (uintptr_t)p2;
 2411|    144|    for(size_t i = 0; i < p1Length; i++) {
  ------------------
  |  Branch (2411:23): [True: 0, False: 144]
  ------------------
 2412|      0|        UA_Order o = orderJumpTable[type->typeKind]((const void*)u1, (const void*)u2, type);
 2413|      0|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2413:12): [True: 0, False: 0]
  ------------------
 2414|      0|            return o;
 2415|      0|        u1 += type->memSize;
 2416|      0|        u2 += type->memSize;
 2417|      0|    }
 2418|    144|    return UA_ORDER_EQ;
 2419|    144|}
ua_types.c:diagnosticInfoOrder:
 2507|     21|diagnosticInfoOrder(const void *p1_, const void *p2_, const UA_DataType *_) {
 2508|     21|    const UA_DiagnosticInfo *p1 = (const UA_DiagnosticInfo*)p1_;
 2509|     21|    const UA_DiagnosticInfo *p2 = (const UA_DiagnosticInfo*)p2_;
 2510|       |    /* SymbolicId */
 2511|     21|    if(p1->hasSymbolicId != p2->hasSymbolicId)
  ------------------
  |  Branch (2511:8): [True: 0, False: 21]
  ------------------
 2512|      0|        return (!p1->hasSymbolicId) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2512:16): [True: 0, False: 0]
  ------------------
 2513|     21|    if(p1->hasSymbolicId && p1->symbolicId != p2->symbolicId)
  ------------------
  |  Branch (2513:8): [True: 0, False: 21]
  |  Branch (2513:29): [True: 0, False: 0]
  ------------------
 2514|      0|        return (p1->symbolicId < p2->symbolicId) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2514:16): [True: 0, False: 0]
  ------------------
 2515|       |
 2516|       |    /* NamespaceUri */
 2517|     21|    if(p1->hasNamespaceUri != p2->hasNamespaceUri)
  ------------------
  |  Branch (2517:8): [True: 0, False: 21]
  ------------------
 2518|      0|        return (!p1->hasNamespaceUri) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2518:16): [True: 0, False: 0]
  ------------------
 2519|     21|    if(p1->hasNamespaceUri && p1->namespaceUri != p2->namespaceUri)
  ------------------
  |  Branch (2519:8): [True: 0, False: 21]
  |  Branch (2519:31): [True: 0, False: 0]
  ------------------
 2520|      0|        return (p1->namespaceUri < p2->namespaceUri) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2520:16): [True: 0, False: 0]
  ------------------
 2521|       |
 2522|       |    /* LocalizedText */
 2523|     21|    if(p1->hasLocalizedText != p2->hasLocalizedText)
  ------------------
  |  Branch (2523:8): [True: 0, False: 21]
  ------------------
 2524|      0|        return (!p1->hasLocalizedText) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2524:16): [True: 0, False: 0]
  ------------------
 2525|     21|    if(p1->hasLocalizedText && p1->localizedText != p2->localizedText)
  ------------------
  |  Branch (2525:8): [True: 0, False: 21]
  |  Branch (2525:32): [True: 0, False: 0]
  ------------------
 2526|      0|        return (p1->localizedText < p2->localizedText) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2526:16): [True: 0, False: 0]
  ------------------
 2527|       |
 2528|       |    /* Locale */
 2529|     21|    if(p1->hasLocale != p2->hasLocale)
  ------------------
  |  Branch (2529:8): [True: 0, False: 21]
  ------------------
 2530|      0|        return (!p1->hasLocale) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2530:16): [True: 0, False: 0]
  ------------------
 2531|     21|    if(p1->hasLocale && p1->locale != p2->locale)
  ------------------
  |  Branch (2531:8): [True: 0, False: 21]
  |  Branch (2531:25): [True: 0, False: 0]
  ------------------
 2532|      0|        return (p1->locale < p2->locale) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2532:16): [True: 0, False: 0]
  ------------------
 2533|       |
 2534|       |    /* AdditionalInfo */
 2535|     21|    if(p1->hasAdditionalInfo != p2->hasAdditionalInfo)
  ------------------
  |  Branch (2535:8): [True: 0, False: 21]
  ------------------
 2536|      0|        return (!p1->hasAdditionalInfo) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2536:16): [True: 0, False: 0]
  ------------------
 2537|     21|    if(p1->hasAdditionalInfo) {
  ------------------
  |  Branch (2537:8): [True: 0, False: 21]
  ------------------
 2538|      0|        UA_Order o = stringOrder(&p1->additionalInfo, &p2->additionalInfo, NULL);
 2539|      0|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2539:12): [True: 0, False: 0]
  ------------------
 2540|      0|            return o;
 2541|      0|    }
 2542|       |
 2543|       |    /* InnerStatusCode */
 2544|     21|    if(p1->hasInnerStatusCode != p2->hasInnerStatusCode)
  ------------------
  |  Branch (2544:8): [True: 0, False: 21]
  ------------------
 2545|      0|        return (!p1->hasInnerStatusCode) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2545:16): [True: 0, False: 0]
  ------------------
 2546|     21|    if(p1->hasInnerStatusCode && p1->innerStatusCode != p2->innerStatusCode)
  ------------------
  |  Branch (2546:8): [True: 0, False: 21]
  |  Branch (2546:34): [True: 0, False: 0]
  ------------------
 2547|      0|        return (p1->innerStatusCode < p2->innerStatusCode) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2547:16): [True: 0, False: 0]
  ------------------
 2548|       |
 2549|       |    /* InnerDiagnosticInfo */
 2550|     21|    if(p1->hasInnerDiagnosticInfo != p2->hasInnerDiagnosticInfo)
  ------------------
  |  Branch (2550:8): [True: 0, False: 21]
  ------------------
 2551|      0|        return (!p1->hasInnerDiagnosticInfo) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2551:16): [True: 0, False: 0]
  ------------------
 2552|     21|    if(p1->innerDiagnosticInfo == p2->innerDiagnosticInfo)
  ------------------
  |  Branch (2552:8): [True: 21, False: 0]
  ------------------
 2553|     21|        return UA_ORDER_EQ;
 2554|      0|    if(!p1->innerDiagnosticInfo || !p2->innerDiagnosticInfo)
  ------------------
  |  Branch (2554:8): [True: 0, False: 0]
  |  Branch (2554:36): [True: 0, False: 0]
  ------------------
 2555|      0|        return (!p1->innerDiagnosticInfo) ? UA_ORDER_LESS : UA_ORDER_MORE;
  ------------------
  |  Branch (2555:16): [True: 0, False: 0]
  ------------------
 2556|      0|    return diagnosticInfoOrder(p1->innerDiagnosticInfo, p2->innerDiagnosticInfo, NULL);
 2557|      0|}
ua_types.c:structureOrder:
 2560|    316|structureOrder(const void *p1, const void *p2, const UA_DataType *type) {
 2561|    316|    uintptr_t u1 = (uintptr_t)p1;
 2562|    316|    uintptr_t u2 = (uintptr_t)p2;
 2563|    316|    UA_Order o = UA_ORDER_EQ;
 2564|  1.55k|    for(size_t i = 0; i < type->membersSize; ++i) {
  ------------------
  |  Branch (2564:23): [True: 1.23k, False: 316]
  ------------------
 2565|  1.23k|        const UA_DataTypeMember *m = &type->members[i];
 2566|  1.23k|        const UA_DataType *mt = m->memberType;
 2567|  1.23k|        u1 += m->padding;
 2568|  1.23k|        u2 += m->padding;
 2569|  1.23k|        if(!m->isOptional) {
  ------------------
  |  Branch (2569:12): [True: 1.23k, False: 0]
  ------------------
 2570|  1.23k|            if(!m->isArray) {
  ------------------
  |  Branch (2570:16): [True: 1.09k, False: 139]
  ------------------
 2571|  1.09k|                o = orderJumpTable[mt->typeKind]((const void *)u1, (const void *)u2, mt);
 2572|  1.09k|                u1 += mt->memSize;
 2573|  1.09k|                u2 += mt->memSize;
 2574|  1.09k|            } else {
 2575|    139|                size_t size1 = *(size_t*)u1;
 2576|    139|                size_t size2 = *(size_t*)u2;
 2577|    139|                u1 += sizeof(size_t);
 2578|    139|                u2 += sizeof(size_t);
 2579|    139|                o = arrayOrder(*(void* const*)u1, size1, *(void* const*)u2, size2, mt);
 2580|    139|                u1 += sizeof(void*);
 2581|    139|                u2 += sizeof(void*);
 2582|    139|            }
 2583|  1.23k|        } else {
 2584|      0|            if(!m->isArray) {
  ------------------
  |  Branch (2584:16): [True: 0, False: 0]
  ------------------
 2585|      0|                const void *pp1 = *(void* const*)u1;
 2586|      0|                const void *pp2 = *(void* const*)u2;
 2587|      0|                if(pp1 == pp2) {
  ------------------
  |  Branch (2587:20): [True: 0, False: 0]
  ------------------
 2588|      0|                    o = UA_ORDER_EQ;
 2589|      0|                } else if(pp1 == NULL) {
  ------------------
  |  Branch (2589:27): [True: 0, False: 0]
  ------------------
 2590|      0|                    o = UA_ORDER_LESS;
 2591|      0|                } else if(pp2 == NULL) {
  ------------------
  |  Branch (2591:27): [True: 0, False: 0]
  ------------------
 2592|      0|                    o = UA_ORDER_MORE;
 2593|      0|                } else {
 2594|      0|                    o = orderJumpTable[mt->typeKind](pp1, pp2, mt);
 2595|      0|                }
 2596|      0|            } else {
 2597|      0|                size_t sa1 = *(size_t*)u1;
 2598|      0|                size_t sa2 = *(size_t*)u2;
 2599|      0|                u1 += sizeof(size_t);
 2600|      0|                u2 += sizeof(size_t);
 2601|      0|                o = arrayOrder(*(void* const*)u1, sa1, *(void* const*)u2, sa2, mt);
 2602|      0|            }
 2603|      0|            u1 += sizeof(void*);
 2604|      0|            u2 += sizeof(void*);
 2605|      0|        }
 2606|       |
 2607|  1.23k|        if(o != UA_ORDER_EQ)
  ------------------
  |  Branch (2607:12): [True: 0, False: 1.23k]
  ------------------
 2608|      0|            break;
 2609|  1.23k|    }
 2610|    316|    return o;
 2611|    316|}

xml_tokenize:
   44|  8.29k|             xml_token *tokens, unsigned int max_tokens) {
   45|  8.29k|    xml_result res;
   46|  8.29k|    memset(&res, 0, sizeof(xml_result));
   47|  8.29k|    res.tokens = tokens;
   48|       |
   49|  8.29k|    yxml_t ctx;
   50|  8.29k|    char buf[512];
   51|  8.29k|    yxml_init(&ctx, buf, 512);
   52|       |
   53|  8.29k|    unsigned char top = 0;
   54|  8.29k|    unsigned tokenPos = 0;
   55|  8.29k|    xml_token *stack[32]; /* Max nesting depth is 32 */
   56|  8.29k|    xml_token backup_tokens[32]; /* To be used when the tokens run out */
   57|       |
   58|       |    /* Help clang-analyzer */
   59|       |#ifdef __clang_analyzer__
   60|       |    memset(stack, 0, 32 * sizeof(void*));
   61|       |    memset(backup_tokens, 0, 32 * sizeof(xml_token));
   62|       |#endif
   63|       |
   64|  8.29k|    stack[top] = &backup_tokens[top];
   65|  8.29k|    memset(stack[top], 0, sizeof(xml_token));
   66|       |
   67|  8.29k|    unsigned val_begin = 0;
   68|  8.29k|    unsigned pos = 0;
   69|   158M|    for(; pos < len; pos++) {
  ------------------
  |  Branch (69:11): [True: 158M, False: 7.14k]
  ------------------
   70|       |#ifdef __clang_analyzer__
   71|       |        UA_assert(stack[top] != NULL);
   72|       |#endif
   73|   158M|        yxml_ret_t xml_status = yxml_parse(&ctx, xml[pos]);
   74|   158M|        switch(xml_status) {
   75|      0|        case YXML_EEOF:
  ------------------
  |  Branch (75:9): [True: 0, False: 158M]
  ------------------
   76|    212|        case YXML_EREF:
  ------------------
  |  Branch (76:9): [True: 212, False: 158M]
  ------------------
   77|    310|        case YXML_ECLOSE:
  ------------------
  |  Branch (77:9): [True: 98, False: 158M]
  ------------------
   78|    319|        case YXML_ESTACK:
  ------------------
  |  Branch (78:9): [True: 9, False: 158M]
  ------------------
   79|  1.11k|        case YXML_ESYN:
  ------------------
  |  Branch (79:9): [True: 792, False: 158M]
  ------------------
   80|  1.11k|        default:
  ------------------
  |  Branch (80:9): [True: 0, False: 158M]
  ------------------
   81|  1.11k|            goto errout;
   82|  65.8M|        case YXML_OK:
  ------------------
  |  Branch (82:9): [True: 65.8M, False: 92.5M]
  ------------------
   83|  65.8M|            continue;
   84|  12.9M|        case YXML_ELEMSTART:
  ------------------
  |  Branch (84:9): [True: 12.9M, False: 145M]
  ------------------
   85|  13.9M|        case YXML_ATTRSTART: {
  ------------------
  |  Branch (85:9): [True: 1.00M, False: 157M]
  ------------------
   86|  13.9M|            if(xml_status == YXML_ELEMSTART) {
  ------------------
  |  Branch (86:16): [True: 12.9M, False: 1.00M]
  ------------------
   87|  12.9M|                stack[top]->children++;
   88|  12.9M|                stack[top]->content = UA_STRING_NULL; /* Only the leaf elements have content */
   89|  12.9M|            } else {
   90|  1.00M|                stack[top]->attributes++;
   91|  1.00M|            }
   92|  13.9M|            top++;
   93|  13.9M|            if(top >= 32)
  ------------------
  |  Branch (93:16): [True: 6, False: 13.9M]
  ------------------
   94|      6|                goto errout; /* nesting too deep */
   95|  13.9M|            stack[top] = (tokenPos < max_tokens) ? &tokens[tokenPos] : &backup_tokens[top];
  ------------------
  |  Branch (95:26): [True: 6.95M, False: 6.99M]
  ------------------
   96|  13.9M|            memset(stack[top], 0, sizeof(xml_token));
   97|  13.9M|            stack[top]->type = (xml_status == YXML_ELEMSTART) ? XML_TOKEN_ELEMENT : XML_TOKEN_ATTRIBUTE;
  ------------------
  |  Branch (97:32): [True: 12.9M, False: 1.00M]
  ------------------
   98|  13.9M|            stack[top]->name = backtrackName(xml, pos);
   99|  13.9M|            const char *start = xml + pos;
  100|  13.9M|            if(xml_status == YXML_ELEMSTART) {
  ------------------
  |  Branch (100:16): [True: 12.9M, False: 1.00M]
  ------------------
  101|  39.3M|                while(*start != '<')
  ------------------
  |  Branch (101:23): [True: 26.3M, False: 12.9M]
  ------------------
  102|  26.3M|                    start--;
  103|  12.9M|            }
  104|  13.9M|            stack[top]->start = (unsigned)(start - xml);
  105|  13.9M|            tokenPos++;
  106|  13.9M|            val_begin = 0; /* if the previous non-leaf element started to collect content */
  107|  13.9M|            break;
  108|  13.9M|        }
  109|  61.6M|        case YXML_CONTENT:
  ------------------
  |  Branch (109:9): [True: 61.6M, False: 96.7M]
  ------------------
  110|  64.6M|        case YXML_ATTRVAL:
  ------------------
  |  Branch (110:9): [True: 2.94M, False: 155M]
  ------------------
  111|  64.6M|            if(ctx.isReference && xml_status == YXML_CONTENT)
  ------------------
  |  Branch (111:16): [True: 1.03M, False: 63.5M]
  |  Branch (111:35): [True: 1.03M, False: 806]
  ------------------
  112|  1.03M|                stack[top]->contentEscaped = true;
  113|  64.6M|            if(val_begin == 0)
  ------------------
  |  Branch (113:16): [True: 304k, False: 64.3M]
  ------------------
  114|   304k|                val_begin = pos;
  115|  64.6M|            stack[top]->end = pos;
  116|  64.6M|            break;
  117|  12.9M|        case YXML_ELEMEND:
  ------------------
  |  Branch (117:9): [True: 12.9M, False: 145M]
  ------------------
  118|  13.9M|        case YXML_ATTREND:
  ------------------
  |  Branch (118:9): [True: 1.00M, False: 157M]
  ------------------
  119|  13.9M|            if(top == 0)
  ------------------
  |  Branch (119:16): [True: 0, False: 13.9M]
  ------------------
  120|      0|                goto errout; /* more closes than opens */
  121|  13.9M|            if(val_begin > 0) {
  ------------------
  |  Branch (121:16): [True: 167k, False: 13.7M]
  ------------------
  122|   167k|                stack[top]->content.data = (UA_Byte*)(uintptr_t)xml + val_begin;
  123|   167k|                stack[top]->content.length = stack[top]->end + 1 - val_begin;
  124|   167k|            }
  125|  13.9M|            stack[top]->end = pos;
  126|  13.9M|            if(xml_status == YXML_ELEMEND) {
  ------------------
  |  Branch (126:16): [True: 12.9M, False: 1.00M]
  ------------------
  127|       |                /* Saw "</", looking for the closing ">" */
  128|  12.9M|                while(stack[top]->end < len && xml[stack[top]->end] != '>')
  ------------------
  |  Branch (128:23): [True: 12.9M, False: 35]
  |  Branch (128:48): [True: 17.1k, False: 12.9M]
  ------------------
  129|  17.1k|                    stack[top]->end++;
  130|  12.9M|                stack[top]->end++;
  131|  12.9M|                if(stack[top]->end > len)
  ------------------
  |  Branch (131:20): [True: 35, False: 12.9M]
  ------------------
  132|     35|                    goto errout;
  133|  12.9M|            }
  134|  13.9M|            val_begin = 0;
  135|  13.9M|            top--;
  136|  13.9M|            break;
  137|  3.76k|        case YXML_PISTART:
  ------------------
  |  Branch (137:9): [True: 3.76k, False: 158M]
  ------------------
  138|  7.23k|        case YXML_PICONTENT:
  ------------------
  |  Branch (138:9): [True: 3.47k, False: 158M]
  ------------------
  139|  10.8k|        case YXML_PIEND:
  ------------------
  |  Branch (139:9): [True: 3.62k, False: 158M]
  ------------------
  140|  10.8k|            continue; /* Ignore processing instructions */
  141|   158M|        }
  142|   158M|    }
  143|       |
  144|       |    /* Check that all elements were closed */
  145|  7.14k|    if(yxml_eof(&ctx) != YXML_OK)
  ------------------
  |  Branch (145:8): [True: 2.03k, False: 5.11k]
  ------------------
  146|  2.03k|        goto errout;
  147|       |
  148|  5.11k|    res.num_tokens = tokenPos;
  149|  5.11k|    if(tokenPos > max_tokens)
  ------------------
  |  Branch (149:8): [True: 462, False: 4.65k]
  ------------------
  150|    462|        res.error = XML_ERROR_OVERFLOW;
  151|  5.11k|    return res;
  152|       |
  153|  3.18k| errout:
  154|  3.18k|    res.error_pos = pos;
  155|  3.18k|    res.error = XML_ERROR_INVALID;
  156|  3.18k|    return res;
  157|  7.14k|}
UA_encodeXml:
  862|  3.13k|             const UA_EncodeXmlOptions *options) {
  863|  3.13k|    if(!src || !type)
  ------------------
  |  Branch (863:8): [True: 0, False: 3.13k]
  |  Branch (863:16): [True: 0, False: 3.13k]
  ------------------
  864|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
  865|       |
  866|       |    /* Allocate buffer */
  867|  3.13k|    UA_Boolean allocated = false;
  868|  3.13k|    status res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  3.13k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  869|  3.13k|    if(outBuf->length == 0) {
  ------------------
  |  Branch (869:8): [True: 0, False: 3.13k]
  ------------------
  870|      0|        size_t len = UA_calcSizeXml(src, type, options);
  871|      0|        res = UA_ByteString_allocBuffer(outBuf, len);
  872|      0|        if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (872:12): [True: 0, False: 0]
  ------------------
  873|      0|            return res;
  874|      0|        allocated = true;
  875|      0|    }
  876|       |
  877|       |    /* Set up the context */
  878|  3.13k|    CtxXml ctx;
  879|  3.13k|    memset(&ctx, 0, sizeof(ctx));
  880|  3.13k|    ctx.pos = outBuf->data;
  881|  3.13k|    ctx.end = &outBuf->data[outBuf->length];
  882|  3.13k|    ctx.depth = 0;
  883|  3.13k|    ctx.calcOnly = false;
  884|  3.13k|    if(options) {
  ------------------
  |  Branch (884:8): [True: 0, False: 3.13k]
  ------------------
  885|      0|        ctx.namespaceMapping = options->namespaceMapping;
  886|      0|        ctx.serverUris = options->serverUris;
  887|      0|        ctx.serverUrisSize = options->serverUrisSize;
  888|      0|    }
  889|       |
  890|       |    /* Encode */
  891|  3.13k|    res = writeXmlElement(&ctx, type->typeName, src, type);
  892|       |
  893|       |    /* Clean up */
  894|  3.13k|    if(res == UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  3.13k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (894:8): [True: 3.13k, False: 0]
  ------------------
  895|  3.13k|        outBuf->length = (size_t)((uintptr_t)ctx.pos - (uintptr_t)outBuf->data);
  896|      0|    else if(allocated)
  ------------------
  |  Branch (896:13): [True: 0, False: 0]
  ------------------
  897|      0|        UA_ByteString_clear(outBuf);
  898|       |
  899|  3.13k|    return res;
  900|  3.13k|}
UA_calcSizeXml:
  908|  1.61k|               const UA_EncodeXmlOptions *options) {
  909|  1.61k|    if(!src || !type)
  ------------------
  |  Branch (909:8): [True: 0, False: 1.61k]
  |  Branch (909:16): [True: 0, False: 1.61k]
  ------------------
  910|      0|        return UA_STATUSCODE_BADINTERNALERROR;
  ------------------
  |  |   29|      0|#define UA_STATUSCODE_BADINTERNALERROR ((UA_StatusCode) 0x80020000)
  ------------------
  911|       |
  912|       |    /* Set up the context */
  913|  1.61k|    CtxXml ctx;
  914|  1.61k|    memset(&ctx, 0, sizeof(ctx));
  915|  1.61k|    ctx.pos = NULL;
  916|  1.61k|    ctx.end = (const UA_Byte*)(uintptr_t)SIZE_MAX;
  917|  1.61k|    ctx.depth = 0;
  918|  1.61k|    if(options) {
  ------------------
  |  Branch (918:8): [True: 0, False: 1.61k]
  ------------------
  919|      0|        ctx.namespaceMapping = options->namespaceMapping;
  920|      0|        ctx.serverUris = options->serverUris;
  921|      0|        ctx.serverUrisSize = options->serverUrisSize;
  922|      0|    }
  923|       |
  924|  1.61k|    ctx.calcOnly = true;
  925|       |
  926|       |    /* Encode */
  927|  1.61k|    status ret = writeXmlElement(&ctx, type->typeName, src, type);
  928|  1.61k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  1.61k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (928:8): [True: 50, False: 1.56k]
  ------------------
  929|     50|        return 0;
  930|  1.56k|    return (size_t)ctx.pos;
  931|  1.61k|}
UA_decodeXml:
 2078|  7.83k|             const UA_DecodeXmlOptions *options) {
 2079|  7.83k|    if(!dst || !src || !type)
  ------------------
  |  Branch (2079:8): [True: 0, False: 7.83k]
  |  Branch (2079:16): [True: 0, False: 7.83k]
  |  Branch (2079:24): [True: 0, False: 7.83k]
  ------------------
 2080|      0|        return UA_STATUSCODE_BADARGUMENTSMISSING;
  ------------------
  |  |  449|      0|#define UA_STATUSCODE_BADARGUMENTSMISSING ((UA_StatusCode) 0x80760000)
  ------------------
 2081|  7.83k|    if(src->length > UINT_MAX)
  ------------------
  |  Branch (2081:8): [True: 0, False: 7.83k]
  ------------------
 2082|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2083|       |
 2084|       |    /* Tokenize. Add a fake wrapper element if options->unwrapped is enabled. */
 2085|  7.83k|    unsigned tokensSize = 63;
 2086|  7.83k|    xml_token tokenbuf[64];
 2087|  7.83k|    xml_token *tokens = tokenbuf;
 2088|       |
 2089|  7.83k|    xml_result res = xml_tokenize((char*)src->data, (unsigned)src->length,
 2090|  7.83k|                                  tokens + 1, tokensSize);
 2091|  7.83k|    if(res.error == XML_ERROR_OVERFLOW) {
  ------------------
  |  Branch (2091:8): [True: 462, False: 7.37k]
  ------------------
 2092|    462|        if(res.num_tokens == UINT_MAX)
  ------------------
  |  Branch (2092:12): [True: 0, False: 462]
  ------------------
 2093|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2094|    462|        size_t requiredTokens = (size_t)res.num_tokens + 1;
 2095|    462|        if(requiredTokens > SIZE_MAX / sizeof(xml_token))
  ------------------
  |  Branch (2095:12): [True: 0, False: 462]
  ------------------
 2096|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2097|    462|        tokens = (xml_token*)UA_malloc(sizeof(xml_token) * requiredTokens);
  ------------------
  |  |   18|    462|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 2098|    462|        if(!tokens)
  ------------------
  |  Branch (2098:12): [True: 0, False: 462]
  ------------------
 2099|      0|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 2100|    462|        res = xml_tokenize((char*)src->data, (unsigned)src->length,
 2101|    462|                           tokens + 1, res.num_tokens);
 2102|    462|    }
 2103|       |
 2104|  7.83k|    if(res.error != XML_ERROR_NONE || res.num_tokens == 0) {
  ------------------
  |  Branch (2104:8): [True: 3.18k, False: 4.65k]
  |  Branch (2104:39): [True: 0, False: 4.65k]
  ------------------
 2105|  3.18k|        if(tokens != tokenbuf)
  ------------------
  |  Branch (2105:12): [True: 0, False: 3.18k]
  ------------------
 2106|      0|            UA_free(tokens);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2107|  3.18k|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|  3.18k|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 2108|  3.18k|    }
 2109|       |
 2110|       |    /* Set up the context */
 2111|  4.65k|    ParseCtxXml ctx;
 2112|  4.65k|    memset(&ctx, 0, sizeof(ParseCtxXml));
 2113|  4.65k|    ctx.xml = (const char*)src->data;
 2114|  4.65k|    ctx.tokens = tokens;
 2115|  4.65k|    ctx.tokensSize = res.num_tokens;
 2116|  4.65k|    if(options) {
  ------------------
  |  Branch (2116:8): [True: 76, False: 4.57k]
  ------------------
 2117|     76|        ctx.customTypes = options->customTypes;
 2118|     76|        ctx.namespaceMapping = options->namespaceMapping;
 2119|     76|        ctx.serverUris = options->serverUris;
 2120|     76|        ctx.serverUrisSize = options->serverUrisSize;
 2121|     76|    }
 2122|       |
 2123|  4.65k|    if(options && options->unwrapped) {
  ------------------
  |  Branch (2123:8): [True: 76, False: 4.57k]
  |  Branch (2123:19): [True: 0, False: 76]
  ------------------
 2124|       |        /* Set up the fake wrapper element */
 2125|      0|        xml_token *tok = tokens;
 2126|      0|        memset(tok, 0, sizeof(xml_token));
 2127|      0|        tok->type = XML_TOKEN_ELEMENT;
 2128|      0|        tok->name = UA_STRING((char*)(uintptr_t)type->typeName);
 2129|      0|        tok->children = 1;
 2130|      0|        tok->start = 0;
 2131|      0|        tok->end = (unsigned)src->length;
 2132|      0|        ctx.tokensSize++;
 2133|  4.65k|    } else {
 2134|  4.65k|        ctx.tokens++; /* Skip the first token */
 2135|  4.65k|    }
 2136|       |
 2137|       |    /* Decode */
 2138|  4.65k|    memset(dst, 0, type->memSize); /* Initialize the value */
 2139|  4.65k|    UA_StatusCode ret = decodeXmlJumpTable[type->typeKind](&ctx, dst, type);
 2140|  4.65k|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|  4.65k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (2140:8): [True: 1.39k, False: 3.26k]
  ------------------
 2141|  1.39k|        UA_clear(dst, type);
 2142|       |
 2143|       |    /* Clean up */
 2144|  4.65k|    if(tokens != tokenbuf)
  ------------------
  |  Branch (2144:8): [True: 462, False: 4.19k]
  ------------------
 2145|    462|        UA_free(tokens);
  ------------------
  |  |   19|    462|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 2146|  4.65k|    return ret;
 2147|  7.83k|}
ua_types_encoding_xml.c:backtrackName:
   28|  13.9M|backtrackName(const char *xml, unsigned end) {
   29|  13.9M|    unsigned pos = end;
   30|  54.1M|    for(; pos > 0; pos--) {
  ------------------
  |  Branch (30:11): [True: 54.1M, False: 0]
  ------------------
   31|  54.1M|        unsigned char c = (unsigned char)xml[pos-1];
   32|  54.1M|        if(c >= 'a' && c <= 'z') continue; /* isAlpha */
  ------------------
  |  Branch (32:12): [True: 39.7M, False: 14.3M]
  |  Branch (32:24): [True: 10.2M, False: 29.5M]
  ------------------
   33|  43.8M|        if(c >= 'A' && c <= 'Z') continue; /* isAlpha */
  ------------------
  |  Branch (33:12): [True: 29.8M, False: 14.0M]
  |  Branch (33:24): [True: 343k, False: 29.5M]
  ------------------
   34|  43.5M|        if(c >= '0' && c <= '9') continue; /* isNum */
  ------------------
  |  Branch (34:12): [True: 42.5M, False: 994k]
  |  Branch (34:24): [True: 50.7k, False: 42.4M]
  ------------------
   35|  43.4M|        if(c == '_' || c >= 128 || c == '-'|| c == '.') continue;
  ------------------
  |  Branch (35:12): [True: 4.13k, False: 43.4M]
  |  Branch (35:24): [True: 29.5M, False: 13.9M]
  |  Branch (35:36): [True: 15.9k, False: 13.9M]
  |  Branch (35:47): [True: 2.04k, False: 13.9M]
  ------------------
   36|  13.9M|        break;
   37|  43.4M|    }
   38|  13.9M|    UA_String s = {end - pos, (UA_Byte*)(uintptr_t)xml + pos};
   39|  13.9M|    return s;
   40|  13.9M|}
ua_types_encoding_xml.c:Boolean_encodeXml:
  346|      6|ENCODE_XML(Boolean) {
  347|      6|    const UA_Boolean *src = (const UA_Boolean*)src_;
  348|      6|    if(*src == true)
  ------------------
  |  Branch (348:8): [True: 3, False: 3]
  ------------------
  349|      3|        return xmlEncodeWriteChars(ctx, "true", 4);
  350|      3|    return xmlEncodeWriteChars(ctx, "false", 5);
  351|      6|}
ua_types_encoding_xml.c:xmlEncodeWriteChars:
  267|  6.27M|xmlEncodeWriteChars(CtxXml *ctx, const char *c, size_t len) {
  268|  6.27M|    if(ctx->calcOnly) {
  ------------------
  |  Branch (268:8): [True: 2.09M, False: 4.18M]
  ------------------
  269|  2.09M|        uintptr_t pos = (uintptr_t)ctx->pos;
  270|  2.09M|        if(len > UINTPTR_MAX - pos)
  ------------------
  |  Branch (270:12): [True: 0, False: 2.09M]
  ------------------
  271|      0|            return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  272|  2.09M|        ctx->pos = (uint8_t*)(pos + len);
  273|  2.09M|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  2.09M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  274|  2.09M|    }
  275|  4.18M|    if(len > (size_t)(ctx->end - ctx->pos))
  ------------------
  |  Branch (275:8): [True: 0, False: 4.18M]
  ------------------
  276|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  277|  4.18M|    if(len)
  ------------------
  |  Branch (277:8): [True: 3.19M, False: 990k]
  ------------------
  278|  3.19M|        memcpy(ctx->pos, c, len);
  279|  4.18M|    ctx->pos += len;
  280|  4.18M|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.18M|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  281|  4.18M|}
ua_types_encoding_xml.c:SByte_encodeXml:
  364|     63|ENCODE_XML(SByte) {
  365|     63|    const UA_SByte *src = (const UA_SByte*)src_;
  366|     63|    char buf[5];
  367|     63|    return encodeSigned(ctx, *src, buf);
  368|     63|}
ua_types_encoding_xml.c:encodeSigned:
  353|  1.15k|static status encodeSigned(CtxXml *ctx, UA_Int64 value, char* buffer) {
  354|  1.15k|    UA_UInt16 digits = itoaSigned(value, buffer);
  355|  1.15k|    return xmlEncodeWriteChars(ctx, buffer, digits);
  356|  1.15k|}
ua_types_encoding_xml.c:Byte_encodeXml:
  371|     45|ENCODE_XML(Byte) {
  372|     45|    const UA_Byte *src = (const UA_Byte*)src_;
  373|     45|    char buf[4];
  374|     45|    return encodeUnsigned(ctx, *src, buf);
  375|     45|}
ua_types_encoding_xml.c:encodeUnsigned:
  358|    333|static status encodeUnsigned(CtxXml *ctx, UA_UInt64 value, char* buffer) {
  359|    333|    UA_UInt16 digits = itoaUnsigned(value, buffer, 10);
  360|    333|    return xmlEncodeWriteChars(ctx, buffer, digits);
  361|    333|}
ua_types_encoding_xml.c:Int16_encodeXml:
  378|    162|ENCODE_XML(Int16) {
  379|    162|    const UA_Int16 *src = (const UA_Int16*)src_;
  380|    162|    char buf[7];
  381|    162|    return encodeSigned(ctx, *src, buf);
  382|    162|}
ua_types_encoding_xml.c:UInt16_encodeXml:
  385|     57|ENCODE_XML(UInt16) {
  386|     57|    const UA_UInt16 *src = (const UA_UInt16*)src_;
  387|     57|    char buf[6];
  388|     57|    return encodeUnsigned(ctx, *src, buf);
  389|     57|}
ua_types_encoding_xml.c:Int32_encodeXml:
  392|    285|ENCODE_XML(Int32) {
  393|    285|    const UA_Int32 *src = (const UA_Int32*)src_;
  394|    285|    char buf[12];
  395|    285|    return encodeSigned(ctx, *src, buf);
  396|    285|}
ua_types_encoding_xml.c:UInt32_encodeXml:
  417|    174|ENCODE_XML(UInt32) {
  418|    174|    const UA_UInt32 *src = (const UA_UInt32*)src_;
  419|    174|    char buf[11];
  420|    174|    return encodeUnsigned(ctx, *src, buf);
  421|    174|}
ua_types_encoding_xml.c:Int64_encodeXml:
  424|    645|ENCODE_XML(Int64) {
  425|    645|    const UA_Int64 *src = (const UA_Int64*)src_;
  426|    645|    char buf[23];
  427|    645|    return encodeSigned(ctx, *src, buf);
  428|    645|}
ua_types_encoding_xml.c:UInt64_encodeXml:
  431|     57|ENCODE_XML(UInt64) {
  432|     57|    const UA_UInt64 *src = (const UA_UInt64*)src_;
  433|     57|    char buf[23];
  434|     57|    return encodeUnsigned(ctx, *src, buf);
  435|     57|}
ua_types_encoding_xml.c:Double_encodeXml:
  454|  1.67k|ENCODE_XML(Double) {
  455|  1.67k|    const UA_Double *src = (const UA_Double*)src_;
  456|  1.67k|    char buffer[32];
  457|  1.67k|    size_t len;
  458|  1.67k|    if(*src != *src)
  ------------------
  |  Branch (458:8): [True: 9, False: 1.66k]
  ------------------
  459|      9|        return xmlEncodeWriteChars(ctx, "NaN", 3);
  460|  1.66k|    if(*src == INFINITY)
  ------------------
  |  Branch (460:8): [True: 9, False: 1.65k]
  ------------------
  461|      9|        return xmlEncodeWriteChars(ctx, "INF", 3);
  462|  1.65k|    if(*src == -INFINITY)
  ------------------
  |  Branch (462:8): [True: 6, False: 1.65k]
  ------------------
  463|      6|        return xmlEncodeWriteChars(ctx, "-INF", 4);
  464|       |
  465|  1.65k|    len = dtoa(*src, buffer);
  466|  1.65k|    return xmlEncodeWriteChars(ctx, buffer, len);
  467|  1.65k|}
ua_types_encoding_xml.c:String_encodeXml:
  470|    963|ENCODE_XML(String) {
  471|    963|    const UA_String *src = (const UA_String*)src_;
  472|    963|    return xmlEncodeWriteEscapedChars(ctx, (const char*)src->data, src->length);
  473|    963|}
ua_types_encoding_xml.c:xmlEncodeWriteEscapedChars:
  288|    963|xmlEncodeWriteEscapedChars(CtxXml *ctx, const char *c, size_t len) {
  289|    963|    if(len == 0)
  ------------------
  |  Branch (289:8): [True: 21, False: 942]
  ------------------
  290|     21|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     21|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  291|    942|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    942|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  292|    942|    size_t start = 0;
  293|  34.6M|    for(size_t i = 0; i < len; i++) {
  ------------------
  |  Branch (293:23): [True: 34.6M, False: 942]
  ------------------
  294|  34.6M|        const char *entity;
  295|  34.6M|        size_t entityLen;
  296|  34.6M|        switch(c[i]) {
  297|     24|        case '&':  entity = "&amp;";  entityLen = 5; break;
  ------------------
  |  Branch (297:9): [True: 24, False: 34.6M]
  ------------------
  298|     75|        case '<':  entity = "&lt;";   entityLen = 4; break;
  ------------------
  |  Branch (298:9): [True: 75, False: 34.6M]
  ------------------
  299|  81.5k|        case '>':  entity = "&gt;";   entityLen = 4; break;
  ------------------
  |  Branch (299:9): [True: 81.5k, False: 34.5M]
  ------------------
  300|  2.49M|        case '"':  entity = "&quot;"; entityLen = 6; break;
  ------------------
  |  Branch (300:9): [True: 2.49M, False: 32.1M]
  ------------------
  301|   512k|        case '\'': entity = "&apos;"; entityLen = 6; break;
  ------------------
  |  Branch (301:9): [True: 512k, False: 34.1M]
  ------------------
  302|  31.5M|        default: continue;
  ------------------
  |  Branch (302:9): [True: 31.5M, False: 3.08M]
  ------------------
  303|  34.6M|        }
  304|  3.08M|        ret |= xmlEncodeWriteChars(ctx, &c[start], i - start);
  305|  3.08M|        ret |= xmlEncodeWriteChars(ctx, entity, entityLen);
  306|  3.08M|        start = i + 1;
  307|  3.08M|    }
  308|    942|    return ret | xmlEncodeWriteChars(ctx, &c[start], len - start);
  309|    942|}
ua_types_encoding_xml.c:ByteString_encodeXml:
  501|     81|ENCODE_XML(ByteString) {
  502|     81|    const UA_ByteString *src = (const UA_ByteString*)src_;
  503|     81|    if(!src->data)
  ------------------
  |  Branch (503:8): [True: 0, False: 81]
  ------------------
  504|      0|        return xmlEncodeWriteChars(ctx, "null", 4);
  505|       |
  506|     81|    if(src->length == 0)
  ------------------
  |  Branch (506:8): [True: 81, False: 0]
  ------------------
  507|     81|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     81|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  508|       |
  509|      0|    size_t flen = 0;
  510|      0|    unsigned char *ba64 = UA_base64(src->data, src->length, &flen);
  511|       |
  512|       |    /* Not converted, no mem */
  513|      0|    if(!ba64)
  ------------------
  |  Branch (513:8): [True: 0, False: 0]
  ------------------
  514|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  515|       |
  516|      0|    if(ctx->pos + flen > ctx->end) {
  ------------------
  |  Branch (516:8): [True: 0, False: 0]
  ------------------
  517|      0|        UA_free(ba64);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  518|      0|        return UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED;
  ------------------
  |  |   47|      0|#define UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED ((UA_StatusCode) 0x80080000)
  ------------------
  519|      0|    }
  520|       |
  521|       |    /* Copy flen bytes to output stream. */
  522|      0|    if(!ctx->calcOnly)
  ------------------
  |  Branch (522:8): [True: 0, False: 0]
  ------------------
  523|      0|        memcpy(ctx->pos, ba64, flen);
  524|      0|    ctx->pos += flen;
  525|       |
  526|       |    /* Base64 result no longer needed */
  527|      0|    UA_free(ba64);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
  528|       |
  529|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  530|      0|}
ua_types_encoding_xml.c:XmlElement_encodeXml:
  476|    462|ENCODE_XML(XmlElement) {
  477|    462|    const UA_XmlElement *src = (const UA_XmlElement*)src_;
  478|    462|    return xmlEncodeWriteChars(ctx, (const char*)src->data, src->length);
  479|    462|}
ua_types_encoding_xml.c:NodeId_encodeXml:
  533|    228|ENCODE_XML(NodeId) {
  534|    228|    const UA_NodeId *src = (const UA_NodeId*)src_;
  535|    228|    UA_StatusCode ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    228|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  536|    228|    UA_String out = UA_STRING_NULL;
  537|    228|    ret |= UA_NodeId_printEx(src, &out, ctx->namespaceMapping);
  538|    228|    ret |= writeXmlElement(ctx, UA_XML_NODEID_IDENTIFIER,
  ------------------
  |  |  244|    228|#define UA_XML_NODEID_IDENTIFIER "Identifier"
  ------------------
  539|    228|                           &out, &UA_TYPES[UA_TYPES_STRING]);
  ------------------
  |  |  402|    228|#define UA_TYPES_STRING 11
  ------------------
  540|    228|    UA_String_clear(&out);
  541|    228|    return ret;
  542|    228|}
ua_types_encoding_xml.c:LocalizedText_encodeXml:
  587|      3|ENCODE_XML(LocalizedText) {
  588|      3|    const UA_LocalizedText *src = (const UA_LocalizedText*)src_;
  589|       |    /* Same rule as in encodeXmlStructure: an absent (NULL) String is skipped
  590|       |     * so it does not come back as an empty String on decoding. An
  591|       |     * empty-but-present String is still written. */
  592|      3|    UA_StatusCode ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      3|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  593|      3|    if(src->locale.data)
  ------------------
  |  Branch (593:8): [True: 0, False: 3]
  ------------------
  594|      0|        ret |= writeXmlElement(ctx, UA_XML_LOCALIZEDTEXT_LOCALE,
  ------------------
  |  |  249|      0|#define UA_XML_LOCALIZEDTEXT_LOCALE "Locale"
  ------------------
  595|      0|                               &src->locale, &UA_TYPES[UA_TYPES_STRING]);
  ------------------
  |  |  402|      0|#define UA_TYPES_STRING 11
  ------------------
  596|      3|    if(src->text.data)
  ------------------
  |  Branch (596:8): [True: 0, False: 3]
  ------------------
  597|      0|        ret |= writeXmlElement(ctx, UA_XML_LOCALIZEDTEXT_TEXT,
  ------------------
  |  |  250|      0|#define UA_XML_LOCALIZEDTEXT_TEXT "Text"
  ------------------
  598|      0|                               &src->text, &UA_TYPES[UA_TYPES_STRING]);
  ------------------
  |  |  402|      0|#define UA_TYPES_STRING 11
  ------------------
  599|      3|    return ret;
  600|      3|}
ua_types_encoding_xml.c:ExtensionObject_encodeXml:
  603|    231|ENCODE_XML(ExtensionObject) {
  604|    231|    const UA_ExtensionObject *src = (const UA_ExtensionObject*)src_;
  605|    231|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_NOBODY)
  ------------------
  |  Branch (605:8): [True: 3, False: 228]
  ------------------
  606|      3|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      3|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  607|    228|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_JSON)
  ------------------
  |  Branch (607:8): [True: 0, False: 228]
  ------------------
  608|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  609|       |
  610|       |    /* The body of the ExtensionObject contains a single element
  611|       |     * which is either a ByteString or XML encoded Structure:
  612|       |     * https://reference.opcfoundation.org/Core/Part6/v104/docs/5.3.1.16. */
  613|    228|    UA_StatusCode ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    228|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  614|    228|    if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_BYTESTRING ||
  ------------------
  |  Branch (614:8): [True: 0, False: 228]
  ------------------
  615|    228|       src->encoding == UA_EXTENSIONOBJECT_ENCODED_XML) {
  ------------------
  |  Branch (615:8): [True: 0, False: 228]
  ------------------
  616|       |        /* Write the type NodeId */
  617|      0|        ret = writeXmlElement(ctx, UA_XML_EXTENSIONOBJECT_TYPEID,
  ------------------
  |  |  251|      0|#define UA_XML_EXTENSIONOBJECT_TYPEID "TypeId"
  ------------------
  618|      0|                              &src->content.encoded.typeId,
  619|      0|                              &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  572|      0|#define UA_TYPES_NODEID 16
  ------------------
  620|       |
  621|       |        /* Write the body */
  622|      0|        ret |= writeXmlElemNameBegin(ctx, UA_XML_EXTENSIONOBJECT_BODY);
  ------------------
  |  |  252|      0|#define UA_XML_EXTENSIONOBJECT_BODY "Body"
  ------------------
  623|      0|        if(src->encoding == UA_EXTENSIONOBJECT_ENCODED_BYTESTRING)
  ------------------
  |  Branch (623:12): [True: 0, False: 0]
  ------------------
  624|      0|           ret |= writeXmlElement(ctx, "ByteString", &src->content.encoded.body,
  625|      0|                                  &UA_TYPES[UA_TYPES_BYTESTRING]);
  ------------------
  |  |  504|      0|#define UA_TYPES_BYTESTRING 14
  ------------------
  626|      0|        else
  627|       |            /* An XML encoded body is markup already, it goes out as it is */
  628|      0|            ret |= ENCODE_DIRECT_XML(&src->content.encoded.body, XmlElement);
  ------------------
  |  |  264|      0|    TYPE##_encodeXml(ctx, (const UA_##TYPE*)SRC, NULL)
  ------------------
  629|      0|        ret |= writeXmlElemNameEnd(ctx, UA_XML_EXTENSIONOBJECT_BODY);
  ------------------
  |  |  252|      0|#define UA_XML_EXTENSIONOBJECT_BODY "Body"
  ------------------
  630|    228|    } else {
  631|       |        /* Write the decoded value */
  632|    228|        const UA_DataType *decoded_type = src->content.decoded.type;
  633|       |
  634|       |        /* Write the type NodeId */
  635|    228|        ret = writeXmlElement(ctx, UA_XML_EXTENSIONOBJECT_TYPEID,
  ------------------
  |  |  251|    228|#define UA_XML_EXTENSIONOBJECT_TYPEID "TypeId"
  ------------------
  636|    228|                              &decoded_type->typeId, &UA_TYPES[UA_TYPES_NODEID]);
  ------------------
  |  |  572|    228|#define UA_TYPES_NODEID 16
  ------------------
  637|       |
  638|       |        /* Write the body */
  639|    228|        ret |= writeXmlElemNameBegin(ctx, UA_XML_EXTENSIONOBJECT_BODY);
  ------------------
  |  |  252|    228|#define UA_XML_EXTENSIONOBJECT_BODY "Body"
  ------------------
  640|    228|        ret |= writeXmlElement(ctx, decoded_type->typeName, src->content.decoded.data, decoded_type);
  641|    228|        ret |= writeXmlElemNameEnd(ctx, UA_XML_EXTENSIONOBJECT_BODY);
  ------------------
  |  |  252|    228|#define UA_XML_EXTENSIONOBJECT_BODY "Body"
  ------------------
  642|    228|    }
  643|       |
  644|    228|    return ret;
  645|    228|}
ua_types_encoding_xml.c:writeXmlElemNameBegin:
  312|  15.0k|writeXmlElemNameBegin(CtxXml *ctx, const char* name) {
  313|  15.0k|    if(ctx->depth >= UA_XML_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   15|  15.0k|#define UA_XML_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (313:8): [True: 0, False: 15.0k]
  ------------------
  314|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  315|  15.0k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  15.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  316|  15.0k|    ret |= xmlEncodeWriteChars(ctx, "<", 1);
  317|  15.0k|    ret |= xmlEncodeWriteChars(ctx, name, strlen(name));
  318|  15.0k|    ret |= xmlEncodeWriteChars(ctx, ">", 1);
  319|  15.0k|    ctx->depth++;
  320|  15.0k|    return ret;
  321|  15.0k|}
ua_types_encoding_xml.c:writeXmlElemNameEnd:
  324|  15.0k|writeXmlElemNameEnd(CtxXml *ctx, const char* name) {
  325|  15.0k|    if(ctx->depth == 0)
  ------------------
  |  Branch (325:8): [True: 0, False: 15.0k]
  ------------------
  326|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  327|  15.0k|    ctx->depth--;
  328|  15.0k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  15.0k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  329|  15.0k|    ret |= xmlEncodeWriteChars(ctx, "</", 2);
  330|  15.0k|    ret |= xmlEncodeWriteChars(ctx, name, strlen(name));
  331|  15.0k|    ret |= xmlEncodeWriteChars(ctx, ">", 1);
  332|  15.0k|    return ret;
  333|  15.0k|}
ua_types_encoding_xml.c:DataValue_encodeXml:
  767|      3|ENCODE_XML(DataValue) {
  768|      3|    const UA_DataValue *src = (const UA_DataValue*)src_;
  769|      3|    UA_StatusCode ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      3|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  770|      3|    if(src->hasValue)
  ------------------
  |  Branch (770:8): [True: 0, False: 3]
  ------------------
  771|      0|        ret |= Variant_encodeXml(ctx, &src->value, &UA_TYPES[UA_TYPES_VARIANT]);
  ------------------
  |  |  810|      0|#define UA_TYPES_VARIANT 23
  ------------------
  772|      3|    if(src->hasStatus)
  ------------------
  |  Branch (772:8): [True: 0, False: 3]
  ------------------
  773|      0|        ret |= writeXmlElement(ctx, "StatusCode", &src->status,
  774|      0|                               &UA_TYPES[UA_TYPES_STATUSCODE]);
  ------------------
  |  |  640|      0|#define UA_TYPES_STATUSCODE 18
  ------------------
  775|      3|    if(src->hasSourceTimestamp)
  ------------------
  |  Branch (775:8): [True: 0, False: 3]
  ------------------
  776|      0|        ret |= writeXmlElement(ctx, "SourceTimestamp", &src->sourceTimestamp,
  777|      0|                               &UA_TYPES[UA_TYPES_DATETIME]);
  ------------------
  |  |  436|      0|#define UA_TYPES_DATETIME 12
  ------------------
  778|      3|    if(src->hasSourcePicoseconds)
  ------------------
  |  Branch (778:8): [True: 0, False: 3]
  ------------------
  779|      0|        ret |= writeXmlElement(ctx, "SourcePicoseconds", &src->sourcePicoseconds,
  780|      0|                               &UA_TYPES[UA_TYPES_UINT16]);
  ------------------
  |  |  164|      0|#define UA_TYPES_UINT16 4
  ------------------
  781|      3|    if(src->hasServerTimestamp)
  ------------------
  |  Branch (781:8): [True: 0, False: 3]
  ------------------
  782|      0|        ret |= writeXmlElement(ctx, "ServerTimestamp", &src->serverTimestamp,
  783|      0|                               &UA_TYPES[UA_TYPES_DATETIME]);
  ------------------
  |  |  436|      0|#define UA_TYPES_DATETIME 12
  ------------------
  784|      3|    if(src->hasServerPicoseconds)
  ------------------
  |  Branch (784:8): [True: 0, False: 3]
  ------------------
  785|      0|        ret |= writeXmlElement(ctx, "ServerPicoseconds", &src->serverPicoseconds,
  786|      0|                               &UA_TYPES[UA_TYPES_UINT16]);
  ------------------
  |  |  164|      0|#define UA_TYPES_UINT16 4
  ------------------
  787|      3|    return ret;
  788|      3|}
ua_types_encoding_xml.c:Variant_encodeXml:
  734|  4.75k|ENCODE_XML(Variant) {
  735|  4.75k|    const UA_Variant *src = (const UA_Variant*)src_;
  736|  4.75k|    if(!src->type)
  ------------------
  |  Branch (736:8): [True: 50, False: 4.70k]
  ------------------
  737|     50|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|     50|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  738|       |
  739|       |    /* Set the array type in the encoding mask */
  740|  4.70k|    const bool isArray = src->arrayLength > 0 || src->data <= UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|  9.40k|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
  |  Branch (740:26): [True: 0, False: 4.70k]
  |  Branch (740:50): [True: 15, False: 4.68k]
  ------------------
  741|       |
  742|  4.70k|    if(src->arrayDimensionsSize > 1)
  ------------------
  |  Branch (742:8): [True: 0, False: 4.70k]
  ------------------
  743|      0|        return UA_STATUSCODE_BADNOTIMPLEMENTED;
  ------------------
  |  |  239|      0|#define UA_STATUSCODE_BADNOTIMPLEMENTED ((UA_StatusCode) 0x80400000)
  ------------------
  744|       |
  745|  4.70k|    UA_StatusCode ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.70k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  746|  4.70k|    ret |= writeXmlElemNameBegin(ctx, UA_XML_VARIANT_VALUE);
  ------------------
  |  |  254|  4.70k|#define UA_XML_VARIANT_VALUE "Value"
  ------------------
  747|  4.70k|    if(!isArray) {
  ------------------
  |  Branch (747:8): [True: 4.68k, False: 15]
  ------------------
  748|  4.68k|        const UA_DataType *srctype = src->type;
  749|  4.68k|        void *ptr = src->data;
  750|  4.68k|        UA_ExtensionObject eo;
  751|  4.68k|        if(srctype->typeKind == UA_DATATYPEKIND_ENUM) {
  ------------------
  |  Branch (751:12): [True: 0, False: 4.68k]
  ------------------
  752|      0|            srctype = &UA_TYPES[UA_TYPES_INT32];
  ------------------
  |  |  198|      0|#define UA_TYPES_INT32 5
  ------------------
  753|  4.68k|        } else if(srctype->typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO) {
  ------------------
  |  Branch (753:19): [True: 228, False: 4.45k]
  ------------------
  754|       |            /* Wrap value in an ExtensionObject */
  755|    228|            UA_ExtensionObject_setValue(&eo, (void*)(uintptr_t)ptr, srctype);
  756|    228|            ptr = &eo;
  757|    228|            srctype = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  742|    228|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  758|    228|        }
  759|  4.68k|        ret |= writeXmlElement(ctx, srctype->typeName, ptr, srctype);
  760|  4.68k|    } else {
  761|     15|        ret |= Array_encodeXml(ctx, src->data, src->arrayLength, src->type);
  762|     15|    }
  763|  4.70k|    ret |= writeXmlElemNameEnd(ctx, UA_XML_VARIANT_VALUE);
  ------------------
  |  |  254|  4.70k|#define UA_XML_VARIANT_VALUE "Value"
  ------------------
  764|  4.70k|    return ret;
  765|  4.70k|}
ua_types_encoding_xml.c:Array_encodeXml:
  649|     15|                const UA_DataType *type) {
  650|     15|    char arrName[128];
  651|     15|    UA_ExtensionObject eo;
  652|       |
  653|     15|    if(type->typeKind == UA_DATATYPEKIND_ENUM)
  ------------------
  |  Branch (653:8): [True: 0, False: 15]
  ------------------
  654|      0|        type = &UA_TYPES[UA_TYPES_INT32];
  ------------------
  |  |  198|      0|#define UA_TYPES_INT32 5
  ------------------
  655|     15|    UA_Boolean wrapEO = (type->typeKind > UA_DATATYPEKIND_DIAGNOSTICINFO);
  656|     15|    if(wrapEO) {
  ------------------
  |  Branch (656:8): [True: 0, False: 15]
  ------------------
  657|      0|        UA_ExtensionObject_setValue(&eo, (void*)(uintptr_t)ptr, type);
  658|      0|        type = &UA_TYPES[UA_TYPES_EXTENSIONOBJECT];
  ------------------
  |  |  742|      0|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  659|      0|    }
  660|       |
  661|     15|    size_t arrNameLen = strlen("ListOf") + strlen(type->typeName);
  662|     15|    if(arrNameLen >= 128)
  ------------------
  |  Branch (662:8): [True: 0, False: 15]
  ------------------
  663|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  664|     15|    memcpy(arrName, "ListOf", strlen("ListOf"));
  665|     15|    memcpy(arrName + strlen("ListOf"), type->typeName, strlen(type->typeName));
  666|     15|    arrName[arrNameLen] = '\0';
  667|       |
  668|     15|    uintptr_t uptr = (uintptr_t)ptr;
  669|     15|    status ret = writeXmlElemNameBegin(ctx, arrName);
  670|     15|    for(size_t i = 0; i < length && ret == UA_STATUSCODE_GOOD; ++i) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (670:23): [True: 0, False: 15]
  |  Branch (670:37): [True: 0, False: 0]
  ------------------
  671|      0|        if(!wrapEO) {
  ------------------
  |  Branch (671:12): [True: 0, False: 0]
  ------------------
  672|      0|            ret |= writeXmlElement(ctx, type->typeName, (const void*)uptr, type);
  673|      0|        } else {
  674|      0|            eo.content.decoded.data = (void*)uptr;
  675|      0|            ret |= writeXmlElement(ctx, type->typeName, &eo, type);
  676|      0|        }
  677|      0|        uptr += type->memSize;
  678|      0|    }
  679|     15|    ret |= writeXmlElemNameEnd(ctx, arrName);
  680|     15|    return ret;
  681|     15|}
ua_types_encoding_xml.c:DiagnosticInfo_encodeXml:
  790|      3|ENCODE_XML(DiagnosticInfo) {
  791|      3|    const UA_DiagnosticInfo *src = (const UA_DiagnosticInfo*)src_;
  792|      3|    UA_StatusCode ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      3|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  793|      3|    if(src->hasSymbolicId)
  ------------------
  |  Branch (793:8): [True: 0, False: 3]
  ------------------
  794|      0|        ret |= writeXmlElement(ctx, "SymbolicId", &src->symbolicId,
  795|      0|                               &UA_TYPES[UA_TYPES_INT32]);
  ------------------
  |  |  198|      0|#define UA_TYPES_INT32 5
  ------------------
  796|      3|    if(src->hasNamespaceUri)
  ------------------
  |  Branch (796:8): [True: 0, False: 3]
  ------------------
  797|      0|        ret |= writeXmlElement(ctx, "NamespaceUri", &src->namespaceUri,
  798|      0|                               &UA_TYPES[UA_TYPES_INT32]);
  ------------------
  |  |  198|      0|#define UA_TYPES_INT32 5
  ------------------
  799|      3|    if(src->hasLocalizedText)
  ------------------
  |  Branch (799:8): [True: 0, False: 3]
  ------------------
  800|      0|        ret |= writeXmlElement(ctx, "LocalizedText", &src->localizedText,
  801|      0|                               &UA_TYPES[UA_TYPES_INT32]);
  ------------------
  |  |  198|      0|#define UA_TYPES_INT32 5
  ------------------
  802|      3|    if(src->hasLocale)
  ------------------
  |  Branch (802:8): [True: 0, False: 3]
  ------------------
  803|      0|        ret |= writeXmlElement(ctx, "Locale", &src->locale,
  804|      0|                               &UA_TYPES[UA_TYPES_INT32]);
  ------------------
  |  |  198|      0|#define UA_TYPES_INT32 5
  ------------------
  805|      3|    if(src->hasAdditionalInfo)
  ------------------
  |  Branch (805:8): [True: 0, False: 3]
  ------------------
  806|      0|        ret |= writeXmlElement(ctx, "AdditionalInfo", &src->additionalInfo,
  807|      0|                               &UA_TYPES[UA_TYPES_STRING]);
  ------------------
  |  |  402|      0|#define UA_TYPES_STRING 11
  ------------------
  808|      3|    if(src->hasInnerStatusCode)
  ------------------
  |  Branch (808:8): [True: 0, False: 3]
  ------------------
  809|      0|        ret |= writeXmlElement(ctx, "InnerStatusCode", &src->innerStatusCode,
  810|      0|                               &UA_TYPES[UA_TYPES_STATUSCODE]);
  ------------------
  |  |  640|      0|#define UA_TYPES_STATUSCODE 18
  ------------------
  811|      3|    if(src->hasInnerDiagnosticInfo) {
  ------------------
  |  Branch (811:8): [True: 0, False: 3]
  ------------------
  812|      0|        if(!src->innerDiagnosticInfo)
  ------------------
  |  Branch (812:12): [True: 0, False: 0]
  ------------------
  813|      0|            return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
  814|      0|        ret |= writeXmlElement(ctx, "InnerDiagnosticInfo", src->innerDiagnosticInfo,
  815|      0|                               &UA_TYPES[UA_TYPES_DIAGNOSTICINFO]);
  ------------------
  |  |  844|      0|#define UA_TYPES_DIAGNOSTICINFO 24
  ------------------
  816|      0|    }
  817|      3|    return ret;
  818|      3|}
ua_types_encoding_xml.c:encodeXmlStructure:
  691|    228|encodeXmlStructure(CtxXml *ctx, const void *src, const UA_DataType *type) {
  692|    228|    uintptr_t ptr = (uintptr_t)src;
  693|    228|    UA_StatusCode ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    228|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  694|  1.39k|    for(size_t i = 0; i < type->membersSize && ret == UA_STATUSCODE_GOOD; i++) {
  ------------------
  |  |   17|  1.16k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (694:23): [True: 1.16k, False: 228]
  |  Branch (694:48): [True: 1.16k, False: 0]
  ------------------
  695|  1.16k|        const UA_DataTypeMember *m = &type->members[i];
  696|  1.16k|        const UA_DataType *mt = m->memberType;
  697|  1.16k|        ptr += m->padding;
  698|       |
  699|  1.16k|        if(m->isArray) {
  ------------------
  |  Branch (699:12): [True: 201, False: 963]
  ------------------
  700|    201|            size_t length = *(const size_t*)ptr;
  701|    201|            ptr += sizeof(size_t);
  702|    201|            const void *data = *(void* const*)ptr;
  703|    201|            ptr += sizeof(void*);
  704|    201|            if(m->isOptional && !data)
  ------------------
  |  Branch (704:16): [True: 0, False: 201]
  |  Branch (704:33): [True: 0, False: 0]
  ------------------
  705|      0|                continue;
  706|    201|            if(!m->isOptional && length == 0 && !data)
  ------------------
  |  Branch (706:16): [True: 201, False: 0]
  |  Branch (706:34): [True: 201, False: 0]
  |  Branch (706:49): [True: 201, False: 0]
  ------------------
  707|    201|                continue;
  708|      0|            ret |= writeXmlElemNameBegin(ctx, m->memberName);
  709|      0|            uintptr_t elem = (uintptr_t)data;
  710|      0|            for(size_t j = 0; j < length && ret == UA_STATUSCODE_GOOD; j++) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (710:31): [True: 0, False: 0]
  |  Branch (710:45): [True: 0, False: 0]
  ------------------
  711|      0|                ret |= writeXmlElement(ctx, mt->typeName, (const void*)elem, mt);
  712|      0|                elem += mt->memSize;
  713|      0|            }
  714|      0|            ret |= writeXmlElemNameEnd(ctx, m->memberName);
  715|      0|            continue;
  716|    201|        }
  717|       |
  718|    963|        const void *value = (const void*)ptr;
  719|    963|        if(m->isOptional) {
  ------------------
  |  Branch (719:12): [True: 0, False: 963]
  ------------------
  720|      0|            value = *(void* const*)ptr;
  721|      0|            ptr += sizeof(void*);
  722|      0|            if(!value)
  ------------------
  |  Branch (722:16): [True: 0, False: 0]
  ------------------
  723|      0|                continue;
  724|    963|        } else {
  725|    963|            ptr += mt->memSize;
  726|    963|            if(isDefaultValue(value, mt))
  ------------------
  |  Branch (726:16): [True: 963, False: 0]
  ------------------
  727|    963|                continue;
  728|    963|        }
  729|      0|        ret |= writeXmlElement(ctx, m->memberName, value, mt);
  730|      0|    }
  731|    228|    return ret;
  732|    228|}
ua_types_encoding_xml.c:isDefaultValue:
  684|    963|isDefaultValue(const void *value, const UA_DataType *type) {
  685|    963|    UA_STACKARRAY(UA_Byte, defaultValue, type->memSize);
  ------------------
  |  |  375|    963|#  define UA_STACKARRAY(TYPE, NAME, SIZE) TYPE NAME[SIZE]
  ------------------
  686|    963|    memset(defaultValue, 0, type->memSize);
  687|    963|    return UA_equal(value, defaultValue, type);
  688|    963|}
ua_types_encoding_xml.c:writeXmlElement:
  337|  10.1k|                const void *value, const UA_DataType *type) {
  338|  10.1k|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  10.1k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  339|  10.1k|    ret |= writeXmlElemNameBegin(ctx, name);
  340|  10.1k|    ret |= encodeXmlJumpTable[type->typeKind](ctx, value, type);
  341|  10.1k|    ret |= writeXmlElemNameEnd(ctx, name);
  342|  10.1k|    return ret;
  343|  10.1k|}
ua_types_encoding_xml.c:Boolean_decodeXml:
  959|     66|DECODE_XML(Boolean) {
  960|     66|    UA_Boolean *dst = (UA_Boolean*)dst_;
  961|     66|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  941|     66|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (941:8): [True: 0, False: 66]
  |  |  ------------------
  |  |  942|     66|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  943|     66|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (943:18): [Folded, False: 66]
  |  |  ------------------
  ------------------
  962|     66|    GET_ELEM_CONTENT;
  ------------------
  |  |  946|     66|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  947|     66|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  948|     66|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (948:17): [Folded, False: 66]
  |  |  ------------------
  ------------------
  963|     66|    skipXmlObject(ctx);
  964|       |
  965|     66|    if(length == 4 &&
  ------------------
  |  Branch (965:8): [True: 7, False: 59]
  ------------------
  966|      7|       data[0] == 't' && data[1] == 'r' &&
  ------------------
  |  Branch (966:8): [True: 6, False: 1]
  |  Branch (966:26): [True: 4, False: 2]
  ------------------
  967|      4|       data[2] == 'u' && data[3] == 'e') {
  ------------------
  |  Branch (967:8): [True: 3, False: 1]
  |  Branch (967:26): [True: 2, False: 1]
  ------------------
  968|      2|        *dst = true;
  969|     64|    } else if(length == 5 &&
  ------------------
  |  Branch (969:15): [True: 11, False: 53]
  ------------------
  970|     11|              data[0] == 'f' && data[1] == 'a' &&
  ------------------
  |  Branch (970:15): [True: 7, False: 4]
  |  Branch (970:33): [True: 6, False: 1]
  ------------------
  971|      6|              data[2] == 'l' && data[3] == 's' &&
  ------------------
  |  Branch (971:15): [True: 5, False: 1]
  |  Branch (971:33): [True: 4, False: 1]
  ------------------
  972|      4|              data[4] == 'e') {
  ------------------
  |  Branch (972:15): [True: 2, False: 2]
  ------------------
  973|      2|        *dst = false;
  974|     62|    } else {
  975|     62|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     62|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  976|     62|    }
  977|       |
  978|      4|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      4|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  979|     66|}
ua_types_encoding_xml.c:skipXmlObject:
  951|  4.31k|skipXmlObject(ParseCtxXml *ctx) {
  952|  4.31k|    size_t end_parent = ctx->tokens[ctx->index].end;
  953|  5.98M|    while(ctx->index < ctx->tokensSize &&
  ------------------
  |  Branch (953:11): [True: 5.98M, False: 4.20k]
  ------------------
  954|  5.98M|          ctx->tokens[ctx->index].end <= end_parent) {
  ------------------
  |  Branch (954:11): [True: 5.98M, False: 102]
  ------------------
  955|  5.98M|        ctx->index++;
  956|  5.98M|    }
  957|  4.31k|}
ua_types_encoding_xml.c:SByte_decodeXml:
 1017|    204|DECODE_XML(SByte) {
 1018|    204|    UA_SByte *dst = (UA_SByte*)dst_;
 1019|    204|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  941|    204|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (941:8): [True: 0, False: 204]
  |  |  ------------------
  |  |  942|    204|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  943|    204|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (943:18): [Folded, False: 204]
  |  |  ------------------
  ------------------
 1020|    204|    GET_ELEM_CONTENT;
  ------------------
  |  |  946|    204|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  947|    204|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  948|    204|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (948:17): [Folded, False: 204]
  |  |  ------------------
  ------------------
 1021|    204|    skipXmlObject(ctx);
 1022|       |
 1023|    204|    UA_Int64 out = 0;
 1024|    204|    UA_StatusCode s = decodeSigned(data, length, &out);
 1025|    204|    if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   17|    408|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   64|    325|#define UA_SBYTE_MIN (-128)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_SBYTE_MIN || out > UA_SBYTE_MAX)
  ------------------
  |  |   65|    101|#define UA_SBYTE_MAX 127
  ------------------
  |  Branch (1025:8): [True: 83, False: 121]
  |  Branch (1025:35): [True: 20, False: 101]
  |  Branch (1025:57): [True: 59, False: 42]
  ------------------
 1026|    162|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    162|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1027|       |
 1028|     42|    *dst = (UA_SByte)out;
 1029|     42|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     42|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1030|    204|}
ua_types_encoding_xml.c:decodeSigned:
  982|  1.28k|decodeSigned(const UA_Byte *data, size_t dataSize, UA_Int64 *dst) {
  983|  1.28k|    if(!data || dataSize == 0)
  ------------------
  |  Branch (983:8): [True: 45, False: 1.24k]
  |  Branch (983:17): [True: 0, False: 1.24k]
  ------------------
  984|     45|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     45|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  985|  1.24k|    size_t len = parseInt64((const char*)data, dataSize, dst);
  986|  1.24k|    if(len == 0)
  ------------------
  |  Branch (986:8): [True: 143, False: 1.09k]
  ------------------
  987|    143|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    143|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  988|       |
  989|       |    /* There must only be whitespace between the end of the parsed number and
  990|       |     * the end of the XML section */
  991|  3.73k|    for(size_t i = len; i < dataSize; i++) {
  ------------------
  |  Branch (991:25): [True: 2.73k, False: 995]
  ------------------
  992|  2.73k|        if(data[i] != ' ' && data[i] - '\t' >= 5)
  ------------------
  |  Branch (992:12): [True: 1.77k, False: 963]
  |  Branch (992:30): [True: 104, False: 1.67k]
  ------------------
  993|    104|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    104|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  994|  2.73k|    }
  995|       |
  996|    995|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    995|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  997|  1.09k|}
ua_types_encoding_xml.c:Byte_decodeXml:
 1032|    176|DECODE_XML(Byte) {
 1033|    176|    UA_Byte *dst = (UA_Byte*)dst_;
 1034|    176|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  941|    176|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (941:8): [True: 0, False: 176]
  |  |  ------------------
  |  |  942|    176|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  943|    176|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (943:18): [Folded, False: 176]
  |  |  ------------------
  ------------------
 1035|    176|    GET_ELEM_CONTENT;
  ------------------
  |  |  946|    176|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  947|    176|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  948|    176|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (948:17): [Folded, False: 176]
  |  |  ------------------
  ------------------
 1036|    176|    skipXmlObject(ctx);
 1037|       |
 1038|    176|    UA_UInt64 out = 0;
 1039|    176|    UA_StatusCode s = decodeUnsigned(data, length, &out);
 1040|    176|    if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   17|    352|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_BYTE_MAX)
  ------------------
  |  |   74|    117|#define UA_BYTE_MAX 255
  ------------------
  |  Branch (1040:8): [True: 59, False: 117]
  |  Branch (1040:35): [True: 87, False: 30]
  ------------------
 1041|    146|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    146|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1042|       |
 1043|     30|    *dst = (UA_Byte)out;
 1044|     30|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     30|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1045|    176|}
ua_types_encoding_xml.c:decodeUnsigned:
 1000|    604|decodeUnsigned(const UA_Byte *data, size_t dataSize, UA_UInt64 *dst) {
 1001|    604|    if(!data || dataSize == 0)
  ------------------
  |  Branch (1001:8): [True: 29, False: 575]
  |  Branch (1001:17): [True: 0, False: 575]
  ------------------
 1002|     29|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     29|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1003|    575|    size_t len = parseUInt64((const char*)data, dataSize, dst);
 1004|    575|    if(len == 0)
  ------------------
  |  Branch (1004:8): [True: 68, False: 507]
  ------------------
 1005|     68|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     68|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1006|       |
 1007|       |    /* There must only be whitespace between the end of the parsed number and
 1008|       |     * the end of the XML section */
 1009|  1.75k|    for(size_t i = len; i < dataSize; i++) {
  ------------------
  |  Branch (1009:25): [True: 1.34k, False: 412]
  ------------------
 1010|  1.34k|        if(data[i] != ' ' && data[i] - '\t' >= 5)
  ------------------
  |  Branch (1010:12): [True: 903, False: 444]
  |  Branch (1010:30): [True: 95, False: 808]
  ------------------
 1011|     95|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     95|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1012|  1.34k|    }
 1013|       |
 1014|    412|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    412|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1015|    507|}
ua_types_encoding_xml.c:Int16_decodeXml:
 1047|    231|DECODE_XML(Int16) {
 1048|    231|    UA_Int16 *dst = (UA_Int16*)dst_;
 1049|    231|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  941|    231|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (941:8): [True: 0, False: 231]
  |  |  ------------------
  |  |  942|    231|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  943|    231|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (943:18): [Folded, False: 231]
  |  |  ------------------
  ------------------
 1050|    231|    GET_ELEM_CONTENT;
  ------------------
  |  |  946|    231|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  947|    231|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  948|    231|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (948:17): [Folded, False: 231]
  |  |  ------------------
  ------------------
 1051|    231|    skipXmlObject(ctx);
 1052|       |
 1053|    231|    UA_Int64 out = 0;
 1054|    231|    UA_StatusCode s = decodeSigned(data, length, &out);
 1055|    231|    if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   17|    462|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   82|    425|#define UA_INT16_MIN (-32768)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT16_MIN || out > UA_INT16_MAX)
  ------------------
  |  |   83|    142|#define UA_INT16_MAX 32767
  ------------------
  |  Branch (1055:8): [True: 37, False: 194]
  |  Branch (1055:35): [True: 52, False: 142]
  |  Branch (1055:57): [True: 34, False: 108]
  ------------------
 1056|    123|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    123|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1057|       |
 1058|    108|    *dst = (UA_Int16)out;
 1059|    108|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    108|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1060|    231|}
ua_types_encoding_xml.c:UInt16_decodeXml:
 1062|    138|DECODE_XML(UInt16) {
 1063|    138|    UA_UInt16 *dst = (UA_UInt16*)dst_;
 1064|    138|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  941|    138|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (941:8): [True: 0, False: 138]
  |  |  ------------------
  |  |  942|    138|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  943|    138|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (943:18): [Folded, False: 138]
  |  |  ------------------
  ------------------
 1065|    138|    GET_ELEM_CONTENT;
  ------------------
  |  |  946|    138|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  947|    138|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  948|    138|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (948:17): [Folded, False: 138]
  |  |  ------------------
  ------------------
 1066|    138|    skipXmlObject(ctx);
 1067|       |
 1068|    138|    UA_UInt64 out = 0;
 1069|    138|    UA_StatusCode s = decodeUnsigned(data, length, &out);
 1070|    138|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   17|    276|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT16_MAX)
  ------------------
  |  |   92|     87|#define UA_UINT16_MAX 65535
  ------------------
  |  Branch (1070:8): [True: 51, False: 87]
  |  Branch (1070:35): [True: 49, False: 38]
  ------------------
 1071|    100|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    100|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1072|       |
 1073|     38|    *dst = (UA_UInt16)out;
 1074|     38|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     38|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1075|    138|}
ua_types_encoding_xml.c:Int32_decodeXml:
 1077|    325|DECODE_XML(Int32) {
 1078|    325|    UA_Int32 *dst = (UA_Int32*)dst_;
 1079|    325|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  941|    325|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (941:8): [True: 0, False: 325]
  |  |  ------------------
  |  |  942|    325|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  943|    325|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (943:18): [Folded, False: 325]
  |  |  ------------------
  ------------------
 1080|    325|    GET_ELEM_CONTENT;
  ------------------
  |  |  946|    325|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  947|    325|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  948|    325|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (948:17): [Folded, False: 325]
  |  |  ------------------
  ------------------
 1081|    325|    skipXmlObject(ctx);
 1082|       |
 1083|    325|    UA_Int64 out = 0;
 1084|    325|    UA_StatusCode s = decodeSigned(data, length, &out);
 1085|    325|    if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |   17|    650|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |  100|    575|#define UA_INT32_MIN ((int32_t)-2147483648LL)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out < UA_INT32_MIN || out > UA_INT32_MAX)
  ------------------
  |  |  101|    199|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (1085:8): [True: 75, False: 250]
  |  Branch (1085:35): [True: 51, False: 199]
  |  Branch (1085:57): [True: 9, False: 190]
  ------------------
 1086|    135|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    135|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1087|       |
 1088|    190|    *dst = (UA_Int32)out;
 1089|    190|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    190|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1090|    325|}
ua_types_encoding_xml.c:UInt32_decodeXml:
 1125|    208|DECODE_XML(UInt32) {
 1126|    208|    UA_UInt32 *dst = (UA_UInt32*)dst_;
 1127|    208|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  941|    208|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (941:8): [True: 0, False: 208]
  |  |  ------------------
  |  |  942|    208|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  943|    208|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (943:18): [Folded, False: 208]
  |  |  ------------------
  ------------------
 1128|    208|    GET_ELEM_CONTENT;
  ------------------
  |  |  946|    208|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  947|    208|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  948|    208|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (948:17): [Folded, False: 208]
  |  |  ------------------
  ------------------
 1129|    208|    skipXmlObject(ctx);
 1130|       |
 1131|    208|    UA_UInt64 out = 0;
 1132|    208|    UA_StatusCode s = decodeUnsigned(data, length, &out);
 1133|    208|    if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |   17|    416|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(s != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |  110|    170|#define UA_UINT32_MAX 4294967295UL
  ------------------
  |  Branch (1133:8): [True: 38, False: 170]
  |  Branch (1133:35): [True: 54, False: 116]
  ------------------
 1134|     92|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     92|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1135|       |
 1136|    116|    *dst = (UA_UInt32)out;
 1137|    116|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    116|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1138|    208|}
ua_types_encoding_xml.c:Int64_decodeXml:
 1140|    505|DECODE_XML(Int64) {
 1141|    505|    UA_Int64 *dst = (UA_Int64*)dst_;
 1142|    505|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  941|    505|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (941:8): [True: 0, False: 505]
  |  |  ------------------
  |  |  942|    505|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  943|    505|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (943:18): [Folded, False: 505]
  |  |  ------------------
  ------------------
 1143|    505|    GET_ELEM_CONTENT;
  ------------------
  |  |  946|    505|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  947|    505|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  948|    505|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (948:17): [Folded, False: 505]
  |  |  ------------------
  ------------------
 1144|    505|    skipXmlObject(ctx);
 1145|       |
 1146|    505|    UA_Int64 out = 0;
 1147|    505|    UA_StatusCode s = decodeSigned(data, length, &out);
 1148|    505|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    505|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1148:8): [True: 75, False: 430]
  ------------------
 1149|     75|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     75|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1150|       |
 1151|    430|    *dst = (UA_Int64)out;
 1152|    430|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    430|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1153|    505|}
ua_types_encoding_xml.c:UInt64_decodeXml:
 1155|     82|DECODE_XML(UInt64) {
 1156|     82|    UA_UInt64 *dst = (UA_UInt64*)dst_;
 1157|     82|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  941|     82|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (941:8): [True: 0, False: 82]
  |  |  ------------------
  |  |  942|     82|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  943|     82|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (943:18): [Folded, False: 82]
  |  |  ------------------
  ------------------
 1158|     82|    GET_ELEM_CONTENT;
  ------------------
  |  |  946|     82|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  947|     82|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  948|     82|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (948:17): [Folded, False: 82]
  |  |  ------------------
  ------------------
 1159|     82|    skipXmlObject(ctx);
 1160|       |
 1161|     82|    UA_UInt64 out = 0;
 1162|     82|    UA_StatusCode s = decodeUnsigned(data, length, &out);
 1163|     82|    if(s != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|     82|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1163:8): [True: 44, False: 38]
  ------------------
 1164|     44|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     44|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1165|       |
 1166|     38|    *dst = (UA_UInt64)out;
 1167|     38|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     38|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1168|     82|}
ua_types_encoding_xml.c:Float_decodeXml:
 1219|      1|DECODE_XML(Float) {
 1220|      1|    UA_Float *dst = (UA_Float*)dst_;
 1221|      1|    UA_Double v = 0.0;
 1222|       |    UA_StatusCode res = Double_decodeXml(ctx, &v, NULL);
 1223|      1|    *dst = (UA_Float)v;
 1224|      1|    return res;
 1225|      1|}
ua_types_encoding_xml.c:Double_decodeXml:
 1170|  1.17k|DECODE_XML(Double) {
 1171|  1.17k|    UA_Double *dst = (UA_Double*)dst_;
 1172|  1.17k|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  941|  1.17k|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (941:8): [True: 0, False: 1.17k]
  |  |  ------------------
  |  |  942|  1.17k|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  943|  1.17k|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (943:18): [Folded, False: 1.17k]
  |  |  ------------------
  ------------------
 1173|  1.17k|    GET_ELEM_CONTENT;
  ------------------
  |  |  946|  1.17k|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  947|  1.17k|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  948|  1.17k|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (948:17): [Folded, False: 1.17k]
  |  |  ------------------
  ------------------
 1174|  1.17k|    skipXmlObject(ctx);
 1175|       |
 1176|  1.17k|    if(!data || length == 0)
  ------------------
  |  Branch (1176:8): [True: 4, False: 1.16k]
  |  Branch (1176:17): [True: 0, False: 1.16k]
  ------------------
 1177|      4|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      4|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1178|       |
 1179|       |    /* https://www.exploringbinary.com/maximum-number-of-decimal-digits-in-binary-floating-point-numbers/
 1180|       |     * Maximum digit counts for select IEEE floating-point formats: 1074
 1181|       |     * Sanity check. */
 1182|  1.16k|    if(length > 1075)
  ------------------
  |  Branch (1182:8): [True: 13, False: 1.15k]
  ------------------
 1183|     13|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     13|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1184|       |
 1185|  1.15k|    if(length == 3 && memcmp(data, "INF", 3) == 0) {
  ------------------
  |  Branch (1185:8): [True: 68, False: 1.08k]
  |  Branch (1185:23): [True: 4, False: 64]
  ------------------
 1186|      4|        *dst = INFINITY;
 1187|      4|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      4|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1188|      4|    }
 1189|       |
 1190|  1.15k|    if(length == 4 && memcmp(data, "-INF", 4) == 0) {
  ------------------
  |  Branch (1190:8): [True: 50, False: 1.10k]
  |  Branch (1190:23): [True: 3, False: 47]
  ------------------
 1191|      3|        *dst = -INFINITY;
 1192|      3|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      3|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1193|      3|    }
 1194|       |
 1195|  1.14k|    if(length == 3 && memcmp(data, "NaN", 3) == 0) {
  ------------------
  |  Branch (1195:8): [True: 64, False: 1.08k]
  |  Branch (1195:23): [True: 4, False: 60]
  ------------------
 1196|      4|        *dst = NAN;
 1197|      4|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      4|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1198|      4|    }
 1199|       |
 1200|  1.14k|    if(length == 3 && memcmp(data, "-NaN", 3) == 0) {
  ------------------
  |  Branch (1200:8): [True: 60, False: 1.08k]
  |  Branch (1200:23): [True: 1, False: 59]
  ------------------
 1201|      1|        *dst = NAN;
 1202|      1|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1203|      1|    }
 1204|       |
 1205|  1.14k|    size_t len = parseDouble((const char*)data, length, dst);
 1206|  1.14k|    if(len == 0)
  ------------------
  |  Branch (1206:8): [True: 13, False: 1.12k]
  ------------------
 1207|     13|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     13|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1208|       |
 1209|       |    /* There must only be whitespace between the end of the parsed number and
 1210|       |     * the end of the token */
 1211|  1.36k|    for(size_t i = len; i < length; i++) {
  ------------------
  |  Branch (1211:25): [True: 264, False: 1.10k]
  ------------------
 1212|    264|        if(data[i] != ' ' && data[i] -'\t' >= 5)
  ------------------
  |  Branch (1212:12): [True: 106, False: 158]
  |  Branch (1212:30): [True: 25, False: 81]
  ------------------
 1213|     25|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     25|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1214|    264|    }
 1215|       |
 1216|  1.10k|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  1.10k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1217|  1.12k|}
ua_types_encoding_xml.c:String_decodeXml:
 1227|    490|DECODE_XML(String) {
 1228|    490|    UA_String *dst = (UA_String*)dst_;
 1229|    490|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  941|    490|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (941:8): [True: 0, False: 490]
  |  |  ------------------
  |  |  942|    490|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  943|    490|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (943:18): [Folded, False: 490]
  |  |  ------------------
  ------------------
 1230|    490|    const xml_token *token = &ctx->tokens[ctx->index];
 1231|    490|    GET_ELEM_CONTENT;
  ------------------
  |  |  946|    490|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  947|    490|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  948|    490|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (948:17): [Folded, False: 490]
  |  |  ------------------
  ------------------
 1232|    490|    skipXmlObject(ctx);
 1233|       |
 1234|       |    /* Empty string? */
 1235|    490|    if(length == 0) {
  ------------------
  |  Branch (1235:8): [True: 14, False: 476]
  ------------------
 1236|     14|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|     14|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1237|     14|        dst->length = 0;
 1238|     14|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     14|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1239|     14|    }
 1240|       |
 1241|    476|    UA_String str = {length, (UA_Byte*)(uintptr_t)data};
 1242|    476|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    476|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1243|    476|    if(token->contentEscaped)
  ------------------
  |  Branch (1243:8): [True: 337, False: 139]
  ------------------
 1244|    337|        ret = getTokenContent(ctx->xml, token, &str);
 1245|    476|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    476|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1245:8): [True: 0, False: 476]
  ------------------
 1246|      0|        return ret;
 1247|       |
 1248|    476|    ret = UA_String_copy(&str, dst);
 1249|    476|    if(ret != UA_STATUSCODE_GOOD || !token->contentEscaped)
  ------------------
  |  |   17|    952|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1249:8): [True: 0, False: 476]
  |  Branch (1249:37): [True: 139, False: 337]
  ------------------
 1250|    139|        return ret;
 1251|       |
 1252|    337|    ret = decodeTokenContentInPlace(dst);
 1253|    337|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    337|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1253:8): [True: 0, False: 337]
  ------------------
 1254|      0|        UA_String_clear(dst);
 1255|    337|    return ret;
 1256|    476|}
ua_types_encoding_xml.c:getTokenContent:
  161|    337|getTokenContent(const char *xml, const xml_token *token, UA_String *content) {
  162|    337|    size_t begin = token->start;
  163|    337|    char quote = 0;
  164|  10.8k|    for(; begin < token->end; begin++) {
  ------------------
  |  Branch (164:11): [True: 10.8k, False: 0]
  ------------------
  165|  10.8k|        char c = xml[begin];
  166|  10.8k|        if(quote) {
  ------------------
  |  Branch (166:12): [True: 1.80k, False: 9.01k]
  ------------------
  167|  1.80k|            if(c == quote)
  ------------------
  |  Branch (167:16): [True: 484, False: 1.31k]
  ------------------
  168|    484|                quote = 0;
  169|  9.01k|        } else if(c == '\'' || c == '"') {
  ------------------
  |  Branch (169:19): [True: 226, False: 8.78k]
  |  Branch (169:32): [True: 258, False: 8.53k]
  ------------------
  170|    484|            quote = c;
  171|  8.53k|        } else if(c == '>') {
  ------------------
  |  Branch (171:19): [True: 337, False: 8.19k]
  ------------------
  172|    337|            begin++;
  173|    337|            break;
  174|    337|        }
  175|  10.8k|    }
  176|    337|    if(begin >= token->end)
  ------------------
  |  Branch (176:8): [True: 0, False: 337]
  ------------------
  177|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  178|       |
  179|    337|    size_t end = token->end;
  180|  3.18k|    while(end > begin && xml[end - 1] != '<')
  ------------------
  |  Branch (180:11): [True: 3.18k, False: 0]
  |  Branch (180:26): [True: 2.84k, False: 337]
  ------------------
  181|  2.84k|        end--;
  182|    337|    if(end <= begin)
  ------------------
  |  Branch (182:8): [True: 0, False: 337]
  ------------------
  183|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  184|    337|    end--;
  185|       |
  186|    337|    content->data = (UA_Byte*)(uintptr_t)&xml[begin];
  187|    337|    content->length = end - begin;
  188|    337|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    337|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  189|    337|}
ua_types_encoding_xml.c:decodeTokenContentInPlace:
  195|    337|decodeTokenContentInPlace(UA_String *content) {
  196|    337|    yxml_t parser;
  197|    337|    char parserStack[512];
  198|    337|    yxml_init_content(&parser, parserStack, sizeof(parserStack));
  199|    337|    unsigned depth = 0;
  200|    337|    size_t outPos = 0;
  201|       |
  202|  28.7M|    for(size_t pos = 0; pos < content->length; pos++) {
  ------------------
  |  Branch (202:25): [True: 28.7M, False: 337]
  ------------------
  203|  28.7M|        yxml_ret_t event = yxml_parse(&parser, content->data[pos]);
  204|  28.7M|        if(event < YXML_OK)
  ------------------
  |  Branch (204:12): [True: 0, False: 28.7M]
  ------------------
  205|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  206|  28.7M|        if(event == YXML_ELEMSTART) {
  ------------------
  |  Branch (206:12): [True: 133k, False: 28.5M]
  ------------------
  207|   133k|            depth++;
  208|  28.5M|        } else if(event == YXML_ELEMEND) {
  ------------------
  |  Branch (208:19): [True: 133k, False: 28.4M]
  ------------------
  209|   133k|            if(depth == 0)
  ------------------
  |  Branch (209:16): [True: 0, False: 133k]
  ------------------
  210|      0|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  211|   133k|            depth--;
  212|  28.4M|        } else if(event == YXML_CONTENT && depth == 0) {
  ------------------
  |  Branch (212:19): [True: 23.0M, False: 5.39M]
  |  Branch (212:44): [True: 23.0M, False: 37.8k]
  ------------------
  213|  23.0M|            size_t eventLength = strlen(parser.data);
  214|  23.0M|            if(outPos > content->length ||
  ------------------
  |  Branch (214:16): [True: 0, False: 23.0M]
  ------------------
  215|  23.0M|               eventLength > content->length - outPos)
  ------------------
  |  Branch (215:16): [True: 0, False: 23.0M]
  ------------------
  216|      0|                return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  217|  23.0M|            memcpy(&content->data[outPos], parser.data, eventLength);
  218|  23.0M|            outPos += eventLength;
  219|  23.0M|        }
  220|  28.7M|    }
  221|       |
  222|    337|    if(depth != 0 || yxml_eof(&parser) != YXML_OK)
  ------------------
  |  Branch (222:8): [True: 0, False: 337]
  |  Branch (222:22): [True: 0, False: 337]
  ------------------
  223|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  224|    337|    content->length = outPos;
  225|    337|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    337|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  226|    337|}
ua_types_encoding_xml.c:DateTime_decodeXml:
 1258|     20|DECODE_XML(DateTime) {
 1259|     20|    UA_DateTime *dst = (UA_DateTime*)dst_;
 1260|     20|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  941|     20|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (941:8): [True: 0, False: 20]
  |  |  ------------------
  |  |  942|     20|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  943|     20|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (943:18): [Folded, False: 20]
  |  |  ------------------
  ------------------
 1261|     20|    GET_ELEM_CONTENT;
  ------------------
  |  |  946|     20|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  947|     20|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  948|     20|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (948:17): [Folded, False: 20]
  |  |  ------------------
  ------------------
 1262|     20|    skipXmlObject(ctx);
 1263|     20|    UA_String str = {length, (UA_Byte*)(uintptr_t)data};
 1264|     20|    return UA_DateTime_parse(dst, str);
 1265|     20|}
ua_types_encoding_xml.c:Guid_decodeXml:
 1359|      1|DECODE_XML(Guid) {
 1360|      1|    UA_Guid *dst = (UA_Guid*)dst_;
 1361|      1|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  941|      1|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (941:8): [True: 0, False: 1]
  |  |  ------------------
  |  |  942|      1|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  943|      1|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (943:18): [Folded, False: 1]
  |  |  ------------------
  ------------------
 1362|      1|    UA_String str;
 1363|      1|    UA_String_init(&str);
 1364|      1|    XmlDecodeEntry entry = {UA_STRING_STATIC(UA_XML_GUID_STRING), &str,
  ------------------
  |  |  224|      1|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1365|      1|                            NULL, false, &UA_TYPES[UA_TYPES_STRING]};
  ------------------
  |  |  402|      1|#define UA_TYPES_STRING 11
  ------------------
 1366|      1|    status ret = decodeXmlFields(ctx, &entry, 1);
 1367|      1|    ret |= UA_Guid_parse(dst, str);
 1368|      1|    UA_String_clear(&str);
 1369|      1|    return ret;
 1370|      1|}
ua_types_encoding_xml.c:decodeXmlFields:
 1294|    235|decodeXmlFields(ParseCtxXml *ctx, XmlDecodeEntry *entries, size_t entryCount) {
 1295|    235|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  941|    235|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (941:8): [True: 0, False: 235]
  |  |  ------------------
  |  |  942|    235|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  943|    235|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (943:18): [Folded, False: 235]
  |  |  ------------------
  ------------------
 1296|       |
 1297|    235|    if(ctx->depth >= UA_XML_ENCODING_MAX_RECURSION)
  ------------------
  |  |   15|    235|#define UA_XML_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (1297:8): [True: 0, False: 235]
  ------------------
 1298|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 1299|       |
 1300|    235|    size_t childCount = ctx->tokens[ctx->index].children;
 1301|       |
 1302|       |    /* Empty object */
 1303|    235|    if(childCount == 0) {
  ------------------
  |  Branch (1303:8): [True: 159, False: 76]
  ------------------
 1304|    159|        skipXmlObject(ctx);
 1305|    159|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    159|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1306|    159|    }
 1307|       |
 1308|       |    /* Go to first entry element */
 1309|     76|    ctx->depth++;
 1310|     76|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
 1311|       |
 1312|     76|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     76|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1313|    228|    for(size_t i = 0; i < childCount; i++) {
  ------------------
  |  Branch (1313:23): [True: 152, False: 76]
  ------------------
 1314|    152|        xml_token *elem = &ctx->tokens[ctx->index];
 1315|    152|        XmlDecodeEntry *entry = NULL;
 1316|    152|        for(size_t j = i; j < entryCount + i; j++) {
  ------------------
  |  Branch (1316:27): [True: 152, False: 0]
  ------------------
 1317|       |            /* Search for key, if found outer loop will be one less. Best case
 1318|       |             * if objectCount is in order! */
 1319|    152|            size_t index = j % entryCount;
 1320|    152|            if(!UA_String_equal_ignorecase(&elem->name, &entries[index].name))
  ------------------
  |  Branch (1320:16): [True: 0, False: 152]
  ------------------
 1321|      0|                continue;
 1322|    152|            entry = &entries[index];
 1323|    152|            break;
 1324|    152|        }
 1325|       |
 1326|       |        /* Unknown child element */
 1327|    152|        if(!entry)
  ------------------
  |  Branch (1327:12): [True: 0, False: 152]
  ------------------
 1328|      0|            goto errout;
 1329|       |
 1330|       |        /* An entry that was expected, but shall not be decoded.
 1331|       |         * Jump over it. */
 1332|    152|        if(!entry->fieldPointer || (!entry->function && !entry->type)) {
  ------------------
  |  Branch (1332:12): [True: 0, False: 152]
  |  Branch (1332:37): [True: 76, False: 76]
  |  Branch (1332:57): [True: 0, False: 76]
  ------------------
 1333|      0|            skipXmlObject(ctx);
 1334|      0|            continue;
 1335|      0|        }
 1336|       |
 1337|       |        /* Duplicate child element */
 1338|    152|        if(entry->found)
  ------------------
  |  Branch (1338:12): [True: 0, False: 152]
  ------------------
 1339|      0|            goto errout;
 1340|    152|        entry->found = true;
 1341|       |
 1342|       |        /* Decode */
 1343|    152|        if(entry->function) /* Specialized decoding function */
  ------------------
  |  Branch (1343:12): [True: 76, False: 76]
  ------------------
 1344|     76|            ret = entry->function(ctx, entry->fieldPointer, entry->type);
 1345|     76|        else /* Decode by type-kind */
 1346|     76|            ret = decodeXmlJumpTable[entry->type->typeKind](ctx, entry->fieldPointer, entry->type);
 1347|    152|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|    152|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1347:12): [True: 0, False: 152]
  ------------------
 1348|      0|            goto cleanup;
 1349|    152|    }
 1350|       |
 1351|     76|cleanup:
 1352|     76|    ctx->depth--;
 1353|     76|    return ret;
 1354|      0|errout:
 1355|      0|    ctx->depth--;
 1356|      0|    return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1357|     76|}
ua_types_encoding_xml.c:ByteString_decodeXml:
 1386|     54|DECODE_XML(ByteString) {
 1387|     54|    UA_ByteString *dst = (UA_ByteString*)dst_;
 1388|     54|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  941|     54|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (941:8): [True: 0, False: 54]
  |  |  ------------------
  |  |  942|     54|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  943|     54|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (943:18): [Folded, False: 54]
  |  |  ------------------
  ------------------
 1389|     54|    GET_ELEM_CONTENT;
  ------------------
  |  |  946|     54|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  947|     54|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  948|     54|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (948:17): [Folded, False: 54]
  |  |  ------------------
  ------------------
 1390|     54|    skipXmlObject(ctx);
 1391|       |
 1392|       |    /* Trim whitespace around the content. The tokenizer can include CDATA
 1393|       |     * delimiters in the content range if whitespace precedes the section. */
 1394|     54|    while(length > 0 && (data[0] == ' ' || data[0] == '\t' ||
  ------------------
  |  Branch (1394:11): [True: 0, False: 54]
  |  Branch (1394:26): [True: 0, False: 0]
  |  Branch (1394:44): [True: 0, False: 0]
  ------------------
 1395|      0|                         data[0] == '\r' || data[0] == '\n')) {
  ------------------
  |  Branch (1395:26): [True: 0, False: 0]
  |  Branch (1395:45): [True: 0, False: 0]
  ------------------
 1396|      0|        data++;
 1397|      0|        length--;
 1398|      0|    }
 1399|     54|    while(length > 0 && (data[length - 1] == ' ' || data[length - 1] == '\t' ||
  ------------------
  |  Branch (1399:11): [True: 0, False: 54]
  |  Branch (1399:26): [True: 0, False: 0]
  |  Branch (1399:53): [True: 0, False: 0]
  ------------------
 1400|      0|                         data[length - 1] == '\r' || data[length - 1] == '\n'))
  ------------------
  |  Branch (1400:26): [True: 0, False: 0]
  |  Branch (1400:54): [True: 0, False: 0]
  ------------------
 1401|      0|        length--;
 1402|       |
 1403|       |    /* Remove an exact CDATA wrapper before compacting the Base64 payload. */
 1404|     54|    if(length >= 12 && memcmp(data, "<![CDATA[", 9) == 0 &&
  ------------------
  |  Branch (1404:8): [True: 0, False: 54]
  |  Branch (1404:24): [True: 0, False: 0]
  ------------------
 1405|      0|       memcmp(&data[length - 3], "]]>", 3) == 0) {
  ------------------
  |  Branch (1405:8): [True: 0, False: 0]
  ------------------
 1406|      0|        data += 9;
 1407|      0|        length -= 12;
 1408|      0|    }
 1409|       |
 1410|       |    /* XML allows insignificant whitespace inside Base64 content. */
 1411|     54|    size_t encodedLength = compactXmlBase64(data, length, NULL);
 1412|       |
 1413|       |    /* Empty bytestring? */
 1414|     54|    if(encodedLength == 0) {
  ------------------
  |  Branch (1414:8): [True: 54, False: 0]
  ------------------
 1415|     54|        dst->data = (UA_Byte*)UA_EMPTY_ARRAY_SENTINEL;
  ------------------
  |  |  756|     54|#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
  ------------------
 1416|     54|        dst->length = 0;
 1417|     54|    } else {
 1418|      0|        const unsigned char *encoded = (const unsigned char*)data;
 1419|      0|        unsigned char *compact = NULL;
 1420|      0|        if(encodedLength != length) {
  ------------------
  |  Branch (1420:12): [True: 0, False: 0]
  ------------------
 1421|      0|            compact = (unsigned char*)UA_malloc(encodedLength);
  ------------------
  |  |   18|      0|#define UA_malloc(size) UA_mallocSingleton(size)
  ------------------
 1422|      0|            if(!compact)
  ------------------
  |  Branch (1422:16): [True: 0, False: 0]
  ------------------
 1423|      0|                return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1424|      0|            compactXmlBase64(data, length, compact);
 1425|      0|            encoded = compact;
 1426|      0|        }
 1427|      0|        size_t flen = 0;
 1428|      0|        unsigned char *unB64 = UA_unbase64(encoded, encodedLength, &flen);
 1429|      0|        UA_free(compact);
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1430|      0|        if(!unB64)
  ------------------
  |  Branch (1430:12): [True: 0, False: 0]
  ------------------
 1431|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1432|      0|        dst->data = (UA_Byte*)unB64;
 1433|      0|        dst->length = flen;
 1434|      0|    }
 1435|       |
 1436|     54|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     54|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1437|     54|}
ua_types_encoding_xml.c:compactXmlBase64:
 1373|     54|compactXmlBase64(const UA_Byte *data, size_t length, UA_Byte *out) {
 1374|     54|    size_t pos = 0;
 1375|     54|    for(size_t i = 0; i < length; i++) {
  ------------------
  |  Branch (1375:23): [True: 0, False: 54]
  ------------------
 1376|      0|        if(data[i] != ' ' && data[i] != '\t' &&
  ------------------
  |  Branch (1376:12): [True: 0, False: 0]
  |  Branch (1376:30): [True: 0, False: 0]
  ------------------
 1377|      0|           data[i] != '\r' && data[i] != '\n') {
  ------------------
  |  Branch (1377:12): [True: 0, False: 0]
  |  Branch (1377:31): [True: 0, False: 0]
  ------------------
 1378|      0|            if(out)
  ------------------
  |  Branch (1378:16): [True: 0, False: 0]
  ------------------
 1379|      0|                out[pos] = data[i];
 1380|      0|            pos++;
 1381|      0|        }
 1382|      0|    }
 1383|     54|    return pos;
 1384|     54|}
ua_types_encoding_xml.c:XmlElement_decodeXml:
 1439|    308|DECODE_XML(XmlElement) {
 1440|    308|    UA_XmlElement *dst = (UA_XmlElement*)dst_;
 1441|    308|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  941|    308|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (941:8): [True: 0, False: 308]
  |  |  ------------------
  |  |  942|    308|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  943|    308|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (943:18): [Folded, False: 308]
  |  |  ------------------
  ------------------
 1442|    308|    xml_token *token = &ctx->tokens[ctx->index];
 1443|    308|    size_t begin = token->start;
 1444|   856k|    while(begin < token->end && ctx->xml[begin] != '>')
  ------------------
  |  Branch (1444:11): [True: 856k, False: 0]
  |  Branch (1444:33): [True: 855k, False: 308]
  ------------------
 1445|   855k|        begin++;
 1446|    308|    if(begin == token->end)
  ------------------
  |  Branch (1446:8): [True: 0, False: 308]
  ------------------
 1447|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1448|    308|    begin++;
 1449|    308|    size_t end = token->end;
 1450|  12.9M|    while(end > begin && ctx->xml[end - 1] != '<')
  ------------------
  |  Branch (1450:11): [True: 12.9M, False: 154]
  |  Branch (1450:26): [True: 12.9M, False: 154]
  ------------------
 1451|  12.9M|        end--;
 1452|    308|    if(end == begin)
  ------------------
  |  Branch (1452:8): [True: 154, False: 154]
  ------------------
 1453|    154|        end = token->end;
 1454|    154|    else
 1455|    154|        end--;
 1456|    308|    UA_StatusCode ret = UA_ByteString_allocBuffer((UA_ByteString*)dst, end - begin);
 1457|    308|    if(ret == UA_STATUSCODE_GOOD && end > begin)
  ------------------
  |  |   17|    616|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1457:8): [True: 308, False: 0]
  |  Branch (1457:37): [True: 252, False: 56]
  ------------------
 1458|    252|        memcpy(dst->data, &ctx->xml[begin], end - begin);
 1459|    308|    skipXmlObject(ctx);
 1460|    308|    return ret;
 1461|    308|}
ua_types_encoding_xml.c:NodeId_decodeXml:
 1463|     77|DECODE_XML(NodeId) {
 1464|     77|    UA_NodeId *dst = (UA_NodeId*)dst_;
 1465|     77|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  941|     77|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (941:8): [True: 0, False: 77]
  |  |  ------------------
  |  |  942|     77|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  943|     77|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (943:18): [Folded, False: 77]
  |  |  ------------------
  ------------------
 1466|     77|    UA_String str;
 1467|     77|    static UA_String identifier = UA_STRING_STATIC(UA_XML_NODEID_IDENTIFIER);
  ------------------
  |  |  224|     77|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1468|     77|    status ret = getChildContent(ctx, identifier, &str);
 1469|     77|    if(ret != UA_STATUSCODE_GOOD) return ret;
  ------------------
  |  |   17|     77|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1469:8): [True: 1, False: 76]
  ------------------
 1470|     76|    skipXmlObject(ctx);
 1471|     76|    return UA_NodeId_parseEx(dst, str, ctx->namespaceMapping);
 1472|     77|}
ua_types_encoding_xml.c:getChildContent:
 1270|     82|getChildContent(ParseCtxXml *ctx, UA_String name, UA_String *out) {
 1271|     82|    size_t oldIndex = ctx->index;
 1272|     82|    size_t children = ctx->tokens[ctx->index].children;
 1273|       |
 1274|       |    /* Skip the attributes and go to the first child */
 1275|     82|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
 1276|       |
 1277|       |    /* Find the child of the name */
 1278|     82|    UA_StatusCode res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     82|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1279|     82|    for(size_t i = 0; i < children; i++) {
  ------------------
  |  Branch (1279:23): [True: 76, False: 6]
  ------------------
 1280|     76|        if(!UA_String_equal(&name, &ctx->tokens[ctx->index].name)) {
  ------------------
  |  Branch (1280:12): [True: 0, False: 76]
  ------------------
 1281|      0|            skipXmlObject(ctx);
 1282|      0|            continue;
 1283|      0|        }
 1284|     76|        *out = ctx->tokens[ctx->index].content;
 1285|     76|        res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     76|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1286|     76|        break;
 1287|     76|    }
 1288|       |
 1289|     82|    ctx->index = oldIndex;
 1290|     82|    return res;
 1291|     82|}
ua_types_encoding_xml.c:ExpandedNodeId_decodeXml:
 1474|      1|DECODE_XML(ExpandedNodeId) {
 1475|      1|    UA_ExpandedNodeId *dst = (UA_ExpandedNodeId*)dst_;
 1476|      1|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  941|      1|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (941:8): [True: 0, False: 1]
  |  |  ------------------
  |  |  942|      1|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  943|      1|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (943:18): [Folded, False: 1]
  |  |  ------------------
  ------------------
 1477|      1|    UA_String str;
 1478|      1|    static UA_String expidentifier = UA_STRING_STATIC(UA_XML_EXPANDEDNODEID_IDENTIFIER);
  ------------------
  |  |  224|      1|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1479|      1|    status ret = getChildContent(ctx, expidentifier, &str);
 1480|      1|    if(ret != UA_STATUSCODE_GOOD) return ret;
  ------------------
  |  |   17|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1480:8): [True: 1, False: 0]
  ------------------
 1481|      0|    skipXmlObject(ctx);
 1482|      0|    return UA_ExpandedNodeId_parseEx(dst, str, ctx->namespaceMapping,
 1483|      0|                                     ctx->serverUrisSize, ctx->serverUris);
 1484|      1|}
ua_types_encoding_xml.c:StatusCode_decodeXml:
 1486|      4|DECODE_XML(StatusCode) {
 1487|      4|    UA_StatusCode *dst = (UA_StatusCode*)dst_;
 1488|      4|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  941|      4|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (941:8): [True: 0, False: 4]
  |  |  ------------------
  |  |  942|      4|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  943|      4|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (943:18): [Folded, False: 4]
  |  |  ------------------
  ------------------
 1489|      4|    UA_String str;
 1490|      4|    static UA_String statusidentifier = UA_STRING_STATIC(UA_XML_STATUSCODE_CODE);
  ------------------
  |  |  224|      4|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1491|      4|    status ret = getChildContent(ctx, statusidentifier, &str);
 1492|      4|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|      4|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1492:8): [True: 4, False: 0]
  ------------------
 1493|      4|        return ret;
 1494|      0|    skipXmlObject(ctx);
 1495|      0|    UA_UInt64 out = 0;
 1496|      0|    ret = decodeUnsigned(str.data, str.length, &out);
 1497|      0|    if(ret != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(ret != UA_STATUSCODE_GOOD || out > UA_UINT32_MAX)
  ------------------
  |  |  110|      0|#define UA_UINT32_MAX 4294967295UL
  ------------------
  |  Branch (1497:8): [True: 0, False: 0]
  |  Branch (1497:37): [True: 0, False: 0]
  ------------------
 1498|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1499|      0|    *dst = (UA_StatusCode)out;
 1500|      0|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1501|      0|}
ua_types_encoding_xml.c:LocalizedText_decodeXml:
 1524|      2|DECODE_XML(LocalizedText) {
 1525|      2|    UA_LocalizedText *dst = (UA_LocalizedText*)dst_;
 1526|      2|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  941|      2|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (941:8): [True: 0, False: 2]
  |  |  ------------------
  |  |  942|      2|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  943|      2|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (943:18): [Folded, False: 2]
  |  |  ------------------
  ------------------
 1527|       |
 1528|      2|    XmlDecodeEntry entries[2] = {
 1529|      2|        {UA_STRING_STATIC(UA_XML_LOCALIZEDTEXT_LOCALE), &dst->locale,
  ------------------
  |  |  224|      2|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1530|      2|         NULL, false, &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  402|      2|#define UA_TYPES_STRING 11
  ------------------
 1531|      2|        {UA_STRING_STATIC(UA_XML_LOCALIZEDTEXT_TEXT), &dst->text,
  ------------------
  |  |  224|      2|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1532|      2|         NULL, false, &UA_TYPES[UA_TYPES_STRING]}
  ------------------
  |  |  402|      2|#define UA_TYPES_STRING 11
  ------------------
 1533|      2|    };
 1534|       |
 1535|      2|    return decodeXmlFields(ctx, entries, 2);
 1536|      2|}
ua_types_encoding_xml.c:ExtensionObject_decodeXml:
 1625|     78|DECODE_XML(ExtensionObject) {
 1626|     78|    UA_ExtensionObject *dst = (UA_ExtensionObject*)dst_;
 1627|     78|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  941|     78|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (941:8): [True: 0, False: 78]
  |  |  ------------------
  |  |  942|     78|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  943|     78|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (943:18): [Folded, False: 78]
  |  |  ------------------
  ------------------
 1628|     78|    xml_token *tok = &ctx->tokens[ctx->index];
 1629|     78|    if(tok->children == 0)
  ------------------
  |  Branch (1629:8): [True: 2, False: 76]
  ------------------
 1630|      2|        return UA_STATUSCODE_GOOD; /* _NO_BODY */
  ------------------
  |  |   17|      2|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1631|     76|    dst->encoding = UA_EXTENSIONOBJECT_ENCODED_XML; /* default so the typeId gets cleaned up */
 1632|     76|    XmlDecodeEntry entries[2] = {
 1633|     76|        {UA_STRING_STATIC(UA_XML_EXTENSIONOBJECT_TYPEID), &dst->content.encoded.typeId,
  ------------------
  |  |  224|     76|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1634|     76|         NULL, false, &UA_TYPES[UA_TYPES_NODEID]},
  ------------------
  |  |  572|     76|#define UA_TYPES_NODEID 16
  ------------------
 1635|     76|        {UA_STRING_STATIC(UA_XML_EXTENSIONOBJECT_BODY), dst,
  ------------------
  |  |  224|     76|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1636|     76|         decodeExtensionObjectBody, false, NULL},
 1637|     76|    };
 1638|     76|    return decodeXmlFields(ctx, entries, 2);
 1639|     78|}
ua_types_encoding_xml.c:decodeExtensionObjectBody:
 1563|     76|decodeExtensionObjectBody(ParseCtxXml *ctx, void *dst, const UA_DataType *type) {
 1564|     76|    UA_ExtensionObject *eo = (UA_ExtensionObject*)dst;
 1565|       |
 1566|     76|    xml_token *tok = &ctx->tokens[ctx->index];
 1567|     76|    if(tok->children != 1)
  ------------------
  |  Branch (1567:8): [True: 0, False: 76]
  ------------------
 1568|      0|        return UA_STATUSCODE_BADDECODINGERROR; /* Only one child allowed */
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1569|       |
 1570|     76|    if(UA_NodeId_isNull(&eo->content.encoded.typeId))
  ------------------
  |  Branch (1570:8): [True: 0, False: 76]
  ------------------
 1571|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1572|       |
 1573|       |    /* Find the datatype of the body */
 1574|     76|    type = lookupXmlType(ctx, &eo->content.encoded.typeId);
 1575|       |
 1576|       |    /* Allocate decoded content */
 1577|     76|    void *decoded = NULL;
 1578|     76|    if(type) {
  ------------------
  |  Branch (1578:8): [True: 76, False: 0]
  ------------------
 1579|     76|        decoded = UA_new(type);
 1580|     76|        if(!decoded)
  ------------------
  |  Branch (1580:12): [True: 0, False: 76]
  ------------------
 1581|      0|            return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1582|     76|    }
 1583|       |
 1584|       |    /* Jump to the first child element */
 1585|     76|    ctx->index += 1 + tok->attributes;
 1586|     76|    tok = &ctx->tokens[ctx->index];
 1587|       |
 1588|     76|    UA_StatusCode ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     76|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1589|     76|    UA_String bs = UA_STRING_STATIC(UA_XML_EXTENSIONOBJECT_BYTESTRING);
  ------------------
  |  |  224|     76|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1590|     76|    if(UA_String_equal(&tok->name, &bs)) {
  ------------------
  |  Branch (1590:8): [True: 0, False: 76]
  ------------------
 1591|       |        /* Decode binary ByteString Body */
 1592|      0|        eo->encoding = UA_EXTENSIONOBJECT_ENCODED_BYTESTRING;
 1593|      0|        ret = decodeXmlJumpTable[UA_DATATYPEKIND_BYTESTRING](ctx, &eo->content.encoded.body, NULL);
 1594|      0|        if(!type)
  ------------------
  |  Branch (1594:12): [True: 0, False: 0]
  ------------------
 1595|      0|            return ret;
 1596|      0|        UA_DecodeBinaryOptions opts;
 1597|      0|        memset(&opts, 0, sizeof(UA_DecodeBinaryOptions));
 1598|      0|        ret = UA_decodeBinary(&eo->content.encoded.body, decoded, type, &opts);
 1599|     76|    } else {
 1600|       |        /* Decode XML Body */
 1601|     76|        eo->encoding = UA_EXTENSIONOBJECT_ENCODED_XML;
 1602|     76|        UA_String body = {tok->end - tok->start, (UA_Byte*)(uintptr_t)ctx->xml + tok->start};
 1603|     76|        skipXmlObject(ctx); /* Skip over the body */
 1604|     76|        if(!type)
  ------------------
  |  Branch (1604:12): [True: 0, False: 76]
  ------------------
 1605|      0|            return UA_String_copy(&body, &eo->content.encoded.body);
 1606|     76|        UA_DecodeXmlOptions opts;
 1607|     76|        memset(&opts, 0, sizeof(UA_DecodeXmlOptions));
 1608|     76|        opts.namespaceMapping = ctx->namespaceMapping;
 1609|     76|        opts.serverUris = ctx->serverUris;
 1610|     76|        opts.serverUrisSize = ctx->serverUrisSize;
 1611|     76|        opts.customTypes = ctx->customTypes;
 1612|     76|        ret = UA_decodeXml(&body, decoded, type, &opts);
 1613|     76|    }
 1614|       |
 1615|     76|    if(ret != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|     76|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1615:8): [True: 0, False: 76]
  ------------------
 1616|      0|        UA_free(decoded); /* Return the un-decoded content if decoding fails */
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1617|      0|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1618|      0|    }
 1619|       |
 1620|     76|    UA_ExtensionObject_clear(eo); /* Also clears the already decoded TypeId */
 1621|     76|    UA_ExtensionObject_setValue(eo, decoded, type);
 1622|     76|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     76|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1623|     76|}
ua_types_encoding_xml.c:lookupXmlType:
 1540|     76|lookupXmlType(ParseCtxXml *ctx, UA_NodeId *typeId) {
 1541|       |    /* Search in the builtin types */
 1542|  18.8k|    for(size_t i = 0; i < UA_TYPES_COUNT; ++i) {
  ------------------
  |  |   17|  18.8k|#define UA_TYPES_COUNT 388
  ------------------
  |  Branch (1542:23): [True: 18.8k, False: 0]
  ------------------
 1543|  18.8k|        if(UA_NodeId_equal(typeId, &UA_TYPES[i].typeId) ||
  ------------------
  |  Branch (1543:12): [True: 76, False: 18.7k]
  ------------------
 1544|  18.7k|           UA_NodeId_equal(typeId, &UA_TYPES[i].xmlEncodingId))
  ------------------
  |  Branch (1544:12): [True: 0, False: 18.7k]
  ------------------
 1545|     76|            return &UA_TYPES[i];
 1546|  18.8k|    }
 1547|       |
 1548|       |    /* Search in the customTypes */
 1549|      0|    const UA_DataTypeArray *customTypes = ctx->customTypes;
 1550|      0|    while(customTypes) {
  ------------------
  |  Branch (1550:11): [True: 0, False: 0]
  ------------------
 1551|      0|        for(size_t i = 0; i < customTypes->typesSize; ++i) {
  ------------------
  |  Branch (1551:27): [True: 0, False: 0]
  ------------------
 1552|      0|            const UA_DataType *type = &customTypes->types[i];
 1553|      0|            if(UA_NodeId_equal(typeId, &type->typeId) ||
  ------------------
  |  Branch (1553:16): [True: 0, False: 0]
  ------------------
 1554|      0|               UA_NodeId_equal(typeId, &type->xmlEncodingId))
  ------------------
  |  Branch (1554:16): [True: 0, False: 0]
  ------------------
 1555|      0|                return type;
 1556|      0|        }
 1557|      0|        customTypes = customTypes->next;
 1558|      0|    }
 1559|      0|    return NULL;
 1560|      0|}
ua_types_encoding_xml.c:DataValue_decodeXml:
 1883|      2|DECODE_XML(DataValue) {
 1884|      2|    UA_DataValue *dst = (UA_DataValue*)dst_;
 1885|      2|    XmlDecodeEntry entries[6] = {
 1886|      2|        {UA_STRING_STATIC("Value"), dst, DataValueValue_decodeXml, false, NULL},
  ------------------
  |  |  224|      2|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1887|      2|        {UA_STRING_STATIC("StatusCode"), &dst->status, NULL, false,
  ------------------
  |  |  224|      2|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1888|      2|         &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  640|      2|#define UA_TYPES_STATUSCODE 18
  ------------------
 1889|      2|        {UA_STRING_STATIC("SourceTimestamp"), &dst->sourceTimestamp, NULL, false,
  ------------------
  |  |  224|      2|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1890|      2|         &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  436|      2|#define UA_TYPES_DATETIME 12
  ------------------
 1891|      2|        {UA_STRING_STATIC("SourcePicoseconds"), &dst->sourcePicoseconds, NULL, false,
  ------------------
  |  |  224|      2|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1892|      2|         &UA_TYPES[UA_TYPES_UINT16]},
  ------------------
  |  |  164|      2|#define UA_TYPES_UINT16 4
  ------------------
 1893|      2|        {UA_STRING_STATIC("ServerTimestamp"), &dst->serverTimestamp, NULL, false,
  ------------------
  |  |  224|      2|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1894|      2|         &UA_TYPES[UA_TYPES_DATETIME]},
  ------------------
  |  |  436|      2|#define UA_TYPES_DATETIME 12
  ------------------
 1895|      2|        {UA_STRING_STATIC("ServerPicoseconds"), &dst->serverPicoseconds, NULL, false,
  ------------------
  |  |  224|      2|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1896|      2|         &UA_TYPES[UA_TYPES_UINT16]}
  ------------------
  |  |  164|      2|#define UA_TYPES_UINT16 4
  ------------------
 1897|      2|    };
 1898|      2|    status ret = decodeXmlFields(ctx, entries, 6);
 1899|      2|    dst->hasValue = entries[0].found;
 1900|      2|    dst->hasStatus = entries[1].found;
 1901|      2|    dst->hasSourceTimestamp = entries[2].found;
 1902|      2|    dst->hasSourcePicoseconds = entries[3].found;
 1903|      2|    dst->hasServerTimestamp = entries[4].found;
 1904|      2|    dst->hasServerPicoseconds = entries[5].found;
 1905|      2|    return ret;
 1906|      2|}
ua_types_encoding_xml.c:decodeXmlVariantValue:
 1799|  4.33k|decodeXmlVariantValue(ParseCtxXml *ctx, UA_Variant *dst) {
 1800|  4.33k|    xml_token *tok = &ctx->tokens[ctx->index];
 1801|  4.33k|    if(tok->children != 1)
  ------------------
  |  Branch (1801:8): [True: 5, False: 4.33k]
  ------------------
 1802|      5|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      5|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1803|       |
 1804|       |    /* Jump to the child of the <Value> token */
 1805|  4.33k|    ctx->depth++;
 1806|  4.33k|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
 1807|  4.33k|    tok = &ctx->tokens[ctx->index];
 1808|       |
 1809|       |    /* Special case for multi-dimensional arrays */
 1810|  4.33k|    static UA_String matrName = UA_STRING_STATIC("Matrix");
  ------------------
  |  |  224|  4.33k|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1811|  4.33k|    UA_StatusCode ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|  4.33k|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1812|  4.33k|    if(UA_String_equal(&tok->name, &matrName)) {
  ------------------
  |  Branch (1812:8): [True: 2, False: 4.33k]
  ------------------
 1813|      2|        ret = decodeMatrixVariant(ctx, dst);
 1814|      2|        unwrapVariantExtensionObject(dst, true);
 1815|      2|        ctx->depth--;
 1816|      2|        return ret;
 1817|      2|    }
 1818|       |
 1819|       |    /* Get the Data type / array type */
 1820|  4.33k|    UA_Boolean isArray = false;
 1821|  4.33k|    static char *lo = "ListOf";
 1822|  4.33k|    UA_String typeName = tok->name;
 1823|  4.33k|    if(tok->name.length > strlen(lo) &&
  ------------------
  |  Branch (1823:8): [True: 748, False: 3.58k]
  ------------------
 1824|    748|       strncmp((char*)tok->name.data, lo, strlen(lo)) == 0) {
  ------------------
  |  Branch (1824:8): [True: 38, False: 710]
  ------------------
 1825|     38|        isArray = true;
 1826|     38|        typeName.data += strlen(lo);
 1827|     38|        typeName.length -= strlen(lo);
 1828|     38|    }
 1829|       |
 1830|       |    /* Look up the DataType from the name */
 1831|  4.33k|    dst->type = lookupTypeByName(ctx, typeName);
 1832|  4.33k|    if(!dst->type) {
  ------------------
  |  Branch (1832:8): [True: 153, False: 4.17k]
  ------------------
 1833|    153|        ctx->depth--;
 1834|    153|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    153|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1835|    153|    }
 1836|       |
 1837|       |    /* Decode */
 1838|  4.17k|    if(!isArray) {
  ------------------
  |  Branch (1838:8): [True: 4.14k, False: 37]
  ------------------
 1839|  4.14k|        dst->data = UA_new(dst->type);
 1840|  4.14k|        if(!dst->data) {
  ------------------
  |  Branch (1840:12): [True: 0, False: 4.14k]
  ------------------
 1841|      0|            ctx->depth--;
 1842|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1843|      0|        }
 1844|  4.14k|        ret = decodeXmlJumpTable[dst->type->typeKind](ctx, dst->data, dst->type);
 1845|  4.14k|    } else {
 1846|     37|        ret = Array_decodeXml(ctx, &dst->arrayLength, dst->type);
 1847|     37|    }
 1848|       |
 1849|       |    /* Unwrap ExtensionObject values in the variant */
 1850|  4.17k|    unwrapVariantExtensionObject(dst, isArray);
 1851|       |
 1852|  4.17k|    ctx->depth--;
 1853|  4.17k|    return ret;
 1854|  4.17k|}
ua_types_encoding_xml.c:decodeMatrixVariant:
 1743|      2|decodeMatrixVariant(ParseCtxXml *ctx, UA_Variant *dst) {
 1744|       |    /* The <Matrix> token needs two children: <Dimensions> and <Elements> */
 1745|      2|    xml_token *tok = &ctx->tokens[ctx->index];
 1746|      2|    if(tok->children != 2)
  ------------------
  |  Branch (1746:8): [True: 1, False: 1]
  ------------------
 1747|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1748|       |
 1749|       |    /* Jump to the child of the <Matrix> token */
 1750|      1|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
 1751|      1|    tok = &ctx->tokens[ctx->index];
 1752|       |
 1753|      1|    UA_assert(tok->type == XML_TOKEN_ELEMENT);
  ------------------
  |  |  399|      1|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1753:5): [True: 1, False: 0]
  ------------------
 1754|      1|    static UA_String dimName = UA_STRING_STATIC("Dimensions");
  ------------------
  |  |  224|      1|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1755|      1|    if(!UA_String_equal(&tok->name, &dimName))
  ------------------
  |  Branch (1755:8): [True: 1, False: 0]
  ------------------
 1756|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1757|       |
 1758|      0|    UA_StatusCode ret =
 1759|      0|        Array_decodeXml(ctx, &dst->arrayDimensionsSize, &UA_TYPES[UA_TYPES_INT32]);
  ------------------
  |  |  198|      0|#define UA_TYPES_INT32 5
  ------------------
 1760|      0|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1760:8): [True: 0, False: 0]
  ------------------
 1761|      0|        return ret;
 1762|       |
 1763|      0|    UA_assert(tok->type == XML_TOKEN_ELEMENT);
  ------------------
  |  |  399|      0|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1763:5): [True: 0, False: 0]
  ------------------
 1764|      0|    static UA_String elemName = UA_STRING_STATIC("Elements");
  ------------------
  |  |  224|      0|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1765|      0|    tok = &ctx->tokens[ctx->index];
 1766|      0|    if(!UA_String_equal(&tok->name, &elemName))
  ------------------
  |  Branch (1766:8): [True: 0, False: 0]
  ------------------
 1767|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1768|       |
 1769|       |    /* Get the type of the first element */
 1770|      0|    size_t oldIndex = ctx->index;
 1771|      0|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
 1772|      0|    tok = &ctx->tokens[ctx->index];
 1773|      0|    UA_assert(tok->type == XML_TOKEN_ELEMENT);
  ------------------
  |  |  399|      0|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (1773:5): [True: 0, False: 0]
  ------------------
 1774|       |
 1775|      0|    UA_String typeName = tok->name;
 1776|      0|    dst->type = lookupTypeByName(ctx, typeName);
 1777|      0|    if(!dst->type)
  ------------------
  |  Branch (1777:8): [True: 0, False: 0]
  ------------------
 1778|      0|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1779|       |
 1780|       |    /* Decode the array */
 1781|      0|    ctx->index = oldIndex;
 1782|      0|    ret = Array_decodeXml(ctx, &dst->arrayLength, dst->type);
 1783|      0|    if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1783:8): [True: 0, False: 0]
  ------------------
 1784|      0|        return ret;
 1785|       |
 1786|       |    /* Check that the ArrayDimensions match */
 1787|      0|    size_t dimLen = 1;
 1788|      0|    for(size_t i = 0; i < dst->arrayDimensionsSize; i++) {
  ------------------
  |  Branch (1788:23): [True: 0, False: 0]
  ------------------
 1789|      0|        if(dst->arrayDimensions[i] != 0 &&
  ------------------
  |  Branch (1789:12): [True: 0, False: 0]
  ------------------
 1790|      0|           dimLen > SIZE_MAX / dst->arrayDimensions[i])
  ------------------
  |  Branch (1790:12): [True: 0, False: 0]
  ------------------
 1791|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1792|      0|        dimLen *= dst->arrayDimensions[i];
 1793|      0|    }
 1794|       |
 1795|      0|    return (dimLen == dst->arrayLength) ? UA_STATUSCODE_GOOD : UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  return (dimLen == dst->arrayLength) ? UA_STATUSCODE_GOOD : UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  |  Branch (1795:12): [True: 0, False: 0]
  ------------------
 1796|      0|}
ua_types_encoding_xml.c:unwrapVariantExtensionObject:
 1695|  4.18k|unwrapVariantExtensionObject(UA_Variant *dst, UA_Boolean isArray) {
 1696|  4.18k|    if(dst->type != &UA_TYPES[UA_TYPES_EXTENSIONOBJECT])
  ------------------
  |  |  742|  4.18k|#define UA_TYPES_EXTENSIONOBJECT 21
  ------------------
  |  Branch (1696:8): [True: 4.10k, False: 80]
  ------------------
 1697|  4.10k|        return;
 1698|     80|    if(isArray && dst->arrayLength == 0)
  ------------------
  |  Branch (1698:8): [True: 2, False: 78]
  |  Branch (1698:19): [True: 2, False: 0]
  ------------------
 1699|      2|        return;
 1700|       |
 1701|     78|    UA_ExtensionObject *eo = (UA_ExtensionObject*)dst->data;
 1702|     78|    if(eo->encoding != UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (1702:8): [True: 2, False: 76]
  ------------------
 1703|      2|        return;
 1704|       |
 1705|     76|    const UA_DataType *type = eo->content.decoded.type;
 1706|       |
 1707|       |    /* Scalar */
 1708|     76|    if(!isArray) {
  ------------------
  |  Branch (1708:8): [True: 76, False: 0]
  ------------------
 1709|     76|        dst->data = eo->content.decoded.data;
 1710|     76|        dst->type = type;
 1711|     76|        UA_free(eo);
  ------------------
  |  |   19|     76|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1712|     76|        return;
 1713|     76|    }
 1714|       |
 1715|       |    /* Array. Check that all members can be unpacked */
 1716|      0|    for(size_t i = 0; i < dst->arrayLength; i++, eo++) {
  ------------------
  |  Branch (1716:23): [True: 0, False: 0]
  ------------------
 1717|      0|        if(eo->encoding != UA_EXTENSIONOBJECT_DECODED)
  ------------------
  |  Branch (1717:12): [True: 0, False: 0]
  ------------------
 1718|      0|            return;
 1719|      0|        if(eo->content.decoded.type != type)
  ------------------
  |  Branch (1719:12): [True: 0, False: 0]
  ------------------
 1720|      0|            return;
 1721|      0|    }
 1722|       |
 1723|       |    /* Allocate the array */
 1724|      0|    void *unpacked = UA_Array_new(dst->arrayLength, type);
 1725|      0|    if(!unpacked)
  ------------------
  |  Branch (1725:8): [True: 0, False: 0]
  ------------------
 1726|      0|        return;
 1727|       |
 1728|       |    /* Unpack the content and set the new array */
 1729|      0|    uintptr_t uptr = (uintptr_t)unpacked;
 1730|      0|    eo = (UA_ExtensionObject*)dst->data;
 1731|      0|    for(size_t i = 0; i < dst->arrayLength; i++, eo++) {
  ------------------
  |  Branch (1731:23): [True: 0, False: 0]
  ------------------
 1732|       |        /* Move the value content */
 1733|      0|        memcpy((void*)uptr, eo->content.decoded.data, type->memSize);
 1734|      0|        UA_free(eo->content.decoded.data); /* Free the old value location */
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1735|      0|        uptr += type->memSize;
 1736|      0|    }
 1737|      0|    UA_free(dst->data); /* Remove the old array of ExtensionObjects */
  ------------------
  |  |   19|      0|#define UA_free(ptr) UA_freeSingleton(ptr)
  ------------------
 1738|      0|    dst->data = unpacked;
 1739|      0|    dst->type = type;
 1740|      0|}
ua_types_encoding_xml.c:lookupTypeByName:
 1669|  4.33k|lookupTypeByName(ParseCtxXml *ctx, UA_String typeName) {
 1670|       |    /* Search in the builtin types */
 1671|   120k|    for(size_t i = 0; i < UA_TYPES_COUNT; ++i) {
  ------------------
  |  |   17|   120k|#define UA_TYPES_COUNT 388
  ------------------
  |  Branch (1671:23): [True: 120k, False: 153]
  ------------------
 1672|   120k|        const UA_DataType *type = &UA_TYPES[i];
 1673|   120k|        size_t length = strlen(type->typeName);
 1674|   120k|        if(length == typeName.length &&
  ------------------
  |  Branch (1674:12): [True: 15.5k, False: 104k]
  ------------------
 1675|  15.5k|           strncmp((char*)typeName.data, type->typeName, typeName.length) == 0)
  ------------------
  |  Branch (1675:12): [True: 4.17k, False: 11.3k]
  ------------------
 1676|  4.17k|            return &UA_TYPES[i];
 1677|   120k|    }
 1678|       |
 1679|       |    /* Search in the customTypes */
 1680|    153|    const UA_DataTypeArray *customTypes = ctx->customTypes;
 1681|    153|    while(customTypes) {
  ------------------
  |  Branch (1681:11): [True: 0, False: 153]
  ------------------
 1682|      0|        for(size_t i = 0; i < customTypes->typesSize; ++i) {
  ------------------
  |  Branch (1682:27): [True: 0, False: 0]
  ------------------
 1683|      0|            const UA_DataType *type = &customTypes->types[i];
 1684|      0|            size_t length = strlen(type->typeName);
 1685|      0|            if(length == typeName.length &&
  ------------------
  |  Branch (1685:16): [True: 0, False: 0]
  ------------------
 1686|      0|               strncmp((char*)typeName.data, type->typeName, typeName.length) == 0)
  ------------------
  |  Branch (1686:16): [True: 0, False: 0]
  ------------------
 1687|      0|                return type;
 1688|      0|        }
 1689|      0|        customTypes = customTypes->next;
 1690|      0|    }
 1691|    153|    return NULL;
 1692|    153|}
ua_types_encoding_xml.c:Array_decodeXml:
 1642|     37|Array_decodeXml(ParseCtxXml *ctx, void *dst_, const UA_DataType *type) {
 1643|     37|    size_t *dstSize = (size_t*)dst_;
 1644|       |
 1645|       |    /* Allocate memory */
 1646|     37|    size_t length = ctx->tokens[ctx->index].children;
 1647|     37|    void **dst = (void**)((uintptr_t)dstSize + sizeof(void*));
 1648|     37|    *dst = UA_Array_new(length, type);
 1649|     37|    if(!*dst)
  ------------------
  |  Branch (1649:8): [True: 0, False: 37]
  ------------------
 1650|      0|        return UA_STATUSCODE_BADOUTOFMEMORY;
  ------------------
  |  |   32|      0|#define UA_STATUSCODE_BADOUTOFMEMORY ((UA_StatusCode) 0x80030000)
  ------------------
 1651|     37|    *dstSize = length;
 1652|       |
 1653|       |    /* Go to first array member. */
 1654|     37|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
 1655|       |
 1656|       |    /* Decode array members */
 1657|     37|    uintptr_t ptr = (uintptr_t)*dst;
 1658|     37|    for(size_t i = 0; i < length; ++i) {
  ------------------
  |  Branch (1658:23): [True: 27, False: 10]
  ------------------
 1659|     27|        status ret = decodeXmlJumpTable[type->typeKind](ctx, (void*)ptr, type);
 1660|     27|        if(ret != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|     27|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1660:12): [True: 27, False: 0]
  ------------------
 1661|     27|            return ret;
 1662|      0|        ptr += type->memSize;
 1663|      0|    }
 1664|       |
 1665|     10|    return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     10|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1666|     37|}
ua_types_encoding_xml.c:Variant_decodeXml:
 1856|  4.57k|DECODE_XML(Variant) {
 1857|  4.57k|    UA_Variant *dst = (UA_Variant*)dst_;
 1858|  4.57k|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  941|  4.57k|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (941:8): [True: 0, False: 4.57k]
  |  |  ------------------
  |  |  942|  4.57k|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  943|  4.57k|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (943:18): [Folded, False: 4.57k]
  |  |  ------------------
  ------------------
 1859|       |
 1860|  4.57k|    if(ctx->depth >= UA_XML_ENCODING_MAX_RECURSION)
  ------------------
  |  |   15|  4.57k|#define UA_XML_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (1860:8): [True: 0, False: 4.57k]
  ------------------
 1861|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 1862|       |
 1863|  4.57k|    xml_token *tok = &ctx->tokens[ctx->index];
 1864|  4.57k|    if(tok->children == 0)
  ------------------
  |  Branch (1864:8): [True: 50, False: 4.52k]
  ------------------
 1865|     50|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     50|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1866|  4.52k|    if(tok->children != 1 || ctx->index + 2 >= ctx->tokensSize)
  ------------------
  |  Branch (1866:8): [True: 134, False: 4.39k]
  |  Branch (1866:30): [True: 2, False: 4.39k]
  ------------------
 1867|    136|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|    136|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1868|       |
 1869|  4.39k|    ctx->index += 1 + ctx->tokens[ctx->index].attributes;
 1870|  4.39k|    tok = &ctx->tokens[ctx->index];
 1871|  4.39k|    static UA_String valName = UA_STRING_STATIC("Value");
  ------------------
  |  |  224|  4.39k|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1872|  4.39k|    if(!UA_String_equal(&tok->name, &valName))
  ------------------
  |  Branch (1872:8): [True: 54, False: 4.33k]
  ------------------
 1873|     54|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     54|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1874|  4.33k|    return decodeXmlVariantValue(ctx, dst);
 1875|  4.39k|}
ua_types_encoding_xml.c:DiagnosticInfo_decodeXml:
 1919|      2|DECODE_XML(DiagnosticInfo) {
 1920|      2|    UA_DiagnosticInfo *dst = (UA_DiagnosticInfo*)dst_;
 1921|      2|    XmlDecodeEntry entries[7] = {
 1922|      2|        {UA_STRING_STATIC("SymbolicId"), &dst->symbolicId, NULL, false,
  ------------------
  |  |  224|      2|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1923|      2|         &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  198|      2|#define UA_TYPES_INT32 5
  ------------------
 1924|      2|        {UA_STRING_STATIC("NamespaceUri"), &dst->namespaceUri, NULL, false,
  ------------------
  |  |  224|      2|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1925|      2|         &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  198|      2|#define UA_TYPES_INT32 5
  ------------------
 1926|      2|        {UA_STRING_STATIC("LocalizedText"), &dst->localizedText, NULL, false,
  ------------------
  |  |  224|      2|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1927|      2|         &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  198|      2|#define UA_TYPES_INT32 5
  ------------------
 1928|      2|        {UA_STRING_STATIC("Locale"), &dst->locale, NULL, false,
  ------------------
  |  |  224|      2|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1929|      2|         &UA_TYPES[UA_TYPES_INT32]},
  ------------------
  |  |  198|      2|#define UA_TYPES_INT32 5
  ------------------
 1930|      2|        {UA_STRING_STATIC("AdditionalInfo"), &dst->additionalInfo, NULL, false,
  ------------------
  |  |  224|      2|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1931|      2|         &UA_TYPES[UA_TYPES_STRING]},
  ------------------
  |  |  402|      2|#define UA_TYPES_STRING 11
  ------------------
 1932|      2|        {UA_STRING_STATIC("InnerStatusCode"), &dst->innerStatusCode, NULL, false,
  ------------------
  |  |  224|      2|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1933|      2|         &UA_TYPES[UA_TYPES_STATUSCODE]},
  ------------------
  |  |  640|      2|#define UA_TYPES_STATUSCODE 18
  ------------------
 1934|      2|        {UA_STRING_STATIC("InnerDiagnosticInfo"), &dst->innerDiagnosticInfo,
  ------------------
  |  |  224|      2|#define UA_STRING_STATIC(CHARS) {sizeof(CHARS)-1, (UA_Byte*)CHARS}
  ------------------
 1935|      2|         DiagnosticInfoInner_decodeXml, false, NULL}
 1936|      2|    };
 1937|      2|    status ret = decodeXmlFields(ctx, entries, 7);
 1938|      2|    dst->hasSymbolicId = entries[0].found;
 1939|      2|    dst->hasNamespaceUri = entries[1].found;
 1940|      2|    dst->hasLocalizedText = entries[2].found;
 1941|      2|    dst->hasLocale = entries[3].found;
 1942|      2|    dst->hasAdditionalInfo = entries[4].found;
 1943|      2|    dst->hasInnerStatusCode = entries[5].found;
 1944|      2|    dst->hasInnerDiagnosticInfo = entries[6].found;
 1945|      2|    return ret;
 1946|      2|}
ua_types_encoding_xml.c:Enum_decodeXml:
 1093|     22|Enum_decodeXml(ParseCtxXml *ctx, void *dst, const UA_DataType *type) {
 1094|     22|    CHECK_DATA_BOUNDS;
  ------------------
  |  |  941|     22|    if(ctx->index >= ctx->tokensSize)               \
  |  |  ------------------
  |  |  |  Branch (941:8): [True: 0, False: 22]
  |  |  ------------------
  |  |  942|     22|        return UA_STATUSCODE_BADDECODINGERROR;      \
  |  |  ------------------
  |  |  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  |  |  ------------------
  |  |  943|     22|    do { } while(0)
  |  |  ------------------
  |  |  |  Branch (943:18): [Folded, False: 22]
  |  |  ------------------
  ------------------
 1095|     22|    GET_ELEM_CONTENT;
  ------------------
  |  |  946|     22|    const UA_Byte *data = ctx->tokens[ctx->index].content.data;    \
  |  |  947|     22|    size_t length = ctx->tokens[ctx->index].content.length;        \
  |  |  948|     22|    do {} while(0)
  |  |  ------------------
  |  |  |  Branch (948:17): [Folded, False: 22]
  |  |  ------------------
  ------------------
 1096|     22|    skipXmlObject(ctx);
 1097|       |
 1098|    166|    for(size_t i = 0; i < type->membersSize; i++) {
  ------------------
  |  Branch (1098:23): [True: 144, False: 22]
  ------------------
 1099|    144|        const UA_DataTypeMember *m = &type->members[i];
 1100|    144|        size_t nameLength = strlen(m->memberName);
 1101|    144|        if(length <= nameLength + 1 || data[nameLength] != '_' ||
  ------------------
  |  Branch (1101:12): [True: 144, False: 0]
  |  Branch (1101:40): [True: 0, False: 0]
  ------------------
 1102|      0|           memcmp(data, m->memberName, nameLength) != 0)
  ------------------
  |  Branch (1102:12): [True: 0, False: 0]
  ------------------
 1103|    144|            continue;
 1104|      0|        UA_Int64 value = 0;
 1105|      0|        UA_StatusCode ret = decodeSigned(&data[nameLength + 1],
 1106|      0|                                         length - nameLength - 1, &value);
 1107|      0|        UA_Int32 expected = (UA_Int32)(uintptr_t)m->memberType;
 1108|      0|        if(ret == UA_STATUSCODE_GOOD && value == expected) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (1108:12): [True: 0, False: 0]
  |  Branch (1108:41): [True: 0, False: 0]
  ------------------
 1109|      0|            *(UA_Int32*)dst = expected;
 1110|      0|            return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1111|      0|        }
 1112|      0|    }
 1113|       |
 1114|       |    /* Be lenient with XML produced by implementations that encode enum values
 1115|       |     * as bare integers instead of the schema-defined "Name_Value" form. */
 1116|     22|    UA_Int64 value = 0;
 1117|     22|    UA_StatusCode ret = decodeSigned(data, length, &value);
 1118|     22|    if(ret == UA_STATUSCODE_GOOD && value >= UA_INT32_MIN && value <= UA_INT32_MAX) {
  ------------------
  |  |   17|     44|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
                  if(ret == UA_STATUSCODE_GOOD && value >= UA_INT32_MIN && value <= UA_INT32_MAX) {
  ------------------
  |  |  100|     22|#define UA_INT32_MIN ((int32_t)-2147483648LL)
  ------------------
                  if(ret == UA_STATUSCODE_GOOD && value >= UA_INT32_MIN && value <= UA_INT32_MAX) {
  ------------------
  |  |  101|      0|#define UA_INT32_MAX 2147483647L
  ------------------
  |  Branch (1118:8): [True: 0, False: 22]
  |  Branch (1118:37): [True: 0, False: 0]
  |  Branch (1118:62): [True: 0, False: 0]
  ------------------
 1119|      0|        *(UA_Int32*)dst = (UA_Int32)value;
 1120|      0|        return UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1121|      0|    }
 1122|     22|    return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|     22|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
 1123|     22|}
ua_types_encoding_xml.c:decodeXmlStructure:
 1951|    152|decodeXmlStructure(ParseCtxXml *ctx, void *dst, const UA_DataType *type) {
 1952|       |    /* Check the recursion limit */
 1953|    152|    if(ctx->depth >= UA_XML_ENCODING_MAX_RECURSION - 1)
  ------------------
  |  |   15|    152|#define UA_XML_ENCODING_MAX_RECURSION 100
  ------------------
  |  Branch (1953:8): [True: 0, False: 152]
  ------------------
 1954|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 1955|    152|    ctx->depth++;
 1956|       |
 1957|    152|    uintptr_t ptr = (uintptr_t)dst;
 1958|    152|    status ret = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|    152|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
 1959|    152|    size_t membersSize = type->membersSize;
 1960|    152|    UA_STACKARRAY(XmlDecodeEntry, entries, membersSize);
  ------------------
  |  |  375|    152|#  define UA_STACKARRAY(TYPE, NAME, SIZE) TYPE NAME[SIZE]
  ------------------
 1961|    928|    for(size_t i = 0; i < membersSize; ++i) {
  ------------------
  |  Branch (1961:23): [True: 776, False: 152]
  ------------------
 1962|    776|        const UA_DataTypeMember *m = &type->members[i];
 1963|    776|        const UA_DataType *mt = m->memberType;
 1964|    776|        entries[i].type = mt;
 1965|    776|        entries[i].name = UA_STRING((char*)(uintptr_t)m->memberName);
 1966|    776|        entries[i].found = false;
 1967|    776|        ptr += m->padding;
 1968|    776|        entries[i].fieldPointer = (void*)ptr;
 1969|    776|        if(!m->isArray && !m->isOptional) {
  ------------------
  |  Branch (1969:12): [True: 642, False: 134]
  |  Branch (1969:27): [True: 642, False: 0]
  ------------------
 1970|    642|            entries[i].function = NULL;
 1971|    642|            ptr += mt->memSize;
 1972|    642|        } else if(m->isArray) {
  ------------------
  |  Branch (1972:19): [True: 134, False: 0]
  ------------------
 1973|    134|            entries[i].function = Array_decodeXml;
 1974|    134|            ptr += sizeof(size_t) + sizeof(void*);
 1975|    134|        } else {
 1976|      0|            entries[i].function = Optional_decodeXml;
 1977|      0|            ptr += sizeof(void*);
 1978|      0|        }
 1979|    776|    }
 1980|       |
 1981|    152|    ret = decodeXmlFields(ctx, entries, membersSize);
 1982|       |
 1983|    152|    if(ctx->depth == 0)
  ------------------
  |  Branch (1983:8): [True: 0, False: 152]
  ------------------
 1984|      0|        return UA_STATUSCODE_BADENCODINGERROR;
  ------------------
  |  |   41|      0|#define UA_STATUSCODE_BADENCODINGERROR ((UA_StatusCode) 0x80060000)
  ------------------
 1985|    152|    ctx->depth--;
 1986|    152|    return ret;
 1987|    152|}

UA_Guid_parse:
   86|      1|UA_Guid_parse(UA_Guid *guid, const UA_String str) {
   87|      1|    UA_StatusCode res = parse_guid(guid, str.data, str.data + str.length);
   88|      1|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|      1|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (88:8): [True: 1, False: 0]
  ------------------
   89|      1|        *guid = UA_GUID_NULL;
   90|      1|    return res;
   91|      1|}
UA_NodeId_parseEx:
  323|     76|                  const UA_NamespaceMapping *nsMapping) {
  324|     76|    UA_StatusCode res =
  325|     76|        parse_nodeid(id, str.data, str.data+str.length, UA_ESCAPING_NONE, nsMapping);
  326|     76|    if(res != UA_STATUSCODE_GOOD)
  ------------------
  |  |   17|     76|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (326:8): [True: 0, False: 76]
  ------------------
  327|      0|        UA_NodeId_clear(id);
  328|     76|    return res;
  329|     76|}
ua_types_lex.c:parse_guid:
   50|      1|parse_guid(UA_Guid *guid, const UA_Byte *s, const UA_Byte *e) {
   51|      1|    size_t len = (size_t)(e - s);
   52|      1|    if(len != 36 || s[8] != '-' || s[13] != '-' || s[23] != '-')
  ------------------
  |  Branch (52:8): [True: 1, False: 0]
  |  Branch (52:21): [True: 0, False: 0]
  |  Branch (52:36): [True: 0, False: 0]
  |  Branch (52:52): [True: 0, False: 0]
  ------------------
   53|      1|        return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      1|#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;
  ------------------
  |  |   44|      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;
  ------------------
  |  |   44|      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;
  ------------------
  |  |   44|      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;
  ------------------
  |  |   44|      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;
  ------------------
  |  |   44|      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;
  ------------------
  |  |   44|      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;
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
   83|      0|}
ua_types_lex.c:parse_nodeid:
  148|     76|             UA_Escaping idEsc, const UA_NamespaceMapping *nsMapping) {
  149|     76|    *id = UA_NODEID_NULL; /* Reset the NodeId */
  150|     76|    LexContext context;
  151|     76|    memset(&context, 0, sizeof(LexContext));
  152|     76|    UA_Byte *begin = (UA_Byte*)(uintptr_t)pos;
  153|     76|    const u8 *ns = NULL, *nsu = NULL, *body = NULL;
  154|       |
  155|       |    
  156|     76|{
  157|     76|	u8 yych;
  158|     76|	yych = YYPEEK();
  ------------------
  |  |   33|     76|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|     76|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|     76|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 76, False: 0]
  |  |  ------------------
  ------------------
  159|     76|	switch (yych) {
  160|      0|		case 'b':
  ------------------
  |  Branch (160:3): [True: 0, False: 76]
  ------------------
  161|      0|		case 'g':
  ------------------
  |  Branch (161:3): [True: 0, False: 76]
  ------------------
  162|     76|		case 'i':
  ------------------
  |  Branch (162:3): [True: 76, False: 0]
  ------------------
  163|     76|		case 's':
  ------------------
  |  Branch (163:3): [True: 0, False: 76]
  ------------------
  164|     76|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|     76|#define YYSTAGN(t) t = NULL
  ------------------
  165|     76|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|     76|#define YYSTAGN(t) t = NULL
  ------------------
  166|     76|			goto yy3;
  167|      0|		case 'n': goto yy4;
  ------------------
  |  Branch (167:3): [True: 0, False: 76]
  ------------------
  168|      0|		default: goto yy1;
  ------------------
  |  Branch (168:3): [True: 0, False: 76]
  ------------------
  169|     76|	}
  170|      0|yy1:
  171|      0|	YYSKIP();
  ------------------
  |  |   35|      0|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  172|      0|yy2:
  173|      0|	{ (void)pos; return UA_STATUSCODE_BADDECODINGERROR; }
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  174|     76|yy3:
  175|     76|	YYSKIP();
  ------------------
  |  |   35|     76|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|     76|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  176|     76|	yych = YYPEEK();
  ------------------
  |  |   33|     76|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|     76|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|     76|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 76, False: 0]
  |  |  ------------------
  ------------------
  177|     76|	switch (yych) {
  178|     76|		case '=': goto yy5;
  ------------------
  |  Branch (178:3): [True: 76, False: 0]
  ------------------
  179|      0|		default: goto yy2;
  ------------------
  |  Branch (179:3): [True: 0, False: 76]
  ------------------
  180|     76|	}
  181|      0|yy4:
  182|      0|	YYSKIP();
  ------------------
  |  |   35|      0|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  183|      0|	YYBACKUP();
  ------------------
  |  |   36|      0|#define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   32|      0|#define YYMARKER context.marker
  |  |  ------------------
  |  |               #define YYBACKUP() YYMARKER = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  184|      0|	yych = YYPEEK();
  ------------------
  |  |   33|      0|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  185|      0|	switch (yych) {
  186|      0|		case 's': goto yy6;
  ------------------
  |  Branch (186:3): [True: 0, False: 0]
  ------------------
  187|      0|		default: goto yy2;
  ------------------
  |  Branch (187:3): [True: 0, False: 0]
  ------------------
  188|      0|	}
  189|     76|yy5:
  190|     76|	YYSKIP();
  ------------------
  |  |   35|     76|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|     76|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  191|     76|	nsu = context.yyt2;
  192|     76|	ns = context.yyt1;
  193|     76|	YYSTAGP(body);
  ------------------
  |  |   38|     76|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|     76|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  194|     76|	YYSHIFTSTAG(body, -2);
  ------------------
  |  |   40|     76|#define YYSHIFTSTAG(t, shift) t += shift
  ------------------
  195|     76|	{ goto match; }
  196|      0|yy6:
  197|      0|	YYSKIP();
  ------------------
  |  |   35|      0|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  198|      0|	yych = YYPEEK();
  ------------------
  |  |   33|      0|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  199|      0|	switch (yych) {
  200|      0|		case '=': goto yy8;
  ------------------
  |  Branch (200:3): [True: 0, False: 0]
  ------------------
  201|      0|		case 'u': goto yy9;
  ------------------
  |  Branch (201:3): [True: 0, False: 0]
  ------------------
  202|      0|		default: goto yy7;
  ------------------
  |  Branch (202:3): [True: 0, False: 0]
  ------------------
  203|      0|	}
  204|      0|yy7:
  205|      0|	YYRESTORE();
  ------------------
  |  |   37|      0|#define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYRESTORE() YYCURSOR = YYMARKER
  |  |  ------------------
  |  |  |  |   32|      0|#define YYMARKER context.marker
  |  |  ------------------
  ------------------
  206|      0|	goto yy2;
  207|      0|yy8:
  208|      0|	YYSKIP();
  ------------------
  |  |   35|      0|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  209|      0|	yych = YYPEEK();
  ------------------
  |  |   33|      0|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  210|      0|	switch (yych) {
  211|      0|		case '0':
  ------------------
  |  Branch (211:3): [True: 0, False: 0]
  ------------------
  212|      0|		case '1':
  ------------------
  |  Branch (212:3): [True: 0, False: 0]
  ------------------
  213|      0|		case '2':
  ------------------
  |  Branch (213:3): [True: 0, False: 0]
  ------------------
  214|      0|		case '3':
  ------------------
  |  Branch (214:3): [True: 0, False: 0]
  ------------------
  215|      0|		case '4':
  ------------------
  |  Branch (215:3): [True: 0, False: 0]
  ------------------
  216|      0|		case '5':
  ------------------
  |  Branch (216:3): [True: 0, False: 0]
  ------------------
  217|      0|		case '6':
  ------------------
  |  Branch (217:3): [True: 0, False: 0]
  ------------------
  218|      0|		case '7':
  ------------------
  |  Branch (218:3): [True: 0, False: 0]
  ------------------
  219|      0|		case '8':
  ------------------
  |  Branch (219:3): [True: 0, False: 0]
  ------------------
  220|      0|		case '9':
  ------------------
  |  Branch (220:3): [True: 0, False: 0]
  ------------------
  221|      0|			YYSTAGP(context.yyt1);
  ------------------
  |  |   38|      0|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  222|      0|			goto yy10;
  223|      0|		default: goto yy7;
  ------------------
  |  Branch (223:3): [True: 0, False: 0]
  ------------------
  224|      0|	}
  225|      0|yy9:
  226|      0|	YYSKIP();
  ------------------
  |  |   35|      0|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  227|      0|	yych = YYPEEK();
  ------------------
  |  |   33|      0|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  228|      0|	switch (yych) {
  229|      0|		case '=': goto yy11;
  ------------------
  |  Branch (229:3): [True: 0, False: 0]
  ------------------
  230|      0|		default: goto yy7;
  ------------------
  |  Branch (230:3): [True: 0, False: 0]
  ------------------
  231|      0|	}
  232|      0|yy10:
  233|      0|	YYSKIP();
  ------------------
  |  |   35|      0|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  234|      0|	yych = YYPEEK();
  ------------------
  |  |   33|      0|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  235|      0|	switch (yych) {
  236|      0|		case '0':
  ------------------
  |  Branch (236:3): [True: 0, False: 0]
  ------------------
  237|      0|		case '1':
  ------------------
  |  Branch (237:3): [True: 0, False: 0]
  ------------------
  238|      0|		case '2':
  ------------------
  |  Branch (238:3): [True: 0, False: 0]
  ------------------
  239|      0|		case '3':
  ------------------
  |  Branch (239:3): [True: 0, False: 0]
  ------------------
  240|      0|		case '4':
  ------------------
  |  Branch (240:3): [True: 0, False: 0]
  ------------------
  241|      0|		case '5':
  ------------------
  |  Branch (241:3): [True: 0, False: 0]
  ------------------
  242|      0|		case '6':
  ------------------
  |  Branch (242:3): [True: 0, False: 0]
  ------------------
  243|      0|		case '7':
  ------------------
  |  Branch (243:3): [True: 0, False: 0]
  ------------------
  244|      0|		case '8':
  ------------------
  |  Branch (244:3): [True: 0, False: 0]
  ------------------
  245|      0|		case '9': goto yy10;
  ------------------
  |  Branch (245:3): [True: 0, False: 0]
  ------------------
  246|      0|		case ';':
  ------------------
  |  Branch (246:3): [True: 0, False: 0]
  ------------------
  247|      0|			YYSTAGN(context.yyt2);
  ------------------
  |  |   39|      0|#define YYSTAGN(t) t = NULL
  ------------------
  248|      0|			goto yy12;
  249|      0|		default: goto yy7;
  ------------------
  |  Branch (249:3): [True: 0, False: 0]
  ------------------
  250|      0|	}
  251|      0|yy11:
  252|      0|	YYSKIP();
  ------------------
  |  |   35|      0|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  253|      0|	yych = YYPEEK();
  ------------------
  |  |   33|      0|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  254|      0|	switch (yych) {
  255|      0|		case 0x00: goto yy7;
  ------------------
  |  Branch (255:3): [True: 0, False: 0]
  ------------------
  256|      0|		case ';':
  ------------------
  |  Branch (256:3): [True: 0, False: 0]
  ------------------
  257|      0|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|      0|#define YYSTAGN(t) t = NULL
  ------------------
  258|      0|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|      0|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  259|      0|			goto yy12;
  260|      0|		default:
  ------------------
  |  Branch (260:3): [True: 0, False: 0]
  ------------------
  261|      0|			YYSTAGP(context.yyt2);
  ------------------
  |  |   38|      0|#define YYSTAGP(t) t = YYCURSOR
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  262|      0|			goto yy13;
  263|      0|	}
  264|      0|yy12:
  265|      0|	YYSKIP();
  ------------------
  |  |   35|      0|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  266|      0|	yych = YYPEEK();
  ------------------
  |  |   33|      0|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  267|      0|	switch (yych) {
  268|      0|		case 'b':
  ------------------
  |  Branch (268:3): [True: 0, False: 0]
  ------------------
  269|      0|		case 'g':
  ------------------
  |  Branch (269:3): [True: 0, False: 0]
  ------------------
  270|      0|		case 'i':
  ------------------
  |  Branch (270:3): [True: 0, False: 0]
  ------------------
  271|      0|		case 's': goto yy14;
  ------------------
  |  Branch (271:3): [True: 0, False: 0]
  ------------------
  272|      0|		default: goto yy7;
  ------------------
  |  Branch (272:3): [True: 0, False: 0]
  ------------------
  273|      0|	}
  274|      0|yy13:
  275|      0|	YYSKIP();
  ------------------
  |  |   35|      0|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  276|      0|	yych = YYPEEK();
  ------------------
  |  |   33|      0|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  277|      0|	switch (yych) {
  278|      0|		case 0x00: goto yy7;
  ------------------
  |  Branch (278:3): [True: 0, False: 0]
  ------------------
  279|      0|		case ';':
  ------------------
  |  Branch (279:3): [True: 0, False: 0]
  ------------------
  280|      0|			YYSTAGN(context.yyt1);
  ------------------
  |  |   39|      0|#define YYSTAGN(t) t = NULL
  ------------------
  281|      0|			goto yy12;
  282|      0|		default: goto yy13;
  ------------------
  |  Branch (282:3): [True: 0, False: 0]
  ------------------
  283|      0|	}
  284|      0|yy14:
  285|      0|	YYSKIP();
  ------------------
  |  |   35|      0|#define YYSKIP() ++YYCURSOR;
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  ------------------
  286|      0|	yych = YYPEEK();
  ------------------
  |  |   33|      0|#define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  |  |               #define YYPEEK() (YYCURSOR < end) ? *YYCURSOR : 0 /* The lexer sees a stream of
  |  |  ------------------
  |  |  |  |   31|      0|#define YYCURSOR pos
  |  |  ------------------
  |  |  |  Branch (33:18): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  287|      0|	switch (yych) {
  288|      0|		case '=': goto yy5;
  ------------------
  |  Branch (288:3): [True: 0, False: 0]
  ------------------
  289|      0|		default: goto yy7;
  ------------------
  |  Branch (289:3): [True: 0, False: 0]
  ------------------
  290|      0|	}
  291|      0|}
  292|       |
  293|       |
  294|     76| match:
  295|     76|    if(nsu) {
  ------------------
  |  Branch (295:8): [True: 0, False: 76]
  ------------------
  296|       |        /* NamespaceUri */
  297|      0|        UA_String nsUri = {(size_t)(body - 1 - nsu), (UA_Byte*)(uintptr_t)nsu};
  298|      0|        UA_StatusCode res = escapedUri2Index(nsUri, &id->namespaceIndex, nsMapping);
  299|      0|        if(res != UA_STATUSCODE_GOOD) {
  ------------------
  |  |   17|      0|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  |  Branch (299:12): [True: 0, False: 0]
  ------------------
  300|       |            /* Return the entire NodeId string s=... */
  301|      0|            UA_String total = {(size_t)((const UA_Byte*)end - begin), begin};
  302|      0|            id->identifierType = UA_NODEIDTYPE_STRING;
  303|      0|            return UA_String_copy(&total, &id->identifier.string);
  304|      0|        }
  305|     76|    } else if(ns) {
  ------------------
  |  Branch (305:15): [True: 0, False: 76]
  ------------------
  306|       |        /* NamespaceIndex */
  307|      0|        UA_UInt32 tmp;
  308|      0|        size_t len = (size_t)(body - 1 - ns);
  309|      0|        if(UA_readNumber((const UA_Byte*)ns, len, &tmp) != len)
  ------------------
  |  Branch (309:12): [True: 0, False: 0]
  ------------------
  310|      0|            return UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  311|      0|        id->namespaceIndex = (UA_UInt16)tmp;
  312|      0|        if(nsMapping)
  ------------------
  |  Branch (312:12): [True: 0, False: 0]
  ------------------
  313|      0|            id->namespaceIndex =
  314|      0|                UA_NamespaceMapping_remote2Local(nsMapping, id->namespaceIndex);
  315|      0|    }
  316|       |
  317|       |    /* From the current position until the end */
  318|     76|    return parse_nodeid_body(id, body, end, idEsc);
  319|     76|}
ua_types_lex.c:parse_nodeid_body:
  109|     76|parse_nodeid_body(UA_NodeId *id, const u8 *body, const u8 *end, UA_Escaping esc) {
  110|     76|    UA_StatusCode res = UA_STATUSCODE_GOOD;
  ------------------
  |  |   17|     76|#define UA_STATUSCODE_GOOD ((UA_StatusCode) 0x00000000)
  ------------------
  111|     76|    UA_String str = {(size_t)(end - (body+2)), (UA_Byte*)(uintptr_t)body + 2};
  112|     76|    switch(*body) {
  113|     76|    case 'i':
  ------------------
  |  Branch (113:5): [True: 76, False: 0]
  ------------------
  114|     76|        id->identifierType = UA_NODEIDTYPE_NUMERIC;
  115|     76|        if(UA_readNumber(str.data, str.length, &id->identifier.numeric) != str.length)
  ------------------
  |  Branch (115:12): [True: 0, False: 76]
  ------------------
  116|      0|            res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  117|     76|        break;
  118|      0|    case 's':
  ------------------
  |  Branch (118:5): [True: 0, False: 76]
  ------------------
  119|      0|        id->identifierType = UA_NODEIDTYPE_STRING;
  120|      0|        res |= UA_String_copy(&str, &id->identifier.string);
  121|      0|        res |= UA_String_unescape(&id->identifier.string, false, esc);
  122|      0|        break;
  123|      0|    case 'g':
  ------------------
  |  Branch (123:5): [True: 0, False: 76]
  ------------------
  124|      0|        id->identifierType = UA_NODEIDTYPE_GUID;
  125|      0|        res = parse_guid(&id->identifier.guid, str.data, end);
  126|      0|        break;
  127|      0|    case 'b':
  ------------------
  |  Branch (127:5): [True: 0, False: 76]
  ------------------
  128|       |        /* For percent-escaping, base64url bytestring encoding is used. That
  129|       |         * doesn't need to be escaped here. The and-escaping is not applied to
  130|       |         * the NodeId identifier part. */
  131|      0|        id->identifierType = UA_NODEIDTYPE_BYTESTRING;
  132|      0|        id->identifier.byteString.data =
  133|      0|            UA_unbase64(str.data, str.length, &id->identifier.byteString.length);
  134|      0|        if(!id->identifier.byteString.data) {
  ------------------
  |  Branch (134:12): [True: 0, False: 0]
  ------------------
  135|      0|            UA_assert(id->identifier.byteString.length == 0);
  ------------------
  |  |  399|      0|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (135:13): [True: 0, False: 0]
  ------------------
  136|      0|            res = UA_STATUSCODE_BADDECODINGERROR; /* Returned on error by UA_unbase64 */
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  137|      0|        }
  138|      0|        break;
  139|      0|    default:
  ------------------
  |  Branch (139:5): [True: 0, False: 76]
  ------------------
  140|      0|        res = UA_STATUSCODE_BADDECODINGERROR;
  ------------------
  |  |   44|      0|#define UA_STATUSCODE_BADDECODINGERROR ((UA_StatusCode) 0x80070000)
  ------------------
  141|      0|        break;
  142|     76|    }
  143|     76|    return res;
  144|     76|}

UA_readNumberWithBase:
  111|     76|UA_readNumberWithBase(const UA_Byte *buf, size_t buflen, UA_UInt32 *number, UA_Byte base) {
  112|     76|    UA_assert(buf);
  ------------------
  |  |  399|     76|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (112:5): [True: 76, False: 0]
  ------------------
  113|     76|    UA_assert(number);
  ------------------
  |  |  399|     76|# define UA_assert(ignore) assert(ignore)
  ------------------
  |  Branch (113:5): [True: 76, False: 0]
  ------------------
  114|     76|    u32 n = 0;
  115|     76|    size_t progress = 0;
  116|       |    /* read numbers until the end or a non-number character appears */
  117|    341|    while(progress < buflen) {
  ------------------
  |  Branch (117:11): [True: 265, False: 76]
  ------------------
  118|    265|        u8 c = buf[progress];
  119|    265|        if(c >= '0' && c <= '9' && c <= '0' + (base-1))
  ------------------
  |  Branch (119:12): [True: 265, False: 0]
  |  Branch (119:24): [True: 265, False: 0]
  |  Branch (119:36): [True: 265, False: 0]
  ------------------
  120|    265|           n = (n * base) + c - '0';
  121|      0|        else if(base > 9 && c >= 'a' && c <= 'z' && c <= 'a' + (base-11))
  ------------------
  |  Branch (121:17): [True: 0, False: 0]
  |  Branch (121:29): [True: 0, False: 0]
  |  Branch (121:41): [True: 0, False: 0]
  |  Branch (121:53): [True: 0, False: 0]
  ------------------
  122|      0|           n = (n * base) + c-'a' + 10;
  123|      0|        else if(base > 9 && c >= 'A' && c <= 'Z' && c <= 'A' + (base-11))
  ------------------
  |  Branch (123:17): [True: 0, False: 0]
  |  Branch (123:29): [True: 0, False: 0]
  |  Branch (123:41): [True: 0, False: 0]
  |  Branch (123:53): [True: 0, False: 0]
  ------------------
  124|      0|           n = (n * base) + c-'A' + 10;
  125|      0|        else
  126|      0|           break;
  127|    265|        ++progress;
  128|    265|    }
  129|     76|    *number = n;
  130|     76|    return progress;
  131|     76|}
UA_readNumber:
  134|     76|UA_readNumber(const UA_Byte *buf, size_t buflen, UA_UInt32 *number) {
  135|     76|    return UA_readNumberWithBase(buf, buflen, number, 10);
  136|     76|}

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

fuzz_xml_decode_encode.cc:_ZL15UA_Variant_initP10UA_Variant:
  243|  7.76k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_xml_decode_encode.cc:_ZL16UA_Variant_clearP10UA_Variant:
  243|  3.18k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
fuzz_xml_decode_encode.cc:_ZL19UA_ByteString_clearP9UA_String:
  243|  3.13k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_ByteString_init:
  243|  3.67k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types.c:UA_ExtensionObject_init:
  243|    304|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_clear:
  243|    229|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_copy:
  243|    476|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_init:
  243|      1|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_String_equal:
  243|  8.87k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_NodeId_equal:
  243|  37.6k|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl
ua_types_encoding_xml.c:UA_ExtensionObject_clear:
  243|     76|# define UA_INLINABLE(decl, impl) static UA_INLINE decl impl

