_ZN10ScriptHashC2ERK7CScript:
   20|  6.00k|ScriptHash::ScriptHash(const CScript& in) : BaseHash(Hash160(in)) {}
_ZN6PKHashC2ERK6CKeyID:
   24|  1.99k|PKHash::PKHash(const CKeyID& pubkey_id) : BaseHash(pubkey_id) {}
_ZN19WitnessV0ScriptHashC2ERK7CScript:
   45|  7.93k|{
   46|  7.93k|    CSHA256().Write(in.data(), in.size()).Finalize(begin());
   47|  7.93k|}
_Z18ExtractDestinationRK7CScriptRNSt3__17variantIJ14CNoDestination17PubKeyDestination6PKHash10ScriptHash19WitnessV0ScriptHash16WitnessV0KeyHash16WitnessV1Taproot11PayToAnchor14WitnessUnknownEEE:
   50|    898|{
   51|    898|    std::vector<valtype> vSolutions;
   52|    898|    TxoutType whichType = Solver(scriptPubKey, vSolutions);
   53|       |
   54|    898|    switch (whichType) {
  ------------------
  |  Branch (54:13): [True: 898, False: 0]
  ------------------
   55|      7|    case TxoutType::PUBKEY: {
  ------------------
  |  Branch (55:5): [True: 7, False: 891]
  ------------------
   56|      7|        CPubKey pubKey(vSolutions[0]);
   57|      7|        if (!pubKey.IsValid()) {
  ------------------
  |  Branch (57:13): [True: 0, False: 7]
  ------------------
   58|      0|            addressRet = CNoDestination(scriptPubKey);
   59|      7|        } else {
   60|      7|            addressRet = PubKeyDestination(pubKey);
   61|      7|        }
   62|      7|        return false;
   63|      0|    }
   64|      2|    case TxoutType::PUBKEYHASH: {
  ------------------
  |  Branch (64:5): [True: 2, False: 896]
  ------------------
   65|      2|        addressRet = PKHash(uint160(vSolutions[0]));
   66|      2|        return true;
   67|      0|    }
   68|     12|    case TxoutType::SCRIPTHASH: {
  ------------------
  |  Branch (68:5): [True: 12, False: 886]
  ------------------
   69|     12|        addressRet = ScriptHash(uint160(vSolutions[0]));
   70|     12|        return true;
   71|      0|    }
   72|      2|    case TxoutType::WITNESS_V0_KEYHASH: {
  ------------------
  |  Branch (72:5): [True: 2, False: 896]
  ------------------
   73|      2|        WitnessV0KeyHash hash;
   74|      2|        std::copy(vSolutions[0].begin(), vSolutions[0].end(), hash.begin());
   75|      2|        addressRet = hash;
   76|      2|        return true;
   77|      0|    }
   78|      2|    case TxoutType::WITNESS_V0_SCRIPTHASH: {
  ------------------
  |  Branch (78:5): [True: 2, False: 896]
  ------------------
   79|      2|        WitnessV0ScriptHash hash;
   80|      2|        std::copy(vSolutions[0].begin(), vSolutions[0].end(), hash.begin());
   81|      2|        addressRet = hash;
   82|      2|        return true;
   83|      0|    }
   84|      5|    case TxoutType::WITNESS_V1_TAPROOT: {
  ------------------
  |  Branch (84:5): [True: 5, False: 893]
  ------------------
   85|      5|        WitnessV1Taproot tap;
   86|      5|        std::copy(vSolutions[0].begin(), vSolutions[0].end(), tap.begin());
   87|      5|        addressRet = tap;
   88|      5|        return true;
   89|      0|    }
   90|      2|    case TxoutType::ANCHOR: {
  ------------------
  |  Branch (90:5): [True: 2, False: 896]
  ------------------
   91|      2|        addressRet = PayToAnchor();
   92|      2|        return true;
   93|      0|    }
   94|     58|    case TxoutType::WITNESS_UNKNOWN: {
  ------------------
  |  Branch (94:5): [True: 58, False: 840]
  ------------------
   95|     58|        addressRet = WitnessUnknown{vSolutions[0][0], vSolutions[1]};
   96|     58|        return true;
   97|      0|    }
   98|      2|    case TxoutType::MULTISIG:
  ------------------
  |  Branch (98:5): [True: 2, False: 896]
  ------------------
   99|     48|    case TxoutType::NULL_DATA:
  ------------------
  |  Branch (99:5): [True: 46, False: 852]
  ------------------
  100|    808|    case TxoutType::NONSTANDARD:
  ------------------
  |  Branch (100:5): [True: 760, False: 138]
  ------------------
  101|    808|        addressRet = CNoDestination(scriptPubKey);
  102|    808|        return false;
  103|    898|    } // no default case, so the compiler can warn about missing cases
  104|    898|    assert(false);
  ------------------
  |  Branch (104:5): [Folded, False: 0]
  ------------------
  105|      0|}
_Z23GetScriptForDestinationRKNSt3__17variantIJ14CNoDestination17PubKeyDestination6PKHash10ScriptHash19WitnessV0ScriptHash16WitnessV0KeyHash16WitnessV1Taproot11PayToAnchor14WitnessUnknownEEE:
  167|  68.1k|{
  168|  68.1k|    return std::visit(CScriptVisitor(), dest);
  169|  68.1k|}
_Z18IsValidDestinationRKNSt3__17variantIJ14CNoDestination17PubKeyDestination6PKHash10ScriptHash19WitnessV0ScriptHash16WitnessV0KeyHash16WitnessV1Taproot11PayToAnchor14WitnessUnknownEEE:
  171|    426|bool IsValidDestination(const CTxDestination& dest) {
  172|    426|    return std::visit(ValidDestinationVisitor(), dest);
  173|    426|}
addresstype.cpp:_ZNK12_GLOBAL__N_114CScriptVisitorclERK6PKHash:
  122|  1.99k|    {
  123|  1.99k|        return CScript() << OP_DUP << OP_HASH160 << ToByteVector(keyID) << OP_EQUALVERIFY << OP_CHECKSIG;
  124|  1.99k|    }
addresstype.cpp:_ZNK12_GLOBAL__N_114CScriptVisitorclERK10ScriptHash:
  127|  6.01k|    {
  128|  6.01k|        return CScript() << OP_HASH160 << ToByteVector(scriptID) << OP_EQUAL;
  129|  6.01k|    }
addresstype.cpp:_ZNK12_GLOBAL__N_114CScriptVisitorclERK19WitnessV0ScriptHash:
  137|  7.93k|    {
  138|  7.93k|        return CScript() << OP_0 << ToByteVector(id);
  139|  7.93k|    }
addresstype.cpp:_ZNK12_GLOBAL__N_114CScriptVisitorclERK16WitnessV0KeyHash:
  132|  1.36k|    {
  133|  1.36k|        return CScript() << OP_0 << ToByteVector(id);
  134|  1.36k|    }
addresstype.cpp:_ZNK12_GLOBAL__N_114CScriptVisitorclERK16WitnessV1Taproot:
  142|  50.8k|    {
  143|  50.8k|        return CScript() << OP_1 << ToByteVector(tap);
  144|  50.8k|    }
addresstype.cpp:_ZNK12_GLOBAL__N_114CScriptVisitorclERK14WitnessUnknown:
  147|     30|    {
  148|     30|        return CScript() << CScript::EncodeOP_N(id.GetWitnessVersion()) << id.GetWitnessProgram();
  149|     30|    }
addresstype.cpp:_ZNK12_GLOBAL__N_123ValidDestinationVisitorclERK14CNoDestination:
  155|    426|    bool operator()(const CNoDestination& dest) const { return false; }

_ZN17PubKeyDestinationC2ERK7CPubKey:
   39|      7|    explicit PubKeyDestination(const CPubKey& pubkey) : m_pubkey(pubkey) {}
_ZN10ScriptHashC2ERK7uint160:
   66|     12|    explicit ScriptHash(const uint160& hash) : BaseHash(hash) {}
_ZN16WitnessV0KeyHashC2Ev:
   81|      2|    WitnessV0KeyHash() : BaseHash() {}
_ZN19WitnessV0ScriptHashC2Ev:
   74|      2|    WitnessV0ScriptHash() : BaseHash() {}
_ZN16WitnessV1TaprootC2Ev:
   90|      5|    WitnessV1Taproot() : XOnlyPubKey() {}
_ZN11PayToAnchorC2Ev:
  125|      2|    PayToAnchor() : WitnessUnknown(1, ANCHOR_BYTES) {
  126|      2|        Assume(CScript::IsPayToAnchor(1, ANCHOR_BYTES));
  ------------------
  |  |  128|      2|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
  127|      2|    };
_ZN14WitnessUnknownC2EiRKNSt3__16vectorIhNS0_9allocatorIhEEEE:
  103|     60|    WitnessUnknown(int version, const std::vector<unsigned char>& program) : m_version(static_cast<unsigned int>(version)), m_program(program) {}
_ZN16WitnessV1TaprootC2ERK11XOnlyPubKey:
   91|  50.8k|    explicit WitnessV1Taproot(const XOnlyPubKey& xpk) : XOnlyPubKey(xpk) {}
_ZN6PKHashC2ERK7uint160:
   50|      2|    explicit PKHash(const uint160& hash) : BaseHash(hash) {}
_ZN14CNoDestinationC2ERK7CScript:
   26|    808|    explicit CNoDestination(const CScript& script) : m_script(script) {}
_ZNK14WitnessUnknown17GetWitnessVersionEv:
  105|     30|    unsigned int GetWitnessVersion() const { return m_version; }
_ZNK14WitnessUnknown17GetWitnessProgramEv:
  106|     30|    const std::vector<unsigned char>& GetWitnessProgram() const LIFETIMEBOUND { return m_program; }
_ZN14CNoDestinationC2Ev:
   25|  1.32k|    CNoDestination() = default;
_ZN16WitnessV0KeyHashC2ERK7uint160:
   82|  1.36k|    explicit WitnessV0KeyHash(const uint160& hash) : BaseHash(hash) {}

_Z12EncodeBase58NSt3__14spanIKhLm18446744073709551615EEE:
   90|  1.34M|{
   91|       |    // Skip & count leading zeroes.
   92|  1.34M|    int zeroes = 0;
   93|  1.34M|    int length = 0;
   94|  1.34M|    while (input.size() > 0 && input[0] == 0) {
  ------------------
  |  Branch (94:12): [True: 1.34M, False: 0]
  |  Branch (94:32): [True: 0, False: 1.34M]
  ------------------
   95|      0|        input = input.subspan(1);
   96|      0|        zeroes++;
   97|      0|    }
   98|       |    // Allocate enough space in big-endian base58 representation.
   99|  1.34M|    int size = input.size() * 138 / 100 + 1; // log(256) / log(58), rounded up.
  100|  1.34M|    std::vector<unsigned char> b58(size);
  101|       |    // Process the bytes.
  102|   112M|    while (input.size() > 0) {
  ------------------
  |  Branch (102:12): [True: 110M, False: 1.34M]
  ------------------
  103|   110M|        int carry = input[0];
  104|   110M|        int i = 0;
  105|       |        // Apply "b58 = b58 * 256 + ch".
  106|  6.32G|        for (std::vector<unsigned char>::reverse_iterator it = b58.rbegin(); (carry != 0 || i < length) && (it != b58.rend()); it++, i++) {
  ------------------
  |  Branch (106:78): [True: 6.21G, False: 110M]
  |  Branch (106:79): [True: 6.19G, False: 134M]
  |  Branch (106:93): [True: 24.2M, False: 110M]
  |  Branch (106:108): [True: 6.21G, False: 0]
  ------------------
  107|  6.21G|            carry += 256 * (*it);
  108|  6.21G|            *it = carry % 58;
  109|  6.21G|            carry /= 58;
  110|  6.21G|        }
  111|       |
  112|   110M|        assert(carry == 0);
  ------------------
  |  Branch (112:9): [True: 110M, False: 0]
  ------------------
  113|   110M|        length = i;
  114|   110M|        input = input.subspan(1);
  115|   110M|    }
  116|       |    // Skip leading zeroes in base58 result.
  117|  1.34M|    std::vector<unsigned char>::iterator it = b58.begin() + (size - length);
  118|  1.34M|    while (it != b58.end() && *it == 0)
  ------------------
  |  Branch (118:12): [True: 1.34M, False: 0]
  |  Branch (118:12): [True: 0, False: 1.34M]
  |  Branch (118:31): [True: 0, False: 1.34M]
  ------------------
  119|      0|        it++;
  120|       |    // Translate the result into a string.
  121|  1.34M|    std::string str;
  122|  1.34M|    str.reserve(zeroes + (b58.end() - it));
  123|  1.34M|    str.assign(zeroes, '1');
  124|   151M|    while (it != b58.end())
  ------------------
  |  Branch (124:12): [True: 149M, False: 1.34M]
  ------------------
  125|   149M|        str += pszBase58[*(it++)];
  126|  1.34M|    return str;
  127|  1.34M|}
_Z12DecodeBase58RKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS_6vectorIhNS3_IhEEEEi:
  130|     70|{
  131|     70|    if (ContainsNUL(str)) {
  ------------------
  |  Branch (131:9): [True: 0, False: 70]
  ------------------
  132|      0|        return false;
  133|      0|    }
  134|     70|    return DecodeBase58(str.c_str(), vchRet, max_ret_len);
  135|     70|}
_Z17EncodeBase58CheckNSt3__14spanIKhLm18446744073709551615EEE:
  138|  1.34M|{
  139|       |    // add 4-byte hash check to the end
  140|  1.34M|    std::vector<unsigned char> vch(input.begin(), input.end());
  141|  1.34M|    uint256 hash = Hash(vch);
  142|  1.34M|    vch.insert(vch.end(), hash.data(), hash.data() + 4);
  143|  1.34M|    return EncodeBase58(vch);
  144|  1.34M|}
_Z17DecodeBase58CheckRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS_6vectorIhNS3_IhEEEEi:
  164|  73.1k|{
  165|  73.1k|    if (ContainsNUL(str)) {
  ------------------
  |  Branch (165:9): [True: 0, False: 73.1k]
  ------------------
  166|      0|        return false;
  167|      0|    }
  168|  73.1k|    return DecodeBase58Check(str.c_str(), vchRet, max_ret);
  169|  73.1k|}
base58.cpp:_ZL12DecodeBase58PKcRNSt3__16vectorIhNS1_9allocatorIhEEEEi:
   41|  73.2k|{
   42|       |    // Skip leading spaces.
   43|  73.5k|    while (*psz && IsSpace(*psz))
  ------------------
  |  Branch (43:12): [True: 73.5k, False: 14]
  |  Branch (43:20): [True: 262, False: 73.2k]
  ------------------
   44|    262|        psz++;
   45|       |    // Skip and count leading '1's.
   46|  73.2k|    int zeroes = 0;
   47|  73.2k|    int length = 0;
   48|  75.4k|    while (*psz == '1') {
  ------------------
  |  Branch (48:12): [True: 2.21k, False: 73.2k]
  ------------------
   49|  2.21k|        zeroes++;
   50|  2.21k|        if (zeroes > max_ret_len) return false;
  ------------------
  |  Branch (50:13): [True: 15, False: 2.20k]
  ------------------
   51|  2.20k|        psz++;
   52|  2.20k|    }
   53|       |    // Allocate enough space in big-endian base256 representation.
   54|  73.2k|    int size = strlen(psz) * 733 /1000 + 1; // log(58) / log(256), rounded up.
   55|  73.2k|    std::vector<unsigned char> b256(size);
   56|       |    // Process the characters.
   57|  73.2k|    static_assert(std::size(mapBase58) == 256, "mapBase58.size() should be 256"); // guarantee not out of range
   58|  8.00M|    while (*psz && !IsSpace(*psz)) {
  ------------------
  |  Branch (58:12): [True: 7.93M, False: 71.3k]
  |  Branch (58:20): [True: 7.93M, False: 60]
  ------------------
   59|       |        // Decode base58 character
   60|  7.93M|        int carry = mapBase58[(uint8_t)*psz];
   61|  7.93M|        if (carry == -1)  // Invalid b58 character
  ------------------
  |  Branch (61:13): [True: 561, False: 7.93M]
  ------------------
   62|    561|            return false;
   63|  7.93M|        int i = 0;
   64|   335M|        for (std::vector<unsigned char>::reverse_iterator it = b256.rbegin(); (carry != 0 || i < length) && (it != b256.rend()); ++it, ++i) {
  ------------------
  |  Branch (64:79): [True: 327M, False: 7.93M]
  |  Branch (64:80): [True: 321M, False: 13.7M]
  |  Branch (64:94): [True: 5.84M, False: 7.93M]
  |  Branch (64:109): [True: 327M, False: 0]
  ------------------
   65|   327M|            carry += 58 * (*it);
   66|   327M|            *it = carry % 256;
   67|   327M|            carry /= 256;
   68|   327M|        }
   69|  7.93M|        assert(carry == 0);
  ------------------
  |  Branch (69:9): [True: 7.93M, False: 0]
  ------------------
   70|  7.93M|        length = i;
   71|  7.93M|        if (length + zeroes > max_ret_len) return false;
  ------------------
  |  Branch (71:13): [True: 1.28k, False: 7.93M]
  ------------------
   72|  7.93M|        psz++;
   73|  7.93M|    }
   74|       |    // Skip trailing spaces.
   75|  71.8k|    while (IsSpace(*psz))
  ------------------
  |  Branch (75:12): [True: 443, False: 71.3k]
  ------------------
   76|    443|        psz++;
   77|  71.3k|    if (*psz != 0)
  ------------------
  |  Branch (77:9): [True: 54, False: 71.3k]
  ------------------
   78|     54|        return false;
   79|       |    // Skip leading zeroes in b256.
   80|  71.3k|    std::vector<unsigned char>::iterator it = b256.begin() + (size - length);
   81|       |    // Copy result into output vector.
   82|  71.3k|    vch.reserve(zeroes + (b256.end() - it));
   83|  71.3k|    vch.assign(zeroes, 0x00);
   84|  5.87M|    while (it != b256.end())
  ------------------
  |  Branch (84:12): [True: 5.80M, False: 71.3k]
  ------------------
   85|  5.80M|        vch.push_back(*(it++));
   86|  71.3k|    return true;
   87|  71.3k|}
base58.cpp:_ZL17DecodeBase58CheckPKcRNSt3__16vectorIhNS1_9allocatorIhEEEEi:
  147|  73.1k|{
  148|  73.1k|    if (!DecodeBase58(psz, vchRet, max_ret_len > std::numeric_limits<int>::max() - 4 ? std::numeric_limits<int>::max() : max_ret_len + 4) ||
  ------------------
  |  Branch (148:9): [True: 1.88k, False: 71.3k]
  |  Branch (148:36): [True: 0, False: 73.1k]
  ------------------
  149|  71.3k|        (vchRet.size() < 4)) {
  ------------------
  |  Branch (149:9): [True: 204, False: 71.0k]
  ------------------
  150|  2.09k|        vchRet.clear();
  151|  2.09k|        return false;
  152|  2.09k|    }
  153|       |    // re-calculate the checksum, ensure it matches the included 4-byte checksum
  154|  71.0k|    uint256 hash = Hash(std::span{vchRet}.first(vchRet.size() - 4));
  155|  71.0k|    if (memcmp(&hash, &vchRet[vchRet.size() - 4], 4) != 0) {
  ------------------
  |  Branch (155:9): [True: 252, False: 70.8k]
  ------------------
  156|    252|        vchRet.clear();
  157|    252|        return false;
  158|    252|    }
  159|  70.8k|    vchRet.resize(vchRet.size() - 4);
  160|  70.8k|    return true;
  161|  71.0k|}

_ZN6bech326DecodeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS_9CharLimitE:
  373|    354|DecodeResult Decode(const std::string& str, CharLimit limit) {
  374|    354|    std::vector<int> errors;
  375|    354|    if (!CheckCharacters(str, errors)) return {};
  ------------------
  |  Branch (375:9): [True: 68, False: 286]
  ------------------
  376|    286|    size_t pos = str.rfind(SEPARATOR);
  377|    286|    if (str.size() > limit) return {};
  ------------------
  |  Branch (377:9): [True: 31, False: 255]
  ------------------
  378|    255|    if (pos == str.npos || pos == 0 || pos + CHECKSUM_SIZE >= str.size()) {
  ------------------
  |  Branch (378:9): [True: 21, False: 234]
  |  Branch (378:28): [True: 0, False: 234]
  |  Branch (378:40): [True: 10, False: 224]
  ------------------
  379|     31|        return {};
  380|     31|    }
  381|    224|    data values(str.size() - 1 - pos);
  382|  3.44k|    for (size_t i = 0; i < str.size() - 1 - pos; ++i) {
  ------------------
  |  Branch (382:24): [True: 3.23k, False: 217]
  ------------------
  383|  3.23k|        unsigned char c = str[i + pos + 1];
  384|  3.23k|        int8_t rev = CHARSET_REV[c];
  385|       |
  386|  3.23k|        if (rev == -1) {
  ------------------
  |  Branch (386:13): [True: 7, False: 3.22k]
  ------------------
  387|      7|            return {};
  388|      7|        }
  389|  3.22k|        values[i] = rev;
  390|  3.22k|    }
  391|    217|    std::string hrp;
  392|    217|    hrp.reserve(pos);
  393|  2.60k|    for (size_t i = 0; i < pos; ++i) {
  ------------------
  |  Branch (393:24): [True: 2.38k, False: 217]
  ------------------
  394|  2.38k|        hrp += LowerCase(str[i]);
  395|  2.38k|    }
  396|    217|    Encoding result = VerifyChecksum(hrp, values);
  397|    217|    if (result == Encoding::INVALID) return {};
  ------------------
  |  Branch (397:9): [True: 207, False: 10]
  ------------------
  398|     10|    return {result, std::move(hrp), data(values.begin(), values.end() - CHECKSUM_SIZE)};
  399|    217|}
_ZN6bech3212LocateErrorsERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS_9CharLimitE:
  402|    344|std::pair<std::string, std::vector<int>> LocateErrors(const std::string& str, CharLimit limit) {
  403|    344|    std::vector<int> error_locations{};
  404|       |
  405|    344|    if (str.size() > limit) {
  ------------------
  |  Branch (405:9): [True: 73, False: 271]
  ------------------
  406|     73|        error_locations.push_back(static_cast<int>(limit));
  407|     73|        return std::make_pair("Bech32 string too long", std::move(error_locations));
  408|     73|    }
  409|       |
  410|    271|    if (!CheckCharacters(str, error_locations)){
  ------------------
  |  Branch (410:9): [True: 26, False: 245]
  ------------------
  411|     26|        return std::make_pair("Invalid character or mixed case", std::move(error_locations));
  412|     26|    }
  413|       |
  414|    245|    size_t pos = str.rfind(SEPARATOR);
  415|    245|    if (pos == str.npos) {
  ------------------
  |  Branch (415:9): [True: 21, False: 224]
  ------------------
  416|     21|        return std::make_pair("Missing separator", std::vector<int>{});
  417|     21|    }
  418|    224|    if (pos == 0 || pos + CHECKSUM_SIZE >= str.size()) {
  ------------------
  |  Branch (418:9): [True: 0, False: 224]
  |  Branch (418:21): [True: 10, False: 214]
  ------------------
  419|     10|        error_locations.push_back(pos);
  420|     10|        return std::make_pair("Invalid separator position", std::move(error_locations));
  421|     10|    }
  422|       |
  423|    214|    std::string hrp;
  424|    214|    hrp.reserve(pos);
  425|  2.49k|    for (size_t i = 0; i < pos; ++i) {
  ------------------
  |  Branch (425:24): [True: 2.28k, False: 214]
  ------------------
  426|  2.28k|        hrp += LowerCase(str[i]);
  427|  2.28k|    }
  428|       |
  429|    214|    size_t length = str.size() - 1 - pos; // length of data part
  430|    214|    data values(length);
  431|  3.15k|    for (size_t i = pos + 1; i < str.size(); ++i) {
  ------------------
  |  Branch (431:30): [True: 2.95k, False: 207]
  ------------------
  432|  2.95k|        unsigned char c = str[i];
  433|  2.95k|        int8_t rev = CHARSET_REV[c];
  434|  2.95k|        if (rev == -1) {
  ------------------
  |  Branch (434:13): [True: 7, False: 2.94k]
  ------------------
  435|      7|            error_locations.push_back(i);
  436|      7|            return std::make_pair("Invalid Base 32 character", std::move(error_locations));
  437|      7|        }
  438|  2.94k|        values[i - pos - 1] = rev;
  439|  2.94k|    }
  440|       |
  441|       |    // We attempt error detection with both bech32 and bech32m, and choose the one with the fewest errors
  442|       |    // We can't simply use the segwit version, because that may be one of the errors
  443|    207|    std::optional<Encoding> error_encoding;
  444|    414|    for (Encoding encoding : {Encoding::BECH32, Encoding::BECH32M}) {
  ------------------
  |  Branch (444:28): [True: 414, False: 207]
  ------------------
  445|    414|        std::vector<int> possible_errors;
  446|       |        // Recall that (expanded hrp + values) is interpreted as a list of coefficients of a polynomial
  447|       |        // over GF(32). PolyMod computes the "remainder" of this polynomial modulo the generator G(x).
  448|    414|        auto enc = PreparePolynomialCoefficients(hrp, values);
  449|    414|        uint32_t residue = PolyMod(enc) ^ EncodingConstant(encoding);
  450|       |
  451|       |        // All valid codewords should be multiples of G(x), so this remainder (after XORing with the encoding
  452|       |        // constant) should be 0 - hence 0 indicates there are no errors present.
  453|    414|        if (residue != 0) {
  ------------------
  |  Branch (453:13): [True: 414, False: 0]
  ------------------
  454|       |            // If errors are present, our polynomial must be of the form C(x) + E(x) where C is the valid
  455|       |            // codeword (a multiple of G(x)), and E encodes the errors.
  456|    414|            uint32_t syn = Syndrome(residue);
  457|       |
  458|       |            // Unpack the three 10-bit syndrome values
  459|    414|            int s0 = syn & 0x3FF;
  460|    414|            int s1 = (syn >> 10) & 0x3FF;
  461|    414|            int s2 = syn >> 20;
  462|       |
  463|       |            // Get the discrete logs of these values in GF1024 for more efficient computation
  464|    414|            int l_s0 = GF1024_LOG.at(s0);
  465|    414|            int l_s1 = GF1024_LOG.at(s1);
  466|    414|            int l_s2 = GF1024_LOG.at(s2);
  467|       |
  468|       |            // First, suppose there is only a single error. Then E(x) = e1*x^p1 for some position p1
  469|       |            // Then s0 = E((e)^997) = e1*(e)^(997*p1) and s1 = E((e)^998) = e1*(e)^(998*p1)
  470|       |            // Therefore s1/s0 = (e)^p1, and by the same logic, s2/s1 = (e)^p1 too.
  471|       |            // Hence, s1^2 == s0*s2, which is exactly the condition we check first:
  472|    414|            if (l_s0 != -1 && l_s1 != -1 && l_s2 != -1 && (2 * l_s1 - l_s2 - l_s0 + 2046) % 1023 == 0) {
  ------------------
  |  Branch (472:17): [True: 393, False: 21]
  |  Branch (472:31): [True: 378, False: 15]
  |  Branch (472:45): [True: 376, False: 2]
  |  Branch (472:59): [True: 23, False: 353]
  ------------------
  473|       |                // Compute the error position p1 as l_s1 - l_s0 = p1 (mod 1023)
  474|     23|                size_t p1 = (l_s1 - l_s0 + 1023) % 1023; // the +1023 ensures it is positive
  475|       |                // Now because s0 = e1*(e)^(997*p1), we get e1 = s0/((e)^(997*p1)). Remember that (e)^1023 = 1,
  476|       |                // so 1/((e)^997) = (e)^(1023-997).
  477|     23|                int l_e1 = l_s0 + (1023 - 997) * p1;
  478|       |                // Finally, some sanity checks on the result:
  479|       |                // - The error position should be within the length of the data
  480|       |                // - e1 should be in GF(32), which implies that e1 = (e)^(33k) for some k (the 31 non-zero elements
  481|       |                // of GF(32) form an index 33 subgroup of the 1023 non-zero elements of GF(1024)).
  482|     23|                if (p1 < length && !(l_e1 % 33)) {
  ------------------
  |  Branch (482:21): [True: 10, False: 13]
  |  Branch (482:36): [True: 9, False: 1]
  ------------------
  483|       |                    // Polynomials run from highest power to lowest, so the index p1 is from the right.
  484|       |                    // We don't return e1 because it is dangerous to suggest corrections to the user,
  485|       |                    // the user should check the address themselves.
  486|      9|                    possible_errors.push_back(str.size() - p1 - 1);
  487|      9|                }
  488|       |            // Otherwise, suppose there are two errors. Then E(x) = e1*x^p1 + e2*x^p2.
  489|    391|            } else {
  490|       |                // For all possible first error positions p1
  491|  5.36k|                for (size_t p1 = 0; p1 < length; ++p1) {
  ------------------
  |  Branch (491:37): [True: 4.99k, False: 362]
  ------------------
  492|       |                    // We have guessed p1, and want to solve for p2. Recall that E(x) = e1*x^p1 + e2*x^p2, so
  493|       |                    // s0 = E((e)^997) = e1*(e)^(997^p1) + e2*(e)^(997*p2), and similar for s1 and s2.
  494|       |                    //
  495|       |                    // Consider s2 + s1*(e)^p1
  496|       |                    //          = 2e1*(e)^(999^p1) + e2*(e)^(999*p2) + e2*(e)^(998*p2)*(e)^p1
  497|       |                    //          = e2*(e)^(999*p2) + e2*(e)^(998*p2)*(e)^p1
  498|       |                    //    (Because we are working in characteristic 2.)
  499|       |                    //          = e2*(e)^(998*p2) ((e)^p2 + (e)^p1)
  500|       |                    //
  501|  4.99k|                    int s2_s1p1 = s2 ^ (s1 == 0 ? 0 : GF1024_EXP.at((l_s1 + p1) % 1023));
  ------------------
  |  Branch (501:41): [True: 348, False: 4.65k]
  ------------------
  502|  4.99k|                    if (s2_s1p1 == 0) continue;
  ------------------
  |  Branch (502:25): [True: 80, False: 4.91k]
  ------------------
  503|  4.91k|                    int l_s2_s1p1 = GF1024_LOG.at(s2_s1p1);
  504|       |
  505|       |                    // Similarly, s1 + s0*(e)^p1
  506|       |                    //          = e2*(e)^(997*p2) ((e)^p2 + (e)^p1)
  507|  4.91k|                    int s1_s0p1 = s1 ^ (s0 == 0 ? 0 : GF1024_EXP.at((l_s0 + p1) % 1023));
  ------------------
  |  Branch (507:41): [True: 389, False: 4.53k]
  ------------------
  508|  4.91k|                    if (s1_s0p1 == 0) continue;
  ------------------
  |  Branch (508:25): [True: 71, False: 4.84k]
  ------------------
  509|  4.84k|                    int l_s1_s0p1 = GF1024_LOG.at(s1_s0p1);
  510|       |
  511|       |                    // So, putting these together, we can compute the second error position as
  512|       |                    // (e)^p2 = (s2 + s1^p1)/(s1 + s0^p1)
  513|       |                    // p2 = log((e)^p2)
  514|  4.84k|                    size_t p2 = (l_s2_s1p1 - l_s1_s0p1 + 1023) % 1023;
  515|       |
  516|       |                    // Sanity checks that p2 is a valid position and not the same as p1
  517|  4.84k|                    if (p2 >= length || p1 == p2) continue;
  ------------------
  |  Branch (517:25): [True: 4.33k, False: 511]
  |  Branch (517:41): [True: 86, False: 425]
  ------------------
  518|       |
  519|       |                    // Now we want to compute the error values e1 and e2.
  520|       |                    // Similar to above, we compute s1 + s0*(e)^p2
  521|       |                    //          = e1*(e)^(997*p1) ((e)^p1 + (e)^p2)
  522|    425|                    int s1_s0p2 = s1 ^ (s0 == 0 ? 0 : GF1024_EXP.at((l_s0 + p2) % 1023));
  ------------------
  |  Branch (522:41): [True: 37, False: 388]
  ------------------
  523|    425|                    if (s1_s0p2 == 0) continue;
  ------------------
  |  Branch (523:25): [True: 0, False: 425]
  ------------------
  524|    425|                    int l_s1_s0p2 = GF1024_LOG.at(s1_s0p2);
  525|       |
  526|       |                    // And compute (the log of) 1/((e)^p1 + (e)^p2))
  527|    425|                    int inv_p1_p2 = 1023 - GF1024_LOG.at(GF1024_EXP.at(p1) ^ GF1024_EXP.at(p2));
  528|       |
  529|       |                    // Then (s1 + s0*(e)^p1) * (1/((e)^p1 + (e)^p2)))
  530|       |                    //         = e2*(e)^(997*p2)
  531|       |                    // Then recover e2 by dividing by (e)^(997*p2)
  532|    425|                    int l_e2 = l_s1_s0p1 + inv_p1_p2 + (1023 - 997) * p2;
  533|       |                    // Check that e2 is in GF(32)
  534|    425|                    if (l_e2 % 33) continue;
  ------------------
  |  Branch (534:25): [True: 358, False: 67]
  ------------------
  535|       |
  536|       |                    // In the same way, (s1 + s0*(e)^p2) * (1/((e)^p1 + (e)^p2)))
  537|       |                    //         = e1*(e)^(997*p1)
  538|       |                    // So recover e1 by dividing by (e)^(997*p1)
  539|     67|                    int l_e1 = l_s1_s0p2 + inv_p1_p2 + (1023 - 997) * p1;
  540|       |                    // Check that e1 is in GF(32)
  541|     67|                    if (l_e1 % 33) continue;
  ------------------
  |  Branch (541:25): [True: 38, False: 29]
  ------------------
  542|       |
  543|       |                    // Again, we do not return e1 or e2 for safety.
  544|       |                    // Order the error positions from the left of the string and return them
  545|     29|                    if (p1 > p2) {
  ------------------
  |  Branch (545:25): [True: 0, False: 29]
  ------------------
  546|      0|                        possible_errors.push_back(str.size() - p1 - 1);
  547|      0|                        possible_errors.push_back(str.size() - p2 - 1);
  548|     29|                    } else {
  549|     29|                        possible_errors.push_back(str.size() - p2 - 1);
  550|     29|                        possible_errors.push_back(str.size() - p1 - 1);
  551|     29|                    }
  552|     29|                    break;
  553|     67|                }
  554|    391|            }
  555|    414|        } else {
  556|       |            // No errors
  557|      0|            return std::make_pair("", std::vector<int>{});
  558|      0|        }
  559|       |
  560|    414|        if (error_locations.empty() || (!possible_errors.empty() && possible_errors.size() < error_locations.size())) {
  ------------------
  |  Branch (560:13): [True: 395, False: 19]
  |  Branch (560:41): [True: 2, False: 17]
  |  Branch (560:69): [True: 0, False: 2]
  ------------------
  561|    395|            error_locations = std::move(possible_errors);
  562|    395|            if (!error_locations.empty()) error_encoding = encoding;
  ------------------
  |  Branch (562:17): [True: 36, False: 359]
  ------------------
  563|    395|        }
  564|    414|    }
  565|    207|    std::string error_message = error_encoding == Encoding::BECH32M ? "Invalid Bech32m checksum"
  ------------------
  |  Branch (565:33): [True: 17, False: 190]
  ------------------
  566|    207|                              : error_encoding == Encoding::BECH32 ? "Invalid Bech32 checksum"
  ------------------
  |  Branch (566:33): [True: 19, False: 171]
  ------------------
  567|    190|                              : "Invalid checksum";
  568|       |
  569|    207|    return std::make_pair(error_message, std::move(error_locations));
  570|    207|}
bech32.cpp:_ZN6bech3212_GLOBAL__N_115CheckCharactersERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorIiNS5_IiEEEE:
  287|    625|{
  288|    625|    bool lower = false, upper = false;
  289|  4.64M|    for (size_t i = 0; i < str.size(); ++i) {
  ------------------
  |  Branch (289:24): [True: 4.64M, False: 625]
  ------------------
  290|  4.64M|        unsigned char c{(unsigned char)(str[i])};
  291|  4.64M|        if (c >= 'a' && c <= 'z') {
  ------------------
  |  Branch (291:13): [True: 2.55M, False: 2.09M]
  |  Branch (291:25): [True: 2.55M, False: 1.21k]
  ------------------
  292|  2.55M|            if (upper) {
  ------------------
  |  Branch (292:17): [True: 1.28M, False: 1.26M]
  ------------------
  293|  1.28M|                errors.push_back(i);
  294|  1.28M|            } else {
  295|  1.26M|                lower = true;
  296|  1.26M|            }
  297|  2.55M|        } else if (c >= 'A' && c <= 'Z') {
  ------------------
  |  Branch (297:20): [True: 113k, False: 1.97M]
  |  Branch (297:32): [True: 41.8k, False: 71.9k]
  ------------------
  298|  41.8k|            if (lower) {
  ------------------
  |  Branch (298:17): [True: 34.2k, False: 7.54k]
  ------------------
  299|  34.2k|                errors.push_back(i);
  300|  34.2k|            } else {
  301|  7.54k|                upper = true;
  302|  7.54k|            }
  303|  2.05M|        } else if (c < 33 || c > 126) {
  ------------------
  |  Branch (303:20): [True: 515, False: 2.05M]
  |  Branch (303:30): [True: 0, False: 2.05M]
  ------------------
  304|    515|            errors.push_back(i);
  305|    515|        }
  306|  4.64M|    }
  307|    625|    return errors.empty();
  308|    625|}
bech32.cpp:_ZN6bech3212_GLOBAL__N_19LowerCaseEh:
  281|  4.66k|{
  282|  4.66k|    return (c >= 'A' && c <= 'Z') ? (c - 'A') + 'a' : c;
  ------------------
  |  Branch (282:13): [True: 3.16k, False: 1.49k]
  |  Branch (282:25): [True: 998, False: 2.16k]
  ------------------
  283|  4.66k|}
bech32.cpp:_ZN6bech3212_GLOBAL__N_114VerifyChecksumERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS1_6vectorIhNS5_IhEEEE:
  327|    217|{
  328|       |    // PolyMod computes what value to xor into the final values to make the checksum 0. However,
  329|       |    // if we required that the checksum was 0, it would be the case that appending a 0 to a valid
  330|       |    // list of values would result in a new valid list. For that reason, Bech32 requires the
  331|       |    // resulting checksum to be 1 instead. In Bech32m, this constant was amended. See
  332|       |    // https://gist.github.com/sipa/14c248c288c3880a3b191f978a34508e for details.
  333|    217|    auto enc = PreparePolynomialCoefficients(hrp, values);
  334|    217|    const uint32_t check = PolyMod(enc);
  335|    217|    if (check == EncodingConstant(Encoding::BECH32)) return Encoding::BECH32;
  ------------------
  |  Branch (335:9): [True: 5, False: 212]
  ------------------
  336|    212|    if (check == EncodingConstant(Encoding::BECH32M)) return Encoding::BECH32M;
  ------------------
  |  Branch (336:9): [True: 5, False: 207]
  ------------------
  337|    207|    return Encoding::INVALID;
  338|    212|}
bech32.cpp:_ZN6bech3212_GLOBAL__N_129PreparePolynomialCoefficientsERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS1_6vectorIhNS5_IhEEEE:
  311|    631|{
  312|    631|    data ret;
  313|    631|    ret.reserve(hrp.size() + 1 + hrp.size() + values.size() + CHECKSUM_SIZE);
  314|       |
  315|       |    /** Expand a HRP for use in checksum computation. */
  316|  7.49k|    for (size_t i = 0; i < hrp.size(); ++i) ret.push_back(hrp[i] >> 5);
  ------------------
  |  Branch (316:24): [True: 6.86k, False: 631]
  ------------------
  317|    631|    ret.push_back(0);
  318|  7.49k|    for (size_t i = 0; i < hrp.size(); ++i) ret.push_back(hrp[i] & 0x1f);
  ------------------
  |  Branch (318:24): [True: 6.86k, False: 631]
  ------------------
  319|       |
  320|    631|    ret.insert(ret.end(), values.begin(), values.end());
  321|       |
  322|    631|    return ret;
  323|    631|}
bech32.cpp:_ZN6bech3212_GLOBAL__N_17PolyModERKNSt3__16vectorIhNS1_9allocatorIhEEEE:
  130|    631|{
  131|       |    // The input is interpreted as a list of coefficients of a polynomial over F = GF(32), with an
  132|       |    // implicit 1 in front. If the input is [v0,v1,v2,v3,v4], that polynomial is v(x) =
  133|       |    // 1*x^5 + v0*x^4 + v1*x^3 + v2*x^2 + v3*x + v4. The implicit 1 guarantees that
  134|       |    // [v0,v1,v2,...] has a distinct checksum from [0,v0,v1,v2,...].
  135|       |
  136|       |    // The output is a 30-bit integer whose 5-bit groups are the coefficients of the remainder of
  137|       |    // v(x) mod g(x), where g(x) is the Bech32 generator,
  138|       |    // x^6 + {29}x^5 + {22}x^4 + {20}x^3 + {21}x^2 + {29}x + {18}. g(x) is chosen in such a way
  139|       |    // that the resulting code is a BCH code, guaranteeing detection of up to 3 errors within a
  140|       |    // window of 1023 characters. Among the various possible BCH codes, one was selected to in
  141|       |    // fact guarantee detection of up to 4 errors within a window of 89 characters.
  142|       |
  143|       |    // Note that the coefficients are elements of GF(32), here represented as decimal numbers
  144|       |    // between {}. In this finite field, addition is just XOR of the corresponding numbers. For
  145|       |    // example, {27} + {13} = {27 ^ 13} = {22}. Multiplication is more complicated, and requires
  146|       |    // treating the bits of values themselves as coefficients of a polynomial over a smaller field,
  147|       |    // GF(2), and multiplying those polynomials mod a^5 + a^3 + 1. For example, {5} * {26} =
  148|       |    // (a^2 + 1) * (a^4 + a^3 + a) = (a^4 + a^3 + a) * a^2 + (a^4 + a^3 + a) = a^6 + a^5 + a^4 + a
  149|       |    // = a^3 + 1 (mod a^5 + a^3 + 1) = {9}.
  150|       |
  151|       |    // During the course of the loop below, `c` contains the bitpacked coefficients of the
  152|       |    // polynomial constructed from just the values of v that were processed so far, mod g(x). In
  153|       |    // the above example, `c` initially corresponds to 1 mod g(x), and after processing 2 inputs of
  154|       |    // v, it corresponds to x^2 + v0*x + v1 mod g(x). As 1 mod g(x) = 1, that is the starting value
  155|       |    // for `c`.
  156|       |
  157|       |    // The following Sage code constructs the generator used:
  158|       |    //
  159|       |    // B = GF(2) # Binary field
  160|       |    // BP.<b> = B[] # Polynomials over the binary field
  161|       |    // F_mod = b**5 + b**3 + 1
  162|       |    // F.<f> = GF(32, modulus=F_mod, repr='int') # GF(32) definition
  163|       |    // FP.<x> = F[] # Polynomials over GF(32)
  164|       |    // E_mod = x**2 + F.fetch_int(9)*x + F.fetch_int(23)
  165|       |    // E.<e> = F.extension(E_mod) # GF(1024) extension field definition
  166|       |    // for p in divisors(E.order() - 1): # Verify e has order 1023.
  167|       |    //    assert((e**p == 1) == (p % 1023 == 0))
  168|       |    // G = lcm([(e**i).minpoly() for i in range(997,1000)])
  169|       |    // print(G) # Print out the generator
  170|       |    //
  171|       |    // It demonstrates that g(x) is the least common multiple of the minimal polynomials
  172|       |    // of 3 consecutive powers (997,998,999) of a primitive element (e) of GF(1024).
  173|       |    // That guarantees it is, in fact, the generator of a primitive BCH code with cycle
  174|       |    // length 1023 and distance 4. See https://en.wikipedia.org/wiki/BCH_code for more details.
  175|       |
  176|    631|    uint32_t c = 1;
  177|  23.4k|    for (const auto v_i : v) {
  ------------------
  |  Branch (177:25): [True: 23.4k, False: 631]
  ------------------
  178|       |        // We want to update `c` to correspond to a polynomial with one extra term. If the initial
  179|       |        // value of `c` consists of the coefficients of c(x) = f(x) mod g(x), we modify it to
  180|       |        // correspond to c'(x) = (f(x) * x + v_i) mod g(x), where v_i is the next input to
  181|       |        // process. Simplifying:
  182|       |        // c'(x) = (f(x) * x + v_i) mod g(x)
  183|       |        //         ((f(x) mod g(x)) * x + v_i) mod g(x)
  184|       |        //         (c(x) * x + v_i) mod g(x)
  185|       |        // If c(x) = c0*x^5 + c1*x^4 + c2*x^3 + c3*x^2 + c4*x + c5, we want to compute
  186|       |        // c'(x) = (c0*x^5 + c1*x^4 + c2*x^3 + c3*x^2 + c4*x + c5) * x + v_i mod g(x)
  187|       |        //       = c0*x^6 + c1*x^5 + c2*x^4 + c3*x^3 + c4*x^2 + c5*x + v_i mod g(x)
  188|       |        //       = c0*(x^6 mod g(x)) + c1*x^5 + c2*x^4 + c3*x^3 + c4*x^2 + c5*x + v_i
  189|       |        // If we call (x^6 mod g(x)) = k(x), this can be written as
  190|       |        // c'(x) = (c1*x^5 + c2*x^4 + c3*x^3 + c4*x^2 + c5*x + v_i) + c0*k(x)
  191|       |
  192|       |        // First, determine the value of c0:
  193|  23.4k|        uint8_t c0 = c >> 25;
  194|       |
  195|       |        // Then compute c1*x^5 + c2*x^4 + c3*x^3 + c4*x^2 + c5*x + v_i:
  196|  23.4k|        c = ((c & 0x1ffffff) << 5) ^ v_i;
  197|       |
  198|       |        // Finally, for each set bit n in c0, conditionally add {2^n}k(x). These constants can be
  199|       |        // computed using the following Sage code (continuing the code above):
  200|       |        //
  201|       |        // for i in [1,2,4,8,16]: # Print out {1,2,4,8,16}*(g(x) mod x^6), packed in hex integers.
  202|       |        //     v = 0
  203|       |        //     for coef in reversed((F.fetch_int(i)*(G % x**6)).coefficients(sparse=True)):
  204|       |        //         v = v*32 + coef.integer_representation()
  205|       |        //     print("0x%x" % v)
  206|       |        //
  207|  23.4k|        if (c0 & 1)  c ^= 0x3b6a57b2; //     k(x) = {29}x^5 + {22}x^4 + {20}x^3 + {21}x^2 + {29}x + {18}
  ------------------
  |  Branch (207:13): [True: 9.51k, False: 13.9k]
  ------------------
  208|  23.4k|        if (c0 & 2)  c ^= 0x26508e6d; //  {2}k(x) = {19}x^5 +  {5}x^4 +     x^3 +  {3}x^2 + {19}x + {13}
  ------------------
  |  Branch (208:13): [True: 10.0k, False: 13.3k]
  ------------------
  209|  23.4k|        if (c0 & 4)  c ^= 0x1ea119fa; //  {4}k(x) = {15}x^5 + {10}x^4 +  {2}x^3 +  {6}x^2 + {15}x + {26}
  ------------------
  |  Branch (209:13): [True: 9.85k, False: 13.5k]
  ------------------
  210|  23.4k|        if (c0 & 8)  c ^= 0x3d4233dd; //  {8}k(x) = {30}x^5 + {20}x^4 +  {4}x^3 + {12}x^2 + {30}x + {29}
  ------------------
  |  Branch (210:13): [True: 10.2k, False: 13.1k]
  ------------------
  211|  23.4k|        if (c0 & 16) c ^= 0x2a1462b3; // {16}k(x) = {21}x^5 +     x^4 +  {8}x^3 + {24}x^2 + {21}x + {19}
  ------------------
  |  Branch (211:13): [True: 9.88k, False: 13.5k]
  ------------------
  212|       |
  213|  23.4k|    }
  214|    631|    return c;
  215|    631|}
bech32.cpp:_ZN6bech3212_GLOBAL__N_116EncodingConstantENS_8EncodingE:
  121|    843|uint32_t EncodingConstant(Encoding encoding) {
  122|    843|    assert(encoding == Encoding::BECH32 || encoding == Encoding::BECH32M);
  ------------------
  |  Branch (122:5): [True: 424, False: 419]
  |  Branch (122:5): [True: 419, False: 0]
  |  Branch (122:5): [True: 843, False: 0]
  ------------------
  123|    843|    return encoding == Encoding::BECH32 ? 1 : 0x2bc830a3;
  ------------------
  |  Branch (123:12): [True: 424, False: 419]
  ------------------
  124|    843|}
bech32.cpp:_ZN6bech3212_GLOBAL__N_18SyndromeEj:
  260|    414|uint32_t Syndrome(const uint32_t residue) {
  261|       |    // low is the first 5 bits, corresponding to the r6 in the residue
  262|       |    // (the constant term of the polynomial).
  263|    414|    uint32_t low = residue & 0x1f;
  264|       |
  265|       |    // We begin by setting s_j = low = r6 for all three values of j, because these are unconditional.
  266|    414|    uint32_t result = low ^ (low << 10) ^ (low << 20);
  267|       |
  268|       |    // Then for each following bit, we add the corresponding precomputed constant if the bit is 1.
  269|       |    // For example, 0x31edd3c4 is 1100011110 1101110100 1111000100 when unpacked in groups of 10
  270|       |    // bits, corresponding exactly to a^999 || a^998 || a^997 (matching the corresponding values in
  271|       |    // GF1024_EXP above). In this way, we compute all three values of s_j for j in (997, 998, 999)
  272|       |    // simultaneously. Recall that XOR corresponds to addition in a characteristic 2 field.
  273|  10.7k|    for (int i = 0; i < 25; ++i) {
  ------------------
  |  Branch (273:21): [True: 10.3k, False: 414]
  ------------------
  274|  10.3k|        result ^= ((residue >> (5+i)) & 1 ? SYNDROME_CONSTS.at(i) : 0);
  ------------------
  |  Branch (274:20): [True: 4.93k, False: 5.41k]
  ------------------
  275|  10.3k|    }
  276|    414|    return result;
  277|    414|}

_ZN6bech3212DecodeResultC2Ev:
   54|    344|    DecodeResult() : encoding(Encoding::INVALID) {}
_ZN6bech3212DecodeResultC2ENS_8EncodingEONSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEONS2_6vectorIhNS6_IhEEEE:
   55|     10|    DecodeResult(Encoding enc, std::string&& h, std::vector<uint8_t>&& d) : encoding(enc), hrp(std::move(h)), data(std::move(d)) {}

_Z6Paramsv:
  128|  1.42M|const CChainParams &Params() {
  129|  1.42M|    assert(globalChainParams);
  ------------------
  |  Branch (129:5): [True: 1.42M, False: 0]
  ------------------
  130|  1.42M|    return *globalChainParams;
  131|  1.42M|}

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

_Z17internal_bswap_32j:
   54|   376M|{
   55|   376M|#ifdef bitcoin_builtin_bswap32
   56|   376M|    return bitcoin_builtin_bswap32(x);
  ------------------
  |  |   24|   376M|#      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|   376M|}
_Z17internal_bswap_64m:
   64|   227M|{
   65|   227M|#ifdef bitcoin_builtin_bswap64
   66|   227M|    return bitcoin_builtin_bswap64(x);
  ------------------
  |  |   27|   227M|#      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|   227M|}

_Z16htole16_internalt:
   19|  9.42k|{
   20|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_16(host_16bits);
   21|  9.42k|        else return host_16bits;
   22|  9.42k|}
_Z16le16toh_internalt:
   29|    177|{
   30|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_16(little_endian_16bits);
   31|    177|        else return little_endian_16bits;
   32|    177|}
_Z16be32toh_internalj:
   44|   257M|{
   45|   257M|    if constexpr (std::endian::native == std::endian::little) return internal_bswap_32(big_endian_32bits);
   46|       |        else return big_endian_32bits;
   47|   257M|}
_Z16htobe32_internalj:
   34|   119M|{
   35|   119M|    if constexpr (std::endian::native == std::endian::little) return internal_bswap_32(host_32bits);
   36|       |        else return host_32bits;
   37|   119M|}
_Z16htole64_internalm:
   59|  11.4M|{
   60|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_64(host_64bits);
   61|  11.4M|        else return host_64bits;
   62|  11.4M|}
_Z16be64toh_internalm:
   64|   166M|{
   65|   166M|    if constexpr (std::endian::native == std::endian::little) return internal_bswap_64(big_endian_64bits);
   66|       |        else return big_endian_64bits;
   67|   166M|}
_Z16htobe64_internalm:
   54|  61.2M|{
   55|  61.2M|    if constexpr (std::endian::native == std::endian::little) return internal_bswap_64(host_64bits);
   56|       |        else return host_64bits;
   57|  61.2M|}
_Z16htole32_internalj:
   39|  57.0M|{
   40|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_32(host_32bits);
   41|  57.0M|        else return host_32bits;
   42|  57.0M|}
_Z16le32toh_internalj:
   49|   182M|{
   50|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_32(little_endian_32bits);
   51|   182M|        else return little_endian_32bits;
   52|   182M|}

_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|}

_Z8ReadLE16ITk8ByteTypehEtPKT_:
   20|    177|{
   21|    177|    uint16_t x;
   22|    177|    memcpy(&x, ptr, 2);
   23|    177|    return le16toh_internal(x);
   24|    177|}
_Z8ReadLE32ITk8ByteTypehEjPKT_:
   28|   182M|{
   29|   182M|    uint32_t x;
   30|   182M|    memcpy(&x, ptr, 4);
   31|   182M|    return le32toh_internal(x);
   32|   182M|}
_Z9WriteLE32ITk8ByteTypehEvPT_j:
   51|  57.0M|{
   52|  57.0M|    uint32_t v = htole32_internal(x);
   53|  57.0M|    memcpy(ptr, &v, 4);
   54|  57.0M|}
_Z8ReadBE32ITk8ByteTypehEjPKT_:
   73|   257M|{
   74|   257M|    uint32_t x;
   75|   257M|    memcpy(&x, ptr, 4);
   76|   257M|    return be32toh_internal(x);
   77|   257M|}
_Z9WriteBE32ITk8ByteTypehEvPT_j:
   96|   119M|{
   97|   119M|    uint32_t v = htobe32_internal(x);
   98|   119M|    memcpy(ptr, &v, 4);
   99|   119M|}
_Z9WriteLE64ITk8ByteTypehEvPT_m:
   58|  11.4M|{
   59|  11.4M|    uint64_t v = htole64_internal(x);
   60|  11.4M|    memcpy(ptr, &v, 8);
   61|  11.4M|}
_Z8ReadBE64ITk8ByteTypehEmPKT_:
   81|   166M|{
   82|   166M|    uint64_t x;
   83|   166M|    memcpy(&x, ptr, 8);
   84|   166M|    return be64toh_internal(x);
   85|   166M|}
_Z9WriteBE64ITk8ByteTypehEvPT_m:
  103|  61.2M|{
  104|  61.2M|    uint64_t v = htobe64_internal(x);
  105|  61.2M|    memcpy(ptr, &v, 8);
  106|  61.2M|}

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

_ZN12CHMAC_SHA512C2EPKhm:
   13|  2.60M|{
   14|  2.60M|    unsigned char rkey[128];
   15|  2.60M|    if (keylen <= 128) {
  ------------------
  |  Branch (15:9): [True: 2.60M, False: 0]
  ------------------
   16|  2.60M|        memcpy(rkey, key, keylen);
   17|  2.60M|        memset(rkey + keylen, 0, 128 - keylen);
   18|  2.60M|    } else {
   19|      0|        CSHA512().Write(key, keylen).Finalize(rkey);
   20|      0|        memset(rkey + 64, 0, 64);
   21|      0|    }
   22|       |
   23|   335M|    for (int n = 0; n < 128; n++)
  ------------------
  |  Branch (23:21): [True: 333M, False: 2.60M]
  ------------------
   24|   333M|        rkey[n] ^= 0x5c;
   25|  2.60M|    outer.Write(rkey, 128);
   26|       |
   27|   335M|    for (int n = 0; n < 128; n++)
  ------------------
  |  Branch (27:21): [True: 333M, False: 2.60M]
  ------------------
   28|   333M|        rkey[n] ^= 0x5c ^ 0x36;
   29|  2.60M|    inner.Write(rkey, 128);
   30|       |
   31|  2.60M|    memory_cleanse(rkey, sizeof(rkey));
   32|  2.60M|}
_ZN12CHMAC_SHA5128FinalizeEPh:
   35|  2.60M|{
   36|  2.60M|    unsigned char temp[64];
   37|  2.60M|    inner.Finalize(temp);
   38|  2.60M|    outer.Write(temp, 64).Finalize(hash);
   39|  2.60M|    memory_cleanse(temp, sizeof(temp));
   40|  2.60M|}

_ZN12CHMAC_SHA5125WriteEPKhm:
   24|  7.80M|    {
   25|  7.80M|        inner.Write(data, len);
   26|  7.80M|        return *this;
   27|  7.80M|    }

_ZN10CRIPEMD160C2Ev:
  243|  11.4M|{
  244|  11.4M|    ripemd160::Initialize(s);
  245|  11.4M|}
_ZN10CRIPEMD1605WriteEPKhm:
  248|  34.2M|{
  249|  34.2M|    const unsigned char* end = data + len;
  250|  34.2M|    size_t bufsize = bytes % 64;
  251|  34.2M|    if (bufsize && bufsize + len >= 64) {
  ------------------
  |  Branch (251:9): [True: 22.8M, False: 11.4M]
  |  Branch (251:20): [True: 11.4M, False: 11.4M]
  ------------------
  252|       |        // Fill the buffer, and process it.
  253|  11.4M|        memcpy(buf + bufsize, data, 64 - bufsize);
  254|  11.4M|        bytes += 64 - bufsize;
  255|  11.4M|        data += 64 - bufsize;
  256|  11.4M|        ripemd160::Transform(s, buf);
  257|  11.4M|        bufsize = 0;
  258|  11.4M|    }
  259|  34.2M|    while (end - data >= 64) {
  ------------------
  |  Branch (259:12): [True: 0, False: 34.2M]
  ------------------
  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|  34.2M|    if (end > data) {
  ------------------
  |  Branch (265:9): [True: 22.8M, False: 11.4M]
  ------------------
  266|       |        // Fill the buffer with what remains.
  267|  22.8M|        memcpy(buf + bufsize, data, end - data);
  268|  22.8M|        bytes += end - data;
  269|  22.8M|    }
  270|  34.2M|    return *this;
  271|  34.2M|}
_ZN10CRIPEMD1608FinalizeEPh:
  274|  11.4M|{
  275|  11.4M|    static const unsigned char pad[64] = {0x80};
  276|  11.4M|    unsigned char sizedesc[8];
  277|  11.4M|    WriteLE64(sizedesc, bytes << 3);
  278|  11.4M|    Write(pad, 1 + ((119 - (bytes % 64)) % 64));
  279|  11.4M|    Write(sizedesc, 8);
  280|  11.4M|    WriteLE32(hash, s[0]);
  281|  11.4M|    WriteLE32(hash + 4, s[1]);
  282|  11.4M|    WriteLE32(hash + 8, s[2]);
  283|  11.4M|    WriteLE32(hash + 12, s[3]);
  284|  11.4M|    WriteLE32(hash + 16, s[4]);
  285|  11.4M|}
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd16010InitializeEPj:
   25|  11.4M|{
   26|  11.4M|    s[0] = 0x67452301ul;
   27|  11.4M|    s[1] = 0xEFCDAB89ul;
   28|  11.4M|    s[2] = 0x98BADCFEul;
   29|  11.4M|    s[3] = 0x10325476ul;
   30|  11.4M|    s[4] = 0xC3D2E1F0ul;
   31|  11.4M|}
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd1609TransformEPjPKh:
   55|  11.4M|{
   56|  11.4M|    uint32_t a1 = s[0], b1 = s[1], c1 = s[2], d1 = s[3], e1 = s[4];
   57|  11.4M|    uint32_t a2 = a1, b2 = b1, c2 = c1, d2 = d1, e2 = e1;
   58|  11.4M|    uint32_t w0 = ReadLE32(chunk + 0), w1 = ReadLE32(chunk + 4), w2 = ReadLE32(chunk + 8), w3 = ReadLE32(chunk + 12);
   59|  11.4M|    uint32_t w4 = ReadLE32(chunk + 16), w5 = ReadLE32(chunk + 20), w6 = ReadLE32(chunk + 24), w7 = ReadLE32(chunk + 28);
   60|  11.4M|    uint32_t w8 = ReadLE32(chunk + 32), w9 = ReadLE32(chunk + 36), w10 = ReadLE32(chunk + 40), w11 = ReadLE32(chunk + 44);
   61|  11.4M|    uint32_t w12 = ReadLE32(chunk + 48), w13 = ReadLE32(chunk + 52), w14 = ReadLE32(chunk + 56), w15 = ReadLE32(chunk + 60);
   62|       |
   63|  11.4M|    R11(a1, b1, c1, d1, e1, w0, 11);
   64|  11.4M|    R12(a2, b2, c2, d2, e2, w5, 8);
   65|  11.4M|    R11(e1, a1, b1, c1, d1, w1, 14);
   66|  11.4M|    R12(e2, a2, b2, c2, d2, w14, 9);
   67|  11.4M|    R11(d1, e1, a1, b1, c1, w2, 15);
   68|  11.4M|    R12(d2, e2, a2, b2, c2, w7, 9);
   69|  11.4M|    R11(c1, d1, e1, a1, b1, w3, 12);
   70|  11.4M|    R12(c2, d2, e2, a2, b2, w0, 11);
   71|  11.4M|    R11(b1, c1, d1, e1, a1, w4, 5);
   72|  11.4M|    R12(b2, c2, d2, e2, a2, w9, 13);
   73|  11.4M|    R11(a1, b1, c1, d1, e1, w5, 8);
   74|  11.4M|    R12(a2, b2, c2, d2, e2, w2, 15);
   75|  11.4M|    R11(e1, a1, b1, c1, d1, w6, 7);
   76|  11.4M|    R12(e2, a2, b2, c2, d2, w11, 15);
   77|  11.4M|    R11(d1, e1, a1, b1, c1, w7, 9);
   78|  11.4M|    R12(d2, e2, a2, b2, c2, w4, 5);
   79|  11.4M|    R11(c1, d1, e1, a1, b1, w8, 11);
   80|  11.4M|    R12(c2, d2, e2, a2, b2, w13, 7);
   81|  11.4M|    R11(b1, c1, d1, e1, a1, w9, 13);
   82|  11.4M|    R12(b2, c2, d2, e2, a2, w6, 7);
   83|  11.4M|    R11(a1, b1, c1, d1, e1, w10, 14);
   84|  11.4M|    R12(a2, b2, c2, d2, e2, w15, 8);
   85|  11.4M|    R11(e1, a1, b1, c1, d1, w11, 15);
   86|  11.4M|    R12(e2, a2, b2, c2, d2, w8, 11);
   87|  11.4M|    R11(d1, e1, a1, b1, c1, w12, 6);
   88|  11.4M|    R12(d2, e2, a2, b2, c2, w1, 14);
   89|  11.4M|    R11(c1, d1, e1, a1, b1, w13, 7);
   90|  11.4M|    R12(c2, d2, e2, a2, b2, w10, 14);
   91|  11.4M|    R11(b1, c1, d1, e1, a1, w14, 9);
   92|  11.4M|    R12(b2, c2, d2, e2, a2, w3, 12);
   93|  11.4M|    R11(a1, b1, c1, d1, e1, w15, 8);
   94|  11.4M|    R12(a2, b2, c2, d2, e2, w12, 6);
   95|       |
   96|  11.4M|    R21(e1, a1, b1, c1, d1, w7, 7);
   97|  11.4M|    R22(e2, a2, b2, c2, d2, w6, 9);
   98|  11.4M|    R21(d1, e1, a1, b1, c1, w4, 6);
   99|  11.4M|    R22(d2, e2, a2, b2, c2, w11, 13);
  100|  11.4M|    R21(c1, d1, e1, a1, b1, w13, 8);
  101|  11.4M|    R22(c2, d2, e2, a2, b2, w3, 15);
  102|  11.4M|    R21(b1, c1, d1, e1, a1, w1, 13);
  103|  11.4M|    R22(b2, c2, d2, e2, a2, w7, 7);
  104|  11.4M|    R21(a1, b1, c1, d1, e1, w10, 11);
  105|  11.4M|    R22(a2, b2, c2, d2, e2, w0, 12);
  106|  11.4M|    R21(e1, a1, b1, c1, d1, w6, 9);
  107|  11.4M|    R22(e2, a2, b2, c2, d2, w13, 8);
  108|  11.4M|    R21(d1, e1, a1, b1, c1, w15, 7);
  109|  11.4M|    R22(d2, e2, a2, b2, c2, w5, 9);
  110|  11.4M|    R21(c1, d1, e1, a1, b1, w3, 15);
  111|  11.4M|    R22(c2, d2, e2, a2, b2, w10, 11);
  112|  11.4M|    R21(b1, c1, d1, e1, a1, w12, 7);
  113|  11.4M|    R22(b2, c2, d2, e2, a2, w14, 7);
  114|  11.4M|    R21(a1, b1, c1, d1, e1, w0, 12);
  115|  11.4M|    R22(a2, b2, c2, d2, e2, w15, 7);
  116|  11.4M|    R21(e1, a1, b1, c1, d1, w9, 15);
  117|  11.4M|    R22(e2, a2, b2, c2, d2, w8, 12);
  118|  11.4M|    R21(d1, e1, a1, b1, c1, w5, 9);
  119|  11.4M|    R22(d2, e2, a2, b2, c2, w12, 7);
  120|  11.4M|    R21(c1, d1, e1, a1, b1, w2, 11);
  121|  11.4M|    R22(c2, d2, e2, a2, b2, w4, 6);
  122|  11.4M|    R21(b1, c1, d1, e1, a1, w14, 7);
  123|  11.4M|    R22(b2, c2, d2, e2, a2, w9, 15);
  124|  11.4M|    R21(a1, b1, c1, d1, e1, w11, 13);
  125|  11.4M|    R22(a2, b2, c2, d2, e2, w1, 13);
  126|  11.4M|    R21(e1, a1, b1, c1, d1, w8, 12);
  127|  11.4M|    R22(e2, a2, b2, c2, d2, w2, 11);
  128|       |
  129|  11.4M|    R31(d1, e1, a1, b1, c1, w3, 11);
  130|  11.4M|    R32(d2, e2, a2, b2, c2, w15, 9);
  131|  11.4M|    R31(c1, d1, e1, a1, b1, w10, 13);
  132|  11.4M|    R32(c2, d2, e2, a2, b2, w5, 7);
  133|  11.4M|    R31(b1, c1, d1, e1, a1, w14, 6);
  134|  11.4M|    R32(b2, c2, d2, e2, a2, w1, 15);
  135|  11.4M|    R31(a1, b1, c1, d1, e1, w4, 7);
  136|  11.4M|    R32(a2, b2, c2, d2, e2, w3, 11);
  137|  11.4M|    R31(e1, a1, b1, c1, d1, w9, 14);
  138|  11.4M|    R32(e2, a2, b2, c2, d2, w7, 8);
  139|  11.4M|    R31(d1, e1, a1, b1, c1, w15, 9);
  140|  11.4M|    R32(d2, e2, a2, b2, c2, w14, 6);
  141|  11.4M|    R31(c1, d1, e1, a1, b1, w8, 13);
  142|  11.4M|    R32(c2, d2, e2, a2, b2, w6, 6);
  143|  11.4M|    R31(b1, c1, d1, e1, a1, w1, 15);
  144|  11.4M|    R32(b2, c2, d2, e2, a2, w9, 14);
  145|  11.4M|    R31(a1, b1, c1, d1, e1, w2, 14);
  146|  11.4M|    R32(a2, b2, c2, d2, e2, w11, 12);
  147|  11.4M|    R31(e1, a1, b1, c1, d1, w7, 8);
  148|  11.4M|    R32(e2, a2, b2, c2, d2, w8, 13);
  149|  11.4M|    R31(d1, e1, a1, b1, c1, w0, 13);
  150|  11.4M|    R32(d2, e2, a2, b2, c2, w12, 5);
  151|  11.4M|    R31(c1, d1, e1, a1, b1, w6, 6);
  152|  11.4M|    R32(c2, d2, e2, a2, b2, w2, 14);
  153|  11.4M|    R31(b1, c1, d1, e1, a1, w13, 5);
  154|  11.4M|    R32(b2, c2, d2, e2, a2, w10, 13);
  155|  11.4M|    R31(a1, b1, c1, d1, e1, w11, 12);
  156|  11.4M|    R32(a2, b2, c2, d2, e2, w0, 13);
  157|  11.4M|    R31(e1, a1, b1, c1, d1, w5, 7);
  158|  11.4M|    R32(e2, a2, b2, c2, d2, w4, 7);
  159|  11.4M|    R31(d1, e1, a1, b1, c1, w12, 5);
  160|  11.4M|    R32(d2, e2, a2, b2, c2, w13, 5);
  161|       |
  162|  11.4M|    R41(c1, d1, e1, a1, b1, w1, 11);
  163|  11.4M|    R42(c2, d2, e2, a2, b2, w8, 15);
  164|  11.4M|    R41(b1, c1, d1, e1, a1, w9, 12);
  165|  11.4M|    R42(b2, c2, d2, e2, a2, w6, 5);
  166|  11.4M|    R41(a1, b1, c1, d1, e1, w11, 14);
  167|  11.4M|    R42(a2, b2, c2, d2, e2, w4, 8);
  168|  11.4M|    R41(e1, a1, b1, c1, d1, w10, 15);
  169|  11.4M|    R42(e2, a2, b2, c2, d2, w1, 11);
  170|  11.4M|    R41(d1, e1, a1, b1, c1, w0, 14);
  171|  11.4M|    R42(d2, e2, a2, b2, c2, w3, 14);
  172|  11.4M|    R41(c1, d1, e1, a1, b1, w8, 15);
  173|  11.4M|    R42(c2, d2, e2, a2, b2, w11, 14);
  174|  11.4M|    R41(b1, c1, d1, e1, a1, w12, 9);
  175|  11.4M|    R42(b2, c2, d2, e2, a2, w15, 6);
  176|  11.4M|    R41(a1, b1, c1, d1, e1, w4, 8);
  177|  11.4M|    R42(a2, b2, c2, d2, e2, w0, 14);
  178|  11.4M|    R41(e1, a1, b1, c1, d1, w13, 9);
  179|  11.4M|    R42(e2, a2, b2, c2, d2, w5, 6);
  180|  11.4M|    R41(d1, e1, a1, b1, c1, w3, 14);
  181|  11.4M|    R42(d2, e2, a2, b2, c2, w12, 9);
  182|  11.4M|    R41(c1, d1, e1, a1, b1, w7, 5);
  183|  11.4M|    R42(c2, d2, e2, a2, b2, w2, 12);
  184|  11.4M|    R41(b1, c1, d1, e1, a1, w15, 6);
  185|  11.4M|    R42(b2, c2, d2, e2, a2, w13, 9);
  186|  11.4M|    R41(a1, b1, c1, d1, e1, w14, 8);
  187|  11.4M|    R42(a2, b2, c2, d2, e2, w9, 12);
  188|  11.4M|    R41(e1, a1, b1, c1, d1, w5, 6);
  189|  11.4M|    R42(e2, a2, b2, c2, d2, w7, 5);
  190|  11.4M|    R41(d1, e1, a1, b1, c1, w6, 5);
  191|  11.4M|    R42(d2, e2, a2, b2, c2, w10, 15);
  192|  11.4M|    R41(c1, d1, e1, a1, b1, w2, 12);
  193|  11.4M|    R42(c2, d2, e2, a2, b2, w14, 8);
  194|       |
  195|  11.4M|    R51(b1, c1, d1, e1, a1, w4, 9);
  196|  11.4M|    R52(b2, c2, d2, e2, a2, w12, 8);
  197|  11.4M|    R51(a1, b1, c1, d1, e1, w0, 15);
  198|  11.4M|    R52(a2, b2, c2, d2, e2, w15, 5);
  199|  11.4M|    R51(e1, a1, b1, c1, d1, w5, 5);
  200|  11.4M|    R52(e2, a2, b2, c2, d2, w10, 12);
  201|  11.4M|    R51(d1, e1, a1, b1, c1, w9, 11);
  202|  11.4M|    R52(d2, e2, a2, b2, c2, w4, 9);
  203|  11.4M|    R51(c1, d1, e1, a1, b1, w7, 6);
  204|  11.4M|    R52(c2, d2, e2, a2, b2, w1, 12);
  205|  11.4M|    R51(b1, c1, d1, e1, a1, w12, 8);
  206|  11.4M|    R52(b2, c2, d2, e2, a2, w5, 5);
  207|  11.4M|    R51(a1, b1, c1, d1, e1, w2, 13);
  208|  11.4M|    R52(a2, b2, c2, d2, e2, w8, 14);
  209|  11.4M|    R51(e1, a1, b1, c1, d1, w10, 12);
  210|  11.4M|    R52(e2, a2, b2, c2, d2, w7, 6);
  211|  11.4M|    R51(d1, e1, a1, b1, c1, w14, 5);
  212|  11.4M|    R52(d2, e2, a2, b2, c2, w6, 8);
  213|  11.4M|    R51(c1, d1, e1, a1, b1, w1, 12);
  214|  11.4M|    R52(c2, d2, e2, a2, b2, w2, 13);
  215|  11.4M|    R51(b1, c1, d1, e1, a1, w3, 13);
  216|  11.4M|    R52(b2, c2, d2, e2, a2, w13, 6);
  217|  11.4M|    R51(a1, b1, c1, d1, e1, w8, 14);
  218|  11.4M|    R52(a2, b2, c2, d2, e2, w14, 5);
  219|  11.4M|    R51(e1, a1, b1, c1, d1, w11, 11);
  220|  11.4M|    R52(e2, a2, b2, c2, d2, w0, 15);
  221|  11.4M|    R51(d1, e1, a1, b1, c1, w6, 8);
  222|  11.4M|    R52(d2, e2, a2, b2, c2, w3, 13);
  223|  11.4M|    R51(c1, d1, e1, a1, b1, w15, 5);
  224|  11.4M|    R52(c2, d2, e2, a2, b2, w9, 11);
  225|  11.4M|    R51(b1, c1, d1, e1, a1, w13, 6);
  226|  11.4M|    R52(b2, c2, d2, e2, a2, w11, 11);
  227|       |
  228|  11.4M|    uint32_t t = s[0];
  229|  11.4M|    s[0] = s[1] + c1 + d2;
  230|  11.4M|    s[1] = s[2] + d1 + e2;
  231|  11.4M|    s[2] = s[3] + e1 + a2;
  232|  11.4M|    s[3] = s[4] + a1 + b2;
  233|  11.4M|    s[4] = t + b1 + c2;
  234|  11.4M|}
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd1603R11ERjjS1_jjji:
   41|   182M|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|  1.82G|{
   37|  1.82G|    a = rol(a + f + x + k, r) + e;
   38|  1.82G|    c = rol(c, 10);
   39|  1.82G|}
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd1603rolEji:
   33|  3.65G|uint32_t inline rol(uint32_t x, int i) { return (x << i) | (x >> (32 - i)); }
ripemd160.cpp:_ZN12_GLOBAL__N_19ripemd1602f1Ejjj:
   17|   365M|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|   182M|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|   365M|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|   182M|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|   365M|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|   182M|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|   365M|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|   182M|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|   365M|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|   182M|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|   182M|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|   182M|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|   182M|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|   182M|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|  12.8M|{
  696|  12.8M|    sha256::Initialize(s);
  697|  12.8M|}
_ZN7CSHA2565WriteEPKhm:
  700|  43.3M|{
  701|  43.3M|    const unsigned char* end = data + len;
  702|  43.3M|    size_t bufsize = bytes % 64;
  703|  43.3M|    if (bufsize && bufsize + len >= 64) {
  ------------------
  |  Branch (703:9): [True: 28.8M, False: 14.4M]
  |  Branch (703:20): [True: 14.4M, False: 14.3M]
  ------------------
  704|       |        // Fill the buffer, and process it.
  705|  14.4M|        memcpy(buf + bufsize, data, 64 - bufsize);
  706|  14.4M|        bytes += 64 - bufsize;
  707|  14.4M|        data += 64 - bufsize;
  708|  14.4M|        Transform(s, buf, 1);
  709|  14.4M|        bufsize = 0;
  710|  14.4M|    }
  711|  43.3M|    if (end - data >= 64) {
  ------------------
  |  Branch (711:9): [True: 1.44M, False: 41.9M]
  ------------------
  712|  1.44M|        size_t blocks = (end - data) / 64;
  713|  1.44M|        Transform(s, data, blocks);
  714|  1.44M|        data += 64 * blocks;
  715|  1.44M|        bytes += 64 * blocks;
  716|  1.44M|    }
  717|  43.3M|    if (end > data) {
  ------------------
  |  Branch (717:9): [True: 28.8M, False: 14.4M]
  ------------------
  718|       |        // Fill the buffer with what remains.
  719|  28.8M|        memcpy(buf + bufsize, data, end - data);
  720|  28.8M|        bytes += end - data;
  721|  28.8M|    }
  722|  43.3M|    return *this;
  723|  43.3M|}
_ZN7CSHA2568FinalizeEPh:
  726|  14.4M|{
  727|  14.4M|    static const unsigned char pad[64] = {0x80};
  728|  14.4M|    unsigned char sizedesc[8];
  729|  14.4M|    WriteBE64(sizedesc, bytes << 3);
  730|  14.4M|    Write(pad, 1 + ((119 - (bytes % 64)) % 64));
  731|  14.4M|    Write(sizedesc, 8);
  732|  14.4M|    WriteBE32(hash, s[0]);
  733|  14.4M|    WriteBE32(hash + 4, s[1]);
  734|  14.4M|    WriteBE32(hash + 8, s[2]);
  735|  14.4M|    WriteBE32(hash + 12, s[3]);
  736|  14.4M|    WriteBE32(hash + 16, s[4]);
  737|  14.4M|    WriteBE32(hash + 20, s[5]);
  738|  14.4M|    WriteBE32(hash + 24, s[6]);
  739|  14.4M|    WriteBE32(hash + 28, s[7]);
  740|  14.4M|}
_ZN7CSHA2565ResetEv:
  743|  1.42M|{
  744|  1.42M|    bytes = 0;
  745|  1.42M|    sha256::Initialize(s);
  746|  1.42M|    return *this;
  747|  1.42M|}
sha256.cpp:_ZN12_GLOBAL__N_16sha2569TransformEPjPKhm:
  100|  15.9M|{
  101|  32.0M|    while (blocks--) {
  ------------------
  |  Branch (101:12): [True: 16.1M, False: 15.9M]
  ------------------
  102|  16.1M|        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|  16.1M|        uint32_t w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15;
  104|       |
  105|  16.1M|        Round(a, b, c, d, e, f, g, h, 0x428a2f98 + (w0 = ReadBE32(chunk + 0)));
  106|  16.1M|        Round(h, a, b, c, d, e, f, g, 0x71374491 + (w1 = ReadBE32(chunk + 4)));
  107|  16.1M|        Round(g, h, a, b, c, d, e, f, 0xb5c0fbcf + (w2 = ReadBE32(chunk + 8)));
  108|  16.1M|        Round(f, g, h, a, b, c, d, e, 0xe9b5dba5 + (w3 = ReadBE32(chunk + 12)));
  109|  16.1M|        Round(e, f, g, h, a, b, c, d, 0x3956c25b + (w4 = ReadBE32(chunk + 16)));
  110|  16.1M|        Round(d, e, f, g, h, a, b, c, 0x59f111f1 + (w5 = ReadBE32(chunk + 20)));
  111|  16.1M|        Round(c, d, e, f, g, h, a, b, 0x923f82a4 + (w6 = ReadBE32(chunk + 24)));
  112|  16.1M|        Round(b, c, d, e, f, g, h, a, 0xab1c5ed5 + (w7 = ReadBE32(chunk + 28)));
  113|  16.1M|        Round(a, b, c, d, e, f, g, h, 0xd807aa98 + (w8 = ReadBE32(chunk + 32)));
  114|  16.1M|        Round(h, a, b, c, d, e, f, g, 0x12835b01 + (w9 = ReadBE32(chunk + 36)));
  115|  16.1M|        Round(g, h, a, b, c, d, e, f, 0x243185be + (w10 = ReadBE32(chunk + 40)));
  116|  16.1M|        Round(f, g, h, a, b, c, d, e, 0x550c7dc3 + (w11 = ReadBE32(chunk + 44)));
  117|  16.1M|        Round(e, f, g, h, a, b, c, d, 0x72be5d74 + (w12 = ReadBE32(chunk + 48)));
  118|  16.1M|        Round(d, e, f, g, h, a, b, c, 0x80deb1fe + (w13 = ReadBE32(chunk + 52)));
  119|  16.1M|        Round(c, d, e, f, g, h, a, b, 0x9bdc06a7 + (w14 = ReadBE32(chunk + 56)));
  120|  16.1M|        Round(b, c, d, e, f, g, h, a, 0xc19bf174 + (w15 = ReadBE32(chunk + 60)));
  121|       |
  122|  16.1M|        Round(a, b, c, d, e, f, g, h, 0xe49b69c1 + (w0 += sigma1(w14) + w9 + sigma0(w1)));
  123|  16.1M|        Round(h, a, b, c, d, e, f, g, 0xefbe4786 + (w1 += sigma1(w15) + w10 + sigma0(w2)));
  124|  16.1M|        Round(g, h, a, b, c, d, e, f, 0x0fc19dc6 + (w2 += sigma1(w0) + w11 + sigma0(w3)));
  125|  16.1M|        Round(f, g, h, a, b, c, d, e, 0x240ca1cc + (w3 += sigma1(w1) + w12 + sigma0(w4)));
  126|  16.1M|        Round(e, f, g, h, a, b, c, d, 0x2de92c6f + (w4 += sigma1(w2) + w13 + sigma0(w5)));
  127|  16.1M|        Round(d, e, f, g, h, a, b, c, 0x4a7484aa + (w5 += sigma1(w3) + w14 + sigma0(w6)));
  128|  16.1M|        Round(c, d, e, f, g, h, a, b, 0x5cb0a9dc + (w6 += sigma1(w4) + w15 + sigma0(w7)));
  129|  16.1M|        Round(b, c, d, e, f, g, h, a, 0x76f988da + (w7 += sigma1(w5) + w0 + sigma0(w8)));
  130|  16.1M|        Round(a, b, c, d, e, f, g, h, 0x983e5152 + (w8 += sigma1(w6) + w1 + sigma0(w9)));
  131|  16.1M|        Round(h, a, b, c, d, e, f, g, 0xa831c66d + (w9 += sigma1(w7) + w2 + sigma0(w10)));
  132|  16.1M|        Round(g, h, a, b, c, d, e, f, 0xb00327c8 + (w10 += sigma1(w8) + w3 + sigma0(w11)));
  133|  16.1M|        Round(f, g, h, a, b, c, d, e, 0xbf597fc7 + (w11 += sigma1(w9) + w4 + sigma0(w12)));
  134|  16.1M|        Round(e, f, g, h, a, b, c, d, 0xc6e00bf3 + (w12 += sigma1(w10) + w5 + sigma0(w13)));
  135|  16.1M|        Round(d, e, f, g, h, a, b, c, 0xd5a79147 + (w13 += sigma1(w11) + w6 + sigma0(w14)));
  136|  16.1M|        Round(c, d, e, f, g, h, a, b, 0x06ca6351 + (w14 += sigma1(w12) + w7 + sigma0(w15)));
  137|  16.1M|        Round(b, c, d, e, f, g, h, a, 0x14292967 + (w15 += sigma1(w13) + w8 + sigma0(w0)));
  138|       |
  139|  16.1M|        Round(a, b, c, d, e, f, g, h, 0x27b70a85 + (w0 += sigma1(w14) + w9 + sigma0(w1)));
  140|  16.1M|        Round(h, a, b, c, d, e, f, g, 0x2e1b2138 + (w1 += sigma1(w15) + w10 + sigma0(w2)));
  141|  16.1M|        Round(g, h, a, b, c, d, e, f, 0x4d2c6dfc + (w2 += sigma1(w0) + w11 + sigma0(w3)));
  142|  16.1M|        Round(f, g, h, a, b, c, d, e, 0x53380d13 + (w3 += sigma1(w1) + w12 + sigma0(w4)));
  143|  16.1M|        Round(e, f, g, h, a, b, c, d, 0x650a7354 + (w4 += sigma1(w2) + w13 + sigma0(w5)));
  144|  16.1M|        Round(d, e, f, g, h, a, b, c, 0x766a0abb + (w5 += sigma1(w3) + w14 + sigma0(w6)));
  145|  16.1M|        Round(c, d, e, f, g, h, a, b, 0x81c2c92e + (w6 += sigma1(w4) + w15 + sigma0(w7)));
  146|  16.1M|        Round(b, c, d, e, f, g, h, a, 0x92722c85 + (w7 += sigma1(w5) + w0 + sigma0(w8)));
  147|  16.1M|        Round(a, b, c, d, e, f, g, h, 0xa2bfe8a1 + (w8 += sigma1(w6) + w1 + sigma0(w9)));
  148|  16.1M|        Round(h, a, b, c, d, e, f, g, 0xa81a664b + (w9 += sigma1(w7) + w2 + sigma0(w10)));
  149|  16.1M|        Round(g, h, a, b, c, d, e, f, 0xc24b8b70 + (w10 += sigma1(w8) + w3 + sigma0(w11)));
  150|  16.1M|        Round(f, g, h, a, b, c, d, e, 0xc76c51a3 + (w11 += sigma1(w9) + w4 + sigma0(w12)));
  151|  16.1M|        Round(e, f, g, h, a, b, c, d, 0xd192e819 + (w12 += sigma1(w10) + w5 + sigma0(w13)));
  152|  16.1M|        Round(d, e, f, g, h, a, b, c, 0xd6990624 + (w13 += sigma1(w11) + w6 + sigma0(w14)));
  153|  16.1M|        Round(c, d, e, f, g, h, a, b, 0xf40e3585 + (w14 += sigma1(w12) + w7 + sigma0(w15)));
  154|  16.1M|        Round(b, c, d, e, f, g, h, a, 0x106aa070 + (w15 += sigma1(w13) + w8 + sigma0(w0)));
  155|       |
  156|  16.1M|        Round(a, b, c, d, e, f, g, h, 0x19a4c116 + (w0 += sigma1(w14) + w9 + sigma0(w1)));
  157|  16.1M|        Round(h, a, b, c, d, e, f, g, 0x1e376c08 + (w1 += sigma1(w15) + w10 + sigma0(w2)));
  158|  16.1M|        Round(g, h, a, b, c, d, e, f, 0x2748774c + (w2 += sigma1(w0) + w11 + sigma0(w3)));
  159|  16.1M|        Round(f, g, h, a, b, c, d, e, 0x34b0bcb5 + (w3 += sigma1(w1) + w12 + sigma0(w4)));
  160|  16.1M|        Round(e, f, g, h, a, b, c, d, 0x391c0cb3 + (w4 += sigma1(w2) + w13 + sigma0(w5)));
  161|  16.1M|        Round(d, e, f, g, h, a, b, c, 0x4ed8aa4a + (w5 += sigma1(w3) + w14 + sigma0(w6)));
  162|  16.1M|        Round(c, d, e, f, g, h, a, b, 0x5b9cca4f + (w6 += sigma1(w4) + w15 + sigma0(w7)));
  163|  16.1M|        Round(b, c, d, e, f, g, h, a, 0x682e6ff3 + (w7 += sigma1(w5) + w0 + sigma0(w8)));
  164|  16.1M|        Round(a, b, c, d, e, f, g, h, 0x748f82ee + (w8 += sigma1(w6) + w1 + sigma0(w9)));
  165|  16.1M|        Round(h, a, b, c, d, e, f, g, 0x78a5636f + (w9 += sigma1(w7) + w2 + sigma0(w10)));
  166|  16.1M|        Round(g, h, a, b, c, d, e, f, 0x84c87814 + (w10 += sigma1(w8) + w3 + sigma0(w11)));
  167|  16.1M|        Round(f, g, h, a, b, c, d, e, 0x8cc70208 + (w11 += sigma1(w9) + w4 + sigma0(w12)));
  168|  16.1M|        Round(e, f, g, h, a, b, c, d, 0x90befffa + (w12 += sigma1(w10) + w5 + sigma0(w13)));
  169|  16.1M|        Round(d, e, f, g, h, a, b, c, 0xa4506ceb + (w13 += sigma1(w11) + w6 + sigma0(w14)));
  170|  16.1M|        Round(c, d, e, f, g, h, a, b, 0xbef9a3f7 + (w14 + sigma1(w12) + w7 + sigma0(w15)));
  171|  16.1M|        Round(b, c, d, e, f, g, h, a, 0xc67178f2 + (w15 + sigma1(w13) + w8 + sigma0(w0)));
  172|       |
  173|  16.1M|        s[0] += a;
  174|  16.1M|        s[1] += b;
  175|  16.1M|        s[2] += c;
  176|  16.1M|        s[3] += d;
  177|  16.1M|        s[4] += e;
  178|  16.1M|        s[5] += f;
  179|  16.1M|        s[6] += g;
  180|  16.1M|        s[7] += h;
  181|  16.1M|        chunk += 64;
  182|  16.1M|    }
  183|  15.9M|}
sha256.cpp:_ZN12_GLOBAL__N_16sha2565RoundEjjjRjjjjS1_j:
   78|  1.03G|{
   79|  1.03G|    uint32_t t1 = h + Sigma1(e) + Ch(e, f, g) + k;
   80|  1.03G|    uint32_t t2 = Sigma0(a) + Maj(a, b, c);
   81|  1.03G|    d += t1;
   82|  1.03G|    h = t1 + t2;
   83|  1.03G|}
sha256.cpp:_ZN12_GLOBAL__N_16sha2566Sigma1Ej:
   72|  1.03G|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|  1.03G|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|  1.03G|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|  1.03G|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|   773M|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|   773M|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|  14.2M|{
   88|  14.2M|    s[0] = 0x6a09e667ul;
   89|  14.2M|    s[1] = 0xbb67ae85ul;
   90|  14.2M|    s[2] = 0x3c6ef372ul;
   91|  14.2M|    s[3] = 0xa54ff53aul;
   92|  14.2M|    s[4] = 0x510e527ful;
   93|  14.2M|    s[5] = 0x9b05688cul;
   94|  14.2M|    s[6] = 0x1f83d9abul;
   95|  14.2M|    s[7] = 0x5be0cd19ul;
   96|  14.2M|}

_ZN7CSHA512C2Ev:
  155|  5.20M|{
  156|  5.20M|    sha512::Initialize(s);
  157|  5.20M|}
_ZN7CSHA5125WriteEPKhm:
  160|  26.0M|{
  161|  26.0M|    const unsigned char* end = data + len;
  162|  26.0M|    size_t bufsize = bytes % 128;
  163|  26.0M|    if (bufsize && bufsize + len >= 128) {
  ------------------
  |  Branch (163:9): [True: 15.6M, False: 10.4M]
  |  Branch (163:20): [True: 5.20M, False: 10.4M]
  ------------------
  164|       |        // Fill the buffer, and process it.
  165|  5.20M|        memcpy(buf + bufsize, data, 128 - bufsize);
  166|  5.20M|        bytes += 128 - bufsize;
  167|  5.20M|        data += 128 - bufsize;
  168|  5.20M|        sha512::Transform(s, buf);
  169|  5.20M|        bufsize = 0;
  170|  5.20M|    }
  171|  31.2M|    while (end - data >= 128) {
  ------------------
  |  Branch (171:12): [True: 5.20M, False: 26.0M]
  ------------------
  172|       |        // Process full chunks directly from the source.
  173|  5.20M|        sha512::Transform(s, data);
  174|  5.20M|        data += 128;
  175|  5.20M|        bytes += 128;
  176|  5.20M|    }
  177|  26.0M|    if (end > data) {
  ------------------
  |  Branch (177:9): [True: 15.6M, False: 10.4M]
  ------------------
  178|       |        // Fill the buffer with what remains.
  179|  15.6M|        memcpy(buf + bufsize, data, end - data);
  180|  15.6M|        bytes += end - data;
  181|  15.6M|    }
  182|  26.0M|    return *this;
  183|  26.0M|}
_ZN7CSHA5128FinalizeEPh:
  186|  5.20M|{
  187|  5.20M|    static const unsigned char pad[128] = {0x80};
  188|  5.20M|    unsigned char sizedesc[16] = {0x00};
  189|  5.20M|    WriteBE64(sizedesc + 8, bytes << 3);
  190|  5.20M|    Write(pad, 1 + ((239 - (bytes % 128)) % 128));
  191|  5.20M|    Write(sizedesc, 16);
  192|  5.20M|    WriteBE64(hash, s[0]);
  193|  5.20M|    WriteBE64(hash + 8, s[1]);
  194|  5.20M|    WriteBE64(hash + 16, s[2]);
  195|  5.20M|    WriteBE64(hash + 24, s[3]);
  196|  5.20M|    WriteBE64(hash + 32, s[4]);
  197|  5.20M|    WriteBE64(hash + 40, s[5]);
  198|  5.20M|    WriteBE64(hash + 48, s[6]);
  199|  5.20M|    WriteBE64(hash + 56, s[7]);
  200|  5.20M|}
sha512.cpp:_ZN12_GLOBAL__N_16sha51210InitializeEPm:
   35|  5.20M|{
   36|  5.20M|    s[0] = 0x6a09e667f3bcc908ull;
   37|  5.20M|    s[1] = 0xbb67ae8584caa73bull;
   38|  5.20M|    s[2] = 0x3c6ef372fe94f82bull;
   39|  5.20M|    s[3] = 0xa54ff53a5f1d36f1ull;
   40|  5.20M|    s[4] = 0x510e527fade682d1ull;
   41|  5.20M|    s[5] = 0x9b05688c2b3e6c1full;
   42|  5.20M|    s[6] = 0x1f83d9abfb41bd6bull;
   43|  5.20M|    s[7] = 0x5be0cd19137e2179ull;
   44|  5.20M|}
sha512.cpp:_ZN12_GLOBAL__N_16sha5129TransformEPmPKh:
   48|  10.4M|{
   49|  10.4M|    uint64_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];
   50|  10.4M|    uint64_t w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15;
   51|       |
   52|  10.4M|    Round(a, b, c, d, e, f, g, h, 0x428a2f98d728ae22ull, w0 = ReadBE64(chunk + 0));
   53|  10.4M|    Round(h, a, b, c, d, e, f, g, 0x7137449123ef65cdull, w1 = ReadBE64(chunk + 8));
   54|  10.4M|    Round(g, h, a, b, c, d, e, f, 0xb5c0fbcfec4d3b2full, w2 = ReadBE64(chunk + 16));
   55|  10.4M|    Round(f, g, h, a, b, c, d, e, 0xe9b5dba58189dbbcull, w3 = ReadBE64(chunk + 24));
   56|  10.4M|    Round(e, f, g, h, a, b, c, d, 0x3956c25bf348b538ull, w4 = ReadBE64(chunk + 32));
   57|  10.4M|    Round(d, e, f, g, h, a, b, c, 0x59f111f1b605d019ull, w5 = ReadBE64(chunk + 40));
   58|  10.4M|    Round(c, d, e, f, g, h, a, b, 0x923f82a4af194f9bull, w6 = ReadBE64(chunk + 48));
   59|  10.4M|    Round(b, c, d, e, f, g, h, a, 0xab1c5ed5da6d8118ull, w7 = ReadBE64(chunk + 56));
   60|  10.4M|    Round(a, b, c, d, e, f, g, h, 0xd807aa98a3030242ull, w8 = ReadBE64(chunk + 64));
   61|  10.4M|    Round(h, a, b, c, d, e, f, g, 0x12835b0145706fbeull, w9 = ReadBE64(chunk + 72));
   62|  10.4M|    Round(g, h, a, b, c, d, e, f, 0x243185be4ee4b28cull, w10 = ReadBE64(chunk + 80));
   63|  10.4M|    Round(f, g, h, a, b, c, d, e, 0x550c7dc3d5ffb4e2ull, w11 = ReadBE64(chunk + 88));
   64|  10.4M|    Round(e, f, g, h, a, b, c, d, 0x72be5d74f27b896full, w12 = ReadBE64(chunk + 96));
   65|  10.4M|    Round(d, e, f, g, h, a, b, c, 0x80deb1fe3b1696b1ull, w13 = ReadBE64(chunk + 104));
   66|  10.4M|    Round(c, d, e, f, g, h, a, b, 0x9bdc06a725c71235ull, w14 = ReadBE64(chunk + 112));
   67|  10.4M|    Round(b, c, d, e, f, g, h, a, 0xc19bf174cf692694ull, w15 = ReadBE64(chunk + 120));
   68|       |
   69|  10.4M|    Round(a, b, c, d, e, f, g, h, 0xe49b69c19ef14ad2ull, w0 += sigma1(w14) + w9 + sigma0(w1));
   70|  10.4M|    Round(h, a, b, c, d, e, f, g, 0xefbe4786384f25e3ull, w1 += sigma1(w15) + w10 + sigma0(w2));
   71|  10.4M|    Round(g, h, a, b, c, d, e, f, 0x0fc19dc68b8cd5b5ull, w2 += sigma1(w0) + w11 + sigma0(w3));
   72|  10.4M|    Round(f, g, h, a, b, c, d, e, 0x240ca1cc77ac9c65ull, w3 += sigma1(w1) + w12 + sigma0(w4));
   73|  10.4M|    Round(e, f, g, h, a, b, c, d, 0x2de92c6f592b0275ull, w4 += sigma1(w2) + w13 + sigma0(w5));
   74|  10.4M|    Round(d, e, f, g, h, a, b, c, 0x4a7484aa6ea6e483ull, w5 += sigma1(w3) + w14 + sigma0(w6));
   75|  10.4M|    Round(c, d, e, f, g, h, a, b, 0x5cb0a9dcbd41fbd4ull, w6 += sigma1(w4) + w15 + sigma0(w7));
   76|  10.4M|    Round(b, c, d, e, f, g, h, a, 0x76f988da831153b5ull, w7 += sigma1(w5) + w0 + sigma0(w8));
   77|  10.4M|    Round(a, b, c, d, e, f, g, h, 0x983e5152ee66dfabull, w8 += sigma1(w6) + w1 + sigma0(w9));
   78|  10.4M|    Round(h, a, b, c, d, e, f, g, 0xa831c66d2db43210ull, w9 += sigma1(w7) + w2 + sigma0(w10));
   79|  10.4M|    Round(g, h, a, b, c, d, e, f, 0xb00327c898fb213full, w10 += sigma1(w8) + w3 + sigma0(w11));
   80|  10.4M|    Round(f, g, h, a, b, c, d, e, 0xbf597fc7beef0ee4ull, w11 += sigma1(w9) + w4 + sigma0(w12));
   81|  10.4M|    Round(e, f, g, h, a, b, c, d, 0xc6e00bf33da88fc2ull, w12 += sigma1(w10) + w5 + sigma0(w13));
   82|  10.4M|    Round(d, e, f, g, h, a, b, c, 0xd5a79147930aa725ull, w13 += sigma1(w11) + w6 + sigma0(w14));
   83|  10.4M|    Round(c, d, e, f, g, h, a, b, 0x06ca6351e003826full, w14 += sigma1(w12) + w7 + sigma0(w15));
   84|  10.4M|    Round(b, c, d, e, f, g, h, a, 0x142929670a0e6e70ull, w15 += sigma1(w13) + w8 + sigma0(w0));
   85|       |
   86|  10.4M|    Round(a, b, c, d, e, f, g, h, 0x27b70a8546d22ffcull, w0 += sigma1(w14) + w9 + sigma0(w1));
   87|  10.4M|    Round(h, a, b, c, d, e, f, g, 0x2e1b21385c26c926ull, w1 += sigma1(w15) + w10 + sigma0(w2));
   88|  10.4M|    Round(g, h, a, b, c, d, e, f, 0x4d2c6dfc5ac42aedull, w2 += sigma1(w0) + w11 + sigma0(w3));
   89|  10.4M|    Round(f, g, h, a, b, c, d, e, 0x53380d139d95b3dfull, w3 += sigma1(w1) + w12 + sigma0(w4));
   90|  10.4M|    Round(e, f, g, h, a, b, c, d, 0x650a73548baf63deull, w4 += sigma1(w2) + w13 + sigma0(w5));
   91|  10.4M|    Round(d, e, f, g, h, a, b, c, 0x766a0abb3c77b2a8ull, w5 += sigma1(w3) + w14 + sigma0(w6));
   92|  10.4M|    Round(c, d, e, f, g, h, a, b, 0x81c2c92e47edaee6ull, w6 += sigma1(w4) + w15 + sigma0(w7));
   93|  10.4M|    Round(b, c, d, e, f, g, h, a, 0x92722c851482353bull, w7 += sigma1(w5) + w0 + sigma0(w8));
   94|  10.4M|    Round(a, b, c, d, e, f, g, h, 0xa2bfe8a14cf10364ull, w8 += sigma1(w6) + w1 + sigma0(w9));
   95|  10.4M|    Round(h, a, b, c, d, e, f, g, 0xa81a664bbc423001ull, w9 += sigma1(w7) + w2 + sigma0(w10));
   96|  10.4M|    Round(g, h, a, b, c, d, e, f, 0xc24b8b70d0f89791ull, w10 += sigma1(w8) + w3 + sigma0(w11));
   97|  10.4M|    Round(f, g, h, a, b, c, d, e, 0xc76c51a30654be30ull, w11 += sigma1(w9) + w4 + sigma0(w12));
   98|  10.4M|    Round(e, f, g, h, a, b, c, d, 0xd192e819d6ef5218ull, w12 += sigma1(w10) + w5 + sigma0(w13));
   99|  10.4M|    Round(d, e, f, g, h, a, b, c, 0xd69906245565a910ull, w13 += sigma1(w11) + w6 + sigma0(w14));
  100|  10.4M|    Round(c, d, e, f, g, h, a, b, 0xf40e35855771202aull, w14 += sigma1(w12) + w7 + sigma0(w15));
  101|  10.4M|    Round(b, c, d, e, f, g, h, a, 0x106aa07032bbd1b8ull, w15 += sigma1(w13) + w8 + sigma0(w0));
  102|       |
  103|  10.4M|    Round(a, b, c, d, e, f, g, h, 0x19a4c116b8d2d0c8ull, w0 += sigma1(w14) + w9 + sigma0(w1));
  104|  10.4M|    Round(h, a, b, c, d, e, f, g, 0x1e376c085141ab53ull, w1 += sigma1(w15) + w10 + sigma0(w2));
  105|  10.4M|    Round(g, h, a, b, c, d, e, f, 0x2748774cdf8eeb99ull, w2 += sigma1(w0) + w11 + sigma0(w3));
  106|  10.4M|    Round(f, g, h, a, b, c, d, e, 0x34b0bcb5e19b48a8ull, w3 += sigma1(w1) + w12 + sigma0(w4));
  107|  10.4M|    Round(e, f, g, h, a, b, c, d, 0x391c0cb3c5c95a63ull, w4 += sigma1(w2) + w13 + sigma0(w5));
  108|  10.4M|    Round(d, e, f, g, h, a, b, c, 0x4ed8aa4ae3418acbull, w5 += sigma1(w3) + w14 + sigma0(w6));
  109|  10.4M|    Round(c, d, e, f, g, h, a, b, 0x5b9cca4f7763e373ull, w6 += sigma1(w4) + w15 + sigma0(w7));
  110|  10.4M|    Round(b, c, d, e, f, g, h, a, 0x682e6ff3d6b2b8a3ull, w7 += sigma1(w5) + w0 + sigma0(w8));
  111|  10.4M|    Round(a, b, c, d, e, f, g, h, 0x748f82ee5defb2fcull, w8 += sigma1(w6) + w1 + sigma0(w9));
  112|  10.4M|    Round(h, a, b, c, d, e, f, g, 0x78a5636f43172f60ull, w9 += sigma1(w7) + w2 + sigma0(w10));
  113|  10.4M|    Round(g, h, a, b, c, d, e, f, 0x84c87814a1f0ab72ull, w10 += sigma1(w8) + w3 + sigma0(w11));
  114|  10.4M|    Round(f, g, h, a, b, c, d, e, 0x8cc702081a6439ecull, w11 += sigma1(w9) + w4 + sigma0(w12));
  115|  10.4M|    Round(e, f, g, h, a, b, c, d, 0x90befffa23631e28ull, w12 += sigma1(w10) + w5 + sigma0(w13));
  116|  10.4M|    Round(d, e, f, g, h, a, b, c, 0xa4506cebde82bde9ull, w13 += sigma1(w11) + w6 + sigma0(w14));
  117|  10.4M|    Round(c, d, e, f, g, h, a, b, 0xbef9a3f7b2c67915ull, w14 += sigma1(w12) + w7 + sigma0(w15));
  118|  10.4M|    Round(b, c, d, e, f, g, h, a, 0xc67178f2e372532bull, w15 += sigma1(w13) + w8 + sigma0(w0));
  119|       |
  120|  10.4M|    Round(a, b, c, d, e, f, g, h, 0xca273eceea26619cull, w0 += sigma1(w14) + w9 + sigma0(w1));
  121|  10.4M|    Round(h, a, b, c, d, e, f, g, 0xd186b8c721c0c207ull, w1 += sigma1(w15) + w10 + sigma0(w2));
  122|  10.4M|    Round(g, h, a, b, c, d, e, f, 0xeada7dd6cde0eb1eull, w2 += sigma1(w0) + w11 + sigma0(w3));
  123|  10.4M|    Round(f, g, h, a, b, c, d, e, 0xf57d4f7fee6ed178ull, w3 += sigma1(w1) + w12 + sigma0(w4));
  124|  10.4M|    Round(e, f, g, h, a, b, c, d, 0x06f067aa72176fbaull, w4 += sigma1(w2) + w13 + sigma0(w5));
  125|  10.4M|    Round(d, e, f, g, h, a, b, c, 0x0a637dc5a2c898a6ull, w5 += sigma1(w3) + w14 + sigma0(w6));
  126|  10.4M|    Round(c, d, e, f, g, h, a, b, 0x113f9804bef90daeull, w6 += sigma1(w4) + w15 + sigma0(w7));
  127|  10.4M|    Round(b, c, d, e, f, g, h, a, 0x1b710b35131c471bull, w7 += sigma1(w5) + w0 + sigma0(w8));
  128|  10.4M|    Round(a, b, c, d, e, f, g, h, 0x28db77f523047d84ull, w8 += sigma1(w6) + w1 + sigma0(w9));
  129|  10.4M|    Round(h, a, b, c, d, e, f, g, 0x32caab7b40c72493ull, w9 += sigma1(w7) + w2 + sigma0(w10));
  130|  10.4M|    Round(g, h, a, b, c, d, e, f, 0x3c9ebe0a15c9bebcull, w10 += sigma1(w8) + w3 + sigma0(w11));
  131|  10.4M|    Round(f, g, h, a, b, c, d, e, 0x431d67c49c100d4cull, w11 += sigma1(w9) + w4 + sigma0(w12));
  132|  10.4M|    Round(e, f, g, h, a, b, c, d, 0x4cc5d4becb3e42b6ull, w12 += sigma1(w10) + w5 + sigma0(w13));
  133|  10.4M|    Round(d, e, f, g, h, a, b, c, 0x597f299cfc657e2aull, w13 += sigma1(w11) + w6 + sigma0(w14));
  134|  10.4M|    Round(c, d, e, f, g, h, a, b, 0x5fcb6fab3ad6faecull, w14 + sigma1(w12) + w7 + sigma0(w15));
  135|  10.4M|    Round(b, c, d, e, f, g, h, a, 0x6c44198c4a475817ull, w15 + sigma1(w13) + w8 + sigma0(w0));
  136|       |
  137|  10.4M|    s[0] += a;
  138|  10.4M|    s[1] += b;
  139|  10.4M|    s[2] += c;
  140|  10.4M|    s[3] += d;
  141|  10.4M|    s[4] += e;
  142|  10.4M|    s[5] += f;
  143|  10.4M|    s[6] += g;
  144|  10.4M|    s[7] += h;
  145|  10.4M|}
sha512.cpp:_ZN12_GLOBAL__N_16sha5125RoundEmmmRmmmmS1_mm:
   26|   832M|{
   27|   832M|    uint64_t t1 = h + Sigma1(e) + Ch(e, f, g) + k + w;
   28|   832M|    uint64_t t2 = Sigma0(a) + Maj(a, b, c);
   29|   832M|    d += t1;
   30|   832M|    h = t1 + t2;
   31|   832M|}
sha512.cpp:_ZN12_GLOBAL__N_16sha5126Sigma1Em:
   20|   832M|uint64_t inline Sigma1(uint64_t x) { return (x >> 14 | x << 50) ^ (x >> 18 | x << 46) ^ (x >> 41 | x << 23); }
sha512.cpp:_ZN12_GLOBAL__N_16sha5122ChEmmm:
   17|   832M|uint64_t inline Ch(uint64_t x, uint64_t y, uint64_t z) { return z ^ (x & (y ^ z)); }
sha512.cpp:_ZN12_GLOBAL__N_16sha5126Sigma0Em:
   19|   832M|uint64_t inline Sigma0(uint64_t x) { return (x >> 28 | x << 36) ^ (x >> 34 | x << 30) ^ (x >> 39 | x << 25); }
sha512.cpp:_ZN12_GLOBAL__N_16sha5123MajEmmm:
   18|   832M|uint64_t inline Maj(uint64_t x, uint64_t y, uint64_t z) { return (x & y) | (z & (x | y)); }
sha512.cpp:_ZN12_GLOBAL__N_16sha5126sigma1Em:
   22|   666M|uint64_t inline sigma1(uint64_t x) { return (x >> 19 | x << 45) ^ (x >> 61 | x << 3) ^ (x >> 6); }
sha512.cpp:_ZN12_GLOBAL__N_16sha5126sigma0Em:
   21|   666M|uint64_t inline sigma0(uint64_t x) { return (x >> 1 | x << 63) ^ (x >> 8 | x << 56) ^ (x >> 7); }

_Z9BIP32HashRK9ChainCodejhPKhPh:
   72|  2.60M|{
   73|  2.60M|    unsigned char num[4];
   74|  2.60M|    WriteBE32(num, nChild);
   75|  2.60M|    CHMAC_SHA512(chainCode.begin(), chainCode.size()).Write(&header, 1).Write(data, 32).Write(num, 4).Finalize(output);
   76|  2.60M|}

_Z4HashINSt3__14spanIhLm18446744073709551615EEEE7uint256RKT_:
   84|  71.0k|{
   85|  71.0k|    uint256 result;
   86|  71.0k|    CHash256().Write(MakeUCharSpan(in1)).Finalize(result);
   87|  71.0k|    return result;
   88|  71.0k|}
_Z7Hash160I11XOnlyPubKeyE7uint160RKT_:
  101|  9.81k|{
  102|  9.81k|    uint160 result;
  103|  9.81k|    CHash160().Write(MakeUCharSpan(in1)).Finalize(result);
  104|  9.81k|    return result;
  105|  9.81k|}
_Z9RIPEMD160NSt3__14spanIKhLm18446744073709551615EEE:
  231|  3.97k|{
  232|  3.97k|    uint160 result;
  233|  3.97k|    CRIPEMD160().Write(data.data(), data.size()).Finalize(result.begin());
  234|  3.97k|    return result;
  235|  3.97k|}
_ZN9ChainCodeC2Ev:
   25|  8.31M|    constexpr ChainCode() = default;
_Z4HashINSt3__16vectorIhNS0_9allocatorIhEEEEE7uint256RKT_:
   84|  1.34M|{
   85|  1.34M|    uint256 result;
   86|  1.34M|    CHash256().Write(MakeUCharSpan(in1)).Finalize(result);
   87|  1.34M|    return result;
   88|  1.34M|}
_ZN9ChainCodeD2Ev:
   28|  11.2M|    ~ChainCode() { memory_cleanse(data(), size()); }
_Z7Hash160INSt3__14spanIKhLm18446744073709551615EEEE7uint160RKT_:
  101|  11.3M|{
  102|  11.3M|    uint160 result;
  103|  11.3M|    CHash160().Write(MakeUCharSpan(in1)).Finalize(result);
  104|  11.3M|    return result;
  105|  11.3M|}
_ZN8CHash2565WriteENSt3__14spanIKhLm18446744073709551615EEE:
   45|  1.42M|    CHash256& Write(std::span<const unsigned char> input) {
   46|  1.42M|        sha.Write(input.data(), input.size());
   47|  1.42M|        return *this;
   48|  1.42M|    }
_ZN8CHash2568FinalizeENSt3__14spanIhLm18446744073709551615EEE:
   38|  1.42M|    void Finalize(std::span<unsigned char> output) {
   39|  1.42M|        assert(output.size() == OUTPUT_SIZE);
  ------------------
  |  Branch (39:9): [True: 1.42M, False: 0]
  ------------------
   40|  1.42M|        unsigned char buf[CSHA256::OUTPUT_SIZE];
   41|  1.42M|        sha.Finalize(buf);
   42|  1.42M|        sha.Reset().Write(buf, CSHA256::OUTPUT_SIZE).Finalize(output.data());
   43|  1.42M|    }
_ZN10HashWriterlsINSt3__14spanIKhLm32EEEEERS_RKT_:
  150|   101k|    {
  151|   101k|        ::Serialize(*this, obj);
  152|   101k|        return *this;
  153|   101k|    }
_ZN10HashWriterlsI7uint256EERS_RKT_:
  150|   101k|    {
  151|   101k|        ::Serialize(*this, obj);
  152|   101k|        return *this;
  153|   101k|    }
_ZN10HashWriterlsIhEERS_RKT_:
  150|  35.3k|    {
  151|  35.3k|        ::Serialize(*this, obj);
  152|  35.3k|        return *this;
  153|  35.3k|    }
_ZN10HashWriterlsI17CompactSizeWriterEERS_RKT_:
  150|  35.3k|    {
  151|  35.3k|        ::Serialize(*this, obj);
  152|  35.3k|        return *this;
  153|  35.3k|    }
_Z7Hash160I7CScriptE7uint160RKT_:
  101|  19.9k|{
  102|  19.9k|    uint160 result;
  103|  19.9k|    CHash160().Write(MakeUCharSpan(in1)).Finalize(result);
  104|  19.9k|    return result;
  105|  19.9k|}
_ZN8CHash1605WriteENSt3__14spanIKhLm18446744073709551615EEE:
   70|  11.4M|    CHash160& Write(std::span<const unsigned char> input) {
   71|  11.4M|        sha.Write(input.data(), input.size());
   72|  11.4M|        return *this;
   73|  11.4M|    }
_ZN8CHash1608FinalizeENSt3__14spanIhLm18446744073709551615EEE:
   63|  11.4M|    void Finalize(std::span<unsigned char> output) {
   64|  11.4M|        assert(output.size() == OUTPUT_SIZE);
  ------------------
  |  Branch (64:9): [True: 11.4M, False: 0]
  ------------------
   65|  11.4M|        unsigned char buf[CSHA256::OUTPUT_SIZE];
   66|  11.4M|        sha.Finalize(buf);
   67|  11.4M|        CRIPEMD160().Write(buf, CSHA256::OUTPUT_SIZE).Finalize(output.data());
   68|  11.4M|    }
_ZN10HashWriter5writeENSt3__14spanIKSt4byteLm18446744073709551615EEE:
  115|   295k|    {
  116|   295k|        ctx.Write(UCharCast(src.data()), src.size());
  117|   295k|    }
_ZN10HashWriter9GetSHA256Ev:
  134|   149k|    uint256 GetSHA256() {
  135|   149k|        uint256 result;
  136|   149k|        ctx.Finalize(result.begin());
  137|   149k|        return result;
  138|   149k|    }
_ZN10HashWriterlsINSt3__14spanIKhLm18446744073709551615EEEEERS_RKT_:
  150|   113k|    {
  151|   113k|        ::Serialize(*this, obj);
  152|   113k|        return *this;
  153|   113k|    }

_ZNK12CChainParams12Base58PrefixENS_10Base58TypeE:
  114|  1.42M|    const std::vector<unsigned char>& Base58Prefix(Base58Type type) const { return base58Prefixes[type]; }
_ZNK12CChainParams9Bech32HRPEv:
  115|    864|    const std::string& Bech32HRP() const { return bech32_hrp; }

_ZN4CKey5CheckEPKh:
  159|  2.44M|bool CKey::Check(const unsigned char *vch) {
  160|  2.44M|    return secp256k1_ec_seckey_verify(secp256k1_context_static, vch);
  161|  2.44M|}
_ZNK4CKey9GetPubKeyEv:
  184|  6.17M|CPubKey CKey::GetPubKey() const {
  185|  6.17M|    assert(keydata);
  ------------------
  |  Branch (185:5): [True: 6.17M, False: 0]
  ------------------
  186|  6.17M|    secp256k1_pubkey pubkey;
  187|  6.17M|    size_t clen = CPubKey::SIZE;
  188|  6.17M|    CPubKey result;
  189|  6.17M|    int ret = secp256k1_ec_pubkey_create(secp256k1_context_sign, &pubkey, UCharCast(begin()));
  190|  6.17M|    assert(ret);
  ------------------
  |  Branch (190:5): [True: 6.17M, False: 0]
  ------------------
  191|  6.17M|    secp256k1_ec_pubkey_serialize(secp256k1_context_static, (unsigned char*)result.begin(), &clen, &pubkey, fCompressed ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED);
  ------------------
  |  |  216|  6.17M|#define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  197|  6.17M|#define SECP256K1_FLAGS_TYPE_COMPRESSION (1 << 1)
  |  |  ------------------
  |  |               #define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  202|  6.17M|#define SECP256K1_FLAGS_BIT_COMPRESSION (1 << 8)
  |  |  ------------------
  ------------------
                  secp256k1_ec_pubkey_serialize(secp256k1_context_static, (unsigned char*)result.begin(), &clen, &pubkey, fCompressed ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED);
  ------------------
  |  |  217|  6.17M|#define SECP256K1_EC_UNCOMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION)
  |  |  ------------------
  |  |  |  |  197|      0|#define SECP256K1_FLAGS_TYPE_COMPRESSION (1 << 1)
  |  |  ------------------
  ------------------
  |  Branch (191:109): [True: 6.17M, False: 0]
  ------------------
  192|  6.17M|    assert(result.size() == clen);
  ------------------
  |  Branch (192:5): [True: 6.17M, False: 0]
  ------------------
  193|  6.17M|    assert(result.IsValid());
  ------------------
  |  Branch (193:5): [True: 6.17M, False: 0]
  ------------------
  194|  6.17M|    return result;
  195|  6.17M|}
_ZNK4CKey6DeriveERS_R9ChainCodejRKS1_:
  294|  2.40M|bool CKey::Derive(CKey& keyChild, ChainCode &ccChild, unsigned int nChild, const ChainCode& cc) const {
  295|  2.40M|    assert(IsValid());
  ------------------
  |  Branch (295:5): [True: 2.40M, False: 0]
  ------------------
  296|  2.40M|    assert(IsCompressed());
  ------------------
  |  Branch (296:5): [True: 2.40M, False: 0]
  ------------------
  297|  2.40M|    std::vector<unsigned char, secure_allocator<unsigned char>> vout(64);
  298|  2.40M|    if ((nChild >> 31) == 0) {
  ------------------
  |  Branch (298:9): [True: 956k, False: 1.45M]
  ------------------
  299|   956k|        CPubKey pubkey = GetPubKey();
  300|   956k|        assert(pubkey.size() == CPubKey::COMPRESSED_SIZE);
  ------------------
  |  Branch (300:9): [True: 956k, False: 0]
  ------------------
  301|   956k|        BIP32Hash(cc, nChild, *pubkey.begin(), pubkey.begin()+1, vout.data());
  302|  1.45M|    } else {
  303|  1.45M|        assert(size() == 32);
  ------------------
  |  Branch (303:9): [True: 1.45M, False: 0]
  ------------------
  304|  1.45M|        BIP32Hash(cc, nChild, 0, UCharCast(begin()), vout.data());
  305|  1.45M|    }
  306|  2.40M|    memcpy(ccChild.begin(), vout.data()+32, 32);
  307|  2.40M|    keyChild.Set(begin(), begin() + 32, true);
  308|  2.40M|    bool ret = secp256k1_ec_seckey_tweak_add(secp256k1_context_static, (unsigned char*)keyChild.begin(), vout.data());
  309|  2.40M|    if (!ret) keyChild.ClearKeyData();
  ------------------
  |  Branch (309:9): [True: 0, False: 2.40M]
  ------------------
  310|  2.40M|    return ret;
  311|  2.40M|}
_ZNK7CExtKey6DeriveERS_j:
  361|  2.40M|bool CExtKey::Derive(CExtKey &out, unsigned int _nChild) const {
  362|  2.40M|    if (nDepth == std::numeric_limits<unsigned char>::max()) return false;
  ------------------
  |  Branch (362:9): [True: 0, False: 2.40M]
  ------------------
  363|  2.40M|    out.nDepth = nDepth + 1;
  364|  2.40M|    out.fingerprint = id_key_fingerprint();
  365|  2.40M|    out.nChild = _nChild;
  366|  2.40M|    return key.Derive(out.key, out.chaincode, _nChild, chaincode);
  367|  2.40M|}
_ZNK7CExtKey6NeuterEv:
  394|  2.35M|CExtPubKey CExtKey::Neuter() const {
  395|  2.35M|    CExtPubKey ret;
  396|  2.35M|    ret.nDepth = nDepth;
  397|  2.35M|    ret.fingerprint = fingerprint;
  398|  2.35M|    ret.nChild = nChild;
  399|  2.35M|    ret.pubkey = key.GetPubKey();
  400|  2.35M|    ret.chaincode = chaincode;
  401|  2.35M|    return ret;
  402|  2.35M|}
_ZNK7CExtKey6EncodeEPh:
  404|   449k|void CExtKey::Encode(unsigned char code[BIP32_EXTKEY_SIZE]) const {
  405|   449k|    code[0] = nDepth;
  406|   449k|    std::ranges::copy(fingerprint, code+1);
  407|   449k|    WriteBE32(code+5, nChild);
  408|   449k|    memcpy(code+9, chaincode.begin(), 32);
  409|   449k|    code[41] = 0;
  410|   449k|    assert(key.size() == 32);
  ------------------
  |  Branch (410:5): [True: 449k, False: 0]
  ------------------
  411|   449k|    memcpy(code+42, key.begin(), 32);
  412|   449k|}
_ZN7CExtKey6DecodeEPKh:
  414|  35.3k|void CExtKey::Decode(const unsigned char code[BIP32_EXTKEY_SIZE]) {
  415|  35.3k|    nDepth = code[0];
  416|  35.3k|    std::copy_n(code + 1, fingerprint.size(), fingerprint.begin());
  417|  35.3k|    nChild = ReadBE32(code+5);
  418|  35.3k|    memcpy(chaincode.begin(), code+9, 32);
  419|  35.3k|    key.Set(code+42, code+BIP32_EXTKEY_SIZE, true);
  420|  35.3k|    if ((nDepth == 0 && (nChild != 0 || ReadLE32(fingerprint.data()) != 0)) || code[41] != 0) key = CKey();
  ------------------
  |  Branch (420:10): [True: 613, False: 34.7k]
  |  Branch (420:26): [True: 0, False: 613]
  |  Branch (420:41): [True: 0, False: 613]
  |  Branch (420:80): [True: 0, False: 35.3k]
  ------------------
  421|  35.3k|}
_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|}

_ZNK7CExtKey18id_key_fingerprintEv:
  252|  2.40M|    {
  253|  2.40M|        return key.GetPubKey().GetID().fingerprint();
  254|  2.40M|    }
_ZN4CKey3SetIPKSt4byteEEvT_S4_b:
  109|  2.40M|    {
  110|  2.40M|        if (size_t(pend - pbegin) != std::tuple_size_v<KeyType>) {
  ------------------
  |  Branch (110:13): [True: 0, False: 2.40M]
  ------------------
  111|      0|            ClearKeyData();
  112|  2.40M|        } else if (Check(UCharCast(&pbegin[0]))) {
  ------------------
  |  Branch (112:20): [True: 2.40M, False: 0]
  ------------------
  113|  2.40M|            MakeKeyData();
  114|  2.40M|            memcpy(keydata->data(), (unsigned char*)&pbegin[0], keydata->size());
  115|  2.40M|            fCompressed = fCompressedIn;
  116|  2.40M|        } else {
  117|      0|            ClearKeyData();
  118|      0|        }
  119|  2.40M|    }
_ZNK4CKey12IsCompressedEv:
  131|  2.40M|    bool IsCompressed() const { return fCompressed; }
_ZN4CKey3SetINSt3__111__wrap_iterIPhEEEEvT_S5_b:
  109|    196|    {
  110|    196|        if (size_t(pend - pbegin) != std::tuple_size_v<KeyType>) {
  ------------------
  |  Branch (110:13): [True: 0, False: 196]
  ------------------
  111|      0|            ClearKeyData();
  112|    196|        } else if (Check(UCharCast(&pbegin[0]))) {
  ------------------
  |  Branch (112:20): [True: 196, False: 0]
  ------------------
  113|    196|            MakeKeyData();
  114|    196|            memcpy(keydata->data(), (unsigned char*)&pbegin[0], keydata->size());
  115|    196|            fCompressed = fCompressedIn;
  116|    196|        } else {
  117|      0|            ClearKeyData();
  118|      0|        }
  119|    196|    }
_ZNK4CKey5beginEv:
  124|  15.3M|    const std::byte* begin() const { return data(); }
_ZNK4CKey3endEv:
  125|     21|    const std::byte* end() const { return data() + size(); }
_ZN4CKeyC2EOS_:
   80|     37|    CKey(CKey&&) noexcept = default;
_ZN7CExtKeyC2Ev:
  248|  3.46M|    CExtKey() = default;
_ZNK4CKey4dataEv:
  123|  15.3M|    const std::byte* data() const { return keydata ? reinterpret_cast<const std::byte*>(keydata->data()) : nullptr; }
  ------------------
  |  Branch (123:44): [True: 15.3M, False: 0]
  ------------------
_ZNK4CKey4sizeEv:
  122|  1.90M|    unsigned int size() const { return keydata ? keydata->size() : 0; }
  ------------------
  |  Branch (122:40): [True: 1.90M, False: 0]
  ------------------
_ZN4CKey3SetIPKhEEvT_S3_b:
  109|  35.3k|    {
  110|  35.3k|        if (size_t(pend - pbegin) != std::tuple_size_v<KeyType>) {
  ------------------
  |  Branch (110:13): [True: 0, False: 35.3k]
  ------------------
  111|      0|            ClearKeyData();
  112|  35.3k|        } else if (Check(UCharCast(&pbegin[0]))) {
  ------------------
  |  Branch (112:20): [True: 35.3k, False: 0]
  ------------------
  113|  35.3k|            MakeKeyData();
  114|  35.3k|            memcpy(keydata->data(), (unsigned char*)&pbegin[0], keydata->size());
  115|  35.3k|            fCompressed = fCompressedIn;
  116|  35.3k|        } else {
  117|      0|            ClearKeyData();
  118|      0|        }
  119|  35.3k|    }
_ZN4CKeyC2Ev:
   79|  5.59M|    CKey() noexcept = default;
_ZN4CKeyC2ERKS_:
   97|  47.3k|    CKey(const CKey& other) { *this = other; }
_ZN4CKeyaSERKS_:
   84|  5.35M|    {
   85|  5.35M|        if (this != &other) {
  ------------------
  |  Branch (85:13): [True: 5.35M, False: 0]
  ------------------
   86|  5.35M|            if (other.keydata) {
  ------------------
  |  Branch (86:17): [True: 5.35M, False: 0]
  ------------------
   87|  5.35M|                MakeKeyData();
   88|  5.35M|                *keydata = *other.keydata;
   89|  5.35M|            } else {
   90|      0|                ClearKeyData();
   91|      0|            }
   92|  5.35M|            fCompressed = other.fCompressed;
   93|  5.35M|        }
   94|  5.35M|        return *this;
   95|  5.35M|    }
_ZN4CKey11MakeKeyDataEv:
   69|  7.80M|    {
   70|  7.80M|        if (!keydata) keydata = make_secure_unique<KeyType>();
  ------------------
  |  Branch (70:13): [True: 5.39M, False: 2.41M]
  ------------------
   71|  7.80M|    }
_ZNK4CKey7IsValidEv:
  128|  3.12M|    bool IsValid() const { return !!keydata; }

_Z12DecodeSecretRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  215|  1.73k|{
  216|  1.73k|    CKey key;
  217|  1.73k|    std::vector<unsigned char> data;
  218|  1.73k|    if (DecodeBase58Check(str, data, 34)) {
  ------------------
  |  Branch (218:9): [True: 197, False: 1.53k]
  ------------------
  219|    197|        const std::vector<unsigned char>& privkey_prefix = Params().Base58Prefix(CChainParams::SECRET_KEY);
  220|    197|        if ((data.size() == 32 + privkey_prefix.size() || (data.size() == 33 + privkey_prefix.size() && data.back() == 1)) &&
  ------------------
  |  Branch (220:14): [True: 0, False: 197]
  |  Branch (220:60): [True: 196, False: 1]
  |  Branch (220:105): [True: 196, False: 0]
  ------------------
  221|    196|            std::equal(privkey_prefix.begin(), privkey_prefix.end(), data.begin())) {
  ------------------
  |  Branch (221:13): [True: 196, False: 0]
  ------------------
  222|    196|            bool compressed = data.size() == 33 + privkey_prefix.size();
  223|    196|            key.Set(data.begin() + privkey_prefix.size(), data.begin() + privkey_prefix.size() + 32, compressed);
  224|    196|        }
  225|    197|    }
  226|  1.73k|    if (!data.empty()) {
  ------------------
  |  Branch (226:9): [True: 197, False: 1.53k]
  ------------------
  227|    197|        memory_cleanse(data.data(), data.size());
  228|    197|    }
  229|  1.73k|    return key;
  230|  1.73k|}
_Z12EncodeSecretRK4CKey:
  233|     21|{
  234|     21|    assert(key.IsValid());
  ------------------
  |  Branch (234:5): [True: 21, False: 0]
  ------------------
  235|     21|    std::vector<unsigned char> data = Params().Base58Prefix(CChainParams::SECRET_KEY);
  236|     21|    data.insert(data.end(), UCharCast(key.begin()), UCharCast(key.end()));
  237|     21|    if (key.IsCompressed()) {
  ------------------
  |  Branch (237:9): [True: 21, False: 0]
  ------------------
  238|     21|        data.push_back(1);
  239|     21|    }
  240|     21|    std::string ret = EncodeBase58Check(data);
  241|     21|    memory_cleanse(data.data(), data.size());
  242|     21|    return ret;
  243|     21|}
_Z15DecodeExtPubKeyRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  246|  35.6k|{
  247|  35.6k|    CExtPubKey key;
  248|  35.6k|    std::vector<unsigned char> data;
  249|  35.6k|    if (DecodeBase58Check(str, data, 78)) {
  ------------------
  |  Branch (249:9): [True: 35.3k, False: 369]
  ------------------
  250|  35.3k|        const std::vector<unsigned char>& prefix = Params().Base58Prefix(CChainParams::EXT_PUBLIC_KEY);
  251|  35.3k|        if (data.size() == BIP32_EXTKEY_SIZE + prefix.size() && std::equal(prefix.begin(), prefix.end(), data.begin())) {
  ------------------
  |  Branch (251:13): [True: 35.3k, False: 3]
  |  Branch (251:65): [True: 0, False: 35.3k]
  ------------------
  252|      0|            key.Decode(data.data() + prefix.size());
  253|      0|        }
  254|  35.3k|    }
  255|  35.6k|    return key;
  256|  35.6k|}
_Z15EncodeExtPubKeyRK10CExtPubKey:
  259|   899k|{
  260|   899k|    std::vector<unsigned char> data = Params().Base58Prefix(CChainParams::EXT_PUBLIC_KEY);
  261|   899k|    size_t size = data.size();
  262|   899k|    data.resize(size + BIP32_EXTKEY_SIZE);
  263|   899k|    key.Encode(data.data() + size);
  264|   899k|    std::string ret = EncodeBase58Check(data);
  265|   899k|    return ret;
  266|   899k|}
_Z12DecodeExtKeyRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  269|  35.6k|{
  270|  35.6k|    CExtKey key;
  271|  35.6k|    std::vector<unsigned char> data;
  272|  35.6k|    if (DecodeBase58Check(str, data, 78)) {
  ------------------
  |  Branch (272:9): [True: 35.3k, False: 369]
  ------------------
  273|  35.3k|        const std::vector<unsigned char>& prefix = Params().Base58Prefix(CChainParams::EXT_SECRET_KEY);
  274|  35.3k|        if (data.size() == BIP32_EXTKEY_SIZE + prefix.size() && std::equal(prefix.begin(), prefix.end(), data.begin())) {
  ------------------
  |  Branch (274:13): [True: 35.3k, False: 3]
  |  Branch (274:65): [True: 35.3k, False: 0]
  ------------------
  275|  35.3k|            key.Decode(data.data() + prefix.size());
  276|  35.3k|        }
  277|  35.3k|    }
  278|  35.6k|    if (!data.empty()) {
  ------------------
  |  Branch (278:9): [True: 35.3k, False: 369]
  ------------------
  279|  35.3k|        memory_cleanse(data.data(), data.size());
  280|  35.3k|    }
  281|  35.6k|    return key;
  282|  35.6k|}
_Z12EncodeExtKeyRK7CExtKey:
  285|   449k|{
  286|   449k|    std::vector<unsigned char> data = Params().Base58Prefix(CChainParams::EXT_SECRET_KEY);
  287|   449k|    size_t size = data.size();
  288|   449k|    data.resize(size + BIP32_EXTKEY_SIZE);
  289|   449k|    key.Encode(data.data() + size);
  290|   449k|    std::string ret = EncodeBase58Check(data);
  291|   449k|    memory_cleanse(data.data(), data.size());
  292|   449k|    return ret;
  293|   449k|}
_Z17DecodeDestinationRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERS5_PNS_6vectorIiNS3_IiEEEE:
  301|    426|{
  302|    426|    return DecodeDestination(str, Params(), error_msg, error_locations);
  303|    426|}
_Z17DecodeDestinationRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  306|    426|{
  307|    426|    std::string error_msg;
  308|    426|    return DecodeDestination(str, error_msg);
  309|    426|}
key_io.cpp:_ZN12_GLOBAL__N_117DecodeDestinationERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERK12CChainParamsRS6_PNS0_6vectorIiNS4_IiEEEE:
   86|    426|{
   87|    426|    std::vector<unsigned char> data;
   88|    426|    uint160 hash;
   89|    426|    error_str = "";
   90|       |
   91|       |    // Note this will be false if it is a valid Bech32 address for a different network
   92|    426|    bool is_bech32 = (ToLower(str.substr(0, params.Bech32HRP().size())) == params.Bech32HRP());
   93|       |
   94|    426|    if (!is_bech32 && DecodeBase58Check(str, data, 21)) {
  ------------------
  |  Branch (94:9): [True: 72, False: 354]
  |  Branch (94:23): [True: 2, False: 70]
  ------------------
   95|       |        // base58-encoded Bitcoin addresses.
   96|       |        // Public-key-hash-addresses have version 0 (or 111 testnet).
   97|       |        // The data vector contains RIPEMD160(SHA256(pubkey)), where pubkey is the serialized public key.
   98|      2|        const std::vector<unsigned char>& pubkey_prefix = params.Base58Prefix(CChainParams::PUBKEY_ADDRESS);
   99|      2|        if (data.size() == hash.size() + pubkey_prefix.size() && std::equal(pubkey_prefix.begin(), pubkey_prefix.end(), data.begin())) {
  ------------------
  |  Branch (99:13): [True: 0, False: 2]
  |  Branch (99:66): [True: 0, False: 0]
  ------------------
  100|      0|            std::copy(data.begin() + pubkey_prefix.size(), data.end(), hash.begin());
  101|      0|            return PKHash(hash);
  102|      0|        }
  103|       |        // Script-hash-addresses have version 5 (or 196 testnet).
  104|       |        // The data vector contains RIPEMD160(SHA256(cscript)), where cscript is the serialized redemption script.
  105|      2|        const std::vector<unsigned char>& script_prefix = params.Base58Prefix(CChainParams::SCRIPT_ADDRESS);
  106|      2|        if (data.size() == hash.size() + script_prefix.size() && std::equal(script_prefix.begin(), script_prefix.end(), data.begin())) {
  ------------------
  |  Branch (106:13): [True: 0, False: 2]
  |  Branch (106:66): [True: 0, False: 0]
  ------------------
  107|      0|            std::copy(data.begin() + script_prefix.size(), data.end(), hash.begin());
  108|      0|            return ScriptHash(hash);
  109|      0|        }
  110|       |
  111|       |        // If the prefix of data matches either the script or pubkey prefix, the length must have been wrong
  112|      2|        if ((data.size() >= script_prefix.size() &&
  ------------------
  |  Branch (112:14): [True: 2, False: 0]
  ------------------
  113|      2|                std::equal(script_prefix.begin(), script_prefix.end(), data.begin())) ||
  ------------------
  |  Branch (113:17): [True: 0, False: 2]
  ------------------
  114|      2|            (data.size() >= pubkey_prefix.size() &&
  ------------------
  |  Branch (114:14): [True: 2, False: 0]
  ------------------
  115|      2|                std::equal(pubkey_prefix.begin(), pubkey_prefix.end(), data.begin()))) {
  ------------------
  |  Branch (115:17): [True: 0, False: 2]
  ------------------
  116|      0|            error_str = "Invalid length for Base58 address (P2PKH or P2SH)";
  117|      2|        } else {
  118|      2|            error_str = "Invalid or unsupported Base58-encoded address.";
  119|      2|        }
  120|      2|        return CNoDestination();
  121|    424|    } else if (!is_bech32) {
  ------------------
  |  Branch (121:16): [True: 70, False: 354]
  ------------------
  122|       |        // Try Base58 decoding without the checksum, using a much larger max length
  123|     70|        if (!DecodeBase58(str, data, 100)) {
  ------------------
  |  Branch (123:13): [True: 29, False: 41]
  ------------------
  124|     29|            error_str = "Invalid or unsupported Segwit (Bech32) or Base58 encoding.";
  125|     41|        } else {
  126|     41|            error_str = "Invalid checksum or length of Base58 address (P2PKH or P2SH)";
  127|     41|        }
  128|     70|        return CNoDestination();
  129|     70|    }
  130|       |
  131|    354|    data.clear();
  132|    354|    const auto dec = bech32::Decode(str);
  133|    354|    if (dec.encoding == bech32::Encoding::BECH32 || dec.encoding == bech32::Encoding::BECH32M) {
  ------------------
  |  Branch (133:9): [True: 5, False: 349]
  |  Branch (133:53): [True: 5, False: 344]
  ------------------
  134|     10|        if (dec.data.empty()) {
  ------------------
  |  Branch (134:13): [True: 2, False: 8]
  ------------------
  135|      2|            error_str = "Empty Bech32 data section";
  136|      2|            return CNoDestination();
  137|      2|        }
  138|       |        // Bech32 decoding
  139|      8|        if (dec.hrp != params.Bech32HRP()) {
  ------------------
  |  Branch (139:13): [True: 4, False: 4]
  ------------------
  140|      4|            error_str = strprintf("Invalid or unsupported prefix for Segwit (Bech32) address (expected %s, got %s).", params.Bech32HRP(), dec.hrp);
  ------------------
  |  | 1172|      4|#define strprintf tfm::format
  ------------------
  141|      4|            return CNoDestination();
  142|      4|        }
  143|      4|        int version = dec.data[0]; // The first 5 bit symbol is the witness version (0-16)
  144|      4|        if (version == 0 && dec.encoding != bech32::Encoding::BECH32) {
  ------------------
  |  Branch (144:13): [True: 0, False: 4]
  |  Branch (144:29): [True: 0, False: 0]
  ------------------
  145|      0|            error_str = "Version 0 witness address must use Bech32 checksum";
  146|      0|            return CNoDestination();
  147|      0|        }
  148|      4|        if (version != 0 && dec.encoding != bech32::Encoding::BECH32M) {
  ------------------
  |  Branch (148:13): [True: 4, False: 0]
  |  Branch (148:29): [True: 1, False: 3]
  ------------------
  149|      1|            error_str = "Version 1+ witness address must use Bech32m checksum";
  150|      1|            return CNoDestination();
  151|      1|        }
  152|       |        // The rest of the symbols are converted witness program bytes.
  153|      3|        data.reserve(((dec.data.size() - 1) * 5) / 8);
  154|      3|        if (ConvertBits<5, 8, false>([&](unsigned char c) { data.push_back(c); }, dec.data.begin() + 1, dec.data.end())) {
  ------------------
  |  Branch (154:13): [True: 0, False: 3]
  ------------------
  155|       |
  156|      0|            std::string_view byte_str{data.size() == 1 ? "byte" : "bytes"};
  ------------------
  |  Branch (156:39): [True: 0, False: 0]
  ------------------
  157|       |
  158|      0|            if (version == 0) {
  ------------------
  |  Branch (158:17): [True: 0, False: 0]
  ------------------
  159|      0|                {
  160|      0|                    WitnessV0KeyHash keyid;
  161|      0|                    if (data.size() == keyid.size()) {
  ------------------
  |  Branch (161:25): [True: 0, False: 0]
  ------------------
  162|      0|                        std::copy(data.begin(), data.end(), keyid.begin());
  163|      0|                        return keyid;
  164|      0|                    }
  165|      0|                }
  166|      0|                {
  167|      0|                    WitnessV0ScriptHash scriptid;
  168|      0|                    if (data.size() == scriptid.size()) {
  ------------------
  |  Branch (168:25): [True: 0, False: 0]
  ------------------
  169|      0|                        std::copy(data.begin(), data.end(), scriptid.begin());
  170|      0|                        return scriptid;
  171|      0|                    }
  172|      0|                }
  173|       |
  174|      0|                error_str = strprintf("Invalid Bech32 v0 address program size (%d %s), per BIP141", data.size(), byte_str);
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
  175|      0|                return CNoDestination();
  176|      0|            }
  177|       |
  178|      0|            if (version == 1 && data.size() == WITNESS_V1_TAPROOT_SIZE) {
  ------------------
  |  Branch (178:17): [True: 0, False: 0]
  |  Branch (178:33): [True: 0, False: 0]
  ------------------
  179|      0|                static_assert(WITNESS_V1_TAPROOT_SIZE == WitnessV1Taproot::size());
  180|      0|                WitnessV1Taproot tap;
  181|      0|                std::copy(data.begin(), data.end(), tap.begin());
  182|      0|                return tap;
  183|      0|            }
  184|       |
  185|      0|            if (CScript::IsPayToAnchor(version, data)) {
  ------------------
  |  Branch (185:17): [True: 0, False: 0]
  ------------------
  186|      0|                return PayToAnchor();
  187|      0|            }
  188|       |
  189|      0|            if (version > 16) {
  ------------------
  |  Branch (189:17): [True: 0, False: 0]
  ------------------
  190|      0|                error_str = "Invalid Bech32 address witness version";
  191|      0|                return CNoDestination();
  192|      0|            }
  193|       |
  194|      0|            if (data.size() < 2 || data.size() > BECH32_WITNESS_PROG_MAX_LEN) {
  ------------------
  |  Branch (194:17): [True: 0, False: 0]
  |  Branch (194:36): [True: 0, False: 0]
  ------------------
  195|      0|                error_str = strprintf("Invalid Bech32 address program size (%d %s)", data.size(), byte_str);
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
  196|      0|                return CNoDestination();
  197|      0|            }
  198|       |
  199|      0|            return WitnessUnknown{version, data};
  200|      3|        } else {
  201|      3|            error_str = strprintf("Invalid padding in Bech32 data section");
  ------------------
  |  | 1172|      3|#define strprintf tfm::format
  ------------------
  202|      3|            return CNoDestination();
  203|      3|        }
  204|      3|    }
  205|       |
  206|       |    // Perform Bech32 error location
  207|    344|    auto res = bech32::LocateErrors(str);
  208|    344|    error_str = res.first;
  209|    344|    if (error_locations) *error_locations = std::move(res.second);
  ------------------
  |  Branch (209:9): [True: 0, False: 344]
  ------------------
  210|    344|    return CNoDestination();
  211|    354|}
key_io.cpp:_ZZN12_GLOBAL__N_117DecodeDestinationERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERK12CChainParamsRS6_PNS0_6vectorIiNS4_IiEEEEENK3$_0clEh:
  154|     66|        if (ConvertBits<5, 8, false>([&](unsigned char c) { data.push_back(c); }, dec.data.begin() + 1, dec.data.end())) {

_Z22MuSig2AggregatePubkeysRKNSt3__16vectorI7CPubKeyNS_9allocatorIS1_EEEER28secp256k1_musig_keyagg_cacheRKNS_8optionalIS1_EE:
   58|  61.5k|{
   59|  61.5k|    if (!GetMuSig2KeyAggCache(pubkeys, keyagg_cache)) {
  ------------------
  |  Branch (59:9): [True: 0, False: 61.5k]
  ------------------
   60|      0|        return std::nullopt;
   61|      0|    }
   62|  61.5k|    std::optional<CPubKey> agg_key = GetCPubKeyFromMuSig2KeyAggCache(keyagg_cache);
   63|  61.5k|    if (!agg_key.has_value()) return std::nullopt;
  ------------------
  |  Branch (63:9): [True: 0, False: 61.5k]
  ------------------
   64|  61.5k|    if (expected_aggregate.has_value() && expected_aggregate != agg_key) return std::nullopt;
  ------------------
  |  Branch (64:9): [True: 0, False: 61.5k]
  |  Branch (64:43): [True: 0, False: 0]
  ------------------
   65|  61.5k|    return agg_key;
   66|  61.5k|}
_Z22MuSig2AggregatePubkeysRKNSt3__16vectorI7CPubKeyNS_9allocatorIS1_EEEE:
   69|  61.5k|{
   70|  61.5k|    secp256k1_musig_keyagg_cache keyagg_cache;
   71|  61.5k|    return MuSig2AggregatePubkeys(pubkeys, keyagg_cache, std::nullopt);
   72|  61.5k|}
_Z25CreateMuSig2SyntheticXpubRK7CPubKey:
   75|    246|{
   76|    246|    CExtPubKey extpub;
   77|    246|    extpub.nDepth = 0;
   78|    246|    extpub.fingerprint.fill(0);
   79|    246|    extpub.nChild = 0;
   80|    246|    extpub.chaincode = MUSIG_CHAINCODE;
   81|    246|    extpub.pubkey = pubkey;
   82|    246|    return extpub;
   83|    246|}
musig.cpp:_ZL20GetMuSig2KeyAggCacheRKNSt3__16vectorI7CPubKeyNS_9allocatorIS1_EEEER28secp256k1_musig_keyagg_cache:
   17|  61.5k|{
   18|  61.5k|    if (pubkeys.empty()) {
  ------------------
  |  Branch (18:9): [True: 0, False: 61.5k]
  ------------------
   19|      0|        return false;
   20|      0|    }
   21|       |
   22|       |    // Parse the pubkeys
   23|  61.5k|    std::vector<secp256k1_pubkey> secp_pubkeys;
   24|  61.5k|    std::vector<const secp256k1_pubkey*> pubkey_ptrs;
   25|   533k|    for (const CPubKey& pubkey : pubkeys) {
  ------------------
  |  Branch (25:32): [True: 533k, False: 61.5k]
  ------------------
   26|   533k|        if (!secp256k1_ec_pubkey_parse(secp256k1_context_static, &secp_pubkeys.emplace_back(), pubkey.data(), pubkey.size())) {
  ------------------
  |  Branch (26:13): [True: 0, False: 533k]
  ------------------
   27|      0|            return false;
   28|      0|        }
   29|   533k|    }
   30|  61.5k|    pubkey_ptrs.reserve(secp_pubkeys.size());
   31|   533k|    for (const secp256k1_pubkey& p : secp_pubkeys) {
  ------------------
  |  Branch (31:36): [True: 533k, False: 61.5k]
  ------------------
   32|   533k|        pubkey_ptrs.push_back(&p);
   33|   533k|    }
   34|       |
   35|       |    // Aggregate the pubkey
   36|  61.5k|    if (!secp256k1_musig_pubkey_agg(secp256k1_context_static, nullptr, &keyagg_cache, pubkey_ptrs.data(), pubkey_ptrs.size())) {
  ------------------
  |  Branch (36:9): [True: 0, False: 61.5k]
  ------------------
   37|      0|        return false;
   38|      0|    }
   39|  61.5k|    return true;
   40|  61.5k|}
musig.cpp:_ZL31GetCPubKeyFromMuSig2KeyAggCacheR28secp256k1_musig_keyagg_cache:
   43|  61.5k|{
   44|       |    // Get the plain aggregated pubkey
   45|  61.5k|    secp256k1_pubkey agg_pubkey;
   46|  61.5k|    if (!secp256k1_musig_pubkey_get(secp256k1_context_static, &agg_pubkey, &keyagg_cache)) {
  ------------------
  |  Branch (46:9): [True: 0, False: 61.5k]
  ------------------
   47|      0|        return std::nullopt;
   48|      0|    }
   49|       |
   50|       |    // Turn into CPubKey
   51|  61.5k|    unsigned char ser_agg_pubkey[CPubKey::COMPRESSED_SIZE];
   52|  61.5k|    size_t ser_agg_pubkey_len = CPubKey::COMPRESSED_SIZE;
   53|  61.5k|    secp256k1_ec_pubkey_serialize(secp256k1_context_static, ser_agg_pubkey, &ser_agg_pubkey_len, &agg_pubkey, SECP256K1_EC_COMPRESSED);
  ------------------
  |  |  216|  61.5k|#define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  197|  61.5k|#define SECP256K1_FLAGS_TYPE_COMPRESSION (1 << 1)
  |  |  ------------------
  |  |               #define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  202|  61.5k|#define SECP256K1_FLAGS_BIT_COMPRESSION (1 << 8)
  |  |  ------------------
  ------------------
   54|  61.5k|    return CPubKey(ser_agg_pubkey, ser_agg_pubkey + ser_agg_pubkey_len);
   55|  61.5k|}

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

_Z25OutputTypeFromDestinationRKNSt3__17variantIJ14CNoDestination17PubKeyDestination6PKHash10ScriptHash19WitnessV0ScriptHash16WitnessV0KeyHash16WitnessV1Taproot11PayToAnchor14WitnessUnknownEEE:
   80|    447|std::optional<OutputType> OutputTypeFromDestination(const CTxDestination& dest) {
   81|    447|    if (std::holds_alternative<PKHash>(dest) ||
  ------------------
  |  Branch (81:9): [True: 1, False: 446]
  ------------------
   82|    446|        std::holds_alternative<ScriptHash>(dest)) {
  ------------------
  |  Branch (82:9): [True: 1, False: 445]
  ------------------
   83|      2|        return OutputType::LEGACY;
   84|      2|    }
   85|    445|    if (std::holds_alternative<WitnessV0KeyHash>(dest) ||
  ------------------
  |  Branch (85:9): [True: 1, False: 444]
  ------------------
   86|    444|        std::holds_alternative<WitnessV0ScriptHash>(dest)) {
  ------------------
  |  Branch (86:9): [True: 1, False: 443]
  ------------------
   87|      2|        return OutputType::BECH32;
   88|      2|    }
   89|    443|    if (std::holds_alternative<WitnessV1Taproot>(dest) ||
  ------------------
  |  Branch (89:9): [True: 3, False: 440]
  ------------------
   90|    440|        std::holds_alternative<WitnessUnknown>(dest)) {
  ------------------
  |  Branch (90:9): [True: 29, False: 411]
  ------------------
   91|     32|        return OutputType::BECH32M;
   92|     32|    }
   93|    411|    return std::nullopt;
   94|    443|}

_ZN9prevectorILj36EhjiE6insertITkNSt3__114input_iteratorENS0_8iteratorEEEvS3_T_S4_:
  335|   125k|    void insert(iterator pos, InputIterator first, InputIterator last) {
  336|   125k|        size_type p = pos - begin();
  337|   125k|        difference_type count = last - first;
  338|   125k|        size_type new_size = size() + count;
  339|   125k|        if (capacity() < new_size) {
  ------------------
  |  Branch (339:13): [True: 56.6k, False: 68.6k]
  ------------------
  340|  56.6k|            change_capacity(new_size + (new_size >> 1));
  341|  56.6k|        }
  342|   125k|        T* ptr = item_ptr(p);
  343|   125k|        T* dst = ptr + count;
  344|   125k|        memmove(dst, ptr, (size() - p) * sizeof(T));
  345|   125k|        _size += count;
  346|   125k|        fill(ptr, first, last);
  347|   125k|    }
_ZN9prevectorILj36EhjiE4fillITkNSt3__114input_iteratorENS0_8iteratorEEEvPhT_S5_:
  167|   125k|    void fill(T* dst, InputIterator first, InputIterator last) {
  168|  6.79M|        while (first != last) {
  ------------------
  |  Branch (168:16): [True: 6.66M, False: 125k]
  ------------------
  169|  6.66M|            new(static_cast<void*>(dst)) T(*first);
  170|  6.66M|            ++dst;
  171|  6.66M|            ++first;
  172|  6.66M|        }
  173|   125k|    }
_ZNK9prevectorILj36EhjiE8iteratoreqES1_:
   74|  6.79M|        bool operator==(iterator x) const { return ptr == x.ptr; }
_ZN9prevectorILj36EhjiE8iteratorppEv:
   64|  6.66M|        iterator& operator++() { ptr++; return *this; }
_ZNK9prevectorILj36EhjiE4backEv:
  412|  17.9k|    const T& back() const {
  413|  17.9k|        return *item_ptr(size() - 1);
  414|  17.9k|    }
_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|   601k|        : _union(std::move(other._union)), _size(other._size)
  225|   601k|    {
  226|   601k|        other._size = 0;
  227|   601k|    }
_ZN9prevectorILj36EhjiE9push_backERKh:
  392|  79.4k|    void push_back(const T& value) {
  393|  79.4k|        emplace_back(value);
  394|  79.4k|    }
_ZN9prevectorILj36EhjiE12emplace_backIJRKhEEEvDpOT_:
  383|  79.4k|    void emplace_back(Args&&... args) {
  384|  79.4k|        size_type new_size = size() + 1;
  385|  79.4k|        if (capacity() < new_size) {
  ------------------
  |  Branch (385:13): [True: 854, False: 78.6k]
  ------------------
  386|    854|            change_capacity(new_size + (new_size >> 1));
  387|    854|        }
  388|  79.4k|        new(item_ptr(size())) T(std::forward<Args>(args)...);
  389|  79.4k|        _size++;
  390|  79.4k|    }
_ZN9prevectorILj36EhjiEaSEOS0_:
  237|  78.8k|    prevector& operator=(prevector<N, T, Size, Diff>&& other) noexcept {
  238|  78.8k|        if (!is_direct()) {
  ------------------
  |  Branch (238:13): [True: 0, False: 78.8k]
  ------------------
  239|      0|            free(_union.indirect_contents.indirect);
  240|      0|        }
  241|  78.8k|        _union = std::move(other._union);
  242|  78.8k|        _size = other._size;
  243|  78.8k|        other._size = 0;
  244|  78.8k|        return *this;
  245|  78.8k|    }
_ZNK9prevectorILj36EhjiE4dataEv:
  468|  53.5k|    const value_type* data() const {
  469|  53.5k|        return item_ptr(0);
  470|  53.5k|    }
_ZN9prevectorILj36EhjiE4fillITkNSt3__114input_iteratorENS0_14const_iteratorEEEvPhT_S5_:
  167|  92.7k|    void fill(T* dst, InputIterator first, InputIterator last) {
  168|  3.72M|        while (first != last) {
  ------------------
  |  Branch (168:16): [True: 3.62M, False: 92.7k]
  ------------------
  169|  3.62M|            new(static_cast<void*>(dst)) T(*first);
  170|  3.62M|            ++dst;
  171|  3.62M|            ++first;
  172|  3.62M|        }
  173|  92.7k|    }
_ZNK9prevectorILj36EhjiE14const_iteratoreqES1_:
  102|  4.05M|        bool operator==(const_iterator x) const { return ptr == x.ptr; }
_ZN9prevectorILj36EhjiE14const_iteratorppEv:
   92|  4.07M|        const_iterator& operator++() { ptr++; return *this; }
_ZNK9prevectorILj36EhjiEixEj:
  272|   194k|    const T& operator[](size_type pos) const {
  273|   194k|        return *item_ptr(pos);
  274|   194k|    }
_ZN9prevectorILj36EhjiE8item_ptrEi:
  159|  5.07M|    T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  ------------------
  |  Branch (159:47): [True: 2.21M, False: 2.85M]
  ------------------
_ZNK9prevectorILj36EhjiE9is_directEv:
  126|  14.9M|    bool is_direct() const { return _size <= N; }
_ZN9prevectorILj36EhjiE10direct_ptrEi:
  122|  2.30M|    T* direct_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.direct) + pos; }
_ZN9prevectorILj36EhjiE12indirect_ptrEi:
  124|  2.85M|    T* indirect_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.indirect_contents.indirect) + pos; }
_ZN9prevectorILj36EhjiE15change_capacityEj:
  128|   227k|    void change_capacity(size_type new_capacity) {
  129|   227k|        if (new_capacity <= N) {
  ------------------
  |  Branch (129:13): [True: 85.1k, False: 142k]
  ------------------
  130|  85.1k|            if (!is_direct()) {
  ------------------
  |  Branch (130:17): [True: 0, False: 85.1k]
  ------------------
  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|   142k|        } else {
  139|   142k|            if (!is_direct()) {
  ------------------
  |  Branch (139:17): [True: 46.4k, False: 96.3k]
  ------------------
  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|  46.4k|                _union.indirect_contents.indirect = static_cast<char*>(realloc(_union.indirect_contents.indirect, ((size_t)sizeof(T)) * new_capacity));
  144|  46.4k|                assert(_union.indirect_contents.indirect);
  ------------------
  |  Branch (144:17): [True: 46.4k, False: 0]
  ------------------
  145|  46.4k|                _union.indirect_contents.capacity = new_capacity;
  146|  96.3k|            } else {
  147|  96.3k|                char* new_indirect = static_cast<char*>(malloc(((size_t)sizeof(T)) * new_capacity));
  148|  96.3k|                assert(new_indirect);
  ------------------
  |  Branch (148:17): [True: 96.3k, False: 0]
  ------------------
  149|  96.3k|                T* src = direct_ptr(0);
  150|  96.3k|                T* dst = reinterpret_cast<T*>(new_indirect);
  151|  96.3k|                memcpy(dst, src, size() * sizeof(T));
  152|  96.3k|                _union.indirect_contents.indirect = new_indirect;
  153|  96.3k|                _union.indirect_contents.capacity = new_capacity;
  154|  96.3k|                _size += N + 1;
  155|  96.3k|            }
  156|   142k|        }
  157|   227k|    }
_ZNK9prevectorILj36EhjiE3endEv:
  258|   471k|    const_iterator end() const { return const_iterator(item_ptr(size())); }
_ZNK9prevectorILj36EhjiE8item_ptrEi:
  160|   892k|    const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  ------------------
  |  Branch (160:59): [True: 460k, False: 431k]
  ------------------
_ZNK9prevectorILj36EhjiE10direct_ptrEi:
  123|   460k|    const T* direct_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.direct) + pos; }
_ZNK9prevectorILj36EhjiE12indirect_ptrEi:
  125|   431k|    const T* indirect_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.indirect_contents.indirect) + pos; }
_ZNK9prevectorILj36EhjiE4sizeEv:
  247|  5.97M|    size_type size() const {
  248|  5.97M|        return is_direct() ? _size : _size - N - 1;
  ------------------
  |  Branch (248:16): [True: 2.71M, False: 3.26M]
  ------------------
  249|  5.97M|    }
_ZNK9prevectorILj36EhjiE5beginEv:
  256|   155k|    const_iterator begin() const { return const_iterator(item_ptr(0)); }
_ZNK9prevectorILj36EhjiE14const_iteratordeEv:
   89|  5.20M|        const T& operator*() const { return *ptr; }
_ZN9prevectorILj36EhjiEaSERKS0_:
  229|  6.97k|    prevector& operator=(const prevector<N, T, Size, Diff>& other) {
  230|  6.97k|        if (&other == this) {
  ------------------
  |  Branch (230:13): [True: 0, False: 6.97k]
  ------------------
  231|      0|            return *this;
  232|      0|        }
  233|  6.97k|        assign(other.begin(), other.end());
  234|  6.97k|        return *this;
  235|  6.97k|    }
_ZN9prevectorILj36EhjiE6assignITkNSt3__114input_iteratorENS0_14const_iteratorEEEvT_S4_:
  186|  6.97k|    void assign(InputIterator first, InputIterator last) {
  187|  6.97k|        size_type n = last - first;
  188|  6.97k|        clear();
  189|  6.97k|        if (capacity() < n) {
  ------------------
  |  Branch (189:13): [True: 3.89k, False: 3.07k]
  ------------------
  190|  3.89k|            change_capacity(n);
  191|  3.89k|        }
  192|  6.97k|        _size += n;
  193|  6.97k|        fill(item_ptr(0), first, last);
  194|  6.97k|    }
_ZNK9prevectorILj36EhjiEeqERKS0_:
  429|     46|    constexpr bool operator==(const prevector& other) const {
  430|     46|        return std::ranges::equal(*this, other);
  431|     46|    }
_ZNK9prevectorILj36EhjiE14const_iteratorssES1_:
  103|   190k|        auto operator<=>(const_iterator x) const { return ptr <=> x.ptr; }
_ZNK9prevectorILj36EhjiE14const_iteratorptEv:
   90|   186k|        const T* operator->() const { return ptr; }
_ZN9prevectorILj36EhjiEC2Ev:
  196|   371k|    prevector() = default;
_ZN9prevectorILj36EhjiE6insertENS0_8iteratorERKh:
  307|  1.04M|    iterator insert(iterator pos, const T& value) {
  308|  1.04M|        size_type p = pos - begin();
  309|  1.04M|        size_type new_size = size() + 1;
  310|  1.04M|        if (capacity() < new_size) {
  ------------------
  |  Branch (310:13): [True: 7.00k, False: 1.03M]
  ------------------
  311|  7.00k|            change_capacity(new_size + (new_size >> 1));
  312|  7.00k|        }
  313|  1.04M|        T* ptr = item_ptr(p);
  314|  1.04M|        T* dst = ptr + 1;
  315|  1.04M|        memmove(dst, ptr, (size() - p) * sizeof(T));
  316|  1.04M|        _size++;
  317|  1.04M|        new(static_cast<void*>(ptr)) T(value);
  318|  1.04M|        return iterator(ptr);
  319|  1.04M|    }
_ZmiN9prevectorILj36EhjiE8iteratorES1_:
   68|  1.67M|        difference_type friend operator-(iterator a, iterator b) { return (&(*a) - &(*b)); }
_ZNK9prevectorILj36EhjiE8iteratordeEv:
   61|  10.0M|        T& operator*() const { return *ptr; }
_ZNK9prevectorILj36EhjiE8capacityEv:
  260|  1.63M|    size_t capacity() const {
  261|  1.63M|        if (is_direct()) {
  ------------------
  |  Branch (261:13): [True: 735k, False: 895k]
  ------------------
  262|   735k|            return N;
  263|   895k|        } else {
  264|   895k|            return _union.indirect_contents.capacity;
  265|   895k|        }
  266|  1.63M|    }
_ZN9prevectorILj36EhjiE8iteratorC2EPh:
   60|  4.38M|        iterator(T* ptr_) : ptr(ptr_) {}
_ZN9prevectorILj36EhjiE6insertITkNSt3__114input_iteratorENS2_11__wrap_iterIPKhEEEEvNS0_8iteratorET_S8_:
  335|   375k|    void insert(iterator pos, InputIterator first, InputIterator last) {
  336|   375k|        size_type p = pos - begin();
  337|   375k|        difference_type count = last - first;
  338|   375k|        size_type new_size = size() + count;
  339|   375k|        if (capacity() < new_size) {
  ------------------
  |  Branch (339:13): [True: 61.5k, False: 313k]
  ------------------
  340|  61.5k|            change_capacity(new_size + (new_size >> 1));
  341|  61.5k|        }
  342|   375k|        T* ptr = item_ptr(p);
  343|   375k|        T* dst = ptr + count;
  344|   375k|        memmove(dst, ptr, (size() - p) * sizeof(T));
  345|   375k|        _size += count;
  346|   375k|        fill(ptr, first, last);
  347|   375k|    }
_ZN9prevectorILj36EhjiE4fillITkNSt3__114input_iteratorENS2_11__wrap_iterIPKhEEEEvPhT_S8_:
  167|   386k|    void fill(T* dst, InputIterator first, InputIterator last) {
  168|  16.3M|        while (first != last) {
  ------------------
  |  Branch (168:16): [True: 15.9M, False: 386k]
  ------------------
  169|  15.9M|            new(static_cast<void*>(dst)) T(*first);
  170|  15.9M|            ++dst;
  171|  15.9M|            ++first;
  172|  15.9M|        }
  173|   386k|    }
_ZN9prevectorILj36EhjiEC2ERKS0_:
  216|  85.7k|    prevector(const prevector<N, T, Size, Diff>& other) {
  217|  85.7k|        size_type n = other.size();
  218|  85.7k|        change_capacity(n);
  219|  85.7k|        _size += n;
  220|  85.7k|        fill(item_ptr(0), other.begin(),  other.end());
  221|  85.7k|    }
_ZN9prevectorILj36EhjiE3endEv:
  257|  1.67M|    iterator end() { return iterator(item_ptr(size())); }
_ZN9prevectorILj36EhjiE5beginEv:
  255|  1.67M|    iterator begin() { return iterator(item_ptr(0)); }
_ZN9prevectorILj36EhjiE5clearEv:
  303|  6.97k|    void clear() {
  304|  6.97k|        resize(0);
  305|  6.97k|    }
_ZN9prevectorILj36EhjiE6resizeEj:
  276|  6.97k|    void resize(size_type new_size) {
  277|  6.97k|        size_type cur_size = size();
  278|  6.97k|        if (cur_size == new_size) {
  ------------------
  |  Branch (278:13): [True: 6.97k, False: 0]
  ------------------
  279|  6.97k|            return;
  280|  6.97k|        }
  281|      0|        if (cur_size > new_size) {
  ------------------
  |  Branch (281:13): [True: 0, False: 0]
  ------------------
  282|      0|            erase(item_ptr(new_size), end());
  283|      0|            return;
  284|      0|        }
  285|      0|        if (new_size > capacity()) {
  ------------------
  |  Branch (285:13): [True: 0, False: 0]
  ------------------
  286|      0|            change_capacity(new_size);
  287|      0|        }
  288|      0|        ptrdiff_t increase = new_size - cur_size;
  289|      0|        fill(item_ptr(cur_size), increase);
  290|      0|        _size += increase;
  291|      0|    }
_ZN9prevectorILj36EhjiEC2ITkNSt3__114input_iteratorENS2_11__wrap_iterIPKhEEEET_S7_:
  209|  11.7k|    prevector(InputIterator first, InputIterator last) {
  210|  11.7k|        size_type n = last - first;
  211|  11.7k|        change_capacity(n);
  212|  11.7k|        _size += n;
  213|  11.7k|        fill(item_ptr(0), first, last);
  214|  11.7k|    }
_ZN9prevectorILj36EhjiED2Ev:
  422|  1.07M|    ~prevector() {
  423|  1.07M|        if (!is_direct()) {
  ------------------
  |  Branch (423:13): [True: 96.3k, False: 974k]
  ------------------
  424|  96.3k|            free(_union.indirect_contents.indirect);
  425|  96.3k|            _union.indirect_contents.indirect = nullptr;
  426|  96.3k|        }
  427|  1.07M|    }
_ZN9prevectorILj36EhjiE14const_iteratorC2EPKh:
   87|   743k|        const_iterator(const T* ptr_) : ptr(ptr_) {}
_ZN9prevectorILj36EhjiEC2ITkNSt3__114input_iteratorENS2_11__wrap_iterIPhEEEET_S6_:
  209|    450|    prevector(InputIterator first, InputIterator last) {
  210|    450|        size_type n = last - first;
  211|    450|        change_capacity(n);
  212|    450|        _size += n;
  213|    450|        fill(item_ptr(0), first, last);
  214|    450|    }
_ZN9prevectorILj36EhjiE4fillITkNSt3__114input_iteratorENS2_11__wrap_iterIPhEEEEvS4_T_S6_:
  167|    450|    void fill(T* dst, InputIterator first, InputIterator last) {
  168|  7.20k|        while (first != last) {
  ------------------
  |  Branch (168:16): [True: 6.75k, False: 450]
  ------------------
  169|  6.75k|            new(static_cast<void*>(dst)) T(*first);
  170|  6.75k|            ++dst;
  171|  6.75k|            ++first;
  172|  6.75k|        }
  173|    450|    }
_ZNK9prevectorILj36EhjiE14const_iteratorplEj:
   97|   117k|        const_iterator operator+(size_type n) const { return const_iterator(ptr + n); }
_ZmiN9prevectorILj36EhjiE14const_iteratorES1_:
   96|   500k|        difference_type friend operator-(const_iterator a, const_iterator b) { return (&(*a) - &(*b)); }
_ZN9prevectorILj36EhjiE14const_iteratorppEi:
   94|   188k|        const_iterator operator++(int) { const_iterator copy(*this); ++(*this); return copy; }
_ZNK9prevectorILj36EhjiE14const_iteratorixEj:
   91|    429|        const T& operator[](size_type pos) const { return ptr[pos]; }
_ZN9prevectorILj36EhjiE14const_iteratorpLEj:
   99|   172k|        const_iterator& operator+=(size_type n) { ptr += n; return *this; }

_ZNK11XOnlyPubKey11GetCPubKeysEv:
  201|   200k|{
  202|   200k|    std::vector<CPubKey> out;
  203|   200k|    unsigned char b[33] = {0x02};
  204|   200k|    std::copy(m_keydata.begin(), m_keydata.end(), b + 1);
  205|   200k|    CPubKey fullpubkey;
  206|   200k|    fullpubkey.Set(b, b + 33);
  207|   200k|    out.push_back(fullpubkey);
  208|   200k|    b[0] = 0x03;
  209|   200k|    fullpubkey.Set(b, b + 33);
  210|   200k|    out.push_back(fullpubkey);
  211|   200k|    return out;
  212|   200k|}
_ZNK11XOnlyPubKey9GetKeyIDsEv:
  215|   200k|{
  216|   200k|    std::vector<CKeyID> out;
  217|   400k|    for (const CPubKey& pk : GetCPubKeys()) {
  ------------------
  |  Branch (217:28): [True: 400k, False: 200k]
  ------------------
  218|   400k|        out.push_back(pk.GetID());
  219|   400k|    }
  220|   200k|    return out;
  221|   200k|}
_ZNK11XOnlyPubKey27GetEvenCorrespondingCPubKeyEv:
  224|   157k|{
  225|   157k|    unsigned char full_key[CPubKey::COMPRESSED_SIZE] = {0x02};
  226|   157k|    std::copy(begin(), end(), full_key + 1);
  227|   157k|    return CPubKey{full_key};
  228|   157k|}
_ZNK11XOnlyPubKey12IsFullyValidEv:
  231|  76.2k|{
  232|  76.2k|    secp256k1_xonly_pubkey pubkey;
  233|  76.2k|    return secp256k1_xonly_pubkey_parse(secp256k1_context_static, &pubkey, m_keydata.data());
  234|  76.2k|}
_ZNK11XOnlyPubKey19ComputeTapTweakHashEPK7uint256:
  247|  75.3k|{
  248|  75.3k|    if (merkle_root == nullptr) {
  ------------------
  |  Branch (248:9): [True: 49.3k, False: 26.0k]
  ------------------
  249|       |        // We have no scripts. The actual tweak does not matter, but follow BIP341 here to
  250|       |        // allow for reproducible tweaking.
  251|  49.3k|        return (HashWriter{HASHER_TAPTWEAK} << m_keydata).GetSHA256();
  252|  49.3k|    } else {
  253|  26.0k|        return (HashWriter{HASHER_TAPTWEAK} << m_keydata << *merkle_root).GetSHA256();
  254|  26.0k|    }
  255|  75.3k|}
_ZNK11XOnlyPubKey14CreateTapTweakEPK7uint256:
  266|  75.3k|{
  267|  75.3k|    secp256k1_xonly_pubkey base_point;
  268|  75.3k|    if (!secp256k1_xonly_pubkey_parse(secp256k1_context_static, &base_point, data())) return std::nullopt;
  ------------------
  |  Branch (268:9): [True: 0, False: 75.3k]
  ------------------
  269|  75.3k|    secp256k1_pubkey out;
  270|  75.3k|    uint256 tweak = ComputeTapTweakHash(merkle_root);
  271|  75.3k|    if (!secp256k1_xonly_pubkey_tweak_add(secp256k1_context_static, &out, &base_point, tweak.data())) return std::nullopt;
  ------------------
  |  Branch (271:9): [True: 0, False: 75.3k]
  ------------------
  272|  75.3k|    int parity = -1;
  273|  75.3k|    std::pair<XOnlyPubKey, bool> ret;
  274|  75.3k|    secp256k1_xonly_pubkey out_xonly;
  275|  75.3k|    if (!secp256k1_xonly_pubkey_from_pubkey(secp256k1_context_static, &out_xonly, &parity, &out)) return std::nullopt;
  ------------------
  |  Branch (275:9): [True: 0, False: 75.3k]
  ------------------
  276|  75.3k|    secp256k1_xonly_pubkey_serialize(secp256k1_context_static, ret.first.begin(), &out_xonly);
  277|  75.3k|    assert(parity == 0 || parity == 1);
  ------------------
  |  Branch (277:5): [True: 37.8k, False: 37.5k]
  |  Branch (277:5): [True: 37.5k, False: 0]
  |  Branch (277:5): [True: 75.3k, False: 0]
  ------------------
  278|  75.3k|    ret.second = parity;
  279|  75.3k|    return ret;
  280|  75.3k|}
_ZNK7CPubKey12IsFullyValidEv:
  320|   110k|bool CPubKey::IsFullyValid() const {
  321|   110k|    if (!IsValid())
  ------------------
  |  Branch (321:9): [True: 31.2k, False: 79.5k]
  ------------------
  322|  31.2k|        return false;
  323|  79.5k|    secp256k1_pubkey pubkey;
  324|  79.5k|    return secp256k1_ec_pubkey_parse(secp256k1_context_static, &pubkey, vch, size());
  325|   110k|}
_ZNK7CPubKey6DeriveERS_R9ChainCodejRKS1_P7uint256:
  341|   194k|bool CPubKey::Derive(CPubKey& pubkeyChild, ChainCode &ccChild, unsigned int nChild, const ChainCode& cc, uint256* bip32_tweak_out) const {
  342|   194k|    assert(IsValid());
  ------------------
  |  Branch (342:5): [True: 194k, False: 0]
  ------------------
  343|   194k|    assert((nChild >> 31) == 0);
  ------------------
  |  Branch (343:5): [True: 194k, False: 0]
  ------------------
  344|   194k|    assert(size() == COMPRESSED_SIZE);
  ------------------
  |  Branch (344:5): [True: 194k, False: 0]
  ------------------
  345|   194k|    unsigned char out[64];
  346|   194k|    BIP32Hash(cc, nChild, *begin(), begin()+1, out);
  347|   194k|    memcpy(ccChild.begin(), out+32, 32);
  348|   194k|    if (bip32_tweak_out) {
  ------------------
  |  Branch (348:9): [True: 0, False: 194k]
  ------------------
  349|      0|        memcpy(bip32_tweak_out->begin(), out, 32);
  350|      0|    }
  351|   194k|    secp256k1_pubkey pubkey;
  352|   194k|    if (!secp256k1_ec_pubkey_parse(secp256k1_context_static, &pubkey, vch, size())) {
  ------------------
  |  Branch (352:9): [True: 0, False: 194k]
  ------------------
  353|      0|        return false;
  354|      0|    }
  355|   194k|    if (!secp256k1_ec_pubkey_tweak_add(secp256k1_context_static, &pubkey, out)) {
  ------------------
  |  Branch (355:9): [True: 0, False: 194k]
  ------------------
  356|      0|        return false;
  357|      0|    }
  358|   194k|    unsigned char pub[COMPRESSED_SIZE];
  359|   194k|    size_t publen = COMPRESSED_SIZE;
  360|   194k|    secp256k1_ec_pubkey_serialize(secp256k1_context_static, pub, &publen, &pubkey, SECP256K1_EC_COMPRESSED);
  ------------------
  |  |  216|   194k|#define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  197|   194k|#define SECP256K1_FLAGS_TYPE_COMPRESSION (1 << 1)
  |  |  ------------------
  |  |               #define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  202|   194k|#define SECP256K1_FLAGS_BIT_COMPRESSION (1 << 8)
  |  |  ------------------
  ------------------
  361|   194k|    pubkeyChild.Set(pub, pub + publen);
  362|   194k|    return true;
  363|   194k|}
_ZNK10CExtPubKey6EncodeEPh:
  385|   899k|void CExtPubKey::Encode(unsigned char code[BIP32_EXTKEY_SIZE]) const {
  386|   899k|    code[0] = nDepth;
  387|   899k|    std::ranges::copy(fingerprint, code+1);
  388|   899k|    WriteBE32(code+5, nChild);
  389|   899k|    memcpy(code+9, chaincode.begin(), 32);
  390|   899k|    assert(pubkey.size() == CPubKey::COMPRESSED_SIZE);
  ------------------
  |  Branch (390:5): [True: 899k, False: 0]
  ------------------
  391|   899k|    memcpy(code+41, pubkey.begin(), CPubKey::COMPRESSED_SIZE);
  392|   899k|}
_ZNK10CExtPubKey6DeriveERS_jP7uint256:
  415|   194k|bool CExtPubKey::Derive(CExtPubKey &out, unsigned int _nChild, uint256* bip32_tweak_out) const {
  416|   194k|    if (nDepth == std::numeric_limits<unsigned char>::max()) return false;
  ------------------
  |  Branch (416:9): [True: 0, False: 194k]
  ------------------
  417|   194k|    out.nDepth = nDepth + 1;
  418|   194k|    out.fingerprint = id_key_fingerprint();
  419|   194k|    out.nChild = _nChild;
  420|   194k|    return pubkey.Derive(out.pubkey, out.chaincode, _nChild, chaincode, bip32_tweak_out);
  421|   194k|}

_ZNK7CPubKey16IsValidNonHybridEv:
  198|  61.9k|    {
  199|  61.9k|        return size() > 0 && (vch[0] == 0x02 || vch[0] == 0x03 || vch[0] == 0x04);
  ------------------
  |  Branch (199:16): [True: 61.9k, False: 0]
  |  Branch (199:31): [True: 11.7k, False: 50.2k]
  |  Branch (199:49): [True: 50.0k, False: 170]
  |  Branch (199:67): [True: 166, False: 4]
  ------------------
  200|  61.9k|    }
_ZN11XOnlyPubKeyC2ERK7CPubKey:
  262|   367k|    explicit XOnlyPubKey(const CPubKey& pubkey) : XOnlyPubKey(std::span{pubkey}.subspan(1, 32)) {}
_ZN7CPubKey9ValidSizeERKNSt3__16vectorIhNS0_9allocatorIhEEEE:
   83|  10.8k|    bool static ValidSize(const std::vector<unsigned char> &vch) {
   84|  10.8k|      return vch.size() > 0 && GetLen(vch[0]) == vch.size();
  ------------------
  |  Branch (84:14): [True: 8.98k, False: 1.81k]
  |  Branch (84:32): [True: 8.85k, False: 134]
  ------------------
   85|  10.8k|    }
_ZeqRK7CPubKeyS1_:
  126|  1.31M|    {
  127|  1.31M|        return a.vch[0] == b.vch[0] &&
  ------------------
  |  Branch (127:16): [True: 1.31M, False: 0]
  ------------------
  128|  1.31M|               memcmp(a.vch, b.vch, a.size()) == 0;
  ------------------
  |  Branch (128:16): [True: 1.31M, False: 0]
  ------------------
  129|  1.31M|    }
_ZNK11XOnlyPubKeyeqERKS_:
  306|  25.1k|    bool operator==(const XOnlyPubKey& other) const { return m_keydata == other.m_keydata; }
_ZN7CPubKeyC2INSt3__111__wrap_iterIPhEEEET_S5_:
  107|  2.73k|    {
  108|  2.73k|        Set(pbegin, pend);
  109|  2.73k|    }
_ZN7CPubKey3SetINSt3__111__wrap_iterIPhEEEEvT_S5_:
   96|  2.73k|    {
   97|  2.73k|        int len = pend == pbegin ? 0 : GetLen(pbegin[0]);
  ------------------
  |  Branch (97:19): [True: 0, False: 2.73k]
  ------------------
   98|  2.73k|        if (len && len == (pend - pbegin))
  ------------------
  |  Branch (98:13): [True: 2.73k, False: 0]
  |  Branch (98:20): [True: 2.73k, False: 0]
  ------------------
   99|  2.73k|            memcpy(vch, (unsigned char*)&pbegin[0], len);
  100|      0|        else
  101|      0|            Invalidate();
  102|  2.73k|    }
_ZltRK7CPubKeyS1_:
  131|  58.8M|    {
  132|  58.8M|        return a.vch[0] < b.vch[0] ||
  ------------------
  |  Branch (132:16): [True: 11.6M, False: 47.2M]
  ------------------
  133|  47.2M|               (a.vch[0] == b.vch[0] && memcmp(a.vch, b.vch, a.size()) < 0);
  ------------------
  |  Branch (133:17): [True: 36.3M, False: 10.9M]
  |  Branch (133:41): [True: 14.7M, False: 21.6M]
  ------------------
  134|  58.8M|    }
_ZNK11XOnlyPubKeyltERKS_:
  307|  11.1M|    bool operator<(const XOnlyPubKey& other) const { return m_keydata < other.m_keydata; }
_ZNK7CPubKey3endEv:
  121|  24.1k|    const unsigned char* end() const { return vch + size(); }
_ZNK7CPubKey12IsCompressedEv:
  207|  54.4k|    {
  208|  54.4k|        return size() == COMPRESSED_SIZE;
  209|  54.4k|    }
_ZNK7CPubKey4dataEv:
  119|  1.18M|    const unsigned char* data() const { return vch; }
_ZN11XOnlyPubKey4sizeEv:
  299|  9.81k|    static constexpr size_t size() { return decltype(m_keydata)::size(); }
_ZN7CPubKey6GetLenEh:
   67|  67.9M|    {
   68|  67.9M|        if (chHeader == 2 || chHeader == 3)
  ------------------
  |  Branch (68:13): [True: 27.4M, False: 40.4M]
  |  Branch (68:30): [True: 39.9M, False: 550k]
  ------------------
   69|  67.4M|            return COMPRESSED_SIZE;
   70|   550k|        if (chHeader == 4 || chHeader == 6 || chHeader == 7)
  ------------------
  |  Branch (70:13): [True: 1.16k, False: 548k]
  |  Branch (70:30): [True: 168, False: 548k]
  |  Branch (70:47): [True: 362, False: 548k]
  ------------------
   71|  1.69k|            return SIZE;
   72|   548k|        return 0;
   73|   550k|    }
_ZN7CPubKey10InvalidateEv:
   77|  11.6M|    {
   78|  11.6M|        vch[0] = 0xFF;
   79|  11.6M|    }
_ZN7CPubKeyC2ENSt3__14spanIKhLm18446744073709551615EEE:
  113|   245k|    {
  114|   245k|        Set(_vch.begin(), _vch.end());
  115|   245k|    }
_ZNK7CPubKey4sizeEv:
  118|  67.0M|    unsigned int size() const { return GetLen(vch[0]); }
_ZNK7CPubKey7IsValidEv:
  192|  8.15M|    {
  193|  8.15M|        return size() > 0;
  194|  8.15M|    }
_ZN7CPubKey3SetINSt3__111__wrap_iterIPKhEEEEvT_S6_:
   96|   245k|    {
   97|   245k|        int len = pend == pbegin ? 0 : GetLen(pbegin[0]);
  ------------------
  |  Branch (97:19): [True: 0, False: 245k]
  ------------------
   98|   245k|        if (len && len == (pend - pbegin))
  ------------------
  |  Branch (98:13): [True: 216k, False: 29.6k]
  |  Branch (98:20): [True: 214k, False: 1.61k]
  ------------------
   99|   214k|            memcpy(vch, (unsigned char*)&pbegin[0], len);
  100|  31.2k|        else
  101|  31.2k|            Invalidate();
  102|   245k|    }
_ZN7CPubKeyC2Ev:
   89|  11.5M|    {
   90|  11.5M|        Invalidate();
   91|  11.5M|    }
_ZNK7CPubKey5GetIDEv:
  167|  11.3M|    {
  168|  11.3M|        return CKeyID(Hash160(std::span{vch}.first(size())));
  169|  11.3M|    }
_ZN6CKeyIDC2ERK7uint160:
   29|  11.3M|    explicit CKeyID(const uint160& in) : uint160(in) {}
_ZNK11XOnlyPubKey5beginEv:
  301|   483k|    const unsigned char* begin() const { return m_keydata.begin(); }
_ZNK11XOnlyPubKey3endEv:
  302|   483k|    const unsigned char* end() const { return m_keydata.end(); }
_ZNK11XOnlyPubKey4dataEv:
  300|  85.1k|    const unsigned char* data() const { return m_keydata.begin(); }
_ZN11XOnlyPubKeyC2Ev:
  244|   356k|    XOnlyPubKey() = default;
_ZN11XOnlyPubKey5beginEv:
  304|   104k|    unsigned char* begin() { return m_keydata.begin(); }
_ZNK7CPubKey5beginEv:
  120|  9.39M|    const unsigned char* begin() const { return vch; }
_ZNK10CExtPubKey18id_key_fingerprintEv:
  370|  1.80M|    {
  371|  1.80M|        return pubkey.GetID().fingerprint();
  372|  1.80M|    }
_ZNK6CKeyID11fingerprintEv:
   31|  4.64M|    {
   32|  4.64M|        KeyFingerprint ret;
   33|  4.64M|        std::copy_n(begin(), ret.size(), ret.begin());
   34|  4.64M|        return ret;
   35|  4.64M|    }
_ZN7CPubKey3SetIPhEEvT_S2_:
   96|   687k|    {
   97|   687k|        int len = pend == pbegin ? 0 : GetLen(pbegin[0]);
  ------------------
  |  Branch (97:19): [True: 0, False: 687k]
  ------------------
   98|   687k|        if (len && len == (pend - pbegin))
  ------------------
  |  Branch (98:13): [True: 687k, False: 0]
  |  Branch (98:20): [True: 687k, False: 0]
  ------------------
   99|   687k|            memcpy(vch, (unsigned char*)&pbegin[0], len);
  100|      0|        else
  101|      0|            Invalidate();
  102|   687k|    }
_ZN7CPubKeyC2IPhEET_S2_:
  107|  61.5k|    {
  108|  61.5k|        Set(pbegin, pend);
  109|  61.5k|    }
_ZN11XOnlyPubKeyC2ENSt3__14spanIKhLm18446744073709551615EEE:
  259|   495k|    constexpr explicit XOnlyPubKey(std::span<const unsigned char> bytes) : m_keydata{bytes} {}

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

_Z13CheckChecksumRNSt3__14spanIKcLm18446744073709551615EEEbRNS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPS9_:
 2925|  24.4k|{
 2926|  24.4k|    auto check_split = Split(sp, '#');
 2927|  24.4k|    if (check_split.size() > 2) {
  ------------------
  |  Branch (2927:9): [True: 84, False: 24.3k]
  ------------------
 2928|     84|        error = "Multiple '#' symbols";
 2929|     84|        return false;
 2930|     84|    }
 2931|  24.3k|    if (check_split.size() == 1 && require_checksum){
  ------------------
  |  Branch (2931:9): [True: 24.2k, False: 118]
  |  Branch (2931:36): [True: 12.1k, False: 12.1k]
  ------------------
 2932|  12.1k|        error = "Missing checksum";
 2933|  12.1k|        return false;
 2934|  12.1k|    }
 2935|  12.2k|    if (check_split.size() == 2) {
  ------------------
  |  Branch (2935:9): [True: 118, False: 12.1k]
  ------------------
 2936|    118|        if (check_split[1].size() != 8) {
  ------------------
  |  Branch (2936:13): [True: 10, False: 108]
  ------------------
 2937|     10|            error = strprintf("Expected 8 character checksum, not %u characters", check_split[1].size());
  ------------------
  |  | 1172|     10|#define strprintf tfm::format
  ------------------
 2938|     10|            return false;
 2939|     10|        }
 2940|    118|    }
 2941|  12.2k|    auto checksum = DescriptorChecksum(check_split[0]);
 2942|  12.2k|    if (checksum.empty()) {
  ------------------
  |  Branch (2942:9): [True: 63, False: 12.1k]
  ------------------
 2943|     63|        error = "Invalid characters in payload";
 2944|     63|        return false;
 2945|     63|    }
 2946|  12.1k|    if (check_split.size() == 2) {
  ------------------
  |  Branch (2946:9): [True: 106, False: 12.0k]
  ------------------
 2947|    106|        if (!std::equal(checksum.begin(), checksum.end(), check_split[1].begin())) {
  ------------------
  |  Branch (2947:13): [True: 32, False: 74]
  ------------------
 2948|     32|            error = strprintf("Provided checksum '%s' does not match computed checksum '%s'", std::string(check_split[1].begin(), check_split[1].end()), checksum);
  ------------------
  |  | 1172|     32|#define strprintf tfm::format
  ------------------
 2949|     32|            return false;
 2950|     32|        }
 2951|    106|    }
 2952|  12.1k|    if (out_checksum) *out_checksum = std::move(checksum);
  ------------------
  |  Branch (2952:9): [True: 0, False: 12.1k]
  ------------------
 2953|  12.1k|    sp = check_split[0];
 2954|  12.1k|    return true;
 2955|  12.1k|}
_Z5ParseNSt3__117basic_string_viewIcNS_11char_traitsIcEEEER19FlatSigningProviderRNS_12basic_stringIcS2_NS_9allocatorIcEEEEb:
 2958|  24.4k|{
 2959|  24.4k|    std::span<const char> sp{descriptor};
 2960|  24.4k|    if (!CheckChecksum(sp, require_checksum, error)) return {};
  ------------------
  |  Branch (2960:9): [True: 12.2k, False: 12.1k]
  ------------------
 2961|  12.1k|    uint32_t key_exp_index = 0;
 2962|  12.1k|    auto ret = ParseScript(key_exp_index, sp, ParseScriptContext::TOP, out, error);
 2963|  12.1k|    if (sp.empty() && !ret.empty()) {
  ------------------
  |  Branch (2963:9): [True: 11.4k, False: 633]
  |  Branch (2963:23): [True: 5.54k, False: 5.93k]
  ------------------
 2964|  5.54k|        std::vector<std::unique_ptr<Descriptor>> descs;
 2965|  5.54k|        descs.reserve(ret.size());
 2966|  33.0k|        for (auto& r : ret) {
  ------------------
  |  Branch (2966:22): [True: 33.0k, False: 5.54k]
  ------------------
 2967|  33.0k|            descs.emplace_back(std::unique_ptr<Descriptor>(std::move(r)));
 2968|  33.0k|        }
 2969|  5.54k|        return descs;
 2970|  5.54k|    }
 2971|  6.57k|    return {};
 2972|  12.1k|}
_Z15InferDescriptorRK7CScriptRK15SigningProvider:
 2984|  33.0k|{
 2985|  33.0k|    return InferScript(script, ParseScriptContext::TOP, provider);
 2986|  33.0k|}
_ZN15DescriptorCache20CacheParentExtPubKeyEjRK10CExtPubKey:
 2997|   690k|{
 2998|   690k|    m_parent_xpubs[key_exp_pos] = xpub;
 2999|   690k|}
_ZN15DescriptorCache21CacheDerivedExtPubKeyEjjRK10CExtPubKey:
 3002|  12.2k|{
 3003|  12.2k|    auto& xpubs = m_derived_xpubs[key_exp_pos];
 3004|  12.2k|    xpubs[der_index] = xpub;
 3005|  12.2k|}
_ZN15DescriptorCache26CacheLastHardenedExtPubKeyEjRK10CExtPubKey:
 3008|   630k|{
 3009|   630k|    m_last_hardened_xpubs[key_exp_pos] = xpub;
 3010|   630k|}
_ZNK15DescriptorCache24GetCachedParentExtPubKeyEjR10CExtPubKey:
 3013|   436k|{
 3014|   436k|    const auto& it = m_parent_xpubs.find(key_exp_pos);
 3015|   436k|    if (it == m_parent_xpubs.end()) return false;
  ------------------
  |  Branch (3015:9): [True: 0, False: 436k]
  ------------------
 3016|   436k|    xpub = it->second;
 3017|   436k|    return true;
 3018|   436k|}
_ZNK15DescriptorCache25GetCachedDerivedExtPubKeyEjjR10CExtPubKey:
 3021|   448k|{
 3022|   448k|    const auto& key_exp_it = m_derived_xpubs.find(key_exp_pos);
 3023|   448k|    if (key_exp_it == m_derived_xpubs.end()) return false;
  ------------------
  |  Branch (3023:9): [True: 436k, False: 12.2k]
  ------------------
 3024|  12.2k|    const auto& der_it = key_exp_it->second.find(der_index);
 3025|  12.2k|    if (der_it == key_exp_it->second.end()) return false;
  ------------------
  |  Branch (3025:9): [True: 0, False: 12.2k]
  ------------------
 3026|  12.2k|    xpub = der_it->second;
 3027|  12.2k|    return true;
 3028|  12.2k|}
descriptor.cpp:_ZN12_GLOBAL__N_118DescriptorChecksumERKNSt3__14spanIKcLm18446744073709551615EEE:
  125|   110k|{
  126|       |    /** A character set designed such that:
  127|       |     *  - The most common 'unprotected' descriptor characters (hex, keypaths) are in the first group of 32.
  128|       |     *  - Case errors cause an offset that's a multiple of 32.
  129|       |     *  - As many alphabetic characters are in the same group (while following the above restrictions).
  130|       |     *
  131|       |     * If p(x) gives the position of a character c in this character set, every group of 3 characters
  132|       |     * (a,b,c) is encoded as the 4 symbols (p(a) & 31, p(b) & 31, p(c) & 31, (p(a) / 32) + 3 * (p(b) / 32) + 9 * (p(c) / 32).
  133|       |     * This means that changes that only affect the lower 5 bits of the position, or only the higher 2 bits, will just
  134|       |     * affect a single symbol.
  135|       |     *
  136|       |     * As a result, within-group-of-32 errors count as 1 symbol, as do cross-group errors that don't affect
  137|       |     * the position within the groups.
  138|       |     */
  139|   110k|    static const std::string INPUT_CHARSET =
  140|   110k|        "0123456789()[],'/*abcdefgh@:$%{}"
  141|   110k|        "IJKLMNOPQRSTUVWXYZ&+-.;<=>?!^_|~"
  142|   110k|        "ijklmnopqrstuvwxyzABCDEFGH`#\"\\ ";
  143|       |
  144|       |    /** The character set for the checksum itself (same as bech32). */
  145|   110k|    static const std::string CHECKSUM_CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l";
  146|       |
  147|   110k|    uint64_t c = 1;
  148|   110k|    int cls = 0;
  149|   110k|    int clscount = 0;
  150|   265M|    for (auto ch : span) {
  ------------------
  |  Branch (150:18): [True: 265M, False: 110k]
  ------------------
  151|   265M|        auto pos = INPUT_CHARSET.find(ch);
  152|   265M|        if (pos == std::string::npos) return "";
  ------------------
  |  Branch (152:13): [True: 63, False: 265M]
  ------------------
  153|   265M|        c = PolyMod(c, pos & 31); // Emit a symbol for the position inside the group, for every character.
  154|   265M|        cls = cls * 3 + (pos >> 5); // Accumulate the group numbers
  155|   265M|        if (++clscount == 3) {
  ------------------
  |  Branch (155:13): [True: 88.6M, False: 177M]
  ------------------
  156|       |            // Emit an extra symbol representing the group numbers, for every 3 characters.
  157|  88.6M|            c = PolyMod(c, cls);
  158|  88.6M|            cls = 0;
  159|  88.6M|            clscount = 0;
  160|  88.6M|        }
  161|   265M|    }
  162|   110k|    if (clscount > 0) c = PolyMod(c, cls);
  ------------------
  |  Branch (162:9): [True: 75.0k, False: 35.7k]
  ------------------
  163|   997k|    for (int j = 0; j < 8; ++j) c = PolyMod(c, 0); // Shift further to determine the checksum.
  ------------------
  |  Branch (163:21): [True: 886k, False: 110k]
  ------------------
  164|   110k|    c ^= 1; // Prevent appending zeroes from not affecting the checksum.
  165|       |
  166|   110k|    std::string ret(8, ' ');
  167|   997k|    for (int j = 0; j < 8; ++j) ret[j] = CHECKSUM_CHARSET[(c >> (5 * (7 - j))) & 31];
  ------------------
  |  Branch (167:21): [True: 886k, False: 110k]
  ------------------
  168|   110k|    return ret;
  169|   110k|}
descriptor.cpp:_ZN12_GLOBAL__N_17PolyModEmi:
  113|   355M|{
  114|   355M|    uint8_t c0 = c >> 35;
  115|   355M|    c = ((c & 0x7ffffffff) << 5) ^ val;
  116|   355M|    if (c0 & 1) c ^= 0xf5dee51989;
  ------------------
  |  Branch (116:9): [True: 177M, False: 177M]
  ------------------
  117|   355M|    if (c0 & 2) c ^= 0xa9fdca3312;
  ------------------
  |  Branch (117:9): [True: 177M, False: 177M]
  ------------------
  118|   355M|    if (c0 & 4) c ^= 0x1bab10e32d;
  ------------------
  |  Branch (118:9): [True: 176M, False: 178M]
  ------------------
  119|   355M|    if (c0 & 8) c ^= 0x3706b1677a;
  ------------------
  |  Branch (119:9): [True: 177M, False: 178M]
  ------------------
  120|   355M|    if (c0 & 16) c ^= 0x644d626ffd;
  ------------------
  |  Branch (120:9): [True: 177M, False: 178M]
  ------------------
  121|   355M|    return c;
  122|   355M|}
descriptor.cpp:_ZN12_GLOBAL__N_111ParseScriptERjRNSt3__14spanIKcLm18446744073709551615EEENS_18ParseScriptContextER19FlatSigningProviderRNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 2339|  21.2k|{
 2340|  21.2k|    using namespace script;
 2341|  21.2k|    Assume(ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH || ctx == ParseScriptContext::P2WSH || ctx == ParseScriptContext::P2TR);
  ------------------
  |  |  128|  88.0k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  |  |  ------------------
  |  |  |  Branch (128:51): [True: 12.1k, False: 9.15k]
  |  |  |  Branch (128:51): [True: 656, False: 8.50k]
  |  |  |  Branch (128:51): [True: 1.90k, False: 6.59k]
  |  |  |  Branch (128:51): [True: 6.59k, False: 0]
  |  |  ------------------
  ------------------
 2342|  21.2k|    std::vector<std::unique_ptr<DescriptorImpl>> ret;
 2343|  21.2k|    auto expr = Expr(sp);
 2344|  21.2k|    if (Func("pk", expr)) {
  ------------------
  |  Branch (2344:9): [True: 2.64k, False: 18.6k]
  ------------------
 2345|  2.64k|        auto pubkeys = ParsePubkey(key_exp_index, expr, ctx, out, error);
 2346|  2.64k|        if (pubkeys.empty()) {
  ------------------
  |  Branch (2346:13): [True: 195, False: 2.44k]
  ------------------
 2347|    195|            error = strprintf("pk(): %s", error);
  ------------------
  |  | 1172|    195|#define strprintf tfm::format
  ------------------
 2348|    195|            return {};
 2349|    195|        }
 2350|  4.08k|        for (auto& pubkey : pubkeys) {
  ------------------
  |  Branch (2350:27): [True: 4.08k, False: 2.44k]
  ------------------
 2351|  4.08k|            ret.emplace_back(std::make_unique<PKDescriptor>(std::move(pubkey), ctx == ParseScriptContext::P2TR));
 2352|  4.08k|        }
 2353|  2.44k|        return ret;
 2354|  2.64k|    }
 2355|  18.6k|    if ((ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH || ctx == ParseScriptContext::P2WSH) && Func("pkh", expr)) {
  ------------------
  |  Branch (2355:9): [True: 98, False: 18.5k]
  |  Branch (2355:10): [True: 11.8k, False: 6.81k]
  |  Branch (2355:44): [True: 599, False: 6.21k]
  |  Branch (2355:79): [True: 1.76k, False: 4.44k]
  |  Branch (2355:116): [True: 98, False: 14.0k]
  ------------------
 2356|     98|        auto pubkeys = ParsePubkey(key_exp_index, expr, ctx, out, error);
 2357|     98|        if (pubkeys.empty()) {
  ------------------
  |  Branch (2357:13): [True: 6, False: 92]
  ------------------
 2358|      6|            error = strprintf("pkh(): %s", error);
  ------------------
  |  | 1172|      6|#define strprintf tfm::format
  ------------------
 2359|      6|            return {};
 2360|      6|        }
 2361|    498|        for (auto& pubkey : pubkeys) {
  ------------------
  |  Branch (2361:27): [True: 498, False: 92]
  ------------------
 2362|    498|            ret.emplace_back(std::make_unique<PKHDescriptor>(std::move(pubkey)));
 2363|    498|        }
 2364|     92|        return ret;
 2365|     98|    }
 2366|  18.5k|    if (ctx == ParseScriptContext::TOP && Func("combo", expr)) {
  ------------------
  |  Branch (2366:9): [True: 11.8k, False: 6.73k]
  |  Branch (2366:9): [True: 103, False: 18.4k]
  |  Branch (2366:43): [True: 103, False: 11.6k]
  ------------------
 2367|    103|        auto pubkeys = ParsePubkey(key_exp_index, expr, ctx, out, error);
 2368|    103|        if (pubkeys.empty()) {
  ------------------
  |  Branch (2368:13): [True: 7, False: 96]
  ------------------
 2369|      7|            error = strprintf("combo(): %s", error);
  ------------------
  |  | 1172|      7|#define strprintf tfm::format
  ------------------
 2370|      7|            return {};
 2371|      7|        }
 2372|    535|        for (auto& pubkey : pubkeys) {
  ------------------
  |  Branch (2372:27): [True: 535, False: 96]
  ------------------
 2373|    535|            ret.emplace_back(std::make_unique<ComboDescriptor>(std::move(pubkey)));
 2374|    535|        }
 2375|     96|        return ret;
 2376|  18.4k|    } else if (Func("combo", expr)) {
  ------------------
  |  Branch (2376:16): [True: 1, False: 18.4k]
  ------------------
 2377|      1|        error = "Can only have combo() at top level";
 2378|      1|        return {};
 2379|      1|    }
 2380|  18.4k|    const bool multi = Func("multi", expr);
 2381|  18.4k|    const bool sortedmulti = !multi && Func("sortedmulti", expr);
  ------------------
  |  Branch (2381:30): [True: 17.8k, False: 561]
  |  Branch (2381:40): [True: 221, False: 17.6k]
  ------------------
 2382|  18.4k|    const bool multi_a = !(multi || sortedmulti) && Func("multi_a", expr);
  ------------------
  |  Branch (2382:28): [True: 561, False: 17.8k]
  |  Branch (2382:37): [True: 221, False: 17.6k]
  |  Branch (2382:53): [True: 564, False: 17.0k]
  ------------------
 2383|  18.4k|    const bool sortedmulti_a = !(multi || sortedmulti || multi_a) && Func("sortedmulti_a", expr);
  ------------------
  |  Branch (2383:34): [True: 561, False: 17.8k]
  |  Branch (2383:43): [True: 221, False: 17.6k]
  |  Branch (2383:58): [True: 564, False: 17.0k]
  |  Branch (2383:70): [True: 1.09k, False: 15.9k]
  ------------------
 2384|  18.4k|    if (((ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH || ctx == ParseScriptContext::P2WSH) && (multi || sortedmulti)) ||
  ------------------
  |  Branch (2384:11): [True: 11.6k, False: 6.73k]
  |  Branch (2384:45): [True: 559, False: 6.17k]
  |  Branch (2384:80): [True: 1.73k, False: 4.44k]
  |  Branch (2384:118): [True: 560, False: 13.4k]
  |  Branch (2384:127): [True: 220, False: 13.2k]
  ------------------
 2385|  17.6k|        (ctx == ParseScriptContext::P2TR && (multi_a || sortedmulti_a))) {
  ------------------
  |  Branch (2385:10): [True: 4.44k, False: 13.2k]
  |  Branch (2385:46): [True: 563, False: 3.88k]
  |  Branch (2385:57): [True: 1.09k, False: 2.78k]
  ------------------
 2386|  2.43k|        auto threshold = Expr(expr);
 2387|  2.43k|        uint32_t thres;
 2388|  2.43k|        std::vector<std::vector<std::unique_ptr<PubkeyProvider>>> providers; // List of multipath expanded pubkeys
 2389|  2.43k|        if (const auto maybe_thres{ToIntegral<uint32_t>(std::string_view{threshold.begin(), threshold.end()})}) {
  ------------------
  |  Branch (2389:24): [True: 2.38k, False: 51]
  ------------------
 2390|  2.38k|            thres = *maybe_thres;
 2391|  2.38k|        } else {
 2392|     51|            error = strprintf("Multi threshold '%s' is not valid", std::string(threshold.begin(), threshold.end()));
  ------------------
  |  | 1172|     51|#define strprintf tfm::format
  ------------------
 2393|     51|            return {};
 2394|     51|        }
 2395|  2.38k|        size_t script_size = 0;
 2396|  2.38k|        size_t max_providers_len = 0;
 2397|  42.9k|        while (expr.size()) {
  ------------------
  |  Branch (2397:16): [True: 40.8k, False: 2.14k]
  ------------------
 2398|  40.8k|            if (!Const(",", expr)) {
  ------------------
  |  Branch (2398:17): [True: 5, False: 40.8k]
  ------------------
 2399|      5|                error = strprintf("Multi: expected ',', got '%c'", expr[0]);
  ------------------
  |  | 1172|      5|#define strprintf tfm::format
  ------------------
 2400|      5|                return {};
 2401|      5|            }
 2402|  40.8k|            auto arg = Expr(expr);
 2403|  40.8k|            auto pks = ParsePubkey(key_exp_index, arg, ctx, out, error);
 2404|  40.8k|            if (pks.empty()) {
  ------------------
  |  Branch (2404:17): [True: 233, False: 40.5k]
  ------------------
 2405|    233|                error = strprintf("Multi: %s", error);
  ------------------
  |  | 1172|    233|#define strprintf tfm::format
  ------------------
 2406|    233|                return {};
 2407|    233|            }
 2408|  40.5k|            script_size += pks.at(0)->GetSize() + 1;
 2409|  40.5k|            max_providers_len = std::max(max_providers_len, pks.size());
 2410|  40.5k|            providers.emplace_back(std::move(pks));
 2411|  40.5k|        }
 2412|  2.14k|        if ((multi || sortedmulti) && (providers.empty() || providers.size() > MAX_PUBKEYS_PER_MULTISIG)) {
  ------------------
  |  Branch (2412:14): [True: 335, False: 1.81k]
  |  Branch (2412:23): [True: 189, False: 1.62k]
  |  Branch (2412:40): [True: 21, False: 503]
  |  Branch (2412:61): [True: 5, False: 498]
  ------------------
 2413|     26|            error = strprintf("Cannot have %u keys in multisig; must have between 1 and %d keys, inclusive", providers.size(), MAX_PUBKEYS_PER_MULTISIG);
  ------------------
  |  | 1172|     26|#define strprintf tfm::format
  ------------------
 2414|     26|            return {};
 2415|  2.12k|        } else if ((multi_a || sortedmulti_a) && (providers.empty() || providers.size() > MAX_PUBKEYS_PER_MULTI_A)) {
  ------------------
  |  Branch (2415:21): [True: 546, False: 1.57k]
  |  Branch (2415:32): [True: 1.07k, False: 498]
  |  Branch (2415:51): [True: 7, False: 1.61k]
  |  Branch (2415:72): [True: 0, False: 1.61k]
  ------------------
 2416|      7|            error = strprintf("Cannot have %u keys in multi_a; must have between 1 and %d keys, inclusive", providers.size(), MAX_PUBKEYS_PER_MULTI_A);
  ------------------
  |  | 1172|      7|#define strprintf tfm::format
  ------------------
 2417|      7|            return {};
 2418|  2.11k|        } else if (thres < 1) {
  ------------------
  |  Branch (2418:20): [True: 8, False: 2.10k]
  ------------------
 2419|      8|            error = strprintf("Multisig threshold cannot be %d, must be at least 1", thres);
  ------------------
  |  | 1172|      8|#define strprintf tfm::format
  ------------------
 2420|      8|            return {};
 2421|  2.10k|        } else if (thres > providers.size()) {
  ------------------
  |  Branch (2421:20): [True: 40, False: 2.06k]
  ------------------
 2422|     40|            error = strprintf("Multisig threshold cannot be larger than the number of keys; threshold is %d but only %u keys specified", thres, providers.size());
  ------------------
  |  | 1172|     40|#define strprintf tfm::format
  ------------------
 2423|     40|            return {};
 2424|     40|        }
 2425|  2.06k|        if (ctx == ParseScriptContext::TOP) {
  ------------------
  |  Branch (2425:13): [True: 134, False: 1.93k]
  ------------------
 2426|    134|            if (providers.size() > 3) {
  ------------------
  |  Branch (2426:17): [True: 8, False: 126]
  ------------------
 2427|      8|                error = strprintf("Cannot have %u pubkeys in bare multisig; only at most 3 pubkeys", providers.size());
  ------------------
  |  | 1172|      8|#define strprintf tfm::format
  ------------------
 2428|      8|                return {};
 2429|      8|            }
 2430|    134|        }
 2431|  2.05k|        if (ctx == ParseScriptContext::P2SH) {
  ------------------
  |  Branch (2431:13): [True: 288, False: 1.77k]
  ------------------
 2432|       |            // This limits the maximum number of compressed pubkeys to 15.
 2433|    288|            if (script_size + 3 > MAX_SCRIPT_ELEMENT_SIZE) {
  ------------------
  |  Branch (2433:17): [True: 2, False: 286]
  ------------------
 2434|      2|                error = strprintf("P2SH script is too large, %d bytes is larger than %d bytes", script_size + 3, MAX_SCRIPT_ELEMENT_SIZE);
  ------------------
  |  | 1172|      2|#define strprintf tfm::format
  ------------------
 2435|      2|                return {};
 2436|      2|            }
 2437|    288|        }
 2438|       |
 2439|       |        // Make sure all vecs are of the same length, or exactly length 1
 2440|       |        // For length 1 vectors, clone key providers until vector is the same length
 2441|  35.8k|        for (auto& vec : providers) {
  ------------------
  |  Branch (2441:24): [True: 35.8k, False: 2.05k]
  ------------------
 2442|  35.8k|            if (vec.size() == 1) {
  ------------------
  |  Branch (2442:17): [True: 34.9k, False: 977]
  ------------------
 2443|   124k|                for (size_t i = 1; i < max_providers_len; ++i) {
  ------------------
  |  Branch (2443:36): [True: 89.5k, False: 34.9k]
  ------------------
 2444|  89.5k|                    vec.emplace_back(vec.at(0)->Clone());
 2445|  89.5k|                }
 2446|  34.9k|            } else if (vec.size() != max_providers_len) {
  ------------------
  |  Branch (2446:24): [True: 2, False: 975]
  ------------------
 2447|      2|                error = strprintf("multi(): Multipath derivation paths have mismatched lengths");
  ------------------
  |  | 1172|      2|#define strprintf tfm::format
  ------------------
 2448|      2|                return {};
 2449|      2|            }
 2450|  35.8k|        }
 2451|       |
 2452|       |        // Build the final descriptors vector
 2453|  11.5k|        for (size_t i = 0; i < max_providers_len; ++i) {
  ------------------
  |  Branch (2453:28): [True: 9.51k, False: 2.05k]
  ------------------
 2454|       |            // Build final pubkeys vectors by retrieving the i'th subscript for each vector in subscripts
 2455|  9.51k|            std::vector<std::unique_ptr<PubkeyProvider>> pubs;
 2456|  9.51k|            pubs.reserve(providers.size());
 2457|   135k|            for (auto& pub : providers) {
  ------------------
  |  Branch (2457:28): [True: 135k, False: 9.51k]
  ------------------
 2458|   135k|                pubs.emplace_back(std::move(pub.at(i)));
 2459|   135k|            }
 2460|  9.51k|            if (multi || sortedmulti) {
  ------------------
  |  Branch (2460:17): [True: 824, False: 8.68k]
  |  Branch (2460:26): [True: 1.05k, False: 7.63k]
  ------------------
 2461|  1.87k|                ret.emplace_back(std::make_unique<MultisigDescriptor>(thres, std::move(pubs), sortedmulti));
 2462|  7.63k|            } else {
 2463|  7.63k|                ret.emplace_back(std::make_unique<MultiADescriptor>(thres, std::move(pubs), sortedmulti_a));
 2464|  7.63k|            }
 2465|  9.51k|        }
 2466|  2.05k|        return ret;
 2467|  15.9k|    } else if (multi || sortedmulti) {
  ------------------
  |  Branch (2467:16): [True: 1, False: 15.9k]
  |  Branch (2467:25): [True: 1, False: 15.9k]
  ------------------
 2468|      2|        error = "Can only have multi/sortedmulti at top level, in sh(), or in wsh()";
 2469|      2|        return {};
 2470|  15.9k|    } else if (multi_a || sortedmulti_a) {
  ------------------
  |  Branch (2470:16): [True: 1, False: 15.9k]
  |  Branch (2470:27): [True: 1, False: 15.9k]
  ------------------
 2471|      2|        error = "Can only have multi_a/sortedmulti_a inside tr()";
 2472|      2|        return {};
 2473|      2|    }
 2474|  15.9k|    if ((ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH) && Func("wpkh", expr)) {
  ------------------
  |  Branch (2474:9): [True: 28, False: 15.9k]
  |  Branch (2474:10): [True: 11.3k, False: 4.60k]
  |  Branch (2474:44): [True: 160, False: 4.44k]
  |  Branch (2474:80): [True: 28, False: 11.5k]
  ------------------
 2475|     28|        auto pubkeys = ParsePubkey(key_exp_index, expr, ParseScriptContext::P2WPKH, out, error);
 2476|     28|        if (pubkeys.empty()) {
  ------------------
  |  Branch (2476:13): [True: 2, False: 26]
  ------------------
 2477|      2|            error = strprintf("wpkh(): %s", error);
  ------------------
  |  | 1172|      2|#define strprintf tfm::format
  ------------------
 2478|      2|            return {};
 2479|      2|        }
 2480|    189|        for (auto& pubkey : pubkeys) {
  ------------------
  |  Branch (2480:27): [True: 189, False: 26]
  ------------------
 2481|    189|            ret.emplace_back(std::make_unique<WPKHDescriptor>(std::move(pubkey)));
 2482|    189|        }
 2483|     26|        return ret;
 2484|  15.9k|    } else if (Func("wpkh", expr)) {
  ------------------
  |  Branch (2484:16): [True: 1, False: 15.9k]
  ------------------
 2485|      1|        error = "Can only have wpkh() at top level or inside sh()";
 2486|      1|        return {};
 2487|      1|    }
 2488|  15.9k|    if (ctx == ParseScriptContext::TOP && Func("sh", expr)) {
  ------------------
  |  Branch (2488:9): [True: 11.3k, False: 4.59k]
  |  Branch (2488:9): [True: 656, False: 15.3k]
  |  Branch (2488:43): [True: 656, False: 10.7k]
  ------------------
 2489|    656|        auto descs = ParseScript(key_exp_index, expr, ParseScriptContext::P2SH, out, error);
 2490|    656|        if (descs.empty() || expr.size()) return {};
  ------------------
  |  Branch (2490:13): [True: 183, False: 473]
  |  Branch (2490:30): [True: 14, False: 459]
  ------------------
 2491|    459|        std::vector<std::unique_ptr<DescriptorImpl>> ret;
 2492|    459|        ret.reserve(descs.size());
 2493|  2.49k|        for (auto& desc : descs) {
  ------------------
  |  Branch (2493:25): [True: 2.49k, False: 459]
  ------------------
 2494|  2.49k|            ret.push_back(std::make_unique<SHDescriptor>(std::move(desc)));
 2495|  2.49k|        }
 2496|    459|        return ret;
 2497|  15.3k|    } else if (Func("sh", expr)) {
  ------------------
  |  Branch (2497:16): [True: 2, False: 15.3k]
  ------------------
 2498|      2|        error = "Can only have sh() at top level";
 2499|      2|        return {};
 2500|      2|    }
 2501|  15.3k|    if ((ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH) && Func("wsh", expr)) {
  ------------------
  |  Branch (2501:9): [True: 1.90k, False: 13.4k]
  |  Branch (2501:10): [True: 10.7k, False: 4.58k]
  |  Branch (2501:44): [True: 141, False: 4.44k]
  |  Branch (2501:80): [True: 1.90k, False: 8.95k]
  ------------------
 2502|  1.90k|        auto descs = ParseScript(key_exp_index, expr, ParseScriptContext::P2WSH, out, error);
 2503|  1.90k|        if (descs.empty() || expr.size()) return {};
  ------------------
  |  Branch (2503:13): [True: 956, False: 950]
  |  Branch (2503:30): [True: 10, False: 940]
  ------------------
 2504|  4.04k|        for (auto& desc : descs) {
  ------------------
  |  Branch (2504:25): [True: 4.04k, False: 940]
  ------------------
 2505|  4.04k|            ret.emplace_back(std::make_unique<WSHDescriptor>(std::move(desc)));
 2506|  4.04k|        }
 2507|    940|        return ret;
 2508|  13.4k|    } else if (Func("wsh", expr)) {
  ------------------
  |  Branch (2508:16): [True: 1, False: 13.3k]
  ------------------
 2509|      1|        error = "Can only have wsh() at top level or inside sh()";
 2510|      1|        return {};
 2511|      1|    }
 2512|  13.3k|    if (ctx == ParseScriptContext::TOP && Func("addr", expr)) {
  ------------------
  |  Branch (2512:9): [True: 8.92k, False: 4.47k]
  |  Branch (2512:9): [True: 426, False: 12.9k]
  |  Branch (2512:43): [True: 426, False: 8.49k]
  ------------------
 2513|    426|        CTxDestination dest = DecodeDestination(std::string(expr.begin(), expr.end()));
 2514|    426|        if (!IsValidDestination(dest)) {
  ------------------
  |  Branch (2514:13): [True: 426, False: 0]
  ------------------
 2515|    426|            error = "Address is not valid";
 2516|    426|            return {};
 2517|    426|        }
 2518|      0|        ret.emplace_back(std::make_unique<AddressDescriptor>(std::move(dest)));
 2519|      0|        return ret;
 2520|  12.9k|    } else if (Func("addr", expr)) {
  ------------------
  |  Branch (2520:16): [True: 1, False: 12.9k]
  ------------------
 2521|      1|        error = "Can only have addr() at top level";
 2522|      1|        return {};
 2523|      1|    }
 2524|  12.9k|    if (ctx == ParseScriptContext::TOP && Func("tr", expr)) {
  ------------------
  |  Branch (2524:9): [True: 8.49k, False: 4.47k]
  |  Branch (2524:9): [True: 4.19k, False: 8.77k]
  |  Branch (2524:43): [True: 4.19k, False: 4.30k]
  ------------------
 2525|  4.19k|        auto arg = Expr(expr);
 2526|  4.19k|        auto internal_keys = ParsePubkey(key_exp_index, arg, ParseScriptContext::P2TR, out, error);
 2527|  4.19k|        if (internal_keys.empty()) {
  ------------------
  |  Branch (2527:13): [True: 456, False: 3.74k]
  ------------------
 2528|    456|            error = strprintf("tr(): %s", error);
  ------------------
  |  | 1172|    456|#define strprintf tfm::format
  ------------------
 2529|    456|            return {};
 2530|    456|        }
 2531|  3.74k|        size_t max_providers_len = internal_keys.size();
 2532|  3.74k|        std::vector<std::vector<std::unique_ptr<DescriptorImpl>>> subscripts; //!< list of multipath expanded script subexpressions
 2533|  3.74k|        std::vector<int> depths; //!< depth in the tree of each subexpression (same length subscripts)
 2534|  3.74k|        if (expr.size()) {
  ------------------
  |  Branch (2534:13): [True: 1.50k, False: 2.23k]
  ------------------
 2535|  1.50k|            if (!Const(",", expr)) {
  ------------------
  |  Branch (2535:17): [True: 2, False: 1.50k]
  ------------------
 2536|      2|                error = strprintf("tr: expected ',', got '%c'", expr[0]);
  ------------------
  |  | 1172|      2|#define strprintf tfm::format
  ------------------
 2537|      2|                return {};
 2538|      2|            }
 2539|       |            /** The path from the top of the tree to what we're currently processing.
 2540|       |             * branches[i] == false: left branch in the i'th step from the top; true: right branch.
 2541|       |             */
 2542|  1.50k|            std::vector<bool> branches;
 2543|       |            // Loop over all provided scripts. In every iteration exactly one script will be processed.
 2544|       |            // Use a do-loop because inside this if-branch we expect at least one script.
 2545|  6.59k|            do {
 2546|       |                // First process all open braces.
 2547|  13.3k|                while (Const("{", expr)) {
  ------------------
  |  Branch (2547:24): [True: 6.79k, False: 6.59k]
  ------------------
 2548|  6.79k|                    branches.push_back(false); // new left branch
 2549|  6.79k|                    if (branches.size() > TAPROOT_CONTROL_MAX_NODE_COUNT) {
  ------------------
  |  Branch (2549:25): [True: 2, False: 6.79k]
  ------------------
 2550|      2|                        error = strprintf("tr() supports at most %i nesting levels", TAPROOT_CONTROL_MAX_NODE_COUNT);
  ------------------
  |  | 1172|      2|#define strprintf tfm::format
  ------------------
 2551|      2|                        return {};
 2552|      2|                    }
 2553|  6.79k|                }
 2554|       |                // Process the actual script expression.
 2555|  6.59k|                auto sarg = Expr(expr);
 2556|  6.59k|                subscripts.emplace_back(ParseScript(key_exp_index, sarg, ParseScriptContext::P2TR, out, error));
 2557|  6.59k|                if (subscripts.back().empty()) return {};
  ------------------
  |  Branch (2557:21): [True: 299, False: 6.29k]
  ------------------
 2558|  6.29k|                max_providers_len = std::max(max_providers_len, subscripts.back().size());
 2559|  6.29k|                depths.push_back(branches.size());
 2560|       |                // Process closing braces; one is expected for every right branch we were in.
 2561|  9.08k|                while (branches.size() && branches.back()) {
  ------------------
  |  Branch (2561:24): [True: 7.91k, False: 1.17k]
  |  Branch (2561:24): [True: 2.80k, False: 6.28k]
  |  Branch (2561:43): [True: 2.80k, False: 5.11k]
  ------------------
 2562|  2.80k|                    if (!Const("}", expr)) {
  ------------------
  |  Branch (2562:25): [True: 14, False: 2.78k]
  ------------------
 2563|     14|                        error = strprintf("tr(): expected '}' after script expression");
  ------------------
  |  | 1172|     14|#define strprintf tfm::format
  ------------------
 2564|     14|                        return {};
 2565|     14|                    }
 2566|  2.78k|                    branches.pop_back(); // move up one level after encountering '}'
 2567|  2.78k|                }
 2568|       |                // If after that, we're at the end of a left branch, expect a comma.
 2569|  6.28k|                if (branches.size() && !branches.back()) {
  ------------------
  |  Branch (2569:21): [True: 5.11k, False: 1.17k]
  |  Branch (2569:21): [True: 5.11k, False: 1.17k]
  |  Branch (2569:40): [True: 5.11k, False: 0]
  ------------------
 2570|  5.11k|                    if (!Const(",", expr)) {
  ------------------
  |  Branch (2570:25): [True: 22, False: 5.09k]
  ------------------
 2571|     22|                        error = strprintf("tr(): expected ',' after script expression");
  ------------------
  |  | 1172|     22|#define strprintf tfm::format
  ------------------
 2572|     22|                        return {};
 2573|     22|                    }
 2574|  5.09k|                    branches.back() = true; // And now we're in a right branch.
 2575|  5.09k|                }
 2576|  6.28k|            } while (branches.size());
  ------------------
  |  Branch (2576:22): [True: 5.09k, False: 1.17k]
  ------------------
 2577|       |            // After we've explored a whole tree, we must be at the end of the expression.
 2578|  1.17k|            if (expr.size()) {
  ------------------
  |  Branch (2578:17): [True: 3, False: 1.16k]
  ------------------
 2579|      3|                error = strprintf("tr(): expected ')' after script expression");
  ------------------
  |  | 1172|      3|#define strprintf tfm::format
  ------------------
 2580|      3|                return {};
 2581|      3|            }
 2582|  1.17k|        }
 2583|  3.74k|        assert(TaprootBuilder::ValidDepths(depths));
  ------------------
  |  Branch (2583:9): [True: 3.39k, False: 0]
  ------------------
 2584|       |
 2585|       |        // Make sure all vecs are of the same length, or exactly length 1
 2586|       |        // For length 1 vectors, clone subdescs until vector is the same length
 2587|  3.39k|        for (auto& vec : subscripts) {
  ------------------
  |  Branch (2587:24): [True: 3.28k, False: 3.39k]
  ------------------
 2588|  3.28k|            if (vec.size() == 1) {
  ------------------
  |  Branch (2588:17): [True: 2.72k, False: 561]
  ------------------
 2589|  4.28k|                for (size_t i = 1; i < max_providers_len; ++i) {
  ------------------
  |  Branch (2589:36): [True: 1.56k, False: 2.72k]
  ------------------
 2590|  1.56k|                    vec.emplace_back(vec.at(0)->Clone());
 2591|  1.56k|                }
 2592|  2.72k|            } else if (vec.size() != max_providers_len) {
  ------------------
  |  Branch (2592:24): [True: 1, False: 560]
  ------------------
 2593|      1|                error = strprintf("tr(): Multipath subscripts have mismatched lengths");
  ------------------
  |  | 1172|      1|#define strprintf tfm::format
  ------------------
 2594|      1|                return {};
 2595|      1|            }
 2596|  3.28k|        }
 2597|       |
 2598|  3.39k|        if (internal_keys.size() > 1 && internal_keys.size() != max_providers_len) {
  ------------------
  |  Branch (2598:13): [True: 1.28k, False: 2.11k]
  |  Branch (2598:41): [True: 1, False: 1.28k]
  ------------------
 2599|      1|            error = strprintf("tr(): Multipath internal key mismatches multipath subscripts lengths");
  ------------------
  |  | 1172|      1|#define strprintf tfm::format
  ------------------
 2600|      1|            return {};
 2601|      1|        }
 2602|       |
 2603|  10.4k|        while (internal_keys.size() < max_providers_len) {
  ------------------
  |  Branch (2603:16): [True: 7.01k, False: 3.39k]
  ------------------
 2604|  7.01k|            internal_keys.emplace_back(internal_keys.at(0)->Clone());
 2605|  7.01k|        }
 2606|       |
 2607|       |        // Build the final descriptors vector
 2608|  28.6k|        for (size_t i = 0; i < max_providers_len; ++i) {
  ------------------
  |  Branch (2608:28): [True: 25.2k, False: 3.39k]
  ------------------
 2609|       |            // Build final subscripts vectors by retrieving the i'th subscript for each vector in subscripts
 2610|  25.2k|            std::vector<std::unique_ptr<DescriptorImpl>> this_subs;
 2611|  25.2k|            this_subs.reserve(subscripts.size());
 2612|  25.2k|            for (auto& subs : subscripts) {
  ------------------
  |  Branch (2612:29): [True: 11.8k, False: 25.2k]
  ------------------
 2613|  11.8k|                this_subs.emplace_back(std::move(subs.at(i)));
 2614|  11.8k|            }
 2615|  25.2k|            ret.emplace_back(std::make_unique<TRDescriptor>(std::move(internal_keys.at(i)), std::move(this_subs), depths));
 2616|  25.2k|        }
 2617|  3.39k|        return ret;
 2618|       |
 2619|       |
 2620|  8.77k|    } else if (Func("tr", expr)) {
  ------------------
  |  Branch (2620:16): [True: 1, False: 8.77k]
  ------------------
 2621|      1|        error = "Can only have tr at top level";
 2622|      1|        return {};
 2623|      1|    }
 2624|  8.77k|    if (ctx == ParseScriptContext::TOP && Func("rawtr", expr)) {
  ------------------
  |  Branch (2624:9): [True: 4.30k, False: 4.47k]
  |  Branch (2624:9): [True: 64, False: 8.71k]
  |  Branch (2624:43): [True: 64, False: 4.23k]
  ------------------
 2625|     64|        auto arg = Expr(expr);
 2626|     64|        if (expr.size()) {
  ------------------
  |  Branch (2626:13): [True: 2, False: 62]
  ------------------
 2627|      2|            error = strprintf("rawtr(): only one key expected.");
  ------------------
  |  | 1172|      2|#define strprintf tfm::format
  ------------------
 2628|      2|            return {};
 2629|      2|        }
 2630|     62|        auto output_keys = ParsePubkey(key_exp_index, arg, ParseScriptContext::P2TR, out, error);
 2631|     62|        if (output_keys.empty()) {
  ------------------
  |  Branch (2631:13): [True: 2, False: 60]
  ------------------
 2632|      2|            error = strprintf("rawtr(): %s", error);
  ------------------
  |  | 1172|      2|#define strprintf tfm::format
  ------------------
 2633|      2|            return {};
 2634|      2|        }
 2635|    285|        for (auto& pubkey : output_keys) {
  ------------------
  |  Branch (2635:27): [True: 285, False: 60]
  ------------------
 2636|    285|            ret.emplace_back(std::make_unique<RawTRDescriptor>(std::move(pubkey)));
 2637|    285|        }
 2638|     60|        return ret;
 2639|  8.71k|    } else if (Func("rawtr", expr)) {
  ------------------
  |  Branch (2639:16): [True: 1, False: 8.70k]
  ------------------
 2640|      1|        error = "Can only have rawtr at top level";
 2641|      1|        return {};
 2642|      1|    }
 2643|  8.70k|    if (ctx == ParseScriptContext::TOP && Func("unused", expr)) {
  ------------------
  |  Branch (2643:9): [True: 4.23k, False: 4.47k]
  |  Branch (2643:9): [True: 20, False: 8.68k]
  |  Branch (2643:43): [True: 20, False: 4.21k]
  ------------------
 2644|       |        // Check for only one expression, should not find commas, brackets, or parentheses
 2645|     20|        auto arg = Expr(expr);
 2646|     20|        if (expr.size()) {
  ------------------
  |  Branch (2646:13): [True: 3, False: 17]
  ------------------
 2647|      3|            error = strprintf("unused(): only one key expected");
  ------------------
  |  | 1172|      3|#define strprintf tfm::format
  ------------------
 2648|      3|            return {};
 2649|      3|        }
 2650|     17|        auto keys = ParsePubkey(key_exp_index, arg, ctx, out, error);
 2651|     17|        if (keys.empty()) return {};
  ------------------
  |  Branch (2651:13): [True: 2, False: 15]
  ------------------
 2652|    100|        for (auto& pubkey : keys) {
  ------------------
  |  Branch (2652:27): [True: 100, False: 15]
  ------------------
 2653|    100|            if (pubkey->IsRange()) {
  ------------------
  |  Branch (2653:17): [True: 0, False: 100]
  ------------------
 2654|      0|                error = "unused(): key cannot be ranged";
 2655|      0|                return {};
 2656|      0|            }
 2657|    100|            ret.emplace_back(std::make_unique<UnusedDescriptor>(std::move(pubkey)));
 2658|    100|        }
 2659|     15|        return ret;
 2660|  8.68k|    } else if (Func("unused", expr)) {
  ------------------
  |  Branch (2660:16): [True: 1, False: 8.68k]
  ------------------
 2661|      1|        error = "Can only have unused at top level";
 2662|      1|        return {};
 2663|      1|    }
 2664|  8.68k|    if (ctx == ParseScriptContext::TOP && Func("raw", expr)) {
  ------------------
  |  Branch (2664:9): [True: 4.21k, False: 4.47k]
  |  Branch (2664:9): [True: 452, False: 8.23k]
  |  Branch (2664:43): [True: 452, False: 3.76k]
  ------------------
 2665|    452|        std::string str(expr.begin(), expr.end());
 2666|    452|        if (!IsHex(str)) {
  ------------------
  |  Branch (2666:13): [True: 2, False: 450]
  ------------------
 2667|      2|            error = "Raw script is not hex";
 2668|      2|            return {};
 2669|      2|        }
 2670|    450|        auto bytes = ParseHex(str);
 2671|    450|        ret.emplace_back(std::make_unique<RawDescriptor>(CScript(bytes.begin(), bytes.end())));
 2672|    450|        return ret;
 2673|  8.23k|    } else if (Func("raw", expr)) {
  ------------------
  |  Branch (2673:16): [True: 1, False: 8.23k]
  ------------------
 2674|      1|        error = "Can only have raw() at top level";
 2675|      1|        return {};
 2676|      1|    }
 2677|       |    // Process miniscript expressions.
 2678|  8.23k|    {
 2679|  8.23k|        const auto script_ctx{ctx == ParseScriptContext::P2WSH ? miniscript::MiniscriptContext::P2WSH : miniscript::MiniscriptContext::TAPSCRIPT};
  ------------------
  |  Branch (2679:31): [True: 1.66k, False: 6.57k]
  ------------------
 2680|  8.23k|        KeyParser parser(/*out = */&out, /* in = */nullptr, /* ctx = */script_ctx, key_exp_index);
 2681|  8.23k|        auto node = miniscript::FromString(std::string(expr.begin(), expr.end()), parser);
 2682|  8.23k|        if (parser.m_key_parsing_error != "") {
  ------------------
  |  Branch (2682:13): [True: 166, False: 8.06k]
  ------------------
 2683|    166|            error = std::move(parser.m_key_parsing_error);
 2684|    166|            return {};
 2685|    166|        }
 2686|  8.06k|        if (node) {
  ------------------
  |  Branch (2686:13): [True: 5.51k, False: 2.55k]
  ------------------
 2687|  5.51k|            if (ctx != ParseScriptContext::P2WSH && ctx != ParseScriptContext::P2TR) {
  ------------------
  |  Branch (2687:17): [True: 4.09k, False: 1.41k]
  |  Branch (2687:53): [True: 1.44k, False: 2.65k]
  ------------------
 2688|  1.44k|                error = "Miniscript expressions can only be used in wsh or tr.";
 2689|  1.44k|                return {};
 2690|  1.44k|            }
 2691|  4.07k|            if (!node->IsSane() || node->IsNotSatisfiable()) {
  ------------------
  |  Branch (2691:17): [True: 638, False: 3.43k]
  |  Branch (2691:36): [True: 123, False: 3.31k]
  ------------------
 2692|       |                // Try to find the first insane sub for better error reporting.
 2693|    761|                const auto* insane_node = &node.value();
 2694|    761|                if (const auto sub = node->FindInsaneSub()) insane_node = sub;
  ------------------
  |  Branch (2694:32): [True: 530, False: 231]
  ------------------
 2695|    761|                error = *insane_node->ToString(parser);
 2696|    761|                if (!insane_node->IsValid()) {
  ------------------
  |  Branch (2696:21): [True: 423, False: 338]
  ------------------
 2697|    423|                    error += " is invalid";
 2698|    423|                } else if (!node->IsSane()) {
  ------------------
  |  Branch (2698:28): [True: 215, False: 123]
  ------------------
 2699|    215|                    error += " is not sane";
 2700|    215|                    if (!insane_node->IsNonMalleable()) {
  ------------------
  |  Branch (2700:25): [True: 36, False: 179]
  ------------------
 2701|     36|                        error += ": malleable witnesses exist";
 2702|    179|                    } else if (insane_node == &node.value() && !insane_node->NeedsSignature()) {
  ------------------
  |  Branch (2702:32): [True: 112, False: 67]
  |  Branch (2702:64): [True: 83, False: 29]
  ------------------
 2703|     83|                        error += ": witnesses without signature exist";
 2704|     96|                    } else if (!insane_node->CheckTimeLocksMix()) {
  ------------------
  |  Branch (2704:32): [True: 5, False: 91]
  ------------------
 2705|      5|                        error += ": contains mixes of timelocks expressed in blocks and seconds";
 2706|     91|                    } else if (!insane_node->CheckDuplicateKey()) {
  ------------------
  |  Branch (2706:32): [True: 56, False: 35]
  ------------------
 2707|     56|                        error += ": contains duplicate public keys";
 2708|     56|                    } else if (!insane_node->ValidSatisfactions()) {
  ------------------
  |  Branch (2708:32): [True: 7, False: 28]
  ------------------
 2709|      7|                        error += ": needs witnesses that may exceed resource limits";
 2710|      7|                    }
 2711|    215|                } else {
 2712|    123|                    error += " is not satisfiable";
 2713|    123|                }
 2714|    761|                return {};
 2715|    761|            }
 2716|       |            // A signature check is required for a miniscript to be sane. Therefore no sane miniscript
 2717|       |            // may have an empty list of public keys.
 2718|  3.31k|            CHECK_NONFATAL(!parser.m_keys.empty());
  ------------------
  |  |  113|  3.31k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
 2719|       |            // Make sure all vecs are of the same length, or exactly length 1
 2720|       |            // For length 1 vectors, clone subdescs until vector is the same length
 2721|  3.31k|            size_t num_multipath = std::max_element(parser.m_keys.begin(), parser.m_keys.end(),
 2722|  3.31k|                    [](const std::vector<std::unique_ptr<PubkeyProvider>>& a, const std::vector<std::unique_ptr<PubkeyProvider>>& b) {
 2723|  3.31k|                        return a.size() < b.size();
 2724|  3.31k|                    })->size();
 2725|       |
 2726|  4.26k|            for (auto& vec : parser.m_keys) {
  ------------------
  |  Branch (2726:28): [True: 4.26k, False: 3.30k]
  ------------------
 2727|  4.26k|                if (vec.size() == 1) {
  ------------------
  |  Branch (2727:21): [True: 3.92k, False: 340]
  ------------------
 2728|  5.80k|                    for (size_t i = 1; i < num_multipath; ++i) {
  ------------------
  |  Branch (2728:40): [True: 1.87k, False: 3.92k]
  ------------------
 2729|  1.87k|                        vec.emplace_back(vec.at(0)->Clone());
 2730|  1.87k|                    }
 2731|  3.92k|                } else if (vec.size() != num_multipath) {
  ------------------
  |  Branch (2731:28): [True: 2, False: 338]
  ------------------
 2732|      2|                    error = strprintf("Miniscript: Multipath derivation paths have mismatched lengths");
  ------------------
  |  | 1172|      2|#define strprintf tfm::format
  ------------------
 2733|      2|                    return {};
 2734|      2|                }
 2735|  4.26k|            }
 2736|       |
 2737|       |            // Build the final descriptors vector
 2738|  9.29k|            for (size_t i = 0; i < num_multipath; ++i) {
  ------------------
  |  Branch (2738:32): [True: 5.98k, False: 3.30k]
  ------------------
 2739|       |                // Build final pubkeys vectors by retrieving the i'th subscript for each vector in subscripts
 2740|  5.98k|                std::vector<std::unique_ptr<PubkeyProvider>> pubs;
 2741|  5.98k|                pubs.reserve(parser.m_keys.size());
 2742|  8.88k|                for (auto& pub : parser.m_keys) {
  ------------------
  |  Branch (2742:32): [True: 8.88k, False: 5.98k]
  ------------------
 2743|  8.88k|                    pubs.emplace_back(std::move(pub.at(i)));
 2744|  8.88k|                }
 2745|  5.98k|                ret.emplace_back(std::make_unique<MiniscriptDescriptor>(std::move(pubs), node->Clone()));
 2746|  5.98k|            }
 2747|  3.30k|            return ret;
 2748|  3.31k|        }
 2749|  8.06k|    }
 2750|  2.55k|    if (ctx == ParseScriptContext::P2SH) {
  ------------------
  |  Branch (2750:9): [True: 16, False: 2.54k]
  ------------------
 2751|     16|        error = "A function is needed within P2SH";
 2752|     16|        return {};
 2753|  2.54k|    } else if (ctx == ParseScriptContext::P2WSH) {
  ------------------
  |  Branch (2753:16): [True: 171, False: 2.36k]
  ------------------
 2754|    171|        error = "A function is needed within P2WSH";
 2755|    171|        return {};
 2756|    171|    }
 2757|  2.36k|    error = strprintf("'%s' is not a valid descriptor function", std::string(expr.begin(), expr.end()));
  ------------------
  |  | 1172|  2.36k|#define strprintf tfm::format
  ------------------
 2758|  2.36k|    return {};
 2759|  2.55k|}
descriptor.cpp:_ZN12_GLOBAL__N_111ParsePubkeyERjRKNSt3__14spanIKcLm18446744073709551615EEENS_18ParseScriptContextER19FlatSigningProviderRNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 2010|   133k|{
 2011|   133k|    std::vector<std::unique_ptr<PubkeyProvider>> ret;
 2012|       |
 2013|   133k|    using namespace script;
 2014|       |
 2015|       |    // musig cannot be nested inside of an origin
 2016|   133k|    std::span<const char> span = sp;
 2017|   133k|    if (Const("musig(", span, /*skip=*/false)) {
  ------------------
  |  Branch (2017:9): [True: 17.3k, False: 115k]
  ------------------
 2018|  17.3k|        if (ctx != ParseScriptContext::P2TR) {
  ------------------
  |  Branch (2018:13): [True: 3, False: 17.3k]
  ------------------
 2019|      3|            error = "musig() is only allowed in tr() and rawtr()";
 2020|      3|            return {};
 2021|      3|        }
 2022|       |
 2023|       |        // Split the span on the end parentheses. The end parentheses must
 2024|       |        // be included in the resulting span so that Expr is happy.
 2025|  17.3k|        auto split = Split(sp, ')', /*include_sep=*/true);
 2026|  17.3k|        if (split.size() > 2) {
  ------------------
  |  Branch (2026:13): [True: 28, False: 17.3k]
  ------------------
 2027|     28|            error = "Too many ')' in musig() expression";
 2028|     28|            return {};
 2029|     28|        }
 2030|  17.3k|        std::span<const char> expr(split.at(0).begin(), split.at(0).end());
 2031|  17.3k|        if (!Func("musig", expr)) {
  ------------------
  |  Branch (2031:13): [True: 7, False: 17.3k]
  ------------------
 2032|      7|            error = "Invalid musig() expression";
 2033|      7|            return {};
 2034|      7|        }
 2035|       |
 2036|       |        // Parse the participant pubkeys
 2037|  17.3k|        bool any_ranged = false;
 2038|  17.3k|        bool all_bip32 = true;
 2039|  17.3k|        std::vector<std::vector<std::unique_ptr<PubkeyProvider>>> providers;
 2040|  17.3k|        bool any_key_parsed = false;
 2041|  17.3k|        size_t max_multipath_len = 0;
 2042|  80.0k|        while (expr.size()) {
  ------------------
  |  Branch (2042:16): [True: 62.7k, False: 17.2k]
  ------------------
 2043|  62.7k|            if (any_key_parsed && !Const(",", expr)) {
  ------------------
  |  Branch (2043:17): [True: 45.4k, False: 17.3k]
  |  Branch (2043:17): [True: 2, False: 62.7k]
  |  Branch (2043:35): [True: 2, False: 45.4k]
  ------------------
 2044|      2|                error = strprintf("musig(): expected ',', got '%c'", expr[0]);
  ------------------
  |  | 1172|      2|#define strprintf tfm::format
  ------------------
 2045|      2|                return {};
 2046|      2|            }
 2047|  62.7k|            auto arg = Expr(expr);
 2048|  62.7k|            auto pk = ParsePubkey(key_exp_index, arg, ParseScriptContext::MUSIG, out, error);
 2049|  62.7k|            if (pk.empty()) {
  ------------------
  |  Branch (2049:17): [True: 54, False: 62.7k]
  ------------------
 2050|     54|                error = strprintf("musig(): %s", error);
  ------------------
  |  | 1172|     54|#define strprintf tfm::format
  ------------------
 2051|     54|                return {};
 2052|     54|            }
 2053|  62.7k|            any_key_parsed = true;
 2054|       |
 2055|  62.7k|            any_ranged = any_ranged || pk.at(0)->IsRange();
  ------------------
  |  Branch (2055:26): [True: 4.76k, False: 57.9k]
  |  Branch (2055:40): [True: 264, False: 57.6k]
  ------------------
 2056|  62.7k|            all_bip32 = all_bip32 &&  pk.at(0)->IsBIP32();
  ------------------
  |  Branch (2056:25): [True: 36.2k, False: 26.4k]
  |  Branch (2056:39): [True: 20.6k, False: 15.6k]
  ------------------
 2057|       |
 2058|  62.7k|            max_multipath_len = std::max(max_multipath_len, pk.size());
 2059|       |
 2060|  62.7k|            providers.emplace_back(std::move(pk));
 2061|  62.7k|        }
 2062|  17.2k|        if (!any_key_parsed) {
  ------------------
  |  Branch (2062:13): [True: 2, False: 17.2k]
  ------------------
 2063|      2|            error = "musig(): Must contain key expressions";
 2064|      2|            return {};
 2065|      2|        }
 2066|       |
 2067|       |        // Parse any derivation
 2068|  17.2k|        DeriveType deriv_type = DeriveType::NON_RANGED;
 2069|  17.2k|        std::vector<KeyPath> derivation_multipaths;
 2070|  17.2k|        if (split.size() == 2 && Const("/", split.at(1), /*skip=*/false)) {
  ------------------
  |  Branch (2070:13): [True: 17.2k, False: 0]
  |  Branch (2070:13): [True: 74, False: 17.2k]
  |  Branch (2070:34): [True: 74, False: 17.2k]
  ------------------
 2071|     74|            if (!all_bip32) {
  ------------------
  |  Branch (2071:17): [True: 1, False: 73]
  ------------------
 2072|      1|                error = "musig(): derivation requires all participants to be xpubs or xprvs";
 2073|      1|                return {};
 2074|      1|            }
 2075|     73|            if (any_ranged) {
  ------------------
  |  Branch (2075:17): [True: 1, False: 72]
  ------------------
 2076|      1|                error = "musig(): Cannot have ranged participant keys if musig() also has derivation";
 2077|      1|                return {};
 2078|      1|            }
 2079|     72|            bool dummy = false;
 2080|     72|            auto deriv_split = Split(split.at(1), '/');
 2081|     72|            deriv_type = ParseDeriveType(deriv_split, dummy);
 2082|     72|            if (deriv_type == DeriveType::HARDENED_RANGED) {
  ------------------
  |  Branch (2082:17): [True: 2, False: 70]
  ------------------
 2083|      2|                error = "musig(): Cannot have hardened child derivation";
 2084|      2|                return {};
 2085|      2|            }
 2086|     70|            bool has_hardened = false;
 2087|     70|            if (!ParseKeyPath(deriv_split, derivation_multipaths, dummy, error, /*allow_multipath=*/true, has_hardened)) {
  ------------------
  |  Branch (2087:17): [True: 1, False: 69]
  ------------------
 2088|      1|                error = "musig(): " + error;
 2089|      1|                return {};
 2090|      1|            }
 2091|     69|            if (has_hardened) {
  ------------------
  |  Branch (2091:17): [True: 7, False: 62]
  ------------------
 2092|      7|                error = "musig(): cannot have hardened derivation steps";
 2093|      7|                return {};
 2094|      7|            }
 2095|  17.2k|        } else {
 2096|  17.2k|            derivation_multipaths.emplace_back();
 2097|  17.2k|        }
 2098|       |
 2099|       |        // Makes sure that all providers vectors in providers are the given length, or exactly length 1
 2100|       |        // Length 1 vectors have the single provider cloned until it matches the given length.
 2101|  17.2k|        const auto& clone_providers = [&providers](size_t length) -> bool {
 2102|  17.2k|            for (auto& multipath_providers : providers) {
 2103|  17.2k|                if (multipath_providers.size() == 1) {
 2104|  17.2k|                    for (size_t i = 1; i < length; ++i) {
 2105|  17.2k|                        multipath_providers.emplace_back(multipath_providers.at(0)->Clone());
 2106|  17.2k|                    }
 2107|  17.2k|                } else if (multipath_providers.size() != length) {
 2108|  17.2k|                    return false;
 2109|  17.2k|                }
 2110|  17.2k|            }
 2111|  17.2k|            return true;
 2112|  17.2k|        };
 2113|       |
 2114|       |        // Emplace the final MuSigPubkeyProvider into ret with the pubkey providers from the specified provider vectors index
 2115|       |        // and the path from the specified path index
 2116|  17.2k|        const auto& emplace_final_provider = [&ret, &key_exp_index, &deriv_type, &derivation_multipaths, &providers](size_t vec_idx, size_t path_idx) -> void {
 2117|  17.2k|            KeyPath& path = derivation_multipaths.at(path_idx);
 2118|  17.2k|            std::vector<std::unique_ptr<PubkeyProvider>> pubs;
 2119|  17.2k|            pubs.reserve(providers.size());
 2120|  17.2k|            for (auto& vec : providers) {
 2121|  17.2k|                pubs.emplace_back(std::move(vec.at(vec_idx)));
 2122|  17.2k|            }
 2123|  17.2k|            ret.emplace_back(std::make_unique<MuSigPubkeyProvider>(key_exp_index, std::move(pubs), path, deriv_type));
 2124|  17.2k|        };
 2125|       |
 2126|  17.2k|        if (max_multipath_len > 1 && derivation_multipaths.size() > 1) {
  ------------------
  |  Branch (2126:13): [True: 1.19k, False: 16.0k]
  |  Branch (2126:38): [True: 2, False: 1.18k]
  ------------------
 2127|      2|            error = "musig(): Cannot have multipath participant keys if musig() is also multipath";
 2128|      2|            return {};
 2129|  17.2k|        } else if (max_multipath_len > 1) {
  ------------------
  |  Branch (2129:20): [True: 1.18k, False: 16.0k]
  ------------------
 2130|  1.18k|            if (!clone_providers(max_multipath_len)) {
  ------------------
  |  Branch (2130:17): [True: 2, False: 1.18k]
  ------------------
 2131|      2|                error = strprintf("musig(): Multipath derivation paths have mismatched lengths");
  ------------------
  |  | 1172|      2|#define strprintf tfm::format
  ------------------
 2132|      2|                return {};
 2133|      2|            }
 2134|  16.9k|            for (size_t i = 0; i < max_multipath_len; ++i) {
  ------------------
  |  Branch (2134:32): [True: 15.7k, False: 1.18k]
  ------------------
 2135|       |                // Final MuSigPubkeyProvider uses participant pubkey providers at each multipath position, and the first (and only) path
 2136|  15.7k|                emplace_final_provider(i, 0);
 2137|  15.7k|            }
 2138|  16.0k|        } else if (derivation_multipaths.size() > 1) {
  ------------------
  |  Branch (2138:20): [True: 56, False: 16.0k]
  ------------------
 2139|       |            // All key provider vectors should be length 1. Clone them until they have the same length as paths
 2140|     56|            if (!Assume(clone_providers(derivation_multipaths.size()))) {
  ------------------
  |  |  128|     56|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
  |  Branch (2140:17): [True: 0, False: 56]
  ------------------
 2141|      0|                error = "musig(): Multipath derivation path with multipath participants is disallowed"; // This error is unreachable due to earlier check
 2142|      0|                return {};
 2143|      0|            }
 2144|    372|            for (size_t i = 0; i < derivation_multipaths.size(); ++i) {
  ------------------
  |  Branch (2144:32): [True: 316, False: 56]
  ------------------
 2145|       |                // Final MuSigPubkeyProvider uses cloned participant pubkey providers, and the multipath derivation paths
 2146|    316|                emplace_final_provider(i, i);
 2147|    316|            }
 2148|  16.0k|        } else {
 2149|       |            // No multipath derivation, MuSigPubkeyProvider uses the first (and only) participant pubkey providers, and the first (and only) path
 2150|  16.0k|            emplace_final_provider(0, 0);
 2151|  16.0k|        }
 2152|  17.2k|        ++key_exp_index; // Increment key expression index for the MuSigPubkeyProvider too
 2153|  17.2k|        return ret;
 2154|  17.2k|    }
 2155|       |
 2156|   115k|    auto origin_split = Split(sp, ']');
 2157|   115k|    if (origin_split.size() > 2) {
  ------------------
  |  Branch (2157:9): [True: 20, False: 115k]
  ------------------
 2158|     20|        error = "Multiple ']' characters found for a single pubkey";
 2159|     20|        return {};
 2160|     20|    }
 2161|       |    // This is set if either the origin or path suffix contains a hardened derivation.
 2162|   115k|    bool apostrophe = false;
 2163|   115k|    if (origin_split.size() == 1) {
  ------------------
  |  Branch (2163:9): [True: 51.2k, False: 64.4k]
  ------------------
 2164|  51.2k|        return ParsePubkeyInner(key_exp_index, origin_split[0], ctx, out, apostrophe, error);
 2165|  51.2k|    }
 2166|  64.4k|    if (origin_split[0].empty() || origin_split[0][0] != '[') {
  ------------------
  |  Branch (2166:9): [True: 7, False: 64.4k]
  |  Branch (2166:36): [True: 9, False: 64.4k]
  ------------------
 2167|     16|        error = strprintf("Key origin start '[ character expected but not found, got '%c' instead",
  ------------------
  |  | 1172|     16|#define strprintf tfm::format
  ------------------
 2168|     16|                          origin_split[0].empty() ? /** empty, implies split char */ ']' : origin_split[0][0]);
  ------------------
  |  Branch (2168:27): [True: 7, False: 9]
  ------------------
 2169|     16|        return {};
 2170|     16|    }
 2171|  64.4k|    auto slash_split = Split(origin_split[0].subspan(1), '/');
 2172|  64.4k|    if (slash_split[0].size() != 8) {
  ------------------
  |  Branch (2172:9): [True: 17, False: 64.4k]
  ------------------
 2173|     17|        error = strprintf("Fingerprint is not 4 bytes (%u characters instead of 8 characters)", slash_split[0].size());
  ------------------
  |  | 1172|     17|#define strprintf tfm::format
  ------------------
 2174|     17|        return {};
 2175|     17|    }
 2176|  64.4k|    std::string fpr_hex = std::string(slash_split[0].begin(), slash_split[0].end());
 2177|  64.4k|    if (!IsHex(fpr_hex)) {
  ------------------
  |  Branch (2177:9): [True: 2, False: 64.4k]
  ------------------
 2178|      2|        error = strprintf("Fingerprint '%s' is not hex", fpr_hex);
  ------------------
  |  | 1172|      2|#define strprintf tfm::format
  ------------------
 2179|      2|        return {};
 2180|      2|    }
 2181|  64.4k|    auto fpr_bytes = ParseHex(fpr_hex);
 2182|  64.4k|    KeyOriginInfo info;
 2183|  64.4k|    static_assert(sizeof(info.fingerprint) == 4, "Fingerprint must be 4 bytes");
 2184|  64.4k|    assert(fpr_bytes.size() == 4);
  ------------------
  |  Branch (2184:5): [True: 64.4k, False: 0]
  ------------------
 2185|  64.4k|    std::copy_n(fpr_bytes.begin(), info.fingerprint.size(), info.fingerprint.begin());
 2186|  64.4k|    std::vector<KeyPath> path;
 2187|  64.4k|    if (!ParseKeyPath(slash_split, path, apostrophe, error, /*allow_multipath=*/false)) return {};
  ------------------
  |  Branch (2187:9): [True: 69, False: 64.3k]
  ------------------
 2188|  64.3k|    info.path = path.at(0);
 2189|  64.3k|    auto providers = ParsePubkeyInner(key_exp_index, origin_split[1], ctx, out, apostrophe, error);
 2190|  64.3k|    if (providers.empty()) return {};
  ------------------
  |  Branch (2190:9): [True: 93, False: 64.2k]
  ------------------
 2191|  64.2k|    ret.reserve(providers.size());
 2192|  84.7k|    for (auto& prov : providers) {
  ------------------
  |  Branch (2192:21): [True: 84.7k, False: 64.2k]
  ------------------
 2193|  84.7k|        ret.emplace_back(std::make_unique<OriginPubkeyProvider>(prov->m_expr_index, info, std::move(prov), apostrophe));
 2194|  84.7k|    }
 2195|  64.2k|    return ret;
 2196|  64.3k|}
descriptor.cpp:_ZN12_GLOBAL__N_115ParseDeriveTypeERNSt3__16vectorINS0_4spanIKcLm18446744073709551615EEENS0_9allocatorIS4_EEEERb:
 1915|  35.3k|{
 1916|  35.3k|    DeriveType type = DeriveType::NON_RANGED;
 1917|  35.3k|    if (std::ranges::equal(split.back(), std::span{"*"}.first(1))) {
  ------------------
  |  Branch (1917:9): [True: 243, False: 35.1k]
  ------------------
 1918|    243|        split.pop_back();
 1919|    243|        type = DeriveType::UNHARDENED_RANGED;
 1920|  35.1k|    } else if (std::ranges::equal(split.back(), std::span{"*'"}.first(2)) || std::ranges::equal(split.back(), std::span{"*h"}.first(2))) {
  ------------------
  |  Branch (1920:16): [True: 1.05k, False: 34.0k]
  |  Branch (1920:16): [True: 1.48k, False: 33.6k]
  |  Branch (1920:78): [True: 431, False: 33.6k]
  ------------------
 1921|  1.48k|        apostrophe = std::ranges::equal(split.back(), std::span{"*'"}.first(2));
 1922|  1.48k|        split.pop_back();
 1923|  1.48k|        type = DeriveType::HARDENED_RANGED;
 1924|  1.48k|    }
 1925|  35.3k|    return type;
 1926|  35.3k|}
descriptor.cpp:_ZN12_GLOBAL__N_112ParseKeyPathERKNSt3__16vectorINS0_4spanIKcLm18446744073709551615EEENS0_9allocatorIS4_EEEERNS1_INS1_IjNS5_IjEEEENS5_ISB_EEEERbRNS0_12basic_stringIcNS0_11char_traitsIcEENS5_IcEEEEbSF_:
 1830|  99.8k|{
 1831|  99.8k|    auto parse_elem = [&](std::span<const char> elem) -> std::optional<uint32_t> {
 1832|  99.8k|        const auto parsed{ParseKeyPathElement(elem)};
 1833|  99.8k|        if (!parsed) {
 1834|  99.8k|            error = parsed.error();
 1835|  99.8k|            return std::nullopt;
 1836|  99.8k|        }
 1837|  99.8k|        if (parsed->is_hardened) {
 1838|  99.8k|            has_hardened = true;
 1839|  99.8k|            apostrophe = elem.back() == '\'';
 1840|  99.8k|        }
 1841|  99.8k|        return parsed->ChildNumber();
 1842|  99.8k|    };
 1843|       |
 1844|  99.8k|    KeyPath path;
 1845|  99.8k|    struct MultipathSubstitutes {
 1846|  99.8k|        size_t placeholder_index;
 1847|  99.8k|        std::vector<uint32_t> values;
 1848|  99.8k|    };
 1849|  99.8k|    std::optional<MultipathSubstitutes> substitutes;
 1850|  99.8k|    has_hardened = false;
 1851|       |
 1852|   218k|    for (size_t i = 1; i < split.size(); ++i) {
  ------------------
  |  Branch (1852:24): [True: 118k, False: 99.6k]
  ------------------
 1853|   118k|        const std::span<const char>& elem = split[i];
 1854|       |
 1855|       |        // Check if element contains multipath specifier
 1856|   118k|        if (!elem.empty() && elem.front() == '<' && elem.back() == '>') {
  ------------------
  |  Branch (1856:13): [True: 118k, False: 4]
  |  Branch (1856:30): [True: 4.69k, False: 113k]
  |  Branch (1856:53): [True: 4.67k, False: 21]
  ------------------
 1857|  4.67k|            if (!allow_multipath) {
  ------------------
  |  Branch (1857:17): [True: 6, False: 4.67k]
  ------------------
 1858|      6|                error = strprintf("Key path value '%s' specifies multipath in a section where multipath is not allowed", std::string(elem.begin(), elem.end()));
  ------------------
  |  | 1172|      6|#define strprintf tfm::format
  ------------------
 1859|      6|                return false;
 1860|      6|            }
 1861|  4.67k|            if (substitutes) {
  ------------------
  |  Branch (1861:17): [True: 1, False: 4.67k]
  ------------------
 1862|      1|                error = "Multiple multipath key path specifiers found";
 1863|      1|                return false;
 1864|      1|            }
 1865|       |
 1866|       |            // Parse each possible value
 1867|  4.67k|            std::vector<std::span<const char>> nums = Split(std::span(elem.begin()+1, elem.end()-1), ";");
 1868|  4.67k|            if (nums.size() < 2) {
  ------------------
  |  Branch (1868:17): [True: 1, False: 4.67k]
  ------------------
 1869|      1|                error = "Multipath key path specifiers must have at least two items";
 1870|      1|                return false;
 1871|      1|            }
 1872|       |
 1873|  4.67k|            substitutes.emplace();
 1874|  4.67k|            std::unordered_set<uint32_t> seen_substitutes;
 1875|  50.5k|            for (const auto& num : nums) {
  ------------------
  |  Branch (1875:34): [True: 50.5k, False: 4.65k]
  ------------------
 1876|  50.5k|                const auto& op_num = parse_elem(num);
 1877|  50.5k|                if (!op_num) return false;
  ------------------
  |  Branch (1877:21): [True: 11, False: 50.5k]
  ------------------
 1878|  50.5k|                auto [_, inserted] = seen_substitutes.insert(*op_num);
 1879|  50.5k|                if (!inserted) {
  ------------------
  |  Branch (1879:21): [True: 3, False: 50.5k]
  ------------------
 1880|      3|                    error = strprintf("Duplicated key path value %u in multipath specifier", *op_num);
  ------------------
  |  | 1172|      3|#define strprintf tfm::format
  ------------------
 1881|      3|                    return false;
 1882|      3|                }
 1883|  50.5k|                substitutes->values.emplace_back(*op_num);
 1884|  50.5k|            }
 1885|       |
 1886|  4.65k|            path.emplace_back(); // Placeholder for multipath segment
 1887|  4.65k|            substitutes->placeholder_index = path.size() - 1;
 1888|   113k|        } else {
 1889|   113k|            const auto& op_num = parse_elem(elem);
 1890|   113k|            if (!op_num) return false;
  ------------------
  |  Branch (1890:17): [True: 119, False: 113k]
  ------------------
 1891|   113k|            path.emplace_back(*op_num);
 1892|   113k|        }
 1893|   118k|    }
 1894|       |
 1895|  99.6k|    if (!substitutes) {
  ------------------
  |  Branch (1895:9): [True: 95.0k, False: 4.65k]
  ------------------
 1896|  95.0k|        out.emplace_back(std::move(path));
 1897|  95.0k|    } else {
 1898|       |        // Replace the multipath placeholder with each value while generating paths
 1899|  50.4k|        for (uint32_t substitute : substitutes->values) {
  ------------------
  |  Branch (1899:34): [True: 50.4k, False: 4.65k]
  ------------------
 1900|  50.4k|            KeyPath branch_path = path;
 1901|  50.4k|            branch_path[substitutes->placeholder_index] = substitute;
 1902|  50.4k|            out.emplace_back(std::move(branch_path));
 1903|  50.4k|        }
 1904|  4.65k|    }
 1905|  99.6k|    return true;
 1906|  99.8k|}
descriptor.cpp:_ZZN12_GLOBAL__N_112ParseKeyPathERKNSt3__16vectorINS0_4spanIKcLm18446744073709551615EEENS0_9allocatorIS4_EEEERNS1_INS1_IjNS5_IjEEEENS5_ISB_EEEERbRNS0_12basic_stringIcNS0_11char_traitsIcEENS5_IcEEEEbSF_ENK3$_0clES4_:
 1831|   164k|    auto parse_elem = [&](std::span<const char> elem) -> std::optional<uint32_t> {
 1832|   164k|        const auto parsed{ParseKeyPathElement(elem)};
 1833|   164k|        if (!parsed) {
  ------------------
  |  Branch (1833:13): [True: 130, False: 164k]
  ------------------
 1834|    130|            error = parsed.error();
 1835|    130|            return std::nullopt;
 1836|    130|        }
 1837|   164k|        if (parsed->is_hardened) {
  ------------------
  |  Branch (1837:13): [True: 30.3k, False: 134k]
  ------------------
 1838|  30.3k|            has_hardened = true;
 1839|  30.3k|            apostrophe = elem.back() == '\'';
 1840|  30.3k|        }
 1841|   164k|        return parsed->ChildNumber();
 1842|   164k|    };
descriptor.cpp:_ZZN12_GLOBAL__N_111ParsePubkeyERjRKNSt3__14spanIKcLm18446744073709551615EEENS_18ParseScriptContextER19FlatSigningProviderRNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clEm:
 2101|  1.24k|        const auto& clone_providers = [&providers](size_t length) -> bool {
 2102|  19.0k|            for (auto& multipath_providers : providers) {
  ------------------
  |  Branch (2102:44): [True: 19.0k, False: 1.24k]
  ------------------
 2103|  19.0k|                if (multipath_providers.size() == 1) {
  ------------------
  |  Branch (2103:21): [True: 17.8k, False: 1.19k]
  ------------------
 2104|   327k|                    for (size_t i = 1; i < length; ++i) {
  ------------------
  |  Branch (2104:40): [True: 309k, False: 17.8k]
  ------------------
 2105|   309k|                        multipath_providers.emplace_back(multipath_providers.at(0)->Clone());
 2106|   309k|                    }
 2107|  17.8k|                } else if (multipath_providers.size() != length) {
  ------------------
  |  Branch (2107:28): [True: 2, False: 1.19k]
  ------------------
 2108|      2|                    return false;
 2109|      2|                }
 2110|  19.0k|            }
 2111|  1.24k|            return true;
 2112|  1.24k|        };
descriptor.cpp:_ZZN12_GLOBAL__N_111ParsePubkeyERjRKNSt3__14spanIKcLm18446744073709551615EEENS_18ParseScriptContextER19FlatSigningProviderRNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_1clEmm:
 2116|  32.1k|        const auto& emplace_final_provider = [&ret, &key_exp_index, &deriv_type, &derivation_multipaths, &providers](size_t vec_idx, size_t path_idx) -> void {
 2117|  32.1k|            KeyPath& path = derivation_multipaths.at(path_idx);
 2118|  32.1k|            std::vector<std::unique_ptr<PubkeyProvider>> pubs;
 2119|  32.1k|            pubs.reserve(providers.size());
 2120|   386k|            for (auto& vec : providers) {
  ------------------
  |  Branch (2120:28): [True: 386k, False: 32.1k]
  ------------------
 2121|   386k|                pubs.emplace_back(std::move(vec.at(vec_idx)));
 2122|   386k|            }
 2123|  32.1k|            ret.emplace_back(std::make_unique<MuSigPubkeyProvider>(key_exp_index, std::move(pubs), path, deriv_type));
 2124|  32.1k|        };
descriptor.cpp:_ZN12_GLOBAL__N_119MuSigPubkeyProviderC2EjNSt3__16vectorINS1_10unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS4_EEEENS1_9allocatorIS7_EEEENS2_IjNS8_IjEEEENS_10DeriveTypeE:
  641|  58.6k|        : PubkeyProvider(exp_index),
  642|  58.6k|        m_participants(std::move(providers)),
  643|  58.6k|        m_path(std::move(path)),
  644|  58.6k|        m_derive(derive),
  645|  58.6k|        m_ranged_participants(std::any_of(m_participants.begin(), m_participants.end(), [](const auto& pubkey) { return pubkey->IsRange(); }))
  646|  58.6k|    {
  647|  58.6k|        if (!Assume(!(m_ranged_participants && IsRangedDerivation()))) {
  ------------------
  |  |  128|  62.6k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  |  |  ------------------
  |  |  |  Branch (128:51): [True: 3.97k, False: 54.6k]
  |  |  |  Branch (128:51): [True: 0, False: 3.97k]
  |  |  ------------------
  ------------------
  |  Branch (647:13): [True: 0, False: 58.6k]
  ------------------
  648|      0|            throw std::runtime_error("musig(): Cannot have both ranged participants and ranged derivation");
  649|      0|        }
  650|  58.6k|        if (!Assume(m_derive != DeriveType::HARDENED_RANGED)) {
  ------------------
  |  |  128|  58.6k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
  |  Branch (650:13): [True: 0, False: 58.6k]
  ------------------
  651|      0|            throw std::runtime_error("musig(): Cannot have hardened derivation");
  652|      0|        }
  653|  58.6k|    }
descriptor.cpp:_ZN12_GLOBAL__N_114PubkeyProviderC2Ej:
  187|  1.53M|    explicit PubkeyProvider(uint32_t exp_index) : m_expr_index(exp_index) {}
descriptor.cpp:_ZNK12_GLOBAL__N_114PubkeyProvider11GetKeyCountEv:
  247|   113k|    virtual size_t GetKeyCount() const { return 1; }
descriptor.cpp:_ZZN12_GLOBAL__N_119MuSigPubkeyProviderC1EjNSt3__16vectorINS1_10unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS4_EEEENS1_9allocatorIS7_EEEENS2_IjNS8_IjEEEENS_10DeriveTypeEENKUlRKT_E_clIS7_EEDaSG_:
  645|   347k|        m_ranged_participants(std::any_of(m_participants.begin(), m_participants.end(), [](const auto& pubkey) { return pubkey->IsRange(); }))
descriptor.cpp:_ZNK12_GLOBAL__N_119MuSigPubkeyProvider18IsRangedDerivationEv:
  632|   345k|    bool IsRangedDerivation() const { return m_derive != DeriveType::NON_RANGED; }
descriptor.cpp:_ZN12_GLOBAL__N_114PubkeyProviderD2Ev:
  189|  1.53M|    virtual ~PubkeyProvider() = default;
descriptor.cpp:_ZNK12_GLOBAL__N_119MuSigPubkeyProvider9GetPubKeyEiRK15SigningProviderR19FlatSigningProviderPK15DescriptorCachePS6_:
  656|   115k|    {
  657|   115k|        FlatSigningProvider dummy;
  658|       |        // If the participants are not ranged, we can compute and cache the aggregate pubkey by creating a PubkeyProvider for it
  659|   115k|        if (!m_aggregate_provider && !m_ranged_participants) {
  ------------------
  |  Branch (659:13): [True: 61.5k, False: 53.6k]
  |  Branch (659:38): [True: 53.6k, False: 7.95k]
  ------------------
  660|       |            // Retrieve the pubkeys from the providers
  661|  53.6k|            std::vector<CPubKey> pubkeys;
  662|   322k|            for (const auto& prov : m_participants) {
  ------------------
  |  Branch (662:35): [True: 322k, False: 53.6k]
  ------------------
  663|   322k|                std::optional<CPubKey> pubkey = prov->GetPubKey(0, arg, dummy, read_cache, write_cache);
  664|   322k|                if (!pubkey.has_value()) {
  ------------------
  |  Branch (664:21): [True: 0, False: 322k]
  ------------------
  665|      0|                    return std::nullopt;
  666|      0|                }
  667|   322k|                pubkeys.push_back(pubkey.value());
  668|   322k|            }
  669|  53.6k|            std::sort(pubkeys.begin(), pubkeys.end());
  670|       |
  671|       |            // Aggregate the pubkey
  672|  53.6k|            m_aggregate_pubkey = MuSig2AggregatePubkeys(pubkeys);
  673|  53.6k|            if (!Assume(m_aggregate_pubkey.has_value())) return std::nullopt;
  ------------------
  |  |  128|  53.6k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
  |  Branch (673:17): [True: 0, False: 53.6k]
  ------------------
  674|       |
  675|       |            // Make our pubkey provider
  676|  53.6k|            if (IsRangedDerivation() || !m_path.empty()) {
  ------------------
  |  Branch (676:17): [True: 1, False: 53.6k]
  |  Branch (676:41): [True: 245, False: 53.4k]
  ------------------
  677|       |                // Make the synthetic xpub and construct the BIP32PubkeyProvider
  678|    246|                CExtPubKey extpub = CreateMuSig2SyntheticXpub(m_aggregate_pubkey.value());
  679|    246|                m_aggregate_provider = std::make_unique<BIP32PubkeyProvider>(m_expr_index, extpub, m_path, m_derive, /*apostrophe=*/false);
  680|  53.4k|            } else {
  681|  53.4k|                m_aggregate_provider = std::make_unique<ConstPubkeyProvider>(m_expr_index, m_aggregate_pubkey.value(), /*xonly=*/false);
  682|  53.4k|            }
  683|  53.6k|        }
  684|       |
  685|       |        // Retrieve all participant pubkeys
  686|   115k|        std::vector<CPubKey> pubkeys;
  687|   856k|        for (const auto& prov : m_participants) {
  ------------------
  |  Branch (687:31): [True: 856k, False: 115k]
  ------------------
  688|   856k|            std::optional<CPubKey> pub = prov->GetPubKey(pos, arg, out, read_cache, write_cache);
  689|   856k|            if (!pub) return std::nullopt;
  ------------------
  |  Branch (689:17): [True: 0, False: 856k]
  ------------------
  690|   856k|            pubkeys.emplace_back(*pub);
  691|   856k|        }
  692|   115k|        std::sort(pubkeys.begin(), pubkeys.end());
  693|       |
  694|   115k|        CPubKey pubout;
  695|   115k|        if (m_aggregate_provider) {
  ------------------
  |  Branch (695:13): [True: 107k, False: 7.95k]
  ------------------
  696|       |            // When we have a cached aggregate key, we are either returning it or deriving from it
  697|       |            // Either way, we can passthrough to its GetPubKey
  698|       |            // Use a dummy signing provider as private keys do not exist for the aggregate pubkey
  699|   107k|            std::optional<CPubKey> pub = m_aggregate_provider->GetPubKey(pos, dummy, out, read_cache, write_cache);
  700|   107k|            if (!pub) return std::nullopt;
  ------------------
  |  Branch (700:17): [True: 0, False: 107k]
  ------------------
  701|   107k|            pubout = *pub;
  702|   107k|            out.aggregate_pubkeys.emplace(m_aggregate_pubkey.value(), pubkeys);
  703|   107k|        } else {
  704|  7.95k|            if (!Assume(m_ranged_participants) || !Assume(m_path.empty())) return std::nullopt;
  ------------------
  |  |  128|  15.9k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
                          if (!Assume(m_ranged_participants) || !Assume(m_path.empty())) return std::nullopt;
  ------------------
  |  |  128|  7.95k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
  |  Branch (704:17): [True: 0, False: 7.95k]
  |  Branch (704:17): [True: 0, False: 7.95k]
  |  Branch (704:51): [True: 0, False: 7.95k]
  ------------------
  705|       |            // Compute aggregate key from derived participants
  706|  7.95k|            std::optional<CPubKey> aggregate_pubkey = MuSig2AggregatePubkeys(pubkeys);
  707|  7.95k|            if (!aggregate_pubkey) return std::nullopt;
  ------------------
  |  Branch (707:17): [True: 0, False: 7.95k]
  ------------------
  708|  7.95k|            pubout = *aggregate_pubkey;
  709|       |
  710|  7.95k|            std::unique_ptr<ConstPubkeyProvider> this_agg_provider = std::make_unique<ConstPubkeyProvider>(m_expr_index, aggregate_pubkey.value(), /*xonly=*/false);
  711|  7.95k|            this_agg_provider->GetPubKey(0, dummy, out, read_cache, write_cache);
  712|  7.95k|            out.aggregate_pubkeys.emplace(pubout, pubkeys);
  713|  7.95k|        }
  714|       |
  715|   115k|        if (!Assume(pubout.IsValid())) return std::nullopt;
  ------------------
  |  |  128|   115k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
  |  Branch (715:13): [True: 0, False: 115k]
  ------------------
  716|   115k|        return pubout;
  717|   115k|    }
descriptor.cpp:_ZN12_GLOBAL__N_119BIP32PubkeyProviderC2EjRK10CExtPubKeyNSt3__16vectorIjNS4_9allocatorIjEEEENS_10DeriveTypeEb:
  445|   473k|    BIP32PubkeyProvider(uint32_t exp_index, const CExtPubKey& extkey, KeyPath path, DeriveType derive, bool apostrophe) : PubkeyProvider(exp_index), m_root_extkey(extkey), m_path(std::move(path)), m_derive(derive), m_apostrophe(apostrophe) {}
descriptor.cpp:_ZNK12_GLOBAL__N_119BIP32PubkeyProvider9GetPubKeyEiRK15SigningProviderR19FlatSigningProviderPK15DescriptorCachePS6_:
  450|  1.21M|    {
  451|  1.21M|        KeyOriginInfo info;
  452|  1.21M|        info.fingerprint = m_root_extkey.id_key_fingerprint();
  453|  1.21M|        info.path = m_path;
  454|  1.21M|        if (m_derive == DeriveType::UNHARDENED_RANGED) info.path.push_back((uint32_t)pos);
  ------------------
  |  Branch (454:13): [True: 2.11k, False: 1.20M]
  ------------------
  455|  1.21M|        if (m_derive == DeriveType::HARDENED_RANGED) info.path.push_back(((uint32_t)pos) | BIP32_HARDENED_FLAG);
  ------------------
  |  Branch (455:13): [True: 24.8k, False: 1.18M]
  ------------------
  456|       |
  457|       |        // Derive keys or fetch them from cache
  458|  1.21M|        CExtPubKey final_extkey = m_root_extkey;
  459|  1.21M|        CExtPubKey parent_extkey = m_root_extkey;
  460|  1.21M|        CExtPubKey last_hardened_extkey;
  461|  1.21M|        bool der = true;
  462|  1.21M|        if (read_cache) {
  ------------------
  |  Branch (462:13): [True: 448k, False: 763k]
  ------------------
  463|   448k|            if (!read_cache->GetCachedDerivedExtPubKey(m_expr_index, pos, final_extkey)) {
  ------------------
  |  Branch (463:17): [True: 436k, False: 12.2k]
  ------------------
  464|   436k|                if (m_derive == DeriveType::HARDENED_RANGED) return std::nullopt;
  ------------------
  |  Branch (464:21): [True: 0, False: 436k]
  ------------------
  465|       |                // Try to get the derivation parent
  466|   436k|                if (!read_cache->GetCachedParentExtPubKey(m_expr_index, parent_extkey)) return std::nullopt;
  ------------------
  |  Branch (466:21): [True: 0, False: 436k]
  ------------------
  467|   436k|                final_extkey = parent_extkey;
  468|   436k|                if (m_derive == DeriveType::UNHARDENED_RANGED) der = parent_extkey.Derive(final_extkey, pos);
  ------------------
  |  Branch (468:21): [True: 749, False: 435k]
  ------------------
  469|   436k|            }
  470|   763k|        } else if (IsHardened()) {
  ------------------
  |  Branch (470:20): [True: 646k, False: 116k]
  ------------------
  471|   646k|            CExtKey xprv;
  472|   646k|            CExtKey lh_xprv;
  473|   646k|            if (!GetDerivedExtKey(arg, xprv, lh_xprv)) return std::nullopt;
  ------------------
  |  Branch (473:17): [True: 0, False: 646k]
  ------------------
  474|   646k|            parent_extkey = xprv.Neuter();
  475|   646k|            if (m_derive == DeriveType::UNHARDENED_RANGED) der = xprv.Derive(xprv, pos);
  ------------------
  |  Branch (475:17): [True: 600, False: 645k]
  ------------------
  476|   646k|            if (m_derive == DeriveType::HARDENED_RANGED) der = xprv.Derive(xprv, pos | BIP32_HARDENED_FLAG);
  ------------------
  |  Branch (476:17): [True: 12.6k, False: 633k]
  ------------------
  477|   646k|            final_extkey = xprv.Neuter();
  478|   646k|            if (lh_xprv.key.IsValid()) {
  ------------------
  |  Branch (478:17): [True: 633k, False: 12.5k]
  ------------------
  479|   633k|                last_hardened_extkey = lh_xprv.Neuter();
  480|   633k|            }
  481|   646k|        } else {
  482|   192k|            for (auto entry : m_path) {
  ------------------
  |  Branch (482:29): [True: 192k, False: 116k]
  ------------------
  483|   192k|                if (!parent_extkey.Derive(parent_extkey, entry)) return std::nullopt;
  ------------------
  |  Branch (483:21): [True: 0, False: 192k]
  ------------------
  484|   192k|            }
  485|   116k|            final_extkey = parent_extkey;
  486|   116k|            if (m_derive == DeriveType::UNHARDENED_RANGED) der = parent_extkey.Derive(final_extkey, pos);
  ------------------
  |  Branch (486:17): [True: 766, False: 116k]
  ------------------
  487|   116k|            assert(m_derive != DeriveType::HARDENED_RANGED);
  ------------------
  |  Branch (487:13): [True: 116k, False: 0]
  ------------------
  488|   116k|        }
  489|  1.21M|        if (!der) return std::nullopt;
  ------------------
  |  Branch (489:13): [True: 0, False: 1.21M]
  ------------------
  490|       |
  491|  1.21M|        out.origins.emplace(final_extkey.pubkey.GetID(), std::make_pair(final_extkey.pubkey, info));
  492|  1.21M|        out.pubkeys.emplace(final_extkey.pubkey.GetID(), final_extkey.pubkey);
  493|       |
  494|  1.21M|        if (write_cache) {
  ------------------
  |  Branch (494:13): [True: 702k, False: 509k]
  ------------------
  495|       |            // Only cache parent if there is any unhardened derivation
  496|   702k|            if (m_derive != DeriveType::HARDENED_RANGED) {
  ------------------
  |  Branch (496:17): [True: 690k, False: 12.2k]
  ------------------
  497|   690k|                write_cache->CacheParentExtPubKey(m_expr_index, parent_extkey);
  498|       |                // Cache last hardened xpub if we have it
  499|   690k|                if (last_hardened_extkey.pubkey.IsValid()) {
  ------------------
  |  Branch (499:21): [True: 630k, False: 59.1k]
  ------------------
  500|   630k|                    write_cache->CacheLastHardenedExtPubKey(m_expr_index, last_hardened_extkey);
  501|   630k|                }
  502|   690k|            } else if (info.path.size() > 0) {
  ------------------
  |  Branch (502:24): [True: 12.2k, False: 0]
  ------------------
  503|  12.2k|                write_cache->CacheDerivedExtPubKey(m_expr_index, pos, final_extkey);
  504|  12.2k|            }
  505|   702k|        }
  506|       |
  507|  1.21M|        return final_extkey.pubkey;
  508|  1.21M|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119BIP32PubkeyProvider10IsHardenedEv:
  439|   763k|    {
  440|   763k|        if (m_derive == DeriveType::HARDENED_RANGED) return true;
  ------------------
  |  Branch (440:13): [True: 12.6k, False: 750k]
  ------------------
  441|   750k|        return HasHardenedDerivation(m_path);
  442|   763k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119BIP32PubkeyProvider16GetDerivedExtKeyERK15SigningProviderR7CExtKeyS5_:
  427|  1.49M|    {
  428|  1.49M|        if (!GetExtKey(arg, xprv)) return false;
  ------------------
  |  Branch (428:13): [True: 0, False: 1.49M]
  ------------------
  429|  2.38M|        for (auto entry : m_path) {
  ------------------
  |  Branch (429:25): [True: 2.38M, False: 1.49M]
  ------------------
  430|  2.38M|            if (!xprv.Derive(xprv, entry)) return false;
  ------------------
  |  Branch (430:17): [True: 0, False: 2.38M]
  ------------------
  431|  2.38M|            if (entry >> 31) {
  ------------------
  |  Branch (431:17): [True: 1.42M, False: 954k]
  ------------------
  432|  1.42M|                last_hardened = xprv;
  433|  1.42M|            }
  434|  2.38M|        }
  435|  1.49M|        return true;
  436|  1.49M|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119BIP32PubkeyProvider9GetExtKeyERK15SigningProviderR7CExtKey:
  414|  1.94M|    {
  415|  1.94M|        CKey key;
  416|  1.94M|        if (!arg.GetKey(m_root_extkey.pubkey.GetID(), key)) return false;
  ------------------
  |  Branch (416:13): [True: 0, False: 1.94M]
  ------------------
  417|  1.94M|        ret.nDepth = m_root_extkey.nDepth;
  418|  1.94M|        ret.fingerprint = m_root_extkey.fingerprint;
  419|  1.94M|        ret.nChild = m_root_extkey.nChild;
  420|  1.94M|        ret.chaincode = m_root_extkey.chaincode;
  421|  1.94M|        ret.key = key;
  422|  1.94M|        return true;
  423|  1.94M|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119BIP32PubkeyProvider7IsRangeEv:
  446|  1.77M|    bool IsRange() const override { return m_derive != DeriveType::NON_RANGED; }
descriptor.cpp:_ZNK12_GLOBAL__N_119BIP32PubkeyProvider7GetSizeEv:
  447|  25.9k|    size_t GetSize() const override { return 33; }
descriptor.cpp:_ZNK12_GLOBAL__N_119BIP32PubkeyProvider8ToStringENS_14PubkeyProvider10StringTypeE:
  521|   490k|    {
  522|   490k|        return ToString(type, /*normalized=*/false);
  523|   490k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119BIP32PubkeyProvider8ToStringENS_14PubkeyProvider10StringTypeEb:
  510|   503k|    {
  511|       |        // If StringType==COMPAT, always use the apostrophe to stay compatible with previous versions
  512|   503k|        const bool use_apostrophe = (!normalized && m_apostrophe) || type == StringType::COMPAT;
  ------------------
  |  Branch (512:38): [True: 490k, False: 12.2k]
  |  Branch (512:53): [True: 428k, False: 62.5k]
  |  Branch (512:70): [True: 0, False: 74.8k]
  ------------------
  513|   503k|        std::string ret = EncodeExtPubKey(m_root_extkey) + FormatHDKeypath(m_path, /*apostrophe=*/use_apostrophe);
  514|   503k|        if (IsRange()) {
  ------------------
  |  Branch (514:13): [True: 25.5k, False: 477k]
  ------------------
  515|  25.5k|            ret += "/*";
  516|  25.5k|            if (m_derive == DeriveType::HARDENED_RANGED) ret += use_apostrophe ? '\'' : 'h';
  ------------------
  |  Branch (516:17): [True: 24.6k, False: 923]
  |  Branch (516:65): [True: 12.2k, False: 12.3k]
  ------------------
  517|  25.5k|        }
  518|   503k|        return ret;
  519|   503k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119BIP32PubkeyProvider15ToPrivateStringERK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  525|   449k|    {
  526|   449k|        CExtKey key;
  527|   449k|        if (!GetExtKey(arg, key)) {
  ------------------
  |  Branch (527:13): [True: 0, False: 449k]
  ------------------
  528|      0|            out = ToString(StringType::PUBLIC);
  529|      0|            return false;
  530|      0|        }
  531|   449k|        out = EncodeExtKey(key) + FormatHDKeypath(m_path, /*apostrophe=*/m_apostrophe);
  532|   449k|        if (IsRange()) {
  ------------------
  |  Branch (532:13): [True: 13.0k, False: 436k]
  ------------------
  533|  13.0k|            out += "/*";
  534|  13.0k|            if (m_derive == DeriveType::HARDENED_RANGED) out += m_apostrophe ? '\'' : 'h';
  ------------------
  |  Branch (534:17): [True: 12.2k, False: 748]
  |  Branch (534:65): [True: 12.2k, False: 46]
  ------------------
  535|  13.0k|        }
  536|   449k|        return true;
  537|   449k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119BIP32PubkeyProvider18ToNormalizedStringERK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEPK15DescriptorCache:
  539|   449k|    {
  540|   449k|        if (m_derive == DeriveType::HARDENED_RANGED) {
  ------------------
  |  Branch (540:13): [True: 12.2k, False: 437k]
  ------------------
  541|  12.2k|            out = ToString(StringType::PUBLIC, /*normalized=*/true);
  542|       |
  543|  12.2k|            return true;
  544|  12.2k|        }
  545|       |        // Step backwards to find the last hardened step in the path
  546|   437k|        int i = (int)m_path.size() - 1;
  547|   512k|        for (; i >= 0; --i) {
  ------------------
  |  Branch (547:16): [True: 472k, False: 40.9k]
  ------------------
  548|   472k|            if (m_path.at(i) >> 31) {
  ------------------
  |  Branch (548:17): [True: 396k, False: 75.4k]
  ------------------
  549|   396k|                break;
  550|   396k|            }
  551|   472k|        }
  552|       |        // Either no derivation or all unhardened derivation
  553|   437k|        if (i == -1) {
  ------------------
  |  Branch (553:13): [True: 40.9k, False: 396k]
  ------------------
  554|  40.9k|            out = ToString();
  555|  40.9k|            return true;
  556|  40.9k|        }
  557|       |        // Get the path to the last hardened stup
  558|   396k|        KeyOriginInfo origin;
  559|   396k|        int k = 0;
  560|  1.02M|        for (; k <= i; ++k) {
  ------------------
  |  Branch (560:16): [True: 631k, False: 396k]
  ------------------
  561|       |            // Add to the path
  562|   631k|            origin.path.push_back(m_path.at(k));
  563|   631k|        }
  564|       |        // Build the remaining path
  565|   396k|        KeyPath end_path;
  566|   399k|        for (; k < (int)m_path.size(); ++k) {
  ------------------
  |  Branch (566:16): [True: 3.19k, False: 396k]
  ------------------
  567|  3.19k|            end_path.push_back(m_path.at(k));
  568|  3.19k|        }
  569|   396k|        origin.fingerprint = m_root_extkey.id_key_fingerprint();
  570|       |
  571|   396k|        CExtPubKey xpub;
  572|   396k|        CExtKey lh_xprv;
  573|       |        // If we have the cache, just get the parent xpub
  574|   396k|        if (cache != nullptr) {
  ------------------
  |  Branch (574:13): [True: 0, False: 396k]
  ------------------
  575|      0|            cache->GetCachedLastHardenedExtPubKey(m_expr_index, xpub);
  576|      0|        }
  577|   396k|        if (!xpub.pubkey.IsValid()) {
  ------------------
  |  Branch (577:13): [True: 396k, False: 0]
  ------------------
  578|       |            // Cache miss, or nor cache, or need privkey
  579|   396k|            CExtKey xprv;
  580|   396k|            if (!GetDerivedExtKey(arg, xprv, lh_xprv)) return false;
  ------------------
  |  Branch (580:17): [True: 0, False: 396k]
  ------------------
  581|   396k|            xpub = lh_xprv.Neuter();
  582|   396k|        }
  583|   396k|        assert(xpub.pubkey.IsValid());
  ------------------
  |  Branch (583:9): [True: 396k, False: 0]
  ------------------
  584|       |
  585|       |        // Build the string
  586|   396k|        std::string origin_str = HexStr(origin.fingerprint) + FormatHDKeypath(origin.path);
  587|   396k|        out = "[" + origin_str + "]" + EncodeExtPubKey(xpub) + FormatHDKeypath(end_path);
  588|   396k|        if (IsRange()) {
  ------------------
  |  Branch (588:13): [True: 600, False: 395k]
  ------------------
  589|    600|            out += "/*";
  590|    600|            assert(m_derive == DeriveType::UNHARDENED_RANGED);
  ------------------
  |  Branch (590:13): [True: 600, False: 0]
  ------------------
  591|    600|        }
  592|   396k|        return true;
  593|   396k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119BIP32PubkeyProvider10GetPrivKeyEiRK15SigningProviderR19FlatSigningProvider:
  595|   448k|    {
  596|   448k|        CExtKey extkey;
  597|   448k|        CExtKey dummy;
  598|   448k|        if (!GetDerivedExtKey(arg, extkey, dummy)) return;
  ------------------
  |  Branch (598:13): [True: 0, False: 448k]
  ------------------
  599|   448k|        if (m_derive == DeriveType::UNHARDENED_RANGED && !extkey.Derive(extkey, pos)) return;
  ------------------
  |  Branch (599:13): [True: 748, False: 447k]
  |  Branch (599:58): [True: 0, False: 748]
  ------------------
  600|   448k|        if (m_derive == DeriveType::HARDENED_RANGED && !extkey.Derive(extkey, pos | BIP32_HARDENED_FLAG)) return;
  ------------------
  |  Branch (600:13): [True: 12.2k, False: 436k]
  |  Branch (600:56): [True: 0, False: 12.2k]
  ------------------
  601|   448k|        out.keys.emplace(extkey.key.GetPubKey().GetID(), extkey.key);
  602|   448k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119BIP32PubkeyProvider5CloneEv:
  612|   392k|    {
  613|   392k|        return std::make_unique<BIP32PubkeyProvider>(m_expr_index, m_root_extkey, m_path, m_derive, m_apostrophe);
  614|   392k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119BIP32PubkeyProvider7IsBIP32Ev:
  448|  20.6k|    bool IsBIP32() const override { return true; }
descriptor.cpp:_ZN12_GLOBAL__N_119ConstPubkeyProviderC2EjRK7CPubKeyb:
  347|   346k|    ConstPubkeyProvider(uint32_t exp_index, const CPubKey& pubkey, bool xonly) : PubkeyProvider(exp_index), m_pubkey(pubkey), m_xonly(xonly) {}
descriptor.cpp:_ZNK12_GLOBAL__N_119ConstPubkeyProvider7IsRangeEv:
  357|   159k|    bool IsRange() const override { return false; }
descriptor.cpp:_ZNK12_GLOBAL__N_119ConstPubkeyProvider7GetSizeEv:
  358|  17.9k|    size_t GetSize() const override { return m_pubkey.size(); }
descriptor.cpp:_ZNK12_GLOBAL__N_119ConstPubkeyProvider8ToStringENS_14PubkeyProvider10StringTypeE:
  360|   283k|    std::string ToString(StringType type) const override { return m_xonly ? HexStr(m_pubkey).substr(2) : HexStr(m_pubkey); }
  ------------------
  |  Branch (360:67): [True: 65.7k, False: 217k]
  ------------------
descriptor.cpp:_ZNK12_GLOBAL__N_119ConstPubkeyProvider15ToPrivateStringERK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  362|  93.8k|    {
  363|  93.8k|        std::optional<CKey> key = GetPrivKey(arg);
  364|  93.8k|        if (!key) {
  ------------------
  |  Branch (364:13): [True: 93.7k, False: 21]
  ------------------
  365|  93.7k|            ret = ToString(StringType::PUBLIC);
  366|  93.7k|            return false;
  367|  93.7k|        }
  368|     21|        ret = EncodeSecret(*key);
  369|     21|        return true;
  370|  93.8k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119ConstPubkeyProvider10GetPrivKeyERK15SigningProvider:
  339|   186k|    {
  340|   186k|        CKey key;
  341|   186k|        if (!(m_xonly ? arg.GetKeyByXOnly(XOnlyPubKey(m_pubkey), key) :
  ------------------
  |  Branch (341:13): [True: 186k, False: 37]
  |  Branch (341:15): [True: 42.9k, False: 143k]
  ------------------
  342|   186k|                        arg.GetKey(m_pubkey.GetID(), key))) return std::nullopt;
  343|     37|        return key;
  344|   186k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119ConstPubkeyProvider18ToNormalizedStringERK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEPK15DescriptorCache:
  372|  93.8k|    {
  373|  93.8k|        ret = ToString(StringType::PUBLIC);
  374|  93.8k|        return true;
  375|  93.8k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119ConstPubkeyProvider10GetPrivKeyEiRK15SigningProviderR19FlatSigningProvider:
  377|  92.9k|    {
  378|  92.9k|        std::optional<CKey> key = GetPrivKey(arg);
  379|  92.9k|        if (!key) return;
  ------------------
  |  Branch (379:13): [True: 92.9k, False: 16]
  ------------------
  380|     16|        out.keys.emplace(key->GetPubKey().GetID(), *key);
  381|     16|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119ConstPubkeyProvider5CloneEv:
  391|  34.7k|    {
  392|  34.7k|        return std::make_unique<ConstPubkeyProvider>(m_expr_index, m_pubkey, m_xonly);
  393|  34.7k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119ConstPubkeyProvider7IsBIP32Ev:
  359|  15.6k|    bool IsBIP32() const override { return false; }
descriptor.cpp:_ZNK12_GLOBAL__N_119ConstPubkeyProvider9GetPubKeyEiRK15SigningProviderR19FlatSigningProviderPK15DescriptorCachePS6_:
  349|   437k|    {
  350|   437k|        KeyOriginInfo info;
  351|   437k|        CKeyID keyid = m_pubkey.GetID();
  352|   437k|        info.fingerprint = keyid.fingerprint();
  353|   437k|        out.origins.emplace(keyid, std::make_pair(m_pubkey, info));
  354|   437k|        out.pubkeys.emplace(keyid, m_pubkey);
  355|   437k|        return m_pubkey;
  356|   437k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119MuSigPubkeyProvider7IsRangeEv:
  718|   115k|    bool IsRange() const override { return IsRangedDerivation() || m_ranged_participants; }
  ------------------
  |  Branch (718:44): [True: 2, False: 115k]
  |  Branch (718:68): [True: 7.95k, False: 107k]
  ------------------
descriptor.cpp:_ZNK12_GLOBAL__N_119MuSigPubkeyProvider7GetSizeEv:
  720|  14.7k|    size_t GetSize() const override { return 32; }
descriptor.cpp:_ZNK12_GLOBAL__N_119MuSigPubkeyProvider8ToStringENS_14PubkeyProvider10StringTypeE:
  723|  57.8k|    {
  724|  57.8k|        std::string out = "musig(";
  725|   486k|        for (size_t i = 0; i < m_participants.size(); ++i) {
  ------------------
  |  Branch (725:28): [True: 428k, False: 57.8k]
  ------------------
  726|   428k|            const auto& pubkey = m_participants.at(i);
  727|   428k|            if (i) out += ",";
  ------------------
  |  Branch (727:17): [True: 370k, False: 57.8k]
  ------------------
  728|   428k|            out += pubkey->ToString(type);
  729|   428k|        }
  730|  57.8k|        out += ")";
  731|  57.8k|        out += FormatHDKeypath(m_path);
  732|  57.8k|        if (IsRangedDerivation()) {
  ------------------
  |  Branch (732:13): [True: 1, False: 57.8k]
  ------------------
  733|      1|            out += "/*";
  734|      1|        }
  735|  57.8k|        return out;
  736|  57.8k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119MuSigPubkeyProvider15ToPrivateStringERK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  738|  57.6k|    {
  739|  57.6k|        bool any_privkeys = false;
  740|  57.6k|        out = "musig(";
  741|   485k|        for (size_t i = 0; i < m_participants.size(); ++i) {
  ------------------
  |  Branch (741:28): [True: 428k, False: 57.6k]
  ------------------
  742|   428k|            const auto& pubkey = m_participants.at(i);
  743|   428k|            if (i) out += ",";
  ------------------
  |  Branch (743:17): [True: 370k, False: 57.6k]
  ------------------
  744|   428k|            std::string tmp;
  745|   428k|            if (pubkey->ToPrivateString(arg, tmp)) {
  ------------------
  |  Branch (745:17): [True: 358k, False: 69.2k]
  ------------------
  746|   358k|                any_privkeys = true;
  747|   358k|            }
  748|   428k|            out += tmp;
  749|   428k|        }
  750|  57.6k|        out += ")";
  751|  57.6k|        out += FormatHDKeypath(m_path);
  752|  57.6k|        if (IsRangedDerivation()) {
  ------------------
  |  Branch (752:13): [True: 1, False: 57.6k]
  ------------------
  753|      1|            out += "/*";
  754|      1|        }
  755|  57.6k|        return any_privkeys;
  756|  57.6k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119MuSigPubkeyProvider18ToNormalizedStringERK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEPK15DescriptorCache:
  758|  57.6k|    {
  759|  57.6k|        out = "musig(";
  760|   485k|        for (size_t i = 0; i < m_participants.size(); ++i) {
  ------------------
  |  Branch (760:28): [True: 428k, False: 57.6k]
  ------------------
  761|   428k|            const auto& pubkey = m_participants.at(i);
  762|   428k|            if (i) out += ",";
  ------------------
  |  Branch (762:17): [True: 370k, False: 57.6k]
  ------------------
  763|   428k|            std::string tmp;
  764|   428k|            if (!pubkey->ToNormalizedString(arg, tmp, cache)) {
  ------------------
  |  Branch (764:17): [True: 0, False: 428k]
  ------------------
  765|      0|                return false;
  766|      0|            }
  767|   428k|            out += tmp;
  768|   428k|        }
  769|  57.6k|        out += ")";
  770|  57.6k|        out += FormatHDKeypath(m_path);
  771|  57.6k|        if (IsRangedDerivation()) {
  ------------------
  |  Branch (771:13): [True: 1, False: 57.6k]
  ------------------
  772|      1|            out += "/*";
  773|      1|        }
  774|  57.6k|        return true;
  775|  57.6k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119MuSigPubkeyProvider10GetPrivKeyEiRK15SigningProviderR19FlatSigningProvider:
  778|  57.6k|    {
  779|       |        // Get the private keys for any participants that we have
  780|       |        // If there is participant derivation, it will be done.
  781|       |        // If there is not, then the participant privkeys will be included directly
  782|   428k|        for (const auto& prov : m_participants) {
  ------------------
  |  Branch (782:31): [True: 428k, False: 57.6k]
  ------------------
  783|   428k|            prov->GetPrivKey(pos, arg, out);
  784|   428k|        }
  785|  57.6k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119MuSigPubkeyProvider5CloneEv:
  807|  26.5k|    {
  808|  26.5k|        std::vector<std::unique_ptr<PubkeyProvider>> providers;
  809|  26.5k|        providers.reserve(m_participants.size());
  810|  43.4k|        for (const std::unique_ptr<PubkeyProvider>& p : m_participants) {
  ------------------
  |  Branch (810:55): [True: 43.4k, False: 26.5k]
  ------------------
  811|  43.4k|            providers.emplace_back(p->Clone());
  812|  43.4k|        }
  813|  26.5k|        return std::make_unique<MuSigPubkeyProvider>(m_expr_index, std::move(providers), m_path, m_derive);
  814|  26.5k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119MuSigPubkeyProvider11GetKeyCountEv:
  821|  57.6k|    {
  822|  57.6k|        return 1 + m_participants.size();
  823|  57.6k|    }
descriptor.cpp:_ZN12_GLOBAL__N_116ParsePubkeyInnerERjRKNSt3__14spanIKcLm18446744073709551615EEENS_18ParseScriptContextER19FlatSigningProviderRbRNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
 1930|   115k|{
 1931|   115k|    std::vector<std::unique_ptr<PubkeyProvider>> ret;
 1932|   115k|    bool permit_uncompressed = ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH;
  ------------------
  |  Branch (1932:32): [True: 1.81k, False: 113k]
  |  Branch (1932:66): [True: 4.28k, False: 109k]
  ------------------
 1933|   115k|    auto split = Split(sp, '/');
 1934|   115k|    std::string str(split[0].begin(), split[0].end());
 1935|   115k|    if (str.size() == 0) {
  ------------------
  |  Branch (1935:9): [True: 45, False: 115k]
  ------------------
 1936|     45|        error = "No key provided";
 1937|     45|        return {};
 1938|     45|    }
 1939|   115k|    if (IsSpace(str.front()) || IsSpace(str.back())) {
  ------------------
  |  Branch (1939:9): [True: 4, False: 115k]
  |  Branch (1939:33): [True: 1, False: 115k]
  ------------------
 1940|      5|        error = strprintf("Key '%s' is invalid due to whitespace", str);
  ------------------
  |  | 1172|      5|#define strprintf tfm::format
  ------------------
 1941|      5|        return {};
 1942|      5|    }
 1943|   115k|    if (split.size() == 1) {
  ------------------
  |  Branch (1943:9): [True: 81.3k, False: 34.1k]
  ------------------
 1944|  81.3k|        if (IsHex(str)) {
  ------------------
  |  Branch (1944:13): [True: 79.6k, False: 1.73k]
  ------------------
 1945|  79.6k|            std::vector<unsigned char> data = ParseHex(str);
 1946|  79.6k|            CPubKey pubkey(data);
 1947|  79.6k|            if (pubkey.IsValid() && !pubkey.IsValidNonHybrid()) {
  ------------------
  |  Branch (1947:17): [True: 48.3k, False: 31.2k]
  |  Branch (1947:37): [True: 2, False: 48.3k]
  ------------------
 1948|      2|                error = "Hybrid public keys are not allowed";
 1949|      2|                return {};
 1950|      2|            }
 1951|  79.6k|            if (pubkey.IsFullyValid()) {
  ------------------
  |  Branch (1951:17): [True: 48.2k, False: 31.4k]
  ------------------
 1952|  48.2k|                if (permit_uncompressed || pubkey.IsCompressed()) {
  ------------------
  |  Branch (1952:21): [True: 982, False: 47.2k]
  |  Branch (1952:44): [True: 47.2k, False: 0]
  ------------------
 1953|  48.2k|                    ret.emplace_back(std::make_unique<ConstPubkeyProvider>(key_exp_index, pubkey, false));
 1954|  48.2k|                    ++key_exp_index;
 1955|  48.2k|                    return ret;
 1956|  48.2k|                } else {
 1957|      0|                    error = "Uncompressed keys are not allowed";
 1958|      0|                    return {};
 1959|      0|                }
 1960|  48.2k|            } else if (data.size() == 32 && ctx == ParseScriptContext::P2TR) {
  ------------------
  |  Branch (1960:24): [True: 31.1k, False: 285]
  |  Branch (1960:45): [True: 31.1k, False: 3]
  ------------------
 1961|  31.1k|                unsigned char fullkey[33] = {0x02};
 1962|  31.1k|                std::copy(data.begin(), data.end(), fullkey + 1);
 1963|  31.1k|                pubkey.Set(std::begin(fullkey), std::end(fullkey));
 1964|  31.1k|                if (pubkey.IsFullyValid()) {
  ------------------
  |  Branch (1964:21): [True: 31.0k, False: 104]
  ------------------
 1965|  31.0k|                    ret.emplace_back(std::make_unique<ConstPubkeyProvider>(key_exp_index, pubkey, true));
 1966|  31.0k|                    ++key_exp_index;
 1967|  31.0k|                    return ret;
 1968|  31.0k|                }
 1969|  31.1k|            }
 1970|    392|            error = strprintf("Pubkey '%s' is invalid", str);
  ------------------
  |  | 1172|    392|#define strprintf tfm::format
  ------------------
 1971|    392|            return {};
 1972|  79.6k|        }
 1973|  1.73k|        CKey key = DecodeSecret(str);
 1974|  1.73k|        if (key.IsValid()) {
  ------------------
  |  Branch (1974:13): [True: 196, False: 1.53k]
  ------------------
 1975|    196|            if (permit_uncompressed || key.IsCompressed()) {
  ------------------
  |  Branch (1975:17): [True: 5, False: 191]
  |  Branch (1975:40): [True: 191, False: 0]
  ------------------
 1976|    196|                CPubKey pubkey = key.GetPubKey();
 1977|    196|                out.keys.emplace(pubkey.GetID(), key);
 1978|    196|                ret.emplace_back(std::make_unique<ConstPubkeyProvider>(key_exp_index, pubkey, ctx == ParseScriptContext::P2TR));
 1979|    196|                ++key_exp_index;
 1980|    196|                return ret;
 1981|    196|            } else {
 1982|      0|                error = "Uncompressed keys are not allowed";
 1983|      0|                return {};
 1984|      0|            }
 1985|    196|        }
 1986|  1.73k|    }
 1987|  35.6k|    CExtKey extkey = DecodeExtKey(str);
 1988|  35.6k|    CExtPubKey extpubkey = DecodeExtPubKey(str);
 1989|  35.6k|    if (!extkey.key.IsValid() && !extpubkey.pubkey.IsValid()) {
  ------------------
  |  Branch (1989:9): [True: 372, False: 35.3k]
  |  Branch (1989:34): [True: 372, False: 0]
  ------------------
 1990|    372|        error = strprintf("key '%s' is not valid", str);
  ------------------
  |  | 1172|    372|#define strprintf tfm::format
  ------------------
 1991|    372|        return {};
 1992|    372|    }
 1993|  35.3k|    std::vector<KeyPath> paths;
 1994|  35.3k|    DeriveType type = ParseDeriveType(split, apostrophe);
 1995|  35.3k|    if (!ParseKeyPath(split, paths, apostrophe, error, /*allow_multipath=*/true)) return {};
  ------------------
  |  Branch (1995:9): [True: 71, False: 35.2k]
  ------------------
 1996|  35.2k|    if (extkey.key.IsValid()) {
  ------------------
  |  Branch (1996:9): [True: 35.2k, False: 0]
  ------------------
 1997|  35.2k|        extpubkey = extkey.Neuter();
 1998|  35.2k|        out.keys.emplace(extpubkey.pubkey.GetID(), extkey.key);
 1999|  35.2k|    }
 2000|  80.6k|    for (auto& path : paths) {
  ------------------
  |  Branch (2000:21): [True: 80.6k, False: 35.2k]
  ------------------
 2001|  80.6k|        ret.emplace_back(std::make_unique<BIP32PubkeyProvider>(key_exp_index, extpubkey, std::move(path), type, apostrophe));
 2002|  80.6k|    }
 2003|  35.2k|    ++key_exp_index;
 2004|  35.2k|    return ret;
 2005|  35.3k|}
descriptor.cpp:_ZN12_GLOBAL__N_112ParseKeyPathERKNSt3__16vectorINS0_4spanIKcLm18446744073709551615EEENS0_9allocatorIS4_EEEERNS1_INS1_IjNS5_IjEEEENS5_ISB_EEEERbRNS0_12basic_stringIcNS0_11char_traitsIcEENS5_IcEEEEb:
 1909|  99.7k|{
 1910|  99.7k|    bool dummy;
 1911|  99.7k|    return ParseKeyPath(split, out, apostrophe, error, allow_multipath, /*has_hardened=*/dummy);
 1912|  99.7k|}
descriptor.cpp:_ZN12_GLOBAL__N_120OriginPubkeyProviderC2Ej13KeyOriginInfoNSt3__110unique_ptrINS_14PubkeyProviderENS2_14default_deleteIS4_EEEEb:
  267|   652k|    OriginPubkeyProvider(uint32_t exp_index, KeyOriginInfo info, std::unique_ptr<PubkeyProvider> provider, bool apostrophe) : PubkeyProvider(exp_index), m_origin(std::move(info)), m_provider(std::move(provider)), m_apostrophe(apostrophe) {}
descriptor.cpp:_ZNK12_GLOBAL__N_120OriginPubkeyProvider9GetPubKeyEiRK15SigningProviderR19FlatSigningProviderPK15DescriptorCachePS6_:
  269|  1.31M|    {
  270|       |        // Derive into a temporary provider. Another key expression may have already put this
  271|       |        // key into out with its origin prefixed, and prefixing that entry would double it up.
  272|  1.31M|        FlatSigningProvider subprovider;
  273|  1.31M|        std::optional<CPubKey> pub = m_provider->GetPubKey(pos, arg, subprovider, read_cache, write_cache);
  274|  1.31M|        if (!pub) return std::nullopt;
  ------------------
  |  Branch (274:13): [True: 0, False: 1.31M]
  ------------------
  275|  1.31M|        const CKeyID keyid{pub->GetID()};
  276|  1.31M|        Assert(subprovider.pubkeys.contains(keyid));
  ------------------
  |  |  116|  1.31M|#define Assert(val) inline_assertion_check<true>(val, std::source_location::current(), #val)
  ------------------
  277|  1.31M|        auto& [pubkey, suborigin] = subprovider.origins[keyid];
  278|  1.31M|        Assert(pubkey == *pub); // m_provider must have a valid origin by this point.
  ------------------
  |  |  116|  1.31M|#define Assert(val) inline_assertion_check<true>(val, std::source_location::current(), #val)
  ------------------
  279|  1.31M|        suborigin.fingerprint = m_origin.fingerprint;
  280|  1.31M|        suborigin.path.insert(suborigin.path.begin(), m_origin.path.begin(), m_origin.path.end());
  281|  1.31M|        auto origin{subprovider.origins.extract(keyid)};
  282|  1.31M|        out.Merge(std::move(subprovider));
  283|       |        // An explicit origin takes precedence over an implicit one for the same key.
  284|  1.31M|        out.origins.insert_or_assign(keyid, std::move(origin.mapped()));
  285|  1.31M|        return pub;
  286|  1.31M|    }
descriptor.cpp:_ZNK12_GLOBAL__N_120OriginPubkeyProvider7IsRangeEv:
  287|   464k|    bool IsRange() const override { return m_provider->IsRange(); }
descriptor.cpp:_ZNK12_GLOBAL__N_120OriginPubkeyProvider7GetSizeEv:
  288|  9.04k|    size_t GetSize() const override { return m_provider->GetSize(); }
descriptor.cpp:_ZNK12_GLOBAL__N_120OriginPubkeyProvider8ToStringENS_14PubkeyProvider10StringTypeE:
  290|   466k|    std::string ToString(StringType type) const override { return "[" + OriginString(type) + "]" + m_provider->ToString(type); }
descriptor.cpp:_ZNK12_GLOBAL__N_120OriginPubkeyProvider12OriginStringENS_14PubkeyProvider10StringTypeEb:
  260|  1.40M|    {
  261|       |        // If StringType==COMPAT, always use the apostrophe to stay compatible with previous versions
  262|  1.40M|        bool use_apostrophe = (!normalized && m_apostrophe) || type == StringType::COMPAT;
  ------------------
  |  Branch (262:32): [True: 933k, False: 466k]
  |  Branch (262:47): [True: 811k, False: 121k]
  |  Branch (262:64): [True: 0, False: 588k]
  ------------------
  263|  1.40M|        return HexStr(m_origin.fingerprint) + FormatHDKeypath(m_origin.path, use_apostrophe);
  264|  1.40M|    }
descriptor.cpp:_ZNK12_GLOBAL__N_120OriginPubkeyProvider15ToPrivateStringERK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  292|   466k|    {
  293|   466k|        std::string sub;
  294|   466k|        bool has_priv_key{m_provider->ToPrivateString(arg, sub)};
  295|   466k|        ret = "[" + OriginString(StringType::PUBLIC) + "]" + std::move(sub);
  296|   466k|        return has_priv_key;
  297|   466k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_120OriginPubkeyProvider18ToNormalizedStringERK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEPK15DescriptorCache:
  299|   466k|    {
  300|   466k|        std::string sub;
  301|   466k|        if (!m_provider->ToNormalizedString(arg, sub, cache)) return false;
  ------------------
  |  Branch (301:13): [True: 0, False: 466k]
  ------------------
  302|       |        // If m_provider is a BIP32PubkeyProvider, we may get a string formatted like a OriginPubkeyProvider
  303|       |        // In that case, we need to strip out the leading square bracket and fingerprint from the substring,
  304|       |        // and append that to our own origin string.
  305|   466k|        if (sub[0] == '[') {
  ------------------
  |  Branch (305:13): [True: 391k, False: 75.8k]
  ------------------
  306|   391k|            sub = sub.substr(9);
  307|   391k|            ret = "[" + OriginString(StringType::PUBLIC, /*normalized=*/true) + std::move(sub);
  308|   391k|        } else {
  309|  75.8k|            ret = "[" + OriginString(StringType::PUBLIC, /*normalized=*/true) + "]" + std::move(sub);
  310|  75.8k|        }
  311|   466k|        return true;
  312|   466k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_120OriginPubkeyProvider10GetPrivKeyEiRK15SigningProviderR19FlatSigningProvider:
  314|   466k|    {
  315|   466k|        m_provider->GetPrivKey(pos, arg, out);
  316|   466k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_120OriginPubkeyProvider5CloneEv:
  326|   397k|    {
  327|   397k|        return std::make_unique<OriginPubkeyProvider>(m_expr_index, m_origin, m_provider->Clone(), m_apostrophe);
  328|   397k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_120OriginPubkeyProvider7IsBIP32Ev:
  289|  19.9k|    bool IsBIP32() const override { return m_provider->IsBIP32(); }
descriptor.cpp:_ZN12_GLOBAL__N_112PKDescriptorC2ENSt3__110unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS3_EEEEb:
 1202|  7.12k|    PKDescriptor(std::unique_ptr<PubkeyProvider> prov, bool xonly = false) : DescriptorImpl(Vector(std::move(prov)), "pk"), m_xonly(xonly) {}
descriptor.cpp:_ZN12_GLOBAL__N_114DescriptorImplC2ENSt3__16vectorINS1_10unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS4_EEEENS1_9allocatorIS7_EEEERKNS1_12basic_stringIcNS1_11char_traitsIcEENS8_IcEEEE:
  868|  42.8k|    DescriptorImpl(std::vector<std::unique_ptr<PubkeyProvider>> pubkeys, const std::string& name) : m_pubkey_args(std::move(pubkeys)), m_name(name), m_subdescriptor_args() {}
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl21MaxSatisfactionWeightEb:
 1054|  1.96k|    std::optional<int64_t> MaxSatisfactionWeight(bool) const override { return {}; }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl20MaxSatisfactionElemsEv:
 1056|    982|    std::optional<int64_t> MaxSatisfactionElems() const override { return {}; }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl7IsRangeEv:
  907|   102k|    {
  908|   299k|        for (const auto& pubkey : m_pubkey_args) {
  ------------------
  |  Branch (908:33): [True: 299k, False: 93.4k]
  ------------------
  909|   299k|            if (pubkey->IsRange()) return true;
  ------------------
  |  Branch (909:17): [True: 9.10k, False: 290k]
  ------------------
  910|   299k|        }
  911|  93.4k|        for (const auto& arg : m_subdescriptor_args) {
  ------------------
  |  Branch (911:30): [True: 36.4k, False: 92.3k]
  ------------------
  912|  36.4k|            if (arg->IsRange()) return true;
  ------------------
  |  Branch (912:17): [True: 1.07k, False: 35.4k]
  ------------------
  913|  36.4k|        }
  914|  92.3k|        return false;
  915|  93.4k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl10IsSolvableEv:
  882|  46.1k|    {
  883|  46.1k|        for (const auto& arg : m_subdescriptor_args) {
  ------------------
  |  Branch (883:30): [True: 18.2k, False: 46.1k]
  ------------------
  884|  18.2k|            if (!arg->IsSolvable()) return false;
  ------------------
  |  Branch (884:17): [True: 0, False: 18.2k]
  ------------------
  885|  18.2k|        }
  886|  46.1k|        return true;
  887|  46.1k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl8ToStringEb:
  976|  33.0k|    {
  977|  33.0k|        std::string ret;
  978|  33.0k|        ToStringHelper(nullptr, ret, compat_format ? StringType::COMPAT : StringType::PUBLIC);
  ------------------
  |  Branch (978:38): [True: 0, False: 33.0k]
  ------------------
  979|  33.0k|        return AddChecksum(ret);
  980|  33.0k|    }
descriptor.cpp:_ZN12_GLOBAL__N_111AddChecksumERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  171|  98.6k|std::string AddChecksum(const std::string& str) { return str + "#" + DescriptorChecksum(str); }
descriptor.cpp:_ZNK12_GLOBAL__N_112PKDescriptor12IsSingleTypeEv:
 1203|    496|    bool IsSingleType() const final { return true; }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl15ToPrivateStringERK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  983|  32.5k|    {
  984|  32.5k|        bool has_priv_key{ToStringHelper(&arg, out, StringType::PRIVATE)};
  985|  32.5k|        out = AddChecksum(out);
  986|  32.5k|        return has_priv_key;
  987|  32.5k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl18ToNormalizedStringERK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEPK15DescriptorCache:
  990|  33.0k|    {
  991|  33.0k|        bool ret = ToStringHelper(&arg, out, StringType::NORMALIZED, cache);
  992|  33.0k|        out = AddChecksum(out);
  993|  33.0k|        return ret;
  994|  33.0k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl6ExpandEiRK15SigningProviderRNSt3__16vectorI7CScriptNS4_9allocatorIS6_EEEER19FlatSigningProviderP15DescriptorCache:
 1023|  33.0k|    {
 1024|  33.0k|        return ExpandHelper(pos, provider, nullptr, output_scripts, out, write_cache);
 1025|  33.0k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl12ExpandHelperEiRK15SigningProviderPK15DescriptorCacheRNSt3__16vectorI7CScriptNS7_9allocatorIS9_EEEER19FlatSigningProviderPS4_:
  998|   102k|    {
  999|   102k|        FlatSigningProvider subprovider;
 1000|   102k|        std::vector<CPubKey> pubkeys;
 1001|   102k|        pubkeys.reserve(m_pubkey_args.size());
 1002|       |
 1003|       |        // Construct temporary data in `pubkeys`, `subscripts`, and `subprovider` to avoid producing output in case of failure.
 1004|   341k|        for (const auto& p : m_pubkey_args) {
  ------------------
  |  Branch (1004:28): [True: 341k, False: 102k]
  ------------------
 1005|   341k|            std::optional<CPubKey> pubkey = p->GetPubKey(pos, arg, subprovider, read_cache, write_cache);
 1006|   341k|            if (!pubkey) return false;
  ------------------
  |  Branch (1006:17): [True: 0, False: 341k]
  ------------------
 1007|   341k|            pubkeys.push_back(pubkey.value());
 1008|   341k|        }
 1009|   102k|        std::vector<CScript> subscripts;
 1010|   102k|        for (const auto& subarg : m_subdescriptor_args) {
  ------------------
  |  Branch (1010:33): [True: 36.4k, False: 102k]
  ------------------
 1011|  36.4k|            std::vector<CScript> outscripts;
 1012|  36.4k|            if (!subarg->ExpandHelper(pos, arg, read_cache, outscripts, subprovider, write_cache)) return false;
  ------------------
  |  Branch (1012:17): [True: 0, False: 36.4k]
  ------------------
 1013|  36.4k|            assert(outscripts.size() == 1);
  ------------------
  |  Branch (1013:13): [True: 36.4k, False: 0]
  ------------------
 1014|  36.4k|            subscripts.emplace_back(std::move(outscripts[0]));
 1015|  36.4k|        }
 1016|   102k|        out.Merge(std::move(subprovider));
 1017|       |
 1018|   102k|        output_scripts = MakeScripts(pubkeys, std::span{subscripts}, out);
 1019|   102k|        return true;
 1020|   102k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl15ExpandFromCacheEiRK15DescriptorCacheRNSt3__16vectorI7CScriptNS4_9allocatorIS6_EEEER19FlatSigningProvider:
 1028|  33.0k|    {
 1029|  33.0k|        return ExpandHelper(pos, DUMMY_SIGNING_PROVIDER, &read_cache, output_scripts, out, nullptr);
 1030|  33.0k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl13ExpandPrivateEiRK15SigningProviderR19FlatSigningProvider:
 1034|  51.2k|    {
 1035|   170k|        for (const auto& p : m_pubkey_args) {
  ------------------
  |  Branch (1035:28): [True: 170k, False: 51.2k]
  ------------------
 1036|   170k|            p->GetPrivKey(pos, provider, out);
 1037|   170k|        }
 1038|  51.2k|        for (const auto& arg : m_subdescriptor_args) {
  ------------------
  |  Branch (1038:30): [True: 18.2k, False: 51.2k]
  ------------------
 1039|  18.2k|            arg->ExpandPrivate(pos, provider, out);
 1040|  18.2k|        }
 1041|  51.2k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl13GetOutputTypeEv:
 1043|  9.09k|    std::optional<OutputType> GetOutputType() const override { return std::nullopt; }
descriptor.cpp:_ZNK12_GLOBAL__N_112PKDescriptor10ScriptSizeEv:
 1205|  3.41k|    std::optional<int64_t> ScriptSize() const override {
 1206|  3.41k|        return 1 + (m_xonly ? 32 : m_pubkey_args[0]->GetSize()) + 1;
  ------------------
  |  Branch (1206:21): [True: 0, False: 3.41k]
  ------------------
 1207|  3.41k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_112PKDescriptor21MaxSatisfactionWeightEb:
 1214|    496|    std::optional<int64_t> MaxSatisfactionWeight(bool use_max_sig) const override {
 1215|    496|        return *MaxSatSize(use_max_sig) * WITNESS_SCALE_FACTOR;
 1216|    496|    }
descriptor.cpp:_ZNK12_GLOBAL__N_112PKDescriptor20MaxSatisfactionElemsEv:
 1218|  1.82k|    std::optional<int64_t> MaxSatisfactionElems() const override { return 1; }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl13GetMaxKeyExprEv:
 1087|  33.0k|    {
 1088|  33.0k|        uint32_t max_key_expr{0};
 1089|  33.0k|        std::vector<const DescriptorImpl*> todo = {this};
 1090|  84.3k|        while (!todo.empty()) {
  ------------------
  |  Branch (1090:16): [True: 51.2k, False: 33.0k]
  ------------------
 1091|  51.2k|            const DescriptorImpl* desc = todo.back();
 1092|  51.2k|            todo.pop_back();
 1093|   170k|            for (const auto& p : desc->m_pubkey_args) {
  ------------------
  |  Branch (1093:32): [True: 170k, False: 51.2k]
  ------------------
 1094|   170k|                max_key_expr = std::max(max_key_expr, p->m_expr_index);
 1095|   170k|            }
 1096|  51.2k|            for (const auto& s : desc->m_subdescriptor_args) {
  ------------------
  |  Branch (1096:32): [True: 18.2k, False: 51.2k]
  ------------------
 1097|  18.2k|                todo.push_back(s.get());
 1098|  18.2k|            }
 1099|  51.2k|        }
 1100|  33.0k|        return max_key_expr;
 1101|  33.0k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl11GetKeyCountEv:
 1104|  33.0k|    {
 1105|  33.0k|        size_t count{0};
 1106|  33.0k|        std::vector<const DescriptorImpl*> todo = {this};
 1107|  84.3k|        while (!todo.empty()) {
  ------------------
  |  Branch (1107:16): [True: 51.2k, False: 33.0k]
  ------------------
 1108|  51.2k|            const DescriptorImpl* desc = todo.back();
 1109|  51.2k|            todo.pop_back();
 1110|   170k|            for (const auto& p : desc->m_pubkey_args) {
  ------------------
  |  Branch (1110:32): [True: 170k, False: 51.2k]
  ------------------
 1111|   170k|                count += p->GetKeyCount();
 1112|   170k|            }
 1113|  51.2k|            for (const auto& s : desc->m_subdescriptor_args) {
  ------------------
  |  Branch (1113:32): [True: 18.2k, False: 51.2k]
  ------------------
 1114|  18.2k|                todo.push_back(s.get());
 1115|  18.2k|            }
 1116|  51.2k|        }
 1117|  33.0k|        return count;
 1118|  33.0k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl13ToStringExtraEv:
  853|   108k|    virtual std::string ToStringExtra() const { return ""; }
descriptor.cpp:_ZNK12_GLOBAL__N_112PKDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEENS1_4spanIK7CScriptLm18446744073709551615EEER19FlatSigningProvider:
 1193|  6.11k|    {
 1194|  6.11k|        if (m_xonly) {
  ------------------
  |  Branch (1194:13): [True: 2.45k, False: 3.65k]
  ------------------
 1195|  2.45k|            CScript script = CScript() << ToByteVector(XOnlyPubKey(keys[0])) << OP_CHECKSIG;
 1196|  2.45k|            return Vector(std::move(script));
 1197|  3.65k|        } else {
 1198|  3.65k|            return Vector(GetScriptForRawPubKey(keys[0]));
 1199|  3.65k|        }
 1200|  6.11k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl23ToStringSubScriptHelperEPK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_10StringTypeEPK15DescriptorCache:
  919|  63.9k|    {
  920|  63.9k|        size_t pos = 0;
  921|  63.9k|        bool is_private{type == StringType::PRIVATE};
  922|       |        // For private string output, track if at least one key has a private key available.
  923|       |        // Initialize to true for non-private types.
  924|  63.9k|        bool any_success{!is_private};
  925|  63.9k|        for (const auto& scriptarg : m_subdescriptor_args) {
  ------------------
  |  Branch (925:36): [True: 19.3k, False: 63.9k]
  ------------------
  926|  19.3k|            if (pos++) ret += ",";
  ------------------
  |  Branch (926:17): [True: 0, False: 19.3k]
  ------------------
  927|  19.3k|            std::string tmp;
  928|  19.3k|            bool subscript_res{scriptarg->ToStringHelper(arg, tmp, type, cache)};
  929|  19.3k|            if (!is_private && !subscript_res) return false;
  ------------------
  |  Branch (929:17): [True: 12.9k, False: 6.45k]
  |  Branch (929:32): [True: 0, False: 12.9k]
  ------------------
  930|  19.3k|            any_success = any_success || subscript_res;
  ------------------
  |  Branch (930:27): [True: 12.9k, False: 6.45k]
  |  Branch (930:42): [True: 5.87k, False: 577]
  ------------------
  931|  19.3k|            ret += tmp;
  932|  19.3k|        }
  933|  63.9k|        return any_success;
  934|  63.9k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl14ToStringHelperEPK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_10StringTypeEPK15DescriptorCache:
  938|   139k|    {
  939|   139k|        std::string extra = ToStringExtra();
  940|   139k|        size_t pos = extra.size() > 0 ? 1 : 0;
  ------------------
  |  Branch (940:22): [True: 31.0k, False: 108k]
  ------------------
  941|   139k|        std::string ret = m_name + "(" + extra;
  942|   139k|        bool is_private{type == StringType::PRIVATE};
  943|       |        // For private string output, track if at least one key has a private key available.
  944|       |        // Initialize to true for non-private types.
  945|   139k|        bool any_success{!is_private};
  946|       |
  947|   490k|        for (const auto& pubkey : m_pubkey_args) {
  ------------------
  |  Branch (947:33): [True: 490k, False: 139k]
  ------------------
  948|   490k|            if (pos++) ret += ",";
  ------------------
  |  Branch (948:17): [True: 401k, False: 88.9k]
  ------------------
  949|   490k|            std::string tmp;
  950|   490k|            switch (type) {
  ------------------
  |  Branch (950:21): [True: 490k, False: 0]
  ------------------
  951|   163k|                case StringType::NORMALIZED:
  ------------------
  |  Branch (951:17): [True: 163k, False: 327k]
  ------------------
  952|   163k|                    if (!pubkey->ToNormalizedString(*arg, tmp, cache)) return false;
  ------------------
  |  Branch (952:25): [True: 0, False: 163k]
  ------------------
  953|   163k|                    break;
  954|   163k|                case StringType::PRIVATE:
  ------------------
  |  Branch (954:17): [True: 163k, False: 327k]
  ------------------
  955|   163k|                    any_success = pubkey->ToPrivateString(*arg, tmp) || any_success;
  ------------------
  |  Branch (955:35): [True: 108k, False: 55.3k]
  |  Branch (955:73): [True: 734, False: 54.5k]
  ------------------
  956|   163k|                    break;
  957|   163k|                case StringType::PUBLIC:
  ------------------
  |  Branch (957:17): [True: 163k, False: 327k]
  ------------------
  958|   163k|                    tmp = pubkey->ToString();
  959|   163k|                    break;
  960|      0|                case StringType::COMPAT:
  ------------------
  |  Branch (960:17): [True: 0, False: 490k]
  ------------------
  961|      0|                    tmp = pubkey->ToString(PubkeyProvider::StringType::COMPAT);
  962|      0|                    break;
  963|   490k|            }
  964|   490k|            ret += tmp;
  965|   490k|        }
  966|   139k|        std::string subscript;
  967|   139k|        bool subscript_res{ToStringSubScriptHelper(arg, subscript, type, cache)};
  968|   139k|        if (!is_private && !subscript_res) return false;
  ------------------
  |  Branch (968:13): [True: 93.1k, False: 46.1k]
  |  Branch (968:28): [True: 0, False: 93.1k]
  ------------------
  969|   139k|        any_success = any_success || subscript_res;
  ------------------
  |  Branch (969:23): [True: 126k, False: 12.5k]
  |  Branch (969:38): [True: 7.39k, False: 5.10k]
  ------------------
  970|   139k|        if (pos && subscript.size()) ret += ',';
  ------------------
  |  Branch (970:13): [True: 119k, False: 19.3k]
  |  Branch (970:20): [True: 26.0k, False: 93.9k]
  ------------------
  971|   139k|        out = std::move(ret) + std::move(subscript) + ")";
  972|   139k|        return any_success;
  973|   139k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_112PKDescriptor10MaxSatSizeEb:
 1209|  3.65k|    std::optional<int64_t> MaxSatSize(bool use_max_sig) const override {
 1210|  3.65k|        const auto ecdsa_sig_size = use_max_sig ? 72 : 71;
  ------------------
  |  Branch (1210:37): [True: 1.82k, False: 1.82k]
  ------------------
 1211|  3.65k|        return 1 + (m_xonly ? 65 : ecdsa_sig_size);
  ------------------
  |  Branch (1211:21): [True: 0, False: 3.65k]
  ------------------
 1212|  3.65k|    }
descriptor.cpp:_ZN12_GLOBAL__N_113PKHDescriptorC2ENSt3__110unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS3_EEEE:
 1236|    980|    PKHDescriptor(std::unique_ptr<PubkeyProvider> prov) : DescriptorImpl(Vector(std::move(prov)), "pkh") {}
descriptor.cpp:_ZNK12_GLOBAL__N_113PKHDescriptor12IsSingleTypeEv:
 1238|    164|    bool IsSingleType() const final { return true; }
descriptor.cpp:_ZNK12_GLOBAL__N_113PKHDescriptor13GetOutputTypeEv:
 1237|  1.00k|    std::optional<OutputType> GetOutputType() const override { return OutputType::LEGACY; }
descriptor.cpp:_ZNK12_GLOBAL__N_113PKHDescriptor10ScriptSizeEv:
 1240|    882|    std::optional<int64_t> ScriptSize() const override { return 1 + 1 + 1 + 20 + 1 + 1; }
descriptor.cpp:_ZNK12_GLOBAL__N_113PKHDescriptor21MaxSatisfactionWeightEb:
 1247|    164|    std::optional<int64_t> MaxSatisfactionWeight(bool use_max_sig) const override {
 1248|    164|        return *MaxSatSize(use_max_sig) * WITNESS_SCALE_FACTOR;
 1249|    164|    }
descriptor.cpp:_ZNK12_GLOBAL__N_113PKHDescriptor20MaxSatisfactionElemsEv:
 1251|    482|    std::optional<int64_t> MaxSatisfactionElems() const override { return 2; }
descriptor.cpp:_ZNK12_GLOBAL__N_113PKHDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEENS1_4spanIK7CScriptLm18446744073709551615EEER19FlatSigningProvider:
 1231|    964|    {
 1232|    964|        CKeyID id = keys[0].GetID();
 1233|    964|        return Vector(GetScriptForDestination(PKHash(id)));
 1234|    964|    }
descriptor.cpp:_ZNK12_GLOBAL__N_113PKHDescriptor10MaxSatSizeEb:
 1242|    964|    std::optional<int64_t> MaxSatSize(bool use_max_sig) const override {
 1243|    964|        const auto sig_size = use_max_sig ? 72 : 71;
  ------------------
  |  Branch (1243:31): [True: 482, False: 482]
  ------------------
 1244|    964|        return 1 + sig_size + 1 + m_pubkey_args[0]->GetSize();
 1245|    964|    }
descriptor.cpp:_ZN12_GLOBAL__N_115ComboDescriptorC2ENSt3__110unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS3_EEEE:
 1311|    535|    ComboDescriptor(std::unique_ptr<PubkeyProvider> prov) : DescriptorImpl(Vector(std::move(prov)), "combo") {}
descriptor.cpp:_ZNK12_GLOBAL__N_115ComboDescriptor12IsSingleTypeEv:
 1312|  1.03k|    bool IsSingleType() const final { return false; }
descriptor.cpp:_ZNK12_GLOBAL__N_115ComboDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEENS1_4spanIK7CScriptLm18446744073709551615EEER19FlatSigningProvider:
 1297|  1.03k|    {
 1298|  1.03k|        std::vector<CScript> ret;
 1299|  1.03k|        CKeyID id = keys[0].GetID();
 1300|  1.03k|        ret.emplace_back(GetScriptForRawPubKey(keys[0])); // P2PK
 1301|  1.03k|        ret.emplace_back(GetScriptForDestination(PKHash(id))); // P2PKH
 1302|  1.03k|        if (keys[0].IsCompressed()) {
  ------------------
  |  Branch (1302:13): [True: 1.03k, False: 0]
  ------------------
 1303|  1.03k|            CScript p2wpkh = GetScriptForDestination(WitnessV0KeyHash(id));
 1304|  1.03k|            out.scripts.emplace(CScriptID(p2wpkh), p2wpkh);
 1305|  1.03k|            ret.emplace_back(p2wpkh);
 1306|  1.03k|            ret.emplace_back(GetScriptForDestination(ScriptHash(p2wpkh))); // P2SH-P2WPKH
 1307|  1.03k|        }
 1308|  1.03k|        return ret;
 1309|  1.03k|    }
descriptor.cpp:_ZN12_GLOBAL__N_118MultisigDescriptorC2EiNSt3__16vectorINS1_10unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS4_EEEENS1_9allocatorIS7_EEEEb:
 1335|  3.65k|    MultisigDescriptor(int threshold, std::vector<std::unique_ptr<PubkeyProvider>> providers, bool sorted = false) : DescriptorImpl(std::move(providers), sorted ? "sortedmulti" : "multi"), m_threshold(threshold), m_sorted(sorted) {}
  ------------------
  |  Branch (1335:155): [True: 1.05k, False: 2.60k]
  ------------------
descriptor.cpp:_ZNK12_GLOBAL__N_118MultisigDescriptor12IsSingleTypeEv:
 1336|    354|    bool IsSingleType() const final { return true; }
descriptor.cpp:_ZNK12_GLOBAL__N_118MultisigDescriptor10ScriptSizeEv:
 1338|  3.38k|    std::optional<int64_t> ScriptSize() const override {
 1339|  3.38k|        const auto n_keys = m_pubkey_args.size();
 1340|  3.38k|        auto op = [](int64_t acc, const std::unique_ptr<PubkeyProvider>& pk) { return acc + 1 + pk->GetSize();};
 1341|  3.38k|        const auto pubkeys_size{std::accumulate(m_pubkey_args.begin(), m_pubkey_args.end(), int64_t{0}, op)};
 1342|  3.38k|        return 1 + BuildScript(n_keys).size() + BuildScript(m_threshold).size() + pubkeys_size;
 1343|  3.38k|    }
descriptor.cpp:_ZZNK12_GLOBAL__N_118MultisigDescriptor10ScriptSizeEvENKUllRKNSt3__110unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS3_EEEEE_clElS8_:
 1340|  13.7k|        auto op = [](int64_t acc, const std::unique_ptr<PubkeyProvider>& pk) { return acc + 1 + pk->GetSize();};
descriptor.cpp:_ZNK12_GLOBAL__N_118MultisigDescriptor21MaxSatisfactionWeightEb:
 1350|    354|    std::optional<int64_t> MaxSatisfactionWeight(bool use_max_sig) const override {
 1351|    354|        return *MaxSatSize(use_max_sig) * WITNESS_SCALE_FACTOR;
 1352|    354|    }
descriptor.cpp:_ZNK12_GLOBAL__N_118MultisigDescriptor20MaxSatisfactionElemsEv:
 1354|  1.78k|    std::optional<int64_t> MaxSatisfactionElems() const override { return 1 + m_threshold; }
descriptor.cpp:_ZNK12_GLOBAL__N_118MultisigDescriptor13ToStringExtraEv:
 1325|  5.34k|    std::string ToStringExtra() const override { return strprintf("%i", m_threshold); }
  ------------------
  |  | 1172|  5.34k|#define strprintf tfm::format
  ------------------
descriptor.cpp:_ZNK12_GLOBAL__N_118MultisigDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEENS1_4spanIK7CScriptLm18446744073709551615EEER19FlatSigningProvider:
 1326|  3.56k|    std::vector<CScript> MakeScripts(const std::vector<CPubKey>& keys, std::span<const CScript>, FlatSigningProvider&) const override {
 1327|  3.56k|        if (m_sorted) {
  ------------------
  |  Branch (1327:13): [True: 2.08k, False: 1.47k]
  ------------------
 1328|  2.08k|            std::vector<CPubKey> sorted_keys(keys);
 1329|  2.08k|            std::sort(sorted_keys.begin(), sorted_keys.end());
 1330|  2.08k|            return Vector(GetScriptForMultisig(m_threshold, sorted_keys));
 1331|  2.08k|        }
 1332|  1.47k|        return Vector(GetScriptForMultisig(m_threshold, keys));
 1333|  3.56k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_118MultisigDescriptor10MaxSatSizeEb:
 1345|  3.56k|    std::optional<int64_t> MaxSatSize(bool use_max_sig) const override {
 1346|  3.56k|        const auto sig_size = use_max_sig ? 72 : 71;
  ------------------
  |  Branch (1346:31): [True: 1.78k, False: 1.78k]
  ------------------
 1347|  3.56k|        return (1 + (1 + sig_size) * m_threshold);
 1348|  3.56k|    }
descriptor.cpp:_ZN12_GLOBAL__N_116MultiADescriptorC2EiNSt3__16vectorINS1_10unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS4_EEEENS1_9allocatorIS7_EEEEb:
 1386|  16.9k|    MultiADescriptor(int threshold, std::vector<std::unique_ptr<PubkeyProvider>> providers, bool sorted = false) : DescriptorImpl(std::move(providers), sorted ? "sortedmulti_a" : "multi_a"), m_threshold(threshold), m_sorted(sorted) {}
  ------------------
  |  Branch (1386:153): [True: 6.19k, False: 10.7k]
  ------------------
descriptor.cpp:_ZNK12_GLOBAL__N_116MultiADescriptor13ToStringExtraEv:
 1371|  24.7k|    std::string ToStringExtra() const override { return strprintf("%i", m_threshold); }
  ------------------
  |  | 1172|  24.7k|#define strprintf tfm::format
  ------------------
descriptor.cpp:_ZNK12_GLOBAL__N_116MultiADescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEENS1_4spanIK7CScriptLm18446744073709551615EEER19FlatSigningProvider:
 1372|  16.5k|    std::vector<CScript> MakeScripts(const std::vector<CPubKey>& keys, std::span<const CScript>, FlatSigningProvider&) const override {
 1373|  16.5k|        CScript ret;
 1374|  16.5k|        std::vector<XOnlyPubKey> xkeys;
 1375|  16.5k|        xkeys.reserve(keys.size());
 1376|   254k|        for (const auto& key : keys) xkeys.emplace_back(key);
  ------------------
  |  Branch (1376:30): [True: 254k, False: 16.5k]
  ------------------
 1377|  16.5k|        if (m_sorted) std::sort(xkeys.begin(), xkeys.end());
  ------------------
  |  Branch (1377:13): [True: 12.0k, False: 4.49k]
  ------------------
 1378|  16.5k|        ret << ToByteVector(xkeys[0]) << OP_CHECKSIG;
 1379|   254k|        for (size_t i = 1; i < keys.size(); ++i) {
  ------------------
  |  Branch (1379:28): [True: 237k, False: 16.5k]
  ------------------
 1380|   237k|            ret << ToByteVector(xkeys[i]) << OP_CHECKSIGADD;
 1381|   237k|        }
 1382|  16.5k|        ret << m_threshold << OP_NUMEQUAL;
 1383|  16.5k|        return Vector(std::move(ret));
 1384|  16.5k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_116MultiADescriptor5CloneEv:
 1401|  1.05k|    {
 1402|  1.05k|        std::vector<std::unique_ptr<PubkeyProvider>> providers;
 1403|  1.05k|        providers.reserve(m_pubkey_args.size());
 1404|  1.41k|        for (const auto& arg : m_pubkey_args) {
  ------------------
  |  Branch (1404:30): [True: 1.41k, False: 1.05k]
  ------------------
 1405|  1.41k|            providers.push_back(arg->Clone());
 1406|  1.41k|        }
 1407|  1.05k|        return std::make_unique<MultiADescriptor>(m_threshold, std::move(providers), m_sorted);
 1408|  1.05k|    }
descriptor.cpp:_ZN12_GLOBAL__N_114WPKHDescriptorC2ENSt3__110unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS3_EEEE:
 1269|    871|    WPKHDescriptor(std::unique_ptr<PubkeyProvider> prov) : DescriptorImpl(Vector(std::move(prov)), "wpkh") {}
descriptor.cpp:_ZNK12_GLOBAL__N_114WPKHDescriptor12IsSingleTypeEv:
 1271|     80|    bool IsSingleType() const final { return true; }
descriptor.cpp:_ZNK12_GLOBAL__N_114WPKHDescriptor13GetOutputTypeEv:
 1270|    588|    std::optional<OutputType> GetOutputType() const override { return OutputType::BECH32; }
descriptor.cpp:_ZNK12_GLOBAL__N_114WPKHDescriptor10ScriptSizeEv:
 1273|    294|    std::optional<int64_t> ScriptSize() const override { return 1 + 1 + 20; }
descriptor.cpp:_ZNK12_GLOBAL__N_114WPKHDescriptor21MaxSatisfactionWeightEb:
 1280|     80|    std::optional<int64_t> MaxSatisfactionWeight(bool use_max_sig) const override {
 1281|     80|        return MaxSatSize(use_max_sig);
 1282|     80|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114WPKHDescriptor20MaxSatisfactionElemsEv:
 1284|    167|    std::optional<int64_t> MaxSatisfactionElems() const override { return 2; }
descriptor.cpp:_ZNK12_GLOBAL__N_114WPKHDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEENS1_4spanIK7CScriptLm18446744073709551615EEER19FlatSigningProvider:
 1264|    334|    {
 1265|    334|        CKeyID id = keys[0].GetID();
 1266|    334|        return Vector(GetScriptForDestination(WitnessV0KeyHash(id)));
 1267|    334|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114WPKHDescriptor10MaxSatSizeEb:
 1275|    334|    std::optional<int64_t> MaxSatSize(bool use_max_sig) const override {
 1276|    334|        const auto sig_size = use_max_sig ? 72 : 71;
  ------------------
  |  Branch (1276:31): [True: 167, False: 167]
  ------------------
 1277|    334|        return (1 + sig_size + 1 + 33);
 1278|    334|    }
descriptor.cpp:_ZN12_GLOBAL__N_112SHDescriptorC2ENSt3__110unique_ptrINS_14DescriptorImplENS1_14default_deleteIS3_EEEE:
 1425|  5.48k|    SHDescriptor(std::unique_ptr<DescriptorImpl> desc) : DescriptorImpl({}, std::move(desc), "sh") {}
descriptor.cpp:_ZN12_GLOBAL__N_114DescriptorImplC2ENSt3__16vectorINS1_10unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS4_EEEENS1_9allocatorIS7_EEEENS3_IS0_NS5_IS0_EEEERKNS1_12basic_stringIcNS1_11char_traitsIcEENS8_IcEEEE:
  869|  13.4k|    DescriptorImpl(std::vector<std::unique_ptr<PubkeyProvider>> pubkeys, std::unique_ptr<DescriptorImpl> script, const std::string& name) : m_pubkey_args(std::move(pubkeys)), m_name(name), m_subdescriptor_args(Vector(std::move(script))) {}
descriptor.cpp:_ZNK12_GLOBAL__N_112SHDescriptor12IsSingleTypeEv:
 1433|  4.97k|    bool IsSingleType() const final { return true; }
descriptor.cpp:_ZNK12_GLOBAL__N_112SHDescriptor13GetOutputTypeEv:
 1428|  4.97k|    {
 1429|  4.97k|        assert(m_subdescriptor_args.size() == 1);
  ------------------
  |  Branch (1429:9): [True: 4.97k, False: 0]
  ------------------
 1430|  4.97k|        if (IsSegwit()) return OutputType::P2SH_SEGWIT;
  ------------------
  |  Branch (1430:13): [True: 968, False: 4.00k]
  ------------------
 1431|  4.00k|        return OutputType::LEGACY;
 1432|  4.97k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_112SHDescriptor8IsSegwitEv:
 1422|  9.94k|    bool IsSegwit() const { return m_subdescriptor_args[0]->GetOutputType() == OutputType::BECH32; }
descriptor.cpp:_ZNK12_GLOBAL__N_112SHDescriptor10ScriptSizeEv:
 1435|  2.48k|    std::optional<int64_t> ScriptSize() const override { return 1 + 1 + 20 + 1; }
descriptor.cpp:_ZNK12_GLOBAL__N_112SHDescriptor21MaxSatisfactionWeightEb:
 1437|  4.97k|    std::optional<int64_t> MaxSatisfactionWeight(bool use_max_sig) const override {
 1438|  4.97k|        if (const auto sat_size = m_subdescriptor_args[0]->MaxSatSize(use_max_sig)) {
  ------------------
  |  Branch (1438:24): [True: 4.97k, False: 0]
  ------------------
 1439|  4.97k|            if (const auto subscript_size = m_subdescriptor_args[0]->ScriptSize()) {
  ------------------
  |  Branch (1439:28): [True: 4.97k, False: 0]
  ------------------
 1440|       |                // The subscript is never witness data.
 1441|  4.97k|                const auto subscript_weight = (1 + *subscript_size) * WITNESS_SCALE_FACTOR;
 1442|       |                // The weight depends on whether the inner descriptor is satisfied using the witness stack.
 1443|  4.97k|                if (IsSegwit()) return subscript_weight + *sat_size;
  ------------------
  |  Branch (1443:21): [True: 968, False: 4.00k]
  ------------------
 1444|  4.00k|                return subscript_weight + *sat_size * WITNESS_SCALE_FACTOR;
 1445|  4.97k|            }
 1446|  4.97k|        }
 1447|      0|        return {};
 1448|  4.97k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_112SHDescriptor20MaxSatisfactionElemsEv:
 1450|  2.48k|    std::optional<int64_t> MaxSatisfactionElems() const override {
 1451|  2.48k|        if (const auto sub_elems = m_subdescriptor_args[0]->MaxSatisfactionElems()) return 1 + *sub_elems;
  ------------------
  |  Branch (1451:24): [True: 2.48k, False: 0]
  ------------------
 1452|      0|        return {};
 1453|  2.48k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_112SHDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEENS1_4spanIK7CScriptLm18446744073709551615EEER19FlatSigningProvider:
 1416|  4.97k|    {
 1417|  4.97k|        auto ret = Vector(GetScriptForDestination(ScriptHash(scripts[0])));
 1418|  4.97k|        if (ret.size()) out.scripts.emplace(CScriptID(scripts[0]), scripts[0]);
  ------------------
  |  Branch (1418:13): [True: 4.97k, False: 0]
  ------------------
 1419|  4.97k|        return ret;
 1420|  4.97k|    }
descriptor.cpp:_ZN12_GLOBAL__N_113WSHDescriptorC2ENSt3__110unique_ptrINS_14DescriptorImplENS1_14default_deleteIS3_EEEE:
 1472|  8.00k|    WSHDescriptor(std::unique_ptr<DescriptorImpl> desc) : DescriptorImpl({}, std::move(desc), "wsh") {}
descriptor.cpp:_ZNK12_GLOBAL__N_113WSHDescriptor12IsSingleTypeEv:
 1474|  7.22k|    bool IsSingleType() const final { return true; }
descriptor.cpp:_ZNK12_GLOBAL__N_113WSHDescriptor13GetOutputTypeEv:
 1473|  8.65k|    std::optional<OutputType> GetOutputType() const override { return OutputType::BECH32; }
descriptor.cpp:_ZNK12_GLOBAL__N_113WSHDescriptor10ScriptSizeEv:
 1476|  4.32k|    std::optional<int64_t> ScriptSize() const override { return 1 + 1 + 32; }
descriptor.cpp:_ZNK12_GLOBAL__N_113WSHDescriptor21MaxSatisfactionWeightEb:
 1487|  7.22k|    std::optional<int64_t> MaxSatisfactionWeight(bool use_max_sig) const override {
 1488|  7.22k|        return MaxSatSize(use_max_sig);
 1489|  7.22k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_113WSHDescriptor20MaxSatisfactionElemsEv:
 1491|  3.96k|    std::optional<int64_t> MaxSatisfactionElems() const override {
 1492|  3.96k|        if (const auto sub_elems = m_subdescriptor_args[0]->MaxSatisfactionElems()) return 1 + *sub_elems;
  ------------------
  |  Branch (1492:24): [True: 3.96k, False: 0]
  ------------------
 1493|      0|        return {};
 1494|  3.96k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_113WSHDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEENS1_4spanIK7CScriptLm18446744073709551615EEER19FlatSigningProvider:
 1466|  7.93k|    {
 1467|  7.93k|        auto ret = Vector(GetScriptForDestination(WitnessV0ScriptHash(scripts[0])));
 1468|  7.93k|        if (ret.size()) out.scripts.emplace(CScriptID(scripts[0]), scripts[0]);
  ------------------
  |  Branch (1468:13): [True: 7.93k, False: 0]
  ------------------
 1469|  7.93k|        return ret;
 1470|  7.93k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_113WSHDescriptor10MaxSatSizeEb:
 1478|  7.93k|    std::optional<int64_t> MaxSatSize(bool use_max_sig) const override {
 1479|  7.93k|        if (const auto sat_size = m_subdescriptor_args[0]->MaxSatSize(use_max_sig)) {
  ------------------
  |  Branch (1479:24): [True: 7.93k, False: 0]
  ------------------
 1480|  7.93k|            if (const auto subscript_size = m_subdescriptor_args[0]->ScriptSize()) {
  ------------------
  |  Branch (1480:28): [True: 7.93k, False: 0]
  ------------------
 1481|  7.93k|                return GetSizeOfCompactSize(*subscript_size) + *subscript_size + *sat_size;
 1482|  7.93k|            }
 1483|  7.93k|        }
 1484|      0|        return {};
 1485|  7.93k|    }
descriptor.cpp:_ZN12_GLOBAL__N_117AddressDescriptorC2ENSt3__17variantIJ14CNoDestination17PubKeyDestination6PKHash10ScriptHash19WitnessV0ScriptHash16WitnessV0KeyHash16WitnessV1Taproot11PayToAnchor14WitnessUnknownEEE:
 1141|     46|    AddressDescriptor(CTxDestination destination) : DescriptorImpl({}, "addr"), m_destination(std::move(destination)) {}
descriptor.cpp:_ZN12_GLOBAL__N_112TRDescriptorC2ENSt3__110unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS3_EEEENS1_6vectorINS2_INS_14DescriptorImplENS4_IS8_EEEENS1_9allocatorISA_EEEENS7_IiNSB_IiEEEE:
 1560|  50.4k|        DescriptorImpl(Vector(std::move(internal_key)), std::move(descs), "tr"), m_depths(std::move(depths))
 1561|  50.4k|    {
 1562|       |        assert(m_subdescriptor_args.size() == m_depths.size());
  ------------------
  |  Branch (1562:9): [True: 50.4k, False: 0]
  ------------------
 1563|  50.4k|    }
descriptor.cpp:_ZN12_GLOBAL__N_114DescriptorImplC2ENSt3__16vectorINS1_10unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS4_EEEENS1_9allocatorIS7_EEEENS2_INS3_IS0_NS5_IS0_EEEENS8_ISC_EEEERKNS1_12basic_stringIcNS1_11char_traitsIcEENS8_IcEEEE:
  870|  50.4k|    DescriptorImpl(std::vector<std::unique_ptr<PubkeyProvider>> pubkeys, std::vector<std::unique_ptr<DescriptorImpl>> scripts, const std::string& name) : m_pubkey_args(std::move(pubkeys)), m_name(name), m_subdescriptor_args(std::move(scripts)) {}
descriptor.cpp:_ZNK12_GLOBAL__N_112TRDescriptor12IsSingleTypeEv:
 1565|  50.2k|    bool IsSingleType() const final { return true; }
descriptor.cpp:_ZNK12_GLOBAL__N_112TRDescriptor13GetOutputTypeEv:
 1564|  50.2k|    std::optional<OutputType> GetOutputType() const override { return OutputType::BECH32M; }
descriptor.cpp:_ZNK12_GLOBAL__N_112TRDescriptor10ScriptSizeEv:
 1567|  25.1k|    std::optional<int64_t> ScriptSize() const override { return 1 + 1 + 32; }
descriptor.cpp:_ZNK12_GLOBAL__N_112TRDescriptor21MaxSatisfactionWeightEb:
 1569|  50.2k|    std::optional<int64_t> MaxSatisfactionWeight(bool) const override {
 1570|       |        // FIXME: We assume keypath spend, which can lead to very large underestimations.
 1571|  50.2k|        return 1 + 65;
 1572|  50.2k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_112TRDescriptor20MaxSatisfactionElemsEv:
 1574|  25.1k|    std::optional<int64_t> MaxSatisfactionElems() const override {
 1575|       |        // FIXME: See above, we assume keypath spend.
 1576|  25.1k|        return 1;
 1577|  25.1k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_112TRDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEENS1_4spanIK7CScriptLm18446744073709551615EEER19FlatSigningProvider:
 1508|  50.2k|    {
 1509|  50.2k|        TaprootBuilder builder;
 1510|  50.2k|        assert(m_depths.size() == scripts.size());
  ------------------
  |  Branch (1510:9): [True: 50.2k, False: 0]
  ------------------
 1511|  73.8k|        for (size_t pos = 0; pos < m_depths.size(); ++pos) {
  ------------------
  |  Branch (1511:30): [True: 23.5k, False: 50.2k]
  ------------------
 1512|  23.5k|            builder.Add(m_depths[pos], scripts[pos], TAPROOT_LEAF_TAPSCRIPT);
 1513|  23.5k|        }
 1514|  50.2k|        if (!builder.IsComplete()) return {};
  ------------------
  |  Branch (1514:13): [True: 0, False: 50.2k]
  ------------------
 1515|  50.2k|        assert(keys.size() == 1);
  ------------------
  |  Branch (1515:9): [True: 50.2k, False: 0]
  ------------------
 1516|  50.2k|        XOnlyPubKey xpk(keys[0]);
 1517|  50.2k|        if (!xpk.IsFullyValid()) return {};
  ------------------
  |  Branch (1517:13): [True: 0, False: 50.2k]
  ------------------
 1518|  50.2k|        builder.Finalize(xpk);
 1519|  50.2k|        WitnessV1Taproot output = builder.GetOutput();
 1520|  50.2k|        out.tr_trees[output] = builder;
 1521|  50.2k|        return Vector(GetScriptForDestination(output));
 1522|  50.2k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_112TRDescriptor23ToStringSubScriptHelperEPK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS_14DescriptorImpl10StringTypeEPK15DescriptorCache:
 1524|  75.3k|    {
 1525|  75.3k|        if (m_depths.empty()) {
  ------------------
  |  Branch (1525:13): [True: 49.3k, False: 26.0k]
  ------------------
 1526|       |            // If there are no sub-descriptors and a PRIVATE string
 1527|       |            // is requested, return `false` to indicate that the presence
 1528|       |            // of a private key depends solely on the internal key (which is checked
 1529|       |            // in the caller), not on any sub-descriptor. This ensures correct behavior for
 1530|       |            // descriptors like tr(internal_key) when checking for private keys.
 1531|  49.3k|            return type != StringType::PRIVATE;
 1532|  49.3k|        }
 1533|  26.0k|        std::vector<bool> path;
 1534|  26.0k|        bool is_private{type == StringType::PRIVATE};
 1535|       |        // For private string output, track if at least one key has a private key available.
 1536|       |        // Initialize to true for non-private types.
 1537|  26.0k|        bool any_success{!is_private};
 1538|       |
 1539|  61.3k|        for (size_t pos = 0; pos < m_depths.size(); ++pos) {
  ------------------
  |  Branch (1539:30): [True: 35.3k, False: 26.0k]
  ------------------
 1540|  35.3k|            if (pos) ret += ',';
  ------------------
  |  Branch (1540:17): [True: 9.35k, False: 26.0k]
  ------------------
 1541|  70.7k|            while ((int)path.size() <= m_depths[pos]) {
  ------------------
  |  Branch (1541:20): [True: 35.3k, False: 35.3k]
  ------------------
 1542|  35.3k|                if (path.size()) ret += '{';
  ------------------
  |  Branch (1542:21): [True: 9.35k, False: 26.0k]
  ------------------
 1543|  35.3k|                path.push_back(false);
 1544|  35.3k|            }
 1545|  35.3k|            std::string tmp;
 1546|  35.3k|            bool subscript_res{m_subdescriptor_args[pos]->ToStringHelper(arg, tmp, type, cache)};
 1547|  35.3k|            if (!is_private && !subscript_res) return false;
  ------------------
  |  Branch (1547:17): [True: 23.5k, False: 11.7k]
  |  Branch (1547:32): [True: 0, False: 23.5k]
  ------------------
 1548|  35.3k|            any_success = any_success || subscript_res;
  ------------------
  |  Branch (1548:27): [True: 23.5k, False: 11.7k]
  |  Branch (1548:42): [True: 7.56k, False: 4.22k]
  ------------------
 1549|  35.3k|            ret += tmp;
 1550|  44.7k|            while (!path.empty() && path.back()) {
  ------------------
  |  Branch (1550:20): [True: 44.7k, False: 0]
  |  Branch (1550:20): [True: 9.35k, False: 35.3k]
  |  Branch (1550:37): [True: 9.35k, False: 35.3k]
  ------------------
 1551|  9.35k|                if (path.size() > 1) ret += '}';
  ------------------
  |  Branch (1551:21): [True: 9.35k, False: 0]
  ------------------
 1552|  9.35k|                path.pop_back();
 1553|  9.35k|            }
 1554|  35.3k|            if (!path.empty()) path.back() = true;
  ------------------
  |  Branch (1554:17): [True: 35.3k, False: 0]
  ------------------
 1555|  35.3k|        }
 1556|  26.0k|        return any_success;
 1557|  26.0k|    }
descriptor.cpp:_ZN12_GLOBAL__N_115RawTRDescriptorC2ENSt3__110unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS3_EEEE:
 1766|    572|    RawTRDescriptor(std::unique_ptr<PubkeyProvider> output_key) : DescriptorImpl(Vector(std::move(output_key)), "rawtr") {}
descriptor.cpp:_ZNK12_GLOBAL__N_115RawTRDescriptor12IsSingleTypeEv:
 1768|    556|    bool IsSingleType() const final { return true; }
descriptor.cpp:_ZNK12_GLOBAL__N_115RawTRDescriptor13GetOutputTypeEv:
 1767|    556|    std::optional<OutputType> GetOutputType() const override { return OutputType::BECH32M; }
descriptor.cpp:_ZNK12_GLOBAL__N_115RawTRDescriptor10ScriptSizeEv:
 1770|    278|    std::optional<int64_t> ScriptSize() const override { return 1 + 1 + 32; }
descriptor.cpp:_ZNK12_GLOBAL__N_115RawTRDescriptor21MaxSatisfactionWeightEb:
 1772|    556|    std::optional<int64_t> MaxSatisfactionWeight(bool) const override {
 1773|       |        // We can't know whether there is a script path, so assume key path spend.
 1774|    556|        return 1 + 65;
 1775|    556|    }
descriptor.cpp:_ZNK12_GLOBAL__N_115RawTRDescriptor20MaxSatisfactionElemsEv:
 1777|    278|    std::optional<int64_t> MaxSatisfactionElems() const override {
 1778|       |        // See above, we assume keypath spend.
 1779|    278|        return 1;
 1780|    278|    }
descriptor.cpp:_ZNK12_GLOBAL__N_115RawTRDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEENS1_4spanIK7CScriptLm18446744073709551615EEER19FlatSigningProvider:
 1758|    556|    {
 1759|    556|        assert(keys.size() == 1);
  ------------------
  |  Branch (1759:9): [True: 556, False: 0]
  ------------------
 1760|    556|        XOnlyPubKey xpk(keys[0]);
 1761|    556|        if (!xpk.IsFullyValid()) return {};
  ------------------
  |  Branch (1761:13): [True: 0, False: 556]
  ------------------
 1762|    556|        WitnessV1Taproot output{xpk};
 1763|    556|        return Vector(GetScriptForDestination(output));
 1764|    556|    }
descriptor.cpp:_ZN12_GLOBAL__N_116UnusedDescriptorC2ENSt3__110unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS3_EEEE:
 1794|    100|    UnusedDescriptor(std::unique_ptr<PubkeyProvider> prov) : DescriptorImpl(Vector(std::move(prov)), "unused") {}
descriptor.cpp:_ZNK12_GLOBAL__N_116UnusedDescriptor12IsSingleTypeEv:
 1795|     20|    bool IsSingleType() const final { return true; }
descriptor.cpp:_ZNK12_GLOBAL__N_116UnusedDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEENS1_4spanIK7CScriptLm18446744073709551615EEER19FlatSigningProvider:
 1792|     40|    std::vector<CScript> MakeScripts(const std::vector<CPubKey>& keys, std::span<const CScript> scripts, FlatSigningProvider& out) const override { return {}; }
descriptor.cpp:_ZN12_GLOBAL__N_113RawDescriptorC2E7CScript:
 1166|    855|    RawDescriptor(CScript script) : DescriptorImpl({}, "raw"), m_script(std::move(script)) {}
descriptor.cpp:_ZNK12_GLOBAL__N_113RawDescriptor10IsSolvableEv:
 1167|    447|    bool IsSolvable() const final { return false; }
descriptor.cpp:_ZNK12_GLOBAL__N_113RawDescriptor12IsSingleTypeEv:
 1175|    894|    bool IsSingleType() const final { return true; }
descriptor.cpp:_ZNK12_GLOBAL__N_113RawDescriptor15ToPrivateStringERK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
 1176|    447|    bool ToPrivateString(const SigningProvider& arg, std::string& out) const final { return false; }
descriptor.cpp:_ZNK12_GLOBAL__N_113RawDescriptor13GetOutputTypeEv:
 1170|    447|    {
 1171|    447|        CTxDestination dest;
 1172|    447|        ExtractDestination(m_script, dest);
 1173|    447|        return OutputTypeFromDestination(dest);
 1174|    447|    }
descriptor.cpp:_ZNK12_GLOBAL__N_113RawDescriptor10ScriptSizeEv:
 1178|    447|    std::optional<int64_t> ScriptSize() const override { return m_script.size(); }
descriptor.cpp:_ZNK12_GLOBAL__N_113RawDescriptor13ToStringExtraEv:
 1163|    894|    std::string ToStringExtra() const override { return HexStr(m_script); }
descriptor.cpp:_ZNK12_GLOBAL__N_113RawDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEENS1_4spanIK7CScriptLm18446744073709551615EEER19FlatSigningProvider:
 1164|    894|    std::vector<CScript> MakeScripts(const std::vector<CPubKey>&, std::span<const CScript>, FlatSigningProvider&) const override { return Vector(m_script); }
descriptor.cpp:_ZN12_GLOBAL__N_19KeyParserC2EP19FlatSigningProviderPK15SigningProviderN10miniscript17MiniscriptContextERj:
 2248|  12.9k|        : m_out(out), m_in(in), m_script_ctx(ctx), m_expr_index(key_exp_index) {}
descriptor.cpp:_ZNK12_GLOBAL__N_19KeyParser9MsContextEv:
 2331|  4.91M|    miniscript::MiniscriptContext MsContext() const {
 2332|  4.91M|        return m_script_ctx;
 2333|  4.91M|    }
descriptor.cpp:_ZNK12_GLOBAL__N_19KeyParser10FromStringERNSt3__14spanIKcLm18446744073709551615EEE:
 2275|  22.3k|    {
 2276|  22.3k|        assert(m_out);
  ------------------
  |  Branch (2276:9): [True: 22.3k, False: 0]
  ------------------
 2277|  22.3k|        Key key = m_keys.size();
 2278|  22.3k|        auto pk = ParsePubkey(m_expr_index, in, ParseContext(), *m_out, m_key_parsing_error);
 2279|  22.3k|        if (pk.empty()) return {};
  ------------------
  |  Branch (2279:13): [True: 166, False: 22.2k]
  ------------------
 2280|  22.2k|        m_keys.emplace_back(std::move(pk));
 2281|  22.2k|        return key;
 2282|  22.3k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_19KeyParser12ParseContextEv:
 2266|  29.6k|    ParseScriptContext ParseContext() const {
 2267|  29.6k|        switch (m_script_ctx) {
  ------------------
  |  Branch (2267:17): [True: 29.6k, False: 0]
  ------------------
 2268|  7.00k|            case miniscript::MiniscriptContext::P2WSH: return ParseScriptContext::P2WSH;
  ------------------
  |  Branch (2268:13): [True: 7.00k, False: 22.6k]
  ------------------
 2269|  22.6k|            case miniscript::MiniscriptContext::TAPSCRIPT: return ParseScriptContext::P2TR;
  ------------------
  |  Branch (2269:13): [True: 22.6k, False: 7.00k]
  ------------------
 2270|  29.6k|        }
 2271|  29.6k|        assert(false);
  ------------------
  |  Branch (2271:9): [Folded, False: 0]
  ------------------
 2272|      0|    }
descriptor.cpp:_ZNK12_GLOBAL__N_19KeyParser10KeyCompareERKjS2_:
 2250|  64.4k|    bool KeyCompare(const Key& a, const Key& b) const {
 2251|       |        // Deriving a hardened step needs the private key, so use the provider that was filled
 2252|       |        // while parsing, or the one we are inferring from, rather than an empty one.
 2253|  64.4k|        const SigningProvider& provider{m_out ? *m_out : (m_in ? *m_in : DUMMY_SIGNING_PROVIDER)};
  ------------------
  |  Branch (2253:41): [True: 55.7k, False: 8.72k]
  |  Branch (2253:59): [True: 8.72k, False: 0]
  ------------------
 2254|  64.4k|        const PubkeyProvider& key_a{*m_keys.at(a).at(0)};
 2255|  64.4k|        const PubkeyProvider& key_b{*m_keys.at(b).at(0)};
 2256|  64.4k|        FlatSigningProvider out_a, out_b;
 2257|  64.4k|        const std::optional<CPubKey> pub_a{key_a.GetPubKey(0, provider, out_a)};
 2258|  64.4k|        const std::optional<CPubKey> pub_b{key_b.GetPubKey(0, provider, out_b)};
 2259|  64.4k|        if (pub_a && pub_b) return *pub_a < *pub_b;
  ------------------
  |  Branch (2259:13): [True: 64.4k, False: 0]
  |  Branch (2259:22): [True: 64.4k, False: 0]
  ------------------
 2260|       |        // Keys that cannot be derived sort before the ones that can, and are compared by their
 2261|       |        // expression so that two different keys are not taken for duplicates.
 2262|      0|        if (pub_a.has_value() != pub_b.has_value()) return !pub_a.has_value();
  ------------------
  |  Branch (2262:13): [True: 0, False: 0]
  ------------------
 2263|      0|        return key_a.ToString() < key_b.ToString();
 2264|      0|    }
descriptor.cpp:_ZNK12_GLOBAL__N_19KeyParser8ToStringERKjRb:
 2285|  1.92k|    {
 2286|  1.92k|        return m_keys.at(key).at(0)->ToString();
 2287|  1.92k|    }
descriptor.cpp:_ZZN12_GLOBAL__N_111ParseScriptERjRNSt3__14spanIKcLm18446744073709551615EEENS_18ParseScriptContextER19FlatSigningProviderRNS1_12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEENK3$_0clERKNS1_6vectorINS1_10unique_ptrINS_14PubkeyProviderENS1_14default_deleteISJ_EEEENSC_ISM_EEEESQ_:
 2722|  1.03k|                    [](const std::vector<std::unique_ptr<PubkeyProvider>>& a, const std::vector<std::unique_ptr<PubkeyProvider>>& b) {
 2723|  1.03k|                        return a.size() < b.size();
 2724|  1.03k|                    })->size();
descriptor.cpp:_ZN12_GLOBAL__N_120MiniscriptDescriptorC2ENSt3__16vectorINS1_10unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS4_EEEENS1_9allocatorIS7_EEEEON10miniscript4NodeIjEE:
 1693|  11.1k|        : DescriptorImpl(std::move(providers), "?"), m_node(std::move(node))
 1694|  11.1k|    {
 1695|       |        // Traverse miniscript tree for unsafe use of older()
 1696|  11.1k|        miniscript::ForEachNode(m_node, [&](const miniscript::Node<uint32_t>& node) {
 1697|  11.1k|            if (node.Fragment() == miniscript::Fragment::OLDER) {
 1698|  11.1k|                const uint32_t raw = node.K();
 1699|  11.1k|                const uint32_t value_part = raw & ~CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG;
 1700|  11.1k|                if (value_part > CTxIn::SEQUENCE_LOCKTIME_MASK) {
 1701|  11.1k|                    const bool is_time_based = (raw & CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG) != 0;
 1702|  11.1k|                    if (is_time_based) {
 1703|  11.1k|                        m_warnings.push_back(strprintf("time-based relative locktime: older(%u) > (65535 * 512) seconds is unsafe", raw));
 1704|  11.1k|                    } else {
 1705|  11.1k|                        m_warnings.push_back(strprintf("height-based relative locktime: older(%u) > 65535 blocks is unsafe", raw));
 1706|  11.1k|                    }
 1707|  11.1k|                }
 1708|  11.1k|            }
 1709|  11.1k|        });
 1710|  11.1k|    }
descriptor.cpp:_ZZN12_GLOBAL__N_120MiniscriptDescriptorC1ENSt3__16vectorINS1_10unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS4_EEEENS1_9allocatorIS7_EEEEON10miniscript4NodeIjEEENKUlRKSD_E_clESG_:
 1696|   250k|        miniscript::ForEachNode(m_node, [&](const miniscript::Node<uint32_t>& node) {
 1697|   250k|            if (node.Fragment() == miniscript::Fragment::OLDER) {
  ------------------
  |  Branch (1697:17): [True: 411, False: 250k]
  ------------------
 1698|    411|                const uint32_t raw = node.K();
 1699|    411|                const uint32_t value_part = raw & ~CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG;
 1700|    411|                if (value_part > CTxIn::SEQUENCE_LOCKTIME_MASK) {
  ------------------
  |  Branch (1700:21): [True: 197, False: 214]
  ------------------
 1701|    197|                    const bool is_time_based = (raw & CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG) != 0;
 1702|    197|                    if (is_time_based) {
  ------------------
  |  Branch (1702:25): [True: 92, False: 105]
  ------------------
 1703|     92|                        m_warnings.push_back(strprintf("time-based relative locktime: older(%u) > (65535 * 512) seconds is unsafe", raw));
  ------------------
  |  | 1172|     92|#define strprintf tfm::format
  ------------------
 1704|    105|                    } else {
 1705|    105|                        m_warnings.push_back(strprintf("height-based relative locktime: older(%u) > 65535 blocks is unsafe", raw));
  ------------------
  |  | 1172|    105|#define strprintf tfm::format
  ------------------
 1706|    105|                    }
 1707|    197|                }
 1708|    411|            }
 1709|   250k|        });
descriptor.cpp:_ZNK12_GLOBAL__N_120MiniscriptDescriptor10IsSolvableEv:
 1726|  4.69k|    bool IsSolvable() const override { return true; }
descriptor.cpp:_ZNK12_GLOBAL__N_120MiniscriptDescriptor10ScriptSizeEv:
 1729|  4.77k|    std::optional<int64_t> ScriptSize() const override { return m_node.ScriptSize(); }
descriptor.cpp:_ZNK12_GLOBAL__N_120MiniscriptDescriptor20MaxSatisfactionElemsEv:
 1738|  2.38k|    {
 1739|  2.38k|        return m_node.GetStackSize();
 1740|  2.38k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_120MiniscriptDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEENS1_4spanIK7CScriptLm18446744073709551615EEER19FlatSigningProvider:
 1679|  9.39k|    {
 1680|  9.39k|        const auto script_ctx{m_node.GetMsCtx()};
 1681|  14.5k|        for (const auto& key : keys) {
  ------------------
  |  Branch (1681:30): [True: 14.5k, False: 9.39k]
  ------------------
 1682|  14.5k|            if (miniscript::IsTapscript(script_ctx)) {
  ------------------
  |  Branch (1682:17): [True: 8.56k, False: 5.97k]
  ------------------
 1683|  8.56k|                provider.pubkeys.emplace(Hash160(XOnlyPubKey{key}), key);
 1684|  8.56k|            } else {
 1685|  5.97k|                provider.pubkeys.emplace(key.GetID(), key);
 1686|  5.97k|            }
 1687|  14.5k|        }
 1688|  9.39k|        return Vector(m_node.ToScript(ScriptMaker(keys, script_ctx)));
 1689|  9.39k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_111ScriptMaker9ToPKBytesEj:
 1615|  12.7k|    std::vector<unsigned char> ToPKBytes(uint32_t key) const {
 1616|       |        // In Tapscript keys always serialize as x-only, whether an x-only key was used in the descriptor or not.
 1617|  12.7k|        if (!miniscript::IsTapscript(m_script_ctx)) {
  ------------------
  |  Branch (1617:13): [True: 5.47k, False: 7.32k]
  ------------------
 1618|  5.47k|            return {m_keys[key].begin(), m_keys[key].end()};
 1619|  5.47k|        }
 1620|  7.32k|        const XOnlyPubKey xonly_pubkey{m_keys[key]};
 1621|  7.32k|        return {xonly_pubkey.begin(), xonly_pubkey.end()};
 1622|  12.7k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_111ScriptMaker10ToPKHBytesEj:
 1624|  1.73k|    std::vector<unsigned char> ToPKHBytes(uint32_t key) const {
 1625|  1.73k|        auto id = GetHash160(key);
 1626|  1.73k|        return {id.begin(), id.end()};
 1627|  1.73k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_111ScriptMaker10GetHash160Ej:
 1605|  1.73k|    uint160 GetHash160(uint32_t key) const {
 1606|  1.73k|        if (miniscript::IsTapscript(m_script_ctx)) {
  ------------------
  |  Branch (1606:13): [True: 1.24k, False: 492]
  ------------------
 1607|  1.24k|            return Hash160(XOnlyPubKey{m_keys[key]});
 1608|  1.24k|        }
 1609|    492|        return m_keys[key].GetID();
 1610|  1.73k|    }
descriptor.cpp:_ZN12_GLOBAL__N_111ScriptMakerC2ERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEEN10miniscript17MiniscriptContextE:
 1613|  9.39k|    ScriptMaker(const std::vector<CPubKey>& keys LIFETIMEBOUND, const miniscript::MiniscriptContext script_ctx) : m_keys(keys), m_script_ctx{script_ctx} {}
descriptor.cpp:_ZNK12_GLOBAL__N_120MiniscriptDescriptor14ToStringHelperEPK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS_14DescriptorImpl10StringTypeEPK15DescriptorCache:
 1714|  14.0k|    {
 1715|  14.0k|        bool has_priv_key{false};
 1716|  14.0k|        auto res = m_node.ToString(StringMaker(arg, m_pubkey_args, type, cache), has_priv_key);
 1717|  14.0k|        if (res) out = *res;
  ------------------
  |  Branch (1717:13): [True: 14.0k, False: 0]
  ------------------
 1718|  14.0k|        if (type == StringType::PRIVATE) {
  ------------------
  |  Branch (1718:13): [True: 4.69k, False: 9.39k]
  ------------------
 1719|  4.69k|            Assume(res.has_value());
  ------------------
  |  |  128|  4.69k|#define Assume(val) inline_assertion_check<false>(val, std::source_location::current(), #val)
  ------------------
 1720|  4.69k|            return has_priv_key;
 1721|  9.39k|        } else {
 1722|  9.39k|            return res.has_value();
 1723|  9.39k|        }
 1724|  14.0k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_111StringMaker8ToStringEjRb:
 1650|  28.2k|    {
 1651|  28.2k|        std::string ret;
 1652|  28.2k|        has_priv_key = false;
 1653|  28.2k|        switch (m_type) {
  ------------------
  |  Branch (1653:17): [True: 28.2k, False: 0]
  ------------------
 1654|  9.43k|        case DescriptorImpl::StringType::PUBLIC:
  ------------------
  |  Branch (1654:9): [True: 9.43k, False: 18.8k]
  ------------------
 1655|  9.43k|            ret = m_pubkeys[key]->ToString();
 1656|  9.43k|            break;
 1657|  9.43k|        case DescriptorImpl::StringType::PRIVATE:
  ------------------
  |  Branch (1657:9): [True: 9.43k, False: 18.8k]
  ------------------
 1658|  9.43k|            has_priv_key = m_pubkeys[key]->ToPrivateString(*m_arg, ret);
 1659|  9.43k|            break;
 1660|  9.43k|        case DescriptorImpl::StringType::NORMALIZED:
  ------------------
  |  Branch (1660:9): [True: 9.43k, False: 18.8k]
  ------------------
 1661|  9.43k|            if (!m_pubkeys[key]->ToNormalizedString(*m_arg, ret, m_cache)) return {};
  ------------------
  |  Branch (1661:17): [True: 0, False: 9.43k]
  ------------------
 1662|  9.43k|            break;
 1663|  9.43k|        case DescriptorImpl::StringType::COMPAT:
  ------------------
  |  Branch (1663:9): [True: 0, False: 28.2k]
  ------------------
 1664|      0|            ret = m_pubkeys[key]->ToString(PubkeyProvider::StringType::COMPAT);
 1665|      0|            break;
 1666|  28.2k|        }
 1667|  28.2k|        return ret;
 1668|  28.2k|    }
descriptor.cpp:_ZN12_GLOBAL__N_111StringMakerC2EPK15SigningProviderRKNSt3__16vectorINS4_10unique_ptrINS_14PubkeyProviderENS4_14default_deleteIS7_EEEENS4_9allocatorISA_EEEENS_14DescriptorImpl10StringTypeEPK15DescriptorCache:
 1647|  14.0k|        : m_arg(arg), m_pubkeys(pubkeys), m_type(type), m_cache(cache) {}
descriptor.cpp:_ZNK12_GLOBAL__N_120MiniscriptDescriptor10MaxSatSizeEb:
 1732|  4.77k|    {
 1733|       |        // For Miniscript we always assume high-R ECDSA signatures.
 1734|  4.77k|        return m_node.GetWitnessSize();
 1735|  4.77k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_120MiniscriptDescriptor5CloneEv:
 1743|    514|    {
 1744|    514|        std::vector<std::unique_ptr<PubkeyProvider>> providers;
 1745|    514|        providers.reserve(m_pubkey_args.size());
 1746|    517|        for (const auto& arg : m_pubkey_args) {
  ------------------
  |  Branch (1746:30): [True: 517, False: 514]
  ------------------
 1747|    517|            providers.push_back(arg->Clone());
 1748|    517|        }
 1749|    514|        return std::make_unique<MiniscriptDescriptor>(std::move(providers), m_node.Clone());
 1750|    514|    }
descriptor.cpp:_ZN12_GLOBAL__N_111InferScriptERK7CScriptNS_18ParseScriptContextERK15SigningProvider:
 2778|  51.7k|{
 2779|  51.7k|    if (ctx == ParseScriptContext::P2TR && script.size() == 34 && script[0] == 32 && script[33] == OP_CHECKSIG) {
  ------------------
  |  Branch (2779:9): [True: 11.7k, False: 39.9k]
  |  Branch (2779:44): [True: 1.23k, False: 10.5k]
  |  Branch (2779:67): [True: 1.21k, False: 20]
  |  Branch (2779:86): [True: 1.21k, False: 0]
  ------------------
 2780|  1.21k|        XOnlyPubKey key{std::span{script}.subspan(1, 32)};
 2781|  1.21k|        return std::make_unique<PKDescriptor>(InferXOnlyPubkey(key, ctx, provider), true);
 2782|  1.21k|    }
 2783|       |
 2784|  50.5k|    if (ctx == ParseScriptContext::P2TR) {
  ------------------
  |  Branch (2784:9): [True: 10.5k, False: 39.9k]
  ------------------
 2785|  10.5k|        auto ret = InferMultiA(script, ctx, provider);
 2786|  10.5k|        if (ret) return ret;
  ------------------
  |  Branch (2786:13): [True: 8.24k, False: 2.30k]
  ------------------
 2787|  10.5k|    }
 2788|       |
 2789|  42.2k|    std::vector<std::vector<unsigned char>> data;
 2790|  42.2k|    TxoutType txntype = Solver(script, data);
 2791|       |
 2792|  42.2k|    if (txntype == TxoutType::PUBKEY && (ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH || ctx == ParseScriptContext::P2WSH)) {
  ------------------
  |  Branch (2792:9): [True: 1.83k, False: 40.4k]
  |  Branch (2792:42): [True: 253, False: 1.58k]
  |  Branch (2792:76): [True: 455, False: 1.12k]
  |  Branch (2792:111): [True: 1.12k, False: 0]
  ------------------
 2793|  1.83k|        CPubKey pubkey(data[0]);
 2794|  1.83k|        if (auto pubkey_provider = InferPubkey(pubkey, ctx, provider)) {
  ------------------
  |  Branch (2794:18): [True: 1.83k, False: 2]
  ------------------
 2795|  1.83k|            return std::make_unique<PKDescriptor>(std::move(pubkey_provider));
 2796|  1.83k|        }
 2797|  1.83k|    }
 2798|  40.4k|    if (txntype == TxoutType::PUBKEYHASH && (ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH || ctx == ParseScriptContext::P2WSH)) {
  ------------------
  |  Branch (2798:9): [True: 1.00k, False: 39.4k]
  |  Branch (2798:46): [True: 83, False: 924]
  |  Branch (2798:80): [True: 210, False: 714]
  |  Branch (2798:115): [True: 190, False: 524]
  ------------------
 2799|    483|        uint160 hash(data[0]);
 2800|    483|        CKeyID keyid(hash);
 2801|    483|        CPubKey pubkey;
 2802|    483|        if (provider.GetPubKey(keyid, pubkey)) {
  ------------------
  |  Branch (2802:13): [True: 482, False: 1]
  ------------------
 2803|    482|            if (auto pubkey_provider = InferPubkey(pubkey, ctx, provider)) {
  ------------------
  |  Branch (2803:22): [True: 482, False: 0]
  ------------------
 2804|    482|                return std::make_unique<PKHDescriptor>(std::move(pubkey_provider));
 2805|    482|            }
 2806|    482|        }
 2807|    483|    }
 2808|  39.9k|    if (txntype == TxoutType::WITNESS_V0_KEYHASH && (ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH)) {
  ------------------
  |  Branch (2808:9): [True: 683, False: 39.2k]
  |  Branch (2808:54): [True: 41, False: 642]
  |  Branch (2808:88): [True: 642, False: 0]
  ------------------
 2809|    683|        uint160 hash(data[0]);
 2810|    683|        CKeyID keyid(hash);
 2811|    683|        CPubKey pubkey;
 2812|    683|        if (provider.GetPubKey(keyid, pubkey)) {
  ------------------
  |  Branch (2812:13): [True: 682, False: 1]
  ------------------
 2813|    682|            if (auto pubkey_provider = InferPubkey(pubkey, ParseScriptContext::P2WPKH, provider)) {
  ------------------
  |  Branch (2813:22): [True: 682, False: 0]
  ------------------
 2814|    682|                return std::make_unique<WPKHDescriptor>(std::move(pubkey_provider));
 2815|    682|            }
 2816|    682|        }
 2817|    683|    }
 2818|  39.2k|    if (txntype == TxoutType::MULTISIG && (ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH || ctx == ParseScriptContext::P2WSH)) {
  ------------------
  |  Branch (2818:9): [True: 1.78k, False: 37.5k]
  |  Branch (2818:44): [True: 179, False: 1.60k]
  |  Branch (2818:78): [True: 1.33k, False: 265]
  |  Branch (2818:113): [True: 265, False: 0]
  ------------------
 2819|  1.78k|        bool ok = true;
 2820|  1.78k|        std::vector<std::unique_ptr<PubkeyProvider>> providers;
 2821|  8.77k|        for (size_t i = 1; i + 1 < data.size(); ++i) {
  ------------------
  |  Branch (2821:28): [True: 6.98k, False: 1.78k]
  ------------------
 2822|  6.98k|            CPubKey pubkey(data[i]);
 2823|  6.98k|            if (auto pubkey_provider = InferPubkey(pubkey, ctx, provider)) {
  ------------------
  |  Branch (2823:22): [True: 6.98k, False: 0]
  ------------------
 2824|  6.98k|                providers.push_back(std::move(pubkey_provider));
 2825|  6.98k|            } else {
 2826|      0|                ok = false;
 2827|      0|                break;
 2828|      0|            }
 2829|  6.98k|        }
 2830|  1.78k|        if (ok) return std::make_unique<MultisigDescriptor>((int)data[0][0], std::move(providers));
  ------------------
  |  Branch (2830:13): [True: 1.78k, False: 0]
  ------------------
 2831|  1.78k|    }
 2832|  37.5k|    if (txntype == TxoutType::SCRIPTHASH && ctx == ParseScriptContext::TOP) {
  ------------------
  |  Branch (2832:9): [True: 3.00k, False: 34.5k]
  |  Branch (2832:45): [True: 3.00k, False: 0]
  ------------------
 2833|  3.00k|        uint160 hash(data[0]);
 2834|  3.00k|        CScriptID scriptid(hash);
 2835|  3.00k|        CScript subscript;
 2836|  3.00k|        if (provider.GetCScript(scriptid, subscript)) {
  ------------------
  |  Branch (2836:13): [True: 3.00k, False: 1]
  ------------------
 2837|  3.00k|            auto sub = InferScript(subscript, ParseScriptContext::P2SH, provider);
 2838|  3.00k|            if (sub) return std::make_unique<SHDescriptor>(std::move(sub));
  ------------------
  |  Branch (2838:17): [True: 2.99k, False: 10]
  ------------------
 2839|  3.00k|        }
 2840|  3.00k|    }
 2841|  34.5k|    if (txntype == TxoutType::WITNESS_V0_SCRIPTHASH && (ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH)) {
  ------------------
  |  Branch (2841:9): [True: 3.97k, False: 30.5k]
  |  Branch (2841:57): [True: 3.61k, False: 357]
  |  Branch (2841:91): [True: 357, False: 0]
  ------------------
 2842|  3.97k|        CScriptID scriptid{RIPEMD160(data[0])};
 2843|  3.97k|        CScript subscript;
 2844|  3.97k|        if (provider.GetCScript(scriptid, subscript)) {
  ------------------
  |  Branch (2844:13): [True: 3.96k, False: 1]
  ------------------
 2845|  3.96k|            auto sub = InferScript(subscript, ParseScriptContext::P2WSH, provider);
 2846|  3.96k|            if (sub) return std::make_unique<WSHDescriptor>(std::move(sub));
  ------------------
  |  Branch (2846:17): [True: 3.95k, False: 10]
  ------------------
 2847|  3.96k|        }
 2848|  3.97k|    }
 2849|  30.5k|    if (txntype == TxoutType::WITNESS_V1_TAPROOT && ctx == ParseScriptContext::TOP) {
  ------------------
  |  Branch (2849:9): [True: 25.4k, False: 5.15k]
  |  Branch (2849:53): [True: 25.4k, False: 0]
  ------------------
 2850|       |        // Extract x-only pubkey from output.
 2851|  25.4k|        XOnlyPubKey pubkey;
 2852|  25.4k|        std::copy(data[0].begin(), data[0].end(), pubkey.begin());
 2853|       |        // Request spending data.
 2854|  25.4k|        TaprootSpendData tap;
 2855|  25.4k|        if (provider.GetTaprootSpendData(pubkey, tap)) {
  ------------------
  |  Branch (2855:13): [True: 25.1k, False: 281]
  ------------------
 2856|       |            // If found, convert it back to tree form.
 2857|  25.1k|            auto tree = InferTaprootTree(tap, pubkey);
 2858|  25.1k|            if (tree) {
  ------------------
  |  Branch (2858:17): [True: 25.1k, False: 4]
  ------------------
 2859|       |                // If that works, try to infer subdescriptors for all leaves.
 2860|  25.1k|                bool ok = true;
 2861|  25.1k|                std::vector<std::unique_ptr<DescriptorImpl>> subscripts; //!< list of script subexpressions
 2862|  25.1k|                std::vector<int> depths; //!< depth in the tree of each subexpression (same length subscripts)
 2863|  25.1k|                for (const auto& [depth, script, leaf_ver] : *tree) {
  ------------------
  |  Branch (2863:60): [True: 11.7k, False: 25.1k]
  ------------------
 2864|  11.7k|                    std::unique_ptr<DescriptorImpl> subdesc;
 2865|  11.7k|                    if (leaf_ver == TAPROOT_LEAF_TAPSCRIPT) {
  ------------------
  |  Branch (2865:25): [True: 11.7k, False: 0]
  ------------------
 2866|  11.7k|                        subdesc = InferScript(CScript(script.begin(), script.end()), ParseScriptContext::P2TR, provider);
 2867|  11.7k|                    }
 2868|  11.7k|                    if (!subdesc) {
  ------------------
  |  Branch (2868:25): [True: 4, False: 11.7k]
  ------------------
 2869|      4|                        ok = false;
 2870|      4|                        break;
 2871|  11.7k|                    } else {
 2872|  11.7k|                        subscripts.push_back(std::move(subdesc));
 2873|  11.7k|                        depths.push_back(depth);
 2874|  11.7k|                    }
 2875|  11.7k|                }
 2876|  25.1k|                if (ok) {
  ------------------
  |  Branch (2876:21): [True: 25.1k, False: 4]
  ------------------
 2877|  25.1k|                    auto key = InferXOnlyPubkey(tap.internal_key, ParseScriptContext::P2TR, provider);
 2878|  25.1k|                    return std::make_unique<TRDescriptor>(std::move(key), std::move(subscripts), std::move(depths));
 2879|  25.1k|                }
 2880|  25.1k|            }
 2881|  25.1k|        }
 2882|       |        // If the above doesn't work, construct a rawtr() descriptor with just the encoded x-only pubkey.
 2883|    289|        if (pubkey.IsFullyValid()) {
  ------------------
  |  Branch (2883:13): [True: 287, False: 2]
  ------------------
 2884|    287|            auto key = InferXOnlyPubkey(pubkey, ParseScriptContext::P2TR, provider);
 2885|    287|            if (key) {
  ------------------
  |  Branch (2885:17): [True: 287, False: 0]
  ------------------
 2886|    287|                return std::make_unique<RawTRDescriptor>(std::move(key));
 2887|    287|            }
 2888|    287|        }
 2889|    289|    }
 2890|       |
 2891|  5.15k|    if (ctx == ParseScriptContext::P2WSH || ctx == ParseScriptContext::P2TR) {
  ------------------
  |  Branch (2891:9): [True: 2.38k, False: 2.76k]
  |  Branch (2891:45): [True: 2.30k, False: 461]
  ------------------
 2892|  4.69k|        const auto script_ctx{ctx == ParseScriptContext::P2WSH ? miniscript::MiniscriptContext::P2WSH : miniscript::MiniscriptContext::TAPSCRIPT};
  ------------------
  |  Branch (2892:31): [True: 2.38k, False: 2.30k]
  ------------------
 2893|  4.69k|        uint32_t key_exp_index = 0;
 2894|  4.69k|        KeyParser parser(/* out = */nullptr, /* in = */&provider, /* ctx = */script_ctx, key_exp_index);
 2895|  4.69k|        auto node = miniscript::FromScript(script, parser);
 2896|  4.69k|        if (node && node->IsSane()) {
  ------------------
  |  Branch (2896:13): [True: 4.69k, False: 0]
  |  Branch (2896:21): [True: 4.68k, False: 14]
  ------------------
 2897|  4.68k|            std::vector<std::unique_ptr<PubkeyProvider>> keys;
 2898|  4.68k|            keys.reserve(parser.m_keys.size());
 2899|  7.20k|            for (auto& key : parser.m_keys) {
  ------------------
  |  Branch (2899:28): [True: 7.20k, False: 4.68k]
  ------------------
 2900|  7.20k|                keys.emplace_back(std::move(key.at(0)));
 2901|  7.20k|            }
 2902|  4.68k|            return std::make_unique<MiniscriptDescriptor>(std::move(keys), std::move(*node));
 2903|  4.68k|        }
 2904|  4.69k|    }
 2905|       |
 2906|       |    // The following descriptors are all top-level only descriptors.
 2907|       |    // So if we are not at the top level, return early.
 2908|    475|    if (ctx != ParseScriptContext::TOP) return nullptr;
  ------------------
  |  Branch (2908:9): [True: 24, False: 451]
  ------------------
 2909|       |
 2910|    451|    CTxDestination dest;
 2911|    451|    if (ExtractDestination(script, dest)) {
  ------------------
  |  Branch (2911:9): [True: 46, False: 405]
  ------------------
 2912|     46|        if (GetScriptForDestination(dest) == script) {
  ------------------
  |  Branch (2912:13): [True: 46, False: 0]
  ------------------
 2913|     46|            return std::make_unique<AddressDescriptor>(std::move(dest));
 2914|     46|        }
 2915|     46|    }
 2916|       |
 2917|    405|    return std::make_unique<RawDescriptor>(script);
 2918|    451|}
descriptor.cpp:_ZN12_GLOBAL__N_116InferXOnlyPubkeyERK11XOnlyPubKeyNS_18ParseScriptContextERK15SigningProvider:
 2217|   157k|{
 2218|   157k|    CPubKey pubkey{xkey.GetEvenCorrespondingCPubKey()};
 2219|   157k|    std::unique_ptr<PubkeyProvider> key_provider = std::make_unique<ConstPubkeyProvider>(0, pubkey, true);
 2220|   157k|    KeyOriginInfo info;
 2221|   157k|    if (provider.GetKeyOriginByXOnly(xkey, info)) {
  ------------------
  |  Branch (2221:9): [True: 157k, False: 9]
  ------------------
 2222|   157k|        return std::make_unique<OriginPubkeyProvider>(0, std::move(info), std::move(key_provider), /*apostrophe=*/false);
 2223|   157k|    }
 2224|      9|    return key_provider;
 2225|   157k|}
descriptor.cpp:_ZN12_GLOBAL__N_111InferMultiAERK7CScriptNS_18ParseScriptContextERK15SigningProvider:
 2762|  10.5k|{
 2763|  10.5k|    auto match = MatchMultiA(script);
 2764|  10.5k|    if (!match) return {};
  ------------------
  |  Branch (2764:9): [True: 2.30k, False: 8.24k]
  ------------------
 2765|  8.24k|    std::vector<std::unique_ptr<PubkeyProvider>> keys;
 2766|  8.24k|    keys.reserve(match->second.size());
 2767|   126k|    for (const auto keyspan : match->second) {
  ------------------
  |  Branch (2767:29): [True: 126k, False: 8.24k]
  ------------------
 2768|   126k|        if (keyspan.size() != 32) return {};
  ------------------
  |  Branch (2768:13): [True: 0, False: 126k]
  ------------------
 2769|   126k|        auto key = InferXOnlyPubkey(XOnlyPubKey{keyspan}, ctx, provider);
 2770|   126k|        if (!key) return {};
  ------------------
  |  Branch (2770:13): [True: 0, False: 126k]
  ------------------
 2771|   126k|        keys.push_back(std::move(key));
 2772|   126k|    }
 2773|  8.24k|    return std::make_unique<MultiADescriptor>(match->first, std::move(keys));
 2774|  8.24k|}
descriptor.cpp:_ZN12_GLOBAL__N_111InferPubkeyERK7CPubKeyNS_18ParseScriptContextERK15SigningProvider:
 2199|  13.5k|{
 2200|       |    // Key cannot be hybrid
 2201|  13.5k|    if (!pubkey.IsValidNonHybrid()) {
  ------------------
  |  Branch (2201:9): [True: 2, False: 13.5k]
  ------------------
 2202|      2|        return nullptr;
 2203|      2|    }
 2204|       |    // Uncompressed is only allowed in TOP and P2SH contexts
 2205|  13.5k|    if (ctx != ParseScriptContext::TOP && ctx != ParseScriptContext::P2SH && !pubkey.IsCompressed()) {
  ------------------
  |  Branch (2205:9): [True: 13.0k, False: 565]
  |  Branch (2205:43): [True: 6.22k, False: 6.80k]
  |  Branch (2205:78): [True: 0, False: 6.22k]
  ------------------
 2206|      0|        return nullptr;
 2207|      0|    }
 2208|  13.5k|    std::unique_ptr<PubkeyProvider> key_provider = std::make_unique<ConstPubkeyProvider>(0, pubkey, false);
 2209|  13.5k|    KeyOriginInfo info;
 2210|  13.5k|    if (provider.GetKeyOrigin(pubkey.GetID(), info)) {
  ------------------
  |  Branch (2210:9): [True: 13.5k, False: 5]
  ------------------
 2211|  13.5k|        return std::make_unique<OriginPubkeyProvider>(0, std::move(info), std::move(key_provider), /*apostrophe=*/false);
 2212|  13.5k|    }
 2213|      5|    return key_provider;
 2214|  13.5k|}
descriptor.cpp:_ZNK12_GLOBAL__N_19KeyParser11FromPKBytesINSt3__111__wrap_iterIPhEEEENS2_8optionalIjEET_S8_:
 2290|  6.39k|    {
 2291|  6.39k|        assert(m_in);
  ------------------
  |  Branch (2291:9): [True: 6.39k, False: 0]
  ------------------
 2292|  6.39k|        Key key = m_keys.size();
 2293|  6.39k|        if (miniscript::IsTapscript(m_script_ctx) && end - begin == 32) {
  ------------------
  |  Branch (2293:13): [True: 3.65k, False: 2.73k]
  |  Branch (2293:54): [True: 3.65k, False: 0]
  ------------------
 2294|  3.65k|            XOnlyPubKey pubkey;
 2295|  3.65k|            std::copy(begin, end, pubkey.begin());
 2296|  3.65k|            if (auto pubkey_provider = InferXOnlyPubkey(pubkey, ParseContext(), *m_in)) {
  ------------------
  |  Branch (2296:22): [True: 3.65k, False: 0]
  ------------------
 2297|  3.65k|                m_keys.emplace_back();
 2298|  3.65k|                m_keys.back().push_back(std::move(pubkey_provider));
 2299|  3.65k|                return key;
 2300|  3.65k|            }
 2301|  3.65k|        } else if (!miniscript::IsTapscript(m_script_ctx)) {
  ------------------
  |  Branch (2301:20): [True: 2.73k, False: 0]
  ------------------
 2302|  2.73k|            CPubKey pubkey(begin, end);
 2303|  2.73k|            if (auto pubkey_provider = InferPubkey(pubkey, ParseContext(), *m_in)) {
  ------------------
  |  Branch (2303:22): [True: 2.73k, False: 0]
  ------------------
 2304|  2.73k|                m_keys.emplace_back();
 2305|  2.73k|                m_keys.back().push_back(std::move(pubkey_provider));
 2306|  2.73k|                return key;
 2307|  2.73k|            }
 2308|  2.73k|        }
 2309|      0|        return {};
 2310|  6.39k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_19KeyParser12FromPKHBytesINSt3__111__wrap_iterIPhEEEENS2_8optionalIjEET_S8_:
 2313|    869|    {
 2314|    869|        assert(end - begin == 20);
  ------------------
  |  Branch (2314:9): [True: 869, False: 0]
  ------------------
 2315|    869|        assert(m_in);
  ------------------
  |  Branch (2315:9): [True: 869, False: 0]
  ------------------
 2316|    869|        uint160 hash;
 2317|    869|        std::copy(begin, end, hash.begin());
 2318|    869|        CKeyID keyid(hash);
 2319|    869|        CPubKey pubkey;
 2320|    869|        if (m_in->GetPubKey(keyid, pubkey)) {
  ------------------
  |  Branch (2320:13): [True: 869, False: 0]
  ------------------
 2321|    869|            if (auto pubkey_provider = InferPubkey(pubkey, ParseContext(), *m_in)) {
  ------------------
  |  Branch (2321:22): [True: 869, False: 0]
  ------------------
 2322|    869|                Key key = m_keys.size();
 2323|    869|                m_keys.emplace_back();
 2324|    869|                m_keys.back().push_back(std::move(pubkey_provider));
 2325|    869|                return key;
 2326|    869|            }
 2327|    869|        }
 2328|      0|        return {};
 2329|    869|    }

_ZN10DescriptorD2Ev:
  109|   106k|    virtual ~Descriptor() = default;

_Z18ComputeTapleafHashhNSt3__14spanIKhLm18446744073709551615EEE:
 1883|  35.3k|{
 1884|  35.3k|    return (HashWriter{HASHER_TAPLEAF} << leaf_version << CompactSizeWriter(script.size()) << script).GetSHA256();
 1885|  35.3k|}
_Z20ComputeTapbranchHashNSt3__14spanIKhLm18446744073709551615EEES2_:
 1888|  39.2k|{
 1889|  39.2k|    HashWriter ss_branch{HASHER_TAPBRANCH};
 1890|  39.2k|    if (std::lexicographical_compare(a.begin(), a.end(), b.begin(), b.end())) {
  ------------------
  |  Branch (1890:9): [True: 15.6k, False: 23.5k]
  ------------------
 1891|  15.6k|        ss_branch << a << b;
 1892|  23.5k|    } else {
 1893|  23.5k|        ss_branch << b << a;
 1894|  23.5k|    }
 1895|  39.2k|    return ss_branch.GetSHA256();
 1896|  39.2k|}
_Z24ComputeTaprootMerkleRootNSt3__14spanIKhLm18446744073709551615EEERK7uint256:
 1899|  11.7k|{
 1900|  11.7k|    assert(control.size() >= TAPROOT_CONTROL_BASE_SIZE);
  ------------------
  |  Branch (1900:5): [True: 11.7k, False: 0]
  ------------------
 1901|  11.7k|    assert(control.size() <= TAPROOT_CONTROL_MAX_SIZE);
  ------------------
  |  Branch (1901:5): [True: 11.7k, False: 0]
  ------------------
 1902|  11.7k|    assert((control.size() - TAPROOT_CONTROL_BASE_SIZE) % TAPROOT_CONTROL_NODE_SIZE == 0);
  ------------------
  |  Branch (1902:5): [True: 11.7k, False: 0]
  ------------------
 1903|       |
 1904|  11.7k|    const int path_len = (control.size() - TAPROOT_CONTROL_BASE_SIZE) / TAPROOT_CONTROL_NODE_SIZE;
 1905|  11.7k|    uint256 k = tapleaf_hash;
 1906|  44.6k|    for (int i = 0; i < path_len; ++i) {
  ------------------
  |  Branch (1906:21): [True: 32.9k, False: 11.7k]
  ------------------
 1907|  32.9k|        std::span node{std::span{control}.subspan(TAPROOT_CONTROL_BASE_SIZE + TAPROOT_CONTROL_NODE_SIZE * i, TAPROOT_CONTROL_NODE_SIZE)};
 1908|  32.9k|        k = ComputeTapbranchHash(k, node);
 1909|  32.9k|    }
 1910|  11.7k|    return k;
 1911|  11.7k|}

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

_ZN10miniscript8internal12SanitizeTypeENS_4TypeE:
   19|  5.04M|Type SanitizeType(Type e) {
   20|  5.04M|    int num_types = (e << "K"_mst) + (e << "V"_mst) + (e << "B"_mst) + (e << "W"_mst);
   21|  5.04M|    if (num_types == 0) return ""_mst; // No valid type, don't care about the rest
  ------------------
  |  Branch (21:9): [True: 1.69M, False: 3.34M]
  ------------------
   22|  3.34M|    CHECK_NONFATAL(num_types == 1); // K, V, B, W all conflict with each other
  ------------------
  |  |  113|  3.34M|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   23|  3.34M|    CHECK_NONFATAL(!(e << "z"_mst) || !(e << "o"_mst)); // z conflicts with o
  ------------------
  |  |  113|  5.28M|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 1.40M, False: 1.94M]
  |  |  |  Branch (113:28): [True: 1.94M, False: 0]
  |  |  ------------------
  ------------------
   24|  3.34M|    CHECK_NONFATAL(!(e << "n"_mst) || !(e << "z"_mst)); // n conflicts with z
  ------------------
  |  |  113|  3.43M|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 3.24M, False: 96.2k]
  |  |  |  Branch (113:28): [True: 96.2k, False: 0]
  |  |  ------------------
  ------------------
   25|  3.34M|    CHECK_NONFATAL(!(e << "n"_mst) || !(e << "W"_mst)); // n conflicts with W
  ------------------
  |  |  113|  3.43M|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 3.24M, False: 96.2k]
  |  |  |  Branch (113:28): [True: 96.2k, False: 0]
  |  |  ------------------
  ------------------
   26|  3.34M|    CHECK_NONFATAL(!(e << "V"_mst) || !(e << "d"_mst)); // V conflicts with d
  ------------------
  |  |  113|  3.38M|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 3.30M, False: 40.6k]
  |  |  |  Branch (113:28): [True: 40.6k, False: 0]
  |  |  ------------------
  ------------------
   27|  3.34M|    CHECK_NONFATAL(!(e << "K"_mst) ||  (e << "u"_mst)); // K implies u
  ------------------
  |  |  113|  3.36M|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 3.32M, False: 18.6k]
  |  |  |  Branch (113:28): [True: 18.6k, False: 0]
  |  |  ------------------
  ------------------
   28|  3.34M|    CHECK_NONFATAL(!(e << "V"_mst) || !(e << "u"_mst)); // V conflicts with u
  ------------------
  |  |  113|  3.38M|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 3.30M, False: 40.6k]
  |  |  |  Branch (113:28): [True: 40.6k, False: 0]
  |  |  ------------------
  ------------------
   29|  3.34M|    CHECK_NONFATAL(!(e << "e"_mst) || !(e << "f"_mst)); // e conflicts with f
  ------------------
  |  |  113|  5.13M|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 1.55M, False: 1.78M]
  |  |  |  Branch (113:28): [True: 1.78M, False: 0]
  |  |  ------------------
  ------------------
   30|  3.34M|    CHECK_NONFATAL(!(e << "e"_mst) ||  (e << "d"_mst)); // e implies d
  ------------------
  |  |  113|  5.13M|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 1.55M, False: 1.78M]
  |  |  |  Branch (113:28): [True: 1.78M, False: 0]
  |  |  ------------------
  ------------------
   31|  3.34M|    CHECK_NONFATAL(!(e << "V"_mst) || !(e << "e"_mst)); // V conflicts with e
  ------------------
  |  |  113|  3.38M|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 3.30M, False: 40.6k]
  |  |  |  Branch (113:28): [True: 40.6k, False: 0]
  |  |  ------------------
  ------------------
   32|  3.34M|    CHECK_NONFATAL(!(e << "d"_mst) || !(e << "f"_mst)); // d conflicts with f
  ------------------
  |  |  113|  6.22M|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 460k, False: 2.88M]
  |  |  |  Branch (113:28): [True: 2.88M, False: 0]
  |  |  ------------------
  ------------------
   33|  3.34M|    CHECK_NONFATAL(!(e << "V"_mst) ||  (e << "f"_mst)); // V implies f
  ------------------
  |  |  113|  3.38M|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 3.30M, False: 40.6k]
  |  |  |  Branch (113:28): [True: 40.6k, False: 0]
  |  |  ------------------
  ------------------
   34|  3.34M|    CHECK_NONFATAL(!(e << "K"_mst) ||  (e << "s"_mst)); // K implies s
  ------------------
  |  |  113|  3.36M|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 3.32M, False: 18.6k]
  |  |  |  Branch (113:28): [True: 18.6k, False: 0]
  |  |  ------------------
  ------------------
   35|  3.34M|    CHECK_NONFATAL(!(e << "z"_mst) ||  (e << "m"_mst)); // z implies m
  ------------------
  |  |  113|  5.28M|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 1.40M, False: 1.94M]
  |  |  |  Branch (113:28): [True: 1.94M, False: 0]
  |  |  ------------------
  ------------------
   36|  3.34M|    return e;
   37|  5.04M|}
_ZN10miniscript8internal11ComputeTypeENS_8FragmentENS_4TypeES2_S2_RKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEEjmmmNS_17MiniscriptContextE:
   40|  5.04M|                 size_t data_size, size_t n_subs, size_t n_keys, MiniscriptContext ms_ctx) {
   41|       |    // Sanity check on data
   42|  5.04M|    if (fragment == Fragment::SHA256 || fragment == Fragment::HASH256) {
  ------------------
  |  Branch (42:9): [True: 79, False: 5.04M]
  |  Branch (42:41): [True: 138, False: 5.04M]
  ------------------
   43|    217|        CHECK_NONFATAL(data_size == 32);
  ------------------
  |  |  113|    217|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   44|  5.04M|    } else if (fragment == Fragment::RIPEMD160 || fragment == Fragment::HASH160) {
  ------------------
  |  Branch (44:16): [True: 290, False: 5.04M]
  |  Branch (44:51): [True: 499, False: 5.04M]
  ------------------
   45|    789|        CHECK_NONFATAL(data_size == 20);
  ------------------
  |  |  113|    789|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   46|  5.04M|    } else {
   47|  5.04M|        CHECK_NONFATAL(data_size == 0);
  ------------------
  |  |  113|  5.04M|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   48|  5.04M|    }
   49|       |    // Sanity check on k
   50|  5.04M|    if (fragment == Fragment::OLDER || fragment == Fragment::AFTER) {
  ------------------
  |  Branch (50:9): [True: 9.73k, False: 5.03M]
  |  Branch (50:40): [True: 11.3k, False: 5.02M]
  ------------------
   51|  21.1k|        CHECK_NONFATAL(k >= 1 && k < 0x80000000UL);
  ------------------
  |  |  113|  42.2k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 21.1k, False: 0]
  |  |  |  Branch (113:28): [True: 21.1k, False: 0]
  |  |  ------------------
  ------------------
   52|  5.02M|    } else if (fragment == Fragment::MULTI || fragment == Fragment::MULTI_A) {
  ------------------
  |  Branch (52:16): [True: 4.15k, False: 5.01M]
  |  Branch (52:47): [True: 2.50k, False: 5.01M]
  ------------------
   53|  6.65k|        CHECK_NONFATAL(k >= 1 && k <= n_keys);
  ------------------
  |  |  113|  13.3k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 6.65k, False: 0]
  |  |  |  Branch (113:28): [True: 6.65k, False: 0]
  |  |  ------------------
  ------------------
   54|  5.01M|    } else if (fragment == Fragment::THRESH) {
  ------------------
  |  Branch (54:16): [True: 24.8k, False: 4.98M]
  ------------------
   55|  24.8k|        CHECK_NONFATAL(k >= 1 && k <= n_subs);
  ------------------
  |  |  113|  49.7k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 24.8k, False: 0]
  |  |  |  Branch (113:28): [True: 24.8k, False: 0]
  |  |  ------------------
  ------------------
   56|  4.98M|    } else {
   57|  4.98M|        CHECK_NONFATAL(k == 0);
  ------------------
  |  |  113|  4.98M|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   58|  4.98M|    }
   59|       |    // Sanity check on subs
   60|  5.04M|    if (fragment == Fragment::AND_V || fragment == Fragment::AND_B || fragment == Fragment::OR_B ||
  ------------------
  |  Branch (60:9): [True: 223k, False: 4.81M]
  |  Branch (60:40): [True: 8.73k, False: 4.80M]
  |  Branch (60:71): [True: 5.10k, False: 4.80M]
  ------------------
   61|  4.80M|        fragment == Fragment::OR_C || fragment == Fragment::OR_I || fragment == Fragment::OR_D) {
  ------------------
  |  Branch (61:9): [True: 3.90k, False: 4.80M]
  |  Branch (61:39): [True: 1.31M, False: 3.48M]
  |  Branch (61:69): [True: 3.09k, False: 3.48M]
  ------------------
   62|  1.55M|        CHECK_NONFATAL(n_subs == 2);
  ------------------
  |  |  113|  1.55M|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   63|  3.48M|    } else if (fragment == Fragment::ANDOR) {
  ------------------
  |  Branch (63:16): [True: 8.30k, False: 3.47M]
  ------------------
   64|  8.30k|        CHECK_NONFATAL(n_subs == 3);
  ------------------
  |  |  113|  8.30k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   65|  3.47M|    } else if (fragment == Fragment::WRAP_A || fragment == Fragment::WRAP_S || fragment == Fragment::WRAP_C ||
  ------------------
  |  Branch (65:16): [True: 55.9k, False: 3.41M]
  |  Branch (65:48): [True: 19.0k, False: 3.40M]
  |  Branch (65:80): [True: 828k, False: 2.57M]
  ------------------
   66|  2.57M|               fragment == Fragment::WRAP_D || fragment == Fragment::WRAP_V || fragment == Fragment::WRAP_J ||
  ------------------
  |  Branch (66:16): [True: 137k, False: 2.43M]
  |  Branch (66:48): [True: 82.3k, False: 2.35M]
  |  Branch (66:80): [True: 26.8k, False: 2.32M]
  ------------------
   67|  2.32M|               fragment == Fragment::WRAP_N) {
  ------------------
  |  Branch (67:16): [True: 384k, False: 1.94M]
  ------------------
   68|  1.53M|        CHECK_NONFATAL(n_subs == 1);
  ------------------
  |  |  113|  1.53M|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   69|  1.94M|    } else if (fragment != Fragment::THRESH) {
  ------------------
  |  Branch (69:16): [True: 1.91M, False: 24.8k]
  ------------------
   70|  1.91M|        CHECK_NONFATAL(n_subs == 0);
  ------------------
  |  |  113|  1.91M|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   71|  1.91M|    }
   72|       |    // Sanity check on keys
   73|  5.04M|    if (fragment == Fragment::PK_K || fragment == Fragment::PK_H) {
  ------------------
  |  Branch (73:9): [True: 14.3k, False: 5.02M]
  |  Branch (73:39): [True: 3.86k, False: 5.02M]
  ------------------
   74|  18.1k|        CHECK_NONFATAL(n_keys == 1);
  ------------------
  |  |  113|  18.1k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   75|  5.02M|    } else if (fragment == Fragment::MULTI) {
  ------------------
  |  Branch (75:16): [True: 4.15k, False: 5.01M]
  ------------------
   76|  4.15k|        CHECK_NONFATAL(n_keys >= 1 && n_keys <= MAX_PUBKEYS_PER_MULTISIG);
  ------------------
  |  |  113|  8.30k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 4.15k, False: 0]
  |  |  |  Branch (113:28): [True: 4.15k, False: 0]
  |  |  ------------------
  ------------------
   77|  4.15k|        CHECK_NONFATAL(!IsTapscript(ms_ctx));
  ------------------
  |  |  113|  4.15k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   78|  5.01M|    } else if (fragment == Fragment::MULTI_A) {
  ------------------
  |  Branch (78:16): [True: 2.50k, False: 5.01M]
  ------------------
   79|  2.50k|        CHECK_NONFATAL(n_keys >= 1 && n_keys <= MAX_PUBKEYS_PER_MULTI_A);
  ------------------
  |  |  113|  5.00k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  |  |  ------------------
  |  |  |  Branch (113:28): [True: 2.50k, False: 0]
  |  |  |  Branch (113:28): [True: 2.50k, False: 0]
  |  |  ------------------
  ------------------
   80|  2.50k|        CHECK_NONFATAL(IsTapscript(ms_ctx));
  ------------------
  |  |  113|  2.50k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   81|  5.01M|    } else {
   82|  5.01M|        CHECK_NONFATAL(n_keys == 0);
  ------------------
  |  |  113|  5.01M|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
   83|  5.01M|    }
   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|  5.04M|    switch (fragment) {
  ------------------
  |  Branch (88:13): [True: 5.04M, False: 0]
  ------------------
   89|  14.3k|        case Fragment::PK_K: return "Konudemsxk"_mst;
  ------------------
  |  Branch (89:9): [True: 14.3k, False: 5.02M]
  ------------------
   90|  3.86k|        case Fragment::PK_H: return "Knudemsxk"_mst;
  ------------------
  |  Branch (90:9): [True: 3.86k, False: 5.03M]
  ------------------
   91|  9.73k|        case Fragment::OLDER: return
  ------------------
  |  Branch (91:9): [True: 9.73k, False: 5.03M]
  ------------------
   92|  9.73k|            "g"_mst.If(k & CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG) |
   93|  9.73k|            "h"_mst.If(!(k & CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG)) |
   94|  9.73k|            "Bzfmxk"_mst;
   95|  11.3k|        case Fragment::AFTER: return
  ------------------
  |  Branch (95:9): [True: 11.3k, False: 5.02M]
  ------------------
   96|  11.3k|            "i"_mst.If(k >= LOCKTIME_THRESHOLD) |
   97|  11.3k|            "j"_mst.If(k < LOCKTIME_THRESHOLD) |
   98|  11.3k|            "Bzfmxk"_mst;
   99|     79|        case Fragment::SHA256: return "Bonudmk"_mst;
  ------------------
  |  Branch (99:9): [True: 79, False: 5.04M]
  ------------------
  100|    290|        case Fragment::RIPEMD160: return "Bonudmk"_mst;
  ------------------
  |  Branch (100:9): [True: 290, False: 5.04M]
  ------------------
  101|    138|        case Fragment::HASH256: return "Bonudmk"_mst;
  ------------------
  |  Branch (101:9): [True: 138, False: 5.04M]
  ------------------
  102|    499|        case Fragment::HASH160: return "Bonudmk"_mst;
  ------------------
  |  Branch (102:9): [True: 499, False: 5.04M]
  ------------------
  103|   323k|        case Fragment::JUST_1: return "Bzufmxk"_mst;
  ------------------
  |  Branch (103:9): [True: 323k, False: 4.71M]
  ------------------
  104|  1.54M|        case Fragment::JUST_0: return "Bzudemsxk"_mst;
  ------------------
  |  Branch (104:9): [True: 1.54M, False: 3.49M]
  ------------------
  105|  55.9k|        case Fragment::WRAP_A: return
  ------------------
  |  Branch (105:9): [True: 55.9k, False: 4.98M]
  ------------------
  106|  55.9k|            "W"_mst.If(x << "B"_mst) | // W=B_x
  107|  55.9k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  108|  55.9k|            (x & "udfems"_mst) | // u=u_x, d=d_x, f=f_x, e=e_x, m=m_x, s=s_x
  109|  55.9k|            "x"_mst; // x
  110|  19.0k|        case Fragment::WRAP_S: return
  ------------------
  |  Branch (110:9): [True: 19.0k, False: 5.02M]
  ------------------
  111|  19.0k|            "W"_mst.If(x << "Bo"_mst) | // W=B_x*o_x
  112|  19.0k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  113|  19.0k|            (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|   828k|        case Fragment::WRAP_C: return
  ------------------
  |  Branch (114:9): [True: 828k, False: 4.21M]
  ------------------
  115|   828k|            "B"_mst.If(x << "K"_mst) | // B=K_x
  116|   828k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  117|   828k|            (x & "ondfem"_mst) | // o=o_x, n=n_x, d=d_x, f=f_x, e=e_x, m=m_x
  118|   828k|            "us"_mst; // u, s
  119|   137k|        case Fragment::WRAP_D: return
  ------------------
  |  Branch (119:9): [True: 137k, False: 4.90M]
  ------------------
  120|   137k|            "B"_mst.If(x << "Vz"_mst) | // B=V_x*z_x
  121|   137k|            "o"_mst.If(x << "z"_mst) | // o=z_x
  122|   137k|            "e"_mst.If(x << "f"_mst) | // e=f_x
  123|   137k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  124|   137k|            (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|   137k|            "u"_mst.If(IsTapscript(ms_ctx)) |
  127|   137k|            "ndx"_mst; // n, d, x
  128|  82.3k|        case Fragment::WRAP_V: return
  ------------------
  |  Branch (128:9): [True: 82.3k, False: 4.95M]
  ------------------
  129|  82.3k|            "V"_mst.If(x << "B"_mst) | // V=B_x
  130|  82.3k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  131|  82.3k|            (x & "zonms"_mst) | // z=z_x, o=o_x, n=n_x, m=m_x, s=s_x
  132|  82.3k|            "fx"_mst; // f, x
  133|  26.8k|        case Fragment::WRAP_J: return
  ------------------
  |  Branch (133:9): [True: 26.8k, False: 5.01M]
  ------------------
  134|  26.8k|            "B"_mst.If(x << "Bn"_mst) | // B=B_x*n_x
  135|  26.8k|            "e"_mst.If(x << "f"_mst) | // e=f_x
  136|  26.8k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  137|  26.8k|            (x & "oums"_mst) | // o=o_x, u=u_x, m=m_x, s=s_x
  138|  26.8k|            "ndx"_mst; // n, d, x
  139|   384k|        case Fragment::WRAP_N: return
  ------------------
  |  Branch (139:9): [True: 384k, False: 4.65M]
  ------------------
  140|   384k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  141|   384k|            (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|   384k|            "ux"_mst; // u, x
  143|   223k|        case Fragment::AND_V: return
  ------------------
  |  Branch (143:9): [True: 223k, False: 4.81M]
  ------------------
  144|   223k|            (y & "KVB"_mst).If(x << "V"_mst) | // B=V_x*B_y, V=V_x*V_y, K=V_x*K_y
  145|   223k|            (x & "n"_mst) | (y & "n"_mst).If(x << "z"_mst) | // n=n_x+z_x*n_y
  146|   223k|            ((x | y) & "o"_mst).If((x | y) << "z"_mst) | // o=o_x*z_y+z_x*o_y
  147|   223k|            (x & y & "mz"_mst) | // m=m_x*m_y, z=z_x*z_y
  148|   223k|            ((x | y) & "s"_mst) | // s=s_x+s_y
  149|   223k|            "f"_mst.If((y << "f"_mst) || (x << "s"_mst)) | // f=f_y+s_x
  ------------------
  |  Branch (149:24): [True: 221k, False: 1.45k]
  |  Branch (149:42): [True: 79, False: 1.37k]
  ------------------
  150|   223k|            (y & "ux"_mst) | // u=u_y, x=x_y
  151|   223k|            ((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|   223k|            "k"_mst.If(((x & y) << "k"_mst) &&
  ------------------
  |  Branch (152:24): [True: 35.4k, False: 187k]
  ------------------
  153|  35.4k|                !(((x << "g"_mst) && (y << "h"_mst)) ||
  ------------------
  |  Branch (153:20): [True: 451, False: 34.9k]
  |  Branch (153:38): [True: 82, False: 369]
  ------------------
  154|  35.3k|                ((x << "h"_mst) && (y << "g"_mst)) ||
  ------------------
  |  Branch (154:18): [True: 2.44k, False: 32.9k]
  |  Branch (154:36): [True: 182, False: 2.26k]
  ------------------
  155|  35.1k|                ((x << "i"_mst) && (y << "j"_mst)) ||
  ------------------
  |  Branch (155:18): [True: 2.44k, False: 32.7k]
  |  Branch (155:36): [True: 194, False: 2.24k]
  ------------------
  156|  34.9k|                ((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.16k, False: 31.8k]
  |  Branch (156:36): [True: 1, False: 3.16k]
  ------------------
  157|  8.73k|        case Fragment::AND_B: return
  ------------------
  |  Branch (157:9): [True: 8.73k, False: 5.03M]
  ------------------
  158|  8.73k|            (x & "B"_mst).If(y << "W"_mst) | // B=B_x*W_y
  159|  8.73k|            ((x | y) & "o"_mst).If((x | y) << "z"_mst) | // o=o_x*z_y+z_x*o_y
  160|  8.73k|            (x & "n"_mst) | (y & "n"_mst).If(x << "z"_mst) | // n=n_x+z_x*n_y
  161|  8.73k|            (x & y & "e"_mst).If((x & y) << "s"_mst) | // e=e_x*e_y*s_x*s_y
  162|  8.73k|            (x & y & "dzm"_mst) | // d=d_x*d_y, z=z_x*z_y, m=m_x*m_y
  163|  8.73k|            "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.25k, False: 7.47k]
  |  Branch (163:48): [True: 487, False: 6.99k]
  |  Branch (163:67): [True: 2, False: 6.98k]
  ------------------
  164|  8.73k|            ((x | y) & "s"_mst) | // s=s_x+s_y
  165|  8.73k|            "ux"_mst | // u, x
  166|  8.73k|            ((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.73k|            "k"_mst.If(((x & y) << "k"_mst) &&
  ------------------
  |  Branch (167:24): [True: 2.85k, False: 5.87k]
  ------------------
  168|  2.85k|                !(((x << "g"_mst) && (y << "h"_mst)) ||
  ------------------
  |  Branch (168:20): [True: 352, False: 2.50k]
  |  Branch (168:38): [True: 262, False: 90]
  ------------------
  169|  2.59k|                ((x << "h"_mst) && (y << "g"_mst)) ||
  ------------------
  |  Branch (169:18): [True: 1.09k, False: 1.49k]
  |  Branch (169:36): [True: 158, False: 939]
  ------------------
  170|  2.43k|                ((x << "i"_mst) && (y << "j"_mst)) ||
  ------------------
  |  Branch (170:18): [True: 479, False: 1.95k]
  |  Branch (170:36): [True: 86, False: 393]
  ------------------
  171|  2.35k|                ((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: 461, False: 1.89k]
  |  Branch (171:36): [True: 3, False: 458]
  ------------------
  172|  5.10k|        case Fragment::OR_B: return
  ------------------
  |  Branch (172:9): [True: 5.10k, False: 5.03M]
  ------------------
  173|  5.10k|            "B"_mst.If(x << "Bd"_mst && y << "Wd"_mst) | // B=B_x*d_x*W_x*d_y
  ------------------
  |  Branch (173:24): [True: 2.06k, False: 3.04k]
  |  Branch (173:41): [True: 882, False: 1.17k]
  ------------------
  174|  5.10k|            ((x | y) & "o"_mst).If((x | y) << "z"_mst) | // o=o_x*z_y+z_x*o_y
  175|  5.10k|            (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: 2.64k, False: 2.46k]
  |  Branch (175:56): [True: 916, False: 1.73k]
  ------------------
  176|  5.10k|            (x & y & "zse"_mst) | // z=z_x*z_y, s=s_x*s_y, e=e_x*e_y
  177|  5.10k|            "dux"_mst | // d, u, x
  178|  5.10k|            ((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|  5.10k|            (x & y & "k"_mst); // k=k_x*k_y
  180|  3.09k|        case Fragment::OR_D: return
  ------------------
  |  Branch (180:9): [True: 3.09k, False: 5.03M]
  ------------------
  181|  3.09k|            (y & "B"_mst).If(x << "Bdu"_mst) | // B=B_y*B_x*d_x*u_x
  182|  3.09k|            (x & "o"_mst).If(y << "z"_mst) | // o=o_x*z_y
  183|  3.09k|            (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: 2.48k, False: 607]
  |  Branch (183:50): [True: 1.68k, False: 796]
  ------------------
  184|  3.09k|            (x & y & "zs"_mst) | // z=z_x*z_y, s=s_x*s_y
  185|  3.09k|            (y & "ufde"_mst) | // u=u_y, f=f_y, d=d_y, e=e_y
  186|  3.09k|            "x"_mst | // x
  187|  3.09k|            ((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|  3.09k|            (x & y & "k"_mst); // k=k_x*k_y
  189|  3.90k|        case Fragment::OR_C: return
  ------------------
  |  Branch (189:9): [True: 3.90k, False: 5.03M]
  ------------------
  190|  3.90k|            (y & "V"_mst).If(x << "Bdu"_mst) | // V=V_y*B_x*u_x*d_x
  191|  3.90k|            (x & "o"_mst).If(y << "z"_mst) | // o=o_x*z_y
  192|  3.90k|            (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: 2.05k, False: 1.85k]
  |  Branch (192:50): [True: 1.73k, False: 318]
  ------------------
  193|  3.90k|            (x & y & "zs"_mst) | // z=z_x*z_y, s=s_x*s_y
  194|  3.90k|            "fx"_mst | // f, x
  195|  3.90k|            ((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|  3.90k|            (x & y & "k"_mst); // k=k_x*k_y
  197|  1.31M|        case Fragment::OR_I: return
  ------------------
  |  Branch (197:9): [True: 1.31M, False: 3.72M]
  ------------------
  198|  1.31M|            (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|  1.31M|            "o"_mst.If((x & y) << "z"_mst) | // o=z_x*z_y
  200|  1.31M|            ((x | y) & "e"_mst).If((x | y) << "f"_mst) | // e=e_x*f_y+f_x*e_y
  201|  1.31M|            (x & y & "m"_mst).If((x | y) << "s"_mst) | // m=m_x*m_y*(s_x+s_y)
  202|  1.31M|            ((x | y) & "d"_mst) | // d=d_x+d_y
  203|  1.31M|            "x"_mst | // x
  204|  1.31M|            ((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|  1.31M|            (x & y & "k"_mst); // k=k_x*k_y
  206|  8.30k|        case Fragment::ANDOR: return
  ------------------
  |  Branch (206:9): [True: 8.30k, False: 5.03M]
  ------------------
  207|  8.30k|            (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|  8.30k|            (x & y & z & "z"_mst) | // z=z_x*z_y*z_z
  209|  8.30k|            ((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|  8.30k|            (y & z & "u"_mst) | // u=u_y*u_z
  211|  8.30k|            (z & "f"_mst).If((x << "s"_mst) || (y << "f"_mst)) | // f=(s_x+f_y)*f_z
  ------------------
  |  Branch (211:30): [True: 2.71k, False: 5.59k]
  |  Branch (211:48): [True: 2.11k, False: 3.47k]
  ------------------
  212|  8.30k|            (z & "d"_mst) | // d=d_z
  213|  8.30k|            (z & "e"_mst).If(x << "s"_mst || y << "f"_mst) | // e=e_z*(s_x+f_y)
  ------------------
  |  Branch (213:30): [True: 2.71k, False: 5.59k]
  |  Branch (213:46): [True: 2.11k, False: 3.47k]
  ------------------
  214|  8.30k|            (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: 4.74k, False: 3.56k]
  |  Branch (214:54): [True: 3.66k, False: 1.07k]
  ------------------
  215|  8.30k|            (z & (x | y) & "s"_mst) | // s=s_z*(s_x+s_y)
  216|  8.30k|            "x"_mst | // x
  217|  8.30k|            ((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|  8.30k|            "k"_mst.If(((x & y & z) << "k"_mst) &&
  ------------------
  |  Branch (218:24): [True: 4.63k, False: 3.66k]
  ------------------
  219|  4.63k|                !(((x << "g"_mst) && (y << "h"_mst)) ||
  ------------------
  |  Branch (219:20): [True: 137, False: 4.50k]
  |  Branch (219:38): [True: 68, False: 69]
  ------------------
  220|  4.57k|                ((x << "h"_mst) && (y << "g"_mst)) ||
  ------------------
  |  Branch (220:18): [True: 609, False: 3.96k]
  |  Branch (220:36): [True: 103, False: 506]
  ------------------
  221|  4.46k|                ((x << "i"_mst) && (y << "j"_mst)) ||
  ------------------
  |  Branch (221:18): [True: 951, False: 3.51k]
  |  Branch (221:36): [True: 755, False: 196]
  ------------------
  222|  3.71k|                ((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: 311, False: 3.40k]
  |  Branch (222:36): [True: 3, False: 308]
  ------------------
  223|  4.15k|        case Fragment::MULTI: {
  ------------------
  |  Branch (223:9): [True: 4.15k, False: 5.03M]
  ------------------
  224|  4.15k|            return "Bnudemsk"_mst;
  225|      0|        }
  226|  2.50k|        case Fragment::MULTI_A: {
  ------------------
  |  Branch (226:9): [True: 2.50k, False: 5.03M]
  ------------------
  227|  2.50k|            return "Budemsk"_mst;
  228|      0|        }
  229|  24.8k|        case Fragment::THRESH: {
  ------------------
  |  Branch (229:9): [True: 24.8k, False: 5.01M]
  ------------------
  230|  24.8k|            bool all_e = true;
  231|  24.8k|            bool all_m = true;
  232|  24.8k|            uint32_t args = 0;
  233|  24.8k|            uint32_t num_s = 0;
  234|  24.8k|            Type acc_tl = "k"_mst;
  235|  60.6k|            for (size_t i = 0; i < sub_types.size(); ++i) {
  ------------------
  |  Branch (235:32): [True: 52.3k, False: 8.26k]
  ------------------
  236|  52.3k|                Type t = sub_types[i];
  237|  52.3k|                if (!(t << (i ? "Wdu"_mst : "Bdu"_mst))) return ""_mst; // Require Bdu, Wdu, Wdu, ...
  ------------------
  |  Branch (237:21): [True: 16.5k, False: 35.7k]
  |  Branch (237:29): [True: 27.4k, False: 24.8k]
  ------------------
  238|  35.7k|                if (!(t << "e"_mst)) all_e = false;
  ------------------
  |  Branch (238:21): [True: 22.6k, False: 13.0k]
  ------------------
  239|  35.7k|                if (!(t << "m"_mst)) all_m = false;
  ------------------
  |  Branch (239:21): [True: 5.07k, False: 30.6k]
  ------------------
  240|  35.7k|                if (t << "s"_mst) num_s += 1;
  ------------------
  |  Branch (240:21): [True: 23.5k, False: 12.2k]
  ------------------
  241|  35.7k|                args += (t << "z"_mst) ? 0 : (t << "o"_mst) ? 1 : 2;
  ------------------
  |  Branch (241:25): [True: 1.45k, False: 34.2k]
  |  Branch (241:46): [True: 7.17k, False: 27.1k]
  ------------------
  242|  35.7k|                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|  35.7k|                    "k"_mst.If(((acc_tl & t) << "k"_mst) && ((k <= 1) ||
  ------------------
  |  Branch (246:32): [True: 30.9k, False: 4.78k]
  |  Branch (246:62): [True: 14.2k, False: 16.6k]
  ------------------
  247|  16.6k|                        ((k > 1) && !(((acc_tl << "g"_mst) && (t << "h"_mst)) ||
  ------------------
  |  Branch (247:26): [True: 16.6k, False: 0]
  |  Branch (247:40): [True: 1.78k, False: 14.8k]
  |  Branch (247:63): [True: 1.33k, False: 441]
  ------------------
  248|  15.3k|                        ((acc_tl << "h"_mst) && (t << "g"_mst)) ||
  ------------------
  |  Branch (248:26): [True: 389, False: 14.9k]
  |  Branch (248:49): [True: 66, False: 323]
  ------------------
  249|  15.2k|                        ((acc_tl << "i"_mst) && (t << "j"_mst)) ||
  ------------------
  |  Branch (249:26): [True: 842, False: 14.4k]
  |  Branch (249:49): [True: 643, False: 199]
  ------------------
  250|  14.6k|                        ((acc_tl << "j"_mst) && (t << "i"_mst))))));
  ------------------
  |  Branch (250:26): [True: 711, False: 13.9k]
  |  Branch (250:49): [True: 21, False: 690]
  ------------------
  251|  35.7k|            }
  252|  8.26k|            return "Bdu"_mst |
  253|  8.26k|                   "z"_mst.If(args == 0) | // z=all z
  254|  8.26k|                   "o"_mst.If(args == 1) | // o=all z except one o
  255|  8.26k|                   "e"_mst.If(all_e && num_s == n_subs) | // e=all e and all s
  ------------------
  |  Branch (255:31): [True: 3.30k, False: 4.96k]
  |  Branch (255:40): [True: 1.24k, False: 2.05k]
  ------------------
  256|  8.26k|                   "m"_mst.If(all_e && all_m && num_s >= n_subs - k) | // m=all e, >=(n-k) s
  ------------------
  |  Branch (256:31): [True: 3.30k, False: 4.96k]
  |  Branch (256:40): [True: 2.67k, False: 634]
  |  Branch (256:49): [True: 2.18k, False: 484]
  ------------------
  257|  8.26k|                   "s"_mst.If(num_s >= n_subs - k + 1) |  // s= >=(n-k+1) s
  258|  8.26k|                   acc_tl; // timelock info
  259|  24.8k|            }
  260|  5.04M|    }
  261|  5.04M|    assert(false);
  ------------------
  |  Branch (261:5): [Folded, False: 0]
  ------------------
  262|      0|}
_ZN10miniscript8internal16ComputeScriptLenENS_8FragmentENS_4TypeEmjmmNS_17MiniscriptContextE:
  265|  5.04M|                        size_t n_keys, MiniscriptContext ms_ctx) {
  266|  5.04M|    switch (fragment) {
  ------------------
  |  Branch (266:13): [True: 5.04M, False: 0]
  ------------------
  267|   323k|        case Fragment::JUST_1:
  ------------------
  |  Branch (267:9): [True: 323k, False: 4.71M]
  ------------------
  268|  1.86M|        case Fragment::JUST_0: return 1;
  ------------------
  |  Branch (268:9): [True: 1.54M, False: 3.49M]
  ------------------
  269|  14.3k|        case Fragment::PK_K: return IsTapscript(ms_ctx) ? 33 : 34;
  ------------------
  |  Branch (269:9): [True: 14.3k, False: 5.02M]
  |  Branch (269:37): [True: 12.6k, False: 1.68k]
  ------------------
  270|  3.86k|        case Fragment::PK_H: return 3 + 21;
  ------------------
  |  Branch (270:9): [True: 3.86k, False: 5.03M]
  ------------------
  271|  9.73k|        case Fragment::OLDER:
  ------------------
  |  Branch (271:9): [True: 9.73k, False: 5.03M]
  ------------------
  272|  21.1k|        case Fragment::AFTER: return 1 + BuildScript(k).size();
  ------------------
  |  Branch (272:9): [True: 11.3k, False: 5.02M]
  ------------------
  273|    138|        case Fragment::HASH256:
  ------------------
  |  Branch (273:9): [True: 138, False: 5.04M]
  ------------------
  274|    217|        case Fragment::SHA256: return 4 + 2 + 33;
  ------------------
  |  Branch (274:9): [True: 79, False: 5.04M]
  ------------------
  275|    499|        case Fragment::HASH160:
  ------------------
  |  Branch (275:9): [True: 499, False: 5.04M]
  ------------------
  276|    789|        case Fragment::RIPEMD160: return 4 + 2 + 21;
  ------------------
  |  Branch (276:9): [True: 290, False: 5.04M]
  ------------------
  277|  4.15k|        case Fragment::MULTI: return 1 + BuildScript(n_keys).size() + BuildScript(k).size() + 34 * n_keys;
  ------------------
  |  Branch (277:9): [True: 4.15k, False: 5.03M]
  ------------------
  278|  2.50k|        case Fragment::MULTI_A: return (1 + 32 + 1) * n_keys + BuildScript(k).size() + 1;
  ------------------
  |  Branch (278:9): [True: 2.50k, False: 5.03M]
  ------------------
  279|   223k|        case Fragment::AND_V: return subsize;
  ------------------
  |  Branch (279:9): [True: 223k, False: 4.81M]
  ------------------
  280|  82.3k|        case Fragment::WRAP_V: return subsize + (sub0typ << "x"_mst);
  ------------------
  |  Branch (280:9): [True: 82.3k, False: 4.95M]
  ------------------
  281|  19.0k|        case Fragment::WRAP_S:
  ------------------
  |  Branch (281:9): [True: 19.0k, False: 5.02M]
  ------------------
  282|   847k|        case Fragment::WRAP_C:
  ------------------
  |  Branch (282:9): [True: 828k, False: 4.21M]
  ------------------
  283|  1.23M|        case Fragment::WRAP_N:
  ------------------
  |  Branch (283:9): [True: 384k, False: 4.65M]
  ------------------
  284|  1.24M|        case Fragment::AND_B:
  ------------------
  |  Branch (284:9): [True: 8.73k, False: 5.03M]
  ------------------
  285|  1.24M|        case Fragment::OR_B: return subsize + 1;
  ------------------
  |  Branch (285:9): [True: 5.10k, False: 5.03M]
  ------------------
  286|  55.9k|        case Fragment::WRAP_A:
  ------------------
  |  Branch (286:9): [True: 55.9k, False: 4.98M]
  ------------------
  287|  59.8k|        case Fragment::OR_C: return subsize + 2;
  ------------------
  |  Branch (287:9): [True: 3.90k, False: 5.03M]
  ------------------
  288|   137k|        case Fragment::WRAP_D:
  ------------------
  |  Branch (288:9): [True: 137k, False: 4.90M]
  ------------------
  289|   140k|        case Fragment::OR_D:
  ------------------
  |  Branch (289:9): [True: 3.09k, False: 5.03M]
  ------------------
  290|  1.45M|        case Fragment::OR_I:
  ------------------
  |  Branch (290:9): [True: 1.31M, False: 3.72M]
  ------------------
  291|  1.46M|        case Fragment::ANDOR: return subsize + 3;
  ------------------
  |  Branch (291:9): [True: 8.30k, False: 5.03M]
  ------------------
  292|  26.8k|        case Fragment::WRAP_J: return subsize + 4;
  ------------------
  |  Branch (292:9): [True: 26.8k, False: 5.01M]
  ------------------
  293|  24.8k|        case Fragment::THRESH: return subsize + n_subs + BuildScript(k).size();
  ------------------
  |  Branch (293:9): [True: 24.8k, False: 5.01M]
  ------------------
  294|  5.04M|    }
  295|  5.04M|    assert(false);
  ------------------
  |  Branch (295:5): [Folded, False: 0]
  ------------------
  296|      0|}
_ZN10miniscript8internal15DecomposeScriptERK7CScript:
  369|  4.69k|{
  370|  4.69k|    std::vector<Opcode> out;
  371|  4.69k|    CScript::const_iterator it = script.begin(), itend = script.end();
  372|   170k|    while (it != itend) {
  ------------------
  |  Branch (372:12): [True: 165k, False: 4.69k]
  ------------------
  373|   165k|        std::vector<unsigned char> push_data;
  374|   165k|        opcodetype opcode;
  375|   165k|        if (!script.GetOp(it, opcode, push_data)) {
  ------------------
  |  Branch (375:13): [True: 0, False: 165k]
  ------------------
  376|      0|            return {};
  377|   165k|        } else if (opcode >= OP_1 && opcode <= OP_16) {
  ------------------
  |  Branch (377:20): [True: 130k, False: 35.5k]
  |  Branch (377:38): [True: 9.29k, False: 120k]
  ------------------
  378|       |            // Deal with OP_n (GetOp does not turn them into pushes).
  379|  9.29k|            push_data.assign(1, CScript::DecodeOP_N(opcode));
  380|   156k|        } else if (opcode == OP_CHECKSIGVERIFY) {
  ------------------
  |  Branch (380:20): [True: 1.00k, False: 155k]
  ------------------
  381|       |            // Decompose OP_CHECKSIGVERIFY into OP_CHECKSIG OP_VERIFY
  382|  1.00k|            out.emplace_back(OP_CHECKSIG, std::vector<unsigned char>());
  383|  1.00k|            opcode = OP_VERIFY;
  384|   155k|        } else if (opcode == OP_CHECKMULTISIGVERIFY) {
  ------------------
  |  Branch (384:20): [True: 203, False: 155k]
  ------------------
  385|       |            // Decompose OP_CHECKMULTISIGVERIFY into OP_CHECKMULTISIG OP_VERIFY
  386|    203|            out.emplace_back(OP_CHECKMULTISIG, std::vector<unsigned char>());
  387|    203|            opcode = OP_VERIFY;
  388|   155k|        } else if (opcode == OP_EQUALVERIFY) {
  ------------------
  |  Branch (388:20): [True: 908, False: 154k]
  ------------------
  389|       |            // Decompose OP_EQUALVERIFY into OP_EQUAL OP_VERIFY
  390|    908|            out.emplace_back(OP_EQUAL, std::vector<unsigned char>());
  391|    908|            opcode = OP_VERIFY;
  392|   154k|        } else if (opcode == OP_NUMEQUALVERIFY) {
  ------------------
  |  Branch (392:20): [True: 15, False: 154k]
  ------------------
  393|       |            // Decompose OP_NUMEQUALVERIFY into OP_NUMEQUAL OP_VERIFY
  394|     15|            out.emplace_back(OP_NUMEQUAL, std::vector<unsigned char>());
  395|     15|            opcode = OP_VERIFY;
  396|   154k|        } else if (IsPushdataOp(opcode)) {
  ------------------
  |  Branch (396:20): [True: 7.52k, False: 146k]
  ------------------
  397|  7.52k|            if (!CheckMinimalPush(push_data, opcode)) return {};
  ------------------
  |  Branch (397:17): [True: 0, False: 7.52k]
  ------------------
  398|   146k|        } else if (it != itend && (opcode == OP_CHECKSIG || opcode == OP_CHECKMULTISIG || opcode == OP_EQUAL || opcode == OP_NUMEQUAL) && (*it == OP_VERIFY)) {
  ------------------
  |  Branch (398:20): [True: 143k, False: 3.63k]
  |  Branch (398:36): [True: 1.58k, False: 141k]
  |  Branch (398:61): [True: 1.39k, False: 140k]
  |  Branch (398:91): [True: 211, False: 140k]
  |  Branch (398:113): [True: 936, False: 139k]
  |  Branch (398:139): [True: 0, False: 4.12k]
  ------------------
  399|       |            // Rule out non minimal VERIFY sequences
  400|      0|            return {};
  401|      0|        }
  402|   165k|        out.emplace_back(opcode, std::move(push_data));
  403|   165k|    }
  404|  4.69k|    std::reverse(out.begin(), out.end());
  405|  4.69k|    return out;
  406|  4.69k|}
_ZN10miniscript8internal17ParseScriptNumberERKNSt3__14pairI10opcodetypeNS1_6vectorIhNS1_9allocatorIhEEEEEE:
  408|  4.65k|std::optional<int64_t> ParseScriptNumber(const Opcode& in) {
  409|  4.65k|    if (in.first == OP_0) {
  ------------------
  |  Branch (409:9): [True: 0, False: 4.65k]
  ------------------
  410|      0|        return 0;
  411|      0|    }
  412|  4.65k|    if (!in.second.empty()) {
  ------------------
  |  Branch (412:9): [True: 4.65k, False: 0]
  ------------------
  413|  4.65k|        if (IsPushdataOp(in.first) && !CheckMinimalPush(in.second, in.first)) return {};
  ------------------
  |  Branch (413:13): [True: 247, False: 4.40k]
  |  Branch (413:39): [True: 0, False: 247]
  ------------------
  414|  4.65k|        try {
  415|  4.65k|            return CScriptNum(in.second, true).GetInt64();
  416|  4.65k|        } catch(const scriptnum_error&) {}
  417|  4.65k|    }
  418|      4|    return {};
  419|  4.65k|}
_ZN10miniscript8internal12FindNextCharENSt3__14spanIKcLm18446744073709551615EEEc:
  422|  44.2k|{
  423|  3.25M|    for (int i = 0; i < (int)sp.size(); ++i) {
  ------------------
  |  Branch (423:21): [True: 3.25M, False: 187]
  ------------------
  424|  3.25M|        if (sp[i] == m) return i;
  ------------------
  |  Branch (424:13): [True: 42.5k, False: 3.21M]
  ------------------
  425|       |        // We only search within the current parentheses
  426|  3.21M|        if (sp[i] == ')') break;
  ------------------
  |  Branch (426:13): [True: 1.50k, False: 3.20M]
  ------------------
  427|  3.21M|    }
  428|  1.69k|    return -1;
  429|  44.2k|}

descriptor.cpp:_ZN10miniscript10FromStringIN12_GLOBAL__N_19KeyParserEEENSt3__18optionalINS_4NodeINT_3KeyEEEEERKNS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKS6_:
 2686|  8.23k|{
 2687|  8.23k|    return internal::Parse<typename Ctx::Key>(str, ctx);
 2688|  8.23k|}
descriptor.cpp:_ZN10miniscript8internal5ParseIjN12_GLOBAL__N_19KeyParserEEENSt3__18optionalINS_4NodeIT_EEEENS4_4spanIKcLm18446744073709551615EEERKT0_:
 1855|  8.23k|{
 1856|  8.23k|    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|  8.23k|    size_t script_size{1};
 1869|  8.23k|    size_t max_size{internal::MaxScriptSize(ctx.MsContext())};
 1870|       |
 1871|       |    // The two integers are used to hold state for thresh()
 1872|  8.23k|    std::vector<std::tuple<ParseContext, int64_t, int64_t>> to_parse;
 1873|  8.23k|    std::vector<Node<Key>> constructed;
 1874|       |
 1875|  8.23k|    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|  8.23k|    const auto parse_multi_exp = [&](std::span<const char>& in, const bool is_multi_a) -> bool {
 1879|  8.23k|        const auto max_keys{is_multi_a ? MAX_PUBKEYS_PER_MULTI_A : MAX_PUBKEYS_PER_MULTISIG};
 1880|  8.23k|        const auto required_ctx{is_multi_a ? MiniscriptContext::TAPSCRIPT : MiniscriptContext::P2WSH};
 1881|  8.23k|        if (ctx.MsContext() != required_ctx) return false;
 1882|       |        // Get threshold
 1883|  8.23k|        int next_comma = FindNextChar(in, ',');
 1884|  8.23k|        if (next_comma < 1) return false;
 1885|  8.23k|        const auto k_to_integral{ToIntegral<int64_t>(std::string_view(in.data(), next_comma))};
 1886|  8.23k|        if (!k_to_integral.has_value()) return false;
 1887|  8.23k|        const int64_t k{k_to_integral.value()};
 1888|  8.23k|        in = in.subspan(next_comma + 1);
 1889|       |        // Get keys. It is compatible for both compressed and x-only keys.
 1890|  8.23k|        std::vector<Key> keys;
 1891|  8.23k|        while (next_comma != -1) {
 1892|  8.23k|            next_comma = FindNextChar(in, ',');
 1893|  8.23k|            int key_length = (next_comma == -1) ? FindNextChar(in, ')') : next_comma;
 1894|  8.23k|            if (key_length < 1) return false;
 1895|  8.23k|            std::span<const char> sp{in.begin(), in.begin() + key_length};
 1896|  8.23k|            auto key = ctx.FromString(sp);
 1897|  8.23k|            if (!key) return false;
 1898|  8.23k|            keys.push_back(std::move(*key));
 1899|  8.23k|            in = in.subspan(key_length + 1);
 1900|  8.23k|        }
 1901|  8.23k|        if (keys.size() < 1 || keys.size() > max_keys) return false;
 1902|  8.23k|        if (k < 1 || k > (int64_t)keys.size()) return false;
 1903|  8.23k|        if (is_multi_a) {
 1904|       |            // (push + xonly-key + CHECKSIG[ADD]) * n + k + OP_NUMEQUAL(VERIFY), minus one.
 1905|  8.23k|            script_size += (1 + 32 + 1) * keys.size() + BuildScript(k).size();
 1906|  8.23k|            constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::MULTI_A, std::move(keys), k);
 1907|  8.23k|        } else {
 1908|  8.23k|            script_size += 2 + (keys.size() > 16) + (k > 16) + 34 * keys.size();
 1909|  8.23k|            constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::MULTI, std::move(keys), k);
 1910|  8.23k|        }
 1911|  8.23k|        return true;
 1912|  8.23k|    };
 1913|       |
 1914|  3.77M|    while (!to_parse.empty()) {
  ------------------
  |  Branch (1914:12): [True: 3.77M, False: 5.57k]
  ------------------
 1915|  3.77M|        if (script_size > max_size) return {};
  ------------------
  |  Branch (1915:13): [True: 3, False: 3.77M]
  ------------------
 1916|       |
 1917|       |        // Get the current context we are decoding within
 1918|  3.77M|        auto [cur_context, n, k] = to_parse.back();
 1919|  3.77M|        to_parse.pop_back();
 1920|       |
 1921|  3.77M|        switch (cur_context) {
  ------------------
  |  Branch (1921:17): [True: 3.77M, False: 0]
  ------------------
 1922|   295k|        case ParseContext::WRAPPED_EXPR: {
  ------------------
  |  Branch (1922:9): [True: 295k, False: 3.47M]
  ------------------
 1923|   295k|            std::optional<size_t> colon_index{};
 1924|  3.83M|            for (size_t i = 1; i < in.size(); ++i) {
  ------------------
  |  Branch (1924:32): [True: 3.83M, False: 433]
  ------------------
 1925|  3.83M|                if (in[i] == ':') {
  ------------------
  |  Branch (1925:21): [True: 196k, False: 3.63M]
  ------------------
 1926|   196k|                    colon_index = i;
 1927|   196k|                    break;
 1928|   196k|                }
 1929|  3.63M|                if (in[i] < 'a' || in[i] > 'z') break;
  ------------------
  |  Branch (1929:21): [True: 98.2k, False: 3.53M]
  |  Branch (1929:36): [True: 16, False: 3.53M]
  ------------------
 1930|  3.63M|            }
 1931|       |            // If there is no colon, this loop won't execute
 1932|   295k|            bool last_was_v{false};
 1933|  3.85M|            for (size_t j = 0; colon_index && j < *colon_index; ++j) {
  ------------------
  |  Branch (1933:32): [True: 3.76M, False: 98.7k]
  |  Branch (1933:47): [True: 3.56M, False: 196k]
  ------------------
 1934|  3.56M|                if (script_size > max_size) return {};
  ------------------
  |  Branch (1934:21): [True: 1, False: 3.56M]
  ------------------
 1935|  3.56M|                if (in[j] == 'a') {
  ------------------
  |  Branch (1935:21): [True: 459k, False: 3.10M]
  ------------------
 1936|   459k|                    script_size += 2;
 1937|   459k|                    to_parse.emplace_back(ParseContext::ALT, -1, -1);
 1938|  3.10M|                } else if (in[j] == 's') {
  ------------------
  |  Branch (1938:28): [True: 28.0k, False: 3.07M]
  ------------------
 1939|  28.0k|                    script_size += 1;
 1940|  28.0k|                    to_parse.emplace_back(ParseContext::SWAP, -1, -1);
 1941|  3.07M|                } else if (in[j] == 'c') {
  ------------------
  |  Branch (1941:28): [True: 832k, False: 2.24M]
  ------------------
 1942|   832k|                    script_size += 1;
 1943|   832k|                    to_parse.emplace_back(ParseContext::CHECK, -1, -1);
 1944|  2.24M|                } else if (in[j] == 'd') {
  ------------------
  |  Branch (1944:28): [True: 144k, False: 2.10M]
  ------------------
 1945|   144k|                    script_size += 3;
 1946|   144k|                    to_parse.emplace_back(ParseContext::DUP_IF, -1, -1);
 1947|  2.10M|                } else if (in[j] == 'j') {
  ------------------
  |  Branch (1947:28): [True: 25.6k, False: 2.07M]
  ------------------
 1948|  25.6k|                    script_size += 4;
 1949|  25.6k|                    to_parse.emplace_back(ParseContext::NON_ZERO, -1, -1);
 1950|  2.07M|                } else if (in[j] == 'n') {
  ------------------
  |  Branch (1950:28): [True: 371k, False: 1.70M]
  ------------------
 1951|   371k|                    script_size += 1;
 1952|   371k|                    to_parse.emplace_back(ParseContext::ZERO_NOTEQUAL, -1, -1);
 1953|  1.70M|                } else if (in[j] == 'v') {
  ------------------
  |  Branch (1953:28): [True: 71.2k, False: 1.63M]
  ------------------
 1954|       |                    // do not permit "...vv...:"; it's not valid, and also doesn't trigger early
 1955|       |                    // failure as script_size isn't incremented.
 1956|  71.2k|                    if (last_was_v) return {};
  ------------------
  |  Branch (1956:25): [True: 1, False: 71.2k]
  ------------------
 1957|  71.2k|                    to_parse.emplace_back(ParseContext::VERIFY, -1, -1);
 1958|  1.63M|                } else if (in[j] == 'u') {
  ------------------
  |  Branch (1958:28): [True: 582k, False: 1.04M]
  ------------------
 1959|   582k|                    script_size += 4;
 1960|   582k|                    to_parse.emplace_back(ParseContext::WRAP_U, -1, -1);
 1961|  1.04M|                } else if (in[j] == 't') {
  ------------------
  |  Branch (1961:28): [True: 214k, False: 834k]
  ------------------
 1962|   214k|                    script_size += 1;
 1963|   214k|                    to_parse.emplace_back(ParseContext::WRAP_T, -1, -1);
 1964|   834k|                } else if (in[j] == 'l') {
  ------------------
  |  Branch (1964:28): [True: 834k, False: 49]
  ------------------
 1965|       |                    // The l: wrapper is equivalent to or_i(0,X)
 1966|   834k|                    script_size += 4;
 1967|   834k|                    constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_0);
 1968|   834k|                    to_parse.emplace_back(ParseContext::OR_I, -1, -1);
 1969|   834k|                } else {
 1970|     49|                    return {};
 1971|     49|                }
 1972|  3.56M|                last_was_v = (in[j] == 'v');
 1973|  3.56M|            }
 1974|   295k|            to_parse.emplace_back(ParseContext::EXPR, -1, -1);
 1975|   295k|            if (colon_index) in = in.subspan(*colon_index + 1);
  ------------------
  |  Branch (1975:17): [True: 196k, False: 98.7k]
  ------------------
 1976|   295k|            break;
 1977|   295k|        }
 1978|   295k|        case ParseContext::EXPR: {
  ------------------
  |  Branch (1978:9): [True: 295k, False: 3.47M]
  ------------------
 1979|   295k|            if (Const("0", in)) {
  ------------------
  |  Branch (1979:17): [True: 54.3k, False: 241k]
  ------------------
 1980|  54.3k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_0);
 1981|   241k|            } else if (Const("1", in)) {
  ------------------
  |  Branch (1981:24): [True: 103k, False: 138k]
  ------------------
 1982|   103k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_1);
 1983|   138k|            } else if (Const("pk(", in, /*skip=*/false)) {
  ------------------
  |  Branch (1983:24): [True: 10.1k, False: 127k]
  ------------------
 1984|  10.1k|                std::optional<Key> key = ParseKey<Key, Ctx>("pk", in, ctx);
 1985|  10.1k|                if (!key) return {};
  ------------------
  |  Branch (1985:21): [True: 58, False: 10.0k]
  ------------------
 1986|  10.0k|                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|  10.0k|                script_size += IsTapscript(ctx.MsContext()) ? 33 : 34;
  ------------------
  |  Branch (1987:32): [True: 9.60k, False: 468]
  ------------------
 1988|   127k|            } else if (Const("pkh(", in, /*skip=*/false)) {
  ------------------
  |  Branch (1988:24): [True: 1.40k, False: 126k]
  ------------------
 1989|  1.40k|                std::optional<Key> key = ParseKey<Key, Ctx>("pkh", in, ctx);
 1990|  1.40k|                if (!key) return {};
  ------------------
  |  Branch (1990:21): [True: 15, False: 1.39k]
  ------------------
 1991|  1.39k|                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|  1.39k|                script_size += 24;
 1993|   126k|            } else if (Const("pk_k(", in, /*skip=*/false)) {
  ------------------
  |  Branch (1993:24): [True: 605, False: 125k]
  ------------------
 1994|    605|                std::optional<Key> key = ParseKey<Key, Ctx>("pk_k", in, ctx);
 1995|    605|                if (!key) return {};
  ------------------
  |  Branch (1995:21): [True: 7, False: 598]
  ------------------
 1996|    598|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::PK_K, Vector(std::move(*key)));
 1997|    598|                script_size += IsTapscript(ctx.MsContext()) ? 32 : 33;
  ------------------
  |  Branch (1997:32): [True: 521, False: 77]
  ------------------
 1998|   125k|            } else if (Const("pk_h(", in, /*skip=*/false)) {
  ------------------
  |  Branch (1998:24): [True: 254, False: 125k]
  ------------------
 1999|    254|                std::optional<Key> key = ParseKey<Key, Ctx>("pk_h", in, ctx);
 2000|    254|                if (!key) return {};
  ------------------
  |  Branch (2000:21): [True: 20, False: 234]
  ------------------
 2001|    234|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::PK_H, Vector(std::move(*key)));
 2002|    234|                script_size += 23;
 2003|   125k|            } else if (Const("sha256(", in, /*skip=*/false)) {
  ------------------
  |  Branch (2003:24): [True: 94, False: 125k]
  ------------------
 2004|     94|                std::optional<std::vector<unsigned char>> hash = ParseHexStr("sha256", in, 32);
 2005|     94|                if (!hash) return {};
  ------------------
  |  Branch (2005:21): [True: 17, False: 77]
  ------------------
 2006|     77|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::SHA256, std::move(*hash));
 2007|     77|                script_size += 38;
 2008|   125k|            } else if (Const("ripemd160(", in, /*skip=*/false)) {
  ------------------
  |  Branch (2008:24): [True: 290, False: 125k]
  ------------------
 2009|    290|                std::optional<std::vector<unsigned char>> hash = ParseHexStr("ripemd160", in, 20);
 2010|    290|                if (!hash) return {};
  ------------------
  |  Branch (2010:21): [True: 4, False: 286]
  ------------------
 2011|    286|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::RIPEMD160, std::move(*hash));
 2012|    286|                script_size += 26;
 2013|   125k|            } else if (Const("hash256(", in, /*skip=*/false)) {
  ------------------
  |  Branch (2013:24): [True: 119, False: 125k]
  ------------------
 2014|    119|                std::optional<std::vector<unsigned char>> hash = ParseHexStr("hash256", in, 32);
 2015|    119|                if (!hash) return {};
  ------------------
  |  Branch (2015:21): [True: 2, False: 117]
  ------------------
 2016|    117|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::HASH256, std::move(*hash));
 2017|    117|                script_size += 38;
 2018|   125k|            } else if (Const("hash160(", in, /*skip=*/false)) {
  ------------------
  |  Branch (2018:24): [True: 506, False: 124k]
  ------------------
 2019|    506|                std::optional<std::vector<unsigned char>> hash = ParseHexStr("hash160", in, 20);
 2020|    506|                if (!hash) return {};
  ------------------
  |  Branch (2020:21): [True: 19, False: 487]
  ------------------
 2021|    487|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::HASH160, std::move(*hash));
 2022|    487|                script_size += 26;
 2023|   124k|            } else if (Const("after(", in, /*skip=*/false)) {
  ------------------
  |  Branch (2023:24): [True: 11.4k, False: 113k]
  ------------------
 2024|  11.4k|                auto expr = Expr(in);
 2025|  11.4k|                if (!Func("after", expr)) return {};
  ------------------
  |  Branch (2025:21): [True: 13, False: 11.4k]
  ------------------
 2026|  11.4k|                const auto num{ToIntegral<int64_t>(std::string_view(expr.begin(), expr.end()))};
 2027|  11.4k|                if (!num.has_value() || *num < 1 || *num >= 0x80000000L) return {};
  ------------------
  |  Branch (2027:21): [True: 73, False: 11.3k]
  |  Branch (2027:41): [True: 117, False: 11.2k]
  |  Branch (2027:53): [True: 29, False: 11.2k]
  ------------------
 2028|  11.2k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::AFTER, *num);
 2029|  11.2k|                script_size += 1 + (*num > 16) + (*num > 0x7f) + (*num > 0x7fff) + (*num > 0x7fffff);
 2030|   113k|            } else if (Const("older(", in, /*skip=*/false)) {
  ------------------
  |  Branch (2030:24): [True: 9.51k, False: 103k]
  ------------------
 2031|  9.51k|                auto expr = Expr(in);
 2032|  9.51k|                if (!Func("older", expr)) return {};
  ------------------
  |  Branch (2032:21): [True: 10, False: 9.50k]
  ------------------
 2033|  9.50k|                const auto num{ToIntegral<int64_t>(std::string_view(expr.begin(), expr.end()))};
 2034|  9.50k|                if (!num.has_value() || *num < 1 || *num >= 0x80000000L) return {};
  ------------------
  |  Branch (2034:21): [True: 54, False: 9.45k]
  |  Branch (2034:41): [True: 80, False: 9.37k]
  |  Branch (2034:53): [True: 49, False: 9.32k]
  ------------------
 2035|  9.32k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::OLDER, *num);
 2036|  9.32k|                script_size += 1 + (*num > 16) + (*num > 0x7f) + (*num > 0x7fff) + (*num > 0x7fffff);
 2037|   103k|            } else if (Const("multi(", in)) {
  ------------------
  |  Branch (2037:24): [True: 1.02k, False: 102k]
  ------------------
 2038|  1.02k|                if (!parse_multi_exp(in, /* is_multi_a = */false)) return {};
  ------------------
  |  Branch (2038:21): [True: 133, False: 896]
  ------------------
 2039|   102k|            } else if (Const("multi_a(", in)) {
  ------------------
  |  Branch (2039:24): [True: 762, False: 101k]
  ------------------
 2040|    762|                if (!parse_multi_exp(in, /* is_multi_a = */true)) return {};
  ------------------
  |  Branch (2040:21): [True: 359, False: 403]
  ------------------
 2041|   101k|            } else if (Const("thresh(", in)) {
  ------------------
  |  Branch (2041:24): [True: 30.7k, False: 71.1k]
  ------------------
 2042|  30.7k|                int next_comma = FindNextChar(in, ',');
 2043|  30.7k|                if (next_comma < 1) return {};
  ------------------
  |  Branch (2043:21): [True: 9, False: 30.6k]
  ------------------
 2044|  30.6k|                const auto k{ToIntegral<int64_t>(std::string_view(in.data(), next_comma))};
 2045|  30.6k|                if (!k.has_value() || *k < 1) return {};
  ------------------
  |  Branch (2045:21): [True: 22, False: 30.6k]
  |  Branch (2045:39): [True: 76, False: 30.5k]
  ------------------
 2046|  30.5k|                in = in.subspan(next_comma + 1);
 2047|       |                // n = 1 here because we read the first WRAPPED_EXPR before reaching THRESH
 2048|  30.5k|                to_parse.emplace_back(ParseContext::THRESH, 1, *k);
 2049|  30.5k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2050|  30.5k|                script_size += 2 + (*k > 16) + (*k > 0x7f) + (*k > 0x7fff) + (*k > 0x7fffff);
 2051|  71.1k|            } else if (Const("andor(", in)) {
  ------------------
  |  Branch (2051:24): [True: 6.75k, False: 64.4k]
  ------------------
 2052|  6.75k|                to_parse.emplace_back(ParseContext::ANDOR, -1, -1);
 2053|  6.75k|                to_parse.emplace_back(ParseContext::CLOSE_BRACKET, -1, -1);
 2054|  6.75k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2055|  6.75k|                to_parse.emplace_back(ParseContext::COMMA, -1, -1);
 2056|  6.75k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2057|  6.75k|                to_parse.emplace_back(ParseContext::COMMA, -1, -1);
 2058|  6.75k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2059|  6.75k|                script_size += 5;
 2060|  64.4k|            } else {
 2061|  64.4k|                if (Const("and_n(", in)) {
  ------------------
  |  Branch (2061:21): [True: 6.28k, False: 58.1k]
  ------------------
 2062|  6.28k|                    to_parse.emplace_back(ParseContext::AND_N, -1, -1);
 2063|  6.28k|                    script_size += 5;
 2064|  58.1k|                } else if (Const("and_b(", in)) {
  ------------------
  |  Branch (2064:28): [True: 11.3k, False: 46.8k]
  ------------------
 2065|  11.3k|                    to_parse.emplace_back(ParseContext::AND_B, -1, -1);
 2066|  11.3k|                    script_size += 2;
 2067|  46.8k|                } else if (Const("and_v(", in)) {
  ------------------
  |  Branch (2067:28): [True: 3.49k, False: 43.3k]
  ------------------
 2068|  3.49k|                    to_parse.emplace_back(ParseContext::AND_V, -1, -1);
 2069|  3.49k|                    script_size += 1;
 2070|  43.3k|                } else if (Const("or_b(", in)) {
  ------------------
  |  Branch (2070:28): [True: 8.45k, False: 34.9k]
  ------------------
 2071|  8.45k|                    to_parse.emplace_back(ParseContext::OR_B, -1, -1);
 2072|  8.45k|                    script_size += 2;
 2073|  34.9k|                } else if (Const("or_c(", in)) {
  ------------------
  |  Branch (2073:28): [True: 5.30k, False: 29.5k]
  ------------------
 2074|  5.30k|                    to_parse.emplace_back(ParseContext::OR_C, -1, -1);
 2075|  5.30k|                    script_size += 3;
 2076|  29.5k|                } else if (Const("or_d(", in)) {
  ------------------
  |  Branch (2076:28): [True: 4.10k, False: 25.4k]
  ------------------
 2077|  4.10k|                    to_parse.emplace_back(ParseContext::OR_D, -1, -1);
 2078|  4.10k|                    script_size += 4;
 2079|  25.4k|                } else if (Const("or_i(", in)) {
  ------------------
  |  Branch (2079:28): [True: 24.5k, False: 930]
  ------------------
 2080|  24.5k|                    to_parse.emplace_back(ParseContext::OR_I, -1, -1);
 2081|  24.5k|                    script_size += 4;
 2082|  24.5k|                } else {
 2083|    930|                    return {};
 2084|    930|                }
 2085|  63.5k|                to_parse.emplace_back(ParseContext::CLOSE_BRACKET, -1, -1);
 2086|  63.5k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2087|  63.5k|                to_parse.emplace_back(ParseContext::COMMA, -1, -1);
 2088|  63.5k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2089|  63.5k|            }
 2090|   293k|            break;
 2091|   295k|        }
 2092|   293k|        case ParseContext::ALT: {
  ------------------
  |  Branch (2092:9): [True: 55.1k, False: 3.71M]
  ------------------
 2093|  55.1k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_A, Vector(std::move(constructed.back()))};
 2094|  55.1k|            break;
 2095|   295k|        }
 2096|  18.8k|        case ParseContext::SWAP: {
  ------------------
  |  Branch (2096:9): [True: 18.8k, False: 3.75M]
  ------------------
 2097|  18.8k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_S, Vector(std::move(constructed.back()))};
 2098|  18.8k|            break;
 2099|   295k|        }
 2100|   810k|        case ParseContext::CHECK: {
  ------------------
  |  Branch (2100:9): [True: 810k, False: 2.95M]
  ------------------
 2101|   810k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_C, Vector(std::move(constructed.back()))};
 2102|   810k|            break;
 2103|   295k|        }
 2104|   137k|        case ParseContext::DUP_IF: {
  ------------------
  |  Branch (2104:9): [True: 137k, False: 3.63M]
  ------------------
 2105|   137k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_D, Vector(std::move(constructed.back()))};
 2106|   137k|            break;
 2107|   295k|        }
 2108|  22.5k|        case ParseContext::NON_ZERO: {
  ------------------
  |  Branch (2108:9): [True: 22.5k, False: 3.74M]
  ------------------
 2109|  22.5k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_J, Vector(std::move(constructed.back()))};
 2110|  22.5k|            break;
 2111|   295k|        }
 2112|   339k|        case ParseContext::ZERO_NOTEQUAL: {
  ------------------
  |  Branch (2112:9): [True: 339k, False: 3.43M]
  ------------------
 2113|   339k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_N, Vector(std::move(constructed.back()))};
 2114|   339k|            break;
 2115|   295k|        }
 2116|  70.5k|        case ParseContext::VERIFY: {
  ------------------
  |  Branch (2116:9): [True: 70.5k, False: 3.70M]
  ------------------
 2117|  70.5k|            script_size += (constructed.back().GetType() << "x"_mst);
 2118|  70.5k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_V, Vector(std::move(constructed.back()))};
 2119|  70.5k|            break;
 2120|   295k|        }
 2121|   577k|        case ParseContext::WRAP_U: {
  ------------------
  |  Branch (2121:9): [True: 577k, False: 3.19M]
  ------------------
 2122|   577k|            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|   577k|            break;
 2124|   295k|        }
 2125|   209k|        case ParseContext::WRAP_T: {
  ------------------
  |  Branch (2125:9): [True: 209k, False: 3.56M]
  ------------------
 2126|   209k|            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|   209k|            break;
 2128|   295k|        }
 2129|  8.72k|        case ParseContext::AND_B: {
  ------------------
  |  Branch (2129:9): [True: 8.72k, False: 3.76M]
  ------------------
 2130|  8.72k|            BuildBack(ctx.MsContext(), Fragment::AND_B, constructed);
 2131|  8.72k|            break;
 2132|   295k|        }
 2133|  4.45k|        case ParseContext::AND_N: {
  ------------------
  |  Branch (2133:9): [True: 4.45k, False: 3.76M]
  ------------------
 2134|  4.45k|            auto mid = std::move(constructed.back());
 2135|  4.45k|            constructed.pop_back();
 2136|  4.45k|            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|  4.45k|            break;
 2138|   295k|        }
 2139|  2.53k|        case ParseContext::AND_V: {
  ------------------
  |  Branch (2139:9): [True: 2.53k, False: 3.76M]
  ------------------
 2140|  2.53k|            BuildBack(ctx.MsContext(), Fragment::AND_V, constructed);
 2141|  2.53k|            break;
 2142|   295k|        }
 2143|  5.07k|        case ParseContext::OR_B: {
  ------------------
  |  Branch (2143:9): [True: 5.07k, False: 3.76M]
  ------------------
 2144|  5.07k|            BuildBack(ctx.MsContext(), Fragment::OR_B, constructed);
 2145|  5.07k|            break;
 2146|   295k|        }
 2147|  3.81k|        case ParseContext::OR_C: {
  ------------------
  |  Branch (2147:9): [True: 3.81k, False: 3.76M]
  ------------------
 2148|  3.81k|            BuildBack(ctx.MsContext(), Fragment::OR_C, constructed);
 2149|  3.81k|            break;
 2150|   295k|        }
 2151|  3.02k|        case ParseContext::OR_D: {
  ------------------
  |  Branch (2151:9): [True: 3.02k, False: 3.76M]
  ------------------
 2152|  3.02k|            BuildBack(ctx.MsContext(), Fragment::OR_D, constructed);
 2153|  3.02k|            break;
 2154|   295k|        }
 2155|   662k|        case ParseContext::OR_I: {
  ------------------
  |  Branch (2155:9): [True: 662k, False: 3.10M]
  ------------------
 2156|   662k|            BuildBack(ctx.MsContext(), Fragment::OR_I, constructed);
 2157|   662k|            break;
 2158|   295k|        }
 2159|  3.32k|        case ParseContext::ANDOR: {
  ------------------
  |  Branch (2159:9): [True: 3.32k, False: 3.76M]
  ------------------
 2160|  3.32k|            auto right = std::move(constructed.back());
 2161|  3.32k|            constructed.pop_back();
 2162|  3.32k|            auto mid = std::move(constructed.back());
 2163|  3.32k|            constructed.pop_back();
 2164|  3.32k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::ANDOR, Vector(std::move(constructed.back()), std::move(mid), std::move(right))};
 2165|  3.32k|            break;
 2166|   295k|        }
 2167|   166k|        case ParseContext::THRESH: {
  ------------------
  |  Branch (2167:9): [True: 166k, False: 3.60M]
  ------------------
 2168|   166k|            if (in.size() < 1) return {};
  ------------------
  |  Branch (2168:17): [True: 91, False: 166k]
  ------------------
 2169|   166k|            if (in[0] == ',') {
  ------------------
  |  Branch (2169:17): [True: 141k, False: 24.5k]
  ------------------
 2170|   141k|                in = in.subspan(1);
 2171|   141k|                to_parse.emplace_back(ParseContext::THRESH, n+1, k);
 2172|   141k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2173|   141k|                script_size += 2;
 2174|   141k|            } else if (in[0] == ')') {
  ------------------
  |  Branch (2174:24): [True: 24.4k, False: 33]
  ------------------
 2175|  24.4k|                if (k > n) return {};
  ------------------
  |  Branch (2175:21): [True: 85, False: 24.4k]
  ------------------
 2176|  24.4k|                in = in.subspan(1);
 2177|       |                // Children are constructed in reverse order, so iterate from end to beginning
 2178|  24.4k|                std::vector<Node<Key>> subs;
 2179|   174k|                for (int i = 0; i < n; ++i) {
  ------------------
  |  Branch (2179:33): [True: 150k, False: 24.4k]
  ------------------
 2180|   150k|                    subs.push_back(std::move(constructed.back()));
 2181|   150k|                    constructed.pop_back();
 2182|   150k|                }
 2183|  24.4k|                std::reverse(subs.begin(), subs.end());
 2184|  24.4k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::THRESH, std::move(subs), k);
 2185|  24.4k|            } else {
 2186|     33|                return {};
 2187|     33|            }
 2188|   166k|            break;
 2189|   166k|        }
 2190|   166k|        case ParseContext::COMMA: {
  ------------------
  |  Branch (2190:9): [True: 44.8k, False: 3.72M]
  ------------------
 2191|  44.8k|            if (in.size() < 1 || in[0] != ',') return {};
  ------------------
  |  Branch (2191:17): [True: 23, False: 44.8k]
  |  Branch (2191:34): [True: 144, False: 44.6k]
  ------------------
 2192|  44.6k|            in = in.subspan(1);
 2193|  44.6k|            break;
 2194|  44.8k|        }
 2195|  33.0k|        case ParseContext::CLOSE_BRACKET: {
  ------------------
  |  Branch (2195:9): [True: 33.0k, False: 3.73M]
  ------------------
 2196|  33.0k|            if (in.size() < 1 || in[0] != ')') return {};
  ------------------
  |  Branch (2196:17): [True: 87, False: 33.0k]
  |  Branch (2196:34): [True: 49, False: 32.9k]
  ------------------
 2197|  32.9k|            in = in.subspan(1);
 2198|  32.9k|            break;
 2199|  33.0k|        }
 2200|  3.77M|        }
 2201|  3.77M|    }
 2202|       |
 2203|       |    // Sanity checks on the produced miniscript
 2204|  8.23k|    assert(constructed.size() >= 1);
  ------------------
  |  Branch (2204:5): [True: 5.57k, False: 0]
  ------------------
 2205|  5.57k|    CHECK_NONFATAL(constructed.size() == 1);
  ------------------
  |  |  113|  5.57k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
 2206|  5.57k|    assert(constructed[0].ScriptSize() == script_size);
  ------------------
  |  Branch (2206:5): [True: 5.57k, False: 0]
  ------------------
 2207|  5.57k|    if (in.size() > 0) return {};
  ------------------
  |  Branch (2207:9): [True: 60, False: 5.51k]
  ------------------
 2208|  5.51k|    Node<Key> tl_node{std::move(constructed.front())};
 2209|  5.51k|    tl_node.DuplicateKeyCheck(ctx);
 2210|  5.51k|    return tl_node;
 2211|  5.57k|}
descriptor.cpp:_ZN10miniscript8internal8ParseKeyIjN12_GLOBAL__N_19KeyParserEEENSt3__18optionalIT_EERKNS4_12basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEERNS4_4spanIKcLm18446744073709551615EEERKT0_:
 1817|  12.3k|{
 1818|  12.3k|    std::span<const char> expr = script::Expr(in);
 1819|  12.3k|    if (!script::Func(func, expr)) return {};
  ------------------
  |  Branch (1819:9): [True: 48, False: 12.3k]
  ------------------
 1820|  12.3k|    return ctx.FromString(expr);
 1821|  12.3k|}
_ZN10miniscript4NodeIjEC2ENS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentENSt3__16vectorIjNS6_9allocatorIjEEEEj:
 1727|  18.3k|        : fragment(nt), k(val), keys(std::move(key)), m_script_ctx{script_ctx}, ops(CalcOps()), ss(CalcStackSize()), ws(CalcWitnessSize()), typ(CalcType()), scriptlen(CalcScriptLen()) {}
_ZNK10miniscript4NodeIjE7CalcOpsEv:
 1004|  5.04M|    internal::Ops CalcOps() const {
 1005|  5.04M|        switch (fragment) {
  ------------------
  |  Branch (1005:17): [True: 5.04M, False: 0]
  ------------------
 1006|   323k|            case Fragment::JUST_1: return {0, 0, {}};
  ------------------
  |  Branch (1006:13): [True: 323k, False: 4.71M]
  ------------------
 1007|  1.54M|            case Fragment::JUST_0: return {0, {}, 0};
  ------------------
  |  Branch (1007:13): [True: 1.54M, False: 3.49M]
  ------------------
 1008|  14.3k|            case Fragment::PK_K: return {0, 0, 0};
  ------------------
  |  Branch (1008:13): [True: 14.3k, False: 5.02M]
  ------------------
 1009|  3.86k|            case Fragment::PK_H: return {3, 0, 0};
  ------------------
  |  Branch (1009:13): [True: 3.86k, False: 5.03M]
  ------------------
 1010|  9.73k|            case Fragment::OLDER:
  ------------------
  |  Branch (1010:13): [True: 9.73k, False: 5.03M]
  ------------------
 1011|  21.1k|            case Fragment::AFTER: return {1, 0, {}};
  ------------------
  |  Branch (1011:13): [True: 11.3k, False: 5.02M]
  ------------------
 1012|     79|            case Fragment::SHA256:
  ------------------
  |  Branch (1012:13): [True: 79, False: 5.04M]
  ------------------
 1013|    369|            case Fragment::RIPEMD160:
  ------------------
  |  Branch (1013:13): [True: 290, False: 5.04M]
  ------------------
 1014|    507|            case Fragment::HASH256:
  ------------------
  |  Branch (1014:13): [True: 138, False: 5.04M]
  ------------------
 1015|  1.00k|            case Fragment::HASH160: return {4, 0, {}};
  ------------------
  |  Branch (1015:13): [True: 499, False: 5.04M]
  ------------------
 1016|   223k|            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: 223k, False: 4.81M]
  ------------------
 1017|  8.73k|            case Fragment::AND_B: {
  ------------------
  |  Branch (1017:13): [True: 8.73k, False: 5.03M]
  ------------------
 1018|  8.73k|                const auto count{1 + subs[0].ops.count + subs[1].ops.count};
 1019|  8.73k|                const auto sat{subs[0].ops.sat + subs[1].ops.sat};
 1020|  8.73k|                const auto dsat{subs[0].ops.dsat + subs[1].ops.dsat};
 1021|  8.73k|                return {count, sat, dsat};
 1022|    507|            }
 1023|  5.10k|            case Fragment::OR_B: {
  ------------------
  |  Branch (1023:13): [True: 5.10k, False: 5.03M]
  ------------------
 1024|  5.10k|                const auto count{1 + subs[0].ops.count + subs[1].ops.count};
 1025|  5.10k|                const auto sat{(subs[0].ops.sat + subs[1].ops.dsat) | (subs[1].ops.sat + subs[0].ops.dsat)};
 1026|  5.10k|                const auto dsat{subs[0].ops.dsat + subs[1].ops.dsat};
 1027|  5.10k|                return {count, sat, dsat};
 1028|    507|            }
 1029|  3.09k|            case Fragment::OR_D: {
  ------------------
  |  Branch (1029:13): [True: 3.09k, False: 5.03M]
  ------------------
 1030|  3.09k|                const auto count{3 + subs[0].ops.count + subs[1].ops.count};
 1031|  3.09k|                const auto sat{subs[0].ops.sat | (subs[1].ops.sat + subs[0].ops.dsat)};
 1032|  3.09k|                const auto dsat{subs[0].ops.dsat + subs[1].ops.dsat};
 1033|  3.09k|                return {count, sat, dsat};
 1034|    507|            }
 1035|  3.90k|            case Fragment::OR_C: {
  ------------------
  |  Branch (1035:13): [True: 3.90k, False: 5.03M]
  ------------------
 1036|  3.90k|                const auto count{2 + subs[0].ops.count + subs[1].ops.count};
 1037|  3.90k|                const auto sat{subs[0].ops.sat | (subs[1].ops.sat + subs[0].ops.dsat)};
 1038|  3.90k|                return {count, sat, {}};
 1039|    507|            }
 1040|  1.31M|            case Fragment::OR_I: {
  ------------------
  |  Branch (1040:13): [True: 1.31M, False: 3.72M]
  ------------------
 1041|  1.31M|                const auto count{3 + subs[0].ops.count + subs[1].ops.count};
 1042|  1.31M|                const auto sat{subs[0].ops.sat | subs[1].ops.sat};
 1043|  1.31M|                const auto dsat{subs[0].ops.dsat | subs[1].ops.dsat};
 1044|  1.31M|                return {count, sat, dsat};
 1045|    507|            }
 1046|  8.30k|            case Fragment::ANDOR: {
  ------------------
  |  Branch (1046:13): [True: 8.30k, False: 5.03M]
  ------------------
 1047|  8.30k|                const auto count{3 + subs[0].ops.count + subs[1].ops.count + subs[2].ops.count};
 1048|  8.30k|                const auto sat{(subs[1].ops.sat + subs[0].ops.sat) | (subs[0].ops.dsat + subs[2].ops.sat)};
 1049|  8.30k|                const auto dsat{subs[0].ops.dsat + subs[2].ops.dsat};
 1050|  8.30k|                return {count, sat, dsat};
 1051|    507|            }
 1052|  4.15k|            case Fragment::MULTI: return {1, (uint32_t)keys.size(), (uint32_t)keys.size()};
  ------------------
  |  Branch (1052:13): [True: 4.15k, False: 5.03M]
  ------------------
 1053|  2.50k|            case Fragment::MULTI_A: return {(uint32_t)keys.size() + 1, 0, 0};
  ------------------
  |  Branch (1053:13): [True: 2.50k, False: 5.03M]
  ------------------
 1054|  19.0k|            case Fragment::WRAP_S:
  ------------------
  |  Branch (1054:13): [True: 19.0k, False: 5.02M]
  ------------------
 1055|   847k|            case Fragment::WRAP_C:
  ------------------
  |  Branch (1055:13): [True: 828k, False: 4.21M]
  ------------------
 1056|  1.23M|            case Fragment::WRAP_N: return {1 + subs[0].ops.count, subs[0].ops.sat, subs[0].ops.dsat};
  ------------------
  |  Branch (1056:13): [True: 384k, False: 4.65M]
  ------------------
 1057|  55.9k|            case Fragment::WRAP_A: return {2 + subs[0].ops.count, subs[0].ops.sat, subs[0].ops.dsat};
  ------------------
  |  Branch (1057:13): [True: 55.9k, False: 4.98M]
  ------------------
 1058|   137k|            case Fragment::WRAP_D: return {3 + subs[0].ops.count, subs[0].ops.sat, 0};
  ------------------
  |  Branch (1058:13): [True: 137k, False: 4.90M]
  ------------------
 1059|  26.8k|            case Fragment::WRAP_J: return {4 + subs[0].ops.count, subs[0].ops.sat, 0};
  ------------------
  |  Branch (1059:13): [True: 26.8k, False: 5.01M]
  ------------------
 1060|  82.3k|            case Fragment::WRAP_V: return {subs[0].ops.count + (subs[0].GetType() << "x"_mst), subs[0].ops.sat, {}};
  ------------------
  |  Branch (1060:13): [True: 82.3k, False: 4.95M]
  ------------------
 1061|  24.8k|            case Fragment::THRESH: {
  ------------------
  |  Branch (1061:13): [True: 24.8k, False: 5.01M]
  ------------------
 1062|  24.8k|                uint32_t count = 0;
 1063|  24.8k|                auto sats = Vector(internal::MaxInt<uint32_t>(0));
 1064|   151k|                for (const auto& sub : subs) {
  ------------------
  |  Branch (1064:38): [True: 151k, False: 24.8k]
  ------------------
 1065|   151k|                    count += sub.ops.count + 1;
 1066|   151k|                    auto next_sats = Vector(sats[0] + sub.ops.dsat);
 1067|  10.0M|                    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: 9.86M, False: 151k]
  ------------------
 1068|   151k|                    next_sats.push_back(sats[sats.size() - 1] + sub.ops.sat);
 1069|   151k|                    sats = std::move(next_sats);
 1070|   151k|                }
 1071|  24.8k|                assert(k < sats.size());
  ------------------
  |  Branch (1071:17): [True: 24.8k, False: 0]
  ------------------
 1072|  24.8k|                return {count, sats[k], sats[0]};
 1073|  24.8k|            }
 1074|  5.04M|        }
 1075|  5.04M|        assert(false);
  ------------------
  |  Branch (1075:9): [Folded, False: 0]
  ------------------
 1076|      0|    }
_ZNK10miniscript4NodeIjE13CalcStackSizeEv:
 1078|  5.04M|    internal::StackSize CalcStackSize() const {
 1079|  5.04M|        using namespace internal;
 1080|  5.04M|        switch (fragment) {
  ------------------
  |  Branch (1080:17): [True: 5.04M, False: 0]
  ------------------
 1081|  1.54M|            case Fragment::JUST_0: return {{}, SatInfo::Push()};
  ------------------
  |  Branch (1081:13): [True: 1.54M, False: 3.49M]
  ------------------
 1082|   323k|            case Fragment::JUST_1: return {SatInfo::Push(), {}};
  ------------------
  |  Branch (1082:13): [True: 323k, False: 4.71M]
  ------------------
 1083|  9.73k|            case Fragment::OLDER:
  ------------------
  |  Branch (1083:13): [True: 9.73k, False: 5.03M]
  ------------------
 1084|  21.1k|            case Fragment::AFTER: return {SatInfo::Push() + SatInfo::Nop(), {}};
  ------------------
  |  Branch (1084:13): [True: 11.3k, False: 5.02M]
  ------------------
 1085|  14.3k|            case Fragment::PK_K: return {SatInfo::Push()};
  ------------------
  |  Branch (1085:13): [True: 14.3k, False: 5.02M]
  ------------------
 1086|  3.86k|            case Fragment::PK_H: return {SatInfo::OP_DUP() + SatInfo::Hash() + SatInfo::Push() + SatInfo::OP_EQUALVERIFY()};
  ------------------
  |  Branch (1086:13): [True: 3.86k, False: 5.03M]
  ------------------
 1087|     79|            case Fragment::SHA256:
  ------------------
  |  Branch (1087:13): [True: 79, False: 5.04M]
  ------------------
 1088|    369|            case Fragment::RIPEMD160:
  ------------------
  |  Branch (1088:13): [True: 290, False: 5.04M]
  ------------------
 1089|    507|            case Fragment::HASH256:
  ------------------
  |  Branch (1089:13): [True: 138, False: 5.04M]
  ------------------
 1090|  1.00k|            case Fragment::HASH160: return {
  ------------------
  |  Branch (1090:13): [True: 499, False: 5.04M]
  ------------------
 1091|  1.00k|                SatInfo::OP_SIZE() + SatInfo::Push() + SatInfo::OP_EQUALVERIFY() + SatInfo::Hash() + SatInfo::Push() + SatInfo::OP_EQUAL(),
 1092|  1.00k|                {}
 1093|  1.00k|            };
 1094|  8.30k|            case Fragment::ANDOR: {
  ------------------
  |  Branch (1094:13): [True: 8.30k, False: 5.03M]
  ------------------
 1095|  8.30k|                const auto& x{subs[0].ss};
 1096|  8.30k|                const auto& y{subs[1].ss};
 1097|  8.30k|                const auto& z{subs[2].ss};
 1098|  8.30k|                return {
 1099|  8.30k|                    (x.Sat() + SatInfo::If() + y.Sat()) | (x.Dsat() + SatInfo::If() + z.Sat()),
 1100|  8.30k|                    x.Dsat() + SatInfo::If() + z.Dsat()
 1101|  8.30k|                };
 1102|    507|            }
 1103|   223k|            case Fragment::AND_V: {
  ------------------
  |  Branch (1103:13): [True: 223k, False: 4.81M]
  ------------------
 1104|   223k|                const auto& x{subs[0].ss};
 1105|   223k|                const auto& y{subs[1].ss};
 1106|   223k|                return {x.Sat() + y.Sat(), {}};
 1107|    507|            }
 1108|  8.73k|            case Fragment::AND_B: {
  ------------------
  |  Branch (1108:13): [True: 8.73k, False: 5.03M]
  ------------------
 1109|  8.73k|                const auto& x{subs[0].ss};
 1110|  8.73k|                const auto& y{subs[1].ss};
 1111|  8.73k|                return {x.Sat() + y.Sat() + SatInfo::BinaryOp(), x.Dsat() + y.Dsat() + SatInfo::BinaryOp()};
 1112|    507|            }
 1113|  5.10k|            case Fragment::OR_B: {
  ------------------
  |  Branch (1113:13): [True: 5.10k, False: 5.03M]
  ------------------
 1114|  5.10k|                const auto& x{subs[0].ss};
 1115|  5.10k|                const auto& y{subs[1].ss};
 1116|  5.10k|                return {
 1117|  5.10k|                    ((x.Sat() + y.Dsat()) | (x.Dsat() + y.Sat())) + SatInfo::BinaryOp(),
 1118|  5.10k|                    x.Dsat() + y.Dsat() + SatInfo::BinaryOp()
 1119|  5.10k|                };
 1120|    507|            }
 1121|  3.90k|            case Fragment::OR_C: {
  ------------------
  |  Branch (1121:13): [True: 3.90k, False: 5.03M]
  ------------------
 1122|  3.90k|                const auto& x{subs[0].ss};
 1123|  3.90k|                const auto& y{subs[1].ss};
 1124|  3.90k|                return {(x.Sat() + SatInfo::If()) | (x.Dsat() + SatInfo::If() + y.Sat()), {}};
 1125|    507|            }
 1126|  3.09k|            case Fragment::OR_D: {
  ------------------
  |  Branch (1126:13): [True: 3.09k, False: 5.03M]
  ------------------
 1127|  3.09k|                const auto& x{subs[0].ss};
 1128|  3.09k|                const auto& y{subs[1].ss};
 1129|  3.09k|                return {
 1130|  3.09k|                    (x.Sat() + SatInfo::OP_IFDUP(true) + SatInfo::If()) | (x.Dsat() + SatInfo::OP_IFDUP(false) + SatInfo::If() + y.Sat()),
 1131|  3.09k|                    x.Dsat() + SatInfo::OP_IFDUP(false) + SatInfo::If() + y.Dsat()
 1132|  3.09k|                };
 1133|    507|            }
 1134|  1.31M|            case Fragment::OR_I: {
  ------------------
  |  Branch (1134:13): [True: 1.31M, False: 3.72M]
  ------------------
 1135|  1.31M|                const auto& x{subs[0].ss};
 1136|  1.31M|                const auto& y{subs[1].ss};
 1137|  1.31M|                return {SatInfo::If() + (x.Sat() | y.Sat()), SatInfo::If() + (x.Dsat() | y.Dsat())};
 1138|    507|            }
 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|  4.15k|            case Fragment::MULTI: return {SatInfo(k, k + keys.size() + 2)};
  ------------------
  |  Branch (1143:13): [True: 4.15k, False: 5.03M]
  ------------------
 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|  2.50k|            case Fragment::MULTI_A: return {SatInfo(keys.size() - 1, keys.size())};
  ------------------
  |  Branch (1147:13): [True: 2.50k, False: 5.03M]
  ------------------
 1148|  55.9k|            case Fragment::WRAP_A:
  ------------------
  |  Branch (1148:13): [True: 55.9k, False: 4.98M]
  ------------------
 1149|   440k|            case Fragment::WRAP_N:
  ------------------
  |  Branch (1149:13): [True: 384k, False: 4.65M]
  ------------------
 1150|   459k|            case Fragment::WRAP_S: return subs[0].ss;
  ------------------
  |  Branch (1150:13): [True: 19.0k, False: 5.02M]
  ------------------
 1151|   828k|            case Fragment::WRAP_C: return {
  ------------------
  |  Branch (1151:13): [True: 828k, False: 4.21M]
  ------------------
 1152|   828k|                subs[0].ss.Sat() + SatInfo::OP_CHECKSIG(),
 1153|   828k|                subs[0].ss.Dsat() + SatInfo::OP_CHECKSIG()
 1154|   828k|            };
 1155|   137k|            case Fragment::WRAP_D: return {
  ------------------
  |  Branch (1155:13): [True: 137k, False: 4.90M]
  ------------------
 1156|   137k|                SatInfo::OP_DUP() + SatInfo::If() + subs[0].ss.Sat(),
 1157|   137k|                SatInfo::OP_DUP() + SatInfo::If()
 1158|   137k|            };
 1159|  82.3k|            case Fragment::WRAP_V: return {subs[0].ss.Sat() + SatInfo::OP_VERIFY(), {}};
  ------------------
  |  Branch (1159:13): [True: 82.3k, False: 4.95M]
  ------------------
 1160|  26.8k|            case Fragment::WRAP_J: return {
  ------------------
  |  Branch (1160:13): [True: 26.8k, False: 5.01M]
  ------------------
 1161|  26.8k|                SatInfo::OP_SIZE() + SatInfo::OP_0NOTEQUAL() + SatInfo::If() + subs[0].ss.Sat(),
 1162|  26.8k|                SatInfo::OP_SIZE() + SatInfo::OP_0NOTEQUAL() + SatInfo::If()
 1163|  26.8k|            };
 1164|  24.8k|            case Fragment::THRESH: {
  ------------------
  |  Branch (1164:13): [True: 24.8k, False: 5.01M]
  ------------------
 1165|       |                // sats[j] is the SatInfo corresponding to all traces reaching j satisfactions.
 1166|  24.8k|                auto sats = Vector(SatInfo::Empty());
 1167|   176k|                for (size_t i = 0; i < subs.size(); ++i) {
  ------------------
  |  Branch (1167:36): [True: 151k, False: 24.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|   151k|                    auto add = i ? SatInfo::BinaryOp() : SatInfo::Empty();
  ------------------
  |  Branch (1170:32): [True: 126k, False: 24.8k]
  ------------------
 1171|       |                    // Construct a variable that will become the next sats, starting with index 0.
 1172|   151k|                    auto next_sats = Vector(sats[0] + subs[i].ss.Dsat() + add);
 1173|       |                    // Then loop to construct next_sats[1..i].
 1174|  10.0M|                    for (size_t j = 1; j < sats.size(); ++j) {
  ------------------
  |  Branch (1174:40): [True: 9.86M, False: 151k]
  ------------------
 1175|  9.86M|                        next_sats.push_back(((sats[j] + subs[i].ss.Dsat()) | (sats[j - 1] + subs[i].ss.Sat())) + add);
 1176|  9.86M|                    }
 1177|       |                    // Finally construct next_sats[i+1].
 1178|   151k|                    next_sats.push_back(sats[sats.size() - 1] + subs[i].ss.Sat() + add);
 1179|       |                    // Switch over.
 1180|   151k|                    sats = std::move(next_sats);
 1181|   151k|                }
 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|  24.8k|                return {
 1185|  24.8k|                    sats[k] + SatInfo::Push() + SatInfo::OP_EQUAL(),
 1186|  24.8k|                    sats[0] + SatInfo::Push() + SatInfo::OP_EQUAL()
 1187|  24.8k|                };
 1188|   440k|            }
 1189|  5.04M|        }
 1190|  5.04M|        assert(false);
  ------------------
  |  Branch (1190:9): [Folded, False: 0]
  ------------------
 1191|      0|    }
_ZNK10miniscript4NodeIjE15CalcWitnessSizeEv:
 1193|  5.04M|    internal::WitnessSize CalcWitnessSize() const {
 1194|  5.04M|        const uint32_t sig_size = IsTapscript(m_script_ctx) ? 1 + 65 : 1 + 72;
  ------------------
  |  Branch (1194:35): [True: 4.73M, False: 309k]
  ------------------
 1195|  5.04M|        const uint32_t pubkey_size = IsTapscript(m_script_ctx) ? 1 + 32 : 1 + 33;
  ------------------
  |  Branch (1195:38): [True: 4.73M, False: 309k]
  ------------------
 1196|  5.04M|        switch (fragment) {
  ------------------
  |  Branch (1196:17): [True: 5.04M, False: 0]
  ------------------
 1197|  1.54M|            case Fragment::JUST_0: return {{}, 0};
  ------------------
  |  Branch (1197:13): [True: 1.54M, False: 3.49M]
  ------------------
 1198|   323k|            case Fragment::JUST_1:
  ------------------
  |  Branch (1198:13): [True: 323k, False: 4.71M]
  ------------------
 1199|   333k|            case Fragment::OLDER:
  ------------------
  |  Branch (1199:13): [True: 9.73k, False: 5.03M]
  ------------------
 1200|   344k|            case Fragment::AFTER: return {0, {}};
  ------------------
  |  Branch (1200:13): [True: 11.3k, False: 5.02M]
  ------------------
 1201|  14.3k|            case Fragment::PK_K: return {sig_size, 1};
  ------------------
  |  Branch (1201:13): [True: 14.3k, False: 5.02M]
  ------------------
 1202|  3.86k|            case Fragment::PK_H: return {sig_size + pubkey_size, 1 + pubkey_size};
  ------------------
  |  Branch (1202:13): [True: 3.86k, False: 5.03M]
  ------------------
 1203|     79|            case Fragment::SHA256:
  ------------------
  |  Branch (1203:13): [True: 79, False: 5.04M]
  ------------------
 1204|    369|            case Fragment::RIPEMD160:
  ------------------
  |  Branch (1204:13): [True: 290, False: 5.04M]
  ------------------
 1205|    507|            case Fragment::HASH256:
  ------------------
  |  Branch (1205:13): [True: 138, False: 5.04M]
  ------------------
 1206|  1.00k|            case Fragment::HASH160: return {1 + 32, {}};
  ------------------
  |  Branch (1206:13): [True: 499, False: 5.04M]
  ------------------
 1207|  8.30k|            case Fragment::ANDOR: {
  ------------------
  |  Branch (1207:13): [True: 8.30k, False: 5.03M]
  ------------------
 1208|  8.30k|                const auto sat{(subs[0].ws.sat + subs[1].ws.sat) | (subs[0].ws.dsat + subs[2].ws.sat)};
 1209|  8.30k|                const auto dsat{subs[0].ws.dsat + subs[2].ws.dsat};
 1210|  8.30k|                return {sat, dsat};
 1211|    507|            }
 1212|   223k|            case Fragment::AND_V: return {subs[0].ws.sat + subs[1].ws.sat, {}};
  ------------------
  |  Branch (1212:13): [True: 223k, False: 4.81M]
  ------------------
 1213|  8.73k|            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.73k, False: 5.03M]
  ------------------
 1214|  5.10k|            case Fragment::OR_B: {
  ------------------
  |  Branch (1214:13): [True: 5.10k, False: 5.03M]
  ------------------
 1215|  5.10k|                const auto sat{(subs[0].ws.dsat + subs[1].ws.sat) | (subs[0].ws.sat + subs[1].ws.dsat)};
 1216|  5.10k|                const auto dsat{subs[0].ws.dsat + subs[1].ws.dsat};
 1217|  5.10k|                return {sat, dsat};
 1218|    507|            }
 1219|  3.90k|            case Fragment::OR_C: return {subs[0].ws.sat | (subs[0].ws.dsat + subs[1].ws.sat), {}};
  ------------------
  |  Branch (1219:13): [True: 3.90k, False: 5.03M]
  ------------------
 1220|  3.09k|            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: 3.09k, False: 5.03M]
  ------------------
 1221|  1.31M|            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: 1.31M, False: 3.72M]
  ------------------
 1222|  4.15k|            case Fragment::MULTI: return {k * sig_size + 1, k + 1};
  ------------------
  |  Branch (1222:13): [True: 4.15k, False: 5.03M]
  ------------------
 1223|  2.50k|            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: 2.50k, False: 5.03M]
  ------------------
 1224|  55.9k|            case Fragment::WRAP_A:
  ------------------
  |  Branch (1224:13): [True: 55.9k, False: 4.98M]
  ------------------
 1225|   440k|            case Fragment::WRAP_N:
  ------------------
  |  Branch (1225:13): [True: 384k, False: 4.65M]
  ------------------
 1226|   459k|            case Fragment::WRAP_S:
  ------------------
  |  Branch (1226:13): [True: 19.0k, False: 5.02M]
  ------------------
 1227|  1.28M|            case Fragment::WRAP_C: return subs[0].ws;
  ------------------
  |  Branch (1227:13): [True: 828k, False: 4.21M]
  ------------------
 1228|   137k|            case Fragment::WRAP_D: return {1 + 1 + subs[0].ws.sat, 1};
  ------------------
  |  Branch (1228:13): [True: 137k, False: 4.90M]
  ------------------
 1229|  82.3k|            case Fragment::WRAP_V: return {subs[0].ws.sat, {}};
  ------------------
  |  Branch (1229:13): [True: 82.3k, False: 4.95M]
  ------------------
 1230|  26.8k|            case Fragment::WRAP_J: return {subs[0].ws.sat, 1};
  ------------------
  |  Branch (1230:13): [True: 26.8k, False: 5.01M]
  ------------------
 1231|  24.8k|            case Fragment::THRESH: {
  ------------------
  |  Branch (1231:13): [True: 24.8k, False: 5.01M]
  ------------------
 1232|  24.8k|                auto sats = Vector(internal::MaxInt<uint32_t>(0));
 1233|   151k|                for (const auto& sub : subs) {
  ------------------
  |  Branch (1233:38): [True: 151k, False: 24.8k]
  ------------------
 1234|   151k|                    auto next_sats = Vector(sats[0] + sub.ws.dsat);
 1235|  10.0M|                    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: 9.86M, False: 151k]
  ------------------
 1236|   151k|                    next_sats.push_back(sats[sats.size() - 1] + sub.ws.sat);
 1237|   151k|                    sats = std::move(next_sats);
 1238|   151k|                }
 1239|  24.8k|                assert(k < sats.size());
  ------------------
  |  Branch (1239:17): [True: 24.8k, False: 0]
  ------------------
 1240|  24.8k|                return {sats[k], sats[0]};
 1241|  24.8k|            }
 1242|  5.04M|        }
 1243|  5.04M|        assert(false);
  ------------------
  |  Branch (1243:9): [Folded, False: 0]
  ------------------
 1244|      0|    }
_ZNK10miniscript4NodeIjE8CalcTypeEv:
  780|  5.04M|    Type CalcType() const {
  781|  5.04M|        using namespace internal;
  782|       |
  783|       |        // THRESH has a variable number of subexpressions
  784|  5.04M|        std::vector<Type> sub_types;
  785|  5.04M|        if (fragment == Fragment::THRESH) {
  ------------------
  |  Branch (785:13): [True: 24.8k, False: 5.01M]
  ------------------
  786|   151k|            for (const auto& sub : subs) sub_types.push_back(sub.GetType());
  ------------------
  |  Branch (786:34): [True: 151k, False: 24.8k]
  ------------------
  787|  24.8k|        }
  788|       |        // All other nodes than THRESH can be computed just from the types of the 0-3 subexpressions.
  789|  5.04M|        Type x = subs.size() > 0 ? subs[0].GetType() : ""_mst;
  ------------------
  |  Branch (789:18): [True: 3.12M, False: 1.91M]
  ------------------
  790|  5.04M|        Type y = subs.size() > 1 ? subs[1].GetType() : ""_mst;
  ------------------
  |  Branch (790:18): [True: 1.58M, False: 3.45M]
  ------------------
  791|  5.04M|        Type z = subs.size() > 2 ? subs[2].GetType() : ""_mst;
  ------------------
  |  Branch (791:18): [True: 19.7k, False: 5.02M]
  ------------------
  792|       |
  793|  5.04M|        return SanitizeType(ComputeType(fragment, x, y, z, sub_types, k, data.size(), subs.size(), keys.size(), m_script_ctx));
  794|  5.04M|    }
_ZNK10miniscript4NodeIjE13CalcScriptLenEv:
  619|  5.04M|    {
  620|  5.04M|        size_t subsize = 0;
  621|  5.04M|        for (const auto& sub : subs) {
  ------------------
  |  Branch (621:30): [True: 4.82M, False: 5.04M]
  ------------------
  622|  4.82M|            subsize += sub.ScriptSize();
  623|  4.82M|        }
  624|  5.04M|        Type sub0type = subs.size() > 0 ? subs[0].GetType() : ""_mst;
  ------------------
  |  Branch (624:25): [True: 3.12M, False: 1.91M]
  ------------------
  625|  5.04M|        return internal::ComputeScriptLen(fragment, sub0type, subsize, k, subs.size(), keys.size(), m_script_ctx);
  626|  5.04M|    }
_ZN10miniscript8internal11ParseHexStrERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_4spanIKcLm18446744073709551615EEEm:
 1825|  1.00k|{
 1826|  1.00k|    std::span<const char> expr = script::Expr(in);
 1827|  1.00k|    if (!script::Func(func, expr)) return {};
  ------------------
  |  Branch (1827:9): [True: 18, False: 991]
  ------------------
 1828|    991|    std::string val = std::string(expr.begin(), expr.end());
 1829|    991|    if (!IsHex(val)) return {};
  ------------------
  |  Branch (1829:9): [True: 12, False: 979]
  ------------------
 1830|    979|    auto hash = ParseHex(val);
 1831|    979|    if (hash.size() != expected_size) return {};
  ------------------
  |  Branch (1831:9): [True: 12, False: 967]
  ------------------
 1832|    967|    return hash;
 1833|    979|}
_ZN10miniscript4NodeIjEC2ENS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentENSt3__16vectorIhNS6_9allocatorIhEEEEj:
 1723|    986|        : fragment(nt), k(val), data(std::move(arg)), m_script_ctx{script_ctx}, ops(CalcOps()), ss(CalcStackSize()), ws(CalcWitnessSize()), typ(CalcType()), scriptlen(CalcScriptLen()) {}
descriptor.cpp:_ZZN10miniscript8internal5ParseIjN12_GLOBAL__N_19KeyParserEEENSt3__18optionalINS_4NodeIT_EEEENS4_4spanIKcLm18446744073709551615EEERKT0_ENKUlRSC_bE_clESG_b:
 1878|  1.79k|    const auto parse_multi_exp = [&](std::span<const char>& in, const bool is_multi_a) -> bool {
 1879|  1.79k|        const auto max_keys{is_multi_a ? MAX_PUBKEYS_PER_MULTI_A : MAX_PUBKEYS_PER_MULTISIG};
  ------------------
  |  Branch (1879:29): [True: 762, False: 1.02k]
  ------------------
 1880|  1.79k|        const auto required_ctx{is_multi_a ? MiniscriptContext::TAPSCRIPT : MiniscriptContext::P2WSH};
  ------------------
  |  Branch (1880:33): [True: 762, False: 1.02k]
  ------------------
 1881|  1.79k|        if (ctx.MsContext() != required_ctx) return false;
  ------------------
  |  Branch (1881:13): [True: 4, False: 1.78k]
  ------------------
 1882|       |        // Get threshold
 1883|  1.78k|        int next_comma = FindNextChar(in, ',');
 1884|  1.78k|        if (next_comma < 1) return false;
  ------------------
  |  Branch (1884:13): [True: 9, False: 1.77k]
  ------------------
 1885|  1.77k|        const auto k_to_integral{ToIntegral<int64_t>(std::string_view(in.data(), next_comma))};
 1886|  1.77k|        if (!k_to_integral.has_value()) return false;
  ------------------
  |  Branch (1886:13): [True: 110, False: 1.66k]
  ------------------
 1887|  1.66k|        const int64_t k{k_to_integral.value()};
 1888|  1.66k|        in = in.subspan(next_comma + 1);
 1889|       |        // Get keys. It is compatible for both compressed and x-only keys.
 1890|  1.66k|        std::vector<Key> keys;
 1891|  11.5k|        while (next_comma != -1) {
  ------------------
  |  Branch (1891:16): [True: 10.1k, False: 1.45k]
  ------------------
 1892|  10.1k|            next_comma = FindNextChar(in, ',');
 1893|  10.1k|            int key_length = (next_comma == -1) ? FindNextChar(in, ')') : next_comma;
  ------------------
  |  Branch (1893:30): [True: 1.58k, False: 8.55k]
  ------------------
 1894|  10.1k|            if (key_length < 1) return false;
  ------------------
  |  Branch (1894:17): [True: 96, False: 10.0k]
  ------------------
 1895|  10.0k|            std::span<const char> sp{in.begin(), in.begin() + key_length};
 1896|  10.0k|            auto key = ctx.FromString(sp);
 1897|  10.0k|            if (!key) return false;
  ------------------
  |  Branch (1897:17): [True: 114, False: 9.93k]
  ------------------
 1898|  9.93k|            keys.push_back(std::move(*key));
 1899|  9.93k|            in = in.subspan(key_length + 1);
 1900|  9.93k|        }
 1901|  1.45k|        if (keys.size() < 1 || keys.size() > max_keys) return false;
  ------------------
  |  Branch (1901:13): [True: 0, False: 1.45k]
  |  Branch (1901:32): [True: 4, False: 1.45k]
  ------------------
 1902|  1.45k|        if (k < 1 || k > (int64_t)keys.size()) return false;
  ------------------
  |  Branch (1902:13): [True: 62, False: 1.39k]
  |  Branch (1902:22): [True: 93, False: 1.29k]
  ------------------
 1903|  1.29k|        if (is_multi_a) {
  ------------------
  |  Branch (1903:13): [True: 403, False: 896]
  ------------------
 1904|       |            // (push + xonly-key + CHECKSIG[ADD]) * n + k + OP_NUMEQUAL(VERIFY), minus one.
 1905|    403|            script_size += (1 + 32 + 1) * keys.size() + BuildScript(k).size();
 1906|    403|            constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::MULTI_A, std::move(keys), k);
 1907|    896|        } else {
 1908|    896|            script_size += 2 + (keys.size() > 16) + (k > 16) + 34 * keys.size();
 1909|    896|            constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::MULTI, std::move(keys), k);
 1910|    896|        }
 1911|  1.29k|        return true;
 1912|  1.45k|    };
_ZN10miniscript4NodeIjEC2ENS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentENSt3__16vectorIS1_NS6_9allocatorIS1_EEEEj:
 1729|  3.02M|        : fragment(nt), k(val), subs(std::move(sub)), m_script_ctx{script_ctx}, ops(CalcOps()), ss(CalcStackSize()), ws(CalcWitnessSize()), typ(CalcType()), scriptlen(CalcScriptLen()) {}
_ZN10miniscript4NodeIjEaSEOS1_:
 1753|  3.13M|    Node& operator=(Node&&) noexcept = default;
_ZNK10miniscript4NodeIjE7GetTypeEv:
 1617|  12.1M|    Type GetType() const { return typ; }
_ZN10miniscript4NodeIjEC2ENS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentEj:
 1731|  1.83M|        : fragment(nt), k(val), m_script_ctx{script_ctx}, ops(CalcOps()), ss(CalcStackSize()), ws(CalcWitnessSize()), typ(CalcType()), scriptlen(CalcScriptLen()) {}
_ZN10miniscript8internal9BuildBackIjEEvNS_17MiniscriptContextENS_8FragmentERNSt3__16vectorINS_4NodeIT_EENS4_9allocatorIS8_EEEEb:
 1838|   718k|{
 1839|   718k|    Node<Key> child{std::move(constructed.back())};
 1840|   718k|    constructed.pop_back();
 1841|   718k|    if (reverse) {
  ------------------
  |  Branch (1841:9): [True: 32.3k, False: 685k]
  ------------------
 1842|  32.3k|        constructed.back() = Node<Key>{internal::NoDupCheck{}, script_ctx, nt, Vector(std::move(child), std::move(constructed.back()))};
 1843|   685k|    } else {
 1844|   685k|        constructed.back() = Node<Key>{internal::NoDupCheck{}, script_ctx, nt, Vector(std::move(constructed.back()), std::move(child))};
 1845|   685k|    }
 1846|   718k|}
_ZN10miniscript4NodeIjEC2EOS1_:
 1752|  6.80M|    Node(Node&&) noexcept = default;
_ZNK10miniscript4NodeIjE10ScriptSizeEv:
 1559|  6.23M|    size_t ScriptSize() const { return scriptlen; }
descriptor.cpp:_ZNK10miniscript4NodeIjE17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_:
 1501|  10.2k|    {
 1502|       |        // We cannot use a lambda here, as lambdas are non assignable, and the set operations
 1503|       |        // below require moving the comparators around.
 1504|  10.2k|        struct Comp {
 1505|  10.2k|            const Ctx* ctx_ptr;
 1506|  10.2k|            Comp(const Ctx& ctx) : ctx_ptr(&ctx) {}
 1507|  10.2k|            bool operator()(const Key& a, const Key& b) const { return ctx_ptr->KeyCompare(a, b); }
 1508|  10.2k|        };
 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|  10.2k|        using keyset = std::set<Key, Comp>;
 1514|  10.2k|        using state = std::optional<keyset>;
 1515|       |
 1516|  10.2k|        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|  10.2k|            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|  10.2k|            for (auto& sub : subs) {
 1522|  10.2k|                if (!sub.has_value()) {
 1523|  10.2k|                    node.has_duplicate_keys = true;
 1524|  10.2k|                    return {};
 1525|  10.2k|                }
 1526|  10.2k|            }
 1527|       |
 1528|       |            // Start building the set of keys involved in this node and children.
 1529|       |            // Start by keys in this node directly.
 1530|  10.2k|            size_t keys_count = node.keys.size();
 1531|  10.2k|            keyset key_set{node.keys.begin(), node.keys.end(), Comp(ctx)};
 1532|  10.2k|            if (key_set.size() != keys_count) {
 1533|       |                // It already has duplicates; bail out.
 1534|  10.2k|                node.has_duplicate_keys = true;
 1535|  10.2k|                return {};
 1536|  10.2k|            }
 1537|       |
 1538|       |            // Merge the keys from the children into this set.
 1539|  10.2k|            for (auto& sub : subs) {
 1540|  10.2k|                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|  10.2k|                if (key_set.size() < sub->size()) std::swap(key_set, *sub);
 1544|  10.2k|                key_set.merge(*sub);
 1545|  10.2k|                if (key_set.size() != keys_count) {
 1546|  10.2k|                    node.has_duplicate_keys = true;
 1547|  10.2k|                    return {};
 1548|  10.2k|                }
 1549|  10.2k|            }
 1550|       |
 1551|  10.2k|            node.has_duplicate_keys = false;
 1552|  10.2k|            return key_set;
 1553|  10.2k|        };
 1554|       |
 1555|  10.2k|        TreeEval<state>(upfn);
 1556|  10.2k|    }
descriptor.cpp:_ZNK10miniscript4NodeIjE8TreeEvalINSt3__18optionalINS3_3setIjZNKS1_17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_E4CompNS3_9allocatorIjEEEEEEZNKS6_IS8_EEvSB_EUlRKS1_NS3_4spanISG_Lm18446744073709551615EEEE_EES9_T0_:
  748|  10.2k|    {
  749|  10.2k|        struct DummyState {};
  750|  10.2k|        return std::move(*TreeEvalMaybe<Result>(DummyState{},
  751|  10.2k|            [](DummyState, const Node&, size_t) { return DummyState{}; },
  752|  10.2k|            [&upfn](DummyState, const Node& node, std::span<Result> subs) {
  753|  10.2k|                Result res{upfn(node, subs)};
  754|  10.2k|                return std::optional<Result>(std::move(res));
  755|  10.2k|            }
  756|  10.2k|        ));
  757|  10.2k|    }
descriptor.cpp:_ZNK10miniscript4NodeIjE13TreeEvalMaybeINSt3__18optionalINS3_3setIjZNKS1_17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_E4CompNS3_9allocatorIjEEEEEEZNKS1_8TreeEvalISG_ZNKS6_IS8_EEvSB_EUlRKS1_NS3_4spanISG_Lm18446744073709551615EEEE_EES9_T0_E10DummyStateZNKSH_ISG_SM_EES9_SN_EUlSO_SJ_mE_ZNKSH_ISG_SM_EES9_SN_EUlSO_SJ_SL_E_EENS4_IS9_EESN_T1_T2_:
  653|  10.2k|    {
  654|       |        /** Entries of the explicit stack tracked in this algorithm. */
  655|  10.2k|        struct StackElem
  656|  10.2k|        {
  657|  10.2k|            const Node& node; //!< The node being evaluated.
  658|  10.2k|            size_t expanded; //!< How many children of this node have been expanded.
  659|  10.2k|            State state; //!< The state for that node.
  660|       |
  661|  10.2k|            StackElem(const Node& node_, size_t exp_, State&& state_) :
  662|  10.2k|                node(node_), expanded(exp_), state(std::move(state_)) {}
  663|  10.2k|        };
  664|       |        /* Stack of tree nodes being explored. */
  665|  10.2k|        std::vector<StackElem> stack;
  666|       |        /* Results of subtrees so far. Their order and mapping to tree nodes
  667|       |         * is implicitly defined by stack. */
  668|  10.2k|        std::vector<Result> results;
  669|  10.2k|        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|  4.20M|        while (stack.size()) {
  ------------------
  |  Branch (687:16): [True: 4.19M, False: 10.2k]
  ------------------
  688|  4.19M|            const Node& node = stack.back().node;
  689|  4.19M|            if (stack.back().expanded < node.subs.size()) {
  ------------------
  |  Branch (689:17): [True: 2.09M, False: 2.10M]
  ------------------
  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|  2.09M|                size_t child_index = stack.back().expanded++;
  694|  2.09M|                State child_state = downfn(stack.back().state, node, child_index);
  695|  2.09M|                stack.emplace_back(node.subs[child_index], 0, std::move(child_state));
  696|  2.09M|                continue;
  697|  2.09M|            }
  698|       |            // Invoke upfn with the last node.subs.size() elements of results as input.
  699|  4.19M|            assert(results.size() >= node.subs.size());
  ------------------
  |  Branch (699:13): [True: 2.10M, False: 0]
  ------------------
  700|  2.10M|            std::optional<Result> result{upfn(std::move(stack.back().state), node,
  701|  2.10M|                std::span<Result>{results}.last(node.subs.size()))};
  702|       |            // If evaluation returns std::nullopt, abort immediately.
  703|  2.10M|            if (!result) return {};
  ------------------
  |  Branch (703:17): [True: 0, False: 2.10M]
  ------------------
  704|       |            // Replace the last node.subs.size() elements of results with the new result.
  705|  2.10M|            results.erase(results.end() - node.subs.size(), results.end());
  706|  2.10M|            results.push_back(std::move(*result));
  707|  2.10M|            stack.pop_back();
  708|  2.10M|        }
  709|       |        // The final remaining results element is the root result, return it.
  710|  10.2k|        assert(results.size() >= 1);
  ------------------
  |  Branch (710:9): [True: 10.2k, False: 0]
  ------------------
  711|  10.2k|        CHECK_NONFATAL(results.size() == 1);
  ------------------
  |  |  113|  10.2k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  712|  10.2k|        return std::move(results[0]);
  713|  10.2k|    }
descriptor.cpp:_ZZNK10miniscript4NodeIjE13TreeEvalMaybeINSt3__18optionalINS3_3setIjZNKS1_17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_E4CompNS3_9allocatorIjEEEEEEZNKS1_8TreeEvalISG_ZNKS6_IS8_EEvSB_EUlRKS1_NS3_4spanISG_Lm18446744073709551615EEEE_EES9_T0_E10DummyStateZNKSH_ISG_SM_EES9_SN_EUlSO_SJ_mE_ZNKSH_ISG_SM_EES9_SN_EUlSO_SJ_SL_E_EENS4_IS9_EESN_T1_T2_EN9StackElemC2ESJ_mOSO_:
  662|  2.10M|                node(node_), expanded(exp_), state(std::move(state_)) {}
descriptor.cpp:_ZZNK10miniscript4NodeIjE8TreeEvalINSt3__18optionalINS3_3setIjZNKS1_17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_E4CompNS3_9allocatorIjEEEEEEZNKS6_IS8_EEvSB_EUlRKS1_NS3_4spanISG_Lm18446744073709551615EEEE_EES9_T0_ENKUlZNKS2_ISG_SL_EES9_SM_E10DummyStateSI_mE_clESN_SI_m:
  751|  2.09M|            [](DummyState, const Node&, size_t) { return DummyState{}; },
descriptor.cpp:_ZZNK10miniscript4NodeIjE8TreeEvalINSt3__18optionalINS3_3setIjZNKS1_17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_E4CompNS3_9allocatorIjEEEEEEZNKS6_IS8_EEvSB_EUlRKS1_NS3_4spanISG_Lm18446744073709551615EEEE_EES9_T0_ENKUlZNKS2_ISG_SL_EES9_SM_E10DummyStateSI_SK_E_clESN_SI_SK_:
  752|  2.10M|            [&upfn](DummyState, const Node& node, std::span<Result> subs) {
  753|  2.10M|                Result res{upfn(node, subs)};
  754|  2.10M|                return std::optional<Result>(std::move(res));
  755|  2.10M|            }
descriptor.cpp:_ZZNK10miniscript4NodeIjE17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_ENKUlRKS1_NSt3__14spanINSA_8optionalINSA_3setIjZNKS2_IS4_EEvS7_E4CompNSA_9allocatorIjEEEEEELm18446744073709551615EEEE_clES9_SJ_:
 1516|  2.10M|        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|  2.10M|            if (node.has_duplicate_keys.has_value() && *node.has_duplicate_keys) return {};
  ------------------
  |  Branch (1518:17): [True: 0, False: 2.10M]
  |  Branch (1518:56): [True: 0, False: 0]
  ------------------
 1519|       |
 1520|       |            // Check if one of the children is already known to have duplicates.
 1521|  2.10M|            for (auto& sub : subs) {
  ------------------
  |  Branch (1521:28): [True: 2.08M, False: 2.09M]
  ------------------
 1522|  2.08M|                if (!sub.has_value()) {
  ------------------
  |  Branch (1522:21): [True: 7.16k, False: 2.07M]
  ------------------
 1523|  7.16k|                    node.has_duplicate_keys = true;
 1524|  7.16k|                    return {};
 1525|  7.16k|                }
 1526|  2.08M|            }
 1527|       |
 1528|       |            // Start building the set of keys involved in this node and children.
 1529|       |            // Start by keys in this node directly.
 1530|  2.09M|            size_t keys_count = node.keys.size();
 1531|  2.09M|            keyset key_set{node.keys.begin(), node.keys.end(), Comp(ctx)};
 1532|  2.09M|            if (key_set.size() != keys_count) {
  ------------------
  |  Branch (1532:17): [True: 133, False: 2.09M]
  ------------------
 1533|       |                // It already has duplicates; bail out.
 1534|    133|                node.has_duplicate_keys = true;
 1535|    133|                return {};
 1536|    133|            }
 1537|       |
 1538|       |            // Merge the keys from the children into this set.
 1539|  2.09M|            for (auto& sub : subs) {
  ------------------
  |  Branch (1539:28): [True: 2.06M, False: 2.09M]
  ------------------
 1540|  2.06M|                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|  2.06M|                if (key_set.size() < sub->size()) std::swap(key_set, *sub);
  ------------------
  |  Branch (1543:21): [True: 203k, False: 1.86M]
  ------------------
 1544|  2.06M|                key_set.merge(*sub);
 1545|  2.06M|                if (key_set.size() != keys_count) {
  ------------------
  |  Branch (1545:21): [True: 501, False: 2.06M]
  ------------------
 1546|    501|                    node.has_duplicate_keys = true;
 1547|    501|                    return {};
 1548|    501|                }
 1549|  2.06M|            }
 1550|       |
 1551|  2.09M|            node.has_duplicate_keys = false;
 1552|  2.09M|            return key_set;
 1553|  2.09M|        };
descriptor.cpp:_ZZNK10miniscript4NodeIjE17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_EN4CompC2ERKS4_:
 1506|  2.09M|            Comp(const Ctx& ctx) : ctx_ptr(&ctx) {}
descriptor.cpp:_ZZNK10miniscript4NodeIjE17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_ENK4CompclERKjSA_:
 1507|  64.4k|            bool operator()(const Key& a, const Key& b) const { return ctx_ptr->KeyCompare(a, b); }
_ZNK10miniscript4NodeIjE6IsSaneEv:
 1702|  9.10k|    bool IsSane() const { return IsValidTopLevel() && IsSaneSubexpression() && NeedsSignature(); }
  ------------------
  |  Branch (1702:34): [True: 8.52k, False: 577]
  |  Branch (1702:55): [True: 8.37k, False: 150]
  |  Branch (1702:80): [True: 8.23k, False: 140]
  ------------------
_ZNK10miniscript4NodeIjE15IsValidTopLevelEv:
 1681|  13.7k|    bool IsValidTopLevel() const { return IsValid() && GetType() << "B"_mst; }
  ------------------
  |  Branch (1681:43): [True: 13.2k, False: 499]
  |  Branch (1681:56): [True: 13.2k, False: 78]
  ------------------
_ZNK10miniscript4NodeIjE19IsSaneSubexpressionEv:
 1699|  1.14M|    bool IsSaneSubexpression() const { return ValidSatisfactions() && IsNonMalleable() && CheckTimeLocksMix() && CheckDuplicateKey(); }
  ------------------
  |  Branch (1699:47): [True: 1.10M, False: 40.0k]
  |  Branch (1699:71): [True: 1.10M, False: 263]
  |  Branch (1699:91): [True: 1.10M, False: 210]
  |  Branch (1699:114): [True: 1.10M, False: 188]
  ------------------
_ZNK10miniscript4NodeIjE16IsNotSatisfiableEv:
 1607|  3.43k|    bool IsNotSatisfiable() const { return !GetStackSize(); }
_ZNK10miniscript4NodeIjE12GetStackSizeEv:
 1583|  96.9k|    std::optional<uint32_t> GetStackSize() const {
 1584|  96.9k|        if (!ss.Sat().Valid()) return {};
  ------------------
  |  Branch (1584:13): [True: 55.2k, False: 41.7k]
  ------------------
 1585|  41.7k|        return ss.Sat().NetDiff() + static_cast<int32_t>(IsBKW());
 1586|  96.9k|    }
_ZNK10miniscript8internal7SatInfo5ValidEv:
  458|  1.11M|    bool Valid() const { return valid; }
_ZNK10miniscript8internal7SatInfo7NetDiffEv:
  459|  41.7k|    int32_t NetDiff() const { return netdiff; }
_ZNK10miniscript4NodeIjE5IsBKWEv:
 1578|   299k|    bool IsBKW() const {
 1579|   299k|        return !((GetType() & "BKW"_mst) == ""_mst);
 1580|   299k|    }
_ZNK10miniscript4NodeIjE13FindInsaneSubEv:
 1623|    761|    const Node* FindInsaneSub() const {
 1624|    761|        return TreeEval<const Node*>([](const Node& node, std::span<const Node*> subs) -> const Node* {
 1625|    761|            for (auto& sub: subs) if (sub) return sub;
 1626|    761|            if (!node.IsSaneSubexpression()) return &node;
 1627|    761|            return nullptr;
 1628|    761|        });
 1629|    761|    }
_ZNK10miniscript4NodeIjE8TreeEvalIPKS1_ZNKS1_13FindInsaneSubEvEUlRS3_NSt3__14spanIS4_Lm18446744073709551615EEEE_EET_T0_:
  748|    761|    {
  749|    761|        struct DummyState {};
  750|    761|        return std::move(*TreeEvalMaybe<Result>(DummyState{},
  751|    761|            [](DummyState, const Node&, size_t) { return DummyState{}; },
  752|    761|            [&upfn](DummyState, const Node& node, std::span<Result> subs) {
  753|    761|                Result res{upfn(node, subs)};
  754|    761|                return std::optional<Result>(std::move(res));
  755|    761|            }
  756|    761|        ));
  757|    761|    }
_ZNK10miniscript4NodeIjE13TreeEvalMaybeIPKS1_ZNKS1_8TreeEvalIS4_ZNKS1_13FindInsaneSubEvEUlRS3_NSt3__14spanIS4_Lm18446744073709551615EEEE_EET_T0_E10DummyStateZNKS5_IS4_SA_EESB_SC_EUlSD_S6_mE_ZNKS5_IS4_SA_EESB_SC_EUlSD_S6_S9_E_EENS7_8optionalISB_EESC_T1_T2_:
  653|    761|    {
  654|       |        /** Entries of the explicit stack tracked in this algorithm. */
  655|    761|        struct StackElem
  656|    761|        {
  657|    761|            const Node& node; //!< The node being evaluated.
  658|    761|            size_t expanded; //!< How many children of this node have been expanded.
  659|    761|            State state; //!< The state for that node.
  660|       |
  661|    761|            StackElem(const Node& node_, size_t exp_, State&& state_) :
  662|    761|                node(node_), expanded(exp_), state(std::move(state_)) {}
  663|    761|        };
  664|       |        /* Stack of tree nodes being explored. */
  665|    761|        std::vector<StackElem> stack;
  666|       |        /* Results of subtrees so far. Their order and mapping to tree nodes
  667|       |         * is implicitly defined by stack. */
  668|    761|        std::vector<Result> results;
  669|    761|        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|  3.55M|        while (stack.size()) {
  ------------------
  |  Branch (687:16): [True: 3.55M, False: 761]
  ------------------
  688|  3.55M|            const Node& node = stack.back().node;
  689|  3.55M|            if (stack.back().expanded < node.subs.size()) {
  ------------------
  |  Branch (689:17): [True: 1.77M, False: 1.77M]
  ------------------
  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|  1.77M|                size_t child_index = stack.back().expanded++;
  694|  1.77M|                State child_state = downfn(stack.back().state, node, child_index);
  695|  1.77M|                stack.emplace_back(node.subs[child_index], 0, std::move(child_state));
  696|  1.77M|                continue;
  697|  1.77M|            }
  698|       |            // Invoke upfn with the last node.subs.size() elements of results as input.
  699|  3.55M|            assert(results.size() >= node.subs.size());
  ------------------
  |  Branch (699:13): [True: 1.77M, False: 0]
  ------------------
  700|  1.77M|            std::optional<Result> result{upfn(std::move(stack.back().state), node,
  701|  1.77M|                std::span<Result>{results}.last(node.subs.size()))};
  702|       |            // If evaluation returns std::nullopt, abort immediately.
  703|  1.77M|            if (!result) return {};
  ------------------
  |  Branch (703:17): [True: 0, False: 1.77M]
  ------------------
  704|       |            // Replace the last node.subs.size() elements of results with the new result.
  705|  1.77M|            results.erase(results.end() - node.subs.size(), results.end());
  706|  1.77M|            results.push_back(std::move(*result));
  707|  1.77M|            stack.pop_back();
  708|  1.77M|        }
  709|       |        // The final remaining results element is the root result, return it.
  710|    761|        assert(results.size() >= 1);
  ------------------
  |  Branch (710:9): [True: 761, False: 0]
  ------------------
  711|    761|        CHECK_NONFATAL(results.size() == 1);
  ------------------
  |  |  113|    761|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  712|    761|        return std::move(results[0]);
  713|    761|    }
_ZZNK10miniscript4NodeIjE13TreeEvalMaybeIPKS1_ZNKS1_8TreeEvalIS4_ZNKS1_13FindInsaneSubEvEUlRS3_NSt3__14spanIS4_Lm18446744073709551615EEEE_EET_T0_E10DummyStateZNKS5_IS4_SA_EESB_SC_EUlSD_S6_mE_ZNKS5_IS4_SA_EESB_SC_EUlSD_S6_S9_E_EENS7_8optionalISB_EESC_T1_T2_EN9StackElemC2ES6_mOSD_:
  662|  1.77M|                node(node_), expanded(exp_), state(std::move(state_)) {}
_ZZNK10miniscript4NodeIjE8TreeEvalIPKS1_ZNKS1_13FindInsaneSubEvEUlRS3_NSt3__14spanIS4_Lm18446744073709551615EEEE_EET_T0_ENKUlZNKS2_IS4_S9_EESA_SB_E10DummyStateS5_mE_clESC_S5_m:
  751|  1.77M|            [](DummyState, const Node&, size_t) { return DummyState{}; },
_ZZNK10miniscript4NodeIjE8TreeEvalIPKS1_ZNKS1_13FindInsaneSubEvEUlRS3_NSt3__14spanIS4_Lm18446744073709551615EEEE_EET_T0_ENKUlZNKS2_IS4_S9_EESA_SB_E10DummyStateS5_S8_E_clESC_S5_S8_:
  752|  1.77M|            [&upfn](DummyState, const Node& node, std::span<Result> subs) {
  753|  1.77M|                Result res{upfn(node, subs)};
  754|  1.77M|                return std::optional<Result>(std::move(res));
  755|  1.77M|            }
_ZZNK10miniscript4NodeIjE13FindInsaneSubEvENKUlRKS1_NSt3__14spanIPS2_Lm18446744073709551615EEEE_clES3_S7_:
 1624|  1.77M|        return TreeEval<const Node*>([](const Node& node, std::span<const Node*> subs) -> const Node* {
 1625|  1.77M|            for (auto& sub: subs) if (sub) return sub;
  ------------------
  |  Branch (1625:27): [True: 1.54M, False: 1.13M]
  |  Branch (1625:39): [True: 638k, False: 911k]
  ------------------
 1626|  1.13M|            if (!node.IsSaneSubexpression()) return &node;
  ------------------
  |  Branch (1626:17): [True: 40.5k, False: 1.09M]
  ------------------
 1627|  1.09M|            return nullptr;
 1628|  1.13M|        });
descriptor.cpp:_ZNK10miniscript4NodeIjE8ToStringIN12_GLOBAL__N_19KeyParserEEENSt3__18optionalINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEERKT_:
  877|    761|    std::optional<std::string> ToString(const CTx& ctx) const {
  878|    761|        bool dummy{false};
  879|    761|        return ToString(ctx, dummy);
  880|    761|    }
descriptor.cpp:_ZNK10miniscript4NodeIjE8ToStringIN12_GLOBAL__N_19KeyParserEEENSt3__18optionalINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEERKT_Rb:
  883|    761|    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|    761|        auto downfn = [](bool, const Node& node, size_t) {
  888|    761|            return (node.fragment == Fragment::WRAP_A || node.fragment == Fragment::WRAP_S ||
  889|    761|                    node.fragment == Fragment::WRAP_D || node.fragment == Fragment::WRAP_V ||
  890|    761|                    node.fragment == Fragment::WRAP_J || node.fragment == Fragment::WRAP_N ||
  891|    761|                    node.fragment == Fragment::WRAP_C ||
  892|    761|                    (node.fragment == Fragment::AND_V && node.subs[1].fragment == Fragment::JUST_1) ||
  893|    761|                    (node.fragment == Fragment::OR_I && node.subs[0].fragment == Fragment::JUST_0) ||
  894|    761|                    (node.fragment == Fragment::OR_I && node.subs[1].fragment == Fragment::JUST_0));
  895|    761|        };
  896|    761|        auto toString = [&ctx, &has_priv_key](Key key) -> std::optional<std::string> {
  897|    761|            bool fragment_has_priv_key{false};
  898|    761|            auto key_str{ctx.ToString(key, fragment_has_priv_key)};
  899|    761|            if (key_str) has_priv_key = has_priv_key || fragment_has_priv_key;
  900|    761|            return key_str;
  901|    761|        };
  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|    761|        const bool is_tapscript{IsTapscript(m_script_ctx)};
  905|    761|        auto upfn = [is_tapscript, &toString](bool wrapped, const Node& node, std::span<std::string> subs) -> std::optional<std::string> {
  906|    761|            std::string ret = wrapped ? ":" : "";
  907|       |
  908|    761|            switch (node.fragment) {
  909|    761|                case Fragment::WRAP_A: return "a" + std::move(subs[0]);
  910|    761|                case Fragment::WRAP_S: return "s" + std::move(subs[0]);
  911|    761|                case Fragment::WRAP_C:
  912|    761|                    if (node.subs[0].fragment == Fragment::PK_K) {
  913|       |                        // pk(K) is syntactic sugar for c:pk_k(K)
  914|    761|                        auto key_str = toString(node.subs[0].keys[0]);
  915|    761|                        if (!key_str) return {};
  916|    761|                        return std::move(ret) + "pk(" + std::move(*key_str) + ")";
  917|    761|                    }
  918|    761|                    if (node.subs[0].fragment == Fragment::PK_H) {
  919|       |                        // pkh(K) is syntactic sugar for c:pk_h(K)
  920|    761|                        auto key_str = toString(node.subs[0].keys[0]);
  921|    761|                        if (!key_str) return {};
  922|    761|                        return std::move(ret) + "pkh(" + std::move(*key_str) + ")";
  923|    761|                    }
  924|    761|                    return "c" + std::move(subs[0]);
  925|    761|                case Fragment::WRAP_D: return "d" + std::move(subs[0]);
  926|    761|                case Fragment::WRAP_V: return "v" + std::move(subs[0]);
  927|    761|                case Fragment::WRAP_J: return "j" + std::move(subs[0]);
  928|    761|                case Fragment::WRAP_N: return "n" + std::move(subs[0]);
  929|    761|                case Fragment::AND_V:
  930|       |                    // t:X is syntactic sugar for and_v(X,1).
  931|    761|                    if (node.subs[1].fragment == Fragment::JUST_1) return "t" + std::move(subs[0]);
  932|    761|                    break;
  933|    761|                case Fragment::OR_I:
  934|    761|                    if (node.subs[0].fragment == Fragment::JUST_0) return "l" + std::move(subs[1]);
  935|    761|                    if (node.subs[1].fragment == Fragment::JUST_0) return "u" + std::move(subs[0]);
  936|    761|                    break;
  937|    761|                default: break;
  938|    761|            }
  939|    761|            switch (node.fragment) {
  940|    761|                case Fragment::PK_K: {
  941|    761|                    auto key_str = toString(node.keys[0]);
  942|    761|                    if (!key_str) return {};
  943|    761|                    return std::move(ret) + "pk_k(" + std::move(*key_str) + ")";
  944|    761|                }
  945|    761|                case Fragment::PK_H: {
  946|    761|                    auto key_str = toString(node.keys[0]);
  947|    761|                    if (!key_str) return {};
  948|    761|                    return std::move(ret) + "pk_h(" + std::move(*key_str) + ")";
  949|    761|                }
  950|    761|                case Fragment::AFTER: return std::move(ret) + "after(" + util::ToString(node.k) + ")";
  951|    761|                case Fragment::OLDER: return std::move(ret) + "older(" + util::ToString(node.k) + ")";
  952|    761|                case Fragment::HASH256: return std::move(ret) + "hash256(" + HexStr(node.data) + ")";
  953|    761|                case Fragment::HASH160: return std::move(ret) + "hash160(" + HexStr(node.data) + ")";
  954|    761|                case Fragment::SHA256: return std::move(ret) + "sha256(" + HexStr(node.data) + ")";
  955|    761|                case Fragment::RIPEMD160: return std::move(ret) + "ripemd160(" + HexStr(node.data) + ")";
  956|    761|                case Fragment::JUST_1: return std::move(ret) + "1";
  957|    761|                case Fragment::JUST_0: return std::move(ret) + "0";
  958|    761|                case Fragment::AND_V: return std::move(ret) + "and_v(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  959|    761|                case Fragment::AND_B: return std::move(ret) + "and_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  960|    761|                case Fragment::OR_B: return std::move(ret) + "or_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  961|    761|                case Fragment::OR_D: return std::move(ret) + "or_d(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  962|    761|                case Fragment::OR_C: return std::move(ret) + "or_c(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  963|    761|                case Fragment::OR_I: return std::move(ret) + "or_i(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  964|    761|                case Fragment::ANDOR:
  965|       |                    // and_n(X,Y) is syntactic sugar for andor(X,Y,0).
  966|    761|                    if (node.subs[2].fragment == Fragment::JUST_0) return std::move(ret) + "and_n(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  967|    761|                    return std::move(ret) + "andor(" + std::move(subs[0]) + "," + std::move(subs[1]) + "," + std::move(subs[2]) + ")";
  968|    761|                case Fragment::MULTI: {
  969|    761|                    CHECK_NONFATAL(!is_tapscript);
  970|    761|                    auto str = std::move(ret) + "multi(" + util::ToString(node.k);
  971|    761|                    for (const auto& key : node.keys) {
  972|    761|                        auto key_str = toString(key);
  973|    761|                        if (!key_str) return {};
  974|    761|                        str += "," + std::move(*key_str);
  975|    761|                    }
  976|    761|                    return std::move(str) + ")";
  977|    761|                }
  978|    761|                case Fragment::MULTI_A: {
  979|    761|                    CHECK_NONFATAL(is_tapscript);
  980|    761|                    auto str = std::move(ret) + "multi_a(" + util::ToString(node.k);
  981|    761|                    for (const auto& key : node.keys) {
  982|    761|                        auto key_str = toString(key);
  983|    761|                        if (!key_str) return {};
  984|    761|                        str += "," + std::move(*key_str);
  985|    761|                    }
  986|    761|                    return std::move(str) + ")";
  987|    761|                }
  988|    761|                case Fragment::THRESH: {
  989|    761|                    auto str = std::move(ret) + "thresh(" + util::ToString(node.k);
  990|    761|                    for (auto& sub : subs) {
  991|    761|                        str += "," + std::move(sub);
  992|    761|                    }
  993|    761|                    return std::move(str) + ")";
  994|    761|                }
  995|    761|                default: break;
  996|    761|            }
  997|    761|            assert(false);
  998|    761|        };
  999|       |
 1000|    761|        return TreeEvalMaybe<std::string>(false, downfn, upfn);
 1001|    761|    }
descriptor.cpp:_ZNK10miniscript4NodeIjE13TreeEvalMaybeINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEbZNKS1_8ToStringIN12_GLOBAL__N_19KeyParserEEENS3_8optionalIS9_EERKT_RbEUlbRKS1_mE_ZNKSA_ISC_EESE_SH_SI_EUlbSK_NS3_4spanIS9_Lm18446744073709551615EEEE_EENSD_ISF_EET0_T1_T2_:
  653|    761|    {
  654|       |        /** Entries of the explicit stack tracked in this algorithm. */
  655|    761|        struct StackElem
  656|    761|        {
  657|    761|            const Node& node; //!< The node being evaluated.
  658|    761|            size_t expanded; //!< How many children of this node have been expanded.
  659|    761|            State state; //!< The state for that node.
  660|       |
  661|    761|            StackElem(const Node& node_, size_t exp_, State&& state_) :
  662|    761|                node(node_), expanded(exp_), state(std::move(state_)) {}
  663|    761|        };
  664|       |        /* Stack of tree nodes being explored. */
  665|    761|        std::vector<StackElem> stack;
  666|       |        /* Results of subtrees so far. Their order and mapping to tree nodes
  667|       |         * is implicitly defined by stack. */
  668|    761|        std::vector<Result> results;
  669|    761|        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|   155k|        while (stack.size()) {
  ------------------
  |  Branch (687:16): [True: 154k, False: 761]
  ------------------
  688|   154k|            const Node& node = stack.back().node;
  689|   154k|            if (stack.back().expanded < node.subs.size()) {
  ------------------
  |  Branch (689:17): [True: 76.7k, False: 77.5k]
  ------------------
  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|  76.7k|                size_t child_index = stack.back().expanded++;
  694|  76.7k|                State child_state = downfn(stack.back().state, node, child_index);
  695|  76.7k|                stack.emplace_back(node.subs[child_index], 0, std::move(child_state));
  696|  76.7k|                continue;
  697|  76.7k|            }
  698|       |            // Invoke upfn with the last node.subs.size() elements of results as input.
  699|   154k|            assert(results.size() >= node.subs.size());
  ------------------
  |  Branch (699:13): [True: 77.5k, False: 0]
  ------------------
  700|  77.5k|            std::optional<Result> result{upfn(std::move(stack.back().state), node,
  701|  77.5k|                std::span<Result>{results}.last(node.subs.size()))};
  702|       |            // If evaluation returns std::nullopt, abort immediately.
  703|  77.5k|            if (!result) return {};
  ------------------
  |  Branch (703:17): [True: 0, False: 77.5k]
  ------------------
  704|       |            // Replace the last node.subs.size() elements of results with the new result.
  705|  77.5k|            results.erase(results.end() - node.subs.size(), results.end());
  706|  77.5k|            results.push_back(std::move(*result));
  707|  77.5k|            stack.pop_back();
  708|  77.5k|        }
  709|       |        // The final remaining results element is the root result, return it.
  710|    761|        assert(results.size() >= 1);
  ------------------
  |  Branch (710:9): [True: 761, False: 0]
  ------------------
  711|    761|        CHECK_NONFATAL(results.size() == 1);
  ------------------
  |  |  113|    761|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  712|    761|        return std::move(results[0]);
  713|    761|    }
descriptor.cpp:_ZZNK10miniscript4NodeIjE13TreeEvalMaybeINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEbZNKS1_8ToStringIN12_GLOBAL__N_19KeyParserEEENS3_8optionalIS9_EERKT_RbEUlbRKS1_mE_ZNKSA_ISC_EESE_SH_SI_EUlbSK_NS3_4spanIS9_Lm18446744073709551615EEEE_EENSD_ISF_EET0_T1_T2_EN9StackElemC2ESK_mOb:
  662|  77.5k|                node(node_), expanded(exp_), state(std::move(state_)) {}
descriptor.cpp:_ZZNK10miniscript4NodeIjE8ToStringIN12_GLOBAL__N_19KeyParserEEENSt3__18optionalINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEERKT_RbENKUlbRKS1_mE_clEbSJ_m:
  887|  76.7k|        auto downfn = [](bool, const Node& node, size_t) {
  888|  76.7k|            return (node.fragment == Fragment::WRAP_A || node.fragment == Fragment::WRAP_S ||
  ------------------
  |  Branch (888:21): [True: 1.97k, False: 74.8k]
  |  Branch (888:58): [True: 710, False: 74.1k]
  ------------------
  889|  74.1k|                    node.fragment == Fragment::WRAP_D || node.fragment == Fragment::WRAP_V ||
  ------------------
  |  Branch (889:21): [True: 502, False: 73.6k]
  |  Branch (889:58): [True: 3.88k, False: 69.7k]
  ------------------
  890|  69.7k|                    node.fragment == Fragment::WRAP_J || node.fragment == Fragment::WRAP_N ||
  ------------------
  |  Branch (890:21): [True: 1.17k, False: 68.5k]
  |  Branch (890:58): [True: 9.13k, False: 59.4k]
  ------------------
  891|  59.4k|                    node.fragment == Fragment::WRAP_C ||
  ------------------
  |  Branch (891:21): [True: 284, False: 59.1k]
  ------------------
  892|  59.1k|                    (node.fragment == Fragment::AND_V && node.subs[1].fragment == Fragment::JUST_1) ||
  ------------------
  |  Branch (892:22): [True: 6.42k, False: 52.6k]
  |  Branch (892:58): [True: 5.32k, False: 1.10k]
  ------------------
  893|  53.8k|                    (node.fragment == Fragment::OR_I && node.subs[0].fragment == Fragment::JUST_0) ||
  ------------------
  |  Branch (893:22): [True: 35.5k, False: 18.2k]
  |  Branch (893:57): [True: 20.6k, False: 14.9k]
  ------------------
  894|  33.1k|                    (node.fragment == Fragment::OR_I && node.subs[1].fragment == Fragment::JUST_0));
  ------------------
  |  Branch (894:22): [True: 14.9k, False: 18.2k]
  |  Branch (894:57): [True: 13.8k, False: 1.13k]
  ------------------
  895|  76.7k|        };
descriptor.cpp:_ZZNK10miniscript4NodeIjE8ToStringIN12_GLOBAL__N_19KeyParserEEENSt3__18optionalINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEERKT_RbENKUlbRKS1_NS5_4spanISC_Lm18446744073709551615EEEE_clEbSJ_SL_:
  905|  77.5k|        auto upfn = [is_tapscript, &toString](bool wrapped, const Node& node, std::span<std::string> subs) -> std::optional<std::string> {
  906|  77.5k|            std::string ret = wrapped ? ":" : "";
  ------------------
  |  Branch (906:31): [True: 57.4k, False: 20.1k]
  ------------------
  907|       |
  908|  77.5k|            switch (node.fragment) {
  909|  1.97k|                case Fragment::WRAP_A: return "a" + std::move(subs[0]);
  ------------------
  |  Branch (909:17): [True: 1.97k, False: 75.5k]
  ------------------
  910|    710|                case Fragment::WRAP_S: return "s" + std::move(subs[0]);
  ------------------
  |  Branch (910:17): [True: 710, False: 76.8k]
  ------------------
  911|    284|                case Fragment::WRAP_C:
  ------------------
  |  Branch (911:17): [True: 284, False: 77.2k]
  ------------------
  912|    284|                    if (node.subs[0].fragment == Fragment::PK_K) {
  ------------------
  |  Branch (912:25): [True: 216, False: 68]
  ------------------
  913|       |                        // pk(K) is syntactic sugar for c:pk_k(K)
  914|    216|                        auto key_str = toString(node.subs[0].keys[0]);
  915|    216|                        if (!key_str) return {};
  ------------------
  |  Branch (915:29): [True: 0, False: 216]
  ------------------
  916|    216|                        return std::move(ret) + "pk(" + std::move(*key_str) + ")";
  917|    216|                    }
  918|     68|                    if (node.subs[0].fragment == Fragment::PK_H) {
  ------------------
  |  Branch (918:25): [True: 42, False: 26]
  ------------------
  919|       |                        // pkh(K) is syntactic sugar for c:pk_h(K)
  920|     42|                        auto key_str = toString(node.subs[0].keys[0]);
  921|     42|                        if (!key_str) return {};
  ------------------
  |  Branch (921:29): [True: 0, False: 42]
  ------------------
  922|     42|                        return std::move(ret) + "pkh(" + std::move(*key_str) + ")";
  923|     42|                    }
  924|     26|                    return "c" + std::move(subs[0]);
  925|    502|                case Fragment::WRAP_D: return "d" + std::move(subs[0]);
  ------------------
  |  Branch (925:17): [True: 502, False: 77.0k]
  ------------------
  926|  3.88k|                case Fragment::WRAP_V: return "v" + std::move(subs[0]);
  ------------------
  |  Branch (926:17): [True: 3.88k, False: 73.6k]
  ------------------
  927|  1.17k|                case Fragment::WRAP_J: return "j" + std::move(subs[0]);
  ------------------
  |  Branch (927:17): [True: 1.17k, False: 76.3k]
  ------------------
  928|  9.13k|                case Fragment::WRAP_N: return "n" + std::move(subs[0]);
  ------------------
  |  Branch (928:17): [True: 9.13k, False: 68.4k]
  ------------------
  929|  3.21k|                case Fragment::AND_V:
  ------------------
  |  Branch (929:17): [True: 3.21k, False: 74.3k]
  ------------------
  930|       |                    // t:X is syntactic sugar for and_v(X,1).
  931|  3.21k|                    if (node.subs[1].fragment == Fragment::JUST_1) return "t" + std::move(subs[0]);
  ------------------
  |  Branch (931:25): [True: 2.66k, False: 552]
  ------------------
  932|    552|                    break;
  933|  17.7k|                case Fragment::OR_I:
  ------------------
  |  Branch (933:17): [True: 17.7k, False: 59.7k]
  ------------------
  934|  17.7k|                    if (node.subs[0].fragment == Fragment::JUST_0) return "l" + std::move(subs[1]);
  ------------------
  |  Branch (934:25): [True: 10.3k, False: 7.47k]
  ------------------
  935|  7.47k|                    if (node.subs[1].fragment == Fragment::JUST_0) return "u" + std::move(subs[0]);
  ------------------
  |  Branch (935:25): [True: 6.91k, False: 565]
  ------------------
  936|    565|                    break;
  937|  38.8k|                default: break;
  ------------------
  |  Branch (937:17): [True: 38.8k, False: 38.6k]
  ------------------
  938|  77.5k|            }
  939|  40.0k|            switch (node.fragment) {
  940|    240|                case Fragment::PK_K: {
  ------------------
  |  Branch (940:17): [True: 240, False: 39.7k]
  ------------------
  941|    240|                    auto key_str = toString(node.keys[0]);
  942|    240|                    if (!key_str) return {};
  ------------------
  |  Branch (942:25): [True: 0, False: 240]
  ------------------
  943|    240|                    return std::move(ret) + "pk_k(" + std::move(*key_str) + ")";
  944|    240|                }
  945|     84|                case Fragment::PK_H: {
  ------------------
  |  Branch (945:17): [True: 84, False: 39.9k]
  ------------------
  946|     84|                    auto key_str = toString(node.keys[0]);
  947|     84|                    if (!key_str) return {};
  ------------------
  |  Branch (947:25): [True: 0, False: 84]
  ------------------
  948|     84|                    return std::move(ret) + "pk_h(" + std::move(*key_str) + ")";
  949|     84|                }
  950|    396|                case Fragment::AFTER: return std::move(ret) + "after(" + util::ToString(node.k) + ")";
  ------------------
  |  Branch (950:17): [True: 396, False: 39.6k]
  ------------------
  951|    328|                case Fragment::OLDER: return std::move(ret) + "older(" + util::ToString(node.k) + ")";
  ------------------
  |  Branch (951:17): [True: 328, False: 39.6k]
  ------------------
  952|     38|                case Fragment::HASH256: return std::move(ret) + "hash256(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (952:17): [True: 38, False: 39.9k]
  ------------------
  953|     67|                case Fragment::HASH160: return std::move(ret) + "hash160(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (953:17): [True: 67, False: 39.9k]
  ------------------
  954|      3|                case Fragment::SHA256: return std::move(ret) + "sha256(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (954:17): [True: 3, False: 40.0k]
  ------------------
  955|     55|                case Fragment::RIPEMD160: return std::move(ret) + "ripemd160(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (955:17): [True: 55, False: 39.9k]
  ------------------
  956|  9.40k|                case Fragment::JUST_1: return std::move(ret) + "1";
  ------------------
  |  Branch (956:17): [True: 9.40k, False: 30.6k]
  ------------------
  957|  24.8k|                case Fragment::JUST_0: return std::move(ret) + "0";
  ------------------
  |  Branch (957:17): [True: 24.8k, False: 15.2k]
  ------------------
  958|    552|                case Fragment::AND_V: return std::move(ret) + "and_v(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (958:17): [True: 552, False: 39.4k]
  ------------------
  959|    319|                case Fragment::AND_B: return std::move(ret) + "and_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (959:17): [True: 319, False: 39.6k]
  ------------------
  960|    286|                case Fragment::OR_B: return std::move(ret) + "or_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (960:17): [True: 286, False: 39.7k]
  ------------------
  961|    424|                case Fragment::OR_D: return std::move(ret) + "or_d(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (961:17): [True: 424, False: 39.5k]
  ------------------
  962|    457|                case Fragment::OR_C: return std::move(ret) + "or_c(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (962:17): [True: 457, False: 39.5k]
  ------------------
  963|    565|                case Fragment::OR_I: return std::move(ret) + "or_i(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (963:17): [True: 565, False: 39.4k]
  ------------------
  964|  1.02k|                case Fragment::ANDOR:
  ------------------
  |  Branch (964:17): [True: 1.02k, False: 38.9k]
  ------------------
  965|       |                    // and_n(X,Y) is syntactic sugar for andor(X,Y,0).
  966|  1.02k|                    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: 489, False: 540]
  ------------------
  967|    540|                    return std::move(ret) + "andor(" + std::move(subs[0]) + "," + std::move(subs[1]) + "," + std::move(subs[2]) + ")";
  968|    217|                case Fragment::MULTI: {
  ------------------
  |  Branch (968:17): [True: 217, False: 39.7k]
  ------------------
  969|    217|                    CHECK_NONFATAL(!is_tapscript);
  ------------------
  |  |  113|    217|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  970|    217|                    auto str = std::move(ret) + "multi(" + util::ToString(node.k);
  971|    853|                    for (const auto& key : node.keys) {
  ------------------
  |  Branch (971:42): [True: 853, False: 217]
  ------------------
  972|    853|                        auto key_str = toString(key);
  973|    853|                        if (!key_str) return {};
  ------------------
  |  Branch (973:29): [True: 0, False: 853]
  ------------------
  974|    853|                        str += "," + std::move(*key_str);
  975|    853|                    }
  976|    217|                    return std::move(str) + ")";
  977|    217|                }
  978|     24|                case Fragment::MULTI_A: {
  ------------------
  |  Branch (978:17): [True: 24, False: 39.9k]
  ------------------
  979|     24|                    CHECK_NONFATAL(is_tapscript);
  ------------------
  |  |  113|     24|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  980|     24|                    auto str = std::move(ret) + "multi_a(" + util::ToString(node.k);
  981|    488|                    for (const auto& key : node.keys) {
  ------------------
  |  Branch (981:42): [True: 488, False: 24]
  ------------------
  982|    488|                        auto key_str = toString(key);
  983|    488|                        if (!key_str) return {};
  ------------------
  |  Branch (983:29): [True: 0, False: 488]
  ------------------
  984|    488|                        str += "," + std::move(*key_str);
  985|    488|                    }
  986|     24|                    return std::move(str) + ")";
  987|     24|                }
  988|    717|                case Fragment::THRESH: {
  ------------------
  |  Branch (988:17): [True: 717, False: 39.2k]
  ------------------
  989|    717|                    auto str = std::move(ret) + "thresh(" + util::ToString(node.k);
  990|  11.0k|                    for (auto& sub : subs) {
  ------------------
  |  Branch (990:36): [True: 11.0k, False: 717]
  ------------------
  991|  11.0k|                        str += "," + std::move(sub);
  992|  11.0k|                    }
  993|    717|                    return std::move(str) + ")";
  994|     24|                }
  995|      0|                default: break;
  ------------------
  |  Branch (995:17): [True: 0, False: 40.0k]
  ------------------
  996|  40.0k|            }
  997|  40.0k|            assert(false);
  ------------------
  |  Branch (997:13): [Folded, False: 0]
  ------------------
  998|      0|        };
descriptor.cpp:_ZZNK10miniscript4NodeIjE8ToStringIN12_GLOBAL__N_19KeyParserEEENSt3__18optionalINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEERKT_RbENKUljE_clEj:
  896|  1.92k|        auto toString = [&ctx, &has_priv_key](Key key) -> std::optional<std::string> {
  897|  1.92k|            bool fragment_has_priv_key{false};
  898|  1.92k|            auto key_str{ctx.ToString(key, fragment_has_priv_key)};
  899|  1.92k|            if (key_str) has_priv_key = has_priv_key || fragment_has_priv_key;
  ------------------
  |  Branch (899:17): [True: 1.92k, False: 0]
  |  Branch (899:41): [True: 0, False: 1.92k]
  |  Branch (899:57): [True: 0, False: 1.92k]
  ------------------
  900|  1.92k|            return key_str;
  901|  1.92k|        };
_ZNK10miniscript4NodeIjE7IsValidEv:
 1675|  1.43M|    bool IsValid() const {
 1676|  1.43M|        if (GetType() == ""_mst) return false;
  ------------------
  |  Branch (1676:13): [True: 40.9k, False: 1.39M]
  ------------------
 1677|  1.39M|        return ScriptSize() <= internal::MaxScriptSize(m_script_ctx);
 1678|  1.43M|    }
_ZNK10miniscript4NodeIjE14IsNonMalleableEv:
 1684|  1.10M|    bool IsNonMalleable() const { return GetType() << "m"_mst; }
_ZNK10miniscript4NodeIjE14NeedsSignatureEv:
 1687|  8.48k|    bool NeedsSignature() const { return GetType() << "s"_mst; }
_ZNK10miniscript4NodeIjE17CheckTimeLocksMixEv:
 1690|  1.10M|    bool CheckTimeLocksMix() const { return GetType() << "k"_mst; }
_ZNK10miniscript4NodeIjE17CheckDuplicateKeyEv:
 1693|  1.10M|    bool CheckDuplicateKey() const { return has_duplicate_keys && !*has_duplicate_keys; }
  ------------------
  |  Branch (1693:45): [True: 1.10M, False: 0]
  |  Branch (1693:67): [True: 1.10M, False: 244]
  ------------------
_ZNK10miniscript4NodeIjE18ValidSatisfactionsEv:
 1696|  1.14M|    bool ValidSatisfactions() const { return IsValid() && CheckOpsLimit() && CheckStackSize(); }
  ------------------
  |  Branch (1696:46): [True: 1.10M, False: 39.9k]
  |  Branch (1696:59): [True: 1.10M, False: 66]
  |  Branch (1696:78): [True: 1.10M, False: 2]
  ------------------
_ZNK10miniscript4NodeIjE13CheckOpsLimitEv:
 1571|  1.10M|    bool CheckOpsLimit() const {
 1572|  1.10M|        if (IsTapscript(m_script_ctx)) return true;
  ------------------
  |  Branch (1572:13): [True: 1.01M, False: 91.2k]
  ------------------
 1573|  91.2k|        if (const auto ops = GetOps()) return *ops <= MAX_OPS_PER_SCRIPT;
  ------------------
  |  Branch (1573:24): [True: 36.0k, False: 55.1k]
  ------------------
 1574|  55.1k|        return true;
 1575|  91.2k|    }
_ZNK10miniscript4NodeIjE6GetOpsEv:
 1562|  91.2k|    std::optional<uint32_t> GetOps() const {
 1563|  91.2k|        if (!ops.sat.Valid()) return {};
  ------------------
  |  Branch (1563:13): [True: 55.1k, False: 36.0k]
  ------------------
 1564|  36.0k|        return ops.count + ops.sat.Value();
 1565|  91.2k|    }
_ZNK10miniscript8internal6MaxIntIjE5ValidEv:
  374|  96.0k|    bool Valid() const { return valid; }
_ZNK10miniscript8internal6MaxIntIjE5ValueEv:
  375|  40.8k|    I Value() const { return value; }
_ZNK10miniscript4NodeIjE14CheckStackSizeEv:
 1595|  1.10M|    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|  1.10M|        if (IsTapscript(m_script_ctx)) {
  ------------------
  |  Branch (1598:13): [True: 1.01M, False: 91.1k]
  ------------------
 1599|  1.01M|            if (const auto exec_ss = GetExecStackSize()) return exec_ss <= MAX_STACK_SIZE;
  ------------------
  |  Branch (1599:28): [True: 257k, False: 758k]
  ------------------
 1600|   758k|            return true;
 1601|  1.01M|        }
 1602|  91.1k|        if (const auto ss = GetStackSize()) return *ss <= MAX_STANDARD_P2WSH_STACK_ITEMS;
  ------------------
  |  Branch (1602:24): [True: 36.0k, False: 55.1k]
  ------------------
 1603|  55.1k|        return true;
 1604|  91.1k|    }
_ZNK10miniscript4NodeIjE16GetExecStackSizeEv:
 1589|  1.01M|    std::optional<uint32_t> GetExecStackSize() const {
 1590|  1.01M|        if (!ss.Sat().Valid()) return {};
  ------------------
  |  Branch (1590:13): [True: 758k, False: 257k]
  ------------------
 1591|   257k|        return ss.Sat().Exec() + static_cast<int32_t>(IsBKW());
 1592|  1.01M|    }
_ZNK10miniscript8internal7SatInfo4ExecEv:
  460|   257k|    int32_t Exec() const { return exec; }
descriptor.cpp:_ZN10miniscript11ForEachNodeIjTkNSt3__19invocableIRKNS_4NodeIT_EEEEZN12_GLOBAL__N_120MiniscriptDescriptorC1ENS1_6vectorINS1_10unique_ptrINS8_14PubkeyProviderENS1_14default_deleteISC_EEEENS1_9allocatorISF_EEEEONS3_IjEEEUlRKSJ_E_EEvS7_OT0_:
  200|  11.1k|{
  201|  11.1k|    std::vector<std::reference_wrapper<const Node<Key>>> stack{root};
  202|   261k|    while (!stack.empty()) {
  ------------------
  |  Branch (202:12): [True: 250k, False: 11.1k]
  ------------------
  203|   250k|        const Node<Key>& node = stack.back();
  204|   250k|        std::invoke(fn, node);
  205|   250k|        stack.pop_back();
  206|   250k|        for (const auto& sub : node.Subs()) {
  ------------------
  |  Branch (206:30): [True: 239k, False: 250k]
  ------------------
  207|   239k|            stack.emplace_back(sub);
  208|   239k|        }
  209|   250k|    }
  210|  11.1k|}
_ZNK10miniscript4NodeIjE8FragmentEv:
  587|   250k|    enum Fragment Fragment() const { return fragment; }
_ZNK10miniscript4NodeIjE1KEv:
  588|    411|    uint32_t K() const { return k; }
_ZNK10miniscript4NodeIjE4SubsEv:
  591|   250k|    const std::vector<Node>& Subs() const { return subs; }
_ZNK10miniscript4NodeIjE8GetMsCtxEv:
 1620|  9.39k|    MiniscriptContext GetMsCtx() const { return m_script_ctx; }
descriptor.cpp:_ZNK10miniscript4NodeIjE8ToScriptIN12_GLOBAL__N_111ScriptMakerEEE7CScriptRKT_:
  799|  9.39k|    {
  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|  9.39k|        auto downfn = [](bool verify, const Node& node, size_t index) {
  804|       |            // For WRAP_V, the subexpression is certainly followed by OP_VERIFY.
  805|  9.39k|            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|  9.39k|            if (node.fragment == Fragment::WRAP_S ||
  809|  9.39k|                (node.fragment == Fragment::AND_V && index == 1)) return verify;
  810|  9.39k|            return false;
  811|  9.39k|        };
  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|  9.39k|        const bool is_tapscript{IsTapscript(m_script_ctx)};
  815|  9.39k|        auto upfn = [&ctx, is_tapscript](bool verify, const Node& node, std::span<CScript> subs) -> CScript {
  816|  9.39k|            switch (node.fragment) {
  817|  9.39k|                case Fragment::PK_K: return BuildScript(ctx.ToPKBytes(node.keys[0]));
  818|  9.39k|                case Fragment::PK_H: return BuildScript(OP_DUP, OP_HASH160, ctx.ToPKHBytes(node.keys[0]), OP_EQUALVERIFY);
  819|  9.39k|                case Fragment::OLDER: return BuildScript(node.k, OP_CHECKSEQUENCEVERIFY);
  820|  9.39k|                case Fragment::AFTER: return BuildScript(node.k, OP_CHECKLOCKTIMEVERIFY);
  821|  9.39k|                case Fragment::SHA256: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_SHA256, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  822|  9.39k|                case Fragment::RIPEMD160: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_RIPEMD160, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  823|  9.39k|                case Fragment::HASH256: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_HASH256, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  824|  9.39k|                case Fragment::HASH160: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_HASH160, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  825|  9.39k|                case Fragment::WRAP_A: return BuildScript(OP_TOALTSTACK, subs[0], OP_FROMALTSTACK);
  826|  9.39k|                case Fragment::WRAP_S: return BuildScript(OP_SWAP, subs[0]);
  827|  9.39k|                case Fragment::WRAP_C: return BuildScript(std::move(subs[0]), verify ? OP_CHECKSIGVERIFY : OP_CHECKSIG);
  828|  9.39k|                case Fragment::WRAP_D: return BuildScript(OP_DUP, OP_IF, subs[0], OP_ENDIF);
  829|  9.39k|                case Fragment::WRAP_V: {
  830|  9.39k|                    if (node.subs[0].GetType() << "x"_mst) {
  831|  9.39k|                        return BuildScript(std::move(subs[0]), OP_VERIFY);
  832|  9.39k|                    } else {
  833|  9.39k|                        return std::move(subs[0]);
  834|  9.39k|                    }
  835|  9.39k|                }
  836|  9.39k|                case Fragment::WRAP_J: return BuildScript(OP_SIZE, OP_0NOTEQUAL, OP_IF, subs[0], OP_ENDIF);
  837|  9.39k|                case Fragment::WRAP_N: return BuildScript(std::move(subs[0]), OP_0NOTEQUAL);
  838|  9.39k|                case Fragment::JUST_1: return BuildScript(OP_1);
  839|  9.39k|                case Fragment::JUST_0: return BuildScript(OP_0);
  840|  9.39k|                case Fragment::AND_V: return BuildScript(std::move(subs[0]), subs[1]);
  841|  9.39k|                case Fragment::AND_B: return BuildScript(std::move(subs[0]), subs[1], OP_BOOLAND);
  842|  9.39k|                case Fragment::OR_B: return BuildScript(std::move(subs[0]), subs[1], OP_BOOLOR);
  843|  9.39k|                case Fragment::OR_D: return BuildScript(std::move(subs[0]), OP_IFDUP, OP_NOTIF, subs[1], OP_ENDIF);
  844|  9.39k|                case Fragment::OR_C: return BuildScript(std::move(subs[0]), OP_NOTIF, subs[1], OP_ENDIF);
  845|  9.39k|                case Fragment::OR_I: return BuildScript(OP_IF, subs[0], OP_ELSE, subs[1], OP_ENDIF);
  846|  9.39k|                case Fragment::ANDOR: return BuildScript(std::move(subs[0]), OP_NOTIF, subs[2], OP_ELSE, subs[1], OP_ENDIF);
  847|  9.39k|                case Fragment::MULTI: {
  848|  9.39k|                    CHECK_NONFATAL(!is_tapscript);
  849|  9.39k|                    CScript script = BuildScript(node.k);
  850|  9.39k|                    for (const auto& key : node.keys) {
  851|  9.39k|                        script = BuildScript(std::move(script), ctx.ToPKBytes(key));
  852|  9.39k|                    }
  853|  9.39k|                    return BuildScript(std::move(script), node.keys.size(), verify ? OP_CHECKMULTISIGVERIFY : OP_CHECKMULTISIG);
  854|  9.39k|                }
  855|  9.39k|                case Fragment::MULTI_A: {
  856|  9.39k|                    CHECK_NONFATAL(is_tapscript);
  857|  9.39k|                    CScript script = BuildScript(ctx.ToPKBytes(*node.keys.begin()), OP_CHECKSIG);
  858|  9.39k|                    for (auto it = node.keys.begin() + 1; it != node.keys.end(); ++it) {
  859|  9.39k|                        script = BuildScript(std::move(script), ctx.ToPKBytes(*it), OP_CHECKSIGADD);
  860|  9.39k|                    }
  861|  9.39k|                    return BuildScript(std::move(script), node.k, verify ? OP_NUMEQUALVERIFY : OP_NUMEQUAL);
  862|  9.39k|                }
  863|  9.39k|                case Fragment::THRESH: {
  864|  9.39k|                    CScript script = std::move(subs[0]);
  865|  9.39k|                    for (size_t i = 1; i < subs.size(); ++i) {
  866|  9.39k|                        script = BuildScript(std::move(script), subs[i], OP_ADD);
  867|  9.39k|                    }
  868|  9.39k|                    return BuildScript(std::move(script), node.k, verify ? OP_EQUALVERIFY : OP_EQUAL);
  869|  9.39k|                }
  870|  9.39k|            }
  871|  9.39k|            assert(false);
  872|  9.39k|        };
  873|  9.39k|        return TreeEval<CScript>(false, downfn, upfn);
  874|  9.39k|    }
descriptor.cpp:_ZNK10miniscript4NodeIjE8TreeEvalI7CScriptbRZNKS1_8ToScriptIN12_GLOBAL__N_111ScriptMakerEEES3_RKT_EUlbRKS1_mE_ZNKS4_IS6_EES3_S9_EUlbSB_NSt3__14spanIS3_Lm18446744073709551615EEEE_EES7_T0_OT1_T2_:
  732|  9.39k|    {
  733|       |        // Invoke TreeEvalMaybe with upfn wrapped to return std::optional<Result>, and then
  734|       |        // unconditionally dereference the result (it cannot be std::nullopt).
  735|  9.39k|        return std::move(*TreeEvalMaybe<Result>(std::move(root_state),
  736|  9.39k|            std::forward<DownFn>(downfn),
  737|  9.39k|            [&upfn](State&& state, const Node& node, std::span<Result> subs) {
  738|  9.39k|                Result res{upfn(std::move(state), node, subs)};
  739|  9.39k|                return std::optional<Result>(std::move(res));
  740|  9.39k|            }
  741|  9.39k|        ));
  742|  9.39k|    }
descriptor.cpp:_ZNK10miniscript4NodeIjE13TreeEvalMaybeI7CScriptbZNKS1_8ToScriptIN12_GLOBAL__N_111ScriptMakerEEES3_RKT_EUlbRKS1_mE_ZNKS1_8TreeEvalIS3_bRSC_ZNKS4_IS6_EES3_S9_EUlbSB_NSt3__14spanIS3_Lm18446744073709551615EEEE_EES7_T0_OT1_T2_EUlObSB_SH_E_EENSF_8optionalIS7_EESJ_SK_SM_:
  653|  9.39k|    {
  654|       |        /** Entries of the explicit stack tracked in this algorithm. */
  655|  9.39k|        struct StackElem
  656|  9.39k|        {
  657|  9.39k|            const Node& node; //!< The node being evaluated.
  658|  9.39k|            size_t expanded; //!< How many children of this node have been expanded.
  659|  9.39k|            State state; //!< The state for that node.
  660|       |
  661|  9.39k|            StackElem(const Node& node_, size_t exp_, State&& state_) :
  662|  9.39k|                node(node_), expanded(exp_), state(std::move(state_)) {}
  663|  9.39k|        };
  664|       |        /* Stack of tree nodes being explored. */
  665|  9.39k|        std::vector<StackElem> stack;
  666|       |        /* Results of subtrees so far. Their order and mapping to tree nodes
  667|       |         * is implicitly defined by stack. */
  668|  9.39k|        std::vector<Result> results;
  669|  9.39k|        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|   383k|        while (stack.size()) {
  ------------------
  |  Branch (687:16): [True: 374k, False: 9.39k]
  ------------------
  688|   374k|            const Node& node = stack.back().node;
  689|   374k|            if (stack.back().expanded < node.subs.size()) {
  ------------------
  |  Branch (689:17): [True: 182k, False: 191k]
  ------------------
  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|   182k|                size_t child_index = stack.back().expanded++;
  694|   182k|                State child_state = downfn(stack.back().state, node, child_index);
  695|   182k|                stack.emplace_back(node.subs[child_index], 0, std::move(child_state));
  696|   182k|                continue;
  697|   182k|            }
  698|       |            // Invoke upfn with the last node.subs.size() elements of results as input.
  699|   374k|            assert(results.size() >= node.subs.size());
  ------------------
  |  Branch (699:13): [True: 191k, False: 0]
  ------------------
  700|   191k|            std::optional<Result> result{upfn(std::move(stack.back().state), node,
  701|   191k|                std::span<Result>{results}.last(node.subs.size()))};
  702|       |            // If evaluation returns std::nullopt, abort immediately.
  703|   191k|            if (!result) return {};
  ------------------
  |  Branch (703:17): [True: 0, False: 191k]
  ------------------
  704|       |            // Replace the last node.subs.size() elements of results with the new result.
  705|   191k|            results.erase(results.end() - node.subs.size(), results.end());
  706|   191k|            results.push_back(std::move(*result));
  707|   191k|            stack.pop_back();
  708|   191k|        }
  709|       |        // The final remaining results element is the root result, return it.
  710|  9.39k|        assert(results.size() >= 1);
  ------------------
  |  Branch (710:9): [True: 9.39k, False: 0]
  ------------------
  711|  9.39k|        CHECK_NONFATAL(results.size() == 1);
  ------------------
  |  |  113|  9.39k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  712|  9.39k|        return std::move(results[0]);
  713|  9.39k|    }
descriptor.cpp:_ZZNK10miniscript4NodeIjE13TreeEvalMaybeI7CScriptbZNKS1_8ToScriptIN12_GLOBAL__N_111ScriptMakerEEES3_RKT_EUlbRKS1_mE_ZNKS1_8TreeEvalIS3_bRSC_ZNKS4_IS6_EES3_S9_EUlbSB_NSt3__14spanIS3_Lm18446744073709551615EEEE_EES7_T0_OT1_T2_EUlObSB_SH_E_EENSF_8optionalIS7_EESJ_SK_SM_EN9StackElemC2ESB_mSN_:
  662|   191k|                node(node_), expanded(exp_), state(std::move(state_)) {}
descriptor.cpp:_ZZNK10miniscript4NodeIjE8ToScriptIN12_GLOBAL__N_111ScriptMakerEEE7CScriptRKT_ENKUlbRKS1_mE_clEbSA_m:
  803|   182k|        auto downfn = [](bool verify, const Node& node, size_t index) {
  804|       |            // For WRAP_V, the subexpression is certainly followed by OP_VERIFY.
  805|   182k|            if (node.fragment == Fragment::WRAP_V) return true;
  ------------------
  |  Branch (805:17): [True: 10.2k, False: 172k]
  ------------------
  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|   172k|            if (node.fragment == Fragment::WRAP_S ||
  ------------------
  |  Branch (808:17): [True: 116, False: 171k]
  ------------------
  809|   171k|                (node.fragment == Fragment::AND_V && index == 1)) return verify;
  ------------------
  |  Branch (809:18): [True: 19.7k, False: 152k]
  |  Branch (809:54): [True: 9.89k, False: 9.89k]
  ------------------
  810|   162k|            return false;
  811|   172k|        };
descriptor.cpp:_ZZNK10miniscript4NodeIjE8TreeEvalI7CScriptbRZNKS1_8ToScriptIN12_GLOBAL__N_111ScriptMakerEEES3_RKT_EUlbRKS1_mE_ZNKS4_IS6_EES3_S9_EUlbSB_NSt3__14spanIS3_Lm18446744073709551615EEEE_EES7_T0_OT1_T2_ENKUlObSB_SG_E_clESM_SB_SG_:
  737|   191k|            [&upfn](State&& state, const Node& node, std::span<Result> subs) {
  738|   191k|                Result res{upfn(std::move(state), node, subs)};
  739|   191k|                return std::optional<Result>(std::move(res));
  740|   191k|            }
descriptor.cpp:_ZZNK10miniscript4NodeIjE8ToScriptIN12_GLOBAL__N_111ScriptMakerEEE7CScriptRKT_ENKUlbRKS1_NSt3__14spanIS5_Lm18446744073709551615EEEE_clEbSA_SD_:
  815|   191k|        auto upfn = [&ctx, is_tapscript](bool verify, const Node& node, std::span<CScript> subs) -> CScript {
  816|   191k|            switch (node.fragment) {
  ------------------
  |  Branch (816:21): [True: 191k, False: 0]
  ------------------
  817|  2.59k|                case Fragment::PK_K: return BuildScript(ctx.ToPKBytes(node.keys[0]));
  ------------------
  |  Branch (817:17): [True: 2.59k, False: 189k]
  ------------------
  818|  1.73k|                case Fragment::PK_H: return BuildScript(OP_DUP, OP_HASH160, ctx.ToPKHBytes(node.keys[0]), OP_EQUALVERIFY);
  ------------------
  |  Branch (818:17): [True: 1.73k, False: 190k]
  ------------------
  819|    370|                case Fragment::OLDER: return BuildScript(node.k, OP_CHECKSEQUENCEVERIFY);
  ------------------
  |  Branch (819:17): [True: 370, False: 191k]
  ------------------
  820|    150|                case Fragment::AFTER: return BuildScript(node.k, OP_CHECKLOCKTIMEVERIFY);
  ------------------
  |  Branch (820:17): [True: 150, False: 191k]
  ------------------
  821|      2|                case Fragment::SHA256: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_SHA256, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  ------------------
  |  Branch (821:17): [True: 2, False: 191k]
  |  Branch (821:110): [True: 0, False: 2]
  ------------------
  822|      4|                case Fragment::RIPEMD160: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_RIPEMD160, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  ------------------
  |  Branch (822:17): [True: 4, False: 191k]
  |  Branch (822:116): [True: 2, False: 2]
  ------------------
  823|     20|                case Fragment::HASH256: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_HASH256, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  ------------------
  |  Branch (823:17): [True: 20, False: 191k]
  |  Branch (823:112): [True: 14, False: 6]
  ------------------
  824|     12|                case Fragment::HASH160: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_HASH160, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  ------------------
  |  Branch (824:17): [True: 12, False: 191k]
  |  Branch (824:112): [True: 10, False: 2]
  ------------------
  825|    812|                case Fragment::WRAP_A: return BuildScript(OP_TOALTSTACK, subs[0], OP_FROMALTSTACK);
  ------------------
  |  Branch (825:17): [True: 812, False: 190k]
  ------------------
  826|    116|                case Fragment::WRAP_S: return BuildScript(OP_SWAP, subs[0]);
  ------------------
  |  Branch (826:17): [True: 116, False: 191k]
  ------------------
  827|  4.33k|                case Fragment::WRAP_C: return BuildScript(std::move(subs[0]), verify ? OP_CHECKSIGVERIFY : OP_CHECKSIG);
  ------------------
  |  Branch (827:17): [True: 4.33k, False: 187k]
  |  Branch (827:79): [True: 2.00k, False: 2.32k]
  ------------------
  828|    204|                case Fragment::WRAP_D: return BuildScript(OP_DUP, OP_IF, subs[0], OP_ENDIF);
  ------------------
  |  Branch (828:17): [True: 204, False: 191k]
  ------------------
  829|  10.2k|                case Fragment::WRAP_V: {
  ------------------
  |  Branch (829:17): [True: 10.2k, False: 181k]
  ------------------
  830|  10.2k|                    if (node.subs[0].GetType() << "x"_mst) {
  ------------------
  |  Branch (830:25): [True: 7.81k, False: 2.48k]
  ------------------
  831|  7.81k|                        return BuildScript(std::move(subs[0]), OP_VERIFY);
  832|  7.81k|                    } else {
  833|  2.48k|                        return std::move(subs[0]);
  834|  2.48k|                    }
  835|  10.2k|                }
  836|  3.11k|                case Fragment::WRAP_J: return BuildScript(OP_SIZE, OP_0NOTEQUAL, OP_IF, subs[0], OP_ENDIF);
  ------------------
  |  Branch (836:17): [True: 3.11k, False: 188k]
  ------------------
  837|  31.3k|                case Fragment::WRAP_N: return BuildScript(std::move(subs[0]), OP_0NOTEQUAL);
  ------------------
  |  Branch (837:17): [True: 31.3k, False: 160k]
  ------------------
  838|  9.76k|                case Fragment::JUST_1: return BuildScript(OP_1);
  ------------------
  |  Branch (838:17): [True: 9.76k, False: 181k]
  ------------------
  839|  56.1k|                case Fragment::JUST_0: return BuildScript(OP_0);
  ------------------
  |  Branch (839:17): [True: 56.1k, False: 135k]
  ------------------
  840|  9.89k|                case Fragment::AND_V: return BuildScript(std::move(subs[0]), subs[1]);
  ------------------
  |  Branch (840:17): [True: 9.89k, False: 181k]
  ------------------
  841|     12|                case Fragment::AND_B: return BuildScript(std::move(subs[0]), subs[1], OP_BOOLAND);
  ------------------
  |  Branch (841:17): [True: 12, False: 191k]
  ------------------
  842|     32|                case Fragment::OR_B: return BuildScript(std::move(subs[0]), subs[1], OP_BOOLOR);
  ------------------
  |  Branch (842:17): [True: 32, False: 191k]
  ------------------
  843|     68|                case Fragment::OR_D: return BuildScript(std::move(subs[0]), OP_IFDUP, OP_NOTIF, subs[1], OP_ENDIF);
  ------------------
  |  Branch (843:17): [True: 68, False: 191k]
  ------------------
  844|     92|                case Fragment::OR_C: return BuildScript(std::move(subs[0]), OP_NOTIF, subs[1], OP_ENDIF);
  ------------------
  |  Branch (844:17): [True: 92, False: 191k]
  ------------------
  845|  54.5k|                case Fragment::OR_I: return BuildScript(OP_IF, subs[0], OP_ELSE, subs[1], OP_ENDIF);
  ------------------
  |  Branch (845:17): [True: 54.5k, False: 137k]
  ------------------
  846|    490|                case Fragment::ANDOR: return BuildScript(std::move(subs[0]), OP_NOTIF, subs[2], OP_ELSE, subs[1], OP_ENDIF);
  ------------------
  |  Branch (846:17): [True: 490, False: 191k]
  ------------------
  847|  3.19k|                case Fragment::MULTI: {
  ------------------
  |  Branch (847:17): [True: 3.19k, False: 188k]
  ------------------
  848|  3.19k|                    CHECK_NONFATAL(!is_tapscript);
  ------------------
  |  |  113|  3.19k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  849|  3.19k|                    CScript script = BuildScript(node.k);
  850|  4.35k|                    for (const auto& key : node.keys) {
  ------------------
  |  Branch (850:42): [True: 4.35k, False: 3.19k]
  ------------------
  851|  4.35k|                        script = BuildScript(std::move(script), ctx.ToPKBytes(key));
  852|  4.35k|                    }
  853|  3.19k|                    return BuildScript(std::move(script), node.keys.size(), verify ? OP_CHECKMULTISIGVERIFY : OP_CHECKMULTISIG);
  ------------------
  |  Branch (853:77): [True: 406, False: 2.78k]
  ------------------
  854|  10.2k|                }
  855|  1.90k|                case Fragment::MULTI_A: {
  ------------------
  |  Branch (855:17): [True: 1.90k, False: 189k]
  ------------------
  856|  1.90k|                    CHECK_NONFATAL(is_tapscript);
  ------------------
  |  |  113|  1.90k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  857|  1.90k|                    CScript script = BuildScript(ctx.ToPKBytes(*node.keys.begin()), OP_CHECKSIG);
  858|  5.85k|                    for (auto it = node.keys.begin() + 1; it != node.keys.end(); ++it) {
  ------------------
  |  Branch (858:59): [True: 3.95k, False: 1.90k]
  ------------------
  859|  3.95k|                        script = BuildScript(std::move(script), ctx.ToPKBytes(*it), OP_CHECKSIGADD);
  860|  3.95k|                    }
  861|  1.90k|                    return BuildScript(std::move(script), node.k, verify ? OP_NUMEQUALVERIFY : OP_NUMEQUAL);
  ------------------
  |  Branch (861:67): [True: 30, False: 1.87k]
  ------------------
  862|  10.2k|                }
  863|    464|                case Fragment::THRESH: {
  ------------------
  |  Branch (863:17): [True: 464, False: 191k]
  ------------------
  864|    464|                    CScript script = std::move(subs[0]);
  865|  1.34k|                    for (size_t i = 1; i < subs.size(); ++i) {
  ------------------
  |  Branch (865:40): [True: 884, False: 464]
  ------------------
  866|    884|                        script = BuildScript(std::move(script), subs[i], OP_ADD);
  867|    884|                    }
  868|    464|                    return BuildScript(std::move(script), node.k, verify ? OP_EQUALVERIFY : OP_EQUAL);
  ------------------
  |  Branch (868:67): [True: 14, False: 450]
  ------------------
  869|  10.2k|                }
  870|   191k|            }
  871|   191k|            assert(false);
  ------------------
  |  Branch (871:13): [Folded, False: 0]
  ------------------
  872|      0|        };
descriptor.cpp:_ZNK10miniscript4NodeIjE8ToStringIN12_GLOBAL__N_111StringMakerEEENSt3__18optionalINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEERKT_Rb:
  883|  14.0k|    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|  14.0k|        auto downfn = [](bool, const Node& node, size_t) {
  888|  14.0k|            return (node.fragment == Fragment::WRAP_A || node.fragment == Fragment::WRAP_S ||
  889|  14.0k|                    node.fragment == Fragment::WRAP_D || node.fragment == Fragment::WRAP_V ||
  890|  14.0k|                    node.fragment == Fragment::WRAP_J || node.fragment == Fragment::WRAP_N ||
  891|  14.0k|                    node.fragment == Fragment::WRAP_C ||
  892|  14.0k|                    (node.fragment == Fragment::AND_V && node.subs[1].fragment == Fragment::JUST_1) ||
  893|  14.0k|                    (node.fragment == Fragment::OR_I && node.subs[0].fragment == Fragment::JUST_0) ||
  894|  14.0k|                    (node.fragment == Fragment::OR_I && node.subs[1].fragment == Fragment::JUST_0));
  895|  14.0k|        };
  896|  14.0k|        auto toString = [&ctx, &has_priv_key](Key key) -> std::optional<std::string> {
  897|  14.0k|            bool fragment_has_priv_key{false};
  898|  14.0k|            auto key_str{ctx.ToString(key, fragment_has_priv_key)};
  899|  14.0k|            if (key_str) has_priv_key = has_priv_key || fragment_has_priv_key;
  900|  14.0k|            return key_str;
  901|  14.0k|        };
  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|  14.0k|        const bool is_tapscript{IsTapscript(m_script_ctx)};
  905|  14.0k|        auto upfn = [is_tapscript, &toString](bool wrapped, const Node& node, std::span<std::string> subs) -> std::optional<std::string> {
  906|  14.0k|            std::string ret = wrapped ? ":" : "";
  907|       |
  908|  14.0k|            switch (node.fragment) {
  909|  14.0k|                case Fragment::WRAP_A: return "a" + std::move(subs[0]);
  910|  14.0k|                case Fragment::WRAP_S: return "s" + std::move(subs[0]);
  911|  14.0k|                case Fragment::WRAP_C:
  912|  14.0k|                    if (node.subs[0].fragment == Fragment::PK_K) {
  913|       |                        // pk(K) is syntactic sugar for c:pk_k(K)
  914|  14.0k|                        auto key_str = toString(node.subs[0].keys[0]);
  915|  14.0k|                        if (!key_str) return {};
  916|  14.0k|                        return std::move(ret) + "pk(" + std::move(*key_str) + ")";
  917|  14.0k|                    }
  918|  14.0k|                    if (node.subs[0].fragment == Fragment::PK_H) {
  919|       |                        // pkh(K) is syntactic sugar for c:pk_h(K)
  920|  14.0k|                        auto key_str = toString(node.subs[0].keys[0]);
  921|  14.0k|                        if (!key_str) return {};
  922|  14.0k|                        return std::move(ret) + "pkh(" + std::move(*key_str) + ")";
  923|  14.0k|                    }
  924|  14.0k|                    return "c" + std::move(subs[0]);
  925|  14.0k|                case Fragment::WRAP_D: return "d" + std::move(subs[0]);
  926|  14.0k|                case Fragment::WRAP_V: return "v" + std::move(subs[0]);
  927|  14.0k|                case Fragment::WRAP_J: return "j" + std::move(subs[0]);
  928|  14.0k|                case Fragment::WRAP_N: return "n" + std::move(subs[0]);
  929|  14.0k|                case Fragment::AND_V:
  930|       |                    // t:X is syntactic sugar for and_v(X,1).
  931|  14.0k|                    if (node.subs[1].fragment == Fragment::JUST_1) return "t" + std::move(subs[0]);
  932|  14.0k|                    break;
  933|  14.0k|                case Fragment::OR_I:
  934|  14.0k|                    if (node.subs[0].fragment == Fragment::JUST_0) return "l" + std::move(subs[1]);
  935|  14.0k|                    if (node.subs[1].fragment == Fragment::JUST_0) return "u" + std::move(subs[0]);
  936|  14.0k|                    break;
  937|  14.0k|                default: break;
  938|  14.0k|            }
  939|  14.0k|            switch (node.fragment) {
  940|  14.0k|                case Fragment::PK_K: {
  941|  14.0k|                    auto key_str = toString(node.keys[0]);
  942|  14.0k|                    if (!key_str) return {};
  943|  14.0k|                    return std::move(ret) + "pk_k(" + std::move(*key_str) + ")";
  944|  14.0k|                }
  945|  14.0k|                case Fragment::PK_H: {
  946|  14.0k|                    auto key_str = toString(node.keys[0]);
  947|  14.0k|                    if (!key_str) return {};
  948|  14.0k|                    return std::move(ret) + "pk_h(" + std::move(*key_str) + ")";
  949|  14.0k|                }
  950|  14.0k|                case Fragment::AFTER: return std::move(ret) + "after(" + util::ToString(node.k) + ")";
  951|  14.0k|                case Fragment::OLDER: return std::move(ret) + "older(" + util::ToString(node.k) + ")";
  952|  14.0k|                case Fragment::HASH256: return std::move(ret) + "hash256(" + HexStr(node.data) + ")";
  953|  14.0k|                case Fragment::HASH160: return std::move(ret) + "hash160(" + HexStr(node.data) + ")";
  954|  14.0k|                case Fragment::SHA256: return std::move(ret) + "sha256(" + HexStr(node.data) + ")";
  955|  14.0k|                case Fragment::RIPEMD160: return std::move(ret) + "ripemd160(" + HexStr(node.data) + ")";
  956|  14.0k|                case Fragment::JUST_1: return std::move(ret) + "1";
  957|  14.0k|                case Fragment::JUST_0: return std::move(ret) + "0";
  958|  14.0k|                case Fragment::AND_V: return std::move(ret) + "and_v(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  959|  14.0k|                case Fragment::AND_B: return std::move(ret) + "and_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  960|  14.0k|                case Fragment::OR_B: return std::move(ret) + "or_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  961|  14.0k|                case Fragment::OR_D: return std::move(ret) + "or_d(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  962|  14.0k|                case Fragment::OR_C: return std::move(ret) + "or_c(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  963|  14.0k|                case Fragment::OR_I: return std::move(ret) + "or_i(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  964|  14.0k|                case Fragment::ANDOR:
  965|       |                    // and_n(X,Y) is syntactic sugar for andor(X,Y,0).
  966|  14.0k|                    if (node.subs[2].fragment == Fragment::JUST_0) return std::move(ret) + "and_n(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  967|  14.0k|                    return std::move(ret) + "andor(" + std::move(subs[0]) + "," + std::move(subs[1]) + "," + std::move(subs[2]) + ")";
  968|  14.0k|                case Fragment::MULTI: {
  969|  14.0k|                    CHECK_NONFATAL(!is_tapscript);
  970|  14.0k|                    auto str = std::move(ret) + "multi(" + util::ToString(node.k);
  971|  14.0k|                    for (const auto& key : node.keys) {
  972|  14.0k|                        auto key_str = toString(key);
  973|  14.0k|                        if (!key_str) return {};
  974|  14.0k|                        str += "," + std::move(*key_str);
  975|  14.0k|                    }
  976|  14.0k|                    return std::move(str) + ")";
  977|  14.0k|                }
  978|  14.0k|                case Fragment::MULTI_A: {
  979|  14.0k|                    CHECK_NONFATAL(is_tapscript);
  980|  14.0k|                    auto str = std::move(ret) + "multi_a(" + util::ToString(node.k);
  981|  14.0k|                    for (const auto& key : node.keys) {
  982|  14.0k|                        auto key_str = toString(key);
  983|  14.0k|                        if (!key_str) return {};
  984|  14.0k|                        str += "," + std::move(*key_str);
  985|  14.0k|                    }
  986|  14.0k|                    return std::move(str) + ")";
  987|  14.0k|                }
  988|  14.0k|                case Fragment::THRESH: {
  989|  14.0k|                    auto str = std::move(ret) + "thresh(" + util::ToString(node.k);
  990|  14.0k|                    for (auto& sub : subs) {
  991|  14.0k|                        str += "," + std::move(sub);
  992|  14.0k|                    }
  993|  14.0k|                    return std::move(str) + ")";
  994|  14.0k|                }
  995|  14.0k|                default: break;
  996|  14.0k|            }
  997|  14.0k|            assert(false);
  998|  14.0k|        };
  999|       |
 1000|  14.0k|        return TreeEvalMaybe<std::string>(false, downfn, upfn);
 1001|  14.0k|    }
descriptor.cpp:_ZNK10miniscript4NodeIjE13TreeEvalMaybeINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEbZNKS1_8ToStringIN12_GLOBAL__N_111StringMakerEEENS3_8optionalIS9_EERKT_RbEUlbRKS1_mE_ZNKSA_ISC_EESE_SH_SI_EUlbSK_NS3_4spanIS9_Lm18446744073709551615EEEE_EENSD_ISF_EET0_T1_T2_:
  653|  14.0k|    {
  654|       |        /** Entries of the explicit stack tracked in this algorithm. */
  655|  14.0k|        struct StackElem
  656|  14.0k|        {
  657|  14.0k|            const Node& node; //!< The node being evaluated.
  658|  14.0k|            size_t expanded; //!< How many children of this node have been expanded.
  659|  14.0k|            State state; //!< The state for that node.
  660|       |
  661|  14.0k|            StackElem(const Node& node_, size_t exp_, State&& state_) :
  662|  14.0k|                node(node_), expanded(exp_), state(std::move(state_)) {}
  663|  14.0k|        };
  664|       |        /* Stack of tree nodes being explored. */
  665|  14.0k|        std::vector<StackElem> stack;
  666|       |        /* Results of subtrees so far. Their order and mapping to tree nodes
  667|       |         * is implicitly defined by stack. */
  668|  14.0k|        std::vector<Result> results;
  669|  14.0k|        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|   575k|        while (stack.size()) {
  ------------------
  |  Branch (687:16): [True: 561k, False: 14.0k]
  ------------------
  688|   561k|            const Node& node = stack.back().node;
  689|   561k|            if (stack.back().expanded < node.subs.size()) {
  ------------------
  |  Branch (689:17): [True: 273k, False: 287k]
  ------------------
  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|   273k|                size_t child_index = stack.back().expanded++;
  694|   273k|                State child_state = downfn(stack.back().state, node, child_index);
  695|   273k|                stack.emplace_back(node.subs[child_index], 0, std::move(child_state));
  696|   273k|                continue;
  697|   273k|            }
  698|       |            // Invoke upfn with the last node.subs.size() elements of results as input.
  699|   561k|            assert(results.size() >= node.subs.size());
  ------------------
  |  Branch (699:13): [True: 287k, False: 0]
  ------------------
  700|   287k|            std::optional<Result> result{upfn(std::move(stack.back().state), node,
  701|   287k|                std::span<Result>{results}.last(node.subs.size()))};
  702|       |            // If evaluation returns std::nullopt, abort immediately.
  703|   287k|            if (!result) return {};
  ------------------
  |  Branch (703:17): [True: 0, False: 287k]
  ------------------
  704|       |            // Replace the last node.subs.size() elements of results with the new result.
  705|   287k|            results.erase(results.end() - node.subs.size(), results.end());
  706|   287k|            results.push_back(std::move(*result));
  707|   287k|            stack.pop_back();
  708|   287k|        }
  709|       |        // The final remaining results element is the root result, return it.
  710|  14.0k|        assert(results.size() >= 1);
  ------------------
  |  Branch (710:9): [True: 14.0k, False: 0]
  ------------------
  711|  14.0k|        CHECK_NONFATAL(results.size() == 1);
  ------------------
  |  |  113|  14.0k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  712|  14.0k|        return std::move(results[0]);
  713|  14.0k|    }
descriptor.cpp:_ZZNK10miniscript4NodeIjE13TreeEvalMaybeINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEbZNKS1_8ToStringIN12_GLOBAL__N_111StringMakerEEENS3_8optionalIS9_EERKT_RbEUlbRKS1_mE_ZNKSA_ISC_EESE_SH_SI_EUlbSK_NS3_4spanIS9_Lm18446744073709551615EEEE_EENSD_ISF_EET0_T1_T2_EN9StackElemC2ESK_mOb:
  662|   287k|                node(node_), expanded(exp_), state(std::move(state_)) {}
descriptor.cpp:_ZZNK10miniscript4NodeIjE8ToStringIN12_GLOBAL__N_111StringMakerEEENSt3__18optionalINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEERKT_RbENKUlbRKS1_mE_clEbSJ_m:
  887|   273k|        auto downfn = [](bool, const Node& node, size_t) {
  888|   273k|            return (node.fragment == Fragment::WRAP_A || node.fragment == Fragment::WRAP_S ||
  ------------------
  |  Branch (888:21): [True: 1.21k, False: 272k]
  |  Branch (888:58): [True: 174, False: 272k]
  ------------------
  889|   272k|                    node.fragment == Fragment::WRAP_D || node.fragment == Fragment::WRAP_V ||
  ------------------
  |  Branch (889:21): [True: 306, False: 271k]
  |  Branch (889:58): [True: 15.4k, False: 256k]
  ------------------
  890|   256k|                    node.fragment == Fragment::WRAP_J || node.fragment == Fragment::WRAP_N ||
  ------------------
  |  Branch (890:21): [True: 4.67k, False: 251k]
  |  Branch (890:58): [True: 47.0k, False: 204k]
  ------------------
  891|   204k|                    node.fragment == Fragment::WRAP_C ||
  ------------------
  |  Branch (891:21): [True: 6.49k, False: 198k]
  ------------------
  892|   198k|                    (node.fragment == Fragment::AND_V && node.subs[1].fragment == Fragment::JUST_1) ||
  ------------------
  |  Branch (892:22): [True: 29.6k, False: 168k]
  |  Branch (892:58): [True: 29.0k, False: 672]
  ------------------
  893|   169k|                    (node.fragment == Fragment::OR_I && node.subs[0].fragment == Fragment::JUST_0) ||
  ------------------
  |  Branch (893:22): [True: 163k, False: 5.51k]
  |  Branch (893:57): [True: 76.6k, False: 86.9k]
  ------------------
  894|  92.4k|                    (node.fragment == Fragment::OR_I && node.subs[1].fragment == Fragment::JUST_0));
  ------------------
  |  Branch (894:22): [True: 86.9k, False: 5.51k]
  |  Branch (894:57): [True: 86.5k, False: 444]
  ------------------
  895|   273k|        };
descriptor.cpp:_ZZNK10miniscript4NodeIjE8ToStringIN12_GLOBAL__N_111StringMakerEEENSt3__18optionalINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEERKT_RbENKUlbRKS1_NS5_4spanISC_Lm18446744073709551615EEEE_clEbSJ_SL_:
  905|   287k|        auto upfn = [is_tapscript, &toString](bool wrapped, const Node& node, std::span<std::string> subs) -> std::optional<std::string> {
  906|   287k|            std::string ret = wrapped ? ":" : "";
  ------------------
  |  Branch (906:31): [True: 267k, False: 20.0k]
  ------------------
  907|       |
  908|   287k|            switch (node.fragment) {
  909|  1.21k|                case Fragment::WRAP_A: return "a" + std::move(subs[0]);
  ------------------
  |  Branch (909:17): [True: 1.21k, False: 286k]
  ------------------
  910|    174|                case Fragment::WRAP_S: return "s" + std::move(subs[0]);
  ------------------
  |  Branch (910:17): [True: 174, False: 287k]
  ------------------
  911|  6.49k|                case Fragment::WRAP_C:
  ------------------
  |  Branch (911:17): [True: 6.49k, False: 281k]
  ------------------
  912|  6.49k|                    if (node.subs[0].fragment == Fragment::PK_K) {
  ------------------
  |  Branch (912:25): [True: 3.89k, False: 2.60k]
  ------------------
  913|       |                        // pk(K) is syntactic sugar for c:pk_k(K)
  914|  3.89k|                        auto key_str = toString(node.subs[0].keys[0]);
  915|  3.89k|                        if (!key_str) return {};
  ------------------
  |  Branch (915:29): [True: 0, False: 3.89k]
  ------------------
  916|  3.89k|                        return std::move(ret) + "pk(" + std::move(*key_str) + ")";
  917|  3.89k|                    }
  918|  2.60k|                    if (node.subs[0].fragment == Fragment::PK_H) {
  ------------------
  |  Branch (918:25): [True: 2.60k, False: 3]
  ------------------
  919|       |                        // pkh(K) is syntactic sugar for c:pk_h(K)
  920|  2.60k|                        auto key_str = toString(node.subs[0].keys[0]);
  921|  2.60k|                        if (!key_str) return {};
  ------------------
  |  Branch (921:29): [True: 0, False: 2.60k]
  ------------------
  922|  2.60k|                        return std::move(ret) + "pkh(" + std::move(*key_str) + ")";
  923|  2.60k|                    }
  924|      3|                    return "c" + std::move(subs[0]);
  925|    306|                case Fragment::WRAP_D: return "d" + std::move(subs[0]);
  ------------------
  |  Branch (925:17): [True: 306, False: 287k]
  ------------------
  926|  15.4k|                case Fragment::WRAP_V: return "v" + std::move(subs[0]);
  ------------------
  |  Branch (926:17): [True: 15.4k, False: 272k]
  ------------------
  927|  4.67k|                case Fragment::WRAP_J: return "j" + std::move(subs[0]);
  ------------------
  |  Branch (927:17): [True: 4.67k, False: 282k]
  ------------------
  928|  47.0k|                case Fragment::WRAP_N: return "n" + std::move(subs[0]);
  ------------------
  |  Branch (928:17): [True: 47.0k, False: 240k]
  ------------------
  929|  14.8k|                case Fragment::AND_V:
  ------------------
  |  Branch (929:17): [True: 14.8k, False: 272k]
  ------------------
  930|       |                    // t:X is syntactic sugar for and_v(X,1).
  931|  14.8k|                    if (node.subs[1].fragment == Fragment::JUST_1) return "t" + std::move(subs[0]);
  ------------------
  |  Branch (931:25): [True: 14.5k, False: 336]
  ------------------
  932|    336|                    break;
  933|  81.8k|                case Fragment::OR_I:
  ------------------
  |  Branch (933:17): [True: 81.8k, False: 205k]
  ------------------
  934|  81.8k|                    if (node.subs[0].fragment == Fragment::JUST_0) return "l" + std::move(subs[1]);
  ------------------
  |  Branch (934:25): [True: 38.3k, False: 43.4k]
  ------------------
  935|  43.4k|                    if (node.subs[1].fragment == Fragment::JUST_0) return "u" + std::move(subs[0]);
  ------------------
  |  Branch (935:25): [True: 43.2k, False: 222]
  ------------------
  936|    222|                    break;
  937|   115k|                default: break;
  ------------------
  |  Branch (937:17): [True: 115k, False: 172k]
  ------------------
  938|   287k|            }
  939|   116k|            switch (node.fragment) {
  940|  3.89k|                case Fragment::PK_K: {
  ------------------
  |  Branch (940:17): [True: 3.89k, False: 112k]
  ------------------
  941|  3.89k|                    auto key_str = toString(node.keys[0]);
  942|  3.89k|                    if (!key_str) return {};
  ------------------
  |  Branch (942:25): [True: 0, False: 3.89k]
  ------------------
  943|  3.89k|                    return std::move(ret) + "pk_k(" + std::move(*key_str) + ")";
  944|  3.89k|                }
  945|  2.60k|                case Fragment::PK_H: {
  ------------------
  |  Branch (945:17): [True: 2.60k, False: 113k]
  ------------------
  946|  2.60k|                    auto key_str = toString(node.keys[0]);
  947|  2.60k|                    if (!key_str) return {};
  ------------------
  |  Branch (947:25): [True: 0, False: 2.60k]
  ------------------
  948|  2.60k|                    return std::move(ret) + "pk_h(" + std::move(*key_str) + ")";
  949|  2.60k|                }
  950|    225|                case Fragment::AFTER: return std::move(ret) + "after(" + util::ToString(node.k) + ")";
  ------------------
  |  Branch (950:17): [True: 225, False: 115k]
  ------------------
  951|    555|                case Fragment::OLDER: return std::move(ret) + "older(" + util::ToString(node.k) + ")";
  ------------------
  |  Branch (951:17): [True: 555, False: 115k]
  ------------------
  952|     30|                case Fragment::HASH256: return std::move(ret) + "hash256(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (952:17): [True: 30, False: 116k]
  ------------------
  953|     18|                case Fragment::HASH160: return std::move(ret) + "hash160(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (953:17): [True: 18, False: 116k]
  ------------------
  954|      3|                case Fragment::SHA256: return std::move(ret) + "sha256(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (954:17): [True: 3, False: 116k]
  ------------------
  955|      6|                case Fragment::RIPEMD160: return std::move(ret) + "ripemd160(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (955:17): [True: 6, False: 116k]
  ------------------
  956|  14.6k|                case Fragment::JUST_1: return std::move(ret) + "1";
  ------------------
  |  Branch (956:17): [True: 14.6k, False: 101k]
  ------------------
  957|  84.2k|                case Fragment::JUST_0: return std::move(ret) + "0";
  ------------------
  |  Branch (957:17): [True: 84.2k, False: 31.9k]
  ------------------
  958|    336|                case Fragment::AND_V: return std::move(ret) + "and_v(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (958:17): [True: 336, False: 115k]
  ------------------
  959|     18|                case Fragment::AND_B: return std::move(ret) + "and_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (959:17): [True: 18, False: 116k]
  ------------------
  960|     48|                case Fragment::OR_B: return std::move(ret) + "or_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (960:17): [True: 48, False: 116k]
  ------------------
  961|    102|                case Fragment::OR_D: return std::move(ret) + "or_d(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (961:17): [True: 102, False: 116k]
  ------------------
  962|    138|                case Fragment::OR_C: return std::move(ret) + "or_c(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (962:17): [True: 138, False: 115k]
  ------------------
  963|    222|                case Fragment::OR_I: return std::move(ret) + "or_i(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (963:17): [True: 222, False: 115k]
  ------------------
  964|    735|                case Fragment::ANDOR:
  ------------------
  |  Branch (964:17): [True: 735, False: 115k]
  ------------------
  965|       |                    // and_n(X,Y) is syntactic sugar for andor(X,Y,0).
  966|    735|                    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: 138, False: 597]
  ------------------
  967|    597|                    return std::move(ret) + "andor(" + std::move(subs[0]) + "," + std::move(subs[1]) + "," + std::move(subs[2]) + ")";
  968|  4.78k|                case Fragment::MULTI: {
  ------------------
  |  Branch (968:17): [True: 4.78k, False: 111k]
  ------------------
  969|  4.78k|                    CHECK_NONFATAL(!is_tapscript);
  ------------------
  |  |  113|  4.78k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  970|  4.78k|                    auto str = std::move(ret) + "multi(" + util::ToString(node.k);
  971|  6.52k|                    for (const auto& key : node.keys) {
  ------------------
  |  Branch (971:42): [True: 6.52k, False: 4.78k]
  ------------------
  972|  6.52k|                        auto key_str = toString(key);
  973|  6.52k|                        if (!key_str) return {};
  ------------------
  |  Branch (973:29): [True: 0, False: 6.52k]
  ------------------
  974|  6.52k|                        str += "," + std::move(*key_str);
  975|  6.52k|                    }
  976|  4.78k|                    return std::move(str) + ")";
  977|  4.78k|                }
  978|  2.85k|                case Fragment::MULTI_A: {
  ------------------
  |  Branch (978:17): [True: 2.85k, False: 113k]
  ------------------
  979|  2.85k|                    CHECK_NONFATAL(is_tapscript);
  ------------------
  |  |  113|  2.85k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  980|  2.85k|                    auto str = std::move(ret) + "multi_a(" + util::ToString(node.k);
  981|  8.77k|                    for (const auto& key : node.keys) {
  ------------------
  |  Branch (981:42): [True: 8.77k, False: 2.85k]
  ------------------
  982|  8.77k|                        auto key_str = toString(key);
  983|  8.77k|                        if (!key_str) return {};
  ------------------
  |  Branch (983:29): [True: 0, False: 8.77k]
  ------------------
  984|  8.77k|                        str += "," + std::move(*key_str);
  985|  8.77k|                    }
  986|  2.85k|                    return std::move(str) + ")";
  987|  2.85k|                }
  988|    696|                case Fragment::THRESH: {
  ------------------
  |  Branch (988:17): [True: 696, False: 115k]
  ------------------
  989|    696|                    auto str = std::move(ret) + "thresh(" + util::ToString(node.k);
  990|  2.02k|                    for (auto& sub : subs) {
  ------------------
  |  Branch (990:36): [True: 2.02k, False: 696]
  ------------------
  991|  2.02k|                        str += "," + std::move(sub);
  992|  2.02k|                    }
  993|    696|                    return std::move(str) + ")";
  994|  2.85k|                }
  995|      0|                default: break;
  ------------------
  |  Branch (995:17): [True: 0, False: 116k]
  ------------------
  996|   116k|            }
  997|   116k|            assert(false);
  ------------------
  |  Branch (997:13): [Folded, False: 0]
  ------------------
  998|      0|        };
descriptor.cpp:_ZZNK10miniscript4NodeIjE8ToStringIN12_GLOBAL__N_111StringMakerEEENSt3__18optionalINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEERKT_RbENKUljE_clEj:
  896|  28.2k|        auto toString = [&ctx, &has_priv_key](Key key) -> std::optional<std::string> {
  897|  28.2k|            bool fragment_has_priv_key{false};
  898|  28.2k|            auto key_str{ctx.ToString(key, fragment_has_priv_key)};
  899|  28.2k|            if (key_str) has_priv_key = has_priv_key || fragment_has_priv_key;
  ------------------
  |  Branch (899:17): [True: 28.2k, False: 0]
  |  Branch (899:41): [True: 2.29k, False: 26.0k]
  |  Branch (899:57): [True: 2.95k, False: 23.0k]
  ------------------
  900|  28.2k|            return key_str;
  901|  28.2k|        };
_ZNK10miniscript4NodeIjE14GetWitnessSizeEv:
 1611|  4.77k|    std::optional<uint32_t> GetWitnessSize() const {
 1612|  4.77k|        if (!ws.sat.Valid()) return {};
  ------------------
  |  Branch (1612:13): [True: 0, False: 4.77k]
  ------------------
 1613|  4.77k|        return ws.sat.Value();
 1614|  4.77k|    }
_ZNK10miniscript4NodeIjE5CloneEv:
  573|  6.49k|    {
  574|       |        // Use TreeEval() to avoid a stack-overflow due to recursion
  575|  6.49k|        auto upfn = [](const Node& node, std::span<Node> children) {
  576|  6.49k|            std::vector<Node> new_subs;
  577|  6.49k|            for (auto& child : children) {
  578|       |                // It's fine to move from children as they are new nodes having
  579|       |                // been produced by calling this function one level down.
  580|  6.49k|                new_subs.push_back(std::move(child));
  581|  6.49k|            }
  582|  6.49k|            return Node{internal::NoDupCheck{}, node.m_script_ctx, node.fragment, std::move(new_subs), node.keys, node.data, node.k};
  583|  6.49k|        };
  584|  6.49k|        return TreeEval<Node>(upfn);
  585|  6.49k|    }
_ZNK10miniscript4NodeIjE8TreeEvalIS1_ZNKS1_5CloneEvEUlRKS1_NSt3__14spanIS1_Lm18446744073709551615EEEE_EET_T0_:
  748|  6.49k|    {
  749|  6.49k|        struct DummyState {};
  750|  6.49k|        return std::move(*TreeEvalMaybe<Result>(DummyState{},
  751|  6.49k|            [](DummyState, const Node&, size_t) { return DummyState{}; },
  752|  6.49k|            [&upfn](DummyState, const Node& node, std::span<Result> subs) {
  753|  6.49k|                Result res{upfn(node, subs)};
  754|  6.49k|                return std::optional<Result>(std::move(res));
  755|  6.49k|            }
  756|  6.49k|        ));
  757|  6.49k|    }
_ZNK10miniscript4NodeIjE13TreeEvalMaybeIS1_ZNKS1_8TreeEvalIS1_ZNKS1_5CloneEvEUlRKS1_NSt3__14spanIS1_Lm18446744073709551615EEEE_EET_T0_E10DummyStateZNKS3_IS1_S9_EESA_SB_EUlSC_S5_mE_ZNKS3_IS1_S9_EESA_SB_EUlSC_S5_S8_E_EENS6_8optionalISA_EESB_T1_T2_:
  653|  6.49k|    {
  654|       |        /** Entries of the explicit stack tracked in this algorithm. */
  655|  6.49k|        struct StackElem
  656|  6.49k|        {
  657|  6.49k|            const Node& node; //!< The node being evaluated.
  658|  6.49k|            size_t expanded; //!< How many children of this node have been expanded.
  659|  6.49k|            State state; //!< The state for that node.
  660|       |
  661|  6.49k|            StackElem(const Node& node_, size_t exp_, State&& state_) :
  662|  6.49k|                node(node_), expanded(exp_), state(std::move(state_)) {}
  663|  6.49k|        };
  664|       |        /* Stack of tree nodes being explored. */
  665|  6.49k|        std::vector<StackElem> stack;
  666|       |        /* Results of subtrees so far. Their order and mapping to tree nodes
  667|       |         * is implicitly defined by stack. */
  668|  6.49k|        std::vector<Result> results;
  669|  6.49k|        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|   310k|        while (stack.size()) {
  ------------------
  |  Branch (687:16): [True: 303k, False: 6.49k]
  ------------------
  688|   303k|            const Node& node = stack.back().node;
  689|   303k|            if (stack.back().expanded < node.subs.size()) {
  ------------------
  |  Branch (689:17): [True: 148k, False: 155k]
  ------------------
  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|   148k|                size_t child_index = stack.back().expanded++;
  694|   148k|                State child_state = downfn(stack.back().state, node, child_index);
  695|   148k|                stack.emplace_back(node.subs[child_index], 0, std::move(child_state));
  696|   148k|                continue;
  697|   148k|            }
  698|       |            // Invoke upfn with the last node.subs.size() elements of results as input.
  699|   303k|            assert(results.size() >= node.subs.size());
  ------------------
  |  Branch (699:13): [True: 155k, False: 0]
  ------------------
  700|   155k|            std::optional<Result> result{upfn(std::move(stack.back().state), node,
  701|   155k|                std::span<Result>{results}.last(node.subs.size()))};
  702|       |            // If evaluation returns std::nullopt, abort immediately.
  703|   155k|            if (!result) return {};
  ------------------
  |  Branch (703:17): [True: 0, False: 155k]
  ------------------
  704|       |            // Replace the last node.subs.size() elements of results with the new result.
  705|   155k|            results.erase(results.end() - node.subs.size(), results.end());
  706|   155k|            results.push_back(std::move(*result));
  707|   155k|            stack.pop_back();
  708|   155k|        }
  709|       |        // The final remaining results element is the root result, return it.
  710|  6.49k|        assert(results.size() >= 1);
  ------------------
  |  Branch (710:9): [True: 6.49k, False: 0]
  ------------------
  711|  6.49k|        CHECK_NONFATAL(results.size() == 1);
  ------------------
  |  |  113|  6.49k|    inline_check_non_fatal(condition, std::source_location::current(), #condition)
  ------------------
  712|  6.49k|        return std::move(results[0]);
  713|  6.49k|    }
_ZZNK10miniscript4NodeIjE13TreeEvalMaybeIS1_ZNKS1_8TreeEvalIS1_ZNKS1_5CloneEvEUlRKS1_NSt3__14spanIS1_Lm18446744073709551615EEEE_EET_T0_E10DummyStateZNKS3_IS1_S9_EESA_SB_EUlSC_S5_mE_ZNKS3_IS1_S9_EESA_SB_EUlSC_S5_S8_E_EENS6_8optionalISA_EESB_T1_T2_EN9StackElemC2ES5_mOSC_:
  662|   155k|                node(node_), expanded(exp_), state(std::move(state_)) {}
_ZZNK10miniscript4NodeIjE8TreeEvalIS1_ZNKS1_5CloneEvEUlRKS1_NSt3__14spanIS1_Lm18446744073709551615EEEE_EET_T0_ENKUlZNKS2_IS1_S8_EES9_SA_E10DummyStateS4_mE_clESB_S4_m:
  751|   148k|            [](DummyState, const Node&, size_t) { return DummyState{}; },
_ZZNK10miniscript4NodeIjE8TreeEvalIS1_ZNKS1_5CloneEvEUlRKS1_NSt3__14spanIS1_Lm18446744073709551615EEEE_EET_T0_ENKUlZNKS2_IS1_S8_EES9_SA_E10DummyStateS4_S7_E_clESB_S4_S7_:
  752|   155k|            [&upfn](DummyState, const Node& node, std::span<Result> subs) {
  753|   155k|                Result res{upfn(node, subs)};
  754|   155k|                return std::optional<Result>(std::move(res));
  755|   155k|            }
_ZZNK10miniscript4NodeIjE5CloneEvENKUlRKS1_NSt3__14spanIS1_Lm18446744073709551615EEEE_clES3_S6_:
  575|   155k|        auto upfn = [](const Node& node, std::span<Node> children) {
  576|   155k|            std::vector<Node> new_subs;
  577|   155k|            for (auto& child : children) {
  ------------------
  |  Branch (577:30): [True: 148k, False: 155k]
  ------------------
  578|       |                // It's fine to move from children as they are new nodes having
  579|       |                // been produced by calling this function one level down.
  580|   148k|                new_subs.push_back(std::move(child));
  581|   148k|            }
  582|   155k|            return Node{internal::NoDupCheck{}, node.m_script_ctx, node.fragment, std::move(new_subs), node.keys, node.data, node.k};
  583|   155k|        };
_ZN10miniscript4NodeIjEC2ENS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentENSt3__16vectorIS1_NS6_9allocatorIS1_EEEENS7_IjNS8_IjEEEENS7_IhNS8_IhEEEEj:
  615|   155k|        : fragment(nt), k(val), keys(std::move(key)), data(std::move(arg)), subs(std::move(sub)), m_script_ctx{script_ctx}, ops(CalcOps()), ss(CalcStackSize()), ws(CalcWitnessSize()), typ(CalcType()), scriptlen(CalcScriptLen()) {}
_ZN10miniscript4NodeIjED2Ev:
  553|  11.8M|    {
  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|  11.8M|        std::vector<std::vector<Node>> queue;
  561|  11.8M|        queue.push_back(std::move(subs));
  562|  14.9M|        do {
  563|  14.9M|            auto flattening{std::move(queue.back())};
  564|  14.9M|            queue.pop_back();
  565|  14.9M|            for (Node& n : flattening) {
  ------------------
  |  Branch (565:26): [True: 4.82M, False: 14.9M]
  ------------------
  566|  4.82M|                if (!n.subs.empty()) queue.push_back(std::move(n.subs));
  ------------------
  |  Branch (566:21): [True: 3.08M, False: 1.73M]
  ------------------
  567|  4.82M|            }
  568|  14.9M|        } while (!queue.empty());
  ------------------
  |  Branch (568:18): [True: 3.08M, False: 11.8M]
  ------------------
  569|  11.8M|    }
descriptor.cpp:_ZN10miniscript10FromScriptIN12_GLOBAL__N_19KeyParserEEENSt3__18optionalINS_4NodeINT_3KeyEEEEERK7CScriptRKS6_:
 2692|  4.69k|{
 2693|  4.69k|    using namespace internal;
 2694|       |    // A too large Script is necessarily invalid, don't bother parsing it.
 2695|  4.69k|    if (script.size() > MaxScriptSize(ctx.MsContext())) return {};
  ------------------
  |  Branch (2695:9): [True: 0, False: 4.69k]
  ------------------
 2696|  4.69k|    auto decomposed = DecomposeScript(script);
 2697|  4.69k|    if (!decomposed) return {};
  ------------------
  |  Branch (2697:9): [True: 0, False: 4.69k]
  ------------------
 2698|  4.69k|    auto it = decomposed->begin();
 2699|  4.69k|    auto ret = DecodeScript<typename Ctx::Key>(it, decomposed->end(), ctx);
 2700|  4.69k|    if (!ret) return {};
  ------------------
  |  Branch (2700:9): [True: 0, False: 4.69k]
  ------------------
 2701|  4.69k|    if (it != decomposed->end()) return {};
  ------------------
  |  Branch (2701:9): [True: 0, False: 4.69k]
  ------------------
 2702|  4.69k|    return ret;
 2703|  4.69k|}
descriptor.cpp:_ZN10miniscript8internal12DecodeScriptIjN12_GLOBAL__N_19KeyParserENSt3__111__wrap_iterIPNS4_4pairI10opcodetypeNS4_6vectorIhNS4_9allocatorIhEEEEEEEEEENS4_8optionalINS_4NodeIT_EEEERT1_SK_RKT0_:
 2297|  4.69k|{
 2298|       |    // The two integers are used to hold state for thresh()
 2299|  4.69k|    std::vector<std::tuple<DecodeContext, int64_t, int64_t>> to_parse;
 2300|  4.69k|    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.69k|    to_parse.emplace_back(DecodeContext::BKV_EXPR, -1, -1);
 2305|       |
 2306|   317k|    while (!to_parse.empty()) {
  ------------------
  |  Branch (2306:12): [True: 312k, False: 4.69k]
  ------------------
 2307|       |        // Exit early if the Miniscript is not going to be valid.
 2308|   312k|        if (!constructed.empty() && !constructed.back().IsValid()) return {};
  ------------------
  |  Branch (2308:13): [True: 277k, False: 35.4k]
  |  Branch (2308:37): [True: 0, False: 277k]
  ------------------
 2309|       |
 2310|       |        // Get the current context we are decoding within
 2311|   312k|        auto [cur_context, n, k] = to_parse.back();
 2312|   312k|        to_parse.pop_back();
 2313|       |
 2314|   312k|        switch(cur_context) {
  ------------------
  |  Branch (2314:16): [True: 312k, False: 0]
  ------------------
 2315|  90.4k|        case DecodeContext::SINGLE_BKV_EXPR: {
  ------------------
  |  Branch (2315:9): [True: 90.4k, False: 222k]
  ------------------
 2316|  90.4k|            if (in >= last) return {};
  ------------------
  |  Branch (2316:17): [True: 0, False: 90.4k]
  ------------------
 2317|       |
 2318|       |            // Constants
 2319|  90.4k|            if (in[0].first == OP_1) {
  ------------------
  |  Branch (2319:17): [True: 4.88k, False: 85.5k]
  ------------------
 2320|  4.88k|                ++in;
 2321|  4.88k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_1);
 2322|  4.88k|                break;
 2323|  4.88k|            }
 2324|  85.5k|            if (in[0].first == OP_0) {
  ------------------
  |  Branch (2324:17): [True: 28.0k, False: 57.5k]
  ------------------
 2325|  28.0k|                ++in;
 2326|  28.0k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_0);
 2327|  28.0k|                break;
 2328|  28.0k|            }
 2329|       |            // Public keys
 2330|  57.5k|            if (in[0].second.size() == 33 || in[0].second.size() == 32) {
  ------------------
  |  Branch (2330:17): [True: 564, False: 56.9k]
  |  Branch (2330:46): [True: 733, False: 56.2k]
  ------------------
 2331|  1.29k|                auto key = ctx.FromPKBytes(in[0].second.begin(), in[0].second.end());
 2332|  1.29k|                if (!key) return {};
  ------------------
  |  Branch (2332:21): [True: 0, False: 1.29k]
  ------------------
 2333|  1.29k|                ++in;
 2334|  1.29k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::PK_K, Vector(std::move(*key)));
 2335|  1.29k|                break;
 2336|  1.29k|            }
 2337|  56.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: 54.9k, False: 1.27k]
  |  Branch (2337:35): [True: 5.83k, False: 49.0k]
  |  Branch (2337:63): [True: 889, False: 4.94k]
  |  Branch (2337:90): [True: 874, False: 15]
  |  Branch (2337:119): [True: 869, False: 5]
  |  Branch (2337:144): [True: 869, False: 0]
  ------------------
 2338|    869|                auto key = ctx.FromPKHBytes(in[2].second.begin(), in[2].second.end());
 2339|    869|                if (!key) return {};
  ------------------
  |  Branch (2339:21): [True: 0, False: 869]
  ------------------
 2340|    869|                in += 5;
 2341|    869|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::PK_H, Vector(std::move(*key)));
 2342|    869|                break;
 2343|    869|            }
 2344|       |            // Time locks
 2345|  55.3k|            std::optional<int64_t> num;
 2346|  55.3k|            if (last - in >= 2 && in[0].first == OP_CHECKSEQUENCEVERIFY && (num = ParseScriptNumber(in[1]))) {
  ------------------
  |  Branch (2346:17): [True: 55.3k, False: 0]
  |  Branch (2346:17): [True: 185, False: 55.1k]
  |  Branch (2346:35): [True: 185, False: 55.1k]
  |  Branch (2346:76): [True: 185, False: 0]
  ------------------
 2347|    185|                in += 2;
 2348|    185|                if (*num < 1 || *num > 0x7FFFFFFFL) return {};
  ------------------
  |  Branch (2348:21): [True: 0, False: 185]
  |  Branch (2348:33): [True: 0, False: 185]
  ------------------
 2349|    185|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::OLDER, *num);
 2350|    185|                break;
 2351|    185|            }
 2352|  55.1k|            if (last - in >= 2 && in[0].first == OP_CHECKLOCKTIMEVERIFY && (num = ParseScriptNumber(in[1]))) {
  ------------------
  |  Branch (2352:17): [True: 55.1k, False: 0]
  |  Branch (2352:17): [True: 75, False: 55.0k]
  |  Branch (2352:35): [True: 75, False: 55.0k]
  |  Branch (2352:76): [True: 75, False: 0]
  ------------------
 2353|     75|                in += 2;
 2354|     75|                if (num < 1 || num > 0x7FFFFFFFL) return {};
  ------------------
  |  Branch (2354:21): [True: 0, False: 75]
  |  Branch (2354:21): [True: 0, False: 75]
  |  Branch (2354:32): [True: 0, False: 75]
  ------------------
 2355|     75|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::AFTER, *num);
 2356|     75|                break;
 2357|     75|            }
 2358|       |            // Hashes
 2359|  55.0k|            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: 51.7k, False: 3.36k]
  |  Branch (2359:17): [True: 19, False: 55.0k]
  |  Branch (2359:35): [True: 246, False: 51.4k]
  |  Branch (2359:62): [True: 23, False: 223]
  |  Branch (2359:90): [True: 23, False: 0]
  |  Branch (2359:117): [True: 19, False: 4]
  |  Branch (2359:153): [True: 19, False: 0]
  |  Branch (2359:166): [True: 19, False: 0]
  ------------------
 2360|     19|                if (in[2].first == OP_SHA256 && in[1].second.size() == 32) {
  ------------------
  |  Branch (2360:21): [True: 1, False: 18]
  |  Branch (2360:49): [True: 1, False: 0]
  ------------------
 2361|      1|                    constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::SHA256, in[1].second);
 2362|      1|                    in += 7;
 2363|      1|                    break;
 2364|     18|                } else if (in[2].first == OP_RIPEMD160 && in[1].second.size() == 20) {
  ------------------
  |  Branch (2364:28): [True: 2, False: 16]
  |  Branch (2364:59): [True: 2, False: 0]
  ------------------
 2365|      2|                    constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::RIPEMD160, in[1].second);
 2366|      2|                    in += 7;
 2367|      2|                    break;
 2368|     16|                } else if (in[2].first == OP_HASH256 && in[1].second.size() == 32) {
  ------------------
  |  Branch (2368:28): [True: 10, False: 6]
  |  Branch (2368:57): [True: 10, False: 0]
  ------------------
 2369|     10|                    constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::HASH256, in[1].second);
 2370|     10|                    in += 7;
 2371|     10|                    break;
 2372|     10|                } else if (in[2].first == OP_HASH160 && in[1].second.size() == 20) {
  ------------------
  |  Branch (2372:28): [True: 6, False: 0]
  |  Branch (2372:57): [True: 6, False: 0]
  ------------------
 2373|      6|                    constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::HASH160, in[1].second);
 2374|      6|                    in += 7;
 2375|      6|                    break;
 2376|      6|                }
 2377|     19|            }
 2378|       |            // Multi
 2379|  55.0k|            if (last - in >= 3 && in[0].first == OP_CHECKMULTISIG) {
  ------------------
  |  Branch (2379:17): [True: 54.7k, False: 268]
  |  Branch (2379:35): [True: 1.59k, False: 53.1k]
  ------------------
 2380|  1.59k|                if (IsTapscript(ctx.MsContext())) return {};
  ------------------
  |  Branch (2380:21): [True: 0, False: 1.59k]
  ------------------
 2381|  1.59k|                std::vector<Key> keys;
 2382|  1.59k|                const auto n = ParseScriptNumber(in[1]);
 2383|  1.59k|                if (!n || last - in < 3 + *n) return {};
  ------------------
  |  Branch (2383:21): [True: 0, False: 1.59k]
  |  Branch (2383:27): [True: 0, False: 1.59k]
  ------------------
 2384|  1.59k|                if (*n < 1 || *n > 20) return {};
  ------------------
  |  Branch (2384:21): [True: 0, False: 1.59k]
  |  Branch (2384:31): [True: 0, False: 1.59k]
  ------------------
 2385|  3.77k|                for (int i = 0; i < *n; ++i) {
  ------------------
  |  Branch (2385:33): [True: 2.17k, False: 1.59k]
  ------------------
 2386|  2.17k|                    if (in[2 + i].second.size() != 33) return {};
  ------------------
  |  Branch (2386:25): [True: 0, False: 2.17k]
  ------------------
 2387|  2.17k|                    auto key = ctx.FromPKBytes(in[2 + i].second.begin(), in[2 + i].second.end());
 2388|  2.17k|                    if (!key) return {};
  ------------------
  |  Branch (2388:25): [True: 0, False: 2.17k]
  ------------------
 2389|  2.17k|                    keys.push_back(std::move(*key));
 2390|  2.17k|                }
 2391|  1.59k|                const auto k = ParseScriptNumber(in[2 + *n]);
 2392|  1.59k|                if (!k || *k < 1 || *k > *n) return {};
  ------------------
  |  Branch (2392:21): [True: 0, False: 1.59k]
  |  Branch (2392:27): [True: 0, False: 1.59k]
  |  Branch (2392:37): [True: 0, False: 1.59k]
  ------------------
 2393|  1.59k|                in += 3 + *n;
 2394|  1.59k|                std::reverse(keys.begin(), keys.end());
 2395|  1.59k|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::MULTI, std::move(keys), *k);
 2396|  1.59k|                break;
 2397|  1.59k|            }
 2398|       |            // Tapscript's equivalent of multi
 2399|  53.4k|            if (last - in >= 4 && in[0].first == OP_NUMEQUAL) {
  ------------------
  |  Branch (2399:17): [True: 52.8k, False: 565]
  |  Branch (2399:35): [True: 951, False: 51.9k]
  ------------------
 2400|    951|                if (!IsTapscript(ctx.MsContext())) return {};
  ------------------
  |  Branch (2400:21): [True: 0, False: 951]
  ------------------
 2401|       |                // The necessary threshold of signatures.
 2402|    951|                const auto k = ParseScriptNumber(in[1]);
 2403|    951|                if (!k) return {};
  ------------------
  |  Branch (2403:21): [True: 0, False: 951]
  ------------------
 2404|    951|                if (*k < 1 || *k > MAX_PUBKEYS_PER_MULTI_A) return {};
  ------------------
  |  Branch (2404:21): [True: 0, False: 951]
  |  Branch (2404:31): [True: 0, False: 951]
  ------------------
 2405|    951|                if (last - in < 2 + *k * 2) return {};
  ------------------
  |  Branch (2405:21): [True: 0, False: 951]
  ------------------
 2406|    951|                std::vector<Key> keys;
 2407|    951|                keys.reserve(*k);
 2408|       |                // Walk through the expected (pubkey, CHECKSIG[ADD]) pairs.
 2409|  2.92k|                for (int pos = 2;; pos += 2) {
 2410|  2.92k|                    if (last - in < pos + 2) return {};
  ------------------
  |  Branch (2410:25): [True: 0, False: 2.92k]
  ------------------
 2411|       |                    // Make sure it's indeed an x-only pubkey and a CHECKSIG[ADD], then parse the key.
 2412|  2.92k|                    if (in[pos].first != OP_CHECKSIGADD && in[pos].first != OP_CHECKSIG) return {};
  ------------------
  |  Branch (2412:25): [True: 951, False: 1.97k]
  |  Branch (2412:60): [True: 0, False: 951]
  ------------------
 2413|  2.92k|                    if (in[pos + 1].second.size() != 32) return {};
  ------------------
  |  Branch (2413:25): [True: 0, False: 2.92k]
  ------------------
 2414|  2.92k|                    auto key = ctx.FromPKBytes(in[pos + 1].second.begin(), in[pos + 1].second.end());
 2415|  2.92k|                    if (!key) return {};
  ------------------
  |  Branch (2415:25): [True: 0, False: 2.92k]
  ------------------
 2416|  2.92k|                    keys.push_back(std::move(*key));
 2417|       |                    // Make sure early we don't parse an arbitrary large expression.
 2418|  2.92k|                    if (keys.size() > MAX_PUBKEYS_PER_MULTI_A) return {};
  ------------------
  |  Branch (2418:25): [True: 0, False: 2.92k]
  ------------------
 2419|       |                    // OP_CHECKSIG means it was the last one to parse.
 2420|  2.92k|                    if (in[pos].first == OP_CHECKSIG) break;
  ------------------
  |  Branch (2420:25): [True: 951, False: 1.97k]
  ------------------
 2421|  2.92k|                }
 2422|    951|                if (keys.size() < (size_t)*k) return {};
  ------------------
  |  Branch (2422:21): [True: 0, False: 951]
  ------------------
 2423|    951|                in += 2 + keys.size() * 2;
 2424|    951|                std::reverse(keys.begin(), keys.end());
 2425|    951|                constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::MULTI_A, std::move(keys), *k);
 2426|    951|                break;
 2427|    951|            }
 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|  52.5k|            if (in[0].first == OP_CHECKSIG) {
  ------------------
  |  Branch (2432:17): [True: 2.16k, False: 50.3k]
  ------------------
 2433|  2.16k|                ++in;
 2434|  2.16k|                to_parse.emplace_back(DecodeContext::CHECK, -1, -1);
 2435|  2.16k|                to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2436|  2.16k|                break;
 2437|  2.16k|            }
 2438|       |            // v: wrapper
 2439|  50.3k|            if (in[0].first == OP_VERIFY) {
  ------------------
  |  Branch (2439:17): [True: 5.14k, False: 45.1k]
  ------------------
 2440|  5.14k|                ++in;
 2441|  5.14k|                to_parse.emplace_back(DecodeContext::VERIFY, -1, -1);
 2442|  5.14k|                to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2443|  5.14k|                break;
 2444|  5.14k|            }
 2445|       |            // n: wrapper
 2446|  45.1k|            if (in[0].first == OP_0NOTEQUAL) {
  ------------------
  |  Branch (2446:17): [True: 15.6k, False: 29.5k]
  ------------------
 2447|  15.6k|                ++in;
 2448|  15.6k|                to_parse.emplace_back(DecodeContext::ZERO_NOTEQUAL, -1, -1);
 2449|  15.6k|                to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2450|  15.6k|                break;
 2451|  15.6k|            }
 2452|       |            // Thresh
 2453|  29.5k|            if (last - in >= 3 && in[0].first == OP_EQUAL && (num = ParseScriptNumber(in[1]))) {
  ------------------
  |  Branch (2453:17): [True: 29.5k, False: 0]
  |  Branch (2453:17): [True: 232, False: 29.2k]
  |  Branch (2453:35): [True: 232, False: 29.2k]
  |  Branch (2453:62): [True: 232, False: 0]
  ------------------
 2454|    232|                if (*num < 1) return {};
  ------------------
  |  Branch (2454:21): [True: 0, False: 232]
  ------------------
 2455|    232|                in += 2;
 2456|    232|                to_parse.emplace_back(DecodeContext::THRESH_W, 0, *num);
 2457|    232|                break;
 2458|    232|            }
 2459|       |            // OP_ENDIF can be WRAP_J, WRAP_D, ANDOR, OR_C, OR_D, or OR_I
 2460|  29.2k|            if (in[0].first == OP_ENDIF) {
  ------------------
  |  Branch (2460:17): [True: 29.2k, False: 22]
  ------------------
 2461|  29.2k|                ++in;
 2462|  29.2k|                to_parse.emplace_back(DecodeContext::ENDIF, -1, -1);
 2463|  29.2k|                to_parse.emplace_back(DecodeContext::BKV_EXPR, -1, -1);
 2464|  29.2k|                break;
 2465|  29.2k|            }
 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|     22|            if (in[0].first == OP_BOOLAND) {
  ------------------
  |  Branch (2472:17): [True: 6, False: 16]
  ------------------
 2473|      6|                ++in;
 2474|      6|                to_parse.emplace_back(DecodeContext::AND_B, -1, -1);
 2475|      6|                to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2476|      6|                to_parse.emplace_back(DecodeContext::W_EXPR, -1, -1);
 2477|      6|                break;
 2478|      6|            }
 2479|       |            // or_b
 2480|     16|            if (in[0].first == OP_BOOLOR) {
  ------------------
  |  Branch (2480:17): [True: 16, False: 0]
  ------------------
 2481|     16|                ++in;
 2482|     16|                to_parse.emplace_back(DecodeContext::OR_B, -1, -1);
 2483|     16|                to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2484|     16|                to_parse.emplace_back(DecodeContext::W_EXPR, -1, -1);
 2485|     16|                break;
 2486|     16|            }
 2487|       |            // Unrecognised expression
 2488|      0|            return {};
 2489|     16|        }
 2490|  66.8k|        case DecodeContext::BKV_EXPR: {
  ------------------
  |  Branch (2490:9): [True: 66.8k, False: 245k]
  ------------------
 2491|  66.8k|            to_parse.emplace_back(DecodeContext::MAYBE_AND_V, -1, -1);
 2492|  66.8k|            to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2493|  66.8k|            break;
 2494|     16|        }
 2495|    464|        case DecodeContext::W_EXPR: {
  ------------------
  |  Branch (2495:9): [True: 464, False: 312k]
  ------------------
 2496|       |            // a: wrapper
 2497|    464|            if (in >= last) return {};
  ------------------
  |  Branch (2497:17): [True: 0, False: 464]
  ------------------
 2498|    464|            if (in[0].first == OP_FROMALTSTACK) {
  ------------------
  |  Branch (2498:17): [True: 406, False: 58]
  ------------------
 2499|    406|                ++in;
 2500|    406|                to_parse.emplace_back(DecodeContext::ALT, -1, -1);
 2501|    406|            } else {
 2502|     58|                to_parse.emplace_back(DecodeContext::SWAP, -1, -1);
 2503|     58|            }
 2504|    464|            to_parse.emplace_back(DecodeContext::BKV_EXPR, -1, -1);
 2505|    464|            break;
 2506|    464|        }
 2507|  66.8k|        case DecodeContext::MAYBE_AND_V: {
  ------------------
  |  Branch (2507:9): [True: 66.8k, False: 245k]
  ------------------
 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|  66.8k|            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: 62.1k, False: 4.69k]
  |  Branch (2510:30): [True: 33.2k, False: 28.9k]
  |  Branch (2510:54): [True: 5.73k, False: 27.5k]
  |  Branch (2510:80): [True: 5.41k, False: 325]
  |  Branch (2510:107): [True: 5.00k, False: 406]
  |  Branch (2510:139): [True: 4.94k, False: 58]
  ------------------
 2511|  4.94k|                to_parse.emplace_back(DecodeContext::AND_V, -1, -1);
 2512|       |                // BKV_EXPR can contain more AND_V nodes
 2513|  4.94k|                to_parse.emplace_back(DecodeContext::BKV_EXPR, -1, -1);
 2514|  4.94k|            }
 2515|  66.8k|            break;
 2516|    464|        }
 2517|     58|        case DecodeContext::SWAP: {
  ------------------
  |  Branch (2517:9): [True: 58, False: 312k]
  ------------------
 2518|     58|            if (in >= last || in[0].first != OP_SWAP || constructed.empty()) return {};
  ------------------
  |  Branch (2518:17): [True: 0, False: 58]
  |  Branch (2518:31): [True: 0, False: 58]
  |  Branch (2518:57): [True: 0, False: 58]
  ------------------
 2519|     58|            ++in;
 2520|     58|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_S, Vector(std::move(constructed.back()))};
 2521|     58|            break;
 2522|     58|        }
 2523|    406|        case DecodeContext::ALT: {
  ------------------
  |  Branch (2523:9): [True: 406, False: 312k]
  ------------------
 2524|    406|            if (in >= last || in[0].first != OP_TOALTSTACK || constructed.empty()) return {};
  ------------------
  |  Branch (2524:17): [True: 0, False: 406]
  |  Branch (2524:31): [True: 0, False: 406]
  |  Branch (2524:63): [True: 0, False: 406]
  ------------------
 2525|    406|            ++in;
 2526|    406|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_A, Vector(std::move(constructed.back()))};
 2527|    406|            break;
 2528|    406|        }
 2529|  2.16k|        case DecodeContext::CHECK: {
  ------------------
  |  Branch (2529:9): [True: 2.16k, False: 310k]
  ------------------
 2530|  2.16k|            if (constructed.empty()) return {};
  ------------------
  |  Branch (2530:17): [True: 0, False: 2.16k]
  ------------------
 2531|  2.16k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_C, Vector(std::move(constructed.back()))};
 2532|  2.16k|            break;
 2533|  2.16k|        }
 2534|    102|        case DecodeContext::DUP_IF: {
  ------------------
  |  Branch (2534:9): [True: 102, False: 312k]
  ------------------
 2535|    102|            if (constructed.empty()) return {};
  ------------------
  |  Branch (2535:17): [True: 0, False: 102]
  ------------------
 2536|    102|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_D, Vector(std::move(constructed.back()))};
 2537|    102|            break;
 2538|    102|        }
 2539|  5.14k|        case DecodeContext::VERIFY: {
  ------------------
  |  Branch (2539:9): [True: 5.14k, False: 307k]
  ------------------
 2540|  5.14k|            if (constructed.empty()) return {};
  ------------------
  |  Branch (2540:17): [True: 0, False: 5.14k]
  ------------------
 2541|  5.14k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_V, Vector(std::move(constructed.back()))};
 2542|  5.14k|            break;
 2543|  5.14k|        }
 2544|  1.55k|        case DecodeContext::NON_ZERO: {
  ------------------
  |  Branch (2544:9): [True: 1.55k, False: 311k]
  ------------------
 2545|  1.55k|            if (constructed.empty()) return {};
  ------------------
  |  Branch (2545:17): [True: 0, False: 1.55k]
  ------------------
 2546|  1.55k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_J, Vector(std::move(constructed.back()))};
 2547|  1.55k|            break;
 2548|  1.55k|        }
 2549|  15.6k|        case DecodeContext::ZERO_NOTEQUAL: {
  ------------------
  |  Branch (2549:9): [True: 15.6k, False: 297k]
  ------------------
 2550|  15.6k|            if (constructed.empty()) return {};
  ------------------
  |  Branch (2550:17): [True: 0, False: 15.6k]
  ------------------
 2551|  15.6k|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_N, Vector(std::move(constructed.back()))};
 2552|  15.6k|            break;
 2553|  15.6k|        }
 2554|  4.94k|        case DecodeContext::AND_V: {
  ------------------
  |  Branch (2554:9): [True: 4.94k, False: 307k]
  ------------------
 2555|  4.94k|            if (constructed.size() < 2) return {};
  ------------------
  |  Branch (2555:17): [True: 0, False: 4.94k]
  ------------------
 2556|  4.94k|            BuildBack(ctx.MsContext(), Fragment::AND_V, constructed, /*reverse=*/true);
 2557|  4.94k|            break;
 2558|  4.94k|        }
 2559|      6|        case DecodeContext::AND_B: {
  ------------------
  |  Branch (2559:9): [True: 6, False: 312k]
  ------------------
 2560|      6|            if (constructed.size() < 2) return {};
  ------------------
  |  Branch (2560:17): [True: 0, False: 6]
  ------------------
 2561|      6|            BuildBack(ctx.MsContext(), Fragment::AND_B, constructed, /*reverse=*/true);
 2562|      6|            break;
 2563|      6|        }
 2564|     16|        case DecodeContext::OR_B: {
  ------------------
  |  Branch (2564:9): [True: 16, False: 312k]
  ------------------
 2565|     16|            if (constructed.size() < 2) return {};
  ------------------
  |  Branch (2565:17): [True: 0, False: 16]
  ------------------
 2566|     16|            BuildBack(ctx.MsContext(), Fragment::OR_B, constructed, /*reverse=*/true);
 2567|     16|            break;
 2568|     16|        }
 2569|     46|        case DecodeContext::OR_C: {
  ------------------
  |  Branch (2569:9): [True: 46, False: 312k]
  ------------------
 2570|     46|            if (constructed.size() < 2) return {};
  ------------------
  |  Branch (2570:17): [True: 0, False: 46]
  ------------------
 2571|     46|            BuildBack(ctx.MsContext(), Fragment::OR_C, constructed, /*reverse=*/true);
 2572|     46|            break;
 2573|     46|        }
 2574|     34|        case DecodeContext::OR_D: {
  ------------------
  |  Branch (2574:9): [True: 34, False: 312k]
  ------------------
 2575|     34|            if (constructed.size() < 2) return {};
  ------------------
  |  Branch (2575:17): [True: 0, False: 34]
  ------------------
 2576|     34|            BuildBack(ctx.MsContext(), Fragment::OR_D, constructed, /*reverse=*/true);
 2577|     34|            break;
 2578|     34|        }
 2579|    245|        case DecodeContext::ANDOR: {
  ------------------
  |  Branch (2579:9): [True: 245, False: 312k]
  ------------------
 2580|    245|            if (constructed.size() < 3) return {};
  ------------------
  |  Branch (2580:17): [True: 0, False: 245]
  ------------------
 2581|    245|            Node left{std::move(constructed.back())};
 2582|    245|            constructed.pop_back();
 2583|    245|            Node right{std::move(constructed.back())};
 2584|    245|            constructed.pop_back();
 2585|    245|            Node mid{std::move(constructed.back())};
 2586|    245|            constructed.back() = Node{internal::NoDupCheck{}, ctx.MsContext(), Fragment::ANDOR, Vector(std::move(left), std::move(mid), std::move(right))};
 2587|    245|            break;
 2588|    245|        }
 2589|    674|        case DecodeContext::THRESH_W: {
  ------------------
  |  Branch (2589:9): [True: 674, False: 312k]
  ------------------
 2590|    674|            if (in >= last) return {};
  ------------------
  |  Branch (2590:17): [True: 0, False: 674]
  ------------------
 2591|    674|            if (in[0].first == OP_ADD) {
  ------------------
  |  Branch (2591:17): [True: 442, False: 232]
  ------------------
 2592|    442|                ++in;
 2593|    442|                to_parse.emplace_back(DecodeContext::THRESH_W, n+1, k);
 2594|    442|                to_parse.emplace_back(DecodeContext::W_EXPR, -1, -1);
 2595|    442|            } else {
 2596|    232|                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|    232|                to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2599|    232|            }
 2600|    674|            break;
 2601|    674|        }
 2602|    232|        case DecodeContext::THRESH_E: {
  ------------------
  |  Branch (2602:9): [True: 232, False: 312k]
  ------------------
 2603|    232|            if (k < 1 || k > n || constructed.size() < static_cast<size_t>(n)) return {};
  ------------------
  |  Branch (2603:17): [True: 0, False: 232]
  |  Branch (2603:26): [True: 0, False: 232]
  |  Branch (2603:35): [True: 0, False: 232]
  ------------------
 2604|    232|            std::vector<Node<Key>> subs;
 2605|    906|            for (int i = 0; i < n; ++i) {
  ------------------
  |  Branch (2605:29): [True: 674, False: 232]
  ------------------
 2606|    674|                Node sub{std::move(constructed.back())};
 2607|    674|                constructed.pop_back();
 2608|    674|                subs.push_back(std::move(sub));
 2609|    674|            }
 2610|    232|            constructed.emplace_back(internal::NoDupCheck{}, ctx.MsContext(), Fragment::THRESH, std::move(subs), k);
 2611|    232|            break;
 2612|    232|        }
 2613|  29.2k|        case DecodeContext::ENDIF: {
  ------------------
  |  Branch (2613:9): [True: 29.2k, False: 283k]
  ------------------
 2614|  29.2k|            if (in >= last) return {};
  ------------------
  |  Branch (2614:17): [True: 0, False: 29.2k]
  ------------------
 2615|       |
 2616|       |            // could be andor or or_i
 2617|  29.2k|            if (in[0].first == OP_ELSE) {
  ------------------
  |  Branch (2617:17): [True: 27.5k, False: 1.73k]
  ------------------
 2618|  27.5k|                ++in;
 2619|  27.5k|                to_parse.emplace_back(DecodeContext::ENDIF_ELSE, -1, -1);
 2620|  27.5k|                to_parse.emplace_back(DecodeContext::BKV_EXPR, -1, -1);
 2621|  27.5k|            }
 2622|       |            // could be j: or d: wrapper
 2623|  1.73k|            else if (in[0].first == OP_IF) {
  ------------------
  |  Branch (2623:22): [True: 1.65k, False: 80]
  ------------------
 2624|  1.65k|                if (last - in >= 2 && in[1].first == OP_DUP) {
  ------------------
  |  Branch (2624:21): [True: 1.65k, False: 0]
  |  Branch (2624:39): [True: 102, False: 1.55k]
  ------------------
 2625|    102|                    in += 2;
 2626|    102|                    to_parse.emplace_back(DecodeContext::DUP_IF, -1, -1);
 2627|  1.55k|                } else if (last - in >= 3 && in[1].first == OP_0NOTEQUAL && in[2].first == OP_SIZE) {
  ------------------
  |  Branch (2627:28): [True: 1.55k, False: 0]
  |  Branch (2627:46): [True: 1.55k, False: 0]
  |  Branch (2627:77): [True: 1.55k, False: 0]
  ------------------
 2628|  1.55k|                    in += 3;
 2629|  1.55k|                    to_parse.emplace_back(DecodeContext::NON_ZERO, -1, -1);
 2630|  1.55k|                }
 2631|      0|                else {
 2632|      0|                    return {};
 2633|      0|                }
 2634|       |            // could be or_c or or_d
 2635|  1.65k|            } else if (in[0].first == OP_NOTIF) {
  ------------------
  |  Branch (2635:24): [True: 80, False: 0]
  ------------------
 2636|     80|                ++in;
 2637|     80|                to_parse.emplace_back(DecodeContext::ENDIF_NOTIF, -1, -1);
 2638|     80|            }
 2639|      0|            else {
 2640|      0|                return {};
 2641|      0|            }
 2642|  29.2k|            break;
 2643|  29.2k|        }
 2644|  29.2k|        case DecodeContext::ENDIF_NOTIF: {
  ------------------
  |  Branch (2644:9): [True: 80, False: 312k]
  ------------------
 2645|     80|            if (in >= last) return {};
  ------------------
  |  Branch (2645:17): [True: 0, False: 80]
  ------------------
 2646|     80|            if (in[0].first == OP_IFDUP) {
  ------------------
  |  Branch (2646:17): [True: 34, False: 46]
  ------------------
 2647|     34|                ++in;
 2648|     34|                to_parse.emplace_back(DecodeContext::OR_D, -1, -1);
 2649|     46|            } else {
 2650|     46|                to_parse.emplace_back(DecodeContext::OR_C, -1, -1);
 2651|     46|            }
 2652|       |            // or_c and or_d both require X to have type modifier d so, can't contain and_v
 2653|     80|            to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2654|     80|            break;
 2655|     80|        }
 2656|  27.5k|        case DecodeContext::ENDIF_ELSE: {
  ------------------
  |  Branch (2656:9): [True: 27.5k, False: 285k]
  ------------------
 2657|  27.5k|            if (in >= last) return {};
  ------------------
  |  Branch (2657:17): [True: 0, False: 27.5k]
  ------------------
 2658|  27.5k|            if (in[0].first == OP_IF) {
  ------------------
  |  Branch (2658:17): [True: 27.2k, False: 245]
  ------------------
 2659|  27.2k|                ++in;
 2660|  27.2k|                BuildBack(ctx.MsContext(), Fragment::OR_I, constructed, /*reverse=*/true);
 2661|  27.2k|            } else if (in[0].first == OP_NOTIF) {
  ------------------
  |  Branch (2661:24): [True: 245, False: 0]
  ------------------
 2662|    245|                ++in;
 2663|    245|                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|    245|                to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2666|    245|            } else {
 2667|      0|                return {};
 2668|      0|            }
 2669|  27.5k|            break;
 2670|  27.5k|        }
 2671|   312k|        }
 2672|   312k|    }
 2673|  4.69k|    if (constructed.size() != 1) return {};
  ------------------
  |  Branch (2673:9): [True: 0, False: 4.69k]
  ------------------
 2674|  4.69k|    Node tl_node{std::move(constructed.front())};
 2675|  4.69k|    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.69k|    if (!tl_node.IsValidTopLevel()) return {};
  ------------------
  |  Branch (2678:9): [True: 0, False: 4.69k]
  ------------------
 2679|  4.69k|    return tl_node;
 2680|  4.69k|}
_ZNK10miniscript4Type2IfEb:
  157|  6.90M|    constexpr Type If(bool x) const { return Type(x ? m_flags : 0); }
  ------------------
  |  Branch (157:51): [True: 2.42M, False: 4.47M]
  ------------------
_ZN10miniscript4TypeC2Ej:
  135|  49.9M|    explicit constexpr Type(uint32_t flags) : m_flags(flags) {}
_ZNK10miniscript4TypeorES0_:
  142|  23.8M|    constexpr Type operator|(Type x) const { return Type(m_flags | x.m_flags); }
_ZNK10miniscript4TypeanES0_:
  145|  19.2M|    constexpr Type operator&(Type x) const { return Type(m_flags & x.m_flags); }
_ZNK10miniscript4TypeeqES0_:
  154|  1.73M|    constexpr bool operator==(Type x) const { return m_flags == x.m_flags; }
_ZN10miniscript8internal3OpsC2EjNS0_6MaxIntIjEES3_:
  397|  5.04M|    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|  16.9M|    constexpr SatInfo() noexcept : valid(false), netdiff(0), exec(0) {}
_ZN10miniscript8internal7SatInfoC2Eii:
  456|  33.7M|        valid{true}, netdiff{in_netdiff}, exec{in_exec} {}
_ZN10miniscript8internalorERKNS0_7SatInfoES3_:
  464|  12.5M|    {
  465|       |        // Union with an empty set is itself.
  466|  12.5M|        if (!a.valid) return b;
  ------------------
  |  Branch (466:13): [True: 5.07M, False: 7.43M]
  ------------------
  467|  7.43M|        if (!b.valid) return a;
  ------------------
  |  Branch (467:13): [True: 1.88M, False: 5.55M]
  ------------------
  468|       |        // Otherwise the netdiff and exec of the union is the maximum of the individual values.
  469|  5.55M|        return {std::max(a.netdiff, b.netdiff), std::max(a.exec, b.exec)};
  470|  7.43M|    }
_ZN10miniscript8internalplERKNS0_7SatInfoES3_:
  474|  35.6M|    {
  475|       |        // Concatenation with an empty set yields an empty set.
  476|  35.6M|        if (!a.valid || !b.valid) return {};
  ------------------
  |  Branch (476:13): [True: 12.8M, False: 22.7M]
  |  Branch (476:25): [True: 1.95M, False: 20.8M]
  ------------------
  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|  20.8M|        return {a.netdiff + b.netdiff, std::max(b.exec, b.netdiff + a.exec)};
  481|  35.6M|    }
_ZN10miniscript8internal7SatInfo5EmptyEv:
  484|  49.7k|    static constexpr SatInfo Empty() noexcept { return {0, 0}; }
_ZN10miniscript8internal7SatInfo4PushEv:
  486|  1.96M|    static constexpr SatInfo Push() noexcept { return {-1, 0}; }
_ZN10miniscript8internal7SatInfo4HashEv:
  488|  4.86k|    static constexpr SatInfo Hash() noexcept { return {0, 0}; }
_ZN10miniscript8internal7SatInfo3NopEv:
  490|  21.1k|    static constexpr SatInfo Nop() noexcept { return {0, 0}; }
_ZN10miniscript8internal7SatInfo2IfEv:
  492|  2.99M|    static constexpr SatInfo If() noexcept { return {1, 1}; }
_ZN10miniscript8internal7SatInfo8BinaryOpEv:
  494|   154k|    static constexpr SatInfo BinaryOp() noexcept { return {1, 1}; }
_ZN10miniscript8internal7SatInfo6OP_DUPEv:
  497|   278k|    static constexpr SatInfo OP_DUP() noexcept { return {-1, 0}; }
_ZN10miniscript8internal7SatInfo8OP_IFDUPEb:
  498|  9.27k|    static constexpr SatInfo OP_IFDUP(bool nonzero) noexcept { return {nonzero ? -1 : 0, 0}; }
  ------------------
  |  Branch (498:72): [True: 3.09k, False: 6.18k]
  ------------------
_ZN10miniscript8internal7SatInfo14OP_EQUALVERIFYEv:
  499|  4.86k|    static constexpr SatInfo OP_EQUALVERIFY() noexcept { return {2, 2}; }
_ZN10miniscript8internal7SatInfo8OP_EQUALEv:
  500|  50.7k|    static constexpr SatInfo OP_EQUAL() noexcept { return {1, 1}; }
_ZN10miniscript8internal7SatInfo7OP_SIZEEv:
  501|  54.6k|    static constexpr SatInfo OP_SIZE() noexcept { return {-1, 0}; }
_ZN10miniscript8internal7SatInfo11OP_CHECKSIGEv:
  502|  1.65M|    static constexpr SatInfo OP_CHECKSIG() noexcept { return {1, 1}; }
_ZN10miniscript8internal7SatInfo12OP_0NOTEQUALEv:
  503|  53.6k|    static constexpr SatInfo OP_0NOTEQUAL() noexcept { return {0, 0}; }
_ZN10miniscript8internal7SatInfo9OP_VERIFYEv:
  504|  82.3k|    static constexpr SatInfo OP_VERIFY() noexcept { return {1, 1}; }
_ZN10miniscript8internal9StackSizeC2ENS0_7SatInfoES2_:
  512|  4.55M|    constexpr StackSize(SatInfo in_sat, SatInfo in_dsat) noexcept : sat(in_sat), dsat(in_dsat) {};
_ZN10miniscript8internal9StackSizeC2ENS0_7SatInfoE:
  513|  24.8k|    constexpr StackSize(SatInfo in_both) noexcept : sat(in_both), dsat(in_both) {};
_ZNK10miniscript8internal9StackSize3SatEv:
  515|  15.6M|    const SatInfo& Sat() const { return sat; }
_ZNK10miniscript8internal9StackSize4DsatEv:
  516|  13.5M|    const SatInfo& Dsat() const { return dsat; }
_ZN10miniscript8internal11WitnessSizeC2ENS0_6MaxIntIjEES3_:
  525|  3.75M|    WitnessSize(MaxInt<uint32_t> in_sat, MaxInt<uint32_t> in_dsat) : sat(in_sat), dsat(in_dsat) {};
_ZN10miniscript8internal13MaxScriptSizeENS_17MiniscriptContextE:
  285|  1.41M|{
  286|  1.41M|    if (IsTapscript(ms_ctx)) {
  ------------------
  |  Branch (286:9): [True: 1.09M, False: 319k]
  ------------------
  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|  1.09M|        constexpr auto max_size{MAX_STANDARD_TX_WEIGHT - TX_BODY_LEEWAY_WEIGHT - MAX_TAPSCRIPT_SAT_SIZE};
  293|  1.09M|        return max_size - GetSizeOfCompactSize(max_size);
  294|  1.09M|    }
  295|   319k|    return MAX_STANDARD_P2WSH_SCRIPT_SIZE;
  296|  1.41M|}
_ZN10miniscript11IsTapscriptENS_17MiniscriptContextE:
  260|  13.9M|{
  261|  13.9M|    switch (ms_ctx) {
  ------------------
  |  Branch (261:13): [True: 13.9M, False: 0]
  ------------------
  262|  1.16M|        case MiniscriptContext::P2WSH: return false;
  ------------------
  |  Branch (262:9): [True: 1.16M, False: 12.7M]
  ------------------
  263|  12.7M|        case MiniscriptContext::TAPSCRIPT: return true;
  ------------------
  |  Branch (263:9): [True: 12.7M, False: 1.16M]
  ------------------
  264|  13.9M|    }
  265|  13.9M|    assert(false);
  ------------------
  |  Branch (265:5): [Folded, False: 0]
  ------------------
  266|      0|}
_ZN10miniscript8internal6MaxIntIjEC2Ej:
  372|  49.6M|    MaxInt(I val) : valid(true), value(val) {}
_ZN10miniscript8internal6MaxIntIjEC2Ev:
  371|  26.8M|    MaxInt() : valid(false), value(0) {}
_ZN10miniscript8internalplERKNS0_6MaxIntIjEES4_:
  377|  48.6M|    friend MaxInt<I> operator+(const MaxInt<I>& a, const MaxInt<I>& b) {
  378|  48.6M|        if (!a.valid || !b.valid) return {};
  ------------------
  |  Branch (378:13): [True: 19.5M, False: 29.0M]
  |  Branch (378:25): [True: 2.85M, False: 26.2M]
  ------------------
  379|  26.2M|        return a.value + b.value;
  380|  48.6M|    }
_ZN10miniscript8internalorERKNS0_6MaxIntIjEES4_:
  382|  25.0M|    friend MaxInt<I> operator|(const MaxInt<I>& a, const MaxInt<I>& b) {
  383|  25.0M|        if (!a.valid) return b;
  ------------------
  |  Branch (383:13): [True: 10.1M, False: 14.8M]
  ------------------
  384|  14.8M|        if (!b.valid) return a;
  ------------------
  |  Branch (384:13): [True: 3.76M, False: 11.1M]
  ------------------
  385|  11.1M|        return std::max(a.value, b.value);
  386|  14.8M|    }
_ZNK10miniscript4TypelsES0_:
  148|  84.0M|    constexpr bool operator<<(Type x) const { return (x.m_flags & ~m_flags) == 0; }

_ZN6script5ConstERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_4spanIKcLm18446744073709551615EEEb:
   14|  2.73M|{
   15|  2.73M|    if ((size_t)sp.size() >= str.size() && std::equal(str.begin(), str.end(), sp.begin())) {
  ------------------
  |  Branch (15:9): [True: 2.71M, False: 17.4k]
  |  Branch (15:44): [True: 414k, False: 2.30M]
  ------------------
   16|   414k|        if (skip) sp = sp.subspan(str.size());
  ------------------
  |  Branch (16:13): [True: 362k, False: 51.8k]
  ------------------
   17|   414k|        return true;
   18|   414k|    }
   19|  2.32M|    return false;
   20|  2.73M|}
_ZN6script4FuncERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERNS0_4spanIKcLm18446744073709551615EEE:
   23|   344k|{
   24|   344k|    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: 333k, False: 11.0k]
  |  Branch (24:48): [True: 99.2k, False: 234k]
  |  Branch (24:73): [True: 95.6k, False: 3.59k]
  |  Branch (24:101): [True: 64.6k, False: 30.9k]
  ------------------
   25|  64.6k|        sp = sp.subspan(str.size() + 1, sp.size() - str.size() - 2);
   26|  64.6k|        return true;
   27|  64.6k|    }
   28|   279k|    return false;
   29|   344k|}
_ZN6script4ExprERNSt3__14spanIKcLm18446744073709551615EEE:
   32|   172k|{
   33|   172k|    int level = 0;
   34|   172k|    auto it = sp.begin();
   35|   124M|    while (it != sp.end()) {
  ------------------
  |  Branch (35:12): [True: 124M, False: 46.9k]
  ------------------
   36|   124M|        if (*it == '(' || *it == '{') {
  ------------------
  |  Branch (36:13): [True: 2.96M, False: 121M]
  |  Branch (36:27): [True: 19.1k, False: 121M]
  ------------------
   37|  2.97M|            ++level;
   38|   121M|        } else if (level && (*it == ')' || *it == '}')) {
  ------------------
  |  Branch (38:20): [True: 111M, False: 10.4M]
  |  Branch (38:30): [True: 2.18M, False: 108M]
  |  Branch (38:44): [True: 8.50k, False: 108M]
  ------------------
   39|  2.19M|            --level;
   40|   119M|        } else if (level == 0 && (*it == ')' || *it == '}' || *it == ',')) {
  ------------------
  |  Branch (40:20): [True: 10.4M, False: 108M]
  |  Branch (40:35): [True: 16.4k, False: 10.4M]
  |  Branch (40:49): [True: 1.96k, False: 10.4M]
  |  Branch (40:63): [True: 107k, False: 10.3M]
  ------------------
   41|   125k|            break;
   42|   125k|        }
   43|   124M|        ++it;
   44|   124M|    }
   45|   172k|    std::span<const char> ret = sp.first(it - sp.begin());
   46|   172k|    sp = sp.subspan(it - sp.begin());
   47|   172k|    return ret;
   48|   172k|}

_ZN9CScriptIDC2ERK7CScript:
   17|  13.9k|CScriptID::CScriptID(const CScript& in) : BaseHash(Hash160(in)) {}
_ZNK7CScript13IsPayToAnchorEv:
  208|     96|{
  209|     96|    return (this->size() == 4 &&
  ------------------
  |  Branch (209:13): [True: 42, False: 54]
  ------------------
  210|     42|        (*this)[0] == OP_1 &&
  ------------------
  |  Branch (210:9): [True: 27, False: 15]
  ------------------
  211|     27|        (*this)[1] == 0x02 &&
  ------------------
  |  Branch (211:9): [True: 27, False: 0]
  ------------------
  212|     27|        (*this)[2] == 0x4e &&
  ------------------
  |  Branch (212:9): [True: 6, False: 21]
  ------------------
  213|      6|        (*this)[3] == 0x73);
  ------------------
  |  Branch (213:9): [True: 3, False: 3]
  ------------------
  214|     96|}
_ZN7CScript13IsPayToAnchorEiRKNSt3__16vectorIhNS0_9allocatorIhEEEE:
  217|      2|{
  218|      2|    return version == 1 &&
  ------------------
  |  Branch (218:12): [True: 2, False: 0]
  ------------------
  219|      2|        program.size() == 2 &&
  ------------------
  |  Branch (219:9): [True: 2, False: 0]
  ------------------
  220|      2|        program[0] == 0x4e &&
  ------------------
  |  Branch (220:9): [True: 2, False: 0]
  ------------------
  221|      2|        program[1] == 0x73;
  ------------------
  |  Branch (221:9): [True: 2, False: 0]
  ------------------
  222|      2|}
_ZNK7CScript17IsPayToScriptHashEv:
  225|  43.1k|{
  226|       |    // Extra-fast test for pay-to-script-hash CScripts:
  227|  43.1k|    return (this->size() == 23 &&
  ------------------
  |  Branch (227:13): [True: 3.05k, False: 40.1k]
  ------------------
  228|  3.05k|            (*this)[0] == OP_HASH160 &&
  ------------------
  |  Branch (228:13): [True: 3.04k, False: 12]
  ------------------
  229|  3.04k|            (*this)[1] == 0x14 &&
  ------------------
  |  Branch (229:13): [True: 3.03k, False: 12]
  ------------------
  230|  3.03k|            (*this)[22] == OP_EQUAL);
  ------------------
  |  Branch (230:13): [True: 3.01k, False: 15]
  ------------------
  231|  43.1k|}
_ZNK7CScript16IsWitnessProgramERiRNSt3__16vectorIhNS1_9allocatorIhEEEE:
  251|  40.1k|{
  252|  40.1k|    if (this->size() < 4 || this->size() > 42) {
  ------------------
  |  Branch (252:9): [True: 249, False: 39.9k]
  |  Branch (252:29): [True: 4.41k, False: 35.5k]
  ------------------
  253|  4.66k|        return false;
  254|  4.66k|    }
  255|  35.5k|    if ((*this)[0] != OP_0 && ((*this)[0] < OP_1 || (*this)[0] > OP_16)) {
  ------------------
  |  Branch (255:9): [True: 30.8k, False: 4.68k]
  |  Branch (255:32): [True: 2.91k, False: 27.9k]
  |  Branch (255:53): [True: 1.82k, False: 26.0k]
  ------------------
  256|  4.73k|        return false;
  257|  4.73k|    }
  258|  30.7k|    if ((size_t)((*this)[1] + 2) == this->size()) {
  ------------------
  |  Branch (258:9): [True: 30.1k, False: 605]
  ------------------
  259|  30.1k|        version = DecodeOP_N((opcodetype)(*this)[0]);
  260|  30.1k|        program = std::vector<unsigned char>(this->begin() + 2, this->end());
  261|  30.1k|        return true;
  262|  30.1k|    }
  263|    605|    return false;
  264|  30.7k|}
_ZNK7CScript10IsPushOnlyEN9prevectorILj36EhjiE14const_iteratorE:
  267|    306|{
  268|  2.32k|    while (pc < end())
  ------------------
  |  Branch (268:12): [True: 2.25k, False: 69]
  ------------------
  269|  2.25k|    {
  270|  2.25k|        opcodetype opcode;
  271|  2.25k|        if (!GetOp(pc, opcode))
  ------------------
  |  Branch (271:13): [True: 213, False: 2.04k]
  ------------------
  272|    213|            return false;
  273|       |        // Note that IsPushOnly() *does* consider OP_RESERVED to be a
  274|       |        // push-type opcode, however execution of OP_RESERVED fails, so
  275|       |        // it's not relevant to P2SH/BIP62 as the scriptSig would fail prior to
  276|       |        // the P2SH special validation code being executed.
  277|  2.04k|        if (opcode > OP_16)
  ------------------
  |  Branch (277:13): [True: 24, False: 2.01k]
  ------------------
  278|     24|            return false;
  279|  2.04k|    }
  280|     69|    return true;
  281|    306|}
_Z11GetScriptOpRN9prevectorILj36EhjiE14const_iteratorES1_R10opcodetypePNSt3__16vectorIhNS5_9allocatorIhEEEE:
  314|   187k|{
  315|   187k|    opcodeRet = OP_INVALIDOPCODE;
  316|   187k|    if (pvchRet)
  ------------------
  |  Branch (316:9): [True: 185k, False: 2.25k]
  ------------------
  317|   185k|        pvchRet->clear();
  318|   187k|    if (pc >= end)
  ------------------
  |  Branch (318:9): [True: 3, False: 187k]
  ------------------
  319|      3|        return false;
  320|       |
  321|       |    // Read instruction
  322|   187k|    if (end - pc < 1)
  ------------------
  |  Branch (322:9): [True: 0, False: 187k]
  ------------------
  323|      0|        return false;
  324|   187k|    unsigned int opcode = *pc++;
  325|       |
  326|       |    // Immediate operand
  327|   187k|    if (opcode <= OP_PUSHDATA4)
  ------------------
  |  Branch (327:9): [True: 45.0k, False: 142k]
  ------------------
  328|  45.0k|    {
  329|  45.0k|        unsigned int nSize = 0;
  330|  45.0k|        if (opcode < OP_PUSHDATA1)
  ------------------
  |  Branch (330:13): [True: 44.3k, False: 678]
  ------------------
  331|  44.3k|        {
  332|  44.3k|            nSize = opcode;
  333|  44.3k|        }
  334|    678|        else if (opcode == OP_PUSHDATA1)
  ------------------
  |  Branch (334:18): [True: 231, False: 447]
  ------------------
  335|    231|        {
  336|    231|            if (end - pc < 1)
  ------------------
  |  Branch (336:17): [True: 9, False: 222]
  ------------------
  337|      9|                return false;
  338|    222|            nSize = *pc++;
  339|    222|        }
  340|    447|        else if (opcode == OP_PUSHDATA2)
  ------------------
  |  Branch (340:18): [True: 183, False: 264]
  ------------------
  341|    183|        {
  342|    183|            if (end - pc < 2)
  ------------------
  |  Branch (342:17): [True: 6, False: 177]
  ------------------
  343|      6|                return false;
  344|    177|            nSize = ReadLE16(&pc[0]);
  345|    177|            pc += 2;
  346|    177|        }
  347|    264|        else if (opcode == OP_PUSHDATA4)
  ------------------
  |  Branch (347:18): [True: 264, False: 0]
  ------------------
  348|    264|        {
  349|    264|            if (end - pc < 4)
  ------------------
  |  Branch (349:17): [True: 12, False: 252]
  ------------------
  350|     12|                return false;
  351|    252|            nSize = ReadLE32(&pc[0]);
  352|    252|            pc += 4;
  353|    252|        }
  354|  45.0k|        if (end - pc < 0 || (unsigned int)(end - pc) < nSize)
  ------------------
  |  Branch (354:13): [True: 0, False: 45.0k]
  |  Branch (354:29): [True: 351, False: 44.6k]
  ------------------
  355|    351|            return false;
  356|  44.6k|        if (pvchRet)
  ------------------
  |  Branch (356:13): [True: 43.2k, False: 1.46k]
  ------------------
  357|  43.2k|            pvchRet->assign(pc, pc + nSize);
  358|  44.6k|        pc += nSize;
  359|  44.6k|    }
  360|       |
  361|   187k|    opcodeRet = static_cast<opcodetype>(opcode);
  362|   187k|    return true;
  363|   187k|}
_Z16CheckMinimalPushRKNSt3__16vectorIhNS_9allocatorIhEEEE10opcodetype:
  373|  8.38k|bool CheckMinimalPush(const std::vector<unsigned char>& data, opcodetype opcode) {
  374|       |    // Excludes OP_1NEGATE, OP_1-16 since they are by definition minimal
  375|  8.38k|    assert(0 <= opcode && opcode <= OP_PUSHDATA4);
  ------------------
  |  Branch (375:5): [True: 8.38k, False: 0]
  |  Branch (375:5): [True: 8.38k, False: 0]
  |  Branch (375:5): [True: 8.38k, False: 0]
  ------------------
  376|  8.38k|    if (data.size() == 0) {
  ------------------
  |  Branch (376:9): [True: 6, False: 8.38k]
  ------------------
  377|       |        // Should have used OP_0.
  378|      6|        return opcode == OP_0;
  379|  8.38k|    } else if (data.size() == 1 && data[0] >= 1 && data[0] <= 16) {
  ------------------
  |  Branch (379:16): [True: 364, False: 8.01k]
  |  Branch (379:36): [True: 355, False: 9]
  |  Branch (379:52): [True: 27, False: 328]
  ------------------
  380|       |        // Should have used OP_1 .. OP_16.
  381|     27|        return false;
  382|  8.35k|    } else if (data.size() == 1 && data[0] == 0x81) {
  ------------------
  |  Branch (382:16): [True: 337, False: 8.01k]
  |  Branch (382:36): [True: 3, False: 334]
  ------------------
  383|       |        // Should have used OP_1NEGATE.
  384|      3|        return false;
  385|  8.35k|    } else if (data.size() <= 75) {
  ------------------
  |  Branch (385:16): [True: 8.34k, False: 6]
  ------------------
  386|       |        // Must have used a direct push (opcode indicating number of bytes pushed + those bytes).
  387|  8.34k|        return opcode == data.size();
  388|  8.34k|    } else if (data.size() <= 255) {
  ------------------
  |  Branch (388:16): [True: 6, False: 0]
  ------------------
  389|       |        // Must have used OP_PUSHDATA.
  390|      6|        return opcode == OP_PUSHDATA1;
  391|      6|    } 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|  8.38k|}

_Z12ToByteVectorI6PKHashENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   69|  1.99k|{
   70|  1.99k|    return std::vector<unsigned char>(in.begin(), in.end());
   71|  1.99k|}
_Z12ToByteVectorI10ScriptHashENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   69|  6.01k|{
   70|  6.01k|    return std::vector<unsigned char>(in.begin(), in.end());
   71|  6.01k|}
_Z12ToByteVectorI19WitnessV0ScriptHashENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   69|  7.93k|{
   70|  7.93k|    return std::vector<unsigned char>(in.begin(), in.end());
   71|  7.93k|}
_Z12ToByteVectorI16WitnessV0KeyHashENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   69|  1.36k|{
   70|  1.36k|    return std::vector<unsigned char>(in.begin(), in.end());
   71|  1.36k|}
_Z12ToByteVectorI16WitnessV1TaprootENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   69|  50.8k|{
   70|  50.8k|    return std::vector<unsigned char>(in.begin(), in.end());
   71|  50.8k|}
_Z11BuildScriptIJRKmEE7CScriptDpOT_:
  612|  3.38k|{
  613|  3.38k|    CScript ret;
  614|  3.38k|    int cnt{0};
  615|       |
  616|  3.38k|    ([&ret, &cnt] (Ts&& input) {
  617|  3.38k|        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.38k|            if (cnt == 0) {
  620|  3.38k|                ret = std::forward<Ts>(input);
  621|  3.38k|            } else {
  622|  3.38k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  3.38k|            }
  624|  3.38k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.38k|            ret << input;
  627|  3.38k|        }
  628|  3.38k|        cnt++;
  629|  3.38k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  3.38k|    return ret;
  632|  3.38k|}
_ZZ11BuildScriptIJRKmEE7CScriptDpOT_ENKUlS1_E_clES1_:
  616|  3.38k|    ([&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.38k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.38k|            ret << input;
  627|  3.38k|        }
  628|  3.38k|        cnt++;
  629|  3.38k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJRKiEE7CScriptDpOT_:
  612|  3.38k|{
  613|  3.38k|    CScript ret;
  614|  3.38k|    int cnt{0};
  615|       |
  616|  3.38k|    ([&ret, &cnt] (Ts&& input) {
  617|  3.38k|        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.38k|            if (cnt == 0) {
  620|  3.38k|                ret = std::forward<Ts>(input);
  621|  3.38k|            } else {
  622|  3.38k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  3.38k|            }
  624|  3.38k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.38k|            ret << input;
  627|  3.38k|        }
  628|  3.38k|        cnt++;
  629|  3.38k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  3.38k|    return ret;
  632|  3.38k|}
_ZZ11BuildScriptIJRKiEE7CScriptDpOT_ENKUlS1_E_clES1_:
  616|  3.38k|    ([&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.38k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.38k|            ret << input;
  627|  3.38k|        }
  628|  3.38k|        cnt++;
  629|  3.38k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJRKlEE7CScriptDpOT_:
  612|    403|{
  613|    403|    CScript ret;
  614|    403|    int cnt{0};
  615|       |
  616|    403|    ([&ret, &cnt] (Ts&& input) {
  617|    403|        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|    403|            if (cnt == 0) {
  620|    403|                ret = std::forward<Ts>(input);
  621|    403|            } else {
  622|    403|                ret.insert(ret.end(), input.begin(), input.end());
  623|    403|            }
  624|    403|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|    403|            ret << input;
  627|    403|        }
  628|    403|        cnt++;
  629|    403|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|    403|    return ret;
  632|    403|}
_ZZ11BuildScriptIJRKlEE7CScriptDpOT_ENKUlS1_E_clES1_:
  616|    403|    ([&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|    403|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|    403|            ret << input;
  627|    403|        }
  628|    403|        cnt++;
  629|    403|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJNSt3__16vectorIhNS0_9allocatorIhEEEEEE7CScriptDpOT_:
  612|  2.59k|{
  613|  2.59k|    CScript ret;
  614|  2.59k|    int cnt{0};
  615|       |
  616|  2.59k|    ([&ret, &cnt] (Ts&& input) {
  617|  2.59k|        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.59k|            if (cnt == 0) {
  620|  2.59k|                ret = std::forward<Ts>(input);
  621|  2.59k|            } else {
  622|  2.59k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  2.59k|            }
  624|  2.59k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  2.59k|            ret << input;
  627|  2.59k|        }
  628|  2.59k|        cnt++;
  629|  2.59k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  2.59k|    return ret;
  632|  2.59k|}
_ZZ11BuildScriptIJNSt3__16vectorIhNS0_9allocatorIhEEEEEE7CScriptDpOT_ENKUlOS4_E_clES9_:
  616|  2.59k|    ([&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.59k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  2.59k|            ret << input;
  627|  2.59k|        }
  628|  2.59k|        cnt++;
  629|  2.59k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeS0_NSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_:
  612|  1.73k|{
  613|  1.73k|    CScript ret;
  614|  1.73k|    int cnt{0};
  615|       |
  616|  1.73k|    ([&ret, &cnt] (Ts&& input) {
  617|  1.73k|        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.73k|            if (cnt == 0) {
  620|  1.73k|                ret = std::forward<Ts>(input);
  621|  1.73k|            } else {
  622|  1.73k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  1.73k|            }
  624|  1.73k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  1.73k|            ret << input;
  627|  1.73k|        }
  628|  1.73k|        cnt++;
  629|  1.73k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  1.73k|    return ret;
  632|  1.73k|}
_ZZ11BuildScriptIJ10opcodetypeS0_NSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E1_clESA_:
  616|  1.73k|    ([&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.73k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  1.73k|            ret << input;
  627|  1.73k|        }
  628|  1.73k|        cnt++;
  629|  1.73k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_NSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E0_clESA_:
  616|  1.73k|    ([&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.73k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  1.73k|            ret << input;
  627|  1.73k|        }
  628|  1.73k|        cnt++;
  629|  1.73k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_NSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS5_E_clESA_:
  616|  1.73k|    ([&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.73k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  1.73k|            ret << input;
  627|  1.73k|        }
  628|  1.73k|        cnt++;
  629|  1.73k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_NSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E_clESA_:
  616|  1.73k|    ([&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.73k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  1.73k|            ret << input;
  627|  1.73k|        }
  628|  1.73k|        cnt++;
  629|  1.73k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJRKj10opcodetypeEE7CScriptDpOT_:
  612|    520|{
  613|    520|    CScript ret;
  614|    520|    int cnt{0};
  615|       |
  616|    520|    ([&ret, &cnt] (Ts&& input) {
  617|    520|        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|    520|            if (cnt == 0) {
  620|    520|                ret = std::forward<Ts>(input);
  621|    520|            } else {
  622|    520|                ret.insert(ret.end(), input.begin(), input.end());
  623|    520|            }
  624|    520|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|    520|            ret << input;
  627|    520|        }
  628|    520|        cnt++;
  629|    520|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|    520|    return ret;
  632|    520|}
_ZZ11BuildScriptIJRKj10opcodetypeEE7CScriptDpOT_ENKUlS1_E_clES1_:
  616|    520|    ([&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|    520|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|    520|            ret << input;
  627|    520|        }
  628|    520|        cnt++;
  629|    520|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJRKj10opcodetypeEE7CScriptDpOT_ENKUlOS2_E_clES7_:
  616|    520|    ([&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|    520|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|    520|            ret << input;
  627|    520|        }
  628|    520|        cnt++;
  629|    520|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeiS0_S0_RKNSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_:
  612|     38|{
  613|     38|    CScript ret;
  614|     38|    int cnt{0};
  615|       |
  616|     38|    ([&ret, &cnt] (Ts&& input) {
  617|     38|        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|            if (cnt == 0) {
  620|     38|                ret = std::forward<Ts>(input);
  621|     38|            } else {
  622|     38|                ret.insert(ret.end(), input.begin(), input.end());
  623|     38|            }
  624|     38|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|     38|            ret << input;
  627|     38|        }
  628|     38|        cnt++;
  629|     38|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|     38|    return ret;
  632|     38|}
_ZZ11BuildScriptIJ10opcodetypeiS0_S0_RKNSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E2_clESC_:
  616|     38|    ([&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|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|     38|            ret << input;
  627|     38|        }
  628|     38|        cnt++;
  629|     38|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeiS0_S0_RKNSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOiE_clESC_:
  616|     38|    ([&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|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|     38|            ret << input;
  627|     38|        }
  628|     38|        cnt++;
  629|     38|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeiS0_S0_RKNSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E1_clESC_:
  616|     38|    ([&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|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|     38|            ret << input;
  627|     38|        }
  628|     38|        cnt++;
  629|     38|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeiS0_S0_RKNSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E0_clESC_:
  616|     38|    ([&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|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|     38|            ret << input;
  627|     38|        }
  628|     38|        cnt++;
  629|     38|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeiS0_S0_RKNSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlS7_E_clES7_:
  616|     38|    ([&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|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|     38|            ret << input;
  627|     38|        }
  628|     38|        cnt++;
  629|     38|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeiS0_S0_RKNSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E_clESC_:
  616|     38|    ([&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|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|     38|            ret << input;
  627|     38|        }
  628|     38|        cnt++;
  629|     38|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeR7CScriptS0_EES1_DpOT_:
  612|    812|{
  613|    812|    CScript ret;
  614|    812|    int cnt{0};
  615|       |
  616|    812|    ([&ret, &cnt] (Ts&& input) {
  617|    812|        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|    812|            if (cnt == 0) {
  620|    812|                ret = std::forward<Ts>(input);
  621|    812|            } else {
  622|    812|                ret.insert(ret.end(), input.begin(), input.end());
  623|    812|            }
  624|    812|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|    812|            ret << input;
  627|    812|        }
  628|    812|        cnt++;
  629|    812|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|    812|    return ret;
  632|    812|}
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_EES1_DpOT_ENKUlOS0_E0_clES6_:
  616|    812|    ([&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|    812|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|    812|            ret << input;
  627|    812|        }
  628|    812|        cnt++;
  629|    812|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_EES1_DpOT_ENKUlS2_E_clES2_:
  616|    812|    ([&ret, &cnt] (Ts&& input) {
  617|    812|        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|    812|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 812]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|    812|            } else {
  622|    812|                ret.insert(ret.end(), input.begin(), input.end());
  623|    812|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|    812|        cnt++;
  629|    812|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_EES1_DpOT_ENKUlOS0_E_clES6_:
  616|    812|    ([&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|    812|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|    812|            ret << input;
  627|    812|        }
  628|    812|        cnt++;
  629|    812|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeR7CScriptEES1_DpOT_:
  612|    116|{
  613|    116|    CScript ret;
  614|    116|    int cnt{0};
  615|       |
  616|    116|    ([&ret, &cnt] (Ts&& input) {
  617|    116|        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|    116|            if (cnt == 0) {
  620|    116|                ret = std::forward<Ts>(input);
  621|    116|            } else {
  622|    116|                ret.insert(ret.end(), input.begin(), input.end());
  623|    116|            }
  624|    116|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|    116|            ret << input;
  627|    116|        }
  628|    116|        cnt++;
  629|    116|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|    116|    return ret;
  632|    116|}
_ZZ11BuildScriptIJ10opcodetypeR7CScriptEES1_DpOT_ENKUlOS0_E_clES6_:
  616|    116|    ([&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|    116|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|    116|            ret << input;
  627|    116|        }
  628|    116|        cnt++;
  629|    116|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptEES1_DpOT_ENKUlS2_E_clES2_:
  616|    116|    ([&ret, &cnt] (Ts&& input) {
  617|    116|        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|    116|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 116]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|    116|            } else {
  622|    116|                ret.insert(ret.end(), input.begin(), input.end());
  623|    116|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|    116|        cnt++;
  629|    116|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScript10opcodetypeEES0_DpOT_:
  612|  43.5k|{
  613|  43.5k|    CScript ret;
  614|  43.5k|    int cnt{0};
  615|       |
  616|  43.5k|    ([&ret, &cnt] (Ts&& input) {
  617|  43.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|  43.5k|            if (cnt == 0) {
  620|  43.5k|                ret = std::forward<Ts>(input);
  621|  43.5k|            } else {
  622|  43.5k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  43.5k|            }
  624|  43.5k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  43.5k|            ret << input;
  627|  43.5k|        }
  628|  43.5k|        cnt++;
  629|  43.5k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  43.5k|    return ret;
  632|  43.5k|}
_ZZ11BuildScriptIJ7CScript10opcodetypeEES0_DpOT_ENKUlOS0_E_clES5_:
  616|  43.5k|    ([&ret, &cnt] (Ts&& input) {
  617|  43.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|  43.5k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 43.5k, False: 0]
  ------------------
  620|  43.5k|                ret = std::forward<Ts>(input);
  621|  43.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|  43.5k|        cnt++;
  629|  43.5k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeEES0_DpOT_ENKUlOS1_E_clES5_:
  616|  43.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|  43.5k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  43.5k|            ret << input;
  627|  43.5k|        }
  628|  43.5k|        cnt++;
  629|  43.5k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeS0_R7CScriptS0_EES1_DpOT_:
  612|    204|{
  613|    204|    CScript ret;
  614|    204|    int cnt{0};
  615|       |
  616|    204|    ([&ret, &cnt] (Ts&& input) {
  617|    204|        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|    204|            if (cnt == 0) {
  620|    204|                ret = std::forward<Ts>(input);
  621|    204|            } else {
  622|    204|                ret.insert(ret.end(), input.begin(), input.end());
  623|    204|            }
  624|    204|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|    204|            ret << input;
  627|    204|        }
  628|    204|        cnt++;
  629|    204|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|    204|    return ret;
  632|    204|}
_ZZ11BuildScriptIJ10opcodetypeS0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E1_clES6_:
  616|    204|    ([&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|    204|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|    204|            ret << input;
  627|    204|        }
  628|    204|        cnt++;
  629|    204|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E0_clES6_:
  616|    204|    ([&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|    204|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|    204|            ret << input;
  627|    204|        }
  628|    204|        cnt++;
  629|    204|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_R7CScriptS0_EES1_DpOT_ENKUlS2_E_clES2_:
  616|    204|    ([&ret, &cnt] (Ts&& input) {
  617|    204|        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|    204|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 204]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|    204|            } else {
  622|    204|                ret.insert(ret.end(), input.begin(), input.end());
  623|    204|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|    204|        cnt++;
  629|    204|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E_clES6_:
  616|    204|    ([&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|    204|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|    204|            ret << input;
  627|    204|        }
  628|    204|        cnt++;
  629|    204|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_:
  612|  3.11k|{
  613|  3.11k|    CScript ret;
  614|  3.11k|    int cnt{0};
  615|       |
  616|  3.11k|    ([&ret, &cnt] (Ts&& input) {
  617|  3.11k|        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.11k|            if (cnt == 0) {
  620|  3.11k|                ret = std::forward<Ts>(input);
  621|  3.11k|            } else {
  622|  3.11k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  3.11k|            }
  624|  3.11k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.11k|            ret << input;
  627|  3.11k|        }
  628|  3.11k|        cnt++;
  629|  3.11k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  3.11k|    return ret;
  632|  3.11k|}
_ZZ11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E2_clES6_:
  616|  3.11k|    ([&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.11k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.11k|            ret << input;
  627|  3.11k|        }
  628|  3.11k|        cnt++;
  629|  3.11k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E1_clES6_:
  616|  3.11k|    ([&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.11k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.11k|            ret << input;
  627|  3.11k|        }
  628|  3.11k|        cnt++;
  629|  3.11k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E0_clES6_:
  616|  3.11k|    ([&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.11k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.11k|            ret << input;
  627|  3.11k|        }
  628|  3.11k|        cnt++;
  629|  3.11k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_ENKUlS2_E_clES2_:
  616|  3.11k|    ([&ret, &cnt] (Ts&& input) {
  617|  3.11k|        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.11k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 3.11k]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|  3.11k|            } else {
  622|  3.11k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  3.11k|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  3.11k|        cnt++;
  629|  3.11k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E_clES6_:
  616|  3.11k|    ([&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.11k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.11k|            ret << input;
  627|  3.11k|        }
  628|  3.11k|        cnt++;
  629|  3.11k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeEE7CScriptDpOT_:
  612|  65.9k|{
  613|  65.9k|    CScript ret;
  614|  65.9k|    int cnt{0};
  615|       |
  616|  65.9k|    ([&ret, &cnt] (Ts&& input) {
  617|  65.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|  65.9k|            if (cnt == 0) {
  620|  65.9k|                ret = std::forward<Ts>(input);
  621|  65.9k|            } else {
  622|  65.9k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  65.9k|            }
  624|  65.9k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  65.9k|            ret << input;
  627|  65.9k|        }
  628|  65.9k|        cnt++;
  629|  65.9k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  65.9k|    return ret;
  632|  65.9k|}
_ZZ11BuildScriptIJ10opcodetypeEE7CScriptDpOT_ENKUlOS0_E_clES5_:
  616|  65.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|  65.9k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  65.9k|            ret << input;
  627|  65.9k|        }
  628|  65.9k|        cnt++;
  629|  65.9k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptRS0_EES0_DpOT_:
  612|  9.89k|{
  613|  9.89k|    CScript ret;
  614|  9.89k|    int cnt{0};
  615|       |
  616|  9.89k|    ([&ret, &cnt] (Ts&& input) {
  617|  9.89k|        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.89k|            if (cnt == 0) {
  620|  9.89k|                ret = std::forward<Ts>(input);
  621|  9.89k|            } else {
  622|  9.89k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  9.89k|            }
  624|  9.89k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  9.89k|            ret << input;
  627|  9.89k|        }
  628|  9.89k|        cnt++;
  629|  9.89k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  9.89k|    return ret;
  632|  9.89k|}
_ZZ11BuildScriptIJ7CScriptRS0_EES0_DpOT_ENKUlOS0_E_clES5_:
  616|  9.89k|    ([&ret, &cnt] (Ts&& input) {
  617|  9.89k|        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.89k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 9.89k, False: 0]
  ------------------
  620|  9.89k|                ret = std::forward<Ts>(input);
  621|  9.89k|            } 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.89k|        cnt++;
  629|  9.89k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptRS0_EES0_DpOT_ENKUlS1_E_clES1_:
  616|  9.89k|    ([&ret, &cnt] (Ts&& input) {
  617|  9.89k|        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.89k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 9.89k]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|  9.89k|            } else {
  622|  9.89k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  9.89k|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  9.89k|        cnt++;
  629|  9.89k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptRS0_10opcodetypeEES0_DpOT_:
  612|    928|{
  613|    928|    CScript ret;
  614|    928|    int cnt{0};
  615|       |
  616|    928|    ([&ret, &cnt] (Ts&& input) {
  617|    928|        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|    928|            if (cnt == 0) {
  620|    928|                ret = std::forward<Ts>(input);
  621|    928|            } else {
  622|    928|                ret.insert(ret.end(), input.begin(), input.end());
  623|    928|            }
  624|    928|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|    928|            ret << input;
  627|    928|        }
  628|    928|        cnt++;
  629|    928|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|    928|    return ret;
  632|    928|}
_ZZ11BuildScriptIJ7CScriptRS0_10opcodetypeEES0_DpOT_ENKUlOS0_E_clES6_:
  616|    928|    ([&ret, &cnt] (Ts&& input) {
  617|    928|        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|    928|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 928, False: 0]
  ------------------
  620|    928|                ret = std::forward<Ts>(input);
  621|    928|            } 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|    928|        cnt++;
  629|    928|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptRS0_10opcodetypeEES0_DpOT_ENKUlS1_E_clES1_:
  616|    928|    ([&ret, &cnt] (Ts&& input) {
  617|    928|        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|    928|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 928]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|    928|            } else {
  622|    928|                ret.insert(ret.end(), input.begin(), input.end());
  623|    928|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|    928|        cnt++;
  629|    928|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptRS0_10opcodetypeEES0_DpOT_ENKUlOS2_E_clES6_:
  616|    928|    ([&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|    928|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|    928|            ret << input;
  627|    928|        }
  628|    928|        cnt++;
  629|    928|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScript10opcodetypeS1_RS0_S1_EES0_DpOT_:
  612|     68|{
  613|     68|    CScript ret;
  614|     68|    int cnt{0};
  615|       |
  616|     68|    ([&ret, &cnt] (Ts&& input) {
  617|     68|        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|     68|            if (cnt == 0) {
  620|     68|                ret = std::forward<Ts>(input);
  621|     68|            } else {
  622|     68|                ret.insert(ret.end(), input.begin(), input.end());
  623|     68|            }
  624|     68|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|     68|            ret << input;
  627|     68|        }
  628|     68|        cnt++;
  629|     68|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|     68|    return ret;
  632|     68|}
_ZZ11BuildScriptIJ7CScript10opcodetypeS1_RS0_S1_EES0_DpOT_ENKUlOS0_E_clES6_:
  616|     68|    ([&ret, &cnt] (Ts&& input) {
  617|     68|        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|     68|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 68, False: 0]
  ------------------
  620|     68|                ret = std::forward<Ts>(input);
  621|     68|            } 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|     68|        cnt++;
  629|     68|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeS1_RS0_S1_EES0_DpOT_ENKUlOS1_E1_clES6_:
  616|     68|    ([&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|     68|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|     68|            ret << input;
  627|     68|        }
  628|     68|        cnt++;
  629|     68|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeS1_RS0_S1_EES0_DpOT_ENKUlOS1_E0_clES6_:
  616|     68|    ([&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|     68|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|     68|            ret << input;
  627|     68|        }
  628|     68|        cnt++;
  629|     68|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeS1_RS0_S1_EES0_DpOT_ENKUlS2_E_clES2_:
  616|     68|    ([&ret, &cnt] (Ts&& input) {
  617|     68|        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|     68|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 68]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|     68|            } else {
  622|     68|                ret.insert(ret.end(), input.begin(), input.end());
  623|     68|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|     68|        cnt++;
  629|     68|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeS1_RS0_S1_EES0_DpOT_ENKUlOS1_E_clES6_:
  616|     68|    ([&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|     68|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|     68|            ret << input;
  627|     68|        }
  628|     68|        cnt++;
  629|     68|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScript10opcodetypeRS0_S1_EES0_DpOT_:
  612|     92|{
  613|     92|    CScript ret;
  614|     92|    int cnt{0};
  615|       |
  616|     92|    ([&ret, &cnt] (Ts&& input) {
  617|     92|        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|     92|            if (cnt == 0) {
  620|     92|                ret = std::forward<Ts>(input);
  621|     92|            } else {
  622|     92|                ret.insert(ret.end(), input.begin(), input.end());
  623|     92|            }
  624|     92|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|     92|            ret << input;
  627|     92|        }
  628|     92|        cnt++;
  629|     92|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|     92|    return ret;
  632|     92|}
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_EES0_DpOT_ENKUlOS0_E_clES6_:
  616|     92|    ([&ret, &cnt] (Ts&& input) {
  617|     92|        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|     92|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 92, False: 0]
  ------------------
  620|     92|                ret = std::forward<Ts>(input);
  621|     92|            } 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|     92|        cnt++;
  629|     92|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_EES0_DpOT_ENKUlOS1_E0_clES6_:
  616|     92|    ([&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|     92|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|     92|            ret << input;
  627|     92|        }
  628|     92|        cnt++;
  629|     92|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_EES0_DpOT_ENKUlS2_E_clES2_:
  616|     92|    ([&ret, &cnt] (Ts&& input) {
  617|     92|        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|     92|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 92]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|     92|            } else {
  622|     92|                ret.insert(ret.end(), input.begin(), input.end());
  623|     92|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|     92|        cnt++;
  629|     92|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_EES0_DpOT_ENKUlOS1_E_clES6_:
  616|     92|    ([&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|     92|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|     92|            ret << input;
  627|     92|        }
  628|     92|        cnt++;
  629|     92|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_:
  612|  54.5k|{
  613|  54.5k|    CScript ret;
  614|  54.5k|    int cnt{0};
  615|       |
  616|  54.5k|    ([&ret, &cnt] (Ts&& input) {
  617|  54.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|  54.5k|            if (cnt == 0) {
  620|  54.5k|                ret = std::forward<Ts>(input);
  621|  54.5k|            } else {
  622|  54.5k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  54.5k|            }
  624|  54.5k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  54.5k|            ret << input;
  627|  54.5k|        }
  628|  54.5k|        cnt++;
  629|  54.5k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  54.5k|    return ret;
  632|  54.5k|}
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_ENKUlOS0_E1_clES6_:
  616|  54.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|  54.5k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  54.5k|            ret << input;
  627|  54.5k|        }
  628|  54.5k|        cnt++;
  629|  54.5k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_ENKUlS2_E0_clES2_:
  616|  54.5k|    ([&ret, &cnt] (Ts&& input) {
  617|  54.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|  54.5k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 54.5k]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|  54.5k|            } else {
  622|  54.5k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  54.5k|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  54.5k|        cnt++;
  629|  54.5k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_ENKUlOS0_E0_clES6_:
  616|  54.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|  54.5k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  54.5k|            ret << input;
  627|  54.5k|        }
  628|  54.5k|        cnt++;
  629|  54.5k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_ENKUlS2_E_clES2_:
  616|  54.5k|    ([&ret, &cnt] (Ts&& input) {
  617|  54.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|  54.5k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 54.5k]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|  54.5k|            } else {
  622|  54.5k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  54.5k|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|  54.5k|        cnt++;
  629|  54.5k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_ENKUlOS0_E_clES6_:
  616|  54.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|  54.5k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  54.5k|            ret << input;
  627|  54.5k|        }
  628|  54.5k|        cnt++;
  629|  54.5k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScript10opcodetypeRS0_S1_S2_S1_EES0_DpOT_:
  612|    490|{
  613|    490|    CScript ret;
  614|    490|    int cnt{0};
  615|       |
  616|    490|    ([&ret, &cnt] (Ts&& input) {
  617|    490|        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|    490|            if (cnt == 0) {
  620|    490|                ret = std::forward<Ts>(input);
  621|    490|            } else {
  622|    490|                ret.insert(ret.end(), input.begin(), input.end());
  623|    490|            }
  624|    490|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|    490|            ret << input;
  627|    490|        }
  628|    490|        cnt++;
  629|    490|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|    490|    return ret;
  632|    490|}
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_S2_S1_EES0_DpOT_ENKUlOS0_E_clES6_:
  616|    490|    ([&ret, &cnt] (Ts&& input) {
  617|    490|        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|    490|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 490, False: 0]
  ------------------
  620|    490|                ret = std::forward<Ts>(input);
  621|    490|            } 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|    490|        cnt++;
  629|    490|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_S2_S1_EES0_DpOT_ENKUlOS1_E1_clES6_:
  616|    490|    ([&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|    490|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|    490|            ret << input;
  627|    490|        }
  628|    490|        cnt++;
  629|    490|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_S2_S1_EES0_DpOT_ENKUlS2_E0_clES2_:
  616|    490|    ([&ret, &cnt] (Ts&& input) {
  617|    490|        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|    490|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 490]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|    490|            } else {
  622|    490|                ret.insert(ret.end(), input.begin(), input.end());
  623|    490|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|    490|        cnt++;
  629|    490|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_S2_S1_EES0_DpOT_ENKUlOS1_E0_clES6_:
  616|    490|    ([&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|    490|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|    490|            ret << input;
  627|    490|        }
  628|    490|        cnt++;
  629|    490|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_S2_S1_EES0_DpOT_ENKUlS2_E_clES2_:
  616|    490|    ([&ret, &cnt] (Ts&& input) {
  617|    490|        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|    490|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 0, False: 490]
  ------------------
  620|      0|                ret = std::forward<Ts>(input);
  621|    490|            } else {
  622|    490|                ret.insert(ret.end(), input.begin(), input.end());
  623|    490|            }
  624|       |        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|       |            ret << input;
  627|       |        }
  628|    490|        cnt++;
  629|    490|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_S2_S1_EES0_DpOT_ENKUlOS1_E_clES6_:
  616|    490|    ([&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|    490|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|    490|            ret << input;
  627|    490|        }
  628|    490|        cnt++;
  629|    490|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJRKjEE7CScriptDpOT_:
  612|  3.19k|{
  613|  3.19k|    CScript ret;
  614|  3.19k|    int cnt{0};
  615|       |
  616|  3.19k|    ([&ret, &cnt] (Ts&& input) {
  617|  3.19k|        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.19k|            if (cnt == 0) {
  620|  3.19k|                ret = std::forward<Ts>(input);
  621|  3.19k|            } else {
  622|  3.19k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  3.19k|            }
  624|  3.19k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.19k|            ret << input;
  627|  3.19k|        }
  628|  3.19k|        cnt++;
  629|  3.19k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  3.19k|    return ret;
  632|  3.19k|}
_ZZ11BuildScriptIJRKjEE7CScriptDpOT_ENKUlS1_E_clES1_:
  616|  3.19k|    ([&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.19k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.19k|            ret << input;
  627|  3.19k|        }
  628|  3.19k|        cnt++;
  629|  3.19k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEEEES0_DpOT_:
  612|  4.35k|{
  613|  4.35k|    CScript ret;
  614|  4.35k|    int cnt{0};
  615|       |
  616|  4.35k|    ([&ret, &cnt] (Ts&& input) {
  617|  4.35k|        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|  4.35k|            if (cnt == 0) {
  620|  4.35k|                ret = std::forward<Ts>(input);
  621|  4.35k|            } else {
  622|  4.35k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  4.35k|            }
  624|  4.35k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  4.35k|            ret << input;
  627|  4.35k|        }
  628|  4.35k|        cnt++;
  629|  4.35k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  4.35k|    return ret;
  632|  4.35k|}
_ZZ11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEEEES0_DpOT_ENKUlOS0_E_clES9_:
  616|  4.35k|    ([&ret, &cnt] (Ts&& input) {
  617|  4.35k|        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|  4.35k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 4.35k, False: 0]
  ------------------
  620|  4.35k|                ret = std::forward<Ts>(input);
  621|  4.35k|            } 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|  4.35k|        cnt++;
  629|  4.35k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEEEES0_DpOT_ENKUlOS5_E_clES9_:
  616|  4.35k|    ([&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|  4.35k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  4.35k|            ret << input;
  627|  4.35k|        }
  628|  4.35k|        cnt++;
  629|  4.35k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptm10opcodetypeEES0_DpOT_:
  612|  3.19k|{
  613|  3.19k|    CScript ret;
  614|  3.19k|    int cnt{0};
  615|       |
  616|  3.19k|    ([&ret, &cnt] (Ts&& input) {
  617|  3.19k|        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.19k|            if (cnt == 0) {
  620|  3.19k|                ret = std::forward<Ts>(input);
  621|  3.19k|            } else {
  622|  3.19k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  3.19k|            }
  624|  3.19k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.19k|            ret << input;
  627|  3.19k|        }
  628|  3.19k|        cnt++;
  629|  3.19k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  3.19k|    return ret;
  632|  3.19k|}
_ZZ11BuildScriptIJ7CScriptm10opcodetypeEES0_DpOT_ENKUlOS0_E_clES5_:
  616|  3.19k|    ([&ret, &cnt] (Ts&& input) {
  617|  3.19k|        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.19k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 3.19k, False: 0]
  ------------------
  620|  3.19k|                ret = std::forward<Ts>(input);
  621|  3.19k|            } 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|  3.19k|        cnt++;
  629|  3.19k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptm10opcodetypeEES0_DpOT_ENKUlOmE_clES5_:
  616|  3.19k|    ([&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.19k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.19k|            ret << input;
  627|  3.19k|        }
  628|  3.19k|        cnt++;
  629|  3.19k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptm10opcodetypeEES0_DpOT_ENKUlOS1_E_clES5_:
  616|  3.19k|    ([&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.19k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.19k|            ret << input;
  627|  3.19k|        }
  628|  3.19k|        cnt++;
  629|  3.19k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJNSt3__16vectorIhNS0_9allocatorIhEEEE10opcodetypeEE7CScriptDpOT_:
  612|  1.90k|{
  613|  1.90k|    CScript ret;
  614|  1.90k|    int cnt{0};
  615|       |
  616|  1.90k|    ([&ret, &cnt] (Ts&& input) {
  617|  1.90k|        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.90k|            if (cnt == 0) {
  620|  1.90k|                ret = std::forward<Ts>(input);
  621|  1.90k|            } else {
  622|  1.90k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  1.90k|            }
  624|  1.90k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  1.90k|            ret << input;
  627|  1.90k|        }
  628|  1.90k|        cnt++;
  629|  1.90k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  1.90k|    return ret;
  632|  1.90k|}
_ZZ11BuildScriptIJNSt3__16vectorIhNS0_9allocatorIhEEEE10opcodetypeEE7CScriptDpOT_ENKUlOS4_E_clESA_:
  616|  1.90k|    ([&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.90k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  1.90k|            ret << input;
  627|  1.90k|        }
  628|  1.90k|        cnt++;
  629|  1.90k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJNSt3__16vectorIhNS0_9allocatorIhEEEE10opcodetypeEE7CScriptDpOT_ENKUlOS5_E_clESA_:
  616|  1.90k|    ([&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.90k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  1.90k|            ret << input;
  627|  1.90k|        }
  628|  1.90k|        cnt++;
  629|  1.90k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEE10opcodetypeEES0_DpOT_:
  612|  3.95k|{
  613|  3.95k|    CScript ret;
  614|  3.95k|    int cnt{0};
  615|       |
  616|  3.95k|    ([&ret, &cnt] (Ts&& input) {
  617|  3.95k|        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.95k|            if (cnt == 0) {
  620|  3.95k|                ret = std::forward<Ts>(input);
  621|  3.95k|            } else {
  622|  3.95k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  3.95k|            }
  624|  3.95k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.95k|            ret << input;
  627|  3.95k|        }
  628|  3.95k|        cnt++;
  629|  3.95k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  3.95k|    return ret;
  632|  3.95k|}
_ZZ11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEE10opcodetypeEES0_DpOT_ENKUlOS0_E_clESA_:
  616|  3.95k|    ([&ret, &cnt] (Ts&& input) {
  617|  3.95k|        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.95k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 3.95k, False: 0]
  ------------------
  620|  3.95k|                ret = std::forward<Ts>(input);
  621|  3.95k|            } 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|  3.95k|        cnt++;
  629|  3.95k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEE10opcodetypeEES0_DpOT_ENKUlOS5_E_clESA_:
  616|  3.95k|    ([&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.95k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.95k|            ret << input;
  627|  3.95k|        }
  628|  3.95k|        cnt++;
  629|  3.95k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEE10opcodetypeEES0_DpOT_ENKUlOS6_E_clESA_:
  616|  3.95k|    ([&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.95k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  3.95k|            ret << input;
  627|  3.95k|        }
  628|  3.95k|        cnt++;
  629|  3.95k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptRKj10opcodetypeEES0_DpOT_:
  612|  2.36k|{
  613|  2.36k|    CScript ret;
  614|  2.36k|    int cnt{0};
  615|       |
  616|  2.36k|    ([&ret, &cnt] (Ts&& input) {
  617|  2.36k|        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.36k|            if (cnt == 0) {
  620|  2.36k|                ret = std::forward<Ts>(input);
  621|  2.36k|            } else {
  622|  2.36k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  2.36k|            }
  624|  2.36k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  2.36k|            ret << input;
  627|  2.36k|        }
  628|  2.36k|        cnt++;
  629|  2.36k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  2.36k|    return ret;
  632|  2.36k|}
_ZZ11BuildScriptIJ7CScriptRKj10opcodetypeEES0_DpOT_ENKUlOS0_E_clES7_:
  616|  2.36k|    ([&ret, &cnt] (Ts&& input) {
  617|  2.36k|        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.36k|            if (cnt == 0) {
  ------------------
  |  Branch (619:17): [True: 2.36k, False: 0]
  ------------------
  620|  2.36k|                ret = std::forward<Ts>(input);
  621|  2.36k|            } 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|  2.36k|        cnt++;
  629|  2.36k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptRKj10opcodetypeEES0_DpOT_ENKUlS2_E_clES2_:
  616|  2.36k|    ([&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.36k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  2.36k|            ret << input;
  627|  2.36k|        }
  628|  2.36k|        cnt++;
  629|  2.36k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptRKj10opcodetypeEES0_DpOT_ENKUlOS3_E_clES7_:
  616|  2.36k|    ([&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.36k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  2.36k|            ret << input;
  627|  2.36k|        }
  628|  2.36k|        cnt++;
  629|  2.36k|    } (std::forward<Ts>(inputs)), ...);
_ZNK10CScriptNum8GetInt64Ev:
  335|  4.65k|    int64_t GetInt64() const { return m_value; }
_Z11BuildScriptIJRjEE7CScriptDpOT_:
  612|  52.6k|{
  613|  52.6k|    CScript ret;
  614|  52.6k|    int cnt{0};
  615|       |
  616|  52.6k|    ([&ret, &cnt] (Ts&& input) {
  617|  52.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|  52.6k|            if (cnt == 0) {
  620|  52.6k|                ret = std::forward<Ts>(input);
  621|  52.6k|            } else {
  622|  52.6k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  52.6k|            }
  624|  52.6k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  52.6k|            ret << input;
  627|  52.6k|        }
  628|  52.6k|        cnt++;
  629|  52.6k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  52.6k|    return ret;
  632|  52.6k|}
_ZZ11BuildScriptIJRjEE7CScriptDpOT_ENKUlS0_E_clES0_:
  616|  52.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|  52.6k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  52.6k|            ret << input;
  627|  52.6k|        }
  628|  52.6k|        cnt++;
  629|  52.6k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJRmEE7CScriptDpOT_:
  612|  4.15k|{
  613|  4.15k|    CScript ret;
  614|  4.15k|    int cnt{0};
  615|       |
  616|  4.15k|    ([&ret, &cnt] (Ts&& input) {
  617|  4.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|  4.15k|            if (cnt == 0) {
  620|  4.15k|                ret = std::forward<Ts>(input);
  621|  4.15k|            } else {
  622|  4.15k|                ret.insert(ret.end(), input.begin(), input.end());
  623|  4.15k|            }
  624|  4.15k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  4.15k|            ret << input;
  627|  4.15k|        }
  628|  4.15k|        cnt++;
  629|  4.15k|    } (std::forward<Ts>(inputs)), ...);
  630|       |
  631|  4.15k|    return ret;
  632|  4.15k|}
_ZZ11BuildScriptIJRmEE7CScriptDpOT_ENKUlS0_E_clES0_:
  616|  4.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|  4.15k|        } else {
  625|       |            // Otherwise invoke CScript::operator<<.
  626|  4.15k|            ret << input;
  627|  4.15k|        }
  628|  4.15k|        cnt++;
  629|  4.15k|    } (std::forward<Ts>(inputs)), ...);
_ZN7CScript10EncodeOP_NEi:
  516|     30|    {
  517|     30|        assert(n >= 0 && n <= 16);
  ------------------
  |  Branch (517:9): [True: 30, False: 0]
  |  Branch (517:9): [True: 30, False: 0]
  |  Branch (517:9): [True: 30, False: 0]
  ------------------
  518|     30|        if (n == 0)
  ------------------
  |  Branch (518:13): [True: 0, False: 30]
  ------------------
  519|      0|            return OP_0;
  520|     30|        return (opcodetype)(OP_1+n-1);
  521|     30|    }
_ZN9CScriptIDC2ERK7uint160:
  601|  6.97k|    explicit CScriptID(const uint160& in) : BaseHash(in) {}
_Z12ToByteVectorI7CPubKeyENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   69|  13.9k|{
   70|  13.9k|    return std::vector<unsigned char>(in.begin(), in.end());
   71|  13.9k|}
_Z12ToByteVectorI11XOnlyPubKeyENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   69|   256k|{
   70|   256k|    return std::vector<unsigned char>(in.begin(), in.end());
   71|   256k|}
_ZN7CScriptlsEl:
  468|  96.8k|    CScript& operator<<(int64_t b) LIFETIMEBOUND { return push_int64(b); }
_ZN7CScript10push_int64El:
  435|  96.8k|    {
  436|  96.8k|        if (n == -1 || (n >= 1 && n <= 16))
  ------------------
  |  Branch (436:13): [True: 0, False: 96.8k]
  |  Branch (436:25): [True: 96.8k, False: 0]
  |  Branch (436:35): [True: 79.4k, False: 17.3k]
  ------------------
  437|  79.4k|        {
  438|  79.4k|            push_back(n + (OP_1 - 1));
  439|  79.4k|        }
  440|  17.3k|        else if (n == 0)
  ------------------
  |  Branch (440:18): [True: 0, False: 17.3k]
  ------------------
  441|      0|        {
  442|      0|            push_back(OP_0);
  443|      0|        }
  444|  17.3k|        else
  445|  17.3k|        {
  446|  17.3k|            *this << CScriptNum::serialize(n);
  447|  17.3k|        }
  448|  96.8k|        return *this;
  449|  96.8k|    }
_ZNK7CScript5GetOpERN9prevectorILj36EhjiE14const_iteratorER10opcodetypeRNSt3__16vectorIhNS6_9allocatorIhEEEE:
  498|   185k|    {
  499|   185k|        return GetScriptOp(pc, end(), opcodeRet, &vchRet);
  500|   185k|    }
_ZNK7CScript5GetOpERN9prevectorILj36EhjiE14const_iteratorER10opcodetype:
  503|  2.25k|    {
  504|  2.25k|        return GetScriptOp(pc, end(), opcodeRet, nullptr);
  505|  2.25k|    }
_ZN7CScriptC2Ev:
  452|   371k|    CScript() = default;
_ZN10CScriptNum9serializeERKl:
  343|  17.3k|    {
  344|  17.3k|        if(value == 0)
  ------------------
  |  Branch (344:12): [True: 0, False: 17.3k]
  ------------------
  345|      0|            return std::vector<unsigned char>();
  346|       |
  347|  17.3k|        std::vector<unsigned char> result;
  348|  17.3k|        const bool neg = value < 0;
  349|  17.3k|        uint64_t absvalue = neg ? ~static_cast<uint64_t>(value) + 1 : static_cast<uint64_t>(value);
  ------------------
  |  Branch (349:29): [True: 0, False: 17.3k]
  ------------------
  350|       |
  351|  67.8k|        while(absvalue)
  ------------------
  |  Branch (351:15): [True: 50.5k, False: 17.3k]
  ------------------
  352|  50.5k|        {
  353|  50.5k|            result.push_back(absvalue & 0xff);
  354|  50.5k|            absvalue >>= 8;
  355|  50.5k|        }
  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|  17.3k|        if (result.back() & 0x80)
  ------------------
  |  Branch (367:13): [True: 1.67k, False: 15.7k]
  ------------------
  368|  1.67k|            result.push_back(neg ? 0x80 : 0);
  ------------------
  |  Branch (368:30): [True: 0, False: 1.67k]
  ------------------
  369|  15.7k|        else if (neg)
  ------------------
  |  Branch (369:18): [True: 0, False: 15.7k]
  ------------------
  370|      0|            result.back() |= 0x80;
  371|       |
  372|  17.3k|        return result;
  373|  17.3k|    }
_ZN10CScriptNumC2ERKNSt3__16vectorIhNS0_9allocatorIhEEEEbm:
  248|  5.22k|    {
  249|  5.22k|        if (vch.size() > nMaxNumSize) {
  ------------------
  |  Branch (249:13): [True: 52, False: 5.17k]
  ------------------
  250|     52|            throw scriptnum_error("script number overflow");
  251|     52|        }
  252|  5.17k|        if (fRequireMinimal && vch.size() > 0) {
  ------------------
  |  Branch (252:13): [True: 5.17k, False: 0]
  |  Branch (252:32): [True: 5.17k, False: 0]
  ------------------
  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|  5.17k|            if ((vch.back() & 0x7f) == 0) {
  ------------------
  |  Branch (259:17): [True: 66, False: 5.10k]
  ------------------
  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|     66|                if (vch.size() <= 1 || (vch[vch.size() - 2] & 0x80) == 0) {
  ------------------
  |  Branch (265:21): [True: 9, False: 57]
  |  Branch (265:40): [True: 9, False: 48]
  ------------------
  266|     18|                    throw scriptnum_error("non-minimally encoded script number");
  267|     18|                }
  268|     66|            }
  269|  5.17k|        }
  270|  5.15k|        m_value = set_vch(vch);
  271|  5.15k|    }
_ZN15scriptnum_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  224|     70|    explicit scriptnum_error(const std::string& str) : std::runtime_error(str) {}
_ZN10CScriptNum7set_vchERKNSt3__16vectorIhNS0_9allocatorIhEEEE:
  377|  5.15k|    {
  378|  5.15k|      if (vch.empty())
  ------------------
  |  Branch (378:11): [True: 0, False: 5.15k]
  ------------------
  379|      0|          return 0;
  380|       |
  381|  5.15k|      int64_t result = 0;
  382|  11.3k|      for (size_t i = 0; i != vch.size(); ++i)
  ------------------
  |  Branch (382:26): [True: 6.14k, False: 5.15k]
  ------------------
  383|  6.14k|          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|  5.15k|      if (vch.back() & 0x80)
  ------------------
  |  Branch (387:11): [True: 123, False: 5.03k]
  ------------------
  388|    123|          return -((int64_t)(result & ~(0x80ULL << (8 * (vch.size() - 1)))));
  389|       |
  390|  5.03k|      return result;
  391|  5.15k|    }
_ZNK10CScriptNum6getintEv:
  327|    503|    {
  328|    503|        if (m_value > std::numeric_limits<int>::max())
  ------------------
  |  Branch (328:13): [True: 0, False: 503]
  ------------------
  329|      0|            return std::numeric_limits<int>::max();
  330|    503|        else if (m_value < std::numeric_limits<int>::min())
  ------------------
  |  Branch (330:18): [True: 0, False: 503]
  ------------------
  331|      0|            return std::numeric_limits<int>::min();
  332|    503|        return m_value;
  333|    503|    }
_ZN7CScriptlsENSt3__14spanIKhLm18446744073709551615EEE:
  493|   375k|    {
  494|   375k|        return *this << std::as_bytes(b);
  495|   375k|    }
_ZN7CScriptlsENSt3__14spanIKSt4byteLm18446744073709551615EEE:
  485|   375k|    {
  486|   375k|        AppendDataSize(b.size());
  487|   375k|        AppendData({reinterpret_cast<const value_type*>(b.data()), b.size()});
  488|   375k|        return *this;
  489|   375k|    }
_ZN7CScript14AppendDataSizeEj:
  409|   375k|    {
  410|   375k|        if (size < OP_PUSHDATA1) {
  ------------------
  |  Branch (410:13): [True: 375k, False: 0]
  ------------------
  411|   375k|            insert(end(), static_cast<value_type>(size));
  412|   375k|        } 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|   375k|    }
_ZN7CScript10AppendDataENSt3__14spanIKhLm18446744073709551615EEE:
  429|   375k|    {
  430|   375k|        insert(end(), data.begin(), data.end());
  431|   375k|    }
_ZN7CScriptlsE10opcodetype:
  471|   669k|    {
  472|   669k|        if (opcode < 0 || opcode > 0xff)
  ------------------
  |  Branch (472:13): [True: 0, False: 669k]
  |  Branch (472:27): [True: 0, False: 669k]
  ------------------
  473|      0|            throw std::runtime_error("CScript::operator<<(): invalid opcode");
  474|   669k|        insert(end(), (unsigned char)opcode);
  475|   669k|        return *this;
  476|   669k|    }
_ZN7CScriptC2ITkNSt3__114input_iteratorENS1_11__wrap_iterIPKhEEEET_S6_:
  454|  11.7k|    CScript(InputIterator first, InputIterator last) : CScriptBase{first, last} { }
_ZN7CScript10DecodeOP_NE10opcodetype:
  509|  51.2k|    {
  510|  51.2k|        if (opcode == OP_0)
  ------------------
  |  Branch (510:13): [True: 4.66k, False: 46.6k]
  ------------------
  511|  4.66k|            return 0;
  512|  51.2k|        assert(opcode >= OP_1 && opcode <= OP_16);
  ------------------
  |  Branch (512:9): [True: 46.6k, False: 0]
  |  Branch (512:9): [True: 46.6k, False: 0]
  |  Branch (512:9): [True: 46.6k, False: 0]
  ------------------
  513|  46.6k|        return (int)opcode - (int)(OP_1 - 1);
  514|  46.6k|    }
_ZN7CScriptC2ITkNSt3__114input_iteratorENS1_11__wrap_iterIPhEEEET_S5_:
  454|    450|    CScript(InputIterator first, InputIterator last) : CScriptBase{first, last} { }

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

_ZNK19FlatSigningProvider10GetCScriptERK9CScriptIDR7CScript:
   87|  6.97k|bool FlatSigningProvider::GetCScript(const CScriptID& scriptid, CScript& script) const { return LookupHelper(scripts, scriptid, script); }
_ZNK19FlatSigningProvider9GetPubKeyERK6CKeyIDR7CPubKey:
   88|  2.03k|bool FlatSigningProvider::GetPubKey(const CKeyID& keyid, CPubKey& pubkey) const { return LookupHelper(pubkeys, keyid, pubkey); }
_ZNK19FlatSigningProvider12GetKeyOriginERK6CKeyIDR13KeyOriginInfo:
   90|   249k|{
   91|   249k|    std::pair<CPubKey, KeyOriginInfo> out;
   92|   249k|    bool ret = LookupHelper(origins, keyid, out);
   93|   249k|    if (ret) info = std::move(out.second);
  ------------------
  |  Branch (93:9): [True: 170k, False: 78.3k]
  ------------------
   94|   249k|    return ret;
   95|   249k|}
_ZNK19FlatSigningProvider6GetKeyERK6CKeyIDR4CKey:
  101|  2.17M|bool FlatSigningProvider::GetKey(const CKeyID& keyid, CKey& key) const { return LookupHelper(keys, keyid, key); }
_ZNK19FlatSigningProvider19GetTaprootSpendDataERK11XOnlyPubKeyR16TaprootSpendData:
  103|  25.4k|{
  104|  25.4k|    TaprootBuilder builder;
  105|  25.4k|    if (LookupHelper(tr_trees, output_key, builder)) {
  ------------------
  |  Branch (105:9): [True: 25.1k, False: 281]
  ------------------
  106|  25.1k|        spenddata = builder.GetSpendData();
  107|  25.1k|        return true;
  108|  25.1k|    }
  109|    281|    return false;
  110|  25.4k|}
_ZN19FlatSigningProvider5MergeEOS_:
  151|  1.41M|{
  152|  1.41M|    scripts.merge(b.scripts);
  153|  1.41M|    pubkeys.merge(b.pubkeys);
  154|  1.41M|    keys.merge(b.keys);
  155|  1.41M|    origins.merge(b.origins);
  156|  1.41M|    tr_trees.merge(b.tr_trees);
  157|  1.41M|    aggregate_pubkeys.merge(b.aggregate_pubkeys);
  158|       |    // We shouldn't be merging 2 different sessions, just overwrite with b's sessions.
  159|  1.41M|    if (!musig2_secnonces) musig2_secnonces = b.musig2_secnonces;
  ------------------
  |  Branch (159:9): [True: 1.41M, False: 0]
  ------------------
  160|  1.41M|    return *this;
  161|  1.41M|}
_ZN14TaprootBuilder7CombineEONS_8NodeInfoES1_:
  359|  6.23k|{
  360|  6.23k|    NodeInfo ret;
  361|       |    /* Iterate over all tracked leaves in a, add b's hash to their Merkle branch, and move them to ret. */
  362|  57.5k|    for (auto& leaf : a.leaves) {
  ------------------
  |  Branch (362:21): [True: 57.5k, False: 6.23k]
  ------------------
  363|  57.5k|        leaf.merkle_branch.push_back(b.hash);
  364|  57.5k|        ret.leaves.emplace_back(std::move(leaf));
  365|  57.5k|    }
  366|       |    /* Iterate over all tracked leaves in b, add a's hash to their Merkle branch, and move them to ret. */
  367|  8.82k|    for (auto& leaf : b.leaves) {
  ------------------
  |  Branch (367:21): [True: 8.82k, False: 6.23k]
  ------------------
  368|  8.82k|        leaf.merkle_branch.push_back(a.hash);
  369|  8.82k|        ret.leaves.emplace_back(std::move(leaf));
  370|  8.82k|    }
  371|  6.23k|    ret.hash = ComputeTapbranchHash(a.hash, b.hash);
  372|  6.23k|    return ret;
  373|  6.23k|}
_ZN14TaprootBuilder6InsertEONS_8NodeInfoEi:
  391|  23.5k|{
  392|  23.5k|    assert(depth >= 0 && (size_t)depth <= TAPROOT_CONTROL_MAX_NODE_COUNT);
  ------------------
  |  Branch (392:5): [True: 23.5k, False: 0]
  |  Branch (392:5): [True: 23.5k, False: 0]
  |  Branch (392:5): [True: 23.5k, 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|  23.5k|    if ((size_t)depth + 1 < m_branch.size()) {
  ------------------
  |  Branch (396:9): [True: 0, False: 23.5k]
  ------------------
  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|  29.8k|    while (m_valid && m_branch.size() > (size_t)depth && m_branch[depth].has_value()) {
  ------------------
  |  Branch (402:12): [True: 29.8k, False: 0]
  |  Branch (402:23): [True: 10.9k, False: 18.8k]
  |  Branch (402:58): [True: 6.23k, False: 4.69k]
  ------------------
  403|  6.23k|        node = Combine(std::move(node), std::move(*m_branch[depth]));
  404|  6.23k|        m_branch.pop_back();
  405|  6.23k|        if (depth == 0) m_valid = false; /* Can't propagate further up than the root */
  ------------------
  |  Branch (405:13): [True: 0, False: 6.23k]
  ------------------
  406|  6.23k|        --depth;
  407|  6.23k|    }
  408|  23.5k|    if (m_valid) {
  ------------------
  |  Branch (408:9): [True: 23.5k, False: 0]
  ------------------
  409|       |        /* Make sure the branch is big enough to place the new node. */
  410|  23.5k|        if (m_branch.size() <= (size_t)depth) m_branch.resize((size_t)depth + 1);
  ------------------
  |  Branch (410:13): [True: 18.8k, False: 4.69k]
  ------------------
  411|  23.5k|        assert(!m_branch[depth].has_value());
  ------------------
  |  Branch (411:9): [True: 23.5k, False: 0]
  ------------------
  412|  23.5k|        m_branch[depth] = std::move(node);
  413|  23.5k|    }
  414|  23.5k|}
_ZN14TaprootBuilder11ValidDepthsERKNSt3__16vectorIiNS0_9allocatorIiEEEE:
  417|  3.39k|{
  418|  3.39k|    std::vector<bool> branch;
  419|  3.39k|    for (int depth : depths) {
  ------------------
  |  Branch (419:20): [True: 3.28k, False: 3.39k]
  ------------------
  420|       |        // This inner loop corresponds to effectively the same logic on branch
  421|       |        // as what Insert() performs on the m_branch variable. Instead of
  422|       |        // storing a NodeInfo object, just remember whether or not there is one
  423|       |        // at that depth.
  424|  3.28k|        if (depth < 0 || (size_t)depth > TAPROOT_CONTROL_MAX_NODE_COUNT) return false;
  ------------------
  |  Branch (424:13): [True: 0, False: 3.28k]
  |  Branch (424:26): [True: 0, False: 3.28k]
  ------------------
  425|  3.28k|        if ((size_t)depth + 1 < branch.size()) return false;
  ------------------
  |  Branch (425:13): [True: 0, False: 3.28k]
  ------------------
  426|  5.40k|        while (branch.size() > (size_t)depth && branch[depth]) {
  ------------------
  |  Branch (426:16): [True: 3.46k, False: 1.93k]
  |  Branch (426:16): [True: 2.11k, False: 3.28k]
  |  Branch (426:49): [True: 2.11k, False: 1.34k]
  ------------------
  427|  2.11k|            branch.pop_back();
  428|  2.11k|            if (depth == 0) return false;
  ------------------
  |  Branch (428:17): [True: 0, False: 2.11k]
  ------------------
  429|  2.11k|            --depth;
  430|  2.11k|        }
  431|  3.28k|        if (branch.size() <= (size_t)depth) branch.resize((size_t)depth + 1);
  ------------------
  |  Branch (431:13): [True: 1.93k, False: 1.34k]
  ------------------
  432|  3.28k|        assert(!branch[depth]);
  ------------------
  |  Branch (432:9): [True: 3.28k, False: 0]
  ------------------
  433|  3.28k|        branch[depth] = true;
  434|  3.28k|    }
  435|       |    // And this check corresponds to the IsComplete() check on m_branch.
  436|  3.39k|    return branch.size() == 0 || (branch.size() == 1 && branch[0]);
  ------------------
  |  Branch (436:12): [True: 2.23k, False: 1.16k]
  |  Branch (436:35): [True: 1.16k, False: 0]
  |  Branch (436:57): [True: 1.16k, False: 0]
  ------------------
  437|  3.39k|}
_ZN14TaprootBuilder3AddEiNSt3__14spanIKhLm18446744073709551615EEEib:
  440|  23.5k|{
  441|  23.5k|    assert((leaf_version & ~TAPROOT_LEAF_MASK) == 0);
  ------------------
  |  Branch (441:5): [True: 23.5k, False: 0]
  ------------------
  442|  23.5k|    if (!IsValid()) return *this;
  ------------------
  |  Branch (442:9): [True: 0, False: 23.5k]
  ------------------
  443|       |    /* Construct NodeInfo object with leaf hash and (if track is true) also leaf information. */
  444|  23.5k|    NodeInfo node;
  445|  23.5k|    node.hash = ComputeTapleafHash(leaf_version, script);
  446|  23.5k|    if (track) node.leaves.emplace_back(LeafInfo{std::vector<unsigned char>(script.begin(), script.end()), leaf_version, {}});
  ------------------
  |  Branch (446:9): [True: 23.5k, False: 0]
  ------------------
  447|       |    /* Insert into the branch. */
  448|  23.5k|    Insert(std::move(node), depth);
  449|  23.5k|    return *this;
  450|  23.5k|}
_ZN14TaprootBuilder8FinalizeERK11XOnlyPubKey:
  463|  50.2k|{
  464|       |    /* Can only call this function when IsComplete() is true. */
  465|  50.2k|    assert(IsComplete());
  ------------------
  |  Branch (465:5): [True: 50.2k, False: 0]
  ------------------
  466|  50.2k|    m_internal_key = internal_key;
  467|  50.2k|    auto ret = m_internal_key.CreateTapTweak(m_branch.size() == 0 ? nullptr : &m_branch[0]->hash);
  ------------------
  |  Branch (467:46): [True: 32.9k, False: 17.3k]
  ------------------
  468|  50.2k|    assert(ret.has_value());
  ------------------
  |  Branch (468:5): [True: 50.2k, False: 0]
  ------------------
  469|  50.2k|    std::tie(m_output_key, m_parity) = *ret;
  470|  50.2k|    return *this;
  471|  50.2k|}
_ZN14TaprootBuilder9GetOutputEv:
  473|  50.2k|WitnessV1Taproot TaprootBuilder::GetOutput() { return WitnessV1Taproot{m_output_key}; }
_ZNK14TaprootBuilder12GetSpendDataEv:
  476|  25.1k|{
  477|  25.1k|    assert(IsComplete());
  ------------------
  |  Branch (477:5): [True: 25.1k, False: 0]
  ------------------
  478|  25.1k|    assert(m_output_key.IsFullyValid());
  ------------------
  |  Branch (478:5): [True: 25.1k, False: 0]
  ------------------
  479|  25.1k|    TaprootSpendData spd;
  480|  25.1k|    spd.merkle_root = m_branch.size() == 0 ? uint256() : m_branch[0]->hash;
  ------------------
  |  Branch (480:23): [True: 16.4k, False: 8.67k]
  ------------------
  481|  25.1k|    spd.internal_key = m_internal_key;
  482|  25.1k|    if (m_branch.size()) {
  ------------------
  |  Branch (482:9): [True: 8.67k, False: 16.4k]
  ------------------
  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|  11.7k|        for (const auto& leaf : m_branch[0]->leaves) {
  ------------------
  |  Branch (486:31): [True: 11.7k, False: 8.67k]
  ------------------
  487|  11.7k|            std::vector<unsigned char> control_block;
  488|  11.7k|            control_block.resize(TAPROOT_CONTROL_BASE_SIZE + TAPROOT_CONTROL_NODE_SIZE * leaf.merkle_branch.size());
  489|  11.7k|            control_block[0] = leaf.leaf_version | (m_parity ? 1 : 0);
  ------------------
  |  Branch (489:53): [True: 5.57k, False: 6.21k]
  ------------------
  490|  11.7k|            std::copy(m_internal_key.begin(), m_internal_key.end(), control_block.begin() + 1);
  491|  11.7k|            if (leaf.merkle_branch.size()) {
  ------------------
  |  Branch (491:17): [True: 4.74k, False: 7.04k]
  ------------------
  492|  4.74k|                std::copy(leaf.merkle_branch[0].begin(),
  493|  4.74k|                          leaf.merkle_branch[0].begin() + TAPROOT_CONTROL_NODE_SIZE * leaf.merkle_branch.size(),
  494|  4.74k|                          control_block.begin() + TAPROOT_CONTROL_BASE_SIZE);
  495|  4.74k|            }
  496|  11.7k|            spd.scripts[{leaf.script, leaf.leaf_version}].insert(std::move(control_block));
  497|  11.7k|        }
  498|  8.67k|    }
  499|  25.1k|    return spd;
  500|  25.1k|}
_Z16InferTaprootTreeRK16TaprootSpendDataRK11XOnlyPubKey:
  503|  25.1k|{
  504|       |    // Verify that the output matches the assumed Merkle root and internal key.
  505|  25.1k|    auto tweak = spenddata.internal_key.CreateTapTweak(spenddata.merkle_root.IsNull() ? nullptr : &spenddata.merkle_root);
  ------------------
  |  Branch (505:56): [True: 16.4k, False: 8.67k]
  ------------------
  506|  25.1k|    if (!tweak || tweak->first != output) return std::nullopt;
  ------------------
  |  Branch (506:9): [True: 0, False: 25.1k]
  |  Branch (506:19): [True: 0, False: 25.1k]
  ------------------
  507|       |    // If the Merkle root is 0, the tree is empty, and we're done.
  508|  25.1k|    std::vector<std::tuple<int, std::vector<unsigned char>, int>> ret;
  509|  25.1k|    if (spenddata.merkle_root.IsNull()) return ret;
  ------------------
  |  Branch (509:9): [True: 16.4k, False: 8.67k]
  ------------------
  510|       |
  511|       |    /** Data structure to represent the nodes of the tree we're going to build. */
  512|  8.67k|    struct TreeNode {
  513|       |        /** Hash of this node, if known; 0 otherwise. */
  514|  8.67k|        uint256 hash;
  515|       |        /** The left and right subtrees (note that their order is irrelevant). */
  516|  8.67k|        std::unique_ptr<TreeNode> sub[2];
  517|       |        /** If this is known to be a leaf node, a pointer to the (script, leaf_ver) pair.
  518|       |         *  nullptr otherwise. */
  519|  8.67k|        const std::pair<std::vector<unsigned char>, int>* leaf = nullptr;
  520|       |        /** Whether or not this node has been explored (is known to be a leaf, or known to have children). */
  521|  8.67k|        bool explored = false;
  522|       |        /** Whether or not this node is an inner node (unknown until explored = true). */
  523|  8.67k|        bool inner;
  524|       |        /** Whether or not we have produced output for this subtree. */
  525|  8.67k|        bool done = false;
  526|  8.67k|    };
  527|       |
  528|       |    // Build tree from the provided branches.
  529|  8.67k|    TreeNode root;
  530|  8.67k|    root.hash = spenddata.merkle_root;
  531|  10.8k|    for (const auto& [key, control_blocks] : spenddata.scripts) {
  ------------------
  |  Branch (531:44): [True: 10.8k, False: 8.67k]
  ------------------
  532|  10.8k|        const auto& [script, leaf_ver] = key;
  533|  11.7k|        for (const auto& control : control_blocks) {
  ------------------
  |  Branch (533:34): [True: 11.7k, False: 10.8k]
  ------------------
  534|       |            // Skip script records with nonsensical leaf version.
  535|  11.7k|            if (leaf_ver < 0 || leaf_ver >= 0x100 || leaf_ver & 1) continue;
  ------------------
  |  Branch (535:17): [True: 0, False: 11.7k]
  |  Branch (535:33): [True: 0, False: 11.7k]
  |  Branch (535:54): [True: 0, False: 11.7k]
  ------------------
  536|       |            // Skip script records with invalid control block sizes.
  537|  11.7k|            if (control.size() < TAPROOT_CONTROL_BASE_SIZE || control.size() > TAPROOT_CONTROL_MAX_SIZE ||
  ------------------
  |  Branch (537:17): [True: 0, False: 11.7k]
  |  Branch (537:63): [True: 0, False: 11.7k]
  ------------------
  538|  11.7k|                ((control.size() - TAPROOT_CONTROL_BASE_SIZE) % TAPROOT_CONTROL_NODE_SIZE) != 0) continue;
  ------------------
  |  Branch (538:17): [True: 0, False: 11.7k]
  ------------------
  539|       |            // Skip script records that don't match the control block.
  540|  11.7k|            if ((control[0] & TAPROOT_LEAF_MASK) != leaf_ver) continue;
  ------------------
  |  Branch (540:17): [True: 0, False: 11.7k]
  ------------------
  541|       |            // Skip script records that don't match the provided Merkle root.
  542|  11.7k|            const uint256 leaf_hash = ComputeTapleafHash(leaf_ver, script);
  543|  11.7k|            const uint256 merkle_root = ComputeTaprootMerkleRoot(control, leaf_hash);
  544|  11.7k|            if (merkle_root != spenddata.merkle_root) continue;
  ------------------
  |  Branch (544:17): [True: 0, False: 11.7k]
  ------------------
  545|       |
  546|  11.7k|            TreeNode* node = &root;
  547|  11.7k|            size_t levels = (control.size() - TAPROOT_CONTROL_BASE_SIZE) / TAPROOT_CONTROL_NODE_SIZE;
  548|  44.6k|            for (size_t depth = 0; depth < levels; ++depth) {
  ------------------
  |  Branch (548:36): [True: 32.9k, False: 11.7k]
  ------------------
  549|       |                // Can't descend into a node which we already know is a leaf.
  550|  32.9k|                if (node->explored && !node->inner) return std::nullopt;
  ------------------
  |  Branch (550:21): [True: 29.8k, False: 3.11k]
  |  Branch (550:39): [True: 0, False: 29.8k]
  ------------------
  551|       |
  552|       |                // Extract partner hash from Merkle branch in control block.
  553|  32.9k|                uint256 hash;
  554|  32.9k|                std::copy(control.begin() + TAPROOT_CONTROL_BASE_SIZE + (levels - 1 - depth) * TAPROOT_CONTROL_NODE_SIZE,
  555|  32.9k|                          control.begin() + TAPROOT_CONTROL_BASE_SIZE + (levels - depth) * TAPROOT_CONTROL_NODE_SIZE,
  556|  32.9k|                          hash.begin());
  557|       |
  558|  32.9k|                if (node->sub[0]) {
  ------------------
  |  Branch (558:21): [True: 29.8k, False: 3.11k]
  ------------------
  559|       |                    // Descend into the existing left or right branch.
  560|  29.8k|                    bool desc = false;
  561|  53.9k|                    for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (561:37): [True: 53.9k, False: 0]
  ------------------
  562|  53.9k|                        if (node->sub[i]->hash == hash || (node->sub[i]->hash.IsNull() && node->sub[1-i]->hash != hash)) {
  ------------------
  |  Branch (562:29): [True: 28.9k, False: 25.0k]
  |  Branch (562:60): [True: 4.66k, False: 20.3k]
  |  Branch (562:91): [True: 828, False: 3.83k]
  ------------------
  563|  29.8k|                            node->sub[i]->hash = hash;
  564|  29.8k|                            node = &*node->sub[1-i];
  565|  29.8k|                            desc = true;
  566|  29.8k|                            break;
  567|  29.8k|                        }
  568|  53.9k|                    }
  569|  29.8k|                    if (!desc) return std::nullopt; // This probably requires a hash collision to hit.
  ------------------
  |  Branch (569:25): [True: 0, False: 29.8k]
  ------------------
  570|  29.8k|                } else {
  571|       |                    // We're in an unexplored node. Create subtrees and descend.
  572|  3.11k|                    node->explored = true;
  573|  3.11k|                    node->inner = true;
  574|  3.11k|                    node->sub[0] = std::make_unique<TreeNode>();
  575|  3.11k|                    node->sub[1] = std::make_unique<TreeNode>();
  576|  3.11k|                    node->sub[1]->hash = hash;
  577|  3.11k|                    node = &*node->sub[0];
  578|  3.11k|                }
  579|  32.9k|            }
  580|       |            // Cannot turn a known inner node into a leaf.
  581|  11.7k|            if (node->sub[0]) return std::nullopt;
  ------------------
  |  Branch (581:17): [True: 0, False: 11.7k]
  ------------------
  582|  11.7k|            node->explored = true;
  583|  11.7k|            node->inner = false;
  584|  11.7k|            node->leaf = &key;
  585|  11.7k|            node->hash = leaf_hash;
  586|  11.7k|        }
  587|  10.8k|    }
  588|       |
  589|       |    // Recursive processing to turn the tree into flattened output. Use an explicit stack here to avoid
  590|       |    // overflowing the call stack (the tree may be 128 levels deep).
  591|  8.67k|    std::vector<TreeNode*> stack{&root};
  592|  29.8k|    while (!stack.empty()) {
  ------------------
  |  Branch (592:12): [True: 21.1k, False: 8.67k]
  ------------------
  593|  21.1k|        TreeNode& node = *stack.back();
  594|  21.1k|        if (!node.explored) {
  ------------------
  |  Branch (594:13): [True: 4, False: 21.1k]
  ------------------
  595|       |            // Unexplored node, which means the tree is incomplete.
  596|      4|            return std::nullopt;
  597|  21.1k|        } else if (!node.inner) {
  ------------------
  |  Branch (597:20): [True: 11.7k, False: 9.37k]
  ------------------
  598|       |            // Leaf node; produce output.
  599|  11.7k|            ret.emplace_back(stack.size() - 1, node.leaf->first, node.leaf->second);
  600|  11.7k|            node.done = true;
  601|  11.7k|            stack.pop_back();
  602|  11.7k|        } else if (node.sub[0]->done && !node.sub[1]->done && !node.sub[1]->explored && !node.sub[1]->hash.IsNull() &&
  ------------------
  |  Branch (602:20): [True: 6.21k, False: 3.16k]
  |  Branch (602:20): [True: 52, False: 9.32k]
  |  Branch (602:41): [True: 3.10k, False: 3.10k]
  |  Branch (602:63): [True: 56, False: 3.05k]
  |  Branch (602:89): [True: 56, False: 0]
  ------------------
  603|     56|                   ComputeTapbranchHash(node.sub[1]->hash, node.sub[1]->hash) == node.hash) {
  ------------------
  |  Branch (603:20): [True: 52, False: 4]
  ------------------
  604|       |            // Whenever there are nodes with two identical subtrees under it, we run into a problem:
  605|       |            // the control blocks for the leaves underneath those will be identical as well, and thus
  606|       |            // they will all be matched to the same path in the tree. The result is that at the location
  607|       |            // where the duplicate occurred, the left child will contain a normal tree that can be explored
  608|       |            // and processed, but the right one will remain unexplored.
  609|       |            //
  610|       |            // This situation can be detected, by encountering an inner node with unexplored right subtree
  611|       |            // with known hash, and H_TapBranch(hash, hash) is equal to the parent node (this node)'s hash.
  612|       |            //
  613|       |            // To deal with this, simply process the left tree a second time (set its done flag to false;
  614|       |            // noting that the done flag of its children have already been set to false after processing
  615|       |            // those). To avoid ending up in an infinite loop, set the done flag of the right (unexplored)
  616|       |            // subtree to true.
  617|     52|            node.sub[0]->done = false;
  618|     52|            node.sub[1]->done = true;
  619|  9.32k|        } else if (node.sub[0]->done && node.sub[1]->done) {
  ------------------
  |  Branch (619:20): [True: 6.15k, False: 3.16k]
  |  Branch (619:41): [True: 3.10k, False: 3.05k]
  ------------------
  620|       |            // An internal node which we're finished with.
  621|  3.10k|            node.sub[0]->done = false;
  622|  3.10k|            node.sub[1]->done = false;
  623|  3.10k|            node.done = true;
  624|  3.10k|            stack.pop_back();
  625|  6.22k|        } else if (!node.sub[0]->done) {
  ------------------
  |  Branch (625:20): [True: 3.16k, False: 3.05k]
  ------------------
  626|       |            // An internal node whose left branch hasn't been processed yet. Do so first.
  627|  3.16k|            stack.push_back(&*node.sub[0]);
  628|  3.16k|        } else if (!node.sub[1]->done) {
  ------------------
  |  Branch (628:20): [True: 3.05k, False: 0]
  ------------------
  629|       |            // An internal node whose right branch hasn't been processed yet. Do so first.
  630|  3.05k|            stack.push_back(&*node.sub[1]);
  631|  3.05k|        }
  632|  21.1k|    }
  633|       |
  634|  8.67k|    return ret;
  635|  8.67k|}
_Z12LookupHelperINSt3__13mapI9CScriptID7CScriptNS0_4lessIS2_EENS0_9allocatorINS0_4pairIKS2_S3_EEEEEES2_S3_EbRKT_RKT0_RT1_:
   22|  6.97k|{
   23|  6.97k|    auto it = map.find(key);
   24|  6.97k|    if (it != map.end()) {
  ------------------
  |  Branch (24:9): [True: 6.97k, False: 2]
  ------------------
   25|  6.97k|        value = it->second;
   26|  6.97k|        return true;
   27|  6.97k|    }
   28|      2|    return false;
   29|  6.97k|}
_Z12LookupHelperINSt3__13mapI6CKeyID7CPubKeyNS0_4lessIS2_EENS0_9allocatorINS0_4pairIKS2_S3_EEEEEES2_S3_EbRKT_RKT0_RT1_:
   22|  2.03k|{
   23|  2.03k|    auto it = map.find(key);
   24|  2.03k|    if (it != map.end()) {
  ------------------
  |  Branch (24:9): [True: 2.03k, False: 2]
  ------------------
   25|  2.03k|        value = it->second;
   26|  2.03k|        return true;
   27|  2.03k|    }
   28|      2|    return false;
   29|  2.03k|}
_Z12LookupHelperINSt3__13mapI6CKeyIDNS0_4pairI7CPubKey13KeyOriginInfoEENS0_4lessIS2_EENS0_9allocatorINS3_IKS2_S6_EEEEEES2_S6_EbRKT_RKT0_RT1_:
   22|   249k|{
   23|   249k|    auto it = map.find(key);
   24|   249k|    if (it != map.end()) {
  ------------------
  |  Branch (24:9): [True: 170k, False: 78.3k]
  ------------------
   25|   170k|        value = it->second;
   26|   170k|        return true;
   27|   170k|    }
   28|  78.3k|    return false;
   29|   249k|}
_Z12LookupHelperINSt3__13mapI6CKeyID4CKeyNS0_4lessIS2_EENS0_9allocatorINS0_4pairIKS2_S3_EEEEEES2_S3_EbRKT_RKT0_RT1_:
   22|  2.17M|{
   23|  2.17M|    auto it = map.find(key);
   24|  2.17M|    if (it != map.end()) {
  ------------------
  |  Branch (24:9): [True: 1.94M, False: 229k]
  ------------------
   25|  1.94M|        value = it->second;
   26|  1.94M|        return true;
   27|  1.94M|    }
   28|   229k|    return false;
   29|  2.17M|}
_Z12LookupHelperINSt3__13mapI11XOnlyPubKey14TaprootBuilderNS0_4lessIS2_EENS0_9allocatorINS0_4pairIKS2_S3_EEEEEES2_S3_EbRKT_RKT0_RT1_:
   22|  25.4k|{
   23|  25.4k|    auto it = map.find(key);
   24|  25.4k|    if (it != map.end()) {
  ------------------
  |  Branch (24:9): [True: 25.1k, False: 281]
  ------------------
   25|  25.1k|        value = it->second;
   26|  25.1k|        return true;
   27|  25.1k|    }
   28|    281|    return false;
   29|  25.4k|}

_ZNK15SigningProvider13GetKeyByXOnlyERK11XOnlyPubKeyR4CKey:
  186|  42.9k|    {
  187|  85.8k|        for (const auto& id : pubkey.GetKeyIDs()) {
  ------------------
  |  Branch (187:29): [True: 85.8k, False: 42.9k]
  ------------------
  188|  85.8k|            if (GetKey(id, key)) return true;
  ------------------
  |  Branch (188:17): [True: 20, False: 85.8k]
  ------------------
  189|  85.8k|        }
  190|  42.9k|        return false;
  191|  42.9k|    }
_ZNK15SigningProvider19GetKeyOriginByXOnlyERK11XOnlyPubKeyR13KeyOriginInfo:
  202|   157k|    {
  203|   235k|        for (const auto& id : pubkey.GetKeyIDs()) {
  ------------------
  |  Branch (203:29): [True: 235k, False: 9]
  ------------------
  204|   235k|            if (GetKeyOrigin(id, info)) return true;
  ------------------
  |  Branch (204:17): [True: 157k, False: 78.3k]
  ------------------
  205|   235k|        }
  206|      9|        return false;
  207|   157k|    }
_ZNK14TaprootBuilder7IsValidEv:
  141|  23.5k|    bool IsValid() const { return m_valid; }
_ZNK14TaprootBuilder10IsCompleteEv:
  143|   125k|    bool IsComplete() const { return m_valid && (m_branch.size() == 0 || (m_branch.size() == 1 && m_branch[0].has_value())); }
  ------------------
  |  Branch (143:38): [True: 125k, False: 0]
  |  Branch (143:50): [True: 82.2k, False: 43.3k]
  |  Branch (143:75): [True: 43.3k, False: 0]
  |  Branch (143:99): [True: 43.3k, False: 0]
  ------------------
_ZNK29ShortestVectorFirstComparatorclERKNSt3__16vectorIhNS0_9allocatorIhEEEES6_:
   35|  4.83k|    {
   36|  4.83k|        if (a.size() < b.size()) return true;
  ------------------
  |  Branch (36:13): [True: 4.34k, False: 491]
  ------------------
   37|    491|        if (a.size() > b.size()) return false;
  ------------------
  |  Branch (37:13): [True: 206, False: 285]
  ------------------
   38|    285|        return a < b;
   39|    491|    }
_ZN15SigningProviderD2Ev:
  170|  1.66M|    virtual ~SigningProvider() = default;

_Z11MatchMultiARK7CScript:
  108|  10.5k|{
  109|  10.5k|    std::vector<std::span<const unsigned char>> keyspans;
  110|       |
  111|       |    // Redundant, but very fast and selective test.
  112|  10.5k|    if (script.size() == 0 || script[0] != 32 || script.back() != OP_NUMEQUAL) return {};
  ------------------
  |  Branch (112:9): [True: 0, False: 10.5k]
  |  Branch (112:31): [True: 1.61k, False: 8.93k]
  |  Branch (112:50): [True: 688, False: 8.24k]
  ------------------
  113|       |
  114|       |    // Parse keys
  115|  8.24k|    auto it = script.begin();
  116|   135k|    while (script.end() - it >= 34) {
  ------------------
  |  Branch (116:12): [True: 126k, False: 8.24k]
  ------------------
  117|   126k|        if (*it != 32) return {};
  ------------------
  |  Branch (117:13): [True: 0, False: 126k]
  ------------------
  118|   126k|        ++it;
  119|   126k|        keyspans.emplace_back(&*it, 32);
  120|   126k|        it += 32;
  121|   126k|        if (*it != (keyspans.size() == 1 ? OP_CHECKSIG : OP_CHECKSIGADD)) return {};
  ------------------
  |  Branch (121:13): [True: 0, False: 126k]
  |  Branch (121:21): [True: 8.24k, False: 118k]
  ------------------
  122|   126k|        ++it;
  123|   126k|    }
  124|  8.24k|    if (keyspans.size() == 0 || keyspans.size() > MAX_PUBKEYS_PER_MULTI_A) return {};
  ------------------
  |  Branch (124:9): [True: 0, False: 8.24k]
  |  Branch (124:33): [True: 0, False: 8.24k]
  ------------------
  125|       |
  126|       |    // Parse threshold.
  127|  8.24k|    opcodetype opcode;
  128|  8.24k|    std::vector<unsigned char> data;
  129|  8.24k|    if (!script.GetOp(it, opcode, data)) return {};
  ------------------
  |  Branch (129:9): [True: 0, False: 8.24k]
  ------------------
  130|  8.24k|    if (it == script.end()) return {};
  ------------------
  |  Branch (130:9): [True: 0, False: 8.24k]
  ------------------
  131|  8.24k|    if (*it != OP_NUMEQUAL) return {};
  ------------------
  |  Branch (131:9): [True: 0, False: 8.24k]
  ------------------
  132|  8.24k|    ++it;
  133|  8.24k|    if (it != script.end()) return {};
  ------------------
  |  Branch (133:9): [True: 0, False: 8.24k]
  ------------------
  134|  8.24k|    auto threshold = GetScriptNumber(opcode, data, 1, (int)keyspans.size());
  135|  8.24k|    if (!threshold) return {};
  ------------------
  |  Branch (135:9): [True: 0, False: 8.24k]
  ------------------
  136|       |
  137|       |    // Construct result.
  138|  8.24k|    return std::pair{*threshold, std::move(keyspans)};
  139|  8.24k|}
_Z6SolverRK7CScriptRNSt3__16vectorINS3_IhNS2_9allocatorIhEEEENS4_IS6_EEEE:
  142|  43.1k|{
  143|  43.1k|    vSolutionsRet.clear();
  144|       |
  145|       |    // Shortcut for pay-to-script-hash, which are more constrained than the other types:
  146|       |    // it is always OP_HASH160 20 [20 byte hash] OP_EQUAL
  147|  43.1k|    if (scriptPubKey.IsPayToScriptHash())
  ------------------
  |  Branch (147:9): [True: 3.01k, False: 40.1k]
  ------------------
  148|  3.01k|    {
  149|  3.01k|        std::vector<unsigned char> hashBytes(scriptPubKey.begin()+2, scriptPubKey.begin()+22);
  150|  3.01k|        vSolutionsRet.push_back(hashBytes);
  151|  3.01k|        return TxoutType::SCRIPTHASH;
  152|  3.01k|    }
  153|       |
  154|  40.1k|    int witnessversion;
  155|  40.1k|    std::vector<unsigned char> witnessprogram;
  156|  40.1k|    if (scriptPubKey.IsWitnessProgram(witnessversion, witnessprogram)) {
  ------------------
  |  Branch (156:9): [True: 30.1k, False: 10.0k]
  ------------------
  157|  30.1k|        if (witnessversion == 0 && witnessprogram.size() == WITNESS_V0_KEYHASH_SIZE) {
  ------------------
  |  Branch (157:13): [True: 4.66k, False: 25.5k]
  |  Branch (157:36): [True: 685, False: 3.97k]
  ------------------
  158|    685|            vSolutionsRet.push_back(std::move(witnessprogram));
  159|    685|            return TxoutType::WITNESS_V0_KEYHASH;
  160|    685|        }
  161|  29.4k|        if (witnessversion == 0 && witnessprogram.size() == WITNESS_V0_SCRIPTHASH_SIZE) {
  ------------------
  |  Branch (161:13): [True: 3.97k, False: 25.5k]
  |  Branch (161:36): [True: 3.97k, False: 6]
  ------------------
  162|  3.97k|            vSolutionsRet.push_back(std::move(witnessprogram));
  163|  3.97k|            return TxoutType::WITNESS_V0_SCRIPTHASH;
  164|  3.97k|        }
  165|  25.5k|        if (witnessversion == 1 && witnessprogram.size() == WITNESS_V1_TAPROOT_SIZE) {
  ------------------
  |  Branch (165:13): [True: 25.4k, False: 54]
  |  Branch (165:36): [True: 25.4k, False: 42]
  ------------------
  166|  25.4k|            vSolutionsRet.push_back(std::move(witnessprogram));
  167|  25.4k|            return TxoutType::WITNESS_V1_TAPROOT;
  168|  25.4k|        }
  169|     96|        if (scriptPubKey.IsPayToAnchor()) {
  ------------------
  |  Branch (169:13): [True: 3, False: 93]
  ------------------
  170|      3|            return TxoutType::ANCHOR;
  171|      3|        }
  172|     93|        if (witnessversion != 0) {
  ------------------
  |  Branch (172:13): [True: 87, False: 6]
  ------------------
  173|     87|            vSolutionsRet.push_back(std::vector<unsigned char>{(unsigned char)witnessversion});
  174|     87|            vSolutionsRet.push_back(std::move(witnessprogram));
  175|     87|            return TxoutType::WITNESS_UNKNOWN;
  176|     87|        }
  177|      6|        return TxoutType::NONSTANDARD;
  178|     93|    }
  179|       |
  180|       |    // Provably prunable, data-carrying output
  181|       |    //
  182|       |    // So long as script passes the IsUnspendable() test and all but the first
  183|       |    // byte passes the IsPushOnly() test we don't care what exactly is in the
  184|       |    // script.
  185|  10.0k|    if (scriptPubKey.size() >= 1 && scriptPubKey[0] == OP_RETURN && scriptPubKey.IsPushOnly(scriptPubKey.begin()+1)) {
  ------------------
  |  Branch (185:9): [True: 10.0k, False: 0]
  |  Branch (185:9): [True: 69, False: 9.93k]
  |  Branch (185:37): [True: 306, False: 9.70k]
  |  Branch (185:69): [True: 69, False: 237]
  ------------------
  186|     69|        return TxoutType::NULL_DATA;
  187|     69|    }
  188|       |
  189|  9.93k|    std::vector<unsigned char> data;
  190|  9.93k|    if (MatchPayToPubkey(scriptPubKey, data)) {
  ------------------
  |  Branch (190:9): [True: 1.84k, False: 8.09k]
  ------------------
  191|  1.84k|        vSolutionsRet.push_back(std::move(data));
  192|  1.84k|        return TxoutType::PUBKEY;
  193|  1.84k|    }
  194|       |
  195|  8.09k|    if (MatchPayToPubkeyHash(scriptPubKey, data)) {
  ------------------
  |  Branch (195:9): [True: 1.00k, False: 7.08k]
  ------------------
  196|  1.00k|        vSolutionsRet.push_back(std::move(data));
  197|  1.00k|        return TxoutType::PUBKEYHASH;
  198|  1.00k|    }
  199|       |
  200|  7.08k|    int required;
  201|  7.08k|    std::vector<std::vector<unsigned char>> keys;
  202|  7.08k|    if (MatchMultisig(scriptPubKey, required, keys)) {
  ------------------
  |  Branch (202:9): [True: 1.78k, False: 5.30k]
  ------------------
  203|  1.78k|        vSolutionsRet.push_back({static_cast<unsigned char>(required)}); // safe as required is in range 1..20
  204|  1.78k|        vSolutionsRet.insert(vSolutionsRet.end(), keys.begin(), keys.end());
  205|  1.78k|        vSolutionsRet.push_back({static_cast<unsigned char>(keys.size())}); // safe as size is in range 1..20
  206|  1.78k|        return TxoutType::MULTISIG;
  207|  1.78k|    }
  208|       |
  209|  5.30k|    vSolutionsRet.clear();
  210|  5.30k|    return TxoutType::NONSTANDARD;
  211|  7.08k|}
_Z21GetScriptForRawPubKeyRK7CPubKey:
  214|  4.68k|{
  215|  4.68k|    return CScript() << std::vector<unsigned char>(pubKey.begin(), pubKey.end()) << OP_CHECKSIG;
  216|  4.68k|}
_Z20GetScriptForMultisigiRKNSt3__16vectorI7CPubKeyNS_9allocatorIS1_EEEE:
  219|  3.56k|{
  220|  3.56k|    CScript script;
  221|       |
  222|  3.56k|    script << nRequired;
  223|  3.56k|    for (const CPubKey& key : keys)
  ------------------
  |  Branch (223:29): [True: 13.9k, False: 3.56k]
  ------------------
  224|  13.9k|        script << ToByteVector(key);
  225|  3.56k|    script << keys.size() << OP_CHECKMULTISIG;
  226|       |
  227|  3.56k|    return script;
  228|  3.56k|}
solver.cpp:_ZL15GetScriptNumber10opcodetypeNSt3__16vectorIhNS0_9allocatorIhEEEEii:
   67|  12.5k|{
   68|  12.5k|    int count;
   69|  12.5k|    if (IsSmallInteger(opcode)) {
  ------------------
  |  Branch (69:9): [True: 11.8k, False: 698]
  ------------------
   70|  11.8k|        count = CScript::DecodeOP_N(opcode);
   71|  11.8k|    } else if (IsPushdataOp(opcode)) {
  ------------------
  |  Branch (71:16): [True: 611, False: 87]
  ------------------
   72|    611|        if (!CheckMinimalPush(data, opcode)) return {};
  ------------------
  |  Branch (72:13): [True: 42, False: 569]
  ------------------
   73|    569|        try {
   74|    569|            count = CScriptNum(data, /* fRequireMinimal = */ true).getint();
   75|    569|        } catch (const scriptnum_error&) {
   76|     66|            return {};
   77|     66|        }
   78|    569|    } else {
   79|     87|        return {};
   80|     87|    }
   81|  12.3k|    if (count < min || count > max) return {};
  ------------------
  |  Branch (81:9): [True: 123, False: 12.1k]
  |  Branch (81:24): [True: 201, False: 11.9k]
  ------------------
   82|  11.9k|    return count;
   83|  12.3k|}
solver.cpp:_ZL14IsSmallInteger10opcodetype:
   60|  12.5k|{
   61|  12.5k|    return opcode >= OP_1 && opcode <= OP_16;
  ------------------
  |  Branch (61:12): [True: 11.8k, False: 629]
  |  Branch (61:30): [True: 11.8k, False: 69]
  ------------------
   62|  12.5k|}
solver.cpp:_ZL16MatchPayToPubkeyRK7CScriptRNSt3__16vectorIhNS2_9allocatorIhEEEE:
   37|  9.93k|{
   38|  9.93k|    if (script.size() == CPubKey::SIZE + 2 && script[0] == CPubKey::SIZE && script.back() == OP_CHECKSIG) {
  ------------------
  |  Branch (38:9): [True: 106, False: 9.83k]
  |  Branch (38:47): [True: 32, False: 74]
  |  Branch (38:77): [True: 23, False: 9]
  ------------------
   39|     23|        pubkey = valtype(script.begin() + 1, script.begin() + CPubKey::SIZE + 1);
   40|     23|        return CPubKey::ValidSize(pubkey);
   41|     23|    }
   42|  9.91k|    if (script.size() == CPubKey::COMPRESSED_SIZE + 2 && script[0] == CPubKey::COMPRESSED_SIZE && script.back() == OP_CHECKSIG) {
  ------------------
  |  Branch (42:9): [True: 1.99k, False: 7.91k]
  |  Branch (42:58): [True: 1.86k, False: 138]
  |  Branch (42:99): [True: 1.84k, False: 12]
  ------------------
   43|  1.84k|        pubkey = valtype(script.begin() + 1, script.begin() + CPubKey::COMPRESSED_SIZE + 1);
   44|  1.84k|        return CPubKey::ValidSize(pubkey);
   45|  1.84k|    }
   46|  8.06k|    return false;
   47|  9.91k|}
solver.cpp:_ZL20MatchPayToPubkeyHashRK7CScriptRNSt3__16vectorIhNS2_9allocatorIhEEEE:
   50|  8.09k|{
   51|  8.09k|    if (script.size() == 25 && script[0] == OP_DUP && script[1] == OP_HASH160 && script[2] == 20 && script[23] == OP_EQUALVERIFY && script[24] == OP_CHECKSIG) {
  ------------------
  |  Branch (51:9): [True: 1.08k, False: 7.01k]
  |  Branch (51:32): [True: 1.06k, False: 15]
  |  Branch (51:55): [True: 1.05k, False: 9]
  |  Branch (51:82): [True: 1.05k, False: 6]
  |  Branch (51:101): [True: 1.02k, False: 24]
  |  Branch (51:133): [True: 1.00k, False: 18]
  ------------------
   52|  1.00k|        pubkeyhash = valtype(script.begin () + 3, script.begin() + 23);
   53|  1.00k|        return true;
   54|  1.00k|    }
   55|  7.08k|    return false;
   56|  8.09k|}
solver.cpp:_ZL13MatchMultisigRK7CScriptRiRNSt3__16vectorINS4_IhNS3_9allocatorIhEEEENS5_IS7_EEEE:
   86|  7.08k|{
   87|  7.08k|    opcodetype opcode;
   88|  7.08k|    valtype data;
   89|       |
   90|  7.08k|    CScript::const_iterator it = script.begin();
   91|  7.08k|    if (script.size() < 1 || script.back() != OP_CHECKMULTISIG) return false;
  ------------------
  |  Branch (91:9): [True: 0, False: 7.08k]
  |  Branch (91:30): [True: 4.62k, False: 2.46k]
  ------------------
   92|       |
   93|  2.46k|    if (!script.GetOp(it, opcode, data)) return false;
  ------------------
  |  Branch (93:9): [True: 147, False: 2.32k]
  ------------------
   94|  2.32k|    auto req_sigs = GetScriptNumber(opcode, data, 1, MAX_PUBKEYS_PER_MULTISIG);
   95|  2.32k|    if (!req_sigs) return false;
  ------------------
  |  Branch (95:9): [True: 378, False: 1.94k]
  ------------------
   96|  1.94k|    required_sigs = *req_sigs;
   97|  8.95k|    while (script.GetOp(it, opcode, data) && CPubKey::ValidSize(data)) {
  ------------------
  |  Branch (97:12): [True: 8.93k, False: 21]
  |  Branch (97:46): [True: 7.01k, False: 1.92k]
  ------------------
   98|  7.01k|        pubkeys.emplace_back(std::move(data));
   99|  7.01k|    }
  100|  1.94k|    auto num_keys = GetScriptNumber(opcode, data, required_sigs, MAX_PUBKEYS_PER_MULTISIG);
  101|  1.94k|    if (!num_keys) return false;
  ------------------
  |  Branch (101:9): [True: 141, False: 1.80k]
  ------------------
  102|  1.80k|    if (pubkeys.size() != static_cast<unsigned long>(*num_keys)) return false;
  ------------------
  |  Branch (102:9): [True: 15, False: 1.78k]
  ------------------
  103|       |
  104|  1.78k|    return (it + 1 == script.end());
  105|  1.80k|}

_Z12IsPushdataOp10opcodetype:
   41|   159k|{
   42|   159k|    return opcode > OP_FALSE && opcode <= OP_PUSHDATA4;
  ------------------
  |  Branch (42:12): [True: 131k, False: 28.0k]
  |  Branch (42:33): [True: 8.38k, False: 123k]
  ------------------
   43|   159k|}

secp256k1.c:secp256k1_eckey_pubkey_parse:
   18|   807k|static int secp256k1_eckey_pubkey_parse(secp256k1_ge *elem, const unsigned char *pub, size_t size) {
   19|   807k|    if (size == 33 && (pub[0] == SECP256K1_TAG_PUBKEY_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_ODD)) {
  ------------------
  |  |  220|  1.61M|#define SECP256K1_TAG_PUBKEY_EVEN 0x02
  ------------------
                  if (size == 33 && (pub[0] == SECP256K1_TAG_PUBKEY_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_ODD)) {
  ------------------
  |  |  221|   472k|#define SECP256K1_TAG_PUBKEY_ODD 0x03
  ------------------
  |  Branch (19:9): [True: 806k, False: 165]
  |  Branch (19:24): [True: 334k, False: 472k]
  |  Branch (19:63): [True: 472k, False: 0]
  ------------------
   20|   806k|        secp256k1_fe x;
   21|   806k|        return secp256k1_fe_set_b32_limit(&x, pub+1) && secp256k1_ge_set_xo_var(elem, &x, pub[0] == SECP256K1_TAG_PUBKEY_ODD);
  ------------------
  |  |   88|   806k|#  define secp256k1_fe_set_b32_limit secp256k1_fe_impl_set_b32_limit
  ------------------
                      return secp256k1_fe_set_b32_limit(&x, pub+1) && secp256k1_ge_set_xo_var(elem, &x, pub[0] == SECP256K1_TAG_PUBKEY_ODD);
  ------------------
  |  |  221|   806k|#define SECP256K1_TAG_PUBKEY_ODD 0x03
  ------------------
  |  Branch (21:16): [True: 806k, False: 1]
  |  Branch (21:57): [True: 806k, False: 104]
  ------------------
   22|   806k|    } else if (size == 65 && (pub[0] == SECP256K1_TAG_PUBKEY_UNCOMPRESSED || pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_ODD)) {
  ------------------
  |  |  222|    330|#define SECP256K1_TAG_PUBKEY_UNCOMPRESSED 0x04
  ------------------
                  } else if (size == 65 && (pub[0] == SECP256K1_TAG_PUBKEY_UNCOMPRESSED || pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_ODD)) {
  ------------------
  |  |  223|    165|#define SECP256K1_TAG_PUBKEY_HYBRID_EVEN 0x06
  ------------------
                  } else if (size == 65 && (pub[0] == SECP256K1_TAG_PUBKEY_UNCOMPRESSED || pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_ODD)) {
  ------------------
  |  |  224|      0|#define SECP256K1_TAG_PUBKEY_HYBRID_ODD 0x07
  ------------------
  |  Branch (22:16): [True: 165, False: 0]
  |  Branch (22:31): [True: 165, False: 0]
  |  Branch (22:78): [True: 0, False: 0]
  |  Branch (22:124): [True: 0, False: 0]
  ------------------
   23|    165|        secp256k1_fe x, y;
   24|    165|        if (!secp256k1_fe_set_b32_limit(&x, pub+1) || !secp256k1_fe_set_b32_limit(&y, pub+33)) {
  ------------------
  |  |   88|    165|#  define secp256k1_fe_set_b32_limit secp256k1_fe_impl_set_b32_limit
  ------------------
                      if (!secp256k1_fe_set_b32_limit(&x, pub+1) || !secp256k1_fe_set_b32_limit(&y, pub+33)) {
  ------------------
  |  |   88|    164|#  define secp256k1_fe_set_b32_limit secp256k1_fe_impl_set_b32_limit
  ------------------
  |  Branch (24:13): [True: 1, False: 164]
  |  Branch (24:55): [True: 2, False: 162]
  ------------------
   25|      3|            return 0;
   26|      3|        }
   27|    162|        secp256k1_ge_set_xy(elem, &x, &y);
   28|    162|        if ((pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_ODD) &&
  ------------------
  |  |  223|    324|#define SECP256K1_TAG_PUBKEY_HYBRID_EVEN 0x06
  ------------------
                      if ((pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_ODD) &&
  ------------------
  |  |  224|    162|#define SECP256K1_TAG_PUBKEY_HYBRID_ODD 0x07
  ------------------
  |  Branch (28:14): [True: 0, False: 162]
  |  Branch (28:60): [True: 0, False: 162]
  ------------------
   29|      0|            secp256k1_fe_is_odd(&y) != (pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_ODD)) {
  ------------------
  |  |   85|      0|#  define secp256k1_fe_is_odd secp256k1_fe_impl_is_odd
  ------------------
                          secp256k1_fe_is_odd(&y) != (pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_ODD)) {
  ------------------
  |  |  224|      0|#define SECP256K1_TAG_PUBKEY_HYBRID_ODD 0x07
  ------------------
  |  Branch (29:13): [True: 0, False: 0]
  ------------------
   30|      0|            return 0;
   31|      0|        }
   32|    162|        return secp256k1_ge_is_valid_var(elem);
   33|    162|    } else {
   34|      0|        return 0;
   35|      0|    }
   36|   807k|}
secp256k1.c:secp256k1_eckey_pubkey_serialize33:
   38|  7.44M|static void secp256k1_eckey_pubkey_serialize33(secp256k1_ge *elem, unsigned char *pub33) {
   39|  7.44M|    VERIFY_CHECK(!secp256k1_ge_is_infinity(elem));
   40|       |
   41|  7.44M|    secp256k1_fe_normalize_var(&elem->x);
  ------------------
  |  |   80|  7.44M|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
   42|  7.44M|    secp256k1_fe_normalize_var(&elem->y);
  ------------------
  |  |   80|  7.44M|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
   43|  7.44M|    pub33[0] = secp256k1_fe_is_odd(&elem->y) ? SECP256K1_TAG_PUBKEY_ODD : SECP256K1_TAG_PUBKEY_EVEN;
  ------------------
  |  |   85|  7.44M|#  define secp256k1_fe_is_odd secp256k1_fe_impl_is_odd
  ------------------
                  pub33[0] = secp256k1_fe_is_odd(&elem->y) ? SECP256K1_TAG_PUBKEY_ODD : SECP256K1_TAG_PUBKEY_EVEN;
  ------------------
  |  |  221|  3.38M|#define SECP256K1_TAG_PUBKEY_ODD 0x03
  ------------------
                  pub33[0] = secp256k1_fe_is_odd(&elem->y) ? SECP256K1_TAG_PUBKEY_ODD : SECP256K1_TAG_PUBKEY_EVEN;
  ------------------
  |  |  220|  11.4M|#define SECP256K1_TAG_PUBKEY_EVEN 0x02
  ------------------
  |  Branch (43:16): [True: 3.38M, False: 4.05M]
  ------------------
   44|  7.44M|    secp256k1_fe_get_b32(&pub33[1], &elem->x);
  ------------------
  |  |   89|  7.44M|#  define secp256k1_fe_get_b32 secp256k1_fe_impl_get_b32
  ------------------
   45|  7.44M|}
secp256k1.c:secp256k1_eckey_privkey_tweak_add:
   57|  2.40M|static int secp256k1_eckey_privkey_tweak_add(secp256k1_scalar *key, const secp256k1_scalar *tweak) {
   58|  2.40M|    secp256k1_scalar_add(key, key, tweak);
   59|  2.40M|    return !secp256k1_scalar_is_zero(key);
   60|  2.40M|}
secp256k1.c:secp256k1_eckey_pubkey_tweak_add:
   62|   269k|static int secp256k1_eckey_pubkey_tweak_add(secp256k1_ge *key, const secp256k1_scalar *tweak) {
   63|   269k|    secp256k1_gej pt;
   64|   269k|    secp256k1_gej_set_ge(&pt, key);
   65|   269k|    secp256k1_ecmult(&pt, &pt, &secp256k1_scalar_one, tweak);
   66|       |
   67|   269k|    if (secp256k1_gej_is_infinity(&pt)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 269k]
  ------------------
   68|      0|        return 0;
   69|      0|    }
   70|   269k|    secp256k1_ge_set_gej(key, &pt);
   71|   269k|    return 1;
   72|   269k|}

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|  6.17M|static int secp256k1_ecmult_gen_context_is_built(const secp256k1_ecmult_gen_context* ctx) {
   23|  6.17M|    return ctx->built;
   24|  6.17M|}
secp256k1.c:secp256k1_ecmult_gen_gej:
   54|  6.17M|static void secp256k1_ecmult_gen_gej(const secp256k1_ecmult_gen_context *ctx, secp256k1_gej *r, const secp256k1_scalar *gn) {
   55|  6.17M|    uint32_t comb_off;
   56|  6.17M|    secp256k1_ge add;
   57|  6.17M|    secp256k1_fe neg;
   58|  6.17M|    secp256k1_ge_storage adds;
   59|  6.17M|    secp256k1_scalar d;
   60|       |    /* Array of uint32_t values large enough to store COMB_BITS bits. Only the bottom
   61|       |     * 8 are ever nonzero, but having the zero padding at the end if COMB_BITS>256
   62|       |     * avoids the need to deal with out-of-bounds reads from a scalar. */
   63|  6.17M|    uint32_t recoded[(COMB_BITS + 31) >> 5] = {0};
   64|  6.17M|    int first = 1, i;
   65|       |
   66|  6.17M|    memset(&adds, 0, sizeof(adds));
   67|       |
   68|       |    /* We want to compute R = gn*G.
   69|       |     *
   70|       |     * To blind the scalar used in the computation, we rewrite this to be
   71|       |     * R = (gn - b)*G + b*G, with a blinding value b determined by the context.
   72|       |     *
   73|       |     * The multiplication (gn-b)*G will be performed using a signed-digit multi-comb (see Section
   74|       |     * 3.3 of "Fast and compact elliptic-curve cryptography" by Mike Hamburg,
   75|       |     * https://eprint.iacr.org/2012/309).
   76|       |     *
   77|       |     * Let comb(s, P) = sum((2*s[i]-1)*2^i*P for i=0..COMB_BITS-1), where s[i] is the i'th bit of
   78|       |     * the binary representation of scalar s. So the s[i] values determine whether -2^i*P (s[i]=0)
   79|       |     * or +2^i*P (s[i]=1) are added together. COMB_BITS is at least 256, so all bits of s are
   80|       |     * covered. By manipulating:
   81|       |     *
   82|       |     *     comb(s, P) = sum((2*s[i]-1)*2^i*P for i=0..COMB_BITS-1)
   83|       |     * <=> comb(s, P) = sum((2*s[i]-1)*2^i for i=0..COMB_BITS-1) * P
   84|       |     * <=> comb(s, P) = (2*sum(s[i]*2^i for i=0..COMB_BITS-1) - sum(2^i for i=0..COMB_BITS-1)) * P
   85|       |     * <=> comb(s, P) = (2*s - (2^COMB_BITS - 1)) * P
   86|       |     *
   87|       |     * If we wanted to compute (gn-b)*G as comb(s, G), it would need to hold that
   88|       |     *
   89|       |     *     (gn - b) * G = (2*s - (2^COMB_BITS - 1)) * G
   90|       |     * <=> s = (gn - b + (2^COMB_BITS - 1))/2 (mod order)
   91|       |     *
   92|       |     * We use an alternative here that avoids the modular division by two: instead we compute
   93|       |     * (gn-b)*G as comb(d, G/2). For that to hold it must be the case that
   94|       |     *
   95|       |     *     (gn - b) * G = (2*d - (2^COMB_BITS - 1)) * (G/2)
   96|       |     * <=> d = gn - b + (2^COMB_BITS - 1)/2 (mod order)
   97|       |     *
   98|       |     * Adding precomputation, our final equations become:
   99|       |     *
  100|       |     *     ctx->scalar_offset = (2^COMB_BITS - 1)/2 - b (mod order)
  101|       |     *     ctx->ge_offset = b*G
  102|       |     *     d = gn + ctx->scalar_offset (mod order)
  103|       |     *     R = comb(d, G/2) + ctx->ge_offset
  104|       |     *
  105|       |     * comb(d, G/2) function is then computed by summing + or - 2^(i-1)*G, for i=0..COMB_BITS-1,
  106|       |     * depending on the value of the bits d[i] of the binary representation of scalar d.
  107|       |     */
  108|       |
  109|       |    /* Compute the scalar d = (gn + ctx->scalar_offset). */
  110|  6.17M|    secp256k1_scalar_add(&d, &ctx->scalar_offset, gn);
  111|       |    /* Convert to recoded array. */
  112|  55.5M|    for (i = 0; i < 8 && i < ((COMB_BITS + 31) >> 5); ++i) {
  ------------------
  |  |   85|  49.3M|#define COMB_BITS (COMB_BLOCKS * COMB_TEETH * COMB_SPACING)
  |  |  ------------------
  |  |  |  |   79|  49.3M|#define COMB_SPACING CEIL_DIV(COMB_RANGE, COMB_BLOCKS * COMB_TEETH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  190|  49.3M|#define CEIL_DIV(x, y) (1 + ((x) - 1) / (y))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (112:17): [True: 49.3M, False: 6.17M]
  |  Branch (112:26): [True: 49.3M, False: 0]
  ------------------
  113|  49.3M|        recoded[i] = secp256k1_scalar_get_bits_limb32(&d, 32 * i, 32);
  114|  49.3M|    }
  115|  6.17M|    secp256k1_scalar_clear(&d);
  116|       |
  117|       |    /* In secp256k1_ecmult_gen_prec_table we have precomputed sums of the
  118|       |     * (2*d[i]-1) * 2^(i-1) * G points, for various combinations of i positions.
  119|       |     * We rewrite our equation in terms of these table entries.
  120|       |     *
  121|       |     * Let mask(b) = sum(2^((b*COMB_TEETH + t)*COMB_SPACING) for t=0..COMB_TEETH-1),
  122|       |     * with b ranging from 0 to COMB_BLOCKS-1. So for example with COMB_BLOCKS=11,
  123|       |     * COMB_TEETH=6, COMB_SPACING=4, we would have:
  124|       |     *   mask(0)  = 2^0   + 2^4   + 2^8   + 2^12  + 2^16  + 2^20,
  125|       |     *   mask(1)  = 2^24  + 2^28  + 2^32  + 2^36  + 2^40  + 2^44,
  126|       |     *   mask(2)  = 2^48  + 2^52  + 2^56  + 2^60  + 2^64  + 2^68,
  127|       |     *   ...
  128|       |     *   mask(10) = 2^240 + 2^244 + 2^248 + 2^252 + 2^256 + 2^260
  129|       |     *
  130|       |     * We will split up the bits d[i] using these masks. Specifically, each mask is
  131|       |     * used COMB_SPACING times, with different shifts:
  132|       |     *
  133|       |     * d = (d & mask(0)<<0) + (d & mask(1)<<0) + ... + (d & mask(COMB_BLOCKS-1)<<0) +
  134|       |     *     (d & mask(0)<<1) + (d & mask(1)<<1) + ... + (d & mask(COMB_BLOCKS-1)<<1) +
  135|       |     *     ...
  136|       |     *     (d & mask(0)<<(COMB_SPACING-1)) + ...
  137|       |     *
  138|       |     * Now define table(b, m) = (m - mask(b)/2) * G, and we will precompute these values for
  139|       |     * b=0..COMB_BLOCKS-1, and for all values m which (d & mask(b)) can take (so m can take on
  140|       |     * 2^COMB_TEETH distinct values).
  141|       |     *
  142|       |     * If m=(d & mask(b)), then table(b, m) is the sum of 2^i * (2*d[i]-1) * G/2, with i
  143|       |     * iterating over the set bits in mask(b). In our example, table(2, 2^48 + 2^56 + 2^68)
  144|       |     * would equal (2^48 - 2^52 + 2^56 - 2^60 - 2^64 + 2^68) * G/2.
  145|       |     *
  146|       |     * With that, we can rewrite comb(d, G/2) as:
  147|       |     *
  148|       |     *     2^0 * (table(0, d>>0 & mask(0)) + ... + table(COMB_BLOCKS-1, d>>0 & mask(COMP_BLOCKS-1)))
  149|       |     *   + 2^1 * (table(0, d>>1 & mask(0)) + ... + table(COMB_BLOCKS-1, d>>1 & mask(COMP_BLOCKS-1)))
  150|       |     *   + 2^2 * (table(0, d>>2 & mask(0)) + ... + table(COMB_BLOCKS-1, d>>2 & mask(COMP_BLOCKS-1)))
  151|       |     *   + ...
  152|       |     *   + 2^(COMB_SPACING-1) * (table(0, d>>(COMB_SPACING-1) & mask(0)) + ...)
  153|       |     *
  154|       |     * Or more generically as
  155|       |     *
  156|       |     *   sum(2^i * sum(table(b, d>>i & mask(b)), b=0..COMB_BLOCKS-1), i=0..COMB_SPACING-1)
  157|       |     *
  158|       |     * This is implemented using an outer loop that runs in reverse order over the lines of this
  159|       |     * equation, which in each iteration runs an inner loop that adds the terms of that line and
  160|       |     * then doubles the result before proceeding to the next line.
  161|       |     *
  162|       |     * In pseudocode:
  163|       |     *   c = infinity
  164|       |     *   for comb_off in range(COMB_SPACING - 1, -1, -1):
  165|       |     *     for block in range(COMB_BLOCKS):
  166|       |     *       c += table(block, (d >> comb_off) & mask(block))
  167|       |     *     if comb_off > 0:
  168|       |     *       c = 2*c
  169|       |     *   return c
  170|       |     *
  171|       |     * This computes c = comb(d, G/2), and thus finally R = c + ctx->ge_offset. Note that it would
  172|       |     * be possible to apply an initial offset instead of a final offset (moving ge_offset to take
  173|       |     * the place of infinity above), but the chosen approach allows using (in a future improvement)
  174|       |     * an incomplete addition formula for most of the multiplication.
  175|       |     *
  176|       |     * The last question is how to implement the table(b, m) function. For any value of b,
  177|       |     * m=(d & mask(b)) can only take on at most 2^COMB_TEETH possible values (the last one may have
  178|       |     * fewer as there mask(b) may exceed the curve order). So we could create COMB_BLOCK tables
  179|       |     * which contain a value for each such m value.
  180|       |     *
  181|       |     * Now note that if m=(d & mask(b)), then flipping the relevant bits of m results in negating
  182|       |     * the result of table(b, m). This is because table(b,m XOR mask(b)) = table(b, mask(b) - m) =
  183|       |     * (mask(b) - m - mask(b)/2)*G = (-m + mask(b)/2)*G = -(m - mask(b)/2)*G = -table(b, m).
  184|       |     * Because of this it suffices to only store the first half of the m values for every b. If an
  185|       |     * entry from the second half is needed, we look up its bit-flipped version instead, and negate
  186|       |     * it.
  187|       |     *
  188|       |     * secp256k1_ecmult_gen_prec_table[b][index] stores the table(b, m) entries. Index
  189|       |     * is the relevant mask(b) bits of m packed together without gaps. */
  190|       |
  191|       |    /* Outer loop: iterate over comb_off from COMB_SPACING - 1 down to 0. */
  192|  6.17M|    comb_off = COMB_SPACING - 1;
  ------------------
  |  |   79|  6.17M|#define COMB_SPACING CEIL_DIV(COMB_RANGE, COMB_BLOCKS * COMB_TEETH)
  |  |  ------------------
  |  |  |  |  190|  6.17M|#define CEIL_DIV(x, y) (1 + ((x) - 1) / (y))
  |  |  ------------------
  ------------------
  193|  6.17M|    while (1) {
  ------------------
  |  Branch (193:12): [True: 6.17M, Folded]
  ------------------
  194|  6.17M|        uint32_t block;
  195|  6.17M|        uint32_t bit_pos = comb_off;
  196|       |        /* Inner loop: for each block, add table entries to the result. */
  197|   271M|        for (block = 0; block < COMB_BLOCKS; ++block) {
  ------------------
  |  Branch (197:25): [True: 265M, False: 6.17M]
  ------------------
  198|       |            /* Gather the mask(block)-selected bits of d into bits. They're packed:
  199|       |             * bits[tooth] = d[(block*COMB_TEETH + tooth)*COMB_SPACING + comb_off]. */
  200|   265M|            uint32_t bits = 0, sign, abs, index, tooth;
  201|       |            /* Instead of reading individual bits here to construct the bits variable,
  202|       |             * build up the result by xoring rotated reads together. In every iteration,
  203|       |             * one additional bit is made correct, starting at the bottom. The bits
  204|       |             * above that contain junk. This reduces leakage by avoiding computations
  205|       |             * on variables that can have only a low number of possible values (e.g.,
  206|       |             * just two values when reading a single bit into a variable.) See:
  207|       |             * https://www.usenix.org/system/files/conference/usenixsecurity18/sec18-alam.pdf
  208|       |             */
  209|  1.85G|            for (tooth = 0; tooth < COMB_TEETH; ++tooth) {
  ------------------
  |  Branch (209:29): [True: 1.59G, False: 265M]
  ------------------
  210|       |                /* Construct bitdata s.t. the bottom bit is the bit we'd like to read.
  211|       |                 *
  212|       |                 * We could just set bitdata = recoded[bit_pos >> 5] >> (bit_pos & 0x1f)
  213|       |                 * but this would simply discard the bits that fall off at the bottom,
  214|       |                 * and thus, for example, bitdata could still have only two values if we
  215|       |                 * happen to shift by exactly 31 positions. We use a rotation instead,
  216|       |                 * which ensures that bitdata doesn't lose entropy. This relies on the
  217|       |                 * rotation being atomic, i.e., the compiler emitting an actual rot
  218|       |                 * instruction. */
  219|  1.59G|                uint32_t bitdata = secp256k1_rotr32(recoded[bit_pos >> 5], bit_pos & 0x1f);
  220|       |
  221|       |                /* Clear the bit at position tooth, but sssh, don't tell clang. */
  222|  1.59G|                uint32_t volatile vmask = ~(1 << tooth);
  223|  1.59G|                bits &= vmask;
  224|       |
  225|       |                /* Write the bit into position tooth (and junk into higher bits). */
  226|  1.59G|                bits ^= bitdata << tooth;
  227|  1.59G|                bit_pos += COMB_SPACING;
  ------------------
  |  |   79|  1.59G|#define COMB_SPACING CEIL_DIV(COMB_RANGE, COMB_BLOCKS * COMB_TEETH)
  |  |  ------------------
  |  |  |  |  190|  1.59G|#define CEIL_DIV(x, y) (1 + ((x) - 1) / (y))
  |  |  ------------------
  ------------------
  228|  1.59G|            }
  229|       |
  230|       |            /* If the top bit of bits is 1, flip them all (corresponding to looking up
  231|       |             * the negated table value), and remember to negate the result in sign. */
  232|   265M|            sign = (bits >> (COMB_TEETH - 1)) & 1;
  233|   265M|            abs = (bits ^ -sign) & (COMB_POINTS - 1);
  ------------------
  |  |   87|   265M|#define COMB_POINTS (1 << (COMB_TEETH - 1))
  ------------------
  234|   265M|            VERIFY_CHECK(sign == 0 || sign == 1);
  235|   265M|            VERIFY_CHECK(abs < COMB_POINTS);
  236|       |
  237|       |            /** This uses a conditional move to avoid any secret data in array indexes.
  238|       |             *   _Any_ use of secret indexes has been demonstrated to result in timing
  239|       |             *   sidechannels, even when the cache-line access patterns are uniform.
  240|       |             *  See also:
  241|       |             *   "A word of warning", CHES 2013 Rump Session, by Daniel J. Bernstein and Peter Schwabe
  242|       |             *    (https://cryptojedi.org/peter/data/chesrump-20130822.pdf) and
  243|       |             *   "Cache Attacks and Countermeasures: the Case of AES", RSA 2006,
  244|       |             *    by Dag Arne Osvik, Adi Shamir, and Eran Tromer
  245|       |             *    (https://eprint.iacr.org/2005/271.pdf)
  246|       |             */
  247|  8.75G|            for (index = 0; index < COMB_POINTS; ++index) {
  ------------------
  |  |   87|  8.75G|#define COMB_POINTS (1 << (COMB_TEETH - 1))
  ------------------
  |  Branch (247:29): [True: 8.49G, False: 265M]
  ------------------
  248|  8.49G|                secp256k1_ge_storage_cmov(&adds, &secp256k1_ecmult_gen_prec_table[block][index], index == abs);
  249|  8.49G|            }
  250|       |
  251|       |            /* Set add=adds or add=-adds, in constant time, based on sign. */
  252|   265M|            secp256k1_ge_from_storage(&add, &adds);
  253|   265M|            secp256k1_fe_negate(&neg, &add.y, 1);
  ------------------
  |  |  211|   265M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   265M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   265M|    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: 265M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   265M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 265M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   265M|    } \
  |  |  |  |   94|   265M|    stmt; \
  |  |  |  |   95|   265M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 265M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|   265M|            secp256k1_fe_cmov(&add.y, &neg, sign);
  ------------------
  |  |   95|   265M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  255|       |
  256|       |            /* Add the looked up and conditionally negated value to r. */
  257|   265M|            if (EXPECT(first, 0)) {
  ------------------
  |  |  146|   265M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  ------------------
  |  |  |  Branch (146:21): [True: 6.17M, False: 259M]
  |  |  ------------------
  ------------------
  258|       |                /* If this is the first table lookup, we can skip addition. */
  259|  6.17M|                secp256k1_gej_set_ge(r, &add);
  260|       |                /* Give the entry a random Z coordinate to blind intermediary results. */
  261|  6.17M|                secp256k1_gej_rescale(r, &ctx->proj_blind);
  262|  6.17M|                first = 0;
  263|   259M|            } else {
  264|   259M|                secp256k1_gej_add_ge(r, r, &add);
  265|   259M|            }
  266|   265M|        }
  267|       |
  268|       |        /* Double the result, except in the last iteration. */
  269|  6.17M|        if (comb_off-- == 0) break;
  ------------------
  |  Branch (269:13): [True: 6.17M, False: 0]
  ------------------
  270|      0|        secp256k1_gej_double(r, r);
  271|      0|    }
  272|       |
  273|       |    /* Correct for the scalar_offset added at the start (ge_offset = b*G, while b was
  274|       |     * subtracted from the input scalar gn). */
  275|  6.17M|    secp256k1_gej_add_ge(r, r, &ctx->ge_offset);
  276|       |
  277|       |    /* Cleanup. */
  278|  6.17M|    secp256k1_fe_clear(&neg);
  279|  6.17M|    secp256k1_ge_clear(&add);
  280|  6.17M|    secp256k1_memclear_explicit(&adds, sizeof(adds));
  281|  6.17M|    secp256k1_memclear_explicit(&recoded, sizeof(recoded));
  282|  6.17M|}
secp256k1.c:secp256k1_ecmult_gen_ge:
  284|  6.17M|SECP256K1_INLINE static void secp256k1_ecmult_gen_ge(const secp256k1_ecmult_gen_context *ctx, secp256k1_ge *r, const secp256k1_scalar *a) {
  285|  6.17M|    secp256k1_gej rj;
  286|  6.17M|    secp256k1_ecmult_gen_gej(ctx, &rj, a);
  287|  6.17M|    secp256k1_ge_set_gej(r, &rj);
  288|       |    /* Jacobian coordinates resulting from our multiplication algorithm could potentially leak
  289|       |     * information about the secret input scalar, so clear the memory out to be on the safe side. */
  290|  6.17M|    secp256k1_gej_clear(&rj);
  291|  6.17M|}

secp256k1.c:secp256k1_ecmult:
  365|   864k|static void secp256k1_ecmult(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_scalar *na, const secp256k1_scalar *ng) {
  366|   864k|    secp256k1_fe aux[ECMULT_TABLE_SIZE(WINDOW_A)];
  367|   864k|    secp256k1_ge pre_a[ECMULT_TABLE_SIZE(WINDOW_A)];
  368|   864k|    struct secp256k1_strauss_point_state ps[1];
  369|   864k|    struct secp256k1_strauss_state state;
  370|       |
  371|   864k|    state.aux = aux;
  372|   864k|    state.pre_a = pre_a;
  373|   864k|    state.ps = ps;
  374|   864k|    secp256k1_ecmult_strauss_wnaf(&state, r, 1, a, na, ng);
  375|   864k|}
secp256k1.c:secp256k1_ecmult_strauss_wnaf:
  252|   864k|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|   864k|    secp256k1_ge tmpa;
  254|   864k|    secp256k1_fe Z;
  255|       |    /* Split G factors. */
  256|   864k|    secp256k1_scalar ng_1, ng_128;
  257|   864k|    int wnaf_ng_1[129];
  258|   864k|    int bits_ng_1 = 0;
  259|   864k|    int wnaf_ng_128[129];
  260|   864k|    int bits_ng_128 = 0;
  261|   864k|    int i;
  262|   864k|    int bits = 0;
  263|   864k|    size_t np;
  264|   864k|    size_t no = 0;
  265|       |
  266|   864k|    secp256k1_fe_set_int(&Z, 1);
  ------------------
  |  |   83|   864k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  267|  1.72M|    for (np = 0; np < num; ++np) {
  ------------------
  |  Branch (267:18): [True: 864k, False: 864k]
  ------------------
  268|   864k|        secp256k1_gej tmp;
  269|   864k|        secp256k1_scalar na_1, na_lam;
  270|   864k|        if (secp256k1_scalar_is_zero(&na[np]) || secp256k1_gej_is_infinity(&a[np])) {
  ------------------
  |  Branch (270:13): [True: 61.5k, False: 802k]
  |  Branch (270:50): [True: 0, False: 802k]
  ------------------
  271|  61.5k|            continue;
  272|  61.5k|        }
  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|   802k|        secp256k1_scalar_split_lambda(&na_1, &na_lam, &na[np]);
  275|       |
  276|       |        /* build wnaf representation for na_1 and na_lam. */
  277|   802k|        state->ps[no].bits_na_1   = secp256k1_ecmult_wnaf_small(state->ps[no].wnaf_na_1,   129, &na_1,   WINDOW_A);
  ------------------
  |  |   32|   802k|#  define WINDOW_A 5
  ------------------
  278|   802k|        state->ps[no].bits_na_lam = secp256k1_ecmult_wnaf_small(state->ps[no].wnaf_na_lam, 129, &na_lam, WINDOW_A);
  ------------------
  |  |   32|   802k|#  define WINDOW_A 5
  ------------------
  279|   802k|        VERIFY_CHECK(state->ps[no].bits_na_1 <= 129);
  280|   802k|        VERIFY_CHECK(state->ps[no].bits_na_lam <= 129);
  281|   802k|        if (state->ps[no].bits_na_1 > bits) {
  ------------------
  |  Branch (281:13): [True: 802k, False: 0]
  ------------------
  282|   802k|            bits = state->ps[no].bits_na_1;
  283|   802k|        }
  284|   802k|        if (state->ps[no].bits_na_lam > bits) {
  ------------------
  |  Branch (284:13): [True: 188k, False: 614k]
  ------------------
  285|   188k|            bits = state->ps[no].bits_na_lam;
  286|   188k|        }
  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|   802k|        tmp = a[np];
  299|   802k|        if (no) {
  ------------------
  |  Branch (299:13): [True: 0, False: 802k]
  ------------------
  300|      0|            secp256k1_gej_rescale(&tmp, &Z);
  301|      0|        }
  302|   802k|        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|   802k|#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|   802k|#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|   802k|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
  303|   802k|        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: 802k]
  ------------------
  304|       |
  305|   802k|        ++no;
  306|   802k|    }
  307|       |
  308|       |    /* Bring them to the same Z denominator. */
  309|   864k|    if (no) {
  ------------------
  |  Branch (309:9): [True: 802k, False: 61.5k]
  ------------------
  310|   802k|        secp256k1_ge_table_set_globalz(ECMULT_TABLE_SIZE(WINDOW_A) * no, state->pre_a, state->aux);
  ------------------
  |  |   41|   802k|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
  311|   802k|    }
  312|       |
  313|  1.66M|    for (np = 0; np < no; ++np) {
  ------------------
  |  Branch (313:18): [True: 802k, False: 864k]
  ------------------
  314|   802k|        size_t j;
  315|  7.22M|        for (j = 0; j < ECMULT_TABLE_SIZE(WINDOW_A); j++) {
  ------------------
  |  |   41|  7.22M|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
  |  Branch (315:21): [True: 6.42M, False: 802k]
  ------------------
  316|  6.42M|            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|  6.42M|#  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|  6.42M|#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|  6.42M|#define ECMULT_TABLE_SIZE(w) ((size_t)1 << ((w)-2))
  ------------------
  317|  6.42M|        }
  318|   802k|    }
  319|       |
  320|   864k|    if (ng) {
  ------------------
  |  Branch (320:9): [True: 269k, False: 594k]
  ------------------
  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|   269k|        secp256k1_scalar_split_128(&ng_1, &ng_128, ng);
  323|       |
  324|       |        /* Build wnaf representation for ng_1 and ng_128 */
  325|   269k|        bits_ng_1   = secp256k1_ecmult_wnaf(wnaf_ng_1,   129, &ng_1,   WINDOW_G);
  ------------------
  |  |   31|   269k|#    define WINDOW_G ECMULT_WINDOW_SIZE
  ------------------
  326|   269k|        bits_ng_128 = secp256k1_ecmult_wnaf(wnaf_ng_128, 129, &ng_128, WINDOW_G);
  ------------------
  |  |   31|   269k|#    define WINDOW_G ECMULT_WINDOW_SIZE
  ------------------
  327|   269k|        if (bits_ng_1 > bits) {
  ------------------
  |  Branch (327:13): [True: 269k, False: 0]
  ------------------
  328|   269k|            bits = bits_ng_1;
  329|   269k|        }
  330|   269k|        if (bits_ng_128 > bits) {
  ------------------
  |  Branch (330:13): [True: 146k, False: 122k]
  ------------------
  331|   146k|            bits = bits_ng_128;
  332|   146k|        }
  333|   269k|    }
  334|       |
  335|   864k|    secp256k1_gej_set_infinity(r);
  336|       |
  337|  95.4M|    for (i = bits - 1; i >= 0; i--) {
  ------------------
  |  Branch (337:24): [True: 94.6M, False: 864k]
  ------------------
  338|  94.6M|        int n;
  339|  94.6M|        secp256k1_gej_double_var(r, r, NULL);
  340|   189M|        for (np = 0; np < no; ++np) {
  ------------------
  |  Branch (340:22): [True: 94.6M, False: 94.6M]
  ------------------
  341|  94.6M|            if (i < state->ps[np].bits_na_1 && (n = state->ps[np].wnaf_na_1[i])) {
  ------------------
  |  Branch (341:17): [True: 60.6M, False: 34.0M]
  |  Branch (341:48): [True: 10.7M, False: 49.8M]
  ------------------
  342|  10.7M|                secp256k1_ecmult_table_get_ge(&tmpa, state->pre_a + np * ECMULT_TABLE_SIZE(WINDOW_A), n, WINDOW_A);
  ------------------
  |  |   41|  10.7M|#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|  10.7M|#  define WINDOW_A 5
  ------------------
  343|  10.7M|                secp256k1_gej_add_ge_var(r, r, &tmpa, NULL);
  344|  10.7M|            }
  345|  94.6M|            if (i < state->ps[np].bits_na_lam && (n = state->ps[np].wnaf_na_lam[i])) {
  ------------------
  |  Branch (345:17): [True: 60.1M, False: 34.4M]
  |  Branch (345:50): [True: 10.3M, False: 49.7M]
  ------------------
  346|  10.3M|                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|  10.3M|#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|  10.3M|#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|  10.3M|#  define WINDOW_A 5
  ------------------
  347|  10.3M|                secp256k1_gej_add_ge_var(r, r, &tmpa, NULL);
  348|  10.3M|            }
  349|  94.6M|        }
  350|  94.6M|        if (i < bits_ng_1 && (n = wnaf_ng_1[i])) {
  ------------------
  |  Branch (350:13): [True: 32.5M, False: 62.0M]
  |  Branch (350:30): [True: 2.27M, False: 30.3M]
  ------------------
  351|  2.27M|            secp256k1_ecmult_table_get_ge_storage(&tmpa, secp256k1_pre_g, n, WINDOW_G);
  ------------------
  |  |   31|  2.27M|#    define WINDOW_G ECMULT_WINDOW_SIZE
  ------------------
  352|  2.27M|            secp256k1_gej_add_zinv_var(r, r, &tmpa, &Z);
  353|  2.27M|        }
  354|  94.6M|        if (i < bits_ng_128 && (n = wnaf_ng_128[i])) {
  ------------------
  |  Branch (354:13): [True: 32.9M, False: 61.6M]
  |  Branch (354:32): [True: 2.30M, False: 30.6M]
  ------------------
  355|  2.30M|            secp256k1_ecmult_table_get_ge_storage(&tmpa, secp256k1_pre_g_128, n, WINDOW_G);
  ------------------
  |  |   31|  2.30M|#    define WINDOW_G ECMULT_WINDOW_SIZE
  ------------------
  356|  2.30M|            secp256k1_gej_add_zinv_var(r, r, &tmpa, &Z);
  357|  2.30M|        }
  358|  94.6M|    }
  359|       |
  360|   864k|    if (!secp256k1_gej_is_infinity(r)) {
  ------------------
  |  Branch (360:9): [True: 802k, False: 61.5k]
  ------------------
  361|   802k|        secp256k1_fe_mul(&r->z, &r->z, &Z);
  ------------------
  |  |   93|   802k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  362|   802k|    }
  363|   864k|}
secp256k1.c:secp256k1_ecmult_wnaf_small:
  224|  1.60M|static int secp256k1_ecmult_wnaf_small(int8_t *wnaf, int len, const secp256k1_scalar *a, int w) {
  225|  1.60M|    int wnaf_tmp[256];
  226|  1.60M|    int ret, i;
  227|       |
  228|  1.60M|    VERIFY_CHECK(2 <= w && w <= 8);
  229|  1.60M|    ret = secp256k1_ecmult_wnaf(wnaf_tmp, len, a, w);
  230|       |
  231|   208M|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (231:17): [True: 207M, False: 1.60M]
  ------------------
  232|   207M|        wnaf[i] = (int8_t)wnaf_tmp[i];
  233|   207M|    }
  234|       |
  235|  1.60M|    return ret;
  236|  1.60M|}
secp256k1.c:secp256k1_ecmult_odd_multiples_table:
   73|   802k|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|   802k|    secp256k1_gej d, ai;
   75|   802k|    secp256k1_ge d_ge;
   76|   802k|    size_t i;
   77|       |
   78|   802k|    VERIFY_CHECK(!secp256k1_gej_is_infinity(a));
   79|       |
   80|   802k|    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|   802k|    secp256k1_ge_set_xy(&d_ge, &d.x, &d.y);
   96|   802k|    secp256k1_ge_set_gej_zinv(&pre_a[0], a, &d.z);
   97|   802k|    secp256k1_gej_set_ge(&ai, &pre_a[0]);
   98|   802k|    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|   802k|    zr[0] = d.z;
  104|       |
  105|  6.42M|    for (i = 1; i < n; i++) {
  ------------------
  |  Branch (105:17): [True: 5.62M, False: 802k]
  ------------------
  106|  5.62M|        secp256k1_gej_add_ge_var(&ai, &ai, &d_ge, &zr[i]);
  107|  5.62M|        secp256k1_ge_set_xy(&pre_a[i], &ai.x, &ai.y);
  108|  5.62M|    }
  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|   802k|    secp256k1_fe_mul(z, &ai.z, &d.z);
  ------------------
  |  |   93|   802k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  115|   802k|}
secp256k1.c:secp256k1_ecmult_wnaf:
  162|  2.14M|static int secp256k1_ecmult_wnaf(int *wnaf, int len, const secp256k1_scalar *a, int w) {
  163|  2.14M|    secp256k1_scalar s;
  164|  2.14M|    int last_set_bit = -1;
  165|  2.14M|    int bit = 0;
  166|  2.14M|    int sign = 1;
  167|  2.14M|    int carry = 0;
  168|       |
  169|  2.14M|    VERIFY_CHECK(wnaf != NULL);
  170|  2.14M|    VERIFY_CHECK(0 <= len && len <= 256);
  171|  2.14M|    VERIFY_CHECK(a != NULL);
  172|  2.14M|    VERIFY_CHECK(2 <= w && w <= 31);
  173|       |
  174|   278M|    for (bit = 0; bit < len; bit++) {
  ------------------
  |  Branch (174:19): [True: 276M, False: 2.14M]
  ------------------
  175|   276M|        wnaf[bit] = 0;
  176|   276M|    }
  177|       |
  178|  2.14M|    s = *a;
  179|  2.14M|    if (secp256k1_scalar_get_bits_limb32(&s, 255, 1)) {
  ------------------
  |  Branch (179:9): [True: 479k, False: 1.66M]
  ------------------
  180|   479k|        secp256k1_scalar_negate(&s, &s);
  181|   479k|        sign = -1;
  182|   479k|    }
  183|       |
  184|  2.14M|    bit = 0;
  185|   134M|    while (bit < len) {
  ------------------
  |  Branch (185:12): [True: 132M, False: 2.14M]
  ------------------
  186|   132M|        int now;
  187|   132M|        int word;
  188|   132M|        if (secp256k1_scalar_get_bits_limb32(&s, bit, 1) == (unsigned int)carry) {
  ------------------
  |  Branch (188:13): [True: 107M, False: 25.6M]
  ------------------
  189|   107M|            bit++;
  190|   107M|            continue;
  191|   107M|        }
  192|       |
  193|  25.6M|        now = w;
  194|  25.6M|        if (now > len - bit) {
  ------------------
  |  Branch (194:13): [True: 908k, False: 24.7M]
  ------------------
  195|   908k|            now = len - bit;
  196|   908k|        }
  197|       |
  198|  25.6M|        word = secp256k1_scalar_get_bits_var(&s, bit, now) + carry;
  199|       |
  200|  25.6M|        carry = (word >> (w-1)) & 1;
  201|  25.6M|        word -= carry << w;
  202|       |
  203|  25.6M|        wnaf[bit] = sign * word;
  204|  25.6M|        last_set_bit = bit;
  205|       |
  206|  25.6M|        bit += now;
  207|  25.6M|    }
  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|  2.14M|    return last_set_bit + 1;
  221|  2.14M|}
secp256k1.c:secp256k1_ecmult_table_get_ge:
  125|  10.7M|SECP256K1_INLINE static void secp256k1_ecmult_table_get_ge(secp256k1_ge *r, const secp256k1_ge *pre, int n, int w) {
  126|  10.7M|    secp256k1_ecmult_table_verify(n,w);
  127|  10.7M|    if (n > 0) {
  ------------------
  |  Branch (127:9): [True: 5.53M, False: 5.18M]
  ------------------
  128|  5.53M|        *r = pre[(n-1)/2];
  129|  5.53M|    } else {
  130|  5.18M|        *r = pre[(-n-1)/2];
  131|  5.18M|        secp256k1_fe_negate(&(r->y), &(r->y), 1);
  ------------------
  |  |  211|  5.18M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  5.18M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  5.18M|    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: 5.18M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  5.18M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 5.18M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  5.18M|    } \
  |  |  |  |   94|  5.18M|    stmt; \
  |  |  |  |   95|  5.18M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 5.18M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  132|  5.18M|    }
  133|  10.7M|}
secp256k1.c:secp256k1_ecmult_table_verify:
  117|  25.6M|SECP256K1_INLINE static void secp256k1_ecmult_table_verify(int n, int w) {
  118|  25.6M|    (void)n;
  119|  25.6M|    (void)w;
  120|  25.6M|    VERIFY_CHECK(((n) & 1) == 1);
  121|  25.6M|    VERIFY_CHECK((n) >= -((1 << ((w)-1)) - 1));
  122|  25.6M|    VERIFY_CHECK((n) <=  ((1 << ((w)-1)) - 1));
  123|  25.6M|}
secp256k1.c:secp256k1_ecmult_table_get_ge_lambda:
  135|  10.3M|SECP256K1_INLINE static void secp256k1_ecmult_table_get_ge_lambda(secp256k1_ge *r, const secp256k1_ge *pre, const secp256k1_fe *x, int n, int w) {
  136|  10.3M|    secp256k1_ecmult_table_verify(n,w);
  137|  10.3M|    if (n > 0) {
  ------------------
  |  Branch (137:9): [True: 5.20M, False: 5.17M]
  ------------------
  138|  5.20M|        secp256k1_ge_set_xy(r, &x[(n-1)/2], &pre[(n-1)/2].y);
  139|  5.20M|    } else {
  140|  5.17M|        secp256k1_ge_set_xy(r, &x[(-n-1)/2], &pre[(-n-1)/2].y);
  141|  5.17M|        secp256k1_fe_negate(&(r->y), &(r->y), 1);
  ------------------
  |  |  211|  5.17M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  5.17M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  5.17M|    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: 5.17M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  5.17M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 5.17M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  5.17M|    } \
  |  |  |  |   94|  5.17M|    stmt; \
  |  |  |  |   95|  5.17M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 5.17M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  142|  5.17M|    }
  143|  10.3M|}
secp256k1.c:secp256k1_ecmult_table_get_ge_storage:
  145|  4.58M|SECP256K1_INLINE static void secp256k1_ecmult_table_get_ge_storage(secp256k1_ge *r, const secp256k1_ge_storage *pre, int n, int w) {
  146|  4.58M|    secp256k1_ecmult_table_verify(n,w);
  147|  4.58M|    if (n > 0) {
  ------------------
  |  Branch (147:9): [True: 2.59M, False: 1.99M]
  ------------------
  148|  2.59M|        secp256k1_ge_from_storage(r, &pre[(n-1)/2]);
  149|  2.59M|    } else {
  150|  1.99M|        secp256k1_ge_from_storage(r, &pre[(-n-1)/2]);
  151|  1.99M|        secp256k1_fe_negate(&(r->y), &(r->y), 1);
  ------------------
  |  |  211|  1.99M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  1.99M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  1.99M|    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.99M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  1.99M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 1.99M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  1.99M|    } \
  |  |  |  |   94|  1.99M|    stmt; \
  |  |  |  |   95|  1.99M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 1.99M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  152|  1.99M|    }
  153|  4.58M|}
secp256k1.c:secp256k1_ecmult_multi_var:
  823|  61.5k|static int secp256k1_ecmult_multi_var(const secp256k1_callback* error_callback, secp256k1_scratch *scratch, secp256k1_gej *r, const secp256k1_scalar *inp_g_sc, secp256k1_ecmult_multi_callback cb, void *cbdata, size_t n) {
  824|  61.5k|    size_t i;
  825|       |
  826|  61.5k|    int (*f)(const secp256k1_callback* error_callback, secp256k1_scratch*, secp256k1_gej*, const secp256k1_scalar*, secp256k1_ecmult_multi_callback cb, void*, size_t, size_t);
  827|  61.5k|    size_t n_batches;
  828|  61.5k|    size_t n_batch_points;
  829|       |
  830|  61.5k|    secp256k1_gej_set_infinity(r);
  831|  61.5k|    if (inp_g_sc == NULL && n == 0) {
  ------------------
  |  Branch (831:9): [True: 61.5k, False: 0]
  |  Branch (831:29): [True: 0, False: 61.5k]
  ------------------
  832|      0|        return 1;
  833|  61.5k|    } else if (n == 0) {
  ------------------
  |  Branch (833:16): [True: 0, False: 61.5k]
  ------------------
  834|      0|        secp256k1_ecmult(r, r, &secp256k1_scalar_zero, inp_g_sc);
  835|      0|        return 1;
  836|      0|    }
  837|  61.5k|    if (scratch == NULL) {
  ------------------
  |  Branch (837:9): [True: 61.5k, False: 0]
  ------------------
  838|  61.5k|        return secp256k1_ecmult_multi_simple_var(r, inp_g_sc, cb, cbdata, n);
  839|  61.5k|    }
  840|       |
  841|       |    /* Compute the batch sizes for Pippenger's algorithm given a scratch space. If it's greater than
  842|       |     * a threshold use Pippenger's algorithm. Otherwise use Strauss' algorithm.
  843|       |     * As a first step check if there's enough space for Pippenger's algo (which requires less space
  844|       |     * than Strauss' algo) and if not, use the simple algorithm. */
  845|      0|    if (!secp256k1_ecmult_multi_batch_size_helper(&n_batches, &n_batch_points, secp256k1_pippenger_max_points(error_callback, scratch), n)) {
  ------------------
  |  Branch (845:9): [True: 0, False: 0]
  ------------------
  846|      0|        return secp256k1_ecmult_multi_simple_var(r, inp_g_sc, cb, cbdata, n);
  847|      0|    }
  848|      0|    if (n_batch_points >= ECMULT_PIPPENGER_THRESHOLD) {
  ------------------
  |  |   55|      0|#define ECMULT_PIPPENGER_THRESHOLD 88
  ------------------
  |  Branch (848:9): [True: 0, False: 0]
  ------------------
  849|      0|        f = secp256k1_ecmult_pippenger_batch;
  850|      0|    } else {
  851|      0|        if (!secp256k1_ecmult_multi_batch_size_helper(&n_batches, &n_batch_points, secp256k1_strauss_max_points(error_callback, scratch), n)) {
  ------------------
  |  Branch (851:13): [True: 0, False: 0]
  ------------------
  852|      0|            return secp256k1_ecmult_multi_simple_var(r, inp_g_sc, cb, cbdata, n);
  853|      0|        }
  854|      0|        f = secp256k1_ecmult_strauss_batch;
  855|      0|    }
  856|      0|    for(i = 0; i < n_batches; i++) {
  ------------------
  |  Branch (856:16): [True: 0, False: 0]
  ------------------
  857|      0|        size_t nbp = n < n_batch_points ? n : n_batch_points;
  ------------------
  |  Branch (857:22): [True: 0, False: 0]
  ------------------
  858|      0|        size_t offset = n_batch_points*i;
  859|      0|        secp256k1_gej tmp;
  860|      0|        if (!f(error_callback, scratch, &tmp, i == 0 ? inp_g_sc : NULL, cb, cbdata, nbp, offset)) {
  ------------------
  |  Branch (860:13): [True: 0, False: 0]
  |  Branch (860:47): [True: 0, False: 0]
  ------------------
  861|      0|            return 0;
  862|      0|        }
  863|      0|        secp256k1_gej_add_var(r, r, &tmp, NULL);
  864|      0|        n -= nbp;
  865|      0|    }
  866|      0|    return 1;
  867|      0|}
secp256k1.c:secp256k1_ecmult_multi_simple_var:
  779|  61.5k|static int secp256k1_ecmult_multi_simple_var(secp256k1_gej *r, const secp256k1_scalar *inp_g_sc, secp256k1_ecmult_multi_callback cb, void *cbdata, size_t n_points) {
  780|  61.5k|    size_t point_idx;
  781|  61.5k|    secp256k1_gej tmpj;
  782|       |
  783|  61.5k|    secp256k1_gej_set_infinity(r);
  784|  61.5k|    secp256k1_gej_set_infinity(&tmpj);
  785|       |    /* r = inp_g_sc*G */
  786|  61.5k|    secp256k1_ecmult(r, &tmpj, &secp256k1_scalar_zero, inp_g_sc);
  787|   594k|    for (point_idx = 0; point_idx < n_points; point_idx++) {
  ------------------
  |  Branch (787:25): [True: 533k, False: 61.5k]
  ------------------
  788|   533k|        secp256k1_ge point;
  789|   533k|        secp256k1_gej pointj;
  790|   533k|        secp256k1_scalar scalar;
  791|   533k|        if (!cb(&scalar, &point, point_idx, cbdata)) {
  ------------------
  |  Branch (791:13): [True: 0, False: 533k]
  ------------------
  792|      0|            return 0;
  793|      0|        }
  794|       |        /* r += scalar*point */
  795|   533k|        secp256k1_gej_set_ge(&pointj, &point);
  796|   533k|        secp256k1_ecmult(&tmpj, &pointj, &scalar, NULL);
  797|   533k|        secp256k1_gej_add_var(r, r, &tmpj, NULL);
  798|   533k|    }
  799|  61.5k|    return 1;
  800|  61.5k|}

secp256k1.c:secp256k1_fe_impl_sqr:
  317|  2.06G|SECP256K1_FORCE_INLINE static void secp256k1_fe_impl_sqr(secp256k1_fe *r, const secp256k1_fe *a) {
  318|  2.06G|    secp256k1_fe_sqr_inner(r->n, a->n);
  319|  2.06G|}
secp256k1.c:secp256k1_fe_impl_mul:
  313|  2.48G|SECP256K1_FORCE_INLINE static void secp256k1_fe_impl_mul(secp256k1_fe *r, const secp256k1_fe *a, const secp256k1_fe * SECP256K1_RESTRICT b) {
  314|  2.48G|    secp256k1_fe_mul_inner(r->n, a->n, b->n);
  315|  2.48G|}
secp256k1.c:secp256k1_fe_impl_add_int:
  301|   958k|SECP256K1_INLINE static void secp256k1_fe_impl_add_int(secp256k1_fe *r, int a) {
  302|   958k|    r->n[0] += a;
  303|   958k|}
secp256k1.c:secp256k1_fe_impl_is_zero:
  206|  7.95M|SECP256K1_INLINE static int secp256k1_fe_impl_is_zero(const secp256k1_fe *a) {
  207|  7.95M|    const uint64_t *t = a->n;
  208|  7.95M|    return (t[0] | t[1] | t[2] | t[3] | t[4]) == 0;
  209|  7.95M|}
secp256k1.c:secp256k1_fe_impl_add:
  305|  2.45G|SECP256K1_INLINE static void secp256k1_fe_impl_add(secp256k1_fe *r, const secp256k1_fe *a) {
  306|  2.45G|    r->n[0] += a->n[0];
  307|  2.45G|    r->n[1] += a->n[1];
  308|  2.45G|    r->n[2] += a->n[2];
  309|  2.45G|    r->n[3] += a->n[3];
  310|  2.45G|    r->n[4] += a->n[4];
  311|  2.45G|}
secp256k1.c:secp256k1_fe_impl_normalize_weak:
   80|  1.36M|static void secp256k1_fe_impl_normalize_weak(secp256k1_fe *r) {
   81|  1.36M|    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|  1.36M|    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;
   85|       |
   86|       |    /* The first pass ensures the magnitude is 1, ... */
   87|  1.36M|    t0 += x * 0x1000003D1ULL;
   88|  1.36M|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;
   89|  1.36M|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL;
   90|  1.36M|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL;
   91|  1.36M|    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|  1.36M|    VERIFY_CHECK(t4 >> 49 == 0);
   95|       |
   96|  1.36M|    r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;
   97|  1.36M|}
secp256k1.c:secp256k1_fe_impl_negate_unchecked:
  278|  1.35G|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.35G|    VERIFY_CHECK(0xFFFFEFFFFFC2FULL * 2 * (m + 1) >= 0xFFFFFFFFFFFFFULL * 2 * m);
  281|  1.35G|    VERIFY_CHECK(0xFFFFFFFFFFFFFULL * 2 * (m + 1) >= 0xFFFFFFFFFFFFFULL * 2 * m);
  282|  1.35G|    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.35G|    r->n[0] = 0xFFFFEFFFFFC2FULL * 2 * (m + 1) - a->n[0];
  287|  1.35G|    r->n[1] = 0xFFFFFFFFFFFFFULL * 2 * (m + 1) - a->n[1];
  288|  1.35G|    r->n[2] = 0xFFFFFFFFFFFFFULL * 2 * (m + 1) - a->n[2];
  289|  1.35G|    r->n[3] = 0xFFFFFFFFFFFFFULL * 2 * (m + 1) - a->n[3];
  290|  1.35G|    r->n[4] = 0x0FFFFFFFFFFFFULL * 2 * (m + 1) - a->n[4];
  291|  1.35G|}
secp256k1.c:secp256k1_fe_impl_cmov:
  321|  1.85G|SECP256K1_INLINE static void secp256k1_fe_impl_cmov(secp256k1_fe *r, const secp256k1_fe *a, int flag) {
  322|  1.85G|    uint64_t mask0, mask1;
  323|  1.85G|    volatile int vflag = flag;
  324|  1.85G|    VERIFY_CHECK(flag == 0 || flag == 1);
  325|  1.85G|    SECP256K1_CHECKMEM_CHECK_VERIFY(r->n, sizeof(r->n));
  ------------------
  |  |  114|  1.85G|#define SECP256K1_CHECKMEM_CHECK_VERIFY(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  1.85G|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 1.85G]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  326|  1.85G|    mask0 = vflag + ~((uint64_t)0);
  327|  1.85G|    mask1 = ~mask0;
  328|  1.85G|    r->n[0] = (r->n[0] & mask0) | (a->n[0] & mask1);
  329|  1.85G|    r->n[1] = (r->n[1] & mask0) | (a->n[1] & mask1);
  330|  1.85G|    r->n[2] = (r->n[2] & mask0) | (a->n[2] & mask1);
  331|  1.85G|    r->n[3] = (r->n[3] & mask0) | (a->n[3] & mask1);
  332|  1.85G|    r->n[4] = (r->n[4] & mask0) | (a->n[4] & mask1);
  333|  1.85G|}
secp256k1.c:secp256k1_fe_impl_normalizes_to_zero:
  137|   532M|static int secp256k1_fe_impl_normalizes_to_zero(const secp256k1_fe *r) {
  138|   532M|    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|   532M|    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|   532M|    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;
  145|       |
  146|       |    /* The first pass ensures the magnitude is 1, ... */
  147|   532M|    t0 += x * 0x1000003D1ULL;
  148|   532M|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL; z0  = t0; z1  = t0 ^ 0x1000003D0ULL;
  149|   532M|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; z0 |= t1; z1 &= t1;
  150|   532M|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; z0 |= t2; z1 &= t2;
  151|   532M|    t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL; z0 |= t3; z1 &= t3;
  152|   532M|                                                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|   532M|    VERIFY_CHECK(t4 >> 49 == 0);
  156|       |
  157|   532M|    return (z0 == 0) | (z1 == 0xFFFFFFFFFFFFFULL);
  158|   532M|}
secp256k1.c:secp256k1_fe_impl_set_int:
  201|  21.6M|SECP256K1_INLINE static void secp256k1_fe_impl_set_int(secp256k1_fe *r, int a) {
  202|  21.6M|    r->n[0] = a;
  203|  21.6M|    r->n[1] = r->n[2] = r->n[3] = r->n[4] = 0;
  204|  21.6M|}
secp256k1.c:secp256k1_fe_impl_mul_int_unchecked:
  293|   625M|SECP256K1_INLINE static void secp256k1_fe_impl_mul_int_unchecked(secp256k1_fe *r, int a) {
  294|   625M|    r->n[0] *= a;
  295|   625M|    r->n[1] *= a;
  296|   625M|    r->n[2] *= a;
  297|   625M|    r->n[3] *= a;
  298|   625M|    r->n[4] *= a;
  299|   625M|}
secp256k1.c:secp256k1_fe_impl_half:
  335|   360M|static SECP256K1_INLINE void secp256k1_fe_impl_half(secp256k1_fe *r) {
  336|   360M|    uint64_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4];
  337|   360M|    uint64_t one = (uint64_t)1;
  338|   360M|    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|   360M|    t0 += 0xFFFFEFFFFFC2FULL & mask;
  351|   360M|    t1 += mask;
  352|   360M|    t2 += mask;
  353|   360M|    t3 += mask;
  354|   360M|    t4 += mask >> 4;
  355|       |
  356|   360M|    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|   360M|    r->n[0] = (t0 >> 1) + ((t1 & one) << 51);
  366|   360M|    r->n[1] = (t1 >> 1) + ((t2 & one) << 51);
  367|   360M|    r->n[2] = (t2 >> 1) + ((t3 & one) << 51);
  368|   360M|    r->n[3] = (t3 >> 1) + ((t4 & one) << 51);
  369|   360M|    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|   360M|}
secp256k1.c:secp256k1_fe_impl_inv:
  453|  6.50M|static void secp256k1_fe_impl_inv(secp256k1_fe *r, const secp256k1_fe *x) {
  454|  6.50M|    secp256k1_fe tmp = *x;
  455|  6.50M|    secp256k1_modinv64_signed62 s;
  456|       |
  457|  6.50M|    secp256k1_fe_normalize(&tmp);
  ------------------
  |  |   78|  6.50M|#  define secp256k1_fe_normalize secp256k1_fe_impl_normalize
  ------------------
  458|  6.50M|    secp256k1_fe_to_signed62(&s, &tmp);
  459|  6.50M|    secp256k1_modinv64(&s, &secp256k1_const_modinfo_fe);
  460|  6.50M|    secp256k1_fe_from_signed62(r, &s);
  461|  6.50M|}
secp256k1.c:secp256k1_fe_to_signed62:
  437|  6.50M|static void secp256k1_fe_to_signed62(secp256k1_modinv64_signed62 *r, const secp256k1_fe *a) {
  438|  6.50M|    const uint64_t M62 = UINT64_MAX >> 2;
  439|  6.50M|    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|  6.50M|    r->v[0] = (a0       | a1 << 52) & M62;
  442|  6.50M|    r->v[1] = (a1 >> 10 | a2 << 42) & M62;
  443|  6.50M|    r->v[2] = (a2 >> 20 | a3 << 32) & M62;
  444|  6.50M|    r->v[3] = (a3 >> 30 | a4 << 22) & M62;
  445|  6.50M|    r->v[4] =  a4 >> 40;
  446|  6.50M|}
secp256k1.c:secp256k1_fe_from_signed62:
  417|  6.50M|static void secp256k1_fe_from_signed62(secp256k1_fe *r, const secp256k1_modinv64_signed62 *a) {
  418|  6.50M|    const uint64_t M52 = UINT64_MAX >> 12;
  419|  6.50M|    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|  6.50M|    VERIFY_CHECK(a0 >> 62 == 0);
  425|  6.50M|    VERIFY_CHECK(a1 >> 62 == 0);
  426|  6.50M|    VERIFY_CHECK(a2 >> 62 == 0);
  427|  6.50M|    VERIFY_CHECK(a3 >> 62 == 0);
  428|  6.50M|    VERIFY_CHECK(a4 >> 8 == 0);
  429|       |
  430|  6.50M|    r->n[0] =  a0                   & M52;
  431|  6.50M|    r->n[1] = (a0 >> 52 | a1 << 10) & M52;
  432|  6.50M|    r->n[2] = (a1 >> 42 | a2 << 20) & M52;
  433|  6.50M|    r->n[3] = (a2 >> 32 | a3 << 30) & M52;
  434|  6.50M|    r->n[4] = (a3 >> 22 | a4 << 40);
  435|  6.50M|}
secp256k1.c:secp256k1_fe_impl_set_b32_limit:
  265|   958k|static int secp256k1_fe_impl_set_b32_limit(secp256k1_fe *r, const unsigned char *a) {
  266|   958k|    secp256k1_fe_impl_set_b32_mod(r, a);
  267|   958k|    return !((r->n[4] == 0x0FFFFFFFFFFFFULL) & ((r->n[3] & r->n[2] & r->n[1]) == 0xFFFFFFFFFFFFFULL) & (r->n[0] >= 0xFFFFEFFFFFC2FULL));
  268|   958k|}
secp256k1.c:secp256k1_fe_impl_get_b32:
  271|  7.51M|static void secp256k1_fe_impl_get_b32(unsigned char *r, const secp256k1_fe *a) {
  272|  7.51M|    secp256k1_write_be64(&r[0], (a->n[4] << 16) | (a->n[3] >> 36));
  273|  7.51M|    secp256k1_write_be64(&r[8], (a->n[3] << 28) | (a->n[2] >> 24));
  274|  7.51M|    secp256k1_write_be64(&r[16], (a->n[2] << 40) | (a->n[1] >> 12));
  275|  7.51M|    secp256k1_write_be64(&r[24], (a->n[1] << 52) | a->n[0]);
  276|  7.51M|}
secp256k1.c:secp256k1_fe_impl_normalize_var:
   99|  15.9M|static void secp256k1_fe_impl_normalize_var(secp256k1_fe *r) {
  100|  15.9M|    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|  15.9M|    uint64_t m;
  104|  15.9M|    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;
  105|       |
  106|       |    /* The first pass ensures the magnitude is 1, ... */
  107|  15.9M|    t0 += x * 0x1000003D1ULL;
  108|  15.9M|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;
  109|  15.9M|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; m = t1;
  110|  15.9M|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; m &= t2;
  111|  15.9M|    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|  15.9M|    VERIFY_CHECK(t4 >> 49 == 0);
  115|       |
  116|       |    /* At most a single final reduction is needed; check if the value is >= the field characteristic */
  117|  15.9M|    x = (t4 >> 48) | ((t4 == 0x0FFFFFFFFFFFFULL) & (m == 0xFFFFFFFFFFFFFULL)
  118|  15.9M|        & (t0 >= 0xFFFFEFFFFFC2FULL));
  119|       |
  120|  15.9M|    if (x) {
  ------------------
  |  Branch (120:9): [True: 2, False: 15.9M]
  ------------------
  121|      2|        t0 += 0x1000003D1ULL;
  122|      2|        t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;
  123|      2|        t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL;
  124|      2|        t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL;
  125|      2|        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|      2|        VERIFY_CHECK(t4 >> 48 == x);
  129|       |
  130|       |        /* Mask off the possible multiple of 2^256 from the final reduction */
  131|      2|        t4 &= 0x0FFFFFFFFFFFFULL;
  132|      2|    }
  133|       |
  134|  15.9M|    r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;
  135|  15.9M|}
secp256k1.c:secp256k1_fe_impl_is_odd:
  211|  8.47M|SECP256K1_INLINE static int secp256k1_fe_impl_is_odd(const secp256k1_fe *a) {
  212|  8.47M|    return a->n[0] & 1;
  213|  8.47M|}
secp256k1.c:secp256k1_fe_impl_from_storage:
  409|   556M|static SECP256K1_INLINE void secp256k1_fe_impl_from_storage(secp256k1_fe *r, const secp256k1_fe_storage *a) {
  410|   556M|    r->n[0] = a->n[0] & 0xFFFFFFFFFFFFFULL;
  411|   556M|    r->n[1] = a->n[0] >> 52 | ((a->n[1] << 12) & 0xFFFFFFFFFFFFFULL);
  412|   556M|    r->n[2] = a->n[1] >> 40 | ((a->n[2] << 24) & 0xFFFFFFFFFFFFFULL);
  413|   556M|    r->n[3] = a->n[2] >> 28 | ((a->n[3] << 36) & 0xFFFFFFFFFFFFFULL);
  414|   556M|    r->n[4] = a->n[3] >> 16;
  415|   556M|}
secp256k1.c:secp256k1_fe_impl_normalizes_to_zero_var:
  160|  30.9M|static int secp256k1_fe_impl_normalizes_to_zero_var(const secp256k1_fe *r) {
  161|  30.9M|    uint64_t t0, t1, t2, t3, t4;
  162|  30.9M|    uint64_t z0, z1;
  163|  30.9M|    uint64_t x;
  164|       |
  165|  30.9M|    t0 = r->n[0];
  166|  30.9M|    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|  30.9M|    x = t4 >> 48;
  170|       |
  171|       |    /* The first pass ensures the magnitude is 1, ... */
  172|  30.9M|    t0 += x * 0x1000003D1ULL;
  173|       |
  174|       |    /* z0 tracks a possible raw value of 0, z1 tracks a possible raw value of P */
  175|  30.9M|    z0 = t0 & 0xFFFFFFFFFFFFFULL;
  176|  30.9M|    z1 = z0 ^ 0x1000003D0ULL;
  177|       |
  178|       |    /* Fast return path should catch the majority of cases */
  179|  30.9M|    if ((z0 != 0ULL) & (z1 != 0xFFFFFFFFFFFFFULL)) {
  ------------------
  |  Branch (179:9): [True: 30.9M, False: 7.23k]
  ------------------
  180|  30.9M|        return 0;
  181|  30.9M|    }
  182|       |
  183|  7.23k|    t1 = r->n[1];
  184|  7.23k|    t2 = r->n[2];
  185|  7.23k|    t3 = r->n[3];
  186|       |
  187|  7.23k|    t4 &= 0x0FFFFFFFFFFFFULL;
  188|       |
  189|  7.23k|    t1 += (t0 >> 52);
  190|  7.23k|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; z0 |= t1; z1 &= t1;
  191|  7.23k|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; z0 |= t2; z1 &= t2;
  192|  7.23k|    t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL; z0 |= t3; z1 &= t3;
  193|  7.23k|                                                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|  7.23k|    VERIFY_CHECK(t4 >> 49 == 0);
  197|       |
  198|  7.23k|    return (z0 == 0) | (z1 == 0xFFFFFFFFFFFFFULL);
  199|  30.9M|}
secp256k1.c:secp256k1_fe_storage_cmov:
  389|  16.9G|static SECP256K1_INLINE void secp256k1_fe_storage_cmov(secp256k1_fe_storage *r, const secp256k1_fe_storage *a, int flag) {
  390|  16.9G|    uint64_t mask0, mask1;
  391|  16.9G|    volatile int vflag = flag;
  392|  16.9G|    VERIFY_CHECK(flag == 0 || flag == 1);
  393|  16.9G|    SECP256K1_CHECKMEM_CHECK_VERIFY(r->n, sizeof(r->n));
  ------------------
  |  |  114|  16.9G|#define SECP256K1_CHECKMEM_CHECK_VERIFY(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  16.9G|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 16.9G]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  394|  16.9G|    mask0 = vflag + ~((uint64_t)0);
  395|  16.9G|    mask1 = ~mask0;
  396|  16.9G|    r->n[0] = (r->n[0] & mask0) | (a->n[0] & mask1);
  397|  16.9G|    r->n[1] = (r->n[1] & mask0) | (a->n[1] & mask1);
  398|  16.9G|    r->n[2] = (r->n[2] & mask0) | (a->n[2] & mask1);
  399|  16.9G|    r->n[3] = (r->n[3] & mask0) | (a->n[3] & mask1);
  400|  16.9G|}
secp256k1.c:secp256k1_fe_impl_set_b32_mod:
  228|   958k|static void secp256k1_fe_impl_set_b32_mod(secp256k1_fe *r, const unsigned char *a) {
  229|   958k|    r->n[0] = (uint64_t)a[31]
  230|   958k|            | ((uint64_t)a[30] << 8)
  231|   958k|            | ((uint64_t)a[29] << 16)
  232|   958k|            | ((uint64_t)a[28] << 24)
  233|   958k|            | ((uint64_t)a[27] << 32)
  234|   958k|            | ((uint64_t)a[26] << 40)
  235|   958k|            | ((uint64_t)(a[25] & 0xF)  << 48);
  236|   958k|    r->n[1] = (uint64_t)((a[25] >> 4) & 0xF)
  237|   958k|            | ((uint64_t)a[24] << 4)
  238|   958k|            | ((uint64_t)a[23] << 12)
  239|   958k|            | ((uint64_t)a[22] << 20)
  240|   958k|            | ((uint64_t)a[21] << 28)
  241|   958k|            | ((uint64_t)a[20] << 36)
  242|   958k|            | ((uint64_t)a[19] << 44);
  243|   958k|    r->n[2] = (uint64_t)a[18]
  244|   958k|            | ((uint64_t)a[17] << 8)
  245|   958k|            | ((uint64_t)a[16] << 16)
  246|   958k|            | ((uint64_t)a[15] << 24)
  247|   958k|            | ((uint64_t)a[14] << 32)
  248|   958k|            | ((uint64_t)a[13] << 40)
  249|   958k|            | ((uint64_t)(a[12] & 0xF) << 48);
  250|   958k|    r->n[3] = (uint64_t)((a[12] >> 4) & 0xF)
  251|   958k|            | ((uint64_t)a[11] << 4)
  252|   958k|            | ((uint64_t)a[10] << 12)
  253|   958k|            | ((uint64_t)a[9]  << 20)
  254|   958k|            | ((uint64_t)a[8]  << 28)
  255|   958k|            | ((uint64_t)a[7]  << 36)
  256|   958k|            | ((uint64_t)a[6]  << 44);
  257|   958k|    r->n[4] = (uint64_t)a[5]
  258|   958k|            | ((uint64_t)a[4] << 8)
  259|   958k|            | ((uint64_t)a[3] << 16)
  260|   958k|            | ((uint64_t)a[2] << 24)
  261|   958k|            | ((uint64_t)a[1] << 32)
  262|   958k|            | ((uint64_t)a[0] << 40);
  263|   958k|}
secp256k1.c:secp256k1_fe_impl_normalize:
   43|  21.7M|static void secp256k1_fe_impl_normalize(secp256k1_fe *r) {
   44|  21.7M|    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|  21.7M|    uint64_t m;
   48|  21.7M|    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;
   49|       |
   50|       |    /* The first pass ensures the magnitude is 1, ... */
   51|  21.7M|    t0 += x * 0x1000003D1ULL;
   52|  21.7M|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;
   53|  21.7M|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; m = t1;
   54|  21.7M|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; m &= t2;
   55|  21.7M|    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|  21.7M|    VERIFY_CHECK(t4 >> 49 == 0);
   59|       |
   60|       |    /* At most a single final reduction is needed; check if the value is >= the field characteristic */
   61|  21.7M|    x = (t4 >> 48) | ((t4 == 0x0FFFFFFFFFFFFULL) & (m == 0xFFFFFFFFFFFFFULL)
   62|  21.7M|        & (t0 >= 0xFFFFEFFFFFC2FULL));
   63|       |
   64|       |    /* Apply the final reduction (for constant-time behaviour, we do it always) */
   65|  21.7M|    t0 += x * 0x1000003D1ULL;
   66|  21.7M|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;
   67|  21.7M|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL;
   68|  21.7M|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL;
   69|  21.7M|    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|  21.7M|    VERIFY_CHECK(t4 >> 48 == x);
   73|       |
   74|       |    /* Mask off the possible multiple of 2^256 from the final reduction */
   75|  21.7M|    t4 &= 0x0FFFFFFFFFFFFULL;
   76|       |
   77|  21.7M|    r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;
   78|  21.7M|}
secp256k1.c:secp256k1_fe_impl_to_storage:
  402|  15.2M|static void secp256k1_fe_impl_to_storage(secp256k1_fe_storage *r, const secp256k1_fe *a) {
  403|  15.2M|    r->n[0] = a->n[0] | a->n[1] << 52;
  404|  15.2M|    r->n[1] = a->n[1] >> 12 | a->n[2] << 40;
  405|  15.2M|    r->n[2] = a->n[2] >> 24 | a->n[3] << 28;
  406|  15.2M|    r->n[3] = a->n[3] >> 36 | a->n[4] << 16;
  407|  15.2M|}

secp256k1.c:secp256k1_fe_sqr_inner:
  154|  2.06G|SECP256K1_FORCE_INLINE static void secp256k1_fe_sqr_inner(uint64_t *r, const uint64_t *a) {
  155|  2.06G|    secp256k1_uint128 c, d;
  156|  2.06G|    uint64_t a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4];
  157|  2.06G|    uint64_t t3, t4, tx, u0;
  158|  2.06G|    const uint64_t M = 0xFFFFFFFFFFFFFULL, R = 0x1000003D10ULL;
  159|       |
  160|  2.06G|    VERIFY_BITS(a[0], 56);
  161|  2.06G|    VERIFY_BITS(a[1], 56);
  162|  2.06G|    VERIFY_BITS(a[2], 56);
  163|  2.06G|    VERIFY_BITS(a[3], 56);
  164|  2.06G|    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|  2.06G|    secp256k1_u128_mul(&d, a0*2, a3);
  172|  2.06G|    secp256k1_u128_accum_mul(&d, a1*2, a2);
  173|  2.06G|    VERIFY_BITS_128(&d, 114);
  174|       |    /* [d 0 0 0] = [p3 0 0 0] */
  175|  2.06G|    secp256k1_u128_mul(&c, a4, a4);
  176|  2.06G|    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|  2.06G|    secp256k1_u128_accum_mul(&d, R, secp256k1_u128_to_u64(&c)); secp256k1_u128_rshift(&c, 64);
  179|  2.06G|    VERIFY_BITS_128(&d, 115);
  180|  2.06G|    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|  2.06G|    t3 = secp256k1_u128_to_u64(&d) & M; secp256k1_u128_rshift(&d, 52);
  183|  2.06G|    VERIFY_BITS(t3, 52);
  184|  2.06G|    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|  2.06G|    a4 *= 2;
  188|  2.06G|    secp256k1_u128_accum_mul(&d, a0, a4);
  189|  2.06G|    secp256k1_u128_accum_mul(&d, a1*2, a3);
  190|  2.06G|    secp256k1_u128_accum_mul(&d, a2, a2);
  191|  2.06G|    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|  2.06G|    secp256k1_u128_accum_mul(&d, R << 12, secp256k1_u128_to_u64(&c));
  194|  2.06G|    VERIFY_BITS_128(&d, 116);
  195|       |    /* [d t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */
  196|  2.06G|    t4 = secp256k1_u128_to_u64(&d) & M; secp256k1_u128_rshift(&d, 52);
  197|  2.06G|    VERIFY_BITS(t4, 52);
  198|  2.06G|    VERIFY_BITS_128(&d, 64);
  199|       |    /* [d t4 t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */
  200|  2.06G|    tx = (t4 >> 48); t4 &= (M >> 4);
  201|  2.06G|    VERIFY_BITS(tx, 4);
  202|  2.06G|    VERIFY_BITS(t4, 48);
  203|       |    /* [d t4+(tx<<48) t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */
  204|       |
  205|  2.06G|    secp256k1_u128_mul(&c, a0, a0);
  206|  2.06G|    VERIFY_BITS_128(&c, 112);
  207|       |    /* [d t4+(tx<<48) t3 0 0 c] = [p8 0 0 0 p4 p3 0 0 p0] */
  208|  2.06G|    secp256k1_u128_accum_mul(&d, a1, a4);
  209|  2.06G|    secp256k1_u128_accum_mul(&d, a2*2, a3);
  210|  2.06G|    VERIFY_BITS_128(&d, 114);
  211|       |    /* [d t4+(tx<<48) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */
  212|  2.06G|    u0 = secp256k1_u128_to_u64(&d) & M; secp256k1_u128_rshift(&d, 52);
  213|  2.06G|    VERIFY_BITS(u0, 52);
  214|  2.06G|    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|  2.06G|    u0 = (u0 << 4) | tx;
  218|  2.06G|    VERIFY_BITS(u0, 56);
  219|       |    /* [d 0 t4+(u0<<48) t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */
  220|  2.06G|    secp256k1_u128_accum_mul(&c, u0, R >> 4);
  221|  2.06G|    VERIFY_BITS_128(&c, 113);
  222|       |    /* [d 0 t4 t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */
  223|  2.06G|    r[0] = secp256k1_u128_to_u64(&c) & M; secp256k1_u128_rshift(&c, 52);
  224|  2.06G|    VERIFY_BITS(r[0], 52);
  225|  2.06G|    VERIFY_BITS_128(&c, 61);
  226|       |    /* [d 0 t4 t3 0 c r0] = [p8 0 0 p5 p4 p3 0 0 p0] */
  227|       |
  228|  2.06G|    a0 *= 2;
  229|  2.06G|    secp256k1_u128_accum_mul(&c, a0, a1);
  230|  2.06G|    VERIFY_BITS_128(&c, 114);
  231|       |    /* [d 0 t4 t3 0 c r0] = [p8 0 0 p5 p4 p3 0 p1 p0] */
  232|  2.06G|    secp256k1_u128_accum_mul(&d, a2, a4);
  233|  2.06G|    secp256k1_u128_accum_mul(&d, a3, a3);
  234|  2.06G|    VERIFY_BITS_128(&d, 114);
  235|       |    /* [d 0 t4 t3 0 c r0] = [p8 0 p6 p5 p4 p3 0 p1 p0] */
  236|  2.06G|    secp256k1_u128_accum_mul(&c, secp256k1_u128_to_u64(&d) & M, R); secp256k1_u128_rshift(&d, 52);
  237|  2.06G|    VERIFY_BITS_128(&c, 115);
  238|  2.06G|    VERIFY_BITS_128(&d, 62);
  239|       |    /* [d 0 0 t4 t3 0 c r0] = [p8 0 p6 p5 p4 p3 0 p1 p0] */
  240|  2.06G|    r[1] = secp256k1_u128_to_u64(&c) & M; secp256k1_u128_rshift(&c, 52);
  241|  2.06G|    VERIFY_BITS(r[1], 52);
  242|  2.06G|    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|  2.06G|    secp256k1_u128_accum_mul(&c, a0, a2);
  246|  2.06G|    secp256k1_u128_accum_mul(&c, a1, a1);
  247|  2.06G|    VERIFY_BITS_128(&c, 114);
  248|       |    /* [d 0 0 t4 t3 c r1 r0] = [p8 0 p6 p5 p4 p3 p2 p1 p0] */
  249|  2.06G|    secp256k1_u128_accum_mul(&d, a3, a4);
  250|  2.06G|    VERIFY_BITS_128(&d, 114);
  251|       |    /* [d 0 0 t4 t3 c r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */
  252|  2.06G|    secp256k1_u128_accum_mul(&c, R, secp256k1_u128_to_u64(&d)); secp256k1_u128_rshift(&d, 64);
  253|  2.06G|    VERIFY_BITS_128(&c, 115);
  254|  2.06G|    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|  2.06G|    r[2] = secp256k1_u128_to_u64(&c) & M; secp256k1_u128_rshift(&c, 52);
  257|  2.06G|    VERIFY_BITS(r[2], 52);
  258|  2.06G|    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|  2.06G|    secp256k1_u128_accum_mul(&c, R << 12, secp256k1_u128_to_u64(&d));
  262|  2.06G|    secp256k1_u128_accum_u64(&c, t3);
  263|  2.06G|    VERIFY_BITS_128(&c, 100);
  264|       |    /* [t4 c r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */
  265|  2.06G|    r[3] = secp256k1_u128_to_u64(&c) & M; secp256k1_u128_rshift(&c, 52);
  266|  2.06G|    VERIFY_BITS(r[3], 52);
  267|  2.06G|    VERIFY_BITS_128(&c, 48);
  268|       |    /* [t4+c r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */
  269|  2.06G|    r[4] = secp256k1_u128_to_u64(&c) + t4;
  270|  2.06G|    VERIFY_BITS(r[4], 49);
  271|       |    /* [r4 r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */
  272|  2.06G|}
secp256k1.c:secp256k1_fe_mul_inner:
   18|  2.48G|SECP256K1_FORCE_INLINE static void secp256k1_fe_mul_inner(uint64_t *r, const uint64_t *a, const uint64_t * SECP256K1_RESTRICT b) {
   19|  2.48G|    secp256k1_uint128 c, d;
   20|  2.48G|    uint64_t t3, t4, tx, u0;
   21|  2.48G|    uint64_t a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4];
   22|  2.48G|    const uint64_t M = 0xFFFFFFFFFFFFFULL, R = 0x1000003D10ULL;
   23|       |
   24|  2.48G|    VERIFY_BITS(a[0], 56);
   25|  2.48G|    VERIFY_BITS(a[1], 56);
   26|  2.48G|    VERIFY_BITS(a[2], 56);
   27|  2.48G|    VERIFY_BITS(a[3], 56);
   28|  2.48G|    VERIFY_BITS(a[4], 52);
   29|  2.48G|    VERIFY_BITS(b[0], 56);
   30|  2.48G|    VERIFY_BITS(b[1], 56);
   31|  2.48G|    VERIFY_BITS(b[2], 56);
   32|  2.48G|    VERIFY_BITS(b[3], 56);
   33|  2.48G|    VERIFY_BITS(b[4], 52);
   34|  2.48G|    VERIFY_CHECK(r != b);
   35|  2.48G|    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.48G|    secp256k1_u128_mul(&d, a0, b[3]);
   44|  2.48G|    secp256k1_u128_accum_mul(&d, a1, b[2]);
   45|  2.48G|    secp256k1_u128_accum_mul(&d, a2, b[1]);
   46|  2.48G|    secp256k1_u128_accum_mul(&d, a3, b[0]);
   47|  2.48G|    VERIFY_BITS_128(&d, 114);
   48|       |    /* [d 0 0 0] = [p3 0 0 0] */
   49|  2.48G|    secp256k1_u128_mul(&c, a4, b[4]);
   50|  2.48G|    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.48G|    secp256k1_u128_accum_mul(&d, R, secp256k1_u128_to_u64(&c)); secp256k1_u128_rshift(&c, 64);
   53|  2.48G|    VERIFY_BITS_128(&d, 115);
   54|  2.48G|    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.48G|    t3 = secp256k1_u128_to_u64(&d) & M; secp256k1_u128_rshift(&d, 52);
   57|  2.48G|    VERIFY_BITS(t3, 52);
   58|  2.48G|    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.48G|    secp256k1_u128_accum_mul(&d, a0, b[4]);
   62|  2.48G|    secp256k1_u128_accum_mul(&d, a1, b[3]);
   63|  2.48G|    secp256k1_u128_accum_mul(&d, a2, b[2]);
   64|  2.48G|    secp256k1_u128_accum_mul(&d, a3, b[1]);
   65|  2.48G|    secp256k1_u128_accum_mul(&d, a4, b[0]);
   66|  2.48G|    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.48G|    secp256k1_u128_accum_mul(&d, R << 12, secp256k1_u128_to_u64(&c));
   69|  2.48G|    VERIFY_BITS_128(&d, 116);
   70|       |    /* [d t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */
   71|  2.48G|    t4 = secp256k1_u128_to_u64(&d) & M; secp256k1_u128_rshift(&d, 52);
   72|  2.48G|    VERIFY_BITS(t4, 52);
   73|  2.48G|    VERIFY_BITS_128(&d, 64);
   74|       |    /* [d t4 t3 0 0 0] = [p8 0 0 0 p4 p3 0 0 0] */
   75|  2.48G|    tx = (t4 >> 48); t4 &= (M >> 4);
   76|  2.48G|    VERIFY_BITS(tx, 4);
   77|  2.48G|    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.48G|    secp256k1_u128_mul(&c, a0, b[0]);
   81|  2.48G|    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.48G|    secp256k1_u128_accum_mul(&d, a1, b[4]);
   84|  2.48G|    secp256k1_u128_accum_mul(&d, a2, b[3]);
   85|  2.48G|    secp256k1_u128_accum_mul(&d, a3, b[2]);
   86|  2.48G|    secp256k1_u128_accum_mul(&d, a4, b[1]);
   87|  2.48G|    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.48G|    u0 = secp256k1_u128_to_u64(&d) & M; secp256k1_u128_rshift(&d, 52);
   90|  2.48G|    VERIFY_BITS(u0, 52);
   91|  2.48G|    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.48G|    u0 = (u0 << 4) | tx;
   95|  2.48G|    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.48G|    secp256k1_u128_accum_mul(&c, u0, R >> 4);
   98|  2.48G|    VERIFY_BITS_128(&c, 113);
   99|       |    /* [d 0 t4 t3 0 0 c] = [p8 0 0 p5 p4 p3 0 0 p0] */
  100|  2.48G|    r[0] = secp256k1_u128_to_u64(&c) & M; secp256k1_u128_rshift(&c, 52);
  101|  2.48G|    VERIFY_BITS(r[0], 52);
  102|  2.48G|    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.48G|    secp256k1_u128_accum_mul(&c, a0, b[1]);
  106|  2.48G|    secp256k1_u128_accum_mul(&c, a1, b[0]);
  107|  2.48G|    VERIFY_BITS_128(&c, 114);
  108|       |    /* [d 0 t4 t3 0 c r0] = [p8 0 0 p5 p4 p3 0 p1 p0] */
  109|  2.48G|    secp256k1_u128_accum_mul(&d, a2, b[4]);
  110|  2.48G|    secp256k1_u128_accum_mul(&d, a3, b[3]);
  111|  2.48G|    secp256k1_u128_accum_mul(&d, a4, b[2]);
  112|  2.48G|    VERIFY_BITS_128(&d, 114);
  113|       |    /* [d 0 t4 t3 0 c r0] = [p8 0 p6 p5 p4 p3 0 p1 p0] */
  114|  2.48G|    secp256k1_u128_accum_mul(&c, secp256k1_u128_to_u64(&d) & M, R); secp256k1_u128_rshift(&d, 52);
  115|  2.48G|    VERIFY_BITS_128(&c, 115);
  116|  2.48G|    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.48G|    r[1] = secp256k1_u128_to_u64(&c) & M; secp256k1_u128_rshift(&c, 52);
  119|  2.48G|    VERIFY_BITS(r[1], 52);
  120|  2.48G|    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.48G|    secp256k1_u128_accum_mul(&c, a0, b[2]);
  124|  2.48G|    secp256k1_u128_accum_mul(&c, a1, b[1]);
  125|  2.48G|    secp256k1_u128_accum_mul(&c, a2, b[0]);
  126|  2.48G|    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.48G|    secp256k1_u128_accum_mul(&d, a3, b[4]);
  129|  2.48G|    secp256k1_u128_accum_mul(&d, a4, b[3]);
  130|  2.48G|    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.48G|    secp256k1_u128_accum_mul(&c, R, secp256k1_u128_to_u64(&d)); secp256k1_u128_rshift(&d, 64);
  133|  2.48G|    VERIFY_BITS_128(&c, 115);
  134|  2.48G|    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.48G|    r[2] = secp256k1_u128_to_u64(&c) & M; secp256k1_u128_rshift(&c, 52);
  138|  2.48G|    VERIFY_BITS(r[2], 52);
  139|  2.48G|    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.48G|    secp256k1_u128_accum_mul(&c, R << 12, secp256k1_u128_to_u64(&d));
  142|  2.48G|    secp256k1_u128_accum_u64(&c, t3);
  143|  2.48G|    VERIFY_BITS_128(&c, 100);
  144|       |    /* [t4 c r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */
  145|  2.48G|    r[3] = secp256k1_u128_to_u64(&c) & M; secp256k1_u128_rshift(&c, 52);
  146|  2.48G|    VERIFY_BITS(r[3], 52);
  147|  2.48G|    VERIFY_BITS_128(&c, 48);
  148|       |    /* [t4+c r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */
  149|  2.48G|    r[4] = secp256k1_u128_to_u64(&c) + t4;
  150|  2.48G|    VERIFY_BITS(r[4], 49);
  151|       |    /* [r4 r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */
  152|  2.48G|}

secp256k1.c:secp256k1_fe_verify:
  149|  4.35G|static void secp256k1_fe_verify(const secp256k1_fe *a) { (void)a; }
secp256k1.c:secp256k1_fe_verify_magnitude:
  150|  4.29G|static void secp256k1_fe_verify_magnitude(const secp256k1_fe *a, int m) { (void)a; (void)m; }
secp256k1.c:secp256k1_fe_sqrt:
   37|   958k|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|   958k|    secp256k1_fe x2, x3, x6, x9, x11, x22, x44, x88, x176, x220, x223, t1;
   48|   958k|    int j, ret;
   49|       |
   50|   958k|    VERIFY_CHECK(r != a);
   51|   958k|    SECP256K1_FE_VERIFY(a);
  ------------------
  |  |  345|   958k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   52|   958k|    SECP256K1_FE_VERIFY_MAGNITUDE(a, 8);
  ------------------
  |  |  349|   958k|#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|   958k|    secp256k1_fe_sqr(&x2, a);
  ------------------
  |  |   94|   958k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   60|   958k|    secp256k1_fe_mul(&x2, &x2, a);
  ------------------
  |  |   93|   958k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
   61|       |
   62|   958k|    secp256k1_fe_sqr(&x3, &x2);
  ------------------
  |  |   94|   958k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   63|   958k|    secp256k1_fe_mul(&x3, &x3, a);
  ------------------
  |  |   93|   958k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
   64|       |
   65|   958k|    x6 = x3;
   66|  3.83M|    for (j=0; j<3; j++) {
  ------------------
  |  Branch (66:15): [True: 2.87M, False: 958k]
  ------------------
   67|  2.87M|        secp256k1_fe_sqr(&x6, &x6);
  ------------------
  |  |   94|  2.87M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   68|  2.87M|    }
   69|   958k|    secp256k1_fe_mul(&x6, &x6, &x3);
  ------------------
  |  |   93|   958k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
   70|       |
   71|   958k|    x9 = x6;
   72|  3.83M|    for (j=0; j<3; j++) {
  ------------------
  |  Branch (72:15): [True: 2.87M, False: 958k]
  ------------------
   73|  2.87M|        secp256k1_fe_sqr(&x9, &x9);
  ------------------
  |  |   94|  2.87M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   74|  2.87M|    }
   75|   958k|    secp256k1_fe_mul(&x9, &x9, &x3);
  ------------------
  |  |   93|   958k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
   76|       |
   77|   958k|    x11 = x9;
   78|  2.87M|    for (j=0; j<2; j++) {
  ------------------
  |  Branch (78:15): [True: 1.91M, False: 958k]
  ------------------
   79|  1.91M|        secp256k1_fe_sqr(&x11, &x11);
  ------------------
  |  |   94|  1.91M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   80|  1.91M|    }
   81|   958k|    secp256k1_fe_mul(&x11, &x11, &x2);
  ------------------
  |  |   93|   958k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
   82|       |
   83|   958k|    x22 = x11;
   84|  11.5M|    for (j=0; j<11; j++) {
  ------------------
  |  Branch (84:15): [True: 10.5M, False: 958k]
  ------------------
   85|  10.5M|        secp256k1_fe_sqr(&x22, &x22);
  ------------------
  |  |   94|  10.5M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   86|  10.5M|    }
   87|   958k|    secp256k1_fe_mul(&x22, &x22, &x11);
  ------------------
  |  |   93|   958k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
   88|       |
   89|   958k|    x44 = x22;
   90|  22.0M|    for (j=0; j<22; j++) {
  ------------------
  |  Branch (90:15): [True: 21.0M, False: 958k]
  ------------------
   91|  21.0M|        secp256k1_fe_sqr(&x44, &x44);
  ------------------
  |  |   94|  21.0M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   92|  21.0M|    }
   93|   958k|    secp256k1_fe_mul(&x44, &x44, &x22);
  ------------------
  |  |   93|   958k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
   94|       |
   95|   958k|    x88 = x44;
   96|  43.1M|    for (j=0; j<44; j++) {
  ------------------
  |  Branch (96:15): [True: 42.1M, False: 958k]
  ------------------
   97|  42.1M|        secp256k1_fe_sqr(&x88, &x88);
  ------------------
  |  |   94|  42.1M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   98|  42.1M|    }
   99|   958k|    secp256k1_fe_mul(&x88, &x88, &x44);
  ------------------
  |  |   93|   958k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  100|       |
  101|   958k|    x176 = x88;
  102|  85.3M|    for (j=0; j<88; j++) {
  ------------------
  |  Branch (102:15): [True: 84.3M, False: 958k]
  ------------------
  103|  84.3M|        secp256k1_fe_sqr(&x176, &x176);
  ------------------
  |  |   94|  84.3M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  104|  84.3M|    }
  105|   958k|    secp256k1_fe_mul(&x176, &x176, &x88);
  ------------------
  |  |   93|   958k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  106|       |
  107|   958k|    x220 = x176;
  108|  43.1M|    for (j=0; j<44; j++) {
  ------------------
  |  Branch (108:15): [True: 42.1M, False: 958k]
  ------------------
  109|  42.1M|        secp256k1_fe_sqr(&x220, &x220);
  ------------------
  |  |   94|  42.1M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  110|  42.1M|    }
  111|   958k|    secp256k1_fe_mul(&x220, &x220, &x44);
  ------------------
  |  |   93|   958k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  112|       |
  113|   958k|    x223 = x220;
  114|  3.83M|    for (j=0; j<3; j++) {
  ------------------
  |  Branch (114:15): [True: 2.87M, False: 958k]
  ------------------
  115|  2.87M|        secp256k1_fe_sqr(&x223, &x223);
  ------------------
  |  |   94|  2.87M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  116|  2.87M|    }
  117|   958k|    secp256k1_fe_mul(&x223, &x223, &x3);
  ------------------
  |  |   93|   958k|#  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|   958k|    t1 = x223;
  122|  23.0M|    for (j=0; j<23; j++) {
  ------------------
  |  Branch (122:15): [True: 22.0M, False: 958k]
  ------------------
  123|  22.0M|        secp256k1_fe_sqr(&t1, &t1);
  ------------------
  |  |   94|  22.0M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  124|  22.0M|    }
  125|   958k|    secp256k1_fe_mul(&t1, &t1, &x22);
  ------------------
  |  |   93|   958k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  126|  6.70M|    for (j=0; j<6; j++) {
  ------------------
  |  Branch (126:15): [True: 5.75M, False: 958k]
  ------------------
  127|  5.75M|        secp256k1_fe_sqr(&t1, &t1);
  ------------------
  |  |   94|  5.75M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  128|  5.75M|    }
  129|   958k|    secp256k1_fe_mul(&t1, &t1, &x2);
  ------------------
  |  |   93|   958k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  130|   958k|    secp256k1_fe_sqr(&t1, &t1);
  ------------------
  |  |   94|   958k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  131|   958k|    secp256k1_fe_sqr(r, &t1);
  ------------------
  |  |   94|   958k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  132|       |
  133|       |    /* Check that a square root was actually calculated */
  134|       |
  135|   958k|    secp256k1_fe_sqr(&t1, r);
  ------------------
  |  |   94|   958k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  136|   958k|    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|   958k|    return ret;
  146|   958k|}
secp256k1.c:secp256k1_fe_equal:
   25|  1.52M|SECP256K1_INLINE static int secp256k1_fe_equal(const secp256k1_fe *a, const secp256k1_fe *b) {
   26|  1.52M|    secp256k1_fe na;
   27|  1.52M|    SECP256K1_FE_VERIFY(a);
  ------------------
  |  |  345|  1.52M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   28|  1.52M|    SECP256K1_FE_VERIFY(b);
  ------------------
  |  |  345|  1.52M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   29|  1.52M|    SECP256K1_FE_VERIFY_MAGNITUDE(a, 1);
  ------------------
  |  |  349|  1.52M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   30|  1.52M|    SECP256K1_FE_VERIFY_MAGNITUDE(b, 30);
  ------------------
  |  |  349|  1.52M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   31|       |
   32|  1.52M|    secp256k1_fe_negate(&na, a, 1);
  ------------------
  |  |  211|  1.52M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  1.52M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  1.52M|    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.52M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  1.52M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 1.52M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  1.52M|    } \
  |  |  |  |   94|  1.52M|    stmt; \
  |  |  |  |   95|  1.52M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 1.52M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   33|  1.52M|    secp256k1_fe_add(&na, b);
  ------------------
  |  |   92|  1.52M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
   34|  1.52M|    return secp256k1_fe_normalizes_to_zero(&na);
  ------------------
  |  |   81|  1.52M|#  define secp256k1_fe_normalizes_to_zero secp256k1_fe_impl_normalizes_to_zero
  ------------------
   35|  1.52M|}
secp256k1.c:secp256k1_fe_clear:
   21|  6.17M|SECP256K1_INLINE static void secp256k1_fe_clear(secp256k1_fe *a) {
   22|  6.17M|    secp256k1_memclear_explicit(a, sizeof(secp256k1_fe));
   23|  6.17M|}

secp256k1.c:secp256k1_ge_set_xy:
  132|  16.8M|static void secp256k1_ge_set_xy(secp256k1_ge *r, const secp256k1_fe *x, const secp256k1_fe *y) {
  133|  16.8M|    SECP256K1_FE_VERIFY(x);
  ------------------
  |  |  345|  16.8M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  134|  16.8M|    SECP256K1_FE_VERIFY(y);
  ------------------
  |  |  345|  16.8M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  135|       |
  136|  16.8M|    r->infinity = 0;
  137|  16.8M|    r->x = *x;
  138|  16.8M|    r->y = *y;
  139|       |
  140|  16.8M|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|  16.8M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  141|  16.8M|}
secp256k1.c:secp256k1_ge_verify:
   78|   629M|static void secp256k1_ge_verify(const secp256k1_ge *a) {
   79|   629M|    SECP256K1_FE_VERIFY(&a->x);
  ------------------
  |  |  345|   629M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   80|   629M|    SECP256K1_FE_VERIFY(&a->y);
  ------------------
  |  |  345|   629M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   81|   629M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->x, SECP256K1_GE_X_MAGNITUDE_MAX);
  ------------------
  |  |  349|   629M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   82|   629M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->y, SECP256K1_GE_Y_MAGNITUDE_MAX);
  ------------------
  |  |  349|   629M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   83|   629M|    VERIFY_CHECK(a->infinity == 0 || a->infinity == 1);
   84|   629M|    (void)a;
   85|   629M|}
secp256k1.c:secp256k1_ge_is_valid_var:
  446|    162|static int secp256k1_ge_is_valid_var(const secp256k1_ge *a) {
  447|    162|    secp256k1_fe y2, x3;
  448|    162|    SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  212|    162|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  449|       |
  450|    162|    if (a->infinity) {
  ------------------
  |  Branch (450:9): [True: 0, False: 162]
  ------------------
  451|      0|        return 0;
  452|      0|    }
  453|       |    /* y^2 = x^3 + 7 */
  454|    162|    secp256k1_fe_sqr(&y2, &a->y);
  ------------------
  |  |   94|    162|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  455|    162|    secp256k1_fe_sqr(&x3, &a->x); secp256k1_fe_mul(&x3, &x3, &a->x);
  ------------------
  |  |   94|    162|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
                  secp256k1_fe_sqr(&x3, &a->x); secp256k1_fe_mul(&x3, &x3, &a->x);
  ------------------
  |  |   93|    162|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  456|    162|    secp256k1_fe_add_int(&x3, SECP256K1_B);
  ------------------
  |  |  102|    162|#  define secp256k1_fe_add_int secp256k1_fe_impl_add_int
  ------------------
                  secp256k1_fe_add_int(&x3, SECP256K1_B);
  ------------------
  |  |   73|    162|#define SECP256K1_B 7
  ------------------
  457|    162|    return secp256k1_fe_equal(&y2, &x3);
  458|    162|}
secp256k1.c:secp256k1_ge_is_in_correct_subgroup:
  926|   958k|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|   958k|    SECP256K1_GE_VERIFY(ge);
  ------------------
  |  |  212|   958k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  943|       |
  944|   958k|    (void)ge;
  945|       |    /* The real secp256k1 group has cofactor 1, so the subgroup is the entire curve. */
  946|   958k|    return 1;
  947|   958k|#endif
  948|   958k|}
secp256k1.c:secp256k1_ge_clear:
  343|  6.97M|static void secp256k1_ge_clear(secp256k1_ge *r) {
  344|  6.97M|    secp256k1_memclear_explicit(r, sizeof(secp256k1_ge));
  345|  6.97M|}
secp256k1.c:secp256k1_gej_verify:
   87|  1.01G|static void secp256k1_gej_verify(const secp256k1_gej *a) {
   88|  1.01G|    SECP256K1_FE_VERIFY(&a->x);
  ------------------
  |  |  345|  1.01G|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   89|  1.01G|    SECP256K1_FE_VERIFY(&a->y);
  ------------------
  |  |  345|  1.01G|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   90|  1.01G|    SECP256K1_FE_VERIFY(&a->z);
  ------------------
  |  |  345|  1.01G|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   91|  1.01G|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->x, SECP256K1_GEJ_X_MAGNITUDE_MAX);
  ------------------
  |  |  349|  1.01G|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   92|  1.01G|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->y, SECP256K1_GEJ_Y_MAGNITUDE_MAX);
  ------------------
  |  |  349|  1.01G|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   93|  1.01G|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->z, SECP256K1_GEJ_Z_MAGNITUDE_MAX);
  ------------------
  |  |  349|  1.01G|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   94|  1.01G|    VERIFY_CHECK(a->infinity == 0 || a->infinity == 1);
   95|  1.01G|    (void)a;
   96|  1.01G|}
secp256k1.c:secp256k1_gej_set_infinity:
  322|  1.85M|static void secp256k1_gej_set_infinity(secp256k1_gej *r) {
  323|  1.85M|    r->infinity = 1;
  324|  1.85M|    secp256k1_fe_set_int(&r->x, 0);
  ------------------
  |  |   83|  1.85M|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  325|  1.85M|    secp256k1_fe_set_int(&r->y, 0);
  ------------------
  |  |   83|  1.85M|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  326|  1.85M|    secp256k1_fe_set_int(&r->z, 0);
  ------------------
  |  |   83|  1.85M|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  327|       |
  328|  1.85M|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|  1.85M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  329|  1.85M|}
secp256k1.c:secp256k1_gej_add_ge:
  724|   265M|static void secp256k1_gej_add_ge(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b) {
  725|       |    /* Operations: 7 mul, 5 sqr, 21 add/cmov/half/mul_int/negate/normalizes_to_zero */
  726|   265M|    secp256k1_fe zz, u1, u2, s1, s2, t, tt, m, n, q, rr;
  727|   265M|    secp256k1_fe m_alt, rr_alt;
  728|   265M|    int degenerate;
  729|   265M|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|   265M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  730|   265M|    SECP256K1_GE_VERIFY(b);
  ------------------
  |  |  212|   265M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  731|   265M|    VERIFY_CHECK(!b->infinity);
  732|       |
  733|       |    /*  In:
  734|       |     *    Eric Brier and Marc Joye, Weierstrass Elliptic Curves and Side-Channel Attacks.
  735|       |     *    In D. Naccache and P. Paillier, Eds., Public Key Cryptography, vol. 2274 of Lecture Notes in Computer Science, pages 335-345. Springer-Verlag, 2002.
  736|       |     *  we find as solution for a unified addition/doubling formula:
  737|       |     *    lambda = ((x1 + x2)^2 - x1 * x2 + a) / (y1 + y2), with a = 0 for secp256k1's curve equation.
  738|       |     *    x3 = lambda^2 - (x1 + x2)
  739|       |     *    2*y3 = lambda * (x1 + x2 - 2 * x3) - (y1 + y2).
  740|       |     *
  741|       |     *  Substituting x_i = Xi / Zi^2 and yi = Yi / Zi^3, for i=1,2,3, gives:
  742|       |     *    U1 = X1*Z2^2, U2 = X2*Z1^2
  743|       |     *    S1 = Y1*Z2^3, S2 = Y2*Z1^3
  744|       |     *    Z = Z1*Z2
  745|       |     *    T = U1+U2
  746|       |     *    M = S1+S2
  747|       |     *    Q = -T*M^2
  748|       |     *    R = T^2-U1*U2
  749|       |     *    X3 = R^2+Q
  750|       |     *    Y3 = -(R*(2*X3+Q)+M^4)/2
  751|       |     *    Z3 = M*Z
  752|       |     *  (Note that the paper uses xi = Xi / Zi and yi = Yi / Zi instead.)
  753|       |     *
  754|       |     *  This formula has the benefit of being the same for both addition
  755|       |     *  of distinct points and doubling. However, it breaks down in the
  756|       |     *  case that either point is infinity, or that y1 = -y2. We handle
  757|       |     *  these cases in the following ways:
  758|       |     *
  759|       |     *    - If b is infinity we simply bail by means of a VERIFY_CHECK.
  760|       |     *
  761|       |     *    - If a is infinity, we detect this, and at the end of the
  762|       |     *      computation replace the result (which will be meaningless,
  763|       |     *      but we compute to be constant-time) with b.x : b.y : 1.
  764|       |     *
  765|       |     *    - If a = -b, we have y1 = -y2, which is a degenerate case.
  766|       |     *      But here the answer is infinity, so we simply set the
  767|       |     *      infinity flag of the result, overriding the computed values
  768|       |     *      without even needing to cmov.
  769|       |     *
  770|       |     *    - If y1 = -y2 but x1 != x2, which does occur thanks to certain
  771|       |     *      properties of our curve (specifically, 1 has nontrivial cube
  772|       |     *      roots in our field, and the curve equation has no x coefficient)
  773|       |     *      then the answer is not infinity but also not given by the above
  774|       |     *      equation. In this case, we cmov in place an alternate expression
  775|       |     *      for lambda. Specifically (y1 - y2)/(x1 - x2). Where both these
  776|       |     *      expressions for lambda are defined, they are equal, and can be
  777|       |     *      obtained from each other by multiplication by (y1 + y2)/(y1 + y2)
  778|       |     *      then substitution of x^3 + 7 for y^2 (using the curve equation).
  779|       |     *      For all pairs of nonzero points (a, b) at least one is defined,
  780|       |     *      so this covers everything.
  781|       |     */
  782|       |
  783|   265M|    secp256k1_fe_sqr(&zz, &a->z);                       /* z = Z1^2 */
  ------------------
  |  |   94|   265M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  784|   265M|    u1 = a->x;                                          /* u1 = U1 = X1*Z2^2 (GEJ_X_M) */
  785|   265M|    secp256k1_fe_mul(&u2, &b->x, &zz);                  /* u2 = U2 = X2*Z1^2 (1) */
  ------------------
  |  |   93|   265M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  786|   265M|    s1 = a->y;                                          /* s1 = S1 = Y1*Z2^3 (GEJ_Y_M) */
  787|   265M|    secp256k1_fe_mul(&s2, &b->y, &zz);                  /* s2 = Y2*Z1^2 (1) */
  ------------------
  |  |   93|   265M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  788|   265M|    secp256k1_fe_mul(&s2, &s2, &a->z);                  /* s2 = S2 = Y2*Z1^3 (1) */
  ------------------
  |  |   93|   265M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  789|   265M|    t = u1; secp256k1_fe_add(&t, &u2);                  /* t = T = U1+U2 (GEJ_X_M+1) */
  ------------------
  |  |   92|   265M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  790|   265M|    m = s1; secp256k1_fe_add(&m, &s2);                  /* m = M = S1+S2 (GEJ_Y_M+1) */
  ------------------
  |  |   92|   265M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  791|   265M|    secp256k1_fe_sqr(&rr, &t);                          /* rr = T^2 (1) */
  ------------------
  |  |   94|   265M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  792|   265M|    secp256k1_fe_negate(&m_alt, &u2, 1);                /* Malt = -X2*Z1^2 (2) */
  ------------------
  |  |  211|   265M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   265M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   265M|    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: 265M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   265M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 265M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   265M|    } \
  |  |  |  |   94|   265M|    stmt; \
  |  |  |  |   95|   265M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 265M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  793|   265M|    secp256k1_fe_mul(&tt, &u1, &m_alt);                 /* tt = -U1*U2 (1) */
  ------------------
  |  |   93|   265M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  794|   265M|    secp256k1_fe_add(&rr, &tt);                         /* rr = R = T^2-U1*U2 (2) */
  ------------------
  |  |   92|   265M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  795|       |    /* If lambda = R/M = R/0 we have a problem (except in the "trivial"
  796|       |     * case that Z = z1z2 = 0, and this is special-cased later on). */
  797|   265M|    degenerate = secp256k1_fe_normalizes_to_zero(&m);
  ------------------
  |  |   81|   265M|#  define secp256k1_fe_normalizes_to_zero secp256k1_fe_impl_normalizes_to_zero
  ------------------
  798|       |    /* This only occurs when y1 == -y2 and x1^3 == x2^3, but x1 != x2.
  799|       |     * This means either x1 == beta*x2 or beta*x1 == x2, where beta is
  800|       |     * a nontrivial cube root of one. In either case, an alternate
  801|       |     * non-indeterminate expression for lambda is (y1 - y2)/(x1 - x2),
  802|       |     * so we set R/M equal to this. */
  803|   265M|    rr_alt = s1;
  804|   265M|    secp256k1_fe_mul_int(&rr_alt, 2);       /* rr_alt = Y1*Z2^3 - Y2*Z1^3 (GEJ_Y_M*2) */
  ------------------
  |  |  233|   265M|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   87|   265M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   265M|    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: 265M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   265M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 265M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   265M|    } \
  |  |  |  |   94|   265M|    stmt; \
  |  |  |  |   95|   265M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 265M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  805|   265M|    secp256k1_fe_add(&m_alt, &u1);          /* Malt = X1*Z2^2 - X2*Z1^2 (GEJ_X_M+2) */
  ------------------
  |  |   92|   265M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  806|       |
  807|   265M|    secp256k1_fe_cmov(&rr_alt, &rr, !degenerate);       /* rr_alt (GEJ_Y_M*2) */
  ------------------
  |  |   95|   265M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  808|   265M|    secp256k1_fe_cmov(&m_alt, &m, !degenerate);         /* m_alt (GEJ_X_M+2) */
  ------------------
  |  |   95|   265M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  809|       |    /* Now Ralt / Malt = lambda and is guaranteed not to be Ralt / 0.
  810|       |     * From here on out Ralt and Malt represent the numerator
  811|       |     * and denominator of lambda; R and M represent the explicit
  812|       |     * expressions x1^2 + x2^2 + x1x2 and y1 + y2. */
  813|   265M|    secp256k1_fe_sqr(&n, &m_alt);                       /* n = Malt^2 (1) */
  ------------------
  |  |   94|   265M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  814|   265M|    secp256k1_fe_negate(&q, &t,
  ------------------
  |  |  211|   265M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   265M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   265M|    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: 265M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   265M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 265M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   265M|    } \
  |  |  |  |   94|   265M|    stmt; \
  |  |  |  |   95|   265M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 265M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  815|   265M|        SECP256K1_GEJ_X_MAGNITUDE_MAX + 1);             /* q = -T (GEJ_X_M+2) */
  816|   265M|    secp256k1_fe_mul(&q, &q, &n);                       /* q = Q = -T*Malt^2 (1) */
  ------------------
  |  |   93|   265M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  817|       |    /* These two lines use the observation that either M == Malt or M == 0,
  818|       |     * so M^3 * Malt is either Malt^4 (which is computed by squaring), or
  819|       |     * zero (which is "computed" by cmov). So the cost is one squaring
  820|       |     * versus two multiplications. */
  821|   265M|    secp256k1_fe_sqr(&n, &n);                           /* n = Malt^4 (1) */
  ------------------
  |  |   94|   265M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  822|   265M|    secp256k1_fe_cmov(&n, &m, degenerate);              /* n = M^3 * Malt (GEJ_Y_M+1) */
  ------------------
  |  |   95|   265M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  823|   265M|    secp256k1_fe_sqr(&t, &rr_alt);                      /* t = Ralt^2 (1) */
  ------------------
  |  |   94|   265M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  824|   265M|    secp256k1_fe_mul(&r->z, &a->z, &m_alt);             /* r->z = Z3 = Malt*Z (1) */
  ------------------
  |  |   93|   265M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  825|   265M|    secp256k1_fe_add(&t, &q);                           /* t = Ralt^2 + Q (2) */
  ------------------
  |  |   92|   265M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  826|   265M|    r->x = t;                                           /* r->x = X3 = Ralt^2 + Q (2) */
  827|   265M|    secp256k1_fe_mul_int(&t, 2);                        /* t = 2*X3 (4) */
  ------------------
  |  |  233|   265M|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   87|   265M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   265M|    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: 265M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   265M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 265M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   265M|    } \
  |  |  |  |   94|   265M|    stmt; \
  |  |  |  |   95|   265M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 265M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  828|   265M|    secp256k1_fe_add(&t, &q);                           /* t = 2*X3 + Q (5) */
  ------------------
  |  |   92|   265M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  829|   265M|    secp256k1_fe_mul(&t, &t, &rr_alt);                  /* t = Ralt*(2*X3 + Q) (1) */
  ------------------
  |  |   93|   265M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  830|   265M|    secp256k1_fe_add(&t, &n);                           /* t = Ralt*(2*X3 + Q) + M^3*Malt (GEJ_Y_M+2) */
  ------------------
  |  |   92|   265M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  831|   265M|    secp256k1_fe_negate(&r->y, &t,
  ------------------
  |  |  211|   265M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   265M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   265M|    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: 265M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   265M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 265M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   265M|    } \
  |  |  |  |   94|   265M|    stmt; \
  |  |  |  |   95|   265M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 265M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  832|   265M|        SECP256K1_GEJ_Y_MAGNITUDE_MAX + 2);             /* r->y = -(Ralt*(2*X3 + Q) + M^3*Malt) (GEJ_Y_M+3) */
  833|   265M|    secp256k1_fe_half(&r->y);                           /* r->y = Y3 = -(Ralt*(2*X3 + Q) + M^3*Malt)/2 ((GEJ_Y_M+3)/2 + 1) */
  ------------------
  |  |  101|   265M|#  define secp256k1_fe_half secp256k1_fe_impl_half
  ------------------
  834|       |
  835|       |    /* In case a->infinity == 1, replace r with (b->x, b->y, 1). */
  836|   265M|    secp256k1_fe_cmov(&r->x, &b->x, a->infinity);
  ------------------
  |  |   95|   265M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  837|   265M|    secp256k1_fe_cmov(&r->y, &b->y, a->infinity);
  ------------------
  |  |   95|   265M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  838|   265M|    secp256k1_fe_cmov(&r->z, &secp256k1_fe_one, a->infinity);
  ------------------
  |  |   95|   265M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  839|       |
  840|       |    /* Set r->infinity if r->z is 0.
  841|       |     *
  842|       |     * If a->infinity is set, then r->infinity = (r->z == 0) = (1 == 0) = false,
  843|       |     * which is correct because the function assumes that b is not infinity.
  844|       |     *
  845|       |     * Now assume !a->infinity. This implies Z = Z1 != 0.
  846|       |     *
  847|       |     * Case y1 = -y2:
  848|       |     * In this case we could have a = -b, namely if x1 = x2.
  849|       |     * We have degenerate = true, r->z = (x1 - x2) * Z.
  850|       |     * Then r->infinity = ((x1 - x2)Z == 0) = (x1 == x2) = (a == -b).
  851|       |     *
  852|       |     * Case y1 != -y2:
  853|       |     * In this case, we can't have a = -b.
  854|       |     * We have degenerate = false, r->z = (y1 + y2) * Z.
  855|       |     * Then r->infinity = ((y1 + y2)Z == 0) = (y1 == -y2) = false. */
  856|   265M|    r->infinity = secp256k1_fe_normalizes_to_zero(&r->z);
  ------------------
  |  |   81|   265M|#  define secp256k1_fe_normalizes_to_zero secp256k1_fe_impl_normalizes_to_zero
  ------------------
  857|       |
  858|   265M|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|   265M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  859|   265M|}
secp256k1.c:secp256k1_gej_is_infinity:
  440|  1.93M|static int secp256k1_gej_is_infinity(const secp256k1_gej *a) {
  441|  1.93M|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|  1.93M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  442|       |
  443|  1.93M|    return a->infinity;
  444|  1.93M|}
secp256k1.c:secp256k1_ge_set_gej:
  159|  6.50M|static void secp256k1_ge_set_gej(secp256k1_ge *r, secp256k1_gej *a) {
  160|  6.50M|    secp256k1_fe z2, z3;
  161|  6.50M|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|  6.50M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  162|       |
  163|  6.50M|    r->infinity = a->infinity;
  164|  6.50M|    secp256k1_fe_inv(&a->z, &a->z);
  ------------------
  |  |   98|  6.50M|#  define secp256k1_fe_inv secp256k1_fe_impl_inv
  ------------------
  165|  6.50M|    secp256k1_fe_sqr(&z2, &a->z);
  ------------------
  |  |   94|  6.50M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  166|  6.50M|    secp256k1_fe_mul(&z3, &a->z, &z2);
  ------------------
  |  |   93|  6.50M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  167|  6.50M|    secp256k1_fe_mul(&a->x, &a->x, &z2);
  ------------------
  |  |   93|  6.50M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  168|  6.50M|    secp256k1_fe_mul(&a->y, &a->y, &z3);
  ------------------
  |  |   93|  6.50M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  169|  6.50M|    secp256k1_fe_set_int(&a->z, 1);
  ------------------
  |  |   83|  6.50M|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  170|  6.50M|    r->x = a->x;
  171|  6.50M|    r->y = a->y;
  172|       |
  173|  6.50M|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|  6.50M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  174|  6.50M|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|  6.50M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  175|  6.50M|}
secp256k1.c:secp256k1_ge_set_xo_var:
  347|   958k|static int secp256k1_ge_set_xo_var(secp256k1_ge *r, const secp256k1_fe *x, int odd) {
  348|   958k|    secp256k1_fe x2, x3;
  349|   958k|    int ret;
  350|   958k|    SECP256K1_FE_VERIFY(x);
  ------------------
  |  |  345|   958k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  351|       |
  352|   958k|    r->x = *x;
  353|   958k|    secp256k1_fe_sqr(&x2, x);
  ------------------
  |  |   94|   958k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  354|   958k|    secp256k1_fe_mul(&x3, x, &x2);
  ------------------
  |  |   93|   958k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  355|   958k|    r->infinity = 0;
  356|   958k|    secp256k1_fe_add_int(&x3, SECP256K1_B);
  ------------------
  |  |  102|   958k|#  define secp256k1_fe_add_int secp256k1_fe_impl_add_int
  ------------------
                  secp256k1_fe_add_int(&x3, SECP256K1_B);
  ------------------
  |  |   73|   958k|#define SECP256K1_B 7
  ------------------
  357|   958k|    ret = secp256k1_fe_sqrt(&r->y, &x3);
  358|   958k|    secp256k1_fe_normalize_var(&r->y);
  ------------------
  |  |   80|   958k|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
  359|   958k|    if (secp256k1_fe_is_odd(&r->y) != odd) {
  ------------------
  |  |   85|   958k|#  define secp256k1_fe_is_odd secp256k1_fe_impl_is_odd
  ------------------
  |  Branch (359:9): [True: 456k, False: 501k]
  ------------------
  360|   456k|        secp256k1_fe_negate(&r->y, &r->y, 1);
  ------------------
  |  |  211|   456k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   456k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   456k|    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: 456k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   456k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 456k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   456k|    } \
  |  |  |  |   94|   456k|    stmt; \
  |  |  |  |   95|   456k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 456k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  361|   456k|    }
  362|       |
  363|   958k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|   958k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  364|   958k|    return ret;
  365|   958k|}
secp256k1.c:secp256k1_gej_set_ge:
  367|  8.31M|static void secp256k1_gej_set_ge(secp256k1_gej *r, const secp256k1_ge *a) {
  368|  8.31M|   SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  212|  8.31M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  369|       |
  370|  8.31M|   r->infinity = a->infinity;
  371|  8.31M|   r->x = a->x;
  372|  8.31M|   r->y = a->y;
  373|  8.31M|   secp256k1_fe_set_int(&r->z, 1);
  ------------------
  |  |   83|  8.31M|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  374|       |
  375|  8.31M|   SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|  8.31M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  376|  8.31M|}
secp256k1.c:secp256k1_gej_rescale:
  861|  6.17M|static void secp256k1_gej_rescale(secp256k1_gej *r, const secp256k1_fe *s) {
  862|       |    /* Operations: 4 mul, 1 sqr */
  863|  6.17M|    secp256k1_fe zz;
  864|  6.17M|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|  6.17M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  865|  6.17M|    SECP256K1_FE_VERIFY(s);
  ------------------
  |  |  345|  6.17M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  866|  6.17M|    VERIFY_CHECK(!secp256k1_fe_normalizes_to_zero_var(s));
  867|       |
  868|  6.17M|    secp256k1_fe_sqr(&zz, s);
  ------------------
  |  |   94|  6.17M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  869|  6.17M|    secp256k1_fe_mul(&r->x, &r->x, &zz);                /* r->x *= s^2 */
  ------------------
  |  |   93|  6.17M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  870|  6.17M|    secp256k1_fe_mul(&r->y, &r->y, &zz);
  ------------------
  |  |   93|  6.17M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  871|  6.17M|    secp256k1_fe_mul(&r->y, &r->y, s);                  /* r->y *= s^3 */
  ------------------
  |  |   93|  6.17M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  872|  6.17M|    secp256k1_fe_mul(&r->z, &r->z, s);                  /* r->z *= s   */
  ------------------
  |  |   93|  6.17M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  873|       |
  874|  6.17M|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|  6.17M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  875|  6.17M|}
secp256k1.c:secp256k1_ge_set_gej_zinv:
   99|   802k|static void secp256k1_ge_set_gej_zinv(secp256k1_ge *r, const secp256k1_gej *a, const secp256k1_fe *zi) {
  100|   802k|    secp256k1_fe zi2;
  101|   802k|    secp256k1_fe zi3;
  102|   802k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|   802k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  103|   802k|    SECP256K1_FE_VERIFY(zi);
  ------------------
  |  |  345|   802k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  104|   802k|    VERIFY_CHECK(!a->infinity);
  105|       |
  106|   802k|    secp256k1_fe_sqr(&zi2, zi);
  ------------------
  |  |   94|   802k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  107|   802k|    secp256k1_fe_mul(&zi3, &zi2, zi);
  ------------------
  |  |   93|   802k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  108|   802k|    secp256k1_fe_mul(&r->x, &a->x, &zi2);
  ------------------
  |  |   93|   802k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  109|   802k|    secp256k1_fe_mul(&r->y, &a->y, &zi3);
  ------------------
  |  |   93|   802k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  110|   802k|    r->infinity = a->infinity;
  111|       |
  112|   802k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|   802k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  113|   802k|}
secp256k1.c:secp256k1_ge_table_set_globalz:
  289|   802k|static void secp256k1_ge_table_set_globalz(size_t len, secp256k1_ge *a, const secp256k1_fe *zr) {
  290|   802k|    size_t i;
  291|   802k|    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|   802k|    if (len > 0) {
  ------------------
  |  Branch (299:9): [True: 802k, False: 0]
  ------------------
  300|   802k|        i = len - 1;
  301|       |        /* Ensure all y values are in weak normal form for fast negation of points */
  302|   802k|        secp256k1_fe_normalize_weak(&a[i].y);
  ------------------
  |  |   79|   802k|#  define secp256k1_fe_normalize_weak secp256k1_fe_impl_normalize_weak
  ------------------
  303|   802k|        zs = zr[i];
  304|       |
  305|       |        /* Work our way backwards, using the z-ratios to scale the x/y values. */
  306|  6.42M|        while (i > 0) {
  ------------------
  |  Branch (306:16): [True: 5.62M, False: 802k]
  ------------------
  307|  5.62M|            if (i != len - 1) {
  ------------------
  |  Branch (307:17): [True: 4.81M, False: 802k]
  ------------------
  308|  4.81M|                secp256k1_fe_mul(&zs, &zs, &zr[i]);
  ------------------
  |  |   93|  4.81M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  309|  4.81M|            }
  310|  5.62M|            i--;
  311|  5.62M|            secp256k1_ge_set_ge_zinv(&a[i], &a[i], &zs);
  312|  5.62M|        }
  313|   802k|    }
  314|       |
  315|       |#ifdef VERIFY
  316|       |    for (i = 0; i < len; i++) {
  317|       |        SECP256K1_GE_VERIFY(&a[i]);
  318|       |    }
  319|       |#endif
  320|   802k|}
secp256k1.c:secp256k1_ge_set_ge_zinv:
  116|  5.62M|static void secp256k1_ge_set_ge_zinv(secp256k1_ge *r, const secp256k1_ge *a, const secp256k1_fe *zi) {
  117|  5.62M|    secp256k1_fe zi2;
  118|  5.62M|    secp256k1_fe zi3;
  119|  5.62M|    SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  212|  5.62M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  120|  5.62M|    SECP256K1_FE_VERIFY(zi);
  ------------------
  |  |  345|  5.62M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  121|  5.62M|    VERIFY_CHECK(!a->infinity);
  122|       |
  123|  5.62M|    secp256k1_fe_sqr(&zi2, zi);
  ------------------
  |  |   94|  5.62M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  124|  5.62M|    secp256k1_fe_mul(&zi3, &zi2, zi);
  ------------------
  |  |   93|  5.62M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  125|  5.62M|    secp256k1_fe_mul(&r->x, &a->x, &zi2);
  ------------------
  |  |   93|  5.62M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  126|  5.62M|    secp256k1_fe_mul(&r->y, &a->y, &zi3);
  ------------------
  |  |   93|  5.62M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  127|  5.62M|    r->infinity = a->infinity;
  128|       |
  129|  5.62M|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|  5.62M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  130|  5.62M|}
secp256k1.c:secp256k1_gej_double_var:
  495|  95.4M|static void secp256k1_gej_double_var(secp256k1_gej *r, const secp256k1_gej *a, secp256k1_fe *rzr) {
  496|  95.4M|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|  95.4M|#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|  95.4M|    if (a->infinity) {
  ------------------
  |  Branch (508:9): [True: 802k, False: 94.6M]
  ------------------
  509|   802k|        secp256k1_gej_set_infinity(r);
  510|   802k|        if (rzr != NULL) {
  ------------------
  |  Branch (510:13): [True: 0, False: 802k]
  ------------------
  511|      0|            secp256k1_fe_set_int(rzr, 1);
  ------------------
  |  |   83|      0|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  512|      0|        }
  513|   802k|        return;
  514|   802k|    }
  515|       |
  516|  94.6M|    if (rzr != NULL) {
  ------------------
  |  Branch (516:9): [True: 0, False: 94.6M]
  ------------------
  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|  94.6M|    secp256k1_gej_double(r, a);
  522|       |
  523|  94.6M|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|  94.6M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  524|  94.6M|}
secp256k1.c:secp256k1_gej_double:
  460|  94.6M|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|  94.6M|    secp256k1_fe l, s, t;
  463|  94.6M|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|  94.6M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  464|       |
  465|  94.6M|    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|  94.6M|    secp256k1_fe_mul(&r->z, &a->z, &a->y); /* Z3 = Y1*Z1 (1) */
  ------------------
  |  |   93|  94.6M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  477|  94.6M|    secp256k1_fe_sqr(&s, &a->y);           /* S = Y1^2 (1) */
  ------------------
  |  |   94|  94.6M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  478|  94.6M|    secp256k1_fe_sqr(&l, &a->x);           /* L = X1^2 (1) */
  ------------------
  |  |   94|  94.6M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  479|  94.6M|    secp256k1_fe_mul_int(&l, 3);           /* L = 3*X1^2 (3) */
  ------------------
  |  |  233|  94.6M|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   87|  94.6M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  94.6M|    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: 94.6M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  94.6M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 94.6M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  94.6M|    } \
  |  |  |  |   94|  94.6M|    stmt; \
  |  |  |  |   95|  94.6M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 94.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  480|  94.6M|    secp256k1_fe_half(&l);                 /* L = 3/2*X1^2 (2) */
  ------------------
  |  |  101|  94.6M|#  define secp256k1_fe_half secp256k1_fe_impl_half
  ------------------
  481|  94.6M|    secp256k1_fe_negate(&t, &s, 1);        /* T = -S (2) */
  ------------------
  |  |  211|  94.6M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  94.6M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  94.6M|    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: 94.6M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  94.6M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 94.6M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  94.6M|    } \
  |  |  |  |   94|  94.6M|    stmt; \
  |  |  |  |   95|  94.6M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 94.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  482|  94.6M|    secp256k1_fe_mul(&t, &t, &a->x);       /* T = -X1*S (1) */
  ------------------
  |  |   93|  94.6M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  483|  94.6M|    secp256k1_fe_sqr(&r->x, &l);           /* X3 = L^2 (1) */
  ------------------
  |  |   94|  94.6M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  484|  94.6M|    secp256k1_fe_add(&r->x, &t);           /* X3 = L^2 + T (2) */
  ------------------
  |  |   92|  94.6M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  485|  94.6M|    secp256k1_fe_add(&r->x, &t);           /* X3 = L^2 + 2*T (3) */
  ------------------
  |  |   92|  94.6M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  486|  94.6M|    secp256k1_fe_sqr(&s, &s);              /* S' = S^2 (1) */
  ------------------
  |  |   94|  94.6M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  487|  94.6M|    secp256k1_fe_add(&t, &r->x);           /* T' = X3 + T (4) */
  ------------------
  |  |   92|  94.6M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  488|  94.6M|    secp256k1_fe_mul(&r->y, &t, &l);       /* Y3 = L*(X3 + T) (1) */
  ------------------
  |  |   93|  94.6M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  489|  94.6M|    secp256k1_fe_add(&r->y, &s);           /* Y3 = L*(X3 + T) + S^2 (2) */
  ------------------
  |  |   92|  94.6M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  490|  94.6M|    secp256k1_fe_negate(&r->y, &r->y, 2);  /* Y3 = -(L*(X3 + T) + S^2) (3) */
  ------------------
  |  |  211|  94.6M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  94.6M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  94.6M|    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: 94.6M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  94.6M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 94.6M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  94.6M|    } \
  |  |  |  |   94|  94.6M|    stmt; \
  |  |  |  |   95|  94.6M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 94.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  491|       |
  492|  94.6M|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|  94.6M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  493|  94.6M|}
secp256k1.c:secp256k1_ge_from_storage:
  890|   278M|static void secp256k1_ge_from_storage(secp256k1_ge *r, const secp256k1_ge_storage *a) {
  891|   278M|    secp256k1_fe_from_storage(&r->x, &a->x);
  ------------------
  |  |   97|   278M|#  define secp256k1_fe_from_storage secp256k1_fe_impl_from_storage
  ------------------
  892|   278M|    secp256k1_fe_from_storage(&r->y, &a->y);
  ------------------
  |  |   97|   278M|#  define secp256k1_fe_from_storage secp256k1_fe_impl_from_storage
  ------------------
  893|   278M|    r->infinity = 0;
  894|       |
  895|   278M|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|   278M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  896|   278M|}
secp256k1.c:secp256k1_gej_add_zinv_var:
  653|  4.58M|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|  4.58M|    secp256k1_fe az, z12, u1, u2, s1, s2, h, i, h2, h3, t;
  656|  4.58M|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|  4.58M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  657|  4.58M|    SECP256K1_GE_VERIFY(b);
  ------------------
  |  |  212|  4.58M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  658|  4.58M|    SECP256K1_FE_VERIFY(bzinv);
  ------------------
  |  |  345|  4.58M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  659|       |
  660|  4.58M|    if (a->infinity) {
  ------------------
  |  Branch (660:9): [True: 269k, False: 4.31M]
  ------------------
  661|   269k|        secp256k1_fe bzinv2, bzinv3;
  662|   269k|        r->infinity = b->infinity;
  663|   269k|        secp256k1_fe_sqr(&bzinv2, bzinv);
  ------------------
  |  |   94|   269k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  664|   269k|        secp256k1_fe_mul(&bzinv3, &bzinv2, bzinv);
  ------------------
  |  |   93|   269k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  665|   269k|        secp256k1_fe_mul(&r->x, &b->x, &bzinv2);
  ------------------
  |  |   93|   269k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  666|   269k|        secp256k1_fe_mul(&r->y, &b->y, &bzinv3);
  ------------------
  |  |   93|   269k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  667|   269k|        secp256k1_fe_set_int(&r->z, 1);
  ------------------
  |  |   83|   269k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  668|   269k|        SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|   269k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  669|   269k|        return;
  670|   269k|    }
  671|  4.31M|    if (b->infinity) {
  ------------------
  |  Branch (671:9): [True: 0, False: 4.31M]
  ------------------
  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|  4.31M|    secp256k1_fe_mul(&az, &a->z, bzinv);
  ------------------
  |  |   93|  4.31M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  685|       |
  686|  4.31M|    secp256k1_fe_sqr(&z12, &az);
  ------------------
  |  |   94|  4.31M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  687|  4.31M|    u1 = a->x;
  688|  4.31M|    secp256k1_fe_mul(&u2, &b->x, &z12);
  ------------------
  |  |   93|  4.31M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  689|  4.31M|    s1 = a->y;
  690|  4.31M|    secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &az);
  ------------------
  |  |   93|  4.31M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
                  secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &az);
  ------------------
  |  |   93|  4.31M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  691|  4.31M|    secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |  211|  4.31M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  4.31M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  4.31M|    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.31M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  4.31M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 4.31M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  4.31M|    } \
  |  |  |  |   94|  4.31M|    stmt; \
  |  |  |  |   95|  4.31M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 4.31M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |   92|  4.31M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  692|  4.31M|    secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |  211|  4.31M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  4.31M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  4.31M|    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.31M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  4.31M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 4.31M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  4.31M|    } \
  |  |  |  |   94|  4.31M|    stmt; \
  |  |  |  |   95|  4.31M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 4.31M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |   92|  4.31M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  693|  4.31M|    if (secp256k1_fe_normalizes_to_zero_var(&h)) {
  ------------------
  |  |   82|  4.31M|#  define secp256k1_fe_normalizes_to_zero_var secp256k1_fe_impl_normalizes_to_zero_var
  ------------------
  |  Branch (693:9): [True: 0, False: 4.31M]
  ------------------
  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|  4.31M|    r->infinity = 0;
  703|  4.31M|    secp256k1_fe_mul(&r->z, &a->z, &h);
  ------------------
  |  |   93|  4.31M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  704|       |
  705|  4.31M|    secp256k1_fe_sqr(&h2, &h);
  ------------------
  |  |   94|  4.31M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  706|  4.31M|    secp256k1_fe_negate(&h2, &h2, 1);
  ------------------
  |  |  211|  4.31M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  4.31M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  4.31M|    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.31M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  4.31M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 4.31M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  4.31M|    } \
  |  |  |  |   94|  4.31M|    stmt; \
  |  |  |  |   95|  4.31M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 4.31M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  707|  4.31M|    secp256k1_fe_mul(&h3, &h2, &h);
  ------------------
  |  |   93|  4.31M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  708|  4.31M|    secp256k1_fe_mul(&t, &u1, &h2);
  ------------------
  |  |   93|  4.31M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  709|       |
  710|  4.31M|    secp256k1_fe_sqr(&r->x, &i);
  ------------------
  |  |   94|  4.31M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  711|  4.31M|    secp256k1_fe_add(&r->x, &h3);
  ------------------
  |  |   92|  4.31M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  712|  4.31M|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|  4.31M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  713|  4.31M|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|  4.31M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  714|       |
  715|  4.31M|    secp256k1_fe_add(&t, &r->x);
  ------------------
  |  |   92|  4.31M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  716|  4.31M|    secp256k1_fe_mul(&r->y, &t, &i);
  ------------------
  |  |   93|  4.31M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  717|  4.31M|    secp256k1_fe_mul(&h3, &h3, &s1);
  ------------------
  |  |   93|  4.31M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  718|  4.31M|    secp256k1_fe_add(&r->y, &h3);
  ------------------
  |  |   92|  4.31M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  719|       |
  720|  4.31M|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|  4.31M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  721|  4.31M|}
secp256k1.c:secp256k1_ge_is_infinity:
  143|   594k|static int secp256k1_ge_is_infinity(const secp256k1_ge *a) {
  144|   594k|    SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  212|   594k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  145|       |
  146|   594k|    return a->infinity;
  147|   594k|}
secp256k1.c:secp256k1_ge_set_infinity:
  331|  85.4k|static void secp256k1_ge_set_infinity(secp256k1_ge *r) {
  332|  85.4k|    r->infinity = 1;
  333|  85.4k|    secp256k1_fe_set_int(&r->x, 0);
  ------------------
  |  |   83|  85.4k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  334|  85.4k|    secp256k1_fe_set_int(&r->y, 0);
  ------------------
  |  |   83|  85.4k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  335|       |
  336|  85.4k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  212|  85.4k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  337|  85.4k|}
secp256k1.c:secp256k1_ge_eq_var:
  398|   509k|static int secp256k1_ge_eq_var(const secp256k1_ge *a, const secp256k1_ge *b) {
  399|   509k|    secp256k1_fe tmp;
  400|   509k|    SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  212|   509k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  401|   509k|    SECP256K1_GE_VERIFY(b);
  ------------------
  |  |  212|   509k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  402|       |
  403|   509k|    if (a->infinity != b->infinity) return 0;
  ------------------
  |  Branch (403:9): [True: 0, False: 509k]
  ------------------
  404|   509k|    if (a->infinity) return 1;
  ------------------
  |  Branch (404:9): [True: 0, False: 509k]
  ------------------
  405|       |
  406|   509k|    tmp = a->x;
  407|   509k|    secp256k1_fe_normalize_weak(&tmp);
  ------------------
  |  |   79|   509k|#  define secp256k1_fe_normalize_weak secp256k1_fe_impl_normalize_weak
  ------------------
  408|   509k|    if (!secp256k1_fe_equal(&tmp, &b->x)) return 0;
  ------------------
  |  Branch (408:9): [True: 455k, False: 53.5k]
  ------------------
  409|       |
  410|  53.5k|    tmp = a->y;
  411|  53.5k|    secp256k1_fe_normalize_weak(&tmp);
  ------------------
  |  |   79|  53.5k|#  define secp256k1_fe_normalize_weak secp256k1_fe_impl_normalize_weak
  ------------------
  412|  53.5k|    if (!secp256k1_fe_equal(&tmp, &b->y)) return 0;
  ------------------
  |  Branch (412:9): [True: 778, False: 52.7k]
  ------------------
  413|       |
  414|  52.7k|    return 1;
  415|  53.5k|}
secp256k1.c:secp256k1_ge_to_bytes_ext:
  997|  61.5k|static void secp256k1_ge_to_bytes_ext(unsigned char *data, const secp256k1_ge *ge) {
  998|  61.5k|    if (secp256k1_ge_is_infinity(ge)) {
  ------------------
  |  Branch (998:9): [True: 23.8k, False: 37.7k]
  ------------------
  999|  23.8k|        memset(data, 0, 64);
 1000|  37.7k|    } else {
 1001|  37.7k|        secp256k1_ge_to_bytes(data, ge);
 1002|  37.7k|    }
 1003|  61.5k|}
secp256k1.c:secp256k1_ge_from_bytes_ext:
 1005|  61.5k|static void secp256k1_ge_from_bytes_ext(secp256k1_ge *ge, const unsigned char *data) {
 1006|  61.5k|    static const unsigned char zeros[64] = { 0 };
 1007|  61.5k|    if (secp256k1_memcmp_var(data, zeros, sizeof(zeros)) == 0) {
  ------------------
  |  Branch (1007:9): [True: 23.8k, False: 37.7k]
  ------------------
 1008|  23.8k|        secp256k1_ge_set_infinity(ge);
 1009|  37.7k|    } else {
 1010|  37.7k|        secp256k1_ge_from_bytes(ge, data);
 1011|  37.7k|    }
 1012|  61.5k|}
secp256k1.c:secp256k1_ge_storage_cmov:
  911|  8.49G|static SECP256K1_INLINE void secp256k1_ge_storage_cmov(secp256k1_ge_storage *r, const secp256k1_ge_storage *a, int flag) {
  912|  8.49G|    VERIFY_CHECK(flag == 0 || flag == 1);
  913|  8.49G|    secp256k1_fe_storage_cmov(&r->x, &a->x, flag);
  914|  8.49G|    secp256k1_fe_storage_cmov(&r->y, &a->y, flag);
  915|  8.49G|}
secp256k1.c:secp256k1_gej_clear:
  339|  6.17M|static void secp256k1_gej_clear(secp256k1_gej *r) {
  340|  6.17M|    secp256k1_memclear_explicit(r, sizeof(secp256k1_gej));
  341|  6.17M|}
secp256k1.c:secp256k1_gej_add_var:
  526|   533k|static void secp256k1_gej_add_var(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_gej *b, secp256k1_fe *rzr) {
  527|       |    /* 12 mul, 4 sqr, 11 add/negate/normalizes_to_zero (ignoring special cases) */
  528|   533k|    secp256k1_fe z22, z12, u1, u2, s1, s2, h, i, h2, h3, t;
  529|   533k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|   533k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  530|   533k|    SECP256K1_GEJ_VERIFY(b);
  ------------------
  |  |  216|   533k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  531|       |
  532|   533k|    if (a->infinity) {
  ------------------
  |  Branch (532:9): [True: 61.5k, False: 471k]
  ------------------
  533|  61.5k|        VERIFY_CHECK(rzr == NULL);
  534|  61.5k|        *r = *b;
  535|  61.5k|        return;
  536|  61.5k|    }
  537|   471k|    if (b->infinity) {
  ------------------
  |  Branch (537:9): [True: 0, False: 471k]
  ------------------
  538|      0|        if (rzr != NULL) {
  ------------------
  |  Branch (538:13): [True: 0, False: 0]
  ------------------
  539|      0|            secp256k1_fe_set_int(rzr, 1);
  ------------------
  |  |   83|      0|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  540|      0|        }
  541|      0|        *r = *a;
  542|      0|        return;
  543|      0|    }
  544|       |
  545|   471k|    secp256k1_fe_sqr(&z22, &b->z);
  ------------------
  |  |   94|   471k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  546|   471k|    secp256k1_fe_sqr(&z12, &a->z);
  ------------------
  |  |   94|   471k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  547|   471k|    secp256k1_fe_mul(&u1, &a->x, &z22);
  ------------------
  |  |   93|   471k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  548|   471k|    secp256k1_fe_mul(&u2, &b->x, &z12);
  ------------------
  |  |   93|   471k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  549|   471k|    secp256k1_fe_mul(&s1, &a->y, &z22); secp256k1_fe_mul(&s1, &s1, &b->z);
  ------------------
  |  |   93|   471k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
                  secp256k1_fe_mul(&s1, &a->y, &z22); secp256k1_fe_mul(&s1, &s1, &b->z);
  ------------------
  |  |   93|   471k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  550|   471k|    secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &a->z);
  ------------------
  |  |   93|   471k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
                  secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &a->z);
  ------------------
  |  |   93|   471k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  551|   471k|    secp256k1_fe_negate(&h, &u1, 1); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |  211|   471k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   471k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   471k|    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: 471k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   471k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 471k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   471k|    } \
  |  |  |  |   94|   471k|    stmt; \
  |  |  |  |   95|   471k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 471k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&h, &u1, 1); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |   92|   471k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  552|   471k|    secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |  211|   471k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   471k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   471k|    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: 471k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   471k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 471k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   471k|    } \
  |  |  |  |   94|   471k|    stmt; \
  |  |  |  |   95|   471k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 471k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |   92|   471k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  553|   471k|    if (secp256k1_fe_normalizes_to_zero_var(&h)) {
  ------------------
  |  |   82|   471k|#  define secp256k1_fe_normalizes_to_zero_var secp256k1_fe_impl_normalizes_to_zero_var
  ------------------
  |  Branch (553:9): [True: 3.53k, False: 468k]
  ------------------
  554|  3.53k|        if (secp256k1_fe_normalizes_to_zero_var(&i)) {
  ------------------
  |  |   82|  3.53k|#  define secp256k1_fe_normalizes_to_zero_var secp256k1_fe_impl_normalizes_to_zero_var
  ------------------
  |  Branch (554:13): [True: 3.53k, False: 0]
  ------------------
  555|  3.53k|            secp256k1_gej_double_var(r, a, rzr);
  556|  3.53k|        } else {
  557|      0|            if (rzr != NULL) {
  ------------------
  |  Branch (557:17): [True: 0, False: 0]
  ------------------
  558|      0|                secp256k1_fe_set_int(rzr, 0);
  ------------------
  |  |   83|      0|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  559|      0|            }
  560|      0|            secp256k1_gej_set_infinity(r);
  561|      0|        }
  562|  3.53k|        return;
  563|  3.53k|    }
  564|       |
  565|   468k|    r->infinity = 0;
  566|   468k|    secp256k1_fe_mul(&t, &h, &b->z);
  ------------------
  |  |   93|   468k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  567|   468k|    if (rzr != NULL) {
  ------------------
  |  Branch (567:9): [True: 0, False: 468k]
  ------------------
  568|      0|        *rzr = t;
  569|      0|    }
  570|   468k|    secp256k1_fe_mul(&r->z, &a->z, &t);
  ------------------
  |  |   93|   468k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  571|       |
  572|   468k|    secp256k1_fe_sqr(&h2, &h);
  ------------------
  |  |   94|   468k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  573|   468k|    secp256k1_fe_negate(&h2, &h2, 1);
  ------------------
  |  |  211|   468k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|   468k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|   468k|    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: 468k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|   468k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 468k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|   468k|    } \
  |  |  |  |   94|   468k|    stmt; \
  |  |  |  |   95|   468k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 468k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  574|   468k|    secp256k1_fe_mul(&h3, &h2, &h);
  ------------------
  |  |   93|   468k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  575|   468k|    secp256k1_fe_mul(&t, &u1, &h2);
  ------------------
  |  |   93|   468k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  576|       |
  577|   468k|    secp256k1_fe_sqr(&r->x, &i);
  ------------------
  |  |   94|   468k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  578|   468k|    secp256k1_fe_add(&r->x, &h3);
  ------------------
  |  |   92|   468k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  579|   468k|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|   468k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  580|   468k|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|   468k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  581|       |
  582|   468k|    secp256k1_fe_add(&t, &r->x);
  ------------------
  |  |   92|   468k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  583|   468k|    secp256k1_fe_mul(&r->y, &t, &i);
  ------------------
  |  |   93|   468k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  584|   468k|    secp256k1_fe_mul(&h3, &h3, &s1);
  ------------------
  |  |   93|   468k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  585|   468k|    secp256k1_fe_add(&r->y, &h3);
  ------------------
  |  |   92|   468k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  586|       |
  587|   468k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|   468k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  588|   468k|}
secp256k1.c:secp256k1_gej_add_ge_var:
  590|  26.7M|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|  26.7M|    secp256k1_fe z12, u1, u2, s1, s2, h, i, h2, h3, t;
  593|  26.7M|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  216|  26.7M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  594|  26.7M|    SECP256K1_GE_VERIFY(b);
  ------------------
  |  |  212|  26.7M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  595|       |
  596|  26.7M|    if (a->infinity) {
  ------------------
  |  Branch (596:9): [True: 533k, False: 26.1M]
  ------------------
  597|   533k|        VERIFY_CHECK(rzr == NULL);
  598|   533k|        secp256k1_gej_set_ge(r, b);
  599|   533k|        return;
  600|   533k|    }
  601|  26.1M|    if (b->infinity) {
  ------------------
  |  Branch (601:9): [True: 0, False: 26.1M]
  ------------------
  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|  26.1M|    secp256k1_fe_sqr(&z12, &a->z);
  ------------------
  |  |   94|  26.1M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  610|  26.1M|    u1 = a->x;
  611|  26.1M|    secp256k1_fe_mul(&u2, &b->x, &z12);
  ------------------
  |  |   93|  26.1M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  612|  26.1M|    s1 = a->y;
  613|  26.1M|    secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &a->z);
  ------------------
  |  |   93|  26.1M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
                  secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &a->z);
  ------------------
  |  |   93|  26.1M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  614|  26.1M|    secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |  211|  26.1M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  26.1M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  26.1M|    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: 26.1M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  26.1M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 26.1M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  26.1M|    } \
  |  |  |  |   94|  26.1M|    stmt; \
  |  |  |  |   95|  26.1M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 26.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |   92|  26.1M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  615|  26.1M|    secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |  211|  26.1M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  26.1M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  26.1M|    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: 26.1M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  26.1M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 26.1M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  26.1M|    } \
  |  |  |  |   94|  26.1M|    stmt; \
  |  |  |  |   95|  26.1M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 26.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |   92|  26.1M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  616|  26.1M|    if (secp256k1_fe_normalizes_to_zero_var(&h)) {
  ------------------
  |  |   82|  26.1M|#  define secp256k1_fe_normalizes_to_zero_var secp256k1_fe_impl_normalizes_to_zero_var
  ------------------
  |  Branch (616:9): [True: 0, False: 26.1M]
  ------------------
  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|  26.1M|    r->infinity = 0;
  629|  26.1M|    if (rzr != NULL) {
  ------------------
  |  Branch (629:9): [True: 5.62M, False: 20.5M]
  ------------------
  630|  5.62M|        *rzr = h;
  631|  5.62M|    }
  632|  26.1M|    secp256k1_fe_mul(&r->z, &a->z, &h);
  ------------------
  |  |   93|  26.1M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  633|       |
  634|  26.1M|    secp256k1_fe_sqr(&h2, &h);
  ------------------
  |  |   94|  26.1M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  635|  26.1M|    secp256k1_fe_negate(&h2, &h2, 1);
  ------------------
  |  |  211|  26.1M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  26.1M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  26.1M|    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: 26.1M]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  26.1M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 26.1M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  26.1M|    } \
  |  |  |  |   94|  26.1M|    stmt; \
  |  |  |  |   95|  26.1M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 26.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  636|  26.1M|    secp256k1_fe_mul(&h3, &h2, &h);
  ------------------
  |  |   93|  26.1M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  637|  26.1M|    secp256k1_fe_mul(&t, &u1, &h2);
  ------------------
  |  |   93|  26.1M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  638|       |
  639|  26.1M|    secp256k1_fe_sqr(&r->x, &i);
  ------------------
  |  |   94|  26.1M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  640|  26.1M|    secp256k1_fe_add(&r->x, &h3);
  ------------------
  |  |   92|  26.1M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  641|  26.1M|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|  26.1M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  642|  26.1M|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|  26.1M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  643|       |
  644|  26.1M|    secp256k1_fe_add(&t, &r->x);
  ------------------
  |  |   92|  26.1M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  645|  26.1M|    secp256k1_fe_mul(&r->y, &t, &i);
  ------------------
  |  |   93|  26.1M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  646|  26.1M|    secp256k1_fe_mul(&h3, &h3, &s1);
  ------------------
  |  |   93|  26.1M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  647|  26.1M|    secp256k1_fe_add(&r->y, &h3);
  ------------------
  |  |   92|  26.1M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  648|       |
  649|  26.1M|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  216|  26.1M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  650|  26.1M|    if (rzr != NULL) SECP256K1_FE_VERIFY(rzr);
  ------------------
  |  |  345|  5.62M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  |  Branch (650:9): [True: 5.62M, False: 20.5M]
  ------------------
  651|  26.1M|}
secp256k1.c:secp256k1_ge_to_bytes:
  977|  7.63M|static void secp256k1_ge_to_bytes(unsigned char *buf, const secp256k1_ge *a) {
  978|  7.63M|    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|  7.63M|    STATIC_ASSERT(sizeof(secp256k1_ge_storage) == 64);
  ------------------
  |  |   74|  7.63M|#define STATIC_ASSERT(expr) do { \
  |  |   75|  7.63M|    switch(0) { \
  |  |  ------------------
  |  |  |  Branch (75:12): [Folded, False: 0]
  |  |  ------------------
  |  |   76|  7.63M|        case 0: \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 7.63M, False: 0]
  |  |  ------------------
  |  |   77|  7.63M|        /* If expr evaluates to 0, we have two case labels "0", which is illegal. */ \
  |  |   78|  7.63M|        case /* ERROR: static assertion failed */ (expr): \
  |  |  ------------------
  |  |  |  Branch (78:9): [True: 0, False: 7.63M]
  |  |  ------------------
  |  |   79|  7.63M|        ; \
  |  |   80|  7.63M|    } \
  |  |   81|  7.63M|} while(0)
  |  |  ------------------
  |  |  |  Branch (81:9): [Folded, False: 7.63M]
  |  |  ------------------
  ------------------
  984|  7.63M|    VERIFY_CHECK(!secp256k1_ge_is_infinity(a));
  985|  7.63M|    secp256k1_ge_to_storage(&s, a);
  986|  7.63M|    memcpy(buf, &s, 64);
  987|  7.63M|}
secp256k1.c:secp256k1_ge_to_storage:
  877|  7.63M|static void secp256k1_ge_to_storage(secp256k1_ge_storage *r, const secp256k1_ge *a) {
  878|  7.63M|    secp256k1_fe x, y;
  879|  7.63M|    SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  212|  7.63M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  880|  7.63M|    VERIFY_CHECK(!a->infinity);
  881|       |
  882|  7.63M|    x = a->x;
  883|  7.63M|    secp256k1_fe_normalize(&x);
  ------------------
  |  |   78|  7.63M|#  define secp256k1_fe_normalize secp256k1_fe_impl_normalize
  ------------------
  884|  7.63M|    y = a->y;
  885|  7.63M|    secp256k1_fe_normalize(&y);
  ------------------
  |  |   78|  7.63M|#  define secp256k1_fe_normalize secp256k1_fe_impl_normalize
  ------------------
  886|  7.63M|    secp256k1_fe_to_storage(&r->x, &x);
  ------------------
  |  |   96|  7.63M|#  define secp256k1_fe_to_storage secp256k1_fe_impl_to_storage
  ------------------
  887|  7.63M|    secp256k1_fe_to_storage(&r->y, &y);
  ------------------
  |  |   96|  7.63M|#  define secp256k1_fe_to_storage secp256k1_fe_impl_to_storage
  ------------------
  888|  7.63M|}
secp256k1.c:secp256k1_ge_from_bytes:
  989|  8.05M|static void secp256k1_ge_from_bytes(secp256k1_ge *r, const unsigned char *buf) {
  990|  8.05M|    secp256k1_ge_storage s;
  991|       |
  992|  8.05M|    STATIC_ASSERT(sizeof(secp256k1_ge_storage) == 64);
  ------------------
  |  |   74|  8.05M|#define STATIC_ASSERT(expr) do { \
  |  |   75|  8.05M|    switch(0) { \
  |  |  ------------------
  |  |  |  Branch (75:12): [Folded, False: 0]
  |  |  ------------------
  |  |   76|  8.05M|        case 0: \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 8.05M, False: 0]
  |  |  ------------------
  |  |   77|  8.05M|        /* If expr evaluates to 0, we have two case labels "0", which is illegal. */ \
  |  |   78|  8.05M|        case /* ERROR: static assertion failed */ (expr): \
  |  |  ------------------
  |  |  |  Branch (78:9): [True: 0, False: 8.05M]
  |  |  ------------------
  |  |   79|  8.05M|        ; \
  |  |   80|  8.05M|    } \
  |  |   81|  8.05M|} while(0)
  |  |  ------------------
  |  |  |  Branch (81:9): [Folded, False: 8.05M]
  |  |  ------------------
  ------------------
  993|  8.05M|    memcpy(&s, buf, 64);
  994|  8.05M|    secp256k1_ge_from_storage(r, &s);
  995|  8.05M|}

secp256k1.c:secp256k1_sha256_transform:
  133|  1.27M|static void secp256k1_sha256_transform(uint32_t *state, const unsigned char *blocks64, size_t n_blocks) {
  134|  2.55M|    while (n_blocks--) {
  ------------------
  |  Branch (134:12): [True: 1.27M, False: 1.27M]
  ------------------
  135|  1.27M|        secp256k1_sha256_transform_impl(state, blocks64);
  136|  1.27M|        blocks64 += 64;
  137|  1.27M|    }
  138|  1.27M|}
secp256k1.c:secp256k1_sha256_transform_impl:
   51|  1.27M|static void secp256k1_sha256_transform_impl(uint32_t* s, const unsigned char* buf) {
   52|  1.27M|    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];
   53|  1.27M|    uint32_t w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15;
   54|       |
   55|  1.27M|    Round(a, b, c, d, e, f, g, h, 0x428a2f98,  w0 = secp256k1_read_be32(&buf[0]));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   56|  1.27M|    Round(h, a, b, c, d, e, f, g, 0x71374491,  w1 = secp256k1_read_be32(&buf[4]));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   57|  1.27M|    Round(g, h, a, b, c, d, e, f, 0xb5c0fbcf,  w2 = secp256k1_read_be32(&buf[8]));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   58|  1.27M|    Round(f, g, h, a, b, c, d, e, 0xe9b5dba5,  w3 = secp256k1_read_be32(&buf[12]));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   59|  1.27M|    Round(e, f, g, h, a, b, c, d, 0x3956c25b,  w4 = secp256k1_read_be32(&buf[16]));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   60|  1.27M|    Round(d, e, f, g, h, a, b, c, 0x59f111f1,  w5 = secp256k1_read_be32(&buf[20]));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   61|  1.27M|    Round(c, d, e, f, g, h, a, b, 0x923f82a4,  w6 = secp256k1_read_be32(&buf[24]));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   62|  1.27M|    Round(b, c, d, e, f, g, h, a, 0xab1c5ed5,  w7 = secp256k1_read_be32(&buf[28]));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   63|  1.27M|    Round(a, b, c, d, e, f, g, h, 0xd807aa98,  w8 = secp256k1_read_be32(&buf[32]));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   64|  1.27M|    Round(h, a, b, c, d, e, f, g, 0x12835b01,  w9 = secp256k1_read_be32(&buf[36]));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   65|  1.27M|    Round(g, h, a, b, c, d, e, f, 0x243185be, w10 = secp256k1_read_be32(&buf[40]));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   66|  1.27M|    Round(f, g, h, a, b, c, d, e, 0x550c7dc3, w11 = secp256k1_read_be32(&buf[44]));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   67|  1.27M|    Round(e, f, g, h, a, b, c, d, 0x72be5d74, w12 = secp256k1_read_be32(&buf[48]));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   68|  1.27M|    Round(d, e, f, g, h, a, b, c, 0x80deb1fe, w13 = secp256k1_read_be32(&buf[52]));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   69|  1.27M|    Round(c, d, e, f, g, h, a, b, 0x9bdc06a7, w14 = secp256k1_read_be32(&buf[56]));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   70|  1.27M|    Round(b, c, d, e, f, g, h, a, 0xc19bf174, w15 = secp256k1_read_be32(&buf[60]));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   71|       |
   72|  1.27M|    Round(a, b, c, d, e, f, g, h, 0xe49b69c1, w0 += sigma1(w14) + w9 + sigma0(w1));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   73|  1.27M|    Round(h, a, b, c, d, e, f, g, 0xefbe4786, w1 += sigma1(w15) + w10 + sigma0(w2));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   74|  1.27M|    Round(g, h, a, b, c, d, e, f, 0x0fc19dc6, w2 += sigma1(w0) + w11 + sigma0(w3));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   75|  1.27M|    Round(f, g, h, a, b, c, d, e, 0x240ca1cc, w3 += sigma1(w1) + w12 + sigma0(w4));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   76|  1.27M|    Round(e, f, g, h, a, b, c, d, 0x2de92c6f, w4 += sigma1(w2) + w13 + sigma0(w5));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   77|  1.27M|    Round(d, e, f, g, h, a, b, c, 0x4a7484aa, w5 += sigma1(w3) + w14 + sigma0(w6));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   78|  1.27M|    Round(c, d, e, f, g, h, a, b, 0x5cb0a9dc, w6 += sigma1(w4) + w15 + sigma0(w7));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   79|  1.27M|    Round(b, c, d, e, f, g, h, a, 0x76f988da, w7 += sigma1(w5) + w0 + sigma0(w8));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   80|  1.27M|    Round(a, b, c, d, e, f, g, h, 0x983e5152, w8 += sigma1(w6) + w1 + sigma0(w9));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   81|  1.27M|    Round(h, a, b, c, d, e, f, g, 0xa831c66d, w9 += sigma1(w7) + w2 + sigma0(w10));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   82|  1.27M|    Round(g, h, a, b, c, d, e, f, 0xb00327c8, w10 += sigma1(w8) + w3 + sigma0(w11));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   83|  1.27M|    Round(f, g, h, a, b, c, d, e, 0xbf597fc7, w11 += sigma1(w9) + w4 + sigma0(w12));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   84|  1.27M|    Round(e, f, g, h, a, b, c, d, 0xc6e00bf3, w12 += sigma1(w10) + w5 + sigma0(w13));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   85|  1.27M|    Round(d, e, f, g, h, a, b, c, 0xd5a79147, w13 += sigma1(w11) + w6 + sigma0(w14));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   86|  1.27M|    Round(c, d, e, f, g, h, a, b, 0x06ca6351, w14 += sigma1(w12) + w7 + sigma0(w15));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   87|  1.27M|    Round(b, c, d, e, f, g, h, a, 0x14292967, w15 += sigma1(w13) + w8 + sigma0(w0));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   88|       |
   89|  1.27M|    Round(a, b, c, d, e, f, g, h, 0x27b70a85, w0 += sigma1(w14) + w9 + sigma0(w1));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   90|  1.27M|    Round(h, a, b, c, d, e, f, g, 0x2e1b2138, w1 += sigma1(w15) + w10 + sigma0(w2));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   91|  1.27M|    Round(g, h, a, b, c, d, e, f, 0x4d2c6dfc, w2 += sigma1(w0) + w11 + sigma0(w3));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   92|  1.27M|    Round(f, g, h, a, b, c, d, e, 0x53380d13, w3 += sigma1(w1) + w12 + sigma0(w4));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   93|  1.27M|    Round(e, f, g, h, a, b, c, d, 0x650a7354, w4 += sigma1(w2) + w13 + sigma0(w5));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   94|  1.27M|    Round(d, e, f, g, h, a, b, c, 0x766a0abb, w5 += sigma1(w3) + w14 + sigma0(w6));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   95|  1.27M|    Round(c, d, e, f, g, h, a, b, 0x81c2c92e, w6 += sigma1(w4) + w15 + sigma0(w7));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   96|  1.27M|    Round(b, c, d, e, f, g, h, a, 0x92722c85, w7 += sigma1(w5) + w0 + sigma0(w8));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   97|  1.27M|    Round(a, b, c, d, e, f, g, h, 0xa2bfe8a1, w8 += sigma1(w6) + w1 + sigma0(w9));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   98|  1.27M|    Round(h, a, b, c, d, e, f, g, 0xa81a664b, w9 += sigma1(w7) + w2 + sigma0(w10));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
   99|  1.27M|    Round(g, h, a, b, c, d, e, f, 0xc24b8b70, w10 += sigma1(w8) + w3 + sigma0(w11));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
  100|  1.27M|    Round(f, g, h, a, b, c, d, e, 0xc76c51a3, w11 += sigma1(w9) + w4 + sigma0(w12));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
  101|  1.27M|    Round(e, f, g, h, a, b, c, d, 0xd192e819, w12 += sigma1(w10) + w5 + sigma0(w13));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
  102|  1.27M|    Round(d, e, f, g, h, a, b, c, 0xd6990624, w13 += sigma1(w11) + w6 + sigma0(w14));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
  103|  1.27M|    Round(c, d, e, f, g, h, a, b, 0xf40e3585, w14 += sigma1(w12) + w7 + sigma0(w15));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
  104|  1.27M|    Round(b, c, d, e, f, g, h, a, 0x106aa070, w15 += sigma1(w13) + w8 + sigma0(w0));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
  105|       |
  106|  1.27M|    Round(a, b, c, d, e, f, g, h, 0x19a4c116, w0 += sigma1(w14) + w9 + sigma0(w1));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
  107|  1.27M|    Round(h, a, b, c, d, e, f, g, 0x1e376c08, w1 += sigma1(w15) + w10 + sigma0(w2));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
  108|  1.27M|    Round(g, h, a, b, c, d, e, f, 0x2748774c, w2 += sigma1(w0) + w11 + sigma0(w3));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
  109|  1.27M|    Round(f, g, h, a, b, c, d, e, 0x34b0bcb5, w3 += sigma1(w1) + w12 + sigma0(w4));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
  110|  1.27M|    Round(e, f, g, h, a, b, c, d, 0x391c0cb3, w4 += sigma1(w2) + w13 + sigma0(w5));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
  111|  1.27M|    Round(d, e, f, g, h, a, b, c, 0x4ed8aa4a, w5 += sigma1(w3) + w14 + sigma0(w6));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
  112|  1.27M|    Round(c, d, e, f, g, h, a, b, 0x5b9cca4f, w6 += sigma1(w4) + w15 + sigma0(w7));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
  113|  1.27M|    Round(b, c, d, e, f, g, h, a, 0x682e6ff3, w7 += sigma1(w5) + w0 + sigma0(w8));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
  114|  1.27M|    Round(a, b, c, d, e, f, g, h, 0x748f82ee, w8 += sigma1(w6) + w1 + sigma0(w9));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
  115|  1.27M|    Round(h, a, b, c, d, e, f, g, 0x78a5636f, w9 += sigma1(w7) + w2 + sigma0(w10));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
  116|  1.27M|    Round(g, h, a, b, c, d, e, f, 0x84c87814, w10 += sigma1(w8) + w3 + sigma0(w11));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
  117|  1.27M|    Round(f, g, h, a, b, c, d, e, 0x8cc70208, w11 += sigma1(w9) + w4 + sigma0(w12));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
  118|  1.27M|    Round(e, f, g, h, a, b, c, d, 0x90befffa, w12 += sigma1(w10) + w5 + sigma0(w13));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
  119|  1.27M|    Round(d, e, f, g, h, a, b, c, 0xa4506ceb, w13 += sigma1(w11) + w6 + sigma0(w14));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
  120|  1.27M|    Round(c, d, e, f, g, h, a, b, 0xbef9a3f7, w14 + sigma1(w12) + w7 + sigma0(w15));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
  121|  1.27M|    Round(b, c, d, e, f, g, h, a, 0xc67178f2, w15 + sigma1(w13) + w8 + sigma0(w0));
  ------------------
  |  |   24|  1.27M|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|  1.27M|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|  1.27M|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|  1.27M|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|  1.27M|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|  1.27M|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|  1.27M|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|  1.27M|    (d) += t1; \
  |  |   28|  1.27M|    (h) = t1 + t2; \
  |  |   29|  1.27M|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded, False: 1.27M]
  |  |  ------------------
  ------------------
  122|       |
  123|  1.27M|    s[0] += a;
  124|  1.27M|    s[1] += b;
  125|  1.27M|    s[2] += c;
  126|  1.27M|    s[3] += d;
  127|  1.27M|    s[4] += e;
  128|  1.27M|    s[5] += f;
  129|  1.27M|    s[6] += g;
  130|  1.27M|    s[7] += h;
  131|  1.27M|}
secp256k1.c:secp256k1_sha256_write:
  210|  2.57M|static void secp256k1_sha256_write(const secp256k1_hash_ctx *hash_ctx, secp256k1_sha256 *hash, const unsigned char *data, size_t len) {
  211|  2.57M|    size_t chunk_len;
  212|  2.57M|    size_t bufsize = hash->bytes & 0x3F;
  213|  2.57M|    hash->bytes += len;
  214|  2.57M|    VERIFY_CHECK(hash->bytes >= len);
  215|  2.57M|    VERIFY_CHECK(hash_ctx != NULL);
  216|  2.57M|    VERIFY_CHECK(hash_ctx->fn_sha256_compression != NULL);
  217|       |
  218|       |    /* If we exceed the 64-byte block size with this input, process it and wipe the buffer */
  219|  2.57M|    chunk_len = 64 - bufsize;
  220|  2.57M|    if (bufsize && len >= chunk_len) {
  ------------------
  |  Branch (220:9): [True: 2.03M, False: 544k]
  |  Branch (220:20): [True: 1.27M, False: 755k]
  ------------------
  221|  1.27M|        memcpy(hash->buf + bufsize, data, chunk_len);
  222|  1.27M|        data += chunk_len;
  223|  1.27M|        len -= chunk_len;
  224|  1.27M|        hash_ctx->fn_sha256_compression(hash->s, hash->buf, 1);
  225|  1.27M|        bufsize = 0;
  226|  1.27M|    }
  227|       |
  228|       |    /* If we still have data to process, invoke compression directly on the input */
  229|  2.57M|    if (len >= 64) {
  ------------------
  |  Branch (229:9): [True: 0, False: 2.57M]
  ------------------
  230|      0|        const size_t n_blocks = len / 64;
  231|      0|        const size_t advance = n_blocks * 64;
  232|      0|        hash_ctx->fn_sha256_compression(hash->s, data, n_blocks);
  233|      0|        data += advance;
  234|      0|        len -= advance;
  235|      0|    }
  236|       |
  237|       |    /* Fill the buffer with what remains */
  238|  2.57M|    if (len) {
  ------------------
  |  Branch (238:9): [True: 2.03M, False: 544k]
  ------------------
  239|  2.03M|        memcpy(hash->buf + bufsize, data, len);
  240|  2.03M|    }
  241|  2.57M|}
secp256k1.c:secp256k1_sha256_finalize:
  243|   542k|static void secp256k1_sha256_finalize(const secp256k1_hash_ctx *hash_ctx, secp256k1_sha256 *hash, unsigned char *out32) {
  244|   542k|    static const unsigned char pad[64] = {0x80};
  245|   542k|    unsigned char sizedesc[8];
  246|   542k|    int i;
  247|       |    /* The maximum message size of SHA256 is 2^64-1 bits. */
  248|   542k|    VERIFY_CHECK(hash->bytes < ((uint64_t)1 << 61));
  249|   542k|    secp256k1_write_be32(&sizedesc[0], hash->bytes >> 29);
  250|   542k|    secp256k1_write_be32(&sizedesc[4], hash->bytes << 3);
  251|   542k|    secp256k1_sha256_write(hash_ctx, hash, pad, 1 + ((119 - (hash->bytes % 64)) % 64));
  252|   542k|    secp256k1_sha256_write(hash_ctx, hash, sizedesc, 8);
  253|  4.87M|    for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (253:17): [True: 4.33M, False: 542k]
  ------------------
  254|  4.33M|        secp256k1_write_be32(&out32[4*i], hash->s[i]);
  255|  4.33M|        hash->s[i] = 0;
  256|  4.33M|    }
  257|   542k|}
secp256k1.c:secp256k1_sha256_initialize_midstate:
   43|   542k|static void secp256k1_sha256_initialize_midstate(secp256k1_sha256 *hash, uint64_t bytes, const uint32_t state[8]) {
   44|   542k|    VERIFY_CHECK((bytes & 0x3F) == 0);
   45|   542k|    VERIFY_CHECK(state != NULL);
   46|   542k|    memcpy(hash->s, state, sizeof(hash->s));
   47|   542k|    hash->bytes = bytes;
   48|   542k|}

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

secp256k1.c:secp256k1_modinv64_update_de_62:
  411|  65.0M|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|  65.0M|    const uint64_t M62 = UINT64_MAX >> 2;
  413|  65.0M|    const int64_t d0 = d->v[0], d1 = d->v[1], d2 = d->v[2], d3 = d->v[3], d4 = d->v[4];
  414|  65.0M|    const int64_t e0 = e->v[0], e1 = e->v[1], e2 = e->v[2], e3 = e->v[3], e4 = e->v[4];
  415|  65.0M|    const int64_t u = t->u, v = t->v, q = t->q, r = t->r;
  416|  65.0M|    int64_t md, me, sd, se;
  417|  65.0M|    secp256k1_int128 cd, ce;
  418|  65.0M|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(d, 5, &modinfo->modulus, -2) > 0); /* d > -2*modulus */
  419|  65.0M|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(d, 5, &modinfo->modulus, 1) < 0);  /* d <    modulus */
  420|  65.0M|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(e, 5, &modinfo->modulus, -2) > 0); /* e > -2*modulus */
  421|  65.0M|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(e, 5, &modinfo->modulus, 1) < 0);  /* e <    modulus */
  422|  65.0M|    VERIFY_CHECK(secp256k1_modinv64_abs(u) <= (((int64_t)1 << 62) - secp256k1_modinv64_abs(v))); /* |u|+|v| <= 2^62 */
  423|  65.0M|    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|  65.0M|    sd = d4 >> 63;
  427|  65.0M|    se = e4 >> 63;
  428|  65.0M|    md = (u & sd) + (v & se);
  429|  65.0M|    me = (q & sd) + (r & se);
  430|       |    /* Begin computing t*[d,e]. */
  431|  65.0M|    secp256k1_i128_mul(&cd, u, d0);
  432|  65.0M|    secp256k1_i128_accum_mul(&cd, v, e0);
  433|  65.0M|    secp256k1_i128_mul(&ce, q, d0);
  434|  65.0M|    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|  65.0M|    md -= (modinfo->modulus_inv62 * secp256k1_i128_to_u64(&cd) + md) & M62;
  437|  65.0M|    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|  65.0M|    secp256k1_i128_accum_mul(&cd, modinfo->modulus.v[0], md);
  440|  65.0M|    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|  65.0M|    VERIFY_CHECK((secp256k1_i128_to_u64(&cd) & M62) == 0); secp256k1_i128_rshift(&cd, 62);
  443|  65.0M|    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|  65.0M|    secp256k1_i128_accum_mul(&cd, u, d1);
  446|  65.0M|    secp256k1_i128_accum_mul(&cd, v, e1);
  447|  65.0M|    secp256k1_i128_accum_mul(&ce, q, d1);
  448|  65.0M|    secp256k1_i128_accum_mul(&ce, r, e1);
  449|  65.0M|    if (modinfo->modulus.v[1]) { /* Optimize for the case where limb of modulus is zero. */
  ------------------
  |  Branch (449:9): [True: 0, False: 65.0M]
  ------------------
  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|  65.0M|    d->v[0] = secp256k1_i128_to_u64(&cd) & M62; secp256k1_i128_rshift(&cd, 62);
  454|  65.0M|    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|  65.0M|    secp256k1_i128_accum_mul(&cd, u, d2);
  457|  65.0M|    secp256k1_i128_accum_mul(&cd, v, e2);
  458|  65.0M|    secp256k1_i128_accum_mul(&ce, q, d2);
  459|  65.0M|    secp256k1_i128_accum_mul(&ce, r, e2);
  460|  65.0M|    if (modinfo->modulus.v[2]) { /* Optimize for the case where limb of modulus is zero. */
  ------------------
  |  Branch (460:9): [True: 0, False: 65.0M]
  ------------------
  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|  65.0M|    d->v[1] = secp256k1_i128_to_u64(&cd) & M62; secp256k1_i128_rshift(&cd, 62);
  465|  65.0M|    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|  65.0M|    secp256k1_i128_accum_mul(&cd, u, d3);
  468|  65.0M|    secp256k1_i128_accum_mul(&cd, v, e3);
  469|  65.0M|    secp256k1_i128_accum_mul(&ce, q, d3);
  470|  65.0M|    secp256k1_i128_accum_mul(&ce, r, e3);
  471|  65.0M|    if (modinfo->modulus.v[3]) { /* Optimize for the case where limb of modulus is zero. */
  ------------------
  |  Branch (471:9): [True: 0, False: 65.0M]
  ------------------
  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|  65.0M|    d->v[2] = secp256k1_i128_to_u64(&cd) & M62; secp256k1_i128_rshift(&cd, 62);
  476|  65.0M|    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|  65.0M|    secp256k1_i128_accum_mul(&cd, u, d4);
  479|  65.0M|    secp256k1_i128_accum_mul(&cd, v, e4);
  480|  65.0M|    secp256k1_i128_accum_mul(&ce, q, d4);
  481|  65.0M|    secp256k1_i128_accum_mul(&ce, r, e4);
  482|  65.0M|    secp256k1_i128_accum_mul(&cd, modinfo->modulus.v[4], md);
  483|  65.0M|    secp256k1_i128_accum_mul(&ce, modinfo->modulus.v[4], me);
  484|  65.0M|    d->v[3] = secp256k1_i128_to_u64(&cd) & M62; secp256k1_i128_rshift(&cd, 62);
  485|  65.0M|    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|  65.0M|    d->v[4] = secp256k1_i128_to_i64(&cd);
  488|  65.0M|    e->v[4] = secp256k1_i128_to_i64(&ce);
  489|       |
  490|  65.0M|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(d, 5, &modinfo->modulus, -2) > 0); /* d > -2*modulus */
  491|  65.0M|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(d, 5, &modinfo->modulus, 1) < 0);  /* d <    modulus */
  492|  65.0M|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(e, 5, &modinfo->modulus, -2) > 0); /* e > -2*modulus */
  493|  65.0M|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(e, 5, &modinfo->modulus, 1) < 0);  /* e <    modulus */
  494|  65.0M|}
secp256k1.c:secp256k1_modinv64_normalize_62:
   88|  6.50M|static void secp256k1_modinv64_normalize_62(secp256k1_modinv64_signed62 *r, int64_t sign, const secp256k1_modinv64_modinfo *modinfo) {
   89|  6.50M|    const int64_t M62 = (int64_t)(UINT64_MAX >> 2);
   90|  6.50M|    int64_t r0 = r->v[0], r1 = r->v[1], r2 = r->v[2], r3 = r->v[3], r4 = r->v[4];
   91|  6.50M|    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|  6.50M|    cond_add = r4 >> 63;
  110|  6.50M|    r0 += modinfo->modulus.v[0] & cond_add;
  111|  6.50M|    r1 += modinfo->modulus.v[1] & cond_add;
  112|  6.50M|    r2 += modinfo->modulus.v[2] & cond_add;
  113|  6.50M|    r3 += modinfo->modulus.v[3] & cond_add;
  114|  6.50M|    r4 += modinfo->modulus.v[4] & cond_add;
  115|  6.50M|    cond_negate = sign >> 63;
  116|  6.50M|    r0 = (r0 ^ cond_negate) - cond_negate;
  117|  6.50M|    r1 = (r1 ^ cond_negate) - cond_negate;
  118|  6.50M|    r2 = (r2 ^ cond_negate) - cond_negate;
  119|  6.50M|    r3 = (r3 ^ cond_negate) - cond_negate;
  120|  6.50M|    r4 = (r4 ^ cond_negate) - cond_negate;
  121|       |    /* Propagate the top bits, to bring limbs back to range (-2^62,2^62). */
  122|  6.50M|    r1 += r0 >> 62; r0 &= M62;
  123|  6.50M|    r2 += r1 >> 62; r1 &= M62;
  124|  6.50M|    r3 += r2 >> 62; r2 &= M62;
  125|  6.50M|    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|  6.50M|    cond_add = r4 >> 63;
  130|  6.50M|    r0 += modinfo->modulus.v[0] & cond_add;
  131|  6.50M|    r1 += modinfo->modulus.v[1] & cond_add;
  132|  6.50M|    r2 += modinfo->modulus.v[2] & cond_add;
  133|  6.50M|    r3 += modinfo->modulus.v[3] & cond_add;
  134|  6.50M|    r4 += modinfo->modulus.v[4] & cond_add;
  135|       |    /* And propagate again. */
  136|  6.50M|    r1 += r0 >> 62; r0 &= M62;
  137|  6.50M|    r2 += r1 >> 62; r1 &= M62;
  138|  6.50M|    r3 += r2 >> 62; r2 &= M62;
  139|  6.50M|    r4 += r3 >> 62; r3 &= M62;
  140|       |
  141|  6.50M|    r->v[0] = r0;
  142|  6.50M|    r->v[1] = r1;
  143|  6.50M|    r->v[2] = r2;
  144|  6.50M|    r->v[3] = r3;
  145|  6.50M|    r->v[4] = r4;
  146|       |
  147|  6.50M|    VERIFY_CHECK(r0 >> 62 == 0);
  148|  6.50M|    VERIFY_CHECK(r1 >> 62 == 0);
  149|  6.50M|    VERIFY_CHECK(r2 >> 62 == 0);
  150|  6.50M|    VERIFY_CHECK(r3 >> 62 == 0);
  151|  6.50M|    VERIFY_CHECK(r4 >> 62 == 0);
  152|  6.50M|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(r, 5, &modinfo->modulus, 0) >= 0); /* r >= 0 */
  153|  6.50M|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(r, 5, &modinfo->modulus, 1) < 0); /* r < modulus */
  154|  6.50M|}
secp256k1.c:secp256k1_modinv64:
  588|  6.50M|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|  6.50M|    secp256k1_modinv64_signed62 d = {{0, 0, 0, 0, 0}};
  591|  6.50M|    secp256k1_modinv64_signed62 e = {{1, 0, 0, 0, 0}};
  592|  6.50M|    secp256k1_modinv64_signed62 f = modinfo->modulus;
  593|  6.50M|    secp256k1_modinv64_signed62 g = *x;
  594|  6.50M|    int i;
  595|  6.50M|    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|  71.5M|    for (i = 0; i < 10; ++i) {
  ------------------
  |  Branch (598:17): [True: 65.0M, False: 6.50M]
  ------------------
  599|       |        /* Compute transition matrix and new zeta after 59 divsteps. */
  600|  65.0M|        secp256k1_modinv64_trans2x2 t;
  601|  65.0M|        zeta = secp256k1_modinv64_divsteps_59(zeta, f.v[0], g.v[0], &t);
  602|       |        /* Update d,e using that transition matrix. */
  603|  65.0M|        secp256k1_modinv64_update_de_62(&d, &e, &t, modinfo);
  604|       |        /* Update f,g using that transition matrix. */
  605|  65.0M|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, 5, &modinfo->modulus, -1) > 0); /* f > -modulus */
  606|  65.0M|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, 5, &modinfo->modulus, 1) <= 0); /* f <= modulus */
  607|  65.0M|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, 5, &modinfo->modulus, -1) > 0); /* g > -modulus */
  608|  65.0M|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, 5, &modinfo->modulus, 1) < 0);  /* g <  modulus */
  609|       |
  610|  65.0M|        secp256k1_modinv64_update_fg_62(&f, &g, &t);
  611|       |
  612|  65.0M|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, 5, &modinfo->modulus, -1) > 0); /* f > -modulus */
  613|  65.0M|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, 5, &modinfo->modulus, 1) <= 0); /* f <= modulus */
  614|  65.0M|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, 5, &modinfo->modulus, -1) > 0); /* g > -modulus */
  615|  65.0M|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, 5, &modinfo->modulus, 1) < 0);  /* g <  modulus */
  616|  65.0M|    }
  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|  6.50M|    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|  6.50M|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, 5, &SECP256K1_SIGNED62_ONE, -1) == 0 ||
  626|  6.50M|                 secp256k1_modinv64_mul_cmp_62(&f, 5, &SECP256K1_SIGNED62_ONE, 1) == 0 ||
  627|  6.50M|                 (secp256k1_modinv64_mul_cmp_62(x, 5, &SECP256K1_SIGNED62_ONE, 0) == 0 &&
  628|  6.50M|                  secp256k1_modinv64_mul_cmp_62(&d, 5, &SECP256K1_SIGNED62_ONE, 0) == 0 &&
  629|  6.50M|                  secp256k1_modinv64_mul_cmp_62(&f, 5, &modinfo->modulus, 1) == 0));
  630|       |
  631|       |    /* Optionally negate d, normalize to [0,modulus), and return it. */
  632|  6.50M|    secp256k1_modinv64_normalize_62(&d, f.v[4], modinfo);
  633|  6.50M|    *x = d;
  634|  6.50M|}
secp256k1.c:secp256k1_modinv64_divsteps_59:
  167|  65.0M|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|  65.0M|    uint64_t u = 8, v = 0, q = 0, r = 8;
  176|  65.0M|    volatile uint64_t c1, c2;
  177|  65.0M|    uint64_t mask1, mask2, f = f0, g = g0, x, y, z;
  178|  65.0M|    int i;
  179|       |
  180|  3.90G|    for (i = 3; i < 62; ++i) {
  ------------------
  |  Branch (180:17): [True: 3.83G, False: 65.0M]
  ------------------
  181|  3.83G|        VERIFY_CHECK((f & 1) == 1); /* f must always be odd */
  182|  3.83G|        VERIFY_CHECK((u * f0 + v * g0) == f << i);
  183|  3.83G|        VERIFY_CHECK((q * f0 + r * g0) == g << i);
  184|       |        /* Compute conditional masks for (zeta < 0) and for (g & 1). */
  185|  3.83G|        c1 = zeta >> 63;
  186|  3.83G|        mask1 = c1;
  187|  3.83G|        c2 = g & 1;
  188|  3.83G|        mask2 = -c2;
  189|       |        /* Compute x,y,z, conditionally negated versions of f,u,v. */
  190|  3.83G|        x = (f ^ mask1) - mask1;
  191|  3.83G|        y = (u ^ mask1) - mask1;
  192|  3.83G|        z = (v ^ mask1) - mask1;
  193|       |        /* Conditionally add x,y,z to g,q,r. */
  194|  3.83G|        g += x & mask2;
  195|  3.83G|        q += y & mask2;
  196|  3.83G|        r += z & mask2;
  197|       |        /* In what follows, c1 is a condition mask for (zeta < 0) and (g & 1). */
  198|  3.83G|        mask1 &= mask2;
  199|       |        /* Conditionally change zeta into -zeta-2 or zeta-1. */
  200|  3.83G|        zeta = (zeta ^ mask1) - 1;
  201|       |        /* Conditionally add g,q,r to f,u,v. */
  202|  3.83G|        f += g & mask1;
  203|  3.83G|        u += q & mask1;
  204|  3.83G|        v += r & mask1;
  205|       |        /* Shifts */
  206|  3.83G|        g >>= 1;
  207|  3.83G|        u <<= 1;
  208|  3.83G|        v <<= 1;
  209|       |        /* Bounds on zeta that follow from the bounds on iteration count (max 10*59 divsteps). */
  210|  3.83G|        VERIFY_CHECK(zeta >= -591 && zeta <= 591);
  211|  3.83G|    }
  212|       |    /* Return data in t and return value. */
  213|  65.0M|    t->u = (int64_t)u;
  214|  65.0M|    t->v = (int64_t)v;
  215|  65.0M|    t->q = (int64_t)q;
  216|  65.0M|    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|  65.0M|    VERIFY_CHECK(secp256k1_modinv64_det_check_pow2(t, 65, 0));
  225|       |
  226|  65.0M|    return zeta;
  227|  65.0M|}
secp256k1.c:secp256k1_modinv64_update_fg_62:
  500|  65.0M|static void secp256k1_modinv64_update_fg_62(secp256k1_modinv64_signed62 *f, secp256k1_modinv64_signed62 *g, const secp256k1_modinv64_trans2x2 *t) {
  501|  65.0M|    const uint64_t M62 = UINT64_MAX >> 2;
  502|  65.0M|    const int64_t f0 = f->v[0], f1 = f->v[1], f2 = f->v[2], f3 = f->v[3], f4 = f->v[4];
  503|  65.0M|    const int64_t g0 = g->v[0], g1 = g->v[1], g2 = g->v[2], g3 = g->v[3], g4 = g->v[4];
  504|  65.0M|    const int64_t u = t->u, v = t->v, q = t->q, r = t->r;
  505|  65.0M|    secp256k1_int128 cf, cg;
  506|       |    /* Start computing t*[f,g]. */
  507|  65.0M|    secp256k1_i128_mul(&cf, u, f0);
  508|  65.0M|    secp256k1_i128_accum_mul(&cf, v, g0);
  509|  65.0M|    secp256k1_i128_mul(&cg, q, f0);
  510|  65.0M|    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|  65.0M|    VERIFY_CHECK((secp256k1_i128_to_u64(&cf) & M62) == 0); secp256k1_i128_rshift(&cf, 62);
  513|  65.0M|    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|  65.0M|    secp256k1_i128_accum_mul(&cf, u, f1);
  516|  65.0M|    secp256k1_i128_accum_mul(&cf, v, g1);
  517|  65.0M|    secp256k1_i128_accum_mul(&cg, q, f1);
  518|  65.0M|    secp256k1_i128_accum_mul(&cg, r, g1);
  519|  65.0M|    f->v[0] = secp256k1_i128_to_u64(&cf) & M62; secp256k1_i128_rshift(&cf, 62);
  520|  65.0M|    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|  65.0M|    secp256k1_i128_accum_mul(&cf, u, f2);
  523|  65.0M|    secp256k1_i128_accum_mul(&cf, v, g2);
  524|  65.0M|    secp256k1_i128_accum_mul(&cg, q, f2);
  525|  65.0M|    secp256k1_i128_accum_mul(&cg, r, g2);
  526|  65.0M|    f->v[1] = secp256k1_i128_to_u64(&cf) & M62; secp256k1_i128_rshift(&cf, 62);
  527|  65.0M|    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|  65.0M|    secp256k1_i128_accum_mul(&cf, u, f3);
  530|  65.0M|    secp256k1_i128_accum_mul(&cf, v, g3);
  531|  65.0M|    secp256k1_i128_accum_mul(&cg, q, f3);
  532|  65.0M|    secp256k1_i128_accum_mul(&cg, r, g3);
  533|  65.0M|    f->v[2] = secp256k1_i128_to_u64(&cf) & M62; secp256k1_i128_rshift(&cf, 62);
  534|  65.0M|    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|  65.0M|    secp256k1_i128_accum_mul(&cf, u, f4);
  537|  65.0M|    secp256k1_i128_accum_mul(&cf, v, g4);
  538|  65.0M|    secp256k1_i128_accum_mul(&cg, q, f4);
  539|  65.0M|    secp256k1_i128_accum_mul(&cg, r, g4);
  540|  65.0M|    f->v[3] = secp256k1_i128_to_u64(&cf) & M62; secp256k1_i128_rshift(&cf, 62);
  541|  65.0M|    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|  65.0M|    f->v[4] = secp256k1_i128_to_i64(&cf);
  544|  65.0M|    g->v[4] = secp256k1_i128_to_i64(&cg);
  545|  65.0M|}

secp256k1_xonly_pubkey_parse:
   29|   151k|int secp256k1_xonly_pubkey_parse(const secp256k1_context* ctx, secp256k1_xonly_pubkey *pubkey, const unsigned char *input32) {
   30|   151k|    secp256k1_ge pk;
   31|   151k|    secp256k1_fe x;
   32|       |
   33|   151k|    VERIFY_CHECK(ctx != NULL);
   34|   151k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|   151k|#define ARG_CHECK(cond) do { \
  |  |   46|   151k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|   151k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 151k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|   151k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 151k]
  |  |  ------------------
  ------------------
   35|   151k|    memset(pubkey, 0, sizeof(*pubkey));
   36|   151k|    ARG_CHECK(input32 != NULL);
  ------------------
  |  |   45|   151k|#define ARG_CHECK(cond) do { \
  |  |   46|   151k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|   151k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 151k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|   151k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 151k]
  |  |  ------------------
  ------------------
   37|       |
   38|   151k|    if (!secp256k1_fe_set_b32_limit(&x, input32)) {
  ------------------
  |  |   88|   151k|#  define secp256k1_fe_set_b32_limit secp256k1_fe_impl_set_b32_limit
  ------------------
  |  Branch (38:9): [True: 1, False: 151k]
  ------------------
   39|      1|        return 0;
   40|      1|    }
   41|   151k|    if (!secp256k1_ge_set_xo_var(&pk, &x, 0)) {
  ------------------
  |  Branch (41:9): [True: 1, False: 151k]
  ------------------
   42|      1|        return 0;
   43|      1|    }
   44|   151k|    if (!secp256k1_ge_is_in_correct_subgroup(&pk)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 151k]
  ------------------
   45|      0|        return 0;
   46|      0|    }
   47|   151k|    secp256k1_xonly_pubkey_save(pubkey, &pk);
   48|   151k|    return 1;
   49|   151k|}
secp256k1_xonly_pubkey_serialize:
   51|  75.3k|int secp256k1_xonly_pubkey_serialize(const secp256k1_context* ctx, unsigned char *output32, const secp256k1_xonly_pubkey *pubkey) {
   52|  75.3k|    secp256k1_ge pk;
   53|       |
   54|  75.3k|    VERIFY_CHECK(ctx != NULL);
   55|  75.3k|    ARG_CHECK(output32 != NULL);
  ------------------
  |  |   45|  75.3k|#define ARG_CHECK(cond) do { \
  |  |   46|  75.3k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  75.3k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 75.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  75.3k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 75.3k]
  |  |  ------------------
  ------------------
   56|  75.3k|    memset(output32, 0, 32);
   57|  75.3k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  75.3k|#define ARG_CHECK(cond) do { \
  |  |   46|  75.3k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  75.3k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 75.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  75.3k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 75.3k]
  |  |  ------------------
  ------------------
   58|       |
   59|  75.3k|    if (!secp256k1_xonly_pubkey_load(ctx, &pk, pubkey)) {
  ------------------
  |  Branch (59:9): [True: 0, False: 75.3k]
  ------------------
   60|      0|        return 0;
   61|      0|    }
   62|  75.3k|    secp256k1_fe_get_b32(output32, &pk.x);
  ------------------
  |  |   89|  75.3k|#  define secp256k1_fe_get_b32 secp256k1_fe_impl_get_b32
  ------------------
   63|  75.3k|    return 1;
   64|  75.3k|}
secp256k1_xonly_pubkey_from_pubkey:
  106|  75.3k|int secp256k1_xonly_pubkey_from_pubkey(const secp256k1_context* ctx, secp256k1_xonly_pubkey *xonly_pubkey, int *pk_parity, const secp256k1_pubkey *pubkey) {
  107|  75.3k|    secp256k1_ge pk;
  108|  75.3k|    int tmp;
  109|       |
  110|  75.3k|    VERIFY_CHECK(ctx != NULL);
  111|  75.3k|    ARG_CHECK(xonly_pubkey != NULL);
  ------------------
  |  |   45|  75.3k|#define ARG_CHECK(cond) do { \
  |  |   46|  75.3k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  75.3k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 75.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  75.3k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 75.3k]
  |  |  ------------------
  ------------------
  112|  75.3k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  75.3k|#define ARG_CHECK(cond) do { \
  |  |   46|  75.3k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  75.3k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 75.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  75.3k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 75.3k]
  |  |  ------------------
  ------------------
  113|       |
  114|  75.3k|    if (!secp256k1_pubkey_load(ctx, &pk, pubkey)) {
  ------------------
  |  Branch (114:9): [True: 0, False: 75.3k]
  ------------------
  115|      0|        return 0;
  116|      0|    }
  117|  75.3k|    tmp = secp256k1_extrakeys_ge_even_y(&pk);
  118|  75.3k|    if (pk_parity != NULL) {
  ------------------
  |  Branch (118:9): [True: 75.3k, False: 0]
  ------------------
  119|  75.3k|        *pk_parity = tmp;
  120|  75.3k|    }
  121|  75.3k|    secp256k1_xonly_pubkey_save(xonly_pubkey, &pk);
  122|  75.3k|    return 1;
  123|  75.3k|}
secp256k1_xonly_pubkey_tweak_add:
  125|  75.3k|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|  75.3k|    secp256k1_ge pk;
  127|       |
  128|  75.3k|    VERIFY_CHECK(ctx != NULL);
  129|  75.3k|    ARG_CHECK(output_pubkey != NULL);
  ------------------
  |  |   45|  75.3k|#define ARG_CHECK(cond) do { \
  |  |   46|  75.3k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  75.3k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 75.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  75.3k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 75.3k]
  |  |  ------------------
  ------------------
  130|  75.3k|    memset(output_pubkey, 0, sizeof(*output_pubkey));
  131|  75.3k|    ARG_CHECK(internal_pubkey != NULL);
  ------------------
  |  |   45|  75.3k|#define ARG_CHECK(cond) do { \
  |  |   46|  75.3k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  75.3k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 75.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  75.3k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 75.3k]
  |  |  ------------------
  ------------------
  132|  75.3k|    ARG_CHECK(tweak32 != NULL);
  ------------------
  |  |   45|  75.3k|#define ARG_CHECK(cond) do { \
  |  |   46|  75.3k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  75.3k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 75.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  75.3k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 75.3k]
  |  |  ------------------
  ------------------
  133|       |
  134|  75.3k|    if (!secp256k1_xonly_pubkey_load(ctx, &pk, internal_pubkey)
  ------------------
  |  Branch (134:9): [True: 0, False: 75.3k]
  ------------------
  135|  75.3k|        || !secp256k1_ec_pubkey_tweak_add_helper(&pk, tweak32)) {
  ------------------
  |  Branch (135:12): [True: 0, False: 75.3k]
  ------------------
  136|      0|        return 0;
  137|      0|    }
  138|  75.3k|    secp256k1_pubkey_save(output_pubkey, &pk);
  139|  75.3k|    return 1;
  140|  75.3k|}
secp256k1.c:secp256k1_xonly_pubkey_save:
   18|   226k|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|   226k|    secp256k1_pubkey_save((secp256k1_pubkey *) pubkey, ge);
   27|   226k|}
secp256k1.c:secp256k1_xonly_pubkey_load:
   14|   150k|static SECP256K1_INLINE int secp256k1_xonly_pubkey_load(const secp256k1_context* ctx, secp256k1_ge *ge, const secp256k1_xonly_pubkey *pubkey) {
   15|   150k|    return secp256k1_pubkey_load(ctx, ge, (const secp256k1_pubkey *) pubkey);
   16|   150k|}
secp256k1.c:secp256k1_extrakeys_ge_even_y:
   95|  75.3k|static int secp256k1_extrakeys_ge_even_y(secp256k1_ge *r) {
   96|  75.3k|    int y_parity = 0;
   97|  75.3k|    VERIFY_CHECK(!secp256k1_ge_is_infinity(r));
   98|       |
   99|  75.3k|    if (secp256k1_fe_is_odd(&r->y)) {
  ------------------
  |  |   85|  75.3k|#  define secp256k1_fe_is_odd secp256k1_fe_impl_is_odd
  ------------------
  |  Branch (99:9): [True: 37.5k, False: 37.8k]
  ------------------
  100|  37.5k|        secp256k1_fe_negate(&r->y, &r->y, 1);
  ------------------
  |  |  211|  37.5k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   87|  37.5k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   88|  37.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: 37.5k]
  |  |  |  |  ------------------
  |  |  |  |   91|      0|            break; \
  |  |  |  |   92|  37.5k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:9): [True: 37.5k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   93|  37.5k|    } \
  |  |  |  |   94|  37.5k|    stmt; \
  |  |  |  |   95|  37.5k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:9): [Folded, False: 37.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  101|  37.5k|        y_parity = 1;
  102|  37.5k|    }
  103|  75.3k|    return y_parity;
  104|  75.3k|}

secp256k1_musig_pubkey_agg:
  156|  61.5k|int secp256k1_musig_pubkey_agg(const secp256k1_context* ctx, secp256k1_xonly_pubkey *agg_pk, secp256k1_musig_keyagg_cache *keyagg_cache, const secp256k1_pubkey * const* pubkeys, size_t n_pubkeys) {
  157|  61.5k|    secp256k1_musig_pubkey_agg_ecmult_data ecmult_data;
  158|  61.5k|    secp256k1_gej pkj;
  159|  61.5k|    secp256k1_ge pkp;
  160|  61.5k|    size_t i;
  161|       |
  162|  61.5k|    VERIFY_CHECK(ctx != NULL);
  163|  61.5k|    if (agg_pk != NULL) {
  ------------------
  |  Branch (163:9): [True: 0, False: 61.5k]
  ------------------
  164|      0|        memset(agg_pk, 0, sizeof(*agg_pk));
  165|      0|    }
  166|  61.5k|    ARG_CHECK(pubkeys != NULL);
  ------------------
  |  |   45|  61.5k|#define ARG_CHECK(cond) do { \
  |  |   46|  61.5k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  61.5k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 61.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  61.5k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 61.5k]
  |  |  ------------------
  ------------------
  167|  61.5k|    ARG_CHECK(n_pubkeys > 0);
  ------------------
  |  |   45|  61.5k|#define ARG_CHECK(cond) do { \
  |  |   46|  61.5k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  61.5k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 61.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  61.5k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 61.5k]
  |  |  ------------------
  ------------------
  168|   594k|    for (i = 0; i < n_pubkeys; i++) {
  ------------------
  |  Branch (168:17): [True: 533k, False: 61.5k]
  ------------------
  169|   533k|        ARG_CHECK(pubkeys[i] != NULL);
  ------------------
  |  |   45|   533k|#define ARG_CHECK(cond) do { \
  |  |   46|   533k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|   533k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 533k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|   533k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 533k]
  |  |  ------------------
  ------------------
  170|   533k|    }
  171|       |
  172|  61.5k|    ecmult_data.ctx = ctx;
  173|  61.5k|    ecmult_data.pks = pubkeys;
  174|       |
  175|  61.5k|    secp256k1_ge_set_infinity(&ecmult_data.second_pk);
  176|  67.8k|    for (i = 1; i < n_pubkeys; i++) {
  ------------------
  |  Branch (176:17): [True: 44.0k, False: 23.8k]
  ------------------
  177|  44.0k|        if (secp256k1_memcmp_var(pubkeys[0], pubkeys[i], sizeof(*pubkeys[0])) != 0) {
  ------------------
  |  Branch (177:13): [True: 37.7k, False: 6.28k]
  ------------------
  178|  37.7k|            secp256k1_ge pk;
  179|  37.7k|            if (!secp256k1_pubkey_load(ctx, &pk, pubkeys[i])) {
  ------------------
  |  Branch (179:17): [True: 0, False: 37.7k]
  ------------------
  180|      0|                return 0;
  181|      0|            }
  182|  37.7k|            ecmult_data.second_pk = pk;
  183|  37.7k|            break;
  184|  37.7k|        }
  185|  44.0k|    }
  186|       |
  187|  61.5k|    if (!secp256k1_musig_compute_pks_hash(ctx, ecmult_data.pks_hash, pubkeys, n_pubkeys)) {
  ------------------
  |  Branch (187:9): [True: 0, False: 61.5k]
  ------------------
  188|      0|        return 0;
  189|      0|    }
  190|       |    /* TODO: actually use optimized ecmult_multi algorithms by providing a
  191|       |     * scratch space */
  192|  61.5k|    if (!secp256k1_ecmult_multi_var(&ctx->error_callback, NULL, &pkj, NULL, secp256k1_musig_pubkey_agg_callback, (void *) &ecmult_data, n_pubkeys)) {
  ------------------
  |  Branch (192:9): [True: 0, False: 61.5k]
  ------------------
  193|       |        /* In order to reach this line with the current implementation of
  194|       |         * ecmult_multi_var one would need to provide a callback that can
  195|       |         * fail. */
  196|      0|        return 0;
  197|      0|    }
  198|  61.5k|    secp256k1_ge_set_gej(&pkp, &pkj);
  199|  61.5k|    secp256k1_fe_normalize_var(&pkp.y);
  ------------------
  |  |   80|  61.5k|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
  200|       |    /* The resulting public key is infinity with negligible probability */
  201|  61.5k|    VERIFY_CHECK(!secp256k1_ge_is_infinity(&pkp));
  202|  61.5k|    if (keyagg_cache != NULL) {
  ------------------
  |  Branch (202:9): [True: 61.5k, False: 0]
  ------------------
  203|  61.5k|        secp256k1_keyagg_cache_internal cache_i = { 0 };
  204|  61.5k|        cache_i.pk = pkp;
  205|  61.5k|        cache_i.second_pk = ecmult_data.second_pk;
  206|  61.5k|        memcpy(cache_i.pks_hash, ecmult_data.pks_hash, sizeof(cache_i.pks_hash));
  207|  61.5k|        secp256k1_keyagg_cache_save(keyagg_cache, &cache_i);
  208|  61.5k|    }
  209|       |
  210|  61.5k|    if (agg_pk != NULL) {
  ------------------
  |  Branch (210:9): [True: 0, False: 61.5k]
  ------------------
  211|      0|        secp256k1_extrakeys_ge_even_y(&pkp);
  212|      0|        secp256k1_xonly_pubkey_save(agg_pk, &pkp);
  213|      0|    }
  214|  61.5k|    return 1;
  215|  61.5k|}
secp256k1_musig_pubkey_get:
  217|  61.5k|int secp256k1_musig_pubkey_get(const secp256k1_context* ctx, secp256k1_pubkey *agg_pk, const secp256k1_musig_keyagg_cache *keyagg_cache) {
  218|  61.5k|    secp256k1_keyagg_cache_internal cache_i;
  219|  61.5k|    VERIFY_CHECK(ctx != NULL);
  220|  61.5k|    ARG_CHECK(agg_pk != NULL);
  ------------------
  |  |   45|  61.5k|#define ARG_CHECK(cond) do { \
  |  |   46|  61.5k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  61.5k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 61.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  61.5k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 61.5k]
  |  |  ------------------
  ------------------
  221|  61.5k|    memset(agg_pk, 0, sizeof(*agg_pk));
  222|  61.5k|    ARG_CHECK(keyagg_cache != NULL);
  ------------------
  |  |   45|  61.5k|#define ARG_CHECK(cond) do { \
  |  |   46|  61.5k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  61.5k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 61.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  61.5k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 61.5k]
  |  |  ------------------
  ------------------
  223|       |
  224|  61.5k|    if (!secp256k1_keyagg_cache_load(ctx, &cache_i, keyagg_cache)) {
  ------------------
  |  Branch (224:9): [True: 0, False: 61.5k]
  ------------------
  225|      0|        return 0;
  226|      0|    }
  227|  61.5k|    secp256k1_pubkey_save(agg_pk, &cache_i.pk);
  228|  61.5k|    return 1;
  229|  61.5k|}
secp256k1.c:secp256k1_musig_compute_pks_hash:
   73|  61.5k|static int secp256k1_musig_compute_pks_hash(const secp256k1_context *ctx, unsigned char *pks_hash, const secp256k1_pubkey * const* pks, size_t np) {
   74|  61.5k|    secp256k1_sha256 sha;
   75|  61.5k|    size_t i;
   76|       |
   77|  61.5k|    secp256k1_musig_keyagglist_sha256(&sha);
   78|   594k|    for (i = 0; i < np; i++) {
  ------------------
  |  Branch (78:17): [True: 533k, False: 61.5k]
  ------------------
   79|   533k|        unsigned char ser[33];
   80|   533k|        size_t ser_len = sizeof(ser);
   81|   533k|        if (!secp256k1_ec_pubkey_serialize(ctx, ser, &ser_len, pks[i], SECP256K1_EC_COMPRESSED)) {
  ------------------
  |  |  216|   533k|#define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  197|   533k|#define SECP256K1_FLAGS_TYPE_COMPRESSION (1 << 1)
  |  |  ------------------
  |  |               #define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  202|   533k|#define SECP256K1_FLAGS_BIT_COMPRESSION (1 << 8)
  |  |  ------------------
  ------------------
  |  Branch (81:13): [True: 0, False: 533k]
  ------------------
   82|      0|            return 0;
   83|      0|        }
   84|   533k|        VERIFY_CHECK(ser_len == sizeof(ser));
   85|   533k|        secp256k1_sha256_write(secp256k1_get_hash_context(ctx), &sha, ser, sizeof(ser));
   86|   533k|    }
   87|  61.5k|    secp256k1_sha256_finalize(secp256k1_get_hash_context(ctx), &sha, pks_hash);
   88|  61.5k|    return 1;
   89|  61.5k|}
secp256k1.c:secp256k1_musig_keyagglist_sha256:
   64|  61.5k|static void secp256k1_musig_keyagglist_sha256(secp256k1_sha256 *sha) {
   65|  61.5k|    static const uint32_t midstate[8] = {
   66|  61.5k|        0xb399d5e0ul, 0xc8fff302ul, 0x6badac71ul, 0x07c5b7f1ul,
   67|  61.5k|        0x9701e2eful, 0x2a72ecf8ul, 0x201a4c7bul, 0xab148a38ul
   68|  61.5k|    };
   69|  61.5k|    secp256k1_sha256_initialize_midstate(sha, 64, midstate);
   70|  61.5k|}
secp256k1.c:secp256k1_musig_pubkey_agg_callback:
  141|   533k|static int secp256k1_musig_pubkey_agg_callback(secp256k1_scalar *sc, secp256k1_ge *pt, size_t idx, void *data) {
  142|   533k|    secp256k1_musig_pubkey_agg_ecmult_data *ctx = (secp256k1_musig_pubkey_agg_ecmult_data *) data;
  143|   533k|    int ret;
  144|   533k|    ret = secp256k1_pubkey_load(ctx->ctx, pt, ctx->pks[idx]);
  145|       |#ifdef VERIFY
  146|       |    /* pubkey_load can't fail because the same pks have already been loaded in
  147|       |     * `musig_compute_pks_hash` (and we test this). */
  148|       |    VERIFY_CHECK(ret);
  149|       |#else
  150|   533k|    (void) ret;
  151|   533k|#endif
  152|   533k|    secp256k1_musig_keyaggcoef_internal(secp256k1_get_hash_context(ctx->ctx), sc, ctx->pks_hash, pt, &ctx->second_pk);
  153|   533k|    return 1;
  154|   533k|}
secp256k1.c:secp256k1_musig_keyaggcoef_internal:
  106|   533k|static void secp256k1_musig_keyaggcoef_internal(const secp256k1_hash_ctx *hash_ctx, secp256k1_scalar *r, const unsigned char *pks_hash, secp256k1_ge *pk, const secp256k1_ge *second_pk) {
  107|   533k|    VERIFY_CHECK(!secp256k1_ge_is_infinity(pk));
  108|       |
  109|   533k|    if (!secp256k1_ge_is_infinity(second_pk)
  ------------------
  |  Branch (109:9): [True: 509k, False: 23.8k]
  ------------------
  110|   509k|          && secp256k1_ge_eq_var(pk, second_pk)) {
  ------------------
  |  Branch (110:14): [True: 52.7k, False: 456k]
  ------------------
  111|  52.7k|        secp256k1_scalar_set_int(r, 1);
  112|   480k|    } else {
  113|   480k|        secp256k1_sha256 sha;
  114|   480k|        unsigned char buf[33];
  115|   480k|        secp256k1_musig_keyaggcoef_sha256(&sha);
  116|   480k|        secp256k1_sha256_write(hash_ctx, &sha, pks_hash, 32);
  117|       |        /* Serialization does not fail since the pk is not the point at infinity
  118|       |         * (according to this function's precondition). */
  119|   480k|        secp256k1_eckey_pubkey_serialize33(pk, buf);
  120|   480k|        secp256k1_sha256_write(hash_ctx, &sha, buf, sizeof(buf));
  121|   480k|        secp256k1_sha256_finalize(hash_ctx, &sha, buf);
  122|       |        secp256k1_scalar_set_b32(r, buf, NULL);
  123|   480k|    }
  124|   533k|}
secp256k1.c:secp256k1_musig_keyaggcoef_sha256:
   93|   480k|static void secp256k1_musig_keyaggcoef_sha256(secp256k1_sha256 *sha) {
   94|   480k|    static const uint32_t midstate[8] = {
   95|   480k|        0x6ef02c5aul, 0x06a480deul, 0x1f298665ul, 0x1d1134f2ul,
   96|   480k|        0x56a0b063ul, 0x52da4147ul, 0xf280d9d4ul, 0x4484be15ul
   97|   480k|    };
   98|   480k|    secp256k1_sha256_initialize_midstate(sha, 64, midstate);
   99|   480k|}
secp256k1.c:secp256k1_keyagg_cache_save:
   31|  61.5k|static void secp256k1_keyagg_cache_save(secp256k1_musig_keyagg_cache *cache, const secp256k1_keyagg_cache_internal *cache_i) {
   32|  61.5k|    unsigned char *ptr = cache->data;
   33|  61.5k|    memcpy(ptr, secp256k1_musig_keyagg_cache_magic, 4);
   34|  61.5k|    ptr += 4;
   35|  61.5k|    secp256k1_ge_to_bytes(ptr, &cache_i->pk);
   36|  61.5k|    ptr += 64;
   37|  61.5k|    secp256k1_ge_to_bytes_ext(ptr, &cache_i->second_pk);
   38|  61.5k|    ptr += 64;
   39|  61.5k|    memcpy(ptr, cache_i->pks_hash, 32);
   40|  61.5k|    ptr += 32;
   41|  61.5k|    *ptr = cache_i->parity_acc;
   42|  61.5k|    ptr += 1;
   43|  61.5k|    secp256k1_scalar_get_b32(ptr, &cache_i->tweak);
   44|  61.5k|}
secp256k1.c:secp256k1_keyagg_cache_load:
   46|  61.5k|static int secp256k1_keyagg_cache_load(const secp256k1_context* ctx, secp256k1_keyagg_cache_internal *cache_i, const secp256k1_musig_keyagg_cache *cache) {
   47|  61.5k|    const unsigned char *ptr = cache->data;
   48|  61.5k|    ARG_CHECK(secp256k1_memcmp_var(ptr, secp256k1_musig_keyagg_cache_magic, 4) == 0);
  ------------------
  |  |   45|  61.5k|#define ARG_CHECK(cond) do { \
  |  |   46|  61.5k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  61.5k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 61.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  61.5k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 61.5k]
  |  |  ------------------
  ------------------
   49|  61.5k|    ptr += 4;
   50|  61.5k|    secp256k1_ge_from_bytes(&cache_i->pk, ptr);
   51|  61.5k|    ptr += 64;
   52|  61.5k|    secp256k1_ge_from_bytes_ext(&cache_i->second_pk, ptr);
   53|  61.5k|    ptr += 64;
   54|  61.5k|    memcpy(cache_i->pks_hash, ptr, 32);
   55|  61.5k|    ptr += 32;
   56|  61.5k|    cache_i->parity_acc = *ptr & 1;
   57|  61.5k|    ptr += 1;
   58|       |    secp256k1_scalar_set_b32(&cache_i->tweak, ptr, NULL);
   59|  61.5k|    return 1;
   60|  61.5k|}

secp256k1.c:secp256k1_scalar_set_b32:
  147|  14.2M|static void secp256k1_scalar_set_b32(secp256k1_scalar *r, const unsigned char *b32, int *overflow) {
  148|  14.2M|    int over;
  149|  14.2M|    r->d[0] = secp256k1_read_be64(&b32[24]);
  150|  14.2M|    r->d[1] = secp256k1_read_be64(&b32[16]);
  151|  14.2M|    r->d[2] = secp256k1_read_be64(&b32[8]);
  152|  14.2M|    r->d[3] = secp256k1_read_be64(&b32[0]);
  153|  14.2M|    over = secp256k1_scalar_reduce(r, secp256k1_scalar_check_overflow(r));
  154|  14.2M|    if (overflow) {
  ------------------
  |  Branch (154:9): [True: 13.7M, False: 542k]
  ------------------
  155|  13.7M|        *overflow = over;
  156|  13.7M|    }
  157|       |
  158|  14.2M|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  14.2M|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  159|  14.2M|}
secp256k1.c:secp256k1_scalar_reduce:
   76|  26.8M|SECP256K1_INLINE static int secp256k1_scalar_reduce(secp256k1_scalar *r, unsigned int overflow) {
   77|  26.8M|    secp256k1_uint128 t;
   78|  26.8M|    VERIFY_CHECK(overflow <= 1);
   79|       |
   80|  26.8M|    secp256k1_u128_from_u64(&t, r->d[0]);
   81|  26.8M|    secp256k1_u128_accum_u64(&t, overflow * SECP256K1_N_C_0);
  ------------------
  |  |   22|  26.8M|#define SECP256K1_N_C_0 (~SECP256K1_N_0 + 1)
  |  |  ------------------
  |  |  |  |   16|  26.8M|#define SECP256K1_N_0 ((uint64_t)0xBFD25E8CD0364141ULL)
  |  |  ------------------
  ------------------
   82|  26.8M|    r->d[0] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
   83|  26.8M|    secp256k1_u128_accum_u64(&t, r->d[1]);
   84|  26.8M|    secp256k1_u128_accum_u64(&t, overflow * SECP256K1_N_C_1);
  ------------------
  |  |   23|  26.8M|#define SECP256K1_N_C_1 (~SECP256K1_N_1)
  |  |  ------------------
  |  |  |  |   17|  26.8M|#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL)
  |  |  ------------------
  ------------------
   85|  26.8M|    r->d[1] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
   86|  26.8M|    secp256k1_u128_accum_u64(&t, r->d[2]);
   87|  26.8M|    secp256k1_u128_accum_u64(&t, overflow * SECP256K1_N_C_2);
  ------------------
  |  |   24|  26.8M|#define SECP256K1_N_C_2 (1)
  ------------------
   88|  26.8M|    r->d[2] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
   89|  26.8M|    secp256k1_u128_accum_u64(&t, r->d[3]);
   90|  26.8M|    r->d[3] = secp256k1_u128_to_u64(&t);
   91|       |
   92|  26.8M|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  26.8M|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
   93|  26.8M|    return overflow;
   94|  26.8M|}
secp256k1.c:secp256k1_scalar_check_overflow:
   64|  26.8M|SECP256K1_INLINE static int secp256k1_scalar_check_overflow(const secp256k1_scalar *a) {
   65|  26.8M|    int yes = 0;
   66|  26.8M|    int no = 0;
   67|  26.8M|    no |= (a->d[3] < SECP256K1_N_3); /* No need for a > check. */
  ------------------
  |  |   19|  26.8M|#define SECP256K1_N_3 ((uint64_t)0xFFFFFFFFFFFFFFFFULL)
  ------------------
   68|  26.8M|    no |= (a->d[2] < SECP256K1_N_2);
  ------------------
  |  |   18|  26.8M|#define SECP256K1_N_2 ((uint64_t)0xFFFFFFFFFFFFFFFEULL)
  ------------------
   69|  26.8M|    yes |= (a->d[2] > SECP256K1_N_2) & ~no;
  ------------------
  |  |   18|  26.8M|#define SECP256K1_N_2 ((uint64_t)0xFFFFFFFFFFFFFFFEULL)
  ------------------
   70|  26.8M|    no |= (a->d[1] < SECP256K1_N_1);
  ------------------
  |  |   17|  26.8M|#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL)
  ------------------
   71|  26.8M|    yes |= (a->d[1] > SECP256K1_N_1) & ~no;
  ------------------
  |  |   17|  26.8M|#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL)
  ------------------
   72|  26.8M|    yes |= (a->d[0] >= SECP256K1_N_0) & ~no;
  ------------------
  |  |   16|  26.8M|#define SECP256K1_N_0 ((uint64_t)0xBFD25E8CD0364141ULL)
  ------------------
   73|  26.8M|    return yes;
   74|  26.8M|}
secp256k1.c:secp256k1_scalar_get_b32:
  161|  2.47M|static void secp256k1_scalar_get_b32(unsigned char *bin, const secp256k1_scalar* a) {
  162|  2.47M|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|  2.47M|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  163|       |
  164|  2.47M|    secp256k1_write_be64(&bin[0],  a->d[3]);
  165|  2.47M|    secp256k1_write_be64(&bin[8],  a->d[2]);
  166|  2.47M|    secp256k1_write_be64(&bin[16], a->d[1]);
  167|  2.47M|    secp256k1_write_be64(&bin[24], a->d[0]);
  168|  2.47M|}
secp256k1.c:secp256k1_scalar_negate:
  176|  1.28M|static void secp256k1_scalar_negate(secp256k1_scalar *r, const secp256k1_scalar *a) {
  177|  1.28M|    uint64_t nonzero = 0xFFFFFFFFFFFFFFFFULL * (secp256k1_scalar_is_zero(a) == 0);
  178|  1.28M|    secp256k1_uint128 t;
  179|  1.28M|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|  1.28M|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  180|       |
  181|  1.28M|    secp256k1_u128_from_u64(&t, ~a->d[0]);
  182|  1.28M|    secp256k1_u128_accum_u64(&t, SECP256K1_N_0 + 1);
  ------------------
  |  |   16|  1.28M|#define SECP256K1_N_0 ((uint64_t)0xBFD25E8CD0364141ULL)
  ------------------
  183|  1.28M|    r->d[0] = secp256k1_u128_to_u64(&t) & nonzero; secp256k1_u128_rshift(&t, 64);
  184|  1.28M|    secp256k1_u128_accum_u64(&t, ~a->d[1]);
  185|  1.28M|    secp256k1_u128_accum_u64(&t, SECP256K1_N_1);
  ------------------
  |  |   17|  1.28M|#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL)
  ------------------
  186|  1.28M|    r->d[1] = secp256k1_u128_to_u64(&t) & nonzero; secp256k1_u128_rshift(&t, 64);
  187|  1.28M|    secp256k1_u128_accum_u64(&t, ~a->d[2]);
  188|  1.28M|    secp256k1_u128_accum_u64(&t, SECP256K1_N_2);
  ------------------
  |  |   18|  1.28M|#define SECP256K1_N_2 ((uint64_t)0xFFFFFFFFFFFFFFFEULL)
  ------------------
  189|  1.28M|    r->d[2] = secp256k1_u128_to_u64(&t) & nonzero; secp256k1_u128_rshift(&t, 64);
  190|  1.28M|    secp256k1_u128_accum_u64(&t, ~a->d[3]);
  191|  1.28M|    secp256k1_u128_accum_u64(&t, SECP256K1_N_3);
  ------------------
  |  |   19|  1.28M|#define SECP256K1_N_3 ((uint64_t)0xFFFFFFFFFFFFFFFFULL)
  ------------------
  192|  1.28M|    r->d[3] = secp256k1_u128_to_u64(&t) & nonzero;
  193|       |
  194|  1.28M|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  1.28M|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  195|  1.28M|}
secp256k1.c:secp256k1_scalar_cmov:
  915|  8.58M|static SECP256K1_INLINE void secp256k1_scalar_cmov(secp256k1_scalar *r, const secp256k1_scalar *a, int flag) {
  916|  8.58M|    uint64_t mask0, mask1;
  917|  8.58M|    volatile int vflag = flag;
  918|  8.58M|    VERIFY_CHECK(flag == 0 || flag == 1);
  919|  8.58M|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|  8.58M|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  920|  8.58M|    SECP256K1_CHECKMEM_CHECK_VERIFY(r->d, sizeof(r->d));
  ------------------
  |  |  114|  8.58M|#define SECP256K1_CHECKMEM_CHECK_VERIFY(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  8.58M|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 8.58M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  921|       |
  922|  8.58M|    mask0 = vflag + ~((uint64_t)0);
  923|  8.58M|    mask1 = ~mask0;
  924|  8.58M|    r->d[0] = (r->d[0] & mask0) | (a->d[0] & mask1);
  925|  8.58M|    r->d[1] = (r->d[1] & mask0) | (a->d[1] & mask1);
  926|  8.58M|    r->d[2] = (r->d[2] & mask0) | (a->d[2] & mask1);
  927|  8.58M|    r->d[3] = (r->d[3] & mask0) | (a->d[3] & mask1);
  928|       |
  929|  8.58M|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  8.58M|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  930|  8.58M|}
secp256k1.c:secp256k1_scalar_mul_shift_var:
  893|  1.60M|SECP256K1_INLINE static void secp256k1_scalar_mul_shift_var(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b, unsigned int shift) {
  894|  1.60M|    uint64_t l[8];
  895|  1.60M|    unsigned int shiftlimbs;
  896|  1.60M|    unsigned int shiftlow;
  897|  1.60M|    unsigned int shifthigh;
  898|  1.60M|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|  1.60M|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  899|  1.60M|    SECP256K1_SCALAR_VERIFY(b);
  ------------------
  |  |  103|  1.60M|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  900|  1.60M|    VERIFY_CHECK(shift >= 256);
  901|       |
  902|  1.60M|    secp256k1_scalar_mul_512(l, a, b);
  903|  1.60M|    shiftlimbs = shift >> 6;
  904|  1.60M|    shiftlow = shift & 0x3F;
  905|  1.60M|    shifthigh = 64 - shiftlow;
  906|  1.60M|    r->d[0] = shift < 512 ? (l[0 + shiftlimbs] >> shiftlow | (shift < 448 && shiftlow ? (l[1 + shiftlimbs] << shifthigh) : 0)) : 0;
  ------------------
  |  Branch (906:15): [True: 1.60M, False: 0]
  |  Branch (906:63): [True: 1.60M, False: 0]
  |  Branch (906:78): [True: 0, False: 1.60M]
  ------------------
  907|  1.60M|    r->d[1] = shift < 448 ? (l[1 + shiftlimbs] >> shiftlow | (shift < 384 && shiftlow ? (l[2 + shiftlimbs] << shifthigh) : 0)) : 0;
  ------------------
  |  Branch (907:15): [True: 1.60M, False: 0]
  |  Branch (907:63): [True: 0, False: 1.60M]
  |  Branch (907:78): [True: 0, False: 0]
  ------------------
  908|  1.60M|    r->d[2] = shift < 384 ? (l[2 + shiftlimbs] >> shiftlow | (shift < 320 && shiftlow ? (l[3 + shiftlimbs] << shifthigh) : 0)) : 0;
  ------------------
  |  Branch (908:15): [True: 0, False: 1.60M]
  |  Branch (908:63): [True: 0, False: 0]
  |  Branch (908:78): [True: 0, False: 0]
  ------------------
  909|  1.60M|    r->d[3] = shift < 320 ? (l[3 + shiftlimbs] >> shiftlow) : 0;
  ------------------
  |  Branch (909:15): [True: 0, False: 1.60M]
  ------------------
  910|  1.60M|    secp256k1_scalar_cadd_bit(r, 0, (l[(shift - 1) >> 6] >> ((shift - 1) & 0x3f)) & 1);
  911|       |
  912|  1.60M|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  1.60M|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  913|  1.60M|}
secp256k1.c:secp256k1_scalar_mul_512:
  682|  4.01M|static void secp256k1_scalar_mul_512(uint64_t *l8, const secp256k1_scalar *a, const secp256k1_scalar *b) {
  683|  4.01M|#ifdef USE_ASM_X86_64
  684|  4.01M|    const uint64_t *pb = b->d;
  685|  4.01M|    __asm__ __volatile__(
  686|       |    /* Preload */
  687|  4.01M|    "movq 0(%%rdi), %%r15\n"
  688|  4.01M|    "movq 8(%%rdi), %%rbx\n"
  689|  4.01M|    "movq 16(%%rdi), %%rcx\n"
  690|  4.01M|    "movq 0(%%rdx), %%r11\n"
  691|  4.01M|    "movq 8(%%rdx), %%r12\n"
  692|  4.01M|    "movq 16(%%rdx), %%r13\n"
  693|  4.01M|    "movq 24(%%rdx), %%r14\n"
  694|       |    /* (rax,rdx) = a0 * b0 */
  695|  4.01M|    "movq %%r15, %%rax\n"
  696|  4.01M|    "mulq %%r11\n"
  697|       |    /* Extract l8[0] */
  698|  4.01M|    "movq %%rax, 0(%%rsi)\n"
  699|       |    /* (r8,r9,r10) = (rdx) */
  700|  4.01M|    "movq %%rdx, %%r8\n"
  701|  4.01M|    "xorq %%r9, %%r9\n"
  702|  4.01M|    "xorq %%r10, %%r10\n"
  703|       |    /* (r8,r9,r10) += a0 * b1 */
  704|  4.01M|    "movq %%r15, %%rax\n"
  705|  4.01M|    "mulq %%r12\n"
  706|  4.01M|    "addq %%rax, %%r8\n"
  707|  4.01M|    "adcq %%rdx, %%r9\n"
  708|  4.01M|    "adcq $0, %%r10\n"
  709|       |    /* (r8,r9,r10) += a1 * b0 */
  710|  4.01M|    "movq %%rbx, %%rax\n"
  711|  4.01M|    "mulq %%r11\n"
  712|  4.01M|    "addq %%rax, %%r8\n"
  713|  4.01M|    "adcq %%rdx, %%r9\n"
  714|  4.01M|    "adcq $0, %%r10\n"
  715|       |    /* Extract l8[1] */
  716|  4.01M|    "movq %%r8, 8(%%rsi)\n"
  717|  4.01M|    "xorq %%r8, %%r8\n"
  718|       |    /* (r9,r10,r8) += a0 * b2 */
  719|  4.01M|    "movq %%r15, %%rax\n"
  720|  4.01M|    "mulq %%r13\n"
  721|  4.01M|    "addq %%rax, %%r9\n"
  722|  4.01M|    "adcq %%rdx, %%r10\n"
  723|  4.01M|    "adcq $0, %%r8\n"
  724|       |    /* (r9,r10,r8) += a1 * b1 */
  725|  4.01M|    "movq %%rbx, %%rax\n"
  726|  4.01M|    "mulq %%r12\n"
  727|  4.01M|    "addq %%rax, %%r9\n"
  728|  4.01M|    "adcq %%rdx, %%r10\n"
  729|  4.01M|    "adcq $0, %%r8\n"
  730|       |    /* (r9,r10,r8) += a2 * b0 */
  731|  4.01M|    "movq %%rcx, %%rax\n"
  732|  4.01M|    "mulq %%r11\n"
  733|  4.01M|    "addq %%rax, %%r9\n"
  734|  4.01M|    "adcq %%rdx, %%r10\n"
  735|  4.01M|    "adcq $0, %%r8\n"
  736|       |    /* Extract l8[2] */
  737|  4.01M|    "movq %%r9, 16(%%rsi)\n"
  738|  4.01M|    "xorq %%r9, %%r9\n"
  739|       |    /* (r10,r8,r9) += a0 * b3 */
  740|  4.01M|    "movq %%r15, %%rax\n"
  741|  4.01M|    "mulq %%r14\n"
  742|  4.01M|    "addq %%rax, %%r10\n"
  743|  4.01M|    "adcq %%rdx, %%r8\n"
  744|  4.01M|    "adcq $0, %%r9\n"
  745|       |    /* Preload a3 */
  746|  4.01M|    "movq 24(%%rdi), %%r15\n"
  747|       |    /* (r10,r8,r9) += a1 * b2 */
  748|  4.01M|    "movq %%rbx, %%rax\n"
  749|  4.01M|    "mulq %%r13\n"
  750|  4.01M|    "addq %%rax, %%r10\n"
  751|  4.01M|    "adcq %%rdx, %%r8\n"
  752|  4.01M|    "adcq $0, %%r9\n"
  753|       |    /* (r10,r8,r9) += a2 * b1 */
  754|  4.01M|    "movq %%rcx, %%rax\n"
  755|  4.01M|    "mulq %%r12\n"
  756|  4.01M|    "addq %%rax, %%r10\n"
  757|  4.01M|    "adcq %%rdx, %%r8\n"
  758|  4.01M|    "adcq $0, %%r9\n"
  759|       |    /* (r10,r8,r9) += a3 * b0 */
  760|  4.01M|    "movq %%r15, %%rax\n"
  761|  4.01M|    "mulq %%r11\n"
  762|  4.01M|    "addq %%rax, %%r10\n"
  763|  4.01M|    "adcq %%rdx, %%r8\n"
  764|  4.01M|    "adcq $0, %%r9\n"
  765|       |    /* Extract l8[3] */
  766|  4.01M|    "movq %%r10, 24(%%rsi)\n"
  767|  4.01M|    "xorq %%r10, %%r10\n"
  768|       |    /* (r8,r9,r10) += a1 * b3 */
  769|  4.01M|    "movq %%rbx, %%rax\n"
  770|  4.01M|    "mulq %%r14\n"
  771|  4.01M|    "addq %%rax, %%r8\n"
  772|  4.01M|    "adcq %%rdx, %%r9\n"
  773|  4.01M|    "adcq $0, %%r10\n"
  774|       |    /* (r8,r9,r10) += a2 * b2 */
  775|  4.01M|    "movq %%rcx, %%rax\n"
  776|  4.01M|    "mulq %%r13\n"
  777|  4.01M|    "addq %%rax, %%r8\n"
  778|  4.01M|    "adcq %%rdx, %%r9\n"
  779|  4.01M|    "adcq $0, %%r10\n"
  780|       |    /* (r8,r9,r10) += a3 * b1 */
  781|  4.01M|    "movq %%r15, %%rax\n"
  782|  4.01M|    "mulq %%r12\n"
  783|  4.01M|    "addq %%rax, %%r8\n"
  784|  4.01M|    "adcq %%rdx, %%r9\n"
  785|  4.01M|    "adcq $0, %%r10\n"
  786|       |    /* Extract l8[4] */
  787|  4.01M|    "movq %%r8, 32(%%rsi)\n"
  788|  4.01M|    "xorq %%r8, %%r8\n"
  789|       |    /* (r9,r10,r8) += a2 * b3 */
  790|  4.01M|    "movq %%rcx, %%rax\n"
  791|  4.01M|    "mulq %%r14\n"
  792|  4.01M|    "addq %%rax, %%r9\n"
  793|  4.01M|    "adcq %%rdx, %%r10\n"
  794|  4.01M|    "adcq $0, %%r8\n"
  795|       |    /* (r9,r10,r8) += a3 * b2 */
  796|  4.01M|    "movq %%r15, %%rax\n"
  797|  4.01M|    "mulq %%r13\n"
  798|  4.01M|    "addq %%rax, %%r9\n"
  799|  4.01M|    "adcq %%rdx, %%r10\n"
  800|  4.01M|    "adcq $0, %%r8\n"
  801|       |    /* Extract l8[5] */
  802|  4.01M|    "movq %%r9, 40(%%rsi)\n"
  803|       |    /* (r10,r8) += a3 * b3 */
  804|  4.01M|    "movq %%r15, %%rax\n"
  805|  4.01M|    "mulq %%r14\n"
  806|  4.01M|    "addq %%rax, %%r10\n"
  807|  4.01M|    "adcq %%rdx, %%r8\n"
  808|       |    /* Extract l8[6] */
  809|  4.01M|    "movq %%r10, 48(%%rsi)\n"
  810|       |    /* Extract l8[7] */
  811|  4.01M|    "movq %%r8, 56(%%rsi)\n"
  812|  4.01M|    : "+d"(pb)
  813|  4.01M|    : "S"(l8), "D"(a->d)
  814|  4.01M|    : "rax", "rbx", "rcx", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", "cc", "memory");
  815|       |
  816|  4.01M|    SECP256K1_CHECKMEM_MSAN_DEFINE(l8, sizeof(*l8) * 8);
  ------------------
  |  |   70|  4.01M|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  4.01M|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 4.01M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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|  4.01M|}
secp256k1.c:secp256k1_scalar_cadd_bit:
  122|  1.60M|static void secp256k1_scalar_cadd_bit(secp256k1_scalar *r, unsigned int bit, int flag) {
  123|  1.60M|    secp256k1_uint128 t;
  124|  1.60M|    volatile int vflag = flag;
  125|  1.60M|    VERIFY_CHECK(flag == 0 || flag == 1);
  126|  1.60M|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  1.60M|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  127|  1.60M|    VERIFY_CHECK(bit < 256);
  128|       |
  129|  1.60M|    bit += ((uint32_t) vflag - 1) & 0x100;  /* forcing (bit >> 6) > 3 makes this a noop */
  130|  1.60M|    secp256k1_u128_from_u64(&t, r->d[0]);
  131|  1.60M|    secp256k1_u128_accum_u64(&t, ((uint64_t)((bit >> 6) == 0)) << (bit & 0x3F));
  132|  1.60M|    r->d[0] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
  133|  1.60M|    secp256k1_u128_accum_u64(&t, r->d[1]);
  134|  1.60M|    secp256k1_u128_accum_u64(&t, ((uint64_t)((bit >> 6) == 1)) << (bit & 0x3F));
  135|  1.60M|    r->d[1] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
  136|  1.60M|    secp256k1_u128_accum_u64(&t, r->d[2]);
  137|  1.60M|    secp256k1_u128_accum_u64(&t, ((uint64_t)((bit >> 6) == 2)) << (bit & 0x3F));
  138|  1.60M|    r->d[2] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
  139|  1.60M|    secp256k1_u128_accum_u64(&t, r->d[3]);
  140|  1.60M|    secp256k1_u128_accum_u64(&t, ((uint64_t)((bit >> 6) == 3)) << (bit & 0x3F));
  141|  1.60M|    r->d[3] = secp256k1_u128_to_u64(&t);
  142|       |
  143|  1.60M|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  1.60M|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  144|  1.60M|    VERIFY_CHECK(secp256k1_u128_hi_u64(&t) == 0);
  145|  1.60M|}
secp256k1.c:secp256k1_scalar_split_128:
  870|   269k|static void secp256k1_scalar_split_128(secp256k1_scalar *r1, secp256k1_scalar *r2, const secp256k1_scalar *k) {
  871|   269k|    SECP256K1_SCALAR_VERIFY(k);
  ------------------
  |  |  103|   269k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  872|       |
  873|   269k|    r1->d[0] = k->d[0];
  874|   269k|    r1->d[1] = k->d[1];
  875|   269k|    r1->d[2] = 0;
  876|   269k|    r1->d[3] = 0;
  877|   269k|    r2->d[0] = k->d[2];
  878|   269k|    r2->d[1] = k->d[3];
  879|   269k|    r2->d[2] = 0;
  880|   269k|    r2->d[3] = 0;
  881|       |
  882|   269k|    SECP256K1_SCALAR_VERIFY(r1);
  ------------------
  |  |  103|   269k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  883|   269k|    SECP256K1_SCALAR_VERIFY(r2);
  ------------------
  |  |  103|   269k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  884|   269k|}
secp256k1.c:secp256k1_scalar_get_bits_limb32:
   41|   184M|SECP256K1_INLINE static uint32_t secp256k1_scalar_get_bits_limb32(const secp256k1_scalar *a, unsigned int offset, unsigned int count) {
   42|   184M|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|   184M|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
   43|   184M|    VERIFY_CHECK(count > 0 && count <= 32);
   44|   184M|    VERIFY_CHECK(offset <= 256 - count);
   45|   184M|    VERIFY_CHECK((offset + count - 1) >> 5 == offset >> 5);
   46|       |
   47|   184M|    return (a->d[offset >> 6] >> (offset & 0x3F)) & (0xFFFFFFFF >> (32 - count));
   48|   184M|}
secp256k1.c:secp256k1_scalar_get_bits_var:
   50|  25.6M|SECP256K1_INLINE static uint32_t secp256k1_scalar_get_bits_var(const secp256k1_scalar *a, unsigned int offset, unsigned int count) {
   51|  25.6M|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|  25.6M|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
   52|  25.6M|    VERIFY_CHECK(count > 0 && count <= 32);
   53|  25.6M|    VERIFY_CHECK(offset <= 256 - count);
   54|       |
   55|  25.6M|    if ((offset + count - 1) >> 6 == offset >> 6) {
  ------------------
  |  Branch (55:9): [True: 23.6M, False: 2.04M]
  ------------------
   56|  23.6M|        return (a->d[offset >> 6] >> (offset & 0x3F)) & (0xFFFFFFFF >> (32 - count));
   57|  23.6M|    } else {
   58|  2.04M|        VERIFY_CHECK((offset >> 6) + 1 < 4);
   59|  2.04M|        VERIFY_CHECK((offset & 0x3F) > 0);
   60|  2.04M|        return ((a->d[offset >> 6] >> (offset & 0x3F)) | (a->d[(offset >> 6) + 1] << (64 - (offset & 0x3F)))) & (0xFFFFFFFF >> (32 - count));
   61|  2.04M|    }
   62|  25.6M|}
secp256k1.c:secp256k1_scalar_set_int:
   32|  52.7k|SECP256K1_INLINE static void secp256k1_scalar_set_int(secp256k1_scalar *r, unsigned int v) {
   33|  52.7k|    r->d[0] = v;
   34|  52.7k|    r->d[1] = 0;
   35|  52.7k|    r->d[2] = 0;
   36|  52.7k|    r->d[3] = 0;
   37|       |
   38|  52.7k|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  52.7k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
   39|  52.7k|}
secp256k1.c:secp256k1_scalar_is_zero:
  170|  15.5M|SECP256K1_INLINE static int secp256k1_scalar_is_zero(const secp256k1_scalar *a) {
  171|  15.5M|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|  15.5M|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  172|       |
  173|  15.5M|    return (a->d[0] | a->d[1] | a->d[2] | a->d[3]) == 0;
  174|  15.5M|}
secp256k1.c:secp256k1_scalar_mul:
  859|  2.40M|static void secp256k1_scalar_mul(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b) {
  860|  2.40M|    uint64_t l[8];
  861|  2.40M|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|  2.40M|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  862|  2.40M|    SECP256K1_SCALAR_VERIFY(b);
  ------------------
  |  |  103|  2.40M|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  863|       |
  864|  2.40M|    secp256k1_scalar_mul_512(l, a, b);
  865|  2.40M|    secp256k1_scalar_reduce_512(r, l);
  866|       |
  867|  2.40M|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  2.40M|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  868|  2.40M|}
secp256k1.c:secp256k1_scalar_reduce_512:
  351|  2.40M|static void secp256k1_scalar_reduce_512(secp256k1_scalar *r, const uint64_t *l) {
  352|  2.40M|#ifdef USE_ASM_X86_64
  353|       |    /* Reduce 512 bits into 385. */
  354|  2.40M|    uint64_t m0, m1, m2, m3, m4, m5, m6;
  355|  2.40M|    uint64_t p0, p1, p2, p3, p4;
  356|  2.40M|    uint64_t c;
  357|       |
  358|  2.40M|    __asm__ __volatile__(
  359|       |    /* Preload. */
  360|  2.40M|    "movq 32(%%rsi), %%r11\n"
  361|  2.40M|    "movq 40(%%rsi), %%r12\n"
  362|  2.40M|    "movq 48(%%rsi), %%r13\n"
  363|  2.40M|    "movq 56(%%rsi), %%r14\n"
  364|       |    /* Initialize r8,r9,r10 */
  365|  2.40M|    "movq 0(%%rsi), %%r8\n"
  366|  2.40M|    "xorq %%r9, %%r9\n"
  367|  2.40M|    "xorq %%r10, %%r10\n"
  368|       |    /* (r8,r9) += n0 * c0 */
  369|  2.40M|    "movq %8, %%rax\n"
  370|  2.40M|    "mulq %%r11\n"
  371|  2.40M|    "addq %%rax, %%r8\n"
  372|  2.40M|    "adcq %%rdx, %%r9\n"
  373|       |    /* extract m0 */
  374|  2.40M|    "movq %%r8, %q0\n"
  375|  2.40M|    "xorq %%r8, %%r8\n"
  376|       |    /* (r9,r10) += l1 */
  377|  2.40M|    "addq 8(%%rsi), %%r9\n"
  378|  2.40M|    "adcq $0, %%r10\n"
  379|       |    /* (r9,r10,r8) += n1 * c0 */
  380|  2.40M|    "movq %8, %%rax\n"
  381|  2.40M|    "mulq %%r12\n"
  382|  2.40M|    "addq %%rax, %%r9\n"
  383|  2.40M|    "adcq %%rdx, %%r10\n"
  384|  2.40M|    "adcq $0, %%r8\n"
  385|       |    /* (r9,r10,r8) += n0 * c1 */
  386|  2.40M|    "movq %9, %%rax\n"
  387|  2.40M|    "mulq %%r11\n"
  388|  2.40M|    "addq %%rax, %%r9\n"
  389|  2.40M|    "adcq %%rdx, %%r10\n"
  390|  2.40M|    "adcq $0, %%r8\n"
  391|       |    /* extract m1 */
  392|  2.40M|    "movq %%r9, %q1\n"
  393|  2.40M|    "xorq %%r9, %%r9\n"
  394|       |    /* (r10,r8,r9) += l2 */
  395|  2.40M|    "addq 16(%%rsi), %%r10\n"
  396|  2.40M|    "adcq $0, %%r8\n"
  397|  2.40M|    "adcq $0, %%r9\n"
  398|       |    /* (r10,r8,r9) += n2 * c0 */
  399|  2.40M|    "movq %8, %%rax\n"
  400|  2.40M|    "mulq %%r13\n"
  401|  2.40M|    "addq %%rax, %%r10\n"
  402|  2.40M|    "adcq %%rdx, %%r8\n"
  403|  2.40M|    "adcq $0, %%r9\n"
  404|       |    /* (r10,r8,r9) += n1 * c1 */
  405|  2.40M|    "movq %9, %%rax\n"
  406|  2.40M|    "mulq %%r12\n"
  407|  2.40M|    "addq %%rax, %%r10\n"
  408|  2.40M|    "adcq %%rdx, %%r8\n"
  409|  2.40M|    "adcq $0, %%r9\n"
  410|       |    /* (r10,r8,r9) += n0 */
  411|  2.40M|    "addq %%r11, %%r10\n"
  412|  2.40M|    "adcq $0, %%r8\n"
  413|  2.40M|    "adcq $0, %%r9\n"
  414|       |    /* extract m2 */
  415|  2.40M|    "movq %%r10, %q2\n"
  416|  2.40M|    "xorq %%r10, %%r10\n"
  417|       |    /* (r8,r9,r10) += l3 */
  418|  2.40M|    "addq 24(%%rsi), %%r8\n"
  419|  2.40M|    "adcq $0, %%r9\n"
  420|  2.40M|    "adcq $0, %%r10\n"
  421|       |    /* (r8,r9,r10) += n3 * c0 */
  422|  2.40M|    "movq %8, %%rax\n"
  423|  2.40M|    "mulq %%r14\n"
  424|  2.40M|    "addq %%rax, %%r8\n"
  425|  2.40M|    "adcq %%rdx, %%r9\n"
  426|  2.40M|    "adcq $0, %%r10\n"
  427|       |    /* (r8,r9,r10) += n2 * c1 */
  428|  2.40M|    "movq %9, %%rax\n"
  429|  2.40M|    "mulq %%r13\n"
  430|  2.40M|    "addq %%rax, %%r8\n"
  431|  2.40M|    "adcq %%rdx, %%r9\n"
  432|  2.40M|    "adcq $0, %%r10\n"
  433|       |    /* (r8,r9,r10) += n1 */
  434|  2.40M|    "addq %%r12, %%r8\n"
  435|  2.40M|    "adcq $0, %%r9\n"
  436|  2.40M|    "adcq $0, %%r10\n"
  437|       |    /* extract m3 */
  438|  2.40M|    "movq %%r8, %q3\n"
  439|  2.40M|    "xorq %%r8, %%r8\n"
  440|       |    /* (r9,r10,r8) += n3 * c1 */
  441|  2.40M|    "movq %9, %%rax\n"
  442|  2.40M|    "mulq %%r14\n"
  443|  2.40M|    "addq %%rax, %%r9\n"
  444|  2.40M|    "adcq %%rdx, %%r10\n"
  445|  2.40M|    "adcq $0, %%r8\n"
  446|       |    /* (r9,r10,r8) += n2 */
  447|  2.40M|    "addq %%r13, %%r9\n"
  448|  2.40M|    "adcq $0, %%r10\n"
  449|  2.40M|    "adcq $0, %%r8\n"
  450|       |    /* extract m4 */
  451|  2.40M|    "movq %%r9, %q4\n"
  452|       |    /* (r10,r8) += n3 */
  453|  2.40M|    "addq %%r14, %%r10\n"
  454|  2.40M|    "adcq $0, %%r8\n"
  455|       |    /* extract m5 */
  456|  2.40M|    "movq %%r10, %q5\n"
  457|       |    /* extract m6 */
  458|  2.40M|    "movq %%r8, %q6\n"
  459|  2.40M|    : "=&g"(m0), "=&g"(m1), "=&g"(m2), "=g"(m3), "=g"(m4), "=g"(m5), "=g"(m6)
  460|  2.40M|    : "S"(l), "i"(SECP256K1_N_C_0), "i"(SECP256K1_N_C_1)
  ------------------
  |  |   22|  2.40M|#define SECP256K1_N_C_0 (~SECP256K1_N_0 + 1)
  |  |  ------------------
  |  |  |  |   16|  2.40M|#define SECP256K1_N_0 ((uint64_t)0xBFD25E8CD0364141ULL)
  |  |  ------------------
  ------------------
                  : "S"(l), "i"(SECP256K1_N_C_0), "i"(SECP256K1_N_C_1)
  ------------------
  |  |   23|  2.40M|#define SECP256K1_N_C_1 (~SECP256K1_N_1)
  |  |  ------------------
  |  |  |  |   17|  2.40M|#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL)
  |  |  ------------------
  ------------------
  461|  2.40M|    : "rax", "rdx", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "cc");
  462|       |
  463|  2.40M|    SECP256K1_CHECKMEM_MSAN_DEFINE(&m0, sizeof(m0));
  ------------------
  |  |   70|  2.40M|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  2.40M|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 2.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  464|  2.40M|    SECP256K1_CHECKMEM_MSAN_DEFINE(&m1, sizeof(m1));
  ------------------
  |  |   70|  2.40M|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  2.40M|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 2.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  465|  2.40M|    SECP256K1_CHECKMEM_MSAN_DEFINE(&m2, sizeof(m2));
  ------------------
  |  |   70|  2.40M|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  2.40M|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 2.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  466|  2.40M|    SECP256K1_CHECKMEM_MSAN_DEFINE(&m3, sizeof(m3));
  ------------------
  |  |   70|  2.40M|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  2.40M|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 2.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  467|  2.40M|    SECP256K1_CHECKMEM_MSAN_DEFINE(&m4, sizeof(m4));
  ------------------
  |  |   70|  2.40M|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  2.40M|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 2.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  468|  2.40M|    SECP256K1_CHECKMEM_MSAN_DEFINE(&m5, sizeof(m5));
  ------------------
  |  |   70|  2.40M|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  2.40M|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 2.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  469|  2.40M|    SECP256K1_CHECKMEM_MSAN_DEFINE(&m6, sizeof(m6));
  ------------------
  |  |   70|  2.40M|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  2.40M|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 2.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  470|       |
  471|       |    /* Reduce 385 bits into 258. */
  472|  2.40M|    __asm__ __volatile__(
  473|       |    /* Preload */
  474|  2.40M|    "movq %q9, %%r11\n"
  475|  2.40M|    "movq %q10, %%r12\n"
  476|  2.40M|    "movq %q11, %%r13\n"
  477|       |    /* Initialize (r8,r9,r10) */
  478|  2.40M|    "movq %q5, %%r8\n"
  479|  2.40M|    "xorq %%r9, %%r9\n"
  480|  2.40M|    "xorq %%r10, %%r10\n"
  481|       |    /* (r8,r9) += m4 * c0 */
  482|  2.40M|    "movq %12, %%rax\n"
  483|  2.40M|    "mulq %%r11\n"
  484|  2.40M|    "addq %%rax, %%r8\n"
  485|  2.40M|    "adcq %%rdx, %%r9\n"
  486|       |    /* extract p0 */
  487|  2.40M|    "movq %%r8, %q0\n"
  488|  2.40M|    "xorq %%r8, %%r8\n"
  489|       |    /* (r9,r10) += m1 */
  490|  2.40M|    "addq %q6, %%r9\n"
  491|  2.40M|    "adcq $0, %%r10\n"
  492|       |    /* (r9,r10,r8) += m5 * c0 */
  493|  2.40M|    "movq %12, %%rax\n"
  494|  2.40M|    "mulq %%r12\n"
  495|  2.40M|    "addq %%rax, %%r9\n"
  496|  2.40M|    "adcq %%rdx, %%r10\n"
  497|  2.40M|    "adcq $0, %%r8\n"
  498|       |    /* (r9,r10,r8) += m4 * c1 */
  499|  2.40M|    "movq %13, %%rax\n"
  500|  2.40M|    "mulq %%r11\n"
  501|  2.40M|    "addq %%rax, %%r9\n"
  502|  2.40M|    "adcq %%rdx, %%r10\n"
  503|  2.40M|    "adcq $0, %%r8\n"
  504|       |    /* extract p1 */
  505|  2.40M|    "movq %%r9, %q1\n"
  506|  2.40M|    "xorq %%r9, %%r9\n"
  507|       |    /* (r10,r8,r9) += m2 */
  508|  2.40M|    "addq %q7, %%r10\n"
  509|  2.40M|    "adcq $0, %%r8\n"
  510|  2.40M|    "adcq $0, %%r9\n"
  511|       |    /* (r10,r8,r9) += m6 * c0 */
  512|  2.40M|    "movq %12, %%rax\n"
  513|  2.40M|    "mulq %%r13\n"
  514|  2.40M|    "addq %%rax, %%r10\n"
  515|  2.40M|    "adcq %%rdx, %%r8\n"
  516|  2.40M|    "adcq $0, %%r9\n"
  517|       |    /* (r10,r8,r9) += m5 * c1 */
  518|  2.40M|    "movq %13, %%rax\n"
  519|  2.40M|    "mulq %%r12\n"
  520|  2.40M|    "addq %%rax, %%r10\n"
  521|  2.40M|    "adcq %%rdx, %%r8\n"
  522|  2.40M|    "adcq $0, %%r9\n"
  523|       |    /* (r10,r8,r9) += m4 */
  524|  2.40M|    "addq %%r11, %%r10\n"
  525|  2.40M|    "adcq $0, %%r8\n"
  526|  2.40M|    "adcq $0, %%r9\n"
  527|       |    /* extract p2 */
  528|  2.40M|    "movq %%r10, %q2\n"
  529|       |    /* (r8,r9) += m3 */
  530|  2.40M|    "addq %q8, %%r8\n"
  531|  2.40M|    "adcq $0, %%r9\n"
  532|       |    /* (r8,r9) += m6 * c1 */
  533|  2.40M|    "movq %13, %%rax\n"
  534|  2.40M|    "mulq %%r13\n"
  535|  2.40M|    "addq %%rax, %%r8\n"
  536|  2.40M|    "adcq %%rdx, %%r9\n"
  537|       |    /* (r8,r9) += m5 */
  538|  2.40M|    "addq %%r12, %%r8\n"
  539|  2.40M|    "adcq $0, %%r9\n"
  540|       |    /* extract p3 */
  541|  2.40M|    "movq %%r8, %q3\n"
  542|       |    /* (r9) += m6 */
  543|  2.40M|    "addq %%r13, %%r9\n"
  544|       |    /* extract p4 */
  545|  2.40M|    "movq %%r9, %q4\n"
  546|  2.40M|    : "=&g"(p0), "=&g"(p1), "=&g"(p2), "=g"(p3), "=g"(p4)
  547|  2.40M|    : "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|  2.40M|#define SECP256K1_N_C_0 (~SECP256K1_N_0 + 1)
  |  |  ------------------
  |  |  |  |   16|  2.40M|#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|  2.40M|#define SECP256K1_N_C_1 (~SECP256K1_N_1)
  |  |  ------------------
  |  |  |  |   17|  2.40M|#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL)
  |  |  ------------------
  ------------------
  548|  2.40M|    : "rax", "rdx", "r8", "r9", "r10", "r11", "r12", "r13", "cc");
  549|       |
  550|  2.40M|    SECP256K1_CHECKMEM_MSAN_DEFINE(&p0, sizeof(p0));
  ------------------
  |  |   70|  2.40M|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  2.40M|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 2.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  551|  2.40M|    SECP256K1_CHECKMEM_MSAN_DEFINE(&p1, sizeof(p1));
  ------------------
  |  |   70|  2.40M|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  2.40M|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 2.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  552|  2.40M|    SECP256K1_CHECKMEM_MSAN_DEFINE(&p2, sizeof(p2));
  ------------------
  |  |   70|  2.40M|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  2.40M|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 2.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  553|  2.40M|    SECP256K1_CHECKMEM_MSAN_DEFINE(&p3, sizeof(p3));
  ------------------
  |  |   70|  2.40M|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  2.40M|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 2.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  554|  2.40M|    SECP256K1_CHECKMEM_MSAN_DEFINE(&p4, sizeof(p4));
  ------------------
  |  |   70|  2.40M|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  2.40M|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 2.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  555|       |
  556|       |    /* Reduce 258 bits into 256. */
  557|  2.40M|    __asm__ __volatile__(
  558|       |    /* Preload */
  559|  2.40M|    "movq %q5, %%r10\n"
  560|       |    /* (rax,rdx) = p4 * c0 */
  561|  2.40M|    "movq %7, %%rax\n"
  562|  2.40M|    "mulq %%r10\n"
  563|       |    /* (rax,rdx) += p0 */
  564|  2.40M|    "addq %q1, %%rax\n"
  565|  2.40M|    "adcq $0, %%rdx\n"
  566|       |    /* extract r0 */
  567|  2.40M|    "movq %%rax, 0(%q6)\n"
  568|       |    /* Move to (r8,r9) */
  569|  2.40M|    "movq %%rdx, %%r8\n"
  570|  2.40M|    "xorq %%r9, %%r9\n"
  571|       |    /* (r8,r9) += p1 */
  572|  2.40M|    "addq %q2, %%r8\n"
  573|  2.40M|    "adcq $0, %%r9\n"
  574|       |    /* (r8,r9) += p4 * c1 */
  575|  2.40M|    "movq %8, %%rax\n"
  576|  2.40M|    "mulq %%r10\n"
  577|  2.40M|    "addq %%rax, %%r8\n"
  578|  2.40M|    "adcq %%rdx, %%r9\n"
  579|       |    /* Extract r1 */
  580|  2.40M|    "movq %%r8, 8(%q6)\n"
  581|  2.40M|    "xorq %%r8, %%r8\n"
  582|       |    /* (r9,r8) += p4 */
  583|  2.40M|    "addq %%r10, %%r9\n"
  584|  2.40M|    "adcq $0, %%r8\n"
  585|       |    /* (r9,r8) += p2 */
  586|  2.40M|    "addq %q3, %%r9\n"
  587|  2.40M|    "adcq $0, %%r8\n"
  588|       |    /* Extract r2 */
  589|  2.40M|    "movq %%r9, 16(%q6)\n"
  590|  2.40M|    "xorq %%r9, %%r9\n"
  591|       |    /* (r8,r9) += p3 */
  592|  2.40M|    "addq %q4, %%r8\n"
  593|  2.40M|    "adcq $0, %%r9\n"
  594|       |    /* Extract r3 */
  595|  2.40M|    "movq %%r8, 24(%q6)\n"
  596|       |    /* Extract c */
  597|  2.40M|    "movq %%r9, %q0\n"
  598|  2.40M|    : "=g"(c)
  599|  2.40M|    : "g"(p0), "g"(p1), "g"(p2), "g"(p3), "g"(p4), "D"(r), "i"(SECP256K1_N_C_0), "i"(SECP256K1_N_C_1)
  ------------------
  |  |   22|  2.40M|#define SECP256K1_N_C_0 (~SECP256K1_N_0 + 1)
  |  |  ------------------
  |  |  |  |   16|  2.40M|#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|  2.40M|#define SECP256K1_N_C_1 (~SECP256K1_N_1)
  |  |  ------------------
  |  |  |  |   17|  2.40M|#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL)
  |  |  ------------------
  ------------------
  600|  2.40M|    : "rax", "rdx", "r8", "r9", "r10", "cc", "memory");
  601|       |
  602|  2.40M|    SECP256K1_CHECKMEM_MSAN_DEFINE(r, sizeof(*r));
  ------------------
  |  |   70|  2.40M|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  2.40M|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 2.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  603|  2.40M|    SECP256K1_CHECKMEM_MSAN_DEFINE(&c, sizeof(c));
  ------------------
  |  |   70|  2.40M|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  2.40M|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded, False: 2.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  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|  2.40M|    secp256k1_scalar_reduce(r, c + secp256k1_scalar_check_overflow(r));
  680|  2.40M|}
secp256k1.c:secp256k1_scalar_add:
   96|  10.1M|static int secp256k1_scalar_add(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b) {
   97|  10.1M|    int overflow;
   98|  10.1M|    secp256k1_uint128 t;
   99|  10.1M|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|  10.1M|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  100|  10.1M|    SECP256K1_SCALAR_VERIFY(b);
  ------------------
  |  |  103|  10.1M|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  101|       |
  102|  10.1M|    secp256k1_u128_from_u64(&t, a->d[0]);
  103|  10.1M|    secp256k1_u128_accum_u64(&t, b->d[0]);
  104|  10.1M|    r->d[0] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
  105|  10.1M|    secp256k1_u128_accum_u64(&t, a->d[1]);
  106|  10.1M|    secp256k1_u128_accum_u64(&t, b->d[1]);
  107|  10.1M|    r->d[1] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
  108|  10.1M|    secp256k1_u128_accum_u64(&t, a->d[2]);
  109|  10.1M|    secp256k1_u128_accum_u64(&t, b->d[2]);
  110|  10.1M|    r->d[2] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
  111|  10.1M|    secp256k1_u128_accum_u64(&t, a->d[3]);
  112|  10.1M|    secp256k1_u128_accum_u64(&t, b->d[3]);
  113|  10.1M|    r->d[3] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
  114|  10.1M|    overflow = secp256k1_u128_to_u64(&t) + secp256k1_scalar_check_overflow(r);
  115|  10.1M|    VERIFY_CHECK(overflow == 0 || overflow == 1);
  116|  10.1M|    secp256k1_scalar_reduce(r, overflow);
  117|       |
  118|  10.1M|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  10.1M|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  119|  10.1M|    return overflow;
  120|  10.1M|}

secp256k1.c:secp256k1_scalar_verify:
   42|   348M|static void secp256k1_scalar_verify(const secp256k1_scalar *r) {
   43|   348M|    VERIFY_CHECK(secp256k1_scalar_check_overflow(r) == 0);
   44|       |
   45|   348M|    (void)r;
   46|   348M|}
secp256k1.c:secp256k1_scalar_set_b32_seckey:
   34|  11.0M|static int secp256k1_scalar_set_b32_seckey(secp256k1_scalar *r, const unsigned char *bin) {
   35|  11.0M|    int overflow;
   36|  11.0M|    secp256k1_scalar_set_b32(r, bin, &overflow);
   37|       |
   38|  11.0M|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  11.0M|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
   39|  11.0M|    return (!overflow) & (!secp256k1_scalar_is_zero(r));
   40|  11.0M|}
secp256k1.c:secp256k1_scalar_clear:
   30|  19.6M|SECP256K1_INLINE static void secp256k1_scalar_clear(secp256k1_scalar *r) {
   31|  19.6M|    secp256k1_memclear_explicit(r, sizeof(secp256k1_scalar));
   32|  19.6M|}
secp256k1.c:secp256k1_scalar_split_lambda:
  142|   802k|static void secp256k1_scalar_split_lambda(secp256k1_scalar * SECP256K1_RESTRICT r1, secp256k1_scalar * SECP256K1_RESTRICT r2, const secp256k1_scalar * SECP256K1_RESTRICT k) {
  143|   802k|    secp256k1_scalar c1, c2;
  144|   802k|    static const secp256k1_scalar minus_b1 = SECP256K1_SCALAR_CONST(
  ------------------
  |  |   17|   802k|#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|   802k|        0x00000000UL, 0x00000000UL, 0x00000000UL, 0x00000000UL,
  146|   802k|        0xE4437ED6UL, 0x010E8828UL, 0x6F547FA9UL, 0x0ABFE4C3UL
  147|   802k|    );
  148|   802k|    static const secp256k1_scalar minus_b2 = SECP256K1_SCALAR_CONST(
  ------------------
  |  |   17|   802k|#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|   802k|        0xFFFFFFFFUL, 0xFFFFFFFFUL, 0xFFFFFFFFUL, 0xFFFFFFFEUL,
  150|   802k|        0x8A280AC5UL, 0x0774346DUL, 0xD765CDA8UL, 0x3DB1562CUL
  151|   802k|    );
  152|   802k|    static const secp256k1_scalar g1 = SECP256K1_SCALAR_CONST(
  ------------------
  |  |   17|   802k|#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|   802k|        0x3086D221UL, 0xA7D46BCDUL, 0xE86C90E4UL, 0x9284EB15UL,
  154|   802k|        0x3DAA8A14UL, 0x71E8CA7FUL, 0xE893209AUL, 0x45DBB031UL
  155|   802k|    );
  156|   802k|    static const secp256k1_scalar g2 = SECP256K1_SCALAR_CONST(
  ------------------
  |  |   17|   802k|#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|   802k|        0xE4437ED6UL, 0x010E8828UL, 0x6F547FA9UL, 0x0ABFE4C4UL,
  158|   802k|        0x221208ACUL, 0x9DF506C6UL, 0x1571B4AEUL, 0x8AC47F71UL
  159|   802k|    );
  160|   802k|    SECP256K1_SCALAR_VERIFY(k);
  ------------------
  |  |  103|   802k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  161|   802k|    VERIFY_CHECK(r1 != k);
  162|   802k|    VERIFY_CHECK(r2 != k);
  163|   802k|    VERIFY_CHECK(r1 != r2);
  164|       |
  165|       |    /* these _var calls are constant time since the shift amount is constant */
  166|   802k|    secp256k1_scalar_mul_shift_var(&c1, k, &g1, 384);
  167|   802k|    secp256k1_scalar_mul_shift_var(&c2, k, &g2, 384);
  168|   802k|    secp256k1_scalar_mul(&c1, &c1, &minus_b1);
  169|   802k|    secp256k1_scalar_mul(&c2, &c2, &minus_b2);
  170|   802k|    secp256k1_scalar_add(r2, &c1, &c2);
  171|   802k|    secp256k1_scalar_mul(r1, r2, &secp256k1_const_lambda);
  172|   802k|    secp256k1_scalar_negate(r1, r1);
  173|   802k|    secp256k1_scalar_add(r1, r1, k);
  174|       |
  175|   802k|    SECP256K1_SCALAR_VERIFY(r1);
  ------------------
  |  |  103|   802k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  176|   802k|    SECP256K1_SCALAR_VERIFY(r2);
  ------------------
  |  |  103|   802k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  177|       |#ifdef VERIFY
  178|       |    secp256k1_scalar_split_lambda_verify(r1, r2, k);
  179|       |#endif
  180|   802k|}

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_ec_pubkey_parse:
  268|   807k|int secp256k1_ec_pubkey_parse(const secp256k1_context* ctx, secp256k1_pubkey* pubkey, const unsigned char *input, size_t inputlen) {
  269|   807k|    secp256k1_ge Q;
  270|       |
  271|   807k|    VERIFY_CHECK(ctx != NULL);
  272|   807k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|   807k|#define ARG_CHECK(cond) do { \
  |  |   46|   807k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|   807k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 807k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|   807k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 807k]
  |  |  ------------------
  ------------------
  273|   807k|    memset(pubkey, 0, sizeof(*pubkey));
  274|   807k|    ARG_CHECK(input != NULL);
  ------------------
  |  |   45|   807k|#define ARG_CHECK(cond) do { \
  |  |   46|   807k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|   807k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 807k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|   807k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 807k]
  |  |  ------------------
  ------------------
  275|   807k|    if (!secp256k1_eckey_pubkey_parse(&Q, input, inputlen)) {
  ------------------
  |  Branch (275:9): [True: 270, False: 806k]
  ------------------
  276|    270|        return 0;
  277|    270|    }
  278|   806k|    if (!secp256k1_ge_is_in_correct_subgroup(&Q)) {
  ------------------
  |  Branch (278:9): [True: 0, False: 806k]
  ------------------
  279|      0|        return 0;
  280|      0|    }
  281|   806k|    secp256k1_pubkey_save(pubkey, &Q);
  282|   806k|    secp256k1_ge_clear(&Q);
  283|   806k|    return 1;
  284|   806k|}
secp256k1_ec_pubkey_serialize:
  286|  6.96M|int secp256k1_ec_pubkey_serialize(const secp256k1_context* ctx, unsigned char *output, size_t *outputlen, const secp256k1_pubkey* pubkey, unsigned int flags) {
  287|  6.96M|    secp256k1_ge Q;
  288|  6.96M|    size_t len;
  289|       |
  290|  6.96M|    VERIFY_CHECK(ctx != NULL);
  291|  6.96M|    ARG_CHECK(outputlen != NULL);
  ------------------
  |  |   45|  6.96M|#define ARG_CHECK(cond) do { \
  |  |   46|  6.96M|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  6.96M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 6.96M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  6.96M|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 6.96M]
  |  |  ------------------
  ------------------
  292|  6.96M|    ARG_CHECK(*outputlen >= ((flags & SECP256K1_FLAGS_BIT_COMPRESSION) ? 33u : 65u));
  ------------------
  |  |   45|  6.96M|#define ARG_CHECK(cond) do { \
  |  |   46|  6.96M|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  13.9M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 6.96M]
  |  |  |  |  |  Branch (146:39): [True: 6.96M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  6.96M|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 6.96M]
  |  |  ------------------
  ------------------
  293|  6.96M|    len = *outputlen;
  294|  6.96M|    *outputlen = 0;
  295|  6.96M|    ARG_CHECK(output != NULL);
  ------------------
  |  |   45|  6.96M|#define ARG_CHECK(cond) do { \
  |  |   46|  6.96M|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  6.96M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 6.96M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  6.96M|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 6.96M]
  |  |  ------------------
  ------------------
  296|  6.96M|    memset(output, 0, len);
  297|  6.96M|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  6.96M|#define ARG_CHECK(cond) do { \
  |  |   46|  6.96M|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  6.96M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 6.96M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  6.96M|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 6.96M]
  |  |  ------------------
  ------------------
  298|  6.96M|    ARG_CHECK((flags & SECP256K1_FLAGS_TYPE_MASK) == SECP256K1_FLAGS_TYPE_COMPRESSION);
  ------------------
  |  |   45|  6.96M|#define ARG_CHECK(cond) do { \
  |  |   46|  6.96M|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  6.96M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 6.96M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  6.96M|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 6.96M]
  |  |  ------------------
  ------------------
  299|  6.96M|    if (secp256k1_pubkey_load(ctx, &Q, pubkey)) {
  ------------------
  |  Branch (299:9): [True: 6.96M, False: 0]
  ------------------
  300|  6.96M|        if (flags & SECP256K1_FLAGS_BIT_COMPRESSION) {
  ------------------
  |  |  202|  6.96M|#define SECP256K1_FLAGS_BIT_COMPRESSION (1 << 8)
  ------------------
  |  Branch (300:13): [True: 6.96M, False: 0]
  ------------------
  301|  6.96M|            secp256k1_eckey_pubkey_serialize33(&Q, output);
  302|  6.96M|            *outputlen = 33;
  303|  6.96M|        } else {
  304|      0|            secp256k1_eckey_pubkey_serialize65(&Q, output);
  305|      0|            *outputlen = 65;
  306|      0|        }
  307|  6.96M|        return 1;
  308|  6.96M|    }
  309|      0|    return 0;
  310|  6.96M|}
secp256k1_ec_seckey_verify:
  615|  2.44M|int secp256k1_ec_seckey_verify(const secp256k1_context* ctx, const unsigned char *seckey) {
  616|  2.44M|    secp256k1_scalar sec;
  617|  2.44M|    int ret;
  618|  2.44M|    VERIFY_CHECK(ctx != NULL);
  619|  2.44M|    ARG_CHECK(seckey != NULL);
  ------------------
  |  |   45|  2.44M|#define ARG_CHECK(cond) do { \
  |  |   46|  2.44M|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  2.44M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2.44M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  2.44M|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 2.44M]
  |  |  ------------------
  ------------------
  620|       |
  621|  2.44M|    ret = secp256k1_scalar_set_b32_seckey(&sec, seckey);
  622|  2.44M|    secp256k1_scalar_clear(&sec);
  623|  2.44M|    return ret;
  624|  2.44M|}
secp256k1_ec_pubkey_create:
  636|  6.17M|int secp256k1_ec_pubkey_create(const secp256k1_context* ctx, secp256k1_pubkey *pubkey, const unsigned char *seckey) {
  637|  6.17M|    secp256k1_ge p;
  638|  6.17M|    secp256k1_scalar seckey_scalar;
  639|  6.17M|    int ret = 0;
  640|  6.17M|    VERIFY_CHECK(ctx != NULL);
  641|  6.17M|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  6.17M|#define ARG_CHECK(cond) do { \
  |  |   46|  6.17M|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  6.17M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 6.17M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  6.17M|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 6.17M]
  |  |  ------------------
  ------------------
  642|  6.17M|    memset(pubkey, 0, sizeof(*pubkey));
  643|  6.17M|    ARG_CHECK(secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx));
  ------------------
  |  |   45|  6.17M|#define ARG_CHECK(cond) do { \
  |  |   46|  6.17M|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  6.17M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 6.17M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  6.17M|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 6.17M]
  |  |  ------------------
  ------------------
  644|  6.17M|    ARG_CHECK(seckey != NULL);
  ------------------
  |  |   45|  6.17M|#define ARG_CHECK(cond) do { \
  |  |   46|  6.17M|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  6.17M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 6.17M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  6.17M|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 6.17M]
  |  |  ------------------
  ------------------
  645|       |
  646|  6.17M|    ret = secp256k1_ec_pubkey_create_helper(&ctx->ecmult_gen_ctx, &seckey_scalar, &p, seckey);
  647|  6.17M|    secp256k1_pubkey_save(pubkey, &p);
  648|  6.17M|    secp256k1_memczero(pubkey, sizeof(*pubkey), !ret);
  649|       |
  650|  6.17M|    secp256k1_scalar_clear(&seckey_scalar);
  651|  6.17M|    return ret;
  652|  6.17M|}
secp256k1_ec_seckey_tweak_add:
  696|  2.40M|int secp256k1_ec_seckey_tweak_add(const secp256k1_context* ctx, unsigned char *seckey, const unsigned char *tweak32) {
  697|  2.40M|    secp256k1_scalar sec;
  698|  2.40M|    int ret = 0;
  699|  2.40M|    VERIFY_CHECK(ctx != NULL);
  700|  2.40M|    ARG_CHECK(seckey != NULL);
  ------------------
  |  |   45|  2.40M|#define ARG_CHECK(cond) do { \
  |  |   46|  2.40M|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  2.40M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  2.40M|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 2.40M]
  |  |  ------------------
  ------------------
  701|  2.40M|    ARG_CHECK(tweak32 != NULL);
  ------------------
  |  |   45|  2.40M|#define ARG_CHECK(cond) do { \
  |  |   46|  2.40M|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  2.40M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 2.40M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  2.40M|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 2.40M]
  |  |  ------------------
  ------------------
  702|       |
  703|  2.40M|    ret = secp256k1_scalar_set_b32_seckey(&sec, seckey);
  704|  2.40M|    ret &= secp256k1_ec_seckey_tweak_add_helper(&sec, tweak32);
  705|  2.40M|    secp256k1_scalar_cmov(&sec, &secp256k1_scalar_zero, !ret);
  706|  2.40M|    secp256k1_scalar_get_b32(seckey, &sec);
  707|       |
  708|  2.40M|    secp256k1_scalar_clear(&sec);
  709|  2.40M|    return ret;
  710|  2.40M|}
secp256k1_ec_pubkey_tweak_add:
  719|   194k|int secp256k1_ec_pubkey_tweak_add(const secp256k1_context* ctx, secp256k1_pubkey *pubkey, const unsigned char *tweak32) {
  720|   194k|    secp256k1_ge p;
  721|   194k|    int ret = 0;
  722|   194k|    VERIFY_CHECK(ctx != NULL);
  723|   194k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|   194k|#define ARG_CHECK(cond) do { \
  |  |   46|   194k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|   194k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 194k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|   194k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 194k]
  |  |  ------------------
  ------------------
  724|   194k|    ARG_CHECK(tweak32 != NULL);
  ------------------
  |  |   45|   194k|#define ARG_CHECK(cond) do { \
  |  |   46|   194k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|   194k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 194k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|   194k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 194k]
  |  |  ------------------
  ------------------
  725|       |
  726|   194k|    ret = secp256k1_pubkey_load(ctx, &p, pubkey);
  727|   194k|    memset(pubkey, 0, sizeof(*pubkey));
  728|   194k|    ret = ret && secp256k1_ec_pubkey_tweak_add_helper(&p, tweak32);
  ------------------
  |  Branch (728:11): [True: 194k, False: 0]
  |  Branch (728:18): [True: 194k, False: 0]
  ------------------
  729|   194k|    if (ret) {
  ------------------
  |  Branch (729:9): [True: 194k, False: 0]
  ------------------
  730|   194k|        secp256k1_pubkey_save(pubkey, &p);
  731|   194k|    }
  732|       |
  733|   194k|    return ret;
  734|   194k|}
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|  7.53M|static void secp256k1_pubkey_save(secp256k1_pubkey* pubkey, secp256k1_ge* ge) {
  265|  7.53M|    secp256k1_ge_to_bytes(pubkey->data, ge);
  266|  7.53M|}
secp256k1.c:secp256k1_pubkey_load:
  258|  7.95M|static int secp256k1_pubkey_load(const secp256k1_context* ctx, secp256k1_ge* ge, const secp256k1_pubkey* pubkey) {
  259|  7.95M|    secp256k1_ge_from_bytes(ge, pubkey->data);
  260|  7.95M|    ARG_CHECK(!secp256k1_fe_is_zero(&ge->x));
  ------------------
  |  |   45|  7.95M|#define ARG_CHECK(cond) do { \
  |  |   46|  7.95M|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  146|  7.95M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (146:21): [True: 0, False: 7.95M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  7.95M|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded, False: 7.95M]
  |  |  ------------------
  ------------------
  261|  7.95M|    return 1;
  262|  7.95M|}
secp256k1.c:secp256k1_ec_pubkey_create_helper:
  626|  6.17M|static int secp256k1_ec_pubkey_create_helper(const secp256k1_ecmult_gen_context *ecmult_gen_ctx, secp256k1_scalar *seckey_scalar, secp256k1_ge *p, const unsigned char *seckey) {
  627|  6.17M|    int ret;
  628|       |
  629|  6.17M|    ret = secp256k1_scalar_set_b32_seckey(seckey_scalar, seckey);
  630|  6.17M|    secp256k1_scalar_cmov(seckey_scalar, &secp256k1_scalar_one, !ret);
  631|       |
  632|  6.17M|    secp256k1_ecmult_gen_ge(ecmult_gen_ctx, p, seckey_scalar);
  633|  6.17M|    return ret;
  634|  6.17M|}
secp256k1.c:secp256k1_ec_seckey_tweak_add_helper:
  685|  2.40M|static int secp256k1_ec_seckey_tweak_add_helper(secp256k1_scalar *sec, const unsigned char *tweak32) {
  686|  2.40M|    secp256k1_scalar term;
  687|  2.40M|    int overflow = 0;
  688|  2.40M|    int ret = 0;
  689|       |
  690|  2.40M|    secp256k1_scalar_set_b32(&term, tweak32, &overflow);
  691|  2.40M|    ret = (!overflow) & secp256k1_eckey_privkey_tweak_add(sec, &term);
  692|  2.40M|    secp256k1_scalar_clear(&term);
  693|  2.40M|    return ret;
  694|  2.40M|}
secp256k1.c:secp256k1_ec_pubkey_tweak_add_helper:
  712|   269k|static int secp256k1_ec_pubkey_tweak_add_helper(secp256k1_ge *p, const unsigned char *tweak32) {
  713|   269k|    secp256k1_scalar term;
  714|   269k|    int overflow = 0;
  715|   269k|    secp256k1_scalar_set_b32(&term, tweak32, &overflow);
  716|   269k|    return !overflow && secp256k1_eckey_pubkey_tweak_add(p, &term);
  ------------------
  |  Branch (716:12): [True: 269k, False: 0]
  |  Branch (716:25): [True: 269k, False: 0]
  ------------------
  717|   269k|}
secp256k1.c:secp256k1_get_hash_context:
  237|  1.12M|static SECP256K1_INLINE const secp256k1_hash_ctx* secp256k1_get_hash_context(const secp256k1_context *ctx) {
  238|  1.12M|    return &ctx->hash_ctx;
  239|  1.12M|}

secp256k1.c:secp256k1_read_be32:
  428|  20.4M|SECP256K1_INLINE static uint32_t secp256k1_read_be32(const unsigned char* p) {
  429|  20.4M|    return (uint32_t)p[0] << 24 |
  430|  20.4M|           (uint32_t)p[1] << 16 |
  431|  20.4M|           (uint32_t)p[2] << 8  |
  432|  20.4M|           (uint32_t)p[3];
  433|  20.4M|}
secp256k1.c:secp256k1_memcmp_var:
  281|   167k|static SECP256K1_INLINE int secp256k1_memcmp_var(const void *s1, const void *s2, size_t n) {
  282|   167k|    const unsigned char *p1 = s1, *p2 = s2;
  283|   167k|    size_t i;
  284|       |
  285|  2.54M|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (285:17): [True: 2.45M, False: 91.7k]
  ------------------
  286|  2.45M|        int diff = p1[i] - p2[i];
  287|  2.45M|        if (diff != 0) {
  ------------------
  |  Branch (287:13): [True: 75.4k, False: 2.37M]
  ------------------
  288|  75.4k|            return diff;
  289|  75.4k|        }
  290|  2.45M|    }
  291|  91.7k|    return 0;
  292|   167k|}
secp256k1.c:secp256k1_read_be64:
  444|  56.9M|SECP256K1_INLINE static uint64_t secp256k1_read_be64(const unsigned char* p) {
  445|  56.9M|    return (uint64_t)p[0] << 56 |
  446|  56.9M|           (uint64_t)p[1] << 48 |
  447|  56.9M|           (uint64_t)p[2] << 40 |
  448|  56.9M|           (uint64_t)p[3] << 32 |
  449|  56.9M|           (uint64_t)p[4] << 24 |
  450|  56.9M|           (uint64_t)p[5] << 16 |
  451|  56.9M|           (uint64_t)p[6] << 8  |
  452|  56.9M|           (uint64_t)p[7];
  453|  56.9M|}
secp256k1.c:secp256k1_memczero:
  220|  6.17M|static SECP256K1_INLINE void secp256k1_memczero(void *s, size_t len, int flag) {
  221|  6.17M|    unsigned char *p = (unsigned char *)s;
  222|       |    /* Access flag with a volatile-qualified lvalue.
  223|       |       This prevents clang from figuring out (after inlining) that flag can
  224|       |       take only be 0 or 1, which leads to variable time code. */
  225|  6.17M|    volatile int vflag = flag;
  226|  6.17M|    unsigned char mask = -(unsigned char) vflag;
  227|  6.17M|    VERIFY_CHECK(flag == 0 || flag == 1);
  228|   401M|    while (len) {
  ------------------
  |  Branch (228:12): [True: 395M, False: 6.17M]
  ------------------
  229|   395M|        *p &= ~mask;
  230|   395M|        p++;
  231|   395M|        len--;
  232|   395M|    }
  233|  6.17M|}
secp256k1.c:secp256k1_rotr32:
  468|  1.59G|SECP256K1_INLINE static uint32_t secp256k1_rotr32(const uint32_t x, const unsigned int by) {
  469|       |#if defined(_MSC_VER)
  470|       |    return _rotr(x, by);  /* needs <stdlib.h> */
  471|       |#else
  472|       |    /* Reduce rotation amount to avoid UB when shifting. */
  473|  1.59G|    const unsigned int mask = CHAR_BIT * sizeof(x) - 1;
  474|       |    /* Turned into a rot instruction by GCC and clang. */
  475|  1.59G|    return (x >> (by & mask)) | (x << ((-by) & mask));
  476|  1.59G|#endif
  477|  1.59G|}
secp256k1.c:secp256k1_write_be64:
  456|  39.9M|SECP256K1_INLINE static void secp256k1_write_be64(unsigned char* p, uint64_t x) {
  457|  39.9M|    p[7] = x;
  458|  39.9M|    p[6] = x >>  8;
  459|  39.9M|    p[5] = x >> 16;
  460|  39.9M|    p[4] = x >> 24;
  461|  39.9M|    p[3] = x >> 32;
  462|  39.9M|    p[2] = x >> 40;
  463|  39.9M|    p[1] = x >> 48;
  464|  39.9M|    p[0] = x >> 56;
  465|  39.9M|}
secp256k1.c:secp256k1_memclear_explicit:
  268|  51.2M|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|  51.2M|    secp256k1_memzero_explicit(ptr, len);
  271|       |#ifdef VERIFY
  272|       |    SECP256K1_CHECKMEM_UNDEFINE(ptr, len);
  273|       |#endif
  274|  51.2M|}
secp256k1.c:secp256k1_memzero_explicit:
  236|  51.2M|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|  51.2M|    memset(ptr, 0, len);
  253|  51.2M|    __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|  51.2M|}
secp256k1.c:secp256k1_write_be32:
  436|  5.42M|SECP256K1_INLINE static void secp256k1_write_be32(unsigned char* p, uint32_t x) {
  437|  5.42M|    p[3] = x;
  438|  5.42M|    p[2] = x >>  8;
  439|  5.42M|    p[1] = x >> 16;
  440|  5.42M|    p[0] = x >> 24;
  441|  5.42M|}

_Z16WriteCompactSizeI10HashWriterEvRT_m:
  303|  35.3k|{
  304|  35.3k|    if (nSize < 253)
  ------------------
  |  Branch (304:9): [True: 25.8k, False: 9.42k]
  ------------------
  305|  25.8k|    {
  306|  25.8k|        ser_writedata8(os, nSize);
  307|  25.8k|    }
  308|  9.42k|    else if (nSize <= std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (308:14): [True: 9.42k, False: 0]
  ------------------
  309|  9.42k|    {
  310|  9.42k|        ser_writedata8(os, 253);
  311|  9.42k|        ser_writedata16(os, nSize);
  312|  9.42k|    }
  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|  35.3k|    return;
  324|  35.3k|}
_Z14ser_writedata8I10HashWriterEvRT_h:
   58|  70.6k|{
   59|  70.6k|    s.write(std::as_bytes(std::span{&obj, 1}));
   60|  70.6k|}
_Z15ser_writedata16I10HashWriterEvRT_t:
   62|  9.42k|{
   63|  9.42k|    obj = htole16_internal(obj);
   64|  9.42k|    s.write(std::as_bytes(std::span{&obj, 1}));
   65|  9.42k|}
_ZN17CompactSizeWriterC2Em:
  623|  35.3k|    explicit CompactSizeWriter(uint64_t n_in) : n(n_in) { }
_Z20GetSizeOfCompactSizem:
  292|  1.09M|{
  293|  1.09M|    if (nSize < 253)             return sizeof(unsigned char);
  ------------------
  |  Branch (293:9): [True: 7.71k, False: 1.09M]
  ------------------
  294|  1.09M|    else if (nSize <= std::numeric_limits<uint16_t>::max()) return sizeof(unsigned char) + sizeof(uint16_t);
  ------------------
  |  Branch (294:14): [True: 226, False: 1.09M]
  ------------------
  295|  1.09M|    else if (nSize <= std::numeric_limits<unsigned int>::max())  return sizeof(unsigned char) + sizeof(unsigned int);
  ------------------
  |  Branch (295:14): [True: 1.09M, False: 0]
  ------------------
  296|      0|    else                         return sizeof(unsigned char) + sizeof(uint64_t);
  297|  1.09M|}
_Z9SerializeI10HashWriterTk9BasicByteKhLm32EEvRT_NSt3__14spanIT0_XT1_EEE:
  260|   101k|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|   101k|{
  768|   101k|    a.Serialize(os);
  769|   101k|}
_Z9SerializeI10HashWriterEvRT_h:
  250|  35.3k|template <typename Stream> void Serialize(Stream& s, uint8_t a)   { ser_writedata8(s, a); }
_Z9SerializeI10HashWriter17CompactSizeWriterQ12SerializableIT0_T_EEvRS3_RKS2_:
  767|  35.3k|{
  768|  35.3k|    a.Serialize(os);
  769|  35.3k|}
_ZNK17CompactSizeWriter9SerializeI10HashWriterEEvRT_:
  626|  35.3k|    void Serialize(Stream &s) const {
  627|  35.3k|        WriteCompactSize<Stream>(s, n);
  628|  35.3k|    }
_Z9SerializeI10HashWriterTk9BasicByteKhEvRT_NSt3__14spanIT0_Lm18446744073709551615EEE:
  261|   113k|template <typename Stream, BasicByte B>           void Serialize(Stream& s, std::span<B> span)         { s.write(std::as_bytes(span)); }

_Z13MakeUCharSpanINSt3__14spanIhLm18446744073709551615EEEEDTcl13UCharSpanCasttlS1_fp_EEERKT_:
  111|  71.0k|template <typename V> constexpr auto MakeUCharSpan(const V& v) -> decltype(UCharSpanCast(std::span{v})) { return UCharSpanCast(std::span{v}); }
_Z13UCharSpanCastIhLm18446744073709551615EEDaNSt3__14spanIT_XT0_EEE:
  108|  71.0k|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()}; }
_Z13MakeUCharSpanI11XOnlyPubKeyEDTcl13UCharSpanCasttlNSt3__14spanEfp_EEERKT_:
  111|  9.81k|template <typename V> constexpr auto MakeUCharSpan(const V& v) -> decltype(UCharSpanCast(std::span{v})) { return UCharSpanCast(std::span{v}); }
_Z9UCharCastPh:
   96|  71.2k|inline unsigned char* UCharCast(unsigned char* c) { return c; }
_Z13MakeUCharSpanINSt3__16vectorIhNS0_9allocatorIhEEEEEDTcl13UCharSpanCasttlNS0_4spanEfp_EEERKT_:
  111|  1.34M|template <typename V> constexpr auto MakeUCharSpan(const V& v) -> decltype(UCharSpanCast(std::span{v})) { return UCharSpanCast(std::span{v}); }
_Z13MakeUCharSpanINSt3__14spanIKhLm18446744073709551615EEEEDTcl13UCharSpanCasttlS1_fp_EEERKT_:
  111|  11.3M|template <typename V> constexpr auto MakeUCharSpan(const V& v) -> decltype(UCharSpanCast(std::span{v})) { return UCharSpanCast(std::span{v}); }
_Z13UCharSpanCastIKhLm18446744073709551615EEDaNSt3__14spanIT_XT0_EEE:
  108|  12.7M|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()}; }
_Z13MakeUCharSpanI7CScriptEDTcl13UCharSpanCasttlNSt3__14spanEfp_EEERKT_:
  111|  19.9k|template <typename V> constexpr auto MakeUCharSpan(const V& v) -> decltype(UCharSpanCast(std::span{v})) { return UCharSpanCast(std::span{v}); }
_Z9UCharCastPKh:
  100|  12.7M|inline const unsigned char* UCharCast(const unsigned char* c) { return c; }
_Z9UCharCastPKSt4byte:
  102|  10.3M|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|    }
_Z18make_secure_uniqueINSt3__15arrayIhLm32EEEJEENS0_10unique_ptrIT_19SecureUniqueDeleterIS4_EEEDpOT0_:
   67|  5.39M|{
   68|  5.39M|    T* p = secure_allocator<T>().allocate(1);
   69|       |
   70|       |    // initialize in place, and return as secure_unique_ptr
   71|  5.39M|    try {
   72|  5.39M|        return secure_unique_ptr<T>(new (p) T(std::forward<Args>(as)...));
   73|  5.39M|    } catch (...) {
   74|      0|        secure_allocator<T>().deallocate(p, 1);
   75|      0|        throw;
   76|      0|    }
   77|  5.39M|}
_ZN16secure_allocatorINSt3__15arrayIhLm32EEEE8allocateEm:
   28|  5.39M|    {
   29|  5.39M|        T* allocation = static_cast<T*>(LockedPoolManager::Instance().alloc(sizeof(T) * n));
   30|  5.39M|        if (!allocation) {
  ------------------
  |  Branch (30:13): [True: 0, False: 5.39M]
  ------------------
   31|      0|            throw std::bad_alloc();
   32|      0|        }
   33|  5.39M|        return allocation;
   34|  5.39M|    }
_ZN19SecureUniqueDeleterINSt3__15arrayIhLm32EEEEclEPS2_:
   57|  5.39M|    void operator()(T* t) noexcept {
   58|  5.39M|        secure_allocator<T>().deallocate(t, 1);
   59|  5.39M|    }
_ZN16secure_allocatorINSt3__15arrayIhLm32EEEE10deallocateEPS2_m:
   37|  5.39M|    {
   38|  5.39M|        if (p != nullptr) {
  ------------------
  |  Branch (38:13): [True: 5.39M, False: 0]
  ------------------
   39|  5.39M|            memory_cleanse(p, sizeof(T) * n);
   40|  5.39M|        }
   41|  5.39M|        LockedPoolManager::Instance().free(p);
   42|  5.39M|    }
_ZN16secure_allocatorIhE10deallocateEPhm:
   37|  2.40M|    {
   38|  2.40M|        if (p != nullptr) {
  ------------------
  |  Branch (38:13): [True: 2.40M, False: 0]
  ------------------
   39|  2.40M|            memory_cleanse(p, sizeof(T) * n);
   40|  2.40M|        }
   41|  2.40M|        LockedPoolManager::Instance().free(p);
   42|  2.40M|    }
_ZN16secure_allocatorIhE8allocateEm:
   28|  2.40M|    {
   29|  2.40M|        T* allocation = static_cast<T*>(LockedPoolManager::Instance().alloc(sizeof(T) * n));
   30|  2.40M|        if (!allocation) {
  ------------------
  |  Branch (30:13): [True: 0, False: 2.40M]
  ------------------
   31|      0|            throw std::bad_alloc();
   32|      0|        }
   33|  2.40M|        return allocation;
   34|  2.40M|    }

_Z14memory_cleansePvm:
   15|  24.7M|{
   16|       |#if defined(WIN32)
   17|       |    /* SecureZeroMemory is guaranteed not to be optimized out. */
   18|       |    SecureZeroMemory(ptr, len);
   19|       |#else
   20|  24.7M|    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|  24.7M|    __asm__ __volatile__("" : : "r"(ptr) : "memory");
   34|  24.7M|#endif
   35|  24.7M|}

_ZN5ArenaD2Ev:
   48|      2|Arena::~Arena() = default;
_ZN5Arena5allocEm:
   51|  7.80M|{
   52|       |    // Round to next multiple of alignment
   53|  7.80M|    size = align_up(size, alignment);
   54|       |
   55|       |    // Don't handle zero-sized chunks
   56|  7.80M|    if (size == 0)
  ------------------
  |  Branch (56:9): [True: 0, False: 7.80M]
  ------------------
   57|      0|        return nullptr;
   58|       |
   59|       |    // Pick a large enough free-chunk. Returns an iterator pointing to the first element that is not less than key.
   60|       |    // This allocation strategy is best-fit. According to "Dynamic Storage Allocation: A Survey and Critical Review",
   61|       |    // Wilson et. al. 1995, https://www.scs.stanford.edu/14wi-cs140/sched/readings/wilson.pdf, best-fit and first-fit
   62|       |    // policies seem to work well in practice.
   63|  7.80M|    auto size_ptr_it = size_to_free_chunk.lower_bound(size);
   64|  7.80M|    if (size_ptr_it == size_to_free_chunk.end())
  ------------------
  |  Branch (64:9): [True: 0, False: 7.80M]
  ------------------
   65|      0|        return nullptr;
   66|       |
   67|       |    // Create the used-chunk, taking its space from the end of the free-chunk
   68|  7.80M|    const size_t size_remaining = size_ptr_it->first - size;
   69|  7.80M|    char* const free_chunk = static_cast<char*>(size_ptr_it->second);
   70|  7.80M|    auto allocated = chunks_used.emplace(free_chunk + size_remaining, size).first;
   71|  7.80M|    chunks_free_end.erase(free_chunk + size_ptr_it->first);
   72|  7.80M|    if (size_ptr_it->first == size) {
  ------------------
  |  Branch (72:9): [True: 1.78M, False: 6.02M]
  ------------------
   73|       |        // whole chunk is used up
   74|  1.78M|        chunks_free.erase(size_ptr_it->second);
   75|  6.02M|    } else {
   76|       |        // still some memory left in the chunk
   77|  6.02M|        auto it_remaining = size_to_free_chunk.emplace(size_remaining, size_ptr_it->second);
   78|  6.02M|        chunks_free[size_ptr_it->second] = it_remaining;
   79|  6.02M|        chunks_free_end.emplace(free_chunk + size_remaining, it_remaining);
   80|  6.02M|    }
   81|  7.80M|    size_to_free_chunk.erase(size_ptr_it);
   82|       |
   83|  7.80M|    return allocated->first;
   84|  7.80M|}
_ZN5Arena4freeEPv:
   87|  7.80M|{
   88|       |    // Freeing the nullptr pointer is OK.
   89|  7.80M|    if (ptr == nullptr) {
  ------------------
  |  Branch (89:9): [True: 0, False: 7.80M]
  ------------------
   90|      0|        return;
   91|      0|    }
   92|       |
   93|       |    // Remove chunk from used map
   94|  7.80M|    auto i = chunks_used.find(ptr);
   95|  7.80M|    if (i == chunks_used.end()) {
  ------------------
  |  Branch (95:9): [True: 0, False: 7.80M]
  ------------------
   96|      0|        throw std::runtime_error("Arena: invalid or double free");
   97|      0|    }
   98|  7.80M|    auto freed = std::make_pair(static_cast<char*>(i->first), i->second);
   99|  7.80M|    chunks_used.erase(i);
  100|       |
  101|       |    // coalesce freed with previous chunk
  102|  7.80M|    auto prev = chunks_free_end.find(freed.first);
  103|  7.80M|    if (prev != chunks_free_end.end()) {
  ------------------
  |  Branch (103:9): [True: 4.66M, False: 3.13M]
  ------------------
  104|  4.66M|        freed.first -= prev->second->first;
  105|  4.66M|        freed.second += prev->second->first;
  106|  4.66M|        size_to_free_chunk.erase(prev->second);
  107|  4.66M|        chunks_free_end.erase(prev);
  108|  4.66M|    }
  109|       |
  110|       |    // coalesce freed with chunk after freed
  111|  7.80M|    auto next = chunks_free.find(freed.first + freed.second);
  112|  7.80M|    if (next != chunks_free.end()) {
  ------------------
  |  Branch (112:9): [True: 1.35M, False: 6.44M]
  ------------------
  113|  1.35M|        freed.second += next->second->first;
  114|  1.35M|        size_to_free_chunk.erase(next->second);
  115|  1.35M|        chunks_free.erase(next);
  116|  1.35M|    }
  117|       |
  118|       |    // Add/set space with coalesced free chunk
  119|  7.80M|    auto it = size_to_free_chunk.emplace(freed.second, freed.first);
  120|  7.80M|    chunks_free[freed.first] = it;
  121|  7.80M|    chunks_free_end[freed.first + freed.second] = it;
  122|  7.80M|}
_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;
_ZN10LockedPool5allocEm:
  286|  7.80M|{
  287|  7.80M|    std::lock_guard<std::mutex> lock(mutex);
  288|       |
  289|       |    // Don't handle impossible sizes
  290|  7.80M|    if (size == 0 || size > ARENA_SIZE)
  ------------------
  |  Branch (290:9): [True: 0, False: 7.80M]
  |  Branch (290:22): [True: 0, False: 7.80M]
  ------------------
  291|      0|        return nullptr;
  292|       |
  293|       |    // Try allocating from each current arena
  294|  7.80M|    for (auto &arena: arenas) {
  ------------------
  |  Branch (294:21): [True: 7.80M, False: 0]
  ------------------
  295|  7.80M|        void *addr = arena.alloc(size);
  296|  7.80M|        if (addr) {
  ------------------
  |  Branch (296:13): [True: 7.80M, False: 0]
  ------------------
  297|  7.80M|            return addr;
  298|  7.80M|        }
  299|  7.80M|    }
  300|       |    // If that fails, create a new one
  301|      0|    if (new_arena(ARENA_SIZE, ARENA_ALIGN)) {
  ------------------
  |  Branch (301:9): [True: 0, False: 0]
  ------------------
  302|      0|        return arenas.back().alloc(size);
  303|      0|    }
  304|      0|    return nullptr;
  305|      0|}
_ZN10LockedPool4freeEPv:
  308|  7.80M|{
  309|  7.80M|    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|  7.80M|    for (auto &arena: arenas) {
  ------------------
  |  Branch (312:21): [True: 7.80M, False: 0]
  ------------------
  313|  7.80M|        if (arena.addressInArena(ptr)) {
  ------------------
  |  Branch (313:13): [True: 7.80M, False: 0]
  ------------------
  314|  7.80M|            arena.free(ptr);
  315|  7.80M|            return;
  316|  7.80M|        }
  317|  7.80M|    }
  318|      0|    throw std::runtime_error("LockedPool: invalid address not pointing to any arena");
  319|  7.80M|}
_ZN10LockedPool15LockedPageArenaD2Ev:
  370|      2|{
  371|      2|    allocator->FreeLocked(base, size);
  372|      2|}
_ZN17LockedPoolManager8InstanceEv:
  405|  15.6M|{
  406|  15.6M|    static std::once_flag init_flag;
  407|  15.6M|    std::call_once(init_flag, LockedPoolManager::CreateInstance);
  408|  15.6M|    return *LockedPoolManager::_instance;
  409|  15.6M|}
lockedpool.cpp:_ZL8align_upmm:
   32|  7.80M|{
   33|  7.80M|    return (x + align - 1) & ~(align - 1);
   34|  7.80M|}

_ZNK5Arena14addressInArenaEPv:
   90|  7.80M|    bool addressInArena(void *ptr) const { return ptr >= base && ptr < end; }
  ------------------
  |  Branch (90:51): [True: 7.80M, False: 0]
  |  Branch (90:66): [True: 7.80M, 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|    }

_Z28descriptor_parse_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEE:
  104|  12.2k|{
  105|  12.2k|    if (IsTooExpensive(buffer)) return;
  ------------------
  |  Branch (105:9): [True: 22, False: 12.2k]
  ------------------
  106|       |
  107|  12.2k|    const std::string descriptor(buffer.begin(), buffer.end());
  108|  12.2k|    FlatSigningProvider signing_provider;
  109|  12.2k|    std::string error;
  110|  24.4k|    for (const bool require_checksum : {true, false}) {
  ------------------
  |  Branch (110:38): [True: 24.4k, False: 12.2k]
  ------------------
  111|  24.4k|        const auto desc = Parse(descriptor, signing_provider, error, require_checksum);
  112|  24.4k|        std::optional<bool> is_ranged;
  113|  24.4k|        std::optional<bool> is_solvable;
  114|  33.0k|        for (const auto& d : desc) {
  ------------------
  |  Branch (114:28): [True: 33.0k, False: 24.4k]
  ------------------
  115|  33.0k|            assert(d);
  ------------------
  |  Branch (115:13): [True: 33.0k, False: 0]
  ------------------
  116|  33.0k|            TestDescriptor(*d, signing_provider, error, is_ranged, is_solvable);
  117|  33.0k|        }
  118|  24.4k|    }
  119|  12.2k|}
descriptor_parse.cpp:_ZL14TestDescriptorRK10DescriptorR19FlatSigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEERNS4_8optionalIbEESE_:
   19|  33.0k|{
   20|       |    // Trivial helpers.
   21|  33.0k|    (void)desc.IsRange();
   22|  33.0k|    (void)desc.IsSingleType();
   23|  33.0k|    (void)desc.GetOutputType();
   24|       |
   25|  33.0k|    if (is_ranged.has_value()) {
  ------------------
  |  Branch (25:9): [True: 27.4k, False: 5.54k]
  ------------------
   26|  27.4k|        assert(desc.IsRange() == *is_ranged);
  ------------------
  |  Branch (26:9): [True: 27.4k, False: 0]
  ------------------
   27|  27.4k|    } else {
   28|  5.54k|        is_ranged = desc.IsRange();
   29|  5.54k|    }
   30|  33.0k|    if (is_solvable.has_value()) {
  ------------------
  |  Branch (30:9): [True: 27.4k, False: 5.54k]
  ------------------
   31|  27.4k|        assert(desc.IsSolvable() == *is_solvable);
  ------------------
  |  Branch (31:9): [True: 27.4k, False: 0]
  ------------------
   32|  27.4k|    } else {
   33|  5.54k|        is_solvable = desc.IsSolvable();
   34|  5.54k|    }
   35|       |
   36|       |    // Serialization to string representation.
   37|  33.0k|    (void)desc.ToString();
   38|  33.0k|    (void)desc.ToPrivateString(sig_provider, dummy);
   39|  33.0k|    (void)desc.ToNormalizedString(sig_provider, dummy);
   40|       |
   41|       |    // Serialization to Script.
   42|  33.0k|    DescriptorCache cache;
   43|  33.0k|    std::vector<CScript> out_scripts;
   44|  33.0k|    (void)desc.Expand(0, sig_provider, out_scripts, sig_provider, &cache);
   45|  33.0k|    (void)desc.ExpandPrivate(0, sig_provider, sig_provider);
   46|  33.0k|    (void)desc.ExpandFromCache(0, cache, out_scripts, sig_provider);
   47|       |
   48|       |    // If we could serialize to script we must be able to infer using the same provider.
   49|  33.0k|    if (!out_scripts.empty()) {
  ------------------
  |  Branch (49:9): [True: 33.0k, False: 20]
  ------------------
   50|  33.0k|        assert(InferDescriptor(out_scripts.back(), sig_provider));
  ------------------
  |  Branch (50:9): [True: 33.0k, False: 0]
  ------------------
   51|       |
   52|       |        // The ScriptSize() must match the size of the serialized Script. (ScriptSize() is set for all descs but 'combo()'.)
   53|  33.0k|        const bool is_combo{!desc.IsSingleType()};
   54|  33.0k|        assert(is_combo || desc.ScriptSize() == out_scripts.back().size());
  ------------------
  |  Branch (54:9): [True: 515, False: 32.4k]
  |  Branch (54:9): [True: 32.4k, False: 0]
  |  Branch (54:9): [True: 33.0k, False: 0]
  ------------------
   55|  33.0k|    }
   56|       |
   57|  33.0k|    const auto max_sat_maxsig{desc.MaxSatisfactionWeight(true)};
   58|  33.0k|    const auto max_sat_nonmaxsig{desc.MaxSatisfactionWeight(false)};
   59|       |    // Whether an estimate is available must not depend on the signature-size
   60|       |    // assumption, and assuming non-max-size signatures must never increase it.
   61|  33.0k|    assert(max_sat_maxsig.has_value() == max_sat_nonmaxsig.has_value());
  ------------------
  |  Branch (61:5): [True: 33.0k, False: 0]
  ------------------
   62|  33.0k|    assert(max_sat_nonmaxsig <= max_sat_maxsig);
  ------------------
  |  Branch (62:5): [True: 33.0k, False: 0]
  ------------------
   63|  33.0k|    const auto max_elems{desc.MaxSatisfactionElems()};
   64|       |    // We must be able to estimate the max satisfaction size for any solvable descriptor (but combo).
   65|  33.0k|    const bool is_nontop_or_nonsolvable{!*is_solvable || !desc.GetOutputType()};
  ------------------
  |  Branch (65:41): [True: 447, False: 32.5k]
  |  Branch (65:58): [True: 960, False: 31.6k]
  ------------------
   66|  33.0k|    const bool is_input_size_info_set{max_sat_maxsig && max_sat_nonmaxsig && max_elems};
  ------------------
  |  Branch (66:39): [True: 32.0k, False: 982]
  |  Branch (66:57): [True: 32.0k, False: 0]
  |  Branch (66:78): [True: 32.0k, False: 0]
  ------------------
   67|  33.0k|    assert(is_input_size_info_set || is_nontop_or_nonsolvable);
  ------------------
  |  Branch (67:5): [True: 32.0k, False: 982]
  |  Branch (67:5): [True: 982, False: 0]
  |  Branch (67:5): [True: 33.0k, False: 0]
  ------------------
   68|       |
   69|  33.0k|    auto max_key_expr = desc.GetMaxKeyExpr();
   70|  33.0k|    auto key_count = desc.GetKeyCount();
   71|       |    assert((max_key_expr == 0 && key_count == 0) || max_key_expr + 1 == key_count);
  ------------------
  |  Branch (71:5): [True: 6.55k, False: 26.4k]
  |  Branch (71:5): [True: 447, False: 6.10k]
  |  Branch (71:5): [True: 32.5k, False: 0]
  |  Branch (71:5): [True: 33.0k, False: 0]
  ------------------
   72|  33.0k|}

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

_ZN12CheckGlobalsC2Ev:
   59|  12.2k|CheckGlobals::CheckGlobals() : m_impl(std::make_unique<CheckGlobalsImpl>()) {}
_ZN12CheckGlobalsD2Ev:
   60|  12.2k|CheckGlobals::~CheckGlobals() = default;
_ZN16CheckGlobalsImplC2Ev:
   17|  12.2k|    {
   18|  12.2k|        g_used_g_prng = false;
   19|  12.2k|        g_seeded_g_prng_zero = false;
   20|  12.2k|        g_used_system_time = false;
   21|  12.2k|        SetMockTime(0s);
   22|  12.2k|        MockableSteadyClock::ClearMockTime();
   23|  12.2k|    }
_ZN16CheckGlobalsImplD2Ev:
   25|  12.2k|    {
   26|  12.2k|        if (g_used_g_prng && !g_seeded_g_prng_zero) {
  ------------------
  |  Branch (26:13): [True: 2, False: 12.2k]
  |  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|  12.2k|        if (g_used_system_time) {
  ------------------
  |  Branch (42:13): [True: 0, False: 12.2k]
  ------------------
   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|  12.2k|    }

_Z16HasDeepDerivPathNSt3__14spanIKhLm18446744073709551615EEEi:
   86|  12.2k|{
   87|  12.2k|    auto depth{0};
   88|  70.1M|    for (const auto& ch: buff) {
  ------------------
  |  Branch (88:24): [True: 70.1M, False: 12.2k]
  ------------------
   89|  70.1M|        if (ch == ',') {
  ------------------
  |  Branch (89:13): [True: 3.33M, False: 66.8M]
  ------------------
   90|       |            // A comma is always present between two key expressions, so we use that as a delimiter.
   91|  3.33M|            depth = 0;
   92|  66.8M|        } else if (ch == '/') {
  ------------------
  |  Branch (92:20): [True: 222k, False: 66.6M]
  ------------------
   93|   222k|            if (++depth > max_depth) return true;
  ------------------
  |  Branch (93:17): [True: 1, False: 222k]
  ------------------
   94|   222k|        }
   95|  70.1M|    }
   96|  12.2k|    return false;
   97|  12.2k|}
_Z17HasTooManySubFragNSt3__14spanIKhLm18446744073709551615EEEim:
  100|  12.2k|{
  101|       |    // We use a stack because there may be many nested sub-frags.
  102|  12.2k|    std::stack<int> counts;
  103|  70.1M|    for (const auto& ch: buff) {
  ------------------
  |  Branch (103:24): [True: 70.1M, False: 12.2k]
  ------------------
  104|       |        // The fuzzer may generate an input with a ton of parentheses. Rule out pathological cases.
  105|  70.1M|        if (counts.size() > max_nested_subs) return true;
  ------------------
  |  Branch (105:13): [True: 2, False: 70.1M]
  ------------------
  106|       |
  107|  70.1M|        if (ch == '(') {
  ------------------
  |  Branch (107:13): [True: 2.75M, False: 67.4M]
  ------------------
  108|       |            // A new fragment was opened, create a new sub-count for it and start as one since any fragment with
  109|       |            // parentheses has at least one sub.
  110|  2.75M|            counts.push(1);
  111|  67.4M|        } else if (ch == ',' && !counts.empty()) {
  ------------------
  |  Branch (111:20): [True: 3.33M, False: 64.0M]
  |  Branch (111:33): [True: 1.44M, False: 1.89M]
  ------------------
  112|       |            // When encountering a comma, account for an additional sub in the last opened fragment. If it exceeds the
  113|       |            // limit, bail.
  114|  1.44M|            if (++counts.top() > max_subs) return true;
  ------------------
  |  Branch (114:17): [True: 1, False: 1.44M]
  ------------------
  115|  65.9M|        } else if (ch == ')' && !counts.empty()) {
  ------------------
  |  Branch (115:20): [True: 2.12M, False: 63.8M]
  |  Branch (115:33): [True: 2.10M, False: 24.1k]
  ------------------
  116|       |            // Fragment closed! Drop its sub count and resume to counting the number of subs for its parent.
  117|  2.10M|            counts.pop();
  118|  2.10M|        }
  119|  70.1M|    }
  120|  12.2k|    return false;
  121|  12.2k|}
_Z18HasTooManyWrappersNSt3__14spanIKhLm18446744073709551615EEEi:
  124|  12.2k|{
  125|       |    // The number of nested wrappers. Nested wrappers are always characters which follow each other so we don't have to
  126|       |    // use a stack as we do above when counting the number of sub-fragments.
  127|  12.2k|    std::optional<int> count;
  128|       |
  129|       |    // We want to detect nested wrappers. A wrapper is a character prepended to a fragment, separated by a colon. There
  130|       |    // may be more than one wrapper, in which case the colon is not repeated. For instance `jjjjj:pk()`.  To count
  131|       |    // wrappers we iterate in reverse and use the colon to detect the end of a wrapper expression and count how many
  132|       |    // characters there are since the beginning of the expression. We stop counting when we encounter a character
  133|       |    // indicating the beginning of a new expression.
  134|  68.2M|    for (const auto ch: buff | std::views::reverse) {
  ------------------
  |  Branch (134:23): [True: 68.2M, False: 12.2k]
  ------------------
  135|       |        // A colon, start counting.
  136|  68.2M|        if (ch == ':') {
  ------------------
  |  Branch (136:13): [True: 1.82M, False: 66.4M]
  ------------------
  137|       |            // The colon itself is not a wrapper so we start at 0.
  138|  1.82M|            count = 0;
  139|  66.4M|        } else if (count) {
  ------------------
  |  Branch (139:20): [True: 26.4M, False: 40.0M]
  ------------------
  140|       |            // If we are counting wrappers, stop when we crossed the beginning of the wrapper expression. Otherwise keep
  141|       |            // counting and bail if we reached the limit.
  142|       |            // A wrapper may only ever occur as the first sub of a descriptor/miniscript expression ('('), as the
  143|       |            // first Taproot leaf in a pair ('{') or as the nth sub in each case (',').
  144|  26.4M|            if (ch == ',' || ch == '(' || ch == '{') {
  ------------------
  |  Branch (144:17): [True: 1.05M, False: 25.4M]
  |  Branch (144:30): [True: 767k, False: 24.6M]
  |  Branch (144:43): [True: 2.05k, False: 24.6M]
  ------------------
  145|  1.82M|                count.reset();
  146|  24.6M|            } else if (++*count > max_wrappers) {
  ------------------
  |  Branch (146:24): [True: 15, False: 24.6M]
  ------------------
  147|     15|                return true;
  148|     15|            }
  149|  26.4M|        }
  150|  68.2M|    }
  151|       |
  152|  12.2k|    return false;
  153|  12.2k|}
_Z19HasTooLargeLeafSizeNSt3__14spanIKhLm18446744073709551615EEEj:
  156|  12.2k|{
  157|  12.2k|    uint32_t leaf_len{0};
  158|  66.1M|    for (auto c : buff) {
  ------------------
  |  Branch (158:17): [True: 66.1M, False: 12.2k]
  ------------------
  159|  66.1M|        if (c == '(' || c == ')' || c == ',' || c == '{' || c == '}') {
  ------------------
  |  Branch (159:13): [True: 1.92M, False: 64.2M]
  |  Branch (159:25): [True: 1.36M, False: 62.8M]
  |  Branch (159:37): [True: 3.32M, False: 59.5M]
  |  Branch (159:49): [True: 14.1k, False: 59.5M]
  |  Branch (159:61): [True: 6.48k, False: 59.5M]
  ------------------
  160|       |            // Possibly start a fresh leaf, or a fresh function name (with
  161|       |            // wrappers), or terminate a prior leaf.
  162|  6.63M|            leaf_len = 0;
  163|  59.5M|        } else {
  164|       |            // Just treat everything else as a leaf. This will also reject long
  165|       |            // function names, but this should be fine if the max_leaf_size is
  166|       |            // set large enough.
  167|  59.5M|            if (++leaf_len > max_leaf_size) {
  ------------------
  |  Branch (167:17): [True: 3, False: 59.5M]
  ------------------
  168|      3|                return true;
  169|      3|            }
  170|  59.5M|        }
  171|  66.1M|    }
  172|  12.2k|    return false;
  173|  12.2k|}

_Z14IsTooExpensiveNSt3__14spanIKhLm18446744073709551615EEE:
   95|  12.2k|{
   96|       |    // Key derivation is expensive. Deriving deep derivation paths takes a lot of compute and we'd
   97|       |    // rather spend time elsewhere in this target, like on the actual descriptor syntax. So rule
   98|       |    // out strings which could correspond to a descriptor containing a too large derivation path.
   99|  12.2k|    if (HasDeepDerivPath(buffer)) return true;
  ------------------
  |  Branch (99:9): [True: 1, False: 12.2k]
  ------------------
  100|       |
  101|       |    // Some fragments can take a virtually unlimited number of sub-fragments (thresh, multi_a) but
  102|       |    // may perform quadratic operations on them. Limit the number of sub-fragments per fragment.
  103|  12.2k|    if (HasTooManySubFrag(buffer)) return true;
  ------------------
  |  Branch (103:9): [True: 3, False: 12.2k]
  ------------------
  104|       |
  105|       |    // The script building logic performs quadratic copies in the number of nested wrappers. Limit
  106|       |    // the number of nested wrappers per fragment.
  107|  12.2k|    if (HasTooManyWrappers(buffer)) return true;
  ------------------
  |  Branch (107:9): [True: 15, False: 12.2k]
  ------------------
  108|       |
  109|       |    // If any suspected leaf is too large, it will likely not represent a valid
  110|       |    // use-case. Also, possible base58 parsing in the leaf is quadratic. So
  111|       |    // limit the leaf size.
  112|  12.2k|    if (HasTooLargeLeafSize(buffer)) return true;
  ------------------
  |  Branch (112:9): [True: 3, False: 12.2k]
  ------------------
  113|       |
  114|  12.2k|    return false;
  115|  12.2k|}

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

_ZN10tinyformat6formatIJiEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|  30.1k|{
 1089|  30.1k|    std::ostringstream oss;
 1090|  30.1k|    format(oss, fmt, args...);
 1091|  30.1k|    return oss.str();
 1092|  30.1k|}
_ZN10tinyformat6formatIJiEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|  30.1k|{
 1081|  30.1k|    vformat(out, fmt, makeFormatList(args...));
 1082|  30.1k|}
_ZN10tinyformat14makeFormatListIJiEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|  30.1k|{
 1045|  30.1k|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|  30.1k|}
_ZN10tinyformat6formatIJcEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|     25|{
 1089|     25|    std::ostringstream oss;
 1090|     25|    format(oss, fmt, args...);
 1091|     25|    return oss.str();
 1092|     25|}
_ZN10tinyformat6formatIJcEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|     25|{
 1081|     25|    vformat(out, fmt, makeFormatList(args...));
 1082|     25|}
_ZN10tinyformat14makeFormatListIJcEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|     25|{
 1045|     25|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|     25|}
_ZN10tinyformat6detail11FormatListNILi1EEC2IJcEEEDpRKT_:
  990|     25|            : FormatList(&m_formatterStore[0], N),
  991|     25|            m_formatterStore { FormatArg(args)... }
  992|     25|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6detail9FormatArgC2IcEERKT_:
  534|     25|            : m_value(static_cast<const void*>(&value)),
  535|     25|            m_formatImpl(&formatImpl<T>),
  536|     25|            m_toIntImpl(&toIntImpl<T>)
  537|     25|        { }
_ZN10tinyformat6detail9FormatArg10formatImplIcEEvRNSt3__113basic_ostreamIcNS3_11char_traitsIcEEEEPKcSA_iPKv:
  558|     25|        {
  559|     25|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|     25|        }
_ZN10tinyformat11formatValueERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEPKcS7_ic:
  385|     25|                        const char* fmtEnd, int /**/, charType value) \
  386|     25|{                                                                     \
  387|     25|    switch (*(fmtEnd-1)) {                                            \
  388|      0|        case 'u': case 'd': case 'i': case 'o': case 'X': case 'x':   \
  ------------------
  |  Branch (388:9): [True: 0, False: 25]
  |  Branch (388:19): [True: 0, False: 25]
  |  Branch (388:29): [True: 0, False: 25]
  |  Branch (388:39): [True: 0, False: 25]
  |  Branch (388:49): [True: 0, False: 25]
  |  Branch (388:59): [True: 0, False: 25]
  ------------------
  389|      0|            out << static_cast<int>(value); break;                    \
  390|     25|        default:                                                      \
  ------------------
  |  Branch (390:9): [True: 25, False: 0]
  ------------------
  391|     25|            out << value;                   break;                    \
  392|     25|    }                                                                 \
  393|     25|}
_ZN10tinyformat6formatIJmiEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|     26|{
 1089|     26|    std::ostringstream oss;
 1090|     26|    format(oss, fmt, args...);
 1091|     26|    return oss.str();
 1092|     26|}
_ZN10tinyformat6formatIJmiEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|     26|{
 1081|     26|    vformat(out, fmt, makeFormatList(args...));
 1082|     26|}
_ZN10tinyformat14makeFormatListIJmiEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|     26|{
 1045|     26|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|     26|}
_ZN10tinyformat6detail11FormatListNILi2EEC2IJmiEEEDpRKT_:
  990|     26|            : FormatList(&m_formatterStore[0], N),
  991|     26|            m_formatterStore { FormatArg(args)... }
  992|     26|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6formatIJjmEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|     40|{
 1089|     40|    std::ostringstream oss;
 1090|     40|    format(oss, fmt, args...);
 1091|     40|    return oss.str();
 1092|     40|}
_ZN10tinyformat6formatIJjmEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|     40|{
 1081|     40|    vformat(out, fmt, makeFormatList(args...));
 1082|     40|}
_ZN10tinyformat14makeFormatListIJjmEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|     40|{
 1045|     40|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|     40|}
_ZN10tinyformat6detail11FormatListNILi2EEC2IJjmEEEDpRKT_:
  990|     40|            : FormatList(&m_formatterStore[0], N),
  991|     40|            m_formatterStore { FormatArg(args)... }
  992|     40|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6formatIJEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|     55|{
 1089|     55|    std::ostringstream oss;
 1090|     55|    format(oss, fmt, args...);
 1091|     55|    return oss.str();
 1092|     55|}
_ZN10tinyformat6formatIJEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|     55|{
 1081|     55|    vformat(out, fmt, makeFormatList(args...));
 1082|     55|}
_ZN10tinyformat14makeFormatListIJEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|     55|{
 1045|     55|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|     55|}
_ZN10tinyformat17FormatStringCheckILj0EEcvPKcEv:
  197|     55|    operator const char*() { return fmt; }
_ZN10tinyformat6formatIJjEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|  2.34M|{
 1089|  2.34M|    std::ostringstream oss;
 1090|  2.34M|    format(oss, fmt, args...);
 1091|  2.34M|    return oss.str();
 1092|  2.34M|}
_ZN10tinyformat6formatIJjEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|  2.34M|{
 1081|  2.34M|    vformat(out, fmt, makeFormatList(args...));
 1082|  2.34M|}
_ZN10tinyformat14makeFormatListIJjEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|  2.34M|{
 1045|  2.34M|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|  2.34M|}
_ZN10tinyformat6detail9FormatArg10formatImplIjEEvRNSt3__113basic_ostreamIcNS3_11char_traitsIcEEEEPKcSA_iPKv:
  558|  2.34M|        {
  559|  2.34M|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|  2.34M|        }
_ZN10tinyformat11formatValueIjEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKcS8_iRKT_:
  351|  2.34M|{
  352|  2.34M|#ifndef TINYFORMAT_ALLOW_WCHAR_STRINGS
  353|       |    // Since we don't support printing of wchar_t using "%ls", make it fail at
  354|       |    // compile time in preference to printing as a void* at runtime.
  355|  2.34M|    typedef typename detail::is_wchar<T>::tinyformat_wchar_is_not_supported DummyType;
  356|  2.34M|    (void) DummyType(); // avoid unused type warning with gcc-4.8
  357|  2.34M|#endif
  358|       |    // The mess here is to support the %c and %p conversions: if these
  359|       |    // conversions are active we try to convert the type to a char or const
  360|       |    // void* respectively and format that instead of the value itself.  For the
  361|       |    // %p conversion it's important to avoid dereferencing the pointer, which
  362|       |    // could otherwise lead to a crash when printing a dangling (const char*).
  363|  2.34M|    const bool canConvertToChar = detail::is_convertible<T,char>::value;
  364|  2.34M|    const bool canConvertToVoidPtr = detail::is_convertible<T, const void*>::value;
  365|  2.34M|    if (canConvertToChar && *(fmtEnd-1) == 'c')
  ------------------
  |  Branch (365:9): [True: 2.34M, Folded]
  |  Branch (365:29): [True: 0, False: 2.34M]
  ------------------
  366|      0|        detail::formatValueAsType<T, char>::invoke(out, value);
  367|  2.34M|    else if (canConvertToVoidPtr && *(fmtEnd-1) == 'p')
  ------------------
  |  Branch (367:14): [Folded, False: 2.34M]
  |  Branch (367:37): [True: 0, False: 0]
  ------------------
  368|      0|        detail::formatValueAsType<T, const void*>::invoke(out, value);
  369|       |#ifdef TINYFORMAT_OLD_LIBSTDCPLUSPLUS_WORKAROUND
  370|       |    else if (detail::formatZeroIntegerWorkaround<T>::invoke(out, value)) /**/;
  371|       |#endif
  372|  2.34M|    else if (ntrunc >= 0) {
  ------------------
  |  Branch (372:14): [True: 0, False: 2.34M]
  ------------------
  373|       |        // Take care not to overread C strings in truncating conversions like
  374|       |        // "%.4s" where at most 4 characters may be read.
  375|      0|        detail::formatTruncated(out, value, ntrunc);
  376|      0|    }
  377|  2.34M|    else
  378|  2.34M|        out << value;
  379|  2.34M|}
_ZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES7_EEES7_NS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|     36|{
 1089|     36|    std::ostringstream oss;
 1090|     36|    format(oss, fmt, args...);
 1091|     36|    return oss.str();
 1092|     36|}
_ZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES7_EEEvRNS1_13basic_ostreamIcS4_EENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|     36|{
 1081|     36|    vformat(out, fmt, makeFormatList(args...));
 1082|     36|}
_ZN10tinyformat14makeFormatListIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES7_EEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|     36|{
 1045|     36|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|     36|}
_ZN10tinyformat6formatIJmjEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|      9|{
 1089|      9|    std::ostringstream oss;
 1090|      9|    format(oss, fmt, args...);
 1091|      9|    return oss.str();
 1092|      9|}
_ZN10tinyformat6formatIJmjEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|      9|{
 1081|      9|    vformat(out, fmt, makeFormatList(args...));
 1082|      9|}
_ZN10tinyformat14makeFormatListIJmjEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|      9|{
 1045|      9|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|      9|}
_ZN10tinyformat6detail11FormatListNILi2EEC2IJmjEEEDpRKT_:
  990|      9|            : FormatList(&m_formatterStore[0], N),
  991|      9|            m_formatterStore { FormatArg(args)... }
  992|      9|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat17FormatStringCheckILj2EEcvPKcEv:
  197|    111|    operator const char*() { return fmt; }
_ZN10tinyformat6detail9FormatArg10formatImplINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEvRNS3_13basic_ostreamIcS6_EEPKcSE_iPKv:
  558|  4.22k|        {
  559|  4.22k|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|  4.22k|        }
_ZN10tinyformat11formatValueINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvRNS1_13basic_ostreamIcS4_EEPKcSC_iRKT_:
  351|  4.22k|{
  352|  4.22k|#ifndef TINYFORMAT_ALLOW_WCHAR_STRINGS
  353|       |    // Since we don't support printing of wchar_t using "%ls", make it fail at
  354|       |    // compile time in preference to printing as a void* at runtime.
  355|  4.22k|    typedef typename detail::is_wchar<T>::tinyformat_wchar_is_not_supported DummyType;
  356|  4.22k|    (void) DummyType(); // avoid unused type warning with gcc-4.8
  357|  4.22k|#endif
  358|       |    // The mess here is to support the %c and %p conversions: if these
  359|       |    // conversions are active we try to convert the type to a char or const
  360|       |    // void* respectively and format that instead of the value itself.  For the
  361|       |    // %p conversion it's important to avoid dereferencing the pointer, which
  362|       |    // could otherwise lead to a crash when printing a dangling (const char*).
  363|  4.22k|    const bool canConvertToChar = detail::is_convertible<T,char>::value;
  364|  4.22k|    const bool canConvertToVoidPtr = detail::is_convertible<T, const void*>::value;
  365|  4.22k|    if (canConvertToChar && *(fmtEnd-1) == 'c')
  ------------------
  |  Branch (365:9): [Folded, False: 4.22k]
  |  Branch (365:29): [True: 0, False: 0]
  ------------------
  366|      0|        detail::formatValueAsType<T, char>::invoke(out, value);
  367|  4.22k|    else if (canConvertToVoidPtr && *(fmtEnd-1) == 'p')
  ------------------
  |  Branch (367:14): [Folded, False: 4.22k]
  |  Branch (367:37): [True: 0, False: 0]
  ------------------
  368|      0|        detail::formatValueAsType<T, const void*>::invoke(out, value);
  369|       |#ifdef TINYFORMAT_OLD_LIBSTDCPLUSPLUS_WORKAROUND
  370|       |    else if (detail::formatZeroIntegerWorkaround<T>::invoke(out, value)) /**/;
  371|       |#endif
  372|  4.22k|    else if (ntrunc >= 0) {
  ------------------
  |  Branch (372:14): [True: 0, False: 4.22k]
  ------------------
  373|       |        // Take care not to overread C strings in truncating conversions like
  374|       |        // "%.4s" where at most 4 characters may be read.
  375|      0|        detail::formatTruncated(out, value, ntrunc);
  376|      0|    }
  377|  4.22k|    else
  378|  4.22k|        out << value;
  379|  4.22k|}
_ZN10tinyformat6detail11FormatListNILi1EEC2IJiEEEDpRKT_:
  990|  30.1k|            : FormatList(&m_formatterStore[0], N),
  991|  30.1k|            m_formatterStore { FormatArg(args)... }
  992|  30.1k|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6formatIJNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEEENS1_12basic_stringIcS4_NS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|    103|{
 1089|    103|    std::ostringstream oss;
 1090|    103|    format(oss, fmt, args...);
 1091|    103|    return oss.str();
 1092|    103|}
_ZN10tinyformat6formatIJNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEEEvRNS1_13basic_ostreamIcS4_EENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|    103|{
 1081|    103|    vformat(out, fmt, makeFormatList(args...));
 1082|    103|}
_ZN10tinyformat14makeFormatListIJNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|    103|{
 1045|    103|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|    103|}
_ZN10tinyformat6detail11FormatListNILi1EEC2IJNSt3__117basic_string_viewIcNS4_11char_traitsIcEEEEEEEDpRKT_:
  990|    103|            : FormatList(&m_formatterStore[0], N),
  991|    103|            m_formatterStore { FormatArg(args)... }
  992|    103|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6detail9FormatArgC2INSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEEERKT_:
  534|    103|            : m_value(static_cast<const void*>(&value)),
  535|    103|            m_formatImpl(&formatImpl<T>),
  536|    103|            m_toIntImpl(&toIntImpl<T>)
  537|    103|        { }
_ZN10tinyformat6detail9FormatArg10formatImplINSt3__117basic_string_viewIcNS3_11char_traitsIcEEEEEEvRNS3_13basic_ostreamIcS6_EEPKcSC_iPKv:
  558|    103|        {
  559|    103|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|    103|        }
_ZN10tinyformat11formatValueINSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEEEvRNS1_13basic_ostreamIcS4_EEPKcSA_iRKT_:
  351|    103|{
  352|    103|#ifndef TINYFORMAT_ALLOW_WCHAR_STRINGS
  353|       |    // Since we don't support printing of wchar_t using "%ls", make it fail at
  354|       |    // compile time in preference to printing as a void* at runtime.
  355|    103|    typedef typename detail::is_wchar<T>::tinyformat_wchar_is_not_supported DummyType;
  356|    103|    (void) DummyType(); // avoid unused type warning with gcc-4.8
  357|    103|#endif
  358|       |    // The mess here is to support the %c and %p conversions: if these
  359|       |    // conversions are active we try to convert the type to a char or const
  360|       |    // void* respectively and format that instead of the value itself.  For the
  361|       |    // %p conversion it's important to avoid dereferencing the pointer, which
  362|       |    // could otherwise lead to a crash when printing a dangling (const char*).
  363|    103|    const bool canConvertToChar = detail::is_convertible<T,char>::value;
  364|    103|    const bool canConvertToVoidPtr = detail::is_convertible<T, const void*>::value;
  365|    103|    if (canConvertToChar && *(fmtEnd-1) == 'c')
  ------------------
  |  Branch (365:9): [Folded, False: 103]
  |  Branch (365:29): [True: 0, False: 0]
  ------------------
  366|      0|        detail::formatValueAsType<T, char>::invoke(out, value);
  367|    103|    else if (canConvertToVoidPtr && *(fmtEnd-1) == 'p')
  ------------------
  |  Branch (367:14): [Folded, False: 103]
  |  Branch (367:37): [True: 0, False: 0]
  ------------------
  368|      0|        detail::formatValueAsType<T, const void*>::invoke(out, value);
  369|       |#ifdef TINYFORMAT_OLD_LIBSTDCPLUSPLUS_WORKAROUND
  370|       |    else if (detail::formatZeroIntegerWorkaround<T>::invoke(out, value)) /**/;
  371|       |#endif
  372|    103|    else if (ntrunc >= 0) {
  ------------------
  |  Branch (372:14): [True: 0, False: 103]
  ------------------
  373|       |        // Take care not to overread C strings in truncating conversions like
  374|       |        // "%.4s" where at most 4 characters may be read.
  375|      0|        detail::formatTruncated(out, value, ntrunc);
  376|      0|    }
  377|    103|    else
  378|    103|        out << value;
  379|    103|}
_ZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEES7_NS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|  4.15k|{
 1089|  4.15k|    std::ostringstream oss;
 1090|  4.15k|    format(oss, fmt, args...);
 1091|  4.15k|    return oss.str();
 1092|  4.15k|}
_ZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEEvRNS1_13basic_ostreamIcS4_EENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|  4.15k|{
 1081|  4.15k|    vformat(out, fmt, makeFormatList(args...));
 1082|  4.15k|}
_ZN10tinyformat14makeFormatListIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|  4.15k|{
 1045|  4.15k|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|  4.15k|}
_ZN10tinyformat17FormatStringCheckILj1EEcvPKcEv:
  197|  2.37M|    operator const char*() { return fmt; }
_ZNK10tinyformat6detail9FormatArg6formatERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEEPKcS9_i:
  541|  2.37M|        {
  542|  2.37M|            TINYFORMAT_ASSERT(m_value);
  ------------------
  |  |  153|  2.37M|#   define TINYFORMAT_ASSERT(cond) assert(cond)
  ------------------
  |  Branch (542:13): [True: 2.37M, False: 0]
  ------------------
  543|  2.37M|            TINYFORMAT_ASSERT(m_formatImpl);
  ------------------
  |  |  153|  2.37M|#   define TINYFORMAT_ASSERT(cond) assert(cond)
  ------------------
  |  Branch (543:13): [True: 2.37M, False: 0]
  ------------------
  544|  2.37M|            m_formatImpl(out, fmtBegin, fmtEnd, ntrunc, m_value);
  545|  2.37M|        }
_ZN10tinyformat10FormatListC2EPNS_6detail9FormatArgEi:
  966|  2.37M|            : m_args(args), m_N(N) { }
_ZN10tinyformat6detail21parseWidthOrPrecisionERiRPKcbPKNS0_9FormatArgES1_i:
  593|  2.37M|{
  594|  2.37M|    if (*c >= '0' && *c <= '9') {
  ------------------
  |  Branch (594:9): [True: 2.37M, False: 0]
  |  Branch (594:22): [True: 0, False: 2.37M]
  ------------------
  595|      0|        n = parseIntAndAdvance(c);
  596|      0|    }
  597|  2.37M|    else if (*c == '*') {
  ------------------
  |  Branch (597:14): [True: 0, False: 2.37M]
  ------------------
  598|      0|        ++c;
  599|      0|        n = 0;
  600|      0|        if (positionalMode) {
  ------------------
  |  Branch (600:13): [True: 0, False: 0]
  ------------------
  601|      0|            int pos = parseIntAndAdvance(c) - 1;
  602|      0|            if (*c != '$')
  ------------------
  |  Branch (602:17): [True: 0, False: 0]
  ------------------
  603|      0|                TINYFORMAT_ERROR("tinyformat: Non-positional argument used after a positional one");
  ------------------
  |  |  135|      0|#define TINYFORMAT_ERROR(reasonString) throw tinyformat::format_error(reasonString)
  ------------------
  604|      0|            if (pos >= 0 && pos < numArgs)
  ------------------
  |  Branch (604:17): [True: 0, False: 0]
  |  Branch (604:29): [True: 0, False: 0]
  ------------------
  605|      0|                n = args[pos].toInt();
  606|      0|            else
  607|      0|                TINYFORMAT_ERROR("tinyformat: Positional argument out of range");
  ------------------
  |  |  135|      0|#define TINYFORMAT_ERROR(reasonString) throw tinyformat::format_error(reasonString)
  ------------------
  608|      0|            ++c;
  609|      0|        }
  610|      0|        else {
  611|      0|            if (argIndex < numArgs)
  ------------------
  |  Branch (611:17): [True: 0, False: 0]
  ------------------
  612|      0|                n = args[argIndex++].toInt();
  613|      0|            else
  614|      0|                TINYFORMAT_ERROR("tinyformat: Not enough arguments to read variable width or precision");
  ------------------
  |  |  135|      0|#define TINYFORMAT_ERROR(reasonString) throw tinyformat::format_error(reasonString)
  ------------------
  615|      0|        }
  616|      0|    }
  617|  2.37M|    else {
  618|  2.37M|        return false;
  619|  2.37M|    }
  620|      0|    return true;
  621|  2.37M|}
_ZN10tinyformat6detail24printFormatStringLiteralERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKc:
  629|  4.75M|{
  630|  4.75M|    const char* c = fmt;
  631|  7.24M|    for (;; ++c) {
  632|  7.24M|        if (*c == '\0') {
  ------------------
  |  Branch (632:13): [True: 2.37M, False: 4.86M]
  ------------------
  633|  2.37M|            out.write(fmt, c - fmt);
  634|  2.37M|            return c;
  635|  2.37M|        }
  636|  4.86M|        else if (*c == '%') {
  ------------------
  |  Branch (636:18): [True: 2.37M, False: 2.48M]
  ------------------
  637|  2.37M|            out.write(fmt, c - fmt);
  638|  2.37M|            if (*(c+1) != '%')
  ------------------
  |  Branch (638:17): [True: 2.37M, False: 0]
  ------------------
  639|  2.37M|                return c;
  640|       |            // for "%%", tack trailing % onto next literal section.
  641|      0|            fmt = ++c;
  642|      0|        }
  643|  7.24M|    }
  644|  4.75M|}
_ZN10tinyformat6detail21streamStateFromFormatERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEERbS7_RiPKcPKNS0_9FormatArgES8_i:
  685|  2.37M|{
  686|  2.37M|    TINYFORMAT_ASSERT(*fmtStart == '%');
  ------------------
  |  |  153|  2.37M|#   define TINYFORMAT_ASSERT(cond) assert(cond)
  ------------------
  |  Branch (686:5): [True: 2.37M, False: 0]
  ------------------
  687|       |    // Reset stream state to defaults.
  688|  2.37M|    out.width(0);
  689|  2.37M|    out.precision(6);
  690|  2.37M|    out.fill(' ');
  691|       |    // Reset most flags; ignore irrelevant unitbuf & skipws.
  692|  2.37M|    out.unsetf(std::ios::adjustfield | std::ios::basefield |
  693|  2.37M|               std::ios::floatfield | std::ios::showbase | std::ios::boolalpha |
  694|  2.37M|               std::ios::showpoint | std::ios::showpos | std::ios::uppercase);
  695|  2.37M|    bool precisionSet = false;
  696|  2.37M|    bool widthSet = false;
  697|  2.37M|    int widthExtra = 0;
  698|  2.37M|    const char* c = fmtStart + 1;
  699|       |
  700|       |    // 1) Parse an argument index (if followed by '$') or a width possibly
  701|       |    // preceded with '0' flag.
  702|  2.37M|    if (*c >= '0' && *c <= '9') {
  ------------------
  |  Branch (702:9): [True: 2.37M, False: 0]
  |  Branch (702:22): [True: 0, False: 2.37M]
  ------------------
  703|      0|        const char tmpc = *c;
  704|      0|        int value = parseIntAndAdvance(c);
  705|      0|        if (*c == '$') {
  ------------------
  |  Branch (705:13): [True: 0, False: 0]
  ------------------
  706|       |            // value is an argument index
  707|      0|            if (value > 0 && value <= numArgs)
  ------------------
  |  Branch (707:17): [True: 0, False: 0]
  |  Branch (707:30): [True: 0, False: 0]
  ------------------
  708|      0|                argIndex = value - 1;
  709|      0|            else
  710|      0|                TINYFORMAT_ERROR("tinyformat: Positional argument out of range");
  ------------------
  |  |  135|      0|#define TINYFORMAT_ERROR(reasonString) throw tinyformat::format_error(reasonString)
  ------------------
  711|      0|            ++c;
  712|      0|            positionalMode = true;
  713|      0|        }
  714|      0|        else if (positionalMode) {
  ------------------
  |  Branch (714:18): [True: 0, False: 0]
  ------------------
  715|      0|            TINYFORMAT_ERROR("tinyformat: Non-positional argument used after a positional one");
  ------------------
  |  |  135|      0|#define TINYFORMAT_ERROR(reasonString) throw tinyformat::format_error(reasonString)
  ------------------
  716|      0|        }
  717|      0|        else {
  718|      0|            if (tmpc == '0') {
  ------------------
  |  Branch (718:17): [True: 0, False: 0]
  ------------------
  719|       |                // Use internal padding so that numeric values are
  720|       |                // formatted correctly, eg -00010 rather than 000-10
  721|      0|                out.fill('0');
  722|      0|                out.setf(std::ios::internal, std::ios::adjustfield);
  723|      0|            }
  724|      0|            if (value != 0) {
  ------------------
  |  Branch (724:17): [True: 0, False: 0]
  ------------------
  725|       |                // Nonzero value means that we parsed width.
  726|      0|                widthSet = true;
  727|      0|                out.width(value);
  728|      0|            }
  729|      0|        }
  730|      0|    }
  731|  2.37M|    else if (positionalMode) {
  ------------------
  |  Branch (731:14): [True: 0, False: 2.37M]
  ------------------
  732|      0|        TINYFORMAT_ERROR("tinyformat: Non-positional argument used after a positional one");
  ------------------
  |  |  135|      0|#define TINYFORMAT_ERROR(reasonString) throw tinyformat::format_error(reasonString)
  ------------------
  733|      0|    }
  734|       |    // 2) Parse flags and width if we did not do it in previous step.
  735|  2.37M|    if (!widthSet) {
  ------------------
  |  Branch (735:9): [True: 2.37M, False: 0]
  ------------------
  736|       |        // Parse flags
  737|  2.37M|        for (;; ++c) {
  738|  2.37M|            switch (*c) {
  739|      0|                case '#':
  ------------------
  |  Branch (739:17): [True: 0, False: 2.37M]
  ------------------
  740|      0|                    out.setf(std::ios::showpoint | std::ios::showbase);
  741|      0|                    continue;
  742|      0|                case '0':
  ------------------
  |  Branch (742:17): [True: 0, False: 2.37M]
  ------------------
  743|       |                    // overridden by left alignment ('-' flag)
  744|      0|                    if (!(out.flags() & std::ios::left)) {
  ------------------
  |  Branch (744:25): [True: 0, False: 0]
  ------------------
  745|       |                        // Use internal padding so that numeric values are
  746|       |                        // formatted correctly, eg -00010 rather than 000-10
  747|      0|                        out.fill('0');
  748|      0|                        out.setf(std::ios::internal, std::ios::adjustfield);
  749|      0|                    }
  750|      0|                    continue;
  751|      0|                case '-':
  ------------------
  |  Branch (751:17): [True: 0, False: 2.37M]
  ------------------
  752|      0|                    out.fill(' ');
  753|      0|                    out.setf(std::ios::left, std::ios::adjustfield);
  754|      0|                    continue;
  755|      0|                case ' ':
  ------------------
  |  Branch (755:17): [True: 0, False: 2.37M]
  ------------------
  756|       |                    // overridden by show positive sign, '+' flag.
  757|      0|                    if (!(out.flags() & std::ios::showpos))
  ------------------
  |  Branch (757:25): [True: 0, False: 0]
  ------------------
  758|      0|                        spacePadPositive = true;
  759|      0|                    continue;
  760|      0|                case '+':
  ------------------
  |  Branch (760:17): [True: 0, False: 2.37M]
  ------------------
  761|      0|                    out.setf(std::ios::showpos);
  762|      0|                    spacePadPositive = false;
  763|      0|                    widthExtra = 1;
  764|      0|                    continue;
  765|  2.37M|                default:
  ------------------
  |  Branch (765:17): [True: 2.37M, False: 0]
  ------------------
  766|  2.37M|                    break;
  767|  2.37M|            }
  768|  2.37M|            break;
  769|  2.37M|        }
  770|       |        // Parse width
  771|  2.37M|        int width = 0;
  772|  2.37M|        widthSet = parseWidthOrPrecision(width, c, positionalMode,
  773|  2.37M|                                         args, argIndex, numArgs);
  774|  2.37M|        if (widthSet) {
  ------------------
  |  Branch (774:13): [True: 0, False: 2.37M]
  ------------------
  775|      0|            if (width < 0) {
  ------------------
  |  Branch (775:17): [True: 0, False: 0]
  ------------------
  776|       |                // negative widths correspond to '-' flag set
  777|      0|                out.fill(' ');
  778|      0|                out.setf(std::ios::left, std::ios::adjustfield);
  779|      0|                width = -width;
  780|      0|            }
  781|      0|            out.width(width);
  782|      0|        }
  783|  2.37M|    }
  784|       |    // 3) Parse precision
  785|  2.37M|    if (*c == '.') {
  ------------------
  |  Branch (785:9): [True: 0, False: 2.37M]
  ------------------
  786|      0|        ++c;
  787|      0|        int precision = 0;
  788|      0|        parseWidthOrPrecision(precision, c, positionalMode,
  789|      0|                              args, argIndex, numArgs);
  790|       |        // Presence of `.` indicates precision set, unless the inferred value
  791|       |        // was negative in which case the default is used.
  792|      0|        precisionSet = precision >= 0;
  793|      0|        if (precisionSet)
  ------------------
  |  Branch (793:13): [True: 0, False: 0]
  ------------------
  794|      0|            out.precision(precision);
  795|      0|    }
  796|       |    // 4) Ignore any C99 length modifier
  797|  2.37M|    while (*c == 'l' || *c == 'h' || *c == 'L' ||
  ------------------
  |  Branch (797:12): [True: 0, False: 2.37M]
  |  Branch (797:25): [True: 0, False: 2.37M]
  |  Branch (797:38): [True: 0, False: 2.37M]
  ------------------
  798|  2.37M|           *c == 'j' || *c == 'z' || *c == 't') {
  ------------------
  |  Branch (798:12): [True: 0, False: 2.37M]
  |  Branch (798:25): [True: 0, False: 2.37M]
  |  Branch (798:38): [True: 0, False: 2.37M]
  ------------------
  799|      0|        ++c;
  800|      0|    }
  801|       |    // 5) We're up to the conversion specifier character.
  802|       |    // Set stream flags based on conversion specifier (thanks to the
  803|       |    // boost::format class for forging the way here).
  804|  2.37M|    bool intConversion = false;
  805|  2.37M|    switch (*c) {
  806|  2.37M|        case 'u': case 'd': case 'i':
  ------------------
  |  Branch (806:9): [True: 335, False: 2.37M]
  |  Branch (806:19): [True: 85, False: 2.37M]
  |  Branch (806:29): [True: 2.37M, False: 4.77k]
  ------------------
  807|  2.37M|            out.setf(std::ios::dec, std::ios::basefield);
  808|  2.37M|            intConversion = true;
  809|  2.37M|            break;
  810|      0|        case 'o':
  ------------------
  |  Branch (810:9): [True: 0, False: 2.37M]
  ------------------
  811|      0|            out.setf(std::ios::oct, std::ios::basefield);
  812|      0|            intConversion = true;
  813|      0|            break;
  814|      0|        case 'X':
  ------------------
  |  Branch (814:9): [True: 0, False: 2.37M]
  ------------------
  815|      0|            out.setf(std::ios::uppercase);
  816|      0|            [[fallthrough]];
  817|      0|        case 'x': case 'p':
  ------------------
  |  Branch (817:9): [True: 0, False: 2.37M]
  |  Branch (817:19): [True: 0, False: 2.37M]
  ------------------
  818|      0|            out.setf(std::ios::hex, std::ios::basefield);
  819|      0|            intConversion = true;
  820|      0|            break;
  821|      0|        case 'E':
  ------------------
  |  Branch (821:9): [True: 0, False: 2.37M]
  ------------------
  822|      0|            out.setf(std::ios::uppercase);
  823|      0|            [[fallthrough]];
  824|      0|        case 'e':
  ------------------
  |  Branch (824:9): [True: 0, False: 2.37M]
  ------------------
  825|      0|            out.setf(std::ios::scientific, std::ios::floatfield);
  826|      0|            out.setf(std::ios::dec, std::ios::basefield);
  827|      0|            break;
  828|      0|        case 'F':
  ------------------
  |  Branch (828:9): [True: 0, False: 2.37M]
  ------------------
  829|      0|            out.setf(std::ios::uppercase);
  830|      0|            [[fallthrough]];
  831|      0|        case 'f':
  ------------------
  |  Branch (831:9): [True: 0, False: 2.37M]
  ------------------
  832|      0|            out.setf(std::ios::fixed, std::ios::floatfield);
  833|      0|            break;
  834|      0|        case 'A':
  ------------------
  |  Branch (834:9): [True: 0, False: 2.37M]
  ------------------
  835|      0|            out.setf(std::ios::uppercase);
  836|      0|            [[fallthrough]];
  837|      0|        case 'a':
  ------------------
  |  Branch (837:9): [True: 0, False: 2.37M]
  ------------------
  838|       |#           ifdef _MSC_VER
  839|       |            // Workaround https://developercommunity.visualstudio.com/content/problem/520472/hexfloat-stream-output-does-not-ignore-precision-a.html
  840|       |            // by always setting maximum precision on MSVC to avoid precision
  841|       |            // loss for doubles.
  842|       |            out.precision(13);
  843|       |#           endif
  844|      0|            out.setf(std::ios::fixed | std::ios::scientific, std::ios::floatfield);
  845|      0|            break;
  846|      0|        case 'G':
  ------------------
  |  Branch (846:9): [True: 0, False: 2.37M]
  ------------------
  847|      0|            out.setf(std::ios::uppercase);
  848|      0|            [[fallthrough]];
  849|      0|        case 'g':
  ------------------
  |  Branch (849:9): [True: 0, False: 2.37M]
  ------------------
  850|      0|            out.setf(std::ios::dec, std::ios::basefield);
  851|       |            // As in boost::format, let stream decide float format.
  852|      0|            out.flags(out.flags() & ~std::ios::floatfield);
  853|      0|            break;
  854|     25|        case 'c':
  ------------------
  |  Branch (854:9): [True: 25, False: 2.37M]
  ------------------
  855|       |            // Handled as special case inside formatValue()
  856|     25|            break;
  857|  4.32k|        case 's':
  ------------------
  |  Branch (857:9): [True: 4.32k, False: 2.37M]
  ------------------
  858|  4.32k|            if (precisionSet)
  ------------------
  |  Branch (858:17): [True: 0, False: 4.32k]
  ------------------
  859|      0|                ntrunc = static_cast<int>(out.precision());
  860|       |            // Make %s print Booleans as "true" and "false"
  861|  4.32k|            out.setf(std::ios::boolalpha);
  862|  4.32k|            break;
  863|      0|        case 'n':
  ------------------
  |  Branch (863:9): [True: 0, False: 2.37M]
  ------------------
  864|       |            // Not supported - will cause problems!
  865|      0|            TINYFORMAT_ERROR("tinyformat: %n conversion spec not supported");
  ------------------
  |  |  135|      0|#define TINYFORMAT_ERROR(reasonString) throw tinyformat::format_error(reasonString)
  ------------------
  866|      0|            break;
  867|      0|        case '\0':
  ------------------
  |  Branch (867:9): [True: 0, False: 2.37M]
  ------------------
  868|      0|            TINYFORMAT_ERROR("tinyformat: Conversion spec incorrectly "
  ------------------
  |  |  135|      0|#define TINYFORMAT_ERROR(reasonString) throw tinyformat::format_error(reasonString)
  ------------------
  869|      0|                             "terminated by end of string");
  870|      0|            return c;
  871|      0|        default:
  ------------------
  |  Branch (871:9): [True: 0, False: 2.37M]
  ------------------
  872|      0|            break;
  873|  2.37M|    }
  874|  2.37M|    if (intConversion && precisionSet && !widthSet) {
  ------------------
  |  Branch (874:9): [True: 2.37M, False: 4.35k]
  |  Branch (874:26): [True: 0, False: 2.37M]
  |  Branch (874:42): [True: 0, False: 0]
  ------------------
  875|       |        // "precision" for integers gives the minimum number of digits (to be
  876|       |        // padded with zeros on the left).  This isn't really supported by the
  877|       |        // iostreams, but we can approximately simulate it with the width if
  878|       |        // the width isn't otherwise used.
  879|      0|        out.width(out.precision() + widthExtra);
  880|      0|        out.setf(std::ios::internal, std::ios::adjustfield);
  881|      0|        out.fill('0');
  882|      0|    }
  883|  2.37M|    return c+1;
  884|  2.37M|}
_ZN10tinyformat6detail10formatImplERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKcPKNS0_9FormatArgEi:
  891|  2.37M|{
  892|       |    // Saved stream state
  893|  2.37M|    std::streamsize origWidth = out.width();
  894|  2.37M|    std::streamsize origPrecision = out.precision();
  895|  2.37M|    std::ios::fmtflags origFlags = out.flags();
  896|  2.37M|    char origFill = out.fill();
  897|       |
  898|       |    // "Positional mode" means all format specs should be of the form "%n$..."
  899|       |    // with `n` an integer. We detect this in `streamStateFromFormat`.
  900|  2.37M|    bool positionalMode = false;
  901|  2.37M|    int argIndex = 0;
  902|  4.75M|    while (true) {
  ------------------
  |  Branch (902:12): [True: 4.75M, Folded]
  ------------------
  903|  4.75M|        fmt = printFormatStringLiteral(out, fmt);
  904|  4.75M|        if (*fmt == '\0') {
  ------------------
  |  Branch (904:13): [True: 2.37M, False: 2.37M]
  ------------------
  905|  2.37M|            if (!positionalMode && argIndex < numArgs) {
  ------------------
  |  Branch (905:17): [True: 2.37M, False: 0]
  |  Branch (905:36): [True: 0, False: 2.37M]
  ------------------
  906|      0|                TINYFORMAT_ERROR("tinyformat: Not enough conversion specifiers in format string");
  ------------------
  |  |  135|      0|#define TINYFORMAT_ERROR(reasonString) throw tinyformat::format_error(reasonString)
  ------------------
  907|      0|            }
  908|  2.37M|            break;
  909|  2.37M|        }
  910|  2.37M|        bool spacePadPositive = false;
  911|  2.37M|        int ntrunc = -1;
  912|  2.37M|        const char* fmtEnd = streamStateFromFormat(out, positionalMode, spacePadPositive, ntrunc, fmt,
  913|  2.37M|                                                   args, argIndex, numArgs);
  914|       |        // NB: argIndex may be incremented by reading variable width/precision
  915|       |        // in `streamStateFromFormat`, so do the bounds check here.
  916|  2.37M|        if (argIndex >= numArgs) {
  ------------------
  |  Branch (916:13): [True: 0, False: 2.37M]
  ------------------
  917|      0|            TINYFORMAT_ERROR("tinyformat: Too many conversion specifiers in format string");
  ------------------
  |  |  135|      0|#define TINYFORMAT_ERROR(reasonString) throw tinyformat::format_error(reasonString)
  ------------------
  918|      0|            return;
  919|      0|        }
  920|  2.37M|        const FormatArg& arg = args[argIndex];
  921|       |        // Format the arg into the stream.
  922|  2.37M|        if (!spacePadPositive) {
  ------------------
  |  Branch (922:13): [True: 2.37M, False: 0]
  ------------------
  923|  2.37M|            arg.format(out, fmt, fmtEnd, ntrunc);
  924|  2.37M|        }
  925|      0|        else {
  926|       |            // The following is a special case with no direct correspondence
  927|       |            // between stream formatting and the printf() behaviour.  Simulate
  928|       |            // it crudely by formatting into a temporary string stream and
  929|       |            // munging the resulting string.
  930|      0|            std::ostringstream tmpStream;
  931|      0|            tmpStream.copyfmt(out);
  932|      0|            tmpStream.setf(std::ios::showpos);
  933|      0|            arg.format(tmpStream, fmt, fmtEnd, ntrunc);
  934|      0|            std::string result = tmpStream.str(); // allocates... yuck.
  935|      0|            for (size_t i = 0, iend = result.size(); i < iend; ++i) {
  ------------------
  |  Branch (935:54): [True: 0, False: 0]
  ------------------
  936|      0|                if (result[i] == '+')
  ------------------
  |  Branch (936:21): [True: 0, False: 0]
  ------------------
  937|      0|                    result[i] = ' ';
  938|      0|            }
  939|      0|            out << result;
  940|      0|        }
  941|  2.37M|        if (!positionalMode)
  ------------------
  |  Branch (941:13): [True: 2.37M, False: 0]
  ------------------
  942|  2.37M|            ++argIndex;
  943|  2.37M|        fmt = fmtEnd;
  944|  2.37M|    }
  945|       |
  946|       |    // Restore stream state
  947|  2.37M|    out.width(origWidth);
  948|  2.37M|    out.precision(origPrecision);
  949|  2.37M|    out.flags(origFlags);
  950|  2.37M|    out.fill(origFill);
  951|  2.37M|}
_ZN10tinyformat7vformatERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEPKcRKNS_10FormatListE:
 1070|  2.37M|{
 1071|  2.37M|    detail::formatImpl(out, fmt, list.m_args, list.m_N);
 1072|  2.37M|}
_ZN10tinyformat6detail11FormatListNILi2EEC2IJNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEESA_EEEDpRKT_:
  990|     36|            : FormatList(&m_formatterStore[0], N),
  991|     36|            m_formatterStore { FormatArg(args)... }
  992|     36|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6detail11FormatListNILi0EEC2Ev:
 1025|     55|    FormatListN() : FormatList(nullptr, 0) {}
_ZN10tinyformat6detail9FormatArg10formatImplImEEvRNSt3__113basic_ostreamIcNS3_11char_traitsIcEEEEPKcSA_iPKv:
  558|    112|        {
  559|    112|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|    112|        }
_ZN10tinyformat11formatValueImEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKcS8_iRKT_:
  351|    112|{
  352|    112|#ifndef TINYFORMAT_ALLOW_WCHAR_STRINGS
  353|       |    // Since we don't support printing of wchar_t using "%ls", make it fail at
  354|       |    // compile time in preference to printing as a void* at runtime.
  355|    112|    typedef typename detail::is_wchar<T>::tinyformat_wchar_is_not_supported DummyType;
  356|    112|    (void) DummyType(); // avoid unused type warning with gcc-4.8
  357|    112|#endif
  358|       |    // The mess here is to support the %c and %p conversions: if these
  359|       |    // conversions are active we try to convert the type to a char or const
  360|       |    // void* respectively and format that instead of the value itself.  For the
  361|       |    // %p conversion it's important to avoid dereferencing the pointer, which
  362|       |    // could otherwise lead to a crash when printing a dangling (const char*).
  363|    112|    const bool canConvertToChar = detail::is_convertible<T,char>::value;
  364|    112|    const bool canConvertToVoidPtr = detail::is_convertible<T, const void*>::value;
  365|    112|    if (canConvertToChar && *(fmtEnd-1) == 'c')
  ------------------
  |  Branch (365:9): [True: 112, Folded]
  |  Branch (365:29): [True: 0, False: 112]
  ------------------
  366|      0|        detail::formatValueAsType<T, char>::invoke(out, value);
  367|    112|    else if (canConvertToVoidPtr && *(fmtEnd-1) == 'p')
  ------------------
  |  Branch (367:14): [Folded, False: 112]
  |  Branch (367:37): [True: 0, False: 0]
  ------------------
  368|      0|        detail::formatValueAsType<T, const void*>::invoke(out, value);
  369|       |#ifdef TINYFORMAT_OLD_LIBSTDCPLUSPLUS_WORKAROUND
  370|       |    else if (detail::formatZeroIntegerWorkaround<T>::invoke(out, value)) /**/;
  371|       |#endif
  372|    112|    else if (ntrunc >= 0) {
  ------------------
  |  Branch (372:14): [True: 0, False: 112]
  ------------------
  373|       |        // Take care not to overread C strings in truncating conversions like
  374|       |        // "%.4s" where at most 4 characters may be read.
  375|      0|        detail::formatTruncated(out, value, ntrunc);
  376|      0|    }
  377|    112|    else
  378|    112|        out << value;
  379|    112|}
_ZN10tinyformat6detail9FormatArg10formatImplIiEEvRNSt3__113basic_ostreamIcNS3_11char_traitsIcEEEEPKcSA_iPKv:
  558|  30.1k|        {
  559|  30.1k|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|  30.1k|        }
_ZN10tinyformat11formatValueIiEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKcS8_iRKT_:
  351|  30.1k|{
  352|  30.1k|#ifndef TINYFORMAT_ALLOW_WCHAR_STRINGS
  353|       |    // Since we don't support printing of wchar_t using "%ls", make it fail at
  354|       |    // compile time in preference to printing as a void* at runtime.
  355|  30.1k|    typedef typename detail::is_wchar<T>::tinyformat_wchar_is_not_supported DummyType;
  356|  30.1k|    (void) DummyType(); // avoid unused type warning with gcc-4.8
  357|  30.1k|#endif
  358|       |    // The mess here is to support the %c and %p conversions: if these
  359|       |    // conversions are active we try to convert the type to a char or const
  360|       |    // void* respectively and format that instead of the value itself.  For the
  361|       |    // %p conversion it's important to avoid dereferencing the pointer, which
  362|       |    // could otherwise lead to a crash when printing a dangling (const char*).
  363|  30.1k|    const bool canConvertToChar = detail::is_convertible<T,char>::value;
  364|  30.1k|    const bool canConvertToVoidPtr = detail::is_convertible<T, const void*>::value;
  365|  30.1k|    if (canConvertToChar && *(fmtEnd-1) == 'c')
  ------------------
  |  Branch (365:9): [True: 30.1k, Folded]
  |  Branch (365:29): [True: 0, False: 30.1k]
  ------------------
  366|      0|        detail::formatValueAsType<T, char>::invoke(out, value);
  367|  30.1k|    else if (canConvertToVoidPtr && *(fmtEnd-1) == 'p')
  ------------------
  |  Branch (367:14): [Folded, False: 30.1k]
  |  Branch (367:37): [True: 0, False: 0]
  ------------------
  368|      0|        detail::formatValueAsType<T, const void*>::invoke(out, value);
  369|       |#ifdef TINYFORMAT_OLD_LIBSTDCPLUSPLUS_WORKAROUND
  370|       |    else if (detail::formatZeroIntegerWorkaround<T>::invoke(out, value)) /**/;
  371|       |#endif
  372|  30.1k|    else if (ntrunc >= 0) {
  ------------------
  |  Branch (372:14): [True: 0, False: 30.1k]
  ------------------
  373|       |        // Take care not to overread C strings in truncating conversions like
  374|       |        // "%.4s" where at most 4 characters may be read.
  375|      0|        detail::formatTruncated(out, value, ntrunc);
  376|      0|    }
  377|  30.1k|    else
  378|  30.1k|        out << value;
  379|  30.1k|}
_ZN10tinyformat6formatIJmEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|     37|{
 1089|     37|    std::ostringstream oss;
 1090|     37|    format(oss, fmt, args...);
 1091|     37|    return oss.str();
 1092|     37|}
_ZN10tinyformat6formatIJmEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|     37|{
 1081|     37|    vformat(out, fmt, makeFormatList(args...));
 1082|     37|}
_ZN10tinyformat14makeFormatListIJmEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|     37|{
 1045|     37|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|     37|}
_ZN10tinyformat6detail9FormatArgC2IiEERKT_:
  534|  30.1k|            : m_value(static_cast<const void*>(&value)),
  535|  30.1k|            m_formatImpl(&formatImpl<T>),
  536|  30.1k|            m_toIntImpl(&toIntImpl<T>)
  537|  30.1k|        { }
_ZN10tinyformat6detail9FormatArgC2INSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEERKT_:
  534|  4.22k|            : m_value(static_cast<const void*>(&value)),
  535|  4.22k|            m_formatImpl(&formatImpl<T>),
  536|  4.22k|            m_toIntImpl(&toIntImpl<T>)
  537|  4.22k|        { }
_ZN10tinyformat6detail9FormatArgC2IjEERKT_:
  534|  2.34M|            : m_value(static_cast<const void*>(&value)),
  535|  2.34M|            m_formatImpl(&formatImpl<T>),
  536|  2.34M|            m_toIntImpl(&toIntImpl<T>)
  537|  2.34M|        { }
_ZN10tinyformat6detail11FormatListNILi1EEC2IJNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEEEDpRKT_:
  990|  4.15k|            : FormatList(&m_formatterStore[0], N),
  991|  4.15k|            m_formatterStore { FormatArg(args)... }
  992|  4.15k|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6detail11FormatListNILi1EEC2IJjEEEDpRKT_:
  990|  2.34M|            : FormatList(&m_formatterStore[0], N),
  991|  2.34M|            m_formatterStore { FormatArg(args)... }
  992|  2.34M|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6detail11FormatListNILi1EEC2IJmEEEDpRKT_:
  990|     37|            : FormatList(&m_formatterStore[0], N),
  991|     37|            m_formatterStore { FormatArg(args)... }
  992|     37|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6detail9FormatArgC2ImEERKT_:
  534|    112|            : m_value(static_cast<const void*>(&value)),
  535|    112|            m_formatImpl(&formatImpl<T>),
  536|    112|            m_toIntImpl(&toIntImpl<T>)
  537|    112|        { }

_ZNK9base_blobILj160EE3endEv:
  105|  9.37k|    constexpr const unsigned char* end() const { return m_data.data() + WIDTH; }
_ZN9base_blobILj160EE3endEv:
  102|  1.73k|    constexpr unsigned char* end() { return m_data.data() + WIDTH; }
_ZN9base_blobILj160EE5beginEv:
  101|  6.57k|    constexpr unsigned char* begin() { return m_data.data(); }
_ZN7uint160C2ENSt3__14spanIKhLm18446744073709551615EEE:
  188|  4.18k|    constexpr explicit uint160(std::span<const unsigned char> vch) : base_blob<160>(vch) {}
_ZN9base_blobILj160EEC2ENSt3__14spanIKhLm18446744073709551615EEE:
   43|  4.18k|    {
   44|  4.18k|        assert(vch.size() == WIDTH);
  ------------------
  |  Branch (44:9): [True: 4.18k, False: 0]
  ------------------
   45|  4.18k|        std::copy(vch.begin(), vch.end(), m_data.begin());
   46|  4.18k|    }
_ZNK9base_blobILj160EEssERKS0_:
   68|  83.1M|    constexpr std::strong_ordering operator<=>(const base_blob& other) const = default;
_ZNK9base_blobILj256EEeqERKS0_:
   62|  95.5k|    constexpr bool operator==(const base_blob&) const = default;
_ZNK9base_blobILj256EEssERKS0_:
   68|  20.8M|    constexpr std::strong_ordering operator<=>(const base_blob& other) const = default;
_ZNK9base_blobILj256EE6IsNullEv:
   51|  75.3k|    {
   52|  75.3k|        return std::all_of(m_data.begin(), m_data.end(), [](uint8_t val) {
   53|  75.3k|            return val == 0;
   54|  75.3k|        });
   55|  75.3k|    }
_ZZNK9base_blobILj256EE6IsNullEvENKUlhE_clEh:
   52|  1.24M|        return std::all_of(m_data.begin(), m_data.end(), [](uint8_t val) {
   53|  1.24M|            return val == 0;
   54|  1.24M|        });
_ZNK9base_blobILj256EE5beginEv:
  104|  4.73M|    constexpr const unsigned char* begin() const { return m_data.data(); }
_ZNK9base_blobILj256EE3endEv:
  105|   691k|    constexpr const unsigned char* end() const { return m_data.data() + WIDTH; }
_ZNK9base_blobILj160EE5beginEv:
  104|  4.65M|    constexpr const unsigned char* begin() const { return m_data.data(); }
_ZN7uint256C2ENSt3__14spanIKhLm18446744073709551615EEE:
  203|   495k|    constexpr explicit uint256(std::span<const unsigned char> vch) : base_blob<256>(vch) {}
_ZN9base_blobILj256EEC2ENSt3__14spanIKhLm18446744073709551615EEE:
   43|   495k|    {
   44|   495k|        assert(vch.size() == WIDTH);
  ------------------
  |  Branch (44:9): [True: 495k, False: 0]
  ------------------
   45|   495k|        std::copy(vch.begin(), vch.end(), m_data.begin());
   46|   495k|    }
_ZN9base_blobILj256EE4dataEv:
   99|  15.4M|    constexpr unsigned char* data() { return m_data.data(); }
_ZNK9base_blobILj256EE9SerializeI10HashWriterEEvRT_:
  113|   101k|    {
  114|   101k|        s << std::span(m_data);
  115|   101k|    }
_ZN7uint160C2Ev:
  187|  11.4M|    constexpr uint160() = default;
_ZN9base_blobILj160EEC2Ev:
   37|  11.4M|    constexpr base_blob() : m_data() {}
_ZN9base_blobILj160EE4dataEv:
   99|  11.4M|    constexpr unsigned char* data() { return m_data.data(); }
_ZN9base_blobILj160EE4sizeEv:
  107|  11.4M|    static constexpr unsigned int size() { return WIDTH; }
_ZN7uint256C2Ev:
  200|  2.07M|    constexpr uint256() = default;
_ZN9base_blobILj256EEC2Ev:
   37|  10.3M|    constexpr base_blob() : m_data() {}
_ZN9base_blobILj256EE5beginEv:
  101|  2.93M|    constexpr unsigned char* begin() { return m_data.data(); }
_ZNK9base_blobILj256EE4dataEv:
   98|  76.2k|    constexpr const unsigned char* data() const { return m_data.data(); }
_ZN9base_blobILj256EE4sizeEv:
  107|  15.2M|    static constexpr unsigned int size() { return WIDTH; }

_Z19ParseKeyPathElementNSt3__14spanIKcLm18446744073709551615EEE:
   18|   164k|{
   19|   164k|    const std::string_view raw{elem.begin(), elem.end()};
   20|   164k|    if (elem.empty()) {
  ------------------
  |  Branch (20:9): [True: 6, False: 164k]
  ------------------
   21|      6|        return util::Unexpected{strprintf("Key path value '%s' is not valid", raw)};
  ------------------
  |  | 1172|      6|#define strprintf tfm::format
  ------------------
   22|      6|    }
   23|       |
   24|   164k|    bool is_hardened = false;
   25|   164k|    const char last = elem.back();
   26|   164k|    if (last == '\'' || last == 'h') {
  ------------------
  |  Branch (26:9): [True: 30.2k, False: 134k]
  |  Branch (26:25): [True: 113, False: 134k]
  ------------------
   27|  30.3k|        elem = elem.first(elem.size() - 1);
   28|  30.3k|        is_hardened = true;
   29|  30.3k|    }
   30|       |
   31|   164k|    const auto number{ToIntegral<uint32_t>(std::string_view{elem.begin(), elem.end()})};
   32|   164k|    if (!number) {
  ------------------
  |  Branch (32:9): [True: 97, False: 164k]
  ------------------
   33|     97|        return util::Unexpected{strprintf("Key path value '%s' is not a valid uint32", raw)};
  ------------------
  |  | 1172|     97|#define strprintf tfm::format
  ------------------
   34|     97|    }
   35|   164k|    if (*number >= BIP32_HARDENED_FLAG) {
  ------------------
  |  Branch (35:9): [True: 27, False: 164k]
  ------------------
   36|     27|        return util::Unexpected{strprintf("Key path value %u is out of range", *number)};
  ------------------
  |  | 1172|     27|#define strprintf tfm::format
  ------------------
   37|     27|    }
   38|   164k|    return KeyPathElement{*number, is_hardened};
   39|   164k|}
_Z15FormatHDKeypathRKNSt3__16vectorIjNS_9allocatorIjEEEEb:
   63|  3.31M|{
   64|  3.31M|    std::string ret;
   65|  3.31M|    for (auto i : path) {
  ------------------
  |  Branch (65:17): [True: 2.34M, False: 3.31M]
  ------------------
   66|  2.34M|        ret += strprintf("/%i", (i << 1) >> 1);
  ------------------
  |  | 1172|  2.34M|#define strprintf tfm::format
  ------------------
   67|  2.34M|        if (i >> 31) ret += apostrophe ? '\'' : 'h';
  ------------------
  |  Branch (67:13): [True: 1.19M, False: 1.15M]
  |  Branch (67:29): [True: 794k, False: 397k]
  ------------------
   68|  2.34M|    }
   69|  3.31M|    return ret;
   70|  3.31M|}
_Z21HasHardenedDerivationNSt3__14spanIKjLm18446744073709551615EEE:
   78|   750k|{
   79|   750k|    return std::any_of(keypath.begin(), keypath.end(), [](uint32_t index) {
   80|   750k|        return index >> 31;
   81|   750k|    });
   82|   750k|}
bip32.cpp:_ZZ21HasHardenedDerivationNSt3__14spanIKjLm18446744073709551615EEEENK3$_0clEj:
   79|  1.20M|    return std::any_of(keypath.begin(), keypath.end(), [](uint32_t index) {
   80|  1.20M|        return index >> 31;
   81|  1.20M|    });

_ZNK14KeyPathElement11ChildNumberEv:
   25|   164k|    uint32_t ChildNumber() const { return index | (is_hardened ? BIP32_HARDENED_FLAG : BIP32_UNHARDENED_FLAG); }
  ------------------
  |  Branch (25:52): [True: 30.3k, False: 134k]
  ------------------

_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|  12.2k|{
   91|  12.2k|    if (IS_ASSERT || std::is_constant_evaluated() || G_ABORT_ON_FAILED_ASSUME) {
  ------------------
  |  Branch (91:9): [True: 12.2k, Folded]
  |  Branch (91:22): [Folded, False: 0]
  |  Branch (91:54): [True: 0, Folded]
  ------------------
   92|  12.2k|        if (!val) {
  ------------------
  |  Branch (92:13): [True: 0, False: 12.2k]
  ------------------
   93|      0|            assertion_fail(loc, assertion);
   94|      0|        }
   95|  12.2k|    }
   96|  12.2k|    return std::forward<T>(val);
   97|  12.2k|}
_Z22inline_check_non_fatalIRKbEOT_S3_RKNSt3__115source_locationENS4_17basic_string_viewIcNS4_11char_traitsIcEEEE:
   73|  4.77k|{
   74|  4.77k|    if (!val) {
  ------------------
  |  Branch (74:9): [True: 0, False: 4.77k]
  ------------------
   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|  4.77k|    return std::forward<T>(val);
   81|  4.77k|}
_Z22inline_assertion_checkILb1EPKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEEOT0_SA_RKNS0_15source_locationENS0_17basic_string_viewIcS3_EE:
   90|    130|{
   91|    130|    if (IS_ASSERT || std::is_constant_evaluated() || G_ABORT_ON_FAILED_ASSUME) {
  ------------------
  |  Branch (91:9): [True: 130, Folded]
  |  Branch (91:22): [Folded, False: 0]
  |  Branch (91:54): [True: 0, Folded]
  ------------------
   92|    130|        if (!val) {
  ------------------
  |  Branch (92:13): [True: 0, False: 130]
  ------------------
   93|      0|            assertion_fail(loc, assertion);
   94|      0|        }
   95|    130|    }
   96|    130|    return std::forward<T>(val);
   97|    130|}
_Z22inline_check_non_fatalIbEOT_S1_RKNSt3__115source_locationENS2_17basic_string_viewIcNS2_11char_traitsIcEEEE:
   73|  66.9M|{
   74|  66.9M|    if (!val) {
  ------------------
  |  Branch (74:9): [True: 0, False: 66.9M]
  ------------------
   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|  66.9M|    return std::forward<T>(val);
   81|  66.9M|}
_Z22inline_assertion_checkILb0ERKbEOT0_S3_RKNSt3__115source_locationENS4_17basic_string_viewIcNS4_11char_traitsIcEEEE:
   90|  7.95k|{
   91|  7.95k|    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|  7.95k|        if (!val) {
  ------------------
  |  Branch (92:13): [True: 0, False: 7.95k]
  ------------------
   93|      0|            assertion_fail(loc, assertion);
   94|      0|        }
   95|  7.95k|    }
   96|  7.95k|    return std::forward<T>(val);
   97|  7.95k|}
_Z22inline_assertion_checkILb1EbEOT0_S1_RKNSt3__115source_locationENS2_17basic_string_viewIcNS2_11char_traitsIcEEEE:
   90|  2.63M|{
   91|  2.63M|    if (IS_ASSERT || std::is_constant_evaluated() || G_ABORT_ON_FAILED_ASSUME) {
  ------------------
  |  Branch (91:9): [True: 2.63M, Folded]
  |  Branch (91:22): [Folded, False: 0]
  |  Branch (91:54): [True: 0, Folded]
  ------------------
   92|  2.63M|        if (!val) {
  ------------------
  |  Branch (92:13): [True: 0, False: 2.63M]
  ------------------
   93|      0|            assertion_fail(loc, assertion);
   94|      0|        }
   95|  2.63M|    }
   96|  2.63M|    return std::forward<T>(val);
   97|  2.63M|}
_Z22inline_assertion_checkILb0EbEOT0_S1_RKNSt3__115source_locationENS2_17basic_string_viewIcNS2_11char_traitsIcEEEE:
   90|   320k|{
   91|   320k|    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|   320k|        if (!val) {
  ------------------
  |  Branch (92:13): [True: 0, False: 320k]
  ------------------
   93|      0|            assertion_fail(loc, assertion);
   94|      0|        }
   95|   320k|    }
   96|   320k|    return std::forward<T>(val);
   97|   320k|}

_ZNKR4util8ExpectedI14KeyPathElementNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEE5errorEv:
   86|    130|    constexpr const E& error() const& noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
  ------------------
  |  |  116|    130|#define Assert(val) inline_assertion_check<true>(val, std::source_location::current(), #val)
  ------------------
_ZN4util8ExpectedI14KeyPathElementNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEC2IS8_EENS_10UnexpectedIT_EE:
   52|    130|    constexpr Expected(Unexpected<Err> u) : m_data{std::in_place_index<1>, std::move(u).error()}
   53|    130|    {
   54|    130|    }
_ZN4util8ExpectedI14KeyPathElementNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEC2ES1_:
   50|   164k|    constexpr Expected(T v) : m_data{std::in_place_index<0>, std::move(v)} {}
_ZNK4util8ExpectedI14KeyPathElementNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEcvbEv:
   57|   164k|    constexpr explicit operator bool() const noexcept { return has_value(); }
_ZNK4util8ExpectedI14KeyPathElementNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEE9has_valueEv:
   56|   493k|    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
_ZNK4util8ExpectedI14KeyPathElementNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEptEv:
   97|   328k|    constexpr const T* operator->() const noexcept LIFETIMEBOUND { return &value(); }
_ZNKR4util8ExpectedI14KeyPathElementNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEE5valueEv:
   60|   328k|    {
   61|   328k|        if (!has_value()) {
  ------------------
  |  Branch (61:13): [True: 0, False: 328k]
  ------------------
   62|      0|            throw BadExpectedAccess{};
   63|      0|        }
   64|   328k|        return std::get<0>(m_data);
   65|   328k|    }
_ZN4util10UnexpectedINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEC2ES7_:
   23|    130|    constexpr explicit Unexpected(E e) : m_error(std::move(e)) {}
_ZNO4util10UnexpectedINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEE5errorEv:
   27|    130|    constexpr E&& error() && noexcept LIFETIMEBOUND { return std::move(m_error); }

_ZN8BaseHashI7uint256E5beginEv:
   19|  7.94k|    {
   20|  7.94k|        return m_hash.begin();
   21|  7.94k|    }
_ZNK8BaseHashI7uint160E5beginEv:
   24|  9.37k|    {
   25|  9.37k|        return m_hash.begin();
   26|  9.37k|    }
_ZNK8BaseHashI7uint160E3endEv:
   34|  9.37k|    {
   35|  9.37k|        return m_hash.end();
   36|  9.37k|    }
_ZNK8BaseHashI7uint256E3endEv:
   34|  7.93k|    {
   35|  7.93k|        return m_hash.end();
   36|  7.93k|    }
_ZN8BaseHashI7uint160EC2Ev:
   15|      2|    BaseHash() : m_hash() {}
_ZN8BaseHashI7uint160E5beginEv:
   19|      2|    {
   20|      2|        return m_hash.begin();
   21|      2|    }
_ZN8BaseHashI7uint256EC2Ev:
   15|  7.94k|    BaseHash() : m_hash() {}
_ZNK8BaseHashI7uint256E5beginEv:
   24|  7.93k|    {
   25|  7.93k|        return m_hash.begin();
   26|  7.93k|    }
_ZNK8BaseHashI7uint160EltERKS1_:
   54|  81.4k|    {
   55|  81.4k|        return m_hash < other.m_hash;
   56|  81.4k|    }
_ZN8BaseHashI7uint160EC2ERKS0_:
   16|  30.2k|    explicit BaseHash(const HashType& in) : m_hash(in) {}

_Z5IsHexNSt3__117basic_string_viewIcNS_11char_traitsIcEEEE:
   41|   147k|{
   42|  5.77M|    for (char c : str) {
  ------------------
  |  Branch (42:17): [True: 5.77M, False: 145k]
  ------------------
   43|  5.77M|        if (HexDigit(c) < 0) return false;
  ------------------
  |  Branch (43:13): [True: 1.66k, False: 5.77M]
  ------------------
   44|  5.77M|    }
   45|   145k|    return (str.size() > 0) && (str.size()%2 == 0);
  ------------------
  |  Branch (45:12): [True: 145k, False: 2]
  |  Branch (45:32): [True: 145k, False: 84]
  ------------------
   46|   147k|}
_Z11TryParseHexIhENSt3__18optionalINS0_6vectorIT_NS0_9allocatorIS3_EEEEEENS0_17basic_string_viewIcNS0_11char_traitsIcEEEE:
   50|   145k|{
   51|   145k|    std::vector<Byte> vch;
   52|   145k|    vch.reserve(str.size() / 2); // two hex characters form a single byte
   53|       |
   54|   145k|    auto it = str.begin();
   55|  3.03M|    while (it != str.end()) {
  ------------------
  |  Branch (55:12): [True: 2.88M, False: 145k]
  ------------------
   56|  2.88M|        if (IsSpace(*it)) {
  ------------------
  |  Branch (56:13): [True: 0, False: 2.88M]
  ------------------
   57|      0|            ++it;
   58|      0|            continue;
   59|      0|        }
   60|  2.88M|        auto c1 = HexDigit(*(it++));
   61|  2.88M|        if (it == str.end()) return std::nullopt;
  ------------------
  |  Branch (61:13): [True: 0, False: 2.88M]
  ------------------
   62|  2.88M|        auto c2 = HexDigit(*(it++));
   63|  2.88M|        if (c1 < 0 || c2 < 0) return std::nullopt;
  ------------------
  |  Branch (63:13): [True: 0, False: 2.88M]
  |  Branch (63:23): [True: 0, False: 2.88M]
  ------------------
   64|  2.88M|        vch.push_back(Byte(c1 << 4) | Byte(c2));
   65|  2.88M|    }
   66|   145k|    return vch;
   67|   145k|}
_Z7ToLowerNSt3__117basic_string_viewIcNS_11char_traitsIcEEEE:
  363|    426|{
  364|    426|    std::string r;
  365|    426|    r.reserve(str.size());
  366|    843|    for (auto ch : str) r += ToLower(ch);
  ------------------
  |  Branch (366:18): [True: 843, False: 426]
  ------------------
  367|    426|    return r;
  368|    426|}

key_io.cpp:_Z11ConvertBitsILi5ELi8ELb0EZN12_GLOBAL__N_117DecodeDestinationERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERK12CChainParamsRS7_PNS1_6vectorIiNS5_IiEEEEE3$_0NS1_11__wrap_iterIPKhEENS1_8identityEEbT2_T3_SP_T4_:
  221|      3|{
  222|      3|    size_t acc = 0;
  223|      3|    size_t bits = 0;
  224|      3|    constexpr size_t maxv = (1 << tobits) - 1;
  225|      3|    constexpr size_t max_acc = (1 << (frombits + tobits - 1)) - 1;
  226|    111|    while (it != end) {
  ------------------
  |  Branch (226:12): [True: 108, False: 3]
  ------------------
  227|    108|        int v = infn(*it);
  228|    108|        if (v < 0) return false;
  ------------------
  |  Branch (228:13): [True: 0, False: 108]
  ------------------
  229|    108|        acc = ((acc << frombits) | v) & max_acc;
  230|    108|        bits += frombits;
  231|    174|        while (bits >= tobits) {
  ------------------
  |  Branch (231:16): [True: 66, False: 108]
  ------------------
  232|     66|            bits -= tobits;
  233|     66|            outfn((acc >> bits) & maxv);
  234|     66|        }
  235|    108|        ++it;
  236|    108|    }
  237|      3|    if (pad) {
  ------------------
  |  Branch (237:9): [Folded, False: 3]
  ------------------
  238|      0|        if (bits) outfn((acc << (tobits - bits)) & maxv);
  ------------------
  |  Branch (238:13): [True: 0, False: 0]
  ------------------
  239|      3|    } else if (bits >= frombits || ((acc << (tobits - bits)) & maxv)) {
  ------------------
  |  Branch (239:16): [True: 2, False: 1]
  |  Branch (239:36): [True: 1, False: 0]
  ------------------
  240|      3|        return false;
  241|      3|    }
  242|      0|    return true;
  243|      3|}
_Z10ToIntegralIlENSt3__18optionalIT_EENS0_17basic_string_viewIcNS0_11char_traitsIcEEEEm:
  181|  53.4k|{
  182|  53.4k|    static_assert(std::is_integral_v<T>);
  183|  53.4k|    T result;
  184|  53.4k|    const auto [first_nonmatching, error_condition] = std::from_chars(str.data(), str.data() + str.size(), result, base);
  185|  53.4k|    if (first_nonmatching != str.data() + str.size() || error_condition != std::errc{}) {
  ------------------
  |  Branch (185:9): [True: 135, False: 53.2k]
  |  Branch (185:57): [True: 124, False: 53.1k]
  ------------------
  186|    259|        return std::nullopt;
  187|    259|    }
  188|  53.1k|    return result;
  189|  53.4k|}
_Z8ParseHexIhENSt3__16vectorIT_NS0_9allocatorIS2_EEEENS0_17basic_string_viewIcNS0_11char_traitsIcEEEE:
   70|   145k|{
   71|   145k|    return TryParseHex<Byte>(hex_str).value_or(std::vector<Byte>{});
   72|   145k|}
_Z7IsSpacec:
  166|  11.1M|constexpr inline bool IsSpace(char c) noexcept {
  167|  11.1M|    return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v';
  ------------------
  |  Branch (167:12): [True: 770, False: 11.1M]
  |  Branch (167:24): [True: 0, False: 11.1M]
  |  Branch (167:37): [True: 0, False: 11.1M]
  |  Branch (167:50): [True: 0, False: 11.1M]
  |  Branch (167:63): [True: 0, False: 11.1M]
  |  Branch (167:76): [True: 0, False: 11.1M]
  ------------------
  168|  11.1M|}
_Z7ToLowerc:
  256|    843|{
  257|    843|    return (c >= 'A' && c <= 'Z' ? (c - 'A') + 'a' : c);
  ------------------
  |  Branch (257:13): [True: 764, False: 79]
  |  Branch (257:25): [True: 299, False: 465]
  ------------------
  258|    843|}
_Z10ToIntegralIjENSt3__18optionalIT_EENS0_17basic_string_viewIcNS0_11char_traitsIcEEEEm:
  181|   166k|{
  182|   166k|    static_assert(std::is_integral_v<T>);
  183|   166k|    T result;
  184|   166k|    const auto [first_nonmatching, error_condition] = std::from_chars(str.data(), str.data() + str.size(), result, base);
  185|   166k|    if (first_nonmatching != str.data() + str.size() || error_condition != std::errc{}) {
  ------------------
  |  Branch (185:9): [True: 121, False: 166k]
  |  Branch (185:57): [True: 27, False: 166k]
  ------------------
  186|    148|        return std::nullopt;
  187|    148|    }
  188|   166k|    return result;
  189|   166k|}

_ZN4util11ContainsNULENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
  238|  73.2k|{
  239|  22.6M|    for (auto c : str) {
  ------------------
  |  Branch (239:17): [True: 22.6M, False: 73.2k]
  ------------------
  240|  22.6M|        if (c == 0) return true;
  ------------------
  |  Branch (240:13): [True: 0, False: 22.6M]
  ------------------
  241|  22.6M|    }
  242|  73.2k|    return false;
  243|  73.2k|}
_ZN4util5SplitINSt3__14spanIKcLm18446744073709551615EEEEENS1_6vectorIT_NS1_9allocatorIS6_EEEERKS4_cb:
  148|   337k|{
  149|   337k|    return Split<T>(sp, std::string_view{&sep, 1}, include_sep);
  150|   337k|}
_ZN4util5SplitINSt3__14spanIKcLm18446744073709551615EEEEENS1_6vectorIT_NS1_9allocatorIS6_EEEERKS4_NS1_17basic_string_viewIcNS1_11char_traitsIcEEEEb:
  120|   342k|{
  121|   342k|    std::vector<T> ret;
  122|   342k|    auto it = sp.begin();
  123|   342k|    auto start = it;
  124|   180M|    while (it != sp.end()) {
  ------------------
  |  Branch (124:12): [True: 180M, False: 342k]
  ------------------
  125|   180M|        if (separators.find(*it) != std::string::npos) {
  ------------------
  |  Branch (125:13): [True: 1.86M, False: 178M]
  ------------------
  126|  1.86M|            if (include_sep) {
  ------------------
  |  Branch (126:17): [True: 91.0k, False: 1.77M]
  ------------------
  127|  91.0k|                ret.emplace_back(start, it + 1);
  128|  1.77M|            } else {
  129|  1.77M|                ret.emplace_back(start, it);
  130|  1.77M|            }
  131|  1.86M|            start = it + 1;
  132|  1.86M|        }
  133|   180M|        ++it;
  134|   180M|    }
  135|   342k|    ret.emplace_back(start, it);
  136|   342k|    return ret;
  137|   342k|}
_ZN4util8ToStringIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  250|  10.7k|{
  251|  10.7k|    std::ostringstream oss;
  252|  10.7k|    oss.imbue(std::locale::classic());
  253|  10.7k|    oss << t;
  254|  10.7k|    return oss.str();
  255|  10.7k|}

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

descriptor.cpp:_Z6VectorIJNSt3__110unique_ptrIN12_GLOBAL__N_114PubkeyProviderENS0_14default_deleteIS3_EEEEEENS0_6vectorINS0_11common_typeIJDpT_EE4typeENS0_9allocatorISC_EEEEDpOS9_:
   24|  60.5k|{
   25|  60.5k|    std::vector<std::common_type_t<Args...>> ret;
   26|  60.5k|    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|  60.5k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  60.5k|    return ret;
   30|  60.5k|}
_Z6VectorIJ7CScriptEENSt3__16vectorINS1_11common_typeIJDpT_EE4typeENS1_9allocatorIS7_EEEEDpOS4_:
   24|   100k|{
   25|   100k|    std::vector<std::common_type_t<Args...>> ret;
   26|   100k|    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|   100k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|   100k|    return ret;
   30|   100k|}
descriptor.cpp:_Z6VectorIJNSt3__110unique_ptrIN12_GLOBAL__N_114DescriptorImplENS0_14default_deleteIS3_EEEEEENS0_6vectorINS0_11common_typeIJDpT_EE4typeENS0_9allocatorISC_EEEEDpOS9_:
   24|  13.4k|{
   25|  13.4k|    std::vector<std::common_type_t<Args...>> ret;
   26|  13.4k|    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.4k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  13.4k|    return ret;
   30|  13.4k|}
_Z6VectorIJRK7CScriptEENSt3__16vectorINS3_11common_typeIJDpT_EE4typeENS3_9allocatorIS9_EEEEDpOS6_:
   24|    894|{
   25|    894|    std::vector<std::common_type_t<Args...>> ret;
   26|    894|    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|    894|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|    894|    return ret;
   30|    894|}
_Z6VectorIJN10miniscript4NodeIjEEEENSt3__16vectorINS3_11common_typeIJDpT_EE4typeENS3_9allocatorIS9_EEEEDpOS6_:
   24|  1.49M|{
   25|  1.49M|    std::vector<std::common_type_t<Args...>> ret;
   26|  1.49M|    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|  1.49M|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  1.49M|    return ret;
   30|  1.49M|}
_Z6VectorIJjEENSt3__16vectorINS0_11common_typeIJDpT_EE4typeENS0_9allocatorIS6_EEEEDpOS3_:
   24|  14.4k|{
   25|  14.4k|    std::vector<std::common_type_t<Args...>> ret;
   26|  14.4k|    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|  14.4k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  14.4k|    return ret;
   30|  14.4k|}
_Z6VectorIJN10miniscript4NodeIjEES2_EENSt3__16vectorINS3_11common_typeIJDpT_EE4typeENS3_9allocatorIS9_EEEEDpOS6_:
   24|  1.50M|{
   25|  1.50M|    std::vector<std::common_type_t<Args...>> ret;
   26|  1.50M|    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|  1.50M|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  1.50M|    return ret;
   30|  1.50M|}
_Z6VectorIJN10miniscript4NodeIjEES2_S2_EENSt3__16vectorINS3_11common_typeIJDpT_EE4typeENS3_9allocatorIS9_EEEEDpOS6_:
   24|  8.01k|{
   25|  8.01k|    std::vector<std::common_type_t<Args...>> ret;
   26|  8.01k|    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|  8.01k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  8.01k|    return ret;
   30|  8.01k|}
_Z6VectorIJN10miniscript8internal6MaxIntIjEEEENSt3__16vectorINS4_11common_typeIJDpT_EE4typeENS4_9allocatorISA_EEEEDpOS7_:
   24|   353k|{
   25|   353k|    std::vector<std::common_type_t<Args...>> ret;
   26|   353k|    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|   353k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|   353k|    return ret;
   30|   353k|}
_Z6VectorIJN10miniscript8internal7SatInfoEEENSt3__16vectorINS3_11common_typeIJDpT_EE4typeENS3_9allocatorIS9_EEEEDpOS6_:
   24|   176k|{
   25|   176k|    std::vector<std::common_type_t<Args...>> ret;
   26|   176k|    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|   176k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|   176k|    return ret;
   30|   176k|}

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

