_ZN19WitnessV0ScriptHashC2ERK7CScript:
   45|  2.23k|{
   46|  2.23k|    CSHA256().Write(in.data(), in.size()).Finalize(begin());
   47|  2.23k|}
_Z23GetScriptForDestinationRKNSt3__17variantIJ14CNoDestination17PubKeyDestination6PKHash10ScriptHash19WitnessV0ScriptHash16WitnessV0KeyHash16WitnessV1Taproot11PayToAnchor14WitnessUnknownEEE:
  167|  1.95k|{
  168|  1.95k|    return std::visit(CScriptVisitor(), dest);
  169|  1.95k|}
addresstype.cpp:_ZNK12_GLOBAL__N_114CScriptVisitorclERK16WitnessV1Taproot:
  142|  1.95k|    {
  143|  1.95k|        return CScript() << OP_1 << ToByteVector(tap);
  144|  1.95k|    }

_ZN16WitnessV1TaprootC2ERK11XOnlyPubKey:
   91|  1.95k|    explicit WitnessV1Taproot(const XOnlyPubKey& xpk) : XOnlyPubKey(xpk) {}

_ZN11ArgsManagerD2Ev:
  130|      2|ArgsManager::~ArgsManager() = default;

_Z17internal_bswap_32j:
   54|  1.61M|{
   55|  1.61M|#ifdef bitcoin_builtin_bswap32
   56|  1.61M|    return bitcoin_builtin_bswap32(x);
  ------------------
  |  |   24|  1.61M|#      define bitcoin_builtin_bswap32(x) __builtin_bswap32(x)
  ------------------
   57|       |#else
   58|       |    return (((x & 0xff000000U) >> 24) | ((x & 0x00ff0000U) >>  8) |
   59|       |            ((x & 0x0000ff00U) <<  8) | ((x & 0x000000ffU) << 24));
   60|       |#endif
   61|  1.61M|}
_Z17internal_bswap_64m:
   64|  17.6k|{
   65|  17.6k|#ifdef bitcoin_builtin_bswap64
   66|  17.6k|    return bitcoin_builtin_bswap64(x);
  ------------------
  |  |   27|  17.6k|#      define bitcoin_builtin_bswap64(x) __builtin_bswap64(x)
  ------------------
   67|       |#else
   68|       |     return (((x & 0xff00000000000000ull) >> 56)
   69|       |          | ((x & 0x00ff000000000000ull) >> 40)
   70|       |          | ((x & 0x0000ff0000000000ull) >> 24)
   71|       |          | ((x & 0x000000ff00000000ull) >> 8)
   72|       |          | ((x & 0x00000000ff000000ull) << 8)
   73|       |          | ((x & 0x0000000000ff0000ull) << 24)
   74|       |          | ((x & 0x000000000000ff00ull) << 40)
   75|       |          | ((x & 0x00000000000000ffull) << 56));
   76|       |#endif
   77|  17.6k|}

_Z16htole16_internalt:
   19|  1.27k|{
   20|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_16(host_16bits);
   21|  1.27k|        else return host_16bits;
   22|  1.27k|}
_Z16be32toh_internalj:
   44|  1.47M|{
   45|  1.47M|    if constexpr (std::endian::native == std::endian::little) return internal_bswap_32(big_endian_32bits);
   46|       |        else return big_endian_32bits;
   47|  1.47M|}
_Z16htobe32_internalj:
   34|   141k|{
   35|   141k|    if constexpr (std::endian::native == std::endian::little) return internal_bswap_32(host_32bits);
   36|       |        else return host_32bits;
   37|   141k|}
_Z16htole64_internalm:
   59|  5.93k|{
   60|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_64(host_64bits);
   61|  5.93k|        else return host_64bits;
   62|  5.93k|}
_Z16htobe64_internalm:
   54|  17.6k|{
   55|  17.6k|    if constexpr (std::endian::native == std::endian::little) return internal_bswap_64(host_64bits);
   56|       |        else return host_64bits;
   57|  17.6k|}
_Z16htole32_internalj:
   39|  29.6k|{
   40|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_32(host_32bits);
   41|  29.6k|        else return host_32bits;
   42|  29.6k|}
_Z16le32toh_internalj:
   49|  94.8k|{
   50|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_32(little_endian_32bits);
   51|  94.8k|        else return little_endian_32bits;
   52|  94.8k|}

_ZN15ChaCha20AlignedD2Ev:
   42|      4|{
   43|      4|    memory_cleanse(input, sizeof(input));
   44|      4|}
_ZN8ChaCha20D2Ev:
  332|      4|{
  333|      4|    memory_cleanse(m_buffer.data(), m_buffer.size());
  334|      4|}

_Z8ReadLE32ITk8ByteTypehEjPKT_:
   28|  94.8k|{
   29|  94.8k|    uint32_t x;
   30|  94.8k|    memcpy(&x, ptr, 4);
   31|  94.8k|    return le32toh_internal(x);
   32|  94.8k|}
_Z9WriteLE32ITk8ByteTypehEvPT_j:
   51|  29.6k|{
   52|  29.6k|    uint32_t v = htole32_internal(x);
   53|  29.6k|    memcpy(ptr, &v, 4);
   54|  29.6k|}
_Z8ReadBE32ITk8ByteTypehEjPKT_:
   73|  1.47M|{
   74|  1.47M|    uint32_t x;
   75|  1.47M|    memcpy(&x, ptr, 4);
   76|  1.47M|    return be32toh_internal(x);
   77|  1.47M|}
_Z9WriteBE32ITk8ByteTypehEvPT_j:
   96|   141k|{
   97|   141k|    uint32_t v = htobe32_internal(x);
   98|   141k|    memcpy(ptr, &v, 4);
   99|   141k|}
_Z9WriteLE64ITk8ByteTypehEvPT_m:
   58|  5.93k|{
   59|  5.93k|    uint64_t v = htole64_internal(x);
   60|  5.93k|    memcpy(ptr, &v, 8);
   61|  5.93k|}
_Z9WriteBE64ITk8ByteTypehEvPT_m:
  103|  17.6k|{
  104|  17.6k|    uint64_t v = htobe64_internal(x);
  105|  17.6k|    memcpy(ptr, &v, 8);
  106|  17.6k|}

_Z6HexStrNSt3__14spanIKhLm18446744073709551615EEE:
   31|  69.5k|{
   32|  69.5k|    std::string rv(s.size() * 2, '\0');
   33|  69.5k|    static constexpr auto byte_to_hex = CreateByteToHexMap();
   34|  69.5k|    static_assert(sizeof(byte_to_hex) == 512);
   35|       |
   36|  69.5k|    char* it = rv.data();
   37|   222k|    for (uint8_t v : s) {
  ------------------
  |  Branch (37:20): [True: 222k, False: 69.5k]
  ------------------
   38|   222k|        std::memcpy(it, byte_to_hex[v].data(), 2);
   39|   222k|        it += 2;
   40|   222k|    }
   41|       |
   42|  69.5k|    assert(it == rv.data() + rv.size());
  ------------------
  |  Branch (42:5): [True: 69.5k, False: 0]
  ------------------
   43|  69.5k|    return rv;
   44|  69.5k|}
_Z8HexDigitc:
   65|   759k|{
   66|   759k|    return p_util_hexdigit[(unsigned char)c];
   67|   759k|}

_ZN10CRIPEMD160C2Ev:
  243|  5.93k|{
  244|  5.93k|    ripemd160::Initialize(s);
  245|  5.93k|}
_ZN10CRIPEMD1605WriteEPKhm:
  248|  17.7k|{
  249|  17.7k|    const unsigned char* end = data + len;
  250|  17.7k|    size_t bufsize = bytes % 64;
  251|  17.7k|    if (bufsize && bufsize + len >= 64) {
  ------------------
  |  Branch (251:9): [True: 11.8k, False: 5.93k]
  |  Branch (251:20): [True: 5.93k, False: 5.93k]
  ------------------
  252|       |        // Fill the buffer, and process it.
  253|  5.93k|        memcpy(buf + bufsize, data, 64 - bufsize);
  254|  5.93k|        bytes += 64 - bufsize;
  255|  5.93k|        data += 64 - bufsize;
  256|  5.93k|        ripemd160::Transform(s, buf);
  257|  5.93k|        bufsize = 0;
  258|  5.93k|    }
  259|  17.7k|    while (end - data >= 64) {
  ------------------
  |  Branch (259:12): [True: 0, False: 17.7k]
  ------------------
  260|       |        // Process full chunks directly from the source.
  261|      0|        ripemd160::Transform(s, data);
  262|      0|        bytes += 64;
  263|      0|        data += 64;
  264|      0|    }
  265|  17.7k|    if (end > data) {
  ------------------
  |  Branch (265:9): [True: 11.8k, False: 5.93k]
  ------------------
  266|       |        // Fill the buffer with what remains.
  267|  11.8k|        memcpy(buf + bufsize, data, end - data);
  268|  11.8k|        bytes += end - data;
  269|  11.8k|    }
  270|  17.7k|    return *this;
  271|  17.7k|}
_ZN10CRIPEMD1608FinalizeEPh:
  274|  5.93k|{
  275|  5.93k|    static const unsigned char pad[64] = {0x80};
  276|  5.93k|    unsigned char sizedesc[8];
  277|  5.93k|    WriteLE64(sizedesc, bytes << 3);
  278|  5.93k|    Write(pad, 1 + ((119 - (bytes % 64)) % 64));
  279|  5.93k|    Write(sizedesc, 8);
  280|  5.93k|    WriteLE32(hash, s[0]);
  281|  5.93k|    WriteLE32(hash + 4, s[1]);
  282|  5.93k|    WriteLE32(hash + 8, s[2]);
  283|  5.93k|    WriteLE32(hash + 12, s[3]);
  284|  5.93k|    WriteLE32(hash + 16, s[4]);
  285|  5.93k|}
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd16010InitializeEPj:
   25|  5.93k|{
   26|  5.93k|    s[0] = 0x67452301ul;
   27|  5.93k|    s[1] = 0xEFCDAB89ul;
   28|  5.93k|    s[2] = 0x98BADCFEul;
   29|  5.93k|    s[3] = 0x10325476ul;
   30|  5.93k|    s[4] = 0xC3D2E1F0ul;
   31|  5.93k|}
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd1609TransformEPjPKh:
   55|  5.93k|{
   56|  5.93k|    uint32_t a1 = s[0], b1 = s[1], c1 = s[2], d1 = s[3], e1 = s[4];
   57|  5.93k|    uint32_t a2 = a1, b2 = b1, c2 = c1, d2 = d1, e2 = e1;
   58|  5.93k|    uint32_t w0 = ReadLE32(chunk + 0), w1 = ReadLE32(chunk + 4), w2 = ReadLE32(chunk + 8), w3 = ReadLE32(chunk + 12);
   59|  5.93k|    uint32_t w4 = ReadLE32(chunk + 16), w5 = ReadLE32(chunk + 20), w6 = ReadLE32(chunk + 24), w7 = ReadLE32(chunk + 28);
   60|  5.93k|    uint32_t w8 = ReadLE32(chunk + 32), w9 = ReadLE32(chunk + 36), w10 = ReadLE32(chunk + 40), w11 = ReadLE32(chunk + 44);
   61|  5.93k|    uint32_t w12 = ReadLE32(chunk + 48), w13 = ReadLE32(chunk + 52), w14 = ReadLE32(chunk + 56), w15 = ReadLE32(chunk + 60);
   62|       |
   63|  5.93k|    R11(a1, b1, c1, d1, e1, w0, 11);
   64|  5.93k|    R12(a2, b2, c2, d2, e2, w5, 8);
   65|  5.93k|    R11(e1, a1, b1, c1, d1, w1, 14);
   66|  5.93k|    R12(e2, a2, b2, c2, d2, w14, 9);
   67|  5.93k|    R11(d1, e1, a1, b1, c1, w2, 15);
   68|  5.93k|    R12(d2, e2, a2, b2, c2, w7, 9);
   69|  5.93k|    R11(c1, d1, e1, a1, b1, w3, 12);
   70|  5.93k|    R12(c2, d2, e2, a2, b2, w0, 11);
   71|  5.93k|    R11(b1, c1, d1, e1, a1, w4, 5);
   72|  5.93k|    R12(b2, c2, d2, e2, a2, w9, 13);
   73|  5.93k|    R11(a1, b1, c1, d1, e1, w5, 8);
   74|  5.93k|    R12(a2, b2, c2, d2, e2, w2, 15);
   75|  5.93k|    R11(e1, a1, b1, c1, d1, w6, 7);
   76|  5.93k|    R12(e2, a2, b2, c2, d2, w11, 15);
   77|  5.93k|    R11(d1, e1, a1, b1, c1, w7, 9);
   78|  5.93k|    R12(d2, e2, a2, b2, c2, w4, 5);
   79|  5.93k|    R11(c1, d1, e1, a1, b1, w8, 11);
   80|  5.93k|    R12(c2, d2, e2, a2, b2, w13, 7);
   81|  5.93k|    R11(b1, c1, d1, e1, a1, w9, 13);
   82|  5.93k|    R12(b2, c2, d2, e2, a2, w6, 7);
   83|  5.93k|    R11(a1, b1, c1, d1, e1, w10, 14);
   84|  5.93k|    R12(a2, b2, c2, d2, e2, w15, 8);
   85|  5.93k|    R11(e1, a1, b1, c1, d1, w11, 15);
   86|  5.93k|    R12(e2, a2, b2, c2, d2, w8, 11);
   87|  5.93k|    R11(d1, e1, a1, b1, c1, w12, 6);
   88|  5.93k|    R12(d2, e2, a2, b2, c2, w1, 14);
   89|  5.93k|    R11(c1, d1, e1, a1, b1, w13, 7);
   90|  5.93k|    R12(c2, d2, e2, a2, b2, w10, 14);
   91|  5.93k|    R11(b1, c1, d1, e1, a1, w14, 9);
   92|  5.93k|    R12(b2, c2, d2, e2, a2, w3, 12);
   93|  5.93k|    R11(a1, b1, c1, d1, e1, w15, 8);
   94|  5.93k|    R12(a2, b2, c2, d2, e2, w12, 6);
   95|       |
   96|  5.93k|    R21(e1, a1, b1, c1, d1, w7, 7);
   97|  5.93k|    R22(e2, a2, b2, c2, d2, w6, 9);
   98|  5.93k|    R21(d1, e1, a1, b1, c1, w4, 6);
   99|  5.93k|    R22(d2, e2, a2, b2, c2, w11, 13);
  100|  5.93k|    R21(c1, d1, e1, a1, b1, w13, 8);
  101|  5.93k|    R22(c2, d2, e2, a2, b2, w3, 15);
  102|  5.93k|    R21(b1, c1, d1, e1, a1, w1, 13);
  103|  5.93k|    R22(b2, c2, d2, e2, a2, w7, 7);
  104|  5.93k|    R21(a1, b1, c1, d1, e1, w10, 11);
  105|  5.93k|    R22(a2, b2, c2, d2, e2, w0, 12);
  106|  5.93k|    R21(e1, a1, b1, c1, d1, w6, 9);
  107|  5.93k|    R22(e2, a2, b2, c2, d2, w13, 8);
  108|  5.93k|    R21(d1, e1, a1, b1, c1, w15, 7);
  109|  5.93k|    R22(d2, e2, a2, b2, c2, w5, 9);
  110|  5.93k|    R21(c1, d1, e1, a1, b1, w3, 15);
  111|  5.93k|    R22(c2, d2, e2, a2, b2, w10, 11);
  112|  5.93k|    R21(b1, c1, d1, e1, a1, w12, 7);
  113|  5.93k|    R22(b2, c2, d2, e2, a2, w14, 7);
  114|  5.93k|    R21(a1, b1, c1, d1, e1, w0, 12);
  115|  5.93k|    R22(a2, b2, c2, d2, e2, w15, 7);
  116|  5.93k|    R21(e1, a1, b1, c1, d1, w9, 15);
  117|  5.93k|    R22(e2, a2, b2, c2, d2, w8, 12);
  118|  5.93k|    R21(d1, e1, a1, b1, c1, w5, 9);
  119|  5.93k|    R22(d2, e2, a2, b2, c2, w12, 7);
  120|  5.93k|    R21(c1, d1, e1, a1, b1, w2, 11);
  121|  5.93k|    R22(c2, d2, e2, a2, b2, w4, 6);
  122|  5.93k|    R21(b1, c1, d1, e1, a1, w14, 7);
  123|  5.93k|    R22(b2, c2, d2, e2, a2, w9, 15);
  124|  5.93k|    R21(a1, b1, c1, d1, e1, w11, 13);
  125|  5.93k|    R22(a2, b2, c2, d2, e2, w1, 13);
  126|  5.93k|    R21(e1, a1, b1, c1, d1, w8, 12);
  127|  5.93k|    R22(e2, a2, b2, c2, d2, w2, 11);
  128|       |
  129|  5.93k|    R31(d1, e1, a1, b1, c1, w3, 11);
  130|  5.93k|    R32(d2, e2, a2, b2, c2, w15, 9);
  131|  5.93k|    R31(c1, d1, e1, a1, b1, w10, 13);
  132|  5.93k|    R32(c2, d2, e2, a2, b2, w5, 7);
  133|  5.93k|    R31(b1, c1, d1, e1, a1, w14, 6);
  134|  5.93k|    R32(b2, c2, d2, e2, a2, w1, 15);
  135|  5.93k|    R31(a1, b1, c1, d1, e1, w4, 7);
  136|  5.93k|    R32(a2, b2, c2, d2, e2, w3, 11);
  137|  5.93k|    R31(e1, a1, b1, c1, d1, w9, 14);
  138|  5.93k|    R32(e2, a2, b2, c2, d2, w7, 8);
  139|  5.93k|    R31(d1, e1, a1, b1, c1, w15, 9);
  140|  5.93k|    R32(d2, e2, a2, b2, c2, w14, 6);
  141|  5.93k|    R31(c1, d1, e1, a1, b1, w8, 13);
  142|  5.93k|    R32(c2, d2, e2, a2, b2, w6, 6);
  143|  5.93k|    R31(b1, c1, d1, e1, a1, w1, 15);
  144|  5.93k|    R32(b2, c2, d2, e2, a2, w9, 14);
  145|  5.93k|    R31(a1, b1, c1, d1, e1, w2, 14);
  146|  5.93k|    R32(a2, b2, c2, d2, e2, w11, 12);
  147|  5.93k|    R31(e1, a1, b1, c1, d1, w7, 8);
  148|  5.93k|    R32(e2, a2, b2, c2, d2, w8, 13);
  149|  5.93k|    R31(d1, e1, a1, b1, c1, w0, 13);
  150|  5.93k|    R32(d2, e2, a2, b2, c2, w12, 5);
  151|  5.93k|    R31(c1, d1, e1, a1, b1, w6, 6);
  152|  5.93k|    R32(c2, d2, e2, a2, b2, w2, 14);
  153|  5.93k|    R31(b1, c1, d1, e1, a1, w13, 5);
  154|  5.93k|    R32(b2, c2, d2, e2, a2, w10, 13);
  155|  5.93k|    R31(a1, b1, c1, d1, e1, w11, 12);
  156|  5.93k|    R32(a2, b2, c2, d2, e2, w0, 13);
  157|  5.93k|    R31(e1, a1, b1, c1, d1, w5, 7);
  158|  5.93k|    R32(e2, a2, b2, c2, d2, w4, 7);
  159|  5.93k|    R31(d1, e1, a1, b1, c1, w12, 5);
  160|  5.93k|    R32(d2, e2, a2, b2, c2, w13, 5);
  161|       |
  162|  5.93k|    R41(c1, d1, e1, a1, b1, w1, 11);
  163|  5.93k|    R42(c2, d2, e2, a2, b2, w8, 15);
  164|  5.93k|    R41(b1, c1, d1, e1, a1, w9, 12);
  165|  5.93k|    R42(b2, c2, d2, e2, a2, w6, 5);
  166|  5.93k|    R41(a1, b1, c1, d1, e1, w11, 14);
  167|  5.93k|    R42(a2, b2, c2, d2, e2, w4, 8);
  168|  5.93k|    R41(e1, a1, b1, c1, d1, w10, 15);
  169|  5.93k|    R42(e2, a2, b2, c2, d2, w1, 11);
  170|  5.93k|    R41(d1, e1, a1, b1, c1, w0, 14);
  171|  5.93k|    R42(d2, e2, a2, b2, c2, w3, 14);
  172|  5.93k|    R41(c1, d1, e1, a1, b1, w8, 15);
  173|  5.93k|    R42(c2, d2, e2, a2, b2, w11, 14);
  174|  5.93k|    R41(b1, c1, d1, e1, a1, w12, 9);
  175|  5.93k|    R42(b2, c2, d2, e2, a2, w15, 6);
  176|  5.93k|    R41(a1, b1, c1, d1, e1, w4, 8);
  177|  5.93k|    R42(a2, b2, c2, d2, e2, w0, 14);
  178|  5.93k|    R41(e1, a1, b1, c1, d1, w13, 9);
  179|  5.93k|    R42(e2, a2, b2, c2, d2, w5, 6);
  180|  5.93k|    R41(d1, e1, a1, b1, c1, w3, 14);
  181|  5.93k|    R42(d2, e2, a2, b2, c2, w12, 9);
  182|  5.93k|    R41(c1, d1, e1, a1, b1, w7, 5);
  183|  5.93k|    R42(c2, d2, e2, a2, b2, w2, 12);
  184|  5.93k|    R41(b1, c1, d1, e1, a1, w15, 6);
  185|  5.93k|    R42(b2, c2, d2, e2, a2, w13, 9);
  186|  5.93k|    R41(a1, b1, c1, d1, e1, w14, 8);
  187|  5.93k|    R42(a2, b2, c2, d2, e2, w9, 12);
  188|  5.93k|    R41(e1, a1, b1, c1, d1, w5, 6);
  189|  5.93k|    R42(e2, a2, b2, c2, d2, w7, 5);
  190|  5.93k|    R41(d1, e1, a1, b1, c1, w6, 5);
  191|  5.93k|    R42(d2, e2, a2, b2, c2, w10, 15);
  192|  5.93k|    R41(c1, d1, e1, a1, b1, w2, 12);
  193|  5.93k|    R42(c2, d2, e2, a2, b2, w14, 8);
  194|       |
  195|  5.93k|    R51(b1, c1, d1, e1, a1, w4, 9);
  196|  5.93k|    R52(b2, c2, d2, e2, a2, w12, 8);
  197|  5.93k|    R51(a1, b1, c1, d1, e1, w0, 15);
  198|  5.93k|    R52(a2, b2, c2, d2, e2, w15, 5);
  199|  5.93k|    R51(e1, a1, b1, c1, d1, w5, 5);
  200|  5.93k|    R52(e2, a2, b2, c2, d2, w10, 12);
  201|  5.93k|    R51(d1, e1, a1, b1, c1, w9, 11);
  202|  5.93k|    R52(d2, e2, a2, b2, c2, w4, 9);
  203|  5.93k|    R51(c1, d1, e1, a1, b1, w7, 6);
  204|  5.93k|    R52(c2, d2, e2, a2, b2, w1, 12);
  205|  5.93k|    R51(b1, c1, d1, e1, a1, w12, 8);
  206|  5.93k|    R52(b2, c2, d2, e2, a2, w5, 5);
  207|  5.93k|    R51(a1, b1, c1, d1, e1, w2, 13);
  208|  5.93k|    R52(a2, b2, c2, d2, e2, w8, 14);
  209|  5.93k|    R51(e1, a1, b1, c1, d1, w10, 12);
  210|  5.93k|    R52(e2, a2, b2, c2, d2, w7, 6);
  211|  5.93k|    R51(d1, e1, a1, b1, c1, w14, 5);
  212|  5.93k|    R52(d2, e2, a2, b2, c2, w6, 8);
  213|  5.93k|    R51(c1, d1, e1, a1, b1, w1, 12);
  214|  5.93k|    R52(c2, d2, e2, a2, b2, w2, 13);
  215|  5.93k|    R51(b1, c1, d1, e1, a1, w3, 13);
  216|  5.93k|    R52(b2, c2, d2, e2, a2, w13, 6);
  217|  5.93k|    R51(a1, b1, c1, d1, e1, w8, 14);
  218|  5.93k|    R52(a2, b2, c2, d2, e2, w14, 5);
  219|  5.93k|    R51(e1, a1, b1, c1, d1, w11, 11);
  220|  5.93k|    R52(e2, a2, b2, c2, d2, w0, 15);
  221|  5.93k|    R51(d1, e1, a1, b1, c1, w6, 8);
  222|  5.93k|    R52(d2, e2, a2, b2, c2, w3, 13);
  223|  5.93k|    R51(c1, d1, e1, a1, b1, w15, 5);
  224|  5.93k|    R52(c2, d2, e2, a2, b2, w9, 11);
  225|  5.93k|    R51(b1, c1, d1, e1, a1, w13, 6);
  226|  5.93k|    R52(b2, c2, d2, e2, a2, w11, 11);
  227|       |
  228|  5.93k|    uint32_t t = s[0];
  229|  5.93k|    s[0] = s[1] + c1 + d2;
  230|  5.93k|    s[1] = s[2] + d1 + e2;
  231|  5.93k|    s[2] = s[3] + e1 + a2;
  232|  5.93k|    s[3] = s[4] + a1 + b2;
  233|  5.93k|    s[4] = t + b1 + c2;
  234|  5.93k|}
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd1603R11ERjjS1_jjji:
   41|  94.8k|void inline R11(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f1(b, c, d), x, 0, r); }
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd1605RoundERjjS1_jjjjji:
   36|   948k|{
   37|   948k|    a = rol(a + f + x + k, r) + e;
   38|   948k|    c = rol(c, 10);
   39|   948k|}
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd1603rolEji:
   33|  1.89M|uint32_t inline rol(uint32_t x, int i) { return (x << i) | (x >> (32 - i)); }
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd1602f1Ejjj:
   17|   189k|uint32_t inline f1(uint32_t x, uint32_t y, uint32_t z) { return x ^ y ^ z; }
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd1603R12ERjjS1_jjji:
   47|  94.8k|void inline R12(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f5(b, c, d), x, 0x50A28BE6ul, r); }
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd1602f5Ejjj:
   21|   189k|uint32_t inline f5(uint32_t x, uint32_t y, uint32_t z) { return x ^ (y | ~z); }
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd1603R21ERjjS1_jjji:
   42|  94.8k|void inline R21(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f2(b, c, d), x, 0x5A827999ul, r); }
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd1602f2Ejjj:
   18|   189k|uint32_t inline f2(uint32_t x, uint32_t y, uint32_t z) { return (x & y) | (~x & z); }
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd1603R22ERjjS1_jjji:
   48|  94.8k|void inline R22(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f4(b, c, d), x, 0x5C4DD124ul, r); }
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd1602f4Ejjj:
   20|   189k|uint32_t inline f4(uint32_t x, uint32_t y, uint32_t z) { return (x & z) | (y & ~z); }
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd1603R31ERjjS1_jjji:
   43|  94.8k|void inline R31(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f3(b, c, d), x, 0x6ED9EBA1ul, r); }
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd1602f3Ejjj:
   19|   189k|uint32_t inline f3(uint32_t x, uint32_t y, uint32_t z) { return (x | ~y) ^ z; }
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd1603R32ERjjS1_jjji:
   49|  94.8k|void inline R32(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f3(b, c, d), x, 0x6D703EF3ul, r); }
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd1603R41ERjjS1_jjji:
   44|  94.8k|void inline R41(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f4(b, c, d), x, 0x8F1BBCDCul, r); }
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd1603R42ERjjS1_jjji:
   50|  94.8k|void inline R42(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f2(b, c, d), x, 0x7A6D76E9ul, r); }
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd1603R51ERjjS1_jjji:
   45|  94.8k|void inline R51(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f5(b, c, d), x, 0xA953FD4Eul, r); }
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd1603R52ERjjS1_jjji:
   51|  94.8k|void inline R52(uint32_t& a, uint32_t b, uint32_t& c, uint32_t d, uint32_t e, uint32_t x, int r) { Round(a, b, c, d, e, f1(b, c, d), x, 0, r); }

_ZN7CSHA256C2Ev:
  695|  10.5k|{
  696|  10.5k|    sha256::Initialize(s);
  697|  10.5k|}
_ZN7CSHA2565WriteEPKhm:
  700|  63.8k|{
  701|  63.8k|    const unsigned char* end = data + len;
  702|  63.8k|    size_t bufsize = bytes % 64;
  703|  63.8k|    if (bufsize && bufsize + len >= 64) {
  ------------------
  |  Branch (703:9): [True: 42.9k, False: 20.9k]
  |  Branch (703:20): [True: 23.4k, False: 19.4k]
  ------------------
  704|       |        // Fill the buffer, and process it.
  705|  23.4k|        memcpy(buf + bufsize, data, 64 - bufsize);
  706|  23.4k|        bytes += 64 - bufsize;
  707|  23.4k|        data += 64 - bufsize;
  708|  23.4k|        Transform(s, buf, 1);
  709|  23.4k|        bufsize = 0;
  710|  23.4k|    }
  711|  63.8k|    if (end - data >= 64) {
  ------------------
  |  Branch (711:9): [True: 4.63k, False: 59.2k]
  ------------------
  712|  4.63k|        size_t blocks = (end - data) / 64;
  713|  4.63k|        Transform(s, data, blocks);
  714|  4.63k|        data += 64 * blocks;
  715|  4.63k|        bytes += 64 * blocks;
  716|  4.63k|    }
  717|  63.8k|    if (end > data) {
  ------------------
  |  Branch (717:9): [True: 42.9k, False: 20.9k]
  ------------------
  718|       |        // Fill the buffer with what remains.
  719|  42.9k|        memcpy(buf + bufsize, data, end - data);
  720|  42.9k|        bytes += end - data;
  721|  42.9k|    }
  722|  63.8k|    return *this;
  723|  63.8k|}
_ZN7CSHA2568FinalizeEPh:
  726|  17.6k|{
  727|  17.6k|    static const unsigned char pad[64] = {0x80};
  728|  17.6k|    unsigned char sizedesc[8];
  729|  17.6k|    WriteBE64(sizedesc, bytes << 3);
  730|  17.6k|    Write(pad, 1 + ((119 - (bytes % 64)) % 64));
  731|  17.6k|    Write(sizedesc, 8);
  732|  17.6k|    WriteBE32(hash, s[0]);
  733|  17.6k|    WriteBE32(hash + 4, s[1]);
  734|  17.6k|    WriteBE32(hash + 8, s[2]);
  735|  17.6k|    WriteBE32(hash + 12, s[3]);
  736|  17.6k|    WriteBE32(hash + 16, s[4]);
  737|  17.6k|    WriteBE32(hash + 20, s[5]);
  738|  17.6k|    WriteBE32(hash + 24, s[6]);
  739|  17.6k|    WriteBE32(hash + 28, s[7]);
  740|  17.6k|}
_ZN7CSHA2565ResetEv:
  743|    634|{
  744|    634|    bytes = 0;
  745|    634|    sha256::Initialize(s);
  746|    634|    return *this;
  747|    634|}
sha256.cpp:_ZN12_GLOBAL__N_16sha2569TransformEPjPKhm:
  100|  28.1k|{
  101|   120k|    while (blocks--) {
  ------------------
  |  Branch (101:12): [True: 92.0k, False: 28.1k]
  ------------------
  102|  92.0k|        uint32_t a = s[0], b = s[1], c = s[2], d = s[3], e = s[4], f = s[5], g = s[6], h = s[7];
  103|  92.0k|        uint32_t w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15;
  104|       |
  105|  92.0k|        Round(a, b, c, d, e, f, g, h, 0x428a2f98 + (w0 = ReadBE32(chunk + 0)));
  106|  92.0k|        Round(h, a, b, c, d, e, f, g, 0x71374491 + (w1 = ReadBE32(chunk + 4)));
  107|  92.0k|        Round(g, h, a, b, c, d, e, f, 0xb5c0fbcf + (w2 = ReadBE32(chunk + 8)));
  108|  92.0k|        Round(f, g, h, a, b, c, d, e, 0xe9b5dba5 + (w3 = ReadBE32(chunk + 12)));
  109|  92.0k|        Round(e, f, g, h, a, b, c, d, 0x3956c25b + (w4 = ReadBE32(chunk + 16)));
  110|  92.0k|        Round(d, e, f, g, h, a, b, c, 0x59f111f1 + (w5 = ReadBE32(chunk + 20)));
  111|  92.0k|        Round(c, d, e, f, g, h, a, b, 0x923f82a4 + (w6 = ReadBE32(chunk + 24)));
  112|  92.0k|        Round(b, c, d, e, f, g, h, a, 0xab1c5ed5 + (w7 = ReadBE32(chunk + 28)));
  113|  92.0k|        Round(a, b, c, d, e, f, g, h, 0xd807aa98 + (w8 = ReadBE32(chunk + 32)));
  114|  92.0k|        Round(h, a, b, c, d, e, f, g, 0x12835b01 + (w9 = ReadBE32(chunk + 36)));
  115|  92.0k|        Round(g, h, a, b, c, d, e, f, 0x243185be + (w10 = ReadBE32(chunk + 40)));
  116|  92.0k|        Round(f, g, h, a, b, c, d, e, 0x550c7dc3 + (w11 = ReadBE32(chunk + 44)));
  117|  92.0k|        Round(e, f, g, h, a, b, c, d, 0x72be5d74 + (w12 = ReadBE32(chunk + 48)));
  118|  92.0k|        Round(d, e, f, g, h, a, b, c, 0x80deb1fe + (w13 = ReadBE32(chunk + 52)));
  119|  92.0k|        Round(c, d, e, f, g, h, a, b, 0x9bdc06a7 + (w14 = ReadBE32(chunk + 56)));
  120|  92.0k|        Round(b, c, d, e, f, g, h, a, 0xc19bf174 + (w15 = ReadBE32(chunk + 60)));
  121|       |
  122|  92.0k|        Round(a, b, c, d, e, f, g, h, 0xe49b69c1 + (w0 += sigma1(w14) + w9 + sigma0(w1)));
  123|  92.0k|        Round(h, a, b, c, d, e, f, g, 0xefbe4786 + (w1 += sigma1(w15) + w10 + sigma0(w2)));
  124|  92.0k|        Round(g, h, a, b, c, d, e, f, 0x0fc19dc6 + (w2 += sigma1(w0) + w11 + sigma0(w3)));
  125|  92.0k|        Round(f, g, h, a, b, c, d, e, 0x240ca1cc + (w3 += sigma1(w1) + w12 + sigma0(w4)));
  126|  92.0k|        Round(e, f, g, h, a, b, c, d, 0x2de92c6f + (w4 += sigma1(w2) + w13 + sigma0(w5)));
  127|  92.0k|        Round(d, e, f, g, h, a, b, c, 0x4a7484aa + (w5 += sigma1(w3) + w14 + sigma0(w6)));
  128|  92.0k|        Round(c, d, e, f, g, h, a, b, 0x5cb0a9dc + (w6 += sigma1(w4) + w15 + sigma0(w7)));
  129|  92.0k|        Round(b, c, d, e, f, g, h, a, 0x76f988da + (w7 += sigma1(w5) + w0 + sigma0(w8)));
  130|  92.0k|        Round(a, b, c, d, e, f, g, h, 0x983e5152 + (w8 += sigma1(w6) + w1 + sigma0(w9)));
  131|  92.0k|        Round(h, a, b, c, d, e, f, g, 0xa831c66d + (w9 += sigma1(w7) + w2 + sigma0(w10)));
  132|  92.0k|        Round(g, h, a, b, c, d, e, f, 0xb00327c8 + (w10 += sigma1(w8) + w3 + sigma0(w11)));
  133|  92.0k|        Round(f, g, h, a, b, c, d, e, 0xbf597fc7 + (w11 += sigma1(w9) + w4 + sigma0(w12)));
  134|  92.0k|        Round(e, f, g, h, a, b, c, d, 0xc6e00bf3 + (w12 += sigma1(w10) + w5 + sigma0(w13)));
  135|  92.0k|        Round(d, e, f, g, h, a, b, c, 0xd5a79147 + (w13 += sigma1(w11) + w6 + sigma0(w14)));
  136|  92.0k|        Round(c, d, e, f, g, h, a, b, 0x06ca6351 + (w14 += sigma1(w12) + w7 + sigma0(w15)));
  137|  92.0k|        Round(b, c, d, e, f, g, h, a, 0x14292967 + (w15 += sigma1(w13) + w8 + sigma0(w0)));
  138|       |
  139|  92.0k|        Round(a, b, c, d, e, f, g, h, 0x27b70a85 + (w0 += sigma1(w14) + w9 + sigma0(w1)));
  140|  92.0k|        Round(h, a, b, c, d, e, f, g, 0x2e1b2138 + (w1 += sigma1(w15) + w10 + sigma0(w2)));
  141|  92.0k|        Round(g, h, a, b, c, d, e, f, 0x4d2c6dfc + (w2 += sigma1(w0) + w11 + sigma0(w3)));
  142|  92.0k|        Round(f, g, h, a, b, c, d, e, 0x53380d13 + (w3 += sigma1(w1) + w12 + sigma0(w4)));
  143|  92.0k|        Round(e, f, g, h, a, b, c, d, 0x650a7354 + (w4 += sigma1(w2) + w13 + sigma0(w5)));
  144|  92.0k|        Round(d, e, f, g, h, a, b, c, 0x766a0abb + (w5 += sigma1(w3) + w14 + sigma0(w6)));
  145|  92.0k|        Round(c, d, e, f, g, h, a, b, 0x81c2c92e + (w6 += sigma1(w4) + w15 + sigma0(w7)));
  146|  92.0k|        Round(b, c, d, e, f, g, h, a, 0x92722c85 + (w7 += sigma1(w5) + w0 + sigma0(w8)));
  147|  92.0k|        Round(a, b, c, d, e, f, g, h, 0xa2bfe8a1 + (w8 += sigma1(w6) + w1 + sigma0(w9)));
  148|  92.0k|        Round(h, a, b, c, d, e, f, g, 0xa81a664b + (w9 += sigma1(w7) + w2 + sigma0(w10)));
  149|  92.0k|        Round(g, h, a, b, c, d, e, f, 0xc24b8b70 + (w10 += sigma1(w8) + w3 + sigma0(w11)));
  150|  92.0k|        Round(f, g, h, a, b, c, d, e, 0xc76c51a3 + (w11 += sigma1(w9) + w4 + sigma0(w12)));
  151|  92.0k|        Round(e, f, g, h, a, b, c, d, 0xd192e819 + (w12 += sigma1(w10) + w5 + sigma0(w13)));
  152|  92.0k|        Round(d, e, f, g, h, a, b, c, 0xd6990624 + (w13 += sigma1(w11) + w6 + sigma0(w14)));
  153|  92.0k|        Round(c, d, e, f, g, h, a, b, 0xf40e3585 + (w14 += sigma1(w12) + w7 + sigma0(w15)));
  154|  92.0k|        Round(b, c, d, e, f, g, h, a, 0x106aa070 + (w15 += sigma1(w13) + w8 + sigma0(w0)));
  155|       |
  156|  92.0k|        Round(a, b, c, d, e, f, g, h, 0x19a4c116 + (w0 += sigma1(w14) + w9 + sigma0(w1)));
  157|  92.0k|        Round(h, a, b, c, d, e, f, g, 0x1e376c08 + (w1 += sigma1(w15) + w10 + sigma0(w2)));
  158|  92.0k|        Round(g, h, a, b, c, d, e, f, 0x2748774c + (w2 += sigma1(w0) + w11 + sigma0(w3)));
  159|  92.0k|        Round(f, g, h, a, b, c, d, e, 0x34b0bcb5 + (w3 += sigma1(w1) + w12 + sigma0(w4)));
  160|  92.0k|        Round(e, f, g, h, a, b, c, d, 0x391c0cb3 + (w4 += sigma1(w2) + w13 + sigma0(w5)));
  161|  92.0k|        Round(d, e, f, g, h, a, b, c, 0x4ed8aa4a + (w5 += sigma1(w3) + w14 + sigma0(w6)));
  162|  92.0k|        Round(c, d, e, f, g, h, a, b, 0x5b9cca4f + (w6 += sigma1(w4) + w15 + sigma0(w7)));
  163|  92.0k|        Round(b, c, d, e, f, g, h, a, 0x682e6ff3 + (w7 += sigma1(w5) + w0 + sigma0(w8)));
  164|  92.0k|        Round(a, b, c, d, e, f, g, h, 0x748f82ee + (w8 += sigma1(w6) + w1 + sigma0(w9)));
  165|  92.0k|        Round(h, a, b, c, d, e, f, g, 0x78a5636f + (w9 += sigma1(w7) + w2 + sigma0(w10)));
  166|  92.0k|        Round(g, h, a, b, c, d, e, f, 0x84c87814 + (w10 += sigma1(w8) + w3 + sigma0(w11)));
  167|  92.0k|        Round(f, g, h, a, b, c, d, e, 0x8cc70208 + (w11 += sigma1(w9) + w4 + sigma0(w12)));
  168|  92.0k|        Round(e, f, g, h, a, b, c, d, 0x90befffa + (w12 += sigma1(w10) + w5 + sigma0(w13)));
  169|  92.0k|        Round(d, e, f, g, h, a, b, c, 0xa4506ceb + (w13 += sigma1(w11) + w6 + sigma0(w14)));
  170|  92.0k|        Round(c, d, e, f, g, h, a, b, 0xbef9a3f7 + (w14 + sigma1(w12) + w7 + sigma0(w15)));
  171|  92.0k|        Round(b, c, d, e, f, g, h, a, 0xc67178f2 + (w15 + sigma1(w13) + w8 + sigma0(w0)));
  172|       |
  173|  92.0k|        s[0] += a;
  174|  92.0k|        s[1] += b;
  175|  92.0k|        s[2] += c;
  176|  92.0k|        s[3] += d;
  177|  92.0k|        s[4] += e;
  178|  92.0k|        s[5] += f;
  179|  92.0k|        s[6] += g;
  180|  92.0k|        s[7] += h;
  181|  92.0k|        chunk += 64;
  182|  92.0k|    }
  183|  28.1k|}
sha256.cpp:_ZN12_GLOBAL__N_16sha2565RoundEjjjRjjjjS1_j:
   78|  5.88M|{
   79|  5.88M|    uint32_t t1 = h + Sigma1(e) + Ch(e, f, g) + k;
   80|  5.88M|    uint32_t t2 = Sigma0(a) + Maj(a, b, c);
   81|  5.88M|    d += t1;
   82|  5.88M|    h = t1 + t2;
   83|  5.88M|}
sha256.cpp:_ZN12_GLOBAL__N_16sha2566Sigma1Ej:
   72|  5.88M|uint32_t inline Sigma1(uint32_t x) { return (x >> 6 | x << 26) ^ (x >> 11 | x << 21) ^ (x >> 25 | x << 7); }
sha256.cpp:_ZN12_GLOBAL__N_16sha2562ChEjjj:
   69|  5.88M|uint32_t inline Ch(uint32_t x, uint32_t y, uint32_t z) { return z ^ (x & (y ^ z)); }
sha256.cpp:_ZN12_GLOBAL__N_16sha2566Sigma0Ej:
   71|  5.88M|uint32_t inline Sigma0(uint32_t x) { return (x >> 2 | x << 30) ^ (x >> 13 | x << 19) ^ (x >> 22 | x << 10); }
sha256.cpp:_ZN12_GLOBAL__N_16sha2563MajEjjj:
   70|  5.88M|uint32_t inline Maj(uint32_t x, uint32_t y, uint32_t z) { return (x & y) | (z & (x | y)); }
sha256.cpp:_ZN12_GLOBAL__N_16sha2566sigma1Ej:
   74|  4.41M|uint32_t inline sigma1(uint32_t x) { return (x >> 17 | x << 15) ^ (x >> 19 | x << 13) ^ (x >> 10); }
sha256.cpp:_ZN12_GLOBAL__N_16sha2566sigma0Ej:
   73|  4.41M|uint32_t inline sigma0(uint32_t x) { return (x >> 7 | x << 25) ^ (x >> 18 | x << 14) ^ (x >> 3); }
sha256.cpp:_ZN12_GLOBAL__N_16sha25610InitializeEPj:
   87|  11.1k|{
   88|  11.1k|    s[0] = 0x6a09e667ul;
   89|  11.1k|    s[1] = 0xbb67ae85ul;
   90|  11.1k|    s[2] = 0x3c6ef372ul;
   91|  11.1k|    s[3] = 0xa54ff53aul;
   92|  11.1k|    s[4] = 0x510e527ful;
   93|  11.1k|    s[5] = 0x9b05688cul;
   94|  11.1k|    s[6] = 0x1f83d9abul;
   95|  11.1k|    s[7] = 0x5be0cd19ul;
   96|  11.1k|}

_Z7Hash160I7CPubKeyE7uint160RKT_:
  101|  2.16k|{
  102|  2.16k|    uint160 result;
  103|  2.16k|    CHash160().Write(MakeUCharSpan(in1)).Finalize(result);
  104|  2.16k|    return result;
  105|  2.16k|}
_Z7Hash160I11XOnlyPubKeyE7uint160RKT_:
  101|  1.64k|{
  102|  1.64k|    uint160 result;
  103|  1.64k|    CHash160().Write(MakeUCharSpan(in1)).Finalize(result);
  104|  1.64k|    return result;
  105|  1.64k|}
_ZN9ChainCodeD2Ev:
   28|      2|    ~ChainCode() { memory_cleanse(data(), size()); }
_ZN8CHash2565WriteENSt3__14spanIKhLm18446744073709551615EEE:
   45|    634|    CHash256& Write(std::span<const unsigned char> input) {
   46|    634|        sha.Write(input.data(), input.size());
   47|    634|        return *this;
   48|    634|    }
_ZN8CHash2568FinalizeENSt3__14spanIhLm18446744073709551615EEE:
   38|    634|    void Finalize(std::span<unsigned char> output) {
   39|    634|        assert(output.size() == OUTPUT_SIZE);
  ------------------
  |  Branch (39:9): [True: 634, False: 0]
  ------------------
   40|    634|        unsigned char buf[CSHA256::OUTPUT_SIZE];
   41|    634|        sha.Finalize(buf);
   42|    634|        sha.Reset().Write(buf, CSHA256::OUTPUT_SIZE).Finalize(output.data());
   43|    634|    }
_ZN10HashWriterlsINSt3__14spanIKhLm32EEEEERS_RKT_:
  150|  6.49k|    {
  151|  6.49k|        ::Serialize(*this, obj);
  152|  6.49k|        return *this;
  153|  6.49k|    }
_ZN10HashWriterlsI7uint256EERS_RKT_:
  150|  6.49k|    {
  151|  6.49k|        ::Serialize(*this, obj);
  152|  6.49k|        return *this;
  153|  6.49k|    }
_ZN10HashWriterlsIhEERS_RKT_:
  150|  3.24k|    {
  151|  3.24k|        ::Serialize(*this, obj);
  152|  3.24k|        return *this;
  153|  3.24k|    }
_ZN10HashWriterlsI17CompactSizeWriterEERS_RKT_:
  150|  3.24k|    {
  151|  3.24k|        ::Serialize(*this, obj);
  152|  3.24k|        return *this;
  153|  3.24k|    }
_ZN8CHash1605WriteENSt3__14spanIKhLm18446744073709551615EEE:
   70|  5.49k|    CHash160& Write(std::span<const unsigned char> input) {
   71|  5.49k|        sha.Write(input.data(), input.size());
   72|  5.49k|        return *this;
   73|  5.49k|    }
_ZN8CHash1608FinalizeENSt3__14spanIhLm18446744073709551615EEE:
   63|  5.49k|    void Finalize(std::span<unsigned char> output) {
   64|  5.49k|        assert(output.size() == OUTPUT_SIZE);
  ------------------
  |  Branch (64:9): [True: 5.49k, False: 0]
  ------------------
   65|  5.49k|        unsigned char buf[CSHA256::OUTPUT_SIZE];
   66|  5.49k|        sha.Finalize(buf);
   67|  5.49k|        CRIPEMD160().Write(buf, CSHA256::OUTPUT_SIZE).Finalize(output.data());
   68|  5.49k|    }
_ZN10HashWriter5writeENSt3__14spanIKSt4byteLm18446744073709551615EEE:
  115|  17.5k|    {
  116|  17.5k|        ctx.Write(UCharCast(src.data()), src.size());
  117|  17.5k|    }
_ZN10HashWriter9GetSHA256Ev:
  134|  6.49k|    uint256 GetSHA256() {
  135|  6.49k|        uint256 result;
  136|  6.49k|        ctx.Finalize(result.begin());
  137|  6.49k|        return result;
  138|  6.49k|    }
_ZN10HashWriterlsINSt3__14spanIKhLm18446744073709551615EEEEERS_RKT_:
  150|  3.24k|    {
  151|  3.24k|        ::Serialize(*this, obj);
  152|  3.24k|        return *this;
  153|  3.24k|    }

_ZN11ECC_ContextD2Ev:
  501|      2|{
  502|      2|    ECC_Stop();
  503|      2|}
key.cpp:_ZL8ECC_Stopv:
  486|      2|static void ECC_Stop() {
  487|      2|    secp256k1_context *ctx = secp256k1_context_sign;
  488|      2|    secp256k1_context_sign = nullptr;
  489|       |
  490|      2|    if (ctx) {
  ------------------
  |  Branch (490:9): [True: 2, False: 0]
  ------------------
  491|      2|        secp256k1_context_destroy(ctx);
  492|      2|    }
  493|      2|}

_ZN11CNetCleanupD2Ev:
 3676|      2|    {
 3677|       |#ifdef WIN32
 3678|       |        // Shutdown Windows Sockets
 3679|       |        WSACleanup();
 3680|       |#endif
 3681|      2|    }

_ZN9prevectorILj36EhjiE4backEv:
  408|  16.0k|    T& back() {
  409|  16.0k|        return *item_ptr(size() - 1);
  410|  16.0k|    }
_ZN9prevectorILj36EhjiE7reserveEj:
  293|    155|    void reserve(size_type new_capacity) {
  294|    155|        if (new_capacity > capacity()) {
  ------------------
  |  Branch (294:13): [True: 95, False: 60]
  ------------------
  295|     95|            change_capacity(new_capacity);
  296|     95|        }
  297|    155|    }
_ZN9prevectorILj36EhjiE6insertITkNSt3__114input_iteratorENS0_8iteratorEEEvS3_T_S4_:
  335|   185k|    void insert(iterator pos, InputIterator first, InputIterator last) {
  336|   185k|        size_type p = pos - begin();
  337|   185k|        difference_type count = last - first;
  338|   185k|        size_type new_size = size() + count;
  339|   185k|        if (capacity() < new_size) {
  ------------------
  |  Branch (339:13): [True: 53.1k, False: 132k]
  ------------------
  340|  53.1k|            change_capacity(new_size + (new_size >> 1));
  341|  53.1k|        }
  342|   185k|        T* ptr = item_ptr(p);
  343|   185k|        T* dst = ptr + count;
  344|   185k|        memmove(dst, ptr, (size() - p) * sizeof(T));
  345|   185k|        _size += count;
  346|   185k|        fill(ptr, first, last);
  347|   185k|    }
_ZN9prevectorILj36EhjiE4fillITkNSt3__114input_iteratorENS0_8iteratorEEEvPhT_S5_:
  167|   185k|    void fill(T* dst, InputIterator first, InputIterator last) {
  168|  21.8M|        while (first != last) {
  ------------------
  |  Branch (168:16): [True: 21.6M, False: 185k]
  ------------------
  169|  21.6M|            new(static_cast<void*>(dst)) T(*first);
  170|  21.6M|            ++dst;
  171|  21.6M|            ++first;
  172|  21.6M|        }
  173|   185k|    }
_ZNK9prevectorILj36EhjiE8iteratoreqES1_:
   74|  21.8M|        bool operator==(iterator x) const { return ptr == x.ptr; }
_ZN9prevectorILj36EhjiE8iteratorppEv:
   64|  21.6M|        iterator& operator++() { ptr++; return *this; }
_ZNK9prevectorILj16EhjiE9is_directEv:
  126|     16|    bool is_direct() const { return _size <= N; }
_ZN9prevectorILj16EhjiED2Ev:
  422|     16|    ~prevector() {
  423|     16|        if (!is_direct()) {
  ------------------
  |  Branch (423:13): [True: 0, False: 16]
  ------------------
  424|      0|            free(_union.indirect_contents.indirect);
  425|      0|            _union.indirect_contents.indirect = nullptr;
  426|      0|        }
  427|     16|    }
_ZN9prevectorILj36EhjiEC2EOS0_:
  224|   758k|        : _union(std::move(other._union)), _size(other._size)
  225|   758k|    {
  226|   758k|        other._size = 0;
  227|   758k|    }
_ZN9prevectorILj36EhjiE9push_backERKh:
  392|   260k|    void push_back(const T& value) {
  393|   260k|        emplace_back(value);
  394|   260k|    }
_ZN9prevectorILj36EhjiE12emplace_backIJRKhEEEvDpOT_:
  383|   260k|    void emplace_back(Args&&... args) {
  384|   260k|        size_type new_size = size() + 1;
  385|   260k|        if (capacity() < new_size) {
  ------------------
  |  Branch (385:13): [True: 1.19k, False: 259k]
  ------------------
  386|  1.19k|            change_capacity(new_size + (new_size >> 1));
  387|  1.19k|        }
  388|   260k|        new(item_ptr(size())) T(std::forward<Args>(args)...);
  389|   260k|        _size++;
  390|   260k|    }
_ZN9prevectorILj36EhjiE4dataEv:
  464|  1.68k|    value_type* data() {
  465|  1.68k|        return item_ptr(0);
  466|  1.68k|    }
_ZN9prevectorILj36EhjiEaSEOS0_:
  237|   373k|    prevector& operator=(prevector<N, T, Size, Diff>&& other) noexcept {
  238|   373k|        if (!is_direct()) {
  ------------------
  |  Branch (238:13): [True: 0, False: 373k]
  ------------------
  239|      0|            free(_union.indirect_contents.indirect);
  240|      0|        }
  241|   373k|        _union = std::move(other._union);
  242|   373k|        _size = other._size;
  243|   373k|        other._size = 0;
  244|   373k|        return *this;
  245|   373k|    }
_ZNK9prevectorILj36EhjiE4dataEv:
  468|  4.18k|    const value_type* data() const {
  469|  4.18k|        return item_ptr(0);
  470|  4.18k|    }
_ZN9prevectorILj36EhjiE4fillITkNSt3__114input_iteratorENS0_14const_iteratorEEEvPhT_S5_:
  167|  9.49k|    void fill(T* dst, InputIterator first, InputIterator last) {
  168|  9.30M|        while (first != last) {
  ------------------
  |  Branch (168:16): [True: 9.29M, False: 9.49k]
  ------------------
  169|  9.29M|            new(static_cast<void*>(dst)) T(*first);
  170|  9.29M|            ++dst;
  171|  9.29M|            ++first;
  172|  9.29M|        }
  173|  9.49k|    }
_ZNK9prevectorILj36EhjiE14const_iteratoreqES1_:
  102|  9.86M|        bool operator==(const_iterator x) const { return ptr == x.ptr; }
_ZN9prevectorILj36EhjiE14const_iteratorppEv:
   92|  10.2M|        const_iterator& operator++() { ptr++; return *this; }
_ZNK9prevectorILj36EhjiEixEj:
  272|  11.5k|    const T& operator[](size_type pos) const {
  273|  11.5k|        return *item_ptr(pos);
  274|  11.5k|    }
_ZN9prevectorILj36EhjiE8item_ptrEi:
  159|  3.75M|    T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  ------------------
  |  Branch (159:47): [True: 2.09M, False: 1.66M]
  ------------------
_ZNK9prevectorILj36EhjiE9is_directEv:
  126|  13.5M|    bool is_direct() const { return _size <= N; }
_ZN9prevectorILj36EhjiE10direct_ptrEi:
  122|  2.15M|    T* direct_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.direct) + pos; }
_ZN9prevectorILj36EhjiE12indirect_ptrEi:
  124|  1.66M|    T* indirect_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.indirect_contents.indirect) + pos; }
_ZN9prevectorILj36EhjiE15change_capacityEj:
  128|   105k|    void change_capacity(size_type new_capacity) {
  129|   105k|        if (new_capacity <= N) {
  ------------------
  |  Branch (129:13): [True: 4.78k, False: 100k]
  ------------------
  130|  4.78k|            if (!is_direct()) {
  ------------------
  |  Branch (130:17): [True: 0, False: 4.78k]
  ------------------
  131|      0|                T* indirect = indirect_ptr(0);
  132|      0|                T* src = indirect;
  133|      0|                T* dst = direct_ptr(0);
  134|      0|                memcpy(dst, src, size() * sizeof(T));
  135|      0|                free(indirect);
  136|      0|                _size -= N + 1;
  137|      0|            }
  138|   100k|        } else {
  139|   100k|            if (!is_direct()) {
  ------------------
  |  Branch (139:17): [True: 36.4k, False: 63.9k]
  ------------------
  140|       |                /* FIXME: Because malloc/realloc here won't call new_handler if allocation fails, assert
  141|       |                    success. These should instead use an allocator or new/delete so that handlers
  142|       |                    are called as necessary, but performance would be slightly degraded by doing so. */
  143|  36.4k|                _union.indirect_contents.indirect = static_cast<char*>(realloc(_union.indirect_contents.indirect, ((size_t)sizeof(T)) * new_capacity));
  144|  36.4k|                assert(_union.indirect_contents.indirect);
  ------------------
  |  Branch (144:17): [True: 36.4k, False: 0]
  ------------------
  145|  36.4k|                _union.indirect_contents.capacity = new_capacity;
  146|  63.9k|            } else {
  147|  63.9k|                char* new_indirect = static_cast<char*>(malloc(((size_t)sizeof(T)) * new_capacity));
  148|  63.9k|                assert(new_indirect);
  ------------------
  |  Branch (148:17): [True: 63.9k, False: 0]
  ------------------
  149|  63.9k|                T* src = direct_ptr(0);
  150|  63.9k|                T* dst = reinterpret_cast<T*>(new_indirect);
  151|  63.9k|                memcpy(dst, src, size() * sizeof(T));
  152|  63.9k|                _union.indirect_contents.indirect = new_indirect;
  153|  63.9k|                _union.indirect_contents.capacity = new_capacity;
  154|  63.9k|                _size += N + 1;
  155|  63.9k|            }
  156|   100k|        }
  157|   105k|    }
_ZNK9prevectorILj36EhjiE3endEv:
  258|  1.30M|    const_iterator end() const { return const_iterator(item_ptr(size())); }
_ZNK9prevectorILj36EhjiE8item_ptrEi:
  160|  1.36M|    const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  ------------------
  |  Branch (160:59): [True: 76.6k, False: 1.28M]
  ------------------
_ZNK9prevectorILj36EhjiE10direct_ptrEi:
  123|  76.6k|    const T* direct_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.direct) + pos; }
_ZNK9prevectorILj36EhjiE12indirect_ptrEi:
  125|  1.28M|    const T* indirect_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.indirect_contents.indirect) + pos; }
_ZNK9prevectorILj36EhjiE4sizeEv:
  247|  5.31M|    size_type size() const {
  248|  5.31M|        return is_direct() ? _size : _size - N - 1;
  ------------------
  |  Branch (248:16): [True: 2.25M, False: 3.05M]
  ------------------
  249|  5.31M|    }
_ZNK9prevectorILj36EhjiE5beginEv:
  256|  41.7k|    const_iterator begin() const { return const_iterator(item_ptr(0)); }
_ZNK9prevectorILj36EhjiE14const_iteratordeEv:
   89|  13.5M|        const T& operator*() const { return *ptr; }
_ZNK9prevectorILj36EhjiEeqERKS0_:
  429|  4.18k|    constexpr bool operator==(const prevector& other) const {
  430|  4.18k|        return std::ranges::equal(*this, other);
  431|  4.18k|    }
_ZNK9prevectorILj36EhjiE14const_iteratorssES1_:
  103|  1.68M|        auto operator<=>(const_iterator x) const { return ptr <=> x.ptr; }
_ZNK9prevectorILj36EhjiE14const_iteratorptEv:
   90|   622k|        const T* operator->() const { return ptr; }
_ZN9prevectorILj36EhjiEC2Ev:
  196|   528k|    prevector() = default;
_ZN9prevectorILj36EhjiE6insertENS0_8iteratorERKh:
  307|   680k|    iterator insert(iterator pos, const T& value) {
  308|   680k|        size_type p = pos - begin();
  309|   680k|        size_type new_size = size() + 1;
  310|   680k|        if (capacity() < new_size) {
  ------------------
  |  Branch (310:13): [True: 13.3k, False: 667k]
  ------------------
  311|  13.3k|            change_capacity(new_size + (new_size >> 1));
  312|  13.3k|        }
  313|   680k|        T* ptr = item_ptr(p);
  314|   680k|        T* dst = ptr + 1;
  315|   680k|        memmove(dst, ptr, (size() - p) * sizeof(T));
  316|   680k|        _size++;
  317|   680k|        new(static_cast<void*>(ptr)) T(value);
  318|   680k|        return iterator(ptr);
  319|   680k|    }
_ZmiN9prevectorILj36EhjiE8iteratorES1_:
   68|  1.21M|        difference_type friend operator-(iterator a, iterator b) { return (&(*a) - &(*b)); }
_ZNK9prevectorILj36EhjiE8iteratordeEv:
   61|  24.0M|        T& operator*() const { return *ptr; }
_ZNK9prevectorILj36EhjiE8capacityEv:
  260|  1.29M|    size_t capacity() const {
  261|  1.29M|        if (is_direct()) {
  ------------------
  |  Branch (261:13): [True: 682k, False: 609k]
  ------------------
  262|   682k|            return N;
  263|   682k|        } else {
  264|   609k|            return _union.indirect_contents.capacity;
  265|   609k|        }
  266|  1.29M|    }
_ZN9prevectorILj36EhjiE8iteratorC2EPh:
   60|  3.11M|        iterator(T* ptr_) : ptr(ptr_) {}
_ZN9prevectorILj36EhjiE6insertITkNSt3__114input_iteratorENS2_11__wrap_iterIPKhEEEEvNS0_8iteratorET_S8_:
  335|   164k|    void insert(iterator pos, InputIterator first, InputIterator last) {
  336|   164k|        size_type p = pos - begin();
  337|   164k|        difference_type count = last - first;
  338|   164k|        size_type new_size = size() + count;
  339|   164k|        if (capacity() < new_size) {
  ------------------
  |  Branch (339:13): [True: 24.8k, False: 139k]
  ------------------
  340|  24.8k|            change_capacity(new_size + (new_size >> 1));
  341|  24.8k|        }
  342|   164k|        T* ptr = item_ptr(p);
  343|   164k|        T* dst = ptr + count;
  344|   164k|        memmove(dst, ptr, (size() - p) * sizeof(T));
  345|   164k|        _size += count;
  346|   164k|        fill(ptr, first, last);
  347|   164k|    }
_ZN9prevectorILj36EhjiE4fillITkNSt3__114input_iteratorENS2_11__wrap_iterIPKhEEEEvPhT_S8_:
  167|   167k|    void fill(T* dst, InputIterator first, InputIterator last) {
  168|  6.69M|        while (first != last) {
  ------------------
  |  Branch (168:16): [True: 6.53M, False: 167k]
  ------------------
  169|  6.53M|            new(static_cast<void*>(dst)) T(*first);
  170|  6.53M|            ++dst;
  171|  6.53M|            ++first;
  172|  6.53M|        }
  173|   167k|    }
_ZN9prevectorILj36EhjiEC2ERKS0_:
  216|  4.18k|    prevector(const prevector<N, T, Size, Diff>& other) {
  217|  4.18k|        size_type n = other.size();
  218|  4.18k|        change_capacity(n);
  219|  4.18k|        _size += n;
  220|  4.18k|        fill(item_ptr(0), other.begin(),  other.end());
  221|  4.18k|    }
_ZN9prevectorILj36EhjiE3endEv:
  257|  1.21M|    iterator end() { return iterator(item_ptr(size())); }
_ZN9prevectorILj36EhjiE5beginEv:
  255|  1.21M|    iterator begin() { return iterator(item_ptr(0)); }
_ZN9prevectorILj36EhjiEC2ITkNSt3__114input_iteratorENS0_14const_iteratorEEET_S4_:
  209|  5.31k|    prevector(InputIterator first, InputIterator last) {
  210|  5.31k|        size_type n = last - first;
  211|  5.31k|        change_capacity(n);
  212|  5.31k|        _size += n;
  213|  5.31k|        fill(item_ptr(0), first, last);
  214|  5.31k|    }
_ZN9prevectorILj36EhjiEC2ITkNSt3__114input_iteratorENS2_11__wrap_iterIPKhEEEET_S7_:
  209|  2.97k|    prevector(InputIterator first, InputIterator last) {
  210|  2.97k|        size_type n = last - first;
  211|  2.97k|        change_capacity(n);
  212|  2.97k|        _size += n;
  213|  2.97k|        fill(item_ptr(0), first, last);
  214|  2.97k|    }
_ZN9prevectorILj36EhjiED2Ev:
  422|  1.29M|    ~prevector() {
  423|  1.29M|        if (!is_direct()) {
  ------------------
  |  Branch (423:13): [True: 63.9k, False: 1.23M]
  ------------------
  424|  63.9k|            free(_union.indirect_contents.indirect);
  425|  63.9k|            _union.indirect_contents.indirect = nullptr;
  426|  63.9k|        }
  427|  1.29M|    }
_ZN9prevectorILj36EhjiE14const_iteratorC2EPKh:
   87|  1.64M|        const_iterator(const T* ptr_) : ptr(ptr_) {}
_ZNK9prevectorILj36EhjiE14const_iteratorplEj:
   97|   294k|        const_iterator operator+(size_type n) const { return const_iterator(ptr + n); }
_ZmiN9prevectorILj36EhjiE14const_iteratorES1_:
   96|  1.62M|        difference_type friend operator-(const_iterator a, const_iterator b) { return (&(*a) - &(*b)); }
_ZN9prevectorILj36EhjiE14const_iteratorppEi:
   94|   999k|        const_iterator operator++(int) { const_iterator copy(*this); ++(*this); return copy; }
_ZN9prevectorILj36EhjiE14const_iteratorpLEj:
   99|   274k|        const_iterator& operator+=(size_type n) { ptr += n; return *this; }

_Z29ecdsa_signature_parse_der_laxP25secp256k1_ecdsa_signaturePKhm:
   45|  10.2k|int ecdsa_signature_parse_der_lax(secp256k1_ecdsa_signature* sig, const unsigned char *input, size_t inputlen) {
   46|  10.2k|    size_t rpos, rlen, spos, slen;
   47|  10.2k|    size_t pos = 0;
   48|  10.2k|    size_t lenbyte;
   49|  10.2k|    unsigned char tmpsig[64] = {0};
   50|  10.2k|    int overflow = 0;
   51|       |
   52|       |    /* Hack to initialize sig with a correctly-parsed but invalid signature. */
   53|  10.2k|    secp256k1_ecdsa_signature_parse_compact(secp256k1_context_static, sig, tmpsig);
   54|       |
   55|       |    /* Sequence tag byte */
   56|  10.2k|    if (pos == inputlen || input[pos] != 0x30) {
  ------------------
  |  Branch (56:9): [True: 0, False: 10.2k]
  |  Branch (56:28): [True: 0, False: 10.2k]
  ------------------
   57|      0|        return 0;
   58|      0|    }
   59|  10.2k|    pos++;
   60|       |
   61|       |    /* Sequence length bytes */
   62|  10.2k|    if (pos == inputlen) {
  ------------------
  |  Branch (62:9): [True: 0, False: 10.2k]
  ------------------
   63|      0|        return 0;
   64|      0|    }
   65|  10.2k|    lenbyte = input[pos++];
   66|  10.2k|    if (lenbyte & 0x80) {
  ------------------
  |  Branch (66:9): [True: 0, False: 10.2k]
  ------------------
   67|      0|        lenbyte -= 0x80;
   68|      0|        if (lenbyte > inputlen - pos) {
  ------------------
  |  Branch (68:13): [True: 0, False: 0]
  ------------------
   69|      0|            return 0;
   70|      0|        }
   71|      0|        pos += lenbyte;
   72|      0|    }
   73|       |
   74|       |    /* Integer tag byte for R */
   75|  10.2k|    if (pos == inputlen || input[pos] != 0x02) {
  ------------------
  |  Branch (75:9): [True: 0, False: 10.2k]
  |  Branch (75:28): [True: 0, False: 10.2k]
  ------------------
   76|      0|        return 0;
   77|      0|    }
   78|  10.2k|    pos++;
   79|       |
   80|       |    /* Integer length for R */
   81|  10.2k|    if (pos == inputlen) {
  ------------------
  |  Branch (81:9): [True: 0, False: 10.2k]
  ------------------
   82|      0|        return 0;
   83|      0|    }
   84|  10.2k|    lenbyte = input[pos++];
   85|  10.2k|    if (lenbyte & 0x80) {
  ------------------
  |  Branch (85:9): [True: 0, False: 10.2k]
  ------------------
   86|      0|        lenbyte -= 0x80;
   87|      0|        if (lenbyte > inputlen - pos) {
  ------------------
  |  Branch (87:13): [True: 0, False: 0]
  ------------------
   88|      0|            return 0;
   89|      0|        }
   90|      0|        while (lenbyte > 0 && input[pos] == 0) {
  ------------------
  |  Branch (90:16): [True: 0, False: 0]
  |  Branch (90:31): [True: 0, False: 0]
  ------------------
   91|      0|            pos++;
   92|      0|            lenbyte--;
   93|      0|        }
   94|      0|        static_assert(sizeof(size_t) >= 4, "size_t too small");
   95|      0|        if (lenbyte >= 4) {
  ------------------
  |  Branch (95:13): [True: 0, False: 0]
  ------------------
   96|      0|            return 0;
   97|      0|        }
   98|      0|        rlen = 0;
   99|      0|        while (lenbyte > 0) {
  ------------------
  |  Branch (99:16): [True: 0, False: 0]
  ------------------
  100|      0|            rlen = (rlen << 8) + input[pos];
  101|      0|            pos++;
  102|      0|            lenbyte--;
  103|      0|        }
  104|  10.2k|    } else {
  105|  10.2k|        rlen = lenbyte;
  106|  10.2k|    }
  107|  10.2k|    if (rlen > inputlen - pos) {
  ------------------
  |  Branch (107:9): [True: 0, False: 10.2k]
  ------------------
  108|      0|        return 0;
  109|      0|    }
  110|  10.2k|    rpos = pos;
  111|  10.2k|    pos += rlen;
  112|       |
  113|       |    /* Integer tag byte for S */
  114|  10.2k|    if (pos == inputlen || input[pos] != 0x02) {
  ------------------
  |  Branch (114:9): [True: 0, False: 10.2k]
  |  Branch (114:28): [True: 0, False: 10.2k]
  ------------------
  115|      0|        return 0;
  116|      0|    }
  117|  10.2k|    pos++;
  118|       |
  119|       |    /* Integer length for S */
  120|  10.2k|    if (pos == inputlen) {
  ------------------
  |  Branch (120:9): [True: 0, False: 10.2k]
  ------------------
  121|      0|        return 0;
  122|      0|    }
  123|  10.2k|    lenbyte = input[pos++];
  124|  10.2k|    if (lenbyte & 0x80) {
  ------------------
  |  Branch (124:9): [True: 0, False: 10.2k]
  ------------------
  125|      0|        lenbyte -= 0x80;
  126|      0|        if (lenbyte > inputlen - pos) {
  ------------------
  |  Branch (126:13): [True: 0, False: 0]
  ------------------
  127|      0|            return 0;
  128|      0|        }
  129|      0|        while (lenbyte > 0 && input[pos] == 0) {
  ------------------
  |  Branch (129:16): [True: 0, False: 0]
  |  Branch (129:31): [True: 0, False: 0]
  ------------------
  130|      0|            pos++;
  131|      0|            lenbyte--;
  132|      0|        }
  133|      0|        static_assert(sizeof(size_t) >= 4, "size_t too small");
  134|      0|        if (lenbyte >= 4) {
  ------------------
  |  Branch (134:13): [True: 0, False: 0]
  ------------------
  135|      0|            return 0;
  136|      0|        }
  137|      0|        slen = 0;
  138|      0|        while (lenbyte > 0) {
  ------------------
  |  Branch (138:16): [True: 0, False: 0]
  ------------------
  139|      0|            slen = (slen << 8) + input[pos];
  140|      0|            pos++;
  141|      0|            lenbyte--;
  142|      0|        }
  143|  10.2k|    } else {
  144|  10.2k|        slen = lenbyte;
  145|  10.2k|    }
  146|  10.2k|    if (slen > inputlen - pos) {
  ------------------
  |  Branch (146:9): [True: 0, False: 10.2k]
  ------------------
  147|      0|        return 0;
  148|      0|    }
  149|  10.2k|    spos = pos;
  150|       |
  151|       |    /* Ignore leading zeroes in R */
  152|  10.7k|    while (rlen > 0 && input[rpos] == 0) {
  ------------------
  |  Branch (152:12): [True: 10.7k, False: 0]
  |  Branch (152:24): [True: 484, False: 10.2k]
  ------------------
  153|    484|        rlen--;
  154|    484|        rpos++;
  155|    484|    }
  156|       |    /* Copy R value */
  157|  10.2k|    if (rlen > 32) {
  ------------------
  |  Branch (157:9): [True: 0, False: 10.2k]
  ------------------
  158|      0|        overflow = 1;
  159|  10.2k|    } else {
  160|  10.2k|        memcpy(tmpsig + 32 - rlen, input + rpos, rlen);
  161|  10.2k|    }
  162|       |
  163|       |    /* Ignore leading zeroes in S */
  164|  10.2k|    while (slen > 0 && input[spos] == 0) {
  ------------------
  |  Branch (164:12): [True: 10.2k, False: 0]
  |  Branch (164:24): [True: 0, False: 10.2k]
  ------------------
  165|      0|        slen--;
  166|      0|        spos++;
  167|      0|    }
  168|       |    /* Copy S value */
  169|  10.2k|    if (slen > 32) {
  ------------------
  |  Branch (169:9): [True: 0, False: 10.2k]
  ------------------
  170|      0|        overflow = 1;
  171|  10.2k|    } else {
  172|  10.2k|        memcpy(tmpsig + 64 - slen, input + spos, slen);
  173|  10.2k|    }
  174|       |
  175|  10.2k|    if (!overflow) {
  ------------------
  |  Branch (175:9): [True: 10.2k, False: 0]
  ------------------
  176|  10.2k|        overflow = !secp256k1_ecdsa_signature_parse_compact(secp256k1_context_static, sig, tmpsig);
  177|  10.2k|    }
  178|  10.2k|    if (overflow) {
  ------------------
  |  Branch (178:9): [True: 0, False: 10.2k]
  ------------------
  179|       |        /* Overwrite the result again with a correctly-parsed but invalid
  180|       |           signature if parsing failed. */
  181|      0|        memset(tmpsig, 0, 64);
  182|      0|        secp256k1_ecdsa_signature_parse_compact(secp256k1_context_static, sig, tmpsig);
  183|      0|    }
  184|  10.2k|    return 1;
  185|  10.2k|}
_ZNK11XOnlyPubKey27GetEvenCorrespondingCPubKeyEv:
  224|  24.2k|{
  225|  24.2k|    unsigned char full_key[CPubKey::COMPRESSED_SIZE] = {0x02};
  226|  24.2k|    std::copy(begin(), end(), full_key + 1);
  227|  24.2k|    return CPubKey{full_key};
  228|  24.2k|}
_ZNK11XOnlyPubKey12IsFullyValidEv:
  231|  1.29k|{
  232|  1.29k|    secp256k1_xonly_pubkey pubkey;
  233|  1.29k|    return secp256k1_xonly_pubkey_parse(secp256k1_context_static, &pubkey, m_keydata.data());
  234|  1.29k|}
_ZNK11XOnlyPubKey19ComputeTapTweakHashEPK7uint256:
  247|  3.24k|{
  248|  3.24k|    if (merkle_root == nullptr) {
  ------------------
  |  Branch (248:9): [True: 0, False: 3.24k]
  ------------------
  249|       |        // We have no scripts. The actual tweak does not matter, but follow BIP341 here to
  250|       |        // allow for reproducible tweaking.
  251|      0|        return (HashWriter{HASHER_TAPTWEAK} << m_keydata).GetSHA256();
  252|  3.24k|    } else {
  253|  3.24k|        return (HashWriter{HASHER_TAPTWEAK} << m_keydata << *merkle_root).GetSHA256();
  254|  3.24k|    }
  255|  3.24k|}
_ZNK11XOnlyPubKey13CheckTapTweakERKS_RK7uint256b:
  258|  1.29k|{
  259|  1.29k|    secp256k1_xonly_pubkey internal_key;
  260|  1.29k|    if (!secp256k1_xonly_pubkey_parse(secp256k1_context_static, &internal_key, internal.data())) return false;
  ------------------
  |  Branch (260:9): [True: 0, False: 1.29k]
  ------------------
  261|  1.29k|    uint256 tweak = internal.ComputeTapTweakHash(&merkle_root);
  262|  1.29k|    return secp256k1_xonly_pubkey_tweak_add_check(secp256k1_context_static, m_keydata.begin(), parity, &internal_key, tweak.begin());
  263|  1.29k|}
_ZNK11XOnlyPubKey14CreateTapTweakEPK7uint256:
  266|  1.95k|{
  267|  1.95k|    secp256k1_xonly_pubkey base_point;
  268|  1.95k|    if (!secp256k1_xonly_pubkey_parse(secp256k1_context_static, &base_point, data())) return std::nullopt;
  ------------------
  |  Branch (268:9): [True: 0, False: 1.95k]
  ------------------
  269|  1.95k|    secp256k1_pubkey out;
  270|  1.95k|    uint256 tweak = ComputeTapTweakHash(merkle_root);
  271|  1.95k|    if (!secp256k1_xonly_pubkey_tweak_add(secp256k1_context_static, &out, &base_point, tweak.data())) return std::nullopt;
  ------------------
  |  Branch (271:9): [True: 0, False: 1.95k]
  ------------------
  272|  1.95k|    int parity = -1;
  273|  1.95k|    std::pair<XOnlyPubKey, bool> ret;
  274|  1.95k|    secp256k1_xonly_pubkey out_xonly;
  275|  1.95k|    if (!secp256k1_xonly_pubkey_from_pubkey(secp256k1_context_static, &out_xonly, &parity, &out)) return std::nullopt;
  ------------------
  |  Branch (275:9): [True: 0, False: 1.95k]
  ------------------
  276|  1.95k|    secp256k1_xonly_pubkey_serialize(secp256k1_context_static, ret.first.begin(), &out_xonly);
  277|  1.95k|    assert(parity == 0 || parity == 1);
  ------------------
  |  Branch (277:5): [True: 938, False: 1.01k]
  |  Branch (277:5): [True: 1.01k, False: 0]
  |  Branch (277:5): [True: 1.95k, False: 0]
  ------------------
  278|  1.95k|    ret.second = parity;
  279|  1.95k|    return ret;
  280|  1.95k|}
_ZN7CPubKey9CheckLowSERKNSt3__16vectorIhNS0_9allocatorIhEEEE:
  423|  10.2k|/* static */ bool CPubKey::CheckLowS(const std::vector<unsigned char>& vchSig) {
  424|  10.2k|    secp256k1_ecdsa_signature sig;
  425|  10.2k|    if (!ecdsa_signature_parse_der_lax(&sig, vchSig.data(), vchSig.size())) {
  ------------------
  |  Branch (425:9): [True: 0, False: 10.2k]
  ------------------
  426|      0|        return false;
  427|      0|    }
  428|  10.2k|    return (!secp256k1_ecdsa_signature_normalize(secp256k1_context_static, nullptr, &sig));
  429|  10.2k|}

_ZN11XOnlyPubKeyC2ERK7CPubKey:
  262|   129k|    explicit XOnlyPubKey(const CPubKey& pubkey) : XOnlyPubKey(std::span{pubkey}.subspan(1, 32)) {}
_ZN7CPubKeyC2INSt3__111__wrap_iterIPhEEEET_S5_:
  107|  29.5k|    {
  108|  29.5k|        Set(pbegin, pend);
  109|  29.5k|    }
_ZN7CPubKey3SetINSt3__111__wrap_iterIPhEEEEvT_S5_:
   96|  29.5k|    {
   97|  29.5k|        int len = pend == pbegin ? 0 : GetLen(pbegin[0]);
  ------------------
  |  Branch (97:19): [True: 0, False: 29.5k]
  ------------------
   98|  29.5k|        if (len && len == (pend - pbegin))
  ------------------
  |  Branch (98:13): [True: 29.5k, False: 0]
  |  Branch (98:20): [True: 29.5k, False: 0]
  ------------------
   99|  29.5k|            memcpy(vch, (unsigned char*)&pbegin[0], len);
  100|      0|        else
  101|      0|            Invalidate();
  102|  29.5k|    }
_ZN6CKeyIDC2Ev:
   28|  1.76k|    CKeyID() : uint160() {}
_ZltRK7CPubKeyS1_:
  131|  2.66M|    {
  132|  2.66M|        return a.vch[0] < b.vch[0] ||
  ------------------
  |  Branch (132:16): [True: 104k, False: 2.55M]
  ------------------
  133|  2.55M|               (a.vch[0] == b.vch[0] && memcmp(a.vch, b.vch, a.size()) < 0);
  ------------------
  |  Branch (133:17): [True: 2.39M, False: 167k]
  |  Branch (133:41): [True: 813k, False: 1.57M]
  ------------------
  134|  2.66M|    }
_ZNK11XOnlyPubKeyltERKS_:
  307|   724k|    bool operator<(const XOnlyPubKey& other) const { return m_keydata < other.m_keydata; }
_ZNK7CPubKey3endEv:
  121|  63.4k|    const unsigned char* end() const { return vch + size(); }
_ZNK7CPubKey4dataEv:
  119|   131k|    const unsigned char* data() const { return vch; }
_ZN11XOnlyPubKey4sizeEv:
  299|  1.64k|    static constexpr size_t size() { return decltype(m_keydata)::size(); }
_ZN7CPubKey6GetLenEh:
   67|  2.68M|    {
   68|  2.68M|        if (chHeader == 2 || chHeader == 3)
  ------------------
  |  Branch (68:13): [True: 1.76M, False: 919k]
  |  Branch (68:30): [True: 919k, False: 0]
  ------------------
   69|  2.68M|            return COMPRESSED_SIZE;
   70|      0|        if (chHeader == 4 || chHeader == 6 || chHeader == 7)
  ------------------
  |  Branch (70:13): [True: 0, False: 0]
  |  Branch (70:30): [True: 0, False: 0]
  |  Branch (70:47): [True: 0, False: 0]
  ------------------
   71|      0|            return SIZE;
   72|      0|        return 0;
   73|      0|    }
_ZN7CPubKey10InvalidateEv:
   77|  81.1k|    {
   78|  81.1k|        vch[0] = 0xFF;
   79|  81.1k|    }
_ZN7CPubKeyC2ENSt3__14spanIKhLm18446744073709551615EEE:
  113|  39.1k|    {
  114|  39.1k|        Set(_vch.begin(), _vch.end());
  115|  39.1k|    }
_ZNK7CPubKey4sizeEv:
  118|  2.61M|    unsigned int size() const { return GetLen(vch[0]); }
_ZNK7CPubKey7IsValidEv:
  192|  29.5k|    {
  193|  29.5k|        return size() > 0;
  194|  29.5k|    }
_ZN7CPubKey3SetINSt3__111__wrap_iterIPKhEEEEvT_S6_:
   96|  39.1k|    {
   97|  39.1k|        int len = pend == pbegin ? 0 : GetLen(pbegin[0]);
  ------------------
  |  Branch (97:19): [True: 0, False: 39.1k]
  ------------------
   98|  39.1k|        if (len && len == (pend - pbegin))
  ------------------
  |  Branch (98:13): [True: 39.1k, False: 0]
  |  Branch (98:20): [True: 39.1k, False: 0]
  ------------------
   99|  39.1k|            memcpy(vch, (unsigned char*)&pbegin[0], len);
  100|      0|        else
  101|      0|            Invalidate();
  102|  39.1k|    }
_ZN7CPubKeyC2Ev:
   89|  81.1k|    {
   90|  81.1k|        Invalidate();
   91|  81.1k|    }
_ZNK11XOnlyPubKey5beginEv:
  301|  80.4k|    const unsigned char* begin() const { return m_keydata.begin(); }
_ZNK11XOnlyPubKey3endEv:
  302|  80.4k|    const unsigned char* end() const { return m_keydata.end(); }
_ZNK11XOnlyPubKey4dataEv:
  300|  4.88k|    const unsigned char* data() const { return m_keydata.begin(); }
_ZN11XOnlyPubKeyC2Ev:
  244|  35.8k|    XOnlyPubKey() = default;
_ZN11XOnlyPubKey5beginEv:
  304|  26.2k|    unsigned char* begin() { return m_keydata.begin(); }
_ZNK7CPubKey5beginEv:
  120|  63.4k|    const unsigned char* begin() const { return vch; }
_ZN11XOnlyPubKeyC2ENSt3__14spanIKhLm18446744073709551615EEE:
  259|   136k|    constexpr explicit XOnlyPubKey(std::span<const unsigned char> bytes) : m_keydata{bytes} {}

random.cpp:_ZN12_GLOBAL__N_18RNGStateD2Ev:
  367|      2|    ~RNGState() = default;

_Z10CastToBoolRKNSt3__16vectorIhNS_9allocatorIhEEEE:
   47|  18.8k|{
   48|  18.8k|    for (unsigned int i = 0; i < vch.size(); i++)
  ------------------
  |  Branch (48:30): [True: 13.3k, False: 5.42k]
  ------------------
   49|  13.3k|    {
   50|  13.3k|        if (vch[i] != 0)
  ------------------
  |  Branch (50:13): [True: 13.3k, False: 23]
  ------------------
   51|  13.3k|        {
   52|       |            // Can be negative zero
   53|  13.3k|            if (i == vch.size()-1 && vch[i] == 0x80)
  ------------------
  |  Branch (53:17): [True: 9.82k, False: 3.55k]
  |  Branch (53:38): [True: 0, False: 9.82k]
  ------------------
   54|      0|                return false;
   55|  13.3k|            return true;
   56|  13.3k|        }
   57|  13.3k|    }
   58|  5.42k|    return false;
   59|  18.8k|}
_Z22CheckSignatureEncodingRKNSt3__16vectorIhNS_9allocatorIhEEEE19script_verify_flagsP13ScriptError_t:
  211|  14.9k|bool CheckSignatureEncoding(const std::vector<unsigned char> &vchSig, script_verify_flags flags, ScriptError* serror) {
  212|       |    // Empty signature. Not strictly DER encoded, but allowed to provide a
  213|       |    // compact way to provide an invalid signature for use with CHECK(MULTI)SIG
  214|  14.9k|    if (vchSig.size() == 0) {
  ------------------
  |  Branch (214:9): [True: 4.62k, False: 10.2k]
  ------------------
  215|  4.62k|        return true;
  216|  4.62k|    }
  217|  10.2k|    if ((flags & (SCRIPT_VERIFY_DERSIG | SCRIPT_VERIFY_LOW_S | SCRIPT_VERIFY_STRICTENC)) != 0 && !IsValidSignatureEncoding(vchSig)) {
  ------------------
  |  Branch (217:9): [True: 10.2k, False: 0]
  |  Branch (217:9): [True: 0, False: 10.2k]
  |  Branch (217:98): [True: 0, False: 10.2k]
  ------------------
  218|      0|        return set_error(serror, SCRIPT_ERR_SIG_DER);
  219|  10.2k|    } else if ((flags & SCRIPT_VERIFY_LOW_S) != 0 && !IsLowDERSignature(vchSig, serror)) {
  ------------------
  |  Branch (219:16): [True: 10.2k, False: 0]
  |  Branch (219:16): [True: 0, False: 10.2k]
  |  Branch (219:54): [True: 0, False: 10.2k]
  ------------------
  220|       |        // serror is set
  221|      0|        return false;
  222|  10.2k|    } else if ((flags & SCRIPT_VERIFY_STRICTENC) != 0 && !IsDefinedHashtypeSignature(vchSig)) {
  ------------------
  |  Branch (222:16): [True: 10.2k, False: 0]
  |  Branch (222:16): [True: 0, False: 10.2k]
  |  Branch (222:58): [True: 0, False: 10.2k]
  ------------------
  223|      0|        return set_error(serror, SCRIPT_ERR_SIG_HASHTYPE);
  224|      0|    }
  225|  10.2k|    return true;
  226|  10.2k|}
_Z10EvalScriptRNSt3__16vectorINS0_IhNS_9allocatorIhEEEENS1_IS3_EEEERK7CScript19script_verify_flagsRK20BaseSignatureChecker10SigVersionR19ScriptExecutionDataP13ScriptError_t:
  418|  8.90k|{
  419|  8.90k|    static const CScriptNum bnZero(0);
  420|  8.90k|    static const CScriptNum bnOne(1);
  421|       |    // static const CScriptNum bnFalse(0);
  422|       |    // static const CScriptNum bnTrue(1);
  423|  8.90k|    static const valtype vchFalse(0);
  424|       |    // static const valtype vchZero(0);
  425|  8.90k|    static const valtype vchTrue(1, 1);
  426|       |
  427|       |    // sigversion cannot be TAPROOT here, as it admits no script execution.
  428|  8.90k|    assert(sigversion == SigVersion::BASE || sigversion == SigVersion::WITNESS_V0 || sigversion == SigVersion::TAPSCRIPT);
  ------------------
  |  Branch (428:5): [True: 5.94k, False: 2.96k]
  |  Branch (428:5): [True: 1.68k, False: 1.28k]
  |  Branch (428:5): [True: 1.28k, False: 0]
  |  Branch (428:5): [True: 8.90k, False: 0]
  ------------------
  429|       |
  430|  8.90k|    CScript::const_iterator pc = script.begin();
  431|  8.90k|    CScript::const_iterator pend = script.end();
  432|  8.90k|    CScript::const_iterator pbegincodehash = script.begin();
  433|  8.90k|    opcodetype opcode;
  434|  8.90k|    valtype vchPushValue;
  435|  8.90k|    ConditionStack vfExec;
  436|  8.90k|    std::vector<valtype> altstack;
  437|  8.90k|    set_error(serror, SCRIPT_ERR_UNKNOWN_ERROR);
  438|  8.90k|    if ((sigversion == SigVersion::BASE || sigversion == SigVersion::WITNESS_V0) && script.size() > MAX_SCRIPT_SIZE) {
  ------------------
  |  Branch (438:10): [True: 5.94k, False: 2.96k]
  |  Branch (438:44): [True: 1.68k, False: 1.28k]
  |  Branch (438:85): [True: 0, False: 7.62k]
  ------------------
  439|      0|        return set_error(serror, SCRIPT_ERR_SCRIPT_SIZE);
  440|      0|    }
  441|  8.90k|    int nOpCount = 0;
  442|  8.90k|    bool fRequireMinimal = (flags & SCRIPT_VERIFY_MINIMALDATA) != 0;
  443|  8.90k|    uint32_t opcode_pos = 0;
  444|  8.90k|    execdata.m_codeseparator_pos = 0xFFFFFFFFUL;
  445|  8.90k|    execdata.m_codeseparator_pos_init = true;
  446|       |
  447|  8.90k|    try
  448|  8.90k|    {
  449|   406k|        for (; pc < pend; ++opcode_pos) {
  ------------------
  |  Branch (449:16): [True: 397k, False: 8.83k]
  ------------------
  450|   397k|            bool fExec = vfExec.all_true();
  451|       |
  452|       |            //
  453|       |            // Read instruction
  454|       |            //
  455|   397k|            if (!script.GetOp(pc, opcode, vchPushValue))
  ------------------
  |  Branch (455:17): [True: 0, False: 397k]
  ------------------
  456|      0|                return set_error(serror, SCRIPT_ERR_BAD_OPCODE);
  457|   397k|            if (vchPushValue.size() > MAX_SCRIPT_ELEMENT_SIZE)
  ------------------
  |  Branch (457:17): [True: 0, False: 397k]
  ------------------
  458|      0|                return set_error(serror, SCRIPT_ERR_PUSH_SIZE);
  459|       |
  460|   397k|            if (sigversion == SigVersion::BASE || sigversion == SigVersion::WITNESS_V0) {
  ------------------
  |  Branch (460:17): [True: 5.94k, False: 391k]
  |  Branch (460:51): [True: 131k, False: 259k]
  ------------------
  461|       |                // Note how OP_RESERVED does not count towards the opcode limit.
  462|   137k|                if (opcode > OP_16 && ++nOpCount > MAX_OPS_PER_SCRIPT) {
  ------------------
  |  Branch (462:21): [True: 77.4k, False: 60.2k]
  |  Branch (462:39): [True: 56, False: 77.3k]
  ------------------
  463|     56|                    return set_error(serror, SCRIPT_ERR_OP_COUNT);
  464|     56|                }
  465|   137k|            }
  466|       |
  467|   397k|            if (opcode == OP_CAT ||
  ------------------
  |  Branch (467:17): [True: 0, False: 397k]
  ------------------
  468|   397k|                opcode == OP_SUBSTR ||
  ------------------
  |  Branch (468:17): [True: 0, False: 397k]
  ------------------
  469|   397k|                opcode == OP_LEFT ||
  ------------------
  |  Branch (469:17): [True: 0, False: 397k]
  ------------------
  470|   397k|                opcode == OP_RIGHT ||
  ------------------
  |  Branch (470:17): [True: 0, False: 397k]
  ------------------
  471|   397k|                opcode == OP_INVERT ||
  ------------------
  |  Branch (471:17): [True: 0, False: 397k]
  ------------------
  472|   397k|                opcode == OP_AND ||
  ------------------
  |  Branch (472:17): [True: 0, False: 397k]
  ------------------
  473|   397k|                opcode == OP_OR ||
  ------------------
  |  Branch (473:17): [True: 0, False: 397k]
  ------------------
  474|   397k|                opcode == OP_XOR ||
  ------------------
  |  Branch (474:17): [True: 0, False: 397k]
  ------------------
  475|   397k|                opcode == OP_2MUL ||
  ------------------
  |  Branch (475:17): [True: 0, False: 397k]
  ------------------
  476|   397k|                opcode == OP_2DIV ||
  ------------------
  |  Branch (476:17): [True: 0, False: 397k]
  ------------------
  477|   397k|                opcode == OP_MUL ||
  ------------------
  |  Branch (477:17): [True: 0, False: 397k]
  ------------------
  478|   397k|                opcode == OP_DIV ||
  ------------------
  |  Branch (478:17): [True: 0, False: 397k]
  ------------------
  479|   397k|                opcode == OP_MOD ||
  ------------------
  |  Branch (479:17): [True: 0, False: 397k]
  ------------------
  480|   397k|                opcode == OP_LSHIFT ||
  ------------------
  |  Branch (480:17): [True: 0, False: 397k]
  ------------------
  481|   397k|                opcode == OP_RSHIFT)
  ------------------
  |  Branch (481:17): [True: 0, False: 397k]
  ------------------
  482|      0|                return set_error(serror, SCRIPT_ERR_DISABLED_OPCODE); // Disabled opcodes (CVE-2010-5137).
  483|       |
  484|       |            // With SCRIPT_VERIFY_CONST_SCRIPTCODE, OP_CODESEPARATOR in non-segwit script is rejected even in an unexecuted branch
  485|   397k|            if (opcode == OP_CODESEPARATOR && sigversion == SigVersion::BASE && (flags & SCRIPT_VERIFY_CONST_SCRIPTCODE))
  ------------------
  |  Branch (485:17): [True: 0, False: 397k]
  |  Branch (485:17): [True: 0, False: 397k]
  |  Branch (485:47): [True: 0, False: 0]
  |  Branch (485:81): [True: 0, False: 0]
  ------------------
  486|      0|                return set_error(serror, SCRIPT_ERR_OP_CODESEPARATOR);
  487|       |
  488|   397k|            if (fExec && 0 <= opcode && opcode <= OP_PUSHDATA4) {
  ------------------
  |  Branch (488:17): [True: 327k, False: 70.1k]
  |  Branch (488:26): [True: 327k, False: 0]
  |  Branch (488:41): [True: 54.6k, False: 272k]
  ------------------
  489|  54.6k|                if (fRequireMinimal && !CheckMinimalPush(vchPushValue, opcode)) {
  ------------------
  |  Branch (489:21): [True: 54.6k, False: 0]
  |  Branch (489:40): [True: 0, False: 54.6k]
  ------------------
  490|      0|                    return set_error(serror, SCRIPT_ERR_MINIMALDATA);
  491|      0|                }
  492|  54.6k|                stack.push_back(vchPushValue);
  493|   342k|            } else if (fExec || (OP_IF <= opcode && opcode <= OP_ENDIF))
  ------------------
  |  Branch (493:24): [True: 272k, False: 70.1k]
  |  Branch (493:34): [True: 42.4k, False: 27.6k]
  |  Branch (493:53): [True: 20.1k, False: 22.2k]
  ------------------
  494|   292k|            switch (opcode)
  495|   292k|            {
  496|       |                //
  497|       |                // Push value
  498|       |                //
  499|      0|                case OP_1NEGATE:
  ------------------
  |  Branch (499:17): [True: 0, False: 292k]
  ------------------
  500|  8.10k|                case OP_1:
  ------------------
  |  Branch (500:17): [True: 8.10k, False: 284k]
  ------------------
  501|  8.81k|                case OP_2:
  ------------------
  |  Branch (501:17): [True: 706, False: 292k]
  ------------------
  502|  9.12k|                case OP_3:
  ------------------
  |  Branch (502:17): [True: 305, False: 292k]
  ------------------
  503|  9.34k|                case OP_4:
  ------------------
  |  Branch (503:17): [True: 226, False: 292k]
  ------------------
  504|  9.65k|                case OP_5:
  ------------------
  |  Branch (504:17): [True: 306, False: 292k]
  ------------------
  505|  9.80k|                case OP_6:
  ------------------
  |  Branch (505:17): [True: 156, False: 292k]
  ------------------
  506|  9.94k|                case OP_7:
  ------------------
  |  Branch (506:17): [True: 135, False: 292k]
  ------------------
  507|  10.1k|                case OP_8:
  ------------------
  |  Branch (507:17): [True: 213, False: 292k]
  ------------------
  508|  10.2k|                case OP_9:
  ------------------
  |  Branch (508:17): [True: 138, False: 292k]
  ------------------
  509|  10.4k|                case OP_10:
  ------------------
  |  Branch (509:17): [True: 200, False: 292k]
  ------------------
  510|  10.7k|                case OP_11:
  ------------------
  |  Branch (510:17): [True: 213, False: 292k]
  ------------------
  511|  10.8k|                case OP_12:
  ------------------
  |  Branch (511:17): [True: 156, False: 292k]
  ------------------
  512|  11.0k|                case OP_13:
  ------------------
  |  Branch (512:17): [True: 146, False: 292k]
  ------------------
  513|  11.0k|                case OP_14:
  ------------------
  |  Branch (513:17): [True: 82, False: 292k]
  ------------------
  514|  11.2k|                case OP_15:
  ------------------
  |  Branch (514:17): [True: 163, False: 292k]
  ------------------
  515|  11.4k|                case OP_16:
  ------------------
  |  Branch (515:17): [True: 181, False: 292k]
  ------------------
  516|  11.4k|                {
  517|       |                    // ( -- value)
  518|  11.4k|                    CScriptNum bn((int)opcode - (int)(OP_1 - 1));
  519|  11.4k|                    stack.push_back(bn.getvch());
  520|       |                    // The result of these opcodes should always be the minimal way to push the data
  521|       |                    // they push, so no need for a CheckMinimalPush here.
  522|  11.4k|                }
  523|  11.4k|                break;
  524|       |
  525|       |
  526|       |                //
  527|       |                // Control
  528|       |                //
  529|  11.7k|                case OP_NOP:
  ------------------
  |  Branch (529:17): [True: 11.7k, False: 281k]
  ------------------
  530|  11.7k|                    break;
  531|       |
  532|    570|                case OP_CHECKLOCKTIMEVERIFY:
  ------------------
  |  Branch (532:17): [True: 570, False: 292k]
  ------------------
  533|    570|                {
  534|    570|                    if (!(flags & SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)) {
  ------------------
  |  Branch (534:25): [True: 0, False: 570]
  ------------------
  535|       |                        // not enabled; treat as a NOP2
  536|      0|                        break;
  537|      0|                    }
  538|       |
  539|    570|                    if (stack.size() < 1)
  ------------------
  |  Branch (539:25): [True: 0, False: 570]
  ------------------
  540|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  541|       |
  542|       |                    // Note that elsewhere numeric opcodes are limited to
  543|       |                    // operands in the range -2**31+1 to 2**31-1, however it is
  544|       |                    // legal for opcodes to produce results exceeding that
  545|       |                    // range. This limitation is implemented by CScriptNum's
  546|       |                    // default 4-byte limit.
  547|       |                    //
  548|       |                    // If we kept to that limit we'd have a year 2038 problem,
  549|       |                    // even though the nLockTime field in transactions
  550|       |                    // themselves is uint32 which only becomes meaningless
  551|       |                    // after the year 2106.
  552|       |                    //
  553|       |                    // Thus as a special case we tell CScriptNum to accept up
  554|       |                    // to 5-byte bignums, which are good until 2**39-1, well
  555|       |                    // beyond the 2**32-1 limit of the nLockTime field itself.
  556|    570|                    const CScriptNum nLockTime(stacktop(-1), fRequireMinimal, 5);
  ------------------
  |  |   65|    570|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  557|       |
  558|       |                    // In the rare event that the argument may be < 0 due to
  559|       |                    // some arithmetic being done first, you can always use
  560|       |                    // 0 MAX CHECKLOCKTIMEVERIFY.
  561|    570|                    if (nLockTime < 0)
  ------------------
  |  Branch (561:25): [True: 0, False: 570]
  ------------------
  562|      0|                        return set_error(serror, SCRIPT_ERR_NEGATIVE_LOCKTIME);
  563|       |
  564|       |                    // Actually compare the specified lock time with the transaction.
  565|    570|                    if (!checker.CheckLockTime(nLockTime))
  ------------------
  |  Branch (565:25): [True: 0, False: 570]
  ------------------
  566|      0|                        return set_error(serror, SCRIPT_ERR_UNSATISFIED_LOCKTIME);
  567|       |
  568|    570|                    break;
  569|    570|                }
  570|       |
  571|    570|                case OP_CHECKSEQUENCEVERIFY:
  ------------------
  |  Branch (571:17): [True: 499, False: 292k]
  ------------------
  572|    499|                {
  573|    499|                    if (!(flags & SCRIPT_VERIFY_CHECKSEQUENCEVERIFY)) {
  ------------------
  |  Branch (573:25): [True: 0, False: 499]
  ------------------
  574|       |                        // not enabled; treat as a NOP3
  575|      0|                        break;
  576|      0|                    }
  577|       |
  578|    499|                    if (stack.size() < 1)
  ------------------
  |  Branch (578:25): [True: 0, False: 499]
  ------------------
  579|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  580|       |
  581|       |                    // nSequence, like nLockTime, is a 32-bit unsigned integer
  582|       |                    // field. See the comment in CHECKLOCKTIMEVERIFY regarding
  583|       |                    // 5-byte numeric operands.
  584|    499|                    const CScriptNum nSequence(stacktop(-1), fRequireMinimal, 5);
  ------------------
  |  |   65|    499|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  585|       |
  586|       |                    // In the rare event that the argument may be < 0 due to
  587|       |                    // some arithmetic being done first, you can always use
  588|       |                    // 0 MAX CHECKSEQUENCEVERIFY.
  589|    499|                    if (nSequence < 0)
  ------------------
  |  Branch (589:25): [True: 0, False: 499]
  ------------------
  590|      0|                        return set_error(serror, SCRIPT_ERR_NEGATIVE_LOCKTIME);
  591|       |
  592|       |                    // To provide for future soft-fork extensibility, if the
  593|       |                    // operand has the disabled lock-time flag set,
  594|       |                    // CHECKSEQUENCEVERIFY behaves as a NOP.
  595|    499|                    if ((nSequence & CTxIn::SEQUENCE_LOCKTIME_DISABLE_FLAG) != 0)
  ------------------
  |  Branch (595:25): [True: 0, False: 499]
  ------------------
  596|      0|                        break;
  597|       |
  598|       |                    // Compare the specified sequence number with the input.
  599|    499|                    if (!checker.CheckSequence(nSequence))
  ------------------
  |  Branch (599:25): [True: 0, False: 499]
  ------------------
  600|      0|                        return set_error(serror, SCRIPT_ERR_UNSATISFIED_LOCKTIME);
  601|       |
  602|    499|                    break;
  603|    499|                }
  604|       |
  605|    499|                case OP_NOP1: case OP_NOP4: case OP_NOP5:
  ------------------
  |  Branch (605:17): [True: 0, False: 292k]
  |  Branch (605:31): [True: 0, False: 292k]
  |  Branch (605:45): [True: 0, False: 292k]
  ------------------
  606|      0|                case OP_NOP6: case OP_NOP7: case OP_NOP8: case OP_NOP9: case OP_NOP10:
  ------------------
  |  Branch (606:17): [True: 0, False: 292k]
  |  Branch (606:31): [True: 0, False: 292k]
  |  Branch (606:45): [True: 0, False: 292k]
  |  Branch (606:59): [True: 0, False: 292k]
  |  Branch (606:73): [True: 0, False: 292k]
  ------------------
  607|      0|                {
  608|      0|                    if (flags & SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)
  ------------------
  |  Branch (608:25): [True: 0, False: 0]
  ------------------
  609|      0|                        return set_error(serror, SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS);
  610|      0|                }
  611|      0|                break;
  612|       |
  613|  7.68k|                case OP_IF:
  ------------------
  |  Branch (613:17): [True: 7.68k, False: 285k]
  ------------------
  614|  14.1k|                case OP_NOTIF:
  ------------------
  |  Branch (614:17): [True: 6.51k, False: 286k]
  ------------------
  615|  14.1k|                {
  616|       |                    // <expression> if [statements] [else [statements]] endif
  617|  14.1k|                    bool fValue = false;
  618|  14.1k|                    if (fExec)
  ------------------
  |  Branch (618:25): [True: 9.08k, False: 5.11k]
  ------------------
  619|  9.08k|                    {
  620|  9.08k|                        if (stack.size() < 1)
  ------------------
  |  Branch (620:29): [True: 0, False: 9.08k]
  ------------------
  621|      0|                            return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  622|  9.08k|                        valtype& vch = stacktop(-1);
  ------------------
  |  |   65|  9.08k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  623|       |                        // Tapscript requires minimal IF/NOTIF inputs as a consensus rule.
  624|  9.08k|                        if (sigversion == SigVersion::TAPSCRIPT) {
  ------------------
  |  Branch (624:29): [True: 2.45k, False: 6.63k]
  ------------------
  625|       |                            // The input argument to the OP_IF and OP_NOTIF opcodes must be either
  626|       |                            // exactly 0 (the empty vector) or exactly 1 (the one-byte vector with value 1).
  627|  2.45k|                            if (vch.size() > 1 || (vch.size() == 1 && vch[0] != 1)) {
  ------------------
  |  Branch (627:33): [True: 0, False: 2.45k]
  |  Branch (627:52): [True: 1.65k, False: 798]
  |  Branch (627:71): [True: 0, False: 1.65k]
  ------------------
  628|      0|                                return set_error(serror, SCRIPT_ERR_TAPSCRIPT_MINIMALIF);
  629|      0|                            }
  630|  2.45k|                        }
  631|       |                        // Under witness v0 rules it is only a policy rule, enabled through SCRIPT_VERIFY_MINIMALIF.
  632|  9.08k|                        if (sigversion == SigVersion::WITNESS_V0 && (flags & SCRIPT_VERIFY_MINIMALIF)) {
  ------------------
  |  Branch (632:29): [True: 6.63k, False: 2.45k]
  |  Branch (632:29): [True: 6.63k, False: 2.45k]
  |  Branch (632:69): [True: 6.63k, False: 0]
  ------------------
  633|  6.63k|                            if (vch.size() > 1)
  ------------------
  |  Branch (633:33): [True: 0, False: 6.63k]
  ------------------
  634|      0|                                return set_error(serror, SCRIPT_ERR_MINIMALIF);
  635|  6.63k|                            if (vch.size() == 1 && vch[0] != 1)
  ------------------
  |  Branch (635:33): [True: 3.51k, False: 3.11k]
  |  Branch (635:52): [True: 0, False: 3.51k]
  ------------------
  636|      0|                                return set_error(serror, SCRIPT_ERR_MINIMALIF);
  637|  6.63k|                        }
  638|  9.08k|                        fValue = CastToBool(vch);
  639|  9.08k|                        if (opcode == OP_NOTIF)
  ------------------
  |  Branch (639:29): [True: 4.89k, False: 4.18k]
  ------------------
  640|  4.89k|                            fValue = !fValue;
  641|  9.08k|                        popstack(stack);
  642|  9.08k|                    }
  643|  14.1k|                    vfExec.push_back(fValue);
  644|  14.1k|                }
  645|      0|                break;
  646|       |
  647|  8.78k|                case OP_ELSE:
  ------------------
  |  Branch (647:17): [True: 8.78k, False: 284k]
  ------------------
  648|  8.78k|                {
  649|  8.78k|                    if (vfExec.empty())
  ------------------
  |  Branch (649:25): [True: 0, False: 8.78k]
  ------------------
  650|      0|                        return set_error(serror, SCRIPT_ERR_UNBALANCED_CONDITIONAL);
  651|  8.78k|                    vfExec.toggle_top();
  652|  8.78k|                }
  653|      0|                break;
  654|       |
  655|  13.1k|                case OP_ENDIF:
  ------------------
  |  Branch (655:17): [True: 13.1k, False: 279k]
  ------------------
  656|  13.1k|                {
  657|  13.1k|                    if (vfExec.empty())
  ------------------
  |  Branch (657:25): [True: 0, False: 13.1k]
  ------------------
  658|      0|                        return set_error(serror, SCRIPT_ERR_UNBALANCED_CONDITIONAL);
  659|  13.1k|                    vfExec.pop_back();
  660|  13.1k|                }
  661|      0|                break;
  662|       |
  663|  1.17k|                case OP_VERIFY:
  ------------------
  |  Branch (663:17): [True: 1.17k, False: 291k]
  ------------------
  664|  1.17k|                {
  665|       |                    // (true -- ) or
  666|       |                    // (false -- false) and return
  667|  1.17k|                    if (stack.size() < 1)
  ------------------
  |  Branch (667:25): [True: 0, False: 1.17k]
  ------------------
  668|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  669|  1.17k|                    bool fValue = CastToBool(stacktop(-1));
  ------------------
  |  |   65|  1.17k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  670|  1.17k|                    if (fValue)
  ------------------
  |  Branch (670:25): [True: 1.17k, False: 0]
  ------------------
  671|  1.17k|                        popstack(stack);
  672|      0|                    else
  673|      0|                        return set_error(serror, SCRIPT_ERR_VERIFY);
  674|  1.17k|                }
  675|  1.17k|                break;
  676|       |
  677|  1.17k|                case OP_RETURN:
  ------------------
  |  Branch (677:17): [True: 0, False: 292k]
  ------------------
  678|      0|                {
  679|      0|                    return set_error(serror, SCRIPT_ERR_OP_RETURN);
  680|  1.17k|                }
  681|      0|                break;
  682|       |
  683|       |
  684|       |                //
  685|       |                // Stack ops
  686|       |                //
  687|  5.56k|                case OP_TOALTSTACK:
  ------------------
  |  Branch (687:17): [True: 5.56k, False: 287k]
  ------------------
  688|  5.56k|                {
  689|  5.56k|                    if (stack.size() < 1)
  ------------------
  |  Branch (689:25): [True: 0, False: 5.56k]
  ------------------
  690|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  691|  5.56k|                    altstack.push_back(stacktop(-1));
  ------------------
  |  |   65|  5.56k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  692|  5.56k|                    popstack(stack);
  693|  5.56k|                }
  694|      0|                break;
  695|       |
  696|  5.53k|                case OP_FROMALTSTACK:
  ------------------
  |  Branch (696:17): [True: 5.53k, False: 287k]
  ------------------
  697|  5.53k|                {
  698|  5.53k|                    if (altstack.size() < 1)
  ------------------
  |  Branch (698:25): [True: 0, False: 5.53k]
  ------------------
  699|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_ALTSTACK_OPERATION);
  700|  5.53k|                    stack.push_back(altstacktop(-1));
  ------------------
  |  |   66|  5.53k|#define altstacktop(i) (altstack.at(size_t(int64_t(altstack.size()) + int64_t{i})))
  ------------------
  701|  5.53k|                    popstack(altstack);
  702|  5.53k|                }
  703|      0|                break;
  704|       |
  705|      0|                case OP_2DROP:
  ------------------
  |  Branch (705:17): [True: 0, False: 292k]
  ------------------
  706|      0|                {
  707|       |                    // (x1 x2 -- )
  708|      0|                    if (stack.size() < 2)
  ------------------
  |  Branch (708:25): [True: 0, False: 0]
  ------------------
  709|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  710|      0|                    popstack(stack);
  711|      0|                    popstack(stack);
  712|      0|                }
  713|      0|                break;
  714|       |
  715|      0|                case OP_2DUP:
  ------------------
  |  Branch (715:17): [True: 0, False: 292k]
  ------------------
  716|      0|                {
  717|       |                    // (x1 x2 -- x1 x2 x1 x2)
  718|      0|                    if (stack.size() < 2)
  ------------------
  |  Branch (718:25): [True: 0, False: 0]
  ------------------
  719|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  720|      0|                    valtype vch1 = stacktop(-2);
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  721|      0|                    valtype vch2 = stacktop(-1);
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  722|      0|                    stack.push_back(vch1);
  723|      0|                    stack.push_back(vch2);
  724|      0|                }
  725|      0|                break;
  726|       |
  727|      0|                case OP_3DUP:
  ------------------
  |  Branch (727:17): [True: 0, False: 292k]
  ------------------
  728|      0|                {
  729|       |                    // (x1 x2 x3 -- x1 x2 x3 x1 x2 x3)
  730|      0|                    if (stack.size() < 3)
  ------------------
  |  Branch (730:25): [True: 0, False: 0]
  ------------------
  731|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  732|      0|                    valtype vch1 = stacktop(-3);
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  733|      0|                    valtype vch2 = stacktop(-2);
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  734|      0|                    valtype vch3 = stacktop(-1);
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  735|      0|                    stack.push_back(vch1);
  736|      0|                    stack.push_back(vch2);
  737|      0|                    stack.push_back(vch3);
  738|      0|                }
  739|      0|                break;
  740|       |
  741|      0|                case OP_2OVER:
  ------------------
  |  Branch (741:17): [True: 0, False: 292k]
  ------------------
  742|      0|                {
  743|       |                    // (x1 x2 x3 x4 -- x1 x2 x3 x4 x1 x2)
  744|      0|                    if (stack.size() < 4)
  ------------------
  |  Branch (744:25): [True: 0, False: 0]
  ------------------
  745|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  746|      0|                    valtype vch1 = stacktop(-4);
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  747|      0|                    valtype vch2 = stacktop(-3);
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  748|      0|                    stack.push_back(vch1);
  749|      0|                    stack.push_back(vch2);
  750|      0|                }
  751|      0|                break;
  752|       |
  753|      0|                case OP_2ROT:
  ------------------
  |  Branch (753:17): [True: 0, False: 292k]
  ------------------
  754|      0|                {
  755|       |                    // (x1 x2 x3 x4 x5 x6 -- x3 x4 x5 x6 x1 x2)
  756|      0|                    if (stack.size() < 6)
  ------------------
  |  Branch (756:25): [True: 0, False: 0]
  ------------------
  757|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  758|      0|                    valtype vch1 = stacktop(-6);
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  759|      0|                    valtype vch2 = stacktop(-5);
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  760|      0|                    stack.erase(stack.end()-6, stack.end()-4);
  761|      0|                    stack.push_back(vch1);
  762|      0|                    stack.push_back(vch2);
  763|      0|                }
  764|      0|                break;
  765|       |
  766|      0|                case OP_2SWAP:
  ------------------
  |  Branch (766:17): [True: 0, False: 292k]
  ------------------
  767|      0|                {
  768|       |                    // (x1 x2 x3 x4 -- x3 x4 x1 x2)
  769|      0|                    if (stack.size() < 4)
  ------------------
  |  Branch (769:25): [True: 0, False: 0]
  ------------------
  770|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  771|      0|                    swap(stacktop(-4), stacktop(-2));
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
                                  swap(stacktop(-4), stacktop(-2));
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  772|      0|                    swap(stacktop(-3), stacktop(-1));
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
                                  swap(stacktop(-3), stacktop(-1));
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  773|      0|                }
  774|      0|                break;
  775|       |
  776|  2.61k|                case OP_IFDUP:
  ------------------
  |  Branch (776:17): [True: 2.61k, False: 290k]
  ------------------
  777|  2.61k|                {
  778|       |                    // (x - 0 | x x)
  779|  2.61k|                    if (stack.size() < 1)
  ------------------
  |  Branch (779:25): [True: 0, False: 2.61k]
  ------------------
  780|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  781|  2.61k|                    valtype vch = stacktop(-1);
  ------------------
  |  |   65|  2.61k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  782|  2.61k|                    if (CastToBool(vch))
  ------------------
  |  Branch (782:25): [True: 1.10k, False: 1.51k]
  ------------------
  783|  1.10k|                        stack.push_back(vch);
  784|  2.61k|                }
  785|      0|                break;
  786|       |
  787|      0|                case OP_DEPTH:
  ------------------
  |  Branch (787:17): [True: 0, False: 292k]
  ------------------
  788|      0|                {
  789|       |                    // -- stacksize
  790|      0|                    CScriptNum bn(stack.size());
  791|      0|                    stack.push_back(bn.getvch());
  792|      0|                }
  793|      0|                break;
  794|       |
  795|      0|                case OP_DROP:
  ------------------
  |  Branch (795:17): [True: 0, False: 292k]
  ------------------
  796|      0|                {
  797|       |                    // (x -- )
  798|      0|                    if (stack.size() < 1)
  ------------------
  |  Branch (798:25): [True: 0, False: 0]
  ------------------
  799|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  800|      0|                    popstack(stack);
  801|      0|                }
  802|      0|                break;
  803|       |
  804|  1.34k|                case OP_DUP:
  ------------------
  |  Branch (804:17): [True: 1.34k, False: 291k]
  ------------------
  805|  1.34k|                {
  806|       |                    // (x -- x x)
  807|  1.34k|                    if (stack.size() < 1)
  ------------------
  |  Branch (807:25): [True: 0, False: 1.34k]
  ------------------
  808|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  809|  1.34k|                    valtype vch = stacktop(-1);
  ------------------
  |  |   65|  1.34k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  810|  1.34k|                    stack.push_back(vch);
  811|  1.34k|                }
  812|      0|                break;
  813|       |
  814|   171k|                case OP_NIP:
  ------------------
  |  Branch (814:17): [True: 171k, False: 121k]
  ------------------
  815|   171k|                {
  816|       |                    // (x1 x2 -- x2)
  817|   171k|                    if (stack.size() < 2)
  ------------------
  |  Branch (817:25): [True: 0, False: 171k]
  ------------------
  818|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  819|   171k|                    stack.erase(stack.end() - 2);
  820|   171k|                }
  821|      0|                break;
  822|       |
  823|      0|                case OP_OVER:
  ------------------
  |  Branch (823:17): [True: 0, False: 292k]
  ------------------
  824|      0|                {
  825|       |                    // (x1 x2 -- x1 x2 x1)
  826|      0|                    if (stack.size() < 2)
  ------------------
  |  Branch (826:25): [True: 0, False: 0]
  ------------------
  827|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  828|      0|                    valtype vch = stacktop(-2);
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  829|      0|                    stack.push_back(vch);
  830|      0|                }
  831|      0|                break;
  832|       |
  833|      0|                case OP_PICK:
  ------------------
  |  Branch (833:17): [True: 0, False: 292k]
  ------------------
  834|      0|                case OP_ROLL:
  ------------------
  |  Branch (834:17): [True: 0, False: 292k]
  ------------------
  835|      0|                {
  836|       |                    // (xn ... x2 x1 x0 n - xn ... x2 x1 x0 xn)
  837|       |                    // (xn ... x2 x1 x0 n - ... x2 x1 x0 xn)
  838|      0|                    if (stack.size() < 2)
  ------------------
  |  Branch (838:25): [True: 0, False: 0]
  ------------------
  839|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  840|      0|                    int n = CScriptNum(stacktop(-1), fRequireMinimal).getint();
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  841|      0|                    popstack(stack);
  842|      0|                    if (n < 0 || n >= (int)stack.size())
  ------------------
  |  Branch (842:25): [True: 0, False: 0]
  |  Branch (842:34): [True: 0, False: 0]
  ------------------
  843|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  844|      0|                    valtype vch = stacktop(-n-1);
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  845|      0|                    if (opcode == OP_ROLL)
  ------------------
  |  Branch (845:25): [True: 0, False: 0]
  ------------------
  846|      0|                        stack.erase(stack.end()-n-1);
  847|      0|                    stack.push_back(vch);
  848|      0|                }
  849|      0|                break;
  850|       |
  851|      0|                case OP_ROT:
  ------------------
  |  Branch (851:17): [True: 0, False: 292k]
  ------------------
  852|      0|                {
  853|       |                    // (x1 x2 x3 -- x2 x3 x1)
  854|       |                    //  x2 x1 x3  after first swap
  855|       |                    //  x2 x3 x1  after second swap
  856|      0|                    if (stack.size() < 3)
  ------------------
  |  Branch (856:25): [True: 0, False: 0]
  ------------------
  857|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  858|      0|                    swap(stacktop(-3), stacktop(-2));
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
                                  swap(stacktop(-3), stacktop(-2));
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  859|      0|                    swap(stacktop(-2), stacktop(-1));
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
                                  swap(stacktop(-2), stacktop(-1));
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  860|      0|                }
  861|      0|                break;
  862|       |
  863|    985|                case OP_SWAP:
  ------------------
  |  Branch (863:17): [True: 985, False: 291k]
  ------------------
  864|    985|                {
  865|       |                    // (x1 x2 -- x2 x1)
  866|    985|                    if (stack.size() < 2)
  ------------------
  |  Branch (866:25): [True: 0, False: 985]
  ------------------
  867|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  868|    985|                    swap(stacktop(-2), stacktop(-1));
  ------------------
  |  |   65|    985|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
                                  swap(stacktop(-2), stacktop(-1));
  ------------------
  |  |   65|    985|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  869|    985|                }
  870|      0|                break;
  871|       |
  872|      0|                case OP_TUCK:
  ------------------
  |  Branch (872:17): [True: 0, False: 292k]
  ------------------
  873|      0|                {
  874|       |                    // (x1 x2 -- x2 x1 x2)
  875|      0|                    if (stack.size() < 2)
  ------------------
  |  Branch (875:25): [True: 0, False: 0]
  ------------------
  876|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  877|      0|                    valtype vch = stacktop(-1);
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  878|      0|                    stack.insert(stack.end()-2, vch);
  879|      0|                }
  880|      0|                break;
  881|       |
  882|       |
  883|  2.64k|                case OP_SIZE:
  ------------------
  |  Branch (883:17): [True: 2.64k, False: 290k]
  ------------------
  884|  2.64k|                {
  885|       |                    // (in -- in size)
  886|  2.64k|                    if (stack.size() < 1)
  ------------------
  |  Branch (886:25): [True: 0, False: 2.64k]
  ------------------
  887|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  888|  2.64k|                    CScriptNum bn(stacktop(-1).size());
  ------------------
  |  |   65|  2.64k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  889|  2.64k|                    stack.push_back(bn.getvch());
  890|  2.64k|                }
  891|      0|                break;
  892|       |
  893|       |
  894|       |                //
  895|       |                // Bitwise logic
  896|       |                //
  897|  3.02k|                case OP_EQUAL:
  ------------------
  |  Branch (897:17): [True: 3.02k, False: 289k]
  ------------------
  898|  6.62k|                case OP_EQUALVERIFY:
  ------------------
  |  Branch (898:17): [True: 3.59k, False: 289k]
  ------------------
  899|       |                //case OP_NOTEQUAL: // use OP_NUMNOTEQUAL
  900|  6.62k|                {
  901|       |                    // (x1 x2 - bool)
  902|  6.62k|                    if (stack.size() < 2)
  ------------------
  |  Branch (902:25): [True: 0, False: 6.62k]
  ------------------
  903|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  904|  6.62k|                    valtype& vch1 = stacktop(-2);
  ------------------
  |  |   65|  6.62k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  905|  6.62k|                    valtype& vch2 = stacktop(-1);
  ------------------
  |  |   65|  6.62k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  906|  6.62k|                    bool fEqual = (vch1 == vch2);
  907|       |                    // OP_NOTEQUAL is disabled because it would be too easy to say
  908|       |                    // something like n != 1 and have some wiseguy pass in 1 with extra
  909|       |                    // zero bytes after it (numerically, 0x01 == 0x0001 == 0x000001)
  910|       |                    //if (opcode == OP_NOTEQUAL)
  911|       |                    //    fEqual = !fEqual;
  912|  6.62k|                    popstack(stack);
  913|  6.62k|                    popstack(stack);
  914|  6.62k|                    stack.push_back(fEqual ? vchTrue : vchFalse);
  ------------------
  |  Branch (914:37): [True: 5.73k, False: 895]
  ------------------
  915|  6.62k|                    if (opcode == OP_EQUALVERIFY)
  ------------------
  |  Branch (915:25): [True: 3.59k, False: 3.02k]
  ------------------
  916|  3.59k|                    {
  917|  3.59k|                        if (fEqual)
  ------------------
  |  Branch (917:29): [True: 3.59k, False: 0]
  ------------------
  918|  3.59k|                            popstack(stack);
  919|      0|                        else
  920|      0|                            return set_error(serror, SCRIPT_ERR_EQUALVERIFY);
  921|  3.59k|                    }
  922|  6.62k|                }
  923|  6.62k|                break;
  924|       |
  925|       |
  926|       |                //
  927|       |                // Numeric
  928|       |                //
  929|  6.62k|                case OP_1ADD:
  ------------------
  |  Branch (929:17): [True: 0, False: 292k]
  ------------------
  930|      0|                case OP_1SUB:
  ------------------
  |  Branch (930:17): [True: 0, False: 292k]
  ------------------
  931|      0|                case OP_NEGATE:
  ------------------
  |  Branch (931:17): [True: 0, False: 292k]
  ------------------
  932|      0|                case OP_ABS:
  ------------------
  |  Branch (932:17): [True: 0, False: 292k]
  ------------------
  933|      0|                case OP_NOT:
  ------------------
  |  Branch (933:17): [True: 0, False: 292k]
  ------------------
  934|  1.32k|                case OP_0NOTEQUAL:
  ------------------
  |  Branch (934:17): [True: 1.32k, False: 291k]
  ------------------
  935|  1.32k|                {
  936|       |                    // (in -- out)
  937|  1.32k|                    if (stack.size() < 1)
  ------------------
  |  Branch (937:25): [True: 0, False: 1.32k]
  ------------------
  938|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  939|  1.32k|                    CScriptNum bn(stacktop(-1), fRequireMinimal);
  ------------------
  |  |   65|  1.32k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  940|  1.32k|                    switch (opcode)
  941|  1.32k|                    {
  942|      0|                    case OP_1ADD:       bn += bnOne; break;
  ------------------
  |  Branch (942:21): [True: 0, False: 1.32k]
  ------------------
  943|      0|                    case OP_1SUB:       bn -= bnOne; break;
  ------------------
  |  Branch (943:21): [True: 0, False: 1.32k]
  ------------------
  944|      0|                    case OP_NEGATE:     bn = -bn; break;
  ------------------
  |  Branch (944:21): [True: 0, False: 1.32k]
  ------------------
  945|      0|                    case OP_ABS:        if (bn < bnZero) bn = -bn; break;
  ------------------
  |  Branch (945:21): [True: 0, False: 1.32k]
  |  Branch (945:45): [True: 0, False: 0]
  ------------------
  946|      0|                    case OP_NOT:        bn = (bn == bnZero); break;
  ------------------
  |  Branch (946:21): [True: 0, False: 1.32k]
  ------------------
  947|  1.32k|                    case OP_0NOTEQUAL:  bn = (bn != bnZero); break;
  ------------------
  |  Branch (947:21): [True: 1.32k, False: 0]
  ------------------
  948|      0|                    default:            assert(!"invalid opcode"); break;
  ------------------
  |  Branch (948:21): [True: 0, False: 1.32k]
  |  Branch (948:41): [Folded, False: 0]
  ------------------
  949|  1.32k|                    }
  950|  1.32k|                    popstack(stack);
  951|  1.32k|                    stack.push_back(bn.getvch());
  952|  1.32k|                }
  953|      0|                break;
  954|       |
  955|  3.93k|                case OP_ADD:
  ------------------
  |  Branch (955:17): [True: 3.93k, False: 288k]
  ------------------
  956|  3.93k|                case OP_SUB:
  ------------------
  |  Branch (956:17): [True: 0, False: 292k]
  ------------------
  957|  4.93k|                case OP_BOOLAND:
  ------------------
  |  Branch (957:17): [True: 1.00k, False: 291k]
  ------------------
  958|  6.51k|                case OP_BOOLOR:
  ------------------
  |  Branch (958:17): [True: 1.57k, False: 291k]
  ------------------
  959|  6.93k|                case OP_NUMEQUAL:
  ------------------
  |  Branch (959:17): [True: 416, False: 292k]
  ------------------
  960|  7.00k|                case OP_NUMEQUALVERIFY:
  ------------------
  |  Branch (960:17): [True: 72, False: 292k]
  ------------------
  961|  7.00k|                case OP_NUMNOTEQUAL:
  ------------------
  |  Branch (961:17): [True: 0, False: 292k]
  ------------------
  962|  7.00k|                case OP_LESSTHAN:
  ------------------
  |  Branch (962:17): [True: 0, False: 292k]
  ------------------
  963|  7.00k|                case OP_GREATERTHAN:
  ------------------
  |  Branch (963:17): [True: 0, False: 292k]
  ------------------
  964|  7.00k|                case OP_LESSTHANOREQUAL:
  ------------------
  |  Branch (964:17): [True: 0, False: 292k]
  ------------------
  965|  7.00k|                case OP_GREATERTHANOREQUAL:
  ------------------
  |  Branch (965:17): [True: 0, False: 292k]
  ------------------
  966|  7.00k|                case OP_MIN:
  ------------------
  |  Branch (966:17): [True: 0, False: 292k]
  ------------------
  967|  7.00k|                case OP_MAX:
  ------------------
  |  Branch (967:17): [True: 0, False: 292k]
  ------------------
  968|  7.00k|                {
  969|       |                    // (x1 x2 -- out)
  970|  7.00k|                    if (stack.size() < 2)
  ------------------
  |  Branch (970:25): [True: 0, False: 7.00k]
  ------------------
  971|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  972|  7.00k|                    CScriptNum bn1(stacktop(-2), fRequireMinimal);
  ------------------
  |  |   65|  7.00k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  973|  7.00k|                    CScriptNum bn2(stacktop(-1), fRequireMinimal);
  ------------------
  |  |   65|  7.00k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  974|  7.00k|                    CScriptNum bn(0);
  975|  7.00k|                    switch (opcode)
  976|  7.00k|                    {
  977|  3.93k|                    case OP_ADD:
  ------------------
  |  Branch (977:21): [True: 3.93k, False: 3.07k]
  ------------------
  978|  3.93k|                        bn = bn1 + bn2;
  979|  3.93k|                        break;
  980|       |
  981|      0|                    case OP_SUB:
  ------------------
  |  Branch (981:21): [True: 0, False: 7.00k]
  ------------------
  982|      0|                        bn = bn1 - bn2;
  983|      0|                        break;
  984|       |
  985|  1.00k|                    case OP_BOOLAND:             bn = (bn1 != bnZero && bn2 != bnZero); break;
  ------------------
  |  Branch (985:21): [True: 1.00k, False: 5.99k]
  |  Branch (985:56): [True: 760, False: 246]
  |  Branch (985:73): [True: 760, False: 0]
  ------------------
  986|  1.57k|                    case OP_BOOLOR:              bn = (bn1 != bnZero || bn2 != bnZero); break;
  ------------------
  |  Branch (986:21): [True: 1.57k, False: 5.42k]
  |  Branch (986:56): [True: 599, False: 980]
  |  Branch (986:73): [True: 789, False: 191]
  ------------------
  987|    416|                    case OP_NUMEQUAL:            bn = (bn1 == bn2); break;
  ------------------
  |  Branch (987:21): [True: 416, False: 6.58k]
  ------------------
  988|     72|                    case OP_NUMEQUALVERIFY:      bn = (bn1 == bn2); break;
  ------------------
  |  Branch (988:21): [True: 72, False: 6.93k]
  ------------------
  989|      0|                    case OP_NUMNOTEQUAL:         bn = (bn1 != bn2); break;
  ------------------
  |  Branch (989:21): [True: 0, False: 7.00k]
  ------------------
  990|      0|                    case OP_LESSTHAN:            bn = (bn1 < bn2); break;
  ------------------
  |  Branch (990:21): [True: 0, False: 7.00k]
  ------------------
  991|      0|                    case OP_GREATERTHAN:         bn = (bn1 > bn2); break;
  ------------------
  |  Branch (991:21): [True: 0, False: 7.00k]
  ------------------
  992|      0|                    case OP_LESSTHANOREQUAL:     bn = (bn1 <= bn2); break;
  ------------------
  |  Branch (992:21): [True: 0, False: 7.00k]
  ------------------
  993|      0|                    case OP_GREATERTHANOREQUAL:  bn = (bn1 >= bn2); break;
  ------------------
  |  Branch (993:21): [True: 0, False: 7.00k]
  ------------------
  994|      0|                    case OP_MIN:                 bn = (bn1 < bn2 ? bn1 : bn2); break;
  ------------------
  |  Branch (994:21): [True: 0, False: 7.00k]
  |  Branch (994:56): [True: 0, False: 0]
  ------------------
  995|      0|                    case OP_MAX:                 bn = (bn1 > bn2 ? bn1 : bn2); break;
  ------------------
  |  Branch (995:21): [True: 0, False: 7.00k]
  |  Branch (995:56): [True: 0, False: 0]
  ------------------
  996|      0|                    default:                     assert(!"invalid opcode"); break;
  ------------------
  |  Branch (996:21): [True: 0, False: 7.00k]
  |  Branch (996:50): [Folded, False: 0]
  ------------------
  997|  7.00k|                    }
  998|  7.00k|                    popstack(stack);
  999|  7.00k|                    popstack(stack);
 1000|  7.00k|                    stack.push_back(bn.getvch());
 1001|       |
 1002|  7.00k|                    if (opcode == OP_NUMEQUALVERIFY)
  ------------------
  |  Branch (1002:25): [True: 72, False: 6.93k]
  ------------------
 1003|     72|                    {
 1004|     72|                        if (CastToBool(stacktop(-1)))
  ------------------
  |  |   65|     72|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  |  Branch (1004:29): [True: 72, False: 0]
  ------------------
 1005|     72|                            popstack(stack);
 1006|      0|                        else
 1007|      0|                            return set_error(serror, SCRIPT_ERR_NUMEQUALVERIFY);
 1008|     72|                    }
 1009|  7.00k|                }
 1010|  7.00k|                break;
 1011|       |
 1012|  7.00k|                case OP_WITHIN:
  ------------------
  |  Branch (1012:17): [True: 0, False: 292k]
  ------------------
 1013|      0|                {
 1014|       |                    // (x min max -- out)
 1015|      0|                    if (stack.size() < 3)
  ------------------
  |  Branch (1015:25): [True: 0, False: 0]
  ------------------
 1016|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
 1017|      0|                    CScriptNum bn1(stacktop(-3), fRequireMinimal);
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
 1018|      0|                    CScriptNum bn2(stacktop(-2), fRequireMinimal);
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
 1019|      0|                    CScriptNum bn3(stacktop(-1), fRequireMinimal);
  ------------------
  |  |   65|      0|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
 1020|      0|                    bool fValue = (bn2 <= bn1 && bn1 < bn3);
  ------------------
  |  Branch (1020:36): [True: 0, False: 0]
  |  Branch (1020:50): [True: 0, False: 0]
  ------------------
 1021|      0|                    popstack(stack);
 1022|      0|                    popstack(stack);
 1023|      0|                    popstack(stack);
 1024|      0|                    stack.push_back(fValue ? vchTrue : vchFalse);
  ------------------
  |  Branch (1024:37): [True: 0, False: 0]
  ------------------
 1025|      0|                }
 1026|      0|                break;
 1027|       |
 1028|       |
 1029|       |                //
 1030|       |                // Crypto
 1031|       |                //
 1032|    433|                case OP_RIPEMD160:
  ------------------
  |  Branch (1032:17): [True: 433, False: 292k]
  ------------------
 1033|    433|                case OP_SHA1:
  ------------------
  |  Branch (1033:17): [True: 0, False: 292k]
  ------------------
 1034|    890|                case OP_SHA256:
  ------------------
  |  Branch (1034:17): [True: 457, False: 292k]
  ------------------
 1035|  2.58k|                case OP_HASH160:
  ------------------
  |  Branch (1035:17): [True: 1.69k, False: 291k]
  ------------------
 1036|  3.21k|                case OP_HASH256:
  ------------------
  |  Branch (1036:17): [True: 634, False: 292k]
  ------------------
 1037|  3.21k|                {
 1038|       |                    // (in -- hash)
 1039|  3.21k|                    if (stack.size() < 1)
  ------------------
  |  Branch (1039:25): [True: 0, False: 3.21k]
  ------------------
 1040|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
 1041|  3.21k|                    valtype& vch = stacktop(-1);
  ------------------
  |  |   65|  3.21k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
 1042|  3.21k|                    valtype vchHash((opcode == OP_RIPEMD160 || opcode == OP_SHA1 || opcode == OP_HASH160) ? 20 : 32);
  ------------------
  |  Branch (1042:38): [True: 433, False: 2.78k]
  |  Branch (1042:64): [True: 0, False: 2.78k]
  |  Branch (1042:85): [True: 1.69k, False: 1.09k]
  ------------------
 1043|  3.21k|                    if (opcode == OP_RIPEMD160)
  ------------------
  |  Branch (1043:25): [True: 433, False: 2.78k]
  ------------------
 1044|    433|                        CRIPEMD160().Write(vch.data(), vch.size()).Finalize(vchHash.data());
 1045|  2.78k|                    else if (opcode == OP_SHA1)
  ------------------
  |  Branch (1045:30): [True: 0, False: 2.78k]
  ------------------
 1046|      0|                        CSHA1().Write(vch.data(), vch.size()).Finalize(vchHash.data());
 1047|  2.78k|                    else if (opcode == OP_SHA256)
  ------------------
  |  Branch (1047:30): [True: 457, False: 2.32k]
  ------------------
 1048|    457|                        CSHA256().Write(vch.data(), vch.size()).Finalize(vchHash.data());
 1049|  2.32k|                    else if (opcode == OP_HASH160)
  ------------------
  |  Branch (1049:30): [True: 1.69k, False: 634]
  ------------------
 1050|  1.69k|                        CHash160().Write(vch).Finalize(vchHash);
 1051|    634|                    else if (opcode == OP_HASH256)
  ------------------
  |  Branch (1051:30): [True: 634, False: 0]
  ------------------
 1052|    634|                        CHash256().Write(vch).Finalize(vchHash);
 1053|  3.21k|                    popstack(stack);
 1054|  3.21k|                    stack.push_back(vchHash);
 1055|  3.21k|                }
 1056|      0|                break;
 1057|       |
 1058|      0|                case OP_CODESEPARATOR:
  ------------------
  |  Branch (1058:17): [True: 0, False: 292k]
  ------------------
 1059|      0|                {
 1060|       |                    // If SCRIPT_VERIFY_CONST_SCRIPTCODE flag is set, use of OP_CODESEPARATOR is rejected in pre-segwit
 1061|       |                    // script, even in an unexecuted branch (this is checked above the opcode case statement).
 1062|       |
 1063|       |                    // Hash starts after the code separator
 1064|      0|                    pbegincodehash = pc;
 1065|      0|                    execdata.m_codeseparator_pos = opcode_pos;
 1066|      0|                }
 1067|      0|                break;
 1068|       |
 1069|  2.55k|                case OP_CHECKSIG:
  ------------------
  |  Branch (1069:17): [True: 2.55k, False: 290k]
  ------------------
 1070|  3.37k|                case OP_CHECKSIGVERIFY:
  ------------------
  |  Branch (1070:17): [True: 822, False: 292k]
  ------------------
 1071|  3.37k|                {
 1072|       |                    // (sig pubkey -- bool)
 1073|  3.37k|                    if (stack.size() < 2)
  ------------------
  |  Branch (1073:25): [True: 0, False: 3.37k]
  ------------------
 1074|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
 1075|       |
 1076|  3.37k|                    valtype& vchSig    = stacktop(-2);
  ------------------
  |  |   65|  3.37k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
 1077|  3.37k|                    valtype& vchPubKey = stacktop(-1);
  ------------------
  |  |   65|  3.37k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
 1078|       |
 1079|  3.37k|                    bool fSuccess = true;
 1080|  3.37k|                    if (!EvalChecksig(vchSig, vchPubKey, pbegincodehash, pend, execdata, flags, checker, sigversion, serror, fSuccess)) return false;
  ------------------
  |  Branch (1080:25): [True: 0, False: 3.37k]
  ------------------
 1081|  3.37k|                    popstack(stack);
 1082|  3.37k|                    popstack(stack);
 1083|  3.37k|                    stack.push_back(fSuccess ? vchTrue : vchFalse);
  ------------------
  |  Branch (1083:37): [True: 2.11k, False: 1.25k]
  ------------------
 1084|  3.37k|                    if (opcode == OP_CHECKSIGVERIFY)
  ------------------
  |  Branch (1084:25): [True: 822, False: 2.55k]
  ------------------
 1085|    822|                    {
 1086|    822|                        if (fSuccess)
  ------------------
  |  Branch (1086:29): [True: 822, False: 0]
  ------------------
 1087|    822|                            popstack(stack);
 1088|      0|                        else
 1089|      0|                            return set_error(serror, SCRIPT_ERR_CHECKSIGVERIFY);
 1090|    822|                    }
 1091|  3.37k|                }
 1092|  3.37k|                break;
 1093|       |
 1094|  16.4k|                case OP_CHECKSIGADD:
  ------------------
  |  Branch (1094:17): [True: 16.4k, False: 276k]
  ------------------
 1095|  16.4k|                {
 1096|       |                    // OP_CHECKSIGADD is only available in Tapscript
 1097|  16.4k|                    if (sigversion == SigVersion::BASE || sigversion == SigVersion::WITNESS_V0) return set_error(serror, SCRIPT_ERR_BAD_OPCODE);
  ------------------
  |  Branch (1097:25): [True: 0, False: 16.4k]
  |  Branch (1097:59): [True: 0, False: 16.4k]
  ------------------
 1098|       |
 1099|       |                    // (sig num pubkey -- num)
 1100|  16.4k|                    if (stack.size() < 3) return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
  ------------------
  |  Branch (1100:25): [True: 0, False: 16.4k]
  ------------------
 1101|       |
 1102|  16.4k|                    const valtype& sig = stacktop(-3);
  ------------------
  |  |   65|  16.4k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
 1103|  16.4k|                    const CScriptNum num(stacktop(-2), fRequireMinimal);
  ------------------
  |  |   65|  16.4k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
 1104|  16.4k|                    const valtype& pubkey = stacktop(-1);
  ------------------
  |  |   65|  16.4k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
 1105|       |
 1106|  16.4k|                    bool success = true;
 1107|  16.4k|                    if (!EvalChecksig(sig, pubkey, pbegincodehash, pend, execdata, flags, checker, sigversion, serror, success)) return false;
  ------------------
  |  Branch (1107:25): [True: 0, False: 16.4k]
  ------------------
 1108|  16.4k|                    popstack(stack);
 1109|  16.4k|                    popstack(stack);
 1110|  16.4k|                    popstack(stack);
 1111|  16.4k|                    stack.push_back((num + (success ? 1 : 0)).getvch());
  ------------------
  |  Branch (1111:45): [True: 3.04k, False: 13.3k]
  ------------------
 1112|  16.4k|                }
 1113|      0|                break;
 1114|       |
 1115|  2.69k|                case OP_CHECKMULTISIG:
  ------------------
  |  Branch (1115:17): [True: 2.69k, False: 290k]
  ------------------
 1116|  3.52k|                case OP_CHECKMULTISIGVERIFY:
  ------------------
  |  Branch (1116:17): [True: 828, False: 292k]
  ------------------
 1117|  3.52k|                {
 1118|  3.52k|                    if (sigversion == SigVersion::TAPSCRIPT) return set_error(serror, SCRIPT_ERR_TAPSCRIPT_CHECKMULTISIG);
  ------------------
  |  Branch (1118:25): [True: 0, False: 3.52k]
  ------------------
 1119|       |
 1120|       |                    // ([sig ...] num_of_signatures [pubkey ...] num_of_pubkeys -- bool)
 1121|       |
 1122|  3.52k|                    int i = 1;
 1123|  3.52k|                    if ((int)stack.size() < i)
  ------------------
  |  Branch (1123:25): [True: 0, False: 3.52k]
  ------------------
 1124|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
 1125|       |
 1126|  3.52k|                    int nKeysCount = CScriptNum(stacktop(-i), fRequireMinimal).getint();
  ------------------
  |  |   65|  3.52k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
 1127|  3.52k|                    if (nKeysCount < 0 || nKeysCount > MAX_PUBKEYS_PER_MULTISIG)
  ------------------
  |  Branch (1127:25): [True: 0, False: 3.52k]
  |  Branch (1127:43): [True: 0, False: 3.52k]
  ------------------
 1128|      0|                        return set_error(serror, SCRIPT_ERR_PUBKEY_COUNT);
 1129|  3.52k|                    nOpCount += nKeysCount;
 1130|  3.52k|                    if (nOpCount > MAX_OPS_PER_SCRIPT)
  ------------------
  |  Branch (1130:25): [True: 12, False: 3.51k]
  ------------------
 1131|     12|                        return set_error(serror, SCRIPT_ERR_OP_COUNT);
 1132|  3.51k|                    int ikey = ++i;
 1133|       |                    // ikey2 is the position of last non-signature item in the stack. Top stack item = 1.
 1134|       |                    // With SCRIPT_VERIFY_NULLFAIL, this is used for cleanup if operation fails.
 1135|  3.51k|                    int ikey2 = nKeysCount + 2;
 1136|  3.51k|                    i += nKeysCount;
 1137|  3.51k|                    if ((int)stack.size() < i)
  ------------------
  |  Branch (1137:25): [True: 0, False: 3.51k]
  ------------------
 1138|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
 1139|       |
 1140|  3.51k|                    int nSigsCount = CScriptNum(stacktop(-i), fRequireMinimal).getint();
  ------------------
  |  |   65|  3.51k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
 1141|  3.51k|                    if (nSigsCount < 0 || nSigsCount > nKeysCount)
  ------------------
  |  Branch (1141:25): [True: 0, False: 3.51k]
  |  Branch (1141:43): [True: 0, False: 3.51k]
  ------------------
 1142|      0|                        return set_error(serror, SCRIPT_ERR_SIG_COUNT);
 1143|  3.51k|                    int isig = ++i;
 1144|  3.51k|                    i += nSigsCount;
 1145|  3.51k|                    if ((int)stack.size() < i)
  ------------------
  |  Branch (1145:25): [True: 0, False: 3.51k]
  ------------------
 1146|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
 1147|       |
 1148|       |                    // Subset of script starting at the most recent codeseparator
 1149|  3.51k|                    CScript scriptCode(pbegincodehash, pend);
 1150|       |
 1151|       |                    // Drop the signature in pre-segwit scripts but not segwit scripts
 1152|  15.8k|                    for (int k = 0; k < nSigsCount; k++)
  ------------------
  |  Branch (1152:37): [True: 12.3k, False: 3.51k]
  ------------------
 1153|  12.3k|                    {
 1154|  12.3k|                        valtype& vchSig = stacktop(-isig-k);
  ------------------
  |  |   65|  12.3k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
 1155|  12.3k|                        if (sigversion == SigVersion::BASE) {
  ------------------
  |  Branch (1155:29): [True: 0, False: 12.3k]
  ------------------
 1156|      0|                            int found = FindAndDelete(scriptCode, CScript() << vchSig);
 1157|      0|                            if (found > 0 && (flags & SCRIPT_VERIFY_CONST_SCRIPTCODE))
  ------------------
  |  Branch (1157:33): [True: 0, False: 0]
  |  Branch (1157:33): [True: 0, False: 0]
  |  Branch (1157:46): [True: 0, False: 0]
  ------------------
 1158|      0|                                return set_error(serror, SCRIPT_ERR_SIG_FINDANDDELETE);
 1159|      0|                        }
 1160|  12.3k|                    }
 1161|       |
 1162|  3.51k|                    bool fSuccess = true;
 1163|  16.6k|                    while (fSuccess && nSigsCount > 0)
  ------------------
  |  Branch (1163:28): [True: 14.8k, False: 1.78k]
  |  Branch (1163:40): [True: 13.1k, False: 1.72k]
  ------------------
 1164|  13.1k|                    {
 1165|  13.1k|                        valtype& vchSig    = stacktop(-isig);
  ------------------
  |  |   65|  13.1k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
 1166|  13.1k|                        valtype& vchPubKey = stacktop(-ikey);
  ------------------
  |  |   65|  13.1k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
 1167|       |
 1168|       |                        // Note how this makes the exact order of pubkey/signature evaluation
 1169|       |                        // distinguishable by CHECKMULTISIG NOT if the STRICTENC flag is set.
 1170|       |                        // See the script_(in)valid tests for details.
 1171|  13.1k|                        if (!CheckSignatureEncoding(vchSig, flags, serror) || !CheckPubKeyEncoding(vchPubKey, flags, sigversion, serror)) {
  ------------------
  |  Branch (1171:29): [True: 0, False: 13.1k]
  |  Branch (1171:79): [True: 0, False: 13.1k]
  ------------------
 1172|       |                            // serror is set
 1173|      0|                            return false;
 1174|      0|                        }
 1175|       |
 1176|       |                        // Check signature
 1177|  13.1k|                        bool fOk = checker.CheckECDSASignature(vchSig, vchPubKey, scriptCode, sigversion);
 1178|       |
 1179|  13.1k|                        if (fOk) {
  ------------------
  |  Branch (1179:29): [True: 4.48k, False: 8.62k]
  ------------------
 1180|  4.48k|                            isig++;
 1181|  4.48k|                            nSigsCount--;
 1182|  4.48k|                        }
 1183|  13.1k|                        ikey++;
 1184|  13.1k|                        nKeysCount--;
 1185|       |
 1186|       |                        // If there are more signatures left than keys left,
 1187|       |                        // then too many signatures have failed. Exit early,
 1188|       |                        // without checking any further signatures.
 1189|  13.1k|                        if (nSigsCount > nKeysCount)
  ------------------
  |  Branch (1189:29): [True: 1.78k, False: 11.3k]
  ------------------
 1190|  1.78k|                            fSuccess = false;
 1191|  13.1k|                    }
 1192|       |
 1193|       |                    // Clean up stack of actual arguments
 1194|  42.6k|                    while (i-- > 1) {
  ------------------
  |  Branch (1194:28): [True: 39.1k, False: 3.51k]
  ------------------
 1195|       |                        // If the operation failed, we require that all signatures must be empty vector
 1196|  39.1k|                        if (!fSuccess && (flags & SCRIPT_VERIFY_NULLFAIL) && !ikey2 && stacktop(-1).size())
  ------------------
  |  |   65|  7.86k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  |  Branch (1196:29): [True: 21.4k, False: 17.6k]
  |  Branch (1196:29): [True: 0, False: 39.1k]
  |  Branch (1196:42): [True: 21.4k, False: 0]
  |  Branch (1196:78): [True: 7.86k, False: 13.6k]
  |  Branch (1196:88): [True: 0, False: 7.86k]
  ------------------
 1197|      0|                            return set_error(serror, SCRIPT_ERR_SIG_NULLFAIL);
 1198|  39.1k|                        if (ikey2 > 0)
  ------------------
  |  Branch (1198:29): [True: 26.8k, False: 12.3k]
  ------------------
 1199|  26.8k|                            ikey2--;
 1200|  39.1k|                        popstack(stack);
 1201|  39.1k|                    }
 1202|       |
 1203|       |                    // A bug causes CHECKMULTISIG to consume one extra argument
 1204|       |                    // whose contents were not checked in any way.
 1205|       |                    //
 1206|       |                    // Unfortunately this is a potential source of mutability,
 1207|       |                    // so optionally verify it is exactly equal to zero prior
 1208|       |                    // to removing it from the stack.
 1209|  3.51k|                    if (stack.size() < 1)
  ------------------
  |  Branch (1209:25): [True: 0, False: 3.51k]
  ------------------
 1210|      0|                        return set_error(serror, SCRIPT_ERR_INVALID_STACK_OPERATION);
 1211|  3.51k|                    if ((flags & SCRIPT_VERIFY_NULLDUMMY) && stacktop(-1).size())
  ------------------
  |  |   65|  3.51k|#define stacktop(i) (stack.at(size_t(int64_t(stack.size()) + int64_t{i})))
  ------------------
  |  Branch (1211:25): [True: 3.51k, False: 0]
  |  Branch (1211:25): [True: 0, False: 3.51k]
  |  Branch (1211:62): [True: 0, False: 3.51k]
  ------------------
 1212|      0|                        return set_error(serror, SCRIPT_ERR_SIG_NULLDUMMY);
 1213|  3.51k|                    popstack(stack);
 1214|       |
 1215|  3.51k|                    stack.push_back(fSuccess ? vchTrue : vchFalse);
  ------------------
  |  Branch (1215:37): [True: 1.72k, False: 1.78k]
  ------------------
 1216|       |
 1217|  3.51k|                    if (opcode == OP_CHECKMULTISIGVERIFY)
  ------------------
  |  Branch (1217:25): [True: 826, False: 2.68k]
  ------------------
 1218|    826|                    {
 1219|    826|                        if (fSuccess)
  ------------------
  |  Branch (1219:29): [True: 826, False: 0]
  ------------------
 1220|    826|                            popstack(stack);
 1221|      0|                        else
 1222|      0|                            return set_error(serror, SCRIPT_ERR_CHECKMULTISIGVERIFY);
 1223|    826|                    }
 1224|  3.51k|                }
 1225|  3.51k|                break;
 1226|       |
 1227|  3.51k|                default:
  ------------------
  |  Branch (1227:17): [True: 0, False: 292k]
  ------------------
 1228|      0|                    return set_error(serror, SCRIPT_ERR_BAD_OPCODE);
 1229|   292k|            }
 1230|       |
 1231|       |            // Size limits
 1232|   397k|            if (stack.size() + altstack.size() > MAX_STACK_SIZE)
  ------------------
  |  Branch (1232:17): [True: 3, False: 397k]
  ------------------
 1233|      3|                return set_error(serror, SCRIPT_ERR_STACK_SIZE);
 1234|   397k|        }
 1235|  8.90k|    }
 1236|  8.90k|    catch (const scriptnum_error&)
 1237|  8.90k|    {
 1238|      0|        return set_error(serror, SCRIPT_ERR_SCRIPTNUM);
 1239|      0|    }
 1240|  8.90k|    catch (...)
 1241|  8.90k|    {
 1242|      0|        return set_error(serror, SCRIPT_ERR_UNKNOWN_ERROR);
 1243|      0|    }
 1244|       |
 1245|  8.83k|    if (!vfExec.empty())
  ------------------
  |  Branch (1245:9): [True: 0, False: 8.83k]
  ------------------
 1246|      0|        return set_error(serror, SCRIPT_ERR_UNBALANCED_CONDITIONAL);
 1247|       |
 1248|  8.83k|    return set_success(serror);
 1249|  8.83k|}
_Z10EvalScriptRNSt3__16vectorINS0_IhNS_9allocatorIhEEEENS1_IS3_EEEERK7CScript19script_verify_flagsRK20BaseSignatureChecker10SigVersionP13ScriptError_t:
 1252|  5.94k|{
 1253|  5.94k|    ScriptExecutionData execdata;
 1254|  5.94k|    return EvalScript(stack, script, flags, checker, sigversion, execdata, serror);
 1255|  5.94k|}
_Z18ComputeTapleafHashhNSt3__14spanIKhLm18446744073709551615EEE:
 1883|  3.24k|{
 1884|  3.24k|    return (HashWriter{HASHER_TAPLEAF} << leaf_version << CompactSizeWriter(script.size()) << script).GetSHA256();
 1885|  3.24k|}
_Z24ComputeTaprootMerkleRootNSt3__14spanIKhLm18446744073709551615EEERK7uint256:
 1899|  1.29k|{
 1900|  1.29k|    assert(control.size() >= TAPROOT_CONTROL_BASE_SIZE);
  ------------------
  |  Branch (1900:5): [True: 1.29k, False: 0]
  ------------------
 1901|  1.29k|    assert(control.size() <= TAPROOT_CONTROL_MAX_SIZE);
  ------------------
  |  Branch (1901:5): [True: 1.29k, False: 0]
  ------------------
 1902|  1.29k|    assert((control.size() - TAPROOT_CONTROL_BASE_SIZE) % TAPROOT_CONTROL_NODE_SIZE == 0);
  ------------------
  |  Branch (1902:5): [True: 1.29k, False: 0]
  ------------------
 1903|       |
 1904|  1.29k|    const int path_len = (control.size() - TAPROOT_CONTROL_BASE_SIZE) / TAPROOT_CONTROL_NODE_SIZE;
 1905|  1.29k|    uint256 k = tapleaf_hash;
 1906|  1.29k|    for (int i = 0; i < path_len; ++i) {
  ------------------
  |  Branch (1906:21): [True: 0, False: 1.29k]
  ------------------
 1907|      0|        std::span node{std::span{control}.subspan(TAPROOT_CONTROL_BASE_SIZE + TAPROOT_CONTROL_NODE_SIZE * i, TAPROOT_CONTROL_NODE_SIZE)};
 1908|      0|        k = ComputeTapbranchHash(k, node);
 1909|      0|    }
 1910|  1.29k|    return k;
 1911|  1.29k|}
_Z12VerifyScriptRK7CScriptS1_PK14CScriptWitness19script_verify_flagsRK20BaseSignatureCheckerP13ScriptError_t:
 2013|  2.97k|{
 2014|  2.97k|    static const CScriptWitness emptyWitness;
 2015|  2.97k|    if (witness == nullptr) {
  ------------------
  |  Branch (2015:9): [True: 0, False: 2.97k]
  ------------------
 2016|      0|        witness = &emptyWitness;
 2017|      0|    }
 2018|  2.97k|    bool hadWitness = false;
 2019|       |
 2020|  2.97k|    set_error(serror, SCRIPT_ERR_UNKNOWN_ERROR);
 2021|       |
 2022|  2.97k|    if ((flags & SCRIPT_VERIFY_SIGPUSHONLY) != 0 && !scriptSig.IsPushOnly()) {
  ------------------
  |  Branch (2022:9): [True: 0, False: 2.97k]
  |  Branch (2022:9): [True: 0, False: 2.97k]
  |  Branch (2022:53): [True: 0, False: 0]
  ------------------
 2023|      0|        return set_error(serror, SCRIPT_ERR_SIG_PUSHONLY);
 2024|      0|    }
 2025|       |
 2026|       |    // scriptSig and scriptPubKey must be evaluated sequentially on the same stack
 2027|       |    // rather than being simply concatenated (see CVE-2010-5141)
 2028|  2.97k|    std::vector<std::vector<unsigned char> > stack, stackCopy;
 2029|  2.97k|    if (!EvalScript(stack, scriptSig, flags, checker, SigVersion::BASE, serror))
  ------------------
  |  Branch (2029:9): [True: 0, False: 2.97k]
  ------------------
 2030|       |        // serror is set
 2031|      0|        return false;
 2032|  2.97k|    if (flags & SCRIPT_VERIFY_P2SH)
  ------------------
  |  Branch (2032:9): [True: 2.97k, False: 0]
  ------------------
 2033|  2.97k|        stackCopy = stack;
 2034|  2.97k|    if (!EvalScript(stack, scriptPubKey, flags, checker, SigVersion::BASE, serror))
  ------------------
  |  Branch (2034:9): [True: 0, False: 2.97k]
  ------------------
 2035|       |        // serror is set
 2036|      0|        return false;
 2037|  2.97k|    if (stack.empty())
  ------------------
  |  Branch (2037:9): [True: 0, False: 2.97k]
  ------------------
 2038|      0|        return set_error(serror, SCRIPT_ERR_EVAL_FALSE);
 2039|  2.97k|    if (CastToBool(stack.back()) == false)
  ------------------
  |  Branch (2039:9): [True: 0, False: 2.97k]
  ------------------
 2040|      0|        return set_error(serror, SCRIPT_ERR_EVAL_FALSE);
 2041|       |
 2042|       |    // Bare witness programs
 2043|  2.97k|    int witnessversion;
 2044|  2.97k|    std::vector<unsigned char> witnessprogram;
 2045|  2.97k|    if (flags & SCRIPT_VERIFY_WITNESS) {
  ------------------
  |  Branch (2045:9): [True: 2.97k, False: 0]
  ------------------
 2046|  2.97k|        if (scriptPubKey.IsWitnessProgram(witnessversion, witnessprogram)) {
  ------------------
  |  Branch (2046:13): [True: 2.97k, False: 0]
  ------------------
 2047|  2.97k|            hadWitness = true;
 2048|  2.97k|            if (scriptSig.size() != 0) {
  ------------------
  |  Branch (2048:17): [True: 0, False: 2.97k]
  ------------------
 2049|       |                // The scriptSig must be _exactly_ CScript(), otherwise we reintroduce malleability.
 2050|      0|                return set_error(serror, SCRIPT_ERR_WITNESS_MALLEATED);
 2051|      0|            }
 2052|  2.97k|            if (!VerifyWitnessProgram(*witness, witnessversion, witnessprogram, flags, checker, serror, /*is_p2sh=*/false)) {
  ------------------
  |  Branch (2052:17): [True: 82, False: 2.89k]
  ------------------
 2053|     82|                return false;
 2054|     82|            }
 2055|       |            // Bypass the cleanstack check at the end. The actual stack is obviously not clean
 2056|       |            // for witness programs.
 2057|  2.89k|            stack.resize(1);
 2058|  2.89k|        }
 2059|  2.97k|    }
 2060|       |
 2061|       |    // Additional validation for spend-to-script-hash transactions:
 2062|  2.89k|    if ((flags & SCRIPT_VERIFY_P2SH) && scriptPubKey.IsPayToScriptHash())
  ------------------
  |  Branch (2062:9): [True: 2.89k, False: 0]
  |  Branch (2062:9): [True: 0, False: 2.89k]
  |  Branch (2062:41): [True: 0, False: 2.89k]
  ------------------
 2063|      0|    {
 2064|       |        // scriptSig must be literals-only or validation fails
 2065|      0|        if (!scriptSig.IsPushOnly())
  ------------------
  |  Branch (2065:13): [True: 0, False: 0]
  ------------------
 2066|      0|            return set_error(serror, SCRIPT_ERR_SIG_PUSHONLY);
 2067|       |
 2068|       |        // Restore stack.
 2069|      0|        swap(stack, stackCopy);
 2070|       |
 2071|       |        // stack cannot be empty here, because if it was the
 2072|       |        // P2SH  HASH <> EQUAL  scriptPubKey would be evaluated with
 2073|       |        // an empty stack and the EvalScript above would return false.
 2074|      0|        assert(!stack.empty());
  ------------------
  |  Branch (2074:9): [True: 0, False: 0]
  ------------------
 2075|       |
 2076|      0|        const valtype& pubKeySerialized = stack.back();
 2077|      0|        CScript pubKey2(pubKeySerialized.begin(), pubKeySerialized.end());
 2078|      0|        popstack(stack);
 2079|       |
 2080|      0|        if (!EvalScript(stack, pubKey2, flags, checker, SigVersion::BASE, serror))
  ------------------
  |  Branch (2080:13): [True: 0, False: 0]
  ------------------
 2081|       |            // serror is set
 2082|      0|            return false;
 2083|      0|        if (stack.empty())
  ------------------
  |  Branch (2083:13): [True: 0, False: 0]
  ------------------
 2084|      0|            return set_error(serror, SCRIPT_ERR_EVAL_FALSE);
 2085|      0|        if (!CastToBool(stack.back()))
  ------------------
  |  Branch (2085:13): [True: 0, False: 0]
  ------------------
 2086|      0|            return set_error(serror, SCRIPT_ERR_EVAL_FALSE);
 2087|       |
 2088|       |        // P2SH witness program
 2089|      0|        if (flags & SCRIPT_VERIFY_WITNESS) {
  ------------------
  |  Branch (2089:13): [True: 0, False: 0]
  ------------------
 2090|      0|            if (pubKey2.IsWitnessProgram(witnessversion, witnessprogram)) {
  ------------------
  |  Branch (2090:17): [True: 0, False: 0]
  ------------------
 2091|      0|                hadWitness = true;
 2092|      0|                if (scriptSig != CScript() << std::vector<unsigned char>(pubKey2.begin(), pubKey2.end())) {
  ------------------
  |  Branch (2092:21): [True: 0, False: 0]
  ------------------
 2093|       |                    // The scriptSig must be _exactly_ a single push of the redeemScript. Otherwise we
 2094|       |                    // reintroduce malleability.
 2095|      0|                    return set_error(serror, SCRIPT_ERR_WITNESS_MALLEATED_P2SH);
 2096|      0|                }
 2097|      0|                if (!VerifyWitnessProgram(*witness, witnessversion, witnessprogram, flags, checker, serror, /*is_p2sh=*/true)) {
  ------------------
  |  Branch (2097:21): [True: 0, False: 0]
  ------------------
 2098|      0|                    return false;
 2099|      0|                }
 2100|       |                // Bypass the cleanstack check at the end. The actual stack is obviously not clean
 2101|       |                // for witness programs.
 2102|      0|                stack.resize(1);
 2103|      0|            }
 2104|      0|        }
 2105|      0|    }
 2106|       |
 2107|       |    // The CLEANSTACK check is only performed after potential P2SH evaluation,
 2108|       |    // as the non-P2SH evaluation of a P2SH script will obviously not result in
 2109|       |    // a clean stack (the P2SH inputs remain). The same holds for witness evaluation.
 2110|  2.89k|    if ((flags & SCRIPT_VERIFY_CLEANSTACK) != 0) {
  ------------------
  |  Branch (2110:9): [True: 2.89k, False: 0]
  ------------------
 2111|       |        // Disallow CLEANSTACK without P2SH, as otherwise a switch CLEANSTACK->P2SH+CLEANSTACK
 2112|       |        // would be possible, which is not a softfork (and P2SH should be one).
 2113|  2.89k|        assert((flags & SCRIPT_VERIFY_P2SH) != 0);
  ------------------
  |  Branch (2113:9): [True: 2.89k, False: 0]
  ------------------
 2114|  2.89k|        assert((flags & SCRIPT_VERIFY_WITNESS) != 0);
  ------------------
  |  Branch (2114:9): [True: 2.89k, False: 0]
  ------------------
 2115|  2.89k|        if (stack.size() != 1) {
  ------------------
  |  Branch (2115:13): [True: 0, False: 2.89k]
  ------------------
 2116|      0|            return set_error(serror, SCRIPT_ERR_CLEANSTACK);
 2117|      0|        }
 2118|  2.89k|    }
 2119|       |
 2120|  2.89k|    if (flags & SCRIPT_VERIFY_WITNESS) {
  ------------------
  |  Branch (2120:9): [True: 2.89k, False: 0]
  ------------------
 2121|       |        // We can't check for correct unexpected witness data if P2SH was off, so require
 2122|       |        // that WITNESS implies P2SH. Otherwise, going from WITNESS->P2SH+WITNESS would be
 2123|       |        // possible, which is not a softfork.
 2124|  2.89k|        assert((flags & SCRIPT_VERIFY_P2SH) != 0);
  ------------------
  |  Branch (2124:9): [True: 2.89k, False: 0]
  ------------------
 2125|  2.89k|        if (!hadWitness && !witness->IsNull()) {
  ------------------
  |  Branch (2125:13): [True: 0, False: 2.89k]
  |  Branch (2125:28): [True: 0, False: 0]
  ------------------
 2126|      0|            return set_error(serror, SCRIPT_ERR_WITNESS_UNEXPECTED);
 2127|      0|        }
 2128|  2.89k|    }
 2129|       |
 2130|  2.89k|    return set_success(serror);
 2131|  2.89k|}
interpreter.cpp:_ZL24IsValidSignatureEncodingRKNSt3__16vectorIhNS_9allocatorIhEEEE:
  118|  20.5k|bool static IsValidSignatureEncoding(const std::vector<unsigned char> &sig) {
  119|       |    // Format: 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S] [sighash]
  120|       |    // * total-length: 1-byte length descriptor of everything that follows,
  121|       |    //   excluding the sighash byte.
  122|       |    // * R-length: 1-byte length descriptor of the R value that follows.
  123|       |    // * R: arbitrary-length big-endian encoded R value. It must use the shortest
  124|       |    //   possible encoding for a positive integer (which means no null bytes at
  125|       |    //   the start, except a single one when the next byte has its highest bit set).
  126|       |    // * S-length: 1-byte length descriptor of the S value that follows.
  127|       |    // * S: arbitrary-length big-endian encoded S value. The same rules apply.
  128|       |    // * sighash: 1-byte value indicating what data is hashed (not part of the DER
  129|       |    //   signature)
  130|       |
  131|       |    // Minimum and maximum size constraints.
  132|  20.5k|    if (sig.size() < 9) return false;
  ------------------
  |  Branch (132:9): [True: 0, False: 20.5k]
  ------------------
  133|  20.5k|    if (sig.size() > 73) return false;
  ------------------
  |  Branch (133:9): [True: 0, False: 20.5k]
  ------------------
  134|       |
  135|       |    // A signature is of type 0x30 (compound).
  136|  20.5k|    if (sig[0] != 0x30) return false;
  ------------------
  |  Branch (136:9): [True: 0, False: 20.5k]
  ------------------
  137|       |
  138|       |    // Make sure the length covers the entire signature.
  139|  20.5k|    if (sig[1] != sig.size() - 3) return false;
  ------------------
  |  Branch (139:9): [True: 0, False: 20.5k]
  ------------------
  140|       |
  141|       |    // Extract the length of the R element.
  142|  20.5k|    unsigned int lenR = sig[3];
  143|       |
  144|       |    // Make sure the length of the S element is still inside the signature.
  145|  20.5k|    if (5 + lenR >= sig.size()) return false;
  ------------------
  |  Branch (145:9): [True: 0, False: 20.5k]
  ------------------
  146|       |
  147|       |    // Extract the length of the S element.
  148|  20.5k|    unsigned int lenS = sig[5 + lenR];
  149|       |
  150|       |    // Verify that the length of the signature matches the sum of the length
  151|       |    // of the elements.
  152|  20.5k|    if ((size_t)(lenR + lenS + 7) != sig.size()) return false;
  ------------------
  |  Branch (152:9): [True: 0, False: 20.5k]
  ------------------
  153|       |
  154|       |    // Check whether the R element is an integer.
  155|  20.5k|    if (sig[2] != 0x02) return false;
  ------------------
  |  Branch (155:9): [True: 0, False: 20.5k]
  ------------------
  156|       |
  157|       |    // Zero-length integers are not allowed for R.
  158|  20.5k|    if (lenR == 0) return false;
  ------------------
  |  Branch (158:9): [True: 0, False: 20.5k]
  ------------------
  159|       |
  160|       |    // Negative numbers are not allowed for R.
  161|  20.5k|    if (sig[4] & 0x80) return false;
  ------------------
  |  Branch (161:9): [True: 0, False: 20.5k]
  ------------------
  162|       |
  163|       |    // Null bytes at the start of R are not allowed, unless R would
  164|       |    // otherwise be interpreted as a negative number.
  165|  20.5k|    if (lenR > 1 && (sig[4] == 0x00) && !(sig[5] & 0x80)) return false;
  ------------------
  |  Branch (165:9): [True: 20.5k, False: 0]
  |  Branch (165:21): [True: 968, False: 19.6k]
  |  Branch (165:41): [True: 0, False: 968]
  ------------------
  166|       |
  167|       |    // Check whether the S element is an integer.
  168|  20.5k|    if (sig[lenR + 4] != 0x02) return false;
  ------------------
  |  Branch (168:9): [True: 0, False: 20.5k]
  ------------------
  169|       |
  170|       |    // Zero-length integers are not allowed for S.
  171|  20.5k|    if (lenS == 0) return false;
  ------------------
  |  Branch (171:9): [True: 0, False: 20.5k]
  ------------------
  172|       |
  173|       |    // Negative numbers are not allowed for S.
  174|  20.5k|    if (sig[lenR + 6] & 0x80) return false;
  ------------------
  |  Branch (174:9): [True: 0, False: 20.5k]
  ------------------
  175|       |
  176|       |    // Null bytes at the start of S are not allowed, unless S would otherwise be
  177|       |    // interpreted as a negative number.
  178|  20.5k|    if (lenS > 1 && (sig[lenR + 6] == 0x00) && !(sig[lenR + 7] & 0x80)) return false;
  ------------------
  |  Branch (178:9): [True: 20.5k, False: 0]
  |  Branch (178:21): [True: 0, False: 20.5k]
  |  Branch (178:48): [True: 0, False: 0]
  ------------------
  179|       |
  180|  20.5k|    return true;
  181|  20.5k|}
interpreter.cpp:_ZN12_GLOBAL__N_19set_errorEP13ScriptError_tS0_:
   38|  11.9k|{
   39|  11.9k|    if (ret)
  ------------------
  |  Branch (39:9): [True: 11.9k, False: 0]
  ------------------
   40|  11.9k|        *ret = serror;
   41|  11.9k|    return false;
   42|  11.9k|}
interpreter.cpp:_ZL17IsLowDERSignatureRKNSt3__16vectorIhNS_9allocatorIhEEEEP13ScriptError_t:
  183|  10.2k|bool static IsLowDERSignature(const valtype &vchSig, ScriptError* serror) {
  184|  10.2k|    if (!IsValidSignatureEncoding(vchSig)) {
  ------------------
  |  Branch (184:9): [True: 0, False: 10.2k]
  ------------------
  185|      0|        return set_error(serror, SCRIPT_ERR_SIG_DER);
  186|      0|    }
  187|       |    // https://bitcoin.stackexchange.com/a/12556:
  188|       |    //     Also note that inside transaction signatures, an extra hashtype byte
  189|       |    //     follows the actual signature data.
  190|  10.2k|    std::vector<unsigned char> vchSigCopy(vchSig.begin(), vchSig.begin() + vchSig.size() - 1);
  191|       |    // If the S value is above the order of the curve divided by two, its
  192|       |    // complement modulo the order could have been used instead, which is
  193|       |    // one byte shorter when encoded correctly.
  194|  10.2k|    if (!CPubKey::CheckLowS(vchSigCopy)) {
  ------------------
  |  Branch (194:9): [True: 0, False: 10.2k]
  ------------------
  195|      0|        return set_error(serror, SCRIPT_ERR_SIG_HIGH_S);
  196|      0|    }
  197|  10.2k|    return true;
  198|  10.2k|}
interpreter.cpp:_ZL26IsDefinedHashtypeSignatureRKNSt3__16vectorIhNS_9allocatorIhEEEE:
  200|  10.2k|bool static IsDefinedHashtypeSignature(const valtype &vchSig) {
  201|  10.2k|    if (vchSig.size() == 0) {
  ------------------
  |  Branch (201:9): [True: 0, False: 10.2k]
  ------------------
  202|      0|        return false;
  203|      0|    }
  204|  10.2k|    unsigned char nHashType = vchSig[vchSig.size() - 1] & (~(SIGHASH_ANYONECANPAY));
  205|  10.2k|    if (nHashType < SIGHASH_ALL || nHashType > SIGHASH_SINGLE)
  ------------------
  |  Branch (205:9): [True: 0, False: 10.2k]
  |  Branch (205:36): [True: 0, False: 10.2k]
  ------------------
  206|      0|        return false;
  207|       |
  208|  10.2k|    return true;
  209|  10.2k|}
interpreter.cpp:_ZNK12_GLOBAL__N_114ConditionStack8all_trueEv:
  295|   397k|    bool all_true() const { return m_first_false_pos == NO_FALSE; }
interpreter.cpp:_ZL8popstackRNSt3__16vectorINS0_IhNS_9allocatorIhEEEENS1_IS3_EEEE:
   68|   157k|{
   69|   157k|    if (stack.empty())
  ------------------
  |  Branch (69:9): [True: 0, False: 157k]
  ------------------
   70|      0|        throw std::runtime_error("popstack(): stack empty");
   71|   157k|    stack.pop_back();
   72|   157k|}
interpreter.cpp:_ZN12_GLOBAL__N_114ConditionStack9push_backEb:
  297|  14.1k|    {
  298|  14.1k|        if (m_first_false_pos == NO_FALSE && !f) {
  ------------------
  |  Branch (298:13): [True: 9.08k, False: 5.11k]
  |  Branch (298:46): [True: 3.12k, False: 5.96k]
  ------------------
  299|       |            // The stack consists of all true values, and a false is added.
  300|       |            // The first false value will appear at the current size.
  301|  3.12k|            m_first_false_pos = m_stack_size;
  302|  3.12k|        }
  303|  14.1k|        ++m_stack_size;
  304|  14.1k|    }
interpreter.cpp:_ZNK12_GLOBAL__N_114ConditionStack5emptyEv:
  294|  30.8k|    bool empty() const { return m_stack_size == 0; }
interpreter.cpp:_ZN12_GLOBAL__N_114ConditionStack10toggle_topEv:
  315|  8.78k|    {
  316|  8.78k|        assert(m_stack_size > 0);
  ------------------
  |  Branch (316:9): [True: 8.78k, False: 0]
  ------------------
  317|  8.78k|        if (m_first_false_pos == NO_FALSE) {
  ------------------
  |  Branch (317:13): [True: 2.84k, False: 5.94k]
  ------------------
  318|       |            // The current stack is all true values; the first false will be the top.
  319|  2.84k|            m_first_false_pos = m_stack_size - 1;
  320|  5.94k|        } else if (m_first_false_pos == m_stack_size - 1) {
  ------------------
  |  Branch (320:20): [True: 1.90k, False: 4.04k]
  ------------------
  321|       |            // The top is the first false value; toggling it will make everything true.
  322|  1.90k|            m_first_false_pos = NO_FALSE;
  323|  4.04k|        } else {
  324|       |            // There is a false value, but not on top. No action is needed as toggling
  325|       |            // anything but the first false value is unobservable.
  326|  4.04k|        }
  327|  8.78k|    }
interpreter.cpp:_ZN12_GLOBAL__N_114ConditionStack8pop_backEv:
  306|  13.1k|    {
  307|  13.1k|        assert(m_stack_size > 0);
  ------------------
  |  Branch (307:9): [True: 13.1k, False: 0]
  ------------------
  308|  13.1k|        --m_stack_size;
  309|  13.1k|        if (m_first_false_pos == m_stack_size) {
  ------------------
  |  Branch (309:13): [True: 4.02k, False: 9.15k]
  ------------------
  310|       |            // When popping off the first false value, everything becomes true.
  311|  4.02k|            m_first_false_pos = NO_FALSE;
  312|  4.02k|        }
  313|  13.1k|    }
interpreter.cpp:_ZL12EvalChecksigRKNSt3__16vectorIhNS_9allocatorIhEEEES5_N9prevectorILj36EhjiE14const_iteratorES8_R19ScriptExecutionData19script_verify_flagsRK20BaseSignatureChecker10SigVersionP13ScriptError_tRb:
  403|  19.7k|{
  404|  19.7k|    switch (sigversion) {
  ------------------
  |  Branch (404:13): [True: 19.7k, False: 0]
  ------------------
  405|      0|    case SigVersion::BASE:
  ------------------
  |  Branch (405:5): [True: 0, False: 19.7k]
  ------------------
  406|  1.80k|    case SigVersion::WITNESS_V0:
  ------------------
  |  Branch (406:5): [True: 1.80k, False: 17.9k]
  ------------------
  407|  1.80k|        return EvalChecksigPreTapscript(sig, pubkey, pbegincodehash, pend, flags, checker, sigversion, serror, success);
  408|  17.9k|    case SigVersion::TAPSCRIPT:
  ------------------
  |  Branch (408:5): [True: 17.9k, False: 1.80k]
  ------------------
  409|  17.9k|        return EvalChecksigTapscript(sig, pubkey, execdata, flags, checker, sigversion, serror, success);
  410|      0|    case SigVersion::TAPROOT:
  ------------------
  |  Branch (410:5): [True: 0, False: 19.7k]
  ------------------
  411|       |        // Key path spending in Taproot has no script, so this is unreachable.
  412|      0|        break;
  413|  19.7k|    }
  414|  19.7k|    assert(false);
  ------------------
  |  Branch (414:5): [Folded, False: 0]
  ------------------
  415|      0|}
interpreter.cpp:_ZL24EvalChecksigPreTapscriptRKNSt3__16vectorIhNS_9allocatorIhEEEES5_N9prevectorILj36EhjiE14const_iteratorES8_19script_verify_flagsRK20BaseSignatureChecker10SigVersionP13ScriptError_tRb:
  332|  1.80k|{
  333|  1.80k|    assert(sigversion == SigVersion::BASE || sigversion == SigVersion::WITNESS_V0);
  ------------------
  |  Branch (333:5): [True: 0, False: 1.80k]
  |  Branch (333:5): [True: 1.80k, False: 0]
  |  Branch (333:5): [True: 1.80k, False: 0]
  ------------------
  334|       |
  335|       |    // Subset of script starting at the most recent codeseparator
  336|  1.80k|    CScript scriptCode(pbegincodehash, pend);
  337|       |
  338|       |    // Drop the signature in pre-segwit scripts but not segwit scripts
  339|  1.80k|    if (sigversion == SigVersion::BASE) {
  ------------------
  |  Branch (339:9): [True: 0, False: 1.80k]
  ------------------
  340|      0|        int found = FindAndDelete(scriptCode, CScript() << vchSig);
  341|      0|        if (found > 0 && (flags & SCRIPT_VERIFY_CONST_SCRIPTCODE))
  ------------------
  |  Branch (341:13): [True: 0, False: 0]
  |  Branch (341:13): [True: 0, False: 0]
  |  Branch (341:26): [True: 0, False: 0]
  ------------------
  342|      0|            return set_error(serror, SCRIPT_ERR_SIG_FINDANDDELETE);
  343|      0|    }
  344|       |
  345|  1.80k|    if (!CheckSignatureEncoding(vchSig, flags, serror) || !CheckPubKeyEncoding(vchPubKey, flags, sigversion, serror)) {
  ------------------
  |  Branch (345:9): [True: 0, False: 1.80k]
  |  Branch (345:59): [True: 0, False: 1.80k]
  ------------------
  346|       |        //serror is set
  347|      0|        return false;
  348|      0|    }
  349|  1.80k|    fSuccess = checker.CheckECDSASignature(vchSig, vchPubKey, scriptCode, sigversion);
  350|       |
  351|  1.80k|    if (!fSuccess && (flags & SCRIPT_VERIFY_NULLFAIL) && vchSig.size())
  ------------------
  |  Branch (351:9): [True: 679, False: 1.12k]
  |  Branch (351:9): [True: 0, False: 1.80k]
  |  Branch (351:22): [True: 679, False: 0]
  |  Branch (351:58): [True: 0, False: 679]
  ------------------
  352|      0|        return set_error(serror, SCRIPT_ERR_SIG_NULLFAIL);
  353|       |
  354|  1.80k|    return true;
  355|  1.80k|}
interpreter.cpp:_ZL21EvalChecksigTapscriptRKNSt3__16vectorIhNS_9allocatorIhEEEES5_R19ScriptExecutionData19script_verify_flagsRK20BaseSignatureChecker10SigVersionP13ScriptError_tRb:
  358|  17.9k|{
  359|  17.9k|    assert(sigversion == SigVersion::TAPSCRIPT);
  ------------------
  |  Branch (359:5): [True: 17.9k, False: 0]
  ------------------
  360|       |
  361|       |    /*
  362|       |     *  The following validation sequence is consensus critical. Please note how --
  363|       |     *    upgradable public key versions precede other rules;
  364|       |     *    the script execution fails when using empty signature with invalid public key;
  365|       |     *    the script execution fails when using non-empty invalid signature.
  366|       |     */
  367|  17.9k|    success = !sig.empty();
  368|  17.9k|    if (success) {
  ------------------
  |  Branch (368:9): [True: 4.03k, False: 13.9k]
  ------------------
  369|       |        // Implement the sigops/witnesssize ratio test.
  370|       |        // Passing with an upgradable public key version is also counted.
  371|  4.03k|        assert(execdata.m_validation_weight_left_init);
  ------------------
  |  Branch (371:9): [True: 4.03k, False: 0]
  ------------------
  372|  4.03k|        execdata.m_validation_weight_left -= VALIDATION_WEIGHT_PER_SIGOP_PASSED;
  373|  4.03k|        if (execdata.m_validation_weight_left < 0) {
  ------------------
  |  Branch (373:13): [True: 0, False: 4.03k]
  ------------------
  374|      0|            return set_error(serror, SCRIPT_ERR_TAPSCRIPT_VALIDATION_WEIGHT);
  375|      0|        }
  376|  4.03k|    }
  377|  17.9k|    if (pubkey.size() == 0) {
  ------------------
  |  Branch (377:9): [True: 0, False: 17.9k]
  ------------------
  378|      0|        return set_error(serror, SCRIPT_ERR_TAPSCRIPT_EMPTY_PUBKEY);
  379|  17.9k|    } else if (pubkey.size() == 32) {
  ------------------
  |  Branch (379:16): [True: 17.9k, False: 0]
  ------------------
  380|  17.9k|        if (success && !checker.CheckSchnorrSignature(sig, pubkey, sigversion, execdata, serror)) {
  ------------------
  |  Branch (380:13): [True: 4.03k, False: 13.9k]
  |  Branch (380:24): [True: 0, False: 4.03k]
  ------------------
  381|      0|            return false; // serror is set
  382|      0|        }
  383|  17.9k|    } else {
  384|       |        /*
  385|       |         *  New public key version softforks should be defined before this `else` block.
  386|       |         *  Generally, the new code should not do anything but failing the script execution. To avoid
  387|       |         *  consensus bugs, it should not modify any existing values (including `success`).
  388|       |         */
  389|      0|        if ((flags & SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_PUBKEYTYPE) != 0) {
  ------------------
  |  Branch (389:13): [True: 0, False: 0]
  ------------------
  390|      0|            return set_error(serror, SCRIPT_ERR_DISCOURAGE_UPGRADABLE_PUBKEYTYPE);
  391|      0|        }
  392|      0|    }
  393|       |
  394|  17.9k|    return true;
  395|  17.9k|}
interpreter.cpp:_ZL19CheckPubKeyEncodingRKNSt3__16vectorIhNS_9allocatorIhEEEE19script_verify_flagsRK10SigVersionP13ScriptError_t:
  228|  14.9k|bool static CheckPubKeyEncoding(const valtype &vchPubKey, script_verify_flags flags, const SigVersion &sigversion, ScriptError* serror) {
  229|  14.9k|    if ((flags & SCRIPT_VERIFY_STRICTENC) != 0 && !IsCompressedOrUncompressedPubKey(vchPubKey)) {
  ------------------
  |  Branch (229:9): [True: 14.9k, False: 0]
  |  Branch (229:9): [True: 0, False: 14.9k]
  |  Branch (229:51): [True: 0, False: 14.9k]
  ------------------
  230|      0|        return set_error(serror, SCRIPT_ERR_PUBKEYTYPE);
  231|      0|    }
  232|       |    // Only compressed keys are accepted in segwit
  233|  14.9k|    if ((flags & SCRIPT_VERIFY_WITNESS_PUBKEYTYPE) != 0 && sigversion == SigVersion::WITNESS_V0 && !IsCompressedPubKey(vchPubKey)) {
  ------------------
  |  Branch (233:9): [True: 14.9k, False: 0]
  |  Branch (233:9): [True: 0, False: 14.9k]
  |  Branch (233:60): [True: 14.9k, False: 0]
  |  Branch (233:100): [True: 0, False: 14.9k]
  ------------------
  234|      0|        return set_error(serror, SCRIPT_ERR_WITNESS_PUBKEYTYPE);
  235|      0|    }
  236|  14.9k|    return true;
  237|  14.9k|}
interpreter.cpp:_ZL32IsCompressedOrUncompressedPubKeyRKNSt3__16vectorIhNS_9allocatorIhEEEE:
   74|  14.9k|bool static IsCompressedOrUncompressedPubKey(const valtype &vchPubKey) {
   75|  14.9k|    if (vchPubKey.size() < CPubKey::COMPRESSED_SIZE) {
  ------------------
  |  Branch (75:9): [True: 0, False: 14.9k]
  ------------------
   76|       |        //  Non-canonical public key: too short
   77|      0|        return false;
   78|      0|    }
   79|  14.9k|    if (vchPubKey[0] == 0x04) {
  ------------------
  |  Branch (79:9): [True: 0, False: 14.9k]
  ------------------
   80|      0|        if (vchPubKey.size() != CPubKey::SIZE) {
  ------------------
  |  Branch (80:13): [True: 0, False: 0]
  ------------------
   81|       |            //  Non-canonical public key: invalid length for uncompressed key
   82|      0|            return false;
   83|      0|        }
   84|  14.9k|    } else if (vchPubKey[0] == 0x02 || vchPubKey[0] == 0x03) {
  ------------------
  |  Branch (84:16): [True: 8.01k, False: 6.89k]
  |  Branch (84:40): [True: 6.89k, False: 0]
  ------------------
   85|  14.9k|        if (vchPubKey.size() != CPubKey::COMPRESSED_SIZE) {
  ------------------
  |  Branch (85:13): [True: 0, False: 14.9k]
  ------------------
   86|       |            //  Non-canonical public key: invalid length for compressed key
   87|      0|            return false;
   88|      0|        }
   89|  14.9k|    } else {
   90|       |        //  Non-canonical public key: neither compressed nor uncompressed
   91|      0|        return false;
   92|      0|    }
   93|  14.9k|    return true;
   94|  14.9k|}
interpreter.cpp:_ZL18IsCompressedPubKeyRKNSt3__16vectorIhNS_9allocatorIhEEEE:
   96|  14.9k|bool static IsCompressedPubKey(const valtype &vchPubKey) {
   97|  14.9k|    if (vchPubKey.size() != CPubKey::COMPRESSED_SIZE) {
  ------------------
  |  Branch (97:9): [True: 0, False: 14.9k]
  ------------------
   98|       |        //  Non-canonical public key: invalid length for compressed key
   99|      0|        return false;
  100|      0|    }
  101|  14.9k|    if (vchPubKey[0] != 0x02 && vchPubKey[0] != 0x03) {
  ------------------
  |  Branch (101:9): [True: 6.89k, False: 8.01k]
  |  Branch (101:33): [True: 0, False: 6.89k]
  ------------------
  102|       |        //  Non-canonical public key: invalid prefix for compressed key
  103|      0|        return false;
  104|      0|    }
  105|  14.9k|    return true;
  106|  14.9k|}
interpreter.cpp:_ZN12_GLOBAL__N_111set_successEP13ScriptError_t:
   31|  11.7k|{
   32|  11.7k|    if (ret)
  ------------------
  |  Branch (32:9): [True: 11.7k, False: 0]
  ------------------
   33|  11.7k|        *ret = SCRIPT_ERR_OK;
   34|  11.7k|    return true;
   35|  11.7k|}
interpreter.cpp:_ZL20VerifyWitnessProgramRK14CScriptWitnessiRKNSt3__16vectorIhNS2_9allocatorIhEEEE19script_verify_flagsRK20BaseSignatureCheckerP13ScriptError_tb:
 1928|  2.97k|{
 1929|  2.97k|    CScript exec_script; //!< Actually executed script (last stack item in P2WSH; implied P2PKH script in P2WPKH; leaf script in P2TR)
 1930|  2.97k|    std::span stack{witness.stack};
 1931|  2.97k|    ScriptExecutionData execdata;
 1932|       |
 1933|  2.97k|    if (witversion == 0) {
  ------------------
  |  Branch (1933:9): [True: 1.68k, False: 1.29k]
  ------------------
 1934|  1.68k|        if (program.size() == WITNESS_V0_SCRIPTHASH_SIZE) {
  ------------------
  |  Branch (1934:13): [True: 1.68k, False: 0]
  ------------------
 1935|       |            // BIP141 P2WSH: 32-byte witness v0 program (which encodes SHA256(script))
 1936|  1.68k|            if (stack.size() == 0) {
  ------------------
  |  Branch (1936:17): [True: 0, False: 1.68k]
  ------------------
 1937|      0|                return set_error(serror, SCRIPT_ERR_WITNESS_PROGRAM_WITNESS_EMPTY);
 1938|      0|            }
 1939|  1.68k|            const valtype& script_bytes = SpanPopBack(stack);
 1940|  1.68k|            exec_script = CScript(script_bytes.begin(), script_bytes.end());
 1941|  1.68k|            uint256 hash_exec_script;
 1942|  1.68k|            CSHA256().Write(exec_script.data(), exec_script.size()).Finalize(hash_exec_script.begin());
 1943|  1.68k|            if (memcmp(hash_exec_script.begin(), program.data(), 32)) {
  ------------------
  |  Branch (1943:17): [True: 0, False: 1.68k]
  ------------------
 1944|      0|                return set_error(serror, SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH);
 1945|      0|            }
 1946|  1.68k|            return ExecuteWitnessScript(stack, exec_script, flags, SigVersion::WITNESS_V0, checker, execdata, serror);
 1947|  1.68k|        } else if (program.size() == WITNESS_V0_KEYHASH_SIZE) {
  ------------------
  |  Branch (1947:20): [True: 0, False: 0]
  ------------------
 1948|       |            // BIP141 P2WPKH: 20-byte witness v0 program (which encodes Hash160(pubkey))
 1949|      0|            if (stack.size() != 2) {
  ------------------
  |  Branch (1949:17): [True: 0, False: 0]
  ------------------
 1950|      0|                return set_error(serror, SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH); // 2 items in witness
 1951|      0|            }
 1952|      0|            exec_script << OP_DUP << OP_HASH160 << program << OP_EQUALVERIFY << OP_CHECKSIG;
 1953|      0|            return ExecuteWitnessScript(stack, exec_script, flags, SigVersion::WITNESS_V0, checker, execdata, serror);
 1954|      0|        } else {
 1955|      0|            return set_error(serror, SCRIPT_ERR_WITNESS_PROGRAM_WRONG_LENGTH);
 1956|      0|        }
 1957|  1.68k|    } else if (witversion == 1 && program.size() == WITNESS_V1_TAPROOT_SIZE && !is_p2sh) {
  ------------------
  |  Branch (1957:16): [True: 1.29k, False: 0]
  |  Branch (1957:35): [True: 1.29k, False: 0]
  |  Branch (1957:80): [True: 1.29k, False: 0]
  ------------------
 1958|       |        // BIP341 Taproot: 32-byte non-P2SH witness v1 program (which encodes a P2C-tweaked pubkey)
 1959|  1.29k|        if (!(flags & SCRIPT_VERIFY_TAPROOT)) return set_success(serror);
  ------------------
  |  Branch (1959:13): [True: 0, False: 1.29k]
  ------------------
 1960|  1.29k|        if (stack.size() == 0) return set_error(serror, SCRIPT_ERR_WITNESS_PROGRAM_WITNESS_EMPTY);
  ------------------
  |  Branch (1960:13): [True: 0, False: 1.29k]
  ------------------
 1961|  1.29k|        if (stack.size() >= 2 && !stack.back().empty() && stack.back()[0] == ANNEX_TAG) {
  ------------------
  |  Branch (1961:13): [True: 1.29k, False: 0]
  |  Branch (1961:34): [True: 1.29k, False: 0]
  |  Branch (1961:59): [True: 0, False: 1.29k]
  ------------------
 1962|       |            // Drop annex (this is non-standard; see IsWitnessStandard)
 1963|      0|            const valtype& annex = SpanPopBack(stack);
 1964|      0|            execdata.m_annex_hash = (HashWriter{} << annex).GetSHA256();
 1965|      0|            execdata.m_annex_present = true;
 1966|  1.29k|        } else {
 1967|  1.29k|            execdata.m_annex_present = false;
 1968|  1.29k|        }
 1969|  1.29k|        execdata.m_annex_init = true;
 1970|  1.29k|        if (stack.size() == 1) {
  ------------------
  |  Branch (1970:13): [True: 0, False: 1.29k]
  ------------------
 1971|       |            // Key path spending (stack size is 1 after removing optional annex)
 1972|      0|            if (!checker.CheckSchnorrSignature(stack.front(), program, SigVersion::TAPROOT, execdata, serror)) {
  ------------------
  |  Branch (1972:17): [True: 0, False: 0]
  ------------------
 1973|      0|                return false; // serror is set
 1974|      0|            }
 1975|      0|            return set_success(serror);
 1976|  1.29k|        } else {
 1977|       |            // Script path spending (stack size is >1 after removing optional annex)
 1978|  1.29k|            const valtype& control = SpanPopBack(stack);
 1979|  1.29k|            const valtype& script = SpanPopBack(stack);
 1980|  1.29k|            if (control.size() < TAPROOT_CONTROL_BASE_SIZE || control.size() > TAPROOT_CONTROL_MAX_SIZE || ((control.size() - TAPROOT_CONTROL_BASE_SIZE) % TAPROOT_CONTROL_NODE_SIZE) != 0) {
  ------------------
  |  Branch (1980:17): [True: 0, False: 1.29k]
  |  Branch (1980:63): [True: 0, False: 1.29k]
  |  Branch (1980:108): [True: 0, False: 1.29k]
  ------------------
 1981|      0|                return set_error(serror, SCRIPT_ERR_TAPROOT_WRONG_CONTROL_SIZE);
 1982|      0|            }
 1983|  1.29k|            execdata.m_tapleaf_hash = ComputeTapleafHash(control[0] & TAPROOT_LEAF_MASK, script);
 1984|  1.29k|            if (!VerifyTaprootCommitment(control, program, execdata.m_tapleaf_hash)) {
  ------------------
  |  Branch (1984:17): [True: 0, False: 1.29k]
  ------------------
 1985|      0|                return set_error(serror, SCRIPT_ERR_WITNESS_PROGRAM_MISMATCH);
 1986|      0|            }
 1987|  1.29k|            execdata.m_tapleaf_hash_init = true;
 1988|  1.29k|            if ((control[0] & TAPROOT_LEAF_MASK) == TAPROOT_LEAF_TAPSCRIPT) {
  ------------------
  |  Branch (1988:17): [True: 1.29k, False: 0]
  ------------------
 1989|       |                // Tapscript (leaf version 0xc0)
 1990|  1.29k|                exec_script = CScript(script.begin(), script.end());
 1991|  1.29k|                execdata.m_validation_weight_left = ::GetSerializeSize(witness.stack) + VALIDATION_WEIGHT_OFFSET;
 1992|  1.29k|                execdata.m_validation_weight_left_init = true;
 1993|  1.29k|                return ExecuteWitnessScript(stack, exec_script, flags, SigVersion::TAPSCRIPT, checker, execdata, serror);
 1994|  1.29k|            }
 1995|      0|            if (flags & SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_TAPROOT_VERSION) {
  ------------------
  |  Branch (1995:17): [True: 0, False: 0]
  ------------------
 1996|      0|                return set_error(serror, SCRIPT_ERR_DISCOURAGE_UPGRADABLE_TAPROOT_VERSION);
 1997|      0|            }
 1998|      0|            return set_success(serror);
 1999|      0|        }
 2000|  1.29k|    } else if (!is_p2sh && CScript::IsPayToAnchor(witversion, program)) {
  ------------------
  |  Branch (2000:16): [True: 0, False: 0]
  |  Branch (2000:28): [True: 0, False: 0]
  ------------------
 2001|      0|        return true;
 2002|      0|    } else {
 2003|      0|        if (flags & SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM) {
  ------------------
  |  Branch (2003:13): [True: 0, False: 0]
  ------------------
 2004|      0|            return set_error(serror, SCRIPT_ERR_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM);
 2005|      0|        }
 2006|       |        // Other version/size/p2sh combinations return true for future softfork compatibility
 2007|      0|        return true;
 2008|      0|    }
 2009|       |    // There is intentionally no return statement here, to be able to use "control reaches end of non-void function" warnings to detect gaps in the logic above.
 2010|  2.97k|}
interpreter.cpp:_ZL20ExecuteWitnessScriptRKNSt3__14spanIKNS_6vectorIhNS_9allocatorIhEEEELm18446744073709551615EEERK7CScript19script_verify_flags10SigVersionRK20BaseSignatureCheckerR19ScriptExecutionDataP13ScriptError_t:
 1843|  2.97k|{
 1844|  2.97k|    std::vector<valtype> stack{stack_span.begin(), stack_span.end()};
 1845|       |
 1846|  2.97k|    if (sigversion == SigVersion::TAPSCRIPT) {
  ------------------
  |  Branch (1846:9): [True: 1.29k, False: 1.68k]
  ------------------
 1847|       |        // OP_SUCCESSx processing overrides everything, including stack element size limits
 1848|  1.29k|        CScript::const_iterator pc = exec_script.begin();
 1849|   276k|        while (pc < exec_script.end()) {
  ------------------
  |  Branch (1849:16): [True: 274k, False: 1.29k]
  ------------------
 1850|   274k|            opcodetype opcode;
 1851|   274k|            if (!exec_script.GetOp(pc, opcode)) {
  ------------------
  |  Branch (1851:17): [True: 0, False: 274k]
  ------------------
 1852|       |                // Note how this condition would not be reached if an unknown OP_SUCCESSx was found
 1853|      0|                return set_error(serror, SCRIPT_ERR_BAD_OPCODE);
 1854|      0|            }
 1855|       |            // New opcodes will be listed here. May use a different sigversion to modify existing opcodes.
 1856|   274k|            if (IsOpSuccess(opcode)) {
  ------------------
  |  Branch (1856:17): [True: 0, False: 274k]
  ------------------
 1857|      0|                if (flags & SCRIPT_VERIFY_DISCOURAGE_OP_SUCCESS) {
  ------------------
  |  Branch (1857:21): [True: 0, False: 0]
  ------------------
 1858|      0|                    return set_error(serror, SCRIPT_ERR_DISCOURAGE_OP_SUCCESS);
 1859|      0|                }
 1860|      0|                return set_success(serror);
 1861|      0|            }
 1862|   274k|        }
 1863|       |
 1864|       |        // Tapscript enforces initial stack size limits (altstack is empty here)
 1865|  1.29k|        if (stack.size() > MAX_STACK_SIZE) return set_error(serror, SCRIPT_ERR_STACK_SIZE);
  ------------------
  |  Branch (1865:13): [True: 11, False: 1.28k]
  ------------------
 1866|  1.29k|    }
 1867|       |
 1868|       |    // Disallow stack item size > MAX_SCRIPT_ELEMENT_SIZE in witness stack
 1869|   216k|    for (const valtype& elem : stack) {
  ------------------
  |  Branch (1869:30): [True: 216k, False: 2.96k]
  ------------------
 1870|   216k|        if (elem.size() > MAX_SCRIPT_ELEMENT_SIZE) return set_error(serror, SCRIPT_ERR_PUSH_SIZE);
  ------------------
  |  Branch (1870:13): [True: 0, False: 216k]
  ------------------
 1871|   216k|    }
 1872|       |
 1873|       |    // Run the script interpreter.
 1874|  2.96k|    if (!EvalScript(stack, exec_script, flags, checker, sigversion, execdata, serror)) return false;
  ------------------
  |  Branch (1874:9): [True: 71, False: 2.89k]
  ------------------
 1875|       |
 1876|       |    // Scripts inside witness implicitly require cleanstack behaviour
 1877|  2.89k|    if (stack.size() != 1) return set_error(serror, SCRIPT_ERR_CLEANSTACK);
  ------------------
  |  Branch (1877:9): [True: 0, False: 2.89k]
  ------------------
 1878|  2.89k|    if (!CastToBool(stack.back())) return set_error(serror, SCRIPT_ERR_EVAL_FALSE);
  ------------------
  |  Branch (1878:9): [True: 0, False: 2.89k]
  ------------------
 1879|  2.89k|    return true;
 1880|  2.89k|}
interpreter.cpp:_ZL23VerifyTaprootCommitmentRKNSt3__16vectorIhNS_9allocatorIhEEEES5_RK7uint256:
 1914|  1.29k|{
 1915|  1.29k|    assert(control.size() >= TAPROOT_CONTROL_BASE_SIZE);
  ------------------
  |  Branch (1915:5): [True: 1.29k, False: 0]
  ------------------
 1916|  1.29k|    assert(program.size() >= uint256::size());
  ------------------
  |  Branch (1916:5): [True: 1.29k, False: 0]
  ------------------
 1917|       |    //! The internal pubkey (x-only, so no Y coordinate parity).
 1918|  1.29k|    const XOnlyPubKey p{std::span{control}.subspan(1, TAPROOT_CONTROL_BASE_SIZE - 1)};
 1919|       |    //! The output pubkey (taken from the scriptPubKey).
 1920|  1.29k|    const XOnlyPubKey q{program};
 1921|       |    // Compute the Merkle root from the leaf and the provided path.
 1922|  1.29k|    const uint256 merkle_root = ComputeTaprootMerkleRoot(control, tapleaf_hash);
 1923|       |    // Verify that the output pubkey matches the tweaked internal pubkey, after correcting for parity.
 1924|  1.29k|    return q.CheckTapTweak(p, merkle_root, control[0] & 1);
 1925|  1.29k|}

_ZN20BaseSignatureCheckerD2Ev:
  298|      2|    virtual ~BaseSignatureChecker() = default;

_ZN10miniscript8internal12SanitizeTypeENS_4TypeE:
   19|   502k|Type SanitizeType(Type e) {
   20|   502k|    int num_types = (e << "K"_mst) + (e << "V"_mst) + (e << "B"_mst) + (e << "W"_mst);
   21|   502k|    if (num_types == 0) return ""_mst; // No valid type, don't care about the rest
  ------------------
  |  Branch (21:9): [True: 0, False: 502k]
  ------------------
   22|   502k|    CHECK_NONFATAL(num_types == 1); // K, V, B, W all conflict with each other
  ------------------
  |  |  113|   502k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   23|   502k|    CHECK_NONFATAL(!(e << "z"_mst) || !(e << "o"_mst)); // z conflicts with o
  ------------------
  |  |  113|   717k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 287k, False: 215k]
  |  |  |  Branch (113:28): [True: 215k, False: 0]
  |  |  ------------------
  ------------------
   24|   502k|    CHECK_NONFATAL(!(e << "n"_mst) || !(e << "z"_mst)); // n conflicts with z
  ------------------
  |  |  113|   618k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 387k, False: 115k]
  |  |  |  Branch (113:28): [True: 115k, False: 0]
  |  |  ------------------
  ------------------
   25|   502k|    CHECK_NONFATAL(!(e << "n"_mst) || !(e << "W"_mst)); // n conflicts with W
  ------------------
  |  |  113|   618k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 387k, False: 115k]
  |  |  |  Branch (113:28): [True: 115k, False: 0]
  |  |  ------------------
  ------------------
   26|   502k|    CHECK_NONFATAL(!(e << "V"_mst) || !(e << "d"_mst)); // V conflicts with d
  ------------------
  |  |  113|   583k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 422k, False: 80.7k]
  |  |  |  Branch (113:28): [True: 80.7k, False: 0]
  |  |  ------------------
  ------------------
   27|   502k|    CHECK_NONFATAL(!(e << "K"_mst) ||  (e << "u"_mst)); // K implies u
  ------------------
  |  |  113|   550k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 454k, False: 47.8k]
  |  |  |  Branch (113:28): [True: 47.8k, False: 0]
  |  |  ------------------
  ------------------
   28|   502k|    CHECK_NONFATAL(!(e << "V"_mst) || !(e << "u"_mst)); // V conflicts with u
  ------------------
  |  |  113|   583k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 422k, False: 80.7k]
  |  |  |  Branch (113:28): [True: 80.7k, False: 0]
  |  |  ------------------
  ------------------
   29|   502k|    CHECK_NONFATAL(!(e << "e"_mst) || !(e << "f"_mst)); // e conflicts with f
  ------------------
  |  |  113|   808k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 197k, False: 305k]
  |  |  |  Branch (113:28): [True: 305k, False: 0]
  |  |  ------------------
  ------------------
   30|   502k|    CHECK_NONFATAL(!(e << "e"_mst) ||  (e << "d"_mst)); // e implies d
  ------------------
  |  |  113|   808k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 197k, False: 305k]
  |  |  |  Branch (113:28): [True: 305k, False: 0]
  |  |  ------------------
  ------------------
   31|   502k|    CHECK_NONFATAL(!(e << "V"_mst) || !(e << "e"_mst)); // V conflicts with e
  ------------------
  |  |  113|   583k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 422k, False: 80.7k]
  |  |  |  Branch (113:28): [True: 80.7k, False: 0]
  |  |  ------------------
  ------------------
   32|   502k|    CHECK_NONFATAL(!(e << "d"_mst) || !(e << "f"_mst)); // d conflicts with f
  ------------------
  |  |  113|   871k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 134k, False: 368k]
  |  |  |  Branch (113:28): [True: 368k, False: 0]
  |  |  ------------------
  ------------------
   33|   502k|    CHECK_NONFATAL(!(e << "V"_mst) ||  (e << "f"_mst)); // V implies f
  ------------------
  |  |  113|   583k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 422k, False: 80.7k]
  |  |  |  Branch (113:28): [True: 80.7k, False: 0]
  |  |  ------------------
  ------------------
   34|   502k|    CHECK_NONFATAL(!(e << "K"_mst) ||  (e << "s"_mst)); // K implies s
  ------------------
  |  |  113|   550k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 454k, False: 47.8k]
  |  |  |  Branch (113:28): [True: 47.8k, False: 0]
  |  |  ------------------
  ------------------
   35|   502k|    CHECK_NONFATAL(!(e << "z"_mst) ||  (e << "m"_mst)); // z implies m
  ------------------
  |  |  113|   717k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 287k, False: 215k]
  |  |  |  Branch (113:28): [True: 215k, False: 0]
  |  |  ------------------
  ------------------
   36|   502k|    return e;
   37|   502k|}
_ZN10miniscript8internal11ComputeTypeENS_8FragmentENS_4TypeES2_S2_RKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEEjmmmNS_17MiniscriptContextE:
   40|   502k|                 size_t data_size, size_t n_subs, size_t n_keys, MiniscriptContext ms_ctx) {
   41|       |    // Sanity check on data
   42|   502k|    if (fragment == Fragment::SHA256 || fragment == Fragment::HASH256) {
  ------------------
  |  Branch (42:9): [True: 5.51k, False: 497k]
  |  Branch (42:41): [True: 4.77k, False: 492k]
  ------------------
   43|  10.2k|        CHECK_NONFATAL(data_size == 32);
  ------------------
  |  |  113|  10.2k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   44|   492k|    } else if (fragment == Fragment::RIPEMD160 || fragment == Fragment::HASH160) {
  ------------------
  |  Branch (44:16): [True: 3.42k, False: 489k]
  |  Branch (44:51): [True: 3.69k, False: 485k]
  ------------------
   45|  7.11k|        CHECK_NONFATAL(data_size == 20);
  ------------------
  |  |  113|  7.11k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   46|   485k|    } else {
   47|   485k|        CHECK_NONFATAL(data_size == 0);
  ------------------
  |  |  113|   485k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   48|   485k|    }
   49|       |    // Sanity check on k
   50|   502k|    if (fragment == Fragment::OLDER || fragment == Fragment::AFTER) {
  ------------------
  |  Branch (50:9): [True: 4.83k, False: 497k]
  |  Branch (50:40): [True: 3.94k, False: 494k]
  ------------------
   51|  8.77k|        CHECK_NONFATAL(k >= 1 && k < 0x80000000UL);
  ------------------
  |  |  113|  17.5k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 8.77k, False: 0]
  |  |  |  Branch (113:28): [True: 8.77k, False: 0]
  |  |  ------------------
  ------------------
   52|   494k|    } else if (fragment == Fragment::MULTI || fragment == Fragment::MULTI_A) {
  ------------------
  |  Branch (52:16): [True: 14.1k, False: 479k]
  |  Branch (52:47): [True: 3.16k, False: 476k]
  ------------------
   53|  17.3k|        CHECK_NONFATAL(k >= 1 && k <= n_keys);
  ------------------
  |  |  113|  34.6k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 17.3k, False: 0]
  |  |  |  Branch (113:28): [True: 17.3k, False: 0]
  |  |  ------------------
  ------------------
   54|   476k|    } else if (fragment == Fragment::THRESH) {
  ------------------
  |  Branch (54:16): [True: 18.8k, False: 457k]
  ------------------
   55|  18.8k|        CHECK_NONFATAL(k >= 1 && k <= n_subs);
  ------------------
  |  |  113|  37.6k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 18.8k, False: 0]
  |  |  |  Branch (113:28): [True: 18.8k, False: 0]
  |  |  ------------------
  ------------------
   56|   457k|    } else {
   57|   457k|        CHECK_NONFATAL(k == 0);
  ------------------
  |  |  113|   457k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   58|   457k|    }
   59|       |    // Sanity check on subs
   60|   502k|    if (fragment == Fragment::AND_V || fragment == Fragment::AND_B || fragment == Fragment::OR_B ||
  ------------------
  |  Branch (60:9): [True: 39.5k, False: 463k]
  |  Branch (60:40): [True: 8.92k, False: 454k]
  |  Branch (60:71): [True: 7.62k, False: 446k]
  ------------------
   61|   446k|        fragment == Fragment::OR_C || fragment == Fragment::OR_I || fragment == Fragment::OR_D) {
  ------------------
  |  Branch (61:9): [True: 8.16k, False: 438k]
  |  Branch (61:39): [True: 26.7k, False: 411k]
  |  Branch (61:69): [True: 11.6k, False: 400k]
  ------------------
   62|   102k|        CHECK_NONFATAL(n_subs == 2);
  ------------------
  |  |  113|   102k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   63|   400k|    } else if (fragment == Fragment::ANDOR) {
  ------------------
  |  Branch (63:16): [True: 20.4k, False: 379k]
  ------------------
   64|  20.4k|        CHECK_NONFATAL(n_subs == 3);
  ------------------
  |  |  113|  20.4k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   65|   379k|    } else if (fragment == Fragment::WRAP_A || fragment == Fragment::WRAP_S || fragment == Fragment::WRAP_C ||
  ------------------
  |  Branch (65:16): [True: 66.7k, False: 312k]
  |  Branch (65:48): [True: 3.91k, False: 309k]
  |  Branch (65:80): [True: 15.2k, False: 293k]
  ------------------
   66|   293k|               fragment == Fragment::WRAP_D || fragment == Fragment::WRAP_V || fragment == Fragment::WRAP_J ||
  ------------------
  |  Branch (66:16): [True: 1.78k, False: 292k]
  |  Branch (66:48): [True: 46.3k, False: 245k]
  |  Branch (66:80): [True: 5.12k, False: 240k]
  ------------------
   67|   240k|               fragment == Fragment::WRAP_N) {
  ------------------
  |  Branch (67:16): [True: 9.44k, False: 231k]
  ------------------
   68|   148k|        CHECK_NONFATAL(n_subs == 1);
  ------------------
  |  |  113|   148k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   69|   231k|    } else if (fragment != Fragment::THRESH) {
  ------------------
  |  Branch (69:16): [True: 212k, False: 18.8k]
  ------------------
   70|   212k|        CHECK_NONFATAL(n_subs == 0);
  ------------------
  |  |  113|   212k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   71|   212k|    }
   72|       |    // Sanity check on keys
   73|   502k|    if (fragment == Fragment::PK_K || fragment == Fragment::PK_H) {
  ------------------
  |  Branch (73:9): [True: 24.3k, False: 478k]
  |  Branch (73:39): [True: 5.92k, False: 472k]
  ------------------
   74|  30.2k|        CHECK_NONFATAL(n_keys == 1);
  ------------------
  |  |  113|  30.2k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   75|   472k|    } else if (fragment == Fragment::MULTI) {
  ------------------
  |  Branch (75:16): [True: 14.1k, False: 458k]
  ------------------
   76|  14.1k|        CHECK_NONFATAL(n_keys >= 1 && n_keys <= MAX_PUBKEYS_PER_MULTISIG);
  ------------------
  |  |  113|  28.3k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 14.1k, False: 0]
  |  |  |  Branch (113:28): [True: 14.1k, False: 0]
  |  |  ------------------
  ------------------
   77|  14.1k|        CHECK_NONFATAL(!IsTapscript(ms_ctx));
  ------------------
  |  |  113|  14.1k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   78|   458k|    } else if (fragment == Fragment::MULTI_A) {
  ------------------
  |  Branch (78:16): [True: 3.16k, False: 455k]
  ------------------
   79|  3.16k|        CHECK_NONFATAL(n_keys >= 1 && n_keys <= MAX_PUBKEYS_PER_MULTI_A);
  ------------------
  |  |  113|  6.32k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 3.16k, False: 0]
  |  |  |  Branch (113:28): [True: 3.16k, False: 0]
  |  |  ------------------
  ------------------
   80|  3.16k|        CHECK_NONFATAL(IsTapscript(ms_ctx));
  ------------------
  |  |  113|  3.16k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   81|   455k|    } else {
   82|   455k|        CHECK_NONFATAL(n_keys == 0);
  ------------------
  |  |  113|   455k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   83|   455k|    }
   84|       |
   85|       |    // Below is the per-fragment logic for computing the expression types.
   86|       |    // It heavily relies on Type's << operator (where "X << a_mst" means
   87|       |    // "X has all properties listed in a").
   88|   502k|    switch (fragment) {
  ------------------
  |  Branch (88:13): [True: 502k, False: 0]
  ------------------
   89|  24.3k|        case Fragment::PK_K: return "Konudemsxk"_mst;
  ------------------
  |  Branch (89:9): [True: 24.3k, False: 478k]
  ------------------
   90|  5.92k|        case Fragment::PK_H: return "Knudemsxk"_mst;
  ------------------
  |  Branch (90:9): [True: 5.92k, False: 496k]
  ------------------
   91|  4.83k|        case Fragment::OLDER: return
  ------------------
  |  Branch (91:9): [True: 4.83k, False: 497k]
  ------------------
   92|  4.83k|            "g"_mst.If(k & CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG) |
   93|  4.83k|            "h"_mst.If(!(k & CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG)) |
   94|  4.83k|            "Bzfmxk"_mst;
   95|  3.94k|        case Fragment::AFTER: return
  ------------------
  |  Branch (95:9): [True: 3.94k, False: 498k]
  ------------------
   96|  3.94k|            "i"_mst.If(k >= LOCKTIME_THRESHOLD) |
   97|  3.94k|            "j"_mst.If(k < LOCKTIME_THRESHOLD) |
   98|  3.94k|            "Bzfmxk"_mst;
   99|  5.51k|        case Fragment::SHA256: return "Bonudmk"_mst;
  ------------------
  |  Branch (99:9): [True: 5.51k, False: 497k]
  ------------------
  100|  3.42k|        case Fragment::RIPEMD160: return "Bonudmk"_mst;
  ------------------
  |  Branch (100:9): [True: 3.42k, False: 499k]
  ------------------
  101|  4.77k|        case Fragment::HASH256: return "Bonudmk"_mst;
  ------------------
  |  Branch (101:9): [True: 4.77k, False: 498k]
  ------------------
  102|  3.69k|        case Fragment::HASH160: return "Bonudmk"_mst;
  ------------------
  |  Branch (102:9): [True: 3.69k, False: 499k]
  ------------------
  103|  12.3k|        case Fragment::JUST_1: return "Bzufmxk"_mst;
  ------------------
  |  Branch (103:9): [True: 12.3k, False: 490k]
  ------------------
  104|   126k|        case Fragment::JUST_0: return "Bzudemsxk"_mst;
  ------------------
  |  Branch (104:9): [True: 126k, False: 376k]
  ------------------
  105|  66.7k|        case Fragment::WRAP_A: return
  ------------------
  |  Branch (105:9): [True: 66.7k, False: 436k]
  ------------------
  106|  66.7k|            "W"_mst.If(x << "B"_mst) | // W=B_x
  107|  66.7k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  108|  66.7k|            (x & "udfems"_mst) | // u=u_x, d=d_x, f=f_x, e=e_x, m=m_x, s=s_x
  109|  66.7k|            "x"_mst; // x
  110|  3.91k|        case Fragment::WRAP_S: return
  ------------------
  |  Branch (110:9): [True: 3.91k, False: 498k]
  ------------------
  111|  3.91k|            "W"_mst.If(x << "Bo"_mst) | // W=B_x*o_x
  112|  3.91k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  113|  3.91k|            (x & "udfemsx"_mst); // u=u_x, d=d_x, f=f_x, e=e_x, m=m_x, s=s_x, x=x_x
  114|  15.2k|        case Fragment::WRAP_C: return
  ------------------
  |  Branch (114:9): [True: 15.2k, False: 487k]
  ------------------
  115|  15.2k|            "B"_mst.If(x << "K"_mst) | // B=K_x
  116|  15.2k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  117|  15.2k|            (x & "ondfem"_mst) | // o=o_x, n=n_x, d=d_x, f=f_x, e=e_x, m=m_x
  118|  15.2k|            "us"_mst; // u, s
  119|  1.78k|        case Fragment::WRAP_D: return
  ------------------
  |  Branch (119:9): [True: 1.78k, False: 501k]
  ------------------
  120|  1.78k|            "B"_mst.If(x << "Vz"_mst) | // B=V_x*z_x
  121|  1.78k|            "o"_mst.If(x << "z"_mst) | // o=z_x
  122|  1.78k|            "e"_mst.If(x << "f"_mst) | // e=f_x
  123|  1.78k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  124|  1.78k|            (x & "ms"_mst) | // m=m_x, s=s_x
  125|       |            // NOTE: 'd:' is 'u' under Tapscript but not P2WSH as MINIMALIF is only a policy rule there.
  126|  1.78k|            "u"_mst.If(IsTapscript(ms_ctx)) |
  127|  1.78k|            "ndx"_mst; // n, d, x
  128|  46.3k|        case Fragment::WRAP_V: return
  ------------------
  |  Branch (128:9): [True: 46.3k, False: 456k]
  ------------------
  129|  46.3k|            "V"_mst.If(x << "B"_mst) | // V=B_x
  130|  46.3k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  131|  46.3k|            (x & "zonms"_mst) | // z=z_x, o=o_x, n=n_x, m=m_x, s=s_x
  132|  46.3k|            "fx"_mst; // f, x
  133|  5.12k|        case Fragment::WRAP_J: return
  ------------------
  |  Branch (133:9): [True: 5.12k, False: 497k]
  ------------------
  134|  5.12k|            "B"_mst.If(x << "Bn"_mst) | // B=B_x*n_x
  135|  5.12k|            "e"_mst.If(x << "f"_mst) | // e=f_x
  136|  5.12k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  137|  5.12k|            (x & "oums"_mst) | // o=o_x, u=u_x, m=m_x, s=s_x
  138|  5.12k|            "ndx"_mst; // n, d, x
  139|  9.44k|        case Fragment::WRAP_N: return
  ------------------
  |  Branch (139:9): [True: 9.44k, False: 493k]
  ------------------
  140|  9.44k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  141|  9.44k|            (x & "Bzondfems"_mst) | // B=B_x, z=z_x, o=o_x, n=n_x, d=d_x, f=f_x, e=e_x, m=m_x, s=s_x
  142|  9.44k|            "ux"_mst; // u, x
  143|  39.5k|        case Fragment::AND_V: return
  ------------------
  |  Branch (143:9): [True: 39.5k, False: 463k]
  ------------------
  144|  39.5k|            (y & "KVB"_mst).If(x << "V"_mst) | // B=V_x*B_y, V=V_x*V_y, K=V_x*K_y
  145|  39.5k|            (x & "n"_mst) | (y & "n"_mst).If(x << "z"_mst) | // n=n_x+z_x*n_y
  146|  39.5k|            ((x | y) & "o"_mst).If((x | y) << "z"_mst) | // o=o_x*z_y+z_x*o_y
  147|  39.5k|            (x & y & "mz"_mst) | // m=m_x*m_y, z=z_x*z_y
  148|  39.5k|            ((x | y) & "s"_mst) | // s=s_x+s_y
  149|  39.5k|            "f"_mst.If((y << "f"_mst) || (x << "s"_mst)) | // f=f_y+s_x
  ------------------
  |  Branch (149:24): [True: 29.5k, False: 10.0k]
  |  Branch (149:42): [True: 7.44k, False: 2.56k]
  ------------------
  150|  39.5k|            (y & "ux"_mst) | // u=u_y, x=x_y
  151|  39.5k|            ((x | y) & "ghij"_mst) | // g=g_x+g_y, h=h_x+h_y, i=i_x+i_y, j=j_x+j_y
  152|  39.5k|            "k"_mst.If(((x & y) << "k"_mst) &&
  ------------------
  |  Branch (152:24): [True: 38.7k, False: 787]
  ------------------
  153|  38.7k|                !(((x << "g"_mst) && (y << "h"_mst)) ||
  ------------------
  |  Branch (153:20): [True: 856, False: 37.9k]
  |  Branch (153:38): [True: 203, False: 653]
  ------------------
  154|  38.5k|                ((x << "h"_mst) && (y << "g"_mst)) ||
  ------------------
  |  Branch (154:18): [True: 2.07k, False: 36.5k]
  |  Branch (154:36): [True: 86, False: 1.98k]
  ------------------
  155|  38.5k|                ((x << "i"_mst) && (y << "j"_mst)) ||
  ------------------
  |  Branch (155:18): [True: 0, False: 38.5k]
  |  Branch (155:36): [True: 0, False: 0]
  ------------------
  156|  38.5k|                ((x << "j"_mst) && (y << "i"_mst)))); // k=k_x*k_y*!(g_x*h_y + h_x*g_y + i_x*j_y + j_x*i_y)
  ------------------
  |  Branch (156:18): [True: 3.51k, False: 34.9k]
  |  Branch (156:36): [True: 0, False: 3.51k]
  ------------------
  157|  8.92k|        case Fragment::AND_B: return
  ------------------
  |  Branch (157:9): [True: 8.92k, False: 493k]
  ------------------
  158|  8.92k|            (x & "B"_mst).If(y << "W"_mst) | // B=B_x*W_y
  159|  8.92k|            ((x | y) & "o"_mst).If((x | y) << "z"_mst) | // o=o_x*z_y+z_x*o_y
  160|  8.92k|            (x & "n"_mst) | (y & "n"_mst).If(x << "z"_mst) | // n=n_x+z_x*n_y
  161|  8.92k|            (x & y & "e"_mst).If((x & y) << "s"_mst) | // e=e_x*e_y*s_x*s_y
  162|  8.92k|            (x & y & "dzm"_mst) | // d=d_x*d_y, z=z_x*z_y, m=m_x*m_y
  163|  8.92k|            "f"_mst.If(((x & y) << "f"_mst) || (x << "sf"_mst) || (y << "sf"_mst)) | // f=f_x*f_y + f_x*s_x + f_y*s_y
  ------------------
  |  Branch (163:24): [True: 1.49k, False: 7.43k]
  |  Branch (163:48): [True: 483, False: 6.95k]
  |  Branch (163:67): [True: 26, False: 6.92k]
  ------------------
  164|  8.92k|            ((x | y) & "s"_mst) | // s=s_x+s_y
  165|  8.92k|            "ux"_mst | // u, x
  166|  8.92k|            ((x | y) & "ghij"_mst) | // g=g_x+g_y, h=h_x+h_y, i=i_x+i_y, j=j_x+j_y
  167|  8.92k|            "k"_mst.If(((x & y) << "k"_mst) &&
  ------------------
  |  Branch (167:24): [True: 8.46k, False: 461]
  ------------------
  168|  8.46k|                !(((x << "g"_mst) && (y << "h"_mst)) ||
  ------------------
  |  Branch (168:20): [True: 378, False: 8.08k]
  |  Branch (168:38): [True: 148, False: 230]
  ------------------
  169|  8.31k|                ((x << "h"_mst) && (y << "g"_mst)) ||
  ------------------
  |  Branch (169:18): [True: 659, False: 7.66k]
  |  Branch (169:36): [True: 76, False: 583]
  ------------------
  170|  8.24k|                ((x << "i"_mst) && (y << "j"_mst)) ||
  ------------------
  |  Branch (170:18): [True: 0, False: 8.24k]
  |  Branch (170:36): [True: 0, False: 0]
  ------------------
  171|  8.24k|                ((x << "j"_mst) && (y << "i"_mst)))); // k=k_x*k_y*!(g_x*h_y + h_x*g_y + i_x*j_y + j_x*i_y)
  ------------------
  |  Branch (171:18): [True: 543, False: 7.70k]
  |  Branch (171:36): [True: 0, False: 543]
  ------------------
  172|  7.62k|        case Fragment::OR_B: return
  ------------------
  |  Branch (172:9): [True: 7.62k, False: 495k]
  ------------------
  173|  7.62k|            "B"_mst.If(x << "Bd"_mst && y << "Wd"_mst) | // B=B_x*d_x*W_x*d_y
  ------------------
  |  Branch (173:24): [True: 7.62k, False: 0]
  |  Branch (173:41): [True: 7.62k, False: 0]
  ------------------
  174|  7.62k|            ((x | y) & "o"_mst).If((x | y) << "z"_mst) | // o=o_x*z_y+z_x*o_y
  175|  7.62k|            (x & y & "m"_mst).If((x | y) << "s"_mst && (x & y) << "e"_mst) | // m=m_x*m_y*e_x*e_y*(s_x+s_y)
  ------------------
  |  Branch (175:34): [True: 6.90k, False: 723]
  |  Branch (175:56): [True: 4.56k, False: 2.34k]
  ------------------
  176|  7.62k|            (x & y & "zse"_mst) | // z=z_x*z_y, s=s_x*s_y, e=e_x*e_y
  177|  7.62k|            "dux"_mst | // d, u, x
  178|  7.62k|            ((x | y) & "ghij"_mst) | // g=g_x+g_y, h=h_x+h_y, i=i_x+i_y, j=j_x+j_y
  179|  7.62k|            (x & y & "k"_mst); // k=k_x*k_y
  180|  11.6k|        case Fragment::OR_D: return
  ------------------
  |  Branch (180:9): [True: 11.6k, False: 491k]
  ------------------
  181|  11.6k|            (y & "B"_mst).If(x << "Bdu"_mst) | // B=B_y*B_x*d_x*u_x
  182|  11.6k|            (x & "o"_mst).If(y << "z"_mst) | // o=o_x*z_y
  183|  11.6k|            (x & y & "m"_mst).If(x << "e"_mst && (x | y) << "s"_mst) | // m=m_x*m_y*e_x*(s_x+s_y)
  ------------------
  |  Branch (183:34): [True: 9.81k, False: 1.79k]
  |  Branch (183:50): [True: 9.76k, False: 50]
  ------------------
  184|  11.6k|            (x & y & "zs"_mst) | // z=z_x*z_y, s=s_x*s_y
  185|  11.6k|            (y & "ufde"_mst) | // u=u_y, f=f_y, d=d_y, e=e_y
  186|  11.6k|            "x"_mst | // x
  187|  11.6k|            ((x | y) & "ghij"_mst) | // g=g_x+g_y, h=h_x+h_y, i=i_x+i_y, j=j_x+j_y
  188|  11.6k|            (x & y & "k"_mst); // k=k_x*k_y
  189|  8.16k|        case Fragment::OR_C: return
  ------------------
  |  Branch (189:9): [True: 8.16k, False: 494k]
  ------------------
  190|  8.16k|            (y & "V"_mst).If(x << "Bdu"_mst) | // V=V_y*B_x*u_x*d_x
  191|  8.16k|            (x & "o"_mst).If(y << "z"_mst) | // o=o_x*z_y
  192|  8.16k|            (x & y & "m"_mst).If(x << "e"_mst && (x | y) << "s"_mst) | // m=m_x*m_y*e_x*(s_x+s_y)
  ------------------
  |  Branch (192:34): [True: 7.03k, False: 1.13k]
  |  Branch (192:50): [True: 6.93k, False: 101]
  ------------------
  193|  8.16k|            (x & y & "zs"_mst) | // z=z_x*z_y, s=s_x*s_y
  194|  8.16k|            "fx"_mst | // f, x
  195|  8.16k|            ((x | y) & "ghij"_mst) | // g=g_x+g_y, h=h_x+h_y, i=i_x+i_y, j=j_x+j_y
  196|  8.16k|            (x & y & "k"_mst); // k=k_x*k_y
  197|  26.7k|        case Fragment::OR_I: return
  ------------------
  |  Branch (197:9): [True: 26.7k, False: 476k]
  ------------------
  198|  26.7k|            (x & y & "VBKufs"_mst) | // V=V_x*V_y, B=B_x*B_y, K=K_x*K_y, u=u_x*u_y, f=f_x*f_y, s=s_x*s_y
  199|  26.7k|            "o"_mst.If((x & y) << "z"_mst) | // o=z_x*z_y
  200|  26.7k|            ((x | y) & "e"_mst).If((x | y) << "f"_mst) | // e=e_x*f_y+f_x*e_y
  201|  26.7k|            (x & y & "m"_mst).If((x | y) << "s"_mst) | // m=m_x*m_y*(s_x+s_y)
  202|  26.7k|            ((x | y) & "d"_mst) | // d=d_x+d_y
  203|  26.7k|            "x"_mst | // x
  204|  26.7k|            ((x | y) & "ghij"_mst) | // g=g_x+g_y, h=h_x+h_y, i=i_x+i_y, j=j_x+j_y
  205|  26.7k|            (x & y & "k"_mst); // k=k_x*k_y
  206|  20.4k|        case Fragment::ANDOR: return
  ------------------
  |  Branch (206:9): [True: 20.4k, False: 482k]
  ------------------
  207|  20.4k|            (y & z & "BKV"_mst).If(x << "Bdu"_mst) | // B=B_x*d_x*u_x*B_y*B_z, K=B_x*d_x*u_x*K_y*K_z, V=B_x*d_x*u_x*V_y*V_z
  208|  20.4k|            (x & y & z & "z"_mst) | // z=z_x*z_y*z_z
  209|  20.4k|            ((x | (y & z)) & "o"_mst).If((x | (y & z)) << "z"_mst) | // o=o_x*z_y*z_z+z_x*o_y*o_z
  210|  20.4k|            (y & z & "u"_mst) | // u=u_y*u_z
  211|  20.4k|            (z & "f"_mst).If((x << "s"_mst) || (y << "f"_mst)) | // f=(s_x+f_y)*f_z
  ------------------
  |  Branch (211:30): [True: 16.0k, False: 4.39k]
  |  Branch (211:48): [True: 888, False: 3.50k]
  ------------------
  212|  20.4k|            (z & "d"_mst) | // d=d_z
  213|  20.4k|            (z & "e"_mst).If(x << "s"_mst || y << "f"_mst) | // e=e_z*(s_x+f_y)
  ------------------
  |  Branch (213:30): [True: 16.0k, False: 4.39k]
  |  Branch (213:46): [True: 888, False: 3.50k]
  ------------------
  214|  20.4k|            (x & y & z & "m"_mst).If(x << "e"_mst && (x | y | z) << "s"_mst) | // m=m_x*m_y*m_z*e_x*(s_x+s_y+s_z)
  ------------------
  |  Branch (214:38): [True: 16.2k, False: 4.27k]
  |  Branch (214:54): [True: 16.1k, False: 25]
  ------------------
  215|  20.4k|            (z & (x | y) & "s"_mst) | // s=s_z*(s_x+s_y)
  216|  20.4k|            "x"_mst | // x
  217|  20.4k|            ((x | y | z) & "ghij"_mst) | // g=g_x+g_y+g_z, h=h_x+h_y+h_z, i=i_x+i_y+i_z, j=j_x+j_y_j_z
  218|  20.4k|            "k"_mst.If(((x & y & z) << "k"_mst) &&
  ------------------
  |  Branch (218:24): [True: 20.0k, False: 398]
  ------------------
  219|  20.0k|                !(((x << "g"_mst) && (y << "h"_mst)) ||
  ------------------
  |  Branch (219:20): [True: 323, False: 19.7k]
  |  Branch (219:38): [True: 75, False: 248]
  ------------------
  220|  20.0k|                ((x << "h"_mst) && (y << "g"_mst)) ||
  ------------------
  |  Branch (220:18): [True: 424, False: 19.5k]
  |  Branch (220:36): [True: 77, False: 347]
  ------------------
  221|  19.9k|                ((x << "i"_mst) && (y << "j"_mst)) ||
  ------------------
  |  Branch (221:18): [True: 0, False: 19.9k]
  |  Branch (221:36): [True: 0, False: 0]
  ------------------
  222|  19.9k|                ((x << "j"_mst) && (y << "i"_mst)))); // k=k_x*k_y*k_z* !(g_x*h_y + h_x*g_y + i_x*j_y + j_x*i_y)
  ------------------
  |  Branch (222:18): [True: 430, False: 19.4k]
  |  Branch (222:36): [True: 0, False: 430]
  ------------------
  223|  14.1k|        case Fragment::MULTI: {
  ------------------
  |  Branch (223:9): [True: 14.1k, False: 488k]
  ------------------
  224|  14.1k|            return "Bnudemsk"_mst;
  225|      0|        }
  226|  3.16k|        case Fragment::MULTI_A: {
  ------------------
  |  Branch (226:9): [True: 3.16k, False: 499k]
  ------------------
  227|  3.16k|            return "Budemsk"_mst;
  228|      0|        }
  229|  18.8k|        case Fragment::THRESH: {
  ------------------
  |  Branch (229:9): [True: 18.8k, False: 483k]
  ------------------
  230|  18.8k|            bool all_e = true;
  231|  18.8k|            bool all_m = true;
  232|  18.8k|            uint32_t args = 0;
  233|  18.8k|            uint32_t num_s = 0;
  234|  18.8k|            Type acc_tl = "k"_mst;
  235|  85.3k|            for (size_t i = 0; i < sub_types.size(); ++i) {
  ------------------
  |  Branch (235:32): [True: 66.4k, False: 18.8k]
  ------------------
  236|  66.4k|                Type t = sub_types[i];
  237|  66.4k|                if (!(t << (i ? "Wdu"_mst : "Bdu"_mst))) return ""_mst; // Require Bdu, Wdu, Wdu, ...
  ------------------
  |  Branch (237:21): [True: 0, False: 66.4k]
  |  Branch (237:29): [True: 47.6k, False: 18.8k]
  ------------------
  238|  66.4k|                if (!(t << "e"_mst)) all_e = false;
  ------------------
  |  Branch (238:21): [True: 5.09k, False: 61.3k]
  ------------------
  239|  66.4k|                if (!(t << "m"_mst)) all_m = false;
  ------------------
  |  Branch (239:21): [True: 2.60k, False: 63.8k]
  ------------------
  240|  66.4k|                if (t << "s"_mst) num_s += 1;
  ------------------
  |  Branch (240:21): [True: 61.6k, False: 4.87k]
  ------------------
  241|  66.4k|                args += (t << "z"_mst) ? 0 : (t << "o"_mst) ? 1 : 2;
  ------------------
  |  Branch (241:25): [True: 10.8k, False: 55.6k]
  |  Branch (241:46): [True: 3.81k, False: 51.7k]
  ------------------
  242|  66.4k|                acc_tl = ((acc_tl | t) & "ghij"_mst) |
  243|       |                    // Thresh contains a combination of timelocks if it has threshold > 1 and
  244|       |                    // it contains two different children that have different types of timelocks
  245|       |                    // Note how if any of the children don't have "k", the parent also does not have "k"
  246|  66.4k|                    "k"_mst.If(((acc_tl & t) << "k"_mst) && ((k <= 1) ||
  ------------------
  |  Branch (246:32): [True: 65.6k, False: 794]
  |  Branch (246:62): [True: 35.9k, False: 29.7k]
  ------------------
  247|  29.7k|                        ((k > 1) && !(((acc_tl << "g"_mst) && (t << "h"_mst)) ||
  ------------------
  |  Branch (247:26): [True: 29.7k, False: 0]
  |  Branch (247:40): [True: 532, False: 29.2k]
  |  Branch (247:63): [True: 70, False: 462]
  ------------------
  248|  29.6k|                        ((acc_tl << "h"_mst) && (t << "g"_mst)) ||
  ------------------
  |  Branch (248:26): [True: 561, False: 29.1k]
  |  Branch (248:49): [True: 39, False: 522]
  ------------------
  249|  29.6k|                        ((acc_tl << "i"_mst) && (t << "j"_mst)) ||
  ------------------
  |  Branch (249:26): [True: 0, False: 29.6k]
  |  Branch (249:49): [True: 0, False: 0]
  ------------------
  250|  29.6k|                        ((acc_tl << "j"_mst) && (t << "i"_mst))))));
  ------------------
  |  Branch (250:26): [True: 1.20k, False: 28.4k]
  |  Branch (250:49): [True: 0, False: 1.20k]
  ------------------
  251|  66.4k|            }
  252|  18.8k|            return "Bdu"_mst |
  253|  18.8k|                   "z"_mst.If(args == 0) | // z=all z
  254|  18.8k|                   "o"_mst.If(args == 1) | // o=all z except one o
  255|  18.8k|                   "e"_mst.If(all_e && num_s == n_subs) | // e=all e and all s
  ------------------
  |  Branch (255:31): [True: 15.8k, False: 3.04k]
  |  Branch (255:40): [True: 15.3k, False: 422]
  ------------------
  256|  18.8k|                   "m"_mst.If(all_e && all_m && num_s >= n_subs - k) | // m=all e, >=(n-k) s
  ------------------
  |  Branch (256:31): [True: 15.8k, False: 3.04k]
  |  Branch (256:40): [True: 15.2k, False: 533]
  |  Branch (256:49): [True: 15.2k, False: 5]
  ------------------
  257|  18.8k|                   "s"_mst.If(num_s >= n_subs - k + 1) |  // s= >=(n-k+1) s
  258|  18.8k|                   acc_tl; // timelock info
  259|  18.8k|            }
  260|   502k|    }
  261|   502k|    assert(false);
  ------------------
  |  Branch (261:5): [Folded, False: 0]
  ------------------
  262|      0|}
_ZN10miniscript8internal16ComputeScriptLenENS_8FragmentENS_4TypeEmjmmNS_17MiniscriptContextE:
  265|   708k|                        size_t n_keys, MiniscriptContext ms_ctx) {
  266|   708k|    switch (fragment) {
  ------------------
  |  Branch (266:13): [True: 708k, False: 0]
  ------------------
  267|  16.7k|        case Fragment::JUST_1:
  ------------------
  |  Branch (267:9): [True: 16.7k, False: 691k]
  ------------------
  268|   192k|        case Fragment::JUST_0: return 1;
  ------------------
  |  Branch (268:9): [True: 175k, False: 532k]
  ------------------
  269|  33.2k|        case Fragment::PK_K: return IsTapscript(ms_ctx) ? 33 : 34;
  ------------------
  |  Branch (269:9): [True: 33.2k, False: 674k]
  |  Branch (269:37): [True: 11.8k, False: 21.3k]
  ------------------
  270|  8.04k|        case Fragment::PK_H: return 3 + 21;
  ------------------
  |  Branch (270:9): [True: 8.04k, False: 700k]
  ------------------
  271|  6.52k|        case Fragment::OLDER:
  ------------------
  |  Branch (271:9): [True: 6.52k, False: 701k]
  ------------------
  272|  11.8k|        case Fragment::AFTER: return 1 + BuildScript(k).size();
  ------------------
  |  Branch (272:9): [True: 5.30k, False: 702k]
  ------------------
  273|  6.45k|        case Fragment::HASH256:
  ------------------
  |  Branch (273:9): [True: 6.45k, False: 701k]
  ------------------
  274|  14.0k|        case Fragment::SHA256: return 4 + 2 + 33;
  ------------------
  |  Branch (274:9): [True: 7.54k, False: 700k]
  ------------------
  275|  4.98k|        case Fragment::HASH160:
  ------------------
  |  Branch (275:9): [True: 4.98k, False: 703k]
  ------------------
  276|  9.63k|        case Fragment::RIPEMD160: return 4 + 2 + 21;
  ------------------
  |  Branch (276:9): [True: 4.64k, False: 703k]
  ------------------
  277|  19.0k|        case Fragment::MULTI: return 1 + BuildScript(n_keys).size() + BuildScript(k).size() + 34 * n_keys;
  ------------------
  |  Branch (277:9): [True: 19.0k, False: 689k]
  ------------------
  278|  4.34k|        case Fragment::MULTI_A: return (1 + 32 + 1) * n_keys + BuildScript(k).size() + 1;
  ------------------
  |  Branch (278:9): [True: 4.34k, False: 703k]
  ------------------
  279|  64.1k|        case Fragment::AND_V: return subsize;
  ------------------
  |  Branch (279:9): [True: 64.1k, False: 643k]
  ------------------
  280|  66.2k|        case Fragment::WRAP_V: return subsize + (sub0typ << "x"_mst);
  ------------------
  |  Branch (280:9): [True: 66.2k, False: 641k]
  ------------------
  281|  5.31k|        case Fragment::WRAP_S:
  ------------------
  |  Branch (281:9): [True: 5.31k, False: 702k]
  ------------------
  282|  25.9k|        case Fragment::WRAP_C:
  ------------------
  |  Branch (282:9): [True: 20.6k, False: 687k]
  ------------------
  283|  39.0k|        case Fragment::WRAP_N:
  ------------------
  |  Branch (283:9): [True: 13.1k, False: 694k]
  ------------------
  284|  51.1k|        case Fragment::AND_B:
  ------------------
  |  Branch (284:9): [True: 12.1k, False: 696k]
  ------------------
  285|  61.7k|        case Fragment::OR_B: return subsize + 1;
  ------------------
  |  Branch (285:9): [True: 10.6k, False: 697k]
  ------------------
  286|  94.7k|        case Fragment::WRAP_A:
  ------------------
  |  Branch (286:9): [True: 94.7k, False: 613k]
  ------------------
  287|   105k|        case Fragment::OR_C: return subsize + 2;
  ------------------
  |  Branch (287:9): [True: 11.1k, False: 696k]
  ------------------
  288|  2.43k|        case Fragment::WRAP_D:
  ------------------
  |  Branch (288:9): [True: 2.43k, False: 705k]
  ------------------
  289|  18.5k|        case Fragment::OR_D:
  ------------------
  |  Branch (289:9): [True: 16.1k, False: 692k]
  ------------------
  290|  55.3k|        case Fragment::OR_I:
  ------------------
  |  Branch (290:9): [True: 36.8k, False: 671k]
  ------------------
  291|  83.8k|        case Fragment::ANDOR: return subsize + 3;
  ------------------
  |  Branch (291:9): [True: 28.4k, False: 679k]
  ------------------
  292|  6.92k|        case Fragment::WRAP_J: return subsize + 4;
  ------------------
  |  Branch (292:9): [True: 6.92k, False: 701k]
  ------------------
  293|  26.3k|        case Fragment::THRESH: return subsize + n_subs + BuildScript(k).size();
  ------------------
  |  Branch (293:9): [True: 26.3k, False: 681k]
  ------------------
  294|   708k|    }
  295|   708k|    assert(false);
  ------------------
  |  Branch (295:5): [Folded, False: 0]
  ------------------
  296|      0|}
_ZN10miniscript8internal10InputStack12SetAvailableENS_12AvailabilityE:
  298|  4.42M|InputStack& InputStack::SetAvailable(Availability avail) {
  299|  4.42M|    available = avail;
  300|  4.42M|    if (avail == Availability::NO) {
  ------------------
  |  Branch (300:9): [True: 4.38M, False: 43.2k]
  ------------------
  301|  4.38M|        stack.clear();
  302|  4.38M|        size = std::numeric_limits<size_t>::max();
  303|  4.38M|        has_sig = false;
  304|  4.38M|        malleable = false;
  305|  4.38M|        non_canon = false;
  306|  4.38M|    }
  307|  4.42M|    return *this;
  308|  4.42M|}
_ZN10miniscript8internal10InputStack10SetWithSigEv:
  310|   111k|InputStack& InputStack::SetWithSig() {
  311|   111k|    has_sig = true;
  312|   111k|    return *this;
  313|   111k|}
_ZN10miniscript8internal10InputStack11SetNonCanonEv:
  315|  81.2k|InputStack& InputStack::SetNonCanon() {
  316|  81.2k|    non_canon = true;
  317|  81.2k|    return *this;
  318|  81.2k|}
_ZN10miniscript8internal10InputStack12SetMalleableEb:
  320|  48.0k|InputStack& InputStack::SetMalleable(bool x) {
  321|  48.0k|    malleable = x;
  322|  48.0k|    return *this;
  323|  48.0k|}
_ZN10miniscript8internalplENS0_10InputStackES1_:
  325|  5.13M|InputStack operator+(InputStack a, InputStack b) {
  326|  5.13M|    a.stack = Cat(std::move(a.stack), std::move(b.stack));
  327|  5.13M|    if (a.available != Availability::NO && b.available != Availability::NO) a.size += b.size;
  ------------------
  |  Branch (327:9): [True: 1.06M, False: 4.06M]
  |  Branch (327:44): [True: 824k, False: 243k]
  ------------------
  328|  5.13M|    a.has_sig |= b.has_sig;
  329|  5.13M|    a.malleable |= b.malleable;
  330|  5.13M|    a.non_canon |= b.non_canon;
  331|  5.13M|    if (a.available == Availability::NO || b.available == Availability::NO) {
  ------------------
  |  Branch (331:9): [True: 4.06M, False: 1.06M]
  |  Branch (331:44): [True: 243k, False: 824k]
  ------------------
  332|  4.30M|        a.SetAvailable(Availability::NO);
  333|  4.30M|    } else if (a.available == Availability::MAYBE || b.available == Availability::MAYBE) {
  ------------------
  |  Branch (333:16): [True: 0, False: 824k]
  |  Branch (333:54): [True: 0, False: 824k]
  ------------------
  334|      0|        a.SetAvailable(Availability::MAYBE);
  335|      0|    }
  336|  5.13M|    return a;
  337|  5.13M|}
_ZN10miniscript8internalorENS0_10InputStackES1_:
  339|  2.60M|InputStack operator|(InputStack a, InputStack b) {
  340|       |    // If only one is invalid, pick the other one. If both are invalid, pick an arbitrary one.
  341|  2.60M|    if (a.available == Availability::NO) return b;
  ------------------
  |  Branch (341:9): [True: 2.11M, False: 481k]
  ------------------
  342|   481k|    if (b.available == Availability::NO) return a;
  ------------------
  |  Branch (342:9): [True: 165k, False: 316k]
  ------------------
  343|       |    // If only one of the solutions has a signature, we must pick the other one.
  344|   316k|    if (!a.has_sig && b.has_sig) return a;
  ------------------
  |  Branch (344:9): [True: 25.4k, False: 291k]
  |  Branch (344:23): [True: 1.25k, False: 24.1k]
  ------------------
  345|   315k|    if (!b.has_sig && a.has_sig) return b;
  ------------------
  |  Branch (345:9): [True: 26.6k, False: 288k]
  |  Branch (345:23): [True: 2.53k, False: 24.1k]
  ------------------
  346|   312k|    if (!a.has_sig && !b.has_sig) {
  ------------------
  |  Branch (346:9): [True: 24.1k, False: 288k]
  |  Branch (346:23): [True: 24.1k, False: 0]
  ------------------
  347|       |        // If neither solution requires a signature, the result is inevitably malleable.
  348|  24.1k|        a.malleable = true;
  349|  24.1k|        b.malleable = true;
  350|   288k|    } else {
  351|       |        // If both options require a signature, prefer the non-malleable one.
  352|   288k|        if (b.malleable && !a.malleable) return a;
  ------------------
  |  Branch (352:13): [True: 932, False: 287k]
  |  Branch (352:28): [True: 366, False: 566]
  ------------------
  353|   288k|        if (a.malleable && !b.malleable) return b;
  ------------------
  |  Branch (353:13): [True: 822, False: 287k]
  |  Branch (353:28): [True: 256, False: 566]
  ------------------
  354|   288k|    }
  355|       |    // Between two malleable or two non-malleable solutions, pick the smaller one between
  356|       |    // YESes, and the bigger ones between MAYBEs. Prefer YES over MAYBE.
  357|   312k|    if (a.available == Availability::YES && b.available == Availability::YES) {
  ------------------
  |  Branch (357:9): [True: 312k, False: 0]
  |  Branch (357:45): [True: 312k, False: 0]
  ------------------
  358|   312k|        return std::move(a.size <= b.size ? a : b);
  ------------------
  |  Branch (358:26): [True: 299k, False: 13.1k]
  ------------------
  359|   312k|    } else if (a.available == Availability::MAYBE && b.available == Availability::MAYBE) {
  ------------------
  |  Branch (359:16): [True: 0, False: 0]
  |  Branch (359:54): [True: 0, False: 0]
  ------------------
  360|      0|        return std::move(a.size >= b.size ? a : b);
  ------------------
  |  Branch (360:26): [True: 0, False: 0]
  ------------------
  361|      0|    } else if (a.available == Availability::YES) {
  ------------------
  |  Branch (361:16): [True: 0, False: 0]
  ------------------
  362|      0|        return a;
  363|      0|    } else {
  364|      0|        return b;
  365|      0|    }
  366|   312k|}
_ZN10miniscript8internal15DecomposeScriptERK7CScript:
  369|  4.18k|{
  370|  4.18k|    std::vector<Opcode> out;
  371|  4.18k|    CScript::const_iterator it = script.begin(), itend = script.end();
  372|   330k|    while (it != itend) {
  ------------------
  |  Branch (372:12): [True: 326k, False: 4.18k]
  ------------------
  373|   326k|        std::vector<unsigned char> push_data;
  374|   326k|        opcodetype opcode;
  375|   326k|        if (!script.GetOp(it, opcode, push_data)) {
  ------------------
  |  Branch (375:13): [True: 0, False: 326k]
  ------------------
  376|      0|            return {};
  377|   326k|        } else if (opcode >= OP_1 && opcode <= OP_16) {
  ------------------
  |  Branch (377:20): [True: 221k, False: 105k]
  |  Branch (377:38): [True: 19.2k, False: 201k]
  ------------------
  378|       |            // Deal with OP_n (GetOp does not turn them into pushes).
  379|  19.2k|            push_data.assign(1, CScript::DecodeOP_N(opcode));
  380|   307k|        } else if (opcode == OP_CHECKSIGVERIFY) {
  ------------------
  |  Branch (380:20): [True: 1.36k, False: 306k]
  ------------------
  381|       |            // Decompose OP_CHECKSIGVERIFY into OP_CHECKSIG OP_VERIFY
  382|  1.36k|            out.emplace_back(OP_CHECKSIG, std::vector<unsigned char>());
  383|  1.36k|            opcode = OP_VERIFY;
  384|   306k|        } else if (opcode == OP_CHECKMULTISIGVERIFY) {
  ------------------
  |  Branch (384:20): [True: 1.23k, False: 304k]
  ------------------
  385|       |            // Decompose OP_CHECKMULTISIGVERIFY into OP_CHECKMULTISIG OP_VERIFY
  386|  1.23k|            out.emplace_back(OP_CHECKMULTISIG, std::vector<unsigned char>());
  387|  1.23k|            opcode = OP_VERIFY;
  388|   304k|        } else if (opcode == OP_EQUALVERIFY) {
  ------------------
  |  Branch (388:20): [True: 9.76k, False: 295k]
  ------------------
  389|       |            // Decompose OP_EQUALVERIFY into OP_EQUAL OP_VERIFY
  390|  9.76k|            out.emplace_back(OP_EQUAL, std::vector<unsigned char>());
  391|  9.76k|            opcode = OP_VERIFY;
  392|   295k|        } else if (opcode == OP_NUMEQUALVERIFY) {
  ------------------
  |  Branch (392:20): [True: 357, False: 294k]
  ------------------
  393|       |            // Decompose OP_NUMEQUALVERIFY into OP_NUMEQUAL OP_VERIFY
  394|    357|            out.emplace_back(OP_NUMEQUAL, std::vector<unsigned char>());
  395|    357|            opcode = OP_VERIFY;
  396|   294k|        } else if (IsPushdataOp(opcode)) {
  ------------------
  |  Branch (396:20): [True: 69.5k, False: 225k]
  ------------------
  397|  69.5k|            if (!CheckMinimalPush(push_data, opcode)) return {};
  ------------------
  |  Branch (397:17): [True: 0, False: 69.5k]
  ------------------
  398|   225k|        } else if (it != itend && (opcode == OP_CHECKSIG || opcode == OP_CHECKMULTISIG || opcode == OP_EQUAL || opcode == OP_NUMEQUAL) && (*it == OP_VERIFY)) {
  ------------------
  |  Branch (398:20): [True: 220k, False: 4.15k]
  |  Branch (398:36): [True: 4.09k, False: 216k]
  |  Branch (398:61): [True: 3.12k, False: 213k]
  |  Branch (398:91): [True: 7.90k, False: 205k]
  |  Branch (398:113): [True: 454, False: 205k]
  |  Branch (398:139): [True: 0, False: 15.5k]
  ------------------
  399|       |            // Rule out non minimal VERIFY sequences
  400|      0|            return {};
  401|      0|        }
  402|   326k|        out.emplace_back(opcode, std::move(push_data));
  403|   326k|    }
  404|  4.18k|    std::reverse(out.begin(), out.end());
  405|  4.18k|    return out;
  406|  4.18k|}
_ZN10miniscript8internal17ParseScriptNumberERKNSt3__14pairI10opcodetypeNS1_6vectorIhNS1_9allocatorIhEEEEEE:
  408|  25.6k|std::optional<int64_t> ParseScriptNumber(const Opcode& in) {
  409|  25.6k|    if (in.first == OP_0) {
  ------------------
  |  Branch (409:9): [True: 0, False: 25.6k]
  ------------------
  410|      0|        return 0;
  411|      0|    }
  412|  25.6k|    if (!in.second.empty()) {
  ------------------
  |  Branch (412:9): [True: 25.6k, False: 0]
  ------------------
  413|  25.6k|        if (IsPushdataOp(in.first) && !CheckMinimalPush(in.second, in.first)) return {};
  ------------------
  |  Branch (413:13): [True: 8.73k, False: 16.8k]
  |  Branch (413:39): [True: 0, False: 8.73k]
  ------------------
  414|  25.6k|        try {
  415|  25.6k|            return CScriptNum(in.second, true).GetInt64();
  416|  25.6k|        } catch(const scriptnum_error&) {}
  417|  25.6k|    }
  418|     43|    return {};
  419|  25.6k|}
_ZN10miniscript8internal12FindNextCharENSt3__14spanIKcLm18446744073709551615EEEc:
  422|  68.4k|{
  423|   194k|    for (int i = 0; i < (int)sp.size(); ++i) {
  ------------------
  |  Branch (423:21): [True: 194k, False: 0]
  ------------------
  424|   194k|        if (sp[i] == m) return i;
  ------------------
  |  Branch (424:13): [True: 62.6k, False: 131k]
  ------------------
  425|       |        // We only search within the current parentheses
  426|   131k|        if (sp[i] == ')') break;
  ------------------
  |  Branch (426:13): [True: 5.81k, False: 125k]
  ------------------
  427|   131k|    }
  428|  5.81k|    return -1;
  429|  68.4k|}

_ZNK10miniscript4TypeltES0_:
  151|  1.21M|    constexpr bool operator<(Type x) const { return m_flags < x.m_flags; }
miniscript.cpp:_ZNK10miniscript4NodeI7CPubKeyE8ToScriptIN12_GLOBAL__N_113ParserContextEEE7CScriptRKT_:
  799|  8.94k|    {
  800|       |        // To construct the CScript for a Miniscript object, we use the TreeEval algorithm.
  801|       |        // The State is a boolean: whether or not the node's script expansion is followed
  802|       |        // by an OP_VERIFY (which may need to be combined with the last script opcode).
  803|  8.94k|        auto downfn = [](bool verify, const Node& node, size_t index) {
  804|       |            // For WRAP_V, the subexpression is certainly followed by OP_VERIFY.
  805|  8.94k|            if (node.fragment == Fragment::WRAP_V) return true;
  806|       |            // The subexpression of WRAP_S, and the last subexpression of AND_V
  807|       |            // inherit the followed-by-OP_VERIFY property from the parent.
  808|  8.94k|            if (node.fragment == Fragment::WRAP_S ||
  809|  8.94k|                (node.fragment == Fragment::AND_V && index == 1)) return verify;
  810|  8.94k|            return false;
  811|  8.94k|        };
  812|       |        // The upward function computes for a node, given its followed-by-OP_VERIFY status
  813|       |        // and the CScripts of its child nodes, the CScript of the node.
  814|  8.94k|        const bool is_tapscript{IsTapscript(m_script_ctx)};
  815|  8.94k|        auto upfn = [&ctx, is_tapscript](bool verify, const Node& node, std::span<CScript> subs) -> CScript {
  816|  8.94k|            switch (node.fragment) {
  817|  8.94k|                case Fragment::PK_K: return BuildScript(ctx.ToPKBytes(node.keys[0]));
  818|  8.94k|                case Fragment::PK_H: return BuildScript(OP_DUP, OP_HASH160, ctx.ToPKHBytes(node.keys[0]), OP_EQUALVERIFY);
  819|  8.94k|                case Fragment::OLDER: return BuildScript(node.k, OP_CHECKSEQUENCEVERIFY);
  820|  8.94k|                case Fragment::AFTER: return BuildScript(node.k, OP_CHECKLOCKTIMEVERIFY);
  821|  8.94k|                case Fragment::SHA256: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_SHA256, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  822|  8.94k|                case Fragment::RIPEMD160: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_RIPEMD160, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  823|  8.94k|                case Fragment::HASH256: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_HASH256, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  824|  8.94k|                case Fragment::HASH160: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_HASH160, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  825|  8.94k|                case Fragment::WRAP_A: return BuildScript(OP_TOALTSTACK, subs[0], OP_FROMALTSTACK);
  826|  8.94k|                case Fragment::WRAP_S: return BuildScript(OP_SWAP, subs[0]);
  827|  8.94k|                case Fragment::WRAP_C: return BuildScript(std::move(subs[0]), verify ? OP_CHECKSIGVERIFY : OP_CHECKSIG);
  828|  8.94k|                case Fragment::WRAP_D: return BuildScript(OP_DUP, OP_IF, subs[0], OP_ENDIF);
  829|  8.94k|                case Fragment::WRAP_V: {
  830|  8.94k|                    if (node.subs[0].GetType() << "x"_mst) {
  831|  8.94k|                        return BuildScript(std::move(subs[0]), OP_VERIFY);
  832|  8.94k|                    } else {
  833|  8.94k|                        return std::move(subs[0]);
  834|  8.94k|                    }
  835|  8.94k|                }
  836|  8.94k|                case Fragment::WRAP_J: return BuildScript(OP_SIZE, OP_0NOTEQUAL, OP_IF, subs[0], OP_ENDIF);
  837|  8.94k|                case Fragment::WRAP_N: return BuildScript(std::move(subs[0]), OP_0NOTEQUAL);
  838|  8.94k|                case Fragment::JUST_1: return BuildScript(OP_1);
  839|  8.94k|                case Fragment::JUST_0: return BuildScript(OP_0);
  840|  8.94k|                case Fragment::AND_V: return BuildScript(std::move(subs[0]), subs[1]);
  841|  8.94k|                case Fragment::AND_B: return BuildScript(std::move(subs[0]), subs[1], OP_BOOLAND);
  842|  8.94k|                case Fragment::OR_B: return BuildScript(std::move(subs[0]), subs[1], OP_BOOLOR);
  843|  8.94k|                case Fragment::OR_D: return BuildScript(std::move(subs[0]), OP_IFDUP, OP_NOTIF, subs[1], OP_ENDIF);
  844|  8.94k|                case Fragment::OR_C: return BuildScript(std::move(subs[0]), OP_NOTIF, subs[1], OP_ENDIF);
  845|  8.94k|                case Fragment::OR_I: return BuildScript(OP_IF, subs[0], OP_ELSE, subs[1], OP_ENDIF);
  846|  8.94k|                case Fragment::ANDOR: return BuildScript(std::move(subs[0]), OP_NOTIF, subs[2], OP_ELSE, subs[1], OP_ENDIF);
  847|  8.94k|                case Fragment::MULTI: {
  848|  8.94k|                    CHECK_NONFATAL(!is_tapscript);
  849|  8.94k|                    CScript script = BuildScript(node.k);
  850|  8.94k|                    for (const auto& key : node.keys) {
  851|  8.94k|                        script = BuildScript(std::move(script), ctx.ToPKBytes(key));
  852|  8.94k|                    }
  853|  8.94k|                    return BuildScript(std::move(script), node.keys.size(), verify ? OP_CHECKMULTISIGVERIFY : OP_CHECKMULTISIG);
  854|  8.94k|                }
  855|  8.94k|                case Fragment::MULTI_A: {
  856|  8.94k|                    CHECK_NONFATAL(is_tapscript);
  857|  8.94k|                    CScript script = BuildScript(ctx.ToPKBytes(*node.keys.begin()), OP_CHECKSIG);
  858|  8.94k|                    for (auto it = node.keys.begin() + 1; it != node.keys.end(); ++it) {
  859|  8.94k|                        script = BuildScript(std::move(script), ctx.ToPKBytes(*it), OP_CHECKSIGADD);
  860|  8.94k|                    }
  861|  8.94k|                    return BuildScript(std::move(script), node.k, verify ? OP_NUMEQUALVERIFY : OP_NUMEQUAL);
  862|  8.94k|                }
  863|  8.94k|                case Fragment::THRESH: {
  864|  8.94k|                    CScript script = std::move(subs[0]);
  865|  8.94k|                    for (size_t i = 1; i < subs.size(); ++i) {
  866|  8.94k|                        script = BuildScript(std::move(script), subs[i], OP_ADD);
  867|  8.94k|                    }
  868|  8.94k|                    return BuildScript(std::move(script), node.k, verify ? OP_EQUALVERIFY : OP_EQUAL);
  869|  8.94k|                }
  870|  8.94k|            }
  871|  8.94k|            assert(false);
  872|  8.94k|        };
  873|  8.94k|        return TreeEval<CScript>(false, downfn, upfn);
  874|  8.94k|    }
miniscript.cpp:_ZNK10miniscript4NodeI7CPubKeyE8TreeEvalI7CScriptbRZNKS2_8ToScriptIN12_GLOBAL__N_113ParserContextEEES4_RKT_EUlbRKS2_mE_ZNKS5_IS7_EES4_SA_EUlbSC_NSt3__14spanIS4_Lm18446744073709551615EEEE_EES8_T0_OT1_T2_:
  732|  8.94k|    {
  733|       |        // Invoke TreeEvalMaybe with upfn wrapped to return std::optional<Result>, and then
  734|       |        // unconditionally dereference the result (it cannot be std::nullopt).
  735|  8.94k|        return std::move(*TreeEvalMaybe<Result>(std::move(root_state),
  736|  8.94k|            std::forward<DownFn>(downfn),
  737|  8.94k|            [&upfn](State&& state, const Node& node, std::span<Result> subs) {
  738|  8.94k|                Result res{upfn(std::move(state), node, subs)};
  739|  8.94k|                return std::optional<Result>(std::move(res));
  740|  8.94k|            }
  741|  8.94k|        ));
  742|  8.94k|    }
miniscript.cpp:_ZNK10miniscript4NodeI7CPubKeyE13TreeEvalMaybeI7CScriptbZNKS2_8ToScriptIN12_GLOBAL__N_113ParserContextEEES4_RKT_EUlbRKS2_mE_ZNKS2_8TreeEvalIS4_bRSD_ZNKS5_IS7_EES4_SA_EUlbSC_NSt3__14spanIS4_Lm18446744073709551615EEEE_EES8_T0_OT1_T2_EUlObSC_SI_E_EENSG_8optionalIS8_EESK_SL_SN_:
  653|  8.94k|    {
  654|       |        /** Entries of the explicit stack tracked in this algorithm. */
  655|  8.94k|        struct StackElem
  656|  8.94k|        {
  657|  8.94k|            const Node& node; //!< The node being evaluated.
  658|  8.94k|            size_t expanded; //!< How many children of this node have been expanded.
  659|  8.94k|            State state; //!< The state for that node.
  660|       |
  661|  8.94k|            StackElem(const Node& node_, size_t exp_, State&& state_) :
  662|  8.94k|                node(node_), expanded(exp_), state(std::move(state_)) {}
  663|  8.94k|        };
  664|       |        /* Stack of tree nodes being explored. */
  665|  8.94k|        std::vector<StackElem> stack;
  666|       |        /* Results of subtrees so far. Their order and mapping to tree nodes
  667|       |         * is implicitly defined by stack. */
  668|  8.94k|        std::vector<Result> results;
  669|  8.94k|        stack.emplace_back(*this, 0, std::move(root_state));
  670|       |
  671|       |        /* Here is a demonstration of the algorithm, for an example tree A(B,C(D,E),F).
  672|       |         * State variables are omitted for simplicity.
  673|       |         *
  674|       |         * First: stack=[(A,0)] results=[]
  675|       |         *        stack=[(A,1),(B,0)] results=[]
  676|       |         *        stack=[(A,1)] results=[B]
  677|       |         *        stack=[(A,2),(C,0)] results=[B]
  678|       |         *        stack=[(A,2),(C,1),(D,0)] results=[B]
  679|       |         *        stack=[(A,2),(C,1)] results=[B,D]
  680|       |         *        stack=[(A,2),(C,2),(E,0)] results=[B,D]
  681|       |         *        stack=[(A,2),(C,2)] results=[B,D,E]
  682|       |         *        stack=[(A,2)] results=[B,C]
  683|       |         *        stack=[(A,3),(F,0)] results=[B,C]
  684|       |         *        stack=[(A,3)] results=[B,C,F]
  685|       |         * Final: stack=[] results=[A]
  686|       |         */
  687|   627k|        while (stack.size()) {
  ------------------
  |  Branch (687:16): [True: 618k, False: 8.94k]
  ------------------
  688|   618k|            const Node& node = stack.back().node;
  689|   618k|            if (stack.back().expanded < node.subs.size()) {
  ------------------
  |  Branch (689:17): [True: 305k, False: 313k]
  ------------------
  690|       |                /* We encounter a tree node with at least one unexpanded child.
  691|       |                 * Expand it. By the time we hit this node again, the result of
  692|       |                 * that child (and all earlier children) will be at the end of `results`. */
  693|   305k|                size_t child_index = stack.back().expanded++;
  694|   305k|                State child_state = downfn(stack.back().state, node, child_index);
  695|   305k|                stack.emplace_back(node.subs[child_index], 0, std::move(child_state));
  696|   305k|                continue;
  697|   305k|            }
  698|       |            // Invoke upfn with the last node.subs.size() elements of results as input.
  699|   618k|            assert(results.size() >= node.subs.size());
  ------------------
  |  Branch (699:13): [True: 313k, False: 0]
  ------------------
  700|   313k|            std::optional<Result> result{upfn(std::move(stack.back().state), node,
  701|   313k|                std::span<Result>{results}.last(node.subs.size()))};
  702|       |            // If evaluation returns std::nullopt, abort immediately.
  703|   313k|            if (!result) return {};
  ------------------
  |  Branch (703:17): [True: 0, False: 313k]
  ------------------
  704|       |            // Replace the last node.subs.size() elements of results with the new result.
  705|   313k|            results.erase(results.end() - node.subs.size(), results.end());
  706|   313k|            results.push_back(std::move(*result));
  707|   313k|            stack.pop_back();
  708|   313k|        }
  709|       |        // The final remaining results element is the root result, return it.
  710|  8.94k|        assert(results.size() >= 1);
  ------------------
  |  Branch (710:9): [True: 8.94k, False: 0]
  ------------------
  711|  8.94k|        CHECK_NONFATAL(results.size() == 1);
  ------------------
  |  |  113|  8.94k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  712|  8.94k|        return std::move(results[0]);
  713|  8.94k|    }
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE13TreeEvalMaybeI7CScriptbZNKS2_8ToScriptIN12_GLOBAL__N_113ParserContextEEES4_RKT_EUlbRKS2_mE_ZNKS2_8TreeEvalIS4_bRSD_ZNKS5_IS7_EES4_SA_EUlbSC_NSt3__14spanIS4_Lm18446744073709551615EEEE_EES8_T0_OT1_T2_EUlObSC_SI_E_EENSG_8optionalIS8_EESK_SL_SN_EN9StackElemC2ESC_mSO_:
  662|   313k|                node(node_), expanded(exp_), state(std::move(state_)) {}
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE8ToScriptIN12_GLOBAL__N_113ParserContextEEE7CScriptRKT_ENKUlbRKS2_mE_clEbSB_m:
  803|   305k|        auto downfn = [](bool verify, const Node& node, size_t index) {
  804|       |            // For WRAP_V, the subexpression is certainly followed by OP_VERIFY.
  805|   305k|            if (node.fragment == Fragment::WRAP_V) return true;
  ------------------
  |  Branch (805:17): [True: 29.1k, False: 275k]
  ------------------
  806|       |            // The subexpression of WRAP_S, and the last subexpression of AND_V
  807|       |            // inherit the followed-by-OP_VERIFY property from the parent.
  808|   275k|            if (node.fragment == Fragment::WRAP_S ||
  ------------------
  |  Branch (808:17): [True: 2.53k, False: 273k]
  ------------------
  809|   273k|                (node.fragment == Fragment::AND_V && index == 1)) return verify;
  ------------------
  |  Branch (809:18): [True: 49.9k, False: 223k]
  |  Branch (809:54): [True: 24.9k, False: 24.9k]
  ------------------
  810|   248k|            return false;
  811|   275k|        };
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE8TreeEvalI7CScriptbRZNKS2_8ToScriptIN12_GLOBAL__N_113ParserContextEEES4_RKT_EUlbRKS2_mE_ZNKS5_IS7_EES4_SA_EUlbSC_NSt3__14spanIS4_Lm18446744073709551615EEEE_EES8_T0_OT1_T2_ENKUlObSC_SH_E_clESN_SC_SH_:
  737|   313k|            [&upfn](State&& state, const Node& node, std::span<Result> subs) {
  738|   313k|                Result res{upfn(std::move(state), node, subs)};
  739|   313k|                return std::optional<Result>(std::move(res));
  740|   313k|            }
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE8ToScriptIN12_GLOBAL__N_113ParserContextEEE7CScriptRKT_ENKUlbRKS2_NSt3__14spanIS6_Lm18446744073709551615EEEE_clEbSB_SE_:
  815|   313k|        auto upfn = [&ctx, is_tapscript](bool verify, const Node& node, std::span<CScript> subs) -> CScript {
  816|   313k|            switch (node.fragment) {
  ------------------
  |  Branch (816:21): [True: 313k, False: 0]
  ------------------
  817|  15.4k|                case Fragment::PK_K: return BuildScript(ctx.ToPKBytes(node.keys[0]));
  ------------------
  |  Branch (817:17): [True: 15.4k, False: 298k]
  ------------------
  818|  3.80k|                case Fragment::PK_H: return BuildScript(OP_DUP, OP_HASH160, ctx.ToPKHBytes(node.keys[0]), OP_EQUALVERIFY);
  ------------------
  |  Branch (818:17): [True: 3.80k, False: 310k]
  ------------------
  819|  3.14k|                case Fragment::OLDER: return BuildScript(node.k, OP_CHECKSEQUENCEVERIFY);
  ------------------
  |  Branch (819:17): [True: 3.14k, False: 310k]
  ------------------
  820|  2.58k|                case Fragment::AFTER: return BuildScript(node.k, OP_CHECKLOCKTIMEVERIFY);
  ------------------
  |  Branch (820:17): [True: 2.58k, False: 311k]
  ------------------
  821|  3.48k|                case Fragment::SHA256: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_SHA256, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  ------------------
  |  Branch (821:17): [True: 3.48k, False: 310k]
  |  Branch (821:110): [True: 1.04k, False: 2.43k]
  ------------------
  822|  2.20k|                case Fragment::RIPEMD160: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_RIPEMD160, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  ------------------
  |  Branch (822:17): [True: 2.20k, False: 311k]
  |  Branch (822:116): [True: 126, False: 2.08k]
  ------------------
  823|  3.09k|                case Fragment::HASH256: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_HASH256, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  ------------------
  |  Branch (823:17): [True: 3.09k, False: 310k]
  |  Branch (823:112): [True: 881, False: 2.21k]
  ------------------
  824|  2.39k|                case Fragment::HASH160: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_HASH160, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  ------------------
  |  Branch (824:17): [True: 2.39k, False: 311k]
  |  Branch (824:112): [True: 276, False: 2.12k]
  ------------------
  825|  38.9k|                case Fragment::WRAP_A: return BuildScript(OP_TOALTSTACK, subs[0], OP_FROMALTSTACK);
  ------------------
  |  Branch (825:17): [True: 38.9k, False: 275k]
  ------------------
  826|  2.53k|                case Fragment::WRAP_S: return BuildScript(OP_SWAP, subs[0]);
  ------------------
  |  Branch (826:17): [True: 2.53k, False: 311k]
  ------------------
  827|  9.92k|                case Fragment::WRAP_C: return BuildScript(std::move(subs[0]), verify ? OP_CHECKSIGVERIFY : OP_CHECKSIG);
  ------------------
  |  Branch (827:17): [True: 9.92k, False: 304k]
  |  Branch (827:79): [True: 2.73k, False: 7.19k]
  ------------------
  828|  1.15k|                case Fragment::WRAP_D: return BuildScript(OP_DUP, OP_IF, subs[0], OP_ENDIF);
  ------------------
  |  Branch (828:17): [True: 1.15k, False: 312k]
  ------------------
  829|  29.1k|                case Fragment::WRAP_V: {
  ------------------
  |  Branch (829:17): [True: 29.1k, False: 284k]
  ------------------
  830|  29.1k|                    if (node.subs[0].GetType() << "x"_mst) {
  ------------------
  |  Branch (830:25): [True: 17.6k, False: 11.5k]
  ------------------
  831|  17.6k|                        return BuildScript(std::move(subs[0]), OP_VERIFY);
  832|  17.6k|                    } else {
  833|  11.5k|                        return std::move(subs[0]);
  834|  11.5k|                    }
  835|  29.1k|                }
  836|  3.33k|                case Fragment::WRAP_J: return BuildScript(OP_SIZE, OP_0NOTEQUAL, OP_IF, subs[0], OP_ENDIF);
  ------------------
  |  Branch (836:17): [True: 3.33k, False: 310k]
  ------------------
  837|  6.01k|                case Fragment::WRAP_N: return BuildScript(std::move(subs[0]), OP_0NOTEQUAL);
  ------------------
  |  Branch (837:17): [True: 6.01k, False: 307k]
  ------------------
  838|  7.99k|                case Fragment::JUST_1: return BuildScript(OP_1);
  ------------------
  |  Branch (838:17): [True: 7.99k, False: 305k]
  ------------------
  839|  76.2k|                case Fragment::JUST_0: return BuildScript(OP_0);
  ------------------
  |  Branch (839:17): [True: 76.2k, False: 237k]
  ------------------
  840|  24.9k|                case Fragment::AND_V: return BuildScript(std::move(subs[0]), subs[1]);
  ------------------
  |  Branch (840:17): [True: 24.9k, False: 288k]
  ------------------
  841|  5.85k|                case Fragment::AND_B: return BuildScript(std::move(subs[0]), subs[1], OP_BOOLAND);
  ------------------
  |  Branch (841:17): [True: 5.85k, False: 308k]
  ------------------
  842|  4.94k|                case Fragment::OR_B: return BuildScript(std::move(subs[0]), subs[1], OP_BOOLOR);
  ------------------
  |  Branch (842:17): [True: 4.94k, False: 309k]
  ------------------
  843|  7.52k|                case Fragment::OR_D: return BuildScript(std::move(subs[0]), OP_IFDUP, OP_NOTIF, subs[1], OP_ENDIF);
  ------------------
  |  Branch (843:17): [True: 7.52k, False: 306k]
  ------------------
  844|  5.27k|                case Fragment::OR_C: return BuildScript(std::move(subs[0]), OP_NOTIF, subs[1], OP_ENDIF);
  ------------------
  |  Branch (844:17): [True: 5.27k, False: 308k]
  ------------------
  845|  17.1k|                case Fragment::OR_I: return BuildScript(OP_IF, subs[0], OP_ELSE, subs[1], OP_ENDIF);
  ------------------
  |  Branch (845:17): [True: 17.1k, False: 296k]
  ------------------
  846|  13.2k|                case Fragment::ANDOR: return BuildScript(std::move(subs[0]), OP_NOTIF, subs[2], OP_ELSE, subs[1], OP_ENDIF);
  ------------------
  |  Branch (846:17): [True: 13.2k, False: 300k]
  ------------------
  847|  9.30k|                case Fragment::MULTI: {
  ------------------
  |  Branch (847:17): [True: 9.30k, False: 304k]
  ------------------
  848|  9.30k|                    CHECK_NONFATAL(!is_tapscript);
  ------------------
  |  |  113|  9.30k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  849|  9.30k|                    CScript script = BuildScript(node.k);
  850|  51.5k|                    for (const auto& key : node.keys) {
  ------------------
  |  Branch (850:42): [True: 51.5k, False: 9.30k]
  ------------------
  851|  51.5k|                        script = BuildScript(std::move(script), ctx.ToPKBytes(key));
  852|  51.5k|                    }
  853|  9.30k|                    return BuildScript(std::move(script), node.keys.size(), verify ? OP_CHECKMULTISIGVERIFY : OP_CHECKMULTISIG);
  ------------------
  |  Branch (853:77): [True: 2.47k, False: 6.83k]
  ------------------
  854|  29.1k|                }
  855|  2.03k|                case Fragment::MULTI_A: {
  ------------------
  |  Branch (855:17): [True: 2.03k, False: 311k]
  ------------------
  856|  2.03k|                    CHECK_NONFATAL(is_tapscript);
  ------------------
  |  |  113|  2.03k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  857|  2.03k|                    CScript script = BuildScript(ctx.ToPKBytes(*node.keys.begin()), OP_CHECKSIG);
  858|  45.8k|                    for (auto it = node.keys.begin() + 1; it != node.keys.end(); ++it) {
  ------------------
  |  Branch (858:59): [True: 43.8k, False: 2.03k]
  ------------------
  859|  43.8k|                        script = BuildScript(std::move(script), ctx.ToPKBytes(*it), OP_CHECKSIGADD);
  860|  43.8k|                    }
  861|  2.03k|                    return BuildScript(std::move(script), node.k, verify ? OP_NUMEQUALVERIFY : OP_NUMEQUAL);
  ------------------
  |  Branch (861:67): [True: 719, False: 1.31k]
  ------------------
  862|  29.1k|                }
  863|  12.1k|                case Fragment::THRESH: {
  ------------------
  |  Branch (863:17): [True: 12.1k, False: 301k]
  ------------------
  864|  12.1k|                    CScript script = std::move(subs[0]);
  865|  42.6k|                    for (size_t i = 1; i < subs.size(); ++i) {
  ------------------
  |  Branch (865:40): [True: 30.5k, False: 12.1k]
  ------------------
  866|  30.5k|                        script = BuildScript(std::move(script), subs[i], OP_ADD);
  867|  30.5k|                    }
  868|  12.1k|                    return BuildScript(std::move(script), node.k, verify ? OP_EQUALVERIFY : OP_EQUAL);
  ------------------
  |  Branch (868:67): [True: 3.25k, False: 8.92k]
  ------------------
  869|  29.1k|                }
  870|   313k|            }
  871|   313k|            assert(false);
  ------------------
  |  Branch (871:13): [Folded, False: 0]
  ------------------
  872|      0|        };
miniscript.cpp:_ZN10miniscript10FromScriptIN12_GLOBAL__N_113ParserContextEEENSt3__18optionalINS_4NodeINT_3KeyEEEEERK7CScriptRKS6_:
 2692|  4.18k|{
 2693|  4.18k|    using namespace internal;
 2694|       |    // A too large Script is necessarily invalid, don't bother parsing it.
 2695|  4.18k|    if (script.size() > MaxScriptSize(ctx.MsContext())) return {};
  ------------------
  |  Branch (2695:9): [True: 0, False: 4.18k]
  ------------------
 2696|  4.18k|    auto decomposed = DecomposeScript(script);
 2697|  4.18k|    if (!decomposed) return {};
  ------------------
  |  Branch (2697:9): [True: 0, False: 4.18k]
  ------------------
 2698|  4.18k|    auto it = decomposed->begin();
 2699|  4.18k|    auto ret = DecodeScript<typename Ctx::Key>(it, decomposed->end(), ctx);
 2700|  4.18k|    if (!ret) return {};
  ------------------
  |  Branch (2700:9): [True: 0, False: 4.18k]
  ------------------
 2701|  4.18k|    if (it != decomposed->end()) return {};
  ------------------
  |  Branch (2701:9): [True: 0, False: 4.18k]
  ------------------
 2702|  4.18k|    return ret;
 2703|  4.18k|}
miniscript.cpp:_ZN10miniscript8internal12DecodeScriptI7CPubKeyN12_GLOBAL__N_113ParserContextENSt3__111__wrap_iterIPNS5_4pairI10opcodetypeNS5_6vectorIhNS5_9allocatorIhEEEEEEEEEENS5_8optionalINS_4NodeIT_EEEERT1_SL_RKT0_:
 2297|  4.18k|{
 2298|       |    // The two integers are used to hold state for thresh()
 2299|  4.18k|    std::vector<std::tuple<DecodeContext, int64_t, int64_t>> to_parse;
 2300|  4.18k|    std::vector<Node<Key>> constructed;
 2301|       |
 2302|       |    // This is the top level, so we assume the type is B
 2303|       |    // (in particular, disallowing top level W expressions)
 2304|  4.18k|    to_parse.emplace_back(DecodeContext::BKV_EXPR, -1, -1);
 2305|       |
 2306|   425k|    while (!to_parse.empty()) {
  ------------------
  |  Branch (2306:12): [True: 421k, False: 4.18k]
  ------------------
 2307|       |        // Exit early if the Miniscript is not going to be valid.
 2308|   421k|        if (!constructed.empty() && !constructed.back().IsValid()) return {};
  ------------------
  |  Branch (2308:13): [True: 389k, False: 32.5k]
  |  Branch (2308:37): [True: 0, False: 389k]
  ------------------
 2309|       |
 2310|       |        // Get the current context we are decoding within
 2311|   421k|        auto [cur_context, n, k] = to_parse.back();
 2312|   421k|        to_parse.pop_back();
 2313|       |
 2314|   421k|        switch(cur_context) {
  ------------------
  |  Branch (2314:16): [True: 421k, False: 0]
  ------------------
 2315|   116k|        case DecodeContext::SINGLE_BKV_EXPR: {
  ------------------
  |  Branch (2315:9): [True: 116k, False: 304k]
  ------------------
 2316|   116k|            if (in >= last) return {};
  ------------------
  |  Branch (2316:17): [True: 0, False: 116k]
  ------------------
 2317|       |
 2318|       |            // Constants
 2319|   116k|            if (in[0].first == OP_1) {
  ------------------
  |  Branch (2319:17): [True: 3.81k, False: 113k]
  ------------------
 2320|  3.81k|                ++in;
 2321|  3.81k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_1);
 2322|  3.81k|                break;
 2323|  3.81k|            }
 2324|   113k|            if (in[0].first == OP_0) {
  ------------------
  |  Branch (2324:17): [True: 35.8k, False: 77.2k]
  ------------------
 2325|  35.8k|                ++in;
 2326|  35.8k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_0);
 2327|  35.8k|                break;
 2328|  35.8k|            }
 2329|       |            // Public keys
 2330|  77.2k|            if (in[0].second.size() == 33 || in[0].second.size() == 32) {
  ------------------
  |  Branch (2330:17): [True: 4.49k, False: 72.7k]
  |  Branch (2330:46): [True: 2.48k, False: 70.2k]
  ------------------
 2331|  6.98k|                auto key = ctx.FromPKBytes(in[0].second.begin(), in[0].second.end());
 2332|  6.98k|                if (!key) return {};
  ------------------
  |  Branch (2332:21): [True: 0, False: 6.98k]
  ------------------
 2333|  6.98k|                ++in;
 2334|  6.98k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::PK_K, Vector(std::move(*key)));
 2335|  6.98k|                break;
 2336|  6.98k|            }
 2337|  70.2k|            if (last - in >= 5 && in[0].first == OP_VERIFY && in[1].first == OP_EQUAL && in[3].first == OP_HASH160 && in[4].first == OP_DUP && in[2].second.size() == 20) {
  ------------------
  |  Branch (2337:17): [True: 68.8k, False: 1.41k]
  |  Branch (2337:35): [True: 15.2k, False: 53.6k]
  |  Branch (2337:63): [True: 4.43k, False: 10.7k]
  |  Branch (2337:90): [True: 1.90k, False: 2.53k]
  |  Branch (2337:119): [True: 1.76k, False: 137]
  |  Branch (2337:144): [True: 1.76k, False: 0]
  ------------------
 2338|  1.76k|                auto key = ctx.FromPKHBytes(in[2].second.begin(), in[2].second.end());
 2339|  1.76k|                if (!key) return {};
  ------------------
  |  Branch (2339:21): [True: 0, False: 1.76k]
  ------------------
 2340|  1.76k|                in += 5;
 2341|  1.76k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::PK_H, Vector(std::move(*key)));
 2342|  1.76k|                break;
 2343|  1.76k|            }
 2344|       |            // Time locks
 2345|  68.5k|            std::optional<int64_t> num;
 2346|  68.5k|            if (last - in >= 2 && in[0].first == OP_CHECKSEQUENCEVERIFY && (num = ParseScriptNumber(in[1]))) {
  ------------------
  |  Branch (2346:17): [True: 68.5k, False: 0]
  |  Branch (2346:17): [True: 1.53k, False: 66.9k]
  |  Branch (2346:35): [True: 1.53k, False: 66.9k]
  |  Branch (2346:76): [True: 1.53k, False: 0]
  ------------------
 2347|  1.53k|                in += 2;
 2348|  1.53k|                if (*num < 1 || *num > 0x7FFFFFFFL) return {};
  ------------------
  |  Branch (2348:21): [True: 0, False: 1.53k]
  |  Branch (2348:33): [True: 0, False: 1.53k]
  ------------------
 2349|  1.53k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::OLDER, *num);
 2350|  1.53k|                break;
 2351|  1.53k|            }
 2352|  66.9k|            if (last - in >= 2 && in[0].first == OP_CHECKLOCKTIMEVERIFY && (num = ParseScriptNumber(in[1]))) {
  ------------------
  |  Branch (2352:17): [True: 66.9k, False: 0]
  |  Branch (2352:17): [True: 1.27k, False: 65.6k]
  |  Branch (2352:35): [True: 1.27k, False: 65.6k]
  |  Branch (2352:76): [True: 1.27k, False: 0]
  ------------------
 2353|  1.27k|                in += 2;
 2354|  1.27k|                if (num < 1 || num > 0x7FFFFFFFL) return {};
  ------------------
  |  Branch (2354:21): [True: 0, False: 1.27k]
  |  Branch (2354:21): [True: 0, False: 1.27k]
  |  Branch (2354:32): [True: 0, False: 1.27k]
  ------------------
 2355|  1.27k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::AFTER, *num);
 2356|  1.27k|                break;
 2357|  1.27k|            }
 2358|       |            // Hashes
 2359|  65.6k|            if (last - in >= 7 && in[0].first == OP_EQUAL && in[3].first == OP_VERIFY && in[4].first == OP_EQUAL && (num = ParseScriptNumber(in[5])) && num == 32 && in[6].first == OP_SIZE) {
  ------------------
  |  Branch (2359:17): [True: 63.8k, False: 1.87k]
  |  Branch (2359:17): [True: 5.33k, False: 60.3k]
  |  Branch (2359:35): [True: 11.1k, False: 52.6k]
  |  Branch (2359:62): [True: 6.89k, False: 4.25k]
  |  Branch (2359:90): [True: 6.79k, False: 92]
  |  Branch (2359:117): [True: 6.75k, False: 43]
  |  Branch (2359:153): [True: 5.33k, False: 1.42k]
  |  Branch (2359:166): [True: 5.33k, False: 0]
  ------------------
 2360|  5.33k|                if (in[2].first == OP_SHA256 && in[1].second.size() == 32) {
  ------------------
  |  Branch (2360:21): [True: 1.56k, False: 3.76k]
  |  Branch (2360:49): [True: 1.56k, False: 0]
  ------------------
 2361|  1.56k|                    constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::SHA256, in[1].second);
 2362|  1.56k|                    in += 7;
 2363|  1.56k|                    break;
 2364|  3.76k|                } else if (in[2].first == OP_RIPEMD160 && in[1].second.size() == 20) {
  ------------------
  |  Branch (2364:28): [True: 1.08k, False: 2.68k]
  |  Branch (2364:59): [True: 1.08k, False: 0]
  ------------------
 2365|  1.08k|                    constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::RIPEMD160, in[1].second);
 2366|  1.08k|                    in += 7;
 2367|  1.08k|                    break;
 2368|  2.68k|                } else if (in[2].first == OP_HASH256 && in[1].second.size() == 32) {
  ------------------
  |  Branch (2368:28): [True: 1.49k, False: 1.18k]
  |  Branch (2368:57): [True: 1.49k, False: 0]
  ------------------
 2369|  1.49k|                    constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::HASH256, in[1].second);
 2370|  1.49k|                    in += 7;
 2371|  1.49k|                    break;
 2372|  1.49k|                } else if (in[2].first == OP_HASH160 && in[1].second.size() == 20) {
  ------------------
  |  Branch (2372:28): [True: 1.18k, False: 0]
  |  Branch (2372:57): [True: 1.18k, False: 0]
  ------------------
 2373|  1.18k|                    constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::HASH160, in[1].second);
 2374|  1.18k|                    in += 7;
 2375|  1.18k|                    break;
 2376|  1.18k|                }
 2377|  5.33k|            }
 2378|       |            // Multi
 2379|  60.3k|            if (last - in >= 3 && in[0].first == OP_CHECKMULTISIG) {
  ------------------
  |  Branch (2379:17): [True: 60.0k, False: 307]
  |  Branch (2379:35): [True: 4.54k, False: 55.5k]
  ------------------
 2380|  4.54k|                if (IsTapscript(ctx.MsContext())) return {};
  ------------------
  |  Branch (2380:21): [True: 0, False: 4.54k]
  ------------------
 2381|  4.54k|                std::vector<Key> keys;
 2382|  4.54k|                const auto n = ParseScriptNumber(in[1]);
 2383|  4.54k|                if (!n || last - in < 3 + *n) return {};
  ------------------
  |  Branch (2383:21): [True: 0, False: 4.54k]
  |  Branch (2383:27): [True: 0, False: 4.54k]
  ------------------
 2384|  4.54k|                if (*n < 1 || *n > 20) return {};
  ------------------
  |  Branch (2384:21): [True: 0, False: 4.54k]
  |  Branch (2384:31): [True: 0, False: 4.54k]
  ------------------
 2385|  29.5k|                for (int i = 0; i < *n; ++i) {
  ------------------
  |  Branch (2385:33): [True: 25.0k, False: 4.54k]
  ------------------
 2386|  25.0k|                    if (in[2 + i].second.size() != 33) return {};
  ------------------
  |  Branch (2386:25): [True: 0, False: 25.0k]
  ------------------
 2387|  25.0k|                    auto key = ctx.FromPKBytes(in[2 + i].second.begin(), in[2 + i].second.end());
 2388|  25.0k|                    if (!key) return {};
  ------------------
  |  Branch (2388:25): [True: 0, False: 25.0k]
  ------------------
 2389|  25.0k|                    keys.push_back(std::move(*key));
 2390|  25.0k|                }
 2391|  4.54k|                const auto k = ParseScriptNumber(in[2 + *n]);
 2392|  4.54k|                if (!k || *k < 1 || *k > *n) return {};
  ------------------
  |  Branch (2392:21): [True: 0, False: 4.54k]
  |  Branch (2392:27): [True: 0, False: 4.54k]
  |  Branch (2392:37): [True: 0, False: 4.54k]
  ------------------
 2393|  4.54k|                in += 3 + *n;
 2394|  4.54k|                std::reverse(keys.begin(), keys.end());
 2395|  4.54k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::MULTI, std::move(keys), *k);
 2396|  4.54k|                break;
 2397|  4.54k|            }
 2398|       |            // Tapscript's equivalent of multi
 2399|  55.8k|            if (last - in >= 4 && in[0].first == OP_NUMEQUAL) {
  ------------------
  |  Branch (2399:17): [True: 55.3k, False: 455]
  |  Branch (2399:35): [True: 988, False: 54.3k]
  ------------------
 2400|    988|                if (!IsTapscript(ctx.MsContext())) return {};
  ------------------
  |  Branch (2400:21): [True: 0, False: 988]
  ------------------
 2401|       |                // The necessary threshold of signatures.
 2402|    988|                const auto k = ParseScriptNumber(in[1]);
 2403|    988|                if (!k) return {};
  ------------------
  |  Branch (2403:21): [True: 0, False: 988]
  ------------------
 2404|    988|                if (*k < 1 || *k > MAX_PUBKEYS_PER_MULTI_A) return {};
  ------------------
  |  Branch (2404:21): [True: 0, False: 988]
  |  Branch (2404:31): [True: 0, False: 988]
  ------------------
 2405|    988|                if (last - in < 2 + *k * 2) return {};
  ------------------
  |  Branch (2405:21): [True: 0, False: 988]
  ------------------
 2406|    988|                std::vector<Key> keys;
 2407|    988|                keys.reserve(*k);
 2408|       |                // Walk through the expected (pubkey, CHECKSIG[ADD]) pairs.
 2409|  21.7k|                for (int pos = 2;; pos += 2) {
 2410|  21.7k|                    if (last - in < pos + 2) return {};
  ------------------
  |  Branch (2410:25): [True: 0, False: 21.7k]
  ------------------
 2411|       |                    // Make sure it's indeed an x-only pubkey and a CHECKSIG[ADD], then parse the key.
 2412|  21.7k|                    if (in[pos].first != OP_CHECKSIGADD && in[pos].first != OP_CHECKSIG) return {};
  ------------------
  |  Branch (2412:25): [True: 988, False: 20.7k]
  |  Branch (2412:60): [True: 0, False: 988]
  ------------------
 2413|  21.7k|                    if (in[pos + 1].second.size() != 32) return {};
  ------------------
  |  Branch (2413:25): [True: 0, False: 21.7k]
  ------------------
 2414|  21.7k|                    auto key = ctx.FromPKBytes(in[pos + 1].second.begin(), in[pos + 1].second.end());
 2415|  21.7k|                    if (!key) return {};
  ------------------
  |  Branch (2415:25): [True: 0, False: 21.7k]
  ------------------
 2416|  21.7k|                    keys.push_back(std::move(*key));
 2417|       |                    // Make sure early we don't parse an arbitrary large expression.
 2418|  21.7k|                    if (keys.size() > MAX_PUBKEYS_PER_MULTI_A) return {};
  ------------------
  |  Branch (2418:25): [True: 0, False: 21.7k]
  ------------------
 2419|       |                    // OP_CHECKSIG means it was the last one to parse.
 2420|  21.7k|                    if (in[pos].first == OP_CHECKSIG) break;
  ------------------
  |  Branch (2420:25): [True: 988, False: 20.7k]
  ------------------
 2421|  21.7k|                }
 2422|    988|                if (keys.size() < (size_t)*k) return {};
  ------------------
  |  Branch (2422:21): [True: 0, False: 988]
  ------------------
 2423|    988|                in += 2 + keys.size() * 2;
 2424|    988|                std::reverse(keys.begin(), keys.end());
 2425|    988|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::MULTI_A, std::move(keys), *k);
 2426|    988|                break;
 2427|    988|            }
 2428|       |            /** In the following wrappers, we only need to push SINGLE_BKV_EXPR rather
 2429|       |             * than BKV_EXPR, because and_v commutes with these wrappers. For example,
 2430|       |             * c:and_v(X,Y) produces the same script as and_v(X,c:Y). */
 2431|       |            // c: wrapper
 2432|  54.8k|            if (in[0].first == OP_CHECKSIG) {
  ------------------
  |  Branch (2432:17): [True: 4.82k, False: 50.0k]
  ------------------
 2433|  4.82k|                ++in;
 2434|  4.82k|                to_parse.emplace_back(DecodeContext::CHECK, -1, -1);
 2435|  4.82k|                to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2436|  4.82k|                break;
 2437|  4.82k|            }
 2438|       |            // v: wrapper
 2439|  50.0k|            if (in[0].first == OP_VERIFY) {
  ------------------
  |  Branch (2439:17): [True: 13.6k, False: 36.3k]
  ------------------
 2440|  13.6k|                ++in;
 2441|  13.6k|                to_parse.emplace_back(DecodeContext::VERIFY, -1, -1);
 2442|  13.6k|                to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2443|  13.6k|                break;
 2444|  13.6k|            }
 2445|       |            // n: wrapper
 2446|  36.3k|            if (in[0].first == OP_0NOTEQUAL) {
  ------------------
  |  Branch (2446:17): [True: 2.88k, False: 33.4k]
  ------------------
 2447|  2.88k|                ++in;
 2448|  2.88k|                to_parse.emplace_back(DecodeContext::ZERO_NOTEQUAL, -1, -1);
 2449|  2.88k|                to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2450|  2.88k|                break;
 2451|  2.88k|            }
 2452|       |            // Thresh
 2453|  33.4k|            if (last - in >= 3 && in[0].first == OP_EQUAL && (num = ParseScriptNumber(in[1]))) {
  ------------------
  |  Branch (2453:17): [True: 33.4k, False: 0]
  |  Branch (2453:17): [True: 5.94k, False: 27.5k]
  |  Branch (2453:35): [True: 5.94k, False: 27.5k]
  |  Branch (2453:62): [True: 5.94k, False: 0]
  ------------------
 2454|  5.94k|                if (*num < 1) return {};
  ------------------
  |  Branch (2454:21): [True: 0, False: 5.94k]
  ------------------
 2455|  5.94k|                in += 2;
 2456|  5.94k|                to_parse.emplace_back(DecodeContext::THRESH_W, 0, *num);
 2457|  5.94k|                break;
 2458|  5.94k|            }
 2459|       |            // OP_ENDIF can be WRAP_J, WRAP_D, ANDOR, OR_C, OR_D, or OR_I
 2460|  27.5k|            if (in[0].first == OP_ENDIF) {
  ------------------
  |  Branch (2460:17): [True: 22.3k, False: 5.22k]
  ------------------
 2461|  22.3k|                ++in;
 2462|  22.3k|                to_parse.emplace_back(DecodeContext::ENDIF, -1, -1);
 2463|  22.3k|                to_parse.emplace_back(DecodeContext::BKV_EXPR, -1, -1);
 2464|  22.3k|                break;
 2465|  22.3k|            }
 2466|       |            /** In and_b and or_b nodes, we only look for SINGLE_BKV_EXPR, because
 2467|       |             * or_b(and_v(X,Y),Z) has script [X] [Y] [Z] OP_BOOLOR, the same as
 2468|       |             * and_v(X,or_b(Y,Z)). In this example, the former of these is invalid as
 2469|       |             * miniscript, while the latter is valid. So we leave the and_v "outside"
 2470|       |             * while decoding. */
 2471|       |            // and_b
 2472|  5.22k|            if (in[0].first == OP_BOOLAND) {
  ------------------
  |  Branch (2472:17): [True: 2.86k, False: 2.36k]
  ------------------
 2473|  2.86k|                ++in;
 2474|  2.86k|                to_parse.emplace_back(DecodeContext::AND_B, -1, -1);
 2475|  2.86k|                to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2476|  2.86k|                to_parse.emplace_back(DecodeContext::W_EXPR, -1, -1);
 2477|  2.86k|                break;
 2478|  2.86k|            }
 2479|       |            // or_b
 2480|  2.36k|            if (in[0].first == OP_BOOLOR) {
  ------------------
  |  Branch (2480:17): [True: 2.36k, False: 0]
  ------------------
 2481|  2.36k|                ++in;
 2482|  2.36k|                to_parse.emplace_back(DecodeContext::OR_B, -1, -1);
 2483|  2.36k|                to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2484|  2.36k|                to_parse.emplace_back(DecodeContext::W_EXPR, -1, -1);
 2485|  2.36k|                break;
 2486|  2.36k|            }
 2487|       |            // Unrecognised expression
 2488|      0|            return {};
 2489|  2.36k|        }
 2490|  72.0k|        case DecodeContext::BKV_EXPR: {
  ------------------
  |  Branch (2490:9): [True: 72.0k, False: 349k]
  ------------------
 2491|  72.0k|            to_parse.emplace_back(DecodeContext::MAYBE_AND_V, -1, -1);
 2492|  72.0k|            to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2493|  72.0k|            break;
 2494|  2.36k|        }
 2495|  19.5k|        case DecodeContext::W_EXPR: {
  ------------------
  |  Branch (2495:9): [True: 19.5k, False: 402k]
  ------------------
 2496|       |            // a: wrapper
 2497|  19.5k|            if (in >= last) return {};
  ------------------
  |  Branch (2497:17): [True: 0, False: 19.5k]
  ------------------
 2498|  19.5k|            if (in[0].first == OP_FROMALTSTACK) {
  ------------------
  |  Branch (2498:17): [True: 18.3k, False: 1.22k]
  ------------------
 2499|  18.3k|                ++in;
 2500|  18.3k|                to_parse.emplace_back(DecodeContext::ALT, -1, -1);
 2501|  18.3k|            } else {
 2502|  1.22k|                to_parse.emplace_back(DecodeContext::SWAP, -1, -1);
 2503|  1.22k|            }
 2504|  19.5k|            to_parse.emplace_back(DecodeContext::BKV_EXPR, -1, -1);
 2505|  19.5k|            break;
 2506|  19.5k|        }
 2507|  72.0k|        case DecodeContext::MAYBE_AND_V: {
  ------------------
  |  Branch (2507:9): [True: 72.0k, False: 349k]
  ------------------
 2508|       |            // If we reach a potential AND_V top-level, check if the next part of the script could be another AND_V child
 2509|       |            // These op-codes cannot end any well-formed miniscript so cannot be used in an and_v node.
 2510|  72.0k|            if (in < last && in[0].first != OP_IF && in[0].first != OP_ELSE && in[0].first != OP_NOTIF && in[0].first != OP_TOALTSTACK && in[0].first != OP_SWAP) {
  ------------------
  |  Branch (2510:17): [True: 67.8k, False: 4.18k]
  |  Branch (2510:30): [True: 57.8k, False: 9.98k]
  |  Branch (2510:54): [True: 43.8k, False: 14.0k]
  |  Branch (2510:80): [True: 31.5k, False: 12.3k]
  |  Branch (2510:107): [True: 13.1k, False: 18.3k]
  |  Branch (2510:139): [True: 11.9k, False: 1.22k]
  ------------------
 2511|  11.9k|                to_parse.emplace_back(DecodeContext::AND_V, -1, -1);
 2512|       |                // BKV_EXPR can contain more AND_V nodes
 2513|  11.9k|                to_parse.emplace_back(DecodeContext::BKV_EXPR, -1, -1);
 2514|  11.9k|            }
 2515|  72.0k|            break;
 2516|  19.5k|        }
 2517|  1.22k|        case DecodeContext::SWAP: {
  ------------------
  |  Branch (2517:9): [True: 1.22k, False: 420k]
  ------------------
 2518|  1.22k|            if (in >= last || in[0].first != OP_SWAP || constructed.empty()) return {};
  ------------------
  |  Branch (2518:17): [True: 0, False: 1.22k]
  |  Branch (2518:31): [True: 0, False: 1.22k]
  |  Branch (2518:57): [True: 0, False: 1.22k]
  ------------------
 2519|  1.22k|            ++in;
 2520|  1.22k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_S, Vector(std::move(constructed.back()))};
 2521|  1.22k|            break;
 2522|  1.22k|        }
 2523|  18.3k|        case DecodeContext::ALT: {
  ------------------
  |  Branch (2523:9): [True: 18.3k, False: 403k]
  ------------------
 2524|  18.3k|            if (in >= last || in[0].first != OP_TOALTSTACK || constructed.empty()) return {};
  ------------------
  |  Branch (2524:17): [True: 0, False: 18.3k]
  |  Branch (2524:31): [True: 0, False: 18.3k]
  |  Branch (2524:63): [True: 0, False: 18.3k]
  ------------------
 2525|  18.3k|            ++in;
 2526|  18.3k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_A, Vector(std::move(constructed.back()))};
 2527|  18.3k|            break;
 2528|  18.3k|        }
 2529|  4.82k|        case DecodeContext::CHECK: {
  ------------------
  |  Branch (2529:9): [True: 4.82k, False: 416k]
  ------------------
 2530|  4.82k|            if (constructed.empty()) return {};
  ------------------
  |  Branch (2530:17): [True: 0, False: 4.82k]
  ------------------
 2531|  4.82k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_C, Vector(std::move(constructed.back()))};
 2532|  4.82k|            break;
 2533|  4.82k|        }
 2534|    553|        case DecodeContext::DUP_IF: {
  ------------------
  |  Branch (2534:9): [True: 553, False: 421k]
  ------------------
 2535|    553|            if (constructed.empty()) return {};
  ------------------
  |  Branch (2535:17): [True: 0, False: 553]
  ------------------
 2536|    553|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_D, Vector(std::move(constructed.back()))};
 2537|    553|            break;
 2538|    553|        }
 2539|  13.6k|        case DecodeContext::VERIFY: {
  ------------------
  |  Branch (2539:9): [True: 13.6k, False: 408k]
  ------------------
 2540|  13.6k|            if (constructed.empty()) return {};
  ------------------
  |  Branch (2540:17): [True: 0, False: 13.6k]
  ------------------
 2541|  13.6k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_V, Vector(std::move(constructed.back()))};
 2542|  13.6k|            break;
 2543|  13.6k|        }
 2544|  1.61k|        case DecodeContext::NON_ZERO: {
  ------------------
  |  Branch (2544:9): [True: 1.61k, False: 420k]
  ------------------
 2545|  1.61k|            if (constructed.empty()) return {};
  ------------------
  |  Branch (2545:17): [True: 0, False: 1.61k]
  ------------------
 2546|  1.61k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_J, Vector(std::move(constructed.back()))};
 2547|  1.61k|            break;
 2548|  1.61k|        }
 2549|  2.88k|        case DecodeContext::ZERO_NOTEQUAL: {
  ------------------
  |  Branch (2549:9): [True: 2.88k, False: 418k]
  ------------------
 2550|  2.88k|            if (constructed.empty()) return {};
  ------------------
  |  Branch (2550:17): [True: 0, False: 2.88k]
  ------------------
 2551|  2.88k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_N, Vector(std::move(constructed.back()))};
 2552|  2.88k|            break;
 2553|  2.88k|        }
 2554|  11.9k|        case DecodeContext::AND_V: {
  ------------------
  |  Branch (2554:9): [True: 11.9k, False: 409k]
  ------------------
 2555|  11.9k|            if (constructed.size() < 2) return {};
  ------------------
  |  Branch (2555:17): [True: 0, False: 11.9k]
  ------------------
 2556|  11.9k|            BuildBack(ctx.MsContext(), Fragment::AND_V, constructed, /*reverse=*/true);
 2557|  11.9k|            break;
 2558|  11.9k|        }
 2559|  2.86k|        case DecodeContext::AND_B: {
  ------------------
  |  Branch (2559:9): [True: 2.86k, False: 418k]
  ------------------
 2560|  2.86k|            if (constructed.size() < 2) return {};
  ------------------
  |  Branch (2560:17): [True: 0, False: 2.86k]
  ------------------
 2561|  2.86k|            BuildBack(ctx.MsContext(), Fragment::AND_B, constructed, /*reverse=*/true);
 2562|  2.86k|            break;
 2563|  2.86k|        }
 2564|  2.36k|        case DecodeContext::OR_B: {
  ------------------
  |  Branch (2564:9): [True: 2.36k, False: 419k]
  ------------------
 2565|  2.36k|            if (constructed.size() < 2) return {};
  ------------------
  |  Branch (2565:17): [True: 0, False: 2.36k]
  ------------------
 2566|  2.36k|            BuildBack(ctx.MsContext(), Fragment::OR_B, constructed, /*reverse=*/true);
 2567|  2.36k|            break;
 2568|  2.36k|        }
 2569|  2.43k|        case DecodeContext::OR_C: {
  ------------------
  |  Branch (2569:9): [True: 2.43k, False: 419k]
  ------------------
 2570|  2.43k|            if (constructed.size() < 2) return {};
  ------------------
  |  Branch (2570:17): [True: 0, False: 2.43k]
  ------------------
 2571|  2.43k|            BuildBack(ctx.MsContext(), Fragment::OR_C, constructed, /*reverse=*/true);
 2572|  2.43k|            break;
 2573|  2.43k|        }
 2574|  3.64k|        case DecodeContext::OR_D: {
  ------------------
  |  Branch (2574:9): [True: 3.64k, False: 418k]
  ------------------
 2575|  3.64k|            if (constructed.size() < 2) return {};
  ------------------
  |  Branch (2575:17): [True: 0, False: 3.64k]
  ------------------
 2576|  3.64k|            BuildBack(ctx.MsContext(), Fragment::OR_D, constructed, /*reverse=*/true);
 2577|  3.64k|            break;
 2578|  3.64k|        }
 2579|  6.23k|        case DecodeContext::ANDOR: {
  ------------------
  |  Branch (2579:9): [True: 6.23k, False: 415k]
  ------------------
 2580|  6.23k|            if (constructed.size() < 3) return {};
  ------------------
  |  Branch (2580:17): [True: 0, False: 6.23k]
  ------------------
 2581|  6.23k|            Node left{std::move(constructed.back())};
 2582|  6.23k|            constructed.pop_back();
 2583|  6.23k|            Node right{std::move(constructed.back())};
 2584|  6.23k|            constructed.pop_back();
 2585|  6.23k|            Node mid{std::move(constructed.back())};
 2586|  6.23k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::ANDOR, Vector(std::move(left), std::move(mid), std::move(right))};
 2587|  6.23k|            break;
 2588|  6.23k|        }
 2589|  20.2k|        case DecodeContext::THRESH_W: {
  ------------------
  |  Branch (2589:9): [True: 20.2k, False: 401k]
  ------------------
 2590|  20.2k|            if (in >= last) return {};
  ------------------
  |  Branch (2590:17): [True: 0, False: 20.2k]
  ------------------
 2591|  20.2k|            if (in[0].first == OP_ADD) {
  ------------------
  |  Branch (2591:17): [True: 14.3k, False: 5.94k]
  ------------------
 2592|  14.3k|                ++in;
 2593|  14.3k|                to_parse.emplace_back(DecodeContext::THRESH_W, n+1, k);
 2594|  14.3k|                to_parse.emplace_back(DecodeContext::W_EXPR, -1, -1);
 2595|  14.3k|            } else {
 2596|  5.94k|                to_parse.emplace_back(DecodeContext::THRESH_E, n+1, k);
 2597|       |                // All children of thresh have type modifier d, so cannot be and_v
 2598|  5.94k|                to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2599|  5.94k|            }
 2600|  20.2k|            break;
 2601|  20.2k|        }
 2602|  5.94k|        case DecodeContext::THRESH_E: {
  ------------------
  |  Branch (2602:9): [True: 5.94k, False: 415k]
  ------------------
 2603|  5.94k|            if (k < 1 || k > n || constructed.size() < static_cast<size_t>(n)) return {};
  ------------------
  |  Branch (2603:17): [True: 0, False: 5.94k]
  |  Branch (2603:26): [True: 0, False: 5.94k]
  |  Branch (2603:35): [True: 0, False: 5.94k]
  ------------------
 2604|  5.94k|            std::vector<Node<Key>> subs;
 2605|  26.2k|            for (int i = 0; i < n; ++i) {
  ------------------
  |  Branch (2605:29): [True: 20.2k, False: 5.94k]
  ------------------
 2606|  20.2k|                Node sub{std::move(constructed.back())};
 2607|  20.2k|                constructed.pop_back();
 2608|  20.2k|                subs.push_back(std::move(sub));
 2609|  20.2k|            }
 2610|  5.94k|            constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::THRESH, std::move(subs), k);
 2611|  5.94k|            break;
 2612|  5.94k|        }
 2613|  22.3k|        case DecodeContext::ENDIF: {
  ------------------
  |  Branch (2613:9): [True: 22.3k, False: 399k]
  ------------------
 2614|  22.3k|            if (in >= last) return {};
  ------------------
  |  Branch (2614:17): [True: 0, False: 22.3k]
  ------------------
 2615|       |
 2616|       |            // could be andor or or_i
 2617|  22.3k|            if (in[0].first == OP_ELSE) {
  ------------------
  |  Branch (2617:17): [True: 14.0k, False: 8.24k]
  ------------------
 2618|  14.0k|                ++in;
 2619|  14.0k|                to_parse.emplace_back(DecodeContext::ENDIF_ELSE, -1, -1);
 2620|  14.0k|                to_parse.emplace_back(DecodeContext::BKV_EXPR, -1, -1);
 2621|  14.0k|            }
 2622|       |            // could be j: or d: wrapper
 2623|  8.24k|            else if (in[0].first == OP_IF) {
  ------------------
  |  Branch (2623:22): [True: 2.16k, False: 6.07k]
  ------------------
 2624|  2.16k|                if (last - in >= 2 && in[1].first == OP_DUP) {
  ------------------
  |  Branch (2624:21): [True: 2.16k, False: 0]
  |  Branch (2624:39): [True: 553, False: 1.61k]
  ------------------
 2625|    553|                    in += 2;
 2626|    553|                    to_parse.emplace_back(DecodeContext::DUP_IF, -1, -1);
 2627|  1.61k|                } else if (last - in >= 3 && in[1].first == OP_0NOTEQUAL && in[2].first == OP_SIZE) {
  ------------------
  |  Branch (2627:28): [True: 1.61k, False: 0]
  |  Branch (2627:46): [True: 1.61k, False: 0]
  |  Branch (2627:77): [True: 1.61k, False: 0]
  ------------------
 2628|  1.61k|                    in += 3;
 2629|  1.61k|                    to_parse.emplace_back(DecodeContext::NON_ZERO, -1, -1);
 2630|  1.61k|                }
 2631|      0|                else {
 2632|      0|                    return {};
 2633|      0|                }
 2634|       |            // could be or_c or or_d
 2635|  6.07k|            } else if (in[0].first == OP_NOTIF) {
  ------------------
  |  Branch (2635:24): [True: 6.07k, False: 0]
  ------------------
 2636|  6.07k|                ++in;
 2637|  6.07k|                to_parse.emplace_back(DecodeContext::ENDIF_NOTIF, -1, -1);
 2638|  6.07k|            }
 2639|      0|            else {
 2640|      0|                return {};
 2641|      0|            }
 2642|  22.3k|            break;
 2643|  22.3k|        }
 2644|  22.3k|        case DecodeContext::ENDIF_NOTIF: {
  ------------------
  |  Branch (2644:9): [True: 6.07k, False: 415k]
  ------------------
 2645|  6.07k|            if (in >= last) return {};
  ------------------
  |  Branch (2645:17): [True: 0, False: 6.07k]
  ------------------
 2646|  6.07k|            if (in[0].first == OP_IFDUP) {
  ------------------
  |  Branch (2646:17): [True: 3.64k, False: 2.43k]
  ------------------
 2647|  3.64k|                ++in;
 2648|  3.64k|                to_parse.emplace_back(DecodeContext::OR_D, -1, -1);
 2649|  3.64k|            } else {
 2650|  2.43k|                to_parse.emplace_back(DecodeContext::OR_C, -1, -1);
 2651|  2.43k|            }
 2652|       |            // or_c and or_d both require X to have type modifier d so, can't contain and_v
 2653|  6.07k|            to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2654|  6.07k|            break;
 2655|  6.07k|        }
 2656|  14.0k|        case DecodeContext::ENDIF_ELSE: {
  ------------------
  |  Branch (2656:9): [True: 14.0k, False: 407k]
  ------------------
 2657|  14.0k|            if (in >= last) return {};
  ------------------
  |  Branch (2657:17): [True: 0, False: 14.0k]
  ------------------
 2658|  14.0k|            if (in[0].first == OP_IF) {
  ------------------
  |  Branch (2658:17): [True: 7.82k, False: 6.23k]
  ------------------
 2659|  7.82k|                ++in;
 2660|  7.82k|                BuildBack(ctx.MsContext(), Fragment::OR_I, constructed, /*reverse=*/true);
 2661|  7.82k|            } else if (in[0].first == OP_NOTIF) {
  ------------------
  |  Branch (2661:24): [True: 6.23k, False: 0]
  ------------------
 2662|  6.23k|                ++in;
 2663|  6.23k|                to_parse.emplace_back(DecodeContext::ANDOR, -1, -1);
 2664|       |                // andor requires X to have type modifier d, so it can't be and_v
 2665|  6.23k|                to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2666|  6.23k|            } else {
 2667|      0|                return {};
 2668|      0|            }
 2669|  14.0k|            break;
 2670|  14.0k|        }
 2671|   421k|        }
 2672|   421k|    }
 2673|  4.18k|    if (constructed.size() != 1) return {};
  ------------------
  |  Branch (2673:9): [True: 0, False: 4.18k]
  ------------------
 2674|  4.18k|    Node tl_node{std::move(constructed.front())};
 2675|  4.18k|    tl_node.DuplicateKeyCheck(ctx);
 2676|       |    // Note that due to how ComputeType works (only assign the type to the node if the
 2677|       |    // subs' types are valid) this would fail if any node of tree is badly typed.
 2678|  4.18k|    if (!tl_node.IsValidTopLevel()) return {};
  ------------------
  |  Branch (2678:9): [True: 0, False: 4.18k]
  ------------------
 2679|  4.18k|    return tl_node;
 2680|  4.18k|}
miniscript.cpp:_ZNK10miniscript4NodeI7CPubKeyE17DuplicateKeyCheckIN12_GLOBAL__N_113ParserContextEEEvRKT_:
 1501|  8.94k|    {
 1502|       |        // We cannot use a lambda here, as lambdas are non assignable, and the set operations
 1503|       |        // below require moving the comparators around.
 1504|  8.94k|        struct Comp {
 1505|  8.94k|            const Ctx* ctx_ptr;
 1506|  8.94k|            Comp(const Ctx& ctx) : ctx_ptr(&ctx) {}
 1507|  8.94k|            bool operator()(const Key& a, const Key& b) const { return ctx_ptr->KeyCompare(a, b); }
 1508|  8.94k|        };
 1509|       |
 1510|       |        // state in the recursive computation:
 1511|       |        // - std::nullopt means "this node has duplicates"
 1512|       |        // - an std::set means "this node has no duplicate keys, and they are: ...".
 1513|  8.94k|        using keyset = std::set<Key, Comp>;
 1514|  8.94k|        using state = std::optional<keyset>;
 1515|       |
 1516|  8.94k|        auto upfn = [&ctx](const Node& node, std::span<state> subs) -> state {
 1517|       |            // If this node is already known to have duplicates, nothing left to do.
 1518|  8.94k|            if (node.has_duplicate_keys.has_value() && *node.has_duplicate_keys) return {};
 1519|       |
 1520|       |            // Check if one of the children is already known to have duplicates.
 1521|  8.94k|            for (auto& sub : subs) {
 1522|  8.94k|                if (!sub.has_value()) {
 1523|  8.94k|                    node.has_duplicate_keys = true;
 1524|  8.94k|                    return {};
 1525|  8.94k|                }
 1526|  8.94k|            }
 1527|       |
 1528|       |            // Start building the set of keys involved in this node and children.
 1529|       |            // Start by keys in this node directly.
 1530|  8.94k|            size_t keys_count = node.keys.size();
 1531|  8.94k|            keyset key_set{node.keys.begin(), node.keys.end(), Comp(ctx)};
 1532|  8.94k|            if (key_set.size() != keys_count) {
 1533|       |                // It already has duplicates; bail out.
 1534|  8.94k|                node.has_duplicate_keys = true;
 1535|  8.94k|                return {};
 1536|  8.94k|            }
 1537|       |
 1538|       |            // Merge the keys from the children into this set.
 1539|  8.94k|            for (auto& sub : subs) {
 1540|  8.94k|                keys_count += sub->size();
 1541|       |                // Small optimization: std::set::merge is linear in the size of the second arg but
 1542|       |                // logarithmic in the size of the first.
 1543|  8.94k|                if (key_set.size() < sub->size()) std::swap(key_set, *sub);
 1544|  8.94k|                key_set.merge(*sub);
 1545|  8.94k|                if (key_set.size() != keys_count) {
 1546|  8.94k|                    node.has_duplicate_keys = true;
 1547|  8.94k|                    return {};
 1548|  8.94k|                }
 1549|  8.94k|            }
 1550|       |
 1551|  8.94k|            node.has_duplicate_keys = false;
 1552|  8.94k|            return key_set;
 1553|  8.94k|        };
 1554|       |
 1555|  8.94k|        TreeEval<state>(upfn);
 1556|  8.94k|    }
miniscript.cpp:_ZNK10miniscript4NodeI7CPubKeyE8TreeEvalINSt3__18optionalINS4_3setIS1_ZNKS2_17DuplicateKeyCheckIN12_GLOBAL__N_113ParserContextEEEvRKT_E4CompNS4_9allocatorIS1_EEEEEEZNKS7_IS9_EEvSC_EUlRKS2_NS4_4spanISH_Lm18446744073709551615EEEE_EESA_T0_:
  748|  8.94k|    {
  749|  8.94k|        struct DummyState {};
  750|  8.94k|        return std::move(*TreeEvalMaybe<Result>(DummyState{},
  751|  8.94k|            [](DummyState, const Node&, size_t) { return DummyState{}; },
  752|  8.94k|            [&upfn](DummyState, const Node& node, std::span<Result> subs) {
  753|  8.94k|                Result res{upfn(node, subs)};
  754|  8.94k|                return std::optional<Result>(std::move(res));
  755|  8.94k|            }
  756|  8.94k|        ));
  757|  8.94k|    }
miniscript.cpp:_ZNK10miniscript4NodeI7CPubKeyE13TreeEvalMaybeINSt3__18optionalINS4_3setIS1_ZNKS2_17DuplicateKeyCheckIN12_GLOBAL__N_113ParserContextEEEvRKT_E4CompNS4_9allocatorIS1_EEEEEEZNKS2_8TreeEvalISH_ZNKS7_IS9_EEvSC_EUlRKS2_NS4_4spanISH_Lm18446744073709551615EEEE_EESA_T0_E10DummyStateZNKSI_ISH_SN_EESA_SO_EUlSP_SK_mE_ZNKSI_ISH_SN_EESA_SO_EUlSP_SK_SM_E_EENS5_ISA_EESO_T1_T2_:
  653|  8.94k|    {
  654|       |        /** Entries of the explicit stack tracked in this algorithm. */
  655|  8.94k|        struct StackElem
  656|  8.94k|        {
  657|  8.94k|            const Node& node; //!< The node being evaluated.
  658|  8.94k|            size_t expanded; //!< How many children of this node have been expanded.
  659|  8.94k|            State state; //!< The state for that node.
  660|       |
  661|  8.94k|            StackElem(const Node& node_, size_t exp_, State&& state_) :
  662|  8.94k|                node(node_), expanded(exp_), state(std::move(state_)) {}
  663|  8.94k|        };
  664|       |        /* Stack of tree nodes being explored. */
  665|  8.94k|        std::vector<StackElem> stack;
  666|       |        /* Results of subtrees so far. Their order and mapping to tree nodes
  667|       |         * is implicitly defined by stack. */
  668|  8.94k|        std::vector<Result> results;
  669|  8.94k|        stack.emplace_back(*this, 0, std::move(root_state));
  670|       |
  671|       |        /* Here is a demonstration of the algorithm, for an example tree A(B,C(D,E),F).
  672|       |         * State variables are omitted for simplicity.
  673|       |         *
  674|       |         * First: stack=[(A,0)] results=[]
  675|       |         *        stack=[(A,1),(B,0)] results=[]
  676|       |         *        stack=[(A,1)] results=[B]
  677|       |         *        stack=[(A,2),(C,0)] results=[B]
  678|       |         *        stack=[(A,2),(C,1),(D,0)] results=[B]
  679|       |         *        stack=[(A,2),(C,1)] results=[B,D]
  680|       |         *        stack=[(A,2),(C,2),(E,0)] results=[B,D]
  681|       |         *        stack=[(A,2),(C,2)] results=[B,D,E]
  682|       |         *        stack=[(A,2)] results=[B,C]
  683|       |         *        stack=[(A,3),(F,0)] results=[B,C]
  684|       |         *        stack=[(A,3)] results=[B,C,F]
  685|       |         * Final: stack=[] results=[A]
  686|       |         */
  687|   627k|        while (stack.size()) {
  ------------------
  |  Branch (687:16): [True: 618k, False: 8.94k]
  ------------------
  688|   618k|            const Node& node = stack.back().node;
  689|   618k|            if (stack.back().expanded < node.subs.size()) {
  ------------------
  |  Branch (689:17): [True: 305k, False: 313k]
  ------------------
  690|       |                /* We encounter a tree node with at least one unexpanded child.
  691|       |                 * Expand it. By the time we hit this node again, the result of
  692|       |                 * that child (and all earlier children) will be at the end of `results`. */
  693|   305k|                size_t child_index = stack.back().expanded++;
  694|   305k|                State child_state = downfn(stack.back().state, node, child_index);
  695|   305k|                stack.emplace_back(node.subs[child_index], 0, std::move(child_state));
  696|   305k|                continue;
  697|   305k|            }
  698|       |            // Invoke upfn with the last node.subs.size() elements of results as input.
  699|   618k|            assert(results.size() >= node.subs.size());
  ------------------
  |  Branch (699:13): [True: 313k, False: 0]
  ------------------
  700|   313k|            std::optional<Result> result{upfn(std::move(stack.back().state), node,
  701|   313k|                std::span<Result>{results}.last(node.subs.size()))};
  702|       |            // If evaluation returns std::nullopt, abort immediately.
  703|   313k|            if (!result) return {};
  ------------------
  |  Branch (703:17): [True: 0, False: 313k]
  ------------------
  704|       |            // Replace the last node.subs.size() elements of results with the new result.
  705|   313k|            results.erase(results.end() - node.subs.size(), results.end());
  706|   313k|            results.push_back(std::move(*result));
  707|   313k|            stack.pop_back();
  708|   313k|        }
  709|       |        // The final remaining results element is the root result, return it.
  710|  8.94k|        assert(results.size() >= 1);
  ------------------
  |  Branch (710:9): [True: 8.94k, False: 0]
  ------------------
  711|  8.94k|        CHECK_NONFATAL(results.size() == 1);
  ------------------
  |  |  113|  8.94k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  712|  8.94k|        return std::move(results[0]);
  713|  8.94k|    }
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE13TreeEvalMaybeINSt3__18optionalINS4_3setIS1_ZNKS2_17DuplicateKeyCheckIN12_GLOBAL__N_113ParserContextEEEvRKT_E4CompNS4_9allocatorIS1_EEEEEEZNKS2_8TreeEvalISH_ZNKS7_IS9_EEvSC_EUlRKS2_NS4_4spanISH_Lm18446744073709551615EEEE_EESA_T0_E10DummyStateZNKSI_ISH_SN_EESA_SO_EUlSP_SK_mE_ZNKSI_ISH_SN_EESA_SO_EUlSP_SK_SM_E_EENS5_ISA_EESO_T1_T2_EN9StackElemC2ESK_mOSP_:
  662|   313k|                node(node_), expanded(exp_), state(std::move(state_)) {}
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE8TreeEvalINSt3__18optionalINS4_3setIS1_ZNKS2_17DuplicateKeyCheckIN12_GLOBAL__N_113ParserContextEEEvRKT_E4CompNS4_9allocatorIS1_EEEEEEZNKS7_IS9_EEvSC_EUlRKS2_NS4_4spanISH_Lm18446744073709551615EEEE_EESA_T0_ENKUlZNKS3_ISH_SM_EESA_SN_E10DummyStateSJ_mE_clESO_SJ_m:
  751|   305k|            [](DummyState, const Node&, size_t) { return DummyState{}; },
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE8TreeEvalINSt3__18optionalINS4_3setIS1_ZNKS2_17DuplicateKeyCheckIN12_GLOBAL__N_113ParserContextEEEvRKT_E4CompNS4_9allocatorIS1_EEEEEEZNKS7_IS9_EEvSC_EUlRKS2_NS4_4spanISH_Lm18446744073709551615EEEE_EESA_T0_ENKUlZNKS3_ISH_SM_EESA_SN_E10DummyStateSJ_SL_E_clESO_SJ_SL_:
  752|   313k|            [&upfn](DummyState, const Node& node, std::span<Result> subs) {
  753|   313k|                Result res{upfn(node, subs)};
  754|   313k|                return std::optional<Result>(std::move(res));
  755|   313k|            }
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE17DuplicateKeyCheckIN12_GLOBAL__N_113ParserContextEEEvRKT_ENKUlRKS2_NSt3__14spanINSB_8optionalINSB_3setIS1_ZNKS3_IS5_EEvS8_E4CompNSB_9allocatorIS1_EEEEEELm18446744073709551615EEEE_clESA_SK_:
 1516|   313k|        auto upfn = [&ctx](const Node& node, std::span<state> subs) -> state {
 1517|       |            // If this node is already known to have duplicates, nothing left to do.
 1518|   313k|            if (node.has_duplicate_keys.has_value() && *node.has_duplicate_keys) return {};
  ------------------
  |  Branch (1518:17): [True: 0, False: 313k]
  |  Branch (1518:56): [True: 0, False: 0]
  ------------------
 1519|       |
 1520|       |            // Check if one of the children is already known to have duplicates.
 1521|   313k|            for (auto& sub : subs) {
  ------------------
  |  Branch (1521:28): [True: 278k, False: 283k]
  ------------------
 1522|   278k|                if (!sub.has_value()) {
  ------------------
  |  Branch (1522:21): [True: 30.7k, False: 248k]
  ------------------
 1523|  30.7k|                    node.has_duplicate_keys = true;
 1524|  30.7k|                    return {};
 1525|  30.7k|                }
 1526|   278k|            }
 1527|       |
 1528|       |            // Start building the set of keys involved in this node and children.
 1529|       |            // Start by keys in this node directly.
 1530|   283k|            size_t keys_count = node.keys.size();
 1531|   283k|            keyset key_set{node.keys.begin(), node.keys.end(), Comp(ctx)};
 1532|   283k|            if (key_set.size() != keys_count) {
  ------------------
  |  Branch (1532:17): [True: 4.11k, False: 279k]
  ------------------
 1533|       |                // It already has duplicates; bail out.
 1534|  4.11k|                node.has_duplicate_keys = true;
 1535|  4.11k|                return {};
 1536|  4.11k|            }
 1537|       |
 1538|       |            // Merge the keys from the children into this set.
 1539|   279k|            for (auto& sub : subs) {
  ------------------
  |  Branch (1539:28): [True: 237k, False: 277k]
  ------------------
 1540|   237k|                keys_count += sub->size();
 1541|       |                // Small optimization: std::set::merge is linear in the size of the second arg but
 1542|       |                // logarithmic in the size of the first.
 1543|   237k|                if (key_set.size() < sub->size()) std::swap(key_set, *sub);
  ------------------
  |  Branch (1543:21): [True: 30.0k, False: 207k]
  ------------------
 1544|   237k|                key_set.merge(*sub);
 1545|   237k|                if (key_set.size() != keys_count) {
  ------------------
  |  Branch (1545:21): [True: 2.08k, False: 235k]
  ------------------
 1546|  2.08k|                    node.has_duplicate_keys = true;
 1547|  2.08k|                    return {};
 1548|  2.08k|                }
 1549|   237k|            }
 1550|       |
 1551|   277k|            node.has_duplicate_keys = false;
 1552|   277k|            return key_set;
 1553|   279k|        };
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE17DuplicateKeyCheckIN12_GLOBAL__N_113ParserContextEEEvRKT_EN4CompC2ERKS5_:
 1506|   283k|            Comp(const Ctx& ctx) : ctx_ptr(&ctx) {}
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE17DuplicateKeyCheckIN12_GLOBAL__N_113ParserContextEEEvRKT_ENK4CompclERKS1_SB_:
 1507|   440k|            bool operator()(const Key& a, const Key& b) const { return ctx_ptr->KeyCompare(a, b); }
_ZNK10miniscript4NodeI7CPubKeyE6GetOpsEv:
 1562|  3.13k|    std::optional<uint32_t> GetOps() const {
 1563|  3.13k|        if (!ops.sat.Valid()) return {};
  ------------------
  |  Branch (1563:13): [True: 620, False: 2.51k]
  ------------------
 1564|  2.51k|        return ops.count + ops.sat.Value();
 1565|  3.13k|    }
_ZNK10miniscript4NodeI7CPubKeyE16GetExecStackSizeEv:
 1589|  2.53k|    std::optional<uint32_t> GetExecStackSize() const {
 1590|  2.53k|        if (!ss.Sat().Valid()) return {};
  ------------------
  |  Branch (1590:13): [True: 590, False: 1.94k]
  ------------------
 1591|  1.94k|        return ss.Sat().Exec() + static_cast<int32_t>(IsBKW());
 1592|  2.53k|    }
_ZNK10miniscript4NodeI7CPubKeyE5IsBKWEv:
 1578|  5.03k|    bool IsBKW() const {
 1579|  5.03k|        return !((GetType() & "BKW"_mst) == ""_mst);
 1580|  5.03k|    }
miniscript.cpp:_ZNK10miniscript4NodeI7CPubKeyE7SatisfyIN12_GLOBAL__N_116SatisfierContextEEENS_12AvailabilityERKT_RNSt3__16vectorINSB_IhNSA_9allocatorIhEEEENSC_ISE_EEEEb:
 1709|  8.37k|    Availability Satisfy(const Ctx& ctx, std::vector<std::vector<unsigned char>>& stack, bool nonmalleable = true) const {
 1710|  8.37k|        auto ret = ProduceInput(ctx);
 1711|  8.37k|        if (nonmalleable && (ret.sat.malleable || !ret.sat.has_sig)) return Availability::NO;
  ------------------
  |  Branch (1711:13): [True: 4.18k, False: 4.18k]
  |  Branch (1711:30): [True: 551, False: 3.63k]
  |  Branch (1711:51): [True: 2.69k, False: 936]
  ------------------
 1712|  5.12k|        stack = std::move(ret.sat.stack);
 1713|  5.12k|        return ret.sat.available;
 1714|  8.37k|    }
miniscript.cpp:_ZNK10miniscript4NodeI7CPubKeyE12ProduceInputIN12_GLOBAL__N_116SatisfierContextEEENS_8internal11InputResultERKT_:
 1247|  8.37k|    internal::InputResult ProduceInput(const Ctx& ctx) const {
 1248|  8.37k|        using namespace internal;
 1249|       |
 1250|       |        // Internal function which is invoked for every tree node, constructing satisfaction/dissatisfactions
 1251|       |        // given those of its subnodes.
 1252|  8.37k|        auto helper = [&ctx](const Node& node, std::span<InputResult> subres) -> InputResult {
 1253|  8.37k|            switch (node.fragment) {
 1254|  8.37k|                case Fragment::PK_K: {
 1255|  8.37k|                    std::vector<unsigned char> sig;
 1256|  8.37k|                    Availability avail = ctx.Sign(node.keys[0], sig);
 1257|  8.37k|                    return {ZERO, InputStack(std::move(sig)).SetWithSig().SetAvailable(avail)};
 1258|  8.37k|                }
 1259|  8.37k|                case Fragment::PK_H: {
 1260|  8.37k|                    std::vector<unsigned char> key = ctx.ToPKBytes(node.keys[0]), sig;
 1261|  8.37k|                    Availability avail = ctx.Sign(node.keys[0], sig);
 1262|  8.37k|                    return {ZERO + InputStack(key), (InputStack(std::move(sig)).SetWithSig() + InputStack(key)).SetAvailable(avail)};
 1263|  8.37k|                }
 1264|  8.37k|                case Fragment::MULTI_A: {
 1265|       |                    // sats[j] represents the best stack containing j valid signatures (out of the first i keys).
 1266|       |                    // In the loop below, these stacks are built up using a dynamic programming approach.
 1267|  8.37k|                    std::vector<InputStack> sats = Vector(EMPTY);
 1268|  8.37k|                    for (size_t i = 0; i < node.keys.size(); ++i) {
 1269|       |                        // Get the signature for the i'th key in reverse order (the signature for the first key needs to
 1270|       |                        // be at the top of the stack, contrary to CHECKMULTISIG's satisfaction).
 1271|  8.37k|                        std::vector<unsigned char> sig;
 1272|  8.37k|                        Availability avail = ctx.Sign(node.keys[node.keys.size() - 1 - i], sig);
 1273|       |                        // Compute signature stack for just this key.
 1274|  8.37k|                        auto sat = InputStack(std::move(sig)).SetWithSig().SetAvailable(avail);
 1275|       |                        // Compute the next sats vector: next_sats[0] is a copy of sats[0] (no signatures). All further
 1276|       |                        // next_sats[j] are equal to either the existing sats[j] + ZERO, or sats[j-1] plus a signature
 1277|       |                        // for the current (i'th) key. The very last element needs all signatures filled.
 1278|  8.37k|                        std::vector<InputStack> next_sats;
 1279|  8.37k|                        next_sats.push_back(sats[0] + ZERO);
 1280|  8.37k|                        for (size_t j = 1; j < sats.size(); ++j) next_sats.push_back((sats[j] + ZERO) | (std::move(sats[j - 1]) + sat));
 1281|  8.37k|                        next_sats.push_back(std::move(sats[sats.size() - 1]) + std::move(sat));
 1282|       |                        // Switch over.
 1283|  8.37k|                        sats = std::move(next_sats);
 1284|  8.37k|                    }
 1285|       |                    // The dissatisfaction consists of as many empty vectors as there are keys, which is the same as
 1286|       |                    // satisfying 0 keys.
 1287|  8.37k|                    auto& nsat{sats[0]};
 1288|  8.37k|                    CHECK_NONFATAL(node.k != 0);
 1289|  8.37k|                    assert(node.k < sats.size());
 1290|  8.37k|                    return {std::move(nsat), std::move(sats[node.k])};
 1291|  8.37k|                }
 1292|  8.37k|                case Fragment::MULTI: {
 1293|       |                    // sats[j] represents the best stack containing j valid signatures (out of the first i keys).
 1294|       |                    // In the loop below, these stacks are built up using a dynamic programming approach.
 1295|       |                    // sats[0] starts off being {0}, due to the CHECKMULTISIG bug that pops off one element too many.
 1296|  8.37k|                    std::vector<InputStack> sats = Vector(ZERO);
 1297|  8.37k|                    for (size_t i = 0; i < node.keys.size(); ++i) {
 1298|  8.37k|                        std::vector<unsigned char> sig;
 1299|  8.37k|                        Availability avail = ctx.Sign(node.keys[i], sig);
 1300|       |                        // Compute signature stack for just the i'th key.
 1301|  8.37k|                        auto sat = InputStack(std::move(sig)).SetWithSig().SetAvailable(avail);
 1302|       |                        // Compute the next sats vector: next_sats[0] is a copy of sats[0] (no signatures). All further
 1303|       |                        // next_sats[j] are equal to either the existing sats[j], or sats[j-1] plus a signature for the
 1304|       |                        // current (i'th) key. The very last element needs all signatures filled.
 1305|  8.37k|                        std::vector<InputStack> next_sats;
 1306|  8.37k|                        next_sats.push_back(sats[0]);
 1307|  8.37k|                        for (size_t j = 1; j < sats.size(); ++j) next_sats.push_back(sats[j] | (std::move(sats[j - 1]) + sat));
 1308|  8.37k|                        next_sats.push_back(std::move(sats[sats.size() - 1]) + std::move(sat));
 1309|       |                        // Switch over.
 1310|  8.37k|                        sats = std::move(next_sats);
 1311|  8.37k|                    }
 1312|       |                    // The dissatisfaction consists of k+1 stack elements all equal to 0.
 1313|  8.37k|                    InputStack nsat = ZERO;
 1314|  8.37k|                    for (size_t i = 0; i < node.k; ++i) nsat = std::move(nsat) + ZERO;
 1315|  8.37k|                    assert(node.k < sats.size());
 1316|  8.37k|                    return {std::move(nsat), std::move(sats[node.k])};
 1317|  8.37k|                }
 1318|  8.37k|                case Fragment::THRESH: {
 1319|       |                    // sats[k] represents the best stack that satisfies k out of the *last* i subexpressions.
 1320|       |                    // In the loop below, these stacks are built up using a dynamic programming approach.
 1321|       |                    // sats[0] starts off empty.
 1322|  8.37k|                    std::vector<InputStack> sats = Vector(EMPTY);
 1323|  8.37k|                    for (size_t i = 0; i < subres.size(); ++i) {
 1324|       |                        // Introduce an alias for the i'th last satisfaction/dissatisfaction.
 1325|  8.37k|                        auto& res = subres[subres.size() - i - 1];
 1326|       |                        // Compute the next sats vector: next_sats[0] is sats[0] plus res.nsat (thus containing all dissatisfactions
 1327|       |                        // so far. next_sats[j] is either sats[j] + res.nsat (reusing j earlier satisfactions) or sats[j-1] + res.sat
 1328|       |                        // (reusing j-1 earlier satisfactions plus a new one). The very last next_sats[j] is all satisfactions.
 1329|  8.37k|                        std::vector<InputStack> next_sats;
 1330|  8.37k|                        next_sats.push_back(sats[0] + res.nsat);
 1331|  8.37k|                        for (size_t j = 1; j < sats.size(); ++j) next_sats.push_back((sats[j] + res.nsat) | (std::move(sats[j - 1]) + res.sat));
 1332|  8.37k|                        next_sats.push_back(std::move(sats[sats.size() - 1]) + std::move(res.sat));
 1333|       |                        // Switch over.
 1334|  8.37k|                        sats = std::move(next_sats);
 1335|  8.37k|                    }
 1336|       |                    // At this point, sats[k].sat is the best satisfaction for the overall thresh() node. The best dissatisfaction
 1337|       |                    // is computed by gathering all sats[i].nsat for i != k.
 1338|  8.37k|                    InputStack nsat = INVALID;
 1339|  8.37k|                    for (size_t i = 0; i < sats.size(); ++i) {
 1340|       |                        // i==k is the satisfaction; i==0 is the canonical dissatisfaction;
 1341|       |                        // the rest are non-canonical (a no-signature dissatisfaction - the i=0
 1342|       |                        // form - is always available) and malleable (due to overcompleteness).
 1343|       |                        // Marking the solutions malleable here is not strictly necessary, as they
 1344|       |                        // should already never be picked in non-malleable solutions due to the
 1345|       |                        // availability of the i=0 form.
 1346|  8.37k|                        if (i != 0 && i != node.k) sats[i].SetMalleable().SetNonCanon();
 1347|       |                        // Include all dissatisfactions (even these non-canonical ones) in nsat.
 1348|  8.37k|                        if (i != node.k) nsat = std::move(nsat) | std::move(sats[i]);
 1349|  8.37k|                    }
 1350|  8.37k|                    assert(node.k < sats.size());
 1351|  8.37k|                    return {std::move(nsat), std::move(sats[node.k])};
 1352|  8.37k|                }
 1353|  8.37k|                case Fragment::OLDER: {
 1354|  8.37k|                    return {INVALID, ctx.CheckOlder(node.k) ? EMPTY : INVALID};
 1355|  8.37k|                }
 1356|  8.37k|                case Fragment::AFTER: {
 1357|  8.37k|                    return {INVALID, ctx.CheckAfter(node.k) ? EMPTY : INVALID};
 1358|  8.37k|                }
 1359|  8.37k|                case Fragment::SHA256: {
 1360|  8.37k|                    std::vector<unsigned char> preimage;
 1361|  8.37k|                    Availability avail = ctx.SatSHA256(node.data, preimage);
 1362|  8.37k|                    return {ZERO32, InputStack(std::move(preimage)).SetAvailable(avail)};
 1363|  8.37k|                }
 1364|  8.37k|                case Fragment::RIPEMD160: {
 1365|  8.37k|                    std::vector<unsigned char> preimage;
 1366|  8.37k|                    Availability avail = ctx.SatRIPEMD160(node.data, preimage);
 1367|  8.37k|                    return {ZERO32, InputStack(std::move(preimage)).SetAvailable(avail)};
 1368|  8.37k|                }
 1369|  8.37k|                case Fragment::HASH256: {
 1370|  8.37k|                    std::vector<unsigned char> preimage;
 1371|  8.37k|                    Availability avail = ctx.SatHASH256(node.data, preimage);
 1372|  8.37k|                    return {ZERO32, InputStack(std::move(preimage)).SetAvailable(avail)};
 1373|  8.37k|                }
 1374|  8.37k|                case Fragment::HASH160: {
 1375|  8.37k|                    std::vector<unsigned char> preimage;
 1376|  8.37k|                    Availability avail = ctx.SatHASH160(node.data, preimage);
 1377|  8.37k|                    return {ZERO32, InputStack(std::move(preimage)).SetAvailable(avail)};
 1378|  8.37k|                }
 1379|  8.37k|                case Fragment::AND_V: {
 1380|  8.37k|                    auto& x = subres[0], &y = subres[1];
 1381|       |                    // As the dissatisfaction here only consist of a single option, it doesn't
 1382|       |                    // actually need to be listed (it's not required for reasoning about malleability of
 1383|       |                    // other options), and is never required (no valid miniscript relies on the ability
 1384|       |                    // to satisfy the type V left subexpression). It's still listed here for
 1385|       |                    // completeness, as a hypothetical (not currently implemented) satisfier that doesn't
 1386|       |                    // care about malleability might in some cases prefer it still.
 1387|  8.37k|                    return {(y.nsat + x.sat).SetNonCanon(), y.sat + x.sat};
 1388|  8.37k|                }
 1389|  8.37k|                case Fragment::AND_B: {
 1390|  8.37k|                    auto& x = subres[0], &y = subres[1];
 1391|       |                    // Note that it is not strictly necessary to mark the 2nd and 3rd dissatisfaction here
 1392|       |                    // as malleable. While they are definitely malleable, they are also non-canonical due
 1393|       |                    // to the guaranteed existence of a no-signature other dissatisfaction (the 1st)
 1394|       |                    // option. Because of that, the 2nd and 3rd option will never be chosen, even if they
 1395|       |                    // weren't marked as malleable.
 1396|  8.37k|                    return {(y.nsat + x.nsat) | (y.sat + x.nsat).SetMalleable().SetNonCanon() | (y.nsat + x.sat).SetMalleable().SetNonCanon(), y.sat + x.sat};
 1397|  8.37k|                }
 1398|  8.37k|                case Fragment::OR_B: {
 1399|  8.37k|                    auto& x = subres[0], &z = subres[1];
 1400|       |                    // The (sat(Z) sat(X)) solution is overcomplete (attacker can change either into dsat).
 1401|  8.37k|                    return {z.nsat + x.nsat, (z.nsat + x.sat) | (z.sat + x.nsat) | (z.sat + x.sat).SetMalleable().SetNonCanon()};
 1402|  8.37k|                }
 1403|  8.37k|                case Fragment::OR_C: {
 1404|  8.37k|                    auto& x = subres[0], &z = subres[1];
 1405|  8.37k|                    return {INVALID, std::move(x.sat) | (z.sat + x.nsat)};
 1406|  8.37k|                }
 1407|  8.37k|                case Fragment::OR_D: {
 1408|  8.37k|                    auto& x = subres[0], &z = subres[1];
 1409|  8.37k|                    return {z.nsat + x.nsat, std::move(x.sat) | (z.sat + x.nsat)};
 1410|  8.37k|                }
 1411|  8.37k|                case Fragment::OR_I: {
 1412|  8.37k|                    auto& x = subres[0], &z = subres[1];
 1413|  8.37k|                    return {(x.nsat + ONE) | (z.nsat + ZERO), (x.sat + ONE) | (z.sat + ZERO)};
 1414|  8.37k|                }
 1415|  8.37k|                case Fragment::ANDOR: {
 1416|  8.37k|                    auto& x = subres[0], &y = subres[1], &z = subres[2];
 1417|  8.37k|                    return {(y.nsat + x.sat).SetNonCanon() | (z.nsat + x.nsat), (y.sat + x.sat) | (z.sat + x.nsat)};
 1418|  8.37k|                }
 1419|  8.37k|                case Fragment::WRAP_A:
 1420|  8.37k|                case Fragment::WRAP_S:
 1421|  8.37k|                case Fragment::WRAP_C:
 1422|  8.37k|                case Fragment::WRAP_N:
 1423|  8.37k|                    return std::move(subres[0]);
 1424|  8.37k|                case Fragment::WRAP_D: {
 1425|  8.37k|                    auto &x = subres[0];
 1426|  8.37k|                    return {ZERO, x.sat + ONE};
 1427|  8.37k|                }
 1428|  8.37k|                case Fragment::WRAP_J: {
 1429|  8.37k|                    auto &x = subres[0];
 1430|       |                    // If a dissatisfaction with a nonzero top stack element exists, an alternative dissatisfaction exists.
 1431|       |                    // As the dissatisfaction logic currently doesn't keep track of this nonzeroness property, and thus even
 1432|       |                    // if a dissatisfaction with a top zero element is found, we don't know whether another one with a
 1433|       |                    // nonzero top stack element exists. Make the conservative assumption that whenever the subexpression is weakly
 1434|       |                    // dissatisfiable, this alternative dissatisfaction exists and leads to malleability.
 1435|  8.37k|                    return {InputStack(ZERO).SetMalleable(x.nsat.available != Availability::NO && !x.nsat.has_sig), std::move(x.sat)};
 1436|  8.37k|                }
 1437|  8.37k|                case Fragment::WRAP_V: {
 1438|  8.37k|                    auto &x = subres[0];
 1439|  8.37k|                    return {INVALID, std::move(x.sat)};
 1440|  8.37k|                }
 1441|  8.37k|                case Fragment::JUST_0: return {EMPTY, INVALID};
 1442|  8.37k|                case Fragment::JUST_1: return {INVALID, EMPTY};
 1443|  8.37k|            }
 1444|  8.37k|            assert(false);
 1445|  8.37k|            return {INVALID, INVALID};
 1446|  8.37k|        };
 1447|       |
 1448|  8.37k|        auto tester = [&helper](const Node& node, std::span<InputResult> subres) -> InputResult {
 1449|  8.37k|            auto ret = helper(node, subres);
 1450|       |
 1451|       |            // Do a consistency check between the satisfaction code and the type checker
 1452|       |            // (the actual satisfaction code in ProduceInputHelper does not use GetType)
 1453|       |
 1454|       |            // For 'z' nodes, available satisfactions/dissatisfactions must have stack size 0.
 1455|  8.37k|            if (node.GetType() << "z"_mst && ret.nsat.available != Availability::NO) CHECK_NONFATAL(ret.nsat.stack.size() == 0);
 1456|  8.37k|            if (node.GetType() << "z"_mst && ret.sat.available != Availability::NO) CHECK_NONFATAL(ret.sat.stack.size() == 0);
 1457|       |
 1458|       |            // For 'o' nodes, available satisfactions/dissatisfactions must have stack size 1.
 1459|  8.37k|            if (node.GetType() << "o"_mst && ret.nsat.available != Availability::NO) CHECK_NONFATAL(ret.nsat.stack.size() == 1);
 1460|  8.37k|            if (node.GetType() << "o"_mst && ret.sat.available != Availability::NO) CHECK_NONFATAL(ret.sat.stack.size() == 1);
 1461|       |
 1462|       |            // For 'n' nodes, available satisfactions/dissatisfactions must have stack size 1 or larger. For satisfactions,
 1463|       |            // the top element cannot be 0.
 1464|  8.37k|            if (node.GetType() << "n"_mst && ret.sat.available != Availability::NO) CHECK_NONFATAL(ret.sat.stack.size() >= 1);
 1465|  8.37k|            if (node.GetType() << "n"_mst && ret.nsat.available != Availability::NO) CHECK_NONFATAL(ret.nsat.stack.size() >= 1);
 1466|  8.37k|            if (node.GetType() << "n"_mst && ret.sat.available != Availability::NO) CHECK_NONFATAL(!ret.sat.stack.back().empty());
 1467|       |
 1468|       |            // For 'd' nodes, a dissatisfaction must exist, and they must not need a signature. If it is non-malleable,
 1469|       |            // it must be canonical.
 1470|  8.37k|            if (node.GetType() << "d"_mst) CHECK_NONFATAL(ret.nsat.available != Availability::NO);
 1471|  8.37k|            if (node.GetType() << "d"_mst) CHECK_NONFATAL(!ret.nsat.has_sig);
 1472|  8.37k|            if (node.GetType() << "d"_mst && !ret.nsat.malleable) CHECK_NONFATAL(!ret.nsat.non_canon);
 1473|       |
 1474|       |            // For 'f'/'s' nodes, dissatisfactions/satisfactions must have a signature.
 1475|  8.37k|            if (node.GetType() << "f"_mst && ret.nsat.available != Availability::NO) CHECK_NONFATAL(ret.nsat.has_sig);
 1476|  8.37k|            if (node.GetType() << "s"_mst && ret.sat.available != Availability::NO) CHECK_NONFATAL(ret.sat.has_sig);
 1477|       |
 1478|       |            // For non-malleable 'e' nodes, a non-malleable dissatisfaction must exist.
 1479|  8.37k|            if (node.GetType() << "me"_mst) CHECK_NONFATAL(ret.nsat.available != Availability::NO);
 1480|  8.37k|            if (node.GetType() << "me"_mst) CHECK_NONFATAL(!ret.nsat.malleable);
 1481|       |
 1482|       |            // For 'm' nodes, if a satisfaction exists, it must be non-malleable.
 1483|  8.37k|            if (node.GetType() << "m"_mst && ret.sat.available != Availability::NO) CHECK_NONFATAL(!ret.sat.malleable);
 1484|       |
 1485|       |            // If a non-malleable satisfaction exists, it must be canonical.
 1486|  8.37k|            if (ret.sat.available != Availability::NO && !ret.sat.malleable) CHECK_NONFATAL(!ret.sat.non_canon);
 1487|       |
 1488|  8.37k|            return ret;
 1489|  8.37k|        };
 1490|       |
 1491|  8.37k|        return TreeEval<InputResult>(tester);
 1492|  8.37k|    }
miniscript.cpp:_ZNK10miniscript4NodeI7CPubKeyE8TreeEvalINS_8internal11InputResultEZNKS2_12ProduceInputIN12_GLOBAL__N_116SatisfierContextEEES5_RKT_EUlRKS2_NSt3__14spanIS5_Lm18446744073709551615EEEE0_EES9_T0_:
  748|  8.37k|    {
  749|  8.37k|        struct DummyState {};
  750|  8.37k|        return std::move(*TreeEvalMaybe<Result>(DummyState{},
  751|  8.37k|            [](DummyState, const Node&, size_t) { return DummyState{}; },
  752|  8.37k|            [&upfn](DummyState, const Node& node, std::span<Result> subs) {
  753|  8.37k|                Result res{upfn(node, subs)};
  754|  8.37k|                return std::optional<Result>(std::move(res));
  755|  8.37k|            }
  756|  8.37k|        ));
  757|  8.37k|    }
miniscript.cpp:_ZNK10miniscript4NodeI7CPubKeyE13TreeEvalMaybeINS_8internal11InputResultEZNKS2_8TreeEvalIS5_ZNKS2_12ProduceInputIN12_GLOBAL__N_116SatisfierContextEEES5_RKT_EUlRKS2_NSt3__14spanIS5_Lm18446744073709551615EEEE0_EESA_T0_E10DummyStateZNKS6_IS5_SI_EESA_SJ_EUlSK_SE_mE_ZNKS6_IS5_SI_EESA_SJ_EUlSK_SE_SH_E_EENSF_8optionalISA_EESJ_T1_T2_:
  653|  8.37k|    {
  654|       |        /** Entries of the explicit stack tracked in this algorithm. */
  655|  8.37k|        struct StackElem
  656|  8.37k|        {
  657|  8.37k|            const Node& node; //!< The node being evaluated.
  658|  8.37k|            size_t expanded; //!< How many children of this node have been expanded.
  659|  8.37k|            State state; //!< The state for that node.
  660|       |
  661|  8.37k|            StackElem(const Node& node_, size_t exp_, State&& state_) :
  662|  8.37k|                node(node_), expanded(exp_), state(std::move(state_)) {}
  663|  8.37k|        };
  664|       |        /* Stack of tree nodes being explored. */
  665|  8.37k|        std::vector<StackElem> stack;
  666|       |        /* Results of subtrees so far. Their order and mapping to tree nodes
  667|       |         * is implicitly defined by stack. */
  668|  8.37k|        std::vector<Result> results;
  669|  8.37k|        stack.emplace_back(*this, 0, std::move(root_state));
  670|       |
  671|       |        /* Here is a demonstration of the algorithm, for an example tree A(B,C(D,E),F).
  672|       |         * State variables are omitted for simplicity.
  673|       |         *
  674|       |         * First: stack=[(A,0)] results=[]
  675|       |         *        stack=[(A,1),(B,0)] results=[]
  676|       |         *        stack=[(A,1)] results=[B]
  677|       |         *        stack=[(A,2),(C,0)] results=[B]
  678|       |         *        stack=[(A,2),(C,1),(D,0)] results=[B]
  679|       |         *        stack=[(A,2),(C,1)] results=[B,D]
  680|       |         *        stack=[(A,2),(C,2),(E,0)] results=[B,D]
  681|       |         *        stack=[(A,2),(C,2)] results=[B,D,E]
  682|       |         *        stack=[(A,2)] results=[B,C]
  683|       |         *        stack=[(A,3),(F,0)] results=[B,C]
  684|       |         *        stack=[(A,3)] results=[B,C,F]
  685|       |         * Final: stack=[] results=[A]
  686|       |         */
  687|   593k|        while (stack.size()) {
  ------------------
  |  Branch (687:16): [True: 585k, False: 8.37k]
  ------------------
  688|   585k|            const Node& node = stack.back().node;
  689|   585k|            if (stack.back().expanded < node.subs.size()) {
  ------------------
  |  Branch (689:17): [True: 288k, False: 296k]
  ------------------
  690|       |                /* We encounter a tree node with at least one unexpanded child.
  691|       |                 * Expand it. By the time we hit this node again, the result of
  692|       |                 * that child (and all earlier children) will be at the end of `results`. */
  693|   288k|                size_t child_index = stack.back().expanded++;
  694|   288k|                State child_state = downfn(stack.back().state, node, child_index);
  695|   288k|                stack.emplace_back(node.subs[child_index], 0, std::move(child_state));
  696|   288k|                continue;
  697|   288k|            }
  698|       |            // Invoke upfn with the last node.subs.size() elements of results as input.
  699|   585k|            assert(results.size() >= node.subs.size());
  ------------------
  |  Branch (699:13): [True: 296k, False: 0]
  ------------------
  700|   296k|            std::optional<Result> result{upfn(std::move(stack.back().state), node,
  701|   296k|                std::span<Result>{results}.last(node.subs.size()))};
  702|       |            // If evaluation returns std::nullopt, abort immediately.
  703|   296k|            if (!result) return {};
  ------------------
  |  Branch (703:17): [True: 0, False: 296k]
  ------------------
  704|       |            // Replace the last node.subs.size() elements of results with the new result.
  705|   296k|            results.erase(results.end() - node.subs.size(), results.end());
  706|   296k|            results.push_back(std::move(*result));
  707|   296k|            stack.pop_back();
  708|   296k|        }
  709|       |        // The final remaining results element is the root result, return it.
  710|  8.37k|        assert(results.size() >= 1);
  ------------------
  |  Branch (710:9): [True: 8.37k, False: 0]
  ------------------
  711|  8.37k|        CHECK_NONFATAL(results.size() == 1);
  ------------------
  |  |  113|  8.37k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  712|  8.37k|        return std::move(results[0]);
  713|  8.37k|    }
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE13TreeEvalMaybeINS_8internal11InputResultEZNKS2_8TreeEvalIS5_ZNKS2_12ProduceInputIN12_GLOBAL__N_116SatisfierContextEEES5_RKT_EUlRKS2_NSt3__14spanIS5_Lm18446744073709551615EEEE0_EESA_T0_E10DummyStateZNKS6_IS5_SI_EESA_SJ_EUlSK_SE_mE_ZNKS6_IS5_SI_EESA_SJ_EUlSK_SE_SH_E_EENSF_8optionalISA_EESJ_T1_T2_EN9StackElemC2ESE_mOSK_:
  662|   296k|                node(node_), expanded(exp_), state(std::move(state_)) {}
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE8TreeEvalINS_8internal11InputResultEZNKS2_12ProduceInputIN12_GLOBAL__N_116SatisfierContextEEES5_RKT_EUlRKS2_NSt3__14spanIS5_Lm18446744073709551615EEEE0_EES9_T0_ENKUlZNKS3_IS5_SH_EES9_SI_E10DummyStateSD_mE_clESJ_SD_m:
  751|   288k|            [](DummyState, const Node&, size_t) { return DummyState{}; },
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE8TreeEvalINS_8internal11InputResultEZNKS2_12ProduceInputIN12_GLOBAL__N_116SatisfierContextEEES5_RKT_EUlRKS2_NSt3__14spanIS5_Lm18446744073709551615EEEE0_EES9_T0_ENKUlZNKS3_IS5_SH_EES9_SI_E10DummyStateSD_SG_E_clESJ_SD_SG_:
  752|   296k|            [&upfn](DummyState, const Node& node, std::span<Result> subs) {
  753|   296k|                Result res{upfn(node, subs)};
  754|   296k|                return std::optional<Result>(std::move(res));
  755|   296k|            }
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE12ProduceInputIN12_GLOBAL__N_116SatisfierContextEEENS_8internal11InputResultERKT_ENKUlRKS2_NSt3__14spanIS7_Lm18446744073709551615EEEE0_clESC_SF_:
 1448|   296k|        auto tester = [&helper](const Node& node, std::span<InputResult> subres) -> InputResult {
 1449|   296k|            auto ret = helper(node, subres);
 1450|       |
 1451|       |            // Do a consistency check between the satisfaction code and the type checker
 1452|       |            // (the actual satisfaction code in ProduceInputHelper does not use GetType)
 1453|       |
 1454|       |            // For 'z' nodes, available satisfactions/dissatisfactions must have stack size 0.
 1455|   296k|            if (node.GetType() << "z"_mst && ret.nsat.available != Availability::NO) CHECK_NONFATAL(ret.nsat.stack.size() == 0);
  ------------------
  |  |  113|  84.1k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  |  Branch (1455:17): [True: 123k, False: 173k]
  |  Branch (1455:17): [True: 84.1k, False: 212k]
  |  Branch (1455:46): [True: 84.1k, False: 39.3k]
  ------------------
 1456|   296k|            if (node.GetType() << "z"_mst && ret.sat.available != Availability::NO) CHECK_NONFATAL(ret.sat.stack.size() == 0);
  ------------------
  |  |  113|  17.5k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  |  Branch (1456:17): [True: 123k, False: 173k]
  |  Branch (1456:17): [True: 17.5k, False: 279k]
  |  Branch (1456:46): [True: 17.5k, False: 106k]
  ------------------
 1457|       |
 1458|       |            // For 'o' nodes, available satisfactions/dissatisfactions must have stack size 1.
 1459|   296k|            if (node.GetType() << "o"_mst && ret.nsat.available != Availability::NO) CHECK_NONFATAL(ret.nsat.stack.size() == 1);
  ------------------
  |  |  113|  40.3k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  |  Branch (1459:17): [True: 49.9k, False: 246k]
  |  Branch (1459:17): [True: 40.3k, False: 256k]
  |  Branch (1459:46): [True: 40.3k, False: 9.53k]
  ------------------
 1460|   296k|            if (node.GetType() << "o"_mst && ret.sat.available != Availability::NO) CHECK_NONFATAL(ret.sat.stack.size() == 1);
  ------------------
  |  |  113|  16.2k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  |  Branch (1460:17): [True: 49.9k, False: 246k]
  |  Branch (1460:17): [True: 16.2k, False: 280k]
  |  Branch (1460:46): [True: 16.2k, False: 33.6k]
  ------------------
 1461|       |
 1462|       |            // For 'n' nodes, available satisfactions/dissatisfactions must have stack size 1 or larger. For satisfactions,
 1463|       |            // the top element cannot be 0.
 1464|   296k|            if (node.GetType() << "n"_mst && ret.sat.available != Availability::NO) CHECK_NONFATAL(ret.sat.stack.size() >= 1);
  ------------------
  |  |  113|  29.0k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  |  Branch (1464:17): [True: 72.2k, False: 224k]
  |  Branch (1464:17): [True: 29.0k, False: 267k]
  |  Branch (1464:46): [True: 29.0k, False: 43.2k]
  ------------------
 1465|   296k|            if (node.GetType() << "n"_mst && ret.nsat.available != Availability::NO) CHECK_NONFATAL(ret.nsat.stack.size() >= 1);
  ------------------
  |  |  113|  53.2k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  |  Branch (1465:17): [True: 72.2k, False: 224k]
  |  Branch (1465:17): [True: 53.2k, False: 243k]
  |  Branch (1465:46): [True: 53.2k, False: 19.0k]
  ------------------
 1466|   296k|            if (node.GetType() << "n"_mst && ret.sat.available != Availability::NO) CHECK_NONFATAL(!ret.sat.stack.back().empty());
  ------------------
  |  |  113|  29.0k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  |  Branch (1466:17): [True: 72.2k, False: 224k]
  |  Branch (1466:17): [True: 29.0k, False: 267k]
  |  Branch (1466:46): [True: 29.0k, False: 43.2k]
  ------------------
 1467|       |
 1468|       |            // For 'd' nodes, a dissatisfaction must exist, and they must not need a signature. If it is non-malleable,
 1469|       |            // it must be canonical.
 1470|   296k|            if (node.GetType() << "d"_mst) CHECK_NONFATAL(ret.nsat.available != Availability::NO);
  ------------------
  |  |  113|   214k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  |  Branch (1470:17): [True: 214k, False: 81.9k]
  ------------------
 1471|   296k|            if (node.GetType() << "d"_mst) CHECK_NONFATAL(!ret.nsat.has_sig);
  ------------------
  |  |  113|   214k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  |  Branch (1471:17): [True: 214k, False: 81.9k]
  ------------------
 1472|   296k|            if (node.GetType() << "d"_mst && !ret.nsat.malleable) CHECK_NONFATAL(!ret.nsat.non_canon);
  ------------------
  |  |  113|   173k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  |  Branch (1472:17): [True: 214k, False: 81.9k]
  |  Branch (1472:17): [True: 173k, False: 123k]
  |  Branch (1472:46): [True: 173k, False: 41.5k]
  ------------------
 1473|       |
 1474|       |            // For 'f'/'s' nodes, dissatisfactions/satisfactions must have a signature.
 1475|   296k|            if (node.GetType() << "f"_mst && ret.nsat.available != Availability::NO) CHECK_NONFATAL(ret.nsat.has_sig);
  ------------------
  |  |  113|  3.50k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  |  Branch (1475:17): [True: 77.7k, False: 219k]
  |  Branch (1475:17): [True: 3.50k, False: 293k]
  |  Branch (1475:46): [True: 3.50k, False: 74.2k]
  ------------------
 1476|   296k|            if (node.GetType() << "s"_mst && ret.sat.available != Availability::NO) CHECK_NONFATAL(ret.sat.has_sig);
  ------------------
  |  |  113|  33.3k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  |  Branch (1476:17): [True: 234k, False: 61.8k]
  |  Branch (1476:17): [True: 33.3k, False: 263k]
  |  Branch (1476:46): [True: 33.3k, False: 201k]
  ------------------
 1477|       |
 1478|       |            // For non-malleable 'e' nodes, a non-malleable dissatisfaction must exist.
 1479|   296k|            if (node.GetType() << "me"_mst) CHECK_NONFATAL(ret.nsat.available != Availability::NO);
  ------------------
  |  |  113|   171k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  |  Branch (1479:17): [True: 171k, False: 125k]
  ------------------
 1480|   296k|            if (node.GetType() << "me"_mst) CHECK_NONFATAL(!ret.nsat.malleable);
  ------------------
  |  |  113|   171k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  |  Branch (1480:17): [True: 171k, False: 125k]
  ------------------
 1481|       |
 1482|       |            // For 'm' nodes, if a satisfaction exists, it must be non-malleable.
 1483|   296k|            if (node.GetType() << "m"_mst && ret.sat.available != Availability::NO) CHECK_NONFATAL(!ret.sat.malleable);
  ------------------
  |  |  113|  63.4k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  |  Branch (1483:17): [True: 271k, False: 25.3k]
  |  Branch (1483:17): [True: 63.4k, False: 233k]
  |  Branch (1483:46): [True: 63.4k, False: 208k]
  ------------------
 1484|       |
 1485|       |            // If a non-malleable satisfaction exists, it must be canonical.
 1486|   296k|            if (ret.sat.available != Availability::NO && !ret.sat.malleable) CHECK_NONFATAL(!ret.sat.non_canon);
  ------------------
  |  |  113|  67.4k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  |  Branch (1486:17): [True: 75.6k, False: 221k]
  |  Branch (1486:58): [True: 67.4k, False: 8.17k]
  ------------------
 1487|       |
 1488|   296k|            return ret;
 1489|   296k|        };
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE12ProduceInputIN12_GLOBAL__N_116SatisfierContextEEENS_8internal11InputResultERKT_ENKUlRKS2_NSt3__14spanIS7_Lm18446744073709551615EEEE_clESC_SF_:
 1252|   296k|        auto helper = [&ctx](const Node& node, std::span<InputResult> subres) -> InputResult {
 1253|   296k|            switch (node.fragment) {
  ------------------
  |  Branch (1253:21): [True: 296k, False: 0]
  ------------------
 1254|  13.9k|                case Fragment::PK_K: {
  ------------------
  |  Branch (1254:17): [True: 13.9k, False: 282k]
  ------------------
 1255|  13.9k|                    std::vector<unsigned char> sig;
 1256|  13.9k|                    Availability avail = ctx.Sign(node.keys[0], sig);
 1257|  13.9k|                    return {ZERO, InputStack(std::move(sig)).SetWithSig().SetAvailable(avail)};
 1258|      0|                }
 1259|  3.52k|                case Fragment::PK_H: {
  ------------------
  |  Branch (1259:17): [True: 3.52k, False: 293k]
  ------------------
 1260|  3.52k|                    std::vector<unsigned char> key = ctx.ToPKBytes(node.keys[0]), sig;
 1261|  3.52k|                    Availability avail = ctx.Sign(node.keys[0], sig);
 1262|  3.52k|                    return {ZERO + InputStack(key), (InputStack(std::move(sig)).SetWithSig() + InputStack(key)).SetAvailable(avail)};
 1263|      0|                }
 1264|  1.97k|                case Fragment::MULTI_A: {
  ------------------
  |  Branch (1264:17): [True: 1.97k, False: 294k]
  ------------------
 1265|       |                    // sats[j] represents the best stack containing j valid signatures (out of the first i keys).
 1266|       |                    // In the loop below, these stacks are built up using a dynamic programming approach.
 1267|  1.97k|                    std::vector<InputStack> sats = Vector(EMPTY);
 1268|  45.5k|                    for (size_t i = 0; i < node.keys.size(); ++i) {
  ------------------
  |  Branch (1268:40): [True: 43.5k, False: 1.97k]
  ------------------
 1269|       |                        // Get the signature for the i'th key in reverse order (the signature for the first key needs to
 1270|       |                        // be at the top of the stack, contrary to CHECKMULTISIG's satisfaction).
 1271|  43.5k|                        std::vector<unsigned char> sig;
 1272|  43.5k|                        Availability avail = ctx.Sign(node.keys[node.keys.size() - 1 - i], sig);
 1273|       |                        // Compute signature stack for just this key.
 1274|  43.5k|                        auto sat = InputStack(std::move(sig)).SetWithSig().SetAvailable(avail);
 1275|       |                        // Compute the next sats vector: next_sats[0] is a copy of sats[0] (no signatures). All further
 1276|       |                        // next_sats[j] are equal to either the existing sats[j] + ZERO, or sats[j-1] plus a signature
 1277|       |                        // for the current (i'th) key. The very last element needs all signatures filled.
 1278|  43.5k|                        std::vector<InputStack> next_sats;
 1279|  43.5k|                        next_sats.push_back(sats[0] + ZERO);
 1280|  1.61M|                        for (size_t j = 1; j < sats.size(); ++j) next_sats.push_back((sats[j] + ZERO) | (std::move(sats[j - 1]) + sat));
  ------------------
  |  Branch (1280:44): [True: 1.56M, False: 43.5k]
  ------------------
 1281|  43.5k|                        next_sats.push_back(std::move(sats[sats.size() - 1]) + std::move(sat));
 1282|       |                        // Switch over.
 1283|  43.5k|                        sats = std::move(next_sats);
 1284|  43.5k|                    }
 1285|       |                    // The dissatisfaction consists of as many empty vectors as there are keys, which is the same as
 1286|       |                    // satisfying 0 keys.
 1287|  1.97k|                    auto& nsat{sats[0]};
 1288|  1.97k|                    CHECK_NONFATAL(node.k != 0);
  ------------------
  |  |  113|  1.97k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
 1289|  1.97k|                    assert(node.k < sats.size());
  ------------------
  |  Branch (1289:21): [True: 1.97k, False: 0]
  ------------------
 1290|  1.97k|                    return {std::move(nsat), std::move(sats[node.k])};
 1291|  1.97k|                }
 1292|  9.08k|                case Fragment::MULTI: {
  ------------------
  |  Branch (1292:17): [True: 9.08k, False: 287k]
  ------------------
 1293|       |                    // sats[j] represents the best stack containing j valid signatures (out of the first i keys).
 1294|       |                    // In the loop below, these stacks are built up using a dynamic programming approach.
 1295|       |                    // sats[0] starts off being {0}, due to the CHECKMULTISIG bug that pops off one element too many.
 1296|  9.08k|                    std::vector<InputStack> sats = Vector(ZERO);
 1297|  59.1k|                    for (size_t i = 0; i < node.keys.size(); ++i) {
  ------------------
  |  Branch (1297:40): [True: 50.1k, False: 9.08k]
  ------------------
 1298|  50.1k|                        std::vector<unsigned char> sig;
 1299|  50.1k|                        Availability avail = ctx.Sign(node.keys[i], sig);
 1300|       |                        // Compute signature stack for just the i'th key.
 1301|  50.1k|                        auto sat = InputStack(std::move(sig)).SetWithSig().SetAvailable(avail);
 1302|       |                        // Compute the next sats vector: next_sats[0] is a copy of sats[0] (no signatures). All further
 1303|       |                        // next_sats[j] are equal to either the existing sats[j], or sats[j-1] plus a signature for the
 1304|       |                        // current (i'th) key. The very last element needs all signatures filled.
 1305|  50.1k|                        std::vector<InputStack> next_sats;
 1306|  50.1k|                        next_sats.push_back(sats[0]);
 1307|   341k|                        for (size_t j = 1; j < sats.size(); ++j) next_sats.push_back(sats[j] | (std::move(sats[j - 1]) + sat));
  ------------------
  |  Branch (1307:44): [True: 291k, False: 50.1k]
  ------------------
 1308|  50.1k|                        next_sats.push_back(std::move(sats[sats.size() - 1]) + std::move(sat));
 1309|       |                        // Switch over.
 1310|  50.1k|                        sats = std::move(next_sats);
 1311|  50.1k|                    }
 1312|       |                    // The dissatisfaction consists of k+1 stack elements all equal to 0.
 1313|  9.08k|                    InputStack nsat = ZERO;
 1314|  40.5k|                    for (size_t i = 0; i < node.k; ++i) nsat = std::move(nsat) + ZERO;
  ------------------
  |  Branch (1314:40): [True: 31.4k, False: 9.08k]
  ------------------
 1315|  9.08k|                    assert(node.k < sats.size());
  ------------------
  |  Branch (1315:21): [True: 9.08k, False: 0]
  ------------------
 1316|  9.08k|                    return {std::move(nsat), std::move(sats[node.k])};
 1317|  9.08k|                }
 1318|  11.8k|                case Fragment::THRESH: {
  ------------------
  |  Branch (1318:17): [True: 11.8k, False: 284k]
  ------------------
 1319|       |                    // sats[k] represents the best stack that satisfies k out of the *last* i subexpressions.
 1320|       |                    // In the loop below, these stacks are built up using a dynamic programming approach.
 1321|       |                    // sats[0] starts off empty.
 1322|  11.8k|                    std::vector<InputStack> sats = Vector(EMPTY);
 1323|  52.4k|                    for (size_t i = 0; i < subres.size(); ++i) {
  ------------------
  |  Branch (1323:40): [True: 40.5k, False: 11.8k]
  ------------------
 1324|       |                        // Introduce an alias for the i'th last satisfaction/dissatisfaction.
 1325|  40.5k|                        auto& res = subres[subres.size() - i - 1];
 1326|       |                        // Compute the next sats vector: next_sats[0] is sats[0] plus res.nsat (thus containing all dissatisfactions
 1327|       |                        // so far. next_sats[j] is either sats[j] + res.nsat (reusing j earlier satisfactions) or sats[j-1] + res.sat
 1328|       |                        // (reusing j-1 earlier satisfactions plus a new one). The very last next_sats[j] is all satisfactions.
 1329|  40.5k|                        std::vector<InputStack> next_sats;
 1330|  40.5k|                        next_sats.push_back(sats[0] + res.nsat);
 1331|   652k|                        for (size_t j = 1; j < sats.size(); ++j) next_sats.push_back((sats[j] + res.nsat) | (std::move(sats[j - 1]) + res.sat));
  ------------------
  |  Branch (1331:44): [True: 611k, False: 40.5k]
  ------------------
 1332|  40.5k|                        next_sats.push_back(std::move(sats[sats.size() - 1]) + std::move(res.sat));
 1333|       |                        // Switch over.
 1334|  40.5k|                        sats = std::move(next_sats);
 1335|  40.5k|                    }
 1336|       |                    // At this point, sats[k].sat is the best satisfaction for the overall thresh() node. The best dissatisfaction
 1337|       |                    // is computed by gathering all sats[i].nsat for i != k.
 1338|  11.8k|                    InputStack nsat = INVALID;
 1339|  64.3k|                    for (size_t i = 0; i < sats.size(); ++i) {
  ------------------
  |  Branch (1339:40): [True: 52.4k, False: 11.8k]
  ------------------
 1340|       |                        // i==k is the satisfaction; i==0 is the canonical dissatisfaction;
 1341|       |                        // the rest are non-canonical (a no-signature dissatisfaction - the i=0
 1342|       |                        // form - is always available) and malleable (due to overcompleteness).
 1343|       |                        // Marking the solutions malleable here is not strictly necessary, as they
 1344|       |                        // should already never be picked in non-malleable solutions due to the
 1345|       |                        // availability of the i=0 form.
 1346|  52.4k|                        if (i != 0 && i != node.k) sats[i].SetMalleable().SetNonCanon();
  ------------------
  |  Branch (1346:29): [True: 40.5k, False: 11.8k]
  |  Branch (1346:39): [True: 28.6k, False: 11.8k]
  ------------------
 1347|       |                        // Include all dissatisfactions (even these non-canonical ones) in nsat.
 1348|  52.4k|                        if (i != node.k) nsat = std::move(nsat) | std::move(sats[i]);
  ------------------
  |  Branch (1348:29): [True: 40.5k, False: 11.8k]
  ------------------
 1349|  52.4k|                    }
 1350|  11.8k|                    assert(node.k < sats.size());
  ------------------
  |  Branch (1350:21): [True: 11.8k, False: 0]
  ------------------
 1351|  11.8k|                    return {std::move(nsat), std::move(sats[node.k])};
 1352|  11.8k|                }
 1353|  3.07k|                case Fragment::OLDER: {
  ------------------
  |  Branch (1353:17): [True: 3.07k, False: 293k]
  ------------------
 1354|  3.07k|                    return {INVALID, ctx.CheckOlder(node.k) ? EMPTY : INVALID};
  ------------------
  |  Branch (1354:38): [True: 2.02k, False: 1.05k]
  ------------------
 1355|  11.8k|                }
 1356|  2.54k|                case Fragment::AFTER: {
  ------------------
  |  Branch (1356:17): [True: 2.54k, False: 294k]
  ------------------
 1357|  2.54k|                    return {INVALID, ctx.CheckAfter(node.k) ? EMPTY : INVALID};
  ------------------
  |  Branch (1357:38): [True: 1.60k, False: 946]
  ------------------
 1358|  11.8k|                }
 1359|  3.12k|                case Fragment::SHA256: {
  ------------------
  |  Branch (1359:17): [True: 3.12k, False: 293k]
  ------------------
 1360|  3.12k|                    std::vector<unsigned char> preimage;
 1361|  3.12k|                    Availability avail = ctx.SatSHA256(node.data, preimage);
 1362|  3.12k|                    return {ZERO32, InputStack(std::move(preimage)).SetAvailable(avail)};
 1363|  11.8k|                }
 1364|  2.17k|                case Fragment::RIPEMD160: {
  ------------------
  |  Branch (1364:17): [True: 2.17k, False: 294k]
  ------------------
 1365|  2.17k|                    std::vector<unsigned char> preimage;
 1366|  2.17k|                    Availability avail = ctx.SatRIPEMD160(node.data, preimage);
 1367|  2.17k|                    return {ZERO32, InputStack(std::move(preimage)).SetAvailable(avail)};
 1368|  11.8k|                }
 1369|  2.98k|                case Fragment::HASH256: {
  ------------------
  |  Branch (1369:17): [True: 2.98k, False: 293k]
  ------------------
 1370|  2.98k|                    std::vector<unsigned char> preimage;
 1371|  2.98k|                    Availability avail = ctx.SatHASH256(node.data, preimage);
 1372|  2.98k|                    return {ZERO32, InputStack(std::move(preimage)).SetAvailable(avail)};
 1373|  11.8k|                }
 1374|  2.37k|                case Fragment::HASH160: {
  ------------------
  |  Branch (1374:17): [True: 2.37k, False: 294k]
  ------------------
 1375|  2.37k|                    std::vector<unsigned char> preimage;
 1376|  2.37k|                    Availability avail = ctx.SatHASH160(node.data, preimage);
 1377|  2.37k|                    return {ZERO32, InputStack(std::move(preimage)).SetAvailable(avail)};
 1378|  11.8k|                }
 1379|  23.8k|                case Fragment::AND_V: {
  ------------------
  |  Branch (1379:17): [True: 23.8k, False: 272k]
  ------------------
 1380|  23.8k|                    auto& x = subres[0], &y = subres[1];
 1381|       |                    // As the dissatisfaction here only consist of a single option, it doesn't
 1382|       |                    // actually need to be listed (it's not required for reasoning about malleability of
 1383|       |                    // other options), and is never required (no valid miniscript relies on the ability
 1384|       |                    // to satisfy the type V left subexpression). It's still listed here for
 1385|       |                    // completeness, as a hypothetical (not currently implemented) satisfier that doesn't
 1386|       |                    // care about malleability might in some cases prefer it still.
 1387|  23.8k|                    return {(y.nsat + x.sat).SetNonCanon(), y.sat + x.sat};
 1388|  11.8k|                }
 1389|  5.72k|                case Fragment::AND_B: {
  ------------------
  |  Branch (1389:17): [True: 5.72k, False: 291k]
  ------------------
 1390|  5.72k|                    auto& x = subres[0], &y = subres[1];
 1391|       |                    // Note that it is not strictly necessary to mark the 2nd and 3rd dissatisfaction here
 1392|       |                    // as malleable. While they are definitely malleable, they are also non-canonical due
 1393|       |                    // to the guaranteed existence of a no-signature other dissatisfaction (the 1st)
 1394|       |                    // option. Because of that, the 2nd and 3rd option will never be chosen, even if they
 1395|       |                    // weren't marked as malleable.
 1396|  5.72k|                    return {(y.nsat + x.nsat) | (y.sat + x.nsat).SetMalleable().SetNonCanon() | (y.nsat + x.sat).SetMalleable().SetNonCanon(), y.sat + x.sat};
 1397|  11.8k|                }
 1398|  4.72k|                case Fragment::OR_B: {
  ------------------
  |  Branch (1398:17): [True: 4.72k, False: 292k]
  ------------------
 1399|  4.72k|                    auto& x = subres[0], &z = subres[1];
 1400|       |                    // The (sat(Z) sat(X)) solution is overcomplete (attacker can change either into dsat).
 1401|  4.72k|                    return {z.nsat + x.nsat, (z.nsat + x.sat) | (z.sat + x.nsat) | (z.sat + x.sat).SetMalleable().SetNonCanon()};
 1402|  11.8k|                }
 1403|  4.86k|                case Fragment::OR_C: {
  ------------------
  |  Branch (1403:17): [True: 4.86k, False: 291k]
  ------------------
 1404|  4.86k|                    auto& x = subres[0], &z = subres[1];
 1405|  4.86k|                    return {INVALID, std::move(x.sat) | (z.sat + x.nsat)};
 1406|  11.8k|                }
 1407|  7.29k|                case Fragment::OR_D: {
  ------------------
  |  Branch (1407:17): [True: 7.29k, False: 289k]
  ------------------
 1408|  7.29k|                    auto& x = subres[0], &z = subres[1];
 1409|  7.29k|                    return {z.nsat + x.nsat, std::move(x.sat) | (z.sat + x.nsat)};
 1410|  11.8k|                }
 1411|  15.6k|                case Fragment::OR_I: {
  ------------------
  |  Branch (1411:17): [True: 15.6k, False: 281k]
  ------------------
 1412|  15.6k|                    auto& x = subres[0], &z = subres[1];
 1413|  15.6k|                    return {(x.nsat + ONE) | (z.nsat + ZERO), (x.sat + ONE) | (z.sat + ZERO)};
 1414|  11.8k|                }
 1415|  12.4k|                case Fragment::ANDOR: {
  ------------------
  |  Branch (1415:17): [True: 12.4k, False: 284k]
  ------------------
 1416|  12.4k|                    auto& x = subres[0], &y = subres[1], &z = subres[2];
 1417|  12.4k|                    return {(y.nsat + x.sat).SetNonCanon() | (z.nsat + x.nsat), (y.sat + x.sat) | (z.sat + x.nsat)};
 1418|  11.8k|                }
 1419|  36.6k|                case Fragment::WRAP_A:
  ------------------
  |  Branch (1419:17): [True: 36.6k, False: 260k]
  ------------------
 1420|  39.1k|                case Fragment::WRAP_S:
  ------------------
  |  Branch (1420:17): [True: 2.44k, False: 294k]
  ------------------
 1421|  48.7k|                case Fragment::WRAP_C:
  ------------------
  |  Branch (1421:17): [True: 9.64k, False: 287k]
  ------------------
 1422|  54.5k|                case Fragment::WRAP_N:
  ------------------
  |  Branch (1422:17): [True: 5.76k, False: 291k]
  ------------------
 1423|  54.5k|                    return std::move(subres[0]);
 1424|  1.10k|                case Fragment::WRAP_D: {
  ------------------
  |  Branch (1424:17): [True: 1.10k, False: 295k]
  ------------------
 1425|  1.10k|                    auto &x = subres[0];
 1426|  1.10k|                    return {ZERO, x.sat + ONE};
 1427|  48.7k|                }
 1428|  3.23k|                case Fragment::WRAP_J: {
  ------------------
  |  Branch (1428:17): [True: 3.23k, False: 293k]
  ------------------
 1429|  3.23k|                    auto &x = subres[0];
 1430|       |                    // If a dissatisfaction with a nonzero top stack element exists, an alternative dissatisfaction exists.
 1431|       |                    // As the dissatisfaction logic currently doesn't keep track of this nonzeroness property, and thus even
 1432|       |                    // if a dissatisfaction with a top zero element is found, we don't know whether another one with a
 1433|       |                    // nonzero top stack element exists. Make the conservative assumption that whenever the subexpression is weakly
 1434|       |                    // dissatisfiable, this alternative dissatisfaction exists and leads to malleability.
 1435|  3.23k|                    return {InputStack(ZERO).SetMalleable(x.nsat.available != Availability::NO && !x.nsat.has_sig), std::move(x.sat)};
  ------------------
  |  Branch (1435:59): [True: 2.91k, False: 316]
  |  Branch (1435:99): [True: 2.90k, False: 8]
  ------------------
 1436|  48.7k|                }
 1437|  27.3k|                case Fragment::WRAP_V: {
  ------------------
  |  Branch (1437:17): [True: 27.3k, False: 269k]
  ------------------
 1438|  27.3k|                    auto &x = subres[0];
 1439|  27.3k|                    return {INVALID, std::move(x.sat)};
 1440|  48.7k|                }
 1441|  71.6k|                case Fragment::JUST_0: return {EMPTY, INVALID};
  ------------------
  |  Branch (1441:17): [True: 71.6k, False: 225k]
  ------------------
 1442|  7.63k|                case Fragment::JUST_1: return {INVALID, EMPTY};
  ------------------
  |  Branch (1442:17): [True: 7.63k, False: 289k]
  ------------------
 1443|   296k|            }
 1444|   296k|            assert(false);
  ------------------
  |  Branch (1444:13): [Folded, False: 0]
  ------------------
 1445|      0|            return {INVALID, INVALID};
 1446|      0|        };
_ZNK10miniscript4NodeI7CPubKeyE12GetStackSizeEv:
 1583|  3.70k|    std::optional<uint32_t> GetStackSize() const {
 1584|  3.70k|        if (!ss.Sat().Valid()) return {};
  ------------------
  |  Branch (1584:13): [True: 611, False: 3.09k]
  ------------------
 1585|  3.09k|        return ss.Sat().NetDiff() + static_cast<int32_t>(IsBKW());
 1586|  3.70k|    }
_ZNK10miniscript4NodeI7CPubKeyE14GetWitnessSizeEv:
 1611|    936|    std::optional<uint32_t> GetWitnessSize() const {
 1612|    936|        if (!ws.sat.Valid()) return {};
  ------------------
  |  Branch (1612:13): [True: 0, False: 936]
  ------------------
 1613|    936|        return ws.sat.Value();
 1614|    936|    }
_ZNK10miniscript4NodeI7CPubKeyE18ValidSatisfactionsEv:
 1696|  5.12k|    bool ValidSatisfactions() const { return IsValid() && CheckOpsLimit() && CheckStackSize(); }
  ------------------
  |  Branch (1696:46): [True: 5.12k, False: 0]
  |  Branch (1696:59): [True: 5.04k, False: 81]
  |  Branch (1696:78): [True: 5.02k, False: 13]
  ------------------
_ZNK10miniscript4NodeI7CPubKeyE13CheckOpsLimitEv:
 1571|  5.14k|    bool CheckOpsLimit() const {
 1572|  5.14k|        if (IsTapscript(m_script_ctx)) return true;
  ------------------
  |  Branch (1572:13): [True: 2.27k, False: 2.87k]
  ------------------
 1573|  2.87k|        if (const auto ops = GetOps()) return *ops <= MAX_OPS_PER_SCRIPT;
  ------------------
  |  Branch (1573:24): [True: 2.26k, False: 611]
  ------------------
 1574|    611|        return true;
 1575|  2.87k|    }
_ZNK10miniscript4NodeI7CPubKeyE14CheckStackSizeEv:
 1595|  5.04k|    bool CheckStackSize() const {
 1596|       |        // Since in Tapscript there is no standardness limit on the script and witness sizes, we may run
 1597|       |        // into the maximum stack size while executing the script. Make sure it doesn't happen.
 1598|  5.04k|        if (IsTapscript(m_script_ctx)) {
  ------------------
  |  Branch (1598:13): [True: 2.27k, False: 2.76k]
  ------------------
 1599|  2.27k|            if (const auto exec_ss = GetExecStackSize()) return exec_ss <= MAX_STACK_SIZE;
  ------------------
  |  Branch (1599:28): [True: 1.69k, False: 581]
  ------------------
 1600|    581|            return true;
 1601|  2.27k|        }
 1602|  2.76k|        if (const auto ss = GetStackSize()) return *ss <= MAX_STANDARD_P2WSH_STACK_ITEMS;
  ------------------
  |  Branch (1602:24): [True: 2.15k, False: 611]
  ------------------
 1603|    611|        return true;
 1604|  2.76k|    }
_ZNK10miniscript4NodeI7CPubKeyE6IsSaneEv:
 1702|  4.18k|    bool IsSane() const { return IsValidTopLevel() && IsSaneSubexpression() && NeedsSignature(); }
  ------------------
  |  Branch (1702:34): [True: 4.18k, False: 0]
  |  Branch (1702:55): [True: 1.72k, False: 2.46k]
  |  Branch (1702:80): [True: 1.01k, False: 709]
  ------------------
_ZNK10miniscript4NodeI7CPubKeyE19IsSaneSubexpressionEv:
 1699|  4.18k|    bool IsSaneSubexpression() const { return ValidSatisfactions() && IsNonMalleable() && CheckTimeLocksMix() && CheckDuplicateKey(); }
  ------------------
  |  Branch (1699:47): [True: 4.12k, False: 59]
  |  Branch (1699:71): [True: 2.84k, False: 1.27k]
  |  Branch (1699:91): [True: 2.79k, False: 58]
  |  Branch (1699:114): [True: 1.72k, False: 1.06k]
  ------------------
_ZNK10miniscript4NodeI7CPubKeyE14IsNonMalleableEv:
 1684|  4.12k|    bool IsNonMalleable() const { return GetType() << "m"_mst; }
_ZNK10miniscript4NodeI7CPubKeyE17CheckTimeLocksMixEv:
 1690|  2.84k|    bool CheckTimeLocksMix() const { return GetType() << "k"_mst; }
_ZNK10miniscript4NodeI7CPubKeyE17CheckDuplicateKeyEv:
 1693|  2.79k|    bool CheckDuplicateKey() const { return has_duplicate_keys && !*has_duplicate_keys; }
  ------------------
  |  Branch (1693:45): [True: 2.79k, False: 0]
  |  Branch (1693:67): [True: 1.72k, False: 1.06k]
  ------------------
_ZNK10miniscript4NodeI7CPubKeyE14NeedsSignatureEv:
 1687|  1.72k|    bool NeedsSignature() const { return GetType() << "s"_mst; }
miniscript.cpp:_ZNK10miniscript4NodeI7CPubKeyE13IsSatisfiableIZN12_GLOBAL__N_18TestNodeENS_17MiniscriptContextERKNSt3__18optionalIS2_EER18FuzzedDataProviderE3$_0EEbT_:
 1635|  4.18k|    {
 1636|       |        // TreeEval() doesn't support bool as NodeType, so use int instead.
 1637|  4.18k|        return TreeEval<int>([&fn](const Node& node, std::span<int> subs) -> bool {
 1638|  4.18k|            switch (node.fragment) {
 1639|  4.18k|                case Fragment::JUST_0:
 1640|  4.18k|                    return false;
 1641|  4.18k|                case Fragment::JUST_1:
 1642|  4.18k|                    return true;
 1643|  4.18k|                case Fragment::PK_K:
 1644|  4.18k|                case Fragment::PK_H:
 1645|  4.18k|                case Fragment::MULTI:
 1646|  4.18k|                case Fragment::MULTI_A:
 1647|  4.18k|                case Fragment::AFTER:
 1648|  4.18k|                case Fragment::OLDER:
 1649|  4.18k|                case Fragment::HASH256:
 1650|  4.18k|                case Fragment::HASH160:
 1651|  4.18k|                case Fragment::SHA256:
 1652|  4.18k|                case Fragment::RIPEMD160:
 1653|  4.18k|                    return bool{fn(node)};
 1654|  4.18k|                case Fragment::ANDOR:
 1655|  4.18k|                    return (subs[0] && subs[1]) || subs[2];
 1656|  4.18k|                case Fragment::AND_V:
 1657|  4.18k|                case Fragment::AND_B:
 1658|  4.18k|                    return subs[0] && subs[1];
 1659|  4.18k|                case Fragment::OR_B:
 1660|  4.18k|                case Fragment::OR_C:
 1661|  4.18k|                case Fragment::OR_D:
 1662|  4.18k|                case Fragment::OR_I:
 1663|  4.18k|                    return subs[0] || subs[1];
 1664|  4.18k|                case Fragment::THRESH:
 1665|  4.18k|                    return static_cast<uint32_t>(std::count(subs.begin(), subs.end(), true)) >= node.k;
 1666|  4.18k|                default: // wrappers
 1667|  4.18k|                    assert(subs.size() >= 1);
 1668|  4.18k|                    CHECK_NONFATAL(subs.size() == 1);
 1669|  4.18k|                    return subs[0];
 1670|  4.18k|            }
 1671|  4.18k|        });
 1672|  4.18k|    }
miniscript.cpp:_ZNK10miniscript4NodeI7CPubKeyE8TreeEvalIiZNKS2_13IsSatisfiableIZN12_GLOBAL__N_18TestNodeENS_17MiniscriptContextERKNSt3__18optionalIS2_EER18FuzzedDataProviderE3$_0EEbT_EUlRKS2_NS7_4spanIiLm18446744073709551615EEEE_EESF_T0_:
  748|  4.18k|    {
  749|  4.18k|        struct DummyState {};
  750|  4.18k|        return std::move(*TreeEvalMaybe<Result>(DummyState{},
  751|  4.18k|            [](DummyState, const Node&, size_t) { return DummyState{}; },
  752|  4.18k|            [&upfn](DummyState, const Node& node, std::span<Result> subs) {
  753|  4.18k|                Result res{upfn(node, subs)};
  754|  4.18k|                return std::optional<Result>(std::move(res));
  755|  4.18k|            }
  756|  4.18k|        ));
  757|  4.18k|    }
miniscript.cpp:_ZNK10miniscript4NodeI7CPubKeyE13TreeEvalMaybeIiZNKS2_8TreeEvalIiZNKS2_13IsSatisfiableIZN12_GLOBAL__N_18TestNodeENS_17MiniscriptContextERKNSt3__18optionalIS2_EER18FuzzedDataProviderE3$_0EEbT_EUlRKS2_NS8_4spanIiLm18446744073709551615EEEE_EESG_T0_E10DummyStateZNKS4_IiSL_EESG_SM_EUlSN_SI_mE_ZNKS4_IiSL_EESG_SM_EUlSN_SI_SK_E_EENS9_ISG_EESM_T1_T2_:
  653|  4.18k|    {
  654|       |        /** Entries of the explicit stack tracked in this algorithm. */
  655|  4.18k|        struct StackElem
  656|  4.18k|        {
  657|  4.18k|            const Node& node; //!< The node being evaluated.
  658|  4.18k|            size_t expanded; //!< How many children of this node have been expanded.
  659|  4.18k|            State state; //!< The state for that node.
  660|       |
  661|  4.18k|            StackElem(const Node& node_, size_t exp_, State&& state_) :
  662|  4.18k|                node(node_), expanded(exp_), state(std::move(state_)) {}
  663|  4.18k|        };
  664|       |        /* Stack of tree nodes being explored. */
  665|  4.18k|        std::vector<StackElem> stack;
  666|       |        /* Results of subtrees so far. Their order and mapping to tree nodes
  667|       |         * is implicitly defined by stack. */
  668|  4.18k|        std::vector<Result> results;
  669|  4.18k|        stack.emplace_back(*this, 0, std::move(root_state));
  670|       |
  671|       |        /* Here is a demonstration of the algorithm, for an example tree A(B,C(D,E),F).
  672|       |         * State variables are omitted for simplicity.
  673|       |         *
  674|       |         * First: stack=[(A,0)] results=[]
  675|       |         *        stack=[(A,1),(B,0)] results=[]
  676|       |         *        stack=[(A,1)] results=[B]
  677|       |         *        stack=[(A,2),(C,0)] results=[B]
  678|       |         *        stack=[(A,2),(C,1),(D,0)] results=[B]
  679|       |         *        stack=[(A,2),(C,1)] results=[B,D]
  680|       |         *        stack=[(A,2),(C,2),(E,0)] results=[B,D]
  681|       |         *        stack=[(A,2),(C,2)] results=[B,D,E]
  682|       |         *        stack=[(A,2)] results=[B,C]
  683|       |         *        stack=[(A,3),(F,0)] results=[B,C]
  684|       |         *        stack=[(A,3)] results=[B,C,F]
  685|       |         * Final: stack=[] results=[A]
  686|       |         */
  687|   296k|        while (stack.size()) {
  ------------------
  |  Branch (687:16): [True: 292k, False: 4.18k]
  ------------------
  688|   292k|            const Node& node = stack.back().node;
  689|   292k|            if (stack.back().expanded < node.subs.size()) {
  ------------------
  |  Branch (689:17): [True: 144k, False: 148k]
  ------------------
  690|       |                /* We encounter a tree node with at least one unexpanded child.
  691|       |                 * Expand it. By the time we hit this node again, the result of
  692|       |                 * that child (and all earlier children) will be at the end of `results`. */
  693|   144k|                size_t child_index = stack.back().expanded++;
  694|   144k|                State child_state = downfn(stack.back().state, node, child_index);
  695|   144k|                stack.emplace_back(node.subs[child_index], 0, std::move(child_state));
  696|   144k|                continue;
  697|   144k|            }
  698|       |            // Invoke upfn with the last node.subs.size() elements of results as input.
  699|   292k|            assert(results.size() >= node.subs.size());
  ------------------
  |  Branch (699:13): [True: 148k, False: 0]
  ------------------
  700|   148k|            std::optional<Result> result{upfn(std::move(stack.back().state), node,
  701|   148k|                std::span<Result>{results}.last(node.subs.size()))};
  702|       |            // If evaluation returns std::nullopt, abort immediately.
  703|   148k|            if (!result) return {};
  ------------------
  |  Branch (703:17): [True: 0, False: 148k]
  ------------------
  704|       |            // Replace the last node.subs.size() elements of results with the new result.
  705|   148k|            results.erase(results.end() - node.subs.size(), results.end());
  706|   148k|            results.push_back(std::move(*result));
  707|   148k|            stack.pop_back();
  708|   148k|        }
  709|       |        // The final remaining results element is the root result, return it.
  710|  4.18k|        assert(results.size() >= 1);
  ------------------
  |  Branch (710:9): [True: 4.18k, False: 0]
  ------------------
  711|  4.18k|        CHECK_NONFATAL(results.size() == 1);
  ------------------
  |  |  113|  4.18k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  712|  4.18k|        return std::move(results[0]);
  713|  4.18k|    }
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE13TreeEvalMaybeIiZNKS2_8TreeEvalIiZNKS2_13IsSatisfiableIZN12_GLOBAL__N_18TestNodeENS_17MiniscriptContextERKNSt3__18optionalIS2_EER18FuzzedDataProviderE3$_0EEbT_EUlRKS2_NS8_4spanIiLm18446744073709551615EEEE_EESG_T0_E10DummyStateZNKS4_IiSL_EESG_SM_EUlSN_SI_mE_ZNKS4_IiSL_EESG_SM_EUlSN_SI_SK_E_EENS9_ISG_EESM_T1_T2_EN9StackElemC2ESI_mOSN_:
  662|   148k|                node(node_), expanded(exp_), state(std::move(state_)) {}
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE8TreeEvalIiZNKS2_13IsSatisfiableIZN12_GLOBAL__N_18TestNodeENS_17MiniscriptContextERKNSt3__18optionalIS2_EER18FuzzedDataProviderE3$_0EEbT_EUlRKS2_NS7_4spanIiLm18446744073709551615EEEE_EESF_T0_ENKUlZNKS3_IiSK_EESF_SL_E10DummyStateSH_mE_clESM_SH_m:
  751|   144k|            [](DummyState, const Node&, size_t) { return DummyState{}; },
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE8TreeEvalIiZNKS2_13IsSatisfiableIZN12_GLOBAL__N_18TestNodeENS_17MiniscriptContextERKNSt3__18optionalIS2_EER18FuzzedDataProviderE3$_0EEbT_EUlRKS2_NS7_4spanIiLm18446744073709551615EEEE_EESF_T0_ENKUlZNKS3_IiSK_EESF_SL_E10DummyStateSH_SJ_E_clESM_SH_SJ_:
  752|   148k|            [&upfn](DummyState, const Node& node, std::span<Result> subs) {
  753|   148k|                Result res{upfn(node, subs)};
  754|   148k|                return std::optional<Result>(std::move(res));
  755|   148k|            }
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE13IsSatisfiableIZN12_GLOBAL__N_18TestNodeENS_17MiniscriptContextERKNSt3__18optionalIS2_EER18FuzzedDataProviderE3$_0EEbT_ENKUlRKS2_NS6_4spanIiLm18446744073709551615EEEE_clESG_SI_:
 1637|   148k|        return TreeEval<int>([&fn](const Node& node, std::span<int> subs) -> bool {
 1638|   148k|            switch (node.fragment) {
 1639|  35.8k|                case Fragment::JUST_0:
  ------------------
  |  Branch (1639:17): [True: 35.8k, False: 112k]
  ------------------
 1640|  35.8k|                    return false;
 1641|  3.81k|                case Fragment::JUST_1:
  ------------------
  |  Branch (1641:17): [True: 3.81k, False: 144k]
  ------------------
 1642|  3.81k|                    return true;
 1643|  6.98k|                case Fragment::PK_K:
  ------------------
  |  Branch (1643:17): [True: 6.98k, False: 141k]
  ------------------
 1644|  8.74k|                case Fragment::PK_H:
  ------------------
  |  Branch (1644:17): [True: 1.76k, False: 146k]
  ------------------
 1645|  13.2k|                case Fragment::MULTI:
  ------------------
  |  Branch (1645:17): [True: 4.54k, False: 143k]
  ------------------
 1646|  14.2k|                case Fragment::MULTI_A:
  ------------------
  |  Branch (1646:17): [True: 988, False: 147k]
  ------------------
 1647|  15.5k|                case Fragment::AFTER:
  ------------------
  |  Branch (1647:17): [True: 1.27k, False: 147k]
  ------------------
 1648|  17.0k|                case Fragment::OLDER:
  ------------------
  |  Branch (1648:17): [True: 1.53k, False: 146k]
  ------------------
 1649|  18.5k|                case Fragment::HASH256:
  ------------------
  |  Branch (1649:17): [True: 1.49k, False: 146k]
  ------------------
 1650|  19.7k|                case Fragment::HASH160:
  ------------------
  |  Branch (1650:17): [True: 1.18k, False: 147k]
  ------------------
 1651|  21.3k|                case Fragment::SHA256:
  ------------------
  |  Branch (1651:17): [True: 1.56k, False: 146k]
  ------------------
 1652|  22.4k|                case Fragment::RIPEMD160:
  ------------------
  |  Branch (1652:17): [True: 1.08k, False: 147k]
  ------------------
 1653|  22.4k|                    return bool{fn(node)};
 1654|  6.23k|                case Fragment::ANDOR:
  ------------------
  |  Branch (1654:17): [True: 6.23k, False: 142k]
  ------------------
 1655|  6.23k|                    return (subs[0] && subs[1]) || subs[2];
  ------------------
  |  Branch (1655:29): [True: 1.46k, False: 4.76k]
  |  Branch (1655:40): [True: 1.02k, False: 444]
  |  Branch (1655:52): [True: 223, False: 4.99k]
  ------------------
 1656|  11.9k|                case Fragment::AND_V:
  ------------------
  |  Branch (1656:17): [True: 11.9k, False: 136k]
  ------------------
 1657|  14.7k|                case Fragment::AND_B:
  ------------------
  |  Branch (1657:17): [True: 2.86k, False: 145k]
  ------------------
 1658|  14.7k|                    return subs[0] && subs[1];
  ------------------
  |  Branch (1658:28): [True: 5.10k, False: 9.69k]
  |  Branch (1658:39): [True: 3.71k, False: 1.38k]
  ------------------
 1659|  2.36k|                case Fragment::OR_B:
  ------------------
  |  Branch (1659:17): [True: 2.36k, False: 146k]
  ------------------
 1660|  4.79k|                case Fragment::OR_C:
  ------------------
  |  Branch (1660:17): [True: 2.43k, False: 145k]
  ------------------
 1661|  8.43k|                case Fragment::OR_D:
  ------------------
  |  Branch (1661:17): [True: 3.64k, False: 144k]
  ------------------
 1662|  16.2k|                case Fragment::OR_I:
  ------------------
  |  Branch (1662:17): [True: 7.82k, False: 140k]
  ------------------
 1663|  16.2k|                    return subs[0] || subs[1];
  ------------------
  |  Branch (1663:28): [True: 6.49k, False: 9.76k]
  |  Branch (1663:39): [True: 1.81k, False: 7.95k]
  ------------------
 1664|  5.94k|                case Fragment::THRESH:
  ------------------
  |  Branch (1664:17): [True: 5.94k, False: 142k]
  ------------------
 1665|  5.94k|                    return static_cast<uint32_t>(std::count(subs.begin(), subs.end(), true)) >= node.k;
 1666|  43.1k|                default: // wrappers
  ------------------
  |  Branch (1666:17): [True: 43.1k, False: 105k]
  ------------------
 1667|  43.1k|                    assert(subs.size() >= 1);
  ------------------
  |  Branch (1667:21): [True: 43.1k, False: 0]
  ------------------
 1668|  43.1k|                    CHECK_NONFATAL(subs.size() == 1);
  ------------------
  |  |  113|  43.1k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
 1669|  43.1k|                    return subs[0];
 1670|   148k|            }
 1671|   148k|        });
_ZNK10miniscript4NodeI7CPubKeyE8FragmentEv:
  587|   211k|    enum Fragment Fragment() const { return fragment; }
_ZNK10miniscript4NodeI7CPubKeyE4KeysEv:
  589|  14.2k|    const std::vector<Key>& Keys() const { return keys; }
_ZNK10miniscript4NodeI7CPubKeyE1KEv:
  588|  8.33k|    uint32_t K() const { return k; }
_ZNK10miniscript4NodeI7CPubKeyE4DataEv:
  590|  5.33k|    const std::vector<unsigned char>& Data() const { return data; }
miniscript.cpp:_ZNK10miniscript4NodeI7CPubKeyE8ToStringIN12_GLOBAL__N_113ParserContextEEENSt3__18optionalINS6_12basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEERKT_:
  877|  4.76k|    std::optional<std::string> ToString(const CTx& ctx) const {
  878|  4.76k|        bool dummy{false};
  879|  4.76k|        return ToString(ctx, dummy);
  880|  4.76k|    }
miniscript.cpp:_ZNK10miniscript4NodeI7CPubKeyE8ToStringIN12_GLOBAL__N_113ParserContextEEENSt3__18optionalINS6_12basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEERKT_Rb:
  883|  4.76k|    std::optional<std::string> ToString(const CTx& ctx, bool& has_priv_key) const {
  884|       |        // To construct the std::string representation for a Miniscript object, we use
  885|       |        // the TreeEvalMaybe algorithm. The State is a boolean: whether the parent node is a
  886|       |        // wrapper. If so, non-wrapper expressions must be prefixed with a ":".
  887|  4.76k|        auto downfn = [](bool, const Node& node, size_t) {
  888|  4.76k|            return (node.fragment == Fragment::WRAP_A || node.fragment == Fragment::WRAP_S ||
  889|  4.76k|                    node.fragment == Fragment::WRAP_D || node.fragment == Fragment::WRAP_V ||
  890|  4.76k|                    node.fragment == Fragment::WRAP_J || node.fragment == Fragment::WRAP_N ||
  891|  4.76k|                    node.fragment == Fragment::WRAP_C ||
  892|  4.76k|                    (node.fragment == Fragment::AND_V && node.subs[1].fragment == Fragment::JUST_1) ||
  893|  4.76k|                    (node.fragment == Fragment::OR_I && node.subs[0].fragment == Fragment::JUST_0) ||
  894|  4.76k|                    (node.fragment == Fragment::OR_I && node.subs[1].fragment == Fragment::JUST_0));
  895|  4.76k|        };
  896|  4.76k|        auto toString = [&ctx, &has_priv_key](Key key) -> std::optional<std::string> {
  897|  4.76k|            bool fragment_has_priv_key{false};
  898|  4.76k|            auto key_str{ctx.ToString(key, fragment_has_priv_key)};
  899|  4.76k|            if (key_str) has_priv_key = has_priv_key || fragment_has_priv_key;
  900|  4.76k|            return key_str;
  901|  4.76k|        };
  902|       |        // The upward function computes for a node, given whether its parent is a wrapper,
  903|       |        // and the string representations of its child nodes, the string representation of the node.
  904|  4.76k|        const bool is_tapscript{IsTapscript(m_script_ctx)};
  905|  4.76k|        auto upfn = [is_tapscript, &toString](bool wrapped, const Node& node, std::span<std::string> subs) -> std::optional<std::string> {
  906|  4.76k|            std::string ret = wrapped ? ":" : "";
  907|       |
  908|  4.76k|            switch (node.fragment) {
  909|  4.76k|                case Fragment::WRAP_A: return "a" + std::move(subs[0]);
  910|  4.76k|                case Fragment::WRAP_S: return "s" + std::move(subs[0]);
  911|  4.76k|                case Fragment::WRAP_C:
  912|  4.76k|                    if (node.subs[0].fragment == Fragment::PK_K) {
  913|       |                        // pk(K) is syntactic sugar for c:pk_k(K)
  914|  4.76k|                        auto key_str = toString(node.subs[0].keys[0]);
  915|  4.76k|                        if (!key_str) return {};
  916|  4.76k|                        return std::move(ret) + "pk(" + std::move(*key_str) + ")";
  917|  4.76k|                    }
  918|  4.76k|                    if (node.subs[0].fragment == Fragment::PK_H) {
  919|       |                        // pkh(K) is syntactic sugar for c:pk_h(K)
  920|  4.76k|                        auto key_str = toString(node.subs[0].keys[0]);
  921|  4.76k|                        if (!key_str) return {};
  922|  4.76k|                        return std::move(ret) + "pkh(" + std::move(*key_str) + ")";
  923|  4.76k|                    }
  924|  4.76k|                    return "c" + std::move(subs[0]);
  925|  4.76k|                case Fragment::WRAP_D: return "d" + std::move(subs[0]);
  926|  4.76k|                case Fragment::WRAP_V: return "v" + std::move(subs[0]);
  927|  4.76k|                case Fragment::WRAP_J: return "j" + std::move(subs[0]);
  928|  4.76k|                case Fragment::WRAP_N: return "n" + std::move(subs[0]);
  929|  4.76k|                case Fragment::AND_V:
  930|       |                    // t:X is syntactic sugar for and_v(X,1).
  931|  4.76k|                    if (node.subs[1].fragment == Fragment::JUST_1) return "t" + std::move(subs[0]);
  932|  4.76k|                    break;
  933|  4.76k|                case Fragment::OR_I:
  934|  4.76k|                    if (node.subs[0].fragment == Fragment::JUST_0) return "l" + std::move(subs[1]);
  935|  4.76k|                    if (node.subs[1].fragment == Fragment::JUST_0) return "u" + std::move(subs[0]);
  936|  4.76k|                    break;
  937|  4.76k|                default: break;
  938|  4.76k|            }
  939|  4.76k|            switch (node.fragment) {
  940|  4.76k|                case Fragment::PK_K: {
  941|  4.76k|                    auto key_str = toString(node.keys[0]);
  942|  4.76k|                    if (!key_str) return {};
  943|  4.76k|                    return std::move(ret) + "pk_k(" + std::move(*key_str) + ")";
  944|  4.76k|                }
  945|  4.76k|                case Fragment::PK_H: {
  946|  4.76k|                    auto key_str = toString(node.keys[0]);
  947|  4.76k|                    if (!key_str) return {};
  948|  4.76k|                    return std::move(ret) + "pk_h(" + std::move(*key_str) + ")";
  949|  4.76k|                }
  950|  4.76k|                case Fragment::AFTER: return std::move(ret) + "after(" + util::ToString(node.k) + ")";
  951|  4.76k|                case Fragment::OLDER: return std::move(ret) + "older(" + util::ToString(node.k) + ")";
  952|  4.76k|                case Fragment::HASH256: return std::move(ret) + "hash256(" + HexStr(node.data) + ")";
  953|  4.76k|                case Fragment::HASH160: return std::move(ret) + "hash160(" + HexStr(node.data) + ")";
  954|  4.76k|                case Fragment::SHA256: return std::move(ret) + "sha256(" + HexStr(node.data) + ")";
  955|  4.76k|                case Fragment::RIPEMD160: return std::move(ret) + "ripemd160(" + HexStr(node.data) + ")";
  956|  4.76k|                case Fragment::JUST_1: return std::move(ret) + "1";
  957|  4.76k|                case Fragment::JUST_0: return std::move(ret) + "0";
  958|  4.76k|                case Fragment::AND_V: return std::move(ret) + "and_v(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  959|  4.76k|                case Fragment::AND_B: return std::move(ret) + "and_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  960|  4.76k|                case Fragment::OR_B: return std::move(ret) + "or_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  961|  4.76k|                case Fragment::OR_D: return std::move(ret) + "or_d(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  962|  4.76k|                case Fragment::OR_C: return std::move(ret) + "or_c(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  963|  4.76k|                case Fragment::OR_I: return std::move(ret) + "or_i(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  964|  4.76k|                case Fragment::ANDOR:
  965|       |                    // and_n(X,Y) is syntactic sugar for andor(X,Y,0).
  966|  4.76k|                    if (node.subs[2].fragment == Fragment::JUST_0) return std::move(ret) + "and_n(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  967|  4.76k|                    return std::move(ret) + "andor(" + std::move(subs[0]) + "," + std::move(subs[1]) + "," + std::move(subs[2]) + ")";
  968|  4.76k|                case Fragment::MULTI: {
  969|  4.76k|                    CHECK_NONFATAL(!is_tapscript);
  970|  4.76k|                    auto str = std::move(ret) + "multi(" + util::ToString(node.k);
  971|  4.76k|                    for (const auto& key : node.keys) {
  972|  4.76k|                        auto key_str = toString(key);
  973|  4.76k|                        if (!key_str) return {};
  974|  4.76k|                        str += "," + std::move(*key_str);
  975|  4.76k|                    }
  976|  4.76k|                    return std::move(str) + ")";
  977|  4.76k|                }
  978|  4.76k|                case Fragment::MULTI_A: {
  979|  4.76k|                    CHECK_NONFATAL(is_tapscript);
  980|  4.76k|                    auto str = std::move(ret) + "multi_a(" + util::ToString(node.k);
  981|  4.76k|                    for (const auto& key : node.keys) {
  982|  4.76k|                        auto key_str = toString(key);
  983|  4.76k|                        if (!key_str) return {};
  984|  4.76k|                        str += "," + std::move(*key_str);
  985|  4.76k|                    }
  986|  4.76k|                    return std::move(str) + ")";
  987|  4.76k|                }
  988|  4.76k|                case Fragment::THRESH: {
  989|  4.76k|                    auto str = std::move(ret) + "thresh(" + util::ToString(node.k);
  990|  4.76k|                    for (auto& sub : subs) {
  991|  4.76k|                        str += "," + std::move(sub);
  992|  4.76k|                    }
  993|  4.76k|                    return std::move(str) + ")";
  994|  4.76k|                }
  995|  4.76k|                default: break;
  996|  4.76k|            }
  997|  4.76k|            assert(false);
  998|  4.76k|        };
  999|       |
 1000|  4.76k|        return TreeEvalMaybe<std::string>(false, downfn, upfn);
 1001|  4.76k|    }
miniscript.cpp:_ZNK10miniscript4NodeI7CPubKeyE13TreeEvalMaybeINSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEbZNKS2_8ToStringIN12_GLOBAL__N_113ParserContextEEENS4_8optionalISA_EERKT_RbEUlbRKS2_mE_ZNKSB_ISD_EESF_SI_SJ_EUlbSL_NS4_4spanISA_Lm18446744073709551615EEEE_EENSE_ISG_EET0_T1_T2_:
  653|  4.76k|    {
  654|       |        /** Entries of the explicit stack tracked in this algorithm. */
  655|  4.76k|        struct StackElem
  656|  4.76k|        {
  657|  4.76k|            const Node& node; //!< The node being evaluated.
  658|  4.76k|            size_t expanded; //!< How many children of this node have been expanded.
  659|  4.76k|            State state; //!< The state for that node.
  660|       |
  661|  4.76k|            StackElem(const Node& node_, size_t exp_, State&& state_) :
  662|  4.76k|                node(node_), expanded(exp_), state(std::move(state_)) {}
  663|  4.76k|        };
  664|       |        /* Stack of tree nodes being explored. */
  665|  4.76k|        std::vector<StackElem> stack;
  666|       |        /* Results of subtrees so far. Their order and mapping to tree nodes
  667|       |         * is implicitly defined by stack. */
  668|  4.76k|        std::vector<Result> results;
  669|  4.76k|        stack.emplace_back(*this, 0, std::move(root_state));
  670|       |
  671|       |        /* Here is a demonstration of the algorithm, for an example tree A(B,C(D,E),F).
  672|       |         * State variables are omitted for simplicity.
  673|       |         *
  674|       |         * First: stack=[(A,0)] results=[]
  675|       |         *        stack=[(A,1),(B,0)] results=[]
  676|       |         *        stack=[(A,1)] results=[B]
  677|       |         *        stack=[(A,2),(C,0)] results=[B]
  678|       |         *        stack=[(A,2),(C,1),(D,0)] results=[B]
  679|       |         *        stack=[(A,2),(C,1)] results=[B,D]
  680|       |         *        stack=[(A,2),(C,2),(E,0)] results=[B,D]
  681|       |         *        stack=[(A,2),(C,2)] results=[B,D,E]
  682|       |         *        stack=[(A,2)] results=[B,C]
  683|       |         *        stack=[(A,3),(F,0)] results=[B,C]
  684|       |         *        stack=[(A,3)] results=[B,C,F]
  685|       |         * Final: stack=[] results=[A]
  686|       |         */
  687|   331k|        while (stack.size()) {
  ------------------
  |  Branch (687:16): [True: 326k, False: 4.76k]
  ------------------
  688|   326k|            const Node& node = stack.back().node;
  689|   326k|            if (stack.back().expanded < node.subs.size()) {
  ------------------
  |  Branch (689:17): [True: 160k, False: 165k]
  ------------------
  690|       |                /* We encounter a tree node with at least one unexpanded child.
  691|       |                 * Expand it. By the time we hit this node again, the result of
  692|       |                 * that child (and all earlier children) will be at the end of `results`. */
  693|   160k|                size_t child_index = stack.back().expanded++;
  694|   160k|                State child_state = downfn(stack.back().state, node, child_index);
  695|   160k|                stack.emplace_back(node.subs[child_index], 0, std::move(child_state));
  696|   160k|                continue;
  697|   160k|            }
  698|       |            // Invoke upfn with the last node.subs.size() elements of results as input.
  699|   326k|            assert(results.size() >= node.subs.size());
  ------------------
  |  Branch (699:13): [True: 165k, False: 0]
  ------------------
  700|   165k|            std::optional<Result> result{upfn(std::move(stack.back().state), node,
  701|   165k|                std::span<Result>{results}.last(node.subs.size()))};
  702|       |            // If evaluation returns std::nullopt, abort immediately.
  703|   165k|            if (!result) return {};
  ------------------
  |  Branch (703:17): [True: 0, False: 165k]
  ------------------
  704|       |            // Replace the last node.subs.size() elements of results with the new result.
  705|   165k|            results.erase(results.end() - node.subs.size(), results.end());
  706|   165k|            results.push_back(std::move(*result));
  707|   165k|            stack.pop_back();
  708|   165k|        }
  709|       |        // The final remaining results element is the root result, return it.
  710|  4.76k|        assert(results.size() >= 1);
  ------------------
  |  Branch (710:9): [True: 4.76k, False: 0]
  ------------------
  711|  4.76k|        CHECK_NONFATAL(results.size() == 1);
  ------------------
  |  |  113|  4.76k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  712|  4.76k|        return std::move(results[0]);
  713|  4.76k|    }
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE13TreeEvalMaybeINSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEbZNKS2_8ToStringIN12_GLOBAL__N_113ParserContextEEENS4_8optionalISA_EERKT_RbEUlbRKS2_mE_ZNKSB_ISD_EESF_SI_SJ_EUlbSL_NS4_4spanISA_Lm18446744073709551615EEEE_EENSE_ISG_EET0_T1_T2_EN9StackElemC2ESL_mOb:
  662|   165k|                node(node_), expanded(exp_), state(std::move(state_)) {}
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE8ToStringIN12_GLOBAL__N_113ParserContextEEENSt3__18optionalINS6_12basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEERKT_RbENKUlbRKS2_mE_clEbSK_m:
  887|   160k|        auto downfn = [](bool, const Node& node, size_t) {
  888|   160k|            return (node.fragment == Fragment::WRAP_A || node.fragment == Fragment::WRAP_S ||
  ------------------
  |  Branch (888:21): [True: 20.5k, False: 140k]
  |  Branch (888:58): [True: 1.31k, False: 138k]
  ------------------
  889|   138k|                    node.fragment == Fragment::WRAP_D || node.fragment == Fragment::WRAP_V ||
  ------------------
  |  Branch (889:21): [True: 598, False: 138k]
  |  Branch (889:58): [True: 15.4k, False: 122k]
  ------------------
  890|   122k|                    node.fragment == Fragment::WRAP_J || node.fragment == Fragment::WRAP_N ||
  ------------------
  |  Branch (890:21): [True: 1.71k, False: 121k]
  |  Branch (890:58): [True: 3.13k, False: 117k]
  ------------------
  891|   117k|                    node.fragment == Fragment::WRAP_C ||
  ------------------
  |  Branch (891:21): [True: 5.10k, False: 112k]
  ------------------
  892|   112k|                    (node.fragment == Fragment::AND_V && node.subs[1].fragment == Fragment::JUST_1) ||
  ------------------
  |  Branch (892:22): [True: 26.1k, False: 86.7k]
  |  Branch (892:58): [True: 2.01k, False: 24.1k]
  ------------------
  893|   110k|                    (node.fragment == Fragment::OR_I && node.subs[0].fragment == Fragment::JUST_0) ||
  ------------------
  |  Branch (893:22): [True: 18.6k, False: 92.2k]
  |  Branch (893:57): [True: 1.98k, False: 16.6k]
  ------------------
  894|   108k|                    (node.fragment == Fragment::OR_I && node.subs[1].fragment == Fragment::JUST_0));
  ------------------
  |  Branch (894:22): [True: 16.6k, False: 92.2k]
  |  Branch (894:57): [True: 5.18k, False: 11.4k]
  ------------------
  895|   160k|        };
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE8ToStringIN12_GLOBAL__N_113ParserContextEEENSt3__18optionalINS6_12basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEERKT_RbENKUlbRKS2_NS6_4spanISD_Lm18446744073709551615EEEE_clEbSK_SM_:
  905|   165k|        auto upfn = [is_tapscript, &toString](bool wrapped, const Node& node, std::span<std::string> subs) -> std::optional<std::string> {
  906|   165k|            std::string ret = wrapped ? ":" : "";
  ------------------
  |  Branch (906:31): [True: 57.1k, False: 108k]
  ------------------
  907|       |
  908|   165k|            switch (node.fragment) {
  909|  20.5k|                case Fragment::WRAP_A: return "a" + std::move(subs[0]);
  ------------------
  |  Branch (909:17): [True: 20.5k, False: 145k]
  ------------------
  910|  1.31k|                case Fragment::WRAP_S: return "s" + std::move(subs[0]);
  ------------------
  |  Branch (910:17): [True: 1.31k, False: 164k]
  ------------------
  911|  5.10k|                case Fragment::WRAP_C:
  ------------------
  |  Branch (911:17): [True: 5.10k, False: 160k]
  ------------------
  912|  5.10k|                    if (node.subs[0].fragment == Fragment::PK_K) {
  ------------------
  |  Branch (912:25): [True: 1.90k, False: 3.19k]
  ------------------
  913|       |                        // pk(K) is syntactic sugar for c:pk_k(K)
  914|  1.90k|                        auto key_str = toString(node.subs[0].keys[0]);
  915|  1.90k|                        if (!key_str) return {};
  ------------------
  |  Branch (915:29): [True: 0, False: 1.90k]
  ------------------
  916|  1.90k|                        return std::move(ret) + "pk(" + std::move(*key_str) + ")";
  917|  1.90k|                    }
  918|  3.19k|                    if (node.subs[0].fragment == Fragment::PK_H) {
  ------------------
  |  Branch (918:25): [True: 689, False: 2.50k]
  ------------------
  919|       |                        // pkh(K) is syntactic sugar for c:pk_h(K)
  920|    689|                        auto key_str = toString(node.subs[0].keys[0]);
  921|    689|                        if (!key_str) return {};
  ------------------
  |  Branch (921:29): [True: 0, False: 689]
  ------------------
  922|    689|                        return std::move(ret) + "pkh(" + std::move(*key_str) + ")";
  923|    689|                    }
  924|  2.50k|                    return "c" + std::move(subs[0]);
  925|    598|                case Fragment::WRAP_D: return "d" + std::move(subs[0]);
  ------------------
  |  Branch (925:17): [True: 598, False: 164k]
  ------------------
  926|  15.4k|                case Fragment::WRAP_V: return "v" + std::move(subs[0]);
  ------------------
  |  Branch (926:17): [True: 15.4k, False: 150k]
  ------------------
  927|  1.71k|                case Fragment::WRAP_J: return "j" + std::move(subs[0]);
  ------------------
  |  Branch (927:17): [True: 1.71k, False: 163k]
  ------------------
  928|  3.13k|                case Fragment::WRAP_N: return "n" + std::move(subs[0]);
  ------------------
  |  Branch (928:17): [True: 3.13k, False: 162k]
  ------------------
  929|  13.0k|                case Fragment::AND_V:
  ------------------
  |  Branch (929:17): [True: 13.0k, False: 152k]
  ------------------
  930|       |                    // t:X is syntactic sugar for and_v(X,1).
  931|  13.0k|                    if (node.subs[1].fragment == Fragment::JUST_1) return "t" + std::move(subs[0]);
  ------------------
  |  Branch (931:25): [True: 1.00k, False: 12.0k]
  ------------------
  932|  12.0k|                    break;
  933|  12.0k|                case Fragment::OR_I:
  ------------------
  |  Branch (933:17): [True: 9.31k, False: 156k]
  ------------------
  934|  9.31k|                    if (node.subs[0].fragment == Fragment::JUST_0) return "l" + std::move(subs[1]);
  ------------------
  |  Branch (934:25): [True: 990, False: 8.32k]
  ------------------
  935|  8.32k|                    if (node.subs[1].fragment == Fragment::JUST_0) return "u" + std::move(subs[0]);
  ------------------
  |  Branch (935:25): [True: 2.59k, False: 5.73k]
  ------------------
  936|  5.73k|                    break;
  937|  95.2k|                default: break;
  ------------------
  |  Branch (937:17): [True: 95.2k, False: 70.3k]
  ------------------
  938|   165k|            }
  939|   113k|            switch (node.fragment) {
  940|  8.47k|                case Fragment::PK_K: {
  ------------------
  |  Branch (940:17): [True: 8.47k, False: 104k]
  ------------------
  941|  8.47k|                    auto key_str = toString(node.keys[0]);
  942|  8.47k|                    if (!key_str) return {};
  ------------------
  |  Branch (942:25): [True: 0, False: 8.47k]
  ------------------
  943|  8.47k|                    return std::move(ret) + "pk_k(" + std::move(*key_str) + ")";
  944|  8.47k|                }
  945|  2.04k|                case Fragment::PK_H: {
  ------------------
  |  Branch (945:17): [True: 2.04k, False: 111k]
  ------------------
  946|  2.04k|                    auto key_str = toString(node.keys[0]);
  947|  2.04k|                    if (!key_str) return {};
  ------------------
  |  Branch (947:25): [True: 0, False: 2.04k]
  ------------------
  948|  2.04k|                    return std::move(ret) + "pk_h(" + std::move(*key_str) + ")";
  949|  2.04k|                }
  950|  1.30k|                case Fragment::AFTER: return std::move(ret) + "after(" + util::ToString(node.k) + ")";
  ------------------
  |  Branch (950:17): [True: 1.30k, False: 111k]
  ------------------
  951|  1.60k|                case Fragment::OLDER: return std::move(ret) + "older(" + util::ToString(node.k) + ")";
  ------------------
  |  Branch (951:17): [True: 1.60k, False: 111k]
  ------------------
  952|  1.59k|                case Fragment::HASH256: return std::move(ret) + "hash256(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (952:17): [True: 1.59k, False: 111k]
  ------------------
  953|  1.21k|                case Fragment::HASH160: return std::move(ret) + "hash160(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (953:17): [True: 1.21k, False: 111k]
  ------------------
  954|  1.92k|                case Fragment::SHA256: return std::move(ret) + "sha256(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (954:17): [True: 1.92k, False: 111k]
  ------------------
  955|  1.11k|                case Fragment::RIPEMD160: return std::move(ret) + "ripemd160(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (955:17): [True: 1.11k, False: 111k]
  ------------------
  956|  4.17k|                case Fragment::JUST_1: return std::move(ret) + "1";
  ------------------
  |  Branch (956:17): [True: 4.17k, False: 108k]
  ------------------
  957|  40.4k|                case Fragment::JUST_0: return std::move(ret) + "0";
  ------------------
  |  Branch (957:17): [True: 40.4k, False: 72.6k]
  ------------------
  958|  12.0k|                case Fragment::AND_V: return std::move(ret) + "and_v(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (958:17): [True: 12.0k, False: 101k]
  ------------------
  959|  2.99k|                case Fragment::AND_B: return std::move(ret) + "and_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (959:17): [True: 2.99k, False: 110k]
  ------------------
  960|  2.58k|                case Fragment::OR_B: return std::move(ret) + "or_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (960:17): [True: 2.58k, False: 110k]
  ------------------
  961|  3.87k|                case Fragment::OR_D: return std::move(ret) + "or_d(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (961:17): [True: 3.87k, False: 109k]
  ------------------
  962|  2.84k|                case Fragment::OR_C: return std::move(ret) + "or_c(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (962:17): [True: 2.84k, False: 110k]
  ------------------
  963|  5.73k|                case Fragment::OR_I: return std::move(ret) + "or_i(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (963:17): [True: 5.73k, False: 107k]
  ------------------
  964|  7.04k|                case Fragment::ANDOR:
  ------------------
  |  Branch (964:17): [True: 7.04k, False: 106k]
  ------------------
  965|       |                    // and_n(X,Y) is syntactic sugar for andor(X,Y,0).
  966|  7.04k|                    if (node.subs[2].fragment == Fragment::JUST_0) return std::move(ret) + "and_n(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (966:25): [True: 2.37k, False: 4.67k]
  ------------------
  967|  4.67k|                    return std::move(ret) + "andor(" + std::move(subs[0]) + "," + std::move(subs[1]) + "," + std::move(subs[2]) + ")";
  968|  4.76k|                case Fragment::MULTI: {
  ------------------
  |  Branch (968:17): [True: 4.76k, False: 108k]
  ------------------
  969|  4.76k|                    CHECK_NONFATAL(!is_tapscript);
  ------------------
  |  |  113|  4.76k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  970|  4.76k|                    auto str = std::move(ret) + "multi(" + util::ToString(node.k);
  971|  26.5k|                    for (const auto& key : node.keys) {
  ------------------
  |  Branch (971:42): [True: 26.5k, False: 4.76k]
  ------------------
  972|  26.5k|                        auto key_str = toString(key);
  973|  26.5k|                        if (!key_str) return {};
  ------------------
  |  Branch (973:29): [True: 0, False: 26.5k]
  ------------------
  974|  26.5k|                        str += "," + std::move(*key_str);
  975|  26.5k|                    }
  976|  4.76k|                    return std::move(str) + ")";
  977|  4.76k|                }
  978|  1.04k|                case Fragment::MULTI_A: {
  ------------------
  |  Branch (978:17): [True: 1.04k, False: 112k]
  ------------------
  979|  1.04k|                    CHECK_NONFATAL(is_tapscript);
  ------------------
  |  |  113|  1.04k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  980|  1.04k|                    auto str = std::move(ret) + "multi_a(" + util::ToString(node.k);
  981|  24.0k|                    for (const auto& key : node.keys) {
  ------------------
  |  Branch (981:42): [True: 24.0k, False: 1.04k]
  ------------------
  982|  24.0k|                        auto key_str = toString(key);
  983|  24.0k|                        if (!key_str) return {};
  ------------------
  |  Branch (983:29): [True: 0, False: 24.0k]
  ------------------
  984|  24.0k|                        str += "," + std::move(*key_str);
  985|  24.0k|                    }
  986|  1.04k|                    return std::move(str) + ")";
  987|  1.04k|                }
  988|  6.24k|                case Fragment::THRESH: {
  ------------------
  |  Branch (988:17): [True: 6.24k, False: 106k]
  ------------------
  989|  6.24k|                    auto str = std::move(ret) + "thresh(" + util::ToString(node.k);
  990|  22.3k|                    for (auto& sub : subs) {
  ------------------
  |  Branch (990:36): [True: 22.3k, False: 6.24k]
  ------------------
  991|  22.3k|                        str += "," + std::move(sub);
  992|  22.3k|                    }
  993|  6.24k|                    return std::move(str) + ")";
  994|  1.04k|                }
  995|      0|                default: break;
  ------------------
  |  Branch (995:17): [True: 0, False: 113k]
  ------------------
  996|   113k|            }
  997|   113k|            assert(false);
  ------------------
  |  Branch (997:13): [Folded, False: 0]
  ------------------
  998|      0|        };
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE8ToStringIN12_GLOBAL__N_113ParserContextEEENSt3__18optionalINS6_12basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEERKT_RbENKUlS1_E_clES1_:
  896|  63.7k|        auto toString = [&ctx, &has_priv_key](Key key) -> std::optional<std::string> {
  897|  63.7k|            bool fragment_has_priv_key{false};
  898|  63.7k|            auto key_str{ctx.ToString(key, fragment_has_priv_key)};
  899|  63.7k|            if (key_str) has_priv_key = has_priv_key || fragment_has_priv_key;
  ------------------
  |  Branch (899:17): [True: 63.7k, False: 0]
  |  Branch (899:41): [True: 61.2k, False: 2.49k]
  |  Branch (899:57): [True: 2.49k, False: 0]
  ------------------
  900|  63.7k|            return key_str;
  901|  63.7k|        };
miniscript.cpp:_ZN10miniscript10FromStringIN12_GLOBAL__N_113ParserContextEEENSt3__18optionalINS_4NodeINT_3KeyEEEEERKNS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKS6_:
 2686|  4.76k|{
 2687|  4.76k|    return internal::Parse<typename Ctx::Key>(str, ctx);
 2688|  4.76k|}
miniscript.cpp:_ZN10miniscript8internal5ParseI7CPubKeyN12_GLOBAL__N_113ParserContextEEENSt3__18optionalINS_4NodeIT_EEEENS5_4spanIKcLm18446744073709551615EEERKT0_:
 1855|  4.76k|{
 1856|  4.76k|    using namespace script;
 1857|       |
 1858|       |    // Account for the minimum script size for all parsed fragments so far. It "borrows" 1
 1859|       |    // script byte from all leaf nodes, counting it instead whenever a space for a recursive
 1860|       |    // expression is added (through andor, and_*, or_*, thresh). This guarantees that all fragments
 1861|       |    // increment the script_size by at least one, except for:
 1862|       |    // - "0", "1": these leafs are only a single byte, so their subtracted-from increment is 0.
 1863|       |    //   This is not an issue however, as "space" for them has to be created by combinators,
 1864|       |    //   which do increment script_size.
 1865|       |    // - "v:": the v wrapper adds nothing as in some cases it results in no opcode being added
 1866|       |    //   (instead transforming another opcode into its VERIFY form). However, the v: wrapper has
 1867|       |    //   to be interleaved with other fragments to be valid, so this is not a concern.
 1868|  4.76k|    size_t script_size{1};
 1869|  4.76k|    size_t max_size{internal::MaxScriptSize(ctx.MsContext())};
 1870|       |
 1871|       |    // The two integers are used to hold state for thresh()
 1872|  4.76k|    std::vector<std::tuple<ParseContext, int64_t, int64_t>> to_parse;
 1873|  4.76k|    std::vector<Node<Key>> constructed;
 1874|       |
 1875|  4.76k|    to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 1876|       |
 1877|       |    // Parses a multi() or multi_a() from its string representation. Returns false on parsing error.
 1878|  4.76k|    const auto parse_multi_exp = [&](std::span<const char>& in, const bool is_multi_a) -> bool {
 1879|  4.76k|        const auto max_keys{is_multi_a ? MAX_PUBKEYS_PER_MULTI_A : MAX_PUBKEYS_PER_MULTISIG};
 1880|  4.76k|        const auto required_ctx{is_multi_a ? MiniscriptContext::TAPSCRIPT : MiniscriptContext::P2WSH};
 1881|  4.76k|        if (ctx.MsContext() != required_ctx) return false;
 1882|       |        // Get threshold
 1883|  4.76k|        int next_comma = FindNextChar(in, ',');
 1884|  4.76k|        if (next_comma < 1) return false;
 1885|  4.76k|        const auto k_to_integral{ToIntegral<int64_t>(std::string_view(in.data(), next_comma))};
 1886|  4.76k|        if (!k_to_integral.has_value()) return false;
 1887|  4.76k|        const int64_t k{k_to_integral.value()};
 1888|  4.76k|        in = in.subspan(next_comma + 1);
 1889|       |        // Get keys. It is compatible for both compressed and x-only keys.
 1890|  4.76k|        std::vector<Key> keys;
 1891|  4.76k|        while (next_comma != -1) {
 1892|  4.76k|            next_comma = FindNextChar(in, ',');
 1893|  4.76k|            int key_length = (next_comma == -1) ? FindNextChar(in, ')') : next_comma;
 1894|  4.76k|            if (key_length < 1) return false;
 1895|  4.76k|            std::span<const char> sp{in.begin(), in.begin() + key_length};
 1896|  4.76k|            auto key = ctx.FromString(sp);
 1897|  4.76k|            if (!key) return false;
 1898|  4.76k|            keys.push_back(std::move(*key));
 1899|  4.76k|            in = in.subspan(key_length + 1);
 1900|  4.76k|        }
 1901|  4.76k|        if (keys.size() < 1 || keys.size() > max_keys) return false;
 1902|  4.76k|        if (k < 1 || k > (int64_t)keys.size()) return false;
 1903|  4.76k|        if (is_multi_a) {
 1904|       |            // (push + xonly-key + CHECKSIG[ADD]) * n + k + OP_NUMEQUAL(VERIFY), minus one.
 1905|  4.76k|            script_size += (1 + 32 + 1) * keys.size() + BuildScript(k).size();
 1906|  4.76k|            constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::MULTI_A, std::move(keys), k);
 1907|  4.76k|        } else {
 1908|  4.76k|            script_size += 2 + (keys.size() > 16) + (k > 16) + 34 * keys.size();
 1909|  4.76k|            constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::MULTI, std::move(keys), k);
 1910|  4.76k|        }
 1911|  4.76k|        return true;
 1912|  4.76k|    };
 1913|       |
 1914|   405k|    while (!to_parse.empty()) {
  ------------------
  |  Branch (1914:12): [True: 400k, False: 4.76k]
  ------------------
 1915|   400k|        if (script_size > max_size) return {};
  ------------------
  |  Branch (1915:13): [True: 0, False: 400k]
  ------------------
 1916|       |
 1917|       |        // Get the current context we are decoding within
 1918|   400k|        auto [cur_context, n, k] = to_parse.back();
 1919|   400k|        to_parse.pop_back();
 1920|       |
 1921|   400k|        switch (cur_context) {
  ------------------
  |  Branch (1921:17): [True: 400k, False: 0]
  ------------------
 1922|   106k|        case ParseContext::WRAPPED_EXPR: {
  ------------------
  |  Branch (1922:9): [True: 106k, False: 294k]
  ------------------
 1923|   106k|            std::optional<size_t> colon_index{};
 1924|   233k|            for (size_t i = 1; i < in.size(); ++i) {
  ------------------
  |  Branch (1924:32): [True: 233k, False: 11]
  ------------------
 1925|   233k|                if (in[i] == ':') {
  ------------------
  |  Branch (1925:21): [True: 40.0k, False: 193k]
  ------------------
 1926|  40.0k|                    colon_index = i;
 1927|  40.0k|                    break;
 1928|  40.0k|                }
 1929|   193k|                if (in[i] < 'a' || in[i] > 'z') break;
  ------------------
  |  Branch (1929:21): [True: 66.0k, False: 127k]
  |  Branch (1929:36): [True: 0, False: 127k]
  ------------------
 1930|   193k|            }
 1931|       |            // If there is no colon, this loop won't execute
 1932|   106k|            bool last_was_v{false};
 1933|   156k|            for (size_t j = 0; colon_index && j < *colon_index; ++j) {
  ------------------
  |  Branch (1933:32): [True: 89.9k, False: 66.0k]
  |  Branch (1933:47): [True: 49.9k, False: 40.0k]
  ------------------
 1934|  49.9k|                if (script_size > max_size) return {};
  ------------------
  |  Branch (1934:21): [True: 0, False: 49.9k]
  ------------------
 1935|  49.9k|                if (in[j] == 'a') {
  ------------------
  |  Branch (1935:21): [True: 20.5k, False: 29.3k]
  ------------------
 1936|  20.5k|                    script_size += 2;
 1937|  20.5k|                    to_parse.emplace_back(ParseContext::ALT, -1, -1);
 1938|  29.3k|                } else if (in[j] == 's') {
  ------------------
  |  Branch (1938:28): [True: 1.31k, False: 28.0k]
  ------------------
 1939|  1.31k|                    script_size += 1;
 1940|  1.31k|                    to_parse.emplace_back(ParseContext::SWAP, -1, -1);
 1941|  28.0k|                } else if (in[j] == 'c') {
  ------------------
  |  Branch (1941:28): [True: 2.50k, False: 25.5k]
  ------------------
 1942|  2.50k|                    script_size += 1;
 1943|  2.50k|                    to_parse.emplace_back(ParseContext::CHECK, -1, -1);
 1944|  25.5k|                } else if (in[j] == 'd') {
  ------------------
  |  Branch (1944:28): [True: 598, False: 24.9k]
  ------------------
 1945|    598|                    script_size += 3;
 1946|    598|                    to_parse.emplace_back(ParseContext::DUP_IF, -1, -1);
 1947|  24.9k|                } else if (in[j] == 'j') {
  ------------------
  |  Branch (1947:28): [True: 1.71k, False: 23.2k]
  ------------------
 1948|  1.71k|                    script_size += 4;
 1949|  1.71k|                    to_parse.emplace_back(ParseContext::NON_ZERO, -1, -1);
 1950|  23.2k|                } else if (in[j] == 'n') {
  ------------------
  |  Branch (1950:28): [True: 3.13k, False: 20.0k]
  ------------------
 1951|  3.13k|                    script_size += 1;
 1952|  3.13k|                    to_parse.emplace_back(ParseContext::ZERO_NOTEQUAL, -1, -1);
 1953|  20.0k|                } else if (in[j] == 'v') {
  ------------------
  |  Branch (1953:28): [True: 15.4k, False: 4.58k]
  ------------------
 1954|       |                    // do not permit "...vv...:"; it's not valid, and also doesn't trigger early
 1955|       |                    // failure as script_size isn't incremented.
 1956|  15.4k|                    if (last_was_v) return {};
  ------------------
  |  Branch (1956:25): [True: 0, False: 15.4k]
  ------------------
 1957|  15.4k|                    to_parse.emplace_back(ParseContext::VERIFY, -1, -1);
 1958|  15.4k|                } else if (in[j] == 'u') {
  ------------------
  |  Branch (1958:28): [True: 2.59k, False: 1.99k]
  ------------------
 1959|  2.59k|                    script_size += 4;
 1960|  2.59k|                    to_parse.emplace_back(ParseContext::WRAP_U, -1, -1);
 1961|  2.59k|                } else if (in[j] == 't') {
  ------------------
  |  Branch (1961:28): [True: 1.00k, False: 990]
  ------------------
 1962|  1.00k|                    script_size += 1;
 1963|  1.00k|                    to_parse.emplace_back(ParseContext::WRAP_T, -1, -1);
 1964|  1.00k|                } else if (in[j] == 'l') {
  ------------------
  |  Branch (1964:28): [True: 990, False: 0]
  ------------------
 1965|       |                    // The l: wrapper is equivalent to or_i(0,X)
 1966|    990|                    script_size += 4;
 1967|    990|                    constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_0);
 1968|    990|                    to_parse.emplace_back(ParseContext::OR_I, -1, -1);
 1969|    990|                } else {
 1970|      0|                    return {};
 1971|      0|                }
 1972|  49.9k|                last_was_v = (in[j] == 'v');
 1973|  49.9k|            }
 1974|   106k|            to_parse.emplace_back(ParseContext::EXPR, -1, -1);
 1975|   106k|            if (colon_index) in = in.subspan(*colon_index + 1);
  ------------------
  |  Branch (1975:17): [True: 40.0k, False: 66.0k]
  ------------------
 1976|   106k|            break;
 1977|   106k|        }
 1978|   106k|        case ParseContext::EXPR: {
  ------------------
  |  Branch (1978:9): [True: 106k, False: 294k]
  ------------------
 1979|   106k|            if (Const("0", in)) {
  ------------------
  |  Branch (1979:17): [True: 34.4k, False: 71.6k]
  ------------------
 1980|  34.4k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_0);
 1981|  71.6k|            } else if (Const("1", in)) {
  ------------------
  |  Branch (1981:24): [True: 3.16k, False: 68.4k]
  ------------------
 1982|  3.16k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_1);
 1983|  68.4k|            } else if (Const("pk(", in, /*skip=*/false)) {
  ------------------
  |  Branch (1983:24): [True: 1.90k, False: 66.5k]
  ------------------
 1984|  1.90k|                std::optional<Key> key = ParseKey<Key, Ctx>("pk", in, ctx);
 1985|  1.90k|                if (!key) return {};
  ------------------
  |  Branch (1985:21): [True: 0, False: 1.90k]
  ------------------
 1986|  1.90k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_C, Vector(Node<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::PK_K, Vector(std::move(*key)))));
 1987|  1.90k|                script_size += IsTapscript(ctx.MsContext()) ? 33 : 34;
  ------------------
  |  Branch (1987:32): [True: 449, False: 1.45k]
  ------------------
 1988|  66.5k|            } else if (Const("pkh(", in, /*skip=*/false)) {
  ------------------
  |  Branch (1988:24): [True: 689, False: 65.8k]
  ------------------
 1989|    689|                std::optional<Key> key = ParseKey<Key, Ctx>("pkh", in, ctx);
 1990|    689|                if (!key) return {};
  ------------------
  |  Branch (1990:21): [True: 0, False: 689]
  ------------------
 1991|    689|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_C, Vector(Node<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::PK_H, Vector(std::move(*key)))));
 1992|    689|                script_size += 24;
 1993|  65.8k|            } else if (Const("pk_k(", in, /*skip=*/false)) {
  ------------------
  |  Branch (1993:24): [True: 6.57k, False: 59.3k]
  ------------------
 1994|  6.57k|                std::optional<Key> key = ParseKey<Key, Ctx>("pk_k", in, ctx);
 1995|  6.57k|                if (!key) return {};
  ------------------
  |  Branch (1995:21): [True: 0, False: 6.57k]
  ------------------
 1996|  6.57k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::PK_K, Vector(std::move(*key)));
 1997|  6.57k|                script_size += IsTapscript(ctx.MsContext()) ? 32 : 33;
  ------------------
  |  Branch (1997:32): [True: 2.55k, False: 4.02k]
  ------------------
 1998|  59.3k|            } else if (Const("pk_h(", in, /*skip=*/false)) {
  ------------------
  |  Branch (1998:24): [True: 1.35k, False: 57.9k]
  ------------------
 1999|  1.35k|                std::optional<Key> key = ParseKey<Key, Ctx>("pk_h", in, ctx);
 2000|  1.35k|                if (!key) return {};
  ------------------
  |  Branch (2000:21): [True: 0, False: 1.35k]
  ------------------
 2001|  1.35k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::PK_H, Vector(std::move(*key)));
 2002|  1.35k|                script_size += 23;
 2003|  57.9k|            } else if (Const("sha256(", in, /*skip=*/false)) {
  ------------------
  |  Branch (2003:24): [True: 1.92k, False: 56.0k]
  ------------------
 2004|  1.92k|                std::optional<std::vector<unsigned char>> hash = ParseHexStr("sha256", in, 32);
 2005|  1.92k|                if (!hash) return {};
  ------------------
  |  Branch (2005:21): [True: 0, False: 1.92k]
  ------------------
 2006|  1.92k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::SHA256, std::move(*hash));
 2007|  1.92k|                script_size += 38;
 2008|  56.0k|            } else if (Const("ripemd160(", in, /*skip=*/false)) {
  ------------------
  |  Branch (2008:24): [True: 1.11k, False: 54.9k]
  ------------------
 2009|  1.11k|                std::optional<std::vector<unsigned char>> hash = ParseHexStr("ripemd160", in, 20);
 2010|  1.11k|                if (!hash) return {};
  ------------------
  |  Branch (2010:21): [True: 0, False: 1.11k]
  ------------------
 2011|  1.11k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::RIPEMD160, std::move(*hash));
 2012|  1.11k|                script_size += 26;
 2013|  54.9k|            } else if (Const("hash256(", in, /*skip=*/false)) {
  ------------------
  |  Branch (2013:24): [True: 1.59k, False: 53.3k]
  ------------------
 2014|  1.59k|                std::optional<std::vector<unsigned char>> hash = ParseHexStr("hash256", in, 32);
 2015|  1.59k|                if (!hash) return {};
  ------------------
  |  Branch (2015:21): [True: 0, False: 1.59k]
  ------------------
 2016|  1.59k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::HASH256, std::move(*hash));
 2017|  1.59k|                script_size += 38;
 2018|  53.3k|            } else if (Const("hash160(", in, /*skip=*/false)) {
  ------------------
  |  Branch (2018:24): [True: 1.21k, False: 52.0k]
  ------------------
 2019|  1.21k|                std::optional<std::vector<unsigned char>> hash = ParseHexStr("hash160", in, 20);
 2020|  1.21k|                if (!hash) return {};
  ------------------
  |  Branch (2020:21): [True: 0, False: 1.21k]
  ------------------
 2021|  1.21k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::HASH160, std::move(*hash));
 2022|  1.21k|                script_size += 26;
 2023|  52.0k|            } else if (Const("after(", in, /*skip=*/false)) {
  ------------------
  |  Branch (2023:24): [True: 1.30k, False: 50.7k]
  ------------------
 2024|  1.30k|                auto expr = Expr(in);
 2025|  1.30k|                if (!Func("after", expr)) return {};
  ------------------
  |  Branch (2025:21): [True: 0, False: 1.30k]
  ------------------
 2026|  1.30k|                const auto num{ToIntegral<int64_t>(std::string_view(expr.begin(), expr.end()))};
 2027|  1.30k|                if (!num.has_value() || *num < 1 || *num >= 0x80000000L) return {};
  ------------------
  |  Branch (2027:21): [True: 0, False: 1.30k]
  |  Branch (2027:41): [True: 0, False: 1.30k]
  |  Branch (2027:53): [True: 0, False: 1.30k]
  ------------------
 2028|  1.30k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::AFTER, *num);
 2029|  1.30k|                script_size += 1 + (*num > 16) + (*num > 0x7f) + (*num > 0x7fff) + (*num > 0x7fffff);
 2030|  50.7k|            } else if (Const("older(", in, /*skip=*/false)) {
  ------------------
  |  Branch (2030:24): [True: 1.60k, False: 49.1k]
  ------------------
 2031|  1.60k|                auto expr = Expr(in);
 2032|  1.60k|                if (!Func("older", expr)) return {};
  ------------------
  |  Branch (2032:21): [True: 0, False: 1.60k]
  ------------------
 2033|  1.60k|                const auto num{ToIntegral<int64_t>(std::string_view(expr.begin(), expr.end()))};
 2034|  1.60k|                if (!num.has_value() || *num < 1 || *num >= 0x80000000L) return {};
  ------------------
  |  Branch (2034:21): [True: 0, False: 1.60k]
  |  Branch (2034:41): [True: 0, False: 1.60k]
  |  Branch (2034:53): [True: 0, False: 1.60k]
  ------------------
 2035|  1.60k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::OLDER, *num);
 2036|  1.60k|                script_size += 1 + (*num > 16) + (*num > 0x7f) + (*num > 0x7fff) + (*num > 0x7fffff);
 2037|  49.1k|            } else if (Const("multi(", in)) {
  ------------------
  |  Branch (2037:24): [True: 4.76k, False: 44.4k]
  ------------------
 2038|  4.76k|                if (!parse_multi_exp(in, /* is_multi_a = */false)) return {};
  ------------------
  |  Branch (2038:21): [True: 0, False: 4.76k]
  ------------------
 2039|  44.4k|            } else if (Const("multi_a(", in)) {
  ------------------
  |  Branch (2039:24): [True: 1.04k, False: 43.3k]
  ------------------
 2040|  1.04k|                if (!parse_multi_exp(in, /* is_multi_a = */true)) return {};
  ------------------
  |  Branch (2040:21): [True: 0, False: 1.04k]
  ------------------
 2041|  43.3k|            } else if (Const("thresh(", in)) {
  ------------------
  |  Branch (2041:24): [True: 6.24k, False: 37.1k]
  ------------------
 2042|  6.24k|                int next_comma = FindNextChar(in, ',');
 2043|  6.24k|                if (next_comma < 1) return {};
  ------------------
  |  Branch (2043:21): [True: 0, False: 6.24k]
  ------------------
 2044|  6.24k|                const auto k{ToIntegral<int64_t>(std::string_view(in.data(), next_comma))};
 2045|  6.24k|                if (!k.has_value() || *k < 1) return {};
  ------------------
  |  Branch (2045:21): [True: 0, False: 6.24k]
  |  Branch (2045:39): [True: 0, False: 6.24k]
  ------------------
 2046|  6.24k|                in = in.subspan(next_comma + 1);
 2047|       |                // n = 1 here because we read the first WRAPPED_EXPR before reaching THRESH
 2048|  6.24k|                to_parse.emplace_back(ParseContext::THRESH, 1, *k);
 2049|  6.24k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2050|  6.24k|                script_size += 2 + (*k > 16) + (*k > 0x7f) + (*k > 0x7fff) + (*k > 0x7fffff);
 2051|  37.1k|            } else if (Const("andor(", in)) {
  ------------------
  |  Branch (2051:24): [True: 4.67k, False: 32.4k]
  ------------------
 2052|  4.67k|                to_parse.emplace_back(ParseContext::ANDOR, -1, -1);
 2053|  4.67k|                to_parse.emplace_back(ParseContext::CLOSE_BRACKET, -1, -1);
 2054|  4.67k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2055|  4.67k|                to_parse.emplace_back(ParseContext::COMMA, -1, -1);
 2056|  4.67k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2057|  4.67k|                to_parse.emplace_back(ParseContext::COMMA, -1, -1);
 2058|  4.67k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2059|  4.67k|                script_size += 5;
 2060|  32.4k|            } else {
 2061|  32.4k|                if (Const("and_n(", in)) {
  ------------------
  |  Branch (2061:21): [True: 2.37k, False: 30.0k]
  ------------------
 2062|  2.37k|                    to_parse.emplace_back(ParseContext::AND_N, -1, -1);
 2063|  2.37k|                    script_size += 5;
 2064|  30.0k|                } else if (Const("and_b(", in)) {
  ------------------
  |  Branch (2064:28): [True: 2.99k, False: 27.0k]
  ------------------
 2065|  2.99k|                    to_parse.emplace_back(ParseContext::AND_B, -1, -1);
 2066|  2.99k|                    script_size += 2;
 2067|  27.0k|                } else if (Const("and_v(", in)) {
  ------------------
  |  Branch (2067:28): [True: 12.0k, False: 15.0k]
  ------------------
 2068|  12.0k|                    to_parse.emplace_back(ParseContext::AND_V, -1, -1);
 2069|  12.0k|                    script_size += 1;
 2070|  15.0k|                } else if (Const("or_b(", in)) {
  ------------------
  |  Branch (2070:28): [True: 2.58k, False: 12.4k]
  ------------------
 2071|  2.58k|                    to_parse.emplace_back(ParseContext::OR_B, -1, -1);
 2072|  2.58k|                    script_size += 2;
 2073|  12.4k|                } else if (Const("or_c(", in)) {
  ------------------
  |  Branch (2073:28): [True: 2.84k, False: 9.60k]
  ------------------
 2074|  2.84k|                    to_parse.emplace_back(ParseContext::OR_C, -1, -1);
 2075|  2.84k|                    script_size += 3;
 2076|  9.60k|                } else if (Const("or_d(", in)) {
  ------------------
  |  Branch (2076:28): [True: 3.87k, False: 5.73k]
  ------------------
 2077|  3.87k|                    to_parse.emplace_back(ParseContext::OR_D, -1, -1);
 2078|  3.87k|                    script_size += 4;
 2079|  5.73k|                } else if (Const("or_i(", in)) {
  ------------------
  |  Branch (2079:28): [True: 5.73k, False: 0]
  ------------------
 2080|  5.73k|                    to_parse.emplace_back(ParseContext::OR_I, -1, -1);
 2081|  5.73k|                    script_size += 4;
 2082|  5.73k|                } else {
 2083|      0|                    return {};
 2084|      0|                }
 2085|  32.4k|                to_parse.emplace_back(ParseContext::CLOSE_BRACKET, -1, -1);
 2086|  32.4k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2087|  32.4k|                to_parse.emplace_back(ParseContext::COMMA, -1, -1);
 2088|  32.4k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2089|  32.4k|            }
 2090|   106k|            break;
 2091|   106k|        }
 2092|   106k|        case ParseContext::ALT: {
  ------------------
  |  Branch (2092:9): [True: 20.5k, False: 380k]
  ------------------
 2093|  20.5k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_A, Vector(std::move(constructed.back()))};
 2094|  20.5k|            break;
 2095|   106k|        }
 2096|  1.31k|        case ParseContext::SWAP: {
  ------------------
  |  Branch (2096:9): [True: 1.31k, False: 399k]
  ------------------
 2097|  1.31k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_S, Vector(std::move(constructed.back()))};
 2098|  1.31k|            break;
 2099|   106k|        }
 2100|  2.50k|        case ParseContext::CHECK: {
  ------------------
  |  Branch (2100:9): [True: 2.50k, False: 398k]
  ------------------
 2101|  2.50k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_C, Vector(std::move(constructed.back()))};
 2102|  2.50k|            break;
 2103|   106k|        }
 2104|    598|        case ParseContext::DUP_IF: {
  ------------------
  |  Branch (2104:9): [True: 598, False: 399k]
  ------------------
 2105|    598|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_D, Vector(std::move(constructed.back()))};
 2106|    598|            break;
 2107|   106k|        }
 2108|  1.71k|        case ParseContext::NON_ZERO: {
  ------------------
  |  Branch (2108:9): [True: 1.71k, False: 398k]
  ------------------
 2109|  1.71k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_J, Vector(std::move(constructed.back()))};
 2110|  1.71k|            break;
 2111|   106k|        }
 2112|  3.13k|        case ParseContext::ZERO_NOTEQUAL: {
  ------------------
  |  Branch (2112:9): [True: 3.13k, False: 397k]
  ------------------
 2113|  3.13k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_N, Vector(std::move(constructed.back()))};
 2114|  3.13k|            break;
 2115|   106k|        }
 2116|  15.4k|        case ParseContext::VERIFY: {
  ------------------
  |  Branch (2116:9): [True: 15.4k, False: 385k]
  ------------------
 2117|  15.4k|            script_size += (constructed.back().GetType() << "x"_mst);
 2118|  15.4k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_V, Vector(std::move(constructed.back()))};
 2119|  15.4k|            break;
 2120|   106k|        }
 2121|  2.59k|        case ParseContext::WRAP_U: {
  ------------------
  |  Branch (2121:9): [True: 2.59k, False: 398k]
  ------------------
 2122|  2.59k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::OR_I, Vector(std::move(constructed.back()), Node<Key>{internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_0})};
 2123|  2.59k|            break;
 2124|   106k|        }
 2125|  1.00k|        case ParseContext::WRAP_T: {
  ------------------
  |  Branch (2125:9): [True: 1.00k, False: 399k]
  ------------------
 2126|  1.00k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::AND_V, Vector(std::move(constructed.back()), Node<Key>{internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_1})};
 2127|  1.00k|            break;
 2128|   106k|        }
 2129|  2.99k|        case ParseContext::AND_B: {
  ------------------
  |  Branch (2129:9): [True: 2.99k, False: 397k]
  ------------------
 2130|  2.99k|            BuildBack(ctx.MsContext(), Fragment::AND_B, constructed);
 2131|  2.99k|            break;
 2132|   106k|        }
 2133|  2.37k|        case ParseContext::AND_N: {
  ------------------
  |  Branch (2133:9): [True: 2.37k, False: 398k]
  ------------------
 2134|  2.37k|            auto mid = std::move(constructed.back());
 2135|  2.37k|            constructed.pop_back();
 2136|  2.37k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::ANDOR, Vector(std::move(constructed.back()), std::move(mid), Node<Key>{internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_0})};
 2137|  2.37k|            break;
 2138|   106k|        }
 2139|  12.0k|        case ParseContext::AND_V: {
  ------------------
  |  Branch (2139:9): [True: 12.0k, False: 388k]
  ------------------
 2140|  12.0k|            BuildBack(ctx.MsContext(), Fragment::AND_V, constructed);
 2141|  12.0k|            break;
 2142|   106k|        }
 2143|  2.58k|        case ParseContext::OR_B: {
  ------------------
  |  Branch (2143:9): [True: 2.58k, False: 398k]
  ------------------
 2144|  2.58k|            BuildBack(ctx.MsContext(), Fragment::OR_B, constructed);
 2145|  2.58k|            break;
 2146|   106k|        }
 2147|  2.84k|        case ParseContext::OR_C: {
  ------------------
  |  Branch (2147:9): [True: 2.84k, False: 397k]
  ------------------
 2148|  2.84k|            BuildBack(ctx.MsContext(), Fragment::OR_C, constructed);
 2149|  2.84k|            break;
 2150|   106k|        }
 2151|  3.87k|        case ParseContext::OR_D: {
  ------------------
  |  Branch (2151:9): [True: 3.87k, False: 396k]
  ------------------
 2152|  3.87k|            BuildBack(ctx.MsContext(), Fragment::OR_D, constructed);
 2153|  3.87k|            break;
 2154|   106k|        }
 2155|  6.72k|        case ParseContext::OR_I: {
  ------------------
  |  Branch (2155:9): [True: 6.72k, False: 393k]
  ------------------
 2156|  6.72k|            BuildBack(ctx.MsContext(), Fragment::OR_I, constructed);
 2157|  6.72k|            break;
 2158|   106k|        }
 2159|  4.67k|        case ParseContext::ANDOR: {
  ------------------
  |  Branch (2159:9): [True: 4.67k, False: 395k]
  ------------------
 2160|  4.67k|            auto right = std::move(constructed.back());
 2161|  4.67k|            constructed.pop_back();
 2162|  4.67k|            auto mid = std::move(constructed.back());
 2163|  4.67k|            constructed.pop_back();
 2164|  4.67k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::ANDOR, Vector(std::move(constructed.back()), std::move(mid), std::move(right))};
 2165|  4.67k|            break;
 2166|   106k|        }
 2167|  22.3k|        case ParseContext::THRESH: {
  ------------------
  |  Branch (2167:9): [True: 22.3k, False: 378k]
  ------------------
 2168|  22.3k|            if (in.size() < 1) return {};
  ------------------
  |  Branch (2168:17): [True: 0, False: 22.3k]
  ------------------
 2169|  22.3k|            if (in[0] == ',') {
  ------------------
  |  Branch (2169:17): [True: 16.1k, False: 6.24k]
  ------------------
 2170|  16.1k|                in = in.subspan(1);
 2171|  16.1k|                to_parse.emplace_back(ParseContext::THRESH, n+1, k);
 2172|  16.1k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2173|  16.1k|                script_size += 2;
 2174|  16.1k|            } else if (in[0] == ')') {
  ------------------
  |  Branch (2174:24): [True: 6.24k, False: 0]
  ------------------
 2175|  6.24k|                if (k > n) return {};
  ------------------
  |  Branch (2175:21): [True: 0, False: 6.24k]
  ------------------
 2176|  6.24k|                in = in.subspan(1);
 2177|       |                // Children are constructed in reverse order, so iterate from end to beginning
 2178|  6.24k|                std::vector<Node<Key>> subs;
 2179|  28.6k|                for (int i = 0; i < n; ++i) {
  ------------------
  |  Branch (2179:33): [True: 22.3k, False: 6.24k]
  ------------------
 2180|  22.3k|                    subs.push_back(std::move(constructed.back()));
 2181|  22.3k|                    constructed.pop_back();
 2182|  22.3k|                }
 2183|  6.24k|                std::reverse(subs.begin(), subs.end());
 2184|  6.24k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::THRESH, std::move(subs), k);
 2185|  6.24k|            } else {
 2186|      0|                return {};
 2187|      0|            }
 2188|  22.3k|            break;
 2189|  22.3k|        }
 2190|  41.8k|        case ParseContext::COMMA: {
  ------------------
  |  Branch (2190:9): [True: 41.8k, False: 358k]
  ------------------
 2191|  41.8k|            if (in.size() < 1 || in[0] != ',') return {};
  ------------------
  |  Branch (2191:17): [True: 0, False: 41.8k]
  |  Branch (2191:34): [True: 0, False: 41.8k]
  ------------------
 2192|  41.8k|            in = in.subspan(1);
 2193|  41.8k|            break;
 2194|  41.8k|        }
 2195|  37.1k|        case ParseContext::CLOSE_BRACKET: {
  ------------------
  |  Branch (2195:9): [True: 37.1k, False: 363k]
  ------------------
 2196|  37.1k|            if (in.size() < 1 || in[0] != ')') return {};
  ------------------
  |  Branch (2196:17): [True: 0, False: 37.1k]
  |  Branch (2196:34): [True: 0, False: 37.1k]
  ------------------
 2197|  37.1k|            in = in.subspan(1);
 2198|  37.1k|            break;
 2199|  37.1k|        }
 2200|   400k|        }
 2201|   400k|    }
 2202|       |
 2203|       |    // Sanity checks on the produced miniscript
 2204|  4.76k|    assert(constructed.size() >= 1);
  ------------------
  |  Branch (2204:5): [True: 4.76k, False: 0]
  ------------------
 2205|  4.76k|    CHECK_NONFATAL(constructed.size() == 1);
  ------------------
  |  |  113|  4.76k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
 2206|  4.76k|    assert(constructed[0].ScriptSize() == script_size);
  ------------------
  |  Branch (2206:5): [True: 4.76k, False: 0]
  ------------------
 2207|  4.76k|    if (in.size() > 0) return {};
  ------------------
  |  Branch (2207:9): [True: 0, False: 4.76k]
  ------------------
 2208|  4.76k|    Node<Key> tl_node{std::move(constructed.front())};
 2209|  4.76k|    tl_node.DuplicateKeyCheck(ctx);
 2210|  4.76k|    return tl_node;
 2211|  4.76k|}
miniscript.cpp:_ZN10miniscript8internal8ParseKeyI7CPubKeyN12_GLOBAL__N_113ParserContextEEENSt3__18optionalIT_EERKNS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEERNS5_4spanIKcLm18446744073709551615EEERKT0_:
 1817|  10.5k|{
 1818|  10.5k|    std::span<const char> expr = script::Expr(in);
 1819|  10.5k|    if (!script::Func(func, expr)) return {};
  ------------------
  |  Branch (1819:9): [True: 0, False: 10.5k]
  ------------------
 1820|  10.5k|    return ctx.FromString(expr);
 1821|  10.5k|}
miniscript.cpp:_ZZN10miniscript8internal5ParseI7CPubKeyN12_GLOBAL__N_113ParserContextEEENSt3__18optionalINS_4NodeIT_EEEENS5_4spanIKcLm18446744073709551615EEERKT0_ENKUlRSD_bE_clESH_b:
 1878|  5.81k|    const auto parse_multi_exp = [&](std::span<const char>& in, const bool is_multi_a) -> bool {
 1879|  5.81k|        const auto max_keys{is_multi_a ? MAX_PUBKEYS_PER_MULTI_A : MAX_PUBKEYS_PER_MULTISIG};
  ------------------
  |  Branch (1879:29): [True: 1.04k, False: 4.76k]
  ------------------
 1880|  5.81k|        const auto required_ctx{is_multi_a ? MiniscriptContext::TAPSCRIPT : MiniscriptContext::P2WSH};
  ------------------
  |  Branch (1880:33): [True: 1.04k, False: 4.76k]
  ------------------
 1881|  5.81k|        if (ctx.MsContext() != required_ctx) return false;
  ------------------
  |  Branch (1881:13): [True: 0, False: 5.81k]
  ------------------
 1882|       |        // Get threshold
 1883|  5.81k|        int next_comma = FindNextChar(in, ',');
 1884|  5.81k|        if (next_comma < 1) return false;
  ------------------
  |  Branch (1884:13): [True: 0, False: 5.81k]
  ------------------
 1885|  5.81k|        const auto k_to_integral{ToIntegral<int64_t>(std::string_view(in.data(), next_comma))};
 1886|  5.81k|        if (!k_to_integral.has_value()) return false;
  ------------------
  |  Branch (1886:13): [True: 0, False: 5.81k]
  ------------------
 1887|  5.81k|        const int64_t k{k_to_integral.value()};
 1888|  5.81k|        in = in.subspan(next_comma + 1);
 1889|       |        // Get keys. It is compatible for both compressed and x-only keys.
 1890|  5.81k|        std::vector<Key> keys;
 1891|  56.4k|        while (next_comma != -1) {
  ------------------
  |  Branch (1891:16): [True: 50.6k, False: 5.81k]
  ------------------
 1892|  50.6k|            next_comma = FindNextChar(in, ',');
 1893|  50.6k|            int key_length = (next_comma == -1) ? FindNextChar(in, ')') : next_comma;
  ------------------
  |  Branch (1893:30): [True: 5.81k, False: 44.7k]
  ------------------
 1894|  50.6k|            if (key_length < 1) return false;
  ------------------
  |  Branch (1894:17): [True: 0, False: 50.6k]
  ------------------
 1895|  50.6k|            std::span<const char> sp{in.begin(), in.begin() + key_length};
 1896|  50.6k|            auto key = ctx.FromString(sp);
 1897|  50.6k|            if (!key) return false;
  ------------------
  |  Branch (1897:17): [True: 0, False: 50.6k]
  ------------------
 1898|  50.6k|            keys.push_back(std::move(*key));
 1899|  50.6k|            in = in.subspan(key_length + 1);
 1900|  50.6k|        }
 1901|  5.81k|        if (keys.size() < 1 || keys.size() > max_keys) return false;
  ------------------
  |  Branch (1901:13): [True: 0, False: 5.81k]
  |  Branch (1901:32): [True: 0, False: 5.81k]
  ------------------
 1902|  5.81k|        if (k < 1 || k > (int64_t)keys.size()) return false;
  ------------------
  |  Branch (1902:13): [True: 0, False: 5.81k]
  |  Branch (1902:22): [True: 0, False: 5.81k]
  ------------------
 1903|  5.81k|        if (is_multi_a) {
  ------------------
  |  Branch (1903:13): [True: 1.04k, False: 4.76k]
  ------------------
 1904|       |            // (push + xonly-key + CHECKSIG[ADD]) * n + k + OP_NUMEQUAL(VERIFY), minus one.
 1905|  1.04k|            script_size += (1 + 32 + 1) * keys.size() + BuildScript(k).size();
 1906|  1.04k|            constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::MULTI_A, std::move(keys), k);
 1907|  4.76k|        } else {
 1908|  4.76k|            script_size += 2 + (keys.size() > 16) + (k > 16) + 34 * keys.size();
 1909|  4.76k|            constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::MULTI, std::move(keys), k);
 1910|  4.76k|        }
 1911|  5.81k|        return true;
 1912|  5.81k|    };
_ZNK10miniscript4NodeI7CPubKeyEeqERKS2_:
 1717|  4.76k|    bool operator==(const Node<Key>& arg) const { return Compare(*this, arg) == 0; }
_ZN10miniscript7CompareERKNS_4NodeI7CPubKeyEES4_:
  761|  4.76k|    {
  762|  4.76k|        std::vector<std::pair<const Node<Key>&, const Node<Key>&>> queue;
  763|  4.76k|        queue.emplace_back(node1, node2);
  764|   170k|        while (!queue.empty()) {
  ------------------
  |  Branch (764:16): [True: 165k, False: 4.76k]
  ------------------
  765|   165k|            const auto& [a, b] = queue.back();
  766|   165k|            queue.pop_back();
  767|   165k|            if (std::tie(a.fragment, a.k, a.keys, a.data) < std::tie(b.fragment, b.k, b.keys, b.data)) return -1;
  ------------------
  |  Branch (767:17): [True: 0, False: 165k]
  ------------------
  768|   165k|            if (std::tie(b.fragment, b.k, b.keys, b.data) < std::tie(a.fragment, a.k, a.keys, a.data)) return 1;
  ------------------
  |  Branch (768:17): [True: 0, False: 165k]
  ------------------
  769|   165k|            if (a.subs.size() < b.subs.size()) return -1;
  ------------------
  |  Branch (769:17): [True: 0, False: 165k]
  ------------------
  770|   165k|            if (b.subs.size() < a.subs.size()) return 1;
  ------------------
  |  Branch (770:17): [True: 0, False: 165k]
  ------------------
  771|   165k|            size_t n = a.subs.size();
  772|   326k|            for (size_t i = 0; i < n; ++i) {
  ------------------
  |  Branch (772:32): [True: 160k, False: 165k]
  ------------------
  773|   160k|                queue.emplace_back(a.subs[n - 1 - i], b.subs[n - 1 - i]);
  774|   160k|            }
  775|   165k|        }
  776|  4.76k|        return 0;
  777|  4.76k|    }
_ZN10miniscript4NodeI7CPubKeyEC2ENS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentENSt3__16vectorIS2_NS7_9allocatorIS2_EEEENS8_IhNS9_IhEEEEj:
 1721|   171k|        : fragment(nt), k(val), data(std::move(arg)), subs(std::move(sub)), m_script_ctx{script_ctx}, ops(CalcOps()), ss(CalcStackSize()), ws(CalcWitnessSize()), typ(CalcType()), scriptlen(CalcScriptLen()) {}
_ZNK10miniscript4NodeI7CPubKeyE4SubsEv:
  591|  17.2k|    const std::vector<Node>& Subs() const { return subs; }
_ZNK10miniscript4NodeI7CPubKeyE12GetStaticOpsEv:
 1568|  4.76k|    uint32_t GetStaticOps() const { return ops.count; }
miniscript.cpp:_ZNK10miniscript4NodeI7CPubKeyE17DuplicateKeyCheckIN12_GLOBAL__N_113KeyComparatorEEEvRKT_:
 1501|  4.76k|    {
 1502|       |        // We cannot use a lambda here, as lambdas are non assignable, and the set operations
 1503|       |        // below require moving the comparators around.
 1504|  4.76k|        struct Comp {
 1505|  4.76k|            const Ctx* ctx_ptr;
 1506|  4.76k|            Comp(const Ctx& ctx) : ctx_ptr(&ctx) {}
 1507|  4.76k|            bool operator()(const Key& a, const Key& b) const { return ctx_ptr->KeyCompare(a, b); }
 1508|  4.76k|        };
 1509|       |
 1510|       |        // state in the recursive computation:
 1511|       |        // - std::nullopt means "this node has duplicates"
 1512|       |        // - an std::set means "this node has no duplicate keys, and they are: ...".
 1513|  4.76k|        using keyset = std::set<Key, Comp>;
 1514|  4.76k|        using state = std::optional<keyset>;
 1515|       |
 1516|  4.76k|        auto upfn = [&ctx](const Node& node, std::span<state> subs) -> state {
 1517|       |            // If this node is already known to have duplicates, nothing left to do.
 1518|  4.76k|            if (node.has_duplicate_keys.has_value() && *node.has_duplicate_keys) return {};
 1519|       |
 1520|       |            // Check if one of the children is already known to have duplicates.
 1521|  4.76k|            for (auto& sub : subs) {
 1522|  4.76k|                if (!sub.has_value()) {
 1523|  4.76k|                    node.has_duplicate_keys = true;
 1524|  4.76k|                    return {};
 1525|  4.76k|                }
 1526|  4.76k|            }
 1527|       |
 1528|       |            // Start building the set of keys involved in this node and children.
 1529|       |            // Start by keys in this node directly.
 1530|  4.76k|            size_t keys_count = node.keys.size();
 1531|  4.76k|            keyset key_set{node.keys.begin(), node.keys.end(), Comp(ctx)};
 1532|  4.76k|            if (key_set.size() != keys_count) {
 1533|       |                // It already has duplicates; bail out.
 1534|  4.76k|                node.has_duplicate_keys = true;
 1535|  4.76k|                return {};
 1536|  4.76k|            }
 1537|       |
 1538|       |            // Merge the keys from the children into this set.
 1539|  4.76k|            for (auto& sub : subs) {
 1540|  4.76k|                keys_count += sub->size();
 1541|       |                // Small optimization: std::set::merge is linear in the size of the second arg but
 1542|       |                // logarithmic in the size of the first.
 1543|  4.76k|                if (key_set.size() < sub->size()) std::swap(key_set, *sub);
 1544|  4.76k|                key_set.merge(*sub);
 1545|  4.76k|                if (key_set.size() != keys_count) {
 1546|  4.76k|                    node.has_duplicate_keys = true;
 1547|  4.76k|                    return {};
 1548|  4.76k|                }
 1549|  4.76k|            }
 1550|       |
 1551|  4.76k|            node.has_duplicate_keys = false;
 1552|  4.76k|            return key_set;
 1553|  4.76k|        };
 1554|       |
 1555|  4.76k|        TreeEval<state>(upfn);
 1556|  4.76k|    }
miniscript.cpp:_ZNK10miniscript4NodeI7CPubKeyE8TreeEvalINSt3__18optionalINS4_3setIS1_ZNKS2_17DuplicateKeyCheckIN12_GLOBAL__N_113KeyComparatorEEEvRKT_E4CompNS4_9allocatorIS1_EEEEEEZNKS7_IS9_EEvSC_EUlRKS2_NS4_4spanISH_Lm18446744073709551615EEEE_EESA_T0_:
  748|  4.76k|    {
  749|  4.76k|        struct DummyState {};
  750|  4.76k|        return std::move(*TreeEvalMaybe<Result>(DummyState{},
  751|  4.76k|            [](DummyState, const Node&, size_t) { return DummyState{}; },
  752|  4.76k|            [&upfn](DummyState, const Node& node, std::span<Result> subs) {
  753|  4.76k|                Result res{upfn(node, subs)};
  754|  4.76k|                return std::optional<Result>(std::move(res));
  755|  4.76k|            }
  756|  4.76k|        ));
  757|  4.76k|    }
miniscript.cpp:_ZNK10miniscript4NodeI7CPubKeyE13TreeEvalMaybeINSt3__18optionalINS4_3setIS1_ZNKS2_17DuplicateKeyCheckIN12_GLOBAL__N_113KeyComparatorEEEvRKT_E4CompNS4_9allocatorIS1_EEEEEEZNKS2_8TreeEvalISH_ZNKS7_IS9_EEvSC_EUlRKS2_NS4_4spanISH_Lm18446744073709551615EEEE_EESA_T0_E10DummyStateZNKSI_ISH_SN_EESA_SO_EUlSP_SK_mE_ZNKSI_ISH_SN_EESA_SO_EUlSP_SK_SM_E_EENS5_ISA_EESO_T1_T2_:
  653|  4.76k|    {
  654|       |        /** Entries of the explicit stack tracked in this algorithm. */
  655|  4.76k|        struct StackElem
  656|  4.76k|        {
  657|  4.76k|            const Node& node; //!< The node being evaluated.
  658|  4.76k|            size_t expanded; //!< How many children of this node have been expanded.
  659|  4.76k|            State state; //!< The state for that node.
  660|       |
  661|  4.76k|            StackElem(const Node& node_, size_t exp_, State&& state_) :
  662|  4.76k|                node(node_), expanded(exp_), state(std::move(state_)) {}
  663|  4.76k|        };
  664|       |        /* Stack of tree nodes being explored. */
  665|  4.76k|        std::vector<StackElem> stack;
  666|       |        /* Results of subtrees so far. Their order and mapping to tree nodes
  667|       |         * is implicitly defined by stack. */
  668|  4.76k|        std::vector<Result> results;
  669|  4.76k|        stack.emplace_back(*this, 0, std::move(root_state));
  670|       |
  671|       |        /* Here is a demonstration of the algorithm, for an example tree A(B,C(D,E),F).
  672|       |         * State variables are omitted for simplicity.
  673|       |         *
  674|       |         * First: stack=[(A,0)] results=[]
  675|       |         *        stack=[(A,1),(B,0)] results=[]
  676|       |         *        stack=[(A,1)] results=[B]
  677|       |         *        stack=[(A,2),(C,0)] results=[B]
  678|       |         *        stack=[(A,2),(C,1),(D,0)] results=[B]
  679|       |         *        stack=[(A,2),(C,1)] results=[B,D]
  680|       |         *        stack=[(A,2),(C,2),(E,0)] results=[B,D]
  681|       |         *        stack=[(A,2),(C,2)] results=[B,D,E]
  682|       |         *        stack=[(A,2)] results=[B,C]
  683|       |         *        stack=[(A,3),(F,0)] results=[B,C]
  684|       |         *        stack=[(A,3)] results=[B,C,F]
  685|       |         * Final: stack=[] results=[A]
  686|       |         */
  687|   331k|        while (stack.size()) {
  ------------------
  |  Branch (687:16): [True: 326k, False: 4.76k]
  ------------------
  688|   326k|            const Node& node = stack.back().node;
  689|   326k|            if (stack.back().expanded < node.subs.size()) {
  ------------------
  |  Branch (689:17): [True: 160k, False: 165k]
  ------------------
  690|       |                /* We encounter a tree node with at least one unexpanded child.
  691|       |                 * Expand it. By the time we hit this node again, the result of
  692|       |                 * that child (and all earlier children) will be at the end of `results`. */
  693|   160k|                size_t child_index = stack.back().expanded++;
  694|   160k|                State child_state = downfn(stack.back().state, node, child_index);
  695|   160k|                stack.emplace_back(node.subs[child_index], 0, std::move(child_state));
  696|   160k|                continue;
  697|   160k|            }
  698|       |            // Invoke upfn with the last node.subs.size() elements of results as input.
  699|   326k|            assert(results.size() >= node.subs.size());
  ------------------
  |  Branch (699:13): [True: 165k, False: 0]
  ------------------
  700|   165k|            std::optional<Result> result{upfn(std::move(stack.back().state), node,
  701|   165k|                std::span<Result>{results}.last(node.subs.size()))};
  702|       |            // If evaluation returns std::nullopt, abort immediately.
  703|   165k|            if (!result) return {};
  ------------------
  |  Branch (703:17): [True: 0, False: 165k]
  ------------------
  704|       |            // Replace the last node.subs.size() elements of results with the new result.
  705|   165k|            results.erase(results.end() - node.subs.size(), results.end());
  706|   165k|            results.push_back(std::move(*result));
  707|   165k|            stack.pop_back();
  708|   165k|        }
  709|       |        // The final remaining results element is the root result, return it.
  710|  4.76k|        assert(results.size() >= 1);
  ------------------
  |  Branch (710:9): [True: 4.76k, False: 0]
  ------------------
  711|  4.76k|        CHECK_NONFATAL(results.size() == 1);
  ------------------
  |  |  113|  4.76k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  712|  4.76k|        return std::move(results[0]);
  713|  4.76k|    }
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE13TreeEvalMaybeINSt3__18optionalINS4_3setIS1_ZNKS2_17DuplicateKeyCheckIN12_GLOBAL__N_113KeyComparatorEEEvRKT_E4CompNS4_9allocatorIS1_EEEEEEZNKS2_8TreeEvalISH_ZNKS7_IS9_EEvSC_EUlRKS2_NS4_4spanISH_Lm18446744073709551615EEEE_EESA_T0_E10DummyStateZNKSI_ISH_SN_EESA_SO_EUlSP_SK_mE_ZNKSI_ISH_SN_EESA_SO_EUlSP_SK_SM_E_EENS5_ISA_EESO_T1_T2_EN9StackElemC2ESK_mOSP_:
  662|   165k|                node(node_), expanded(exp_), state(std::move(state_)) {}
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE8TreeEvalINSt3__18optionalINS4_3setIS1_ZNKS2_17DuplicateKeyCheckIN12_GLOBAL__N_113KeyComparatorEEEvRKT_E4CompNS4_9allocatorIS1_EEEEEEZNKS7_IS9_EEvSC_EUlRKS2_NS4_4spanISH_Lm18446744073709551615EEEE_EESA_T0_ENKUlZNKS3_ISH_SM_EESA_SN_E10DummyStateSJ_mE_clESO_SJ_m:
  751|   160k|            [](DummyState, const Node&, size_t) { return DummyState{}; },
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE8TreeEvalINSt3__18optionalINS4_3setIS1_ZNKS2_17DuplicateKeyCheckIN12_GLOBAL__N_113KeyComparatorEEEvRKT_E4CompNS4_9allocatorIS1_EEEEEEZNKS7_IS9_EEvSC_EUlRKS2_NS4_4spanISH_Lm18446744073709551615EEEE_EESA_T0_ENKUlZNKS3_ISH_SM_EESA_SN_E10DummyStateSJ_SL_E_clESO_SJ_SL_:
  752|   165k|            [&upfn](DummyState, const Node& node, std::span<Result> subs) {
  753|   165k|                Result res{upfn(node, subs)};
  754|   165k|                return std::optional<Result>(std::move(res));
  755|   165k|            }
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE17DuplicateKeyCheckIN12_GLOBAL__N_113KeyComparatorEEEvRKT_ENKUlRKS2_NSt3__14spanINSB_8optionalINSB_3setIS1_ZNKS3_IS5_EEvS8_E4CompNSB_9allocatorIS1_EEEEEELm18446744073709551615EEEE_clESA_SK_:
 1516|   165k|        auto upfn = [&ctx](const Node& node, std::span<state> subs) -> state {
 1517|       |            // If this node is already known to have duplicates, nothing left to do.
 1518|   165k|            if (node.has_duplicate_keys.has_value() && *node.has_duplicate_keys) return {};
  ------------------
  |  Branch (1518:17): [True: 0, False: 165k]
  |  Branch (1518:56): [True: 0, False: 0]
  ------------------
 1519|       |
 1520|       |            // Check if one of the children is already known to have duplicates.
 1521|   165k|            for (auto& sub : subs) {
  ------------------
  |  Branch (1521:28): [True: 147k, False: 148k]
  ------------------
 1522|   147k|                if (!sub.has_value()) {
  ------------------
  |  Branch (1522:21): [True: 17.3k, False: 130k]
  ------------------
 1523|  17.3k|                    node.has_duplicate_keys = true;
 1524|  17.3k|                    return {};
 1525|  17.3k|                }
 1526|   147k|            }
 1527|       |
 1528|       |            // Start building the set of keys involved in this node and children.
 1529|       |            // Start by keys in this node directly.
 1530|   148k|            size_t keys_count = node.keys.size();
 1531|   148k|            keyset key_set{node.keys.begin(), node.keys.end(), Comp(ctx)};
 1532|   148k|            if (key_set.size() != keys_count) {
  ------------------
  |  Branch (1532:17): [True: 2.12k, False: 146k]
  ------------------
 1533|       |                // It already has duplicates; bail out.
 1534|  2.12k|                node.has_duplicate_keys = true;
 1535|  2.12k|                return {};
 1536|  2.12k|            }
 1537|       |
 1538|       |            // Merge the keys from the children into this set.
 1539|   146k|            for (auto& sub : subs) {
  ------------------
  |  Branch (1539:28): [True: 124k, False: 144k]
  ------------------
 1540|   124k|                keys_count += sub->size();
 1541|       |                // Small optimization: std::set::merge is linear in the size of the second arg but
 1542|       |                // logarithmic in the size of the first.
 1543|   124k|                if (key_set.size() < sub->size()) std::swap(key_set, *sub);
  ------------------
  |  Branch (1543:21): [True: 14.7k, False: 109k]
  ------------------
 1544|   124k|                key_set.merge(*sub);
 1545|   124k|                if (key_set.size() != keys_count) {
  ------------------
  |  Branch (1545:21): [True: 1.16k, False: 122k]
  ------------------
 1546|  1.16k|                    node.has_duplicate_keys = true;
 1547|  1.16k|                    return {};
 1548|  1.16k|                }
 1549|   124k|            }
 1550|       |
 1551|   144k|            node.has_duplicate_keys = false;
 1552|   144k|            return key_set;
 1553|   146k|        };
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE17DuplicateKeyCheckIN12_GLOBAL__N_113KeyComparatorEEEvRKT_EN4CompC2ERKS5_:
 1506|   148k|            Comp(const Ctx& ctx) : ctx_ptr(&ctx) {}
miniscript.cpp:_ZZNK10miniscript4NodeI7CPubKeyE17DuplicateKeyCheckIN12_GLOBAL__N_113KeyComparatorEEEvRKT_ENK4CompclERKS1_SB_:
 1507|   226k|            bool operator()(const Key& a, const Key& b) const { return ctx_ptr->KeyCompare(a, b); }
_ZN10miniscript8internal11ParseHexStrERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_4spanIKcLm18446744073709551615EEEm:
 1825|  5.84k|{
 1826|  5.84k|    std::span<const char> expr = script::Expr(in);
 1827|  5.84k|    if (!script::Func(func, expr)) return {};
  ------------------
  |  Branch (1827:9): [True: 0, False: 5.84k]
  ------------------
 1828|  5.84k|    std::string val = std::string(expr.begin(), expr.end());
 1829|  5.84k|    if (!IsHex(val)) return {};
  ------------------
  |  Branch (1829:9): [True: 0, False: 5.84k]
  ------------------
 1830|  5.84k|    auto hash = ParseHex(val);
 1831|  5.84k|    if (hash.size() != expected_size) return {};
  ------------------
  |  Branch (1831:9): [True: 0, False: 5.84k]
  ------------------
 1832|  5.84k|    return hash;
 1833|  5.84k|}
_ZNK10miniscript8internal7SatInfo5ValidEv:
  458|  6.23k|    bool Valid() const { return valid; }
_ZNK10miniscript8internal7SatInfo7NetDiffEv:
  459|  3.09k|    int32_t NetDiff() const { return netdiff; }
_ZNK10miniscript8internal6MaxIntIjE5ValidEv:
  374|  4.06k|    bool Valid() const { return valid; }
_ZNK10miniscript8internal6MaxIntIjE5ValueEv:
  375|  3.44k|    I Value() const { return value; }
_ZNK10miniscript8internal7SatInfo4ExecEv:
  460|  1.94k|    int32_t Exec() const { return exec; }
_ZNK10miniscript4Type2IfEb:
  157|   864k|    constexpr Type If(bool x) const { return Type(x ? m_flags : 0); }
  ------------------
  |  Branch (157:51): [True: 665k, False: 199k]
  ------------------
_ZN10miniscript4TypeC2Ej:
  135|  5.22M|    explicit constexpr Type(uint32_t flags) : m_flags(flags) {}
_ZNK10miniscript4TypeorES0_:
  142|  2.26M|    constexpr Type operator|(Type x) const { return Type(m_flags | x.m_flags); }
_ZNK10miniscript4TypeanES0_:
  145|  2.09M|    constexpr Type operator&(Type x) const { return Type(m_flags & x.m_flags); }
_ZNK10miniscript4TypeeqES0_:
  154|   983k|    constexpr bool operator==(Type x) const { return m_flags == x.m_flags; }
_ZN10miniscript8internal3OpsC2EjNS0_6MaxIntIjEES3_:
  397|   502k|    Ops(uint32_t in_count, MaxInt<uint32_t> in_sat, MaxInt<uint32_t> in_dsat) : count(in_count), sat(in_sat), dsat(in_dsat) {};
_ZN10miniscript8internal7SatInfoC2Ev:
  452|  3.51M|    constexpr SatInfo() noexcept : valid(false), netdiff(0), exec(0) {}
_ZN10miniscript8internal7SatInfoC2Eii:
  456|  1.69M|        valid{true}, netdiff{in_netdiff}, exec{in_exec} {}
_ZN10miniscript8internalorERKNS0_7SatInfoES3_:
  464|  1.12M|    {
  465|       |        // Union with an empty set is itself.
  466|  1.12M|        if (!a.valid) return b;
  ------------------
  |  Branch (466:13): [True: 986k, False: 142k]
  ------------------
  467|   142k|        if (!b.valid) return a;
  ------------------
  |  Branch (467:13): [True: 72.1k, False: 70.1k]
  ------------------
  468|       |        // Otherwise the netdiff and exec of the union is the maximum of the individual values.
  469|  70.1k|        return {std::max(a.netdiff, b.netdiff), std::max(a.exec, b.exec)};
  470|   142k|    }
_ZN10miniscript8internalplERKNS0_7SatInfoES3_:
  474|  4.05M|    {
  475|       |        // Concatenation with an empty set yields an empty set.
  476|  4.05M|        if (!a.valid || !b.valid) return {};
  ------------------
  |  Branch (476:13): [True: 3.11M, False: 939k]
  |  Branch (476:25): [True: 146k, False: 792k]
  ------------------
  477|       |        // Otherwise, the maximum stack size difference for the combined scripts is the sum of the
  478|       |        // netdiffs, and the maximum stack size difference anywhere is either b.exec (if the
  479|       |        // maximum occurred in b) or b.netdiff+a.exec (if the maximum occurred in a).
  480|   792k|        return {a.netdiff + b.netdiff, std::max(b.exec, b.netdiff + a.exec)};
  481|  4.05M|    }
_ZN10miniscript8internal7SatInfo5EmptyEv:
  484|  37.6k|    static constexpr SatInfo Empty() noexcept { return {0, 0}; }
_ZN10miniscript8internal7SatInfo4PushEv:
  486|   250k|    static constexpr SatInfo Push() noexcept { return {-1, 0}; }
_ZN10miniscript8internal7SatInfo4HashEv:
  488|  23.3k|    static constexpr SatInfo Hash() noexcept { return {0, 0}; }
_ZN10miniscript8internal7SatInfo3NopEv:
  490|  8.77k|    static constexpr SatInfo Nop() noexcept { return {0, 0}; }
_ZN10miniscript8internal7SatInfo2IfEv:
  492|   179k|    static constexpr SatInfo If() noexcept { return {1, 1}; }
_ZN10miniscript8internal7SatInfo8BinaryOpEv:
  494|  80.7k|    static constexpr SatInfo BinaryOp() noexcept { return {1, 1}; }
_ZN10miniscript8internal7SatInfo6OP_DUPEv:
  497|  9.48k|    static constexpr SatInfo OP_DUP() noexcept { return {-1, 0}; }
_ZN10miniscript8internal7SatInfo8OP_IFDUPEb:
  498|  34.8k|    static constexpr SatInfo OP_IFDUP(bool nonzero) noexcept { return {nonzero ? -1 : 0, 0}; }
  ------------------
  |  Branch (498:72): [True: 11.6k, False: 23.2k]
  ------------------
_ZN10miniscript8internal7SatInfo14OP_EQUALVERIFYEv:
  499|  23.3k|    static constexpr SatInfo OP_EQUALVERIFY() noexcept { return {2, 2}; }
_ZN10miniscript8internal7SatInfo8OP_EQUALEv:
  500|  55.0k|    static constexpr SatInfo OP_EQUAL() noexcept { return {1, 1}; }
_ZN10miniscript8internal7SatInfo7OP_SIZEEv:
  501|  27.6k|    static constexpr SatInfo OP_SIZE() noexcept { return {-1, 0}; }
_ZN10miniscript8internal7SatInfo11OP_CHECKSIGEv:
  502|  30.4k|    static constexpr SatInfo OP_CHECKSIG() noexcept { return {1, 1}; }
_ZN10miniscript8internal7SatInfo12OP_0NOTEQUALEv:
  503|  10.2k|    static constexpr SatInfo OP_0NOTEQUAL() noexcept { return {0, 0}; }
_ZN10miniscript8internal7SatInfo9OP_VERIFYEv:
  504|  46.3k|    static constexpr SatInfo OP_VERIFY() noexcept { return {1, 1}; }
_ZN10miniscript8internal9StackSizeC2ENS0_7SatInfoES2_:
  512|   375k|    constexpr StackSize(SatInfo in_sat, SatInfo in_dsat) noexcept : sat(in_sat), dsat(in_dsat) {};
_ZN10miniscript8internal9StackSizeC2ENS0_7SatInfoE:
  513|  47.5k|    constexpr StackSize(SatInfo in_both) noexcept : sat(in_both), dsat(in_both) {};
_ZNK10miniscript8internal9StackSize3SatEv:
  515|  1.44M|    const SatInfo& Sat() const { return sat; }
_ZNK10miniscript8internal9StackSize4DsatEv:
  516|  1.31M|    const SatInfo& Dsat() const { return dsat; }
_ZN10miniscript8internal11WitnessSizeC2ENS0_6MaxIntIjEES3_:
  525|   407k|    WitnessSize(MaxInt<uint32_t> in_sat, MaxInt<uint32_t> in_dsat) : sat(in_sat), dsat(in_dsat) {};
_ZN10miniscript8internal13MaxScriptSizeENS_17MiniscriptContextE:
  285|   794k|{
  286|   794k|    if (IsTapscript(ms_ctx)) {
  ------------------
  |  Branch (286:9): [True: 313k, False: 481k]
  ------------------
  287|       |        // Leaf scripts under Tapscript are not explicitly limited in size. They are only implicitly
  288|       |        // bounded by the maximum standard size of a spending transaction. Let the maximum script
  289|       |        // size conservatively be small enough such that even a maximum sized witness and a reasonably
  290|       |        // sized spending transaction can spend an output paying to this script without running into
  291|       |        // the maximum standard tx size limit.
  292|   313k|        constexpr auto max_size{MAX_STANDARD_TX_WEIGHT - TX_BODY_LEEWAY_WEIGHT - MAX_TAPSCRIPT_SAT_SIZE};
  293|   313k|        return max_size - GetSizeOfCompactSize(max_size);
  294|   313k|    }
  295|   481k|    return MAX_STANDARD_P2WSH_SCRIPT_SIZE;
  296|   794k|}
_ZN10miniscript8internal10InputStackC2ENSt3__16vectorIhNS2_9allocatorIhEEEE:
  329|   128k|    InputStack(std::vector<unsigned char> in) : size(in.size() + 1), stack(Vector(std::move(in))) {}
_ZN10miniscript11IsTapscriptENS_17MiniscriptContextE:
  260|  2.63M|{
  261|  2.63M|    switch (ms_ctx) {
  ------------------
  |  Branch (261:13): [True: 2.63M, False: 0]
  ------------------
  262|  1.57M|        case MiniscriptContext::P2WSH: return false;
  ------------------
  |  Branch (262:9): [True: 1.57M, False: 1.05M]
  ------------------
  263|  1.05M|        case MiniscriptContext::TAPSCRIPT: return true;
  ------------------
  |  Branch (263:9): [True: 1.05M, False: 1.57M]
  ------------------
  264|  2.63M|    }
  265|  2.63M|    assert(false);
  ------------------
  |  Branch (265:5): [Folded, False: 0]
  ------------------
  266|      0|}
_ZN10miniscript8internal6MaxIntIjEC2Ej:
  372|  1.48M|    MaxInt(I val) : valid(true), value(val) {}
_ZN10miniscript8internal6MaxIntIjEC2Ev:
  371|  4.78M|    MaxInt() : valid(false), value(0) {}
_ZN10miniscript8internalplERKNS0_6MaxIntIjEES4_:
  377|  4.88M|    friend MaxInt<I> operator+(const MaxInt<I>& a, const MaxInt<I>& b) {
  378|  4.88M|        if (!a.valid || !b.valid) return {};
  ------------------
  |  Branch (378:13): [True: 4.00M, False: 877k]
  |  Branch (378:25): [True: 264k, False: 613k]
  ------------------
  379|   613k|        return a.value + b.value;
  380|  4.88M|    }
_ZN10miniscript8internalorERKNS0_6MaxIntIjEES4_:
  382|  2.25M|    friend MaxInt<I> operator|(const MaxInt<I>& a, const MaxInt<I>& b) {
  383|  2.25M|        if (!a.valid) return b;
  ------------------
  |  Branch (383:13): [True: 1.97M, False: 284k]
  ------------------
  384|   284k|        if (!b.valid) return a;
  ------------------
  |  Branch (384:13): [True: 144k, False: 140k]
  ------------------
  385|   140k|        return std::max(a.value, b.value);
  386|   284k|    }
_ZNK10miniscript4TypelsES0_:
  148|  17.0M|    constexpr bool operator<<(Type x) const { return (x.m_flags & ~m_flags) == 0; }
_ZN10miniscript8internal11InputResultC2IRKNS0_10InputStackERS3_EEOT_OT0_:
  360|  24.6k|    InputResult(A&& in_nsat, B&& in_sat) : nsat(std::forward<A>(in_nsat)), sat(std::forward<B>(in_sat)) {}
_ZN10miniscript8internal11InputResultC2INS0_10InputStackERS3_EEOT_OT0_:
  360|  3.52k|    InputResult(A&& in_nsat, B&& in_sat) : nsat(std::forward<A>(in_nsat)), sat(std::forward<B>(in_sat)) {}
_ZN10miniscript8internal11InputResultC2INS0_10InputStackES3_EEOT_OT0_:
  360|  68.7k|    InputResult(A&& in_nsat, B&& in_sat) : nsat(std::forward<A>(in_nsat)), sat(std::forward<B>(in_sat)) {}
_ZN10miniscript8internal11InputResultC2IRKNS0_10InputStackES5_EEOT_OT0_:
  360|  84.8k|    InputResult(A&& in_nsat, B&& in_sat) : nsat(std::forward<A>(in_nsat)), sat(std::forward<B>(in_sat)) {}
_ZN10miniscript8internal11InputResultC2IRNS0_10InputStackES3_EEOT_OT0_:
  360|  27.1k|    InputResult(A&& in_nsat, B&& in_sat) : nsat(std::forward<A>(in_nsat)), sat(std::forward<B>(in_sat)) {}
_ZN10miniscript8internal11InputResultC2IRKNS0_10InputStackES3_EEOT_OT0_:
  360|  33.3k|    InputResult(A&& in_nsat, B&& in_sat) : nsat(std::forward<A>(in_nsat)), sat(std::forward<B>(in_sat)) {}
_ZN10miniscript4NodeI7CPubKeyED2Ev:
  553|  1.53M|    {
  554|       |        // Destroy the subexpressions iteratively after moving out their
  555|       |        // subexpressions to avoid a stack-overflow due to recursive calls to
  556|       |        // the subs' destructors.
  557|       |        // We move vectors in order to only update array-pointers inside them
  558|       |        // rather than moving individual Node instances which would involve
  559|       |        // moving/copying each Node field.
  560|  1.53M|        std::vector<std::vector<Node>> queue;
  561|  1.53M|        queue.push_back(std::move(subs));
  562|  1.80M|        do {
  563|  1.80M|            auto flattening{std::move(queue.back())};
  564|  1.80M|            queue.pop_back();
  565|  1.80M|            for (Node& n : flattening) {
  ------------------
  |  Branch (565:26): [True: 481k, False: 1.80M]
  ------------------
  566|   481k|                if (!n.subs.empty()) queue.push_back(std::move(n.subs));
  ------------------
  |  Branch (566:21): [True: 272k, False: 209k]
  ------------------
  567|   481k|            }
  568|  1.80M|        } while (!queue.empty());
  ------------------
  |  Branch (568:18): [True: 272k, False: 1.53M]
  ------------------
  569|  1.53M|    }
_ZNK10miniscript4NodeI7CPubKeyE7IsValidEv:
 1675|   596k|    bool IsValid() const {
 1676|   596k|        if (GetType() == ""_mst) return false;
  ------------------
  |  Branch (1676:13): [True: 0, False: 596k]
  ------------------
 1677|   596k|        return ScriptSize() <= internal::MaxScriptSize(m_script_ctx);
 1678|   596k|    }
_ZNK10miniscript4NodeI7CPubKeyE7GetTypeEv:
 1617|  6.37M|    Type GetType() const { return typ; }
_ZNK10miniscript4NodeI7CPubKeyE10ScriptSizeEv:
 1559|  1.09M|    size_t ScriptSize() const { return scriptlen; }
_ZN10miniscript4NodeI7CPubKeyEC2ENS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentEj:
 1731|  89.9k|        : fragment(nt), k(val), m_script_ctx{script_ctx}, ops(CalcOps()), ss(CalcStackSize()), ws(CalcWitnessSize()), typ(CalcType()), scriptlen(CalcScriptLen()) {}
_ZNK10miniscript4NodeI7CPubKeyE7CalcOpsEv:
 1004|   502k|    internal::Ops CalcOps() const {
 1005|   502k|        switch (fragment) {
  ------------------
  |  Branch (1005:17): [True: 502k, False: 0]
  ------------------
 1006|  12.3k|            case Fragment::JUST_1: return {0, 0, {}};
  ------------------
  |  Branch (1006:13): [True: 12.3k, False: 490k]
  ------------------
 1007|   126k|            case Fragment::JUST_0: return {0, {}, 0};
  ------------------
  |  Branch (1007:13): [True: 126k, False: 376k]
  ------------------
 1008|  24.3k|            case Fragment::PK_K: return {0, 0, 0};
  ------------------
  |  Branch (1008:13): [True: 24.3k, False: 478k]
  ------------------
 1009|  5.92k|            case Fragment::PK_H: return {3, 0, 0};
  ------------------
  |  Branch (1009:13): [True: 5.92k, False: 496k]
  ------------------
 1010|  4.83k|            case Fragment::OLDER:
  ------------------
  |  Branch (1010:13): [True: 4.83k, False: 497k]
  ------------------
 1011|  8.77k|            case Fragment::AFTER: return {1, 0, {}};
  ------------------
  |  Branch (1011:13): [True: 3.94k, False: 498k]
  ------------------
 1012|  5.51k|            case Fragment::SHA256:
  ------------------
  |  Branch (1012:13): [True: 5.51k, False: 497k]
  ------------------
 1013|  8.94k|            case Fragment::RIPEMD160:
  ------------------
  |  Branch (1013:13): [True: 3.42k, False: 499k]
  ------------------
 1014|  13.7k|            case Fragment::HASH256:
  ------------------
  |  Branch (1014:13): [True: 4.77k, False: 498k]
  ------------------
 1015|  17.4k|            case Fragment::HASH160: return {4, 0, {}};
  ------------------
  |  Branch (1015:13): [True: 3.69k, False: 499k]
  ------------------
 1016|  39.5k|            case Fragment::AND_V: return {subs[0].ops.count + subs[1].ops.count, subs[0].ops.sat + subs[1].ops.sat, {}};
  ------------------
  |  Branch (1016:13): [True: 39.5k, False: 463k]
  ------------------
 1017|  8.92k|            case Fragment::AND_B: {
  ------------------
  |  Branch (1017:13): [True: 8.92k, False: 493k]
  ------------------
 1018|  8.92k|                const auto count{1 + subs[0].ops.count + subs[1].ops.count};
 1019|  8.92k|                const auto sat{subs[0].ops.sat + subs[1].ops.sat};
 1020|  8.92k|                const auto dsat{subs[0].ops.dsat + subs[1].ops.dsat};
 1021|  8.92k|                return {count, sat, dsat};
 1022|  13.7k|            }
 1023|  7.62k|            case Fragment::OR_B: {
  ------------------
  |  Branch (1023:13): [True: 7.62k, False: 495k]
  ------------------
 1024|  7.62k|                const auto count{1 + subs[0].ops.count + subs[1].ops.count};
 1025|  7.62k|                const auto sat{(subs[0].ops.sat + subs[1].ops.dsat) | (subs[1].ops.sat + subs[0].ops.dsat)};
 1026|  7.62k|                const auto dsat{subs[0].ops.dsat + subs[1].ops.dsat};
 1027|  7.62k|                return {count, sat, dsat};
 1028|  13.7k|            }
 1029|  11.6k|            case Fragment::OR_D: {
  ------------------
  |  Branch (1029:13): [True: 11.6k, False: 491k]
  ------------------
 1030|  11.6k|                const auto count{3 + subs[0].ops.count + subs[1].ops.count};
 1031|  11.6k|                const auto sat{subs[0].ops.sat | (subs[1].ops.sat + subs[0].ops.dsat)};
 1032|  11.6k|                const auto dsat{subs[0].ops.dsat + subs[1].ops.dsat};
 1033|  11.6k|                return {count, sat, dsat};
 1034|  13.7k|            }
 1035|  8.16k|            case Fragment::OR_C: {
  ------------------
  |  Branch (1035:13): [True: 8.16k, False: 494k]
  ------------------
 1036|  8.16k|                const auto count{2 + subs[0].ops.count + subs[1].ops.count};
 1037|  8.16k|                const auto sat{subs[0].ops.sat | (subs[1].ops.sat + subs[0].ops.dsat)};
 1038|  8.16k|                return {count, sat, {}};
 1039|  13.7k|            }
 1040|  26.7k|            case Fragment::OR_I: {
  ------------------
  |  Branch (1040:13): [True: 26.7k, False: 476k]
  ------------------
 1041|  26.7k|                const auto count{3 + subs[0].ops.count + subs[1].ops.count};
 1042|  26.7k|                const auto sat{subs[0].ops.sat | subs[1].ops.sat};
 1043|  26.7k|                const auto dsat{subs[0].ops.dsat | subs[1].ops.dsat};
 1044|  26.7k|                return {count, sat, dsat};
 1045|  13.7k|            }
 1046|  20.4k|            case Fragment::ANDOR: {
  ------------------
  |  Branch (1046:13): [True: 20.4k, False: 482k]
  ------------------
 1047|  20.4k|                const auto count{3 + subs[0].ops.count + subs[1].ops.count + subs[2].ops.count};
 1048|  20.4k|                const auto sat{(subs[1].ops.sat + subs[0].ops.sat) | (subs[0].ops.dsat + subs[2].ops.sat)};
 1049|  20.4k|                const auto dsat{subs[0].ops.dsat + subs[2].ops.dsat};
 1050|  20.4k|                return {count, sat, dsat};
 1051|  13.7k|            }
 1052|  14.1k|            case Fragment::MULTI: return {1, (uint32_t)keys.size(), (uint32_t)keys.size()};
  ------------------
  |  Branch (1052:13): [True: 14.1k, False: 488k]
  ------------------
 1053|  3.16k|            case Fragment::MULTI_A: return {(uint32_t)keys.size() + 1, 0, 0};
  ------------------
  |  Branch (1053:13): [True: 3.16k, False: 499k]
  ------------------
 1054|  3.91k|            case Fragment::WRAP_S:
  ------------------
  |  Branch (1054:13): [True: 3.91k, False: 498k]
  ------------------
 1055|  19.1k|            case Fragment::WRAP_C:
  ------------------
  |  Branch (1055:13): [True: 15.2k, False: 487k]
  ------------------
 1056|  28.5k|            case Fragment::WRAP_N: return {1 + subs[0].ops.count, subs[0].ops.sat, subs[0].ops.dsat};
  ------------------
  |  Branch (1056:13): [True: 9.44k, False: 493k]
  ------------------
 1057|  66.7k|            case Fragment::WRAP_A: return {2 + subs[0].ops.count, subs[0].ops.sat, subs[0].ops.dsat};
  ------------------
  |  Branch (1057:13): [True: 66.7k, False: 436k]
  ------------------
 1058|  1.78k|            case Fragment::WRAP_D: return {3 + subs[0].ops.count, subs[0].ops.sat, 0};
  ------------------
  |  Branch (1058:13): [True: 1.78k, False: 501k]
  ------------------
 1059|  5.12k|            case Fragment::WRAP_J: return {4 + subs[0].ops.count, subs[0].ops.sat, 0};
  ------------------
  |  Branch (1059:13): [True: 5.12k, False: 497k]
  ------------------
 1060|  46.3k|            case Fragment::WRAP_V: return {subs[0].ops.count + (subs[0].GetType() << "x"_mst), subs[0].ops.sat, {}};
  ------------------
  |  Branch (1060:13): [True: 46.3k, False: 456k]
  ------------------
 1061|  18.8k|            case Fragment::THRESH: {
  ------------------
  |  Branch (1061:13): [True: 18.8k, False: 483k]
  ------------------
 1062|  18.8k|                uint32_t count = 0;
 1063|  18.8k|                auto sats = Vector(internal::MaxInt<uint32_t>(0));
 1064|  66.4k|                for (const auto& sub : subs) {
  ------------------
  |  Branch (1064:38): [True: 66.4k, False: 18.8k]
  ------------------
 1065|  66.4k|                    count += sub.ops.count + 1;
 1066|  66.4k|                    auto next_sats = Vector(sats[0] + sub.ops.dsat);
 1067|  1.09M|                    for (size_t j = 1; j < sats.size(); ++j) next_sats.push_back((sats[j] + sub.ops.dsat) | (sats[j - 1] + sub.ops.sat));
  ------------------
  |  Branch (1067:40): [True: 1.02M, False: 66.4k]
  ------------------
 1068|  66.4k|                    next_sats.push_back(sats[sats.size() - 1] + sub.ops.sat);
 1069|  66.4k|                    sats = std::move(next_sats);
 1070|  66.4k|                }
 1071|  18.8k|                assert(k < sats.size());
  ------------------
  |  Branch (1071:17): [True: 18.8k, False: 0]
  ------------------
 1072|  18.8k|                return {count, sats[k], sats[0]};
 1073|  18.8k|            }
 1074|   502k|        }
 1075|   502k|        assert(false);
  ------------------
  |  Branch (1075:9): [Folded, False: 0]
  ------------------
 1076|      0|    }
_ZNK10miniscript4NodeI7CPubKeyE13CalcStackSizeEv:
 1078|   502k|    internal::StackSize CalcStackSize() const {
 1079|   502k|        using namespace internal;
 1080|   502k|        switch (fragment) {
  ------------------
  |  Branch (1080:17): [True: 502k, False: 0]
  ------------------
 1081|   126k|            case Fragment::JUST_0: return {{}, SatInfo::Push()};
  ------------------
  |  Branch (1081:13): [True: 126k, False: 376k]
  ------------------
 1082|  12.3k|            case Fragment::JUST_1: return {SatInfo::Push(), {}};
  ------------------
  |  Branch (1082:13): [True: 12.3k, False: 490k]
  ------------------
 1083|  4.83k|            case Fragment::OLDER:
  ------------------
  |  Branch (1083:13): [True: 4.83k, False: 497k]
  ------------------
 1084|  8.77k|            case Fragment::AFTER: return {SatInfo::Push() + SatInfo::Nop(), {}};
  ------------------
  |  Branch (1084:13): [True: 3.94k, False: 498k]
  ------------------
 1085|  24.3k|            case Fragment::PK_K: return {SatInfo::Push()};
  ------------------
  |  Branch (1085:13): [True: 24.3k, False: 478k]
  ------------------
 1086|  5.92k|            case Fragment::PK_H: return {SatInfo::OP_DUP() + SatInfo::Hash() + SatInfo::Push() + SatInfo::OP_EQUALVERIFY()};
  ------------------
  |  Branch (1086:13): [True: 5.92k, False: 496k]
  ------------------
 1087|  5.51k|            case Fragment::SHA256:
  ------------------
  |  Branch (1087:13): [True: 5.51k, False: 497k]
  ------------------
 1088|  8.94k|            case Fragment::RIPEMD160:
  ------------------
  |  Branch (1088:13): [True: 3.42k, False: 499k]
  ------------------
 1089|  13.7k|            case Fragment::HASH256:
  ------------------
  |  Branch (1089:13): [True: 4.77k, False: 498k]
  ------------------
 1090|  17.4k|            case Fragment::HASH160: return {
  ------------------
  |  Branch (1090:13): [True: 3.69k, False: 499k]
  ------------------
 1091|  17.4k|                SatInfo::OP_SIZE() + SatInfo::Push() + SatInfo::OP_EQUALVERIFY() + SatInfo::Hash() + SatInfo::Push() + SatInfo::OP_EQUAL(),
 1092|  17.4k|                {}
 1093|  17.4k|            };
 1094|  20.4k|            case Fragment::ANDOR: {
  ------------------
  |  Branch (1094:13): [True: 20.4k, False: 482k]
  ------------------
 1095|  20.4k|                const auto& x{subs[0].ss};
 1096|  20.4k|                const auto& y{subs[1].ss};
 1097|  20.4k|                const auto& z{subs[2].ss};
 1098|  20.4k|                return {
 1099|  20.4k|                    (x.Sat() + SatInfo::If() + y.Sat()) | (x.Dsat() + SatInfo::If() + z.Sat()),
 1100|  20.4k|                    x.Dsat() + SatInfo::If() + z.Dsat()
 1101|  20.4k|                };
 1102|  13.7k|            }
 1103|  39.5k|            case Fragment::AND_V: {
  ------------------
  |  Branch (1103:13): [True: 39.5k, False: 463k]
  ------------------
 1104|  39.5k|                const auto& x{subs[0].ss};
 1105|  39.5k|                const auto& y{subs[1].ss};
 1106|  39.5k|                return {x.Sat() + y.Sat(), {}};
 1107|  13.7k|            }
 1108|  8.92k|            case Fragment::AND_B: {
  ------------------
  |  Branch (1108:13): [True: 8.92k, False: 493k]
  ------------------
 1109|  8.92k|                const auto& x{subs[0].ss};
 1110|  8.92k|                const auto& y{subs[1].ss};
 1111|  8.92k|                return {x.Sat() + y.Sat() + SatInfo::BinaryOp(), x.Dsat() + y.Dsat() + SatInfo::BinaryOp()};
 1112|  13.7k|            }
 1113|  7.62k|            case Fragment::OR_B: {
  ------------------
  |  Branch (1113:13): [True: 7.62k, False: 495k]
  ------------------
 1114|  7.62k|                const auto& x{subs[0].ss};
 1115|  7.62k|                const auto& y{subs[1].ss};
 1116|  7.62k|                return {
 1117|  7.62k|                    ((x.Sat() + y.Dsat()) | (x.Dsat() + y.Sat())) + SatInfo::BinaryOp(),
 1118|  7.62k|                    x.Dsat() + y.Dsat() + SatInfo::BinaryOp()
 1119|  7.62k|                };
 1120|  13.7k|            }
 1121|  8.16k|            case Fragment::OR_C: {
  ------------------
  |  Branch (1121:13): [True: 8.16k, False: 494k]
  ------------------
 1122|  8.16k|                const auto& x{subs[0].ss};
 1123|  8.16k|                const auto& y{subs[1].ss};
 1124|  8.16k|                return {(x.Sat() + SatInfo::If()) | (x.Dsat() + SatInfo::If() + y.Sat()), {}};
 1125|  13.7k|            }
 1126|  11.6k|            case Fragment::OR_D: {
  ------------------
  |  Branch (1126:13): [True: 11.6k, False: 491k]
  ------------------
 1127|  11.6k|                const auto& x{subs[0].ss};
 1128|  11.6k|                const auto& y{subs[1].ss};
 1129|  11.6k|                return {
 1130|  11.6k|                    (x.Sat() + SatInfo::OP_IFDUP(true) + SatInfo::If()) | (x.Dsat() + SatInfo::OP_IFDUP(false) + SatInfo::If() + y.Sat()),
 1131|  11.6k|                    x.Dsat() + SatInfo::OP_IFDUP(false) + SatInfo::If() + y.Dsat()
 1132|  11.6k|                };
 1133|  13.7k|            }
 1134|  26.7k|            case Fragment::OR_I: {
  ------------------
  |  Branch (1134:13): [True: 26.7k, False: 476k]
  ------------------
 1135|  26.7k|                const auto& x{subs[0].ss};
 1136|  26.7k|                const auto& y{subs[1].ss};
 1137|  26.7k|                return {SatInfo::If() + (x.Sat() | y.Sat()), SatInfo::If() + (x.Dsat() | y.Dsat())};
 1138|  13.7k|            }
 1139|       |            // multi(k, key1, key2, ..., key_n) starts off with k+1 stack elements (a 0, plus k
 1140|       |            // signatures), then reaches n+k+3 stack elements after pushing the n keys, plus k and
 1141|       |            // n itself, and ends with 1 stack element (success or failure). Thus, it net removes
 1142|       |            // k elements (from k+1 to 1), while reaching k+n+2 more than it ends with.
 1143|  14.1k|            case Fragment::MULTI: return {SatInfo(k, k + keys.size() + 2)};
  ------------------
  |  Branch (1143:13): [True: 14.1k, False: 488k]
  ------------------
 1144|       |            // multi_a(k, key1, key2, ..., key_n) starts off with n stack elements (the
 1145|       |            // signatures), reaches 1 more (after the first key push), and ends with 1. Thus it net
 1146|       |            // removes n-1 elements (from n to 1) while reaching n more than it ends with.
 1147|  3.16k|            case Fragment::MULTI_A: return {SatInfo(keys.size() - 1, keys.size())};
  ------------------
  |  Branch (1147:13): [True: 3.16k, False: 499k]
  ------------------
 1148|  66.7k|            case Fragment::WRAP_A:
  ------------------
  |  Branch (1148:13): [True: 66.7k, False: 436k]
  ------------------
 1149|  76.2k|            case Fragment::WRAP_N:
  ------------------
  |  Branch (1149:13): [True: 9.44k, False: 493k]
  ------------------
 1150|  80.1k|            case Fragment::WRAP_S: return subs[0].ss;
  ------------------
  |  Branch (1150:13): [True: 3.91k, False: 498k]
  ------------------
 1151|  15.2k|            case Fragment::WRAP_C: return {
  ------------------
  |  Branch (1151:13): [True: 15.2k, False: 487k]
  ------------------
 1152|  15.2k|                subs[0].ss.Sat() + SatInfo::OP_CHECKSIG(),
 1153|  15.2k|                subs[0].ss.Dsat() + SatInfo::OP_CHECKSIG()
 1154|  15.2k|            };
 1155|  1.78k|            case Fragment::WRAP_D: return {
  ------------------
  |  Branch (1155:13): [True: 1.78k, False: 501k]
  ------------------
 1156|  1.78k|                SatInfo::OP_DUP() + SatInfo::If() + subs[0].ss.Sat(),
 1157|  1.78k|                SatInfo::OP_DUP() + SatInfo::If()
 1158|  1.78k|            };
 1159|  46.3k|            case Fragment::WRAP_V: return {subs[0].ss.Sat() + SatInfo::OP_VERIFY(), {}};
  ------------------
  |  Branch (1159:13): [True: 46.3k, False: 456k]
  ------------------
 1160|  5.12k|            case Fragment::WRAP_J: return {
  ------------------
  |  Branch (1160:13): [True: 5.12k, False: 497k]
  ------------------
 1161|  5.12k|                SatInfo::OP_SIZE() + SatInfo::OP_0NOTEQUAL() + SatInfo::If() + subs[0].ss.Sat(),
 1162|  5.12k|                SatInfo::OP_SIZE() + SatInfo::OP_0NOTEQUAL() + SatInfo::If()
 1163|  5.12k|            };
 1164|  18.8k|            case Fragment::THRESH: {
  ------------------
  |  Branch (1164:13): [True: 18.8k, False: 483k]
  ------------------
 1165|       |                // sats[j] is the SatInfo corresponding to all traces reaching j satisfactions.
 1166|  18.8k|                auto sats = Vector(SatInfo::Empty());
 1167|  85.3k|                for (size_t i = 0; i < subs.size(); ++i) {
  ------------------
  |  Branch (1167:36): [True: 66.4k, False: 18.8k]
  ------------------
 1168|       |                    // Loop over the subexpressions, processing them one by one. After adding
 1169|       |                    // element i we need to add OP_ADD (if i>0).
 1170|  66.4k|                    auto add = i ? SatInfo::BinaryOp() : SatInfo::Empty();
  ------------------
  |  Branch (1170:32): [True: 47.6k, False: 18.8k]
  ------------------
 1171|       |                    // Construct a variable that will become the next sats, starting with index 0.
 1172|  66.4k|                    auto next_sats = Vector(sats[0] + subs[i].ss.Dsat() + add);
 1173|       |                    // Then loop to construct next_sats[1..i].
 1174|  1.09M|                    for (size_t j = 1; j < sats.size(); ++j) {
  ------------------
  |  Branch (1174:40): [True: 1.02M, False: 66.4k]
  ------------------
 1175|  1.02M|                        next_sats.push_back(((sats[j] + subs[i].ss.Dsat()) | (sats[j - 1] + subs[i].ss.Sat())) + add);
 1176|  1.02M|                    }
 1177|       |                    // Finally construct next_sats[i+1].
 1178|  66.4k|                    next_sats.push_back(sats[sats.size() - 1] + subs[i].ss.Sat() + add);
 1179|       |                    // Switch over.
 1180|  66.4k|                    sats = std::move(next_sats);
 1181|  66.4k|                }
 1182|       |                // To satisfy thresh we need k satisfactions; to dissatisfy we need 0. In both
 1183|       |                // cases a push of k and an OP_EQUAL follow.
 1184|  18.8k|                return {
 1185|  18.8k|                    sats[k] + SatInfo::Push() + SatInfo::OP_EQUAL(),
 1186|  18.8k|                    sats[0] + SatInfo::Push() + SatInfo::OP_EQUAL()
 1187|  18.8k|                };
 1188|  76.2k|            }
 1189|   502k|        }
 1190|   502k|        assert(false);
  ------------------
  |  Branch (1190:9): [Folded, False: 0]
  ------------------
 1191|      0|    }
_ZNK10miniscript4NodeI7CPubKeyE15CalcWitnessSizeEv:
 1193|   502k|    internal::WitnessSize CalcWitnessSize() const {
 1194|   502k|        const uint32_t sig_size = IsTapscript(m_script_ctx) ? 1 + 65 : 1 + 72;
  ------------------
  |  Branch (1194:35): [True: 198k, False: 304k]
  ------------------
 1195|   502k|        const uint32_t pubkey_size = IsTapscript(m_script_ctx) ? 1 + 32 : 1 + 33;
  ------------------
  |  Branch (1195:38): [True: 198k, False: 304k]
  ------------------
 1196|   502k|        switch (fragment) {
  ------------------
  |  Branch (1196:17): [True: 502k, False: 0]
  ------------------
 1197|   126k|            case Fragment::JUST_0: return {{}, 0};
  ------------------
  |  Branch (1197:13): [True: 126k, False: 376k]
  ------------------
 1198|  12.3k|            case Fragment::JUST_1:
  ------------------
  |  Branch (1198:13): [True: 12.3k, False: 490k]
  ------------------
 1199|  17.1k|            case Fragment::OLDER:
  ------------------
  |  Branch (1199:13): [True: 4.83k, False: 497k]
  ------------------
 1200|  21.1k|            case Fragment::AFTER: return {0, {}};
  ------------------
  |  Branch (1200:13): [True: 3.94k, False: 498k]
  ------------------
 1201|  24.3k|            case Fragment::PK_K: return {sig_size, 1};
  ------------------
  |  Branch (1201:13): [True: 24.3k, False: 478k]
  ------------------
 1202|  5.92k|            case Fragment::PK_H: return {sig_size + pubkey_size, 1 + pubkey_size};
  ------------------
  |  Branch (1202:13): [True: 5.92k, False: 496k]
  ------------------
 1203|  5.51k|            case Fragment::SHA256:
  ------------------
  |  Branch (1203:13): [True: 5.51k, False: 497k]
  ------------------
 1204|  8.94k|            case Fragment::RIPEMD160:
  ------------------
  |  Branch (1204:13): [True: 3.42k, False: 499k]
  ------------------
 1205|  13.7k|            case Fragment::HASH256:
  ------------------
  |  Branch (1205:13): [True: 4.77k, False: 498k]
  ------------------
 1206|  17.4k|            case Fragment::HASH160: return {1 + 32, {}};
  ------------------
  |  Branch (1206:13): [True: 3.69k, False: 499k]
  ------------------
 1207|  20.4k|            case Fragment::ANDOR: {
  ------------------
  |  Branch (1207:13): [True: 20.4k, False: 482k]
  ------------------
 1208|  20.4k|                const auto sat{(subs[0].ws.sat + subs[1].ws.sat) | (subs[0].ws.dsat + subs[2].ws.sat)};
 1209|  20.4k|                const auto dsat{subs[0].ws.dsat + subs[2].ws.dsat};
 1210|  20.4k|                return {sat, dsat};
 1211|  13.7k|            }
 1212|  39.5k|            case Fragment::AND_V: return {subs[0].ws.sat + subs[1].ws.sat, {}};
  ------------------
  |  Branch (1212:13): [True: 39.5k, False: 463k]
  ------------------
 1213|  8.92k|            case Fragment::AND_B: return {subs[0].ws.sat + subs[1].ws.sat, subs[0].ws.dsat + subs[1].ws.dsat};
  ------------------
  |  Branch (1213:13): [True: 8.92k, False: 493k]
  ------------------
 1214|  7.62k|            case Fragment::OR_B: {
  ------------------
  |  Branch (1214:13): [True: 7.62k, False: 495k]
  ------------------
 1215|  7.62k|                const auto sat{(subs[0].ws.dsat + subs[1].ws.sat) | (subs[0].ws.sat + subs[1].ws.dsat)};
 1216|  7.62k|                const auto dsat{subs[0].ws.dsat + subs[1].ws.dsat};
 1217|  7.62k|                return {sat, dsat};
 1218|  13.7k|            }
 1219|  8.16k|            case Fragment::OR_C: return {subs[0].ws.sat | (subs[0].ws.dsat + subs[1].ws.sat), {}};
  ------------------
  |  Branch (1219:13): [True: 8.16k, False: 494k]
  ------------------
 1220|  11.6k|            case Fragment::OR_D: return {subs[0].ws.sat | (subs[0].ws.dsat + subs[1].ws.sat), subs[0].ws.dsat + subs[1].ws.dsat};
  ------------------
  |  Branch (1220:13): [True: 11.6k, False: 491k]
  ------------------
 1221|  26.7k|            case Fragment::OR_I: return {(subs[0].ws.sat + 1 + 1) | (subs[1].ws.sat + 1), (subs[0].ws.dsat + 1 + 1) | (subs[1].ws.dsat + 1)};
  ------------------
  |  Branch (1221:13): [True: 26.7k, False: 476k]
  ------------------
 1222|  14.1k|            case Fragment::MULTI: return {k * sig_size + 1, k + 1};
  ------------------
  |  Branch (1222:13): [True: 14.1k, False: 488k]
  ------------------
 1223|  3.16k|            case Fragment::MULTI_A: return {k * sig_size + static_cast<uint32_t>(keys.size()) - k, static_cast<uint32_t>(keys.size())};
  ------------------
  |  Branch (1223:13): [True: 3.16k, False: 499k]
  ------------------
 1224|  66.7k|            case Fragment::WRAP_A:
  ------------------
  |  Branch (1224:13): [True: 66.7k, False: 436k]
  ------------------
 1225|  76.2k|            case Fragment::WRAP_N:
  ------------------
  |  Branch (1225:13): [True: 9.44k, False: 493k]
  ------------------
 1226|  80.1k|            case Fragment::WRAP_S:
  ------------------
  |  Branch (1226:13): [True: 3.91k, False: 498k]
  ------------------
 1227|  95.3k|            case Fragment::WRAP_C: return subs[0].ws;
  ------------------
  |  Branch (1227:13): [True: 15.2k, False: 487k]
  ------------------
 1228|  1.78k|            case Fragment::WRAP_D: return {1 + 1 + subs[0].ws.sat, 1};
  ------------------
  |  Branch (1228:13): [True: 1.78k, False: 501k]
  ------------------
 1229|  46.3k|            case Fragment::WRAP_V: return {subs[0].ws.sat, {}};
  ------------------
  |  Branch (1229:13): [True: 46.3k, False: 456k]
  ------------------
 1230|  5.12k|            case Fragment::WRAP_J: return {subs[0].ws.sat, 1};
  ------------------
  |  Branch (1230:13): [True: 5.12k, False: 497k]
  ------------------
 1231|  18.8k|            case Fragment::THRESH: {
  ------------------
  |  Branch (1231:13): [True: 18.8k, False: 483k]
  ------------------
 1232|  18.8k|                auto sats = Vector(internal::MaxInt<uint32_t>(0));
 1233|  66.4k|                for (const auto& sub : subs) {
  ------------------
  |  Branch (1233:38): [True: 66.4k, False: 18.8k]
  ------------------
 1234|  66.4k|                    auto next_sats = Vector(sats[0] + sub.ws.dsat);
 1235|  1.09M|                    for (size_t j = 1; j < sats.size(); ++j) next_sats.push_back((sats[j] + sub.ws.dsat) | (sats[j - 1] + sub.ws.sat));
  ------------------
  |  Branch (1235:40): [True: 1.02M, False: 66.4k]
  ------------------
 1236|  66.4k|                    next_sats.push_back(sats[sats.size() - 1] + sub.ws.sat);
 1237|  66.4k|                    sats = std::move(next_sats);
 1238|  66.4k|                }
 1239|  18.8k|                assert(k < sats.size());
  ------------------
  |  Branch (1239:17): [True: 18.8k, False: 0]
  ------------------
 1240|  18.8k|                return {sats[k], sats[0]};
 1241|  18.8k|            }
 1242|   502k|        }
 1243|   502k|        assert(false);
  ------------------
  |  Branch (1243:9): [Folded, False: 0]
  ------------------
 1244|      0|    }
_ZNK10miniscript4NodeI7CPubKeyE8CalcTypeEv:
  780|   502k|    Type CalcType() const {
  781|   502k|        using namespace internal;
  782|       |
  783|       |        // THRESH has a variable number of subexpressions
  784|   502k|        std::vector<Type> sub_types;
  785|   502k|        if (fragment == Fragment::THRESH) {
  ------------------
  |  Branch (785:13): [True: 18.8k, False: 483k]
  ------------------
  786|  66.4k|            for (const auto& sub : subs) sub_types.push_back(sub.GetType());
  ------------------
  |  Branch (786:34): [True: 66.4k, False: 18.8k]
  ------------------
  787|  18.8k|        }
  788|       |        // All other nodes than THRESH can be computed just from the types of the 0-3 subexpressions.
  789|   502k|        Type x = subs.size() > 0 ? subs[0].GetType() : ""_mst;
  ------------------
  |  Branch (789:18): [True: 290k, False: 212k]
  ------------------
  790|   502k|        Type y = subs.size() > 1 ? subs[1].GetType() : ""_mst;
  ------------------
  |  Branch (790:18): [True: 125k, False: 377k]
  ------------------
  791|   502k|        Type z = subs.size() > 2 ? subs[2].GetType() : ""_mst;
  ------------------
  |  Branch (791:18): [True: 22.3k, False: 480k]
  ------------------
  792|       |
  793|   502k|        return SanitizeType(ComputeType(fragment, x, y, z, sub_types, k, data.size(), subs.size(), keys.size(), m_script_ctx));
  794|   502k|    }
_ZNK10miniscript4NodeI7CPubKeyE13CalcScriptLenEv:
  619|   502k|    {
  620|   502k|        size_t subsize = 0;
  621|   502k|        for (const auto& sub : subs) {
  ------------------
  |  Branch (621:30): [True: 481k, False: 502k]
  ------------------
  622|   481k|            subsize += sub.ScriptSize();
  623|   481k|        }
  624|   502k|        Type sub0type = subs.size() > 0 ? subs[0].GetType() : ""_mst;
  ------------------
  |  Branch (624:25): [True: 290k, False: 212k]
  ------------------
  625|   502k|        return internal::ComputeScriptLen(fragment, sub0type, subsize, k, subs.size(), keys.size(), m_script_ctx);
  626|   502k|    }
_ZN10miniscript4NodeI7CPubKeyEC2ENS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentENSt3__16vectorIS1_NS7_9allocatorIS1_EEEEj:
 1727|  47.5k|        : fragment(nt), k(val), keys(std::move(key)), m_script_ctx{script_ctx}, ops(CalcOps()), ss(CalcStackSize()), ws(CalcWitnessSize()), typ(CalcType()), scriptlen(CalcScriptLen()) {}
_ZN10miniscript4NodeI7CPubKeyEC2ENS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentENSt3__16vectorIhNS7_9allocatorIhEEEEj:
 1723|  11.1k|        : fragment(nt), k(val), data(std::move(arg)), m_script_ctx{script_ctx}, ops(CalcOps()), ss(CalcStackSize()), ws(CalcWitnessSize()), typ(CalcType()), scriptlen(CalcScriptLen()) {}
_ZN10miniscript4NodeI7CPubKeyEC2ENS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentENSt3__16vectorIS2_NS7_9allocatorIS2_EEEEj:
 1729|   182k|        : fragment(nt), k(val), subs(std::move(sub)), m_script_ctx{script_ctx}, ops(CalcOps()), ss(CalcStackSize()), ws(CalcWitnessSize()), typ(CalcType()), scriptlen(CalcScriptLen()) {}
_ZN10miniscript4NodeI7CPubKeyEaSEOS2_:
 1753|   184k|    Node& operator=(Node&&) noexcept = default;
_ZN10miniscript8internal9BuildBackI7CPubKeyEEvNS_17MiniscriptContextENS_8FragmentERNSt3__16vectorINS_4NodeIT_EENS5_9allocatorIS9_EEEEb:
 1838|  62.1k|{
 1839|  62.1k|    Node<Key> child{std::move(constructed.back())};
 1840|  62.1k|    constructed.pop_back();
 1841|  62.1k|    if (reverse) {
  ------------------
  |  Branch (1841:9): [True: 31.0k, False: 31.0k]
  ------------------
 1842|  31.0k|        constructed.back() = Node<Key>{internal::NoDupCheck{}, script_ctx, nt, Vector(std::move(child), std::move(constructed.back()))};
 1843|  31.0k|    } else {
 1844|  31.0k|        constructed.back() = Node<Key>{internal::NoDupCheck{}, script_ctx, nt, Vector(std::move(constructed.back()), std::move(child))};
 1845|  31.0k|    }
 1846|  62.1k|}
_ZN10miniscript4NodeI7CPubKeyEC2EOS2_:
 1752|  1.03M|    Node(Node&&) noexcept = default;
_ZNK10miniscript4NodeI7CPubKeyE15IsValidTopLevelEv:
 1681|  13.1k|    bool IsValidTopLevel() const { return IsValid() && GetType() << "B"_mst; }
  ------------------
  |  Branch (1681:43): [True: 13.1k, False: 0]
  |  Branch (1681:56): [True: 12.5k, False: 576]
  ------------------

_ZN6script5ConstERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_4spanIKcLm18446744073709551615EEEb:
   14|  1.06M|{
   15|  1.06M|    if ((size_t)sp.size() >= str.size() && std::equal(str.begin(), str.end(), sp.begin())) {
  ------------------
  |  Branch (15:9): [True: 1.06M, False: 129]
  |  Branch (15:44): [True: 106k, False: 963k]
  ------------------
   16|   106k|        if (skip) sp = sp.subspan(str.size());
  ------------------
  |  Branch (16:13): [True: 86.8k, False: 19.2k]
  ------------------
   17|   106k|        return true;
   18|   106k|    }
   19|   963k|    return false;
   20|  1.06M|}
_ZN6script4FuncERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_4spanIKcLm18446744073709551615EEE:
   23|  19.2k|{
   24|  19.2k|    if ((size_t)sp.size() >= str.size() + 2 && sp[str.size()] == '(' && sp[sp.size() - 1] == ')' && std::equal(str.begin(), str.end(), sp.begin())) {
  ------------------
  |  Branch (24:9): [True: 19.2k, False: 0]
  |  Branch (24:48): [True: 19.2k, False: 0]
  |  Branch (24:73): [True: 19.2k, False: 0]
  |  Branch (24:101): [True: 19.2k, False: 0]
  ------------------
   25|  19.2k|        sp = sp.subspan(str.size() + 1, sp.size() - str.size() - 2);
   26|  19.2k|        return true;
   27|  19.2k|    }
   28|      0|    return false;
   29|  19.2k|}
_ZN6script4ExprERNSt3__14spanIKcLm18446744073709551615EEE:
   32|  19.2k|{
   33|  19.2k|    int level = 0;
   34|  19.2k|    auto it = sp.begin();
   35|   509k|    while (it != sp.end()) {
  ------------------
  |  Branch (35:12): [True: 509k, False: 619]
  ------------------
   36|   509k|        if (*it == '(' || *it == '{') {
  ------------------
  |  Branch (36:13): [True: 19.2k, False: 489k]
  |  Branch (36:27): [True: 0, False: 489k]
  ------------------
   37|  19.2k|            ++level;
   38|   489k|        } else if (level && (*it == ')' || *it == '}')) {
  ------------------
  |  Branch (38:20): [True: 377k, False: 112k]
  |  Branch (38:30): [True: 19.2k, False: 358k]
  |  Branch (38:44): [True: 0, False: 358k]
  ------------------
   39|  19.2k|            --level;
   40|   470k|        } else if (level == 0 && (*it == ')' || *it == '}' || *it == ',')) {
  ------------------
  |  Branch (40:20): [True: 112k, False: 358k]
  |  Branch (40:35): [True: 10.2k, False: 101k]
  |  Branch (40:49): [True: 0, False: 101k]
  |  Branch (40:63): [True: 8.38k, False: 93.4k]
  ------------------
   41|  18.6k|            break;
   42|  18.6k|        }
   43|   490k|        ++it;
   44|   490k|    }
   45|  19.2k|    std::span<const char> ret = sp.first(it - sp.begin());
   46|  19.2k|    sp = sp.subspan(it - sp.begin());
   47|  19.2k|    return ret;
   48|  19.2k|}

_ZNK7CScript17IsPayToScriptHashEv:
  225|  2.89k|{
  226|       |    // Extra-fast test for pay-to-script-hash CScripts:
  227|  2.89k|    return (this->size() == 23 &&
  ------------------
  |  Branch (227:13): [True: 0, False: 2.89k]
  ------------------
  228|      0|            (*this)[0] == OP_HASH160 &&
  ------------------
  |  Branch (228:13): [True: 0, False: 0]
  ------------------
  229|      0|            (*this)[1] == 0x14 &&
  ------------------
  |  Branch (229:13): [True: 0, False: 0]
  ------------------
  230|      0|            (*this)[22] == OP_EQUAL);
  ------------------
  |  Branch (230:13): [True: 0, False: 0]
  ------------------
  231|  2.89k|}
_ZNK7CScript16IsWitnessProgramERiRNSt3__16vectorIhNS1_9allocatorIhEEEE:
  251|  2.97k|{
  252|  2.97k|    if (this->size() < 4 || this->size() > 42) {
  ------------------
  |  Branch (252:9): [True: 0, False: 2.97k]
  |  Branch (252:29): [True: 0, False: 2.97k]
  ------------------
  253|      0|        return false;
  254|      0|    }
  255|  2.97k|    if ((*this)[0] != OP_0 && ((*this)[0] < OP_1 || (*this)[0] > OP_16)) {
  ------------------
  |  Branch (255:9): [True: 1.29k, False: 1.68k]
  |  Branch (255:32): [True: 0, False: 1.29k]
  |  Branch (255:53): [True: 0, False: 1.29k]
  ------------------
  256|      0|        return false;
  257|      0|    }
  258|  2.97k|    if ((size_t)((*this)[1] + 2) == this->size()) {
  ------------------
  |  Branch (258:9): [True: 2.97k, False: 0]
  ------------------
  259|  2.97k|        version = DecodeOP_N((opcodetype)(*this)[0]);
  260|  2.97k|        program = std::vector<unsigned char>(this->begin() + 2, this->end());
  261|  2.97k|        return true;
  262|  2.97k|    }
  263|      0|    return false;
  264|  2.97k|}
_Z11GetScriptOpRN9prevectorILj36EhjiE14const_iteratorES1_R10opcodetypePNSt3__16vectorIhNS5_9allocatorIhEEEE:
  314|   999k|{
  315|   999k|    opcodeRet = OP_INVALIDOPCODE;
  316|   999k|    if (pvchRet)
  ------------------
  |  Branch (316:9): [True: 724k, False: 274k]
  ------------------
  317|   724k|        pvchRet->clear();
  318|   999k|    if (pc >= end)
  ------------------
  |  Branch (318:9): [True: 0, False: 999k]
  ------------------
  319|      0|        return false;
  320|       |
  321|       |    // Read instruction
  322|   999k|    if (end - pc < 1)
  ------------------
  |  Branch (322:9): [True: 0, False: 999k]
  ------------------
  323|      0|        return false;
  324|   999k|    unsigned int opcode = *pc++;
  325|       |
  326|       |    // Immediate operand
  327|   999k|    if (opcode <= OP_PUSHDATA4)
  ------------------
  |  Branch (327:9): [True: 215k, False: 783k]
  ------------------
  328|   215k|    {
  329|   215k|        unsigned int nSize = 0;
  330|   215k|        if (opcode < OP_PUSHDATA1)
  ------------------
  |  Branch (330:13): [True: 215k, False: 0]
  ------------------
  331|   215k|        {
  332|   215k|            nSize = opcode;
  333|   215k|        }
  334|      0|        else if (opcode == OP_PUSHDATA1)
  ------------------
  |  Branch (334:18): [True: 0, False: 0]
  ------------------
  335|      0|        {
  336|      0|            if (end - pc < 1)
  ------------------
  |  Branch (336:17): [True: 0, False: 0]
  ------------------
  337|      0|                return false;
  338|      0|            nSize = *pc++;
  339|      0|        }
  340|      0|        else if (opcode == OP_PUSHDATA2)
  ------------------
  |  Branch (340:18): [True: 0, False: 0]
  ------------------
  341|      0|        {
  342|      0|            if (end - pc < 2)
  ------------------
  |  Branch (342:17): [True: 0, False: 0]
  ------------------
  343|      0|                return false;
  344|      0|            nSize = ReadLE16(&pc[0]);
  345|      0|            pc += 2;
  346|      0|        }
  347|      0|        else if (opcode == OP_PUSHDATA4)
  ------------------
  |  Branch (347:18): [True: 0, False: 0]
  ------------------
  348|      0|        {
  349|      0|            if (end - pc < 4)
  ------------------
  |  Branch (349:17): [True: 0, False: 0]
  ------------------
  350|      0|                return false;
  351|      0|            nSize = ReadLE32(&pc[0]);
  352|      0|            pc += 4;
  353|      0|        }
  354|   215k|        if (end - pc < 0 || (unsigned int)(end - pc) < nSize)
  ------------------
  |  Branch (354:13): [True: 0, False: 215k]
  |  Branch (354:29): [True: 0, False: 215k]
  ------------------
  355|      0|            return false;
  356|   215k|        if (pvchRet)
  ------------------
  |  Branch (356:13): [True: 183k, False: 31.4k]
  ------------------
  357|   183k|            pvchRet->assign(pc, pc + nSize);
  358|   215k|        pc += nSize;
  359|   215k|    }
  360|       |
  361|   999k|    opcodeRet = static_cast<opcodetype>(opcode);
  362|   999k|    return true;
  363|   999k|}
_Z11IsOpSuccessRK10opcodetype:
  366|   274k|{
  367|   274k|    return opcode == 80 || opcode == 98 || (opcode >= 126 && opcode <= 129) ||
  ------------------
  |  Branch (367:12): [True: 0, False: 274k]
  |  Branch (367:28): [True: 0, False: 274k]
  |  Branch (367:45): [True: 36.6k, False: 238k]
  |  Branch (367:62): [True: 0, False: 36.6k]
  ------------------
  368|   274k|           (opcode >= 131 && opcode <= 134) || (opcode >= 137 && opcode <= 138) ||
  ------------------
  |  Branch (368:13): [True: 35.1k, False: 239k]
  |  Branch (368:30): [True: 0, False: 35.1k]
  |  Branch (368:49): [True: 30.2k, False: 244k]
  |  Branch (368:66): [True: 0, False: 30.2k]
  ------------------
  369|   274k|           (opcode >= 141 && opcode <= 142) || (opcode >= 149 && opcode <= 153) ||
  ------------------
  |  Branch (369:13): [True: 30.2k, False: 244k]
  |  Branch (369:30): [True: 0, False: 30.2k]
  |  Branch (369:49): [True: 27.8k, False: 246k]
  |  Branch (369:66): [True: 0, False: 27.8k]
  ------------------
  370|   274k|           (opcode >= 187 && opcode <= 254);
  ------------------
  |  Branch (370:13): [True: 0, False: 274k]
  |  Branch (370:30): [True: 0, False: 0]
  ------------------
  371|   274k|}
_Z16CheckMinimalPushRKNSt3__16vectorIhNS_9allocatorIhEEEE10opcodetype:
  373|   132k|bool CheckMinimalPush(const std::vector<unsigned char>& data, opcodetype opcode) {
  374|       |    // Excludes OP_1NEGATE, OP_1-16 since they are by definition minimal
  375|   132k|    assert(0 <= opcode && opcode <= OP_PUSHDATA4);
  ------------------
  |  Branch (375:5): [True: 132k, False: 0]
  |  Branch (375:5): [True: 132k, False: 0]
  |  Branch (375:5): [True: 132k, False: 0]
  ------------------
  376|   132k|    if (data.size() == 0) {
  ------------------
  |  Branch (376:9): [True: 6.53k, False: 126k]
  ------------------
  377|       |        // Should have used OP_0.
  378|  6.53k|        return opcode == OP_0;
  379|   126k|    } else if (data.size() == 1 && data[0] >= 1 && data[0] <= 16) {
  ------------------
  |  Branch (379:16): [True: 15.2k, False: 111k]
  |  Branch (379:36): [True: 15.2k, False: 0]
  |  Branch (379:52): [True: 0, False: 15.2k]
  ------------------
  380|       |        // Should have used OP_1 .. OP_16.
  381|      0|        return false;
  382|   126k|    } else if (data.size() == 1 && data[0] == 0x81) {
  ------------------
  |  Branch (382:16): [True: 15.2k, False: 111k]
  |  Branch (382:36): [True: 0, False: 15.2k]
  ------------------
  383|       |        // Should have used OP_1NEGATE.
  384|      0|        return false;
  385|   126k|    } else if (data.size() <= 75) {
  ------------------
  |  Branch (385:16): [True: 126k, False: 0]
  ------------------
  386|       |        // Must have used a direct push (opcode indicating number of bytes pushed + those bytes).
  387|   126k|        return opcode == data.size();
  388|   126k|    } else if (data.size() <= 255) {
  ------------------
  |  Branch (388:16): [True: 0, False: 0]
  ------------------
  389|       |        // Must have used OP_PUSHDATA.
  390|      0|        return opcode == OP_PUSHDATA1;
  391|      0|    } else if (data.size() <= 65535) {
  ------------------
  |  Branch (391:16): [True: 0, False: 0]
  ------------------
  392|       |        // Must have used OP_PUSHDATA2.
  393|      0|        return opcode == OP_PUSHDATA2;
  394|      0|    }
  395|      0|    return true;
  396|   132k|}

_Z12ToByteVectorI16WitnessV1TaprootENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   69|  1.95k|{
   70|  1.95k|    return std::vector<unsigned char>(in.begin(), in.end());
   71|  1.95k|}
_Z11BuildScriptIJRKlEE7CScriptDpOT_:
  612|  1.04k|{
  613|  1.04k|    CScript ret;
  614|  1.04k|    int cnt{0};
  615|       |
  616|  1.04k|    ([&ret, &cnt] (Ts&& input) {
  617|  1.04k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  1.04k|            if (cnt == 0) {
  620|  1.04k|                ret = std::forward<Ts>(input);
  621|  1.04k|            } else {
  622|  1.04k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  1.04k|            }
  624|  1.04k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  1.04k|            ret << input;
  627|  1.04k|        }
  628|  1.04k|        cnt++;
  629|  1.04k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  1.04k|    return ret;
  632|  1.04k|}
_ZZ11BuildScriptIJRKlEE7CScriptDpOT_ENKUlS1_E_clES1_:
  616|  1.04k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  1.04k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  1.04k|            ret << input;
  627|  1.04k|        }
  628|  1.04k|        cnt++;
  629|  1.04k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJNSt3__16vectorIhNS0_9allocatorIhEEEEEE7CScriptDpOT_:
  612|  15.4k|{
  613|  15.4k|    CScript ret;
  614|  15.4k|    int cnt{0};
  615|       |
  616|  15.4k|    ([&ret, &cnt] (Ts&& input) {
  617|  15.4k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  15.4k|            if (cnt == 0) {
  620|  15.4k|                ret = std::forward<Ts>(input);
  621|  15.4k|            } else {
  622|  15.4k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  15.4k|            }
  624|  15.4k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  15.4k|            ret << input;
  627|  15.4k|        }
  628|  15.4k|        cnt++;
  629|  15.4k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  15.4k|    return ret;
  632|  15.4k|}
_ZZ11BuildScriptIJNSt3__16vectorIhNS0_9allocatorIhEEEEEE7CScriptDpOT_ENKUlOS4_E_clES9_:
  616|  15.4k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  15.4k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  15.4k|            ret << input;
  627|  15.4k|        }
  628|  15.4k|        cnt++;
  629|  15.4k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeS0_NSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_:
  612|  3.80k|{
  613|  3.80k|    CScript ret;
  614|  3.80k|    int cnt{0};
  615|       |
  616|  3.80k|    ([&ret, &cnt] (Ts&& input) {
  617|  3.80k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  3.80k|            if (cnt == 0) {
  620|  3.80k|                ret = std::forward<Ts>(input);
  621|  3.80k|            } else {
  622|  3.80k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  3.80k|            }
  624|  3.80k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.80k|            ret << input;
  627|  3.80k|        }
  628|  3.80k|        cnt++;
  629|  3.80k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  3.80k|    return ret;
  632|  3.80k|}
_ZZ11BuildScriptIJ10opcodetypeS0_NSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E1_clESA_:
  616|  3.80k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  3.80k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.80k|            ret << input;
  627|  3.80k|        }
  628|  3.80k|        cnt++;
  629|  3.80k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_NSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E0_clESA_:
  616|  3.80k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  3.80k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.80k|            ret << input;
  627|  3.80k|        }
  628|  3.80k|        cnt++;
  629|  3.80k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_NSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS5_E_clESA_:
  616|  3.80k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  3.80k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.80k|            ret << input;
  627|  3.80k|        }
  628|  3.80k|        cnt++;
  629|  3.80k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_NSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E_clESA_:
  616|  3.80k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  3.80k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.80k|            ret << input;
  627|  3.80k|        }
  628|  3.80k|        cnt++;
  629|  3.80k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJRKj10opcodetypeEE7CScriptDpOT_:
  612|  5.72k|{
  613|  5.72k|    CScript ret;
  614|  5.72k|    int cnt{0};
  615|       |
  616|  5.72k|    ([&ret, &cnt] (Ts&& input) {
  617|  5.72k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  5.72k|            if (cnt == 0) {
  620|  5.72k|                ret = std::forward<Ts>(input);
  621|  5.72k|            } else {
  622|  5.72k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  5.72k|            }
  624|  5.72k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  5.72k|            ret << input;
  627|  5.72k|        }
  628|  5.72k|        cnt++;
  629|  5.72k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  5.72k|    return ret;
  632|  5.72k|}
_ZZ11BuildScriptIJRKj10opcodetypeEE7CScriptDpOT_ENKUlS1_E_clES1_:
  616|  5.72k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  5.72k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  5.72k|            ret << input;
  627|  5.72k|        }
  628|  5.72k|        cnt++;
  629|  5.72k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJRKj10opcodetypeEE7CScriptDpOT_ENKUlOS2_E_clES7_:
  616|  5.72k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  5.72k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  5.72k|            ret << input;
  627|  5.72k|        }
  628|  5.72k|        cnt++;
  629|  5.72k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeiS0_S0_RKNSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_:
  612|  11.1k|{
  613|  11.1k|    CScript ret;
  614|  11.1k|    int cnt{0};
  615|       |
  616|  11.1k|    ([&ret, &cnt] (Ts&& input) {
  617|  11.1k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  11.1k|            if (cnt == 0) {
  620|  11.1k|                ret = std::forward<Ts>(input);
  621|  11.1k|            } else {
  622|  11.1k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  11.1k|            }
  624|  11.1k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  11.1k|            ret << input;
  627|  11.1k|        }
  628|  11.1k|        cnt++;
  629|  11.1k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  11.1k|    return ret;
  632|  11.1k|}
_ZZ11BuildScriptIJ10opcodetypeiS0_S0_RKNSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E2_clESC_:
  616|  11.1k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  11.1k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  11.1k|            ret << input;
  627|  11.1k|        }
  628|  11.1k|        cnt++;
  629|  11.1k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeiS0_S0_RKNSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOiE_clESC_:
  616|  11.1k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  11.1k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  11.1k|            ret << input;
  627|  11.1k|        }
  628|  11.1k|        cnt++;
  629|  11.1k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeiS0_S0_RKNSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E1_clESC_:
  616|  11.1k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  11.1k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  11.1k|            ret << input;
  627|  11.1k|        }
  628|  11.1k|        cnt++;
  629|  11.1k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeiS0_S0_RKNSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E0_clESC_:
  616|  11.1k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  11.1k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  11.1k|            ret << input;
  627|  11.1k|        }
  628|  11.1k|        cnt++;
  629|  11.1k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeiS0_S0_RKNSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlS7_E_clES7_:
  616|  11.1k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  11.1k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  11.1k|            ret << input;
  627|  11.1k|        }
  628|  11.1k|        cnt++;
  629|  11.1k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeiS0_S0_RKNSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E_clESC_:
  616|  11.1k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  11.1k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  11.1k|            ret << input;
  627|  11.1k|        }
  628|  11.1k|        cnt++;
  629|  11.1k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeR7CScriptS0_EES1_DpOT_:
  612|  38.9k|{
  613|  38.9k|    CScript ret;
  614|  38.9k|    int cnt{0};
  615|       |
  616|  38.9k|    ([&ret, &cnt] (Ts&& input) {
  617|  38.9k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  38.9k|            if (cnt == 0) {
  620|  38.9k|                ret = std::forward<Ts>(input);
  621|  38.9k|            } else {
  622|  38.9k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  38.9k|            }
  624|  38.9k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  38.9k|            ret << input;
  627|  38.9k|        }
  628|  38.9k|        cnt++;
  629|  38.9k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  38.9k|    return ret;
  632|  38.9k|}
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_EES1_DpOT_ENKUlOS0_E0_clES6_:
  616|  38.9k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  38.9k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  38.9k|            ret << input;
  627|  38.9k|        }
  628|  38.9k|        cnt++;
  629|  38.9k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_EES1_DpOT_ENKUlS2_E_clES2_:
  616|  38.9k|    ([&ret, &cnt] (Ts&& input) {
  617|  38.9k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  38.9k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 38.9k]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|  38.9k|            } else {
  622|  38.9k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  38.9k|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  38.9k|        cnt++;
  629|  38.9k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_EES1_DpOT_ENKUlOS0_E_clES6_:
  616|  38.9k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  38.9k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  38.9k|            ret << input;
  627|  38.9k|        }
  628|  38.9k|        cnt++;
  629|  38.9k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeR7CScriptEES1_DpOT_:
  612|  2.53k|{
  613|  2.53k|    CScript ret;
  614|  2.53k|    int cnt{0};
  615|       |
  616|  2.53k|    ([&ret, &cnt] (Ts&& input) {
  617|  2.53k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  2.53k|            if (cnt == 0) {
  620|  2.53k|                ret = std::forward<Ts>(input);
  621|  2.53k|            } else {
  622|  2.53k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  2.53k|            }
  624|  2.53k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  2.53k|            ret << input;
  627|  2.53k|        }
  628|  2.53k|        cnt++;
  629|  2.53k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  2.53k|    return ret;
  632|  2.53k|}
_ZZ11BuildScriptIJ10opcodetypeR7CScriptEES1_DpOT_ENKUlOS0_E_clES6_:
  616|  2.53k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  2.53k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  2.53k|            ret << input;
  627|  2.53k|        }
  628|  2.53k|        cnt++;
  629|  2.53k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptEES1_DpOT_ENKUlS2_E_clES2_:
  616|  2.53k|    ([&ret, &cnt] (Ts&& input) {
  617|  2.53k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  2.53k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 2.53k]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|  2.53k|            } else {
  622|  2.53k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  2.53k|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  2.53k|        cnt++;
  629|  2.53k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScript10opcodetypeEES0_DpOT_:
  612|  33.5k|{
  613|  33.5k|    CScript ret;
  614|  33.5k|    int cnt{0};
  615|       |
  616|  33.5k|    ([&ret, &cnt] (Ts&& input) {
  617|  33.5k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  33.5k|            if (cnt == 0) {
  620|  33.5k|                ret = std::forward<Ts>(input);
  621|  33.5k|            } else {
  622|  33.5k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  33.5k|            }
  624|  33.5k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  33.5k|            ret << input;
  627|  33.5k|        }
  628|  33.5k|        cnt++;
  629|  33.5k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  33.5k|    return ret;
  632|  33.5k|}
_ZZ11BuildScriptIJ7CScript10opcodetypeEES0_DpOT_ENKUlOS0_E_clES5_:
  616|  33.5k|    ([&ret, &cnt] (Ts&& input) {
  617|  33.5k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  33.5k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 33.5k, False: 0]
  ------------------
  620|  33.5k|                ret = std::forward<Ts>(input);
  621|  33.5k|            } else {
  622|      0|                ret.insert(ret.end(), input.begin(), input.end());
  623|      0|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  33.5k|        cnt++;
  629|  33.5k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeEES0_DpOT_ENKUlOS1_E_clES5_:
  616|  33.5k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  33.5k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  33.5k|            ret << input;
  627|  33.5k|        }
  628|  33.5k|        cnt++;
  629|  33.5k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeS0_R7CScriptS0_EES1_DpOT_:
  612|  1.15k|{
  613|  1.15k|    CScript ret;
  614|  1.15k|    int cnt{0};
  615|       |
  616|  1.15k|    ([&ret, &cnt] (Ts&& input) {
  617|  1.15k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  1.15k|            if (cnt == 0) {
  620|  1.15k|                ret = std::forward<Ts>(input);
  621|  1.15k|            } else {
  622|  1.15k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  1.15k|            }
  624|  1.15k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  1.15k|            ret << input;
  627|  1.15k|        }
  628|  1.15k|        cnt++;
  629|  1.15k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  1.15k|    return ret;
  632|  1.15k|}
_ZZ11BuildScriptIJ10opcodetypeS0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E1_clES6_:
  616|  1.15k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  1.15k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  1.15k|            ret << input;
  627|  1.15k|        }
  628|  1.15k|        cnt++;
  629|  1.15k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E0_clES6_:
  616|  1.15k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  1.15k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  1.15k|            ret << input;
  627|  1.15k|        }
  628|  1.15k|        cnt++;
  629|  1.15k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_R7CScriptS0_EES1_DpOT_ENKUlS2_E_clES2_:
  616|  1.15k|    ([&ret, &cnt] (Ts&& input) {
  617|  1.15k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  1.15k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 1.15k]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|  1.15k|            } else {
  622|  1.15k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  1.15k|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  1.15k|        cnt++;
  629|  1.15k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E_clES6_:
  616|  1.15k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  1.15k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  1.15k|            ret << input;
  627|  1.15k|        }
  628|  1.15k|        cnt++;
  629|  1.15k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_:
  612|  3.33k|{
  613|  3.33k|    CScript ret;
  614|  3.33k|    int cnt{0};
  615|       |
  616|  3.33k|    ([&ret, &cnt] (Ts&& input) {
  617|  3.33k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  3.33k|            if (cnt == 0) {
  620|  3.33k|                ret = std::forward<Ts>(input);
  621|  3.33k|            } else {
  622|  3.33k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  3.33k|            }
  624|  3.33k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.33k|            ret << input;
  627|  3.33k|        }
  628|  3.33k|        cnt++;
  629|  3.33k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  3.33k|    return ret;
  632|  3.33k|}
_ZZ11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E2_clES6_:
  616|  3.33k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  3.33k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.33k|            ret << input;
  627|  3.33k|        }
  628|  3.33k|        cnt++;
  629|  3.33k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E1_clES6_:
  616|  3.33k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  3.33k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.33k|            ret << input;
  627|  3.33k|        }
  628|  3.33k|        cnt++;
  629|  3.33k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E0_clES6_:
  616|  3.33k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  3.33k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.33k|            ret << input;
  627|  3.33k|        }
  628|  3.33k|        cnt++;
  629|  3.33k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_ENKUlS2_E_clES2_:
  616|  3.33k|    ([&ret, &cnt] (Ts&& input) {
  617|  3.33k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  3.33k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 3.33k]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|  3.33k|            } else {
  622|  3.33k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  3.33k|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  3.33k|        cnt++;
  629|  3.33k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E_clES6_:
  616|  3.33k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  3.33k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.33k|            ret << input;
  627|  3.33k|        }
  628|  3.33k|        cnt++;
  629|  3.33k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeEE7CScriptDpOT_:
  612|  84.2k|{
  613|  84.2k|    CScript ret;
  614|  84.2k|    int cnt{0};
  615|       |
  616|  84.2k|    ([&ret, &cnt] (Ts&& input) {
  617|  84.2k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  84.2k|            if (cnt == 0) {
  620|  84.2k|                ret = std::forward<Ts>(input);
  621|  84.2k|            } else {
  622|  84.2k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  84.2k|            }
  624|  84.2k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  84.2k|            ret << input;
  627|  84.2k|        }
  628|  84.2k|        cnt++;
  629|  84.2k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  84.2k|    return ret;
  632|  84.2k|}
_ZZ11BuildScriptIJ10opcodetypeEE7CScriptDpOT_ENKUlOS0_E_clES5_:
  616|  84.2k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  84.2k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  84.2k|            ret << input;
  627|  84.2k|        }
  628|  84.2k|        cnt++;
  629|  84.2k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptRS0_EES0_DpOT_:
  612|  24.9k|{
  613|  24.9k|    CScript ret;
  614|  24.9k|    int cnt{0};
  615|       |
  616|  24.9k|    ([&ret, &cnt] (Ts&& input) {
  617|  24.9k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  24.9k|            if (cnt == 0) {
  620|  24.9k|                ret = std::forward<Ts>(input);
  621|  24.9k|            } else {
  622|  24.9k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  24.9k|            }
  624|  24.9k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  24.9k|            ret << input;
  627|  24.9k|        }
  628|  24.9k|        cnt++;
  629|  24.9k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  24.9k|    return ret;
  632|  24.9k|}
_ZZ11BuildScriptIJ7CScriptRS0_EES0_DpOT_ENKUlOS0_E_clES5_:
  616|  24.9k|    ([&ret, &cnt] (Ts&& input) {
  617|  24.9k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  24.9k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 24.9k, False: 0]
  ------------------
  620|  24.9k|                ret = std::forward<Ts>(input);
  621|  24.9k|            } else {
  622|      0|                ret.insert(ret.end(), input.begin(), input.end());
  623|      0|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  24.9k|        cnt++;
  629|  24.9k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptRS0_EES0_DpOT_ENKUlS1_E_clES1_:
  616|  24.9k|    ([&ret, &cnt] (Ts&& input) {
  617|  24.9k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  24.9k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 24.9k]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|  24.9k|            } else {
  622|  24.9k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  24.9k|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  24.9k|        cnt++;
  629|  24.9k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptRS0_10opcodetypeEES0_DpOT_:
  612|  41.3k|{
  613|  41.3k|    CScript ret;
  614|  41.3k|    int cnt{0};
  615|       |
  616|  41.3k|    ([&ret, &cnt] (Ts&& input) {
  617|  41.3k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  41.3k|            if (cnt == 0) {
  620|  41.3k|                ret = std::forward<Ts>(input);
  621|  41.3k|            } else {
  622|  41.3k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  41.3k|            }
  624|  41.3k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  41.3k|            ret << input;
  627|  41.3k|        }
  628|  41.3k|        cnt++;
  629|  41.3k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  41.3k|    return ret;
  632|  41.3k|}
_ZZ11BuildScriptIJ7CScriptRS0_10opcodetypeEES0_DpOT_ENKUlOS0_E_clES6_:
  616|  41.3k|    ([&ret, &cnt] (Ts&& input) {
  617|  41.3k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  41.3k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 41.3k, False: 0]
  ------------------
  620|  41.3k|                ret = std::forward<Ts>(input);
  621|  41.3k|            } else {
  622|      0|                ret.insert(ret.end(), input.begin(), input.end());
  623|      0|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  41.3k|        cnt++;
  629|  41.3k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptRS0_10opcodetypeEES0_DpOT_ENKUlS1_E_clES1_:
  616|  41.3k|    ([&ret, &cnt] (Ts&& input) {
  617|  41.3k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  41.3k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 41.3k]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|  41.3k|            } else {
  622|  41.3k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  41.3k|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  41.3k|        cnt++;
  629|  41.3k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptRS0_10opcodetypeEES0_DpOT_ENKUlOS2_E_clES6_:
  616|  41.3k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  41.3k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  41.3k|            ret << input;
  627|  41.3k|        }
  628|  41.3k|        cnt++;
  629|  41.3k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScript10opcodetypeS1_RS0_S1_EES0_DpOT_:
  612|  7.52k|{
  613|  7.52k|    CScript ret;
  614|  7.52k|    int cnt{0};
  615|       |
  616|  7.52k|    ([&ret, &cnt] (Ts&& input) {
  617|  7.52k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  7.52k|            if (cnt == 0) {
  620|  7.52k|                ret = std::forward<Ts>(input);
  621|  7.52k|            } else {
  622|  7.52k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  7.52k|            }
  624|  7.52k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  7.52k|            ret << input;
  627|  7.52k|        }
  628|  7.52k|        cnt++;
  629|  7.52k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  7.52k|    return ret;
  632|  7.52k|}
_ZZ11BuildScriptIJ7CScript10opcodetypeS1_RS0_S1_EES0_DpOT_ENKUlOS0_E_clES6_:
  616|  7.52k|    ([&ret, &cnt] (Ts&& input) {
  617|  7.52k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  7.52k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 7.52k, False: 0]
  ------------------
  620|  7.52k|                ret = std::forward<Ts>(input);
  621|  7.52k|            } else {
  622|      0|                ret.insert(ret.end(), input.begin(), input.end());
  623|      0|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  7.52k|        cnt++;
  629|  7.52k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeS1_RS0_S1_EES0_DpOT_ENKUlOS1_E1_clES6_:
  616|  7.52k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  7.52k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  7.52k|            ret << input;
  627|  7.52k|        }
  628|  7.52k|        cnt++;
  629|  7.52k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeS1_RS0_S1_EES0_DpOT_ENKUlOS1_E0_clES6_:
  616|  7.52k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  7.52k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  7.52k|            ret << input;
  627|  7.52k|        }
  628|  7.52k|        cnt++;
  629|  7.52k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeS1_RS0_S1_EES0_DpOT_ENKUlS2_E_clES2_:
  616|  7.52k|    ([&ret, &cnt] (Ts&& input) {
  617|  7.52k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  7.52k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 7.52k]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|  7.52k|            } else {
  622|  7.52k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  7.52k|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  7.52k|        cnt++;
  629|  7.52k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeS1_RS0_S1_EES0_DpOT_ENKUlOS1_E_clES6_:
  616|  7.52k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  7.52k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  7.52k|            ret << input;
  627|  7.52k|        }
  628|  7.52k|        cnt++;
  629|  7.52k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScript10opcodetypeRS0_S1_EES0_DpOT_:
  612|  5.27k|{
  613|  5.27k|    CScript ret;
  614|  5.27k|    int cnt{0};
  615|       |
  616|  5.27k|    ([&ret, &cnt] (Ts&& input) {
  617|  5.27k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  5.27k|            if (cnt == 0) {
  620|  5.27k|                ret = std::forward<Ts>(input);
  621|  5.27k|            } else {
  622|  5.27k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  5.27k|            }
  624|  5.27k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  5.27k|            ret << input;
  627|  5.27k|        }
  628|  5.27k|        cnt++;
  629|  5.27k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  5.27k|    return ret;
  632|  5.27k|}
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_EES0_DpOT_ENKUlOS0_E_clES6_:
  616|  5.27k|    ([&ret, &cnt] (Ts&& input) {
  617|  5.27k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  5.27k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 5.27k, False: 0]
  ------------------
  620|  5.27k|                ret = std::forward<Ts>(input);
  621|  5.27k|            } else {
  622|      0|                ret.insert(ret.end(), input.begin(), input.end());
  623|      0|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  5.27k|        cnt++;
  629|  5.27k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_EES0_DpOT_ENKUlOS1_E0_clES6_:
  616|  5.27k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  5.27k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  5.27k|            ret << input;
  627|  5.27k|        }
  628|  5.27k|        cnt++;
  629|  5.27k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_EES0_DpOT_ENKUlS2_E_clES2_:
  616|  5.27k|    ([&ret, &cnt] (Ts&& input) {
  617|  5.27k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  5.27k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 5.27k]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|  5.27k|            } else {
  622|  5.27k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  5.27k|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  5.27k|        cnt++;
  629|  5.27k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_EES0_DpOT_ENKUlOS1_E_clES6_:
  616|  5.27k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  5.27k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  5.27k|            ret << input;
  627|  5.27k|        }
  628|  5.27k|        cnt++;
  629|  5.27k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_:
  612|  17.1k|{
  613|  17.1k|    CScript ret;
  614|  17.1k|    int cnt{0};
  615|       |
  616|  17.1k|    ([&ret, &cnt] (Ts&& input) {
  617|  17.1k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  17.1k|            if (cnt == 0) {
  620|  17.1k|                ret = std::forward<Ts>(input);
  621|  17.1k|            } else {
  622|  17.1k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  17.1k|            }
  624|  17.1k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  17.1k|            ret << input;
  627|  17.1k|        }
  628|  17.1k|        cnt++;
  629|  17.1k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  17.1k|    return ret;
  632|  17.1k|}
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_ENKUlOS0_E1_clES6_:
  616|  17.1k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  17.1k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  17.1k|            ret << input;
  627|  17.1k|        }
  628|  17.1k|        cnt++;
  629|  17.1k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_ENKUlS2_E0_clES2_:
  616|  17.1k|    ([&ret, &cnt] (Ts&& input) {
  617|  17.1k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  17.1k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 17.1k]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|  17.1k|            } else {
  622|  17.1k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  17.1k|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  17.1k|        cnt++;
  629|  17.1k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_ENKUlOS0_E0_clES6_:
  616|  17.1k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  17.1k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  17.1k|            ret << input;
  627|  17.1k|        }
  628|  17.1k|        cnt++;
  629|  17.1k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_ENKUlS2_E_clES2_:
  616|  17.1k|    ([&ret, &cnt] (Ts&& input) {
  617|  17.1k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  17.1k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 17.1k]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|  17.1k|            } else {
  622|  17.1k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  17.1k|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  17.1k|        cnt++;
  629|  17.1k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_ENKUlOS0_E_clES6_:
  616|  17.1k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  17.1k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  17.1k|            ret << input;
  627|  17.1k|        }
  628|  17.1k|        cnt++;
  629|  17.1k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScript10opcodetypeRS0_S1_S2_S1_EES0_DpOT_:
  612|  13.2k|{
  613|  13.2k|    CScript ret;
  614|  13.2k|    int cnt{0};
  615|       |
  616|  13.2k|    ([&ret, &cnt] (Ts&& input) {
  617|  13.2k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  13.2k|            if (cnt == 0) {
  620|  13.2k|                ret = std::forward<Ts>(input);
  621|  13.2k|            } else {
  622|  13.2k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  13.2k|            }
  624|  13.2k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  13.2k|            ret << input;
  627|  13.2k|        }
  628|  13.2k|        cnt++;
  629|  13.2k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  13.2k|    return ret;
  632|  13.2k|}
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_S2_S1_EES0_DpOT_ENKUlOS0_E_clES6_:
  616|  13.2k|    ([&ret, &cnt] (Ts&& input) {
  617|  13.2k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  13.2k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 13.2k, False: 0]
  ------------------
  620|  13.2k|                ret = std::forward<Ts>(input);
  621|  13.2k|            } else {
  622|      0|                ret.insert(ret.end(), input.begin(), input.end());
  623|      0|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  13.2k|        cnt++;
  629|  13.2k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_S2_S1_EES0_DpOT_ENKUlOS1_E1_clES6_:
  616|  13.2k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  13.2k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  13.2k|            ret << input;
  627|  13.2k|        }
  628|  13.2k|        cnt++;
  629|  13.2k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_S2_S1_EES0_DpOT_ENKUlS2_E0_clES2_:
  616|  13.2k|    ([&ret, &cnt] (Ts&& input) {
  617|  13.2k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  13.2k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 13.2k]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|  13.2k|            } else {
  622|  13.2k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  13.2k|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  13.2k|        cnt++;
  629|  13.2k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_S2_S1_EES0_DpOT_ENKUlOS1_E0_clES6_:
  616|  13.2k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  13.2k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  13.2k|            ret << input;
  627|  13.2k|        }
  628|  13.2k|        cnt++;
  629|  13.2k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_S2_S1_EES0_DpOT_ENKUlS2_E_clES2_:
  616|  13.2k|    ([&ret, &cnt] (Ts&& input) {
  617|  13.2k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  13.2k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 13.2k]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|  13.2k|            } else {
  622|  13.2k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  13.2k|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  13.2k|        cnt++;
  629|  13.2k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_S2_S1_EES0_DpOT_ENKUlOS1_E_clES6_:
  616|  13.2k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  13.2k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  13.2k|            ret << input;
  627|  13.2k|        }
  628|  13.2k|        cnt++;
  629|  13.2k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJRKjEE7CScriptDpOT_:
  612|  9.30k|{
  613|  9.30k|    CScript ret;
  614|  9.30k|    int cnt{0};
  615|       |
  616|  9.30k|    ([&ret, &cnt] (Ts&& input) {
  617|  9.30k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  9.30k|            if (cnt == 0) {
  620|  9.30k|                ret = std::forward<Ts>(input);
  621|  9.30k|            } else {
  622|  9.30k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  9.30k|            }
  624|  9.30k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  9.30k|            ret << input;
  627|  9.30k|        }
  628|  9.30k|        cnt++;
  629|  9.30k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  9.30k|    return ret;
  632|  9.30k|}
_ZZ11BuildScriptIJRKjEE7CScriptDpOT_ENKUlS1_E_clES1_:
  616|  9.30k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  9.30k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  9.30k|            ret << input;
  627|  9.30k|        }
  628|  9.30k|        cnt++;
  629|  9.30k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEEEES0_DpOT_:
  612|  51.5k|{
  613|  51.5k|    CScript ret;
  614|  51.5k|    int cnt{0};
  615|       |
  616|  51.5k|    ([&ret, &cnt] (Ts&& input) {
  617|  51.5k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  51.5k|            if (cnt == 0) {
  620|  51.5k|                ret = std::forward<Ts>(input);
  621|  51.5k|            } else {
  622|  51.5k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  51.5k|            }
  624|  51.5k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  51.5k|            ret << input;
  627|  51.5k|        }
  628|  51.5k|        cnt++;
  629|  51.5k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  51.5k|    return ret;
  632|  51.5k|}
_ZZ11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEEEES0_DpOT_ENKUlOS0_E_clES9_:
  616|  51.5k|    ([&ret, &cnt] (Ts&& input) {
  617|  51.5k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  51.5k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 51.5k, False: 0]
  ------------------
  620|  51.5k|                ret = std::forward<Ts>(input);
  621|  51.5k|            } else {
  622|      0|                ret.insert(ret.end(), input.begin(), input.end());
  623|      0|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  51.5k|        cnt++;
  629|  51.5k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEEEES0_DpOT_ENKUlOS5_E_clES9_:
  616|  51.5k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  51.5k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  51.5k|            ret << input;
  627|  51.5k|        }
  628|  51.5k|        cnt++;
  629|  51.5k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptm10opcodetypeEES0_DpOT_:
  612|  9.30k|{
  613|  9.30k|    CScript ret;
  614|  9.30k|    int cnt{0};
  615|       |
  616|  9.30k|    ([&ret, &cnt] (Ts&& input) {
  617|  9.30k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  9.30k|            if (cnt == 0) {
  620|  9.30k|                ret = std::forward<Ts>(input);
  621|  9.30k|            } else {
  622|  9.30k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  9.30k|            }
  624|  9.30k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  9.30k|            ret << input;
  627|  9.30k|        }
  628|  9.30k|        cnt++;
  629|  9.30k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  9.30k|    return ret;
  632|  9.30k|}
_ZZ11BuildScriptIJ7CScriptm10opcodetypeEES0_DpOT_ENKUlOS0_E_clES5_:
  616|  9.30k|    ([&ret, &cnt] (Ts&& input) {
  617|  9.30k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  9.30k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 9.30k, False: 0]
  ------------------
  620|  9.30k|                ret = std::forward<Ts>(input);
  621|  9.30k|            } else {
  622|      0|                ret.insert(ret.end(), input.begin(), input.end());
  623|      0|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  9.30k|        cnt++;
  629|  9.30k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptm10opcodetypeEES0_DpOT_ENKUlOmE_clES5_:
  616|  9.30k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  9.30k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  9.30k|            ret << input;
  627|  9.30k|        }
  628|  9.30k|        cnt++;
  629|  9.30k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptm10opcodetypeEES0_DpOT_ENKUlOS1_E_clES5_:
  616|  9.30k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  9.30k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  9.30k|            ret << input;
  627|  9.30k|        }
  628|  9.30k|        cnt++;
  629|  9.30k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJNSt3__16vectorIhNS0_9allocatorIhEEEE10opcodetypeEE7CScriptDpOT_:
  612|  2.03k|{
  613|  2.03k|    CScript ret;
  614|  2.03k|    int cnt{0};
  615|       |
  616|  2.03k|    ([&ret, &cnt] (Ts&& input) {
  617|  2.03k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  2.03k|            if (cnt == 0) {
  620|  2.03k|                ret = std::forward<Ts>(input);
  621|  2.03k|            } else {
  622|  2.03k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  2.03k|            }
  624|  2.03k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  2.03k|            ret << input;
  627|  2.03k|        }
  628|  2.03k|        cnt++;
  629|  2.03k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  2.03k|    return ret;
  632|  2.03k|}
_ZZ11BuildScriptIJNSt3__16vectorIhNS0_9allocatorIhEEEE10opcodetypeEE7CScriptDpOT_ENKUlOS4_E_clESA_:
  616|  2.03k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  2.03k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  2.03k|            ret << input;
  627|  2.03k|        }
  628|  2.03k|        cnt++;
  629|  2.03k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJNSt3__16vectorIhNS0_9allocatorIhEEEE10opcodetypeEE7CScriptDpOT_ENKUlOS5_E_clESA_:
  616|  2.03k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  2.03k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  2.03k|            ret << input;
  627|  2.03k|        }
  628|  2.03k|        cnt++;
  629|  2.03k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEE10opcodetypeEES0_DpOT_:
  612|  43.8k|{
  613|  43.8k|    CScript ret;
  614|  43.8k|    int cnt{0};
  615|       |
  616|  43.8k|    ([&ret, &cnt] (Ts&& input) {
  617|  43.8k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  43.8k|            if (cnt == 0) {
  620|  43.8k|                ret = std::forward<Ts>(input);
  621|  43.8k|            } else {
  622|  43.8k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  43.8k|            }
  624|  43.8k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  43.8k|            ret << input;
  627|  43.8k|        }
  628|  43.8k|        cnt++;
  629|  43.8k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  43.8k|    return ret;
  632|  43.8k|}
_ZZ11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEE10opcodetypeEES0_DpOT_ENKUlOS0_E_clESA_:
  616|  43.8k|    ([&ret, &cnt] (Ts&& input) {
  617|  43.8k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  43.8k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 43.8k, False: 0]
  ------------------
  620|  43.8k|                ret = std::forward<Ts>(input);
  621|  43.8k|            } else {
  622|      0|                ret.insert(ret.end(), input.begin(), input.end());
  623|      0|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  43.8k|        cnt++;
  629|  43.8k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEE10opcodetypeEES0_DpOT_ENKUlOS5_E_clESA_:
  616|  43.8k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  43.8k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  43.8k|            ret << input;
  627|  43.8k|        }
  628|  43.8k|        cnt++;
  629|  43.8k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEE10opcodetypeEES0_DpOT_ENKUlOS6_E_clESA_:
  616|  43.8k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  43.8k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  43.8k|            ret << input;
  627|  43.8k|        }
  628|  43.8k|        cnt++;
  629|  43.8k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptRKj10opcodetypeEES0_DpOT_:
  612|  14.2k|{
  613|  14.2k|    CScript ret;
  614|  14.2k|    int cnt{0};
  615|       |
  616|  14.2k|    ([&ret, &cnt] (Ts&& input) {
  617|  14.2k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  14.2k|            if (cnt == 0) {
  620|  14.2k|                ret = std::forward<Ts>(input);
  621|  14.2k|            } else {
  622|  14.2k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  14.2k|            }
  624|  14.2k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  14.2k|            ret << input;
  627|  14.2k|        }
  628|  14.2k|        cnt++;
  629|  14.2k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  14.2k|    return ret;
  632|  14.2k|}
_ZZ11BuildScriptIJ7CScriptRKj10opcodetypeEES0_DpOT_ENKUlOS0_E_clES7_:
  616|  14.2k|    ([&ret, &cnt] (Ts&& input) {
  617|  14.2k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  14.2k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 14.2k, False: 0]
  ------------------
  620|  14.2k|                ret = std::forward<Ts>(input);
  621|  14.2k|            } else {
  622|      0|                ret.insert(ret.end(), input.begin(), input.end());
  623|      0|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  14.2k|        cnt++;
  629|  14.2k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptRKj10opcodetypeEES0_DpOT_ENKUlS2_E_clES2_:
  616|  14.2k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  14.2k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  14.2k|            ret << input;
  627|  14.2k|        }
  628|  14.2k|        cnt++;
  629|  14.2k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptRKj10opcodetypeEES0_DpOT_ENKUlOS3_E_clES7_:
  616|  14.2k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  14.2k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  14.2k|            ret << input;
  627|  14.2k|        }
  628|  14.2k|        cnt++;
  629|  14.2k|    } (std::forward<Ts>(inputs)), ...);
_ZNK10CScriptNum8GetInt64Ev:
  335|  26.6k|    int64_t GetInt64() const { return m_value; }
_Z11BuildScriptIJRjEE7CScriptDpOT_:
  612|  61.6k|{
  613|  61.6k|    CScript ret;
  614|  61.6k|    int cnt{0};
  615|       |
  616|  61.6k|    ([&ret, &cnt] (Ts&& input) {
  617|  61.6k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  61.6k|            if (cnt == 0) {
  620|  61.6k|                ret = std::forward<Ts>(input);
  621|  61.6k|            } else {
  622|  61.6k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  61.6k|            }
  624|  61.6k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  61.6k|            ret << input;
  627|  61.6k|        }
  628|  61.6k|        cnt++;
  629|  61.6k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  61.6k|    return ret;
  632|  61.6k|}
_ZZ11BuildScriptIJRjEE7CScriptDpOT_ENKUlS0_E_clES0_:
  616|  61.6k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  61.6k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  61.6k|            ret << input;
  627|  61.6k|        }
  628|  61.6k|        cnt++;
  629|  61.6k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJRmEE7CScriptDpOT_:
  612|  19.0k|{
  613|  19.0k|    CScript ret;
  614|  19.0k|    int cnt{0};
  615|       |
  616|  19.0k|    ([&ret, &cnt] (Ts&& input) {
  617|  19.0k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|  19.0k|            if (cnt == 0) {
  620|  19.0k|                ret = std::forward<Ts>(input);
  621|  19.0k|            } else {
  622|  19.0k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  19.0k|            }
  624|  19.0k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  19.0k|            ret << input;
  627|  19.0k|        }
  628|  19.0k|        cnt++;
  629|  19.0k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  19.0k|    return ret;
  632|  19.0k|}
_ZZ11BuildScriptIJRmEE7CScriptDpOT_ENKUlS0_E_clES0_:
  616|  19.0k|    ([&ret, &cnt] (Ts&& input) {
  617|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  618|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  619|       |            if (cnt == 0) {
  620|       |                ret = std::forward<Ts>(input);
  621|       |            } else {
  622|       |                ret.insert(ret.end(), input.begin(), input.end());
  623|       |            }
  624|  19.0k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  19.0k|            ret << input;
  627|  19.0k|        }
  628|  19.0k|        cnt++;
  629|  19.0k|    } (std::forward<Ts>(inputs)), ...);
_ZN7CScriptlsEl:
  468|   131k|    CScript& operator<<(int64_t b) LIFETIMEBOUND { return push_int64(b); }
_ZN7CScript10push_int64El:
  435|   131k|    {
  436|   131k|        if (n == -1 || (n >= 1 && n <= 16))
  ------------------
  |  Branch (436:13): [True: 0, False: 131k]
  |  Branch (436:25): [True: 131k, False: 0]
  |  Branch (436:35): [True: 98.9k, False: 32.4k]
  ------------------
  437|  98.9k|        {
  438|  98.9k|            push_back(n + (OP_1 - 1));
  439|  98.9k|        }
  440|  32.4k|        else if (n == 0)
  ------------------
  |  Branch (440:18): [True: 0, False: 32.4k]
  ------------------
  441|      0|        {
  442|      0|            push_back(OP_0);
  443|      0|        }
  444|  32.4k|        else
  445|  32.4k|        {
  446|  32.4k|            *this << CScriptNum::serialize(n);
  447|  32.4k|        }
  448|   131k|        return *this;
  449|   131k|    }
_ZN14CScriptWitnessC2Ev:
  584|  8.37k|    CScriptWitness() = default;
_ZNK7CScript5GetOpERN9prevectorILj36EhjiE14const_iteratorER10opcodetypeRNSt3__16vectorIhNS6_9allocatorIhEEEE:
  498|   724k|    {
  499|   724k|        return GetScriptOp(pc, end(), opcodeRet, &vchRet);
  500|   724k|    }
_ZNK7CScript5GetOpERN9prevectorILj36EhjiE14const_iteratorER10opcodetype:
  503|   274k|    {
  504|   274k|        return GetScriptOp(pc, end(), opcodeRet, nullptr);
  505|   274k|    }
_ZN7CScriptC2Ev:
  452|   528k|    CScript() = default;
_ZN10CScriptNumC2ERKl:
  240|  41.9k|    {
  241|  41.9k|        m_value = n;
  242|  41.9k|    }
_ZNK10CScriptNum6getvchEv:
  338|  38.8k|    {
  339|  38.8k|        return serialize(m_value);
  340|  38.8k|    }
_ZN10CScriptNum9serializeERKl:
  343|  71.2k|    {
  344|  71.2k|        if(value == 0)
  ------------------
  |  Branch (344:12): [True: 6.83k, False: 64.4k]
  ------------------
  345|  6.83k|            return std::vector<unsigned char>();
  346|       |
  347|  64.4k|        std::vector<unsigned char> result;
  348|  64.4k|        const bool neg = value < 0;
  349|  64.4k|        uint64_t absvalue = neg ? ~static_cast<uint64_t>(value) + 1 : static_cast<uint64_t>(value);
  ------------------
  |  Branch (349:29): [True: 0, False: 64.4k]
  ------------------
  350|       |
  351|   165k|        while(absvalue)
  ------------------
  |  Branch (351:15): [True: 100k, False: 64.4k]
  ------------------
  352|   100k|        {
  353|   100k|            result.push_back(absvalue & 0xff);
  354|   100k|            absvalue >>= 8;
  355|   100k|        }
  356|       |
  357|       |//    - If the most significant byte is >= 0x80 and the value is positive, push a
  358|       |//    new zero-byte to make the significant byte < 0x80 again.
  359|       |
  360|       |//    - If the most significant byte is >= 0x80 and the value is negative, push a
  361|       |//    new 0x80 byte that will be popped off when converting to an integral.
  362|       |
  363|       |//    - If the most significant byte is < 0x80 and the value is negative, add
  364|       |//    0x80 to it, since it will be subtracted and interpreted as a negative when
  365|       |//    converting to an integral.
  366|       |
  367|  64.4k|        if (result.back() & 0x80)
  ------------------
  |  Branch (367:13): [True: 2.57k, False: 61.8k]
  ------------------
  368|  2.57k|            result.push_back(neg ? 0x80 : 0);
  ------------------
  |  Branch (368:30): [True: 0, False: 2.57k]
  ------------------
  369|  61.8k|        else if (neg)
  ------------------
  |  Branch (369:18): [True: 0, False: 61.8k]
  ------------------
  370|      0|            result.back() |= 0x80;
  371|       |
  372|  64.4k|        return result;
  373|  71.2k|    }
_ZN10CScriptNumC2ERKNSt3__16vectorIhNS0_9allocatorIhEEEEbm:
  248|  65.4k|    {
  249|  65.4k|        if (vch.size() > nMaxNumSize) {
  ------------------
  |  Branch (249:13): [True: 43, False: 65.4k]
  ------------------
  250|     43|            throw scriptnum_error("script number overflow");
  251|     43|        }
  252|  65.4k|        if (fRequireMinimal && vch.size() > 0) {
  ------------------
  |  Branch (252:13): [True: 65.4k, False: 0]
  |  Branch (252:32): [True: 53.0k, False: 12.4k]
  ------------------
  253|       |            // Check that the number is encoded with the minimum possible
  254|       |            // number of bytes.
  255|       |            //
  256|       |            // If the most-significant-byte - excluding the sign bit - is zero
  257|       |            // then we're not minimal. Note how this test also rejects the
  258|       |            // negative-zero encoding, 0x80.
  259|  53.0k|            if ((vch.back() & 0x7f) == 0) {
  ------------------
  |  Branch (259:17): [True: 815, False: 52.1k]
  ------------------
  260|       |                // One exception: if there's more than one byte and the most
  261|       |                // significant bit of the second-most-significant-byte is set
  262|       |                // it would conflict with the sign bit. An example of this case
  263|       |                // is +-255, which encode to 0xff00 and 0xff80 respectively.
  264|       |                // (big-endian).
  265|    815|                if (vch.size() <= 1 || (vch[vch.size() - 2] & 0x80) == 0) {
  ------------------
  |  Branch (265:21): [True: 0, False: 815]
  |  Branch (265:40): [True: 0, False: 815]
  ------------------
  266|      0|                    throw scriptnum_error("non-minimally encoded script number");
  267|      0|                }
  268|    815|            }
  269|  53.0k|        }
  270|  65.4k|        m_value = set_vch(vch);
  271|  65.4k|    }
_ZN15scriptnum_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  224|     43|    explicit scriptnum_error(const std::string& str) : std::runtime_error(str) {}
_ZN10CScriptNum7set_vchERKNSt3__16vectorIhNS0_9allocatorIhEEEE:
  377|  65.4k|    {
  378|  65.4k|      if (vch.empty())
  ------------------
  |  Branch (378:11): [True: 12.4k, False: 53.0k]
  ------------------
  379|  12.4k|          return 0;
  380|       |
  381|  53.0k|      int64_t result = 0;
  382|   115k|      for (size_t i = 0; i != vch.size(); ++i)
  ------------------
  |  Branch (382:26): [True: 62.4k, False: 53.0k]
  ------------------
  383|  62.4k|          result |= static_cast<int64_t>(vch[i]) << 8*i;
  384|       |
  385|       |      // If the input vector's most significant byte is 0x80, remove it from
  386|       |      // the result's msb and return a negative.
  387|  53.0k|      if (vch.back() & 0x80)
  ------------------
  |  Branch (387:11): [True: 0, False: 53.0k]
  ------------------
  388|      0|          return -((int64_t)(result & ~(0x80ULL << (8 * (vch.size() - 1)))));
  389|       |
  390|  53.0k|      return result;
  391|  53.0k|    }
_ZNK10CScriptNumssERKl:
  274|  1.06k|    inline auto operator<=>(const int64_t& rhs) const    { return m_value <=> rhs; }
_ZNK10CScriptNumanERKl:
  287|    499|    inline CScriptNum operator&(   const int64_t& rhs)    const { return CScriptNum(m_value & rhs);}
_ZNK10CScriptNumeqERKl:
  273|  6.63k|    inline bool operator==(const int64_t& rhs) const    { return m_value == rhs; }
_ZNK10CScriptNum6getintEv:
  327|  7.03k|    {
  328|  7.03k|        if (m_value > std::numeric_limits<int>::max())
  ------------------
  |  Branch (328:13): [True: 0, False: 7.03k]
  ------------------
  329|      0|            return std::numeric_limits<int>::max();
  330|  7.03k|        else if (m_value < std::numeric_limits<int>::min())
  ------------------
  |  Branch (330:18): [True: 0, False: 7.03k]
  ------------------
  331|      0|            return std::numeric_limits<int>::min();
  332|  7.03k|        return m_value;
  333|  7.03k|    }
_ZNK10CScriptNumeqERKS_:
  276|  6.13k|    inline bool operator==(const CScriptNum& rhs) const { return operator==(rhs.m_value); }
_ZN10CScriptNumaSERKl:
  299|  4.39k|    {
  300|  4.39k|        m_value = rhs;
  301|  4.39k|        return *this;
  302|  4.39k|    }
_ZNK10CScriptNumplERKS_:
  281|  3.93k|    inline CScriptNum operator+(   const CScriptNum& rhs) const { return operator+(rhs.m_value);   }
_ZNK10CScriptNumplERKl:
  279|  20.3k|    inline CScriptNum operator+(   const int64_t& rhs)    const { return CScriptNum(m_value + rhs);}
_ZN7CScriptlsENSt3__14spanIKhLm18446744073709551615EEE:
  493|   164k|    {
  494|   164k|        return *this << std::as_bytes(b);
  495|   164k|    }
_ZN7CScriptlsENSt3__14spanIKSt4byteLm18446744073709551615EEE:
  485|   164k|    {
  486|   164k|        AppendDataSize(b.size());
  487|   164k|        AppendData({reinterpret_cast<const value_type*>(b.data()), b.size()});
  488|   164k|        return *this;
  489|   164k|    }
_ZN7CScript14AppendDataSizeEj:
  409|   164k|    {
  410|   164k|        if (size < OP_PUSHDATA1) {
  ------------------
  |  Branch (410:13): [True: 164k, False: 0]
  ------------------
  411|   164k|            insert(end(), static_cast<value_type>(size));
  412|   164k|        } else if (size <= 0xff) {
  ------------------
  |  Branch (412:20): [True: 0, False: 0]
  ------------------
  413|      0|            insert(end(), OP_PUSHDATA1);
  414|      0|            insert(end(), static_cast<value_type>(size));
  415|      0|        } else if (size <= 0xffff) {
  ------------------
  |  Branch (415:20): [True: 0, False: 0]
  ------------------
  416|      0|            insert(end(), OP_PUSHDATA2);
  417|      0|            value_type data[2];
  418|      0|            WriteLE16(data, size);
  419|      0|            insert(end(), std::cbegin(data), std::cend(data));
  420|      0|        } else {
  421|      0|            insert(end(), OP_PUSHDATA4);
  422|      0|            value_type data[4];
  423|      0|            WriteLE32(data, size);
  424|      0|            insert(end(), std::cbegin(data), std::cend(data));
  425|      0|        }
  426|   164k|    }
_ZN7CScript10AppendDataENSt3__14spanIKhLm18446744073709551615EEE:
  429|   164k|    {
  430|   164k|        insert(end(), data.begin(), data.end());
  431|   164k|    }
_ZN7CScriptlsE10opcodetype:
  471|   516k|    {
  472|   516k|        if (opcode < 0 || opcode > 0xff)
  ------------------
  |  Branch (472:13): [True: 0, False: 516k]
  |  Branch (472:27): [True: 0, False: 516k]
  ------------------
  473|      0|            throw std::runtime_error("CScript::operator<<(): invalid opcode");
  474|   516k|        insert(end(), (unsigned char)opcode);
  475|   516k|        return *this;
  476|   516k|    }
_ZN7CScriptC2ITkNSt3__114input_iteratorEN9prevectorILj36EhjiE14const_iteratorEEET_S5_:
  454|  5.31k|    CScript(InputIterator first, InputIterator last) : CScriptBase{first, last} { }
_ZN7CScriptC2ITkNSt3__114input_iteratorENS1_11__wrap_iterIPKhEEEET_S6_:
  454|  2.97k|    CScript(InputIterator first, InputIterator last) : CScriptBase{first, last} { }
_ZN7CScript10DecodeOP_NE10opcodetype:
  509|  22.2k|    {
  510|  22.2k|        if (opcode == OP_0)
  ------------------
  |  Branch (510:13): [True: 1.68k, False: 20.5k]
  ------------------
  511|  1.68k|            return 0;
  512|  22.2k|        assert(opcode >= OP_1 && opcode <= OP_16);
  ------------------
  |  Branch (512:9): [True: 20.5k, False: 0]
  |  Branch (512:9): [True: 20.5k, False: 0]
  |  Branch (512:9): [True: 20.5k, False: 0]
  ------------------
  513|  20.5k|        return (int)opcode - (int)(OP_1 - 1);
  514|  20.5k|    }

_ZN20BaseSignatureCreatorD2Ev:
   41|      4|    virtual ~BaseSignatureCreator() = default;

_ZN14TaprootBuilder6InsertEONS_8NodeInfoEi:
  391|  1.95k|{
  392|  1.95k|    assert(depth >= 0 && (size_t)depth <= TAPROOT_CONTROL_MAX_NODE_COUNT);
  ------------------
  |  Branch (392:5): [True: 1.95k, False: 0]
  |  Branch (392:5): [True: 1.95k, False: 0]
  |  Branch (392:5): [True: 1.95k, False: 0]
  ------------------
  393|       |    /* We cannot insert a leaf at a lower depth while a deeper branch is unfinished. Doing
  394|       |     * so would mean the Add() invocations do not correspond to a DFS traversal of a
  395|       |     * binary tree. */
  396|  1.95k|    if ((size_t)depth + 1 < m_branch.size()) {
  ------------------
  |  Branch (396:9): [True: 0, False: 1.95k]
  ------------------
  397|      0|        m_valid = false;
  398|      0|        return;
  399|      0|    }
  400|       |    /* As long as an entry in the branch exists at the specified depth, combine it and propagate up.
  401|       |     * The 'node' variable is overwritten here with the newly combined node. */
  402|  1.95k|    while (m_valid && m_branch.size() > (size_t)depth && m_branch[depth].has_value()) {
  ------------------
  |  Branch (402:12): [True: 1.95k, False: 0]
  |  Branch (402:23): [True: 0, False: 1.95k]
  |  Branch (402:58): [True: 0, False: 0]
  ------------------
  403|      0|        node = Combine(std::move(node), std::move(*m_branch[depth]));
  404|      0|        m_branch.pop_back();
  405|      0|        if (depth == 0) m_valid = false; /* Can't propagate further up than the root */
  ------------------
  |  Branch (405:13): [True: 0, False: 0]
  ------------------
  406|      0|        --depth;
  407|      0|    }
  408|  1.95k|    if (m_valid) {
  ------------------
  |  Branch (408:9): [True: 1.95k, False: 0]
  ------------------
  409|       |        /* Make sure the branch is big enough to place the new node. */
  410|  1.95k|        if (m_branch.size() <= (size_t)depth) m_branch.resize((size_t)depth + 1);
  ------------------
  |  Branch (410:13): [True: 1.95k, False: 0]
  ------------------
  411|  1.95k|        assert(!m_branch[depth].has_value());
  ------------------
  |  Branch (411:9): [True: 1.95k, False: 0]
  ------------------
  412|  1.95k|        m_branch[depth] = std::move(node);
  413|  1.95k|    }
  414|  1.95k|}
_ZN14TaprootBuilder3AddEiNSt3__14spanIKhLm18446744073709551615EEEib:
  440|  1.95k|{
  441|  1.95k|    assert((leaf_version & ~TAPROOT_LEAF_MASK) == 0);
  ------------------
  |  Branch (441:5): [True: 1.95k, False: 0]
  ------------------
  442|  1.95k|    if (!IsValid()) return *this;
  ------------------
  |  Branch (442:9): [True: 0, False: 1.95k]
  ------------------
  443|       |    /* Construct NodeInfo object with leaf hash and (if track is true) also leaf information. */
  444|  1.95k|    NodeInfo node;
  445|  1.95k|    node.hash = ComputeTapleafHash(leaf_version, script);
  446|  1.95k|    if (track) node.leaves.emplace_back(LeafInfo{std::vector<unsigned char>(script.begin(), script.end()), leaf_version, {}});
  ------------------
  |  Branch (446:9): [True: 1.95k, False: 0]
  ------------------
  447|       |    /* Insert into the branch. */
  448|  1.95k|    Insert(std::move(node), depth);
  449|  1.95k|    return *this;
  450|  1.95k|}
_ZN14TaprootBuilder8FinalizeERK11XOnlyPubKey:
  463|  1.95k|{
  464|       |    /* Can only call this function when IsComplete() is true. */
  465|  1.95k|    assert(IsComplete());
  ------------------
  |  Branch (465:5): [True: 1.95k, False: 0]
  ------------------
  466|  1.95k|    m_internal_key = internal_key;
  467|  1.95k|    auto ret = m_internal_key.CreateTapTweak(m_branch.size() == 0 ? nullptr : &m_branch[0]->hash);
  ------------------
  |  Branch (467:46): [True: 0, False: 1.95k]
  ------------------
  468|  1.95k|    assert(ret.has_value());
  ------------------
  |  Branch (468:5): [True: 1.95k, False: 0]
  ------------------
  469|  1.95k|    std::tie(m_output_key, m_parity) = *ret;
  470|  1.95k|    return *this;
  471|  1.95k|}
_ZN14TaprootBuilder9GetOutputEv:
  473|  1.95k|WitnessV1Taproot TaprootBuilder::GetOutput() { return WitnessV1Taproot{m_output_key}; }
_ZNK14TaprootBuilder12GetSpendDataEv:
  476|  1.29k|{
  477|  1.29k|    assert(IsComplete());
  ------------------
  |  Branch (477:5): [True: 1.29k, False: 0]
  ------------------
  478|  1.29k|    assert(m_output_key.IsFullyValid());
  ------------------
  |  Branch (478:5): [True: 1.29k, False: 0]
  ------------------
  479|  1.29k|    TaprootSpendData spd;
  480|  1.29k|    spd.merkle_root = m_branch.size() == 0 ? uint256() : m_branch[0]->hash;
  ------------------
  |  Branch (480:23): [True: 0, False: 1.29k]
  ------------------
  481|  1.29k|    spd.internal_key = m_internal_key;
  482|  1.29k|    if (m_branch.size()) {
  ------------------
  |  Branch (482:9): [True: 1.29k, False: 0]
  ------------------
  483|       |        // If any script paths exist, they have been combined into the root m_branch[0]
  484|       |        // by now. Compute the control block for each of its tracked leaves, and put them in
  485|       |        // spd.scripts.
  486|  1.29k|        for (const auto& leaf : m_branch[0]->leaves) {
  ------------------
  |  Branch (486:31): [True: 1.29k, False: 1.29k]
  ------------------
  487|  1.29k|            std::vector<unsigned char> control_block;
  488|  1.29k|            control_block.resize(TAPROOT_CONTROL_BASE_SIZE + TAPROOT_CONTROL_NODE_SIZE * leaf.merkle_branch.size());
  489|  1.29k|            control_block[0] = leaf.leaf_version | (m_parity ? 1 : 0);
  ------------------
  |  Branch (489:53): [True: 685, False: 606]
  ------------------
  490|  1.29k|            std::copy(m_internal_key.begin(), m_internal_key.end(), control_block.begin() + 1);
  491|  1.29k|            if (leaf.merkle_branch.size()) {
  ------------------
  |  Branch (491:17): [True: 0, False: 1.29k]
  ------------------
  492|      0|                std::copy(leaf.merkle_branch[0].begin(),
  493|      0|                          leaf.merkle_branch[0].begin() + TAPROOT_CONTROL_NODE_SIZE * leaf.merkle_branch.size(),
  494|      0|                          control_block.begin() + TAPROOT_CONTROL_BASE_SIZE);
  495|      0|            }
  496|  1.29k|            spd.scripts[{leaf.script, leaf.leaf_version}].insert(std::move(control_block));
  497|  1.29k|        }
  498|  1.29k|    }
  499|  1.29k|    return spd;
  500|  1.29k|}

_ZNK14TaprootBuilder7IsValidEv:
  141|  1.95k|    bool IsValid() const { return m_valid; }
_ZNK14TaprootBuilder10IsCompleteEv:
  143|  3.24k|    bool IsComplete() const { return m_valid && (m_branch.size() == 0 || (m_branch.size() == 1 && m_branch[0].has_value())); }
  ------------------
  |  Branch (143:38): [True: 3.24k, False: 0]
  |  Branch (143:50): [True: 0, False: 3.24k]
  |  Branch (143:75): [True: 3.24k, False: 0]
  |  Branch (143:99): [True: 3.24k, False: 0]
  ------------------
_ZN15SigningProviderD2Ev:
  170|      2|    virtual ~SigningProvider() = default;

_Z12IsPushdataOp10opcodetype:
   41|   320k|{
   42|   320k|    return opcode > OP_FALSE && opcode <= OP_PUSHDATA4;
  ------------------
  |  Branch (42:12): [True: 284k, False: 35.8k]
  |  Branch (42:33): [True: 78.3k, False: 206k]
  ------------------
   43|   320k|}

_ZN19script_verify_flagsC2E23script_verify_flag_name:
   25|   151k|    constexpr explicit(false) script_verify_flags(script_verify_flag_name f) : m_value{value_type{1} << static_cast<uint8_t>(f)} { }
_ZN19script_verify_flags8from_intEm:
   35|   151k|    static constexpr script_verify_flags from_int(value_type f) { script_verify_flags r; r.m_value = f; return r; }
_Zor19script_verify_flagsS_:
   40|  20.5k|    friend constexpr script_verify_flags operator|(script_verify_flags a, script_verify_flags b) { return from_int(a.m_value | b.m_value); }
_Zan19script_verify_flagsS_:
   41|   130k|    friend constexpr script_verify_flags operator&(script_verify_flags a, script_verify_flags b) { return from_int(a.m_value & b.m_value); }
_ZNK19script_verify_flagscvbEv:
   48|  46.3k|    constexpr explicit operator bool() const { return m_value != 0; }
_ZNK19script_verify_flagseqES_:
   49|  84.1k|    constexpr bool operator==(script_verify_flags other) const { return m_value == other.m_value; }
_Zor23script_verify_flag_nameS_:
   67|  10.2k|{
   68|  10.2k|    return script_verify_flags{f1} | f2;
   69|  10.2k|}

secp256k1.c:secp256k1_eckey_pubkey_tweak_add:
   62|  3.24k|static int secp256k1_eckey_pubkey_tweak_add(secp256k1_ge *key, const secp256k1_scalar *tweak) {
   63|  3.24k|    secp256k1_gej pt;
   64|  3.24k|    secp256k1_gej_set_ge(&pt, key);
   65|  3.24k|    secp256k1_ecmult(&pt, &pt, &secp256k1_scalar_one, tweak);
   66|       |
   67|  3.24k|    if (secp256k1_gej_is_infinity(&pt)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 3.24k]
  ------------------
   68|      0|        return 0;
   69|      0|    }
   70|  3.24k|    secp256k1_ge_set_gej(key, &pt);
   71|  3.24k|    return 1;
   72|  3.24k|}

secp256k1.c:secp256k1_ecmult_gen_context_clear:
   26|      2|static void secp256k1_ecmult_gen_context_clear(secp256k1_ecmult_gen_context *ctx) {
   27|      2|    ctx->built = 0;
   28|      2|    secp256k1_scalar_clear(&ctx->scalar_offset);
   29|      2|    secp256k1_ge_clear(&ctx->ge_offset);
   30|      2|    secp256k1_fe_clear(&ctx->proj_blind);
   31|      2|}
secp256k1.c:secp256k1_ecmult_gen_context_is_built:
   22|      4|static int secp256k1_ecmult_gen_context_is_built(const secp256k1_ecmult_gen_context* ctx) {
   23|      4|    return ctx->built;
   24|      4|}

secp256k1.c:secp256k1_ecmult:
  365|  3.24k|static void secp256k1_ecmult(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_scalar *na, const secp256k1_scalar *ng) {
  366|  3.24k|    secp256k1_fe aux[ECMULT_TABLE_SIZE(WINDOW_A)];
  367|  3.24k|    secp256k1_ge pre_a[ECMULT_TABLE_SIZE(WINDOW_A)];
  368|  3.24k|    struct secp256k1_strauss_point_state ps[1];
  369|  3.24k|    struct secp256k1_strauss_state state;
  370|       |
  371|  3.24k|    state.aux = aux;
  372|  3.24k|    state.pre_a = pre_a;
  373|  3.24k|    state.ps = ps;
  374|  3.24k|    secp256k1_ecmult_strauss_wnaf(&state, r, 1, a, na, ng);
  375|  3.24k|}
secp256k1.c:secp256k1_ecmult_strauss_wnaf:
  252|  3.24k|static void secp256k1_ecmult_strauss_wnaf(const struct secp256k1_strauss_state *state, secp256k1_gej *r, size_t num, const secp256k1_gej *a, const secp256k1_scalar *na, const secp256k1_scalar *ng) {
  253|  3.24k|    secp256k1_ge tmpa;
  254|  3.24k|    secp256k1_fe Z;
  255|       |    /* Split G factors. */
  256|  3.24k|    secp256k1_scalar ng_1, ng_128;
  257|  3.24k|    int wnaf_ng_1[129];
  258|  3.24k|    int bits_ng_1 = 0;
  259|  3.24k|    int wnaf_ng_128[129];
  260|  3.24k|    int bits_ng_128 = 0;
  261|  3.24k|    int i;
  262|  3.24k|    int bits = 0;
  263|  3.24k|    size_t np;
  264|  3.24k|    size_t no = 0;
  265|       |
  266|  3.24k|    secp256k1_fe_set_int(&Z, 1);
  ------------------
  |  |   83|  3.24k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  267|  6.49k|    for (np = 0; np < num; ++np) {
  ------------------
  |  Branch (267:18): [True: 3.24k, False: 3.24k]
  ------------------
  268|  3.24k|        secp256k1_gej tmp;
  269|  3.24k|        secp256k1_scalar na_1, na_lam;
  270|  3.24k|        if (secp256k1_scalar_is_zero(&na[np]) || secp256k1_gej_is_infinity(&a[np])) {
  ------------------
  |  Branch (270:13): [True: 0, False: 3.24k]
  |  Branch (270:50): [True: 0, False: 3.24k]
  ------------------
  271|      0|            continue;
  272|      0|        }
  273|       |        /* split na into na_1 and na_lam (where na = na_1 + na_lam*lambda, and na_1 and na_lam are ~128 bit) */
  274|  3.24k|        secp256k1_scalar_split_lambda(&na_1, &na_lam, &na[np]);
  275|       |
  276|       |        /* build wnaf representation for na_1 and na_lam. */
  277|  3.24k|        state->ps[no].bits_na_1   = secp256k1_ecmult_wnaf_small(state->ps[no].wnaf_na_1,   129, &na_1,   WINDOW_A);
  ------------------
  |  |   32|  3.24k|#  define WINDOW_A 5
  ------------------
  278|  3.24k|        state->ps[no].bits_na_lam = secp256k1_ecmult_wnaf_small(state->ps[no].wnaf_na_lam, 129, &na_lam, WINDOW_A);
  ------------------
  |  |   32|  3.24k|#  define WINDOW_A 5
  ------------------
  279|  3.24k|        VERIFY_CHECK(state->ps[no].bits_na_1 <= 129);
  280|  3.24k|        VERIFY_CHECK(state->ps[no].bits_na_lam <= 129);
  281|  3.24k|        if (state->ps[no].bits_na_1 > bits) {
  ------------------
  |  Branch (281:13): [True: 3.24k, False: 0]
  ------------------
  282|  3.24k|            bits = state->ps[no].bits_na_1;
  283|  3.24k|        }
  284|  3.24k|        if (state->ps[no].bits_na_lam > bits) {
  ------------------
  |  Branch (284:13): [True: 0, False: 3.24k]
  ------------------
  285|      0|            bits = state->ps[no].bits_na_lam;
  286|      0|        }
  287|       |
  288|       |        /* Calculate odd multiples of a.
  289|       |         * All multiples are brought to the same Z 'denominator', which is stored
  290|       |         * in Z. Due to secp256k1' isomorphism we can do all operations pretending
  291|       |         * that the Z coordinate was 1, use affine addition formulae, and correct
  292|       |         * the Z coordinate of the result once at the end.
  293|       |         * The exception is the precomputed G table points, which are actually
  294|       |         * affine. Compared to the base used for other points, they have a Z ratio
  295|       |         * of 1/Z, so we can use secp256k1_gej_add_zinv_var, which uses the same
  296|       |         * isomorphism to efficiently add with a known Z inverse.
  297|       |         */
  298|  3.24k|        tmp = a[np];
  299|  3.24k|        if (no) {
  ------------------
  |  Branch (299:13): [True: 0, False: 3.24k]
  ------------------
  300|      0|            secp256k1_gej_rescale(&tmp, &Z);
  301|      0|        }
  302|  3.24k|        secp256k1_ecmult_odd_multiples_table(ECMULT_TABLE_SIZE(WINDOW_A), state->pre_a + no * ECMULT_TABLE_SIZE(WINDOW_A), state->aux + no * ECMULT_TABLE_SIZE(WINDOW_A), &Z, &tmp);
  ------------------
  |  |   41|  3.24k|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
                      secp256k1_ecmult_odd_multiples_table(ECMULT_TABLE_SIZE(WINDOW_A), state->pre_a + no * ECMULT_TABLE_SIZE(WINDOW_A), state->aux + no * ECMULT_TABLE_SIZE(WINDOW_A), &Z, &tmp);
  ------------------
  |  |   41|  3.24k|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
                      secp256k1_ecmult_odd_multiples_table(ECMULT_TABLE_SIZE(WINDOW_A), state->pre_a + no * ECMULT_TABLE_SIZE(WINDOW_A), state->aux + no * ECMULT_TABLE_SIZE(WINDOW_A), &Z, &tmp);
  ------------------
  |  |   41|  3.24k|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
  303|  3.24k|        if (no) secp256k1_fe_mul(state->aux + no * ECMULT_TABLE_SIZE(WINDOW_A), state->aux + no * ECMULT_TABLE_SIZE(WINDOW_A), &(a[np].z));
  ------------------
  |  |   93|      0|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
                      if (no) secp256k1_fe_mul(state->aux + no * ECMULT_TABLE_SIZE(WINDOW_A), state->aux + no * ECMULT_TABLE_SIZE(WINDOW_A), &(a[np].z));
  ------------------
  |  |   41|      0|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
                      if (no) secp256k1_fe_mul(state->aux + no * ECMULT_TABLE_SIZE(WINDOW_A), state->aux + no * ECMULT_TABLE_SIZE(WINDOW_A), &(a[np].z));
  ------------------
  |  |   41|      0|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
  |  Branch (303:13): [True: 0, False: 3.24k]
  ------------------
  304|       |
  305|  3.24k|        ++no;
  306|  3.24k|    }
  307|       |
  308|       |    /* Bring them to the same Z denominator. */
  309|  3.24k|    if (no) {
  ------------------
  |  Branch (309:9): [True: 3.24k, False: 0]
  ------------------
  310|  3.24k|        secp256k1_ge_table_set_globalz(ECMULT_TABLE_SIZE(WINDOW_A) * no, state->pre_a, state->aux);
  ------------------
  |  |   41|  3.24k|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
  311|  3.24k|    }
  312|       |
  313|  6.49k|    for (np = 0; np < no; ++np) {
  ------------------
  |  Branch (313:18): [True: 3.24k, False: 3.24k]
  ------------------
  314|  3.24k|        size_t j;
  315|  29.2k|        for (j = 0; j < ECMULT_TABLE_SIZE(WINDOW_A); j++) {
  ------------------
  |  |   41|  29.2k|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
  |  Branch (315:21): [True: 25.9k, False: 3.24k]
  ------------------
  316|  25.9k|            secp256k1_fe_mul(&state->aux[np * ECMULT_TABLE_SIZE(WINDOW_A) + j], &state->pre_a[np * ECMULT_TABLE_SIZE(WINDOW_A) + j].x, &secp256k1_const_beta);
  ------------------
  |  |   93|  25.9k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
                          secp256k1_fe_mul(&state->aux[np * ECMULT_TABLE_SIZE(WINDOW_A) + j], &state->pre_a[np * ECMULT_TABLE_SIZE(WINDOW_A) + j].x, &secp256k1_const_beta);
  ------------------
  |  |   41|  25.9k|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
                          secp256k1_fe_mul(&state->aux[np * ECMULT_TABLE_SIZE(WINDOW_A) + j], &state->pre_a[np * ECMULT_TABLE_SIZE(WINDOW_A) + j].x, &secp256k1_const_beta);
  ------------------
  |  |   41|  25.9k|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
  317|  25.9k|        }
  318|  3.24k|    }
  319|       |
  320|  3.24k|    if (ng) {
  ------------------
  |  Branch (320:9): [True: 3.24k, False: 0]
  ------------------
  321|       |        /* split ng into ng_1 and ng_128 (where gn = gn_1 + gn_128*2^128, and gn_1 and gn_128 are ~128 bit) */
  322|  3.24k|        secp256k1_scalar_split_128(&ng_1, &ng_128, ng);
  323|       |
  324|       |        /* Build wnaf representation for ng_1 and ng_128 */
  325|  3.24k|        bits_ng_1   = secp256k1_ecmult_wnaf(wnaf_ng_1,   129, &ng_1,   WINDOW_G);
  ------------------
  |  |   31|  3.24k|#    define WINDOW_G ECMULT_WINDOW_SIZE
  ------------------
  326|  3.24k|        bits_ng_128 = secp256k1_ecmult_wnaf(wnaf_ng_128, 129, &ng_128, WINDOW_G);
  ------------------
  |  |   31|  3.24k|#    define WINDOW_G ECMULT_WINDOW_SIZE
  ------------------
  327|  3.24k|        if (bits_ng_1 > bits) {
  ------------------
  |  Branch (327:13): [True: 3.24k, False: 0]
  ------------------
  328|  3.24k|            bits = bits_ng_1;
  329|  3.24k|        }
  330|  3.24k|        if (bits_ng_128 > bits) {
  ------------------
  |  Branch (330:13): [True: 1.50k, False: 1.74k]
  ------------------
  331|  1.50k|            bits = bits_ng_128;
  332|  1.50k|        }
  333|  3.24k|    }
  334|       |
  335|  3.24k|    secp256k1_gej_set_infinity(r);
  336|       |
  337|   409k|    for (i = bits - 1; i >= 0; i--) {
  ------------------
  |  Branch (337:24): [True: 406k, False: 3.24k]
  ------------------
  338|   406k|        int n;
  339|   406k|        secp256k1_gej_double_var(r, r, NULL);
  340|   812k|        for (np = 0; np < no; ++np) {
  ------------------
  |  Branch (340:22): [True: 406k, False: 406k]
  ------------------
  341|   406k|            if (i < state->ps[np].bits_na_1 && (n = state->ps[np].wnaf_na_1[i])) {
  ------------------
  |  Branch (341:17): [True: 3.24k, False: 402k]
  |  Branch (341:48): [True: 3.24k, False: 0]
  ------------------
  342|  3.24k|                secp256k1_ecmult_table_get_ge(&tmpa, state->pre_a + np * ECMULT_TABLE_SIZE(WINDOW_A), n, WINDOW_A);
  ------------------
  |  |   41|  3.24k|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
                              secp256k1_ecmult_table_get_ge(&tmpa, state->pre_a + np * ECMULT_TABLE_SIZE(WINDOW_A), n, WINDOW_A);
  ------------------
  |  |   32|  3.24k|#  define WINDOW_A 5
  ------------------
  343|  3.24k|                secp256k1_gej_add_ge_var(r, r, &tmpa, NULL);
  344|  3.24k|            }
  345|   406k|            if (i < state->ps[np].bits_na_lam && (n = state->ps[np].wnaf_na_lam[i])) {
  ------------------
  |  Branch (345:17): [True: 0, False: 406k]
  |  Branch (345:50): [True: 0, False: 0]
  ------------------
  346|      0|                secp256k1_ecmult_table_get_ge_lambda(&tmpa, state->pre_a + np * ECMULT_TABLE_SIZE(WINDOW_A), state->aux + np * ECMULT_TABLE_SIZE(WINDOW_A), n, WINDOW_A);
  ------------------
  |  |   41|      0|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
                              secp256k1_ecmult_table_get_ge_lambda(&tmpa, state->pre_a + np * ECMULT_TABLE_SIZE(WINDOW_A), state->aux + np * ECMULT_TABLE_SIZE(WINDOW_A), n, WINDOW_A);
  ------------------
  |  |   41|      0|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
                              secp256k1_ecmult_table_get_ge_lambda(&tmpa, state->pre_a + np * ECMULT_TABLE_SIZE(WINDOW_A), state->aux + np * ECMULT_TABLE_SIZE(WINDOW_A), n, WINDOW_A);
  ------------------
  |  |   32|      0|#  define WINDOW_A 5
  ------------------
  347|      0|                secp256k1_gej_add_ge_var(r, r, &tmpa, NULL);
  348|      0|            }
  349|   406k|        }
  350|   406k|        if (i < bits_ng_1 && (n = wnaf_ng_1[i])) {
  ------------------
  |  Branch (350:13): [True: 394k, False: 11.2k]
  |  Branch (350:30): [True: 27.5k, False: 367k]
  ------------------
  351|  27.5k|            secp256k1_ecmult_table_get_ge_storage(&tmpa, secp256k1_pre_g, n, WINDOW_G);
  ------------------
  |  |   31|  27.5k|#    define WINDOW_G ECMULT_WINDOW_SIZE
  ------------------
  352|  27.5k|            secp256k1_gej_add_zinv_var(r, r, &tmpa, &Z);
  353|  27.5k|        }
  354|   406k|        if (i < bits_ng_128 && (n = wnaf_ng_128[i])) {
  ------------------
  |  Branch (354:13): [True: 395k, False: 10.6k]
  |  Branch (354:32): [True: 27.5k, False: 367k]
  ------------------
  355|  27.5k|            secp256k1_ecmult_table_get_ge_storage(&tmpa, secp256k1_pre_g_128, n, WINDOW_G);
  ------------------
  |  |   31|  27.5k|#    define WINDOW_G ECMULT_WINDOW_SIZE
  ------------------
  356|  27.5k|            secp256k1_gej_add_zinv_var(r, r, &tmpa, &Z);
  357|  27.5k|        }
  358|   406k|    }
  359|       |
  360|  3.24k|    if (!secp256k1_gej_is_infinity(r)) {
  ------------------
  |  Branch (360:9): [True: 3.24k, False: 0]
  ------------------
  361|  3.24k|        secp256k1_fe_mul(&r->z, &r->z, &Z);
  ------------------
  |  |   93|  3.24k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  362|  3.24k|    }
  363|  3.24k|}
secp256k1.c:secp256k1_ecmult_wnaf_small:
  224|  6.49k|static int secp256k1_ecmult_wnaf_small(int8_t *wnaf, int len, const secp256k1_scalar *a, int w) {
  225|  6.49k|    int wnaf_tmp[256];
  226|  6.49k|    int ret, i;
  227|       |
  228|  6.49k|    VERIFY_CHECK(2 <= w && w <= 8);
  229|  6.49k|    ret = secp256k1_ecmult_wnaf(wnaf_tmp, len, a, w);
  230|       |
  231|   843k|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (231:17): [True: 837k, False: 6.49k]
  ------------------
  232|   837k|        wnaf[i] = (int8_t)wnaf_tmp[i];
  233|   837k|    }
  234|       |
  235|  6.49k|    return ret;
  236|  6.49k|}
secp256k1.c:secp256k1_ecmult_odd_multiples_table:
   73|  3.24k|static void secp256k1_ecmult_odd_multiples_table(size_t n, secp256k1_ge *pre_a, secp256k1_fe *zr, secp256k1_fe *z, const secp256k1_gej *a) {
   74|  3.24k|    secp256k1_gej d, ai;
   75|  3.24k|    secp256k1_ge d_ge;
   76|  3.24k|    size_t i;
   77|       |
   78|  3.24k|    VERIFY_CHECK(!secp256k1_gej_is_infinity(a));
   79|       |
   80|  3.24k|    secp256k1_gej_double_var(&d, a, NULL);
   81|       |
   82|       |    /*
   83|       |     * Perform the additions using an isomorphic curve Y^2 = X^3 + 7*C^6 where C := d.z.
   84|       |     * The isomorphism, phi, maps a secp256k1 point (x, y) to the point (x*C^2, y*C^3) on the other curve.
   85|       |     * In Jacobian coordinates phi maps (x, y, z) to (x*C^2, y*C^3, z) or, equivalently to (x, y, z/C).
   86|       |     *
   87|       |     *     phi(x, y, z) = (x*C^2, y*C^3, z) = (x, y, z/C)
   88|       |     *   d_ge := phi(d) = (d.x, d.y, 1)
   89|       |     *     ai := phi(a) = (a.x*C^2, a.y*C^3, a.z)
   90|       |     *
   91|       |     * The group addition functions work correctly on these isomorphic curves.
   92|       |     * In particular phi(d) is easy to represent in affine coordinates under this isomorphism.
   93|       |     * This lets us use the faster secp256k1_gej_add_ge_var group addition function that we wouldn't be able to use otherwise.
   94|       |     */
   95|  3.24k|    secp256k1_ge_set_xy(&d_ge, &d.x, &d.y);
   96|  3.24k|    secp256k1_ge_set_gej_zinv(&pre_a[0], a, &d.z);
   97|  3.24k|    secp256k1_gej_set_ge(&ai, &pre_a[0]);
   98|  3.24k|    ai.z = a->z;
   99|       |
  100|       |    /* pre_a[0] is the point (a.x*C^2, a.y*C^3, a.z*C) which is equivalent to a.
  101|       |     * Set zr[0] to C, which is the ratio between the omitted z(pre_a[0]) value and a.z.
  102|       |     */
  103|  3.24k|    zr[0] = d.z;
  104|       |
  105|  25.9k|    for (i = 1; i < n; i++) {
  ------------------
  |  Branch (105:17): [True: 22.7k, False: 3.24k]
  ------------------
  106|  22.7k|        secp256k1_gej_add_ge_var(&ai, &ai, &d_ge, &zr[i]);
  107|  22.7k|        secp256k1_ge_set_xy(&pre_a[i], &ai.x, &ai.y);
  108|  22.7k|    }
  109|       |
  110|       |    /* Multiply the last z-coordinate by C to undo the isomorphism.
  111|       |     * Since the z-coordinates of the pre_a values are implied by the zr array of z-coordinate ratios,
  112|       |     * undoing the isomorphism here undoes the isomorphism for all pre_a values.
  113|       |     */
  114|  3.24k|    secp256k1_fe_mul(z, &ai.z, &d.z);
  ------------------
  |  |   93|  3.24k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  115|  3.24k|}
secp256k1.c:secp256k1_ecmult_wnaf:
  162|  12.9k|static int secp256k1_ecmult_wnaf(int *wnaf, int len, const secp256k1_scalar *a, int w) {
  163|  12.9k|    secp256k1_scalar s;
  164|  12.9k|    int last_set_bit = -1;
  165|  12.9k|    int bit = 0;
  166|  12.9k|    int sign = 1;
  167|  12.9k|    int carry = 0;
  168|       |
  169|  12.9k|    VERIFY_CHECK(wnaf != NULL);
  170|  12.9k|    VERIFY_CHECK(0 <= len && len <= 256);
  171|  12.9k|    VERIFY_CHECK(a != NULL);
  172|  12.9k|    VERIFY_CHECK(2 <= w && w <= 31);
  173|       |
  174|  1.68M|    for (bit = 0; bit < len; bit++) {
  ------------------
  |  Branch (174:19): [True: 1.67M, False: 12.9k]
  ------------------
  175|  1.67M|        wnaf[bit] = 0;
  176|  1.67M|    }
  177|       |
  178|  12.9k|    s = *a;
  179|  12.9k|    if (secp256k1_scalar_get_bits_limb32(&s, 255, 1)) {
  ------------------
  |  Branch (179:9): [True: 0, False: 12.9k]
  ------------------
  180|      0|        secp256k1_scalar_negate(&s, &s);
  181|      0|        sign = -1;
  182|      0|    }
  183|       |
  184|  12.9k|    bit = 0;
  185|   948k|    while (bit < len) {
  ------------------
  |  Branch (185:12): [True: 935k, False: 12.9k]
  ------------------
  186|   935k|        int now;
  187|   935k|        int word;
  188|   935k|        if (secp256k1_scalar_get_bits_limb32(&s, bit, 1) == (unsigned int)carry) {
  ------------------
  |  Branch (188:13): [True: 877k, False: 58.3k]
  ------------------
  189|   877k|            bit++;
  190|   877k|            continue;
  191|   877k|        }
  192|       |
  193|  58.3k|        now = w;
  194|  58.3k|        if (now > len - bit) {
  ------------------
  |  Branch (194:13): [True: 5.26k, False: 53.0k]
  ------------------
  195|  5.26k|            now = len - bit;
  196|  5.26k|        }
  197|       |
  198|  58.3k|        word = secp256k1_scalar_get_bits_var(&s, bit, now) + carry;
  199|       |
  200|  58.3k|        carry = (word >> (w-1)) & 1;
  201|  58.3k|        word -= carry << w;
  202|       |
  203|  58.3k|        wnaf[bit] = sign * word;
  204|  58.3k|        last_set_bit = bit;
  205|       |
  206|  58.3k|        bit += now;
  207|  58.3k|    }
  208|       |#ifdef VERIFY
  209|       |    {
  210|       |        int verify_bit = bit;
  211|       |
  212|       |        VERIFY_CHECK(carry == 0);
  213|       |
  214|       |        while (verify_bit < 256) {
  215|       |            VERIFY_CHECK(secp256k1_scalar_get_bits_limb32(&s, verify_bit, 1) == 0);
  216|       |            verify_bit++;
  217|       |        }
  218|       |    }
  219|       |#endif
  220|  12.9k|    return last_set_bit + 1;
  221|  12.9k|}
secp256k1.c:secp256k1_ecmult_table_get_ge:
  125|  3.24k|SECP256K1_INLINE static void secp256k1_ecmult_table_get_ge(secp256k1_ge *r, const secp256k1_ge *pre, int n, int w) {
  126|  3.24k|    secp256k1_ecmult_table_verify(n,w);
  127|  3.24k|    if (n > 0) {
  ------------------
  |  Branch (127:9): [True: 3.24k, False: 0]
  ------------------
  128|  3.24k|        *r = pre[(n-1)/2];
  129|  3.24k|    } else {
  130|      0|        *r = pre[(-n-1)/2];
  131|      0|        secp256k1_fe_negate(&(r->y), &(r->y), 1);
  ------------------
  |  |  211|      0|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|      0|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|      0|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|      0|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|      0|    } \
  |  |  |  |   94|      0|    stmt; \
  |  |  |  |   95|      0|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  132|      0|    }
  133|  3.24k|}
secp256k1.c:secp256k1_ecmult_table_verify:
  117|  58.3k|SECP256K1_INLINE static void secp256k1_ecmult_table_verify(int n, int w) {
  118|  58.3k|    (void)n;
  119|  58.3k|    (void)w;
  120|  58.3k|    VERIFY_CHECK(((n) & 1) == 1);
  121|  58.3k|    VERIFY_CHECK((n) >= -((1 << ((w)-1)) - 1));
  122|  58.3k|    VERIFY_CHECK((n) <=  ((1 << ((w)-1)) - 1));
  123|  58.3k|}
secp256k1.c:secp256k1_ecmult_table_get_ge_storage:
  145|  55.0k|SECP256K1_INLINE static void secp256k1_ecmult_table_get_ge_storage(secp256k1_ge *r, const secp256k1_ge_storage *pre, int n, int w) {
  146|  55.0k|    secp256k1_ecmult_table_verify(n,w);
  147|  55.0k|    if (n > 0) {
  ------------------
  |  Branch (147:9): [True: 30.5k, False: 24.5k]
  ------------------
  148|  30.5k|        secp256k1_ge_from_storage(r, &pre[(n-1)/2]);
  149|  30.5k|    } else {
  150|  24.5k|        secp256k1_ge_from_storage(r, &pre[(-n-1)/2]);
  151|  24.5k|        secp256k1_fe_negate(&(r->y), &(r->y), 1);
  ------------------
  |  |  211|  24.5k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  24.5k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  24.5k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 24.5k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  24.5k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 24.5k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  24.5k|    } \
  |  |  |  |   94|  24.5k|    stmt; \
  |  |  |  |   95|  24.5k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 24.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  152|  24.5k|    }
  153|  55.0k|}

secp256k1.c:secp256k1_fe_impl_sqr:
  317|  3.04M|SECP256K1_FORCE_INLINE static void secp256k1_fe_impl_sqr(secp256k1_fe *r, const secp256k1_fe *a) {
  318|  3.04M|    secp256k1_fe_sqr_inner(r->n, a->n);
  319|  3.04M|}
secp256k1.c:secp256k1_fe_impl_mul:
  313|  2.10M|SECP256K1_FORCE_INLINE static void secp256k1_fe_impl_mul(secp256k1_fe *r, const secp256k1_fe *a, const secp256k1_fe * SECP256K1_RESTRICT b) {
  314|  2.10M|    secp256k1_fe_mul_inner(r->n, a->n, b->n);
  315|  2.10M|}
secp256k1.c:secp256k1_fe_impl_add_int:
  301|  4.53k|SECP256K1_INLINE static void secp256k1_fe_impl_add_int(secp256k1_fe *r, int a) {
  302|  4.53k|    r->n[0] += a;
  303|  4.53k|}
secp256k1.c:secp256k1_fe_impl_is_zero:
  206|  7.15k|SECP256K1_INLINE static int secp256k1_fe_impl_is_zero(const secp256k1_fe *a) {
  207|  7.15k|    const uint64_t *t = a->n;
  208|  7.15k|    return (t[0] | t[1] | t[2] | t[3] | t[4]) == 0;
  209|  7.15k|}
secp256k1.c:secp256k1_fe_impl_add:
  305|  2.17M|SECP256K1_INLINE static void secp256k1_fe_impl_add(secp256k1_fe *r, const secp256k1_fe *a) {
  306|  2.17M|    r->n[0] += a->n[0];
  307|  2.17M|    r->n[1] += a->n[1];
  308|  2.17M|    r->n[2] += a->n[2];
  309|  2.17M|    r->n[3] += a->n[3];
  310|  2.17M|    r->n[4] += a->n[4];
  311|  2.17M|}
secp256k1.c:secp256k1_fe_impl_normalize_weak:
   80|  3.24k|static void secp256k1_fe_impl_normalize_weak(secp256k1_fe *r) {
   81|  3.24k|    uint64_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4];
   82|       |
   83|       |    /* Reduce t4 at the start so there will be at most a single carry from the first pass */
   84|  3.24k|    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;
   85|       |
   86|       |    /* The first pass ensures the magnitude is 1, ... */
   87|  3.24k|    t0 += x * 0x1000003D1ULL;
   88|  3.24k|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;
   89|  3.24k|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL;
   90|  3.24k|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL;
   91|  3.24k|    t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL;
   92|       |
   93|       |    /* ... except for a possible carry at bit 48 of t4 (i.e. bit 256 of the field element) */
   94|  3.24k|    VERIFY_CHECK(t4 >> 49 == 0);
   95|       |
   96|  3.24k|    r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;
   97|  3.24k|}
secp256k1.c:secp256k1_fe_impl_negate_unchecked:
  278|  1.07M|SECP256K1_INLINE static void secp256k1_fe_impl_negate_unchecked(secp256k1_fe *r, const secp256k1_fe *a, int m) {
  279|       |    /* For all legal values of m (0..31), the following properties hold: */
  280|  1.07M|    VERIFY_CHECK(0xFFFFEFFFFFC2FULL * 2 * (m + 1) >= 0xFFFFFFFFFFFFFULL * 2 * m);
  281|  1.07M|    VERIFY_CHECK(0xFFFFFFFFFFFFFULL * 2 * (m + 1) >= 0xFFFFFFFFFFFFFULL * 2 * m);
  282|  1.07M|    VERIFY_CHECK(0x0FFFFFFFFFFFFULL * 2 * (m + 1) >= 0x0FFFFFFFFFFFFULL * 2 * m);
  283|       |
  284|       |    /* Due to the properties above, the left hand in the subtractions below is never less than
  285|       |     * the right hand. */
  286|  1.07M|    r->n[0] = 0xFFFFEFFFFFC2FULL * 2 * (m + 1) - a->n[0];
  287|  1.07M|    r->n[1] = 0xFFFFFFFFFFFFFULL * 2 * (m + 1) - a->n[1];
  288|  1.07M|    r->n[2] = 0xFFFFFFFFFFFFFULL * 2 * (m + 1) - a->n[2];
  289|  1.07M|    r->n[3] = 0xFFFFFFFFFFFFFULL * 2 * (m + 1) - a->n[3];
  290|  1.07M|    r->n[4] = 0x0FFFFFFFFFFFFULL * 2 * (m + 1) - a->n[4];
  291|  1.07M|}
secp256k1.c:secp256k1_fe_impl_normalizes_to_zero:
  137|  4.53k|static int secp256k1_fe_impl_normalizes_to_zero(const secp256k1_fe *r) {
  138|  4.53k|    uint64_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4];
  139|       |
  140|       |    /* z0 tracks a possible raw value of 0, z1 tracks a possible raw value of P */
  141|  4.53k|    uint64_t z0, z1;
  142|       |
  143|       |    /* Reduce t4 at the start so there will be at most a single carry from the first pass */
  144|  4.53k|    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;
  145|       |
  146|       |    /* The first pass ensures the magnitude is 1, ... */
  147|  4.53k|    t0 += x * 0x1000003D1ULL;
  148|  4.53k|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL; z0  = t0; z1  = t0 ^ 0x1000003D0ULL;
  149|  4.53k|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; z0 |= t1; z1 &= t1;
  150|  4.53k|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; z0 |= t2; z1 &= t2;
  151|  4.53k|    t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL; z0 |= t3; z1 &= t3;
  152|  4.53k|                                                z0 |= t4; z1 &= t4 ^ 0xF000000000000ULL;
  153|       |
  154|       |    /* ... except for a possible carry at bit 48 of t4 (i.e. bit 256 of the field element) */
  155|  4.53k|    VERIFY_CHECK(t4 >> 49 == 0);
  156|       |
  157|  4.53k|    return (z0 == 0) | (z1 == 0xFFFFFFFFFFFFFULL);
  158|  4.53k|}
secp256k1.c:secp256k1_fe_impl_set_int:
  201|  35.7k|SECP256K1_INLINE static void secp256k1_fe_impl_set_int(secp256k1_fe *r, int a) {
  202|  35.7k|    r->n[0] = a;
  203|  35.7k|    r->n[1] = r->n[2] = r->n[3] = r->n[4] = 0;
  204|  35.7k|}
secp256k1.c:secp256k1_fe_impl_mul_int_unchecked:
  293|   406k|SECP256K1_INLINE static void secp256k1_fe_impl_mul_int_unchecked(secp256k1_fe *r, int a) {
  294|   406k|    r->n[0] *= a;
  295|   406k|    r->n[1] *= a;
  296|   406k|    r->n[2] *= a;
  297|   406k|    r->n[3] *= a;
  298|   406k|    r->n[4] *= a;
  299|   406k|}
secp256k1.c:secp256k1_fe_impl_half:
  335|   406k|static SECP256K1_INLINE void secp256k1_fe_impl_half(secp256k1_fe *r) {
  336|   406k|    uint64_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4];
  337|   406k|    uint64_t one = (uint64_t)1;
  338|   406k|    uint64_t mask = -(t0 & one) >> 12;
  339|       |
  340|       |    /* Bounds analysis (over the rationals).
  341|       |     *
  342|       |     * Let m = r->magnitude
  343|       |     *     C = 0xFFFFFFFFFFFFFULL * 2
  344|       |     *     D = 0x0FFFFFFFFFFFFULL * 2
  345|       |     *
  346|       |     * Initial bounds: t0..t3 <= C * m
  347|       |     *                     t4 <= D * m
  348|       |     */
  349|       |
  350|   406k|    t0 += 0xFFFFEFFFFFC2FULL & mask;
  351|   406k|    t1 += mask;
  352|   406k|    t2 += mask;
  353|   406k|    t3 += mask;
  354|   406k|    t4 += mask >> 4;
  355|       |
  356|   406k|    VERIFY_CHECK((t0 & one) == 0);
  357|       |
  358|       |    /* t0..t3: added <= C/2
  359|       |     *     t4: added <= D/2
  360|       |     *
  361|       |     * Current bounds: t0..t3 <= C * (m + 1/2)
  362|       |     *                     t4 <= D * (m + 1/2)
  363|       |     */
  364|       |
  365|   406k|    r->n[0] = (t0 >> 1) + ((t1 & one) << 51);
  366|   406k|    r->n[1] = (t1 >> 1) + ((t2 & one) << 51);
  367|   406k|    r->n[2] = (t2 >> 1) + ((t3 & one) << 51);
  368|   406k|    r->n[3] = (t3 >> 1) + ((t4 & one) << 51);
  369|   406k|    r->n[4] = (t4 >> 1);
  370|       |
  371|       |    /* t0..t3: shifted right and added <= C/4 + 1/2
  372|       |     *     t4: shifted right
  373|       |     *
  374|       |     * Current bounds: t0..t3 <= C * (m/2 + 1/2)
  375|       |     *                     t4 <= D * (m/2 + 1/4)
  376|       |     *
  377|       |     * Therefore the output magnitude (M) has to be set such that:
  378|       |     *     t0..t3: C * M >= C * (m/2 + 1/2)
  379|       |     *         t4: D * M >= D * (m/2 + 1/4)
  380|       |     *
  381|       |     * It suffices for all limbs that, for any input magnitude m:
  382|       |     *     M >= m/2 + 1/2
  383|       |     *
  384|       |     * and since we want the smallest such integer value for M:
  385|       |     *     M == floor(m/2) + 1
  386|       |     */
  387|   406k|}
secp256k1.c:secp256k1_fe_impl_inv:
  453|  3.24k|static void secp256k1_fe_impl_inv(secp256k1_fe *r, const secp256k1_fe *x) {
  454|  3.24k|    secp256k1_fe tmp = *x;
  455|  3.24k|    secp256k1_modinv64_signed62 s;
  456|       |
  457|  3.24k|    secp256k1_fe_normalize(&tmp);
  ------------------
  |  |   78|  3.24k|#  define secp256k1_fe_normalize secp256k1_fe_impl_normalize
  ------------------
  458|  3.24k|    secp256k1_fe_to_signed62(&s, &tmp);
  459|  3.24k|    secp256k1_modinv64(&s, &secp256k1_const_modinfo_fe);
  460|  3.24k|    secp256k1_fe_from_signed62(r, &s);
  461|  3.24k|}
secp256k1.c:secp256k1_fe_to_signed62:
  437|  3.24k|static void secp256k1_fe_to_signed62(secp256k1_modinv64_signed62 *r, const secp256k1_fe *a) {
  438|  3.24k|    const uint64_t M62 = UINT64_MAX >> 2;
  439|  3.24k|    const uint64_t a0 = a->n[0], a1 = a->n[1], a2 = a->n[2], a3 = a->n[3], a4 = a->n[4];
  440|       |
  441|  3.24k|    r->v[0] = (a0       | a1 << 52) & M62;
  442|  3.24k|    r->v[1] = (a1 >> 10 | a2 << 42) & M62;
  443|  3.24k|    r->v[2] = (a2 >> 20 | a3 << 32) & M62;
  444|  3.24k|    r->v[3] = (a3 >> 30 | a4 << 22) & M62;
  445|  3.24k|    r->v[4] =  a4 >> 40;
  446|  3.24k|}
secp256k1.c:secp256k1_fe_from_signed62:
  417|  3.24k|static void secp256k1_fe_from_signed62(secp256k1_fe *r, const secp256k1_modinv64_signed62 *a) {
  418|  3.24k|    const uint64_t M52 = UINT64_MAX >> 12;
  419|  3.24k|    const uint64_t a0 = a->v[0], a1 = a->v[1], a2 = a->v[2], a3 = a->v[3], a4 = a->v[4];
  420|       |
  421|       |    /* The output from secp256k1_modinv64{_var} should be normalized to range [0,modulus), and
  422|       |     * have limbs in [0,2^62). The modulus is < 2^256, so the top limb must be below 2^(256-62*4).
  423|       |     */
  424|  3.24k|    VERIFY_CHECK(a0 >> 62 == 0);
  425|  3.24k|    VERIFY_CHECK(a1 >> 62 == 0);
  426|  3.24k|    VERIFY_CHECK(a2 >> 62 == 0);
  427|  3.24k|    VERIFY_CHECK(a3 >> 62 == 0);
  428|  3.24k|    VERIFY_CHECK(a4 >> 8 == 0);
  429|       |
  430|  3.24k|    r->n[0] =  a0                   & M52;
  431|  3.24k|    r->n[1] = (a0 >> 52 | a1 << 10) & M52;
  432|  3.24k|    r->n[2] = (a1 >> 42 | a2 << 20) & M52;
  433|  3.24k|    r->n[3] = (a2 >> 32 | a3 << 30) & M52;
  434|  3.24k|    r->n[4] = (a3 >> 22 | a4 << 40);
  435|  3.24k|}
secp256k1.c:secp256k1_fe_impl_set_b32_limit:
  265|  4.53k|static int secp256k1_fe_impl_set_b32_limit(secp256k1_fe *r, const unsigned char *a) {
  266|  4.53k|    secp256k1_fe_impl_set_b32_mod(r, a);
  267|  4.53k|    return !((r->n[4] == 0x0FFFFFFFFFFFFULL) & ((r->n[3] & r->n[2] & r->n[1]) == 0xFFFFFFFFFFFFFULL) & (r->n[0] >= 0xFFFFEFFFFFC2FULL));
  268|  4.53k|}
secp256k1.c:secp256k1_fe_impl_get_b32:
  271|  3.24k|static void secp256k1_fe_impl_get_b32(unsigned char *r, const secp256k1_fe *a) {
  272|  3.24k|    secp256k1_write_be64(&r[0], (a->n[4] << 16) | (a->n[3] >> 36));
  273|  3.24k|    secp256k1_write_be64(&r[8], (a->n[3] << 28) | (a->n[2] >> 24));
  274|  3.24k|    secp256k1_write_be64(&r[16], (a->n[2] << 40) | (a->n[1] >> 12));
  275|  3.24k|    secp256k1_write_be64(&r[24], (a->n[1] << 52) | a->n[0]);
  276|  3.24k|}
secp256k1.c:secp256k1_fe_impl_normalize_var:
   99|  7.11k|static void secp256k1_fe_impl_normalize_var(secp256k1_fe *r) {
  100|  7.11k|    uint64_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4];
  101|       |
  102|       |    /* Reduce t4 at the start so there will be at most a single carry from the first pass */
  103|  7.11k|    uint64_t m;
  104|  7.11k|    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;
  105|       |
  106|       |    /* The first pass ensures the magnitude is 1, ... */
  107|  7.11k|    t0 += x * 0x1000003D1ULL;
  108|  7.11k|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;
  109|  7.11k|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; m = t1;
  110|  7.11k|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; m &= t2;
  111|  7.11k|    t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL; m &= t3;
  112|       |
  113|       |    /* ... except for a possible carry at bit 48 of t4 (i.e. bit 256 of the field element) */
  114|  7.11k|    VERIFY_CHECK(t4 >> 49 == 0);
  115|       |
  116|       |    /* At most a single final reduction is needed; check if the value is >= the field characteristic */
  117|  7.11k|    x = (t4 >> 48) | ((t4 == 0x0FFFFFFFFFFFFULL) & (m == 0xFFFFFFFFFFFFFULL)
  118|  7.11k|        & (t0 >= 0xFFFFEFFFFFC2FULL));
  119|       |
  120|  7.11k|    if (x) {
  ------------------
  |  Branch (120:9): [True: 0, False: 7.11k]
  ------------------
  121|      0|        t0 += 0x1000003D1ULL;
  122|      0|        t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;
  123|      0|        t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL;
  124|      0|        t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL;
  125|      0|        t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL;
  126|       |
  127|       |        /* If t4 didn't carry to bit 48 already, then it should have after any final reduction */
  128|      0|        VERIFY_CHECK(t4 >> 48 == x);
  129|       |
  130|       |        /* Mask off the possible multiple of 2^256 from the final reduction */
  131|      0|        t4 &= 0x0FFFFFFFFFFFFULL;
  132|      0|    }
  133|       |
  134|  7.11k|    r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;
  135|  7.11k|}
secp256k1.c:secp256k1_fe_impl_is_odd:
  211|  7.78k|SECP256K1_INLINE static int secp256k1_fe_impl_is_odd(const secp256k1_fe *a) {
  212|  7.78k|    return a->n[0] & 1;
  213|  7.78k|}
secp256k1.c:secp256k1_fe_impl_from_storage:
  409|   124k|static SECP256K1_INLINE void secp256k1_fe_impl_from_storage(secp256k1_fe *r, const secp256k1_fe_storage *a) {
  410|   124k|    r->n[0] = a->n[0] & 0xFFFFFFFFFFFFFULL;
  411|   124k|    r->n[1] = a->n[0] >> 52 | ((a->n[1] << 12) & 0xFFFFFFFFFFFFFULL);
  412|   124k|    r->n[2] = a->n[1] >> 40 | ((a->n[2] << 24) & 0xFFFFFFFFFFFFFULL);
  413|   124k|    r->n[3] = a->n[2] >> 28 | ((a->n[3] << 36) & 0xFFFFFFFFFFFFFULL);
  414|   124k|    r->n[4] = a->n[3] >> 16;
  415|   124k|}
secp256k1.c:secp256k1_fe_impl_normalizes_to_zero_var:
  160|  77.8k|static int secp256k1_fe_impl_normalizes_to_zero_var(const secp256k1_fe *r) {
  161|  77.8k|    uint64_t t0, t1, t2, t3, t4;
  162|  77.8k|    uint64_t z0, z1;
  163|  77.8k|    uint64_t x;
  164|       |
  165|  77.8k|    t0 = r->n[0];
  166|  77.8k|    t4 = r->n[4];
  167|       |
  168|       |    /* Reduce t4 at the start so there will be at most a single carry from the first pass */
  169|  77.8k|    x = t4 >> 48;
  170|       |
  171|       |    /* The first pass ensures the magnitude is 1, ... */
  172|  77.8k|    t0 += x * 0x1000003D1ULL;
  173|       |
  174|       |    /* z0 tracks a possible raw value of 0, z1 tracks a possible raw value of P */
  175|  77.8k|    z0 = t0 & 0xFFFFFFFFFFFFFULL;
  176|  77.8k|    z1 = z0 ^ 0x1000003D0ULL;
  177|       |
  178|       |    /* Fast return path should catch the majority of cases */
  179|  77.8k|    if ((z0 != 0ULL) & (z1 != 0xFFFFFFFFFFFFFULL)) {
  ------------------
  |  Branch (179:9): [True: 77.8k, False: 0]
  ------------------
  180|  77.8k|        return 0;
  181|  77.8k|    }
  182|       |
  183|      0|    t1 = r->n[1];
  184|      0|    t2 = r->n[2];
  185|      0|    t3 = r->n[3];
  186|       |
  187|      0|    t4 &= 0x0FFFFFFFFFFFFULL;
  188|       |
  189|      0|    t1 += (t0 >> 52);
  190|      0|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; z0 |= t1; z1 &= t1;
  191|      0|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; z0 |= t2; z1 &= t2;
  192|      0|    t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL; z0 |= t3; z1 &= t3;
  193|      0|                                                z0 |= t4; z1 &= t4 ^ 0xF000000000000ULL;
  194|       |
  195|       |    /* ... except for a possible carry at bit 48 of t4 (i.e. bit 256 of the field element) */
  196|      0|    VERIFY_CHECK(t4 >> 49 == 0);
  197|       |
  198|      0|    return (z0 == 0) | (z1 == 0xFFFFFFFFFFFFFULL);
  199|  77.8k|}
secp256k1.c:secp256k1_fe_impl_set_b32_mod:
  228|  4.53k|static void secp256k1_fe_impl_set_b32_mod(secp256k1_fe *r, const unsigned char *a) {
  229|  4.53k|    r->n[0] = (uint64_t)a[31]
  230|  4.53k|            | ((uint64_t)a[30] << 8)
  231|  4.53k|            | ((uint64_t)a[29] << 16)
  232|  4.53k|            | ((uint64_t)a[28] << 24)
  233|  4.53k|            | ((uint64_t)a[27] << 32)
  234|  4.53k|            | ((uint64_t)a[26] << 40)
  235|  4.53k|            | ((uint64_t)(a[25] & 0xF)  << 48);
  236|  4.53k|    r->n[1] = (uint64_t)((a[25] >> 4) & 0xF)
  237|  4.53k|            | ((uint64_t)a[24] << 4)
  238|  4.53k|            | ((uint64_t)a[23] << 12)
  239|  4.53k|            | ((uint64_t)a[22] << 20)
  240|  4.53k|            | ((uint64_t)a[21] << 28)
  241|  4.53k|            | ((uint64_t)a[20] << 36)
  242|  4.53k|            | ((uint64_t)a[19] << 44);
  243|  4.53k|    r->n[2] = (uint64_t)a[18]
  244|  4.53k|            | ((uint64_t)a[17] << 8)
  245|  4.53k|            | ((uint64_t)a[16] << 16)
  246|  4.53k|            | ((uint64_t)a[15] << 24)
  247|  4.53k|            | ((uint64_t)a[14] << 32)
  248|  4.53k|            | ((uint64_t)a[13] << 40)
  249|  4.53k|            | ((uint64_t)(a[12] & 0xF) << 48);
  250|  4.53k|    r->n[3] = (uint64_t)((a[12] >> 4) & 0xF)
  251|  4.53k|            | ((uint64_t)a[11] << 4)
  252|  4.53k|            | ((uint64_t)a[10] << 12)
  253|  4.53k|            | ((uint64_t)a[9]  << 20)
  254|  4.53k|            | ((uint64_t)a[8]  << 28)
  255|  4.53k|            | ((uint64_t)a[7]  << 36)
  256|  4.53k|            | ((uint64_t)a[6]  << 44);
  257|  4.53k|    r->n[4] = (uint64_t)a[5]
  258|  4.53k|            | ((uint64_t)a[4] << 8)
  259|  4.53k|            | ((uint64_t)a[3] << 16)
  260|  4.53k|            | ((uint64_t)a[2] << 24)
  261|  4.53k|            | ((uint64_t)a[1] << 32)
  262|  4.53k|            | ((uint64_t)a[0] << 40);
  263|  4.53k|}
secp256k1.c:secp256k1_fe_impl_normalize:
   43|  20.1k|static void secp256k1_fe_impl_normalize(secp256k1_fe *r) {
   44|  20.1k|    uint64_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4];
   45|       |
   46|       |    /* Reduce t4 at the start so there will be at most a single carry from the first pass */
   47|  20.1k|    uint64_t m;
   48|  20.1k|    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;
   49|       |
   50|       |    /* The first pass ensures the magnitude is 1, ... */
   51|  20.1k|    t0 += x * 0x1000003D1ULL;
   52|  20.1k|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;
   53|  20.1k|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; m = t1;
   54|  20.1k|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; m &= t2;
   55|  20.1k|    t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL; m &= t3;
   56|       |
   57|       |    /* ... except for a possible carry at bit 48 of t4 (i.e. bit 256 of the field element) */
   58|  20.1k|    VERIFY_CHECK(t4 >> 49 == 0);
   59|       |
   60|       |    /* At most a single final reduction is needed; check if the value is >= the field characteristic */
   61|  20.1k|    x = (t4 >> 48) | ((t4 == 0x0FFFFFFFFFFFFULL) & (m == 0xFFFFFFFFFFFFFULL)
   62|  20.1k|        & (t0 >= 0xFFFFEFFFFFC2FULL));
   63|       |
   64|       |    /* Apply the final reduction (for constant-time behaviour, we do it always) */
   65|  20.1k|    t0 += x * 0x1000003D1ULL;
   66|  20.1k|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;
   67|  20.1k|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL;
   68|  20.1k|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL;
   69|  20.1k|    t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL;
   70|       |
   71|       |    /* If t4 didn't carry to bit 48 already, then it should have after any final reduction */
   72|  20.1k|    VERIFY_CHECK(t4 >> 48 == x);
   73|       |
   74|       |    /* Mask off the possible multiple of 2^256 from the final reduction */
   75|  20.1k|    t4 &= 0x0FFFFFFFFFFFFULL;
   76|       |
   77|  20.1k|    r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;
   78|  20.1k|}
secp256k1.c:secp256k1_fe_impl_to_storage:
  402|  16.8k|static void secp256k1_fe_impl_to_storage(secp256k1_fe_storage *r, const secp256k1_fe *a) {
  403|  16.8k|    r->n[0] = a->n[0] | a->n[1] << 52;
  404|  16.8k|    r->n[1] = a->n[1] >> 12 | a->n[2] << 40;
  405|  16.8k|    r->n[2] = a->n[2] >> 24 | a->n[3] << 28;
  406|  16.8k|    r->n[3] = a->n[3] >> 36 | a->n[4] << 16;
  407|  16.8k|}

secp256k1.c:secp256k1_fe_sqr_inner:
  154|  3.04M|SECP256K1_FORCE_INLINE static void secp256k1_fe_sqr_inner(uint64_t *r, const uint64_t *a) {
  155|  3.04M|    secp256k1_uint128 c, d;
  156|  3.04M|    uint64_t a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4];
  157|  3.04M|    uint64_t t3, t4, tx, u0;
  158|  3.04M|    const uint64_t M = 0xFFFFFFFFFFFFFULL, R = 0x1000003D10ULL;
  159|       |
  160|  3.04M|    VERIFY_BITS(a[0], 56);
  161|  3.04M|    VERIFY_BITS(a[1], 56);
  162|  3.04M|    VERIFY_BITS(a[2], 56);
  163|  3.04M|    VERIFY_BITS(a[3], 56);
  164|  3.04M|    VERIFY_BITS(a[4], 52);
  165|       |
  166|       |    /**  [... a b c] is a shorthand for ... + a<<104 + b<<52 + c<<0 mod n.
  167|       |     *  px is a shorthand for sum(a[i]*a[x-i], i=0..x).
  168|       |     *  Note that [x 0 0 0 0 0] = [x*R].
  169|       |     */
  170|       |
  171|  3.04M|    secp256k1_u128_mul(&d, a0*2, a3);
  172|  3.04M|    secp256k1_u128_accum_mul(&d, a1*2, a2);
  173|  3.04M|    VERIFY_BITS_128(&d, 114);
  174|       |    /* [d 0 0 0] = [p3 0 0 0] */
  175|  3.04M|    secp256k1_u128_mul(&c, a4, a4);
  176|  3.04M|    VERIFY_BITS_128(&c, 112);
  177|       |    /* [c 0 0 0 0 d 0 0 0] = [p8 0 0 0 0 p3 0 0 0] */
  178|  3.04M|    secp256k1_u128_accum_mul(&d, R, secp256k1_u128_to_u64(&c)); secp256k1_u128_rshift(&c, 64);
  179|  3.04M|    VERIFY_BITS_128(&d, 115);
  180|  3.04M|    VERIFY_BITS_128(&c, 48);
  181|       |    /* [(c<<12) 0 0 0 0 0 d 0 0 0] = [p8 0 0 0 0 p3 0 0 0] */
  182|  3.04M|    t3 = secp256k1_u128_to_u64(&d) & M; secp256k1_u128_rshift(&d, 52);
  183|  3.04M|    VERIFY_BITS(t3, 52);
  184|  3.04M|    VERIFY_BITS_128(&d, 63);
  185|       |    /* [(c<<12) 0 0 0 0 d t3 0 0 0] = [p8 0 0 0 0 p3 0 0 0] */
  186|       |
  187|  3.04M|    a4 *= 2;
  188|  3.04M|    secp256k1_u128_accum_mul(&d, a0, a4);
  189|  3.04M|    secp256k1_u128_accum_mul(&d, a1*2, a3);
  190|  3.04M|    secp256k1_u128_accum_mul(&d, a2, a2);
  191|  3.04M|    VERIFY_BITS_128(&d, 115);
  192|       |    /* [(c<<12) 0 0 0 0 d t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */
  193|  3.04M|    secp256k1_u128_accum_mul(&d, R << 12, secp256k1_u128_to_u64(&c));
  194|  3.04M|    VERIFY_BITS_128(&d, 116);
  195|       |    /* [d t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */
  196|  3.04M|    t4 = secp256k1_u128_to_u64(&d) & M; secp256k1_u128_rshift(&d, 52);
  197|  3.04M|    VERIFY_BITS(t4, 52);
  198|  3.04M|    VERIFY_BITS_128(&d, 64);
  199|       |    /* [d t4 t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */
  200|  3.04M|    tx = (t4 >> 48); t4 &= (M >> 4);
  201|  3.04M|    VERIFY_BITS(tx, 4);
  202|  3.04M|    VERIFY_BITS(t4, 48);
  203|       |    /* [d t4+(tx<<48) t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */
  204|       |
  205|  3.04M|    secp256k1_u128_mul(&c, a0, a0);
  206|  3.04M|    VERIFY_BITS_128(&c, 112);
  207|       |    /* [d t4+(tx<<48) t3 0 0 c] = [p8 0 0 0 p4 p3 0 0 p0] */
  208|  3.04M|    secp256k1_u128_accum_mul(&d, a1, a4);
  209|  3.04M|    secp256k1_u128_accum_mul(&d, a2*2, a3);
  210|  3.04M|    VERIFY_BITS_128(&d, 114);
  211|       |    /* [d t4+(tx<<48) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */
  212|  3.04M|    u0 = secp256k1_u128_to_u64(&d) & M; secp256k1_u128_rshift(&d, 52);
  213|  3.04M|    VERIFY_BITS(u0, 52);
  214|  3.04M|    VERIFY_BITS_128(&d, 62);
  215|       |    /* [d u0 t4+(tx<<48) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */
  216|       |    /* [d 0 t4+(tx<<48)+(u0<<52) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */
  217|  3.04M|    u0 = (u0 << 4) | tx;
  218|  3.04M|    VERIFY_BITS(u0, 56);
  219|       |    /* [d 0 t4+(u0<<48) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */
  220|  3.04M|    secp256k1_u128_accum_mul(&c, u0, R >> 4);
  221|  3.04M|    VERIFY_BITS_128(&c, 113);
  222|       |    /* [d 0 t4 t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */
  223|  3.04M|    r[0] = secp256k1_u128_to_u64(&c) & M; secp256k1_u128_rshift(&c, 52);
  224|  3.04M|    VERIFY_BITS(r[0], 52);
  225|  3.04M|    VERIFY_BITS_128(&c, 61);
  226|       |    /* [d 0 t4 t3 0 c r0] = [p8 0 0 p5 p4 p3 0 0 p0] */
  227|       |
  228|  3.04M|    a0 *= 2;
  229|  3.04M|    secp256k1_u128_accum_mul(&c, a0, a1);
  230|  3.04M|    VERIFY_BITS_128(&c, 114);
  231|       |    /* [d 0 t4 t3 0 c r0] = [p8 0 0 p5 p4 p3 0 p1 p0] */
  232|  3.04M|    secp256k1_u128_accum_mul(&d, a2, a4);
  233|  3.04M|    secp256k1_u128_accum_mul(&d, a3, a3);
  234|  3.04M|    VERIFY_BITS_128(&d, 114);
  235|       |    /* [d 0 t4 t3 0 c r0] = [p8 0 p6 p5 p4 p3 0 p1 p0] */
  236|  3.04M|    secp256k1_u128_accum_mul(&c, secp256k1_u128_to_u64(&d) & M, R); secp256k1_u128_rshift(&d, 52);
  237|  3.04M|    VERIFY_BITS_128(&c, 115);
  238|  3.04M|    VERIFY_BITS_128(&d, 62);
  239|       |    /* [d 0 0 t4 t3 0 c r0] = [p8 0 p6 p5 p4 p3 0 p1 p0] */
  240|  3.04M|    r[1] = secp256k1_u128_to_u64(&c) & M; secp256k1_u128_rshift(&c, 52);
  241|  3.04M|    VERIFY_BITS(r[1], 52);
  242|  3.04M|    VERIFY_BITS_128(&c, 63);
  243|       |    /* [d 0 0 t4 t3 c r1 r0] = [p8 0 p6 p5 p4 p3 0 p1 p0] */
  244|       |
  245|  3.04M|    secp256k1_u128_accum_mul(&c, a0, a2);
  246|  3.04M|    secp256k1_u128_accum_mul(&c, a1, a1);
  247|  3.04M|    VERIFY_BITS_128(&c, 114);
  248|       |    /* [d 0 0 t4 t3 c r1 r0] = [p8 0 p6 p5 p4 p3 p2 p1 p0] */
  249|  3.04M|    secp256k1_u128_accum_mul(&d, a3, a4);
  250|  3.04M|    VERIFY_BITS_128(&d, 114);
  251|       |    /* [d 0 0 t4 t3 c r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */
  252|  3.04M|    secp256k1_u128_accum_mul(&c, R, secp256k1_u128_to_u64(&d)); secp256k1_u128_rshift(&d, 64);
  253|  3.04M|    VERIFY_BITS_128(&c, 115);
  254|  3.04M|    VERIFY_BITS_128(&d, 50);
  255|       |    /* [(d<<12) 0 0 0 t4 t3 c r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */
  256|  3.04M|    r[2] = secp256k1_u128_to_u64(&c) & M; secp256k1_u128_rshift(&c, 52);
  257|  3.04M|    VERIFY_BITS(r[2], 52);
  258|  3.04M|    VERIFY_BITS_128(&c, 63);
  259|       |    /* [(d<<12) 0 0 0 t4 t3+c r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */
  260|       |
  261|  3.04M|    secp256k1_u128_accum_mul(&c, R << 12, secp256k1_u128_to_u64(&d));
  262|  3.04M|    secp256k1_u128_accum_u64(&c, t3);
  263|  3.04M|    VERIFY_BITS_128(&c, 100);
  264|       |    /* [t4 c r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */
  265|  3.04M|    r[3] = secp256k1_u128_to_u64(&c) & M; secp256k1_u128_rshift(&c, 52);
  266|  3.04M|    VERIFY_BITS(r[3], 52);
  267|  3.04M|    VERIFY_BITS_128(&c, 48);
  268|       |    /* [t4+c r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */
  269|  3.04M|    r[4] = secp256k1_u128_to_u64(&c) + t4;
  270|  3.04M|    VERIFY_BITS(r[4], 49);
  271|       |    /* [r4 r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */
  272|  3.04M|}
secp256k1.c:secp256k1_fe_mul_inner:
   18|  2.10M|SECP256K1_FORCE_INLINE static void secp256k1_fe_mul_inner(uint64_t *r, const uint64_t *a, const uint64_t * SECP256K1_RESTRICT b) {
   19|  2.10M|    secp256k1_uint128 c, d;
   20|  2.10M|    uint64_t t3, t4, tx, u0;
   21|  2.10M|    uint64_t a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4];
   22|  2.10M|    const uint64_t M = 0xFFFFFFFFFFFFFULL, R = 0x1000003D10ULL;
   23|       |
   24|  2.10M|    VERIFY_BITS(a[0], 56);
   25|  2.10M|    VERIFY_BITS(a[1], 56);
   26|  2.10M|    VERIFY_BITS(a[2], 56);
   27|  2.10M|    VERIFY_BITS(a[3], 56);
   28|  2.10M|    VERIFY_BITS(a[4], 52);
   29|  2.10M|    VERIFY_BITS(b[0], 56);
   30|  2.10M|    VERIFY_BITS(b[1], 56);
   31|  2.10M|    VERIFY_BITS(b[2], 56);
   32|  2.10M|    VERIFY_BITS(b[3], 56);
   33|  2.10M|    VERIFY_BITS(b[4], 52);
   34|  2.10M|    VERIFY_CHECK(r != b);
   35|  2.10M|    VERIFY_CHECK(a != b);
   36|       |
   37|       |    /*  [... a b c] is a shorthand for ... + a<<104 + b<<52 + c<<0 mod n.
   38|       |     *  for 0 <= x <= 4, px is a shorthand for sum(a[i]*b[x-i], i=0..x).
   39|       |     *  for 4 <= x <= 8, px is a shorthand for sum(a[i]*b[x-i], i=(x-4)..4)
   40|       |     *  Note that [x 0 0 0 0 0] = [x*R].
   41|       |     */
   42|       |
   43|  2.10M|    secp256k1_u128_mul(&d, a0, b[3]);
   44|  2.10M|    secp256k1_u128_accum_mul(&d, a1, b[2]);
   45|  2.10M|    secp256k1_u128_accum_mul(&d, a2, b[1]);
   46|  2.10M|    secp256k1_u128_accum_mul(&d, a3, b[0]);
   47|  2.10M|    VERIFY_BITS_128(&d, 114);
   48|       |    /* [d 0 0 0] = [p3 0 0 0] */
   49|  2.10M|    secp256k1_u128_mul(&c, a4, b[4]);
   50|  2.10M|    VERIFY_BITS_128(&c, 112);
   51|       |    /* [c 0 0 0 0 d 0 0 0] = [p8 0 0 0 0 p3 0 0 0] */
   52|  2.10M|    secp256k1_u128_accum_mul(&d, R, secp256k1_u128_to_u64(&c)); secp256k1_u128_rshift(&c, 64);
   53|  2.10M|    VERIFY_BITS_128(&d, 115);
   54|  2.10M|    VERIFY_BITS_128(&c, 48);
   55|       |    /* [(c<<12) 0 0 0 0 0 d 0 0 0] = [p8 0 0 0 0 p3 0 0 0] */
   56|  2.10M|    t3 = secp256k1_u128_to_u64(&d) & M; secp256k1_u128_rshift(&d, 52);
   57|  2.10M|    VERIFY_BITS(t3, 52);
   58|  2.10M|    VERIFY_BITS_128(&d, 63);
   59|       |    /* [(c<<12) 0 0 0 0 d t3 0 0 0] = [p8 0 0 0 0 p3 0 0 0] */
   60|       |
   61|  2.10M|    secp256k1_u128_accum_mul(&d, a0, b[4]);
   62|  2.10M|    secp256k1_u128_accum_mul(&d, a1, b[3]);
   63|  2.10M|    secp256k1_u128_accum_mul(&d, a2, b[2]);
   64|  2.10M|    secp256k1_u128_accum_mul(&d, a3, b[1]);
   65|  2.10M|    secp256k1_u128_accum_mul(&d, a4, b[0]);
   66|  2.10M|    VERIFY_BITS_128(&d, 115);
   67|       |    /* [(c<<12) 0 0 0 0 d t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */
   68|  2.10M|    secp256k1_u128_accum_mul(&d, R << 12, secp256k1_u128_to_u64(&c));
   69|  2.10M|    VERIFY_BITS_128(&d, 116);
   70|       |    /* [d t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */
   71|  2.10M|    t4 = secp256k1_u128_to_u64(&d) & M; secp256k1_u128_rshift(&d, 52);
   72|  2.10M|    VERIFY_BITS(t4, 52);
   73|  2.10M|    VERIFY_BITS_128(&d, 64);
   74|       |    /* [d t4 t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */
   75|  2.10M|    tx = (t4 >> 48); t4 &= (M >> 4);
   76|  2.10M|    VERIFY_BITS(tx, 4);
   77|  2.10M|    VERIFY_BITS(t4, 48);
   78|       |    /* [d t4+(tx<<48) t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */
   79|       |
   80|  2.10M|    secp256k1_u128_mul(&c, a0, b[0]);
   81|  2.10M|    VERIFY_BITS_128(&c, 112);
   82|       |    /* [d t4+(tx<<48) t3 0 0 c] = [p8 0 0 0 p4 p3 0 0 p0] */
   83|  2.10M|    secp256k1_u128_accum_mul(&d, a1, b[4]);
   84|  2.10M|    secp256k1_u128_accum_mul(&d, a2, b[3]);
   85|  2.10M|    secp256k1_u128_accum_mul(&d, a3, b[2]);
   86|  2.10M|    secp256k1_u128_accum_mul(&d, a4, b[1]);
   87|  2.10M|    VERIFY_BITS_128(&d, 114);
   88|       |    /* [d t4+(tx<<48) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */
   89|  2.10M|    u0 = secp256k1_u128_to_u64(&d) & M; secp256k1_u128_rshift(&d, 52);
   90|  2.10M|    VERIFY_BITS(u0, 52);
   91|  2.10M|    VERIFY_BITS_128(&d, 62);
   92|       |    /* [d u0 t4+(tx<<48) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */
   93|       |    /* [d 0 t4+(tx<<48)+(u0<<52) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */
   94|  2.10M|    u0 = (u0 << 4) | tx;
   95|  2.10M|    VERIFY_BITS(u0, 56);
   96|       |    /* [d 0 t4+(u0<<48) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */
   97|  2.10M|    secp256k1_u128_accum_mul(&c, u0, R >> 4);
   98|  2.10M|    VERIFY_BITS_128(&c, 113);
   99|       |    /* [d 0 t4 t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */
  100|  2.10M|    r[0] = secp256k1_u128_to_u64(&c) & M; secp256k1_u128_rshift(&c, 52);
  101|  2.10M|    VERIFY_BITS(r[0], 52);
  102|  2.10M|    VERIFY_BITS_128(&c, 61);
  103|       |    /* [d 0 t4 t3 0 c r0] = [p8 0 0 p5 p4 p3 0 0 p0] */
  104|       |
  105|  2.10M|    secp256k1_u128_accum_mul(&c, a0, b[1]);
  106|  2.10M|    secp256k1_u128_accum_mul(&c, a1, b[0]);
  107|  2.10M|    VERIFY_BITS_128(&c, 114);
  108|       |    /* [d 0 t4 t3 0 c r0] = [p8 0 0 p5 p4 p3 0 p1 p0] */
  109|  2.10M|    secp256k1_u128_accum_mul(&d, a2, b[4]);
  110|  2.10M|    secp256k1_u128_accum_mul(&d, a3, b[3]);
  111|  2.10M|    secp256k1_u128_accum_mul(&d, a4, b[2]);
  112|  2.10M|    VERIFY_BITS_128(&d, 114);
  113|       |    /* [d 0 t4 t3 0 c r0] = [p8 0 p6 p5 p4 p3 0 p1 p0] */
  114|  2.10M|    secp256k1_u128_accum_mul(&c, secp256k1_u128_to_u64(&d) & M, R); secp256k1_u128_rshift(&d, 52);
  115|  2.10M|    VERIFY_BITS_128(&c, 115);
  116|  2.10M|    VERIFY_BITS_128(&d, 62);
  117|       |    /* [d 0 0 t4 t3 0 c r0] = [p8 0 p6 p5 p4 p3 0 p1 p0] */
  118|  2.10M|    r[1] = secp256k1_u128_to_u64(&c) & M; secp256k1_u128_rshift(&c, 52);
  119|  2.10M|    VERIFY_BITS(r[1], 52);
  120|  2.10M|    VERIFY_BITS_128(&c, 63);
  121|       |    /* [d 0 0 t4 t3 c r1 r0] = [p8 0 p6 p5 p4 p3 0 p1 p0] */
  122|       |
  123|  2.10M|    secp256k1_u128_accum_mul(&c, a0, b[2]);
  124|  2.10M|    secp256k1_u128_accum_mul(&c, a1, b[1]);
  125|  2.10M|    secp256k1_u128_accum_mul(&c, a2, b[0]);
  126|  2.10M|    VERIFY_BITS_128(&c, 114);
  127|       |    /* [d 0 0 t4 t3 c r1 r0] = [p8 0 p6 p5 p4 p3 p2 p1 p0] */
  128|  2.10M|    secp256k1_u128_accum_mul(&d, a3, b[4]);
  129|  2.10M|    secp256k1_u128_accum_mul(&d, a4, b[3]);
  130|  2.10M|    VERIFY_BITS_128(&d, 114);
  131|       |    /* [d 0 0 t4 t3 c t1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */
  132|  2.10M|    secp256k1_u128_accum_mul(&c, R, secp256k1_u128_to_u64(&d)); secp256k1_u128_rshift(&d, 64);
  133|  2.10M|    VERIFY_BITS_128(&c, 115);
  134|  2.10M|    VERIFY_BITS_128(&d, 50);
  135|       |    /* [(d<<12) 0 0 0 t4 t3 c r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */
  136|       |
  137|  2.10M|    r[2] = secp256k1_u128_to_u64(&c) & M; secp256k1_u128_rshift(&c, 52);
  138|  2.10M|    VERIFY_BITS(r[2], 52);
  139|  2.10M|    VERIFY_BITS_128(&c, 63);
  140|       |    /* [(d<<12) 0 0 0 t4 t3+c r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */
  141|  2.10M|    secp256k1_u128_accum_mul(&c, R << 12, secp256k1_u128_to_u64(&d));
  142|  2.10M|    secp256k1_u128_accum_u64(&c, t3);
  143|  2.10M|    VERIFY_BITS_128(&c, 100);
  144|       |    /* [t4 c r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */
  145|  2.10M|    r[3] = secp256k1_u128_to_u64(&c) & M; secp256k1_u128_rshift(&c, 52);
  146|  2.10M|    VERIFY_BITS(r[3], 52);
  147|  2.10M|    VERIFY_BITS_128(&c, 48);
  148|       |    /* [t4+c r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */
  149|  2.10M|    r[4] = secp256k1_u128_to_u64(&c) + t4;
  150|  2.10M|    VERIFY_BITS(r[4], 49);
  151|       |    /* [r4 r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */
  152|  2.10M|}

secp256k1.c:secp256k1_fe_verify:
  149|  6.12M|static void secp256k1_fe_verify(const secp256k1_fe *a) { (void)a; }
secp256k1.c:secp256k1_fe_verify_magnitude:
  150|  5.96M|static void secp256k1_fe_verify_magnitude(const secp256k1_fe *a, int m) { (void)a; (void)m; }
secp256k1.c:secp256k1_fe_sqrt:
   37|  4.53k|static int secp256k1_fe_sqrt(secp256k1_fe * SECP256K1_RESTRICT r, const secp256k1_fe * SECP256K1_RESTRICT a) {
   38|       |    /** Given that p is congruent to 3 mod 4, we can compute the square root of
   39|       |     *  a mod p as the (p+1)/4'th power of a.
   40|       |     *
   41|       |     *  As (p+1)/4 is an even number, it will have the same result for a and for
   42|       |     *  (-a). Only one of these two numbers actually has a square root however,
   43|       |     *  so we test at the end by squaring and comparing to the input.
   44|       |     *  Also because (p+1)/4 is an even number, the computed square root is
   45|       |     *  itself always a square (a ** ((p+1)/4) is the square of a ** ((p+1)/8)).
   46|       |     */
   47|  4.53k|    secp256k1_fe x2, x3, x6, x9, x11, x22, x44, x88, x176, x220, x223, t1;
   48|  4.53k|    int j, ret;
   49|       |
   50|  4.53k|    VERIFY_CHECK(r != a);
   51|  4.53k|    SECP256K1_FE_VERIFY(a);
  ------------------
  |  |  345|  4.53k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   52|  4.53k|    SECP256K1_FE_VERIFY_MAGNITUDE(a, 8);
  ------------------
  |  |  349|  4.53k|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   53|       |
   54|       |    /** The binary representation of (p + 1)/4 has 3 blocks of 1s, with lengths in
   55|       |     *  { 2, 22, 223 }. Use an addition chain to calculate 2^n - 1 for each block:
   56|       |     *  1, [2], 3, 6, 9, 11, [22], 44, 88, 176, 220, [223]
   57|       |     */
   58|       |
   59|  4.53k|    secp256k1_fe_sqr(&x2, a);
  ------------------
  |  |   94|  4.53k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   60|  4.53k|    secp256k1_fe_mul(&x2, &x2, a);
  ------------------
  |  |   93|  4.53k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
   61|       |
   62|  4.53k|    secp256k1_fe_sqr(&x3, &x2);
  ------------------
  |  |   94|  4.53k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   63|  4.53k|    secp256k1_fe_mul(&x3, &x3, a);
  ------------------
  |  |   93|  4.53k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
   64|       |
   65|  4.53k|    x6 = x3;
   66|  18.1k|    for (j=0; j<3; j++) {
  ------------------
  |  Branch (66:15): [True: 13.6k, False: 4.53k]
  ------------------
   67|  13.6k|        secp256k1_fe_sqr(&x6, &x6);
  ------------------
  |  |   94|  13.6k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   68|  13.6k|    }
   69|  4.53k|    secp256k1_fe_mul(&x6, &x6, &x3);
  ------------------
  |  |   93|  4.53k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
   70|       |
   71|  4.53k|    x9 = x6;
   72|  18.1k|    for (j=0; j<3; j++) {
  ------------------
  |  Branch (72:15): [True: 13.6k, False: 4.53k]
  ------------------
   73|  13.6k|        secp256k1_fe_sqr(&x9, &x9);
  ------------------
  |  |   94|  13.6k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   74|  13.6k|    }
   75|  4.53k|    secp256k1_fe_mul(&x9, &x9, &x3);
  ------------------
  |  |   93|  4.53k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
   76|       |
   77|  4.53k|    x11 = x9;
   78|  13.6k|    for (j=0; j<2; j++) {
  ------------------
  |  Branch (78:15): [True: 9.07k, False: 4.53k]
  ------------------
   79|  9.07k|        secp256k1_fe_sqr(&x11, &x11);
  ------------------
  |  |   94|  9.07k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   80|  9.07k|    }
   81|  4.53k|    secp256k1_fe_mul(&x11, &x11, &x2);
  ------------------
  |  |   93|  4.53k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
   82|       |
   83|  4.53k|    x22 = x11;
   84|  54.4k|    for (j=0; j<11; j++) {
  ------------------
  |  Branch (84:15): [True: 49.9k, False: 4.53k]
  ------------------
   85|  49.9k|        secp256k1_fe_sqr(&x22, &x22);
  ------------------
  |  |   94|  49.9k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   86|  49.9k|    }
   87|  4.53k|    secp256k1_fe_mul(&x22, &x22, &x11);
  ------------------
  |  |   93|  4.53k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
   88|       |
   89|  4.53k|    x44 = x22;
   90|   104k|    for (j=0; j<22; j++) {
  ------------------
  |  Branch (90:15): [True: 99.8k, False: 4.53k]
  ------------------
   91|  99.8k|        secp256k1_fe_sqr(&x44, &x44);
  ------------------
  |  |   94|  99.8k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   92|  99.8k|    }
   93|  4.53k|    secp256k1_fe_mul(&x44, &x44, &x22);
  ------------------
  |  |   93|  4.53k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
   94|       |
   95|  4.53k|    x88 = x44;
   96|   204k|    for (j=0; j<44; j++) {
  ------------------
  |  Branch (96:15): [True: 199k, False: 4.53k]
  ------------------
   97|   199k|        secp256k1_fe_sqr(&x88, &x88);
  ------------------
  |  |   94|   199k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   98|   199k|    }
   99|  4.53k|    secp256k1_fe_mul(&x88, &x88, &x44);
  ------------------
  |  |   93|  4.53k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  100|       |
  101|  4.53k|    x176 = x88;
  102|   403k|    for (j=0; j<88; j++) {
  ------------------
  |  Branch (102:15): [True: 399k, False: 4.53k]
  ------------------
  103|   399k|        secp256k1_fe_sqr(&x176, &x176);
  ------------------
  |  |   94|   399k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  104|   399k|    }
  105|  4.53k|    secp256k1_fe_mul(&x176, &x176, &x88);
  ------------------
  |  |   93|  4.53k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  106|       |
  107|  4.53k|    x220 = x176;
  108|   204k|    for (j=0; j<44; j++) {
  ------------------
  |  Branch (108:15): [True: 199k, False: 4.53k]
  ------------------
  109|   199k|        secp256k1_fe_sqr(&x220, &x220);
  ------------------
  |  |   94|   199k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  110|   199k|    }
  111|  4.53k|    secp256k1_fe_mul(&x220, &x220, &x44);
  ------------------
  |  |   93|  4.53k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  112|       |
  113|  4.53k|    x223 = x220;
  114|  18.1k|    for (j=0; j<3; j++) {
  ------------------
  |  Branch (114:15): [True: 13.6k, False: 4.53k]
  ------------------
  115|  13.6k|        secp256k1_fe_sqr(&x223, &x223);
  ------------------
  |  |   94|  13.6k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  116|  13.6k|    }
  117|  4.53k|    secp256k1_fe_mul(&x223, &x223, &x3);
  ------------------
  |  |   93|  4.53k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  118|       |
  119|       |    /* The final result is then assembled using a sliding window over the blocks. */
  120|       |
  121|  4.53k|    t1 = x223;
  122|   108k|    for (j=0; j<23; j++) {
  ------------------
  |  Branch (122:15): [True: 104k, False: 4.53k]
  ------------------
  123|   104k|        secp256k1_fe_sqr(&t1, &t1);
  ------------------
  |  |   94|   104k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  124|   104k|    }
  125|  4.53k|    secp256k1_fe_mul(&t1, &t1, &x22);
  ------------------
  |  |   93|  4.53k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  126|  31.7k|    for (j=0; j<6; j++) {
  ------------------
  |  Branch (126:15): [True: 27.2k, False: 4.53k]
  ------------------
  127|  27.2k|        secp256k1_fe_sqr(&t1, &t1);
  ------------------
  |  |   94|  27.2k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  128|  27.2k|    }
  129|  4.53k|    secp256k1_fe_mul(&t1, &t1, &x2);
  ------------------
  |  |   93|  4.53k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  130|  4.53k|    secp256k1_fe_sqr(&t1, &t1);
  ------------------
  |  |   94|  4.53k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  131|  4.53k|    secp256k1_fe_sqr(r, &t1);
  ------------------
  |  |   94|  4.53k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  132|       |
  133|       |    /* Check that a square root was actually calculated */
  134|       |
  135|  4.53k|    secp256k1_fe_sqr(&t1, r);
  ------------------
  |  |   94|  4.53k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  136|  4.53k|    ret = secp256k1_fe_equal(&t1, a);
  137|       |
  138|       |#ifdef VERIFY
  139|       |    if (!ret) {
  140|       |        secp256k1_fe_negate(&t1, &t1, 1);
  141|       |        secp256k1_fe_normalize_var(&t1);
  142|       |        VERIFY_CHECK(secp256k1_fe_equal(&t1, a));
  143|       |    }
  144|       |#endif
  145|  4.53k|    return ret;
  146|  4.53k|}
secp256k1.c:secp256k1_fe_equal:
   25|  4.53k|SECP256K1_INLINE static int secp256k1_fe_equal(const secp256k1_fe *a, const secp256k1_fe *b) {
   26|  4.53k|    secp256k1_fe na;
   27|  4.53k|    SECP256K1_FE_VERIFY(a);
  ------------------
  |  |  345|  4.53k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   28|  4.53k|    SECP256K1_FE_VERIFY(b);
  ------------------
  |  |  345|  4.53k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   29|  4.53k|    SECP256K1_FE_VERIFY_MAGNITUDE(a, 1);
  ------------------
  |  |  349|  4.53k|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   30|  4.53k|    SECP256K1_FE_VERIFY_MAGNITUDE(b, 30);
  ------------------
  |  |  349|  4.53k|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   31|       |
   32|  4.53k|    secp256k1_fe_negate(&na, a, 1);
  ------------------
  |  |  211|  4.53k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  4.53k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  4.53k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 4.53k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  4.53k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 4.53k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  4.53k|    } \
  |  |  |  |   94|  4.53k|    stmt; \
  |  |  |  |   95|  4.53k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 4.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   33|  4.53k|    secp256k1_fe_add(&na, b);
  ------------------
  |  |   92|  4.53k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
   34|  4.53k|    return secp256k1_fe_normalizes_to_zero(&na);
  ------------------
  |  |   81|  4.53k|#  define secp256k1_fe_normalizes_to_zero secp256k1_fe_impl_normalizes_to_zero
  ------------------
   35|  4.53k|}
secp256k1.c:secp256k1_fe_clear:
   21|      2|SECP256K1_INLINE static void secp256k1_fe_clear(secp256k1_fe *a) {
   22|      2|    secp256k1_memclear_explicit(a, sizeof(secp256k1_fe));
   23|      2|}

secp256k1.c:secp256k1_ge_set_xy:
  132|  25.9k|static void secp256k1_ge_set_xy(secp256k1_ge *r, const secp256k1_fe *x, const secp256k1_fe *y) {
  133|  25.9k|    SECP256K1_FE_VERIFY(x);
  ------------------
  |  |  345|  25.9k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  134|  25.9k|    SECP256K1_FE_VERIFY(y);
  ------------------
  |  |  345|  25.9k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  135|       |
  136|  25.9k|    r->infinity = 0;
  137|  25.9k|    r->x = *x;
  138|  25.9k|    r->y = *y;
  139|       |
  140|  25.9k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|  25.9k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  141|  25.9k|}
secp256k1.c:secp256k1_ge_verify:
   78|   245k|static void secp256k1_ge_verify(const secp256k1_ge *a) {
   79|   245k|    SECP256K1_FE_VERIFY(&a->x);
  ------------------
  |  |  345|   245k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   80|   245k|    SECP256K1_FE_VERIFY(&a->y);
  ------------------
  |  |  345|   245k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   81|   245k|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->x, SECP256K1_GE_X_MAGNITUDE_MAX);
  ------------------
  |  |  349|   245k|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   82|   245k|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->y, SECP256K1_GE_Y_MAGNITUDE_MAX);
  ------------------
  |  |  349|   245k|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   83|   245k|    VERIFY_CHECK(a->infinity == 0 || a->infinity == 1);
   84|   245k|    (void)a;
   85|   245k|}
secp256k1.c:secp256k1_ge_is_in_correct_subgroup:
  926|  4.53k|static int secp256k1_ge_is_in_correct_subgroup(const secp256k1_ge* ge) {
  927|       |#ifdef EXHAUSTIVE_TEST_ORDER
  928|       |    secp256k1_gej out;
  929|       |    int i;
  930|       |    SECP256K1_GE_VERIFY(ge);
  931|       |
  932|       |    /* A very simple EC multiplication ladder that avoids a dependency on ecmult. */
  933|       |    secp256k1_gej_set_infinity(&out);
  934|       |    for (i = 0; i < 32; ++i) {
  935|       |        secp256k1_gej_double_var(&out, &out, NULL);
  936|       |        if ((((uint32_t)EXHAUSTIVE_TEST_ORDER) >> (31 - i)) & 1) {
  937|       |            secp256k1_gej_add_ge_var(&out, &out, ge, NULL);
  938|       |        }
  939|       |    }
  940|       |    return secp256k1_gej_is_infinity(&out);
  941|       |#else
  942|  4.53k|    SECP256K1_GE_VERIFY(ge);
  ------------------
  |  |  212|  4.53k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  943|       |
  944|  4.53k|    (void)ge;
  945|       |    /* The real secp256k1 group has cofactor 1, so the subgroup is the entire curve. */
  946|  4.53k|    return 1;
  947|  4.53k|#endif
  948|  4.53k|}
secp256k1.c:secp256k1_ge_clear:
  343|      2|static void secp256k1_ge_clear(secp256k1_ge *r) {
  344|      2|    secp256k1_memclear_explicit(r, sizeof(secp256k1_ge));
  345|      2|}
secp256k1.c:secp256k1_gej_verify:
   87|  1.82M|static void secp256k1_gej_verify(const secp256k1_gej *a) {
   88|  1.82M|    SECP256K1_FE_VERIFY(&a->x);
  ------------------
  |  |  345|  1.82M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   89|  1.82M|    SECP256K1_FE_VERIFY(&a->y);
  ------------------
  |  |  345|  1.82M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   90|  1.82M|    SECP256K1_FE_VERIFY(&a->z);
  ------------------
  |  |  345|  1.82M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   91|  1.82M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->x, SECP256K1_GEJ_X_MAGNITUDE_MAX);
  ------------------
  |  |  349|  1.82M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   92|  1.82M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->y, SECP256K1_GEJ_Y_MAGNITUDE_MAX);
  ------------------
  |  |  349|  1.82M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   93|  1.82M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->z, SECP256K1_GEJ_Z_MAGNITUDE_MAX);
  ------------------
  |  |  349|  1.82M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   94|  1.82M|    VERIFY_CHECK(a->infinity == 0 || a->infinity == 1);
   95|  1.82M|    (void)a;
   96|  1.82M|}
secp256k1.c:secp256k1_gej_set_infinity:
  322|  6.49k|static void secp256k1_gej_set_infinity(secp256k1_gej *r) {
  323|  6.49k|    r->infinity = 1;
  324|  6.49k|    secp256k1_fe_set_int(&r->x, 0);
  ------------------
  |  |   83|  6.49k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  325|  6.49k|    secp256k1_fe_set_int(&r->y, 0);
  ------------------
  |  |   83|  6.49k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  326|  6.49k|    secp256k1_fe_set_int(&r->z, 0);
  ------------------
  |  |   83|  6.49k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  327|       |
  328|  6.49k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|  6.49k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  329|  6.49k|}
secp256k1.c:secp256k1_gej_is_infinity:
  440|  9.73k|static int secp256k1_gej_is_infinity(const secp256k1_gej *a) {
  441|  9.73k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|  9.73k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  442|       |
  443|  9.73k|    return a->infinity;
  444|  9.73k|}
secp256k1.c:secp256k1_ge_set_gej:
  159|  3.24k|static void secp256k1_ge_set_gej(secp256k1_ge *r, secp256k1_gej *a) {
  160|  3.24k|    secp256k1_fe z2, z3;
  161|  3.24k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|  3.24k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  162|       |
  163|  3.24k|    r->infinity = a->infinity;
  164|  3.24k|    secp256k1_fe_inv(&a->z, &a->z);
  ------------------
  |  |   98|  3.24k|#  define secp256k1_fe_inv secp256k1_fe_impl_inv
  ------------------
  165|  3.24k|    secp256k1_fe_sqr(&z2, &a->z);
  ------------------
  |  |   94|  3.24k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  166|  3.24k|    secp256k1_fe_mul(&z3, &a->z, &z2);
  ------------------
  |  |   93|  3.24k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  167|  3.24k|    secp256k1_fe_mul(&a->x, &a->x, &z2);
  ------------------
  |  |   93|  3.24k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  168|  3.24k|    secp256k1_fe_mul(&a->y, &a->y, &z3);
  ------------------
  |  |   93|  3.24k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  169|  3.24k|    secp256k1_fe_set_int(&a->z, 1);
  ------------------
  |  |   83|  3.24k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  170|  3.24k|    r->x = a->x;
  171|  3.24k|    r->y = a->y;
  172|       |
  173|  3.24k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|  3.24k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  174|  3.24k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|  3.24k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  175|  3.24k|}
secp256k1.c:secp256k1_ge_set_xo_var:
  347|  4.53k|static int secp256k1_ge_set_xo_var(secp256k1_ge *r, const secp256k1_fe *x, int odd) {
  348|  4.53k|    secp256k1_fe x2, x3;
  349|  4.53k|    int ret;
  350|  4.53k|    SECP256K1_FE_VERIFY(x);
  ------------------
  |  |  345|  4.53k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  351|       |
  352|  4.53k|    r->x = *x;
  353|  4.53k|    secp256k1_fe_sqr(&x2, x);
  ------------------
  |  |   94|  4.53k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  354|  4.53k|    secp256k1_fe_mul(&x3, x, &x2);
  ------------------
  |  |   93|  4.53k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  355|  4.53k|    r->infinity = 0;
  356|  4.53k|    secp256k1_fe_add_int(&x3, SECP256K1_B);
  ------------------
  |  |  102|  4.53k|#  define secp256k1_fe_add_int secp256k1_fe_impl_add_int
  ------------------
                  secp256k1_fe_add_int(&x3, SECP256K1_B);
  ------------------
  |  |   73|  4.53k|#define SECP256K1_B 7
  ------------------
  357|  4.53k|    ret = secp256k1_fe_sqrt(&r->y, &x3);
  358|  4.53k|    secp256k1_fe_normalize_var(&r->y);
  ------------------
  |  |   80|  4.53k|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
  359|  4.53k|    if (secp256k1_fe_is_odd(&r->y) != odd) {
  ------------------
  |  |   85|  4.53k|#  define secp256k1_fe_is_odd secp256k1_fe_impl_is_odd
  ------------------
  |  Branch (359:9): [True: 3.88k, False: 656]
  ------------------
  360|  3.88k|        secp256k1_fe_negate(&r->y, &r->y, 1);
  ------------------
  |  |  211|  3.88k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  3.88k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  3.88k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 3.88k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  3.88k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 3.88k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  3.88k|    } \
  |  |  |  |   94|  3.88k|    stmt; \
  |  |  |  |   95|  3.88k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 3.88k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  361|  3.88k|    }
  362|       |
  363|  4.53k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|  4.53k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  364|  4.53k|    return ret;
  365|  4.53k|}
secp256k1.c:secp256k1_gej_set_ge:
  367|  6.49k|static void secp256k1_gej_set_ge(secp256k1_gej *r, const secp256k1_ge *a) {
  368|  6.49k|   SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  212|  6.49k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  369|       |
  370|  6.49k|   r->infinity = a->infinity;
  371|  6.49k|   r->x = a->x;
  372|  6.49k|   r->y = a->y;
  373|  6.49k|   secp256k1_fe_set_int(&r->z, 1);
  ------------------
  |  |   83|  6.49k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  374|       |
  375|  6.49k|   SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|  6.49k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  376|  6.49k|}
secp256k1.c:secp256k1_ge_set_gej_zinv:
   99|  3.24k|static void secp256k1_ge_set_gej_zinv(secp256k1_ge *r, const secp256k1_gej *a, const secp256k1_fe *zi) {
  100|  3.24k|    secp256k1_fe zi2;
  101|  3.24k|    secp256k1_fe zi3;
  102|  3.24k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|  3.24k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  103|  3.24k|    SECP256K1_FE_VERIFY(zi);
  ------------------
  |  |  345|  3.24k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  104|  3.24k|    VERIFY_CHECK(!a->infinity);
  105|       |
  106|  3.24k|    secp256k1_fe_sqr(&zi2, zi);
  ------------------
  |  |   94|  3.24k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  107|  3.24k|    secp256k1_fe_mul(&zi3, &zi2, zi);
  ------------------
  |  |   93|  3.24k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  108|  3.24k|    secp256k1_fe_mul(&r->x, &a->x, &zi2);
  ------------------
  |  |   93|  3.24k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  109|  3.24k|    secp256k1_fe_mul(&r->y, &a->y, &zi3);
  ------------------
  |  |   93|  3.24k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  110|  3.24k|    r->infinity = a->infinity;
  111|       |
  112|  3.24k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|  3.24k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  113|  3.24k|}
secp256k1.c:secp256k1_ge_table_set_globalz:
  289|  3.24k|static void secp256k1_ge_table_set_globalz(size_t len, secp256k1_ge *a, const secp256k1_fe *zr) {
  290|  3.24k|    size_t i;
  291|  3.24k|    secp256k1_fe zs;
  292|       |#ifdef VERIFY
  293|       |    for (i = 0; i < len; i++) {
  294|       |        SECP256K1_GE_VERIFY(&a[i]);
  295|       |        SECP256K1_FE_VERIFY(&zr[i]);
  296|       |    }
  297|       |#endif
  298|       |
  299|  3.24k|    if (len > 0) {
  ------------------
  |  Branch (299:9): [True: 3.24k, False: 0]
  ------------------
  300|  3.24k|        i = len - 1;
  301|       |        /* Ensure all y values are in weak normal form for fast negation of points */
  302|  3.24k|        secp256k1_fe_normalize_weak(&a[i].y);
  ------------------
  |  |   79|  3.24k|#  define secp256k1_fe_normalize_weak secp256k1_fe_impl_normalize_weak
  ------------------
  303|  3.24k|        zs = zr[i];
  304|       |
  305|       |        /* Work our way backwards, using the z-ratios to scale the x/y values. */
  306|  25.9k|        while (i > 0) {
  ------------------
  |  Branch (306:16): [True: 22.7k, False: 3.24k]
  ------------------
  307|  22.7k|            if (i != len - 1) {
  ------------------
  |  Branch (307:17): [True: 19.4k, False: 3.24k]
  ------------------
  308|  19.4k|                secp256k1_fe_mul(&zs, &zs, &zr[i]);
  ------------------
  |  |   93|  19.4k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  309|  19.4k|            }
  310|  22.7k|            i--;
  311|  22.7k|            secp256k1_ge_set_ge_zinv(&a[i], &a[i], &zs);
  312|  22.7k|        }
  313|  3.24k|    }
  314|       |
  315|       |#ifdef VERIFY
  316|       |    for (i = 0; i < len; i++) {
  317|       |        SECP256K1_GE_VERIFY(&a[i]);
  318|       |    }
  319|       |#endif
  320|  3.24k|}
secp256k1.c:secp256k1_ge_set_ge_zinv:
  116|  22.7k|static void secp256k1_ge_set_ge_zinv(secp256k1_ge *r, const secp256k1_ge *a, const secp256k1_fe *zi) {
  117|  22.7k|    secp256k1_fe zi2;
  118|  22.7k|    secp256k1_fe zi3;
  119|  22.7k|    SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  212|  22.7k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  120|  22.7k|    SECP256K1_FE_VERIFY(zi);
  ------------------
  |  |  345|  22.7k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  121|  22.7k|    VERIFY_CHECK(!a->infinity);
  122|       |
  123|  22.7k|    secp256k1_fe_sqr(&zi2, zi);
  ------------------
  |  |   94|  22.7k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  124|  22.7k|    secp256k1_fe_mul(&zi3, &zi2, zi);
  ------------------
  |  |   93|  22.7k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  125|  22.7k|    secp256k1_fe_mul(&r->x, &a->x, &zi2);
  ------------------
  |  |   93|  22.7k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  126|  22.7k|    secp256k1_fe_mul(&r->y, &a->y, &zi3);
  ------------------
  |  |   93|  22.7k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  127|  22.7k|    r->infinity = a->infinity;
  128|       |
  129|  22.7k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|  22.7k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  130|  22.7k|}
secp256k1.c:secp256k1_gej_double_var:
  495|   409k|static void secp256k1_gej_double_var(secp256k1_gej *r, const secp256k1_gej *a, secp256k1_fe *rzr) {
  496|   409k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|   409k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  497|       |
  498|       |    /** For secp256k1, 2Q is infinity if and only if Q is infinity. This is because if 2Q = infinity,
  499|       |     *  Q must equal -Q, or that Q.y == -(Q.y), or Q.y is 0. For a point on y^2 = x^3 + 7 to have
  500|       |     *  y=0, x^3 must be -7 mod p. However, -7 has no cube root mod p.
  501|       |     *
  502|       |     *  Having said this, if this function receives a point on a sextic twist, e.g. by
  503|       |     *  a fault attack, it is possible for y to be 0. This happens for y^2 = x^3 + 6,
  504|       |     *  since -6 does have a cube root mod p. For this point, this function will not set
  505|       |     *  the infinity flag even though the point doubles to infinity, and the result
  506|       |     *  point will be gibberish (z = 0 but infinity = 0).
  507|       |     */
  508|   409k|    if (a->infinity) {
  ------------------
  |  Branch (508:9): [True: 3.24k, False: 406k]
  ------------------
  509|  3.24k|        secp256k1_gej_set_infinity(r);
  510|  3.24k|        if (rzr != NULL) {
  ------------------
  |  Branch (510:13): [True: 0, False: 3.24k]
  ------------------
  511|      0|            secp256k1_fe_set_int(rzr, 1);
  ------------------
  |  |   83|      0|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  512|      0|        }
  513|  3.24k|        return;
  514|  3.24k|    }
  515|       |
  516|   406k|    if (rzr != NULL) {
  ------------------
  |  Branch (516:9): [True: 0, False: 406k]
  ------------------
  517|      0|        *rzr = a->y;
  518|      0|        secp256k1_fe_normalize_weak(rzr);
  ------------------
  |  |   79|      0|#  define secp256k1_fe_normalize_weak secp256k1_fe_impl_normalize_weak
  ------------------
  519|      0|    }
  520|       |
  521|   406k|    secp256k1_gej_double(r, a);
  522|       |
  523|   406k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|   406k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  524|   406k|}
secp256k1.c:secp256k1_gej_double:
  460|   406k|static SECP256K1_INLINE void secp256k1_gej_double(secp256k1_gej *r, const secp256k1_gej *a) {
  461|       |    /* Operations: 3 mul, 4 sqr, 8 add/half/mul_int/negate */
  462|   406k|    secp256k1_fe l, s, t;
  463|   406k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|   406k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  464|       |
  465|   406k|    r->infinity = a->infinity;
  466|       |
  467|       |    /* Formula used:
  468|       |     * L = (3/2) * X1^2
  469|       |     * S = Y1^2
  470|       |     * T = -X1*S
  471|       |     * X3 = L^2 + 2*T
  472|       |     * Y3 = -(L*(X3 + T) + S^2)
  473|       |     * Z3 = Y1*Z1
  474|       |     */
  475|       |
  476|   406k|    secp256k1_fe_mul(&r->z, &a->z, &a->y); /* Z3 = Y1*Z1 (1) */
  ------------------
  |  |   93|   406k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  477|   406k|    secp256k1_fe_sqr(&s, &a->y);           /* S = Y1^2 (1) */
  ------------------
  |  |   94|   406k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  478|   406k|    secp256k1_fe_sqr(&l, &a->x);           /* L = X1^2 (1) */
  ------------------
  |  |   94|   406k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  479|   406k|    secp256k1_fe_mul_int(&l, 3);           /* L = 3*X1^2 (3) */
  ------------------
  |  |  233|   406k|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   87|   406k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   406k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 406k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   406k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 406k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   406k|    } \
  |  |  |  |   94|   406k|    stmt; \
  |  |  |  |   95|   406k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 406k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  480|   406k|    secp256k1_fe_half(&l);                 /* L = 3/2*X1^2 (2) */
  ------------------
  |  |  101|   406k|#  define secp256k1_fe_half secp256k1_fe_impl_half
  ------------------
  481|   406k|    secp256k1_fe_negate(&t, &s, 1);        /* T = -S (2) */
  ------------------
  |  |  211|   406k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   406k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   406k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 406k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   406k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 406k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   406k|    } \
  |  |  |  |   94|   406k|    stmt; \
  |  |  |  |   95|   406k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 406k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  482|   406k|    secp256k1_fe_mul(&t, &t, &a->x);       /* T = -X1*S (1) */
  ------------------
  |  |   93|   406k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  483|   406k|    secp256k1_fe_sqr(&r->x, &l);           /* X3 = L^2 (1) */
  ------------------
  |  |   94|   406k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  484|   406k|    secp256k1_fe_add(&r->x, &t);           /* X3 = L^2 + T (2) */
  ------------------
  |  |   92|   406k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  485|   406k|    secp256k1_fe_add(&r->x, &t);           /* X3 = L^2 + 2*T (3) */
  ------------------
  |  |   92|   406k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  486|   406k|    secp256k1_fe_sqr(&s, &s);              /* S' = S^2 (1) */
  ------------------
  |  |   94|   406k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  487|   406k|    secp256k1_fe_add(&t, &r->x);           /* T' = X3 + T (4) */
  ------------------
  |  |   92|   406k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  488|   406k|    secp256k1_fe_mul(&r->y, &t, &l);       /* Y3 = L*(X3 + T) (1) */
  ------------------
  |  |   93|   406k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  489|   406k|    secp256k1_fe_add(&r->y, &s);           /* Y3 = L*(X3 + T) + S^2 (2) */
  ------------------
  |  |   92|   406k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  490|   406k|    secp256k1_fe_negate(&r->y, &r->y, 2);  /* Y3 = -(L*(X3 + T) + S^2) (3) */
  ------------------
  |  |  211|   406k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   406k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   406k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 406k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   406k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 406k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   406k|    } \
  |  |  |  |   94|   406k|    stmt; \
  |  |  |  |   95|   406k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 406k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  491|       |
  492|   406k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|   406k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  493|   406k|}
secp256k1.c:secp256k1_ge_from_storage:
  890|  62.2k|static void secp256k1_ge_from_storage(secp256k1_ge *r, const secp256k1_ge_storage *a) {
  891|  62.2k|    secp256k1_fe_from_storage(&r->x, &a->x);
  ------------------
  |  |   97|  62.2k|#  define secp256k1_fe_from_storage secp256k1_fe_impl_from_storage
  ------------------
  892|  62.2k|    secp256k1_fe_from_storage(&r->y, &a->y);
  ------------------
  |  |   97|  62.2k|#  define secp256k1_fe_from_storage secp256k1_fe_impl_from_storage
  ------------------
  893|  62.2k|    r->infinity = 0;
  894|       |
  895|  62.2k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|  62.2k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  896|  62.2k|}
secp256k1.c:secp256k1_gej_add_zinv_var:
  653|  55.0k|static void secp256k1_gej_add_zinv_var(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b, const secp256k1_fe *bzinv) {
  654|       |    /* Operations: 9 mul, 3 sqr, 11 add/negate/normalizes_to_zero (ignoring special cases) */
  655|  55.0k|    secp256k1_fe az, z12, u1, u2, s1, s2, h, i, h2, h3, t;
  656|  55.0k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|  55.0k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  657|  55.0k|    SECP256K1_GE_VERIFY(b);
  ------------------
  |  |  212|  55.0k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  658|  55.0k|    SECP256K1_FE_VERIFY(bzinv);
  ------------------
  |  |  345|  55.0k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  659|       |
  660|  55.0k|    if (a->infinity) {
  ------------------
  |  Branch (660:9): [True: 3.24k, False: 51.8k]
  ------------------
  661|  3.24k|        secp256k1_fe bzinv2, bzinv3;
  662|  3.24k|        r->infinity = b->infinity;
  663|  3.24k|        secp256k1_fe_sqr(&bzinv2, bzinv);
  ------------------
  |  |   94|  3.24k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  664|  3.24k|        secp256k1_fe_mul(&bzinv3, &bzinv2, bzinv);
  ------------------
  |  |   93|  3.24k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  665|  3.24k|        secp256k1_fe_mul(&r->x, &b->x, &bzinv2);
  ------------------
  |  |   93|  3.24k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  666|  3.24k|        secp256k1_fe_mul(&r->y, &b->y, &bzinv3);
  ------------------
  |  |   93|  3.24k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  667|  3.24k|        secp256k1_fe_set_int(&r->z, 1);
  ------------------
  |  |   83|  3.24k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  668|  3.24k|        SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|  3.24k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  669|  3.24k|        return;
  670|  3.24k|    }
  671|  51.8k|    if (b->infinity) {
  ------------------
  |  Branch (671:9): [True: 0, False: 51.8k]
  ------------------
  672|      0|        *r = *a;
  673|      0|        return;
  674|      0|    }
  675|       |
  676|       |    /** We need to calculate (rx,ry,rz) = (ax,ay,az) + (bx,by,1/bzinv). Due to
  677|       |     *  secp256k1's isomorphism we can multiply the Z coordinates on both sides
  678|       |     *  by bzinv, and get: (rx,ry,rz*bzinv) = (ax,ay,az*bzinv) + (bx,by,1).
  679|       |     *  This means that (rx,ry,rz) can be calculated as
  680|       |     *  (ax,ay,az*bzinv) + (bx,by,1), when not applying the bzinv factor to rz.
  681|       |     *  The variable az below holds the modified Z coordinate for a, which is used
  682|       |     *  for the computation of rx and ry, but not for rz.
  683|       |     */
  684|  51.8k|    secp256k1_fe_mul(&az, &a->z, bzinv);
  ------------------
  |  |   93|  51.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  685|       |
  686|  51.8k|    secp256k1_fe_sqr(&z12, &az);
  ------------------
  |  |   94|  51.8k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  687|  51.8k|    u1 = a->x;
  688|  51.8k|    secp256k1_fe_mul(&u2, &b->x, &z12);
  ------------------
  |  |   93|  51.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  689|  51.8k|    s1 = a->y;
  690|  51.8k|    secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &az);
  ------------------
  |  |   93|  51.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
                  secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &az);
  ------------------
  |  |   93|  51.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  691|  51.8k|    secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |  211|  51.8k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  51.8k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  51.8k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 51.8k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  51.8k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 51.8k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  51.8k|    } \
  |  |  |  |   94|  51.8k|    stmt; \
  |  |  |  |   95|  51.8k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 51.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |   92|  51.8k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  692|  51.8k|    secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |  211|  51.8k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  51.8k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  51.8k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 51.8k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  51.8k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 51.8k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  51.8k|    } \
  |  |  |  |   94|  51.8k|    stmt; \
  |  |  |  |   95|  51.8k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 51.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |   92|  51.8k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  693|  51.8k|    if (secp256k1_fe_normalizes_to_zero_var(&h)) {
  ------------------
  |  |   82|  51.8k|#  define secp256k1_fe_normalizes_to_zero_var secp256k1_fe_impl_normalizes_to_zero_var
  ------------------
  |  Branch (693:9): [True: 0, False: 51.8k]
  ------------------
  694|      0|        if (secp256k1_fe_normalizes_to_zero_var(&i)) {
  ------------------
  |  |   82|      0|#  define secp256k1_fe_normalizes_to_zero_var secp256k1_fe_impl_normalizes_to_zero_var
  ------------------
  |  Branch (694:13): [True: 0, False: 0]
  ------------------
  695|      0|            secp256k1_gej_double_var(r, a, NULL);
  696|      0|        } else {
  697|      0|            secp256k1_gej_set_infinity(r);
  698|      0|        }
  699|      0|        return;
  700|      0|    }
  701|       |
  702|  51.8k|    r->infinity = 0;
  703|  51.8k|    secp256k1_fe_mul(&r->z, &a->z, &h);
  ------------------
  |  |   93|  51.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  704|       |
  705|  51.8k|    secp256k1_fe_sqr(&h2, &h);
  ------------------
  |  |   94|  51.8k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  706|  51.8k|    secp256k1_fe_negate(&h2, &h2, 1);
  ------------------
  |  |  211|  51.8k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  51.8k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  51.8k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 51.8k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  51.8k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 51.8k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  51.8k|    } \
  |  |  |  |   94|  51.8k|    stmt; \
  |  |  |  |   95|  51.8k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 51.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  707|  51.8k|    secp256k1_fe_mul(&h3, &h2, &h);
  ------------------
  |  |   93|  51.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  708|  51.8k|    secp256k1_fe_mul(&t, &u1, &h2);
  ------------------
  |  |   93|  51.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  709|       |
  710|  51.8k|    secp256k1_fe_sqr(&r->x, &i);
  ------------------
  |  |   94|  51.8k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  711|  51.8k|    secp256k1_fe_add(&r->x, &h3);
  ------------------
  |  |   92|  51.8k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  712|  51.8k|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|  51.8k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  713|  51.8k|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|  51.8k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  714|       |
  715|  51.8k|    secp256k1_fe_add(&t, &r->x);
  ------------------
  |  |   92|  51.8k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  716|  51.8k|    secp256k1_fe_mul(&r->y, &t, &i);
  ------------------
  |  |   93|  51.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  717|  51.8k|    secp256k1_fe_mul(&h3, &h3, &s1);
  ------------------
  |  |   93|  51.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  718|  51.8k|    secp256k1_fe_add(&r->y, &h3);
  ------------------
  |  |   92|  51.8k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  719|       |
  720|  51.8k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|  51.8k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  721|  51.8k|}
secp256k1.c:secp256k1_gej_add_ge_var:
  590|  25.9k|static void secp256k1_gej_add_ge_var(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b, secp256k1_fe *rzr) {
  591|       |    /* Operations: 8 mul, 3 sqr, 11 add/negate/normalizes_to_zero (ignoring special cases) */
  592|  25.9k|    secp256k1_fe z12, u1, u2, s1, s2, h, i, h2, h3, t;
  593|  25.9k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|  25.9k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  594|  25.9k|    SECP256K1_GE_VERIFY(b);
  ------------------
  |  |  212|  25.9k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  595|       |
  596|  25.9k|    if (a->infinity) {
  ------------------
  |  Branch (596:9): [True: 0, False: 25.9k]
  ------------------
  597|      0|        VERIFY_CHECK(rzr == NULL);
  598|      0|        secp256k1_gej_set_ge(r, b);
  599|      0|        return;
  600|      0|    }
  601|  25.9k|    if (b->infinity) {
  ------------------
  |  Branch (601:9): [True: 0, False: 25.9k]
  ------------------
  602|      0|        if (rzr != NULL) {
  ------------------
  |  Branch (602:13): [True: 0, False: 0]
  ------------------
  603|      0|            secp256k1_fe_set_int(rzr, 1);
  ------------------
  |  |   83|      0|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  604|      0|        }
  605|      0|        *r = *a;
  606|      0|        return;
  607|      0|    }
  608|       |
  609|  25.9k|    secp256k1_fe_sqr(&z12, &a->z);
  ------------------
  |  |   94|  25.9k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  610|  25.9k|    u1 = a->x;
  611|  25.9k|    secp256k1_fe_mul(&u2, &b->x, &z12);
  ------------------
  |  |   93|  25.9k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  612|  25.9k|    s1 = a->y;
  613|  25.9k|    secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &a->z);
  ------------------
  |  |   93|  25.9k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
                  secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &a->z);
  ------------------
  |  |   93|  25.9k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  614|  25.9k|    secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |  211|  25.9k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  25.9k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  25.9k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 25.9k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  25.9k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 25.9k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  25.9k|    } \
  |  |  |  |   94|  25.9k|    stmt; \
  |  |  |  |   95|  25.9k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 25.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |   92|  25.9k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  615|  25.9k|    secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |  211|  25.9k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  25.9k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  25.9k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 25.9k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  25.9k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 25.9k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  25.9k|    } \
  |  |  |  |   94|  25.9k|    stmt; \
  |  |  |  |   95|  25.9k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 25.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |   92|  25.9k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  616|  25.9k|    if (secp256k1_fe_normalizes_to_zero_var(&h)) {
  ------------------
  |  |   82|  25.9k|#  define secp256k1_fe_normalizes_to_zero_var secp256k1_fe_impl_normalizes_to_zero_var
  ------------------
  |  Branch (616:9): [True: 0, False: 25.9k]
  ------------------
  617|      0|        if (secp256k1_fe_normalizes_to_zero_var(&i)) {
  ------------------
  |  |   82|      0|#  define secp256k1_fe_normalizes_to_zero_var secp256k1_fe_impl_normalizes_to_zero_var
  ------------------
  |  Branch (617:13): [True: 0, False: 0]
  ------------------
  618|      0|            secp256k1_gej_double_var(r, a, rzr);
  619|      0|        } else {
  620|      0|            if (rzr != NULL) {
  ------------------
  |  Branch (620:17): [True: 0, False: 0]
  ------------------
  621|      0|                secp256k1_fe_set_int(rzr, 0);
  ------------------
  |  |   83|      0|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  622|      0|            }
  623|      0|            secp256k1_gej_set_infinity(r);
  624|      0|        }
  625|      0|        return;
  626|      0|    }
  627|       |
  628|  25.9k|    r->infinity = 0;
  629|  25.9k|    if (rzr != NULL) {
  ------------------
  |  Branch (629:9): [True: 22.7k, False: 3.24k]
  ------------------
  630|  22.7k|        *rzr = h;
  631|  22.7k|    }
  632|  25.9k|    secp256k1_fe_mul(&r->z, &a->z, &h);
  ------------------
  |  |   93|  25.9k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  633|       |
  634|  25.9k|    secp256k1_fe_sqr(&h2, &h);
  ------------------
  |  |   94|  25.9k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  635|  25.9k|    secp256k1_fe_negate(&h2, &h2, 1);
  ------------------
  |  |  211|  25.9k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  25.9k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  25.9k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 25.9k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  25.9k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 25.9k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  25.9k|    } \
  |  |  |  |   94|  25.9k|    stmt; \
  |  |  |  |   95|  25.9k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 25.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  636|  25.9k|    secp256k1_fe_mul(&h3, &h2, &h);
  ------------------
  |  |   93|  25.9k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  637|  25.9k|    secp256k1_fe_mul(&t, &u1, &h2);
  ------------------
  |  |   93|  25.9k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  638|       |
  639|  25.9k|    secp256k1_fe_sqr(&r->x, &i);
  ------------------
  |  |   94|  25.9k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  640|  25.9k|    secp256k1_fe_add(&r->x, &h3);
  ------------------
  |  |   92|  25.9k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  641|  25.9k|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|  25.9k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  642|  25.9k|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|  25.9k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  643|       |
  644|  25.9k|    secp256k1_fe_add(&t, &r->x);
  ------------------
  |  |   92|  25.9k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  645|  25.9k|    secp256k1_fe_mul(&r->y, &t, &i);
  ------------------
  |  |   93|  25.9k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  646|  25.9k|    secp256k1_fe_mul(&h3, &h3, &s1);
  ------------------
  |  |   93|  25.9k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  647|  25.9k|    secp256k1_fe_add(&r->y, &h3);
  ------------------
  |  |   92|  25.9k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  648|       |
  649|  25.9k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|  25.9k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  650|  25.9k|    if (rzr != NULL) SECP256K1_FE_VERIFY(rzr);
  ------------------
  |  |  345|  22.7k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  |  Branch (650:9): [True: 22.7k, False: 3.24k]
  ------------------
  651|  25.9k|}
secp256k1.c:secp256k1_ge_to_bytes:
  977|  8.44k|static void secp256k1_ge_to_bytes(unsigned char *buf, const secp256k1_ge *a) {
  978|  8.44k|    secp256k1_ge_storage s;
  979|       |
  980|       |    /* We require that the secp256k1_ge_storage type is exactly 64 bytes.
  981|       |     * This is formally not guaranteed by the C standard, but should hold on any
  982|       |     * sane compiler in the real world. */
  983|  8.44k|    STATIC_ASSERT(sizeof(secp256k1_ge_storage) == 64);
  ------------------
  |  |   74|  8.44k|#define STATIC_ASSERT(expr) do { \
  |  |   75|  8.44k|    switch(0) { \
  |  |  ------------------
  |  |  |  Branch (75:12): [Folded, False: 0]
  |  |  ------------------
  |  |   76|  8.44k|        case 0: \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 8.44k, False: 0]
  |  |  ------------------
  |  |   77|  8.44k|        /* If expr evaluates to 0, we have two case labels "0", which is illegal. */ \
  |  |   78|  8.44k|        case /* ERROR: static assertion failed */ (expr): \
  |  |  ------------------
  |  |  |  Branch (78:9): [True: 0, False: 8.44k]
  |  |  ------------------
  |  |   79|  8.44k|        ; \
  |  |   80|  8.44k|    } \
  |  |   81|  8.44k|} while(0)
  |  |  ------------------
  |  |  |  Branch (81:9): [Folded, False: 8.44k]
  |  |  ------------------
  ------------------
  984|  8.44k|    VERIFY_CHECK(!secp256k1_ge_is_infinity(a));
  985|  8.44k|    secp256k1_ge_to_storage(&s, a);
  986|  8.44k|    memcpy(buf, &s, 64);
  987|  8.44k|}
secp256k1.c:secp256k1_ge_to_storage:
  877|  8.44k|static void secp256k1_ge_to_storage(secp256k1_ge_storage *r, const secp256k1_ge *a) {
  878|  8.44k|    secp256k1_fe x, y;
  879|  8.44k|    SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  212|  8.44k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  880|  8.44k|    VERIFY_CHECK(!a->infinity);
  881|       |
  882|  8.44k|    x = a->x;
  883|  8.44k|    secp256k1_fe_normalize(&x);
  ------------------
  |  |   78|  8.44k|#  define secp256k1_fe_normalize secp256k1_fe_impl_normalize
  ------------------
  884|  8.44k|    y = a->y;
  885|  8.44k|    secp256k1_fe_normalize(&y);
  ------------------
  |  |   78|  8.44k|#  define secp256k1_fe_normalize secp256k1_fe_impl_normalize
  ------------------
  886|  8.44k|    secp256k1_fe_to_storage(&r->x, &x);
  ------------------
  |  |   96|  8.44k|#  define secp256k1_fe_to_storage secp256k1_fe_impl_to_storage
  ------------------
  887|  8.44k|    secp256k1_fe_to_storage(&r->y, &y);
  ------------------
  |  |   96|  8.44k|#  define secp256k1_fe_to_storage secp256k1_fe_impl_to_storage
  ------------------
  888|  8.44k|}
secp256k1.c:secp256k1_ge_from_bytes:
  989|  7.15k|static void secp256k1_ge_from_bytes(secp256k1_ge *r, const unsigned char *buf) {
  990|  7.15k|    secp256k1_ge_storage s;
  991|       |
  992|  7.15k|    STATIC_ASSERT(sizeof(secp256k1_ge_storage) == 64);
  ------------------
  |  |   74|  7.15k|#define STATIC_ASSERT(expr) do { \
  |  |   75|  7.15k|    switch(0) { \
  |  |  ------------------
  |  |  |  Branch (75:12): [Folded, False: 0]
  |  |  ------------------
  |  |   76|  7.15k|        case 0: \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 7.15k, False: 0]
  |  |  ------------------
  |  |   77|  7.15k|        /* If expr evaluates to 0, we have two case labels "0", which is illegal. */ \
  |  |   78|  7.15k|        case /* ERROR: static assertion failed */ (expr): \
  |  |  ------------------
  |  |  |  Branch (78:9): [True: 0, False: 7.15k]
  |  |  ------------------
  |  |   79|  7.15k|        ; \
  |  |   80|  7.15k|    } \
  |  |   81|  7.15k|} while(0)
  |  |  ------------------
  |  |  |  Branch (81:9): [Folded, False: 7.15k]
  |  |  ------------------
  ------------------
  993|  7.15k|    memcpy(&s, buf, 64);
  994|  7.15k|    secp256k1_ge_from_storage(r, &s);
  995|  7.15k|}

secp256k1.c:secp256k1_u128_mul:
   11|  15.4M|static SECP256K1_INLINE void secp256k1_u128_mul(secp256k1_uint128 *r, uint64_t a, uint64_t b) {
   12|  15.4M|   *r = (uint128_t)a * b;
   13|  15.4M|}
secp256k1.c:secp256k1_u128_accum_mul:
   15|   113M|static SECP256K1_INLINE void secp256k1_u128_accum_mul(secp256k1_uint128 *r, uint64_t a, uint64_t b) {
   16|   113M|   *r += (uint128_t)a * b;
   17|   113M|}
secp256k1.c:secp256k1_u128_to_u64:
   28|  67.2M|static SECP256K1_INLINE uint64_t secp256k1_u128_to_u64(const secp256k1_uint128 *a) {
   29|  67.2M|   return (uint64_t)(*a);
   30|  67.2M|}
secp256k1.c:secp256k1_u128_rshift:
   23|  51.7M|static SECP256K1_INLINE void secp256k1_u128_rshift(secp256k1_uint128 *r, unsigned int n) {
   24|  51.7M|   VERIFY_CHECK(n < 128);
   25|  51.7M|   *r >>= n;
   26|  51.7M|}
secp256k1.c:secp256k1_u128_accum_u64:
   19|  5.62M|static SECP256K1_INLINE void secp256k1_u128_accum_u64(secp256k1_uint128 *r, uint64_t a) {
   20|  5.62M|   *r += a;
   21|  5.62M|}
secp256k1.c:secp256k1_u128_from_u64:
   36|  76.8k|static SECP256K1_INLINE void secp256k1_u128_from_u64(secp256k1_uint128 *r, uint64_t a) {
   37|  76.8k|   *r = a;
   38|  76.8k|}
secp256k1.c:secp256k1_i128_mul:
   49|   129k|static SECP256K1_INLINE void secp256k1_i128_mul(secp256k1_int128 *r, int64_t a, int64_t b) {
   50|   129k|   *r = (int128_t)a * b;
   51|   129k|}
secp256k1.c:secp256k1_i128_accum_mul:
   53|  1.29M|static SECP256K1_INLINE void secp256k1_i128_accum_mul(secp256k1_int128 *r, int64_t a, int64_t b) {
   54|  1.29M|   int128_t ab = (int128_t)a * b;
   55|  1.29M|   VERIFY_CHECK(0 <= ab ? *r <= INT128_MAX - ab : INT128_MIN - ab <= *r);
   56|  1.29M|   *r += ab;
   57|  1.29M|}
secp256k1.c:secp256k1_i128_to_u64:
   71|   584k|static SECP256K1_INLINE uint64_t secp256k1_i128_to_u64(const secp256k1_int128 *a) {
   72|   584k|   return (uint64_t)*a;
   73|   584k|}
secp256k1.c:secp256k1_i128_rshift:
   66|   649k|static SECP256K1_INLINE void secp256k1_i128_rshift(secp256k1_int128 *r, unsigned int n) {
   67|   649k|   VERIFY_CHECK(n < 128);
   68|   649k|   *r >>= n;
   69|   649k|}
secp256k1.c:secp256k1_i128_to_i64:
   75|   129k|static SECP256K1_INLINE int64_t secp256k1_i128_to_i64(const secp256k1_int128 *a) {
   76|   129k|   VERIFY_CHECK(INT64_MIN <= *a && *a <= INT64_MAX);
   77|   129k|   return *a;
   78|   129k|}

secp256k1.c:secp256k1_modinv64_update_de_62:
  411|  32.4k|static void secp256k1_modinv64_update_de_62(secp256k1_modinv64_signed62 *d, secp256k1_modinv64_signed62 *e, const secp256k1_modinv64_trans2x2 *t, const secp256k1_modinv64_modinfo* modinfo) {
  412|  32.4k|    const uint64_t M62 = UINT64_MAX >> 2;
  413|  32.4k|    const int64_t d0 = d->v[0], d1 = d->v[1], d2 = d->v[2], d3 = d->v[3], d4 = d->v[4];
  414|  32.4k|    const int64_t e0 = e->v[0], e1 = e->v[1], e2 = e->v[2], e3 = e->v[3], e4 = e->v[4];
  415|  32.4k|    const int64_t u = t->u, v = t->v, q = t->q, r = t->r;
  416|  32.4k|    int64_t md, me, sd, se;
  417|  32.4k|    secp256k1_int128 cd, ce;
  418|  32.4k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(d, 5, &modinfo->modulus, -2) > 0); /* d > -2*modulus */
  419|  32.4k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(d, 5, &modinfo->modulus, 1) < 0);  /* d <    modulus */
  420|  32.4k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(e, 5, &modinfo->modulus, -2) > 0); /* e > -2*modulus */
  421|  32.4k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(e, 5, &modinfo->modulus, 1) < 0);  /* e <    modulus */
  422|  32.4k|    VERIFY_CHECK(secp256k1_modinv64_abs(u) <= (((int64_t)1 << 62) - secp256k1_modinv64_abs(v))); /* |u|+|v| <= 2^62 */
  423|  32.4k|    VERIFY_CHECK(secp256k1_modinv64_abs(q) <= (((int64_t)1 << 62) - secp256k1_modinv64_abs(r))); /* |q|+|r| <= 2^62 */
  424|       |
  425|       |    /* [md,me] start as zero; plus [u,q] if d is negative; plus [v,r] if e is negative. */
  426|  32.4k|    sd = d4 >> 63;
  427|  32.4k|    se = e4 >> 63;
  428|  32.4k|    md = (u & sd) + (v & se);
  429|  32.4k|    me = (q & sd) + (r & se);
  430|       |    /* Begin computing t*[d,e]. */
  431|  32.4k|    secp256k1_i128_mul(&cd, u, d0);
  432|  32.4k|    secp256k1_i128_accum_mul(&cd, v, e0);
  433|  32.4k|    secp256k1_i128_mul(&ce, q, d0);
  434|  32.4k|    secp256k1_i128_accum_mul(&ce, r, e0);
  435|       |    /* Correct md,me so that t*[d,e]+modulus*[md,me] has 62 zero bottom bits. */
  436|  32.4k|    md -= (modinfo->modulus_inv62 * secp256k1_i128_to_u64(&cd) + md) & M62;
  437|  32.4k|    me -= (modinfo->modulus_inv62 * secp256k1_i128_to_u64(&ce) + me) & M62;
  438|       |    /* Update the beginning of computation for t*[d,e]+modulus*[md,me] now md,me are known. */
  439|  32.4k|    secp256k1_i128_accum_mul(&cd, modinfo->modulus.v[0], md);
  440|  32.4k|    secp256k1_i128_accum_mul(&ce, modinfo->modulus.v[0], me);
  441|       |    /* Verify that the low 62 bits of the computation are indeed zero, and then throw them away. */
  442|  32.4k|    VERIFY_CHECK((secp256k1_i128_to_u64(&cd) & M62) == 0); secp256k1_i128_rshift(&cd, 62);
  443|  32.4k|    VERIFY_CHECK((secp256k1_i128_to_u64(&ce) & M62) == 0); secp256k1_i128_rshift(&ce, 62);
  444|       |    /* Compute limb 1 of t*[d,e]+modulus*[md,me], and store it as output limb 0 (= down shift). */
  445|  32.4k|    secp256k1_i128_accum_mul(&cd, u, d1);
  446|  32.4k|    secp256k1_i128_accum_mul(&cd, v, e1);
  447|  32.4k|    secp256k1_i128_accum_mul(&ce, q, d1);
  448|  32.4k|    secp256k1_i128_accum_mul(&ce, r, e1);
  449|  32.4k|    if (modinfo->modulus.v[1]) { /* Optimize for the case where limb of modulus is zero. */
  ------------------
  |  Branch (449:9): [True: 0, False: 32.4k]
  ------------------
  450|      0|        secp256k1_i128_accum_mul(&cd, modinfo->modulus.v[1], md);
  451|      0|        secp256k1_i128_accum_mul(&ce, modinfo->modulus.v[1], me);
  452|      0|    }
  453|  32.4k|    d->v[0] = secp256k1_i128_to_u64(&cd) & M62; secp256k1_i128_rshift(&cd, 62);
  454|  32.4k|    e->v[0] = secp256k1_i128_to_u64(&ce) & M62; secp256k1_i128_rshift(&ce, 62);
  455|       |    /* Compute limb 2 of t*[d,e]+modulus*[md,me], and store it as output limb 1. */
  456|  32.4k|    secp256k1_i128_accum_mul(&cd, u, d2);
  457|  32.4k|    secp256k1_i128_accum_mul(&cd, v, e2);
  458|  32.4k|    secp256k1_i128_accum_mul(&ce, q, d2);
  459|  32.4k|    secp256k1_i128_accum_mul(&ce, r, e2);
  460|  32.4k|    if (modinfo->modulus.v[2]) { /* Optimize for the case where limb of modulus is zero. */
  ------------------
  |  Branch (460:9): [True: 0, False: 32.4k]
  ------------------
  461|      0|        secp256k1_i128_accum_mul(&cd, modinfo->modulus.v[2], md);
  462|      0|        secp256k1_i128_accum_mul(&ce, modinfo->modulus.v[2], me);
  463|      0|    }
  464|  32.4k|    d->v[1] = secp256k1_i128_to_u64(&cd) & M62; secp256k1_i128_rshift(&cd, 62);
  465|  32.4k|    e->v[1] = secp256k1_i128_to_u64(&ce) & M62; secp256k1_i128_rshift(&ce, 62);
  466|       |    /* Compute limb 3 of t*[d,e]+modulus*[md,me], and store it as output limb 2. */
  467|  32.4k|    secp256k1_i128_accum_mul(&cd, u, d3);
  468|  32.4k|    secp256k1_i128_accum_mul(&cd, v, e3);
  469|  32.4k|    secp256k1_i128_accum_mul(&ce, q, d3);
  470|  32.4k|    secp256k1_i128_accum_mul(&ce, r, e3);
  471|  32.4k|    if (modinfo->modulus.v[3]) { /* Optimize for the case where limb of modulus is zero. */
  ------------------
  |  Branch (471:9): [True: 0, False: 32.4k]
  ------------------
  472|      0|        secp256k1_i128_accum_mul(&cd, modinfo->modulus.v[3], md);
  473|      0|        secp256k1_i128_accum_mul(&ce, modinfo->modulus.v[3], me);
  474|      0|    }
  475|  32.4k|    d->v[2] = secp256k1_i128_to_u64(&cd) & M62; secp256k1_i128_rshift(&cd, 62);
  476|  32.4k|    e->v[2] = secp256k1_i128_to_u64(&ce) & M62; secp256k1_i128_rshift(&ce, 62);
  477|       |    /* Compute limb 4 of t*[d,e]+modulus*[md,me], and store it as output limb 3. */
  478|  32.4k|    secp256k1_i128_accum_mul(&cd, u, d4);
  479|  32.4k|    secp256k1_i128_accum_mul(&cd, v, e4);
  480|  32.4k|    secp256k1_i128_accum_mul(&ce, q, d4);
  481|  32.4k|    secp256k1_i128_accum_mul(&ce, r, e4);
  482|  32.4k|    secp256k1_i128_accum_mul(&cd, modinfo->modulus.v[4], md);
  483|  32.4k|    secp256k1_i128_accum_mul(&ce, modinfo->modulus.v[4], me);
  484|  32.4k|    d->v[3] = secp256k1_i128_to_u64(&cd) & M62; secp256k1_i128_rshift(&cd, 62);
  485|  32.4k|    e->v[3] = secp256k1_i128_to_u64(&ce) & M62; secp256k1_i128_rshift(&ce, 62);
  486|       |    /* What remains is limb 5 of t*[d,e]+modulus*[md,me]; store it as output limb 4. */
  487|  32.4k|    d->v[4] = secp256k1_i128_to_i64(&cd);
  488|  32.4k|    e->v[4] = secp256k1_i128_to_i64(&ce);
  489|       |
  490|  32.4k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(d, 5, &modinfo->modulus, -2) > 0); /* d > -2*modulus */
  491|  32.4k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(d, 5, &modinfo->modulus, 1) < 0);  /* d <    modulus */
  492|  32.4k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(e, 5, &modinfo->modulus, -2) > 0); /* e > -2*modulus */
  493|  32.4k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(e, 5, &modinfo->modulus, 1) < 0);  /* e <    modulus */
  494|  32.4k|}
secp256k1.c:secp256k1_modinv64_normalize_62:
   88|  3.24k|static void secp256k1_modinv64_normalize_62(secp256k1_modinv64_signed62 *r, int64_t sign, const secp256k1_modinv64_modinfo *modinfo) {
   89|  3.24k|    const int64_t M62 = (int64_t)(UINT64_MAX >> 2);
   90|  3.24k|    int64_t r0 = r->v[0], r1 = r->v[1], r2 = r->v[2], r3 = r->v[3], r4 = r->v[4];
   91|  3.24k|    volatile int64_t cond_add, cond_negate;
   92|       |
   93|       |#ifdef VERIFY
   94|       |    /* Verify that all limbs are in range (-2^62,2^62). */
   95|       |    int i;
   96|       |    for (i = 0; i < 5; ++i) {
   97|       |        VERIFY_CHECK(r->v[i] >= -M62);
   98|       |        VERIFY_CHECK(r->v[i] <= M62);
   99|       |    }
  100|       |    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(r, 5, &modinfo->modulus, -2) > 0); /* r > -2*modulus */
  101|       |    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(r, 5, &modinfo->modulus, 1) < 0); /* r < modulus */
  102|       |#endif
  103|       |
  104|       |    /* In a first step, add the modulus if the input is negative, and then negate if requested.
  105|       |     * This brings r from range (-2*modulus,modulus) to range (-modulus,modulus). As all input
  106|       |     * limbs are in range (-2^62,2^62), this cannot overflow an int64_t. Note that the right
  107|       |     * shifts below are signed sign-extending shifts (see assumptions.h for tests that that is
  108|       |     * indeed the behavior of the right shift operator). */
  109|  3.24k|    cond_add = r4 >> 63;
  110|  3.24k|    r0 += modinfo->modulus.v[0] & cond_add;
  111|  3.24k|    r1 += modinfo->modulus.v[1] & cond_add;
  112|  3.24k|    r2 += modinfo->modulus.v[2] & cond_add;
  113|  3.24k|    r3 += modinfo->modulus.v[3] & cond_add;
  114|  3.24k|    r4 += modinfo->modulus.v[4] & cond_add;
  115|  3.24k|    cond_negate = sign >> 63;
  116|  3.24k|    r0 = (r0 ^ cond_negate) - cond_negate;
  117|  3.24k|    r1 = (r1 ^ cond_negate) - cond_negate;
  118|  3.24k|    r2 = (r2 ^ cond_negate) - cond_negate;
  119|  3.24k|    r3 = (r3 ^ cond_negate) - cond_negate;
  120|  3.24k|    r4 = (r4 ^ cond_negate) - cond_negate;
  121|       |    /* Propagate the top bits, to bring limbs back to range (-2^62,2^62). */
  122|  3.24k|    r1 += r0 >> 62; r0 &= M62;
  123|  3.24k|    r2 += r1 >> 62; r1 &= M62;
  124|  3.24k|    r3 += r2 >> 62; r2 &= M62;
  125|  3.24k|    r4 += r3 >> 62; r3 &= M62;
  126|       |
  127|       |    /* In a second step add the modulus again if the result is still negative, bringing
  128|       |     * r to range [0,modulus). */
  129|  3.24k|    cond_add = r4 >> 63;
  130|  3.24k|    r0 += modinfo->modulus.v[0] & cond_add;
  131|  3.24k|    r1 += modinfo->modulus.v[1] & cond_add;
  132|  3.24k|    r2 += modinfo->modulus.v[2] & cond_add;
  133|  3.24k|    r3 += modinfo->modulus.v[3] & cond_add;
  134|  3.24k|    r4 += modinfo->modulus.v[4] & cond_add;
  135|       |    /* And propagate again. */
  136|  3.24k|    r1 += r0 >> 62; r0 &= M62;
  137|  3.24k|    r2 += r1 >> 62; r1 &= M62;
  138|  3.24k|    r3 += r2 >> 62; r2 &= M62;
  139|  3.24k|    r4 += r3 >> 62; r3 &= M62;
  140|       |
  141|  3.24k|    r->v[0] = r0;
  142|  3.24k|    r->v[1] = r1;
  143|  3.24k|    r->v[2] = r2;
  144|  3.24k|    r->v[3] = r3;
  145|  3.24k|    r->v[4] = r4;
  146|       |
  147|  3.24k|    VERIFY_CHECK(r0 >> 62 == 0);
  148|  3.24k|    VERIFY_CHECK(r1 >> 62 == 0);
  149|  3.24k|    VERIFY_CHECK(r2 >> 62 == 0);
  150|  3.24k|    VERIFY_CHECK(r3 >> 62 == 0);
  151|  3.24k|    VERIFY_CHECK(r4 >> 62 == 0);
  152|  3.24k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(r, 5, &modinfo->modulus, 0) >= 0); /* r >= 0 */
  153|  3.24k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(r, 5, &modinfo->modulus, 1) < 0); /* r < modulus */
  154|  3.24k|}
secp256k1.c:secp256k1_modinv64:
  588|  3.24k|static void secp256k1_modinv64(secp256k1_modinv64_signed62 *x, const secp256k1_modinv64_modinfo *modinfo) {
  589|       |    /* Start with d=0, e=1, f=modulus, g=x, zeta=-1. */
  590|  3.24k|    secp256k1_modinv64_signed62 d = {{0, 0, 0, 0, 0}};
  591|  3.24k|    secp256k1_modinv64_signed62 e = {{1, 0, 0, 0, 0}};
  592|  3.24k|    secp256k1_modinv64_signed62 f = modinfo->modulus;
  593|  3.24k|    secp256k1_modinv64_signed62 g = *x;
  594|  3.24k|    int i;
  595|  3.24k|    int64_t zeta = -1; /* zeta = -(delta+1/2); delta starts at 1/2. */
  596|       |
  597|       |    /* Do 10 iterations of 59 divsteps each = 590 divsteps. This suffices for 256-bit inputs. */
  598|  35.7k|    for (i = 0; i < 10; ++i) {
  ------------------
  |  Branch (598:17): [True: 32.4k, False: 3.24k]
  ------------------
  599|       |        /* Compute transition matrix and new zeta after 59 divsteps. */
  600|  32.4k|        secp256k1_modinv64_trans2x2 t;
  601|  32.4k|        zeta = secp256k1_modinv64_divsteps_59(zeta, f.v[0], g.v[0], &t);
  602|       |        /* Update d,e using that transition matrix. */
  603|  32.4k|        secp256k1_modinv64_update_de_62(&d, &e, &t, modinfo);
  604|       |        /* Update f,g using that transition matrix. */
  605|  32.4k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, 5, &modinfo->modulus, -1) > 0); /* f > -modulus */
  606|  32.4k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, 5, &modinfo->modulus, 1) <= 0); /* f <= modulus */
  607|  32.4k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, 5, &modinfo->modulus, -1) > 0); /* g > -modulus */
  608|  32.4k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, 5, &modinfo->modulus, 1) < 0);  /* g <  modulus */
  609|       |
  610|  32.4k|        secp256k1_modinv64_update_fg_62(&f, &g, &t);
  611|       |
  612|  32.4k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, 5, &modinfo->modulus, -1) > 0); /* f > -modulus */
  613|  32.4k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, 5, &modinfo->modulus, 1) <= 0); /* f <= modulus */
  614|  32.4k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, 5, &modinfo->modulus, -1) > 0); /* g > -modulus */
  615|  32.4k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, 5, &modinfo->modulus, 1) < 0);  /* g <  modulus */
  616|  32.4k|    }
  617|       |
  618|       |    /* At this point sufficient iterations have been performed that g must have reached 0
  619|       |     * and (if g was not originally 0) f must now equal +/- GCD of the initial f, g
  620|       |     * values i.e. +/- 1, and d now contains +/- the modular inverse. */
  621|       |
  622|       |    /* g == 0 */
  623|  3.24k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, 5, &SECP256K1_SIGNED62_ONE, 0) == 0);
  624|       |    /* |f| == 1, or (x == 0 and d == 0 and f == modulus) */
  625|  3.24k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, 5, &SECP256K1_SIGNED62_ONE, -1) == 0 ||
  626|  3.24k|                 secp256k1_modinv64_mul_cmp_62(&f, 5, &SECP256K1_SIGNED62_ONE, 1) == 0 ||
  627|  3.24k|                 (secp256k1_modinv64_mul_cmp_62(x, 5, &SECP256K1_SIGNED62_ONE, 0) == 0 &&
  628|  3.24k|                  secp256k1_modinv64_mul_cmp_62(&d, 5, &SECP256K1_SIGNED62_ONE, 0) == 0 &&
  629|  3.24k|                  secp256k1_modinv64_mul_cmp_62(&f, 5, &modinfo->modulus, 1) == 0));
  630|       |
  631|       |    /* Optionally negate d, normalize to [0,modulus), and return it. */
  632|  3.24k|    secp256k1_modinv64_normalize_62(&d, f.v[4], modinfo);
  633|  3.24k|    *x = d;
  634|  3.24k|}
secp256k1.c:secp256k1_modinv64_divsteps_59:
  167|  32.4k|static int64_t secp256k1_modinv64_divsteps_59(int64_t zeta, uint64_t f0, uint64_t g0, secp256k1_modinv64_trans2x2 *t) {
  168|       |    /* u,v,q,r are the elements of the transformation matrix being built up,
  169|       |     * starting with the identity matrix times 8 (because the caller expects
  170|       |     * a result scaled by 2^62). Semantically they are signed integers
  171|       |     * in range [-2^62,2^62], but here represented as unsigned mod 2^64. This
  172|       |     * permits left shifting (which is UB for negative numbers). The range
  173|       |     * being inside [-2^63,2^63) means that casting to signed works correctly.
  174|       |     */
  175|  32.4k|    uint64_t u = 8, v = 0, q = 0, r = 8;
  176|  32.4k|    volatile uint64_t c1, c2;
  177|  32.4k|    uint64_t mask1, mask2, f = f0, g = g0, x, y, z;
  178|  32.4k|    int i;
  179|       |
  180|  1.94M|    for (i = 3; i < 62; ++i) {
  ------------------
  |  Branch (180:17): [True: 1.91M, False: 32.4k]
  ------------------
  181|  1.91M|        VERIFY_CHECK((f & 1) == 1); /* f must always be odd */
  182|  1.91M|        VERIFY_CHECK((u * f0 + v * g0) == f << i);
  183|  1.91M|        VERIFY_CHECK((q * f0 + r * g0) == g << i);
  184|       |        /* Compute conditional masks for (zeta < 0) and for (g & 1). */
  185|  1.91M|        c1 = zeta >> 63;
  186|  1.91M|        mask1 = c1;
  187|  1.91M|        c2 = g & 1;
  188|  1.91M|        mask2 = -c2;
  189|       |        /* Compute x,y,z, conditionally negated versions of f,u,v. */
  190|  1.91M|        x = (f ^ mask1) - mask1;
  191|  1.91M|        y = (u ^ mask1) - mask1;
  192|  1.91M|        z = (v ^ mask1) - mask1;
  193|       |        /* Conditionally add x,y,z to g,q,r. */
  194|  1.91M|        g += x & mask2;
  195|  1.91M|        q += y & mask2;
  196|  1.91M|        r += z & mask2;
  197|       |        /* In what follows, c1 is a condition mask for (zeta < 0) and (g & 1). */
  198|  1.91M|        mask1 &= mask2;
  199|       |        /* Conditionally change zeta into -zeta-2 or zeta-1. */
  200|  1.91M|        zeta = (zeta ^ mask1) - 1;
  201|       |        /* Conditionally add g,q,r to f,u,v. */
  202|  1.91M|        f += g & mask1;
  203|  1.91M|        u += q & mask1;
  204|  1.91M|        v += r & mask1;
  205|       |        /* Shifts */
  206|  1.91M|        g >>= 1;
  207|  1.91M|        u <<= 1;
  208|  1.91M|        v <<= 1;
  209|       |        /* Bounds on zeta that follow from the bounds on iteration count (max 10*59 divsteps). */
  210|  1.91M|        VERIFY_CHECK(zeta >= -591 && zeta <= 591);
  211|  1.91M|    }
  212|       |    /* Return data in t and return value. */
  213|  32.4k|    t->u = (int64_t)u;
  214|  32.4k|    t->v = (int64_t)v;
  215|  32.4k|    t->q = (int64_t)q;
  216|  32.4k|    t->r = (int64_t)r;
  217|       |
  218|       |    /* The determinant of t must be a power of two. This guarantees that multiplication with t
  219|       |     * does not change the gcd of f and g, apart from adding a power-of-2 factor to it (which
  220|       |     * will be divided out again). As each divstep's individual matrix has determinant 2, the
  221|       |     * aggregate of 59 of them will have determinant 2^59. Multiplying with the initial
  222|       |     * 8*identity (which has determinant 2^6) means the overall outputs has determinant
  223|       |     * 2^65. */
  224|  32.4k|    VERIFY_CHECK(secp256k1_modinv64_det_check_pow2(t, 65, 0));
  225|       |
  226|  32.4k|    return zeta;
  227|  32.4k|}
secp256k1.c:secp256k1_modinv64_update_fg_62:
  500|  32.4k|static void secp256k1_modinv64_update_fg_62(secp256k1_modinv64_signed62 *f, secp256k1_modinv64_signed62 *g, const secp256k1_modinv64_trans2x2 *t) {
  501|  32.4k|    const uint64_t M62 = UINT64_MAX >> 2;
  502|  32.4k|    const int64_t f0 = f->v[0], f1 = f->v[1], f2 = f->v[2], f3 = f->v[3], f4 = f->v[4];
  503|  32.4k|    const int64_t g0 = g->v[0], g1 = g->v[1], g2 = g->v[2], g3 = g->v[3], g4 = g->v[4];
  504|  32.4k|    const int64_t u = t->u, v = t->v, q = t->q, r = t->r;
  505|  32.4k|    secp256k1_int128 cf, cg;
  506|       |    /* Start computing t*[f,g]. */
  507|  32.4k|    secp256k1_i128_mul(&cf, u, f0);
  508|  32.4k|    secp256k1_i128_accum_mul(&cf, v, g0);
  509|  32.4k|    secp256k1_i128_mul(&cg, q, f0);
  510|  32.4k|    secp256k1_i128_accum_mul(&cg, r, g0);
  511|       |    /* Verify that the bottom 62 bits of the result are zero, and then throw them away. */
  512|  32.4k|    VERIFY_CHECK((secp256k1_i128_to_u64(&cf) & M62) == 0); secp256k1_i128_rshift(&cf, 62);
  513|  32.4k|    VERIFY_CHECK((secp256k1_i128_to_u64(&cg) & M62) == 0); secp256k1_i128_rshift(&cg, 62);
  514|       |    /* Compute limb 1 of t*[f,g], and store it as output limb 0 (= down shift). */
  515|  32.4k|    secp256k1_i128_accum_mul(&cf, u, f1);
  516|  32.4k|    secp256k1_i128_accum_mul(&cf, v, g1);
  517|  32.4k|    secp256k1_i128_accum_mul(&cg, q, f1);
  518|  32.4k|    secp256k1_i128_accum_mul(&cg, r, g1);
  519|  32.4k|    f->v[0] = secp256k1_i128_to_u64(&cf) & M62; secp256k1_i128_rshift(&cf, 62);
  520|  32.4k|    g->v[0] = secp256k1_i128_to_u64(&cg) & M62; secp256k1_i128_rshift(&cg, 62);
  521|       |    /* Compute limb 2 of t*[f,g], and store it as output limb 1. */
  522|  32.4k|    secp256k1_i128_accum_mul(&cf, u, f2);
  523|  32.4k|    secp256k1_i128_accum_mul(&cf, v, g2);
  524|  32.4k|    secp256k1_i128_accum_mul(&cg, q, f2);
  525|  32.4k|    secp256k1_i128_accum_mul(&cg, r, g2);
  526|  32.4k|    f->v[1] = secp256k1_i128_to_u64(&cf) & M62; secp256k1_i128_rshift(&cf, 62);
  527|  32.4k|    g->v[1] = secp256k1_i128_to_u64(&cg) & M62; secp256k1_i128_rshift(&cg, 62);
  528|       |    /* Compute limb 3 of t*[f,g], and store it as output limb 2. */
  529|  32.4k|    secp256k1_i128_accum_mul(&cf, u, f3);
  530|  32.4k|    secp256k1_i128_accum_mul(&cf, v, g3);
  531|  32.4k|    secp256k1_i128_accum_mul(&cg, q, f3);
  532|  32.4k|    secp256k1_i128_accum_mul(&cg, r, g3);
  533|  32.4k|    f->v[2] = secp256k1_i128_to_u64(&cf) & M62; secp256k1_i128_rshift(&cf, 62);
  534|  32.4k|    g->v[2] = secp256k1_i128_to_u64(&cg) & M62; secp256k1_i128_rshift(&cg, 62);
  535|       |    /* Compute limb 4 of t*[f,g], and store it as output limb 3. */
  536|  32.4k|    secp256k1_i128_accum_mul(&cf, u, f4);
  537|  32.4k|    secp256k1_i128_accum_mul(&cf, v, g4);
  538|  32.4k|    secp256k1_i128_accum_mul(&cg, q, f4);
  539|  32.4k|    secp256k1_i128_accum_mul(&cg, r, g4);
  540|  32.4k|    f->v[3] = secp256k1_i128_to_u64(&cf) & M62; secp256k1_i128_rshift(&cf, 62);
  541|  32.4k|    g->v[3] = secp256k1_i128_to_u64(&cg) & M62; secp256k1_i128_rshift(&cg, 62);
  542|       |    /* What remains is limb 5 of t*[f,g]; store it as output limb 4. */
  543|  32.4k|    f->v[4] = secp256k1_i128_to_i64(&cf);
  544|  32.4k|    g->v[4] = secp256k1_i128_to_i64(&cg);
  545|  32.4k|}

secp256k1_xonly_pubkey_parse:
   29|  4.53k|int secp256k1_xonly_pubkey_parse(const secp256k1_context* ctx, secp256k1_xonly_pubkey *pubkey, const unsigned char *input32) {
   30|  4.53k|    secp256k1_ge pk;
   31|  4.53k|    secp256k1_fe x;
   32|       |
   33|  4.53k|    VERIFY_CHECK(ctx != NULL);
   34|  4.53k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  4.53k|#define ARG_CHECK(cond) do { \
  |  |   46|  4.53k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  4.53k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 4.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  4.53k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 4.53k]
  |  |  ------------------
  ------------------
   35|  4.53k|    memset(pubkey, 0, sizeof(*pubkey));
   36|  4.53k|    ARG_CHECK(input32 != NULL);
  ------------------
  |  |   45|  4.53k|#define ARG_CHECK(cond) do { \
  |  |   46|  4.53k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  4.53k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 4.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  4.53k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 4.53k]
  |  |  ------------------
  ------------------
   37|       |
   38|  4.53k|    if (!secp256k1_fe_set_b32_limit(&x, input32)) {
  ------------------
  |  |   88|  4.53k|#  define secp256k1_fe_set_b32_limit secp256k1_fe_impl_set_b32_limit
  ------------------
  |  Branch (38:9): [True: 0, False: 4.53k]
  ------------------
   39|      0|        return 0;
   40|      0|    }
   41|  4.53k|    if (!secp256k1_ge_set_xo_var(&pk, &x, 0)) {
  ------------------
  |  Branch (41:9): [True: 0, False: 4.53k]
  ------------------
   42|      0|        return 0;
   43|      0|    }
   44|  4.53k|    if (!secp256k1_ge_is_in_correct_subgroup(&pk)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 4.53k]
  ------------------
   45|      0|        return 0;
   46|      0|    }
   47|  4.53k|    secp256k1_xonly_pubkey_save(pubkey, &pk);
   48|  4.53k|    return 1;
   49|  4.53k|}
secp256k1_xonly_pubkey_serialize:
   51|  1.95k|int secp256k1_xonly_pubkey_serialize(const secp256k1_context* ctx, unsigned char *output32, const secp256k1_xonly_pubkey *pubkey) {
   52|  1.95k|    secp256k1_ge pk;
   53|       |
   54|  1.95k|    VERIFY_CHECK(ctx != NULL);
   55|  1.95k|    ARG_CHECK(output32 != NULL);
  ------------------
  |  |   45|  1.95k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.95k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  1.95k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 1.95k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.95k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 1.95k]
  |  |  ------------------
  ------------------
   56|  1.95k|    memset(output32, 0, 32);
   57|  1.95k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  1.95k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.95k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  1.95k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 1.95k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.95k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 1.95k]
  |  |  ------------------
  ------------------
   58|       |
   59|  1.95k|    if (!secp256k1_xonly_pubkey_load(ctx, &pk, pubkey)) {
  ------------------
  |  Branch (59:9): [True: 0, False: 1.95k]
  ------------------
   60|      0|        return 0;
   61|      0|    }
   62|  1.95k|    secp256k1_fe_get_b32(output32, &pk.x);
  ------------------
  |  |   89|  1.95k|#  define secp256k1_fe_get_b32 secp256k1_fe_impl_get_b32
  ------------------
   63|  1.95k|    return 1;
   64|  1.95k|}
secp256k1_xonly_pubkey_from_pubkey:
  106|  1.95k|int secp256k1_xonly_pubkey_from_pubkey(const secp256k1_context* ctx, secp256k1_xonly_pubkey *xonly_pubkey, int *pk_parity, const secp256k1_pubkey *pubkey) {
  107|  1.95k|    secp256k1_ge pk;
  108|  1.95k|    int tmp;
  109|       |
  110|  1.95k|    VERIFY_CHECK(ctx != NULL);
  111|  1.95k|    ARG_CHECK(xonly_pubkey != NULL);
  ------------------
  |  |   45|  1.95k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.95k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  1.95k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 1.95k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.95k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 1.95k]
  |  |  ------------------
  ------------------
  112|  1.95k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  1.95k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.95k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  1.95k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 1.95k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.95k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 1.95k]
  |  |  ------------------
  ------------------
  113|       |
  114|  1.95k|    if (!secp256k1_pubkey_load(ctx, &pk, pubkey)) {
  ------------------
  |  Branch (114:9): [True: 0, False: 1.95k]
  ------------------
  115|      0|        return 0;
  116|      0|    }
  117|  1.95k|    tmp = secp256k1_extrakeys_ge_even_y(&pk);
  118|  1.95k|    if (pk_parity != NULL) {
  ------------------
  |  Branch (118:9): [True: 1.95k, False: 0]
  ------------------
  119|  1.95k|        *pk_parity = tmp;
  120|  1.95k|    }
  121|  1.95k|    secp256k1_xonly_pubkey_save(xonly_pubkey, &pk);
  122|  1.95k|    return 1;
  123|  1.95k|}
secp256k1_xonly_pubkey_tweak_add:
  125|  1.95k|int secp256k1_xonly_pubkey_tweak_add(const secp256k1_context* ctx, secp256k1_pubkey *output_pubkey, const secp256k1_xonly_pubkey *internal_pubkey, const unsigned char *tweak32) {
  126|  1.95k|    secp256k1_ge pk;
  127|       |
  128|  1.95k|    VERIFY_CHECK(ctx != NULL);
  129|  1.95k|    ARG_CHECK(output_pubkey != NULL);
  ------------------
  |  |   45|  1.95k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.95k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  1.95k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 1.95k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.95k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 1.95k]
  |  |  ------------------
  ------------------
  130|  1.95k|    memset(output_pubkey, 0, sizeof(*output_pubkey));
  131|  1.95k|    ARG_CHECK(internal_pubkey != NULL);
  ------------------
  |  |   45|  1.95k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.95k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  1.95k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 1.95k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.95k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 1.95k]
  |  |  ------------------
  ------------------
  132|  1.95k|    ARG_CHECK(tweak32 != NULL);
  ------------------
  |  |   45|  1.95k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.95k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  1.95k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 1.95k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.95k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 1.95k]
  |  |  ------------------
  ------------------
  133|       |
  134|  1.95k|    if (!secp256k1_xonly_pubkey_load(ctx, &pk, internal_pubkey)
  ------------------
  |  Branch (134:9): [True: 0, False: 1.95k]
  ------------------
  135|  1.95k|        || !secp256k1_ec_pubkey_tweak_add_helper(&pk, tweak32)) {
  ------------------
  |  Branch (135:12): [True: 0, False: 1.95k]
  ------------------
  136|      0|        return 0;
  137|      0|    }
  138|  1.95k|    secp256k1_pubkey_save(output_pubkey, &pk);
  139|  1.95k|    return 1;
  140|  1.95k|}
secp256k1_xonly_pubkey_tweak_add_check:
  142|  1.29k|int secp256k1_xonly_pubkey_tweak_add_check(const secp256k1_context* ctx, const unsigned char *tweaked_pubkey32, int tweaked_pk_parity, const secp256k1_xonly_pubkey *internal_pubkey, const unsigned char *tweak32) {
  143|  1.29k|    secp256k1_ge pk;
  144|  1.29k|    unsigned char pk_expected32[32];
  145|       |
  146|  1.29k|    VERIFY_CHECK(ctx != NULL);
  147|  1.29k|    ARG_CHECK(internal_pubkey != NULL);
  ------------------
  |  |   45|  1.29k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.29k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  1.29k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 1.29k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.29k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 1.29k]
  |  |  ------------------
  ------------------
  148|  1.29k|    ARG_CHECK(tweaked_pubkey32 != NULL);
  ------------------
  |  |   45|  1.29k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.29k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  1.29k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 1.29k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.29k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 1.29k]
  |  |  ------------------
  ------------------
  149|  1.29k|    ARG_CHECK(tweak32 != NULL);
  ------------------
  |  |   45|  1.29k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.29k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  1.29k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 1.29k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.29k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 1.29k]
  |  |  ------------------
  ------------------
  150|       |
  151|  1.29k|    if (!secp256k1_xonly_pubkey_load(ctx, &pk, internal_pubkey)
  ------------------
  |  Branch (151:9): [True: 0, False: 1.29k]
  ------------------
  152|  1.29k|        || !secp256k1_ec_pubkey_tweak_add_helper(&pk, tweak32)) {
  ------------------
  |  Branch (152:12): [True: 0, False: 1.29k]
  ------------------
  153|      0|        return 0;
  154|      0|    }
  155|  1.29k|    secp256k1_fe_normalize_var(&pk.x);
  ------------------
  |  |   80|  1.29k|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
  156|  1.29k|    secp256k1_fe_normalize_var(&pk.y);
  ------------------
  |  |   80|  1.29k|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
  157|  1.29k|    secp256k1_fe_get_b32(pk_expected32, &pk.x);
  ------------------
  |  |   89|  1.29k|#  define secp256k1_fe_get_b32 secp256k1_fe_impl_get_b32
  ------------------
  158|       |
  159|  1.29k|    return secp256k1_memcmp_var(&pk_expected32, tweaked_pubkey32, 32) == 0
  ------------------
  |  Branch (159:12): [True: 1.29k, False: 0]
  ------------------
  160|  1.29k|            && secp256k1_fe_is_odd(&pk.y) == tweaked_pk_parity;
  ------------------
  |  |   85|  1.29k|#  define secp256k1_fe_is_odd secp256k1_fe_impl_is_odd
  ------------------
  |  Branch (160:16): [True: 1.29k, False: 0]
  ------------------
  161|  1.29k|}
secp256k1.c:secp256k1_xonly_pubkey_save:
   18|  6.49k|static SECP256K1_INLINE void secp256k1_xonly_pubkey_save(secp256k1_xonly_pubkey *pubkey, secp256k1_ge *ge) {
   19|       |#ifdef VERIFY
   20|       |    /* ensure that the group element's Y coordinate is even, as per definition of x-only public keys */
   21|       |    secp256k1_fe y = ge->y;
   22|       |    secp256k1_fe_normalize_var(&y);
   23|       |    VERIFY_CHECK(!secp256k1_fe_is_odd(&y));
   24|       |#endif
   25|       |
   26|  6.49k|    secp256k1_pubkey_save((secp256k1_pubkey *) pubkey, ge);
   27|  6.49k|}
secp256k1.c:secp256k1_xonly_pubkey_load:
   14|  5.20k|static SECP256K1_INLINE int secp256k1_xonly_pubkey_load(const secp256k1_context* ctx, secp256k1_ge *ge, const secp256k1_xonly_pubkey *pubkey) {
   15|  5.20k|    return secp256k1_pubkey_load(ctx, ge, (const secp256k1_pubkey *) pubkey);
   16|  5.20k|}
secp256k1.c:secp256k1_extrakeys_ge_even_y:
   95|  1.95k|static int secp256k1_extrakeys_ge_even_y(secp256k1_ge *r) {
   96|  1.95k|    int y_parity = 0;
   97|  1.95k|    VERIFY_CHECK(!secp256k1_ge_is_infinity(r));
   98|       |
   99|  1.95k|    if (secp256k1_fe_is_odd(&r->y)) {
  ------------------
  |  |   85|  1.95k|#  define secp256k1_fe_is_odd secp256k1_fe_impl_is_odd
  ------------------
  |  Branch (99:9): [True: 1.01k, False: 938]
  ------------------
  100|  1.01k|        secp256k1_fe_negate(&r->y, &r->y, 1);
  ------------------
  |  |  211|  1.01k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  1.01k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  1.01k|    switch(42) { \
  |  |  |  |   89|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   90|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:9): [True: 0, False: 1.01k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  1.01k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 1.01k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  1.01k|    } \
  |  |  |  |   94|  1.01k|    stmt; \
  |  |  |  |   95|  1.01k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 1.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  101|  1.01k|        y_parity = 1;
  102|  1.01k|    }
  103|  1.95k|    return y_parity;
  104|  1.95k|}

secp256k1.c:secp256k1_scalar_set_b32:
  147|  44.3k|static void secp256k1_scalar_set_b32(secp256k1_scalar *r, const unsigned char *b32, int *overflow) {
  148|  44.3k|    int over;
  149|  44.3k|    r->d[0] = secp256k1_read_be64(&b32[24]);
  150|  44.3k|    r->d[1] = secp256k1_read_be64(&b32[16]);
  151|  44.3k|    r->d[2] = secp256k1_read_be64(&b32[8]);
  152|  44.3k|    r->d[3] = secp256k1_read_be64(&b32[0]);
  153|  44.3k|    over = secp256k1_scalar_reduce(r, secp256k1_scalar_check_overflow(r));
  154|  44.3k|    if (overflow) {
  ------------------
  |  Branch (154:9): [True: 44.3k, False: 0]
  ------------------
  155|  44.3k|        *overflow = over;
  156|  44.3k|    }
  157|       |
  158|  44.3k|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  44.3k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  159|  44.3k|}
secp256k1.c:secp256k1_scalar_reduce:
   76|  60.6k|SECP256K1_INLINE static int secp256k1_scalar_reduce(secp256k1_scalar *r, unsigned int overflow) {
   77|  60.6k|    secp256k1_uint128 t;
   78|  60.6k|    VERIFY_CHECK(overflow <= 1);
   79|       |
   80|  60.6k|    secp256k1_u128_from_u64(&t, r->d[0]);
   81|  60.6k|    secp256k1_u128_accum_u64(&t, overflow * SECP256K1_N_C_0);
  ------------------
  |  |   22|  60.6k|#define SECP256K1_N_C_0 (~SECP256K1_N_0 + 1)
  |  |  ------------------
  |  |  |  |   16|  60.6k|#define SECP256K1_N_0 ((uint64_t)0xBFD25E8CD0364141ULL)
  |  |  ------------------
  ------------------
   82|  60.6k|    r->d[0] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
   83|  60.6k|    secp256k1_u128_accum_u64(&t, r->d[1]);
   84|  60.6k|    secp256k1_u128_accum_u64(&t, overflow * SECP256K1_N_C_1);
  ------------------
  |  |   23|  60.6k|#define SECP256K1_N_C_1 (~SECP256K1_N_1)
  |  |  ------------------
  |  |  |  |   17|  60.6k|#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL)
  |  |  ------------------
  ------------------
   85|  60.6k|    r->d[1] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
   86|  60.6k|    secp256k1_u128_accum_u64(&t, r->d[2]);
   87|  60.6k|    secp256k1_u128_accum_u64(&t, overflow * SECP256K1_N_C_2);
  ------------------
  |  |   24|  60.6k|#define SECP256K1_N_C_2 (1)
  ------------------
   88|  60.6k|    r->d[2] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
   89|  60.6k|    secp256k1_u128_accum_u64(&t, r->d[3]);
   90|  60.6k|    r->d[3] = secp256k1_u128_to_u64(&t);
   91|       |
   92|  60.6k|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  60.6k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
   93|  60.6k|    return overflow;
   94|  60.6k|}
secp256k1.c:secp256k1_scalar_check_overflow:
   64|  60.6k|SECP256K1_INLINE static int secp256k1_scalar_check_overflow(const secp256k1_scalar *a) {
   65|  60.6k|    int yes = 0;
   66|  60.6k|    int no = 0;
   67|  60.6k|    no |= (a->d[3] < SECP256K1_N_3); /* No need for a > check. */
  ------------------
  |  |   19|  60.6k|#define SECP256K1_N_3 ((uint64_t)0xFFFFFFFFFFFFFFFFULL)
  ------------------
   68|  60.6k|    no |= (a->d[2] < SECP256K1_N_2);
  ------------------
  |  |   18|  60.6k|#define SECP256K1_N_2 ((uint64_t)0xFFFFFFFFFFFFFFFEULL)
  ------------------
   69|  60.6k|    yes |= (a->d[2] > SECP256K1_N_2) & ~no;
  ------------------
  |  |   18|  60.6k|#define SECP256K1_N_2 ((uint64_t)0xFFFFFFFFFFFFFFFEULL)
  ------------------
   70|  60.6k|    no |= (a->d[1] < SECP256K1_N_1);
  ------------------
  |  |   17|  60.6k|#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL)
  ------------------
   71|  60.6k|    yes |= (a->d[1] > SECP256K1_N_1) & ~no;
  ------------------
  |  |   17|  60.6k|#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL)
  ------------------
   72|  60.6k|    yes |= (a->d[0] >= SECP256K1_N_0) & ~no;
  ------------------
  |  |   16|  60.6k|#define SECP256K1_N_0 ((uint64_t)0xBFD25E8CD0364141ULL)
  ------------------
   73|  60.6k|    return yes;
   74|  60.6k|}
secp256k1.c:secp256k1_scalar_is_high:
  244|  10.2k|static int secp256k1_scalar_is_high(const secp256k1_scalar *a) {
  245|  10.2k|    int yes = 0;
  246|  10.2k|    int no = 0;
  247|  10.2k|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|  10.2k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  248|       |
  249|  10.2k|    no |= (a->d[3] < SECP256K1_N_H_3);
  ------------------
  |  |   30|  10.2k|#define SECP256K1_N_H_3 ((uint64_t)0x7FFFFFFFFFFFFFFFULL)
  ------------------
  250|  10.2k|    yes |= (a->d[3] > SECP256K1_N_H_3) & ~no;
  ------------------
  |  |   30|  10.2k|#define SECP256K1_N_H_3 ((uint64_t)0x7FFFFFFFFFFFFFFFULL)
  ------------------
  251|  10.2k|    no |= (a->d[2] < SECP256K1_N_H_2) & ~yes; /* No need for a > check. */
  ------------------
  |  |   29|  10.2k|#define SECP256K1_N_H_2 ((uint64_t)0xFFFFFFFFFFFFFFFFULL)
  ------------------
  252|  10.2k|    no |= (a->d[1] < SECP256K1_N_H_1) & ~yes;
  ------------------
  |  |   28|  10.2k|#define SECP256K1_N_H_1 ((uint64_t)0x5D576E7357A4501DULL)
  ------------------
  253|  10.2k|    yes |= (a->d[1] > SECP256K1_N_H_1) & ~no;
  ------------------
  |  |   28|  10.2k|#define SECP256K1_N_H_1 ((uint64_t)0x5D576E7357A4501DULL)
  ------------------
  254|  10.2k|    yes |= (a->d[0] > SECP256K1_N_H_0) & ~no;
  ------------------
  |  |   27|  10.2k|#define SECP256K1_N_H_0 ((uint64_t)0xDFE92F46681B20A0ULL)
  ------------------
  255|  10.2k|    return yes;
  256|  10.2k|}
secp256k1.c:secp256k1_scalar_negate:
  176|  3.24k|static void secp256k1_scalar_negate(secp256k1_scalar *r, const secp256k1_scalar *a) {
  177|  3.24k|    uint64_t nonzero = 0xFFFFFFFFFFFFFFFFULL * (secp256k1_scalar_is_zero(a) == 0);
  178|  3.24k|    secp256k1_uint128 t;
  179|  3.24k|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|  3.24k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  180|       |
  181|  3.24k|    secp256k1_u128_from_u64(&t, ~a->d[0]);
  182|  3.24k|    secp256k1_u128_accum_u64(&t, SECP256K1_N_0 + 1);
  ------------------
  |  |   16|  3.24k|#define SECP256K1_N_0 ((uint64_t)0xBFD25E8CD0364141ULL)
  ------------------
  183|  3.24k|    r->d[0] = secp256k1_u128_to_u64(&t) & nonzero; secp256k1_u128_rshift(&t, 64);
  184|  3.24k|    secp256k1_u128_accum_u64(&t, ~a->d[1]);
  185|  3.24k|    secp256k1_u128_accum_u64(&t, SECP256K1_N_1);
  ------------------
  |  |   17|  3.24k|#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL)
  ------------------
  186|  3.24k|    r->d[1] = secp256k1_u128_to_u64(&t) & nonzero; secp256k1_u128_rshift(&t, 64);
  187|  3.24k|    secp256k1_u128_accum_u64(&t, ~a->d[2]);
  188|  3.24k|    secp256k1_u128_accum_u64(&t, SECP256K1_N_2);
  ------------------
  |  |   18|  3.24k|#define SECP256K1_N_2 ((uint64_t)0xFFFFFFFFFFFFFFFEULL)
  ------------------
  189|  3.24k|    r->d[2] = secp256k1_u128_to_u64(&t) & nonzero; secp256k1_u128_rshift(&t, 64);
  190|  3.24k|    secp256k1_u128_accum_u64(&t, ~a->d[3]);
  191|  3.24k|    secp256k1_u128_accum_u64(&t, SECP256K1_N_3);
  ------------------
  |  |   19|  3.24k|#define SECP256K1_N_3 ((uint64_t)0xFFFFFFFFFFFFFFFFULL)
  ------------------
  192|  3.24k|    r->d[3] = secp256k1_u128_to_u64(&t) & nonzero;
  193|       |
  194|  3.24k|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  3.24k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  195|  3.24k|}
secp256k1.c:secp256k1_scalar_mul_shift_var:
  893|  6.49k|SECP256K1_INLINE static void secp256k1_scalar_mul_shift_var(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b, unsigned int shift) {
  894|  6.49k|    uint64_t l[8];
  895|  6.49k|    unsigned int shiftlimbs;
  896|  6.49k|    unsigned int shiftlow;
  897|  6.49k|    unsigned int shifthigh;
  898|  6.49k|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|  6.49k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  899|  6.49k|    SECP256K1_SCALAR_VERIFY(b);
  ------------------
  |  |  103|  6.49k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  900|  6.49k|    VERIFY_CHECK(shift >= 256);
  901|       |
  902|  6.49k|    secp256k1_scalar_mul_512(l, a, b);
  903|  6.49k|    shiftlimbs = shift >> 6;
  904|  6.49k|    shiftlow = shift & 0x3F;
  905|  6.49k|    shifthigh = 64 - shiftlow;
  906|  6.49k|    r->d[0] = shift < 512 ? (l[0 + shiftlimbs] >> shiftlow | (shift < 448 && shiftlow ? (l[1 + shiftlimbs] << shifthigh) : 0)) : 0;
  ------------------
  |  Branch (906:15): [True: 6.49k, False: 0]
  |  Branch (906:63): [True: 6.49k, False: 0]
  |  Branch (906:78): [True: 0, False: 6.49k]
  ------------------
  907|  6.49k|    r->d[1] = shift < 448 ? (l[1 + shiftlimbs] >> shiftlow | (shift < 384 && shiftlow ? (l[2 + shiftlimbs] << shifthigh) : 0)) : 0;
  ------------------
  |  Branch (907:15): [True: 6.49k, False: 0]
  |  Branch (907:63): [True: 0, False: 6.49k]
  |  Branch (907:78): [True: 0, False: 0]
  ------------------
  908|  6.49k|    r->d[2] = shift < 384 ? (l[2 + shiftlimbs] >> shiftlow | (shift < 320 && shiftlow ? (l[3 + shiftlimbs] << shifthigh) : 0)) : 0;
  ------------------
  |  Branch (908:15): [True: 0, False: 6.49k]
  |  Branch (908:63): [True: 0, False: 0]
  |  Branch (908:78): [True: 0, False: 0]
  ------------------
  909|  6.49k|    r->d[3] = shift < 320 ? (l[3 + shiftlimbs] >> shiftlow) : 0;
  ------------------
  |  Branch (909:15): [True: 0, False: 6.49k]
  ------------------
  910|  6.49k|    secp256k1_scalar_cadd_bit(r, 0, (l[(shift - 1) >> 6] >> ((shift - 1) & 0x3f)) & 1);
  911|       |
  912|  6.49k|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  6.49k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  913|  6.49k|}
secp256k1.c:secp256k1_scalar_mul_512:
  682|  16.2k|static void secp256k1_scalar_mul_512(uint64_t *l8, const secp256k1_scalar *a, const secp256k1_scalar *b) {
  683|  16.2k|#ifdef USE_ASM_X86_64
  684|  16.2k|    const uint64_t *pb = b->d;
  685|  16.2k|    __asm__ __volatile__(
  686|       |    /* Preload */
  687|  16.2k|    "movq 0(%%rdi), %%r15\n"
  688|  16.2k|    "movq 8(%%rdi), %%rbx\n"
  689|  16.2k|    "movq 16(%%rdi), %%rcx\n"
  690|  16.2k|    "movq 0(%%rdx), %%r11\n"
  691|  16.2k|    "movq 8(%%rdx), %%r12\n"
  692|  16.2k|    "movq 16(%%rdx), %%r13\n"
  693|  16.2k|    "movq 24(%%rdx), %%r14\n"
  694|       |    /* (rax,rdx) = a0 * b0 */
  695|  16.2k|    "movq %%r15, %%rax\n"
  696|  16.2k|    "mulq %%r11\n"
  697|       |    /* Extract l8[0] */
  698|  16.2k|    "movq %%rax, 0(%%rsi)\n"
  699|       |    /* (r8,r9,r10) = (rdx) */
  700|  16.2k|    "movq %%rdx, %%r8\n"
  701|  16.2k|    "xorq %%r9, %%r9\n"
  702|  16.2k|    "xorq %%r10, %%r10\n"
  703|       |    /* (r8,r9,r10) += a0 * b1 */
  704|  16.2k|    "movq %%r15, %%rax\n"
  705|  16.2k|    "mulq %%r12\n"
  706|  16.2k|    "addq %%rax, %%r8\n"
  707|  16.2k|    "adcq %%rdx, %%r9\n"
  708|  16.2k|    "adcq $0, %%r10\n"
  709|       |    /* (r8,r9,r10) += a1 * b0 */
  710|  16.2k|    "movq %%rbx, %%rax\n"
  711|  16.2k|    "mulq %%r11\n"
  712|  16.2k|    "addq %%rax, %%r8\n"
  713|  16.2k|    "adcq %%rdx, %%r9\n"
  714|  16.2k|    "adcq $0, %%r10\n"
  715|       |    /* Extract l8[1] */
  716|  16.2k|    "movq %%r8, 8(%%rsi)\n"
  717|  16.2k|    "xorq %%r8, %%r8\n"
  718|       |    /* (r9,r10,r8) += a0 * b2 */
  719|  16.2k|    "movq %%r15, %%rax\n"
  720|  16.2k|    "mulq %%r13\n"
  721|  16.2k|    "addq %%rax, %%r9\n"
  722|  16.2k|    "adcq %%rdx, %%r10\n"
  723|  16.2k|    "adcq $0, %%r8\n"
  724|       |    /* (r9,r10,r8) += a1 * b1 */
  725|  16.2k|    "movq %%rbx, %%rax\n"
  726|  16.2k|    "mulq %%r12\n"
  727|  16.2k|    "addq %%rax, %%r9\n"
  728|  16.2k|    "adcq %%rdx, %%r10\n"
  729|  16.2k|    "adcq $0, %%r8\n"
  730|       |    /* (r9,r10,r8) += a2 * b0 */
  731|  16.2k|    "movq %%rcx, %%rax\n"
  732|  16.2k|    "mulq %%r11\n"
  733|  16.2k|    "addq %%rax, %%r9\n"
  734|  16.2k|    "adcq %%rdx, %%r10\n"
  735|  16.2k|    "adcq $0, %%r8\n"
  736|       |    /* Extract l8[2] */
  737|  16.2k|    "movq %%r9, 16(%%rsi)\n"
  738|  16.2k|    "xorq %%r9, %%r9\n"
  739|       |    /* (r10,r8,r9) += a0 * b3 */
  740|  16.2k|    "movq %%r15, %%rax\n"
  741|  16.2k|    "mulq %%r14\n"
  742|  16.2k|    "addq %%rax, %%r10\n"
  743|  16.2k|    "adcq %%rdx, %%r8\n"
  744|  16.2k|    "adcq $0, %%r9\n"
  745|       |    /* Preload a3 */
  746|  16.2k|    "movq 24(%%rdi), %%r15\n"
  747|       |    /* (r10,r8,r9) += a1 * b2 */
  748|  16.2k|    "movq %%rbx, %%rax\n"
  749|  16.2k|    "mulq %%r13\n"
  750|  16.2k|    "addq %%rax, %%r10\n"
  751|  16.2k|    "adcq %%rdx, %%r8\n"
  752|  16.2k|    "adcq $0, %%r9\n"
  753|       |    /* (r10,r8,r9) += a2 * b1 */
  754|  16.2k|    "movq %%rcx, %%rax\n"
  755|  16.2k|    "mulq %%r12\n"
  756|  16.2k|    "addq %%rax, %%r10\n"
  757|  16.2k|    "adcq %%rdx, %%r8\n"
  758|  16.2k|    "adcq $0, %%r9\n"
  759|       |    /* (r10,r8,r9) += a3 * b0 */
  760|  16.2k|    "movq %%r15, %%rax\n"
  761|  16.2k|    "mulq %%r11\n"
  762|  16.2k|    "addq %%rax, %%r10\n"
  763|  16.2k|    "adcq %%rdx, %%r8\n"
  764|  16.2k|    "adcq $0, %%r9\n"
  765|       |    /* Extract l8[3] */
  766|  16.2k|    "movq %%r10, 24(%%rsi)\n"
  767|  16.2k|    "xorq %%r10, %%r10\n"
  768|       |    /* (r8,r9,r10) += a1 * b3 */
  769|  16.2k|    "movq %%rbx, %%rax\n"
  770|  16.2k|    "mulq %%r14\n"
  771|  16.2k|    "addq %%rax, %%r8\n"
  772|  16.2k|    "adcq %%rdx, %%r9\n"
  773|  16.2k|    "adcq $0, %%r10\n"
  774|       |    /* (r8,r9,r10) += a2 * b2 */
  775|  16.2k|    "movq %%rcx, %%rax\n"
  776|  16.2k|    "mulq %%r13\n"
  777|  16.2k|    "addq %%rax, %%r8\n"
  778|  16.2k|    "adcq %%rdx, %%r9\n"
  779|  16.2k|    "adcq $0, %%r10\n"
  780|       |    /* (r8,r9,r10) += a3 * b1 */
  781|  16.2k|    "movq %%r15, %%rax\n"
  782|  16.2k|    "mulq %%r12\n"
  783|  16.2k|    "addq %%rax, %%r8\n"
  784|  16.2k|    "adcq %%rdx, %%r9\n"
  785|  16.2k|    "adcq $0, %%r10\n"
  786|       |    /* Extract l8[4] */
  787|  16.2k|    "movq %%r8, 32(%%rsi)\n"
  788|  16.2k|    "xorq %%r8, %%r8\n"
  789|       |    /* (r9,r10,r8) += a2 * b3 */
  790|  16.2k|    "movq %%rcx, %%rax\n"
  791|  16.2k|    "mulq %%r14\n"
  792|  16.2k|    "addq %%rax, %%r9\n"
  793|  16.2k|    "adcq %%rdx, %%r10\n"
  794|  16.2k|    "adcq $0, %%r8\n"
  795|       |    /* (r9,r10,r8) += a3 * b2 */
  796|  16.2k|    "movq %%r15, %%rax\n"
  797|  16.2k|    "mulq %%r13\n"
  798|  16.2k|    "addq %%rax, %%r9\n"
  799|  16.2k|    "adcq %%rdx, %%r10\n"
  800|  16.2k|    "adcq $0, %%r8\n"
  801|       |    /* Extract l8[5] */
  802|  16.2k|    "movq %%r9, 40(%%rsi)\n"
  803|       |    /* (r10,r8) += a3 * b3 */
  804|  16.2k|    "movq %%r15, %%rax\n"
  805|  16.2k|    "mulq %%r14\n"
  806|  16.2k|    "addq %%rax, %%r10\n"
  807|  16.2k|    "adcq %%rdx, %%r8\n"
  808|       |    /* Extract l8[6] */
  809|  16.2k|    "movq %%r10, 48(%%rsi)\n"
  810|       |    /* Extract l8[7] */
  811|  16.2k|    "movq %%r8, 56(%%rsi)\n"
  812|  16.2k|    : "+d"(pb)
  813|  16.2k|    : "S"(l8), "D"(a->d)
  814|  16.2k|    : "rax", "rbx", "rcx", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", "cc", "memory");
  815|       |
  816|  16.2k|    SECP256K1_CHECKMEM_MSAN_DEFINE(l8, sizeof(*l8) * 8);
  ------------------
  |  |   70|  16.2k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  16.2k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 16.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  817|       |
  818|       |#else
  819|       |    /* 160 bit accumulator. */
  820|       |    uint64_t c0 = 0, c1 = 0;
  821|       |    uint32_t c2 = 0;
  822|       |
  823|       |    /* l8[0..7] = a[0..3] * b[0..3]. */
  824|       |    muladd_fast(a->d[0], b->d[0]);
  825|       |    extract_fast(l8[0]);
  826|       |    muladd(a->d[0], b->d[1]);
  827|       |    muladd(a->d[1], b->d[0]);
  828|       |    extract(l8[1]);
  829|       |    muladd(a->d[0], b->d[2]);
  830|       |    muladd(a->d[1], b->d[1]);
  831|       |    muladd(a->d[2], b->d[0]);
  832|       |    extract(l8[2]);
  833|       |    muladd(a->d[0], b->d[3]);
  834|       |    muladd(a->d[1], b->d[2]);
  835|       |    muladd(a->d[2], b->d[1]);
  836|       |    muladd(a->d[3], b->d[0]);
  837|       |    extract(l8[3]);
  838|       |    muladd(a->d[1], b->d[3]);
  839|       |    muladd(a->d[2], b->d[2]);
  840|       |    muladd(a->d[3], b->d[1]);
  841|       |    extract(l8[4]);
  842|       |    muladd(a->d[2], b->d[3]);
  843|       |    muladd(a->d[3], b->d[2]);
  844|       |    extract(l8[5]);
  845|       |    muladd_fast(a->d[3], b->d[3]);
  846|       |    extract_fast(l8[6]);
  847|       |    VERIFY_CHECK(c1 == 0);
  848|       |    l8[7] = c0;
  849|       |#endif
  850|  16.2k|}
secp256k1.c:secp256k1_scalar_cadd_bit:
  122|  6.49k|static void secp256k1_scalar_cadd_bit(secp256k1_scalar *r, unsigned int bit, int flag) {
  123|  6.49k|    secp256k1_uint128 t;
  124|  6.49k|    volatile int vflag = flag;
  125|  6.49k|    VERIFY_CHECK(flag == 0 || flag == 1);
  126|  6.49k|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  6.49k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  127|  6.49k|    VERIFY_CHECK(bit < 256);
  128|       |
  129|  6.49k|    bit += ((uint32_t) vflag - 1) & 0x100;  /* forcing (bit >> 6) > 3 makes this a noop */
  130|  6.49k|    secp256k1_u128_from_u64(&t, r->d[0]);
  131|  6.49k|    secp256k1_u128_accum_u64(&t, ((uint64_t)((bit >> 6) == 0)) << (bit & 0x3F));
  132|  6.49k|    r->d[0] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
  133|  6.49k|    secp256k1_u128_accum_u64(&t, r->d[1]);
  134|  6.49k|    secp256k1_u128_accum_u64(&t, ((uint64_t)((bit >> 6) == 1)) << (bit & 0x3F));
  135|  6.49k|    r->d[1] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
  136|  6.49k|    secp256k1_u128_accum_u64(&t, r->d[2]);
  137|  6.49k|    secp256k1_u128_accum_u64(&t, ((uint64_t)((bit >> 6) == 2)) << (bit & 0x3F));
  138|  6.49k|    r->d[2] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
  139|  6.49k|    secp256k1_u128_accum_u64(&t, r->d[3]);
  140|  6.49k|    secp256k1_u128_accum_u64(&t, ((uint64_t)((bit >> 6) == 3)) << (bit & 0x3F));
  141|  6.49k|    r->d[3] = secp256k1_u128_to_u64(&t);
  142|       |
  143|  6.49k|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  6.49k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  144|  6.49k|    VERIFY_CHECK(secp256k1_u128_hi_u64(&t) == 0);
  145|  6.49k|}
secp256k1.c:secp256k1_scalar_split_128:
  870|  3.24k|static void secp256k1_scalar_split_128(secp256k1_scalar *r1, secp256k1_scalar *r2, const secp256k1_scalar *k) {
  871|  3.24k|    SECP256K1_SCALAR_VERIFY(k);
  ------------------
  |  |  103|  3.24k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  872|       |
  873|  3.24k|    r1->d[0] = k->d[0];
  874|  3.24k|    r1->d[1] = k->d[1];
  875|  3.24k|    r1->d[2] = 0;
  876|  3.24k|    r1->d[3] = 0;
  877|  3.24k|    r2->d[0] = k->d[2];
  878|  3.24k|    r2->d[1] = k->d[3];
  879|  3.24k|    r2->d[2] = 0;
  880|  3.24k|    r2->d[3] = 0;
  881|       |
  882|  3.24k|    SECP256K1_SCALAR_VERIFY(r1);
  ------------------
  |  |  103|  3.24k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  883|  3.24k|    SECP256K1_SCALAR_VERIFY(r2);
  ------------------
  |  |  103|  3.24k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  884|  3.24k|}
secp256k1.c:secp256k1_scalar_get_bits_limb32:
   41|   948k|SECP256K1_INLINE static uint32_t secp256k1_scalar_get_bits_limb32(const secp256k1_scalar *a, unsigned int offset, unsigned int count) {
   42|   948k|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|   948k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
   43|   948k|    VERIFY_CHECK(count > 0 && count <= 32);
   44|   948k|    VERIFY_CHECK(offset <= 256 - count);
   45|   948k|    VERIFY_CHECK((offset + count - 1) >> 5 == offset >> 5);
   46|       |
   47|   948k|    return (a->d[offset >> 6] >> (offset & 0x3F)) & (0xFFFFFFFF >> (32 - count));
   48|   948k|}
secp256k1.c:secp256k1_scalar_get_bits_var:
   50|  58.3k|SECP256K1_INLINE static uint32_t secp256k1_scalar_get_bits_var(const secp256k1_scalar *a, unsigned int offset, unsigned int count) {
   51|  58.3k|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|  58.3k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
   52|  58.3k|    VERIFY_CHECK(count > 0 && count <= 32);
   53|  58.3k|    VERIFY_CHECK(offset <= 256 - count);
   54|       |
   55|  58.3k|    if ((offset + count - 1) >> 6 == offset >> 6) {
  ------------------
  |  Branch (55:9): [True: 48.4k, False: 9.86k]
  ------------------
   56|  48.4k|        return (a->d[offset >> 6] >> (offset & 0x3F)) & (0xFFFFFFFF >> (32 - count));
   57|  48.4k|    } else {
   58|  9.86k|        VERIFY_CHECK((offset >> 6) + 1 < 4);
   59|  9.86k|        VERIFY_CHECK((offset & 0x3F) > 0);
   60|  9.86k|        return ((a->d[offset >> 6] >> (offset & 0x3F)) | (a->d[(offset >> 6) + 1] << (64 - (offset & 0x3F)))) & (0xFFFFFFFF >> (32 - count));
   61|  9.86k|    }
   62|  58.3k|}
secp256k1.c:secp256k1_scalar_is_zero:
  170|  6.49k|SECP256K1_INLINE static int secp256k1_scalar_is_zero(const secp256k1_scalar *a) {
  171|  6.49k|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|  6.49k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  172|       |
  173|  6.49k|    return (a->d[0] | a->d[1] | a->d[2] | a->d[3]) == 0;
  174|  6.49k|}
secp256k1.c:secp256k1_scalar_mul:
  859|  9.73k|static void secp256k1_scalar_mul(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b) {
  860|  9.73k|    uint64_t l[8];
  861|  9.73k|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|  9.73k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  862|  9.73k|    SECP256K1_SCALAR_VERIFY(b);
  ------------------
  |  |  103|  9.73k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  863|       |
  864|  9.73k|    secp256k1_scalar_mul_512(l, a, b);
  865|  9.73k|    secp256k1_scalar_reduce_512(r, l);
  866|       |
  867|  9.73k|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  9.73k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  868|  9.73k|}
secp256k1.c:secp256k1_scalar_reduce_512:
  351|  9.73k|static void secp256k1_scalar_reduce_512(secp256k1_scalar *r, const uint64_t *l) {
  352|  9.73k|#ifdef USE_ASM_X86_64
  353|       |    /* Reduce 512 bits into 385. */
  354|  9.73k|    uint64_t m0, m1, m2, m3, m4, m5, m6;
  355|  9.73k|    uint64_t p0, p1, p2, p3, p4;
  356|  9.73k|    uint64_t c;
  357|       |
  358|  9.73k|    __asm__ __volatile__(
  359|       |    /* Preload. */
  360|  9.73k|    "movq 32(%%rsi), %%r11\n"
  361|  9.73k|    "movq 40(%%rsi), %%r12\n"
  362|  9.73k|    "movq 48(%%rsi), %%r13\n"
  363|  9.73k|    "movq 56(%%rsi), %%r14\n"
  364|       |    /* Initialize r8,r9,r10 */
  365|  9.73k|    "movq 0(%%rsi), %%r8\n"
  366|  9.73k|    "xorq %%r9, %%r9\n"
  367|  9.73k|    "xorq %%r10, %%r10\n"
  368|       |    /* (r8,r9) += n0 * c0 */
  369|  9.73k|    "movq %8, %%rax\n"
  370|  9.73k|    "mulq %%r11\n"
  371|  9.73k|    "addq %%rax, %%r8\n"
  372|  9.73k|    "adcq %%rdx, %%r9\n"
  373|       |    /* extract m0 */
  374|  9.73k|    "movq %%r8, %q0\n"
  375|  9.73k|    "xorq %%r8, %%r8\n"
  376|       |    /* (r9,r10) += l1 */
  377|  9.73k|    "addq 8(%%rsi), %%r9\n"
  378|  9.73k|    "adcq $0, %%r10\n"
  379|       |    /* (r9,r10,r8) += n1 * c0 */
  380|  9.73k|    "movq %8, %%rax\n"
  381|  9.73k|    "mulq %%r12\n"
  382|  9.73k|    "addq %%rax, %%r9\n"
  383|  9.73k|    "adcq %%rdx, %%r10\n"
  384|  9.73k|    "adcq $0, %%r8\n"
  385|       |    /* (r9,r10,r8) += n0 * c1 */
  386|  9.73k|    "movq %9, %%rax\n"
  387|  9.73k|    "mulq %%r11\n"
  388|  9.73k|    "addq %%rax, %%r9\n"
  389|  9.73k|    "adcq %%rdx, %%r10\n"
  390|  9.73k|    "adcq $0, %%r8\n"
  391|       |    /* extract m1 */
  392|  9.73k|    "movq %%r9, %q1\n"
  393|  9.73k|    "xorq %%r9, %%r9\n"
  394|       |    /* (r10,r8,r9) += l2 */
  395|  9.73k|    "addq 16(%%rsi), %%r10\n"
  396|  9.73k|    "adcq $0, %%r8\n"
  397|  9.73k|    "adcq $0, %%r9\n"
  398|       |    /* (r10,r8,r9) += n2 * c0 */
  399|  9.73k|    "movq %8, %%rax\n"
  400|  9.73k|    "mulq %%r13\n"
  401|  9.73k|    "addq %%rax, %%r10\n"
  402|  9.73k|    "adcq %%rdx, %%r8\n"
  403|  9.73k|    "adcq $0, %%r9\n"
  404|       |    /* (r10,r8,r9) += n1 * c1 */
  405|  9.73k|    "movq %9, %%rax\n"
  406|  9.73k|    "mulq %%r12\n"
  407|  9.73k|    "addq %%rax, %%r10\n"
  408|  9.73k|    "adcq %%rdx, %%r8\n"
  409|  9.73k|    "adcq $0, %%r9\n"
  410|       |    /* (r10,r8,r9) += n0 */
  411|  9.73k|    "addq %%r11, %%r10\n"
  412|  9.73k|    "adcq $0, %%r8\n"
  413|  9.73k|    "adcq $0, %%r9\n"
  414|       |    /* extract m2 */
  415|  9.73k|    "movq %%r10, %q2\n"
  416|  9.73k|    "xorq %%r10, %%r10\n"
  417|       |    /* (r8,r9,r10) += l3 */
  418|  9.73k|    "addq 24(%%rsi), %%r8\n"
  419|  9.73k|    "adcq $0, %%r9\n"
  420|  9.73k|    "adcq $0, %%r10\n"
  421|       |    /* (r8,r9,r10) += n3 * c0 */
  422|  9.73k|    "movq %8, %%rax\n"
  423|  9.73k|    "mulq %%r14\n"
  424|  9.73k|    "addq %%rax, %%r8\n"
  425|  9.73k|    "adcq %%rdx, %%r9\n"
  426|  9.73k|    "adcq $0, %%r10\n"
  427|       |    /* (r8,r9,r10) += n2 * c1 */
  428|  9.73k|    "movq %9, %%rax\n"
  429|  9.73k|    "mulq %%r13\n"
  430|  9.73k|    "addq %%rax, %%r8\n"
  431|  9.73k|    "adcq %%rdx, %%r9\n"
  432|  9.73k|    "adcq $0, %%r10\n"
  433|       |    /* (r8,r9,r10) += n1 */
  434|  9.73k|    "addq %%r12, %%r8\n"
  435|  9.73k|    "adcq $0, %%r9\n"
  436|  9.73k|    "adcq $0, %%r10\n"
  437|       |    /* extract m3 */
  438|  9.73k|    "movq %%r8, %q3\n"
  439|  9.73k|    "xorq %%r8, %%r8\n"
  440|       |    /* (r9,r10,r8) += n3 * c1 */
  441|  9.73k|    "movq %9, %%rax\n"
  442|  9.73k|    "mulq %%r14\n"
  443|  9.73k|    "addq %%rax, %%r9\n"
  444|  9.73k|    "adcq %%rdx, %%r10\n"
  445|  9.73k|    "adcq $0, %%r8\n"
  446|       |    /* (r9,r10,r8) += n2 */
  447|  9.73k|    "addq %%r13, %%r9\n"
  448|  9.73k|    "adcq $0, %%r10\n"
  449|  9.73k|    "adcq $0, %%r8\n"
  450|       |    /* extract m4 */
  451|  9.73k|    "movq %%r9, %q4\n"
  452|       |    /* (r10,r8) += n3 */
  453|  9.73k|    "addq %%r14, %%r10\n"
  454|  9.73k|    "adcq $0, %%r8\n"
  455|       |    /* extract m5 */
  456|  9.73k|    "movq %%r10, %q5\n"
  457|       |    /* extract m6 */
  458|  9.73k|    "movq %%r8, %q6\n"
  459|  9.73k|    : "=&g"(m0), "=&g"(m1), "=&g"(m2), "=g"(m3), "=g"(m4), "=g"(m5), "=g"(m6)
  460|  9.73k|    : "S"(l), "i"(SECP256K1_N_C_0), "i"(SECP256K1_N_C_1)
  ------------------
  |  |   22|  9.73k|#define SECP256K1_N_C_0 (~SECP256K1_N_0 + 1)
  |  |  ------------------
  |  |  |  |   16|  9.73k|#define SECP256K1_N_0 ((uint64_t)0xBFD25E8CD0364141ULL)
  |  |  ------------------
  ------------------
                  : "S"(l), "i"(SECP256K1_N_C_0), "i"(SECP256K1_N_C_1)
  ------------------
  |  |   23|  9.73k|#define SECP256K1_N_C_1 (~SECP256K1_N_1)
  |  |  ------------------
  |  |  |  |   17|  9.73k|#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL)
  |  |  ------------------
  ------------------
  461|  9.73k|    : "rax", "rdx", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "cc");
  462|       |
  463|  9.73k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&m0, sizeof(m0));
  ------------------
  |  |   70|  9.73k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  9.73k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 9.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  464|  9.73k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&m1, sizeof(m1));
  ------------------
  |  |   70|  9.73k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  9.73k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 9.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  465|  9.73k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&m2, sizeof(m2));
  ------------------
  |  |   70|  9.73k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  9.73k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 9.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  466|  9.73k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&m3, sizeof(m3));
  ------------------
  |  |   70|  9.73k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  9.73k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 9.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  467|  9.73k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&m4, sizeof(m4));
  ------------------
  |  |   70|  9.73k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  9.73k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 9.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  468|  9.73k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&m5, sizeof(m5));
  ------------------
  |  |   70|  9.73k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  9.73k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 9.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  469|  9.73k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&m6, sizeof(m6));
  ------------------
  |  |   70|  9.73k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  9.73k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 9.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  470|       |
  471|       |    /* Reduce 385 bits into 258. */
  472|  9.73k|    __asm__ __volatile__(
  473|       |    /* Preload */
  474|  9.73k|    "movq %q9, %%r11\n"
  475|  9.73k|    "movq %q10, %%r12\n"
  476|  9.73k|    "movq %q11, %%r13\n"
  477|       |    /* Initialize (r8,r9,r10) */
  478|  9.73k|    "movq %q5, %%r8\n"
  479|  9.73k|    "xorq %%r9, %%r9\n"
  480|  9.73k|    "xorq %%r10, %%r10\n"
  481|       |    /* (r8,r9) += m4 * c0 */
  482|  9.73k|    "movq %12, %%rax\n"
  483|  9.73k|    "mulq %%r11\n"
  484|  9.73k|    "addq %%rax, %%r8\n"
  485|  9.73k|    "adcq %%rdx, %%r9\n"
  486|       |    /* extract p0 */
  487|  9.73k|    "movq %%r8, %q0\n"
  488|  9.73k|    "xorq %%r8, %%r8\n"
  489|       |    /* (r9,r10) += m1 */
  490|  9.73k|    "addq %q6, %%r9\n"
  491|  9.73k|    "adcq $0, %%r10\n"
  492|       |    /* (r9,r10,r8) += m5 * c0 */
  493|  9.73k|    "movq %12, %%rax\n"
  494|  9.73k|    "mulq %%r12\n"
  495|  9.73k|    "addq %%rax, %%r9\n"
  496|  9.73k|    "adcq %%rdx, %%r10\n"
  497|  9.73k|    "adcq $0, %%r8\n"
  498|       |    /* (r9,r10,r8) += m4 * c1 */
  499|  9.73k|    "movq %13, %%rax\n"
  500|  9.73k|    "mulq %%r11\n"
  501|  9.73k|    "addq %%rax, %%r9\n"
  502|  9.73k|    "adcq %%rdx, %%r10\n"
  503|  9.73k|    "adcq $0, %%r8\n"
  504|       |    /* extract p1 */
  505|  9.73k|    "movq %%r9, %q1\n"
  506|  9.73k|    "xorq %%r9, %%r9\n"
  507|       |    /* (r10,r8,r9) += m2 */
  508|  9.73k|    "addq %q7, %%r10\n"
  509|  9.73k|    "adcq $0, %%r8\n"
  510|  9.73k|    "adcq $0, %%r9\n"
  511|       |    /* (r10,r8,r9) += m6 * c0 */
  512|  9.73k|    "movq %12, %%rax\n"
  513|  9.73k|    "mulq %%r13\n"
  514|  9.73k|    "addq %%rax, %%r10\n"
  515|  9.73k|    "adcq %%rdx, %%r8\n"
  516|  9.73k|    "adcq $0, %%r9\n"
  517|       |    /* (r10,r8,r9) += m5 * c1 */
  518|  9.73k|    "movq %13, %%rax\n"
  519|  9.73k|    "mulq %%r12\n"
  520|  9.73k|    "addq %%rax, %%r10\n"
  521|  9.73k|    "adcq %%rdx, %%r8\n"
  522|  9.73k|    "adcq $0, %%r9\n"
  523|       |    /* (r10,r8,r9) += m4 */
  524|  9.73k|    "addq %%r11, %%r10\n"
  525|  9.73k|    "adcq $0, %%r8\n"
  526|  9.73k|    "adcq $0, %%r9\n"
  527|       |    /* extract p2 */
  528|  9.73k|    "movq %%r10, %q2\n"
  529|       |    /* (r8,r9) += m3 */
  530|  9.73k|    "addq %q8, %%r8\n"
  531|  9.73k|    "adcq $0, %%r9\n"
  532|       |    /* (r8,r9) += m6 * c1 */
  533|  9.73k|    "movq %13, %%rax\n"
  534|  9.73k|    "mulq %%r13\n"
  535|  9.73k|    "addq %%rax, %%r8\n"
  536|  9.73k|    "adcq %%rdx, %%r9\n"
  537|       |    /* (r8,r9) += m5 */
  538|  9.73k|    "addq %%r12, %%r8\n"
  539|  9.73k|    "adcq $0, %%r9\n"
  540|       |    /* extract p3 */
  541|  9.73k|    "movq %%r8, %q3\n"
  542|       |    /* (r9) += m6 */
  543|  9.73k|    "addq %%r13, %%r9\n"
  544|       |    /* extract p4 */
  545|  9.73k|    "movq %%r9, %q4\n"
  546|  9.73k|    : "=&g"(p0), "=&g"(p1), "=&g"(p2), "=g"(p3), "=g"(p4)
  547|  9.73k|    : "g"(m0), "g"(m1), "g"(m2), "g"(m3), "g"(m4), "g"(m5), "g"(m6), "i"(SECP256K1_N_C_0), "i"(SECP256K1_N_C_1)
  ------------------
  |  |   22|  9.73k|#define SECP256K1_N_C_0 (~SECP256K1_N_0 + 1)
  |  |  ------------------
  |  |  |  |   16|  9.73k|#define SECP256K1_N_0 ((uint64_t)0xBFD25E8CD0364141ULL)
  |  |  ------------------
  ------------------
                  : "g"(m0), "g"(m1), "g"(m2), "g"(m3), "g"(m4), "g"(m5), "g"(m6), "i"(SECP256K1_N_C_0), "i"(SECP256K1_N_C_1)
  ------------------
  |  |   23|  9.73k|#define SECP256K1_N_C_1 (~SECP256K1_N_1)
  |  |  ------------------
  |  |  |  |   17|  9.73k|#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL)
  |  |  ------------------
  ------------------
  548|  9.73k|    : "rax", "rdx", "r8", "r9", "r10", "r11", "r12", "r13", "cc");
  549|       |
  550|  9.73k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&p0, sizeof(p0));
  ------------------
  |  |   70|  9.73k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  9.73k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 9.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  551|  9.73k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&p1, sizeof(p1));
  ------------------
  |  |   70|  9.73k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  9.73k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 9.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  552|  9.73k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&p2, sizeof(p2));
  ------------------
  |  |   70|  9.73k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  9.73k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 9.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  553|  9.73k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&p3, sizeof(p3));
  ------------------
  |  |   70|  9.73k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  9.73k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 9.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  554|  9.73k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&p4, sizeof(p4));
  ------------------
  |  |   70|  9.73k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  9.73k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 9.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  555|       |
  556|       |    /* Reduce 258 bits into 256. */
  557|  9.73k|    __asm__ __volatile__(
  558|       |    /* Preload */
  559|  9.73k|    "movq %q5, %%r10\n"
  560|       |    /* (rax,rdx) = p4 * c0 */
  561|  9.73k|    "movq %7, %%rax\n"
  562|  9.73k|    "mulq %%r10\n"
  563|       |    /* (rax,rdx) += p0 */
  564|  9.73k|    "addq %q1, %%rax\n"
  565|  9.73k|    "adcq $0, %%rdx\n"
  566|       |    /* extract r0 */
  567|  9.73k|    "movq %%rax, 0(%q6)\n"
  568|       |    /* Move to (r8,r9) */
  569|  9.73k|    "movq %%rdx, %%r8\n"
  570|  9.73k|    "xorq %%r9, %%r9\n"
  571|       |    /* (r8,r9) += p1 */
  572|  9.73k|    "addq %q2, %%r8\n"
  573|  9.73k|    "adcq $0, %%r9\n"
  574|       |    /* (r8,r9) += p4 * c1 */
  575|  9.73k|    "movq %8, %%rax\n"
  576|  9.73k|    "mulq %%r10\n"
  577|  9.73k|    "addq %%rax, %%r8\n"
  578|  9.73k|    "adcq %%rdx, %%r9\n"
  579|       |    /* Extract r1 */
  580|  9.73k|    "movq %%r8, 8(%q6)\n"
  581|  9.73k|    "xorq %%r8, %%r8\n"
  582|       |    /* (r9,r8) += p4 */
  583|  9.73k|    "addq %%r10, %%r9\n"
  584|  9.73k|    "adcq $0, %%r8\n"
  585|       |    /* (r9,r8) += p2 */
  586|  9.73k|    "addq %q3, %%r9\n"
  587|  9.73k|    "adcq $0, %%r8\n"
  588|       |    /* Extract r2 */
  589|  9.73k|    "movq %%r9, 16(%q6)\n"
  590|  9.73k|    "xorq %%r9, %%r9\n"
  591|       |    /* (r8,r9) += p3 */
  592|  9.73k|    "addq %q4, %%r8\n"
  593|  9.73k|    "adcq $0, %%r9\n"
  594|       |    /* Extract r3 */
  595|  9.73k|    "movq %%r8, 24(%q6)\n"
  596|       |    /* Extract c */
  597|  9.73k|    "movq %%r9, %q0\n"
  598|  9.73k|    : "=g"(c)
  599|  9.73k|    : "g"(p0), "g"(p1), "g"(p2), "g"(p3), "g"(p4), "D"(r), "i"(SECP256K1_N_C_0), "i"(SECP256K1_N_C_1)
  ------------------
  |  |   22|  9.73k|#define SECP256K1_N_C_0 (~SECP256K1_N_0 + 1)
  |  |  ------------------
  |  |  |  |   16|  9.73k|#define SECP256K1_N_0 ((uint64_t)0xBFD25E8CD0364141ULL)
  |  |  ------------------
  ------------------
                  : "g"(p0), "g"(p1), "g"(p2), "g"(p3), "g"(p4), "D"(r), "i"(SECP256K1_N_C_0), "i"(SECP256K1_N_C_1)
  ------------------
  |  |   23|  9.73k|#define SECP256K1_N_C_1 (~SECP256K1_N_1)
  |  |  ------------------
  |  |  |  |   17|  9.73k|#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL)
  |  |  ------------------
  ------------------
  600|  9.73k|    : "rax", "rdx", "r8", "r9", "r10", "cc", "memory");
  601|       |
  602|  9.73k|    SECP256K1_CHECKMEM_MSAN_DEFINE(r, sizeof(*r));
  ------------------
  |  |   70|  9.73k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  9.73k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 9.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  603|  9.73k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&c, sizeof(c));
  ------------------
  |  |   70|  9.73k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  9.73k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 9.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  604|       |
  605|       |#else
  606|       |    secp256k1_uint128 c128;
  607|       |    uint64_t c, c0, c1, c2;
  608|       |    uint64_t n0 = l[4], n1 = l[5], n2 = l[6], n3 = l[7];
  609|       |    uint64_t m0, m1, m2, m3, m4, m5;
  610|       |    uint32_t m6;
  611|       |    uint64_t p0, p1, p2, p3;
  612|       |    uint32_t p4;
  613|       |
  614|       |    /* Reduce 512 bits into 385. */
  615|       |    /* m[0..6] = l[0..3] + n[0..3] * SECP256K1_N_C. */
  616|       |    c0 = l[0]; c1 = 0; c2 = 0;
  617|       |    muladd_fast(n0, SECP256K1_N_C_0);
  618|       |    extract_fast(m0);
  619|       |    sumadd_fast(l[1]);
  620|       |    muladd(n1, SECP256K1_N_C_0);
  621|       |    muladd(n0, SECP256K1_N_C_1);
  622|       |    extract(m1);
  623|       |    sumadd(l[2]);
  624|       |    muladd(n2, SECP256K1_N_C_0);
  625|       |    muladd(n1, SECP256K1_N_C_1);
  626|       |    sumadd(n0);
  627|       |    extract(m2);
  628|       |    sumadd(l[3]);
  629|       |    muladd(n3, SECP256K1_N_C_0);
  630|       |    muladd(n2, SECP256K1_N_C_1);
  631|       |    sumadd(n1);
  632|       |    extract(m3);
  633|       |    muladd(n3, SECP256K1_N_C_1);
  634|       |    sumadd(n2);
  635|       |    extract(m4);
  636|       |    sumadd_fast(n3);
  637|       |    extract_fast(m5);
  638|       |    VERIFY_CHECK(c0 <= 1);
  639|       |    m6 = c0;
  640|       |
  641|       |    /* Reduce 385 bits into 258. */
  642|       |    /* p[0..4] = m[0..3] + m[4..6] * SECP256K1_N_C. */
  643|       |    c0 = m0; c1 = 0; c2 = 0;
  644|       |    muladd_fast(m4, SECP256K1_N_C_0);
  645|       |    extract_fast(p0);
  646|       |    sumadd_fast(m1);
  647|       |    muladd(m5, SECP256K1_N_C_0);
  648|       |    muladd(m4, SECP256K1_N_C_1);
  649|       |    extract(p1);
  650|       |    sumadd(m2);
  651|       |    muladd(m6, SECP256K1_N_C_0);
  652|       |    muladd(m5, SECP256K1_N_C_1);
  653|       |    sumadd(m4);
  654|       |    extract(p2);
  655|       |    sumadd_fast(m3);
  656|       |    muladd_fast(m6, SECP256K1_N_C_1);
  657|       |    sumadd_fast(m5);
  658|       |    extract_fast(p3);
  659|       |    p4 = c0 + m6;
  660|       |    VERIFY_CHECK(p4 <= 2);
  661|       |
  662|       |    /* Reduce 258 bits into 256. */
  663|       |    /* r[0..3] = p[0..3] + p[4] * SECP256K1_N_C. */
  664|       |    secp256k1_u128_from_u64(&c128, p0);
  665|       |    secp256k1_u128_accum_mul(&c128, SECP256K1_N_C_0, p4);
  666|       |    r->d[0] = secp256k1_u128_to_u64(&c128); secp256k1_u128_rshift(&c128, 64);
  667|       |    secp256k1_u128_accum_u64(&c128, p1);
  668|       |    secp256k1_u128_accum_mul(&c128, SECP256K1_N_C_1, p4);
  669|       |    r->d[1] = secp256k1_u128_to_u64(&c128); secp256k1_u128_rshift(&c128, 64);
  670|       |    secp256k1_u128_accum_u64(&c128, p2);
  671|       |    secp256k1_u128_accum_u64(&c128, p4);
  672|       |    r->d[2] = secp256k1_u128_to_u64(&c128); secp256k1_u128_rshift(&c128, 64);
  673|       |    secp256k1_u128_accum_u64(&c128, p3);
  674|       |    r->d[3] = secp256k1_u128_to_u64(&c128);
  675|       |    c = secp256k1_u128_hi_u64(&c128);
  676|       |#endif
  677|       |
  678|       |    /* Final reduction of r. */
  679|  9.73k|    secp256k1_scalar_reduce(r, c + secp256k1_scalar_check_overflow(r));
  680|  9.73k|}
secp256k1.c:secp256k1_scalar_add:
   96|  6.49k|static int secp256k1_scalar_add(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b) {
   97|  6.49k|    int overflow;
   98|  6.49k|    secp256k1_uint128 t;
   99|  6.49k|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|  6.49k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  100|  6.49k|    SECP256K1_SCALAR_VERIFY(b);
  ------------------
  |  |  103|  6.49k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  101|       |
  102|  6.49k|    secp256k1_u128_from_u64(&t, a->d[0]);
  103|  6.49k|    secp256k1_u128_accum_u64(&t, b->d[0]);
  104|  6.49k|    r->d[0] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
  105|  6.49k|    secp256k1_u128_accum_u64(&t, a->d[1]);
  106|  6.49k|    secp256k1_u128_accum_u64(&t, b->d[1]);
  107|  6.49k|    r->d[1] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
  108|  6.49k|    secp256k1_u128_accum_u64(&t, a->d[2]);
  109|  6.49k|    secp256k1_u128_accum_u64(&t, b->d[2]);
  110|  6.49k|    r->d[2] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
  111|  6.49k|    secp256k1_u128_accum_u64(&t, a->d[3]);
  112|  6.49k|    secp256k1_u128_accum_u64(&t, b->d[3]);
  113|  6.49k|    r->d[3] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
  114|  6.49k|    overflow = secp256k1_u128_to_u64(&t) + secp256k1_scalar_check_overflow(r);
  115|  6.49k|    VERIFY_CHECK(overflow == 0 || overflow == 1);
  116|  6.49k|    secp256k1_scalar_reduce(r, overflow);
  117|       |
  118|  6.49k|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  6.49k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  119|  6.49k|    return overflow;
  120|  6.49k|}

secp256k1.c:secp256k1_scalar_verify:
   42|  1.23M|static void secp256k1_scalar_verify(const secp256k1_scalar *r) {
   43|  1.23M|    VERIFY_CHECK(secp256k1_scalar_check_overflow(r) == 0);
   44|       |
   45|  1.23M|    (void)r;
   46|  1.23M|}
secp256k1.c:secp256k1_scalar_clear:
   30|      2|SECP256K1_INLINE static void secp256k1_scalar_clear(secp256k1_scalar *r) {
   31|      2|    secp256k1_memclear_explicit(r, sizeof(secp256k1_scalar));
   32|      2|}
secp256k1.c:secp256k1_scalar_split_lambda:
  142|  3.24k|static void secp256k1_scalar_split_lambda(secp256k1_scalar * SECP256K1_RESTRICT r1, secp256k1_scalar * SECP256K1_RESTRICT r2, const secp256k1_scalar * SECP256K1_RESTRICT k) {
  143|  3.24k|    secp256k1_scalar c1, c2;
  144|  3.24k|    static const secp256k1_scalar minus_b1 = SECP256K1_SCALAR_CONST(
  ------------------
  |  |   17|  3.24k|#define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {{((uint64_t)(d1)) << 32 | (d0), ((uint64_t)(d3)) << 32 | (d2), ((uint64_t)(d5)) << 32 | (d4), ((uint64_t)(d7)) << 32 | (d6)}}
  ------------------
  145|  3.24k|        0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL,
  146|  3.24k|        0xE4437ED6UL, 0x010E8828UL, 0x6F547FA9UL, 0x0ABFE4C3UL
  147|  3.24k|    );
  148|  3.24k|    static const secp256k1_scalar minus_b2 = SECP256K1_SCALAR_CONST(
  ------------------
  |  |   17|  3.24k|#define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {{((uint64_t)(d1)) << 32 | (d0), ((uint64_t)(d3)) << 32 | (d2), ((uint64_t)(d5)) << 32 | (d4), ((uint64_t)(d7)) << 32 | (d6)}}
  ------------------
  149|  3.24k|        0xFFFFFFFFUL, 0xFFFFFFFFUL, 0xFFFFFFFFUL, 0xFFFFFFFEUL,
  150|  3.24k|        0x8A280AC5UL, 0x0774346DUL, 0xD765CDA8UL, 0x3DB1562CUL
  151|  3.24k|    );
  152|  3.24k|    static const secp256k1_scalar g1 = SECP256K1_SCALAR_CONST(
  ------------------
  |  |   17|  3.24k|#define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {{((uint64_t)(d1)) << 32 | (d0), ((uint64_t)(d3)) << 32 | (d2), ((uint64_t)(d5)) << 32 | (d4), ((uint64_t)(d7)) << 32 | (d6)}}
  ------------------
  153|  3.24k|        0x3086D221UL, 0xA7D46BCDUL, 0xE86C90E4UL, 0x9284EB15UL,
  154|  3.24k|        0x3DAA8A14UL, 0x71E8CA7FUL, 0xE893209AUL, 0x45DBB031UL
  155|  3.24k|    );
  156|  3.24k|    static const secp256k1_scalar g2 = SECP256K1_SCALAR_CONST(
  ------------------
  |  |   17|  3.24k|#define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {{((uint64_t)(d1)) << 32 | (d0), ((uint64_t)(d3)) << 32 | (d2), ((uint64_t)(d5)) << 32 | (d4), ((uint64_t)(d7)) << 32 | (d6)}}
  ------------------
  157|  3.24k|        0xE4437ED6UL, 0x010E8828UL, 0x6F547FA9UL, 0x0ABFE4C4UL,
  158|  3.24k|        0x221208ACUL, 0x9DF506C6UL, 0x1571B4AEUL, 0x8AC47F71UL
  159|  3.24k|    );
  160|  3.24k|    SECP256K1_SCALAR_VERIFY(k);
  ------------------
  |  |  103|  3.24k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  161|  3.24k|    VERIFY_CHECK(r1 != k);
  162|  3.24k|    VERIFY_CHECK(r2 != k);
  163|  3.24k|    VERIFY_CHECK(r1 != r2);
  164|       |
  165|       |    /* these _var calls are constant time since the shift amount is constant */
  166|  3.24k|    secp256k1_scalar_mul_shift_var(&c1, k, &g1, 384);
  167|  3.24k|    secp256k1_scalar_mul_shift_var(&c2, k, &g2, 384);
  168|  3.24k|    secp256k1_scalar_mul(&c1, &c1, &minus_b1);
  169|  3.24k|    secp256k1_scalar_mul(&c2, &c2, &minus_b2);
  170|  3.24k|    secp256k1_scalar_add(r2, &c1, &c2);
  171|  3.24k|    secp256k1_scalar_mul(r1, r2, &secp256k1_const_lambda);
  172|  3.24k|    secp256k1_scalar_negate(r1, r1);
  173|  3.24k|    secp256k1_scalar_add(r1, r1, k);
  174|       |
  175|  3.24k|    SECP256K1_SCALAR_VERIFY(r1);
  ------------------
  |  |  103|  3.24k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  176|  3.24k|    SECP256K1_SCALAR_VERIFY(r2);
  ------------------
  |  |  103|  3.24k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  177|       |#ifdef VERIFY
  178|       |    secp256k1_scalar_split_lambda_verify(r1, r2, k);
  179|       |#endif
  180|  3.24k|}

secp256k1_context_preallocated_destroy:
  178|      2|void secp256k1_context_preallocated_destroy(secp256k1_context* ctx) {
  179|      2|    ARG_CHECK_VOID(ctx == NULL || secp256k1_context_is_proper(ctx));
  ------------------
  |  |   52|      2|#define ARG_CHECK_VOID(cond) do { \
  |  |   53|      2|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|      4|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2]
  |  |  |  |  |  Branch (146:39): [True: 0, False: 2]
  |  |  |  |  |  Branch (146:39): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   55|      0|        return; \
  |  |   56|      0|    } \
  |  |   57|      2|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 2]
  |  |  ------------------
  ------------------
  180|       |
  181|       |    /* Defined as noop */
  182|      2|    if (ctx == NULL) {
  ------------------
  |  Branch (182:9): [True: 0, False: 2]
  ------------------
  183|      0|        return;
  184|      0|    }
  185|       |
  186|      2|    secp256k1_ecmult_gen_context_clear(&ctx->ecmult_gen_ctx);
  187|      2|}
secp256k1_context_destroy:
  189|      2|void secp256k1_context_destroy(secp256k1_context* ctx) {
  190|      2|    ARG_CHECK_VOID(ctx == NULL || secp256k1_context_is_proper(ctx));
  ------------------
  |  |   52|      2|#define ARG_CHECK_VOID(cond) do { \
  |  |   53|      2|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|      4|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2]
  |  |  |  |  |  Branch (146:39): [True: 0, False: 2]
  |  |  |  |  |  Branch (146:39): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   55|      0|        return; \
  |  |   56|      0|    } \
  |  |   57|      2|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded, False: 2]
  |  |  ------------------
  ------------------
  191|       |
  192|       |    /* Defined as noop */
  193|      2|    if (ctx == NULL) {
  ------------------
  |  Branch (193:9): [True: 0, False: 2]
  ------------------
  194|      0|        return;
  195|      0|    }
  196|       |
  197|      2|    secp256k1_context_preallocated_destroy(ctx);
  198|      2|    free(ctx);
  199|      2|}
secp256k1_ecdsa_signature_parse_compact:
  411|  20.5k|int secp256k1_ecdsa_signature_parse_compact(const secp256k1_context* ctx, secp256k1_ecdsa_signature* sig, const unsigned char *input64) {
  412|  20.5k|    secp256k1_scalar r, s;
  413|  20.5k|    int ret = 1;
  414|  20.5k|    int overflow = 0;
  415|       |
  416|  20.5k|    VERIFY_CHECK(ctx != NULL);
  417|  20.5k|    ARG_CHECK(sig != NULL);
  ------------------
  |  |   45|  20.5k|#define ARG_CHECK(cond) do { \
  |  |   46|  20.5k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  20.5k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  20.5k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 20.5k]
  |  |  ------------------
  ------------------
  418|  20.5k|    ARG_CHECK(input64 != NULL);
  ------------------
  |  |   45|  20.5k|#define ARG_CHECK(cond) do { \
  |  |   46|  20.5k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  20.5k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  20.5k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 20.5k]
  |  |  ------------------
  ------------------
  419|       |
  420|  20.5k|    secp256k1_scalar_set_b32(&r, &input64[0], &overflow);
  421|  20.5k|    ret &= !overflow;
  422|  20.5k|    secp256k1_scalar_set_b32(&s, &input64[32], &overflow);
  423|  20.5k|    ret &= !overflow;
  424|  20.5k|    if (ret) {
  ------------------
  |  Branch (424:9): [True: 20.5k, False: 0]
  ------------------
  425|  20.5k|        secp256k1_ecdsa_signature_save(sig, &r, &s);
  426|  20.5k|    } else {
  427|      0|        memset(sig, 0, sizeof(*sig));
  428|      0|    }
  429|  20.5k|    return ret;
  430|  20.5k|}
secp256k1_ecdsa_signature_normalize:
  457|  10.2k|int secp256k1_ecdsa_signature_normalize(const secp256k1_context* ctx, secp256k1_ecdsa_signature *sigout, const secp256k1_ecdsa_signature *sigin) {
  458|  10.2k|    secp256k1_scalar r, s;
  459|  10.2k|    int ret = 0;
  460|       |
  461|  10.2k|    VERIFY_CHECK(ctx != NULL);
  462|  10.2k|    ARG_CHECK(sigin != NULL);
  ------------------
  |  |   45|  10.2k|#define ARG_CHECK(cond) do { \
  |  |   46|  10.2k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  10.2k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 10.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  10.2k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 10.2k]
  |  |  ------------------
  ------------------
  463|       |
  464|  10.2k|    secp256k1_ecdsa_signature_load(ctx, &r, &s, sigin);
  465|  10.2k|    ret = secp256k1_scalar_is_high(&s);
  466|  10.2k|    if (sigout != NULL) {
  ------------------
  |  Branch (466:9): [True: 0, False: 10.2k]
  ------------------
  467|      0|        if (ret) {
  ------------------
  |  Branch (467:13): [True: 0, False: 0]
  ------------------
  468|      0|            secp256k1_scalar_negate(&s, &s);
  469|      0|        }
  470|      0|        secp256k1_ecdsa_signature_save(sigout, &r, &s);
  471|      0|    }
  472|       |
  473|  10.2k|    return ret;
  474|  10.2k|}
secp256k1.c:secp256k1_context_is_proper:
   83|      4|static int secp256k1_context_is_proper(const secp256k1_context* ctx) {
   84|      4|    return secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx);
   85|      4|}
secp256k1.c:secp256k1_pubkey_save:
  264|  8.44k|static void secp256k1_pubkey_save(secp256k1_pubkey* pubkey, secp256k1_ge* ge) {
  265|  8.44k|    secp256k1_ge_to_bytes(pubkey->data, ge);
  266|  8.44k|}
secp256k1.c:secp256k1_pubkey_load:
  258|  7.15k|static int secp256k1_pubkey_load(const secp256k1_context* ctx, secp256k1_ge* ge, const secp256k1_pubkey* pubkey) {
  259|  7.15k|    secp256k1_ge_from_bytes(ge, pubkey->data);
  260|  7.15k|    ARG_CHECK(!secp256k1_fe_is_zero(&ge->x));
  ------------------
  |  |   45|  7.15k|#define ARG_CHECK(cond) do { \
  |  |   46|  7.15k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  7.15k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 7.15k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  7.15k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 7.15k]
  |  |  ------------------
  ------------------
  261|  7.15k|    return 1;
  262|  7.15k|}
secp256k1.c:secp256k1_ecdsa_signature_save:
  385|  20.5k|static void secp256k1_ecdsa_signature_save(secp256k1_ecdsa_signature* sig, const secp256k1_scalar* r, const secp256k1_scalar* s) {
  386|  20.5k|    if (sizeof(secp256k1_scalar) == 32) {
  ------------------
  |  Branch (386:9): [True: 20.5k, Folded]
  ------------------
  387|  20.5k|        memcpy(&sig->data[0], r, 32);
  388|  20.5k|        memcpy(&sig->data[32], s, 32);
  389|  20.5k|    } else {
  390|      0|        secp256k1_scalar_get_b32(&sig->data[0], r);
  391|      0|        secp256k1_scalar_get_b32(&sig->data[32], s);
  392|      0|    }
  393|  20.5k|}
secp256k1.c:secp256k1_ecdsa_signature_load:
  371|  10.2k|static void secp256k1_ecdsa_signature_load(const secp256k1_context* ctx, secp256k1_scalar* r, secp256k1_scalar* s, const secp256k1_ecdsa_signature* sig) {
  372|  10.2k|    (void)ctx;
  373|  10.2k|    if (sizeof(secp256k1_scalar) == 32) {
  ------------------
  |  Branch (373:9): [True: 10.2k, Folded]
  ------------------
  374|       |        /* When the secp256k1_scalar type is exactly 32 byte, use its
  375|       |         * representation inside secp256k1_ecdsa_signature, as conversion is very fast.
  376|       |         * Note that secp256k1_ecdsa_signature_save must use the same representation. */
  377|  10.2k|        memcpy(r, &sig->data[0], 32);
  378|  10.2k|        memcpy(s, &sig->data[32], 32);
  379|  10.2k|    } else {
  380|      0|        secp256k1_scalar_set_b32(r, &sig->data[0], NULL);
  381|       |        secp256k1_scalar_set_b32(s, &sig->data[32], NULL);
  382|      0|    }
  383|  10.2k|}
secp256k1.c:secp256k1_ec_pubkey_tweak_add_helper:
  712|  3.24k|static int secp256k1_ec_pubkey_tweak_add_helper(secp256k1_ge *p, const unsigned char *tweak32) {
  713|  3.24k|    secp256k1_scalar term;
  714|  3.24k|    int overflow = 0;
  715|  3.24k|    secp256k1_scalar_set_b32(&term, tweak32, &overflow);
  716|  3.24k|    return !overflow && secp256k1_eckey_pubkey_tweak_add(p, &term);
  ------------------
  |  Branch (716:12): [True: 3.24k, False: 0]
  |  Branch (716:25): [True: 3.24k, False: 0]
  ------------------
  717|  3.24k|}

secp256k1.c:secp256k1_memcmp_var:
  281|  1.29k|static SECP256K1_INLINE int secp256k1_memcmp_var(const void *s1, const void *s2, size_t n) {
  282|  1.29k|    const unsigned char *p1 = s1, *p2 = s2;
  283|  1.29k|    size_t i;
  284|       |
  285|  42.6k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (285:17): [True: 41.3k, False: 1.29k]
  ------------------
  286|  41.3k|        int diff = p1[i] - p2[i];
  287|  41.3k|        if (diff != 0) {
  ------------------
  |  Branch (287:13): [True: 0, False: 41.3k]
  ------------------
  288|      0|            return diff;
  289|      0|        }
  290|  41.3k|    }
  291|  1.29k|    return 0;
  292|  1.29k|}
secp256k1.c:secp256k1_read_be64:
  444|   177k|SECP256K1_INLINE static uint64_t secp256k1_read_be64(const unsigned char* p) {
  445|   177k|    return (uint64_t)p[0] << 56 |
  446|   177k|           (uint64_t)p[1] << 48 |
  447|   177k|           (uint64_t)p[2] << 40 |
  448|   177k|           (uint64_t)p[3] << 32 |
  449|   177k|           (uint64_t)p[4] << 24 |
  450|   177k|           (uint64_t)p[5] << 16 |
  451|   177k|           (uint64_t)p[6] << 8  |
  452|   177k|           (uint64_t)p[7];
  453|   177k|}
secp256k1.c:secp256k1_write_be64:
  456|  12.9k|SECP256K1_INLINE static void secp256k1_write_be64(unsigned char* p, uint64_t x) {
  457|  12.9k|    p[7] = x;
  458|  12.9k|    p[6] = x >>  8;
  459|  12.9k|    p[5] = x >> 16;
  460|  12.9k|    p[4] = x >> 24;
  461|  12.9k|    p[3] = x >> 32;
  462|  12.9k|    p[2] = x >> 40;
  463|  12.9k|    p[1] = x >> 48;
  464|  12.9k|    p[0] = x >> 56;
  465|  12.9k|}
secp256k1.c:secp256k1_memclear_explicit:
  268|      6|static SECP256K1_INLINE void secp256k1_memclear_explicit(void *ptr, size_t len) {
  269|       |    /* The current implementation zeroes, but callers must not rely on this */
  270|      6|    secp256k1_memzero_explicit(ptr, len);
  271|       |#ifdef VERIFY
  272|       |    SECP256K1_CHECKMEM_UNDEFINE(ptr, len);
  273|       |#endif
  274|      6|}
secp256k1.c:secp256k1_memzero_explicit:
  236|      6|static SECP256K1_INLINE void secp256k1_memzero_explicit(void *ptr, size_t len) {
  237|       |#if defined(_MSC_VER)
  238|       |    /* SecureZeroMemory is guaranteed not to be optimized out by MSVC. */
  239|       |    SecureZeroMemory(ptr, len);
  240|       |#elif defined(__GNUC__)
  241|       |    /* We use a memory barrier that scares the compiler away from optimizing out the memset.
  242|       |     *
  243|       |     * Quoting Adam Langley <agl@google.com> in commit ad1907fe73334d6c696c8539646c21b11178f20f
  244|       |     * in BoringSSL (ISC License):
  245|       |     *    As best as we can tell, this is sufficient to break any optimisations that
  246|       |     *    might try to eliminate "superfluous" memsets.
  247|       |     * This method is used in memzero_explicit() the Linux kernel, too. Its advantage is that it
  248|       |     * is pretty efficient, because the compiler can still implement the memset() efficiently,
  249|       |     * just not remove it entirely. See "Dead Store Elimination (Still) Considered Harmful" by
  250|       |     * Yang et al. (USENIX Security 2017) for more background.
  251|       |     */
  252|      6|    memset(ptr, 0, len);
  253|      6|    __asm__ __volatile__("" : : "r"(ptr) : "memory");
  254|       |#else
  255|       |    void *(*volatile const volatile_memset)(void *, int, size_t) = memset;
  256|       |    volatile_memset(ptr, 0, len);
  257|       |#endif
  258|      6|}

miniscript.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS4_IhNS3_9allocatorIhEEEENS5_IS7_EEEEE7WrapperIT_RT0_EOSE_:
  491|    936|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_Z16GetSerializeSizeINSt3__16vectorINS1_IhNS0_9allocatorIhEEEENS2_IS4_EEEEEmRKT_:
 1158|  2.22k|{
 1159|  2.22k|    return (SizeComputer() << t).size();
 1160|  2.22k|}
_ZN12SizeComputerlsINSt3__16vectorINS2_IhNS1_9allocatorIhEEEENS3_IS5_EEEEEERS_RKT_:
 1134|  2.22k|    {
 1135|  2.22k|        ::Serialize(*this, obj);
 1136|  2.22k|        return *this;
 1137|  2.22k|    }
_Z9SerializeI12SizeComputerNSt3__16vectorIhNS1_9allocatorIhEEEENS3_IS5_EEEvRT_RKNS2_IT0_T1_EE:
  899|  2.22k|{
  900|       |    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  901|       |        WriteCompactSize(os, v.size());
  902|       |        if (!v.empty()) os.write(MakeByteSpan(v));
  903|       |    } else if constexpr (std::is_same_v<T, bool>) {
  904|       |        // A special case for std::vector<bool>, as dereferencing
  905|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  906|       |        // due to std::vector's special casing for bool arguments.
  907|       |        WriteCompactSize(os, v.size());
  908|       |        for (bool elem : v) {
  909|       |            ::Serialize(os, elem);
  910|       |        }
  911|  2.22k|    } else {
  912|  2.22k|        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  913|  2.22k|    }
  914|  2.22k|}
_Z9SerializeI12SizeComputer7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS6_IhNS5_9allocatorIhEEEENS7_IS9_EEEEEQ12SerializableIT0_T_EEvRSG_RKSF_:
  767|  2.22k|{
  768|  2.22k|    a.Serialize(os);
  769|  2.22k|}
_ZNK7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS4_IhNS3_9allocatorIhEEEENS5_IS7_EEEEE9SerializeI12SizeComputerEEvRT_:
  476|  2.22k|    template<typename Stream> void Serialize(Stream &s) const { Formatter().Ser(s, m_object); }
_ZN15VectorFormatterI16DefaultFormatterE3SerI12SizeComputerNSt3__16vectorINS5_IhNS4_9allocatorIhEEEENS6_IS8_EEEEEEvRT_RKT0_:
  670|  2.22k|    {
  671|  2.22k|        Formatter formatter;
  672|  2.22k|        WriteCompactSize(s, v.size());
  673|   227k|        for (const typename V::value_type& elem : v) {
  ------------------
  |  Branch (673:49): [True: 227k, False: 2.22k]
  ------------------
  674|   227k|            formatter.Ser(s, elem);
  675|   227k|        }
  676|  2.22k|    }
_ZN16DefaultFormatter3SerI12SizeComputerNSt3__16vectorIhNS2_9allocatorIhEEEEEEvRT_RKT0_:
  788|   227k|    static void Ser(Stream& s, const T& t) { Serialize(s, t); }
_Z9SerializeI12SizeComputerhNSt3__19allocatorIhEEEvRT_RKNS1_6vectorIT0_T1_EE:
  899|   227k|{
  900|   227k|    if constexpr (BasicByte<T>) { // Use optimized version for unformatted basic bytes
  901|   227k|        WriteCompactSize(os, v.size());
  902|   227k|        if (!v.empty()) os.write(MakeByteSpan(v));
  ------------------
  |  Branch (902:13): [True: 16.0k, False: 211k]
  ------------------
  903|       |    } else if constexpr (std::is_same_v<T, bool>) {
  904|       |        // A special case for std::vector<bool>, as dereferencing
  905|       |        // std::vector<bool>::const_iterator does not result in a const bool&
  906|       |        // due to std::vector's special casing for bool arguments.
  907|       |        WriteCompactSize(os, v.size());
  908|       |        for (bool elem : v) {
  909|       |            ::Serialize(os, elem);
  910|       |        }
  911|       |    } else {
  912|       |        Serialize(os, Using<VectorFormatter<DefaultFormatter>>(v));
  913|       |    }
  914|   227k|}
_Z16WriteCompactSizeI10HashWriterEvRT_m:
  303|  3.24k|{
  304|  3.24k|    if (nSize < 253)
  ------------------
  |  Branch (304:9): [True: 1.97k, False: 1.27k]
  ------------------
  305|  1.97k|    {
  306|  1.97k|        ser_writedata8(os, nSize);
  307|  1.97k|    }
  308|  1.27k|    else if (nSize <= std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (308:14): [True: 1.27k, False: 0]
  ------------------
  309|  1.27k|    {
  310|  1.27k|        ser_writedata8(os, 253);
  311|  1.27k|        ser_writedata16(os, nSize);
  312|  1.27k|    }
  313|      0|    else if (nSize <= std::numeric_limits<unsigned int>::max())
  ------------------
  |  Branch (313:14): [True: 0, False: 0]
  ------------------
  314|      0|    {
  315|      0|        ser_writedata8(os, 254);
  316|      0|        ser_writedata32(os, nSize);
  317|      0|    }
  318|      0|    else
  319|      0|    {
  320|      0|        ser_writedata8(os, 255);
  321|      0|        ser_writedata64(os, nSize);
  322|      0|    }
  323|  3.24k|    return;
  324|  3.24k|}
_Z14ser_writedata8I10HashWriterEvRT_h:
   58|  6.49k|{
   59|  6.49k|    s.write(std::as_bytes(std::span{&obj, 1}));
   60|  6.49k|}
_Z15ser_writedata16I10HashWriterEvRT_t:
   62|  1.27k|{
   63|  1.27k|    obj = htole16_internal(obj);
   64|  1.27k|    s.write(std::as_bytes(std::span{&obj, 1}));
   65|  1.27k|}
_ZN17CompactSizeWriterC2Em:
  623|  3.24k|    explicit CompactSizeWriter(uint64_t n_in) : n(n_in) { }
_ZN12SizeComputerC2Ev:
 1119|  2.22k|    SizeComputer() = default;
_Z16WriteCompactSizeR12SizeComputerm:
 1152|   229k|{
 1153|   229k|    s.seek(GetSizeOfCompactSize(nSize));
 1154|   229k|}
_ZN12SizeComputer4seekEm:
 1128|   229k|    {
 1129|   229k|        m_size += num;
 1130|   229k|    }
_Z20GetSizeOfCompactSizem:
  292|   543k|{
  293|   543k|    if (nSize < 253)             return sizeof(unsigned char);
  ------------------
  |  Branch (293:9): [True: 229k, False: 313k]
  ------------------
  294|   313k|    else if (nSize <= std::numeric_limits<uint16_t>::max()) return sizeof(unsigned char) + sizeof(uint16_t);
  ------------------
  |  Branch (294:14): [True: 770, False: 313k]
  ------------------
  295|   313k|    else if (nSize <= std::numeric_limits<unsigned int>::max())  return sizeof(unsigned char) + sizeof(unsigned int);
  ------------------
  |  Branch (295:14): [True: 313k, False: 0]
  ------------------
  296|      0|    else                         return sizeof(unsigned char) + sizeof(uint64_t);
  297|   543k|}
_ZN12SizeComputer5writeENSt3__14spanIKSt4byteLm18446744073709551615EEE:
 1122|  16.0k|    {
 1123|  16.0k|        m_size += src.size();
 1124|  16.0k|    }
interpreter.cpp:_ZL5UsingI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS4_IhNS3_9allocatorIhEEEENS5_IS7_EEEEE7WrapperIT_RT0_EOSE_:
  491|  1.29k|static inline Wrapper<Formatter, T&> Using(T&& t) { return Wrapper<Formatter, T&>(t); }
_ZN7WrapperI15VectorFormatterI16DefaultFormatterERKNSt3__16vectorINS4_IhNS3_9allocatorIhEEEENS5_IS7_EEEEEC2ESB_:
  475|  2.22k|    explicit Wrapper(T obj) : m_object(obj) {}
_ZNK12SizeComputer4sizeEv:
 1140|  2.22k|    {
 1141|  2.22k|        return m_size;
 1142|  2.22k|    }
_Z9SerializeI10HashWriterTk9BasicByteKhLm32EEvRT_NSt3__14spanIT0_XT1_EEE:
  260|  6.49k|template <typename Stream, BasicByte B, size_t N> void Serialize(Stream& s, std::span<B, N> span)      { s.write(std::as_bytes(span)); }
_Z9SerializeI10HashWriter7uint256Q12SerializableIT0_T_EEvRS3_RKS2_:
  767|  6.49k|{
  768|  6.49k|    a.Serialize(os);
  769|  6.49k|}
_Z9SerializeI10HashWriterEvRT_h:
  250|  3.24k|template <typename Stream> void Serialize(Stream& s, uint8_t a)   { ser_writedata8(s, a); }
_Z9SerializeI10HashWriter17CompactSizeWriterQ12SerializableIT0_T_EEvRS3_RKS2_:
  767|  3.24k|{
  768|  3.24k|    a.Serialize(os);
  769|  3.24k|}
_ZNK17CompactSizeWriter9SerializeI10HashWriterEEvRT_:
  626|  3.24k|    void Serialize(Stream &s) const {
  627|  3.24k|        WriteCompactSize<Stream>(s, n);
  628|  3.24k|    }
_Z9SerializeI10HashWriterTk9BasicByteKhEvRT_NSt3__14spanIT0_Lm18446744073709551615EEE:
  261|  3.24k|template <typename Stream, BasicByte B>           void Serialize(Stream& s, std::span<B> span)         { s.write(std::as_bytes(span)); }

_Z13MakeUCharSpanI11XOnlyPubKeyEDTcl13UCharSpanCasttlNSt3__14spanEfp_EEERKT_:
  111|  1.64k|template <typename V> constexpr auto MakeUCharSpan(const V& v) -> decltype(UCharSpanCast(std::span{v})) { return UCharSpanCast(std::span{v}); }
_Z13MakeUCharSpanI7CPubKeyEDTcl13UCharSpanCasttlNSt3__14spanEfp_EEERKT_:
  111|  2.16k|template <typename V> constexpr auto MakeUCharSpan(const V& v) -> decltype(UCharSpanCast(std::span{v})) { return UCharSpanCast(std::span{v}); }
_Z12MakeByteSpanINSt3__16vectorIhNS0_9allocatorIhEEEEEDaRKT_:
   85|  16.0k|{
   86|  16.0k|    return std::as_bytes(std::span{v});
   87|  16.0k|}
_Z11SpanPopBackIKNSt3__16vectorIhNS0_9allocatorIhEEEEERT_RNS0_4spanIS6_Lm18446744073709551615EEE:
   76|  4.26k|{
   77|  4.26k|    size_t size = span.size();
   78|  4.26k|    T& back = span.back();
   79|  4.26k|    span = span.first(size - 1);
   80|  4.26k|    return back;
   81|  4.26k|}
_Z13UCharSpanCastIKhLm18446744073709551615EEDaNSt3__14spanIT_XT0_EEE:
  108|  3.80k|template <typename T, size_t N> constexpr auto UCharSpanCast(std::span<T, N> s) { return std::span<std::remove_pointer_t<decltype(UCharCast(s.data()))>, N>{UCharCast(s.data()), s.size()}; }
_Z9UCharCastPKh:
  100|  3.80k|inline const unsigned char* UCharCast(const unsigned char* c) { return c; }
_Z9UCharCastPKSt4byte:
  102|  17.5k|inline const unsigned char* UCharCast(const std::byte* c) { return reinterpret_cast<const unsigned char*>(c); }

random.cpp:_ZN16secure_allocatorIN12_GLOBAL__N_18RNGStateEE10deallocateEPS1_m:
   37|      2|    {
   38|      2|        if (p != nullptr) {
  ------------------
  |  Branch (38:13): [True: 2, False: 0]
  ------------------
   39|      2|            memory_cleanse(p, sizeof(T) * n);
   40|      2|        }
   41|      2|        LockedPoolManager::Instance().free(p);
   42|      2|    }

_Z14memory_cleansePvm:
   15|     14|{
   16|       |#if defined(WIN32)
   17|       |    /* SecureZeroMemory is guaranteed not to be optimized out. */
   18|       |    SecureZeroMemory(ptr, len);
   19|       |#else
   20|     14|    std::memset(ptr, 0, len);
   21|       |
   22|       |    /* Memory barrier that scares the compiler away from optimizing out the memset.
   23|       |     *
   24|       |     * Quoting Adam Langley <agl@google.com> in commit ad1907fe73334d6c696c8539646c21b11178f20f
   25|       |     * in BoringSSL (ISC License):
   26|       |     *    As best as we can tell, this is sufficient to break any optimisations that
   27|       |     *    might try to eliminate "superfluous" memsets.
   28|       |     * This method is used in memzero_explicit() the Linux kernel, too. Its advantage is that it
   29|       |     * is pretty efficient because the compiler can still implement the memset() efficiently,
   30|       |     * just not remove it entirely. See "Dead Store Elimination (Still) Considered Harmful" by
   31|       |     * Yang et al. (USENIX Security 2017) for more background.
   32|       |     */
   33|     14|    __asm__ __volatile__("" : : "r"(ptr) : "memory");
   34|     14|#endif
   35|     14|}

_ZN5ArenaD2Ev:
   48|      2|Arena::~Arena() = default;
_ZN5Arena4freeEPv:
   87|      2|{
   88|       |    // Freeing the nullptr pointer is OK.
   89|      2|    if (ptr == nullptr) {
  ------------------
  |  Branch (89:9): [True: 0, False: 2]
  ------------------
   90|      0|        return;
   91|      0|    }
   92|       |
   93|       |    // Remove chunk from used map
   94|      2|    auto i = chunks_used.find(ptr);
   95|      2|    if (i == chunks_used.end()) {
  ------------------
  |  Branch (95:9): [True: 0, False: 2]
  ------------------
   96|      0|        throw std::runtime_error("Arena: invalid or double free");
   97|      0|    }
   98|      2|    auto freed = std::make_pair(static_cast<char*>(i->first), i->second);
   99|      2|    chunks_used.erase(i);
  100|       |
  101|       |    // coalesce freed with previous chunk
  102|      2|    auto prev = chunks_free_end.find(freed.first);
  103|      2|    if (prev != chunks_free_end.end()) {
  ------------------
  |  Branch (103:9): [True: 2, False: 0]
  ------------------
  104|      2|        freed.first -= prev->second->first;
  105|      2|        freed.second += prev->second->first;
  106|      2|        size_to_free_chunk.erase(prev->second);
  107|      2|        chunks_free_end.erase(prev);
  108|      2|    }
  109|       |
  110|       |    // coalesce freed with chunk after freed
  111|      2|    auto next = chunks_free.find(freed.first + freed.second);
  112|      2|    if (next != chunks_free.end()) {
  ------------------
  |  Branch (112:9): [True: 0, False: 2]
  ------------------
  113|      0|        freed.second += next->second->first;
  114|      0|        size_to_free_chunk.erase(next->second);
  115|      0|        chunks_free.erase(next);
  116|      0|    }
  117|       |
  118|       |    // Add/set space with coalesced free chunk
  119|      2|    auto it = size_to_free_chunk.emplace(freed.second, freed.first);
  120|      2|    chunks_free[freed.first] = it;
  121|      2|    chunks_free_end[freed.first + freed.second] = it;
  122|      2|}
_ZN24PosixLockedPageAllocator10FreeLockedEPvm:
  254|      2|{
  255|      2|    len = align_up(len, page_size);
  256|      2|    memory_cleanse(addr, len);
  257|      2|    munlock(addr, len);
  258|      2|    munmap(addr, len);
  259|      2|}
_ZN10LockedPoolD2Ev:
  283|      2|LockedPool::~LockedPool() = default;
_ZN10LockedPool4freeEPv:
  308|      2|{
  309|      2|    std::lock_guard<std::mutex> lock(mutex);
  310|       |    // TODO we can do better than this linear search by keeping a map of arena
  311|       |    // extents to arena, and looking up the address.
  312|      2|    for (auto &arena: arenas) {
  ------------------
  |  Branch (312:21): [True: 2, False: 0]
  ------------------
  313|      2|        if (arena.addressInArena(ptr)) {
  ------------------
  |  Branch (313:13): [True: 2, False: 0]
  ------------------
  314|      2|            arena.free(ptr);
  315|      2|            return;
  316|      2|        }
  317|      2|    }
  318|      0|    throw std::runtime_error("LockedPool: invalid address not pointing to any arena");
  319|      2|}
_ZN10LockedPool15LockedPageArenaD2Ev:
  370|      2|{
  371|      2|    allocator->FreeLocked(base, size);
  372|      2|}
_ZN17LockedPoolManager8InstanceEv:
  405|      2|{
  406|      2|    static std::once_flag init_flag;
  407|      2|    std::call_once(init_flag, LockedPoolManager::CreateInstance);
  408|      2|    return *LockedPoolManager::_instance;
  409|      2|}
lockedpool.cpp:_ZL8align_upmm:
   32|      2|{
   33|      2|    return (x + align - 1) & ~(align - 1);
   34|      2|}

_ZNK5Arena14addressInArenaEPv:
   90|      2|    bool addressInArena(void *ptr) const { return ptr >= base && ptr < end; }
  ------------------
  |  Branch (90:51): [True: 2, False: 0]
  |  Branch (90:66): [True: 2, False: 0]
  ------------------
_ZN19LockedPageAllocatorD2Ev:
   22|      2|    virtual ~LockedPageAllocator() = default;

_ZN14AnnotatedMixinINSt3__115recursive_mutexEED2Ev:
   96|      2|    ~AnnotatedMixin() {
   97|      2|        DeleteLock((void*)this);
   98|      2|    }
_ZN14AnnotatedMixinINSt3__15mutexEED2Ev:
   96|     64|    ~AnnotatedMixin() {
   97|     64|        DeleteLock((void*)this);
   98|     64|    }
_Z10DeleteLockPv:
   74|     66|inline void DeleteLock(void* cs) {}
_Z17MaybeCheckNotHeldR14AnnotatedMixinINSt3__15mutexEE:
  258|     30|inline Mutex& MaybeCheckNotHeld(Mutex& cs) EXCLUSIVE_LOCKS_REQUIRED(!cs) LOCK_RETURNED(cs) { return cs; }
_ZN10UniqueLockI14AnnotatedMixinINSt3__15mutexEEEC2ERS3_PKcS7_ib:
  181|     30|    UniqueLock(MutexType& mutexIn, const char* pszName, const char* pszFile, int nLine, bool fTry = false) EXCLUSIVE_LOCK_FUNCTION(mutexIn) : Base(mutexIn, std::defer_lock)
  182|     30|    {
  183|     30|        if (fTry)
  ------------------
  |  Branch (183:13): [True: 0, False: 30]
  ------------------
  184|      0|            TryEnter(pszName, pszFile, nLine);
  185|     30|        else
  186|     30|            Enter(pszName, pszFile, nLine);
  187|     30|    }
_Z13EnterCriticalINSt3__15mutexEEvPKcS3_iPT_b:
   67|     30|inline void EnterCritical(const char* pszName, const char* pszFile, int nLine, MutexType* cs, bool fTry = false) {}
_Z13LeaveCriticalv:
   68|     30|inline void LeaveCritical() {}
_ZN10UniqueLockI14AnnotatedMixinINSt3__15mutexEEE5EnterEPKcS6_i:
  159|     30|    {
  160|     30|        EnterCritical(pszName, pszFile, nLine, Base::mutex());
  161|       |#ifdef DEBUG_LOCKCONTENTION
  162|       |        if (!Base::try_lock()) {
  163|       |            ContendedLock(pszName, pszFile, nLine, static_cast<Base&>(*this));
  164|       |        }
  165|       |#else
  166|     30|        Base::lock();
  167|     30|#endif
  168|     30|    }
_ZN10UniqueLockI14AnnotatedMixinINSt3__15mutexEEED2Ev:
  201|     30|    {
  202|     30|        if (Base::owns_lock())
  ------------------
  |  Branch (202:13): [True: 30, False: 0]
  ------------------
  203|     30|            LeaveCritical();
  204|     30|    }

_ZN18FuzzedDataProvider22ConsumeIntegralInRangeItEET_S1_S1_:
  205|  2.36k|T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
  206|  2.36k|  static_assert(std::is_integral_v<T>, "An integral type is required.");
  207|  2.36k|  static_assert(sizeof(T) <= sizeof(uint64_t), "Unsupported integral type.");
  208|       |
  209|  2.36k|  if (min > max)
  ------------------
  |  Branch (209:7): [True: 0, False: 2.36k]
  ------------------
  210|      0|    abort();
  211|       |
  212|       |  // Use the biggest type possible to hold the range and the result.
  213|  2.36k|  uint64_t range = static_cast<uint64_t>(max) - static_cast<uint64_t>(min);
  214|  2.36k|  uint64_t result = 0;
  215|  2.36k|  size_t offset = 0;
  216|       |
  217|  5.01k|  while (offset < sizeof(T) * CHAR_BIT && (range >> offset) > 0 &&
  ------------------
  |  Branch (217:10): [True: 4.00k, False: 1.00k]
  |  Branch (217:43): [True: 3.01k, False: 991]
  ------------------
  218|  3.01k|         remaining_bytes_ != 0) {
  ------------------
  |  Branch (218:10): [True: 2.64k, False: 367]
  ------------------
  219|       |    // Pull bytes off the end of the seed data. Experimentally, this seems to
  220|       |    // allow the fuzzer to more easily explore the input space. This makes
  221|       |    // sense, since it works by modifying inputs that caused new code to run,
  222|       |    // and this data is often used to encode length of data read by
  223|       |    // |ConsumeBytes|. Separating out read lengths makes it easier modify the
  224|       |    // contents of the data that is actually read.
  225|  2.64k|    --remaining_bytes_;
  226|  2.64k|    result = (result << CHAR_BIT) | data_ptr_[remaining_bytes_];
  227|  2.64k|    offset += CHAR_BIT;
  228|  2.64k|  }
  229|       |
  230|       |  // Avoid division by 0, in case |range + 1| results in overflow.
  231|  2.36k|  if (range != std::numeric_limits<decltype(range)>::max())
  ------------------
  |  Branch (231:7): [True: 2.36k, False: 0]
  ------------------
  232|  2.36k|    result = result % (range + 1);
  233|       |
  234|  2.36k|  return static_cast<T>(static_cast<uint64_t>(min) + result);
  235|  2.36k|}
_ZN18FuzzedDataProviderC2EPKhm:
   37|  5.04k|      : data_ptr_(data), remaining_bytes_(size) {}
_ZN18FuzzedDataProvider11ConsumeBoolEv:
  289|  9.23k|inline bool FuzzedDataProvider::ConsumeBool() {
  290|  9.23k|  return 1 & ConsumeIntegral<uint8_t>();
  291|  9.23k|}
_ZN18FuzzedDataProvider15ConsumeIntegralIhEET_v:
  195|   101k|template <typename T> T FuzzedDataProvider::ConsumeIntegral() {
  196|   101k|  return ConsumeIntegralInRange(std::numeric_limits<T>::min(),
  197|   101k|                                std::numeric_limits<T>::max());
  198|   101k|}
_ZN18FuzzedDataProvider22ConsumeIntegralInRangeIhEET_S1_S1_:
  205|   111k|T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
  206|   111k|  static_assert(std::is_integral_v<T>, "An integral type is required.");
  207|   111k|  static_assert(sizeof(T) <= sizeof(uint64_t), "Unsupported integral type.");
  208|       |
  209|   111k|  if (min > max)
  ------------------
  |  Branch (209:7): [True: 0, False: 111k]
  ------------------
  210|      0|    abort();
  211|       |
  212|       |  // Use the biggest type possible to hold the range and the result.
  213|   111k|  uint64_t range = static_cast<uint64_t>(max) - static_cast<uint64_t>(min);
  214|   111k|  uint64_t result = 0;
  215|   111k|  size_t offset = 0;
  216|       |
  217|   170k|  while (offset < sizeof(T) * CHAR_BIT && (range >> offset) > 0 &&
  ------------------
  |  Branch (217:10): [True: 111k, False: 59.4k]
  |  Branch (217:43): [True: 108k, False: 2.23k]
  ------------------
  218|   108k|         remaining_bytes_ != 0) {
  ------------------
  |  Branch (218:10): [True: 59.4k, False: 49.4k]
  ------------------
  219|       |    // Pull bytes off the end of the seed data. Experimentally, this seems to
  220|       |    // allow the fuzzer to more easily explore the input space. This makes
  221|       |    // sense, since it works by modifying inputs that caused new code to run,
  222|       |    // and this data is often used to encode length of data read by
  223|       |    // |ConsumeBytes|. Separating out read lengths makes it easier modify the
  224|       |    // contents of the data that is actually read.
  225|  59.4k|    --remaining_bytes_;
  226|  59.4k|    result = (result << CHAR_BIT) | data_ptr_[remaining_bytes_];
  227|  59.4k|    offset += CHAR_BIT;
  228|  59.4k|  }
  229|       |
  230|       |  // Avoid division by 0, in case |range + 1| results in overflow.
  231|   111k|  if (range != std::numeric_limits<decltype(range)>::max())
  ------------------
  |  Branch (231:7): [True: 111k, False: 0]
  ------------------
  232|   111k|    result = result % (range + 1);
  233|       |
  234|   111k|  return static_cast<T>(static_cast<uint64_t>(min) + result);
  235|   111k|}
_ZN18FuzzedDataProvider22ConsumeIntegralInRangeIjEET_S1_S1_:
  205|  11.8k|T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
  206|  11.8k|  static_assert(std::is_integral_v<T>, "An integral type is required.");
  207|  11.8k|  static_assert(sizeof(T) <= sizeof(uint64_t), "Unsupported integral type.");
  208|       |
  209|  11.8k|  if (min > max)
  ------------------
  |  Branch (209:7): [True: 0, False: 11.8k]
  ------------------
  210|      0|    abort();
  211|       |
  212|       |  // Use the biggest type possible to hold the range and the result.
  213|  11.8k|  uint64_t range = static_cast<uint64_t>(max) - static_cast<uint64_t>(min);
  214|  11.8k|  uint64_t result = 0;
  215|  11.8k|  size_t offset = 0;
  216|       |
  217|  24.5k|  while (offset < sizeof(T) * CHAR_BIT && (range >> offset) > 0 &&
  ------------------
  |  Branch (217:10): [True: 22.1k, False: 2.34k]
  |  Branch (217:43): [True: 13.5k, False: 8.60k]
  ------------------
  218|  13.5k|         remaining_bytes_ != 0) {
  ------------------
  |  Branch (218:10): [True: 12.6k, False: 923]
  ------------------
  219|       |    // Pull bytes off the end of the seed data. Experimentally, this seems to
  220|       |    // allow the fuzzer to more easily explore the input space. This makes
  221|       |    // sense, since it works by modifying inputs that caused new code to run,
  222|       |    // and this data is often used to encode length of data read by
  223|       |    // |ConsumeBytes|. Separating out read lengths makes it easier modify the
  224|       |    // contents of the data that is actually read.
  225|  12.6k|    --remaining_bytes_;
  226|  12.6k|    result = (result << CHAR_BIT) | data_ptr_[remaining_bytes_];
  227|  12.6k|    offset += CHAR_BIT;
  228|  12.6k|  }
  229|       |
  230|       |  // Avoid division by 0, in case |range + 1| results in overflow.
  231|  11.8k|  if (range != std::numeric_limits<decltype(range)>::max())
  ------------------
  |  Branch (231:7): [True: 11.8k, False: 0]
  ------------------
  232|  11.8k|    result = result % (range + 1);
  233|       |
  234|  11.8k|  return static_cast<T>(static_cast<uint64_t>(min) + result);
  235|  11.8k|}
_ZN18FuzzedDataProvider22ConsumeIntegralInRangeIKmEET_S2_S2_:
  205|   216k|T FuzzedDataProvider::ConsumeIntegralInRange(T min, T max) {
  206|   216k|  static_assert(std::is_integral_v<T>, "An integral type is required.");
  207|   216k|  static_assert(sizeof(T) <= sizeof(uint64_t), "Unsupported integral type.");
  208|       |
  209|   216k|  if (min > max)
  ------------------
  |  Branch (209:7): [True: 0, False: 216k]
  ------------------
  210|      0|    abort();
  211|       |
  212|       |  // Use the biggest type possible to hold the range and the result.
  213|   216k|  uint64_t range = static_cast<uint64_t>(max) - static_cast<uint64_t>(min);
  214|   216k|  uint64_t result = 0;
  215|   216k|  size_t offset = 0;
  216|       |
  217|   355k|  while (offset < sizeof(T) * CHAR_BIT && (range >> offset) > 0 &&
  ------------------
  |  Branch (217:10): [True: 355k, False: 0]
  |  Branch (217:43): [True: 216k, False: 139k]
  ------------------
  218|   216k|         remaining_bytes_ != 0) {
  ------------------
  |  Branch (218:10): [True: 139k, False: 77.4k]
  ------------------
  219|       |    // Pull bytes off the end of the seed data. Experimentally, this seems to
  220|       |    // allow the fuzzer to more easily explore the input space. This makes
  221|       |    // sense, since it works by modifying inputs that caused new code to run,
  222|       |    // and this data is often used to encode length of data read by
  223|       |    // |ConsumeBytes|. Separating out read lengths makes it easier modify the
  224|       |    // contents of the data that is actually read.
  225|   139k|    --remaining_bytes_;
  226|   139k|    result = (result << CHAR_BIT) | data_ptr_[remaining_bytes_];
  227|   139k|    offset += CHAR_BIT;
  228|   139k|  }
  229|       |
  230|       |  // Avoid division by 0, in case |range + 1| results in overflow.
  231|   216k|  if (range != std::numeric_limits<decltype(range)>::max())
  ------------------
  |  Branch (231:7): [True: 216k, False: 0]
  ------------------
  232|   216k|    result = result % (range + 1);
  233|       |
  234|   216k|  return static_cast<T>(static_cast<uint64_t>(min) + result);
  235|   216k|}

LLVMFuzzerTestOneInput:
  213|  5.04k|{
  214|  5.04k|    test_one_input({data, size});
  215|  5.04k|    return 0;
  216|  5.04k|}
fuzz.cpp:_ZL14test_one_inputNSt3__14spanIKhLm18446744073709551615EEE:
   84|  5.04k|{
   85|  5.04k|    CheckGlobals check{};
   86|  5.04k|    (*Assert(g_test_one_input))(buffer);
  ------------------
  |  |  116|  5.04k|#define Assert(val) inline_assertion_check<true>(val, std::source_location::current(), #val)
  ------------------
   87|  5.04k|}

_Z28miniscript_smart_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEE:
 1223|  5.04k|{
 1224|       |    /** The set of types we aim to construct nodes for. Together they cover all. */
 1225|  5.04k|    static constexpr std::array<Type, 4> BASE_TYPES{"B"_mst, "V"_mst, "K"_mst, "W"_mst};
 1226|       |
 1227|  5.04k|    FuzzedDataProvider provider(buffer.data(), buffer.size());
 1228|  5.04k|    const auto script_ctx{(MsCtx)provider.ConsumeBool()};
 1229|  5.04k|    TestNode(script_ctx, GenNode(script_ctx, [&](Type needed_type) {
 1230|  5.04k|        return ConsumeNodeSmart(script_ctx, provider, needed_type);
 1231|  5.04k|    }, PickValue(provider, BASE_TYPES), true), provider);
 1232|  5.04k|}
miniscript.cpp:_ZN12_GLOBAL__N_18TestNodeEN10miniscript17MiniscriptContextERKNSt3__18optionalINS0_4NodeI7CPubKeyEEEER18FuzzedDataProvider:
 1031|  5.04k|{
 1032|  5.04k|    if (!node) return;
  ------------------
  |  Branch (1032:9): [True: 288, False: 4.76k]
  ------------------
 1033|       |
 1034|       |    // Check that it roundtrips to text representation
 1035|  4.76k|    const ParserContext parser_ctx{script_ctx};
 1036|  4.76k|    std::optional<std::string> str{node->ToString(parser_ctx)};
 1037|  4.76k|    assert(str);
  ------------------
  |  Branch (1037:5): [True: 4.76k, False: 0]
  ------------------
 1038|  4.76k|    auto parsed = miniscript::FromString(*str, parser_ctx);
 1039|  4.76k|    assert(parsed);
  ------------------
  |  Branch (1039:5): [True: 4.76k, False: 0]
  ------------------
 1040|  4.76k|    assert(*parsed == *node);
  ------------------
  |  Branch (1040:5): [True: 4.76k, False: 0]
  ------------------
 1041|       |
 1042|       |    // Check consistency between script size estimation and real size.
 1043|  4.76k|    auto script = node->ToScript(parser_ctx);
 1044|  4.76k|    assert(node->ScriptSize() == script.size());
  ------------------
  |  Branch (1044:5): [True: 4.76k, False: 0]
  ------------------
 1045|       |
 1046|       |    // Check consistency of "x" property with the script (type K is excluded, because it can end
 1047|       |    // with a push of a key, which could match these opcodes).
 1048|  4.76k|    if (!(node->GetType() << "K"_mst)) {
  ------------------
  |  Branch (1048:9): [True: 4.55k, False: 202]
  ------------------
 1049|  4.55k|        bool ends_in_verify = !(node->GetType() << "x"_mst);
 1050|  4.55k|        assert(ends_in_verify == (script.back() == OP_CHECKSIG || script.back() == OP_CHECKMULTISIG || script.back() == OP_EQUAL || script.back() == OP_NUMEQUAL));
  ------------------
  |  Branch (1050:9): [True: 356, False: 4.20k]
  |  Branch (1050:9): [True: 180, False: 4.02k]
  |  Branch (1050:9): [True: 712, False: 3.31k]
  |  Branch (1050:9): [True: 177, False: 3.13k]
  |  Branch (1050:9): [True: 4.55k, False: 0]
  ------------------
 1051|  4.55k|    }
 1052|       |
 1053|       |    // The rest of the checks only apply when testing a valid top-level script.
 1054|  4.76k|    if (!node->IsValidTopLevel()) return;
  ------------------
  |  Branch (1054:9): [True: 576, False: 4.18k]
  ------------------
 1055|       |
 1056|       |    // Check roundtrip to script
 1057|  4.18k|    auto decoded = miniscript::FromScript(script, parser_ctx);
 1058|  4.18k|    assert(decoded);
  ------------------
  |  Branch (1058:5): [True: 4.18k, False: 0]
  ------------------
 1059|       |    // Note we can't use *decoded == *node because the miniscript representation may differ, so we check that:
 1060|       |    // - The script corresponding to that decoded form matches exactly
 1061|       |    // - The type matches exactly
 1062|  4.18k|    assert(decoded->ToScript(parser_ctx) == script);
  ------------------
  |  Branch (1062:5): [True: 4.18k, False: 0]
  ------------------
 1063|  4.18k|    assert(decoded->GetType() == node->GetType());
  ------------------
  |  Branch (1063:5): [True: 4.18k, False: 0]
  ------------------
 1064|       |
 1065|       |    // Optionally pad the script or the witness in order to increase the sensitivity of the tests of
 1066|       |    // the resources limits logic.
 1067|  4.18k|    CScriptWitness witness_mal, witness_nonmal;
 1068|  4.18k|    if (provider.ConsumeBool()) {
  ------------------
  |  Branch (1068:9): [True: 257, False: 3.92k]
  ------------------
 1069|       |        // Under P2WSH, optionally pad the script with OP_NOPs to max op the ops limit of the constructed script.
 1070|       |        // This makes the script obviously not actually miniscript-compatible anymore, but the
 1071|       |        // signatures constructed in this test don't commit to the script anyway, so the same
 1072|       |        // miniscript satisfier will work. This increases the sensitivity of the test to the ops
 1073|       |        // counting logic being too low, especially for simple scripts.
 1074|       |        // Do this optionally because we're not solely interested in cases where the number of ops is
 1075|       |        // maximal.
 1076|       |        // Do not pad more than what would cause MAX_STANDARD_P2WSH_SCRIPT_SIZE to be reached, however,
 1077|       |        // as that also invalidates scripts.
 1078|    257|        const auto node_ops{node->GetOps()};
 1079|    257|        if (!IsTapscript(script_ctx) && node_ops && *node_ops < MAX_OPS_PER_SCRIPT
  ------------------
  |  Branch (1079:13): [True: 100, False: 157]
  |  Branch (1079:41): [True: 93, False: 7]
  |  Branch (1079:53): [True: 87, False: 6]
  ------------------
 1080|     87|            && node->ScriptSize() < MAX_STANDARD_P2WSH_SCRIPT_SIZE) {
  ------------------
  |  Branch (1080:16): [True: 86, False: 1]
  ------------------
 1081|     86|            int add = std::min<int>(
 1082|     86|                MAX_OPS_PER_SCRIPT - *node_ops,
 1083|     86|                MAX_STANDARD_P2WSH_SCRIPT_SIZE - node->ScriptSize());
 1084|  10.4k|            for (int i = 0; i < add; ++i) script.push_back(OP_NOP);
  ------------------
  |  Branch (1084:29): [True: 10.3k, False: 86]
  ------------------
 1085|     86|        }
 1086|       |
 1087|       |        // Under Tapscript, optionally pad the stack up to the limit minus the calculated maximum execution stack
 1088|       |        // size to assert a Miniscript would never add more elements to the stack during execution than anticipated.
 1089|    257|        const auto node_exec_ss{node->GetExecStackSize()};
 1090|    257|        if (miniscript::IsTapscript(script_ctx) && node_exec_ss && *node_exec_ss < MAX_STACK_SIZE) {
  ------------------
  |  Branch (1090:13): [True: 157, False: 100]
  |  Branch (1090:52): [True: 155, False: 2]
  |  Branch (1090:68): [True: 155, False: 0]
  ------------------
 1091|    155|            unsigned add{(unsigned)MAX_STACK_SIZE - *node_exec_ss};
 1092|    155|            witness_mal.stack.resize(add);
 1093|    155|            witness_nonmal.stack.resize(add);
 1094|    155|            script.reserve(add);
 1095|   151k|            for (unsigned i = 0; i < add; ++i) script.push_back(OP_NIP);
  ------------------
  |  Branch (1095:34): [True: 151k, False: 155]
  ------------------
 1096|    155|        }
 1097|    257|    }
 1098|       |
 1099|  4.18k|    const SatisfierContext satisfier_ctx{script_ctx};
 1100|       |
 1101|       |    // Get the ScriptPubKey for this script, filling spend data if it's Taproot.
 1102|  4.18k|    TaprootBuilder builder;
 1103|  4.18k|    const CScript script_pubkey{ScriptPubKey(script_ctx, script, builder)};
 1104|       |
 1105|       |    // Run malleable satisfaction algorithm.
 1106|  4.18k|    std::vector<std::vector<unsigned char>> stack_mal;
 1107|  4.18k|    const bool mal_success = node->Satisfy(satisfier_ctx, stack_mal, false) == miniscript::Availability::YES;
 1108|       |
 1109|       |    // Run non-malleable satisfaction algorithm.
 1110|  4.18k|    std::vector<std::vector<unsigned char>> stack_nonmal;
 1111|  4.18k|    const bool nonmal_success = node->Satisfy(satisfier_ctx, stack_nonmal, true) == miniscript::Availability::YES;
 1112|       |
 1113|  4.18k|    if (nonmal_success) {
  ------------------
  |  Branch (1113:9): [True: 936, False: 3.24k]
  ------------------
 1114|       |        // Non-malleable satisfactions are bounded by the satisfaction size plus:
 1115|       |        // - For P2WSH spends, the witness script
 1116|       |        // - For Tapscript spends, both the witness script and the control block
 1117|    936|        const size_t max_stack_size{*node->GetStackSize() + 1 + miniscript::IsTapscript(script_ctx)};
 1118|    936|        assert(stack_nonmal.size() <= max_stack_size);
  ------------------
  |  Branch (1118:9): [True: 936, False: 0]
  ------------------
 1119|       |        // If a non-malleable satisfaction exists, the malleable one must also exist, and be identical to it.
 1120|    936|        assert(mal_success);
  ------------------
  |  Branch (1120:9): [True: 936, False: 0]
  ------------------
 1121|    936|        assert(stack_nonmal == stack_mal);
  ------------------
  |  Branch (1121:9): [True: 936, False: 0]
  ------------------
 1122|       |        // Compute witness size (excluding script push, control block, and witness count encoding).
 1123|    936|        const uint64_t wit_size{GetSerializeSize(stack_nonmal) - GetSizeOfCompactSize(stack_nonmal.size())};
 1124|    936|        assert(wit_size <= *node->GetWitnessSize());
  ------------------
  |  Branch (1124:9): [True: 936, False: 0]
  ------------------
 1125|       |
 1126|       |        // Test non-malleable satisfaction.
 1127|    936|        witness_nonmal.stack.insert(witness_nonmal.stack.end(), std::make_move_iterator(stack_nonmal.begin()), std::make_move_iterator(stack_nonmal.end()));
 1128|    936|        SatisfactionToWitness(script_ctx, witness_nonmal, script, builder);
 1129|    936|        ScriptError serror;
 1130|    936|        bool res = VerifyScript(DUMMY_SCRIPTSIG, script_pubkey, &witness_nonmal, STANDARD_SCRIPT_VERIFY_FLAGS, CHECKER_CTX, &serror);
 1131|       |        // Non-malleable satisfactions are guaranteed to be valid if ValidSatisfactions().
 1132|    936|        if (node->ValidSatisfactions()) assert(res);
  ------------------
  |  Branch (1132:13): [True: 901, False: 35]
  |  Branch (1132:41): [True: 901, False: 0]
  ------------------
 1133|       |        // More detailed: non-malleable satisfactions must be valid, or could fail with ops count error (if CheckOpsLimit failed),
 1134|       |        // or with a stack size error (if CheckStackSize check failed).
 1135|    936|        assert(res ||
  ------------------
  |  Branch (1135:9): [True: 27, False: 0]
  |  Branch (1135:9): [True: 27, False: 0]
  |  Branch (1135:9): [True: 909, False: 27]
  |  Branch (1135:9): [True: 0, False: 0]
  |  Branch (1135:9): [True: 0, False: 0]
  |  Branch (1135:9): [True: 936, False: 0]
  ------------------
 1136|    936|               (!node->CheckOpsLimit() && serror == ScriptError::SCRIPT_ERR_OP_COUNT) ||
 1137|    936|               (!node->CheckStackSize() && serror == ScriptError::SCRIPT_ERR_STACK_SIZE));
 1138|    936|    }
 1139|       |
 1140|  4.18k|    if (mal_success && (!nonmal_success || witness_mal.stack != witness_nonmal.stack)) {
  ------------------
  |  Branch (1140:9): [True: 2.03k, False: 2.14k]
  |  Branch (1140:25): [True: 1.10k, False: 936]
  |  Branch (1140:44): [True: 936, False: 0]
  ------------------
 1141|       |        // Test malleable satisfaction only if it's different from the non-malleable one.
 1142|  2.03k|        witness_mal.stack.insert(witness_mal.stack.end(), std::make_move_iterator(stack_mal.begin()), std::make_move_iterator(stack_mal.end()));
 1143|  2.03k|        SatisfactionToWitness(script_ctx, witness_mal, script, builder);
 1144|  2.03k|        ScriptError serror;
 1145|  2.03k|        bool res = VerifyScript(DUMMY_SCRIPTSIG, script_pubkey, &witness_mal, STANDARD_SCRIPT_VERIFY_FLAGS, CHECKER_CTX, &serror);
 1146|       |        // Malleable satisfactions are not guaranteed to be valid under any conditions, but they can only
 1147|       |        // fail due to stack or ops limits.
 1148|  2.03k|        assert(res || serror == ScriptError::SCRIPT_ERR_OP_COUNT || serror == ScriptError::SCRIPT_ERR_STACK_SIZE);
  ------------------
  |  Branch (1148:9): [True: 1.98k, False: 55]
  |  Branch (1148:9): [True: 41, False: 14]
  |  Branch (1148:9): [True: 14, False: 0]
  |  Branch (1148:9): [True: 2.03k, False: 0]
  ------------------
 1149|  2.03k|    }
 1150|       |
 1151|  4.18k|    if (node->IsSane()) {
  ------------------
  |  Branch (1151:9): [True: 1.01k, False: 3.16k]
  ------------------
 1152|       |        // For sane nodes, the two algorithms behave identically.
 1153|  1.01k|        assert(mal_success == nonmal_success);
  ------------------
  |  Branch (1153:9): [True: 1.01k, False: 0]
  ------------------
 1154|  1.01k|    }
 1155|       |
 1156|       |    // Verify that if a node is policy-satisfiable, the malleable satisfaction
 1157|       |    // algorithm succeeds. Given that under IsSane() both satisfactions
 1158|       |    // are identical, this implies that for such nodes, the non-malleable
 1159|       |    // satisfaction will also match the expected policy.
 1160|  4.18k|    const auto is_key_satisfiable = [script_ctx](const CPubKey& pubkey) -> bool {
 1161|  4.18k|        auto sig_ptr{TEST_DATA.GetSig(script_ctx, pubkey)};
 1162|  4.18k|        return sig_ptr != nullptr && sig_ptr->second;
 1163|  4.18k|    };
 1164|  4.18k|    bool satisfiable = node->IsSatisfiable([&](const Node& node) -> bool {
 1165|  4.18k|        switch (node.Fragment()) {
 1166|  4.18k|        case Fragment::PK_K:
 1167|  4.18k|        case Fragment::PK_H:
 1168|  4.18k|            return is_key_satisfiable(node.Keys()[0]);
 1169|  4.18k|        case Fragment::MULTI:
 1170|  4.18k|        case Fragment::MULTI_A: {
 1171|  4.18k|            size_t sats = std::ranges::count_if(node.Keys(), [&](const auto& key) {
 1172|  4.18k|                return size_t(is_key_satisfiable(key));
 1173|  4.18k|            });
 1174|  4.18k|            return sats >= node.K();
 1175|  4.18k|        }
 1176|  4.18k|        case Fragment::OLDER:
 1177|  4.18k|        case Fragment::AFTER:
 1178|  4.18k|            return node.K() & 1;
 1179|  4.18k|        case Fragment::SHA256:
 1180|  4.18k|            return TEST_DATA.sha256_preimages.contains(node.Data());
 1181|  4.18k|        case Fragment::HASH256:
 1182|  4.18k|            return TEST_DATA.hash256_preimages.contains(node.Data());
 1183|  4.18k|        case Fragment::RIPEMD160:
 1184|  4.18k|            return TEST_DATA.ripemd160_preimages.contains(node.Data());
 1185|  4.18k|        case Fragment::HASH160:
 1186|  4.18k|            return TEST_DATA.hash160_preimages.contains(node.Data());
 1187|  4.18k|        default:
 1188|  4.18k|            assert(false);
 1189|  4.18k|        }
 1190|  4.18k|        return false;
 1191|  4.18k|    });
 1192|       |    assert(mal_success == satisfiable);
  ------------------
  |  Branch (1192:5): [True: 4.18k, False: 0]
  ------------------
 1193|  4.18k|}
miniscript.cpp:_ZNK12_GLOBAL__N_113ParserContext9ToPKBytesERK7CPubKey:
  140|   116k|    std::vector<unsigned char> ToPKBytes(const Key& key) const {
  141|   116k|        if (!miniscript::IsTapscript(script_ctx)) {
  ------------------
  |  Branch (141:13): [True: 63.4k, False: 52.9k]
  ------------------
  142|  63.4k|            return {key.begin(), key.end()};
  143|  63.4k|        }
  144|  52.9k|        const XOnlyPubKey xonly_pubkey{key};
  145|  52.9k|        return {xonly_pubkey.begin(), xonly_pubkey.end()};
  146|   116k|    }
miniscript.cpp:_ZNK12_GLOBAL__N_113ParserContext10ToPKHBytesERK7CPubKey:
  148|  3.80k|    std::vector<unsigned char> ToPKHBytes(const Key& key) const {
  149|  3.80k|        if (!miniscript::IsTapscript(script_ctx)) {
  ------------------
  |  Branch (149:13): [True: 2.16k, False: 1.64k]
  ------------------
  150|  2.16k|            const auto h = Hash160(key);
  151|  2.16k|            return {h.begin(), h.end()};
  152|  2.16k|        }
  153|  1.64k|        const auto h = Hash160(XOnlyPubKey{key});
  154|  1.64k|        return {h.begin(), h.end()};
  155|  3.80k|    }
miniscript.cpp:_ZNK12_GLOBAL__N_113ParserContext9MsContextEv:
  187|   342k|    MsCtx MsContext() const {
  188|   342k|        return script_ctx;
  189|   342k|    }
miniscript.cpp:_ZNK12_GLOBAL__N_113ParserContext11FromPKBytesINSt3__111__wrap_iterIPhEEEENS2_8optionalI7CPubKeyEET_S9_:
  165|  53.8k|    std::optional<Key> FromPKBytes(I first, I last) const {
  166|  53.8k|        if (!miniscript::IsTapscript(script_ctx)) {
  ------------------
  |  Branch (166:13): [True: 29.5k, False: 24.2k]
  ------------------
  167|  29.5k|            Key key{first, last};
  168|  29.5k|            if (key.IsValid()) return key;
  ------------------
  |  Branch (168:17): [True: 29.5k, False: 0]
  ------------------
  169|      0|            return {};
  170|  29.5k|        }
  171|  24.2k|        if (last - first != 32) return {};
  ------------------
  |  Branch (171:13): [True: 0, False: 24.2k]
  ------------------
  172|  24.2k|        XOnlyPubKey xonly_pubkey;
  173|  24.2k|        std::copy(first, last, xonly_pubkey.begin());
  174|  24.2k|        return xonly_pubkey.GetEvenCorrespondingCPubKey();
  175|  24.2k|    }
miniscript.cpp:_ZNK12_GLOBAL__N_113ParserContext12FromPKHBytesINSt3__111__wrap_iterIPhEEEENS2_8optionalI7CPubKeyEET_S9_:
  178|  1.76k|    std::optional<Key> FromPKHBytes(I first, I last) const {
  179|  1.76k|        assert(last - first == 20);
  ------------------
  |  Branch (179:9): [True: 1.76k, False: 0]
  ------------------
  180|  1.76k|        CKeyID keyid;
  181|  1.76k|        std::copy(first, last, keyid.begin());
  182|  1.76k|        const auto it = TEST_DATA.dummy_keys_map.find(keyid);
  183|  1.76k|        if (it == TEST_DATA.dummy_keys_map.end()) return {};
  ------------------
  |  Branch (183:13): [True: 0, False: 1.76k]
  ------------------
  184|  1.76k|        return it->second;
  185|  1.76k|    }
miniscript.cpp:_ZNK12_GLOBAL__N_113ParserContext10KeyCompareERK7CPubKeyS3_:
  124|   440k|    bool KeyCompare(const Key& a, const Key& b) const {
  125|   440k|        return a < b;
  126|   440k|    }
miniscript.cpp:_ZN12_GLOBAL__N_116SatisfierContextC2EN10miniscript17MiniscriptContextE:
  247|  4.18k|    constexpr SatisfierContext(MsCtx ctx) noexcept : ParserContext(ctx) {}
miniscript.cpp:_ZN12_GLOBAL__N_113ParserContextC2EN10miniscript17MiniscriptContextE:
  122|  8.94k|    constexpr ParserContext(MsCtx ctx) noexcept : script_ctx(ctx) {}
miniscript.cpp:_ZN12_GLOBAL__N_112ScriptPubKeyEN10miniscript17MiniscriptContextERK7CScriptR14TaprootBuilder:
 1011|  4.18k|{
 1012|  4.18k|    if (!miniscript::IsTapscript(ctx)) return CScript() << OP_0 << WitnessV0ScriptHash(script);
  ------------------
  |  Branch (1012:9): [True: 2.23k, False: 1.95k]
  ------------------
 1013|       |
 1014|       |    // For Taproot outputs we always use a tree with a single script and a dummy internal key.
 1015|  1.95k|    builder.Add(0, script, TAPROOT_LEAF_TAPSCRIPT);
 1016|  1.95k|    builder.Finalize(XOnlyPubKey::NUMS_H);
 1017|  1.95k|    return GetScriptForDestination(builder.GetOutput());
 1018|  4.18k|}
miniscript.cpp:_ZNK12_GLOBAL__N_116SatisfierContext4SignERK7CPubKeyRNSt3__16vectorIhNS4_9allocatorIhEEEE:
  255|   111k|    miniscript::Availability Sign(const CPubKey& key, std::vector<unsigned char>& sig) const {
  256|   111k|        bool sig_available{false};
  257|   111k|        if (auto res = TEST_DATA.GetSig(script_ctx, key)) {
  ------------------
  |  Branch (257:18): [True: 111k, False: 0]
  ------------------
  258|   111k|            std::tie(sig, sig_available) = *res;
  259|   111k|        }
  260|   111k|        return sig_available ? miniscript::Availability::YES : miniscript::Availability::NO;
  ------------------
  |  Branch (260:16): [True: 37.4k, False: 73.6k]
  ------------------
  261|   111k|    }
miniscript.cpp:_ZNK12_GLOBAL__N_18TestData6GetSigEN10miniscript17MiniscriptContextERK7CPubKey:
   99|   166k|    const std::pair<std::vector<unsigned char>, bool>* GetSig(const MsCtx script_ctx, const Key& key) const {
  100|   166k|        if (!miniscript::IsTapscript(script_ctx)) {
  ------------------
  |  Branch (100:13): [True: 91.5k, False: 75.1k]
  ------------------
  101|  91.5k|            const auto it = dummy_sigs.find(key);
  102|  91.5k|            if (it == dummy_sigs.end()) return nullptr;
  ------------------
  |  Branch (102:17): [True: 0, False: 91.5k]
  ------------------
  103|  91.5k|            return &it->second;
  104|  91.5k|        } else {
  105|  75.1k|            const auto it = schnorr_sigs.find(XOnlyPubKey{key});
  106|  75.1k|            if (it == schnorr_sigs.end()) return nullptr;
  ------------------
  |  Branch (106:17): [True: 0, False: 75.1k]
  ------------------
  107|  75.1k|            return &it->second;
  108|  75.1k|        }
  109|   166k|    }
miniscript.cpp:_ZNK12_GLOBAL__N_116SatisfierContext10CheckOlderEj:
  252|  3.07k|    bool CheckOlder(uint32_t value) const { return value % 2; }
miniscript.cpp:_ZNK12_GLOBAL__N_116SatisfierContext10CheckAfterEj:
  251|  2.54k|    bool CheckAfter(uint32_t value) const { return value % 2; }
miniscript.cpp:_ZNK12_GLOBAL__N_116SatisfierContext9SatSHA256ERKNSt3__16vectorIhNS1_9allocatorIhEEEERS5_:
  272|  3.12k|    miniscript::Availability SatSHA256(const std::vector<unsigned char>& hash, std::vector<unsigned char>& preimage) const {
  273|  3.12k|        return LookupHash(hash, preimage, TEST_DATA.sha256_preimages);
  274|  3.12k|    }
miniscript.cpp:_ZNK12_GLOBAL__N_116SatisfierContext10LookupHashERKNSt3__16vectorIhNS1_9allocatorIhEEEERS5_RKNS1_3mapIS5_S5_NS1_4lessIS5_EENS3_INS1_4pairIS6_S5_EEEEEE:
  266|  10.6k|    {
  267|  10.6k|        const auto it = map.find(hash);
  268|  10.6k|        if (it == map.end()) return miniscript::Availability::NO;
  ------------------
  |  Branch (268:13): [True: 4.90k, False: 5.76k]
  ------------------
  269|  5.76k|        preimage = it->second;
  270|  5.76k|        return miniscript::Availability::YES;
  271|  10.6k|    }
miniscript.cpp:_ZNK12_GLOBAL__N_116SatisfierContext12SatRIPEMD160ERKNSt3__16vectorIhNS1_9allocatorIhEEEERS5_:
  275|  2.17k|    miniscript::Availability SatRIPEMD160(const std::vector<unsigned char>& hash, std::vector<unsigned char>& preimage) const {
  276|  2.17k|        return LookupHash(hash, preimage, TEST_DATA.ripemd160_preimages);
  277|  2.17k|    }
miniscript.cpp:_ZNK12_GLOBAL__N_116SatisfierContext10SatHASH256ERKNSt3__16vectorIhNS1_9allocatorIhEEEERS5_:
  278|  2.98k|    miniscript::Availability SatHASH256(const std::vector<unsigned char>& hash, std::vector<unsigned char>& preimage) const {
  279|  2.98k|        return LookupHash(hash, preimage, TEST_DATA.hash256_preimages);
  280|  2.98k|    }
miniscript.cpp:_ZNK12_GLOBAL__N_116SatisfierContext10SatHASH160ERKNSt3__16vectorIhNS1_9allocatorIhEEEERS5_:
  281|  2.37k|    miniscript::Availability SatHASH160(const std::vector<unsigned char>& hash, std::vector<unsigned char>& preimage) const {
  282|  2.37k|        return LookupHash(hash, preimage, TEST_DATA.hash160_preimages);
  283|  2.37k|    }
miniscript.cpp:_ZN12_GLOBAL__N_121SatisfactionToWitnessEN10miniscript17MiniscriptContextER14CScriptWitnessRK7CScriptR14TaprootBuilder:
 1021|  2.97k|void SatisfactionToWitness(MsCtx ctx, CScriptWitness& witness, const CScript& script, TaprootBuilder& builder) {
 1022|       |    // For P2WSH, it's only the witness script.
 1023|  2.97k|    witness.stack.emplace_back(script.begin(), script.end());
 1024|  2.97k|    if (!miniscript::IsTapscript(ctx)) return;
  ------------------
  |  Branch (1024:9): [True: 1.68k, False: 1.29k]
  ------------------
 1025|       |    // For Tapscript we also need the control block.
 1026|  1.29k|    witness.stack.push_back(*builder.GetSpendData().scripts.begin()->second.begin());
 1027|  1.29k|}
miniscript.cpp:_ZNK12_GLOBAL__N_114CheckerContext19CheckECDSASignatureERKNSt3__16vectorIhNS1_9allocatorIhEEEES7_RK7CScript10SigVersion:
  291|  14.9k|    {
  292|  14.9k|        const CPubKey key{vchPubKey};
  293|  14.9k|        const auto it = TEST_DATA.dummy_sigs.find(key);
  294|  14.9k|        if (it == TEST_DATA.dummy_sigs.end()) return false;
  ------------------
  |  Branch (294:13): [True: 0, False: 14.9k]
  ------------------
  295|  14.9k|        return it->second.first == sig;
  296|  14.9k|    }
miniscript.cpp:_ZNK12_GLOBAL__N_114CheckerContext21CheckSchnorrSignatureENSt3__14spanIKhLm18446744073709551615EEES4_10SigVersionR19ScriptExecutionDataP13ScriptError_t:
  298|  4.03k|                               ScriptExecutionData&, ScriptError*) const override {
  299|  4.03k|        XOnlyPubKey pk{pubkey};
  300|  4.03k|        auto it = TEST_DATA.schnorr_sigs.find(pk);
  301|  4.03k|        if (it == TEST_DATA.schnorr_sigs.end()) return false;
  ------------------
  |  Branch (301:13): [True: 0, False: 4.03k]
  ------------------
  302|  4.03k|        return std::ranges::equal(it->second.first, sig);
  303|  4.03k|    }
miniscript.cpp:_ZNK12_GLOBAL__N_114CheckerContext13CheckLockTimeERK10CScriptNum:
  304|    570|    bool CheckLockTime(const CScriptNum& nLockTime) const override { return nLockTime.GetInt64() & 1; }
miniscript.cpp:_ZNK12_GLOBAL__N_114CheckerContext13CheckSequenceERK10CScriptNum:
  305|    499|    bool CheckSequence(const CScriptNum& nSequence) const override { return nSequence.GetInt64() & 1; }
miniscript.cpp:_ZZN12_GLOBAL__N_18TestNodeEN10miniscript17MiniscriptContextERKNSt3__18optionalINS0_4NodeI7CPubKeyEEEER18FuzzedDataProviderENK3$_0clERKS6_:
 1164|  22.4k|    bool satisfiable = node->IsSatisfiable([&](const Node& node) -> bool {
 1165|  22.4k|        switch (node.Fragment()) {
 1166|  6.98k|        case Fragment::PK_K:
  ------------------
  |  Branch (1166:9): [True: 6.98k, False: 15.4k]
  ------------------
 1167|  8.74k|        case Fragment::PK_H:
  ------------------
  |  Branch (1167:9): [True: 1.76k, False: 20.6k]
  ------------------
 1168|  8.74k|            return is_key_satisfiable(node.Keys()[0]);
 1169|  4.54k|        case Fragment::MULTI:
  ------------------
  |  Branch (1169:9): [True: 4.54k, False: 17.8k]
  ------------------
 1170|  5.52k|        case Fragment::MULTI_A: {
  ------------------
  |  Branch (1170:9): [True: 988, False: 21.4k]
  ------------------
 1171|  5.52k|            size_t sats = std::ranges::count_if(node.Keys(), [&](const auto& key) {
 1172|  5.52k|                return size_t(is_key_satisfiable(key));
 1173|  5.52k|            });
 1174|  5.52k|            return sats >= node.K();
 1175|  4.54k|        }
 1176|  1.53k|        case Fragment::OLDER:
  ------------------
  |  Branch (1176:9): [True: 1.53k, False: 20.8k]
  ------------------
 1177|  2.81k|        case Fragment::AFTER:
  ------------------
  |  Branch (1177:9): [True: 1.27k, False: 21.1k]
  ------------------
 1178|  2.81k|            return node.K() & 1;
 1179|  1.56k|        case Fragment::SHA256:
  ------------------
  |  Branch (1179:9): [True: 1.56k, False: 20.8k]
  ------------------
 1180|  1.56k|            return TEST_DATA.sha256_preimages.contains(node.Data());
 1181|  1.49k|        case Fragment::HASH256:
  ------------------
  |  Branch (1181:9): [True: 1.49k, False: 20.9k]
  ------------------
 1182|  1.49k|            return TEST_DATA.hash256_preimages.contains(node.Data());
 1183|  1.08k|        case Fragment::RIPEMD160:
  ------------------
  |  Branch (1183:9): [True: 1.08k, False: 21.3k]
  ------------------
 1184|  1.08k|            return TEST_DATA.ripemd160_preimages.contains(node.Data());
 1185|  1.18k|        case Fragment::HASH160:
  ------------------
  |  Branch (1185:9): [True: 1.18k, False: 21.2k]
  ------------------
 1186|  1.18k|            return TEST_DATA.hash160_preimages.contains(node.Data());
 1187|      0|        default:
  ------------------
  |  Branch (1187:9): [True: 0, False: 22.4k]
  ------------------
 1188|      0|            assert(false);
  ------------------
  |  Branch (1188:13): [Folded, False: 0]
  ------------------
 1189|  22.4k|        }
 1190|      0|        return false;
 1191|  22.4k|    });
miniscript.cpp:_ZZN12_GLOBAL__N_18TestNodeEN10miniscript17MiniscriptContextERKNSt3__18optionalINS0_4NodeI7CPubKeyEEEER18FuzzedDataProviderENK3$_1clERKS5_:
 1160|  55.5k|    const auto is_key_satisfiable = [script_ctx](const CPubKey& pubkey) -> bool {
 1161|  55.5k|        auto sig_ptr{TEST_DATA.GetSig(script_ctx, pubkey)};
 1162|  55.5k|        return sig_ptr != nullptr && sig_ptr->second;
  ------------------
  |  Branch (1162:16): [True: 55.5k, False: 0]
  |  Branch (1162:38): [True: 18.7k, False: 36.8k]
  ------------------
 1163|  55.5k|    };
miniscript.cpp:_ZZZN12_GLOBAL__N_18TestNodeEN10miniscript17MiniscriptContextERKNSt3__18optionalINS0_4NodeI7CPubKeyEEEER18FuzzedDataProviderENK3$_0clERKS6_ENKUlRKT_E_clIS5_EEDaSH_:
 1171|  46.8k|            size_t sats = std::ranges::count_if(node.Keys(), [&](const auto& key) {
 1172|  46.8k|                return size_t(is_key_satisfiable(key));
 1173|  46.8k|            });
miniscript.cpp:_ZNK12_GLOBAL__N_113ParserContext8ToStringERK7CPubKeyRb:
  129|  63.7k|    {
  130|  63.7k|        has_priv_key = false;
  131|  63.7k|        auto it = TEST_DATA.dummy_key_idx_map.find(key);
  132|  63.7k|        if (it == TEST_DATA.dummy_key_idx_map.end()) {
  ------------------
  |  Branch (132:13): [True: 0, False: 63.7k]
  ------------------
  133|      0|            return HexStr(key);
  134|      0|        }
  135|  63.7k|        has_priv_key = true;
  136|  63.7k|        uint8_t idx = it->second;
  137|  63.7k|        return HexStr(std::span{&idx, 1});
  138|  63.7k|    }
miniscript.cpp:_ZNK12_GLOBAL__N_113ParserContext10FromStringERNSt3__14spanIKcLm18446744073709551615EEE:
  157|  61.1k|    std::optional<Key> FromString(std::span<const char>& in) const {
  158|  61.1k|        if (in.size() != 2) return {};
  ------------------
  |  Branch (158:13): [True: 0, False: 61.1k]
  ------------------
  159|  61.1k|        auto idx = ParseHex(std::string(in.begin(), in.end()));
  160|  61.1k|        if (idx.size() != 1) return {};
  ------------------
  |  Branch (160:13): [True: 0, False: 61.1k]
  ------------------
  161|  61.1k|        return TEST_DATA.dummy_keys[idx[0]];
  162|  61.1k|    }
miniscript.cpp:_ZN12_GLOBAL__N_113ConsumePubKeyER18FuzzedDataProvider:
  347|  92.1k|CPubKey ConsumePubKey(FuzzedDataProvider& provider) {
  348|  92.1k|    return ConsumeIndex<CPubKey>(provider, TEST_DATA.dummy_keys);
  349|  92.1k|}
miniscript.cpp:_ZN12_GLOBAL__N_112ConsumeIndexI7CPubKeyNSt3__16vectorIS1_NS2_9allocatorIS1_EEEEEET_R18FuzzedDataProviderRT0_:
  342|  92.1k|T ConsumeIndex(FuzzedDataProvider& provider, A& col) {
  343|  92.1k|    const uint8_t i = provider.ConsumeIntegral<uint8_t>();
  344|  92.1k|    return col[i];
  345|  92.1k|}
miniscript.cpp:_ZN12_GLOBAL__N_18NodeInfoC2EN10miniscript8FragmentE7CPubKey:
  332|  10.9k|    NodeInfo(Fragment frag, CPubKey key): fragment(frag), k(0), keys({key}) {}
miniscript.cpp:_ZN12_GLOBAL__N_18NodeInfoC2EN10miniscript8FragmentEj:
  333|  3.05k|    NodeInfo(Fragment frag, uint32_t _k): fragment(frag), k(_k) {}
miniscript.cpp:_ZN12_GLOBAL__N_18NodeInfoC2EN10miniscript8FragmentENSt3__16vectorIhNS3_9allocatorIhEEEE:
  334|  6.23k|    NodeInfo(Fragment frag, std::vector<unsigned char> h): fragment(frag), k(0), hash(std::move(h)) {}
miniscript.cpp:_ZN12_GLOBAL__N_18NodeInfoC2EN10miniscript8FragmentEjNSt3__16vectorI7CPubKeyNS3_9allocatorIS5_EEEE:
  337|  6.05k|    NodeInfo(Fragment frag, uint32_t _k, std::vector<CPubKey> _keys): fragment(frag), k(_k), keys(std::move(_keys)) {}
miniscript.cpp:_ZN12_GLOBAL__N_18NodeInfoC2ENSt3__16vectorIN10miniscript4TypeENS1_9allocatorIS4_EEEENS3_8FragmentE:
  335|   171k|    NodeInfo(std::vector<Type> subt, Fragment frag): fragment(frag), k(0), subtypes(std::move(subt)) {}
miniscript.cpp:_ZN12_GLOBAL__N_18NodeInfoC2ENSt3__16vectorIN10miniscript4TypeENS1_9allocatorIS4_EEEENS3_8FragmentEj:
  336|  7.54k|    NodeInfo(std::vector<Type> subt, Fragment frag, uint32_t _k): fragment(frag), k(_k), subtypes(std::move(subt))  {}
miniscript.cpp:_ZNK12_GLOBAL__N_113KeyComparator10KeyCompareERK7CPubKeyS3_:
  310|   226k|    bool KeyCompare(const CPubKey& a, const CPubKey& b) const {
  311|   226k|        return a < b;
  312|   226k|    }
miniscript.cpp:_ZN12_GLOBAL__N_17GenNodeIZ28miniscript_smart_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEE3$_0EENS1_8optionalIN10miniscript4NodeI7CPubKeyEEEENS7_17MiniscriptContextET_NS7_4TypeEb:
  855|  5.04k|{
  856|       |    /** A stack of miniscript Nodes being built up. */
  857|  5.04k|    std::vector<Node> stack;
  858|       |    /** The queue of instructions. */
  859|  5.04k|    std::vector<std::pair<Type, std::optional<NodeInfo>>> todo{{root_type, {}}};
  860|       |    /** Predict the number of (static) script ops. */
  861|  5.04k|    uint32_t ops{0};
  862|       |    /** Predict the total script size (every unexplored subnode is counted as one, as every leaf is
  863|       |     *  at least one script byte). */
  864|  5.04k|    uint32_t scriptsize{1};
  865|       |
  866|   398k|    while (!todo.empty()) {
  ------------------
  |  Branch (866:12): [True: 394k, False: 4.76k]
  ------------------
  867|       |        // The expected type we have to construct.
  868|   394k|        auto type_needed = todo.back().first;
  869|   394k|        if (!todo.back().second) {
  ------------------
  |  Branch (869:13): [True: 205k, False: 188k]
  ------------------
  870|       |            // Fragment/children have not been decided yet. Decide them.
  871|   205k|            auto node_info = ConsumeNode(type_needed);
  872|   205k|            if (!node_info) return {};
  ------------------
  |  Branch (872:17): [True: 0, False: 205k]
  ------------------
  873|       |            // Update predicted resource limits. Since every leaf Miniscript node is at least one
  874|       |            // byte long, we move one byte from each child to their parent. A similar technique is
  875|       |            // used in the miniscript::internal::Parse function to prevent runaway string parsing.
  876|   205k|            scriptsize += miniscript::internal::ComputeScriptLen(node_info->fragment, ""_mst, node_info->subtypes.size(), node_info->k, node_info->subtypes.size(),
  877|   205k|                                                                 node_info->keys.size(), script_ctx) - 1;
  878|   205k|            if (scriptsize > MAX_STANDARD_P2WSH_SCRIPT_SIZE) return {};
  ------------------
  |  Branch (878:17): [True: 70, False: 205k]
  ------------------
  879|   205k|            switch (node_info->fragment) {
  ------------------
  |  Branch (879:21): [True: 205k, False: 0]
  ------------------
  880|  49.8k|            case Fragment::JUST_0:
  ------------------
  |  Branch (880:13): [True: 49.8k, False: 155k]
  ------------------
  881|  54.2k|            case Fragment::JUST_1:
  ------------------
  |  Branch (881:13): [True: 4.37k, False: 200k]
  ------------------
  882|  54.2k|                break;
  883|  8.86k|            case Fragment::PK_K:
  ------------------
  |  Branch (883:13): [True: 8.86k, False: 196k]
  ------------------
  884|  8.86k|                break;
  885|  2.12k|            case Fragment::PK_H:
  ------------------
  |  Branch (885:13): [True: 2.12k, False: 203k]
  ------------------
  886|  2.12k|                ops += 3;
  887|  2.12k|                break;
  888|  1.69k|            case Fragment::OLDER:
  ------------------
  |  Branch (888:13): [True: 1.69k, False: 203k]
  ------------------
  889|  3.05k|            case Fragment::AFTER:
  ------------------
  |  Branch (889:13): [True: 1.36k, False: 203k]
  ------------------
  890|  3.05k|                ops += 1;
  891|  3.05k|                break;
  892|  1.22k|            case Fragment::RIPEMD160:
  ------------------
  |  Branch (892:13): [True: 1.22k, False: 204k]
  ------------------
  893|  3.25k|            case Fragment::SHA256:
  ------------------
  |  Branch (893:13): [True: 2.03k, False: 203k]
  ------------------
  894|  4.55k|            case Fragment::HASH160:
  ------------------
  |  Branch (894:13): [True: 1.29k, False: 203k]
  ------------------
  895|  6.23k|            case Fragment::HASH256:
  ------------------
  |  Branch (895:13): [True: 1.68k, False: 203k]
  ------------------
  896|  6.23k|                ops += 4;
  897|  6.23k|                break;
  898|  7.97k|            case Fragment::ANDOR:
  ------------------
  |  Branch (898:13): [True: 7.97k, False: 197k]
  ------------------
  899|  7.97k|                ops += 3;
  900|  7.97k|                break;
  901|  24.5k|            case Fragment::AND_V:
  ------------------
  |  Branch (901:13): [True: 24.5k, False: 180k]
  ------------------
  902|  24.5k|                break;
  903|  3.19k|            case Fragment::AND_B:
  ------------------
  |  Branch (903:13): [True: 3.19k, False: 202k]
  ------------------
  904|  6.18k|            case Fragment::OR_B:
  ------------------
  |  Branch (904:13): [True: 2.99k, False: 202k]
  ------------------
  905|  6.18k|                ops += 1;
  906|  6.18k|                break;
  907|  2.98k|            case Fragment::OR_C:
  ------------------
  |  Branch (907:13): [True: 2.98k, False: 202k]
  ------------------
  908|  2.98k|                ops += 2;
  909|  2.98k|                break;
  910|  4.50k|            case Fragment::OR_D:
  ------------------
  |  Branch (910:13): [True: 4.50k, False: 200k]
  ------------------
  911|  4.50k|                ops += 3;
  912|  4.50k|                break;
  913|  10.1k|            case Fragment::OR_I:
  ------------------
  |  Branch (913:13): [True: 10.1k, False: 195k]
  ------------------
  914|  10.1k|                ops += 3;
  915|  10.1k|                break;
  916|  7.54k|            case Fragment::THRESH:
  ------------------
  |  Branch (916:13): [True: 7.54k, False: 197k]
  ------------------
  917|  7.54k|                ops += node_info->subtypes.size();
  918|  7.54k|                break;
  919|  4.87k|            case Fragment::MULTI:
  ------------------
  |  Branch (919:13): [True: 4.87k, False: 200k]
  ------------------
  920|  4.87k|                ops += 1;
  921|  4.87k|                break;
  922|  1.12k|            case Fragment::MULTI_A:
  ------------------
  |  Branch (922:13): [True: 1.12k, False: 204k]
  ------------------
  923|  1.12k|                ops += node_info->keys.size() + 1;
  924|  1.12k|                break;
  925|  28.0k|            case Fragment::WRAP_A:
  ------------------
  |  Branch (925:13): [True: 28.0k, False: 177k]
  ------------------
  926|  28.0k|                ops += 2;
  927|  28.0k|                break;
  928|  1.40k|            case Fragment::WRAP_S:
  ------------------
  |  Branch (928:13): [True: 1.40k, False: 203k]
  ------------------
  929|  1.40k|                ops += 1;
  930|  1.40k|                break;
  931|  5.36k|            case Fragment::WRAP_C:
  ------------------
  |  Branch (931:13): [True: 5.36k, False: 199k]
  ------------------
  932|  5.36k|                ops += 1;
  933|  5.36k|                break;
  934|    652|            case Fragment::WRAP_D:
  ------------------
  |  Branch (934:13): [True: 652, False: 204k]
  ------------------
  935|    652|                ops += 3;
  936|    652|                break;
  937|  19.9k|            case Fragment::WRAP_V:
  ------------------
  |  Branch (937:13): [True: 19.9k, False: 185k]
  ------------------
  938|       |                // We don't account for OP_VERIFY here; that will be corrected for when the actual
  939|       |                // node is constructed below.
  940|  19.9k|                break;
  941|  1.80k|            case Fragment::WRAP_J:
  ------------------
  |  Branch (941:13): [True: 1.80k, False: 203k]
  ------------------
  942|  1.80k|                ops += 4;
  943|  1.80k|                break;
  944|  3.68k|            case Fragment::WRAP_N:
  ------------------
  |  Branch (944:13): [True: 3.68k, False: 201k]
  ------------------
  945|  3.68k|                ops += 1;
  946|  3.68k|                break;
  947|   205k|            }
  948|   205k|            if (ops > MAX_OPS_PER_SCRIPT) return {};
  ------------------
  |  Branch (948:17): [True: 207, False: 205k]
  ------------------
  949|   205k|            auto subtypes = node_info->subtypes;
  950|   205k|            todo.back().second = std::move(node_info);
  951|   205k|            todo.reserve(todo.size() + subtypes.size());
  952|       |            // As elements on the todo stack are processed back to front, construct
  953|       |            // them in reverse order (so that the first subnode is generated first).
  954|   426k|            for (size_t i = 0; i < subtypes.size(); ++i) {
  ------------------
  |  Branch (954:32): [True: 221k, False: 205k]
  ------------------
  955|   221k|                todo.emplace_back(*(subtypes.rbegin() + i), std::nullopt);
  956|   221k|            }
  957|   205k|        } else {
  958|       |            // The back of todo has fragment and number of children decided, and
  959|       |            // those children have been constructed at the back of stack. Pop
  960|       |            // that entry off todo, and use it to construct a new Node on
  961|       |            // stack.
  962|   188k|            NodeInfo& info = *todo.back().second;
  963|       |            // Gather children from the back of stack.
  964|   188k|            std::vector<Node> sub;
  965|   188k|            sub.reserve(info.subtypes.size());
  966|   365k|            for (size_t i = 0; i < info.subtypes.size(); ++i) {
  ------------------
  |  Branch (966:32): [True: 176k, False: 188k]
  ------------------
  967|   176k|                sub.push_back(std::move(*(stack.end() - info.subtypes.size() + i)));
  968|   176k|            }
  969|   188k|            stack.erase(stack.end() - info.subtypes.size(), stack.end());
  970|       |            // Construct new Node.
  971|   188k|            Node node{[&] {
  972|   188k|                if (info.keys.empty()) {
  973|   188k|                    return Node{miniscript::internal::NoDupCheck{}, script_ctx, info.fragment, std::move(sub), std::move(info.hash), info.k};
  974|   188k|                }
  975|   188k|                assert(sub.empty());
  976|   188k|                assert(info.hash.empty());
  977|   188k|                return Node{miniscript::internal::NoDupCheck{}, script_ctx, info.fragment, std::move(info.keys), info.k};
  978|   188k|            }()};
  979|       |            // Verify acceptability.
  980|   188k|            if ((node.GetType() & "KVWB"_mst) == ""_mst) {
  ------------------
  |  Branch (980:17): [True: 0, False: 188k]
  ------------------
  981|      0|                assert(!strict_valid);
  ------------------
  |  Branch (981:17): [True: 0, False: 0]
  ------------------
  982|      0|                return {};
  983|      0|            }
  984|   188k|            if (!(type_needed == ""_mst)) {
  ------------------
  |  Branch (984:17): [True: 188k, False: 0]
  ------------------
  985|   188k|                assert(node.GetType() << type_needed);
  ------------------
  |  Branch (985:17): [True: 188k, False: 0]
  ------------------
  986|   188k|            }
  987|   188k|            if (!node.IsValid()) return {};
  ------------------
  |  Branch (987:17): [True: 1, False: 188k]
  ------------------
  988|       |            // Update resource predictions.
  989|   188k|            if (node.Fragment() == Fragment::WRAP_V && node.Subs()[0].GetType() << "x"_mst) {
  ------------------
  |  Branch (989:17): [True: 17.2k, False: 171k]
  |  Branch (989:17): [True: 11.1k, False: 177k]
  |  Branch (989:56): [True: 11.1k, False: 6.02k]
  ------------------
  990|  11.1k|                ops += 1;
  991|  11.1k|                scriptsize += 1;
  992|  11.1k|            }
  993|   188k|            if (!miniscript::IsTapscript(script_ctx) && ops > MAX_OPS_PER_SCRIPT) return {};
  ------------------
  |  Branch (993:17): [True: 113k, False: 75.6k]
  |  Branch (993:57): [True: 8, False: 113k]
  ------------------
  994|   188k|            if (scriptsize > miniscript::internal::MaxScriptSize(script_ctx)) {
  ------------------
  |  Branch (994:17): [True: 2, False: 188k]
  ------------------
  995|      2|                return {};
  996|      2|            }
  997|       |            // Move it to the stack.
  998|   188k|            stack.push_back(std::move(node));
  999|   188k|            todo.pop_back();
 1000|   188k|        }
 1001|   394k|    }
 1002|  5.04k|    assert(stack.size() == 1);
  ------------------
  |  Branch (1002:5): [True: 4.76k, False: 0]
  ------------------
 1003|  4.76k|    assert(stack[0].GetStaticOps() == ops);
  ------------------
  |  Branch (1003:5): [True: 4.76k, False: 0]
  ------------------
 1004|  4.76k|    assert(stack[0].ScriptSize() == scriptsize);
  ------------------
  |  Branch (1004:5): [True: 4.76k, False: 0]
  ------------------
 1005|  4.76k|    stack[0].DuplicateKeyCheck(KEY_COMP);
 1006|  4.76k|    return std::move(stack[0]);
 1007|  4.76k|}
miniscript.cpp:_ZZ28miniscript_smart_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK3$_0clEN10miniscript4TypeE:
 1229|   205k|    TestNode(script_ctx, GenNode(script_ctx, [&](Type needed_type) {
 1230|   205k|        return ConsumeNodeSmart(script_ctx, provider, needed_type);
 1231|   205k|    }, PickValue(provider, BASE_TYPES), true), provider);
miniscript.cpp:_ZN12_GLOBAL__N_116ConsumeNodeSmartEN10miniscript17MiniscriptContextER18FuzzedDataProviderNS0_4TypeE:
  771|   205k|std::optional<NodeInfo> ConsumeNodeSmart(MsCtx script_ctx, FuzzedDataProvider& provider, Type type_needed) {
  772|       |    /** Table entry for the requested type. */
  773|   205k|    const auto& table{IsTapscript(script_ctx) ? SMARTINFO.tap_table : SMARTINFO.wsh_table};
  ------------------
  |  Branch (773:23): [True: 83.5k, False: 121k]
  ------------------
  774|   205k|    auto recipes_it = table.find(type_needed);
  775|   205k|    assert(recipes_it != table.end());
  ------------------
  |  Branch (775:5): [True: 205k, False: 0]
  ------------------
  776|       |    /** Pick one recipe from the available ones for that type. */
  777|   205k|    const auto& [frag, subt] = PickValue(provider, recipes_it->second);
  778|       |
  779|       |    // Based on the fragment the recipe uses, fill in other data (k, keys, data).
  780|   205k|    switch (frag) {
  ------------------
  |  Branch (780:13): [True: 205k, False: 0]
  ------------------
  781|  8.87k|        case Fragment::PK_K:
  ------------------
  |  Branch (781:9): [True: 8.87k, False: 196k]
  ------------------
  782|  10.9k|        case Fragment::PK_H:
  ------------------
  |  Branch (782:9): [True: 2.12k, False: 203k]
  ------------------
  783|  10.9k|            return {{frag, ConsumePubKey(provider)}};
  784|  4.87k|        case Fragment::MULTI: {
  ------------------
  |  Branch (784:9): [True: 4.87k, False: 200k]
  ------------------
  785|  4.87k|            const auto n_keys = provider.ConsumeIntegralInRange<uint8_t>(1, 20);
  786|  4.87k|            const auto k = provider.ConsumeIntegralInRange<uint8_t>(1, n_keys);
  787|  4.87k|            std::vector<CPubKey> keys{n_keys};
  788|  27.7k|            for (auto& key: keys) key = ConsumePubKey(provider);
  ------------------
  |  Branch (788:27): [True: 27.7k, False: 4.87k]
  ------------------
  789|  4.87k|            return {{frag, k, std::move(keys)}};
  790|  8.87k|        }
  791|  1.18k|        case Fragment::MULTI_A: {
  ------------------
  |  Branch (791:9): [True: 1.18k, False: 204k]
  ------------------
  792|  1.18k|            const auto n_keys = provider.ConsumeIntegralInRange<uint16_t>(1, 999);
  793|  1.18k|            const auto k = provider.ConsumeIntegralInRange<uint16_t>(1, n_keys);
  794|  1.18k|            std::vector<CPubKey> keys{n_keys};
  795|  53.3k|            for (auto& key: keys) key = ConsumePubKey(provider);
  ------------------
  |  Branch (795:27): [True: 53.3k, False: 1.18k]
  ------------------
  796|  1.18k|            return {{frag, k, std::move(keys)}};
  797|  8.87k|        }
  798|  1.69k|        case Fragment::OLDER:
  ------------------
  |  Branch (798:9): [True: 1.69k, False: 203k]
  ------------------
  799|  3.05k|        case Fragment::AFTER:
  ------------------
  |  Branch (799:9): [True: 1.36k, False: 203k]
  ------------------
  800|  3.05k|            return {{frag, provider.ConsumeIntegralInRange<uint32_t>(1, 0x7FFFFFF)}};
  801|  2.03k|        case Fragment::SHA256:
  ------------------
  |  Branch (801:9): [True: 2.03k, False: 203k]
  ------------------
  802|  2.03k|            return {{frag, PickValue(provider, TEST_DATA.sha256)}};
  803|  1.68k|        case Fragment::HASH256:
  ------------------
  |  Branch (803:9): [True: 1.68k, False: 203k]
  ------------------
  804|  1.68k|            return {{frag, PickValue(provider, TEST_DATA.hash256)}};
  805|  1.22k|        case Fragment::RIPEMD160:
  ------------------
  |  Branch (805:9): [True: 1.22k, False: 204k]
  ------------------
  806|  1.22k|            return {{frag, PickValue(provider, TEST_DATA.ripemd160)}};
  807|  1.29k|        case Fragment::HASH160:
  ------------------
  |  Branch (807:9): [True: 1.29k, False: 204k]
  ------------------
  808|  1.29k|            return {{frag, PickValue(provider, TEST_DATA.hash160)}};
  809|  49.8k|        case Fragment::JUST_0:
  ------------------
  |  Branch (809:9): [True: 49.8k, False: 155k]
  ------------------
  810|  54.2k|        case Fragment::JUST_1:
  ------------------
  |  Branch (810:9): [True: 4.37k, False: 200k]
  ------------------
  811|  82.2k|        case Fragment::WRAP_A:
  ------------------
  |  Branch (811:9): [True: 28.0k, False: 177k]
  ------------------
  812|  83.6k|        case Fragment::WRAP_S:
  ------------------
  |  Branch (812:9): [True: 1.40k, False: 203k]
  ------------------
  813|  89.0k|        case Fragment::WRAP_C:
  ------------------
  |  Branch (813:9): [True: 5.36k, False: 199k]
  ------------------
  814|  89.6k|        case Fragment::WRAP_D:
  ------------------
  |  Branch (814:9): [True: 652, False: 204k]
  ------------------
  815|   109k|        case Fragment::WRAP_V:
  ------------------
  |  Branch (815:9): [True: 19.9k, False: 185k]
  ------------------
  816|   111k|        case Fragment::WRAP_J:
  ------------------
  |  Branch (816:9): [True: 1.80k, False: 203k]
  ------------------
  817|   115k|        case Fragment::WRAP_N:
  ------------------
  |  Branch (817:9): [True: 3.68k, False: 201k]
  ------------------
  818|   139k|        case Fragment::AND_V:
  ------------------
  |  Branch (818:9): [True: 24.5k, False: 180k]
  ------------------
  819|   142k|        case Fragment::AND_B:
  ------------------
  |  Branch (819:9): [True: 3.19k, False: 202k]
  ------------------
  820|   145k|        case Fragment::OR_B:
  ------------------
  |  Branch (820:9): [True: 2.99k, False: 202k]
  ------------------
  821|   148k|        case Fragment::OR_C:
  ------------------
  |  Branch (821:9): [True: 2.98k, False: 202k]
  ------------------
  822|   153k|        case Fragment::OR_D:
  ------------------
  |  Branch (822:9): [True: 4.50k, False: 200k]
  ------------------
  823|   163k|        case Fragment::OR_I:
  ------------------
  |  Branch (823:9): [True: 10.1k, False: 195k]
  ------------------
  824|   171k|        case Fragment::ANDOR:
  ------------------
  |  Branch (824:9): [True: 7.97k, False: 197k]
  ------------------
  825|   171k|            return {{subt, frag}};
  826|  7.54k|        case Fragment::THRESH: {
  ------------------
  |  Branch (826:9): [True: 7.54k, False: 197k]
  ------------------
  827|  7.54k|            uint32_t children;
  828|  7.54k|            if (subt.size() < 2) {
  ------------------
  |  Branch (828:17): [True: 6.27k, False: 1.27k]
  ------------------
  829|  6.27k|                children = subt.size();
  830|  6.27k|            } else {
  831|       |                // If we hit a thresh with 2 subnodes, artificially extend it to any number
  832|       |                // (2 or larger) by replicating the type of the last subnode.
  833|  1.27k|                children = provider.ConsumeIntegralInRange<uint32_t>(2, MAX_OPS_PER_SCRIPT / 2);
  834|  1.27k|            }
  835|  7.54k|            auto k = provider.ConsumeIntegralInRange<uint32_t>(1, children);
  836|  7.54k|            std::vector<Type> subs = subt;
  837|  39.2k|            while (subs.size() < children) subs.push_back(subs.back());
  ------------------
  |  Branch (837:20): [True: 31.6k, False: 7.54k]
  ------------------
  838|  7.54k|            return {{std::move(subs), frag, k}};
  839|   163k|        }
  840|   205k|    }
  841|       |
  842|   205k|    assert(false);
  ------------------
  |  Branch (842:5): [Folded, False: 0]
  ------------------
  843|      0|}
miniscript.cpp:_ZZN12_GLOBAL__N_17GenNodeIZ28miniscript_smart_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEE3$_0EENS1_8optionalIN10miniscript4NodeI7CPubKeyEEEENS7_17MiniscriptContextET_NS7_4TypeEbENKUlvE_clEv:
  971|   188k|            Node node{[&] {
  972|   188k|                if (info.keys.empty()) {
  ------------------
  |  Branch (972:21): [True: 171k, False: 16.9k]
  ------------------
  973|   171k|                    return Node{miniscript::internal::NoDupCheck{}, script_ctx, info.fragment, std::move(sub), std::move(info.hash), info.k};
  974|   171k|                }
  975|   188k|                assert(sub.empty());
  ------------------
  |  Branch (975:17): [True: 16.9k, False: 0]
  ------------------
  976|  16.9k|                assert(info.hash.empty());
  ------------------
  |  Branch (976:17): [True: 16.9k, False: 0]
  ------------------
  977|  16.9k|                return Node{miniscript::internal::NoDupCheck{}, script_ctx, info.fragment, std::move(info.keys), info.k};
  978|  16.9k|            }()};

_Z9PickValueIKNSt3__15arrayIN10miniscript4TypeELm4EEEERDaR18FuzzedDataProviderRT_:
   58|  5.04k|{
   59|  5.04k|    return *PickIterator(fuzzed_data_provider, col);
   60|  5.04k|}
_Z12PickIteratorIKNSt3__15arrayIN10miniscript4TypeELm4EEEEDaR18FuzzedDataProviderRT_:
   50|  5.04k|{
   51|  5.04k|    const auto sz{col.size()};
   52|  5.04k|    assert(sz >= 1);
  ------------------
  |  Branch (52:5): [True: 5.04k, False: 0]
  ------------------
   53|  5.04k|    return std::next(col.begin(), fuzzed_data_provider.ConsumeIntegralInRange<decltype(sz)>(0, sz - 1));
   54|  5.04k|}
_Z9PickValueIKNSt3__16vectorINS0_4pairIN10miniscript8FragmentENS1_INS3_4TypeENS0_9allocatorIS5_EEEEEENS6_IS9_EEEEERDaR18FuzzedDataProviderRT_:
   58|   205k|{
   59|   205k|    return *PickIterator(fuzzed_data_provider, col);
   60|   205k|}
_Z12PickIteratorIKNSt3__16vectorINS0_4pairIN10miniscript8FragmentENS1_INS3_4TypeENS0_9allocatorIS5_EEEEEENS6_IS9_EEEEEDaR18FuzzedDataProviderRT_:
   50|   205k|{
   51|   205k|    const auto sz{col.size()};
   52|   205k|    assert(sz >= 1);
  ------------------
  |  Branch (52:5): [True: 205k, False: 0]
  ------------------
   53|   205k|    return std::next(col.begin(), fuzzed_data_provider.ConsumeIntegralInRange<decltype(sz)>(0, sz - 1));
   54|   205k|}
_Z9PickValueINSt3__16vectorINS1_IhNS0_9allocatorIhEEEENS2_IS4_EEEEERDaR18FuzzedDataProviderRT_:
   58|  6.23k|{
   59|  6.23k|    return *PickIterator(fuzzed_data_provider, col);
   60|  6.23k|}
_Z12PickIteratorINSt3__16vectorINS1_IhNS0_9allocatorIhEEEENS2_IS4_EEEEEDaR18FuzzedDataProviderRT_:
   50|  6.23k|{
   51|  6.23k|    const auto sz{col.size()};
   52|  6.23k|    assert(sz >= 1);
  ------------------
  |  Branch (52:5): [True: 6.23k, False: 0]
  ------------------
   53|  6.23k|    return std::next(col.begin(), fuzzed_data_provider.ConsumeIntegralInRange<decltype(sz)>(0, sz - 1));
   54|  6.23k|}

_ZN12CheckGlobalsC2Ev:
   59|  5.04k|CheckGlobals::CheckGlobals() : m_impl(std::make_unique<CheckGlobalsImpl>()) {}
_ZN12CheckGlobalsD2Ev:
   60|  5.05k|CheckGlobals::~CheckGlobals() = default;
_ZN16CheckGlobalsImplC2Ev:
   17|  5.04k|    {
   18|  5.04k|        g_used_g_prng = false;
   19|  5.04k|        g_seeded_g_prng_zero = false;
   20|  5.04k|        g_used_system_time = false;
   21|  5.04k|        SetMockTime(0s);
   22|  5.04k|        MockableSteadyClock::ClearMockTime();
   23|  5.04k|    }
_ZN16CheckGlobalsImplD2Ev:
   25|  5.05k|    {
   26|  5.05k|        if (g_used_g_prng && !g_seeded_g_prng_zero) {
  ------------------
  |  Branch (26:13): [True: 2, False: 5.04k]
  |  Branch (26:30): [True: 0, False: 2]
  ------------------
   27|      0|            std::cerr << "\n\n"
   28|      0|                         "The current fuzz target used the global random state.\n\n"
   29|       |
   30|      0|                         "This is acceptable, but requires the fuzz target to call \n"
   31|      0|                         "SeedRandomStateForTest(SeedRand::ZEROS) in the first line \n"
   32|      0|                         "of the FUZZ_TARGET function.\n\n"
   33|       |
   34|      0|                         "An alternative solution would be to avoid any use of globals.\n\n"
   35|       |
   36|      0|                         "Without a solution, fuzz instability and non-determinism can lead \n"
   37|      0|                         "to non-reproducible bugs or inefficient fuzzing.\n\n"
   38|      0|                      << std::endl;
   39|      0|            std::abort(); // Abort, because AFL may try to recover from a std::exit
   40|      0|        }
   41|       |
   42|  5.05k|        if (g_used_system_time) {
  ------------------
  |  Branch (42:13): [True: 0, False: 5.05k]
  ------------------
   43|      0|            std::cerr << "\n\n"
   44|      0|                         "The current fuzz target accessed system time.\n\n"
   45|       |
   46|      0|                         "This is acceptable, but requires the fuzz target to use \n"
   47|      0|                         "a FakeNodeClock, FakeSteadyClock or call \n"
   48|      0|                         "SetMockTime() at the \n" "beginning of processing the \n"
   49|      0|                         "fuzz input.\n\n"
   50|       |
   51|      0|                         "Without setting mock time, time-dependent behavior can lead \n"
   52|      0|                         "to non-reproducible bugs or inefficient fuzzing.\n\n"
   53|      0|                      << std::endl;
   54|      0|            std::abort();
   55|      0|        }
   56|  5.05k|    }

__gcov_reset:
   13|      2|extern "C" __attribute__((weak)) void __gcov_reset(void) {}

_ZNK9base_blobILj160EE3endEv:
  105|  3.80k|    constexpr const unsigned char* end() const { return m_data.data() + WIDTH; }
_ZN9base_blobILj160EE5beginEv:
  101|  1.76k|    constexpr unsigned char* begin() { return m_data.data(); }
_ZNK9base_blobILj160EEssERKS0_:
   68|  32.8k|    constexpr std::strong_ordering operator<=>(const base_blob& other) const = default;
_ZNK9base_blobILj256EEssERKS0_:
   68|  1.29M|    constexpr std::strong_ordering operator<=>(const base_blob& other) const = default;
_ZNK9base_blobILj256EE5beginEv:
  104|  86.6k|    constexpr const unsigned char* begin() const { return m_data.data(); }
_ZNK9base_blobILj256EE3endEv:
  105|  80.4k|    constexpr const unsigned char* end() const { return m_data.data() + WIDTH; }
_ZNK9base_blobILj160EE5beginEv:
  104|  3.80k|    constexpr const unsigned char* begin() const { return m_data.data(); }
_ZN7uint256C2ENSt3__14spanIKhLm18446744073709551615EEE:
  203|   136k|    constexpr explicit uint256(std::span<const unsigned char> vch) : base_blob<256>(vch) {}
_ZN9base_blobILj256EEC2ENSt3__14spanIKhLm18446744073709551615EEE:
   43|   136k|    {
   44|   136k|        assert(vch.size() == WIDTH);
  ------------------
  |  Branch (44:9): [True: 136k, False: 0]
  ------------------
   45|   136k|        std::copy(vch.begin(), vch.end(), m_data.begin());
   46|   136k|    }
_ZN9base_blobILj256EE4dataEv:
   99|  4.18k|    constexpr unsigned char* data() { return m_data.data(); }
_ZNK9base_blobILj256EE9SerializeI10HashWriterEEvRT_:
  113|  6.49k|    {
  114|  6.49k|        s << std::span(m_data);
  115|  6.49k|    }
_ZN7uint160C2Ev:
  187|  5.57k|    constexpr uint160() = default;
_ZN9base_blobILj160EEC2Ev:
   37|  5.57k|    constexpr base_blob() : m_data() {}
_ZN9base_blobILj160EE4dataEv:
   99|  3.80k|    constexpr unsigned char* data() { return m_data.data(); }
_ZN9base_blobILj160EE4sizeEv:
  107|  3.80k|    static constexpr unsigned int size() { return WIDTH; }
_ZN7uint256C2Ev:
  200|  67.3k|    constexpr uint256() = default;
_ZN9base_blobILj256EEC2Ev:
   37|  67.3k|    constexpr base_blob() : m_data() {}
_ZN9base_blobILj256EE5beginEv:
  101|  39.5k|    constexpr unsigned char* begin() { return m_data.data(); }
_ZNK9base_blobILj256EE4dataEv:
   98|  1.29k|    constexpr const unsigned char* data() const { return m_data.data(); }
_ZN9base_blobILj256EE4sizeEv:
  107|  5.16k|    static constexpr unsigned int size() { return WIDTH; }

_ZN10btcsignals6signalIFvvENS_10null_valueEED2Ev:
  175|      6|    ~signal() = default;
_ZN10btcsignals6signalIFv20SynchronizationStatellbENS_10null_valueEED2Ev:
  175|      2|    ~signal() = default;
_ZN10btcsignals6signalIFv20SynchronizationStateRK11CBlockIndexdENS_10null_valueEED2Ev:
  175|      2|    ~signal() = default;
_ZN10btcsignals6signalIFvRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEibENS_10null_valueEED2Ev:
  175|      2|    ~signal() = default;
_ZN10btcsignals6signalIFvbENS_10null_valueEED2Ev:
  175|      2|    ~signal() = default;
_ZN10btcsignals6signalIFviENS_10null_valueEED2Ev:
  175|      2|    ~signal() = default;
_ZN10btcsignals6signalIFvRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENS_10null_valueEED2Ev:
  175|      2|    ~signal() = default;
_ZN10btcsignals6signalIFbRK13bilingual_strRKNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEjENS_6any_ofEED2Ev:
  175|      2|    ~signal() = default;
_ZN10btcsignals6signalIFvRK13bilingual_strjENS_10null_valueEED2Ev:
  175|      2|    ~signal() = default;

_Z22inline_assertion_checkILb1ERPKNSt3__18functionIFvNS0_4spanIKhLm18446744073709551615EEEEEEEOT0_SB_RKNS0_15source_locationENS0_17basic_string_viewIcNS0_11char_traitsIcEEEE:
   90|  5.04k|{
   91|  5.04k|    if (IS_ASSERT || std::is_constant_evaluated() || G_ABORT_ON_FAILED_ASSUME) {
  ------------------
  |  Branch (91:9): [True: 5.04k, Folded]
  |  Branch (91:22): [Folded, False: 0]
  |  Branch (91:54): [True: 0, Folded]
  ------------------
   92|  5.04k|        if (!val) {
  ------------------
  |  Branch (92:13): [True: 0, False: 5.04k]
  ------------------
   93|      0|            assertion_fail(loc, assertion);
   94|      0|        }
   95|  5.04k|    }
   96|  5.04k|    return std::forward<T>(val);
   97|  5.04k|}
_Z22inline_check_non_fatalIRKbEOT_S3_RKNSt3__115source_locationENS4_17basic_string_viewIcNS4_11char_traitsIcEEEE:
   73|  3.07k|{
   74|  3.07k|    if (!val) {
  ------------------
  |  Branch (74:9): [True: 0, False: 3.07k]
  ------------------
   75|      0|        if constexpr (G_ABORT_ON_FAILED_ASSUME) {
   76|      0|            assertion_fail(loc, assertion);
   77|      0|        }
   78|      0|        throw NonFatalCheckError{assertion, loc};
   79|      0|    }
   80|  3.07k|    return std::forward<T>(val);
   81|  3.07k|}
_Z22inline_check_non_fatalIRbEOT_S2_RKNSt3__115source_locationENS3_17basic_string_viewIcNS3_11char_traitsIcEEEE:
   73|  36.8k|{
   74|  36.8k|    if (!val) {
  ------------------
  |  Branch (74:9): [True: 0, False: 36.8k]
  ------------------
   75|      0|        if constexpr (G_ABORT_ON_FAILED_ASSUME) {
   76|      0|            assertion_fail(loc, assertion);
   77|      0|        }
   78|      0|        throw NonFatalCheckError{assertion, loc};
   79|      0|    }
   80|  36.8k|    return std::forward<T>(val);
   81|  36.8k|}
_Z22inline_check_non_fatalIbEOT_S1_RKNSt3__115source_locationENS2_17basic_string_viewIcNS2_11char_traitsIcEEEE:
   73|  10.4M|{
   74|  10.4M|    if (!val) {
  ------------------
  |  Branch (74:9): [True: 0, False: 10.4M]
  ------------------
   75|      0|        if constexpr (G_ABORT_ON_FAILED_ASSUME) {
   76|      0|            assertion_fail(loc, assertion);
   77|      0|        }
   78|      0|        throw NonFatalCheckError{assertion, loc};
   79|      0|    }
   80|  10.4M|    return std::forward<T>(val);
   81|  10.4M|}
_Z22inline_assertion_checkILb1EbEOT0_S1_RKNSt3__115source_locationENS2_17basic_string_viewIcNS2_11char_traitsIcEEEE:
   90|  5.04k|{
   91|  5.04k|    if (IS_ASSERT || std::is_constant_evaluated() || G_ABORT_ON_FAILED_ASSUME) {
  ------------------
  |  Branch (91:9): [True: 5.04k, Folded]
  |  Branch (91:22): [Folded, False: 0]
  |  Branch (91:54): [True: 0, Folded]
  ------------------
   92|  5.04k|        if (!val) {
  ------------------
  |  Branch (92:13): [True: 0, False: 5.04k]
  ------------------
   93|      0|            assertion_fail(loc, assertion);
   94|      0|        }
   95|  5.04k|    }
   96|  5.04k|    return std::forward<T>(val);
   97|  5.04k|}
_Z22inline_assertion_checkILb0EbEOT0_S1_RKNSt3__115source_locationENS2_17basic_string_viewIcNS2_11char_traitsIcEEEE:
   90|     10|{
   91|     10|    if (IS_ASSERT || std::is_constant_evaluated() || G_ABORT_ON_FAILED_ASSUME) {
  ------------------
  |  Branch (91:9): [Folded, False: 0]
  |  Branch (91:22): [Folded, False: 0]
  |  Branch (91:54): [True: 0, Folded]
  ------------------
   92|     10|        if (!val) {
  ------------------
  |  Branch (92:13): [True: 0, False: 10]
  ------------------
   93|      0|            assertion_fail(loc, assertion);
   94|      0|        }
   95|     10|    }
   96|     10|    return std::forward<T>(val);
   97|     10|}

_ZN8BaseHashI7uint256E4dataEv:
   63|  2.23k|    unsigned char* data() { return m_hash.data(); }
_ZN8BaseHashI7uint256E5beginEv:
   19|  2.23k|    {
   20|  2.23k|        return m_hash.begin();
   21|  2.23k|    }
_ZN8BaseHashI7uint256EC2Ev:
   15|  2.23k|    BaseHash() : m_hash() {}
_ZNK8BaseHashI7uint256E4sizeEv:
   59|  2.23k|    {
   60|  2.23k|        return m_hash.size();
   61|  2.23k|    }

_Z5IsHexNSt3__117basic_string_viewIcNS_11char_traitsIcEEEE:
   41|  5.84k|{
   42|   318k|    for (char c : str) {
  ------------------
  |  Branch (42:17): [True: 318k, False: 5.84k]
  ------------------
   43|   318k|        if (HexDigit(c) < 0) return false;
  ------------------
  |  Branch (43:13): [True: 0, False: 318k]
  ------------------
   44|   318k|    }
   45|  5.84k|    return (str.size() > 0) && (str.size()%2 == 0);
  ------------------
  |  Branch (45:12): [True: 5.84k, False: 0]
  |  Branch (45:32): [True: 5.84k, False: 0]
  ------------------
   46|  5.84k|}
_Z11TryParseHexIhENSt3__18optionalINS0_6vectorIT_NS0_9allocatorIS3_EEEEEENS0_17basic_string_viewIcNS0_11char_traitsIcEEEE:
   50|  66.9k|{
   51|  66.9k|    std::vector<Byte> vch;
   52|  66.9k|    vch.reserve(str.size() / 2); // two hex characters form a single byte
   53|       |
   54|  66.9k|    auto it = str.begin();
   55|   287k|    while (it != str.end()) {
  ------------------
  |  Branch (55:12): [True: 220k, False: 66.9k]
  ------------------
   56|   220k|        if (IsSpace(*it)) {
  ------------------
  |  Branch (56:13): [True: 0, False: 220k]
  ------------------
   57|      0|            ++it;
   58|      0|            continue;
   59|      0|        }
   60|   220k|        auto c1 = HexDigit(*(it++));
   61|   220k|        if (it == str.end()) return std::nullopt;
  ------------------
  |  Branch (61:13): [True: 0, False: 220k]
  ------------------
   62|   220k|        auto c2 = HexDigit(*(it++));
   63|   220k|        if (c1 < 0 || c2 < 0) return std::nullopt;
  ------------------
  |  Branch (63:13): [True: 0, False: 220k]
  |  Branch (63:23): [True: 0, False: 220k]
  ------------------
   64|   220k|        vch.push_back(Byte(c1 << 4) | Byte(c2));
   65|   220k|    }
   66|  66.9k|    return vch;
   67|  66.9k|}

_Z10ToIntegralIlENSt3__18optionalIT_EENS0_17basic_string_viewIcNS0_11char_traitsIcEEEEm:
  181|  14.9k|{
  182|  14.9k|    static_assert(std::is_integral_v<T>);
  183|  14.9k|    T result;
  184|  14.9k|    const auto [first_nonmatching, error_condition] = std::from_chars(str.data(), str.data() + str.size(), result, base);
  185|  14.9k|    if (first_nonmatching != str.data() + str.size() || error_condition != std::errc{}) {
  ------------------
  |  Branch (185:9): [True: 0, False: 14.9k]
  |  Branch (185:57): [True: 0, False: 14.9k]
  ------------------
  186|      0|        return std::nullopt;
  187|      0|    }
  188|  14.9k|    return result;
  189|  14.9k|}
_Z8ParseHexIhENSt3__16vectorIT_NS0_9allocatorIS2_EEEENS0_17basic_string_viewIcNS0_11char_traitsIcEEEE:
   70|  66.9k|{
   71|  66.9k|    return TryParseHex<Byte>(hex_str).value_or(std::vector<Byte>{});
   72|  66.9k|}
_Z7IsSpacec:
  166|   220k|constexpr inline bool IsSpace(char c) noexcept {
  167|   220k|    return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v';
  ------------------
  |  Branch (167:12): [True: 0, False: 220k]
  |  Branch (167:24): [True: 0, False: 220k]
  |  Branch (167:37): [True: 0, False: 220k]
  |  Branch (167:50): [True: 0, False: 220k]
  |  Branch (167:63): [True: 0, False: 220k]
  |  Branch (167:76): [True: 0, False: 220k]
  ------------------
  168|   220k|}

_ZN4util8ToStringIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  250|  14.9k|{
  251|  14.9k|    std::ostringstream oss;
  252|  14.9k|    oss.imbue(std::locale::classic());
  253|  14.9k|    oss << t;
  254|  14.9k|    return oss.str();
  255|  14.9k|}

_ZN16CThreadInterruptD2Ev:
   32|      4|    virtual ~CThreadInterrupt() = default;

_ZN10ThreadPoolD2Ev:
   93|     10|    {
   94|     10|        Stop(); // In case it hasn't been stopped.
   95|     10|    }
_ZN10ThreadPool4StopEv:
  129|     10|    {
  130|       |        // Notify workers and join them
  131|     10|        std::vector<std::thread> threads_to_join;
  132|     10|        {
  133|     10|            LOCK(m_mutex);
  ------------------
  |  |  268|     10|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|     10|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|     10|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|     10|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  134|       |            // Ensure Stop() is not called from a worker thread while workers are still registered,
  135|       |            // otherwise a self-join deadlock would occur.
  136|     10|            auto id = std::this_thread::get_id();
  137|     10|            for (const auto& worker : m_workers) assert(worker.get_id() != id);
  ------------------
  |  Branch (137:37): [True: 0, False: 10]
  |  Branch (137:50): [True: 0, False: 0]
  ------------------
  138|       |            // Early shutdown to return right away on any concurrent Submit() call
  139|     10|            m_interrupt = true;
  140|     10|            threads_to_join.swap(m_workers);
  141|     10|        }
  142|      0|        m_cv.notify_all();
  143|       |        // Help draining queue
  144|     10|        while (ProcessTask()) {}
  ------------------
  |  Branch (144:16): [True: 0, False: 10]
  ------------------
  145|       |        // Free resources
  146|     10|        for (auto& worker : threads_to_join) worker.join();
  ------------------
  |  Branch (146:27): [True: 0, False: 10]
  ------------------
  147|       |
  148|       |        // Since we currently wait for tasks completion, sanity-check empty queue
  149|     10|        LOCK(m_mutex);
  ------------------
  |  |  268|     10|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|     10|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|     10|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|     10|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  150|     10|        Assume(m_work_queue.empty());
  ------------------
  |  |  128|     10|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
  151|       |        // Re-allow Start() now that all workers have exited
  152|     10|        m_interrupt = false;
  153|     10|    }
_ZN10ThreadPool11ProcessTaskEv:
  244|     10|    {
  245|     10|        std::packaged_task<void()> task;
  246|     10|        {
  247|     10|            LOCK(m_mutex);
  ------------------
  |  |  268|     10|#define LOCK(cs) UniqueLock BITCOIN_UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|     10|#define BITCOIN_UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|     10|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|     10|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  248|     10|            if (m_work_queue.empty()) return false;
  ------------------
  |  Branch (248:17): [True: 10, False: 0]
  ------------------
  249|       |
  250|       |            // Pop the task
  251|      0|            task = std::move(m_work_queue.front());
  252|      0|            m_work_queue.pop();
  253|      0|        }
  254|      0|        task();
  255|      0|        return true;
  256|     10|    }

_Z11SetMockTimeNSt3__16chrono8durationIxNS_5ratioILl1ELl1EEEEE:
   54|  5.04k|{
   55|  5.04k|    Assert(mock_time_in >= 0s);
  ------------------
  |  |  116|  5.04k|#define Assert(val) inline_assertion_check<true>(val, std::source_location::current(), #val)
  ------------------
   56|  5.04k|    g_mock_time.store(mock_time_in, std::memory_order_relaxed);
   57|  5.04k|}
_ZN19MockableSteadyClock13ClearMockTimeEv:
   84|  5.04k|{
   85|  5.04k|    g_mock_steady_time.store(0ms, std::memory_order_relaxed);
   86|  5.04k|}

_Z3CatINSt3__16vectorINS1_IhNS0_9allocatorIhEEEENS2_IS4_EEEEET_S7_OS7_:
   35|  5.13M|{
   36|  5.13M|    v1.reserve(v1.size() + v2.size());
   37|  5.13M|    for (auto& arg : v2) {
  ------------------
  |  Branch (37:20): [True: 2.88M, False: 5.13M]
  ------------------
   38|  2.88M|        v1.push_back(std::move(arg));
   39|  2.88M|    }
   40|  5.13M|    return v1;
   41|  5.13M|}
_Z6VectorIJNSt3__16vectorIhNS0_9allocatorIhEEEEEENS1_INS0_11common_typeIJDpT_EE4typeENS2_IS9_EEEEDpOS6_:
   24|   128k|{
   25|   128k|    std::vector<std::common_type_t<Args...>> ret;
   26|   128k|    ret.reserve(sizeof...(args));
   27|       |    // The line below uses the trick from https://www.experts-exchange.com/articles/32502/None-recursive-variadic-templates-with-std-initializer-list.html
   28|   128k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|   128k|    return ret;
   30|   128k|}
_Z6VectorIJN10miniscript8internal6MaxIntIjEEEENSt3__16vectorINS4_11common_typeIJDpT_EE4typeENS4_9allocatorISA_EEEEDpOS7_:
   24|   170k|{
   25|   170k|    std::vector<std::common_type_t<Args...>> ret;
   26|   170k|    ret.reserve(sizeof...(args));
   27|       |    // The line below uses the trick from https://www.experts-exchange.com/articles/32502/None-recursive-variadic-templates-with-std-initializer-list.html
   28|   170k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|   170k|    return ret;
   30|   170k|}
_Z6VectorIJN10miniscript8internal7SatInfoEEENSt3__16vectorINS3_11common_typeIJDpT_EE4typeENS3_9allocatorIS9_EEEEDpOS6_:
   24|  85.3k|{
   25|  85.3k|    std::vector<std::common_type_t<Args...>> ret;
   26|  85.3k|    ret.reserve(sizeof...(args));
   27|       |    // The line below uses the trick from https://www.experts-exchange.com/articles/32502/None-recursive-variadic-templates-with-std-initializer-list.html
   28|  85.3k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  85.3k|    return ret;
   30|  85.3k|}
_Z6VectorIJRKN10miniscript8internal10InputStackEEENSt3__16vectorINS5_11common_typeIJDpT_EE4typeENS5_9allocatorISB_EEEEDpOS8_:
   24|  22.9k|{
   25|  22.9k|    std::vector<std::common_type_t<Args...>> ret;
   26|  22.9k|    ret.reserve(sizeof...(args));
   27|       |    // The line below uses the trick from https://www.experts-exchange.com/articles/32502/None-recursive-variadic-templates-with-std-initializer-list.html
   28|  22.9k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  22.9k|    return ret;
   30|  22.9k|}
_Z6VectorIJ7CPubKeyEENSt3__16vectorINS1_11common_typeIJDpT_EE4typeENS1_9allocatorIS7_EEEEDpOS4_:
   24|  19.2k|{
   25|  19.2k|    std::vector<std::common_type_t<Args...>> ret;
   26|  19.2k|    ret.reserve(sizeof...(args));
   27|       |    // The line below uses the trick from https://www.experts-exchange.com/articles/32502/None-recursive-variadic-templates-with-std-initializer-list.html
   28|  19.2k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  19.2k|    return ret;
   30|  19.2k|}
_Z6VectorIJN10miniscript4NodeI7CPubKeyEEEENSt3__16vectorINS4_11common_typeIJDpT_EE4typeENS4_9allocatorISA_EEEEDpOS7_:
   24|  91.0k|{
   25|  91.0k|    std::vector<std::common_type_t<Args...>> ret;
   26|  91.0k|    ret.reserve(sizeof...(args));
   27|       |    // The line below uses the trick from https://www.experts-exchange.com/articles/32502/None-recursive-variadic-templates-with-std-initializer-list.html
   28|  91.0k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  91.0k|    return ret;
   30|  91.0k|}
_Z6VectorIJN10miniscript4NodeI7CPubKeyEES3_EENSt3__16vectorINS4_11common_typeIJDpT_EE4typeENS4_9allocatorISA_EEEEDpOS7_:
   24|  65.7k|{
   25|  65.7k|    std::vector<std::common_type_t<Args...>> ret;
   26|  65.7k|    ret.reserve(sizeof...(args));
   27|       |    // The line below uses the trick from https://www.experts-exchange.com/articles/32502/None-recursive-variadic-templates-with-std-initializer-list.html
   28|  65.7k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  65.7k|    return ret;
   30|  65.7k|}
_Z6VectorIJN10miniscript4NodeI7CPubKeyEES3_S3_EENSt3__16vectorINS4_11common_typeIJDpT_EE4typeENS4_9allocatorISA_EEEEDpOS7_:
   24|  13.2k|{
   25|  13.2k|    std::vector<std::common_type_t<Args...>> ret;
   26|  13.2k|    ret.reserve(sizeof...(args));
   27|       |    // The line below uses the trick from https://www.experts-exchange.com/articles/32502/None-recursive-variadic-templates-with-std-initializer-list.html
   28|  13.2k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  13.2k|    return ret;
   30|  13.2k|}

_ZN19WalletInitInterfaceD2Ev:
   25|      2|    virtual ~WalletInitInterface() = default;

