_ZN10ScriptHashC2ERK7CScript:
   20|  1.22k|ScriptHash::ScriptHash(const CScript& in) : BaseHash(Hash160(in)) {}
_ZN6PKHashC2ERK6CKeyID:
   24|     20|PKHash::PKHash(const CKeyID& pubkey_id) : BaseHash(pubkey_id) {}
_ZN19WitnessV0ScriptHashC2ERK7CScript:
   45|  1.53k|{
   46|  1.53k|    CSHA256().Write(in.data(), in.size()).Finalize(begin());
   47|  1.53k|}
_Z18ExtractDestinationRK7CScriptRNSt3__17variantIJ14CNoDestination17PubKeyDestination6PKHash10ScriptHash19WitnessV0ScriptHash16WitnessV0KeyHash16WitnessV1Taproot11PayToAnchor14WitnessUnknownEEE:
   50|  1.01k|{
   51|  1.01k|    std::vector<valtype> vSolutions;
   52|  1.01k|    TxoutType whichType = Solver(scriptPubKey, vSolutions);
   53|       |
   54|  1.01k|    switch (whichType) {
  ------------------
  |  Branch (54:13): [True: 0, False: 1.01k]
  ------------------
   55|      7|    case TxoutType::PUBKEY: {
  ------------------
  |  Branch (55:5): [True: 7, False: 1.01k]
  ------------------
   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|      0|    case TxoutType::PUBKEYHASH: {
  ------------------
  |  Branch (64:5): [True: 0, False: 1.01k]
  ------------------
   65|      0|        addressRet = PKHash(uint160(vSolutions[0]));
   66|      0|        return true;
   67|      0|    }
   68|      2|    case TxoutType::SCRIPTHASH: {
  ------------------
  |  Branch (68:5): [True: 2, False: 1.01k]
  ------------------
   69|      2|        addressRet = ScriptHash(uint160(vSolutions[0]));
   70|      2|        return true;
   71|      0|    }
   72|      2|    case TxoutType::WITNESS_V0_KEYHASH: {
  ------------------
  |  Branch (72:5): [True: 2, False: 1.01k]
  ------------------
   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: 1.01k]
  ------------------
   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: 1.01k]
  ------------------
   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|      0|    case TxoutType::ANCHOR: {
  ------------------
  |  Branch (90:5): [True: 0, False: 1.01k]
  ------------------
   91|      0|        addressRet = PayToAnchor();
   92|      0|        return true;
   93|      0|    }
   94|     60|    case TxoutType::WITNESS_UNKNOWN: {
  ------------------
  |  Branch (94:5): [True: 60, False: 958]
  ------------------
   95|     60|        addressRet = WitnessUnknown{vSolutions[0][0], vSolutions[1]};
   96|     60|        return true;
   97|      0|    }
   98|      0|    case TxoutType::MULTISIG:
  ------------------
  |  Branch (98:5): [True: 0, False: 1.01k]
  ------------------
   99|     60|    case TxoutType::NULL_DATA:
  ------------------
  |  Branch (99:5): [True: 60, False: 958]
  ------------------
  100|    940|    case TxoutType::NONSTANDARD:
  ------------------
  |  Branch (100:5): [True: 880, False: 138]
  ------------------
  101|    940|        addressRet = CNoDestination(scriptPubKey);
  102|    940|        return false;
  103|  1.01k|    } // no default case, so the compiler can warn about missing cases
  104|      0|    assert(false);
  105|      0|}
_Z23GetScriptForDestinationRKNSt3__17variantIJ14CNoDestination17PubKeyDestination6PKHash10ScriptHash19WitnessV0ScriptHash16WitnessV0KeyHash16WitnessV1Taproot11PayToAnchor14WitnessUnknownEEE:
  167|  5.66k|{
  168|  5.66k|    return std::visit(CScriptVisitor(), dest);
  169|  5.66k|}
_Z18IsValidDestinationRKNSt3__17variantIJ14CNoDestination17PubKeyDestination6PKHash10ScriptHash19WitnessV0ScriptHash16WitnessV0KeyHash16WitnessV1Taproot11PayToAnchor14WitnessUnknownEEE:
  171|    454|bool IsValidDestination(const CTxDestination& dest) {
  172|    454|    return std::visit(ValidDestinationVisitor(), dest);
  173|    454|}
addresstype.cpp:_ZNK12_GLOBAL__N_114CScriptVisitorclERK6PKHash:
  122|     20|    {
  123|     20|        return CScript() << OP_DUP << OP_HASH160 << ToByteVector(keyID) << OP_EQUALVERIFY << OP_CHECKSIG;
  124|     20|    }
addresstype.cpp:_ZNK12_GLOBAL__N_114CScriptVisitorclERK10ScriptHash:
  127|  1.22k|    {
  128|  1.22k|        return CScript() << OP_HASH160 << ToByteVector(scriptID) << OP_EQUAL;
  129|  1.22k|    }
addresstype.cpp:_ZNK12_GLOBAL__N_114CScriptVisitorclERK19WitnessV0ScriptHash:
  137|  1.53k|    {
  138|  1.53k|        return CScript() << OP_0 << ToByteVector(id);
  139|  1.53k|    }
addresstype.cpp:_ZNK12_GLOBAL__N_114CScriptVisitorclERK16WitnessV0KeyHash:
  132|     13|    {
  133|     13|        return CScript() << OP_0 << ToByteVector(id);
  134|     13|    }
addresstype.cpp:_ZNK12_GLOBAL__N_114CScriptVisitorclERK16WitnessV1Taproot:
  142|  2.83k|    {
  143|  2.83k|        return CScript() << OP_1 << ToByteVector(tap);
  144|  2.83k|    }
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|    454|    bool operator()(const CNoDestination& dest) const { return false; }

_ZN14CNoDestinationC2ERK7CScript:
   26|    940|    explicit CNoDestination(const CScript& script) : m_script(script) {}
_ZN17PubKeyDestinationC2ERK7CPubKey:
   39|      7|    explicit PubKeyDestination(const CPubKey& pubkey) : m_pubkey(pubkey) {}
_ZN10ScriptHashC2ERK7uint160:
   66|      2|    explicit ScriptHash(const uint160& hash) : BaseHash(hash) {}
_ZN19WitnessV0ScriptHashC2Ev:
   74|      2|    WitnessV0ScriptHash() : BaseHash() {}
_ZN16WitnessV0KeyHashC2Ev:
   81|      2|    WitnessV0KeyHash() : BaseHash() {}
_ZN16WitnessV0KeyHashC2ERK7uint160:
   82|     12|    explicit WitnessV0KeyHash(const uint160& hash) : BaseHash(hash) {}
_ZN16WitnessV1TaprootC2Ev:
   90|      5|    WitnessV1Taproot() : XOnlyPubKey() {}
_ZN16WitnessV1TaprootC2ERK11XOnlyPubKey:
   91|  2.83k|    explicit WitnessV1Taproot(const XOnlyPubKey& xpk) : XOnlyPubKey(xpk) {}
_ZN14WitnessUnknownC2EiRKNSt3__16vectorIhNS0_9allocatorIhEEEE:
  103|     60|    WitnessUnknown(int version, const std::vector<unsigned char>& program) : m_version(static_cast<unsigned int>(version)), m_program(program) {}
_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.47k|    CNoDestination() = default;

_Z12EncodeBase584SpanIKhE:
   90|   255k|{
   91|       |    // Skip & count leading zeroes.
   92|   255k|    int zeroes = 0;
   93|   255k|    int length = 0;
   94|   255k|    while (input.size() > 0 && input[0] == 0) {
  ------------------
  |  Branch (94:12): [True: 255k, False: 0]
  |  Branch (94:32): [True: 0, False: 255k]
  ------------------
   95|      0|        input = input.subspan(1);
   96|      0|        zeroes++;
   97|      0|    }
   98|       |    // Allocate enough space in big-endian base58 representation.
   99|   255k|    int size = input.size() * 138 / 100 + 1; // log(256) / log(58), rounded up.
  100|   255k|    std::vector<unsigned char> b58(size);
  101|       |    // Process the bytes.
  102|  21.2M|    while (input.size() > 0) {
  ------------------
  |  Branch (102:12): [True: 20.9M, False: 255k]
  ------------------
  103|  20.9M|        int carry = input[0];
  104|  20.9M|        int i = 0;
  105|       |        // Apply "b58 = b58 * 256 + ch".
  106|  1.19G|        for (std::vector<unsigned char>::reverse_iterator it = b58.rbegin(); (carry != 0 || i < length) && (it != b58.rend()); it++, i++) {
  ------------------
  |  Branch (106:78): [True: 1.17G, False: 20.9M]
  |  Branch (106:79): [True: 1.17G, False: 24.8M]
  |  Branch (106:93): [True: 3.90M, False: 20.9M]
  |  Branch (106:108): [True: 1.17G, False: 0]
  ------------------
  107|  1.17G|            carry += 256 * (*it);
  108|  1.17G|            *it = carry % 58;
  109|  1.17G|            carry /= 58;
  110|  1.17G|        }
  111|       |
  112|  20.9M|        assert(carry == 0);
  113|  20.9M|        length = i;
  114|  20.9M|        input = input.subspan(1);
  115|  20.9M|    }
  116|       |    // Skip leading zeroes in base58 result.
  117|   255k|    std::vector<unsigned char>::iterator it = b58.begin() + (size - length);
  118|   255k|    while (it != b58.end() && *it == 0)
  ------------------
  |  Branch (118:12): [True: 255k, False: 0]
  |  Branch (118:12): [True: 0, False: 255k]
  |  Branch (118:31): [True: 0, False: 255k]
  ------------------
  119|      0|        it++;
  120|       |    // Translate the result into a string.
  121|   255k|    std::string str;
  122|   255k|    str.reserve(zeroes + (b58.end() - it));
  123|   255k|    str.assign(zeroes, '1');
  124|  28.6M|    while (it != b58.end())
  ------------------
  |  Branch (124:12): [True: 28.3M, False: 255k]
  ------------------
  125|  28.3M|        str += pszBase58[*(it++)];
  126|   255k|    return str;
  127|   255k|}
_Z12DecodeBase58RKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS_6vectorIhNS3_IhEEEEi:
  130|     53|{
  131|     53|    if (!ContainsNoNUL(str)) {
  ------------------
  |  Branch (131:9): [True: 0, False: 53]
  ------------------
  132|      0|        return false;
  133|      0|    }
  134|     53|    return DecodeBase58(str.c_str(), vchRet, max_ret_len);
  135|     53|}
_Z17EncodeBase58Check4SpanIKhE:
  138|   255k|{
  139|       |    // add 4-byte hash check to the end
  140|   255k|    std::vector<unsigned char> vch(input.begin(), input.end());
  141|   255k|    uint256 hash = Hash(vch);
  142|   255k|    vch.insert(vch.end(), hash.data(), hash.data() + 4);
  143|   255k|    return EncodeBase58(vch);
  144|   255k|}
_Z17DecodeBase58CheckRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS_6vectorIhNS3_IhEEEEi:
  164|   265k|{
  165|   265k|    if (!ContainsNoNUL(str)) {
  ------------------
  |  Branch (165:9): [True: 0, False: 265k]
  ------------------
  166|      0|        return false;
  167|      0|    }
  168|   265k|    return DecodeBase58Check(str.c_str(), vchRet, max_ret);
  169|   265k|}
base58.cpp:_ZL12DecodeBase58PKcRNSt3__16vectorIhNS1_9allocatorIhEEEEi:
   41|   265k|{
   42|       |    // Skip leading spaces.
   43|   266k|    while (*psz && IsSpace(*psz))
  ------------------
  |  Branch (43:12): [True: 266k, False: 29]
  |  Branch (43:20): [True: 305, False: 265k]
  ------------------
   44|    305|        psz++;
   45|       |    // Skip and count leading '1's.
   46|   265k|    int zeroes = 0;
   47|   265k|    int length = 0;
   48|   268k|    while (*psz == '1') {
  ------------------
  |  Branch (48:12): [True: 2.34k, False: 265k]
  ------------------
   49|  2.34k|        zeroes++;
   50|  2.34k|        if (zeroes > max_ret_len) return false;
  ------------------
  |  Branch (50:13): [True: 16, False: 2.33k]
  ------------------
   51|  2.33k|        psz++;
   52|  2.33k|    }
   53|       |    // Allocate enough space in big-endian base256 representation.
   54|   265k|    int size = strlen(psz) * 733 /1000 + 1; // log(58) / log(256), rounded up.
   55|   265k|    std::vector<unsigned char> b256(size);
   56|       |    // Process the characters.
   57|   265k|    static_assert(std::size(mapBase58) == 256, "mapBase58.size() should be 256"); // guarantee not out of range
   58|  29.5M|    while (*psz && !IsSpace(*psz)) {
  ------------------
  |  Branch (58:12): [True: 29.2M, False: 263k]
  |  Branch (58:20): [True: 29.2M, False: 69]
  ------------------
   59|       |        // Decode base58 character
   60|  29.2M|        int carry = mapBase58[(uint8_t)*psz];
   61|  29.2M|        if (carry == -1)  // Invalid b58 character
  ------------------
  |  Branch (61:13): [True: 470, False: 29.2M]
  ------------------
   62|    470|            return false;
   63|  29.2M|        int i = 0;
   64|  1.24G|        for (std::vector<unsigned char>::reverse_iterator it = b256.rbegin(); (carry != 0 || i < length) && (it != b256.rend()); ++it, ++i) {
  ------------------
  |  Branch (64:79): [True: 1.21G, False: 29.2M]
  |  Branch (64:80): [True: 1.19G, False: 50.9M]
  |  Branch (64:94): [True: 21.6M, False: 29.2M]
  |  Branch (64:109): [True: 1.21G, False: 0]
  ------------------
   65|  1.21G|            carry += 58 * (*it);
   66|  1.21G|            *it = carry % 256;
   67|  1.21G|            carry /= 256;
   68|  1.21G|        }
   69|  29.2M|        assert(carry == 0);
   70|  29.2M|        length = i;
   71|  29.2M|        if (length + zeroes > max_ret_len) return false;
  ------------------
  |  Branch (71:13): [True: 1.76k, False: 29.2M]
  ------------------
   72|  29.2M|        psz++;
   73|  29.2M|    }
   74|       |    // Skip trailing spaces.
   75|   263k|    while (IsSpace(*psz))
  ------------------
  |  Branch (75:12): [True: 298, False: 263k]
  ------------------
   76|    298|        psz++;
   77|   263k|    if (*psz != 0)
  ------------------
  |  Branch (77:9): [True: 34, False: 263k]
  ------------------
   78|     34|        return false;
   79|       |    // Skip leading zeroes in b256.
   80|   263k|    std::vector<unsigned char>::iterator it = b256.begin() + (size - length);
   81|       |    // Copy result into output vector.
   82|   263k|    vch.reserve(zeroes + (b256.end() - it));
   83|   263k|    vch.assign(zeroes, 0x00);
   84|  21.8M|    while (it != b256.end())
  ------------------
  |  Branch (84:12): [True: 21.5M, False: 263k]
  ------------------
   85|  21.5M|        vch.push_back(*(it++));
   86|   263k|    return true;
   87|   263k|}
base58.cpp:_ZL17DecodeBase58CheckPKcRNSt3__16vectorIhNS1_9allocatorIhEEEEi:
  147|   265k|{
  148|   265k|    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: 2.26k, False: 263k]
  |  Branch (148:36): [True: 0, False: 265k]
  ------------------
  149|   265k|        (vchRet.size() < 4)) {
  ------------------
  |  Branch (149:9): [True: 227, False: 263k]
  ------------------
  150|  2.49k|        vchRet.clear();
  151|  2.49k|        return false;
  152|  2.49k|    }
  153|       |    // re-calculate the checksum, ensure it matches the included 4-byte checksum
  154|   263k|    uint256 hash = Hash(Span{vchRet}.first(vchRet.size() - 4));
  155|   263k|    if (memcmp(&hash, &vchRet[vchRet.size() - 4], 4) != 0) {
  ------------------
  |  Branch (155:9): [True: 235, False: 262k]
  ------------------
  156|    235|        vchRet.clear();
  157|    235|        return false;
  158|    235|    }
  159|   262k|    vchRet.resize(vchRet.size() - 4);
  160|   262k|    return true;
  161|   263k|}

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

_ZN6bech3212DecodeResultC2Ev:
   52|    394|    DecodeResult() : encoding(Encoding::INVALID) {}
_ZN6bech3212DecodeResultC2ENS_8EncodingEONSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEONS2_6vectorIhNS6_IhEEEE:
   53|      7|    DecodeResult(Encoding enc, std::string&& h, std::vector<uint8_t>&& d) : encoding(enc), hrp(std::move(h)), data(std::move(d)) {}

_Z6Paramsv:
  105|   519k|const CChainParams &Params() {
  106|   519k|    assert(globalChainParams);
  107|   519k|    return *globalChainParams;
  108|   519k|}

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

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

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

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

_ZN12CHMAC_SHA512C2EPKhm:
   10|   550k|{
   11|   550k|    unsigned char rkey[128];
   12|   550k|    if (keylen <= 128) {
  ------------------
  |  Branch (12:9): [True: 550k, False: 0]
  ------------------
   13|   550k|        memcpy(rkey, key, keylen);
   14|   550k|        memset(rkey + keylen, 0, 128 - keylen);
   15|   550k|    } else {
   16|      0|        CSHA512().Write(key, keylen).Finalize(rkey);
   17|      0|        memset(rkey + 64, 0, 64);
   18|      0|    }
   19|       |
   20|  70.9M|    for (int n = 0; n < 128; n++)
  ------------------
  |  Branch (20:21): [True: 70.4M, False: 550k]
  ------------------
   21|  70.4M|        rkey[n] ^= 0x5c;
   22|   550k|    outer.Write(rkey, 128);
   23|       |
   24|  70.9M|    for (int n = 0; n < 128; n++)
  ------------------
  |  Branch (24:21): [True: 70.4M, False: 550k]
  ------------------
   25|  70.4M|        rkey[n] ^= 0x5c ^ 0x36;
   26|   550k|    inner.Write(rkey, 128);
   27|   550k|}
_ZN12CHMAC_SHA5128FinalizeEPh:
   30|   550k|{
   31|   550k|    unsigned char temp[64];
   32|   550k|    inner.Finalize(temp);
   33|   550k|    outer.Write(temp, 64).Finalize(hash);
   34|   550k|}

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

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

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

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

_ZN8CHash2568FinalizeE4SpanIhE:
   30|   519k|    void Finalize(Span<unsigned char> output) {
   31|   519k|        assert(output.size() == OUTPUT_SIZE);
   32|   519k|        unsigned char buf[CSHA256::OUTPUT_SIZE];
   33|   519k|        sha.Finalize(buf);
   34|   519k|        sha.Reset().Write(buf, CSHA256::OUTPUT_SIZE).Finalize(output.data());
   35|   519k|    }
_ZN8CHash2565WriteE4SpanIKhE:
   37|   519k|    CHash256& Write(Span<const unsigned char> input) {
   38|   519k|        sha.Write(input.data(), input.size());
   39|   519k|        return *this;
   40|   519k|    }
_ZN8CHash1608FinalizeE4SpanIhE:
   55|  2.07M|    void Finalize(Span<unsigned char> output) {
   56|  2.07M|        assert(output.size() == OUTPUT_SIZE);
   57|  2.07M|        unsigned char buf[CSHA256::OUTPUT_SIZE];
   58|  2.07M|        sha.Finalize(buf);
   59|  2.07M|        CRIPEMD160().Write(buf, CSHA256::OUTPUT_SIZE).Finalize(output.data());
   60|  2.07M|    }
_ZN8CHash1605WriteE4SpanIKhE:
   62|  2.07M|    CHash160& Write(Span<const unsigned char> input) {
   63|  2.07M|        sha.Write(input.data(), input.size());
   64|  2.07M|        return *this;
   65|  2.07M|    }
_ZN10HashWriter5writeE4SpanIKSt4byteE:
  107|   106k|    {
  108|   106k|        ctx.Write(UCharCast(src.data()), src.size());
  109|   106k|    }
_ZN10HashWriter9GetSHA256Ev:
  126|  47.0k|    uint256 GetSHA256() {
  127|  47.0k|        uint256 result;
  128|  47.0k|        ctx.Finalize(result.begin());
  129|  47.0k|        return result;
  130|  47.0k|    }
_Z9RIPEMD1604SpanIKhE:
  223|    770|{
  224|    770|    uint160 result;
  225|    770|    CRIPEMD160().Write(data.data(), data.size()).Finalize(result.begin());
  226|    770|    return result;
  227|    770|}
_Z7Hash160I4SpanIKhEE7uint160RKT_:
   93|  2.06M|{
   94|  2.06M|    uint160 result;
   95|  2.06M|    CHash160().Write(MakeUCharSpan(in1)).Finalize(result);
   96|  2.06M|    return result;
   97|  2.06M|}
_Z4HashINSt3__16vectorIhNS0_9allocatorIhEEEEE7uint256RKT_:
   76|   255k|{
   77|   255k|    uint256 result;
   78|   255k|    CHash256().Write(MakeUCharSpan(in1)).Finalize(result);
   79|   255k|    return result;
   80|   255k|}
_Z7Hash160I11XOnlyPubKeyE7uint160RKT_:
   93|  3.30k|{
   94|  3.30k|    uint160 result;
   95|  3.30k|    CHash160().Write(MakeUCharSpan(in1)).Finalize(result);
   96|  3.30k|    return result;
   97|  3.30k|}
_Z7Hash160I7CScriptE7uint160RKT_:
   93|  3.99k|{
   94|  3.99k|    uint160 result;
   95|  3.99k|    CHash160().Write(MakeUCharSpan(in1)).Finalize(result);
   96|  3.99k|    return result;
   97|  3.99k|}
_Z4HashI4SpanIhEE7uint256RKT_:
   76|   263k|{
   77|   263k|    uint256 result;
   78|   263k|    CHash256().Write(MakeUCharSpan(in1)).Finalize(result);
   79|   263k|    return result;
   80|   263k|}
_ZN10HashWriterlsI7uint256EERS_RKT_:
  142|  7.27k|    {
  143|  7.27k|        ::Serialize(*this, obj);
  144|  7.27k|        return *this;
  145|  7.27k|    }
_ZN10HashWriterlsI4SpanIKhEEERS_RKT_:
  142|  82.3k|    {
  143|  82.3k|        ::Serialize(*this, obj);
  144|  82.3k|        return *this;
  145|  82.3k|    }
_ZN10HashWriterlsIhEERS_RKT_:
  142|  10.5k|    {
  143|  10.5k|        ::Serialize(*this, obj);
  144|  10.5k|        return *this;
  145|  10.5k|    }
_ZN10HashWriterlsI17CompactSizeWriterEERS_RKT_:
  142|  10.5k|    {
  143|  10.5k|        ::Serialize(*this, obj);
  144|  10.5k|        return *this;
  145|  10.5k|    }

_ZNK12CChainParams12Base58PrefixENS_10Base58TypeE:
  118|   518k|    const std::vector<unsigned char>& Base58Prefix(Base58Type type) const { return base58Prefixes[type]; }
_ZNK12CChainParams9Bech32HRPEv:
  119|    916|    const std::string& Bech32HRP() const { return bech32_hrp; }

_ZN4CKey5CheckEPKh:
  157|   527k|bool CKey::Check(const unsigned char *vch) {
  158|   527k|    return secp256k1_ec_seckey_verify(secp256k1_context_sign, vch);
  159|   527k|}
_ZNK4CKey9GetPubKeyEv:
  182|  1.09M|CPubKey CKey::GetPubKey() const {
  183|  1.09M|    assert(keydata);
  184|  1.09M|    secp256k1_pubkey pubkey;
  185|  1.09M|    size_t clen = CPubKey::SIZE;
  186|  1.09M|    CPubKey result;
  187|  1.09M|    int ret = secp256k1_ec_pubkey_create(secp256k1_context_sign, &pubkey, UCharCast(begin()));
  188|  1.09M|    assert(ret);
  189|  1.09M|    secp256k1_ec_pubkey_serialize(secp256k1_context_sign, (unsigned char*)result.begin(), &clen, &pubkey, fCompressed ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED);
  ------------------
  |  |  212|  1.09M|#define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  193|  1.09M|#define SECP256K1_FLAGS_TYPE_COMPRESSION (1 << 1)
  |  |  ------------------
  |  |               #define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  198|  1.09M|#define SECP256K1_FLAGS_BIT_COMPRESSION (1 << 8)
  |  |  ------------------
  ------------------
                  secp256k1_ec_pubkey_serialize(secp256k1_context_sign, (unsigned char*)result.begin(), &clen, &pubkey, fCompressed ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED);
  ------------------
  |  |  213|  1.09M|#define SECP256K1_EC_UNCOMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION)
  |  |  ------------------
  |  |  |  |  193|      0|#define SECP256K1_FLAGS_TYPE_COMPRESSION (1 << 1)
  |  |  ------------------
  ------------------
  |  Branch (189:107): [True: 1.09M, False: 0]
  ------------------
  190|  1.09M|    assert(result.size() == clen);
  191|  1.09M|    assert(result.IsValid());
  192|  1.09M|    return result;
  193|  1.09M|}
_ZNK4CKey6DeriveERS_R7uint256jRKS1_:
  292|   396k|bool CKey::Derive(CKey& keyChild, ChainCode &ccChild, unsigned int nChild, const ChainCode& cc) const {
  293|   396k|    assert(IsValid());
  294|   396k|    assert(IsCompressed());
  295|   396k|    std::vector<unsigned char, secure_allocator<unsigned char>> vout(64);
  296|   396k|    if ((nChild >> 31) == 0) {
  ------------------
  |  Branch (296:9): [True: 257k, False: 138k]
  ------------------
  297|   257k|        CPubKey pubkey = GetPubKey();
  298|   257k|        assert(pubkey.size() == CPubKey::COMPRESSED_SIZE);
  299|   257k|        BIP32Hash(cc, nChild, *pubkey.begin(), pubkey.begin()+1, vout.data());
  300|   257k|    } else {
  301|   138k|        assert(size() == 32);
  302|   138k|        BIP32Hash(cc, nChild, 0, UCharCast(begin()), vout.data());
  303|   138k|    }
  304|   396k|    memcpy(ccChild.begin(), vout.data()+32, 32);
  305|   396k|    keyChild.Set(begin(), begin() + 32, true);
  306|   396k|    bool ret = secp256k1_ec_seckey_tweak_add(secp256k1_context_sign, (unsigned char*)keyChild.begin(), vout.data());
  307|   396k|    if (!ret) keyChild.ClearKeyData();
  ------------------
  |  Branch (307:9): [True: 0, False: 396k]
  ------------------
  308|   396k|    return ret;
  309|   396k|}
_ZNK7CExtKey6DeriveERS_j:
  359|   396k|bool CExtKey::Derive(CExtKey &out, unsigned int _nChild) const {
  360|   396k|    if (nDepth == std::numeric_limits<unsigned char>::max()) return false;
  ------------------
  |  Branch (360:9): [True: 0, False: 396k]
  ------------------
  361|   396k|    out.nDepth = nDepth + 1;
  362|   396k|    CKeyID id = key.GetPubKey().GetID();
  363|   396k|    memcpy(out.vchFingerprint, &id, 4);
  364|   396k|    out.nChild = _nChild;
  365|   396k|    return key.Derive(out.key, out.chaincode, _nChild, chaincode);
  366|   396k|}
_ZNK7CExtKey6NeuterEv:
  380|   315k|CExtPubKey CExtKey::Neuter() const {
  381|   315k|    CExtPubKey ret;
  382|   315k|    ret.nDepth = nDepth;
  383|   315k|    memcpy(ret.vchFingerprint, vchFingerprint, 4);
  384|   315k|    ret.nChild = nChild;
  385|   315k|    ret.pubkey = key.GetPubKey();
  386|   315k|    ret.chaincode = chaincode;
  387|   315k|    return ret;
  388|   315k|}
_ZNK7CExtKey6EncodeEPh:
  390|  3.97k|void CExtKey::Encode(unsigned char code[BIP32_EXTKEY_SIZE]) const {
  391|  3.97k|    code[0] = nDepth;
  392|  3.97k|    memcpy(code+1, vchFingerprint, 4);
  393|  3.97k|    WriteBE32(code+5, nChild);
  394|  3.97k|    memcpy(code+9, chaincode.begin(), 32);
  395|  3.97k|    code[41] = 0;
  396|  3.97k|    assert(key.size() == 32);
  397|  3.97k|    memcpy(code+42, key.begin(), 32);
  398|  3.97k|}
_ZN7CExtKey6DecodeEPKh:
  400|   131k|void CExtKey::Decode(const unsigned char code[BIP32_EXTKEY_SIZE]) {
  401|   131k|    nDepth = code[0];
  402|   131k|    memcpy(vchFingerprint, code+1, 4);
  403|   131k|    nChild = ReadBE32(code+5);
  404|   131k|    memcpy(chaincode.begin(), code+9, 32);
  405|   131k|    key.Set(code+42, code+BIP32_EXTKEY_SIZE, true);
  406|   131k|    if ((nDepth == 0 && (nChild != 0 || ReadLE32(vchFingerprint) != 0)) || code[41] != 0) key = CKey();
  ------------------
  |  Branch (406:10): [True: 794, False: 130k]
  |  Branch (406:26): [True: 0, False: 794]
  |  Branch (406:41): [True: 0, False: 794]
  |  Branch (406:76): [True: 0, False: 131k]
  ------------------
  407|   131k|}
_ZN11ECC_ContextD2Ev:
  482|      2|{
  483|      2|    ECC_Stop();
  484|      2|}
key.cpp:_ZL8ECC_Stopv:
  467|      2|static void ECC_Stop() {
  468|      2|    secp256k1_context *ctx = secp256k1_context_sign;
  469|      2|    secp256k1_context_sign = nullptr;
  470|       |
  471|      2|    if (ctx) {
  ------------------
  |  Branch (471:9): [True: 2, False: 0]
  ------------------
  472|      2|        secp256k1_context_destroy(ctx);
  473|      2|    }
  474|      2|}

_ZN4CKey11MakeKeyDataEv:
   64|  1.25M|    {
   65|  1.25M|        if (!keydata) keydata = make_secure_unique<KeyType>();
  ------------------
  |  Branch (65:13): [True: 855k, False: 396k]
  ------------------
   66|  1.25M|    }
_ZN4CKeyaSERKS_:
   79|   723k|    {
   80|   723k|        if (this != &other) {
  ------------------
  |  Branch (80:13): [True: 723k, False: 0]
  ------------------
   81|   723k|            if (other.keydata) {
  ------------------
  |  Branch (81:17): [True: 723k, False: 0]
  ------------------
   82|   723k|                MakeKeyData();
   83|   723k|                *keydata = *other.keydata;
   84|   723k|            } else {
   85|      0|                ClearKeyData();
   86|      0|            }
   87|   723k|            fCompressed = other.fCompressed;
   88|   723k|        }
   89|   723k|        return *this;
   90|   723k|    }
_ZN4CKeyC2ERKS_:
   92|  17.6k|    CKey(const CKey& other) { *this = other; }
_ZNK4CKey4sizeEv:
  117|   142k|    unsigned int size() const { return keydata ? keydata->size() : 0; }
  ------------------
  |  Branch (117:40): [True: 142k, False: 0]
  ------------------
_ZNK4CKey4dataEv:
  118|  2.42M|    const std::byte* data() const { return keydata ? reinterpret_cast<const std::byte*>(keydata->data()) : nullptr; }
  ------------------
  |  Branch (118:44): [True: 2.42M, False: 0]
  ------------------
_ZNK4CKey5beginEv:
  119|  2.42M|    const std::byte* begin() const { return data(); }
_ZNK4CKey3endEv:
  120|      5|    const std::byte* end() const { return data() + size(); }
_ZNK4CKey7IsValidEv:
  123|   707k|    bool IsValid() const { return !!keydata; }
_ZNK4CKey12IsCompressedEv:
  126|   396k|    bool IsCompressed() const { return fCompressed; }
_ZN4CKeyC2Ev:
   74|   951k|    CKey() noexcept = default;
_ZN4CKey3SetIPKSt4byteEEvT_S4_b:
  104|   396k|    {
  105|   396k|        if (size_t(pend - pbegin) != std::tuple_size_v<KeyType>) {
  ------------------
  |  Branch (105:13): [True: 0, False: 396k]
  ------------------
  106|      0|            ClearKeyData();
  107|   396k|        } else if (Check(UCharCast(&pbegin[0]))) {
  ------------------
  |  Branch (107:20): [True: 396k, False: 0]
  ------------------
  108|   396k|            MakeKeyData();
  109|   396k|            memcpy(keydata->data(), (unsigned char*)&pbegin[0], keydata->size());
  110|   396k|            fCompressed = fCompressedIn;
  111|   396k|        } else {
  112|      0|            ClearKeyData();
  113|      0|        }
  114|   396k|    }
_ZN7CExtKeyC2Ev:
  243|   576k|    CExtKey() = default;
_ZN4CKey3SetINSt3__111__wrap_iterIPhEEEEvT_S5_b:
  104|    112|    {
  105|    112|        if (size_t(pend - pbegin) != std::tuple_size_v<KeyType>) {
  ------------------
  |  Branch (105:13): [True: 0, False: 112]
  ------------------
  106|      0|            ClearKeyData();
  107|    112|        } else if (Check(UCharCast(&pbegin[0]))) {
  ------------------
  |  Branch (107:20): [True: 112, False: 0]
  ------------------
  108|    112|            MakeKeyData();
  109|    112|            memcpy(keydata->data(), (unsigned char*)&pbegin[0], keydata->size());
  110|    112|            fCompressed = fCompressedIn;
  111|    112|        } else {
  112|      0|            ClearKeyData();
  113|      0|        }
  114|    112|    }
_ZN4CKey3SetIPKhEEvT_S3_b:
  104|   131k|    {
  105|   131k|        if (size_t(pend - pbegin) != std::tuple_size_v<KeyType>) {
  ------------------
  |  Branch (105:13): [True: 0, False: 131k]
  ------------------
  106|      0|            ClearKeyData();
  107|   131k|        } else if (Check(UCharCast(&pbegin[0]))) {
  ------------------
  |  Branch (107:20): [True: 131k, False: 0]
  ------------------
  108|   131k|            MakeKeyData();
  109|   131k|            memcpy(keydata->data(), (unsigned char*)&pbegin[0], keydata->size());
  110|   131k|            fCompressed = fCompressedIn;
  111|   131k|        } else {
  112|      0|            ClearKeyData();
  113|      0|        }
  114|   131k|    }

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

_Z25OutputTypeFromDestinationRKNSt3__17variantIJ14CNoDestination17PubKeyDestination6PKHash10ScriptHash19WitnessV0ScriptHash16WitnessV0KeyHash16WitnessV1Taproot11PayToAnchor14WitnessUnknownEEE:
  110|    511|std::optional<OutputType> OutputTypeFromDestination(const CTxDestination& dest) {
  111|    511|    if (std::holds_alternative<PKHash>(dest) ||
  ------------------
  |  Branch (111:9): [True: 0, False: 511]
  ------------------
  112|    511|        std::holds_alternative<ScriptHash>(dest)) {
  ------------------
  |  Branch (112:9): [True: 1, False: 510]
  ------------------
  113|      1|        return OutputType::LEGACY;
  114|      1|    }
  115|    510|    if (std::holds_alternative<WitnessV0KeyHash>(dest) ||
  ------------------
  |  Branch (115:9): [True: 1, False: 509]
  ------------------
  116|    510|        std::holds_alternative<WitnessV0ScriptHash>(dest)) {
  ------------------
  |  Branch (116:9): [True: 1, False: 508]
  ------------------
  117|      2|        return OutputType::BECH32;
  118|      2|    }
  119|    508|    if (std::holds_alternative<WitnessV1Taproot>(dest) ||
  ------------------
  |  Branch (119:9): [True: 3, False: 505]
  ------------------
  120|    508|        std::holds_alternative<WitnessUnknown>(dest)) {
  ------------------
  |  Branch (120:9): [True: 30, False: 475]
  ------------------
  121|     33|        return OutputType::BECH32M;
  122|     33|    }
  123|    475|    return std::nullopt;
  124|    508|}

_ZN9prevectorILj28EhjiE3endEv:
  304|  1.06M|    iterator end() { return iterator(item_ptr(size())); }
_ZN9prevectorILj28EhjiE8item_ptrEi:
  206|  3.19M|    T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  ------------------
  |  Branch (206:47): [True: 465k, False: 2.72M]
  ------------------
_ZNK9prevectorILj28EhjiE9is_directEv:
  173|  17.0M|    bool is_direct() const { return _size <= N; }
_ZN9prevectorILj28EhjiE10direct_ptrEi:
  169|   512k|    T* direct_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.direct) + pos; }
_ZN9prevectorILj28EhjiE12indirect_ptrEi:
  171|  2.72M|    T* indirect_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.indirect_contents.indirect) + pos; }
_ZN9prevectorILj28EhjiE6insertENS0_8iteratorERKh:
  359|   680k|    iterator insert(iterator pos, const T& value) {
  360|   680k|        size_type p = pos - begin();
  361|   680k|        size_type new_size = size() + 1;
  362|   680k|        if (capacity() < new_size) {
  ------------------
  |  Branch (362:13): [True: 1.65k, False: 678k]
  ------------------
  363|  1.65k|            change_capacity(new_size + (new_size >> 1));
  364|  1.65k|        }
  365|   680k|        T* ptr = item_ptr(p);
  366|   680k|        T* dst = ptr + 1;
  367|   680k|        memmove(dst, ptr, (size() - p) * sizeof(T));
  368|   680k|        _size++;
  369|   680k|        new(static_cast<void*>(ptr)) T(value);
  370|   680k|        return iterator(ptr);
  371|   680k|    }
_ZN9prevectorILj28EhjiE5beginEv:
  302|  1.06M|    iterator begin() { return iterator(item_ptr(0)); }
_ZmiN9prevectorILj28EhjiE8iteratorES1_:
   66|  1.06M|        difference_type friend operator-(iterator a, iterator b) { return (&(*a) - &(*b)); }
_ZNK9prevectorILj28EhjiE8iteratordeEv:
   59|  4.45M|        T& operator*() const { return *ptr; }
_ZNK9prevectorILj28EhjiE8capacityEv:
  312|  1.05M|    size_t capacity() const {
  313|  1.05M|        if (is_direct()) {
  ------------------
  |  Branch (313:13): [True: 167k, False: 884k]
  ------------------
  314|   167k|            return N;
  315|   884k|        } else {
  316|   884k|            return _union.indirect_contents.capacity;
  317|   884k|        }
  318|  1.05M|    }
_ZN9prevectorILj28EhjiE15change_capacityEj:
  175|  72.0k|    void change_capacity(size_type new_capacity) {
  176|  72.0k|        if (new_capacity <= N) {
  ------------------
  |  Branch (176:13): [True: 3.70k, False: 68.3k]
  ------------------
  177|  3.70k|            if (!is_direct()) {
  ------------------
  |  Branch (177:17): [True: 0, False: 3.70k]
  ------------------
  178|      0|                T* indirect = indirect_ptr(0);
  179|      0|                T* src = indirect;
  180|      0|                T* dst = direct_ptr(0);
  181|      0|                memcpy(dst, src, size() * sizeof(T));
  182|      0|                free(indirect);
  183|      0|                _size -= N + 1;
  184|      0|            }
  185|  68.3k|        } else {
  186|  68.3k|            if (!is_direct()) {
  ------------------
  |  Branch (186:17): [True: 21.4k, False: 46.9k]
  ------------------
  187|       |                /* FIXME: Because malloc/realloc here won't call new_handler if allocation fails, assert
  188|       |                    success. These should instead use an allocator or new/delete so that handlers
  189|       |                    are called as necessary, but performance would be slightly degraded by doing so. */
  190|  21.4k|                _union.indirect_contents.indirect = static_cast<char*>(realloc(_union.indirect_contents.indirect, ((size_t)sizeof(T)) * new_capacity));
  191|  21.4k|                assert(_union.indirect_contents.indirect);
  192|  21.4k|                _union.indirect_contents.capacity = new_capacity;
  193|  46.9k|            } else {
  194|  46.9k|                char* new_indirect = static_cast<char*>(malloc(((size_t)sizeof(T)) * new_capacity));
  195|  46.9k|                assert(new_indirect);
  196|  46.9k|                T* src = direct_ptr(0);
  197|  46.9k|                T* dst = reinterpret_cast<T*>(new_indirect);
  198|  46.9k|                memcpy(dst, src, size() * sizeof(T));
  199|  46.9k|                _union.indirect_contents.indirect = new_indirect;
  200|  46.9k|                _union.indirect_contents.capacity = new_capacity;
  201|  46.9k|                _size += N + 1;
  202|  46.9k|            }
  203|  68.3k|        }
  204|  72.0k|    }
_ZN9prevectorILj28EhjiE6insertITkNSt3__114input_iteratorENS2_11__wrap_iterIPKhEEEEvNS0_8iteratorET_S8_:
  387|   302k|    void insert(iterator pos, InputIterator first, InputIterator last) {
  388|   302k|        size_type p = pos - begin();
  389|   302k|        difference_type count = last - first;
  390|   302k|        size_type new_size = size() + count;
  391|   302k|        if (capacity() < new_size) {
  ------------------
  |  Branch (391:13): [True: 33.2k, False: 269k]
  ------------------
  392|  33.2k|            change_capacity(new_size + (new_size >> 1));
  393|  33.2k|        }
  394|   302k|        T* ptr = item_ptr(p);
  395|   302k|        T* dst = ptr + count;
  396|   302k|        memmove(dst, ptr, (size() - p) * sizeof(T));
  397|   302k|        _size += count;
  398|   302k|        fill(ptr, first, last);
  399|   302k|    }
_ZN9prevectorILj28EhjiE4fillITkNSt3__114input_iteratorENS2_11__wrap_iterIPKhEEEEvPhT_S8_:
  214|   306k|    void fill(T* dst, InputIterator first, InputIterator last) {
  215|  14.4M|        while (first != last) {
  ------------------
  |  Branch (215:16): [True: 14.0M, False: 306k]
  ------------------
  216|  14.0M|            new(static_cast<void*>(dst)) T(*first);
  217|  14.0M|            ++dst;
  218|  14.0M|            ++first;
  219|  14.0M|        }
  220|   306k|    }
_ZN9prevectorILj28EhjiE9push_backERKh:
  444|  27.8k|    void push_back(const T& value) {
  445|  27.8k|        emplace_back(value);
  446|  27.8k|    }
_ZN9prevectorILj28EhjiE12emplace_backIJRKhEEEvDpOT_:
  435|  27.8k|    void emplace_back(Args&&... args) {
  436|  27.8k|        size_type new_size = size() + 1;
  437|  27.8k|        if (capacity() < new_size) {
  ------------------
  |  Branch (437:13): [True: 312, False: 27.5k]
  ------------------
  438|    312|            change_capacity(new_size + (new_size >> 1));
  439|    312|        }
  440|  27.8k|        new(item_ptr(size())) T(std::forward<Args>(args)...);
  441|  27.8k|        _size++;
  442|  27.8k|    }
_ZNK9prevectorILj28EhjiE3endEv:
  305|  4.50M|    const_iterator end() const { return const_iterator(item_ptr(size())); }
_ZNK9prevectorILj28EhjiE8item_ptrEi:
  207|  4.57M|    const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  ------------------
  |  Branch (207:59): [True: 26.5k, False: 4.55M]
  ------------------
_ZNK9prevectorILj28EhjiE10direct_ptrEi:
  170|  26.5k|    const T* direct_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.direct) + pos; }
_ZNK9prevectorILj28EhjiE12indirect_ptrEi:
  172|  4.55M|    const T* indirect_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.indirect_contents.indirect) + pos; }
_ZNK9prevectorILj28EhjiE4sizeEv:
  294|  7.82M|    size_type size() const {
  295|  7.82M|        return is_direct() ? _size : _size - N - 1;
  ------------------
  |  Branch (295:16): [True: 566k, False: 7.26M]
  ------------------
  296|  7.82M|    }
_ZNK9prevectorILj28EhjiE5beginEv:
  303|  25.1k|    const_iterator begin() const { return const_iterator(item_ptr(0)); }
_ZNK9prevectorILj28EhjiE14const_iteratordeEv:
  111|  60.7M|        const T& operator*() const { return *ptr; }
_ZN9prevectorILj28EhjiE5clearEv:
  355|  1.38k|    void clear() {
  356|  1.38k|        resize(0);
  357|  1.38k|    }
_ZN9prevectorILj28EhjiE6resizeEj:
  328|  1.38k|    void resize(size_type new_size) {
  329|  1.38k|        size_type cur_size = size();
  330|  1.38k|        if (cur_size == new_size) {
  ------------------
  |  Branch (330:13): [True: 1.38k, False: 0]
  ------------------
  331|  1.38k|            return;
  332|  1.38k|        }
  333|      0|        if (cur_size > new_size) {
  ------------------
  |  Branch (333:13): [True: 0, False: 0]
  ------------------
  334|      0|            erase(item_ptr(new_size), end());
  335|      0|            return;
  336|      0|        }
  337|      0|        if (new_size > capacity()) {
  ------------------
  |  Branch (337:13): [True: 0, False: 0]
  ------------------
  338|      0|            change_capacity(new_size);
  339|      0|        }
  340|      0|        ptrdiff_t increase = new_size - cur_size;
  341|      0|        fill(item_ptr(cur_size), increase);
  342|      0|        _size += increase;
  343|      0|    }
_ZN9prevectorILj28EhjiE4fillITkNSt3__114input_iteratorENS0_14const_iteratorEEEvPhT_S5_:
  214|  13.8k|    void fill(T* dst, InputIterator first, InputIterator last) {
  215|  44.7M|        while (first != last) {
  ------------------
  |  Branch (215:16): [True: 44.7M, False: 13.8k]
  ------------------
  216|  44.7M|            new(static_cast<void*>(dst)) T(*first);
  217|  44.7M|            ++dst;
  218|  44.7M|            ++first;
  219|  44.7M|        }
  220|  13.8k|    }
_ZNK9prevectorILj28EhjiE14const_iteratorneES1_:
  125|  44.8M|        bool operator!=(const_iterator x) const { return ptr != x.ptr; }
_ZN9prevectorILj28EhjiE14const_iteratorppEv:
  114|  47.2M|        const_iterator& operator++() { ptr++; return *this; }
_ZNK9prevectorILj28EhjiEeqERKS0_:
  481|     35|    bool operator==(const prevector<N, T, Size, Diff>& other) const {
  482|     35|        if (other.size() != size()) {
  ------------------
  |  Branch (482:13): [True: 0, False: 35]
  ------------------
  483|      0|            return false;
  484|      0|        }
  485|     35|        const_iterator b1 = begin();
  486|     35|        const_iterator b2 = other.begin();
  487|     35|        const_iterator e1 = end();
  488|    523|        while (b1 != e1) {
  ------------------
  |  Branch (488:16): [True: 488, False: 35]
  ------------------
  489|    488|            if ((*b1) != (*b2)) {
  ------------------
  |  Branch (489:17): [True: 0, False: 488]
  ------------------
  490|      0|                return false;
  491|      0|            }
  492|    488|            ++b1;
  493|    488|            ++b2;
  494|    488|        }
  495|     35|        return true;
  496|     35|    }
_ZNK9prevectorILj28EhjiE4dataEv:
  537|  14.9k|    const value_type* data() const {
  538|  14.9k|        return item_ptr(0);
  539|  14.9k|    }
_ZNK9prevectorILj28EhjiEixEj:
  324|  27.9k|    const T& operator[](size_type pos) const {
  325|  27.9k|        return *item_ptr(pos);
  326|  27.9k|    }
_ZN9prevectorILj28EhjiED2Ev:
  474|   282k|    ~prevector() {
  475|   282k|        if (!is_direct()) {
  ------------------
  |  Branch (475:13): [True: 46.9k, False: 235k]
  ------------------
  476|  46.9k|            free(_union.indirect_contents.indirect);
  477|  46.9k|            _union.indirect_contents.indirect = nullptr;
  478|  46.9k|        }
  479|   282k|    }
_ZN9prevectorILj28EhjiEC2EOS0_:
  271|   163k|        : _union(std::move(other._union)), _size(other._size)
  272|   163k|    {
  273|   163k|        other._size = 0;
  274|   163k|    }
_ZN9prevectorILj28EhjiEC2Ev:
  243|   102k|    prevector() = default;
_ZN9prevectorILj28EhjiE8iteratorC2EPh:
   58|  2.80M|        iterator(T* ptr_) : ptr(ptr_) {}
_ZN9prevectorILj28EhjiE14const_iteratorC2EPKh:
  109|  4.56M|        const_iterator(const T* ptr_) : ptr(ptr_) {}
_ZN9prevectorILj28EhjiEC2ERKS0_:
  263|  12.4k|    prevector(const prevector<N, T, Size, Diff>& other) {
  264|  12.4k|        size_type n = other.size();
  265|  12.4k|        change_capacity(n);
  266|  12.4k|        _size += n;
  267|  12.4k|        fill(item_ptr(0), other.begin(),  other.end());
  268|  12.4k|    }
_ZN9prevectorILj28EhjiEaSERKS0_:
  276|  1.38k|    prevector& operator=(const prevector<N, T, Size, Diff>& other) {
  277|  1.38k|        if (&other == this) {
  ------------------
  |  Branch (277:13): [True: 0, False: 1.38k]
  ------------------
  278|      0|            return *this;
  279|      0|        }
  280|  1.38k|        assign(other.begin(), other.end());
  281|  1.38k|        return *this;
  282|  1.38k|    }
_ZN9prevectorILj28EhjiE6assignITkNSt3__114input_iteratorENS0_14const_iteratorEEEvT_S4_:
  233|  1.38k|    void assign(InputIterator first, InputIterator last) {
  234|  1.38k|        size_type n = last - first;
  235|  1.38k|        clear();
  236|  1.38k|        if (capacity() < n) {
  ------------------
  |  Branch (236:13): [True: 1.36k, False: 14]
  ------------------
  237|  1.36k|            change_capacity(n);
  238|  1.36k|        }
  239|  1.38k|        _size += n;
  240|  1.38k|        fill(item_ptr(0), first, last);
  241|  1.38k|    }
_ZmiN9prevectorILj28EhjiE14const_iteratorES1_:
  118|  6.68M|        difference_type friend operator-(const_iterator a, const_iterator b) { return (&(*a) - &(*b)); }
_ZN9prevectorILj28EhjiEaSEOS0_:
  284|  20.9k|    prevector& operator=(prevector<N, T, Size, Diff>&& other) noexcept {
  285|  20.9k|        if (!is_direct()) {
  ------------------
  |  Branch (285:13): [True: 0, False: 20.9k]
  ------------------
  286|      0|            free(_union.indirect_contents.indirect);
  287|      0|        }
  288|  20.9k|        _union = std::move(other._union);
  289|  20.9k|        _size = other._size;
  290|  20.9k|        other._size = 0;
  291|  20.9k|        return *this;
  292|  20.9k|    }
_ZN9prevectorILj28EhjiEC2ITkNSt3__114input_iteratorENS2_11__wrap_iterIPKhEEEET_S7_:
  256|  3.52k|    prevector(InputIterator first, InputIterator last) {
  257|  3.52k|        size_type n = last - first;
  258|  3.52k|        change_capacity(n);
  259|  3.52k|        _size += n;
  260|  3.52k|        fill(item_ptr(0), first, last);
  261|  3.52k|    }
_ZN9prevectorILj28EhjiE6insertITkNSt3__114input_iteratorENS0_8iteratorEEEvS3_T_S4_:
  387|  39.2k|    void insert(iterator pos, InputIterator first, InputIterator last) {
  388|  39.2k|        size_type p = pos - begin();
  389|  39.2k|        difference_type count = last - first;
  390|  39.2k|        size_type new_size = size() + count;
  391|  39.2k|        if (capacity() < new_size) {
  ------------------
  |  Branch (391:13): [True: 18.9k, False: 20.3k]
  ------------------
  392|  18.9k|            change_capacity(new_size + (new_size >> 1));
  393|  18.9k|        }
  394|  39.2k|        T* ptr = item_ptr(p);
  395|  39.2k|        T* dst = ptr + count;
  396|  39.2k|        memmove(dst, ptr, (size() - p) * sizeof(T));
  397|  39.2k|        _size += count;
  398|  39.2k|        fill(ptr, first, last);
  399|  39.2k|    }
_ZN9prevectorILj28EhjiE4fillITkNSt3__114input_iteratorENS0_8iteratorEEEvPhT_S5_:
  214|  39.2k|    void fill(T* dst, InputIterator first, InputIterator last) {
  215|  2.36M|        while (first != last) {
  ------------------
  |  Branch (215:16): [True: 2.32M, False: 39.2k]
  ------------------
  216|  2.32M|            new(static_cast<void*>(dst)) T(*first);
  217|  2.32M|            ++dst;
  218|  2.32M|            ++first;
  219|  2.32M|        }
  220|  39.2k|    }
_ZNK9prevectorILj28EhjiE8iteratorneES1_:
   73|  2.36M|        bool operator!=(iterator x) const { return ptr != x.ptr; }
_ZN9prevectorILj28EhjiE8iteratorppEv:
   62|  2.32M|        iterator& operator++() { ptr++; return *this; }
_ZNK9prevectorILj28EhjiE14const_iteratorptEv:
  112|  51.4k|        const T* operator->() const { return ptr; }
_ZN9prevectorILj28EhjiEC2ITkNSt3__114input_iteratorENS2_11__wrap_iterIPhEEEET_S6_:
  256|    513|    prevector(InputIterator first, InputIterator last) {
  257|    513|        size_type n = last - first;
  258|    513|        change_capacity(n);
  259|    513|        _size += n;
  260|    513|        fill(item_ptr(0), first, last);
  261|    513|    }
_ZN9prevectorILj28EhjiE4fillITkNSt3__114input_iteratorENS2_11__wrap_iterIPhEEEEvS4_T_S6_:
  214|    513|    void fill(T* dst, InputIterator first, InputIterator last) {
  215|  8.80M|        while (first != last) {
  ------------------
  |  Branch (215:16): [True: 8.79M, False: 513]
  ------------------
  216|  8.79M|            new(static_cast<void*>(dst)) T(*first);
  217|  8.79M|            ++dst;
  218|  8.79M|            ++first;
  219|  8.79M|        }
  220|    513|    }
_ZNK9prevectorILj28EhjiE14const_iteratorltES1_:
  129|  2.14M|        bool operator<(const_iterator x) const { return ptr < x.ptr; }
_ZNK9prevectorILj28EhjiE4backEv:
  464|  4.92k|    const T& back() const {
  465|  4.92k|        return *item_ptr(size() - 1);
  466|  4.92k|    }
_ZNK9prevectorILj28EhjiE14const_iteratorplEj:
  119|  32.8k|        const_iterator operator+(size_type n) const { return const_iterator(ptr + n); }
_ZNK9prevectorILj28EhjiE14const_iteratoreqES1_:
  124|  2.42k|        bool operator==(const_iterator x) const { return ptr == x.ptr; }
_ZN9prevectorILj28EhjiE14const_iteratorpLEj:
  121|  2.29M|        const_iterator& operator+=(size_type n) { ptr += n; return *this; }
_ZNK9prevectorILj28EhjiE14const_iteratorixEj:
  113|  4.44k|        const T& operator[](size_type pos) const { return ptr[pos]; }
_ZNK9prevectorILj28EhjiE14const_iteratorgeES1_:
  126|  2.20M|        bool operator>=(const_iterator x) const { return ptr >= x.ptr; }
_ZN9prevectorILj28EhjiE14const_iteratorppEi:
  116|  2.20M|        const_iterator operator++(int) { const_iterator copy(*this); ++(*this); return copy; }

_ZNK11XOnlyPubKey9GetKeyIDsEv:
  201|   156k|{
  202|   156k|    std::vector<CKeyID> out;
  203|       |    // For now, use the old full pubkey-based key derivation logic. As it is indexed by
  204|       |    // Hash160(full pubkey), we need to return both a version prefixed with 0x02, and one
  205|       |    // with 0x03.
  206|   156k|    unsigned char b[33] = {0x02};
  207|   156k|    std::copy(m_keydata.begin(), m_keydata.end(), b + 1);
  208|   156k|    CPubKey fullpubkey;
  209|   156k|    fullpubkey.Set(b, b + 33);
  210|   156k|    out.push_back(fullpubkey.GetID());
  211|   156k|    b[0] = 0x03;
  212|   156k|    fullpubkey.Set(b, b + 33);
  213|   156k|    out.push_back(fullpubkey.GetID());
  214|   156k|    return out;
  215|   156k|}
_ZNK11XOnlyPubKey27GetEvenCorrespondingCPubKeyEv:
  218|   138k|{
  219|   138k|    unsigned char full_key[CPubKey::COMPRESSED_SIZE] = {0x02};
  220|   138k|    std::copy(begin(), end(), full_key + 1);
  221|   138k|    return CPubKey{full_key};
  222|   138k|}
_ZNK11XOnlyPubKey12IsFullyValidEv:
  225|  4.25k|{
  226|  4.25k|    secp256k1_xonly_pubkey pubkey;
  227|  4.25k|    return secp256k1_xonly_pubkey_parse(secp256k1_context_static, &pubkey, m_keydata.data());
  228|  4.25k|}
_ZNK11XOnlyPubKey19ComputeTapTweakHashEPK7uint256:
  241|  4.23k|{
  242|  4.23k|    if (merkle_root == nullptr) {
  ------------------
  |  Branch (242:9): [True: 1.20k, False: 3.03k]
  ------------------
  243|       |        // We have no scripts. The actual tweak does not matter, but follow BIP341 here to
  244|       |        // allow for reproducible tweaking.
  245|  1.20k|        return (HashWriter{HASHER_TAPTWEAK} << m_keydata).GetSHA256();
  246|  3.03k|    } else {
  247|  3.03k|        return (HashWriter{HASHER_TAPTWEAK} << m_keydata << *merkle_root).GetSHA256();
  248|  3.03k|    }
  249|  4.23k|}
_ZNK11XOnlyPubKey14CreateTapTweakEPK7uint256:
  260|  4.23k|{
  261|  4.23k|    secp256k1_xonly_pubkey base_point;
  262|  4.23k|    if (!secp256k1_xonly_pubkey_parse(secp256k1_context_static, &base_point, data())) return std::nullopt;
  ------------------
  |  Branch (262:9): [True: 0, False: 4.23k]
  ------------------
  263|  4.23k|    secp256k1_pubkey out;
  264|  4.23k|    uint256 tweak = ComputeTapTweakHash(merkle_root);
  265|  4.23k|    if (!secp256k1_xonly_pubkey_tweak_add(secp256k1_context_static, &out, &base_point, tweak.data())) return std::nullopt;
  ------------------
  |  Branch (265:9): [True: 0, False: 4.23k]
  ------------------
  266|  4.23k|    int parity = -1;
  267|  4.23k|    std::pair<XOnlyPubKey, bool> ret;
  268|  4.23k|    secp256k1_xonly_pubkey out_xonly;
  269|  4.23k|    if (!secp256k1_xonly_pubkey_from_pubkey(secp256k1_context_static, &out_xonly, &parity, &out)) return std::nullopt;
  ------------------
  |  Branch (269:9): [True: 0, False: 4.23k]
  ------------------
  270|  4.23k|    secp256k1_xonly_pubkey_serialize(secp256k1_context_static, ret.first.begin(), &out_xonly);
  271|  4.23k|    assert(parity == 0 || parity == 1);
  272|  4.23k|    ret.second = parity;
  273|  4.23k|    return ret;
  274|  4.23k|}
_ZNK7CPubKey12IsFullyValidEv:
  314|  57.6k|bool CPubKey::IsFullyValid() const {
  315|  57.6k|    if (!IsValid())
  ------------------
  |  Branch (315:9): [True: 25.0k, False: 32.5k]
  ------------------
  316|  25.0k|        return false;
  317|  32.5k|    secp256k1_pubkey pubkey;
  318|  32.5k|    return secp256k1_ec_pubkey_parse(secp256k1_context_static, &pubkey, vch, size());
  319|  57.6k|}
_ZNK7CPubKey6DeriveERS_R7uint256jRKS1_:
  335|   153k|bool CPubKey::Derive(CPubKey& pubkeyChild, ChainCode &ccChild, unsigned int nChild, const ChainCode& cc) const {
  336|   153k|    assert(IsValid());
  337|   153k|    assert((nChild >> 31) == 0);
  338|   153k|    assert(size() == COMPRESSED_SIZE);
  339|   153k|    unsigned char out[64];
  340|   153k|    BIP32Hash(cc, nChild, *begin(), begin()+1, out);
  341|   153k|    memcpy(ccChild.begin(), out+32, 32);
  342|   153k|    secp256k1_pubkey pubkey;
  343|   153k|    if (!secp256k1_ec_pubkey_parse(secp256k1_context_static, &pubkey, vch, size())) {
  ------------------
  |  Branch (343:9): [True: 0, False: 153k]
  ------------------
  344|      0|        return false;
  345|      0|    }
  346|   153k|    if (!secp256k1_ec_pubkey_tweak_add(secp256k1_context_static, &pubkey, out)) {
  ------------------
  |  Branch (346:9): [True: 0, False: 153k]
  ------------------
  347|      0|        return false;
  348|      0|    }
  349|   153k|    unsigned char pub[COMPRESSED_SIZE];
  350|   153k|    size_t publen = COMPRESSED_SIZE;
  351|   153k|    secp256k1_ec_pubkey_serialize(secp256k1_context_static, pub, &publen, &pubkey, SECP256K1_EC_COMPRESSED);
  ------------------
  |  |  212|   153k|#define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  193|   153k|#define SECP256K1_FLAGS_TYPE_COMPRESSION (1 << 1)
  |  |  ------------------
  |  |               #define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  198|   153k|#define SECP256K1_FLAGS_BIT_COMPRESSION (1 << 8)
  |  |  ------------------
  ------------------
  352|   153k|    pubkeyChild.Set(pub, pub + publen);
  353|   153k|    return true;
  354|   153k|}
_ZNK10CExtPubKey6EncodeEPh:
  376|   251k|void CExtPubKey::Encode(unsigned char code[BIP32_EXTKEY_SIZE]) const {
  377|   251k|    code[0] = nDepth;
  378|   251k|    memcpy(code+1, vchFingerprint, 4);
  379|   251k|    WriteBE32(code+5, nChild);
  380|   251k|    memcpy(code+9, chaincode.begin(), 32);
  381|   251k|    assert(pubkey.size() == CPubKey::COMPRESSED_SIZE);
  382|   251k|    memcpy(code+41, pubkey.begin(), CPubKey::COMPRESSED_SIZE);
  383|   251k|}
_ZNK10CExtPubKey6DeriveERS_j:
  406|   153k|bool CExtPubKey::Derive(CExtPubKey &out, unsigned int _nChild) const {
  407|   153k|    if (nDepth == std::numeric_limits<unsigned char>::max()) return false;
  ------------------
  |  Branch (407:9): [True: 0, False: 153k]
  ------------------
  408|   153k|    out.nDepth = nDepth + 1;
  409|   153k|    CKeyID id = pubkey.GetID();
  410|   153k|    memcpy(out.vchFingerprint, &id, 4);
  411|   153k|    out.nChild = _nChild;
  412|   153k|    return pubkey.Derive(out.pubkey, out.chaincode, _nChild, chaincode);
  413|   153k|}

_ZN6CKeyIDC2ERK7uint160:
   27|  2.07M|    explicit CKeyID(const uint160& in) : uint160(in) {}
_ZN7CPubKey6GetLenEh:
   61|  6.69M|    {
   62|  6.69M|        if (chHeader == 2 || chHeader == 3)
  ------------------
  |  Branch (62:13): [True: 4.44M, False: 2.25M]
  |  Branch (62:30): [True: 2.05M, False: 202k]
  ------------------
   63|  6.49M|            return COMPRESSED_SIZE;
   64|   202k|        if (chHeader == 4 || chHeader == 6 || chHeader == 7)
  ------------------
  |  Branch (64:13): [True: 1.32k, False: 200k]
  |  Branch (64:30): [True: 59, False: 200k]
  |  Branch (64:47): [True: 107, False: 200k]
  ------------------
   65|  1.48k|            return SIZE;
   66|   200k|        return 0;
   67|   202k|    }
_ZN7CPubKey10InvalidateEv:
   71|  2.80M|    {
   72|  2.80M|        vch[0] = 0xFF;
   73|  2.80M|    }
_ZN7CPubKey9ValidSizeERKNSt3__16vectorIhNS0_9allocatorIhEEEE:
   77|  6.78k|    bool static ValidSize(const std::vector<unsigned char> &vch) {
   78|  6.78k|      return vch.size() > 0 && GetLen(vch[0]) == vch.size();
  ------------------
  |  Branch (78:14): [True: 5.87k, False: 914]
  |  Branch (78:32): [True: 5.71k, False: 164]
  ------------------
   79|  6.78k|    }
_ZN7CPubKeyC2Ev:
   83|  2.77M|    {
   84|  2.77M|        Invalidate();
   85|  2.77M|    }
_ZN7CPubKeyC2E4SpanIKhE:
  107|   176k|    {
  108|   176k|        Set(_vch.begin(), _vch.end());
  109|   176k|    }
_ZNK7CPubKey4sizeEv:
  112|  6.02M|    unsigned int size() const { return GetLen(vch[0]); }
_ZNK7CPubKey4dataEv:
  113|   342k|    const unsigned char* data() const { return vch; }
_ZNK7CPubKey5beginEv:
  114|  2.18M|    const unsigned char* begin() const { return vch; }
_ZNK7CPubKey3endEv:
  115|  13.0k|    const unsigned char* end() const { return vch + size(); }
_ZltRK7CPubKeyS1_:
  129|  65.9k|    {
  130|  65.9k|        return a.vch[0] < b.vch[0] ||
  ------------------
  |  Branch (130:16): [True: 7.37k, False: 58.5k]
  ------------------
  131|  65.9k|               (a.vch[0] == b.vch[0] && memcmp(a.vch, b.vch, a.size()) < 0);
  ------------------
  |  Branch (131:17): [True: 51.8k, False: 6.70k]
  |  Branch (131:41): [True: 25.2k, False: 26.5k]
  ------------------
  132|  65.9k|    }
_ZNK7CPubKey5GetIDEv:
  165|  2.06M|    {
  166|  2.06M|        return CKeyID(Hash160(Span{vch}.first(size())));
  167|  2.06M|    }
_ZNK7CPubKey7IsValidEv:
  190|  1.55M|    {
  191|  1.55M|        return size() > 0;
  192|  1.55M|    }
_ZNK7CPubKey16IsValidNonHybridEv:
  196|  14.6k|    {
  197|  14.6k|        return size() > 0 && (vch[0] == 0x02 || vch[0] == 0x03 || vch[0] == 0x04);
  ------------------
  |  Branch (197:16): [True: 14.6k, False: 0]
  |  Branch (197:31): [True: 8.23k, False: 6.46k]
  |  Branch (197:49): [True: 6.27k, False: 185]
  |  Branch (197:67): [True: 181, False: 4]
  ------------------
  198|  14.6k|    }
_ZNK7CPubKey12IsCompressedEv:
  205|  9.96k|    {
  206|  9.96k|        return size() == COMPRESSED_SIZE;
  207|  9.96k|    }
_ZN11XOnlyPubKeyC2ENSt3__14spanIKhLm18446744073709551615EEE:
  257|   434k|    constexpr explicit XOnlyPubKey(std::span<const unsigned char> bytes) : m_keydata{bytes} {}
_ZN11XOnlyPubKeyC2ERK7CPubKey:
  260|   298k|    explicit XOnlyPubKey(const CPubKey& pubkey) : XOnlyPubKey(Span{pubkey}.subspan(1, 32)) {}
_ZN11XOnlyPubKey4sizeEv:
  293|  3.30k|    static constexpr size_t size() { return decltype(m_keydata)::size(); }
_ZNK11XOnlyPubKey4dataEv:
  294|  7.54k|    const unsigned char* data() const { return m_keydata.begin(); }
_ZNK11XOnlyPubKey5beginEv:
  295|   418k|    const unsigned char* begin() const { return m_keydata.begin(); }
_ZNK11XOnlyPubKey3endEv:
  296|   418k|    const unsigned char* end() const { return m_keydata.end(); }
_ZN11XOnlyPubKey5beginEv:
  298|  6.40k|    unsigned char* begin() { return m_keydata.begin(); }
_ZNK11XOnlyPubKeyneERKS_:
  301|  1.41k|    bool operator!=(const XOnlyPubKey& other) const { return m_keydata != other.m_keydata; }
_ZNK11XOnlyPubKeyltERKS_:
  302|  12.0M|    bool operator<(const XOnlyPubKey& other) const { return m_keydata < other.m_keydata; }
_ZN7CPubKey3SetIPKhEEvT_S3_:
   90|   176k|    {
   91|   176k|        int len = pend == pbegin ? 0 : GetLen(pbegin[0]);
  ------------------
  |  Branch (91:19): [True: 0, False: 176k]
  ------------------
   92|   176k|        if (len && len == (pend - pbegin))
  ------------------
  |  Branch (92:13): [True: 151k, False: 24.2k]
  |  Branch (92:20): [True: 151k, False: 751]
  ------------------
   93|   151k|            memcpy(vch, (unsigned char*)&pbegin[0], len);
   94|  25.0k|        else
   95|  25.0k|            Invalidate();
   96|   176k|    }
_ZN11XOnlyPubKeyC2Ev:
  242|  20.5k|    XOnlyPubKey() = default;
_ZN7CPubKeyC2INSt3__111__wrap_iterIPhEEEET_S5_:
  101|  1.49k|    {
  102|  1.49k|        Set(pbegin, pend);
  103|  1.49k|    }
_ZN7CPubKey3SetINSt3__111__wrap_iterIPhEEEEvT_S5_:
   90|  1.49k|    {
   91|  1.49k|        int len = pend == pbegin ? 0 : GetLen(pbegin[0]);
  ------------------
  |  Branch (91:19): [True: 0, False: 1.49k]
  ------------------
   92|  1.49k|        if (len && len == (pend - pbegin))
  ------------------
  |  Branch (92:13): [True: 1.49k, False: 0]
  |  Branch (92:20): [True: 1.49k, False: 0]
  ------------------
   93|  1.49k|            memcpy(vch, (unsigned char*)&pbegin[0], len);
   94|      0|        else
   95|      0|            Invalidate();
   96|  1.49k|    }
_ZN7CPubKey3SetIPhEEvT_S2_:
   90|   492k|    {
   91|   492k|        int len = pend == pbegin ? 0 : GetLen(pbegin[0]);
  ------------------
  |  Branch (91:19): [True: 0, False: 492k]
  ------------------
   92|   492k|        if (len && len == (pend - pbegin))
  ------------------
  |  Branch (92:13): [True: 492k, False: 0]
  |  Branch (92:20): [True: 492k, False: 0]
  ------------------
   93|   492k|            memcpy(vch, (unsigned char*)&pbegin[0], len);
   94|      0|        else
   95|      0|            Invalidate();
   96|   492k|    }

_Z13CheckChecksumR4SpanIKcEbRNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEPS9_:
 2325|  20.4k|{
 2326|  20.4k|    auto check_split = Split(sp, '#');
 2327|  20.4k|    if (check_split.size() > 2) {
  ------------------
  |  Branch (2327:9): [True: 58, False: 20.3k]
  ------------------
 2328|     58|        error = "Multiple '#' symbols";
 2329|     58|        return false;
 2330|     58|    }
 2331|  20.3k|    if (check_split.size() == 1 && require_checksum){
  ------------------
  |  Branch (2331:9): [True: 20.2k, False: 106]
  |  Branch (2331:36): [True: 10.1k, False: 10.1k]
  ------------------
 2332|  10.1k|        error = "Missing checksum";
 2333|  10.1k|        return false;
 2334|  10.1k|    }
 2335|  10.2k|    if (check_split.size() == 2) {
  ------------------
  |  Branch (2335:9): [True: 106, False: 10.1k]
  ------------------
 2336|    106|        if (check_split[1].size() != 8) {
  ------------------
  |  Branch (2336:13): [True: 18, False: 88]
  ------------------
 2337|     18|            error = strprintf("Expected 8 character checksum, not %u characters", check_split[1].size());
  ------------------
  |  | 1172|     18|#define strprintf tfm::format
  ------------------
 2338|     18|            return false;
 2339|     18|        }
 2340|    106|    }
 2341|  10.2k|    auto checksum = DescriptorChecksum(check_split[0]);
 2342|  10.2k|    if (checksum.empty()) {
  ------------------
  |  Branch (2342:9): [True: 66, False: 10.1k]
  ------------------
 2343|     66|        error = "Invalid characters in payload";
 2344|     66|        return false;
 2345|     66|    }
 2346|  10.1k|    if (check_split.size() == 2) {
  ------------------
  |  Branch (2346:9): [True: 86, False: 10.0k]
  ------------------
 2347|     86|        if (!std::equal(checksum.begin(), checksum.end(), check_split[1].begin())) {
  ------------------
  |  Branch (2347:13): [True: 44, False: 42]
  ------------------
 2348|     44|            error = strprintf("Provided checksum '%s' does not match computed checksum '%s'", std::string(check_split[1].begin(), check_split[1].end()), checksum);
  ------------------
  |  | 1172|     44|#define strprintf tfm::format
  ------------------
 2349|     44|            return false;
 2350|     44|        }
 2351|     86|    }
 2352|  10.1k|    if (out_checksum) *out_checksum = std::move(checksum);
  ------------------
  |  Branch (2352:9): [True: 0, False: 10.1k]
  ------------------
 2353|  10.1k|    sp = check_split[0];
 2354|  10.1k|    return true;
 2355|  10.1k|}
_Z5ParseRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEER19FlatSigningProviderRS5_b:
 2358|  20.4k|{
 2359|  20.4k|    Span<const char> sp{descriptor};
 2360|  20.4k|    if (!CheckChecksum(sp, require_checksum, error)) return {};
  ------------------
  |  Branch (2360:9): [True: 10.3k, False: 10.1k]
  ------------------
 2361|  10.1k|    uint32_t key_exp_index = 0;
 2362|  10.1k|    auto ret = ParseScript(key_exp_index, sp, ParseScriptContext::TOP, out, error);
 2363|  10.1k|    if (sp.size() == 0 && !ret.empty()) {
  ------------------
  |  Branch (2363:9): [True: 9.63k, False: 470]
  |  Branch (2363:27): [True: 3.58k, False: 6.04k]
  ------------------
 2364|  3.58k|        std::vector<std::unique_ptr<Descriptor>> descs;
 2365|  3.58k|        descs.reserve(ret.size());
 2366|  3.58k|        for (auto& r : ret) {
  ------------------
  |  Branch (2366:22): [True: 3.58k, False: 3.58k]
  ------------------
 2367|  3.58k|            descs.emplace_back(std::unique_ptr<Descriptor>(std::move(r)));
 2368|  3.58k|        }
 2369|  3.58k|        return descs;
 2370|  3.58k|    }
 2371|  6.51k|    return {};
 2372|  10.1k|}
_Z15InferDescriptorRK7CScriptRK15SigningProvider:
 2384|  3.58k|{
 2385|  3.58k|    return InferScript(script, ParseScriptContext::TOP, provider);
 2386|  3.58k|}
_ZN15DescriptorCache20CacheParentExtPubKeyEjRK10CExtPubKey:
 2397|   125k|{
 2398|   125k|    m_parent_xpubs[key_exp_pos] = xpub;
 2399|   125k|}
_ZN15DescriptorCache21CacheDerivedExtPubKeyEjjRK10CExtPubKey:
 2402|    356|{
 2403|    356|    auto& xpubs = m_derived_xpubs[key_exp_pos];
 2404|    356|    xpubs[der_index] = xpub;
 2405|    356|}
_ZN15DescriptorCache26CacheLastHardenedExtPubKeyEjRK10CExtPubKey:
 2408|  45.8k|{
 2409|  45.8k|    m_last_hardened_xpubs[key_exp_pos] = xpub;
 2410|  45.8k|}
_ZNK15DescriptorCache24GetCachedParentExtPubKeyEjR10CExtPubKey:
 2413|   125k|{
 2414|   125k|    const auto& it = m_parent_xpubs.find(key_exp_pos);
 2415|   125k|    if (it == m_parent_xpubs.end()) return false;
  ------------------
  |  Branch (2415:9): [True: 0, False: 125k]
  ------------------
 2416|   125k|    xpub = it->second;
 2417|   125k|    return true;
 2418|   125k|}
_ZNK15DescriptorCache25GetCachedDerivedExtPubKeyEjjR10CExtPubKey:
 2421|   125k|{
 2422|   125k|    const auto& key_exp_it = m_derived_xpubs.find(key_exp_pos);
 2423|   125k|    if (key_exp_it == m_derived_xpubs.end()) return false;
  ------------------
  |  Branch (2423:9): [True: 125k, False: 356]
  ------------------
 2424|    356|    const auto& der_it = key_exp_it->second.find(der_index);
 2425|    356|    if (der_it == key_exp_it->second.end()) return false;
  ------------------
  |  Branch (2425:9): [True: 0, False: 356]
  ------------------
 2426|    356|    xpub = der_it->second;
 2427|    356|    return true;
 2428|    356|}
descriptor.cpp:_ZN12_GLOBAL__N_118DescriptorChecksumERK4SpanIKcE:
  106|  20.4k|{
  107|       |    /** A character set designed such that:
  108|       |     *  - The most common 'unprotected' descriptor characters (hex, keypaths) are in the first group of 32.
  109|       |     *  - Case errors cause an offset that's a multiple of 32.
  110|       |     *  - As many alphabetic characters are in the same group (while following the above restrictions).
  111|       |     *
  112|       |     * If p(x) gives the position of a character c in this character set, every group of 3 characters
  113|       |     * (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).
  114|       |     * This means that changes that only affect the lower 5 bits of the position, or only the higher 2 bits, will just
  115|       |     * affect a single symbol.
  116|       |     *
  117|       |     * As a result, within-group-of-32 errors count as 1 symbol, as do cross-group errors that don't affect
  118|       |     * the position within the groups.
  119|       |     */
  120|  20.4k|    static const std::string INPUT_CHARSET =
  121|  20.4k|        "0123456789()[],'/*abcdefgh@:$%{}"
  122|  20.4k|        "IJKLMNOPQRSTUVWXYZ&+-.;<=>?!^_|~"
  123|  20.4k|        "ijklmnopqrstuvwxyzABCDEFGH`#\"\\ ";
  124|       |
  125|       |    /** The character set for the checksum itself (same as bech32). */
  126|  20.4k|    static const std::string CHECKSUM_CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l";
  127|       |
  128|  20.4k|    uint64_t c = 1;
  129|  20.4k|    int cls = 0;
  130|  20.4k|    int clscount = 0;
  131|   246M|    for (auto ch : span) {
  ------------------
  |  Branch (131:18): [True: 246M, False: 20.3k]
  ------------------
  132|   246M|        auto pos = INPUT_CHARSET.find(ch);
  133|   246M|        if (pos == std::string::npos) return "";
  ------------------
  |  Branch (133:13): [True: 66, False: 246M]
  ------------------
  134|   246M|        c = PolyMod(c, pos & 31); // Emit a symbol for the position inside the group, for every character.
  135|   246M|        cls = cls * 3 + (pos >> 5); // Accumulate the group numbers
  136|   246M|        if (++clscount == 3) {
  ------------------
  |  Branch (136:13): [True: 82.0M, False: 164M]
  ------------------
  137|       |            // Emit an extra symbol representing the group numbers, for every 3 characters.
  138|  82.0M|            c = PolyMod(c, cls);
  139|  82.0M|            cls = 0;
  140|  82.0M|            clscount = 0;
  141|  82.0M|        }
  142|   246M|    }
  143|  20.3k|    if (clscount > 0) c = PolyMod(c, cls);
  ------------------
  |  Branch (143:9): [True: 14.4k, False: 5.95k]
  ------------------
  144|   183k|    for (int j = 0; j < 8; ++j) c = PolyMod(c, 0); // Shift further to determine the checksum.
  ------------------
  |  Branch (144:21): [True: 163k, False: 20.3k]
  ------------------
  145|  20.3k|    c ^= 1; // Prevent appending zeroes from not affecting the checksum.
  146|       |
  147|  20.3k|    std::string ret(8, ' ');
  148|   183k|    for (int j = 0; j < 8; ++j) ret[j] = CHECKSUM_CHARSET[(c >> (5 * (7 - j))) & 31];
  ------------------
  |  Branch (148:21): [True: 163k, False: 20.3k]
  ------------------
  149|  20.3k|    return ret;
  150|  20.4k|}
descriptor.cpp:_ZN12_GLOBAL__N_17PolyModEmi:
   94|   328M|{
   95|   328M|    uint8_t c0 = c >> 35;
   96|   328M|    c = ((c & 0x7ffffffff) << 5) ^ val;
   97|   328M|    if (c0 & 1) c ^= 0xf5dee51989;
  ------------------
  |  Branch (97:9): [True: 164M, False: 164M]
  ------------------
   98|   328M|    if (c0 & 2) c ^= 0xa9fdca3312;
  ------------------
  |  Branch (98:9): [True: 164M, False: 164M]
  ------------------
   99|   328M|    if (c0 & 4) c ^= 0x1bab10e32d;
  ------------------
  |  Branch (99:9): [True: 164M, False: 164M]
  ------------------
  100|   328M|    if (c0 & 8) c ^= 0x3706b1677a;
  ------------------
  |  Branch (100:9): [True: 164M, False: 164M]
  ------------------
  101|   328M|    if (c0 & 16) c ^= 0x644d626ffd;
  ------------------
  |  Branch (101:9): [True: 164M, False: 164M]
  ------------------
  102|   328M|    return c;
  103|   328M|}
descriptor.cpp:_ZN12_GLOBAL__N_111ParseScriptERjR4SpanIKcENS_18ParseScriptContextER19FlatSigningProviderRNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEE:
 1755|  18.9k|{
 1756|  18.9k|    using namespace script;
 1757|  18.9k|    Assume(ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH || ctx == ParseScriptContext::P2WSH || ctx == ParseScriptContext::P2TR);
  ------------------
  |  |   97|  80.2k|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  |  |  ------------------
  |  |  |  Branch (97:51): [True: 10.1k, False: 8.88k]
  |  |  |  Branch (97:51): [True: 761, False: 8.12k]
  |  |  |  Branch (97:51): [True: 1.80k, False: 6.31k]
  |  |  |  Branch (97:51): [True: 6.31k, False: 0]
  |  |  ------------------
  ------------------
 1758|  18.9k|    std::vector<std::unique_ptr<DescriptorImpl>> ret;
 1759|  18.9k|    auto expr = Expr(sp);
 1760|  18.9k|    if (Func("pk", expr)) {
  ------------------
  |  Branch (1760:9): [True: 2.59k, False: 16.3k]
  ------------------
 1761|  2.59k|        auto pubkeys = ParsePubkey(key_exp_index, expr, ctx, out, error);
 1762|  2.59k|        if (pubkeys.empty()) {
  ------------------
  |  Branch (1762:13): [True: 226, False: 2.36k]
  ------------------
 1763|    226|            error = strprintf("pk(): %s", error);
  ------------------
  |  | 1172|    226|#define strprintf tfm::format
  ------------------
 1764|    226|            return {};
 1765|    226|        }
 1766|  2.36k|        ++key_exp_index;
 1767|  2.36k|        for (auto& pubkey : pubkeys) {
  ------------------
  |  Branch (1767:27): [True: 2.36k, False: 2.36k]
  ------------------
 1768|  2.36k|            ret.emplace_back(std::make_unique<PKDescriptor>(std::move(pubkey), ctx == ParseScriptContext::P2TR));
 1769|  2.36k|        }
 1770|  2.36k|        return ret;
 1771|  2.59k|    }
 1772|  16.3k|    if ((ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH || ctx == ParseScriptContext::P2WSH) && Func("pkh", expr)) {
  ------------------
  |  Branch (1772:9): [True: 16, False: 16.3k]
  |  Branch (1772:10): [True: 9.77k, False: 6.62k]
  |  Branch (1772:44): [True: 757, False: 5.86k]
  |  Branch (1772:79): [True: 1.79k, False: 4.07k]
  |  Branch (1772:116): [True: 16, False: 12.3k]
  ------------------
 1773|     16|        auto pubkeys = ParsePubkey(key_exp_index, expr, ctx, out, error);
 1774|     16|        if (pubkeys.empty()) {
  ------------------
  |  Branch (1774:13): [True: 7, False: 9]
  ------------------
 1775|      7|            error = strprintf("pkh(): %s", error);
  ------------------
  |  | 1172|      7|#define strprintf tfm::format
  ------------------
 1776|      7|            return {};
 1777|      7|        }
 1778|      9|        ++key_exp_index;
 1779|      9|        for (auto& pubkey : pubkeys) {
  ------------------
  |  Branch (1779:27): [True: 9, False: 9]
  ------------------
 1780|      9|            ret.emplace_back(std::make_unique<PKHDescriptor>(std::move(pubkey)));
 1781|      9|        }
 1782|      9|        return ret;
 1783|     16|    }
 1784|  16.3k|    if (ctx == ParseScriptContext::TOP && Func("combo", expr)) {
  ------------------
  |  Branch (1784:9): [True: 9.76k, False: 6.61k]
  |  Branch (1784:9): [True: 10, False: 16.3k]
  |  Branch (1784:43): [True: 10, False: 9.75k]
  ------------------
 1785|     10|        auto pubkeys = ParsePubkey(key_exp_index, expr, ctx, out, error);
 1786|     10|        if (pubkeys.empty()) {
  ------------------
  |  Branch (1786:13): [True: 5, False: 5]
  ------------------
 1787|      5|            error = strprintf("combo(): %s", error);
  ------------------
  |  | 1172|      5|#define strprintf tfm::format
  ------------------
 1788|      5|            return {};
 1789|      5|        }
 1790|      5|        ++key_exp_index;
 1791|      5|        for (auto& pubkey : pubkeys) {
  ------------------
  |  Branch (1791:27): [True: 5, False: 5]
  ------------------
 1792|      5|            ret.emplace_back(std::make_unique<ComboDescriptor>(std::move(pubkey)));
 1793|      5|        }
 1794|      5|        return ret;
 1795|  16.3k|    } else if (Func("combo", expr)) {
  ------------------
  |  Branch (1795:16): [True: 1, False: 16.3k]
  ------------------
 1796|      1|        error = "Can only have combo() at top level";
 1797|      1|        return {};
 1798|      1|    }
 1799|  16.3k|    const bool multi = Func("multi", expr);
 1800|  16.3k|    const bool sortedmulti = !multi && Func("sortedmulti", expr);
  ------------------
  |  Branch (1800:30): [True: 15.2k, False: 1.12k]
  |  Branch (1800:40): [True: 179, False: 15.0k]
  ------------------
 1801|  16.3k|    const bool multi_a = !(multi || sortedmulti) && Func("multi_a", expr);
  ------------------
  |  Branch (1801:28): [True: 1.12k, False: 15.2k]
  |  Branch (1801:37): [True: 179, False: 15.0k]
  |  Branch (1801:53): [True: 815, False: 14.2k]
  ------------------
 1802|  16.3k|    const bool sortedmulti_a = !(multi || sortedmulti || multi_a) && Func("sortedmulti_a", expr);
  ------------------
  |  Branch (1802:34): [True: 1.12k, False: 15.2k]
  |  Branch (1802:43): [True: 179, False: 15.0k]
  |  Branch (1802:58): [True: 815, False: 14.2k]
  |  Branch (1802:70): [True: 1.11k, False: 13.1k]
  ------------------
 1803|  16.3k|    if (((ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH || ctx == ParseScriptContext::P2WSH) && (multi || sortedmulti)) ||
  ------------------
  |  Branch (1803:11): [True: 9.75k, False: 6.61k]
  |  Branch (1803:45): [True: 755, False: 5.85k]
  |  Branch (1803:80): [True: 1.78k, False: 4.07k]
  |  Branch (1803:118): [True: 1.12k, False: 11.1k]
  |  Branch (1803:127): [True: 178, False: 10.9k]
  ------------------
 1804|  16.3k|        (ctx == ParseScriptContext::P2TR && (multi_a || sortedmulti_a))) {
  ------------------
  |  Branch (1804:10): [True: 4.07k, False: 10.9k]
  |  Branch (1804:46): [True: 814, False: 3.25k]
  |  Branch (1804:57): [True: 1.11k, False: 2.13k]
  ------------------
 1805|  3.23k|        auto threshold = Expr(expr);
 1806|  3.23k|        uint32_t thres;
 1807|  3.23k|        std::vector<std::vector<std::unique_ptr<PubkeyProvider>>> providers; // List of multipath expanded pubkeys
 1808|  3.23k|        if (!ParseUInt32(std::string(threshold.begin(), threshold.end()), &thres)) {
  ------------------
  |  Branch (1808:13): [True: 117, False: 3.11k]
  ------------------
 1809|    117|            error = strprintf("Multi threshold '%s' is not valid", std::string(threshold.begin(), threshold.end()));
  ------------------
  |  | 1172|    117|#define strprintf tfm::format
  ------------------
 1810|    117|            return {};
 1811|    117|        }
 1812|  3.11k|        size_t script_size = 0;
 1813|  3.11k|        size_t max_providers_len = 0;
 1814|   148k|        while (expr.size()) {
  ------------------
  |  Branch (1814:16): [True: 145k, False: 2.89k]
  ------------------
 1815|   145k|            if (!Const(",", expr)) {
  ------------------
  |  Branch (1815:17): [True: 1, False: 145k]
  ------------------
 1816|      1|                error = strprintf("Multi: expected ',', got '%c'", expr[0]);
  ------------------
  |  | 1172|      1|#define strprintf tfm::format
  ------------------
 1817|      1|                return {};
 1818|      1|            }
 1819|   145k|            auto arg = Expr(expr);
 1820|   145k|            auto pks = ParsePubkey(key_exp_index, arg, ctx, out, error);
 1821|   145k|            if (pks.empty()) {
  ------------------
  |  Branch (1821:17): [True: 228, False: 145k]
  ------------------
 1822|    228|                error = strprintf("Multi: %s", error);
  ------------------
  |  | 1172|    228|#define strprintf tfm::format
  ------------------
 1823|    228|                return {};
 1824|    228|            }
 1825|   145k|            script_size += pks.at(0)->GetSize() + 1;
 1826|   145k|            max_providers_len = std::max(max_providers_len, pks.size());
 1827|   145k|            providers.emplace_back(std::move(pks));
 1828|   145k|            key_exp_index++;
 1829|   145k|        }
 1830|  2.89k|        if ((multi || sortedmulti) && (providers.empty() || providers.size() > MAX_PUBKEYS_PER_MULTISIG)) {
  ------------------
  |  Branch (1830:14): [True: 840, False: 2.05k]
  |  Branch (1830:23): [True: 162, False: 1.88k]
  |  Branch (1830:40): [True: 40, False: 962]
  |  Branch (1830:61): [True: 6, False: 956]
  ------------------
 1831|     46|            error = strprintf("Cannot have %u keys in multisig; must have between 1 and %d keys, inclusive", providers.size(), MAX_PUBKEYS_PER_MULTISIG);
  ------------------
  |  | 1172|     46|#define strprintf tfm::format
  ------------------
 1832|     46|            return {};
 1833|  2.84k|        } else if ((multi_a || sortedmulti_a) && (providers.empty() || providers.size() > MAX_PUBKEYS_PER_MULTI_A)) {
  ------------------
  |  Branch (1833:21): [True: 793, False: 2.05k]
  |  Branch (1833:32): [True: 1.09k, False: 956]
  |  Branch (1833:51): [True: 7, False: 1.88k]
  |  Branch (1833:72): [True: 0, False: 1.88k]
  ------------------
 1834|      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
  ------------------
 1835|      7|            return {};
 1836|  2.83k|        } else if (thres < 1) {
  ------------------
  |  Branch (1836:20): [True: 9, False: 2.82k]
  ------------------
 1837|      9|            error = strprintf("Multisig threshold cannot be %d, must be at least 1", thres);
  ------------------
  |  | 1172|      9|#define strprintf tfm::format
  ------------------
 1838|      9|            return {};
 1839|  2.82k|        } else if (thres > providers.size()) {
  ------------------
  |  Branch (1839:20): [True: 34, False: 2.79k]
  ------------------
 1840|     34|            error = strprintf("Multisig threshold cannot be larger than the number of keys; threshold is %d but only %u keys specified", thres, providers.size());
  ------------------
  |  | 1172|     34|#define strprintf tfm::format
  ------------------
 1841|     34|            return {};
 1842|     34|        }
 1843|  2.79k|        if (ctx == ParseScriptContext::TOP) {
  ------------------
  |  Branch (1843:13): [True: 290, False: 2.50k]
  ------------------
 1844|    290|            if (providers.size() > 3) {
  ------------------
  |  Branch (1844:17): [True: 10, False: 280]
  ------------------
 1845|     10|                error = strprintf("Cannot have %u pubkeys in bare multisig; only at most 3 pubkeys", providers.size());
  ------------------
  |  | 1172|     10|#define strprintf tfm::format
  ------------------
 1846|     10|                return {};
 1847|     10|            }
 1848|    290|        }
 1849|  2.78k|        if (ctx == ParseScriptContext::P2SH) {
  ------------------
  |  Branch (1849:13): [True: 470, False: 2.31k]
  ------------------
 1850|       |            // This limits the maximum number of compressed pubkeys to 15.
 1851|    470|            if (script_size + 3 > MAX_SCRIPT_ELEMENT_SIZE) {
  ------------------
  |  Branch (1851:17): [True: 6, False: 464]
  ------------------
 1852|      6|                error = strprintf("P2SH script is too large, %d bytes is larger than %d bytes", script_size + 3, MAX_SCRIPT_ELEMENT_SIZE);
  ------------------
  |  | 1172|      6|#define strprintf tfm::format
  ------------------
 1853|      6|                return {};
 1854|      6|            }
 1855|    470|        }
 1856|       |
 1857|       |        // Make sure all vecs are of the same length, or exactly length 1
 1858|       |        // For length 1 vectors, clone key providers until vector is the same length
 1859|   141k|        for (auto& vec : providers) {
  ------------------
  |  Branch (1859:24): [True: 141k, False: 2.77k]
  ------------------
 1860|   141k|            if (vec.size() == 1) {
  ------------------
  |  Branch (1860:17): [True: 141k, False: 0]
  ------------------
 1861|   141k|                for (size_t i = 1; i < max_providers_len; ++i) {
  ------------------
  |  Branch (1861:36): [True: 0, False: 141k]
  ------------------
 1862|      0|                    vec.emplace_back(vec.at(0)->Clone());
 1863|      0|                }
 1864|   141k|            } else if (vec.size() != max_providers_len) {
  ------------------
  |  Branch (1864:24): [True: 0, False: 0]
  ------------------
 1865|      0|                error = strprintf("multi(): Multipath derivation paths have mismatched lengths");
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
 1866|      0|                return {};
 1867|      0|            }
 1868|   141k|        }
 1869|       |
 1870|       |        // Build the final descriptors vector
 1871|  5.55k|        for (size_t i = 0; i < max_providers_len; ++i) {
  ------------------
  |  Branch (1871:28): [True: 2.77k, False: 2.77k]
  ------------------
 1872|       |            // Build final pubkeys vectors by retrieving the i'th subscript for each vector in subscripts
 1873|  2.77k|            std::vector<std::unique_ptr<PubkeyProvider>> pubs;
 1874|  2.77k|            pubs.reserve(providers.size());
 1875|   141k|            for (auto& pub : providers) {
  ------------------
  |  Branch (1875:28): [True: 141k, False: 2.77k]
  ------------------
 1876|   141k|                pubs.emplace_back(std::move(pub.at(i)));
 1877|   141k|            }
 1878|  2.77k|            if (multi || sortedmulti) {
  ------------------
  |  Branch (1878:17): [True: 743, False: 2.03k]
  |  Branch (1878:26): [True: 160, False: 1.87k]
  ------------------
 1879|    903|                ret.emplace_back(std::make_unique<MultisigDescriptor>(thres, std::move(pubs), sortedmulti));
 1880|  1.87k|            } else {
 1881|  1.87k|                ret.emplace_back(std::make_unique<MultiADescriptor>(thres, std::move(pubs), sortedmulti_a));
 1882|  1.87k|            }
 1883|  2.77k|        }
 1884|  2.77k|        return ret;
 1885|  13.1k|    } else if (multi || sortedmulti) {
  ------------------
  |  Branch (1885:16): [True: 1, False: 13.1k]
  |  Branch (1885:25): [True: 1, False: 13.1k]
  ------------------
 1886|      2|        error = "Can only have multi/sortedmulti at top level, in sh(), or in wsh()";
 1887|      2|        return {};
 1888|  13.1k|    } else if (multi_a || sortedmulti_a) {
  ------------------
  |  Branch (1888:16): [True: 1, False: 13.1k]
  |  Branch (1888:27): [True: 1, False: 13.1k]
  ------------------
 1889|      2|        error = "Can only have multi_a/sortedmulti_a inside tr()";
 1890|      2|        return {};
 1891|      2|    }
 1892|  13.1k|    if ((ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH) && Func("wpkh", expr)) {
  ------------------
  |  Branch (1892:9): [True: 5, False: 13.1k]
  |  Branch (1892:10): [True: 9.14k, False: 3.98k]
  |  Branch (1892:44): [True: 233, False: 3.74k]
  |  Branch (1892:80): [True: 5, False: 9.37k]
  ------------------
 1893|      5|        auto pubkeys = ParsePubkey(key_exp_index, expr, ParseScriptContext::P2WPKH, out, error);
 1894|      5|        if (pubkeys.empty()) {
  ------------------
  |  Branch (1894:13): [True: 3, False: 2]
  ------------------
 1895|      3|            error = strprintf("wpkh(): %s", error);
  ------------------
  |  | 1172|      3|#define strprintf tfm::format
  ------------------
 1896|      3|            return {};
 1897|      3|        }
 1898|      2|        key_exp_index++;
 1899|      2|        for (auto& pubkey : pubkeys) {
  ------------------
  |  Branch (1899:27): [True: 2, False: 2]
  ------------------
 1900|      2|            ret.emplace_back(std::make_unique<WPKHDescriptor>(std::move(pubkey)));
 1901|      2|        }
 1902|      2|        return ret;
 1903|  13.1k|    } else if (Func("wpkh", expr)) {
  ------------------
  |  Branch (1903:16): [True: 1, False: 13.1k]
  ------------------
 1904|      1|        error = "Can only have wpkh() at top level or inside sh()";
 1905|      1|        return {};
 1906|      1|    }
 1907|  13.1k|    if (ctx == ParseScriptContext::TOP && Func("sh", expr)) {
  ------------------
  |  Branch (1907:9): [True: 9.14k, False: 3.97k]
  |  Branch (1907:9): [True: 761, False: 12.3k]
  |  Branch (1907:43): [True: 761, False: 8.38k]
  ------------------
 1908|    761|        auto descs = ParseScript(key_exp_index, expr, ParseScriptContext::P2SH, out, error);
 1909|    761|        if (descs.empty() || expr.size()) return {};
  ------------------
  |  Branch (1909:13): [True: 147, False: 614]
  |  Branch (1909:30): [True: 4, False: 610]
  ------------------
 1910|    610|        std::vector<std::unique_ptr<DescriptorImpl>> ret;
 1911|    610|        ret.reserve(descs.size());
 1912|    610|        for (auto& desc : descs) {
  ------------------
  |  Branch (1912:25): [True: 610, False: 610]
  ------------------
 1913|    610|            ret.push_back(std::make_unique<SHDescriptor>(std::move(desc)));
 1914|    610|        }
 1915|    610|        return ret;
 1916|  12.3k|    } else if (Func("sh", expr)) {
  ------------------
  |  Branch (1916:16): [True: 2, False: 12.3k]
  ------------------
 1917|      2|        error = "Can only have sh() at top level";
 1918|      2|        return {};
 1919|      2|    }
 1920|  12.3k|    if ((ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH) && Func("wsh", expr)) {
  ------------------
  |  Branch (1920:9): [True: 1.80k, False: 10.5k]
  |  Branch (1920:10): [True: 8.38k, False: 3.97k]
  |  Branch (1920:44): [True: 231, False: 3.74k]
  |  Branch (1920:80): [True: 1.80k, False: 6.80k]
  ------------------
 1921|  1.80k|        auto descs = ParseScript(key_exp_index, expr, ParseScriptContext::P2WSH, out, error);
 1922|  1.80k|        if (descs.empty() || expr.size()) return {};
  ------------------
  |  Branch (1922:13): [True: 1.00k, False: 805]
  |  Branch (1922:30): [True: 25, False: 780]
  ------------------
 1923|    780|        for (auto& desc : descs) {
  ------------------
  |  Branch (1923:25): [True: 780, False: 780]
  ------------------
 1924|    780|            ret.emplace_back(std::make_unique<WSHDescriptor>(std::move(desc)));
 1925|    780|        }
 1926|    780|        return ret;
 1927|  10.5k|    } else if (Func("wsh", expr)) {
  ------------------
  |  Branch (1927:16): [True: 1, False: 10.5k]
  ------------------
 1928|      1|        error = "Can only have wsh() at top level or inside sh()";
 1929|      1|        return {};
 1930|      1|    }
 1931|  10.5k|    if (ctx == ParseScriptContext::TOP && Func("addr", expr)) {
  ------------------
  |  Branch (1931:9): [True: 6.77k, False: 3.77k]
  |  Branch (1931:9): [True: 454, False: 10.0k]
  |  Branch (1931:43): [True: 454, False: 6.32k]
  ------------------
 1932|    454|        CTxDestination dest = DecodeDestination(std::string(expr.begin(), expr.end()));
 1933|    454|        if (!IsValidDestination(dest)) {
  ------------------
  |  Branch (1933:13): [True: 454, False: 0]
  ------------------
 1934|    454|            error = "Address is not valid";
 1935|    454|            return {};
 1936|    454|        }
 1937|      0|        ret.emplace_back(std::make_unique<AddressDescriptor>(std::move(dest)));
 1938|      0|        return ret;
 1939|  10.0k|    } else if (Func("addr", expr)) {
  ------------------
  |  Branch (1939:16): [True: 1, False: 10.0k]
  ------------------
 1940|      1|        error = "Can only have addr() at top level";
 1941|      1|        return {};
 1942|      1|    }
 1943|  10.0k|    if (ctx == ParseScriptContext::TOP && Func("tr", expr)) {
  ------------------
  |  Branch (1943:9): [True: 6.32k, False: 3.77k]
  |  Branch (1943:9): [True: 2.08k, False: 8.01k]
  |  Branch (1943:43): [True: 2.08k, False: 4.23k]
  ------------------
 1944|  2.08k|        auto arg = Expr(expr);
 1945|  2.08k|        auto internal_keys = ParsePubkey(key_exp_index, arg, ParseScriptContext::P2TR, out, error);
 1946|  2.08k|        if (internal_keys.empty()) {
  ------------------
  |  Branch (1946:13): [True: 362, False: 1.72k]
  ------------------
 1947|    362|            error = strprintf("tr(): %s", error);
  ------------------
  |  | 1172|    362|#define strprintf tfm::format
  ------------------
 1948|    362|            return {};
 1949|    362|        }
 1950|  1.72k|        size_t max_providers_len = internal_keys.size();
 1951|  1.72k|        ++key_exp_index;
 1952|  1.72k|        std::vector<std::vector<std::unique_ptr<DescriptorImpl>>> subscripts; //!< list of multipath expanded script subexpressions
 1953|  1.72k|        std::vector<int> depths; //!< depth in the tree of each subexpression (same length subscripts)
 1954|  1.72k|        if (expr.size()) {
  ------------------
  |  Branch (1954:13): [True: 1.31k, False: 403]
  ------------------
 1955|  1.31k|            if (!Const(",", expr)) {
  ------------------
  |  Branch (1955:17): [True: 1, False: 1.31k]
  ------------------
 1956|      1|                error = strprintf("tr: expected ',', got '%c'", expr[0]);
  ------------------
  |  | 1172|      1|#define strprintf tfm::format
  ------------------
 1957|      1|                return {};
 1958|      1|            }
 1959|       |            /** The path from the top of the tree to what we're currently processing.
 1960|       |             * branches[i] == false: left branch in the i'th step from the top; true: right branch.
 1961|       |             */
 1962|  1.31k|            std::vector<bool> branches;
 1963|       |            // Loop over all provided scripts. In every iteration exactly one script will be processed.
 1964|       |            // Use a do-loop because inside this if-branch we expect at least one script.
 1965|  6.31k|            do {
 1966|       |                // First process all open braces.
 1967|  13.4k|                while (Const("{", expr)) {
  ------------------
  |  Branch (1967:24): [True: 7.14k, False: 6.31k]
  ------------------
 1968|  7.14k|                    branches.push_back(false); // new left branch
 1969|  7.14k|                    if (branches.size() > TAPROOT_CONTROL_MAX_NODE_COUNT) {
  ------------------
  |  Branch (1969:25): [True: 3, False: 7.13k]
  ------------------
 1970|      3|                        error = strprintf("tr() supports at most %i nesting levels", TAPROOT_CONTROL_MAX_NODE_COUNT);
  ------------------
  |  | 1172|      3|#define strprintf tfm::format
  ------------------
 1971|      3|                        return {};
 1972|      3|                    }
 1973|  7.14k|                }
 1974|       |                // Process the actual script expression.
 1975|  6.31k|                auto sarg = Expr(expr);
 1976|  6.31k|                subscripts.emplace_back(ParseScript(key_exp_index, sarg, ParseScriptContext::P2TR, out, error));
 1977|  6.31k|                if (subscripts.back().empty()) return {};
  ------------------
  |  Branch (1977:21): [True: 276, False: 6.03k]
  ------------------
 1978|  6.03k|                max_providers_len = std::max(max_providers_len, subscripts.back().size());
 1979|  6.03k|                depths.push_back(branches.size());
 1980|       |                // Process closing braces; one is expected for every right branch we were in.
 1981|  9.00k|                while (branches.size() && branches.back()) {
  ------------------
  |  Branch (1981:24): [True: 7.98k, False: 1.01k]
  |  Branch (1981:24): [True: 2.97k, False: 6.02k]
  |  Branch (1981:43): [True: 2.97k, False: 5.00k]
  ------------------
 1982|  2.97k|                    if (!Const("}", expr)) {
  ------------------
  |  Branch (1982:25): [True: 10, False: 2.96k]
  ------------------
 1983|     10|                        error = strprintf("tr(): expected '}' after script expression");
  ------------------
  |  | 1172|     10|#define strprintf tfm::format
  ------------------
 1984|     10|                        return {};
 1985|     10|                    }
 1986|  2.96k|                    branches.pop_back(); // move up one level after encountering '}'
 1987|  2.96k|                }
 1988|       |                // If after that, we're at the end of a left branch, expect a comma.
 1989|  6.02k|                if (branches.size() && !branches.back()) {
  ------------------
  |  Branch (1989:21): [True: 5.00k, False: 1.01k]
  |  Branch (1989:21): [True: 5.00k, False: 1.01k]
  |  Branch (1989:40): [True: 5.00k, False: 0]
  ------------------
 1990|  5.00k|                    if (!Const(",", expr)) {
  ------------------
  |  Branch (1990:25): [True: 11, False: 4.99k]
  ------------------
 1991|     11|                        error = strprintf("tr(): expected ',' after script expression");
  ------------------
  |  | 1172|     11|#define strprintf tfm::format
  ------------------
 1992|     11|                        return {};
 1993|     11|                    }
 1994|  4.99k|                    branches.back() = true; // And now we're in a right branch.
 1995|  4.99k|                }
 1996|  6.02k|            } while (branches.size());
  ------------------
  |  Branch (1996:22): [True: 4.99k, False: 1.01k]
  ------------------
 1997|       |            // After we've explored a whole tree, we must be at the end of the expression.
 1998|  1.01k|            if (expr.size()) {
  ------------------
  |  Branch (1998:17): [True: 2, False: 1.01k]
  ------------------
 1999|      2|                error = strprintf("tr(): expected ')' after script expression");
  ------------------
  |  | 1172|      2|#define strprintf tfm::format
  ------------------
 2000|      2|                return {};
 2001|      2|            }
 2002|  1.01k|        }
 2003|  1.41k|        assert(TaprootBuilder::ValidDepths(depths));
 2004|       |
 2005|       |        // Make sure all vecs are of the same length, or exactly length 1
 2006|       |        // For length 1 vectors, clone subdescs until vector is the same length
 2007|  3.56k|        for (auto& vec : subscripts) {
  ------------------
  |  Branch (2007:24): [True: 3.56k, False: 1.41k]
  ------------------
 2008|  3.56k|            if (vec.size() == 1) {
  ------------------
  |  Branch (2008:17): [True: 3.56k, False: 0]
  ------------------
 2009|  3.56k|                for (size_t i = 1; i < max_providers_len; ++i) {
  ------------------
  |  Branch (2009:36): [True: 0, False: 3.56k]
  ------------------
 2010|      0|                    vec.emplace_back(vec.at(0)->Clone());
 2011|      0|                }
 2012|  3.56k|            } else if (vec.size() != max_providers_len) {
  ------------------
  |  Branch (2012:24): [True: 0, False: 0]
  ------------------
 2013|      0|                error = strprintf("tr(): Multipath subscripts have mismatched lengths");
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
 2014|      0|                return {};
 2015|      0|            }
 2016|  3.56k|        }
 2017|       |
 2018|  1.41k|        if (internal_keys.size() > 1 && internal_keys.size() != max_providers_len) {
  ------------------
  |  Branch (2018:13): [True: 0, False: 1.41k]
  |  Branch (2018:41): [True: 0, False: 0]
  ------------------
 2019|      0|            error = strprintf("tr(): Multipath internal key mismatches multipath subscripts lengths");
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
 2020|      0|            return {};
 2021|      0|        }
 2022|       |
 2023|  1.41k|        while (internal_keys.size() < max_providers_len) {
  ------------------
  |  Branch (2023:16): [True: 0, False: 1.41k]
  ------------------
 2024|      0|            internal_keys.emplace_back(internal_keys.at(0)->Clone());
 2025|      0|        }
 2026|       |
 2027|       |        // Build the final descriptors vector
 2028|  2.83k|        for (size_t i = 0; i < max_providers_len; ++i) {
  ------------------
  |  Branch (2028:28): [True: 1.41k, False: 1.41k]
  ------------------
 2029|       |            // Build final subscripts vectors by retrieving the i'th subscript for each vector in subscripts
 2030|  1.41k|            std::vector<std::unique_ptr<DescriptorImpl>> this_subs;
 2031|  1.41k|            this_subs.reserve(subscripts.size());
 2032|  3.56k|            for (auto& subs : subscripts) {
  ------------------
  |  Branch (2032:29): [True: 3.56k, False: 1.41k]
  ------------------
 2033|  3.56k|                this_subs.emplace_back(std::move(subs.at(i)));
 2034|  3.56k|            }
 2035|  1.41k|            ret.emplace_back(std::make_unique<TRDescriptor>(std::move(internal_keys.at(i)), std::move(this_subs), depths));
 2036|  1.41k|        }
 2037|  1.41k|        return ret;
 2038|       |
 2039|       |
 2040|  8.01k|    } else if (Func("tr", expr)) {
  ------------------
  |  Branch (2040:16): [True: 1, False: 8.00k]
  ------------------
 2041|      1|        error = "Can only have tr at top level";
 2042|      1|        return {};
 2043|      1|    }
 2044|  8.00k|    if (ctx == ParseScriptContext::TOP && Func("rawtr", expr)) {
  ------------------
  |  Branch (2044:9): [True: 4.23k, False: 3.77k]
  |  Branch (2044:9): [True: 11, False: 7.99k]
  |  Branch (2044:43): [True: 11, False: 4.22k]
  ------------------
 2045|     11|        auto arg = Expr(expr);
 2046|     11|        if (expr.size()) {
  ------------------
  |  Branch (2046:13): [True: 6, False: 5]
  ------------------
 2047|      6|            error = strprintf("rawtr(): only one key expected.");
  ------------------
  |  | 1172|      6|#define strprintf tfm::format
  ------------------
 2048|      6|            return {};
 2049|      6|        }
 2050|      5|        auto output_keys = ParsePubkey(key_exp_index, arg, ParseScriptContext::P2TR, out, error);
 2051|      5|        if (output_keys.empty()) {
  ------------------
  |  Branch (2051:13): [True: 2, False: 3]
  ------------------
 2052|      2|            error = strprintf("rawtr(): %s", error);
  ------------------
  |  | 1172|      2|#define strprintf tfm::format
  ------------------
 2053|      2|            return {};
 2054|      2|        }
 2055|      3|        ++key_exp_index;
 2056|      3|        for (auto& pubkey : output_keys) {
  ------------------
  |  Branch (2056:27): [True: 3, False: 3]
  ------------------
 2057|      3|            ret.emplace_back(std::make_unique<RawTRDescriptor>(std::move(pubkey)));
 2058|      3|        }
 2059|      3|        return ret;
 2060|  7.99k|    } else if (Func("rawtr", expr)) {
  ------------------
  |  Branch (2060:16): [True: 1, False: 7.99k]
  ------------------
 2061|      1|        error = "Can only have rawtr at top level";
 2062|      1|        return {};
 2063|      1|    }
 2064|  7.99k|    if (ctx == ParseScriptContext::TOP && Func("raw", expr)) {
  ------------------
  |  Branch (2064:9): [True: 4.22k, False: 3.77k]
  |  Branch (2064:9): [True: 527, False: 7.47k]
  |  Branch (2064:43): [True: 527, False: 3.69k]
  ------------------
 2065|    527|        std::string str(expr.begin(), expr.end());
 2066|    527|        if (!IsHex(str)) {
  ------------------
  |  Branch (2066:13): [True: 14, False: 513]
  ------------------
 2067|     14|            error = "Raw script is not hex";
 2068|     14|            return {};
 2069|     14|        }
 2070|    513|        auto bytes = ParseHex(str);
 2071|    513|        ret.emplace_back(std::make_unique<RawDescriptor>(CScript(bytes.begin(), bytes.end())));
 2072|    513|        return ret;
 2073|  7.47k|    } else if (Func("raw", expr)) {
  ------------------
  |  Branch (2073:16): [True: 1, False: 7.46k]
  ------------------
 2074|      1|        error = "Can only have raw() at top level";
 2075|      1|        return {};
 2076|      1|    }
 2077|       |    // Process miniscript expressions.
 2078|  7.46k|    {
 2079|  7.46k|        const auto script_ctx{ctx == ParseScriptContext::P2WSH ? miniscript::MiniscriptContext::P2WSH : miniscript::MiniscriptContext::TAPSCRIPT};
  ------------------
  |  Branch (2079:31): [True: 1.60k, False: 5.86k]
  ------------------
 2080|  7.46k|        KeyParser parser(/*out = */&out, /* in = */nullptr, /* ctx = */script_ctx, key_exp_index);
 2081|  7.46k|        auto node = miniscript::FromString(std::string(expr.begin(), expr.end()), parser);
 2082|  7.46k|        if (parser.m_key_parsing_error != "") {
  ------------------
  |  Branch (2082:13): [True: 194, False: 7.27k]
  ------------------
 2083|    194|            error = std::move(parser.m_key_parsing_error);
 2084|    194|            return {};
 2085|    194|        }
 2086|  7.27k|        if (node) {
  ------------------
  |  Branch (2086:13): [True: 4.68k, False: 2.59k]
  ------------------
 2087|  4.68k|            if (ctx != ParseScriptContext::P2WSH && ctx != ParseScriptContext::P2TR) {
  ------------------
  |  Branch (2087:17): [True: 3.47k, False: 1.21k]
  |  Branch (2087:53): [True: 1.46k, False: 2.01k]
  ------------------
 2088|  1.46k|                error = "Miniscript expressions can only be used in wsh or tr.";
 2089|  1.46k|                return {};
 2090|  1.46k|            }
 2091|  3.22k|            if (!node->IsSane() || node->IsNotSatisfiable()) {
  ------------------
  |  Branch (2091:17): [True: 573, False: 2.65k]
  |  Branch (2091:36): [True: 73, False: 2.57k]
  ------------------
 2092|       |                // Try to find the first insane sub for better error reporting.
 2093|    646|                auto insane_node = node.get();
 2094|    646|                if (const auto sub = node->FindInsaneSub()) insane_node = sub;
  ------------------
  |  Branch (2094:32): [True: 500, False: 146]
  ------------------
 2095|    646|                if (const auto str = insane_node->ToString(parser)) error = *str;
  ------------------
  |  Branch (2095:32): [True: 646, False: 0]
  ------------------
 2096|    646|                if (!insane_node->IsValid()) {
  ------------------
  |  Branch (2096:21): [True: 348, False: 298]
  ------------------
 2097|    348|                    error += " is invalid";
 2098|    348|                } else if (!node->IsSane()) {
  ------------------
  |  Branch (2098:28): [True: 225, False: 73]
  ------------------
 2099|    225|                    error += " is not sane";
 2100|    225|                    if (!insane_node->IsNonMalleable()) {
  ------------------
  |  Branch (2100:25): [True: 34, False: 191]
  ------------------
 2101|     34|                        error += ": malleable witnesses exist";
 2102|    191|                    } else if (insane_node == node.get() && !insane_node->NeedsSignature()) {
  ------------------
  |  Branch (2102:32): [True: 78, False: 113]
  |  Branch (2102:61): [True: 60, False: 18]
  ------------------
 2103|     60|                        error += ": witnesses without signature exist";
 2104|    131|                    } else if (!insane_node->CheckTimeLocksMix()) {
  ------------------
  |  Branch (2104:32): [True: 4, False: 127]
  ------------------
 2105|      4|                        error += ": contains mixes of timelocks expressed in blocks and seconds";
 2106|    127|                    } else if (!insane_node->CheckDuplicateKey()) {
  ------------------
  |  Branch (2106:32): [True: 102, False: 25]
  ------------------
 2107|    102|                        error += ": contains duplicate public keys";
 2108|    102|                    } else if (!insane_node->ValidSatisfactions()) {
  ------------------
  |  Branch (2108:32): [True: 8, False: 17]
  ------------------
 2109|      8|                        error += ": needs witnesses that may exceed resource limits";
 2110|      8|                    }
 2111|    225|                } else {
 2112|     73|                    error += " is not satisfiable";
 2113|     73|                }
 2114|    646|                return {};
 2115|    646|            }
 2116|       |            // A signature check is required for a miniscript to be sane. Therefore no sane miniscript
 2117|       |            // may have an empty list of public keys.
 2118|  2.57k|            CHECK_NONFATAL(!parser.m_keys.empty());
  ------------------
  |  |   82|  2.57k|    inline_check_non_fatal(condition, __FILE__, __LINE__, __func__, #condition)
  ------------------
 2119|  2.57k|            key_exp_index += parser.m_keys.size();
 2120|       |            // Make sure all vecs are of the same length, or exactly length 1
 2121|       |            // For length 1 vectors, clone subdescs until vector is the same length
 2122|  2.57k|            size_t num_multipath = std::max_element(parser.m_keys.begin(), parser.m_keys.end(),
 2123|  2.57k|                    [](const std::vector<std::unique_ptr<PubkeyProvider>>& a, const std::vector<std::unique_ptr<PubkeyProvider>>& b) {
 2124|  2.57k|                        return a.size() < b.size();
 2125|  2.57k|                    })->size();
 2126|       |
 2127|  4.15k|            for (auto& vec : parser.m_keys) {
  ------------------
  |  Branch (2127:28): [True: 4.15k, False: 2.57k]
  ------------------
 2128|  4.15k|                if (vec.size() == 1) {
  ------------------
  |  Branch (2128:21): [True: 4.15k, False: 0]
  ------------------
 2129|  4.15k|                    for (size_t i = 1; i < num_multipath; ++i) {
  ------------------
  |  Branch (2129:40): [True: 0, False: 4.15k]
  ------------------
 2130|      0|                        vec.emplace_back(vec.at(0)->Clone());
 2131|      0|                    }
 2132|  4.15k|                } else if (vec.size() != num_multipath) {
  ------------------
  |  Branch (2132:28): [True: 0, False: 0]
  ------------------
 2133|      0|                    error = strprintf("Miniscript: Multipath derivation paths have mismatched lengths");
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
 2134|      0|                    return {};
 2135|      0|                }
 2136|  4.15k|            }
 2137|       |
 2138|       |            // Build the final descriptors vector
 2139|  5.15k|            for (size_t i = 0; i < num_multipath; ++i) {
  ------------------
  |  Branch (2139:32): [True: 2.57k, False: 2.57k]
  ------------------
 2140|       |                // Build final pubkeys vectors by retrieving the i'th subscript for each vector in subscripts
 2141|  2.57k|                std::vector<std::unique_ptr<PubkeyProvider>> pubs;
 2142|  2.57k|                pubs.reserve(parser.m_keys.size());
 2143|  4.15k|                for (auto& pub : parser.m_keys) {
  ------------------
  |  Branch (2143:32): [True: 4.15k, False: 2.57k]
  ------------------
 2144|  4.15k|                    pubs.emplace_back(std::move(pub.at(i)));
 2145|  4.15k|                }
 2146|  2.57k|                ret.emplace_back(std::make_unique<MiniscriptDescriptor>(std::move(pubs), node->Clone()));
 2147|  2.57k|            }
 2148|  2.57k|            return ret;
 2149|  2.57k|        }
 2150|  7.27k|    }
 2151|  2.59k|    if (ctx == ParseScriptContext::P2SH) {
  ------------------
  |  Branch (2151:9): [True: 22, False: 2.56k]
  ------------------
 2152|     22|        error = "A function is needed within P2SH";
 2153|     22|        return {};
 2154|  2.56k|    } else if (ctx == ParseScriptContext::P2WSH) {
  ------------------
  |  Branch (2154:16): [True: 329, False: 2.23k]
  ------------------
 2155|    329|        error = "A function is needed within P2WSH";
 2156|    329|        return {};
 2157|    329|    }
 2158|  2.23k|    error = strprintf("'%s' is not a valid descriptor function", std::string(expr.begin(), expr.end()));
  ------------------
  |  | 1172|  2.23k|#define strprintf tfm::format
  ------------------
 2159|  2.23k|    return {};
 2160|  2.59k|}
descriptor.cpp:_ZN12_GLOBAL__N_111ParsePubkeyEjRK4SpanIKcENS_18ParseScriptContextER19FlatSigningProviderRNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEE:
 1582|   164k|{
 1583|   164k|    std::vector<std::unique_ptr<PubkeyProvider>> ret;
 1584|   164k|    auto origin_split = Split(sp, ']');
 1585|   164k|    if (origin_split.size() > 2) {
  ------------------
  |  Branch (1585:9): [True: 11, False: 164k]
  ------------------
 1586|     11|        error = "Multiple ']' characters found for a single pubkey";
 1587|     11|        return {};
 1588|     11|    }
 1589|       |    // This is set if either the origin or path suffix contains a hardened derivation.
 1590|   164k|    bool apostrophe = false;
 1591|   164k|    if (origin_split.size() == 1) {
  ------------------
  |  Branch (1591:9): [True: 34.5k, False: 130k]
  ------------------
 1592|  34.5k|        return ParsePubkeyInner(key_exp_index, origin_split[0], ctx, out, apostrophe, error);
 1593|  34.5k|    }
 1594|   130k|    if (origin_split[0].empty() || origin_split[0][0] != '[') {
  ------------------
  |  Branch (1594:9): [True: 8, False: 130k]
  |  Branch (1594:36): [True: 19, False: 130k]
  ------------------
 1595|     27|        error = strprintf("Key origin start '[ character expected but not found, got '%c' instead",
  ------------------
  |  | 1172|     27|#define strprintf tfm::format
  ------------------
 1596|     27|                          origin_split[0].empty() ? /** empty, implies split char */ ']' : origin_split[0][0]);
  ------------------
  |  Branch (1596:27): [True: 8, False: 19]
  ------------------
 1597|     27|        return {};
 1598|     27|    }
 1599|   130k|    auto slash_split = Split(origin_split[0].subspan(1), '/');
 1600|   130k|    if (slash_split[0].size() != 8) {
  ------------------
  |  Branch (1600:9): [True: 22, False: 130k]
  ------------------
 1601|     22|        error = strprintf("Fingerprint is not 4 bytes (%u characters instead of 8 characters)", slash_split[0].size());
  ------------------
  |  | 1172|     22|#define strprintf tfm::format
  ------------------
 1602|     22|        return {};
 1603|     22|    }
 1604|   130k|    std::string fpr_hex = std::string(slash_split[0].begin(), slash_split[0].end());
 1605|   130k|    if (!IsHex(fpr_hex)) {
  ------------------
  |  Branch (1605:9): [True: 2, False: 130k]
  ------------------
 1606|      2|        error = strprintf("Fingerprint '%s' is not hex", fpr_hex);
  ------------------
  |  | 1172|      2|#define strprintf tfm::format
  ------------------
 1607|      2|        return {};
 1608|      2|    }
 1609|   130k|    auto fpr_bytes = ParseHex(fpr_hex);
 1610|   130k|    KeyOriginInfo info;
 1611|   130k|    static_assert(sizeof(info.fingerprint) == 4, "Fingerprint must be 4 bytes");
 1612|   130k|    assert(fpr_bytes.size() == 4);
 1613|   130k|    std::copy(fpr_bytes.begin(), fpr_bytes.end(), info.fingerprint);
 1614|   130k|    std::vector<KeyPath> path;
 1615|   130k|    if (!ParseKeyPath(slash_split, path, apostrophe, error, /*allow_multipath=*/false)) return {};
  ------------------
  |  Branch (1615:9): [True: 128, False: 130k]
  ------------------
 1616|   130k|    info.path = path.at(0);
 1617|   130k|    auto providers = ParsePubkeyInner(key_exp_index, origin_split[1], ctx, out, apostrophe, error);
 1618|   130k|    if (providers.empty()) return {};
  ------------------
  |  Branch (1618:9): [True: 85, False: 129k]
  ------------------
 1619|   129k|    ret.reserve(providers.size());
 1620|   129k|    for (auto& prov : providers) {
  ------------------
  |  Branch (1620:21): [True: 129k, False: 129k]
  ------------------
 1621|   129k|        ret.emplace_back(std::make_unique<OriginPubkeyProvider>(key_exp_index, info, std::move(prov), apostrophe));
 1622|   129k|    }
 1623|   129k|    return ret;
 1624|   130k|}
descriptor.cpp:_ZN12_GLOBAL__N_116ParsePubkeyInnerEjRK4SpanIKcENS_18ParseScriptContextER19FlatSigningProviderRbRNSt3__112basic_stringIcNS9_11char_traitsIcEENS9_9allocatorIcEEEE:
 1503|   164k|{
 1504|   164k|    std::vector<std::unique_ptr<PubkeyProvider>> ret;
 1505|   164k|    bool permit_uncompressed = ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH;
  ------------------
  |  Branch (1505:32): [True: 1.91k, False: 162k]
  |  Branch (1505:66): [True: 4.48k, False: 158k]
  ------------------
 1506|   164k|    auto split = Split(sp, '/');
 1507|   164k|    std::string str(split[0].begin(), split[0].end());
 1508|   164k|    if (str.size() == 0) {
  ------------------
  |  Branch (1508:9): [True: 32, False: 164k]
  ------------------
 1509|     32|        error = "No key provided";
 1510|     32|        return {};
 1511|     32|    }
 1512|   164k|    if (split.size() == 1) {
  ------------------
  |  Branch (1512:9): [True: 34.8k, False: 129k]
  ------------------
 1513|  34.8k|        if (IsHex(str)) {
  ------------------
  |  Branch (1513:13): [True: 32.7k, False: 2.10k]
  ------------------
 1514|  32.7k|            std::vector<unsigned char> data = ParseHex(str);
 1515|  32.7k|            CPubKey pubkey(data);
 1516|  32.7k|            if (pubkey.IsValid() && !pubkey.IsValidNonHybrid()) {
  ------------------
  |  Branch (1516:17): [True: 7.66k, False: 25.0k]
  |  Branch (1516:37): [True: 2, False: 7.65k]
  ------------------
 1517|      2|                error = "Hybrid public keys are not allowed";
 1518|      2|                return {};
 1519|      2|            }
 1520|  32.7k|            if (pubkey.IsFullyValid()) {
  ------------------
  |  Branch (1520:17): [True: 7.47k, False: 25.2k]
  ------------------
 1521|  7.47k|                if (permit_uncompressed || pubkey.IsCompressed()) {
  ------------------
  |  Branch (1521:21): [True: 1.10k, False: 6.37k]
  |  Branch (1521:44): [True: 6.37k, False: 0]
  ------------------
 1522|  7.47k|                    ret.emplace_back(std::make_unique<ConstPubkeyProvider>(key_exp_index, pubkey, false));
 1523|  7.47k|                    return ret;
 1524|  7.47k|                } else {
 1525|      0|                    error = "Uncompressed keys are not allowed";
 1526|      0|                    return {};
 1527|      0|                }
 1528|  25.2k|            } else if (data.size() == 32 && ctx == ParseScriptContext::P2TR) {
  ------------------
  |  Branch (1528:24): [True: 24.9k, False: 307]
  |  Branch (1528:45): [True: 24.9k, False: 1]
  ------------------
 1529|  24.9k|                unsigned char fullkey[33] = {0x02};
 1530|  24.9k|                std::copy(data.begin(), data.end(), fullkey + 1);
 1531|  24.9k|                pubkey.Set(std::begin(fullkey), std::end(fullkey));
 1532|  24.9k|                if (pubkey.IsFullyValid()) {
  ------------------
  |  Branch (1532:21): [True: 24.8k, False: 75]
  ------------------
 1533|  24.8k|                    ret.emplace_back(std::make_unique<ConstPubkeyProvider>(key_exp_index, pubkey, true));
 1534|  24.8k|                    return ret;
 1535|  24.8k|                }
 1536|  24.9k|            }
 1537|    383|            error = strprintf("Pubkey '%s' is invalid", str);
  ------------------
  |  | 1172|    383|#define strprintf tfm::format
  ------------------
 1538|    383|            return {};
 1539|  32.7k|        }
 1540|  2.10k|        CKey key = DecodeSecret(str);
 1541|  2.10k|        if (key.IsValid()) {
  ------------------
  |  Branch (1541:13): [True: 112, False: 1.99k]
  ------------------
 1542|    112|            if (permit_uncompressed || key.IsCompressed()) {
  ------------------
  |  Branch (1542:17): [True: 4, False: 108]
  |  Branch (1542:40): [True: 108, False: 0]
  ------------------
 1543|    112|                CPubKey pubkey = key.GetPubKey();
 1544|    112|                out.keys.emplace(pubkey.GetID(), key);
 1545|    112|                ret.emplace_back(std::make_unique<ConstPubkeyProvider>(key_exp_index, pubkey, ctx == ParseScriptContext::P2TR));
 1546|    112|                return ret;
 1547|    112|            } else {
 1548|      0|                error = "Uncompressed keys are not allowed";
 1549|      0|                return {};
 1550|      0|            }
 1551|    112|        }
 1552|  2.10k|    }
 1553|   131k|    CExtKey extkey = DecodeExtKey(str);
 1554|   131k|    CExtPubKey extpubkey = DecodeExtPubKey(str);
 1555|   131k|    if (!extkey.key.IsValid() && !extpubkey.pubkey.IsValid()) {
  ------------------
  |  Branch (1555:9): [True: 340, False: 131k]
  |  Branch (1555:34): [True: 340, False: 0]
  ------------------
 1556|    340|        error = strprintf("key '%s' is not valid", str);
  ------------------
  |  | 1172|    340|#define strprintf tfm::format
  ------------------
 1557|    340|        return {};
 1558|    340|    }
 1559|   131k|    std::vector<KeyPath> paths;
 1560|   131k|    DeriveType type = DeriveType::NO;
 1561|   131k|    if (std::ranges::equal(split.back(), Span{"*"}.first(1))) {
  ------------------
  |  Branch (1561:9): [True: 222, False: 131k]
  ------------------
 1562|    222|        split.pop_back();
 1563|    222|        type = DeriveType::UNHARDENED;
 1564|   131k|    } else if (std::ranges::equal(split.back(), Span{"*'"}.first(2)) || std::ranges::equal(split.back(), Span{"*h"}.first(2))) {
  ------------------
  |  Branch (1564:16): [True: 388, False: 130k]
  |  Branch (1564:16): [True: 704, False: 130k]
  |  Branch (1564:73): [True: 316, False: 130k]
  ------------------
 1565|    704|        apostrophe = std::ranges::equal(split.back(), Span{"*'"}.first(2));
 1566|    704|        split.pop_back();
 1567|    704|        type = DeriveType::HARDENED;
 1568|    704|    }
 1569|   131k|    if (!ParseKeyPath(split, paths, apostrophe, error, /*allow_multipath=*/true)) return {};
  ------------------
  |  Branch (1569:9): [True: 80, False: 131k]
  ------------------
 1570|   131k|    if (extkey.key.IsValid()) {
  ------------------
  |  Branch (1570:9): [True: 131k, False: 0]
  ------------------
 1571|   131k|        extpubkey = extkey.Neuter();
 1572|   131k|        out.keys.emplace(extpubkey.pubkey.GetID(), extkey.key);
 1573|   131k|    }
 1574|   131k|    for (auto& path : paths) {
  ------------------
  |  Branch (1574:21): [True: 131k, False: 131k]
  ------------------
 1575|   131k|        ret.emplace_back(std::make_unique<BIP32PubkeyProvider>(key_exp_index, extpubkey, std::move(path), type, apostrophe));
 1576|   131k|    }
 1577|   131k|    return ret;
 1578|   131k|}
descriptor.cpp:_ZN12_GLOBAL__N_119ConstPubkeyProviderC2EjRK7CPubKeyb:
  300|   177k|    ConstPubkeyProvider(uint32_t exp_index, const CPubKey& pubkey, bool xonly) : PubkeyProvider(exp_index), m_pubkey(pubkey), m_xonly(xonly) {}
descriptor.cpp:_ZN12_GLOBAL__N_114PubkeyProviderC2Ej:
  169|   584k|    explicit PubkeyProvider(uint32_t exp_index) : m_expr_index(exp_index) {}
descriptor.cpp:_ZN12_GLOBAL__N_114PubkeyProviderD2Ev:
  171|   584k|    virtual ~PubkeyProvider() = default;
descriptor.cpp:_ZNK12_GLOBAL__N_119ConstPubkeyProvider9GetPubKeyEiRK15SigningProviderR7CPubKeyR13KeyOriginInfoPK15DescriptorCachePS8_:
  302|  98.8k|    {
  303|  98.8k|        key = m_pubkey;
  304|  98.8k|        info.path.clear();
  305|  98.8k|        CKeyID keyid = m_pubkey.GetID();
  306|  98.8k|        std::copy(keyid.begin(), keyid.begin() + sizeof(info.fingerprint), info.fingerprint);
  307|  98.8k|        return true;
  308|  98.8k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119ConstPubkeyProvider7IsRangeEv:
  309|  39.8k|    bool IsRange() const override { return false; }
descriptor.cpp:_ZNK12_GLOBAL__N_119ConstPubkeyProvider7GetSizeEv:
  310|  20.8k|    size_t GetSize() const override { return m_pubkey.size(); }
descriptor.cpp:_ZNK12_GLOBAL__N_119ConstPubkeyProvider8ToStringENS_14PubkeyProvider10StringTypeE:
  311|  43.5k|    std::string ToString(StringType type) const override { return m_xonly ? HexStr(m_pubkey).substr(2) : HexStr(m_pubkey); }
  ------------------
  |  Branch (311:67): [True: 35.8k, False: 7.68k]
  ------------------
descriptor.cpp:_ZNK12_GLOBAL__N_119ConstPubkeyProvider15ToPrivateStringERK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  313|  2.16k|    {
  314|  2.16k|        CKey key;
  315|  2.16k|        if (!GetPrivKey(/*pos=*/0, arg, key)) return false;
  ------------------
  |  Branch (315:13): [True: 2.15k, False: 5]
  ------------------
  316|      5|        ret = EncodeSecret(key);
  317|      5|        return true;
  318|  2.16k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119ConstPubkeyProvider18ToNormalizedStringERK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEPK15DescriptorCache:
  320|  17.7k|    {
  321|  17.7k|        ret = ToString(StringType::PUBLIC);
  322|  17.7k|        return true;
  323|  17.7k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119ConstPubkeyProvider10GetPrivKeyEiRK15SigningProviderR4CKey:
  325|  22.1k|    {
  326|  22.1k|        return m_xonly ? arg.GetKeyByXOnly(XOnlyPubKey(m_pubkey), key) :
  ------------------
  |  Branch (326:16): [True: 18.5k, False: 3.58k]
  ------------------
  327|  22.1k|                         arg.GetKey(m_pubkey.GetID(), key);
  328|  22.1k|    }
descriptor.cpp:_ZN12_GLOBAL__N_119BIP32PubkeyProviderC2EjRK10CExtPubKeyNSt3__16vectorIjNS4_9allocatorIjEEEENS_10DeriveTypeEb:
  394|   131k|    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_119BIP32PubkeyProvider9GetPubKeyEiRK15SigningProviderR7CPubKeyR13KeyOriginInfoPK15DescriptorCachePS8_:
  398|   271k|    {
  399|       |        // Info of parent of the to be derived pubkey
  400|   271k|        KeyOriginInfo parent_info;
  401|   271k|        CKeyID keyid = m_root_extkey.pubkey.GetID();
  402|   271k|        std::copy(keyid.begin(), keyid.begin() + sizeof(parent_info.fingerprint), parent_info.fingerprint);
  403|   271k|        parent_info.path = m_path;
  404|       |
  405|       |        // Info of the derived key itself which is copied out upon successful completion
  406|   271k|        KeyOriginInfo final_info_out_tmp = parent_info;
  407|   271k|        if (m_derive == DeriveType::UNHARDENED) final_info_out_tmp.path.push_back((uint32_t)pos);
  ------------------
  |  Branch (407:13): [True: 933, False: 270k]
  ------------------
  408|   271k|        if (m_derive == DeriveType::HARDENED) final_info_out_tmp.path.push_back(((uint32_t)pos) | 0x80000000L);
  ------------------
  |  Branch (408:13): [True: 1.08k, False: 270k]
  ------------------
  409|       |
  410|       |        // Derive keys or fetch them from cache
  411|   271k|        CExtPubKey final_extkey = m_root_extkey;
  412|   271k|        CExtPubKey parent_extkey = m_root_extkey;
  413|   271k|        CExtPubKey last_hardened_extkey;
  414|   271k|        bool der = true;
  415|   271k|        if (read_cache) {
  ------------------
  |  Branch (415:13): [True: 125k, False: 145k]
  ------------------
  416|   125k|            if (!read_cache->GetCachedDerivedExtPubKey(m_expr_index, pos, final_extkey)) {
  ------------------
  |  Branch (416:17): [True: 125k, False: 356]
  ------------------
  417|   125k|                if (m_derive == DeriveType::HARDENED) return false;
  ------------------
  |  Branch (417:21): [True: 0, False: 125k]
  ------------------
  418|       |                // Try to get the derivation parent
  419|   125k|                if (!read_cache->GetCachedParentExtPubKey(m_expr_index, parent_extkey)) return false;
  ------------------
  |  Branch (419:21): [True: 0, False: 125k]
  ------------------
  420|   125k|                final_extkey = parent_extkey;
  421|   125k|                if (m_derive == DeriveType::UNHARDENED) der = parent_extkey.Derive(final_extkey, pos);
  ------------------
  |  Branch (421:21): [True: 76, False: 124k]
  ------------------
  422|   125k|            }
  423|   145k|        } else if (IsHardened()) {
  ------------------
  |  Branch (423:20): [True: 49.3k, False: 96.3k]
  ------------------
  424|  49.3k|            CExtKey xprv;
  425|  49.3k|            CExtKey lh_xprv;
  426|  49.3k|            if (!GetDerivedExtKey(arg, xprv, lh_xprv)) return false;
  ------------------
  |  Branch (426:17): [True: 3.08k, False: 46.2k]
  ------------------
  427|  46.2k|            parent_extkey = xprv.Neuter();
  428|  46.2k|            if (m_derive == DeriveType::UNHARDENED) der = xprv.Derive(xprv, pos);
  ------------------
  |  Branch (428:17): [True: 17, False: 46.2k]
  ------------------
  429|  46.2k|            if (m_derive == DeriveType::HARDENED) der = xprv.Derive(xprv, pos | 0x80000000UL);
  ------------------
  |  Branch (429:17): [True: 356, False: 45.8k]
  ------------------
  430|  46.2k|            final_extkey = xprv.Neuter();
  431|  46.2k|            if (lh_xprv.key.IsValid()) {
  ------------------
  |  Branch (431:17): [True: 45.8k, False: 356]
  ------------------
  432|  45.8k|                last_hardened_extkey = lh_xprv.Neuter();
  433|  45.8k|            }
  434|  96.3k|        } else {
  435|   153k|            for (auto entry : m_path) {
  ------------------
  |  Branch (435:29): [True: 153k, False: 96.3k]
  ------------------
  436|   153k|                if (!parent_extkey.Derive(parent_extkey, entry)) return false;
  ------------------
  |  Branch (436:21): [True: 0, False: 153k]
  ------------------
  437|   153k|            }
  438|  96.3k|            final_extkey = parent_extkey;
  439|  96.3k|            if (m_derive == DeriveType::UNHARDENED) der = parent_extkey.Derive(final_extkey, pos);
  ------------------
  |  Branch (439:17): [True: 838, False: 95.5k]
  ------------------
  440|  96.3k|            assert(m_derive != DeriveType::HARDENED);
  441|  96.3k|        }
  442|   268k|        if (!der) return false;
  ------------------
  |  Branch (442:13): [True: 0, False: 268k]
  ------------------
  443|       |
  444|   268k|        final_info_out = final_info_out_tmp;
  445|   268k|        key_out = final_extkey.pubkey;
  446|       |
  447|   268k|        if (write_cache) {
  ------------------
  |  Branch (447:13): [True: 125k, False: 142k]
  ------------------
  448|       |            // Only cache parent if there is any unhardened derivation
  449|   125k|            if (m_derive != DeriveType::HARDENED) {
  ------------------
  |  Branch (449:17): [True: 125k, False: 356]
  ------------------
  450|   125k|                write_cache->CacheParentExtPubKey(m_expr_index, parent_extkey);
  451|       |                // Cache last hardened xpub if we have it
  452|   125k|                if (last_hardened_extkey.pubkey.IsValid()) {
  ------------------
  |  Branch (452:21): [True: 45.8k, False: 79.1k]
  ------------------
  453|  45.8k|                    write_cache->CacheLastHardenedExtPubKey(m_expr_index, last_hardened_extkey);
  454|  45.8k|                }
  455|   125k|            } else if (final_info_out.path.size() > 0) {
  ------------------
  |  Branch (455:24): [True: 356, False: 0]
  ------------------
  456|    356|                write_cache->CacheDerivedExtPubKey(m_expr_index, pos, final_extkey);
  457|    356|            }
  458|   125k|        }
  459|       |
  460|   268k|        return true;
  461|   268k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119BIP32PubkeyProvider10IsHardenedEv:
  385|   145k|    {
  386|   145k|        if (m_derive == DeriveType::HARDENED) return true;
  ------------------
  |  Branch (386:13): [True: 730, False: 144k]
  ------------------
  387|   245k|        for (auto entry : m_path) {
  ------------------
  |  Branch (387:25): [True: 245k, False: 96.3k]
  ------------------
  388|   245k|            if (entry >> 31) return true;
  ------------------
  |  Branch (388:17): [True: 48.5k, False: 197k]
  ------------------
  389|   245k|        }
  390|  96.3k|        return false;
  391|   144k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119BIP32PubkeyProvider16GetDerivedExtKeyERK15SigningProviderR7CExtKeyS5_:
  373|   220k|    {
  374|   220k|        if (!GetExtKey(arg, xprv)) return false;
  ------------------
  |  Branch (374:13): [True: 3.08k, False: 217k]
  ------------------
  375|   395k|        for (auto entry : m_path) {
  ------------------
  |  Branch (375:25): [True: 395k, False: 217k]
  ------------------
  376|   395k|            if (!xprv.Derive(xprv, entry)) return false;
  ------------------
  |  Branch (376:17): [True: 0, False: 395k]
  ------------------
  377|   395k|            if (entry >> 31) {
  ------------------
  |  Branch (377:17): [True: 137k, False: 257k]
  ------------------
  378|   137k|                last_hardened = xprv;
  379|   137k|            }
  380|   395k|        }
  381|   217k|        return true;
  382|   217k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119BIP32PubkeyProvider9GetExtKeyERK15SigningProviderR7CExtKey:
  360|   224k|    {
  361|   224k|        CKey key;
  362|   224k|        if (!arg.GetKey(m_root_extkey.pubkey.GetID(), key)) return false;
  ------------------
  |  Branch (362:13): [True: 3.08k, False: 221k]
  ------------------
  363|   221k|        ret.nDepth = m_root_extkey.nDepth;
  364|   221k|        std::copy(m_root_extkey.vchFingerprint, m_root_extkey.vchFingerprint + sizeof(ret.vchFingerprint), ret.vchFingerprint);
  365|   221k|        ret.nChild = m_root_extkey.nChild;
  366|   221k|        ret.chaincode = m_root_extkey.chaincode;
  367|   221k|        ret.key = key;
  368|   221k|        return true;
  369|   224k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119BIP32PubkeyProvider7IsRangeEv:
  395|   505k|    bool IsRange() const override { return m_derive != DeriveType::NO; }
descriptor.cpp:_ZNK12_GLOBAL__N_119BIP32PubkeyProvider7GetSizeEv:
  396|   134k|    size_t GetSize() const override { return 33; }
descriptor.cpp:_ZNK12_GLOBAL__N_119BIP32PubkeyProvider8ToStringENS_14PubkeyProvider10StringTypeE:
  474|   205k|    {
  475|   205k|        return ToString(type, /*normalized=*/false);
  476|   205k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119BIP32PubkeyProvider8ToStringENS_14PubkeyProvider10StringTypeEb:
  463|   206k|    {
  464|       |        // If StringType==COMPAT, always use the apostrophe to stay compatible with previous versions
  465|   206k|        const bool use_apostrophe = (!normalized && m_apostrophe) || type == StringType::COMPAT;
  ------------------
  |  Branch (465:38): [True: 205k, False: 351]
  |  Branch (465:53): [True: 46.4k, False: 159k]
  |  Branch (465:70): [True: 0, False: 159k]
  ------------------
  466|   206k|        std::string ret = EncodeExtPubKey(m_root_extkey) + FormatHDKeypath(m_path, /*apostrophe=*/use_apostrophe);
  467|   206k|        if (IsRange()) {
  ------------------
  |  Branch (467:13): [True: 932, False: 205k]
  ------------------
  468|    932|            ret += "/*";
  469|    932|            if (m_derive == DeriveType::HARDENED) ret += use_apostrophe ? '\'' : 'h';
  ------------------
  |  Branch (469:17): [True: 740, False: 192]
  |  Branch (469:58): [True: 338, False: 402]
  ------------------
  470|    932|        }
  471|   206k|        return ret;
  472|   206k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119BIP32PubkeyProvider15ToPrivateStringERK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  478|  3.97k|    {
  479|  3.97k|        CExtKey key;
  480|  3.97k|        if (!GetExtKey(arg, key)) return false;
  ------------------
  |  Branch (480:13): [True: 0, False: 3.97k]
  ------------------
  481|  3.97k|        out = EncodeExtKey(key) + FormatHDKeypath(m_path, /*apostrophe=*/m_apostrophe);
  482|  3.97k|        if (IsRange()) {
  ------------------
  |  Branch (482:13): [True: 432, False: 3.53k]
  ------------------
  483|    432|            out += "/*";
  484|    432|            if (m_derive == DeriveType::HARDENED) out += m_apostrophe ? '\'' : 'h';
  ------------------
  |  Branch (484:17): [True: 356, False: 76]
  |  Branch (484:58): [True: 325, False: 31]
  ------------------
  485|    432|        }
  486|  3.97k|        return true;
  487|  3.97k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119BIP32PubkeyProvider18ToNormalizedStringERK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEPK15DescriptorCache:
  489|   124k|    {
  490|   124k|        if (m_derive == DeriveType::HARDENED) {
  ------------------
  |  Branch (490:13): [True: 351, False: 124k]
  ------------------
  491|    351|            out = ToString(StringType::PUBLIC, /*normalized=*/true);
  492|       |
  493|    351|            return true;
  494|    351|        }
  495|       |        // Step backwards to find the last hardened step in the path
  496|   124k|        int i = (int)m_path.size() - 1;
  497|   252k|        for (; i >= 0; --i) {
  ------------------
  |  Branch (497:16): [True: 173k, False: 78.6k]
  ------------------
  498|   173k|            if (m_path.at(i) >> 31) {
  ------------------
  |  Branch (498:17): [True: 45.8k, False: 128k]
  ------------------
  499|  45.8k|                break;
  500|  45.8k|            }
  501|   173k|        }
  502|       |        // Either no derivation or all unhardened derivation
  503|   124k|        if (i == -1) {
  ------------------
  |  Branch (503:13): [True: 78.6k, False: 45.8k]
  ------------------
  504|  78.6k|            out = ToString();
  505|  78.6k|            return true;
  506|  78.6k|        }
  507|       |        // Get the path to the last hardened stup
  508|  45.8k|        KeyOriginInfo origin;
  509|  45.8k|        int k = 0;
  510|   134k|        for (; k <= i; ++k) {
  ------------------
  |  Branch (510:16): [True: 88.2k, False: 45.8k]
  ------------------
  511|       |            // Add to the path
  512|  88.2k|            origin.path.push_back(m_path.at(k));
  513|  88.2k|        }
  514|       |        // Build the remaining path
  515|  45.8k|        KeyPath end_path;
  516|  46.5k|        for (; k < (int)m_path.size(); ++k) {
  ------------------
  |  Branch (516:16): [True: 710, False: 45.8k]
  ------------------
  517|    710|            end_path.push_back(m_path.at(k));
  518|    710|        }
  519|       |        // Get the fingerprint
  520|  45.8k|        CKeyID id = m_root_extkey.pubkey.GetID();
  521|  45.8k|        std::copy(id.begin(), id.begin() + 4, origin.fingerprint);
  522|       |
  523|  45.8k|        CExtPubKey xpub;
  524|  45.8k|        CExtKey lh_xprv;
  525|       |        // If we have the cache, just get the parent xpub
  526|  45.8k|        if (cache != nullptr) {
  ------------------
  |  Branch (526:13): [True: 0, False: 45.8k]
  ------------------
  527|      0|            cache->GetCachedLastHardenedExtPubKey(m_expr_index, xpub);
  528|      0|        }
  529|  45.8k|        if (!xpub.pubkey.IsValid()) {
  ------------------
  |  Branch (529:13): [True: 45.8k, False: 0]
  ------------------
  530|       |            // Cache miss, or nor cache, or need privkey
  531|  45.8k|            CExtKey xprv;
  532|  45.8k|            if (!GetDerivedExtKey(arg, xprv, lh_xprv)) return false;
  ------------------
  |  Branch (532:17): [True: 0, False: 45.8k]
  ------------------
  533|  45.8k|            xpub = lh_xprv.Neuter();
  534|  45.8k|        }
  535|  45.8k|        assert(xpub.pubkey.IsValid());
  536|       |
  537|       |        // Build the string
  538|  45.8k|        std::string origin_str = HexStr(origin.fingerprint) + FormatHDKeypath(origin.path);
  539|  45.8k|        out = "[" + origin_str + "]" + EncodeExtPubKey(xpub) + FormatHDKeypath(end_path);
  540|  45.8k|        if (IsRange()) {
  ------------------
  |  Branch (540:13): [True: 16, False: 45.8k]
  ------------------
  541|     16|            out += "/*";
  542|     16|            assert(m_derive == DeriveType::UNHARDENED);
  543|     16|        }
  544|  45.8k|        return true;
  545|  45.8k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119BIP32PubkeyProvider10GetPrivKeyEiRK15SigningProviderR4CKey:
  547|   125k|    {
  548|   125k|        CExtKey extkey;
  549|   125k|        CExtKey dummy;
  550|   125k|        if (!GetDerivedExtKey(arg, extkey, dummy)) return false;
  ------------------
  |  Branch (550:13): [True: 0, False: 125k]
  ------------------
  551|   125k|        if (m_derive == DeriveType::UNHARDENED && !extkey.Derive(extkey, pos)) return false;
  ------------------
  |  Branch (551:13): [True: 76, False: 125k]
  |  Branch (551:51): [True: 0, False: 76]
  ------------------
  552|   125k|        if (m_derive == DeriveType::HARDENED && !extkey.Derive(extkey, pos | 0x80000000UL)) return false;
  ------------------
  |  Branch (552:13): [True: 356, False: 125k]
  |  Branch (552:49): [True: 0, False: 356]
  ------------------
  553|   125k|        key = extkey.key;
  554|   125k|        return true;
  555|   125k|    }
descriptor.cpp:_ZN12_GLOBAL__N_112ParseKeyPathERKNSt3__16vectorI4SpanIKcENS0_9allocatorIS4_EEEERNS1_INS1_IjNS5_IjEEEENS5_ISB_EEEERbRNS0_12basic_stringIcNS0_11char_traitsIcEENS5_IcEEEEb:
 1441|   261k|{
 1442|   261k|    KeyPath path;
 1443|   261k|    std::optional<size_t> multipath_segment_index;
 1444|   261k|    std::vector<uint32_t> multipath_values;
 1445|   261k|    std::unordered_set<uint32_t> seen_multipath;
 1446|       |
 1447|   490k|    for (size_t i = 1; i < split.size(); ++i) {
  ------------------
  |  Branch (1447:24): [True: 229k, False: 261k]
  ------------------
 1448|   229k|        const Span<const char>& elem = split[i];
 1449|       |
 1450|       |        // Check if element contain multipath specifier
 1451|   229k|        if (!elem.empty() && elem.front() == '<' && elem.back() == '>') {
  ------------------
  |  Branch (1451:13): [True: 229k, False: 6]
  |  Branch (1451:30): [True: 62, False: 229k]
  |  Branch (1451:53): [True: 55, False: 7]
  ------------------
 1452|     55|            if (!allow_multipath) {
  ------------------
  |  Branch (1452:17): [True: 53, False: 2]
  ------------------
 1453|     53|                error = strprintf("Key path value '%s' specifies multipath in a section where multipath is not allowed", std::string(elem.begin(), elem.end()));
  ------------------
  |  | 1172|     53|#define strprintf tfm::format
  ------------------
 1454|     53|                return false;
 1455|     53|            }
 1456|      2|            if (multipath_segment_index) {
  ------------------
  |  Branch (1456:17): [True: 0, False: 2]
  ------------------
 1457|      0|                error = "Multiple multipath key path specifiers found";
 1458|      0|                return false;
 1459|      0|            }
 1460|       |
 1461|       |            // Parse each possible value
 1462|      2|            std::vector<Span<const char>> nums = Split(Span(elem.begin()+1, elem.end()-1), ";");
 1463|      2|            if (nums.size() < 2) {
  ------------------
  |  Branch (1463:17): [True: 1, False: 1]
  ------------------
 1464|      1|                error = "Multipath key path specifiers must have at least two items";
 1465|      1|                return false;
 1466|      1|            }
 1467|       |
 1468|      2|            for (const auto& num : nums) {
  ------------------
  |  Branch (1468:34): [True: 2, False: 0]
  ------------------
 1469|      2|                const auto& op_num = ParseKeyPathNum(num, apostrophe, error);
 1470|      2|                if (!op_num) return false;
  ------------------
  |  Branch (1470:21): [True: 1, False: 1]
  ------------------
 1471|      1|                auto [_, inserted] = seen_multipath.insert(*op_num);
 1472|      1|                if (!inserted) {
  ------------------
  |  Branch (1472:21): [True: 0, False: 1]
  ------------------
 1473|      0|                    error = strprintf("Duplicated key path value %u in multipath specifier", *op_num);
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
 1474|      0|                    return false;
 1475|      0|                }
 1476|      1|                multipath_values.emplace_back(*op_num);
 1477|      1|            }
 1478|       |
 1479|      0|            path.emplace_back(); // Placeholder for multipath segment
 1480|      0|            multipath_segment_index = path.size()-1;
 1481|   229k|        } else {
 1482|   229k|            const auto& op_num = ParseKeyPathNum(elem, apostrophe, error);
 1483|   229k|            if (!op_num) return false;
  ------------------
  |  Branch (1483:17): [True: 153, False: 229k]
  ------------------
 1484|   229k|            path.emplace_back(*op_num);
 1485|   229k|        }
 1486|   229k|    }
 1487|       |
 1488|   261k|    if (!multipath_segment_index) {
  ------------------
  |  Branch (1488:9): [True: 261k, False: 0]
  ------------------
 1489|   261k|        out.emplace_back(std::move(path));
 1490|   261k|    } else {
 1491|       |        // Replace the multipath placeholder with each value while generating paths
 1492|      0|        for (size_t i = 0; i < multipath_values.size(); i++) {
  ------------------
  |  Branch (1492:28): [True: 0, False: 0]
  ------------------
 1493|      0|            KeyPath branch_path = path;
 1494|      0|            branch_path[*multipath_segment_index] = multipath_values[i];
 1495|      0|            out.emplace_back(std::move(branch_path));
 1496|      0|        }
 1497|      0|    }
 1498|   261k|    return true;
 1499|   261k|}
descriptor.cpp:_ZN12_GLOBAL__N_115ParseKeyPathNumE4SpanIKcERbRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
 1408|   229k|{
 1409|   229k|    bool hardened = false;
 1410|   229k|    if (elem.size() > 0) {
  ------------------
  |  Branch (1410:9): [True: 229k, False: 6]
  ------------------
 1411|   229k|        const char last = elem[elem.size() - 1];
 1412|   229k|        if (last == '\'' || last == 'h') {
  ------------------
  |  Branch (1412:13): [True: 46.6k, False: 182k]
  |  Branch (1412:29): [True: 271, False: 182k]
  ------------------
 1413|  46.9k|            elem = elem.first(elem.size() - 1);
 1414|  46.9k|            hardened = true;
 1415|  46.9k|            apostrophe = last == '\'';
 1416|  46.9k|        }
 1417|   229k|    }
 1418|   229k|    uint32_t p;
 1419|   229k|    if (!ParseUInt32(std::string(elem.begin(), elem.end()), &p)) {
  ------------------
  |  Branch (1419:9): [True: 129, False: 229k]
  ------------------
 1420|    129|        error = strprintf("Key path value '%s' is not a valid uint32", std::string(elem.begin(), elem.end()));
  ------------------
  |  | 1172|    129|#define strprintf tfm::format
  ------------------
 1421|    129|        return std::nullopt;
 1422|   229k|    } else if (p > 0x7FFFFFFFUL) {
  ------------------
  |  Branch (1422:16): [True: 25, False: 229k]
  ------------------
 1423|     25|        error = strprintf("Key path value %u is out of range", p);
  ------------------
  |  | 1172|     25|#define strprintf tfm::format
  ------------------
 1424|     25|        return std::nullopt;
 1425|     25|    }
 1426|       |
 1427|   229k|    return std::make_optional<uint32_t>(p | (((uint32_t)hardened) << 31));
 1428|   229k|}
descriptor.cpp:_ZN12_GLOBAL__N_120OriginPubkeyProviderC2Ej13KeyOriginInfoNSt3__110unique_ptrINS_14PubkeyProviderENS2_14default_deleteIS4_EEEEb:
  242|   275k|    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_120OriginPubkeyProvider9GetPubKeyEiRK15SigningProviderR7CPubKeyR13KeyOriginInfoPK15DescriptorCachePS8_:
  244|   278k|    {
  245|   278k|        if (!m_provider->GetPubKey(pos, arg, key, info, read_cache, write_cache)) return false;
  ------------------
  |  Branch (245:13): [True: 2.48k, False: 275k]
  ------------------
  246|   275k|        std::copy(std::begin(m_origin.fingerprint), std::end(m_origin.fingerprint), info.fingerprint);
  247|   275k|        info.path.insert(info.path.begin(), m_origin.path.begin(), m_origin.path.end());
  248|   275k|        return true;
  249|   278k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_120OriginPubkeyProvider7IsRangeEv:
  250|   246k|    bool IsRange() const override { return m_provider->IsRange(); }
descriptor.cpp:_ZNK12_GLOBAL__N_120OriginPubkeyProvider7GetSizeEv:
  251|   128k|    size_t GetSize() const override { return m_provider->GetSize(); }
descriptor.cpp:_ZNK12_GLOBAL__N_120OriginPubkeyProvider8ToStringENS_14PubkeyProvider10StringTypeE:
  252|   124k|    std::string ToString(StringType type) const override { return "[" + OriginString(type) + "]" + m_provider->ToString(type); }
descriptor.cpp:_ZNK12_GLOBAL__N_120OriginPubkeyProvider12OriginStringENS_14PubkeyProvider10StringTypeEb:
  235|   249k|    {
  236|       |        // If StringType==COMPAT, always use the apostrophe to stay compatible with previous versions
  237|   249k|        bool use_apostrophe = (!normalized && m_apostrophe) || type == StringType::COMPAT;
  ------------------
  |  Branch (237:32): [True: 126k, False: 123k]
  |  Branch (237:47): [True: 46.8k, False: 79.3k]
  |  Branch (237:64): [True: 0, False: 202k]
  ------------------
  238|   249k|        return HexStr(m_origin.fingerprint) + FormatHDKeypath(m_origin.path, use_apostrophe);
  239|   249k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_120OriginPubkeyProvider15ToPrivateStringERK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  254|  2.02k|    {
  255|  2.02k|        std::string sub;
  256|  2.02k|        if (!m_provider->ToPrivateString(arg, sub)) return false;
  ------------------
  |  Branch (256:13): [True: 35, False: 1.99k]
  ------------------
  257|  1.99k|        ret = "[" + OriginString(StringType::PUBLIC) + "]" + std::move(sub);
  258|  1.99k|        return true;
  259|  2.02k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_120OriginPubkeyProvider18ToNormalizedStringERK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEPK15DescriptorCache:
  261|   123k|    {
  262|   123k|        std::string sub;
  263|   123k|        if (!m_provider->ToNormalizedString(arg, sub, cache)) return false;
  ------------------
  |  Branch (263:13): [True: 0, False: 123k]
  ------------------
  264|       |        // If m_provider is a BIP32PubkeyProvider, we may get a string formatted like a OriginPubkeyProvider
  265|       |        // In that case, we need to strip out the leading square bracket and fingerprint from the substring,
  266|       |        // and append that to our own origin string.
  267|   123k|        if (sub[0] == '[') {
  ------------------
  |  Branch (267:13): [True: 45.1k, False: 78.2k]
  ------------------
  268|  45.1k|            sub = sub.substr(9);
  269|  45.1k|            ret = "[" + OriginString(StringType::PUBLIC, /*normalized=*/true) + std::move(sub);
  270|  78.2k|        } else {
  271|  78.2k|            ret = "[" + OriginString(StringType::PUBLIC, /*normalized=*/true) + "]" + std::move(sub);
  272|  78.2k|        }
  273|   123k|        return true;
  274|   123k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_120OriginPubkeyProvider10GetPrivKeyEiRK15SigningProviderR4CKey:
  276|   123k|    {
  277|   123k|        return m_provider->GetPrivKey(pos, arg, key);
  278|   123k|    }
descriptor.cpp:_ZN12_GLOBAL__N_112PKDescriptorC2ENSt3__110unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS3_EEEEb:
  856|  3.77k|    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:
  601|  13.9k|    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:
  766|  1.03k|    std::optional<int64_t> MaxSatisfactionWeight(bool) const override { return {}; }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl20MaxSatisfactionElemsEv:
  768|    515|    std::optional<int64_t> MaxSatisfactionElems() const override { return {}; }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl7IsRangeEv:
  624|  17.0k|    {
  625|   289k|        for (const auto& pubkey : m_pubkey_args) {
  ------------------
  |  Branch (625:33): [True: 289k, False: 16.6k]
  ------------------
  626|   289k|            if (pubkey->IsRange()) return true;
  ------------------
  |  Branch (626:17): [True: 334, False: 289k]
  ------------------
  627|   289k|        }
  628|  16.6k|        for (const auto& arg : m_subdescriptor_args) {
  ------------------
  |  Branch (628:30): [True: 9.85k, False: 16.4k]
  ------------------
  629|  9.85k|            if (arg->IsRange()) return true;
  ------------------
  |  Branch (629:17): [True: 266, False: 9.59k]
  ------------------
  630|  9.85k|        }
  631|  16.4k|        return false;
  632|  16.6k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl10IsSolvableEv:
  615|  6.65k|    {
  616|  6.65k|        for (const auto& arg : m_subdescriptor_args) {
  ------------------
  |  Branch (616:30): [True: 4.92k, False: 6.65k]
  ------------------
  617|  4.92k|            if (!arg->IsSolvable()) return false;
  ------------------
  |  Branch (617:17): [True: 0, False: 4.92k]
  ------------------
  618|  4.92k|        }
  619|  6.65k|        return true;
  620|  6.65k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl8ToStringEb:
  680|  3.58k|    {
  681|  3.58k|        std::string ret;
  682|  3.58k|        ToStringHelper(nullptr, ret, compat_format ? StringType::COMPAT : StringType::PUBLIC);
  ------------------
  |  Branch (682:38): [True: 0, False: 3.58k]
  ------------------
  683|  3.58k|        return AddChecksum(ret);
  684|  3.58k|    }
descriptor.cpp:_ZN12_GLOBAL__N_111AddChecksumERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  152|  10.2k|std::string AddChecksum(const std::string& str) { return str + "#" + DescriptorChecksum(str); }
descriptor.cpp:_ZNK12_GLOBAL__N_112PKDescriptor12IsSingleTypeEv:
  857|    272|    bool IsSingleType() const final { return true; }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl15ToPrivateStringERK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  687|  3.07k|    {
  688|  3.07k|        bool ret = ToStringHelper(&arg, out, StringType::PRIVATE);
  689|  3.07k|        out = AddChecksum(out);
  690|  3.07k|        return ret;
  691|  3.07k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl18ToNormalizedStringERK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEPK15DescriptorCache:
  694|  3.58k|    {
  695|  3.58k|        bool ret = ToStringHelper(&arg, out, StringType::NORMALIZED, cache);
  696|  3.58k|        out = AddChecksum(out);
  697|  3.58k|        return ret;
  698|  3.58k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl6ExpandEiRK15SigningProviderRNSt3__16vectorI7CScriptNS4_9allocatorIS6_EEEER19FlatSigningProviderP15DescriptorCache:
  733|  3.58k|    {
  734|  3.58k|        return ExpandHelper(pos, provider, nullptr, output_scripts, out, write_cache);
  735|  3.58k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl12ExpandHelperEiRK15SigningProviderPK15DescriptorCacheRNSt3__16vectorI7CScriptNS7_9allocatorIS9_EEEER19FlatSigningProviderPS4_:
  702|  17.0k|    {
  703|  17.0k|        std::vector<std::pair<CPubKey, KeyOriginInfo>> entries;
  704|  17.0k|        entries.reserve(m_pubkey_args.size());
  705|       |
  706|       |        // Construct temporary data in `entries`, `subscripts`, and `subprovider` to avoid producing output in case of failure.
  707|   290k|        for (const auto& p : m_pubkey_args) {
  ------------------
  |  Branch (707:28): [True: 290k, False: 17.0k]
  ------------------
  708|   290k|            entries.emplace_back();
  709|   290k|            if (!p->GetPubKey(pos, arg, entries.back().first, entries.back().second, read_cache, write_cache)) return false;
  ------------------
  |  Branch (709:17): [True: 0, False: 290k]
  ------------------
  710|   290k|        }
  711|  17.0k|        std::vector<CScript> subscripts;
  712|  17.0k|        FlatSigningProvider subprovider;
  713|  17.0k|        for (const auto& subarg : m_subdescriptor_args) {
  ------------------
  |  Branch (713:33): [True: 9.85k, False: 17.0k]
  ------------------
  714|  9.85k|            std::vector<CScript> outscripts;
  715|  9.85k|            if (!subarg->ExpandHelper(pos, arg, read_cache, outscripts, subprovider, write_cache)) return false;
  ------------------
  |  Branch (715:17): [True: 0, False: 9.85k]
  ------------------
  716|  9.85k|            assert(outscripts.size() == 1);
  717|  9.85k|            subscripts.emplace_back(std::move(outscripts[0]));
  718|  9.85k|        }
  719|  17.0k|        out.Merge(std::move(subprovider));
  720|       |
  721|  17.0k|        std::vector<CPubKey> pubkeys;
  722|  17.0k|        pubkeys.reserve(entries.size());
  723|   290k|        for (auto& entry : entries) {
  ------------------
  |  Branch (723:26): [True: 290k, False: 17.0k]
  ------------------
  724|   290k|            pubkeys.push_back(entry.first);
  725|   290k|            out.origins.emplace(entry.first.GetID(), std::make_pair<CPubKey, KeyOriginInfo>(CPubKey(entry.first), std::move(entry.second)));
  726|   290k|        }
  727|       |
  728|  17.0k|        output_scripts = MakeScripts(pubkeys, Span{subscripts}, out);
  729|  17.0k|        return true;
  730|  17.0k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl15ExpandFromCacheEiRK15DescriptorCacheRNSt3__16vectorI7CScriptNS4_9allocatorIS6_EEEER19FlatSigningProvider:
  738|  3.58k|    {
  739|  3.58k|        return ExpandHelper(pos, DUMMY_SIGNING_PROVIDER, &read_cache, output_scripts, out, nullptr);
  740|  3.58k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl13ExpandPrivateEiRK15SigningProviderR19FlatSigningProvider:
  744|  8.51k|    {
  745|   145k|        for (const auto& p : m_pubkey_args) {
  ------------------
  |  Branch (745:28): [True: 145k, False: 8.51k]
  ------------------
  746|   145k|            CKey key;
  747|   145k|            if (!p->GetPrivKey(pos, provider, key)) continue;
  ------------------
  |  Branch (747:17): [True: 19.9k, False: 125k]
  ------------------
  748|   125k|            out.keys.emplace(key.GetPubKey().GetID(), key);
  749|   125k|        }
  750|  8.51k|        for (const auto& arg : m_subdescriptor_args) {
  ------------------
  |  Branch (750:30): [True: 4.92k, False: 8.51k]
  ------------------
  751|  4.92k|            arg->ExpandPrivate(pos, provider, out);
  752|  4.92k|        }
  753|  8.51k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl13GetOutputTypeEv:
  755|  2.69k|    std::optional<OutputType> GetOutputType() const override { return std::nullopt; }
descriptor.cpp:_ZNK12_GLOBAL__N_112PKDescriptor10ScriptSizeEv:
  859|    164|    std::optional<int64_t> ScriptSize() const override {
  860|    164|        return 1 + (m_xonly ? 32 : m_pubkey_args[0]->GetSize()) + 1;
  ------------------
  |  Branch (860:21): [True: 0, False: 164]
  ------------------
  861|    164|    }
descriptor.cpp:_ZNK12_GLOBAL__N_112PKDescriptor21MaxSatisfactionWeightEb:
  868|    272|    std::optional<int64_t> MaxSatisfactionWeight(bool use_max_sig) const override {
  869|    272|        return *MaxSatSize(use_max_sig) * WITNESS_SCALE_FACTOR;
  870|    272|    }
descriptor.cpp:_ZNK12_GLOBAL__N_112PKDescriptor20MaxSatisfactionElemsEv:
  872|    150|    std::optional<int64_t> MaxSatisfactionElems() const override { return 1; }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl13ToStringExtraEv:
  586|  11.4k|    virtual std::string ToStringExtra() const { return ""; }
descriptor.cpp:_ZNK12_GLOBAL__N_112PKDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
  847|  2.83k|    {
  848|  2.83k|        if (m_xonly) {
  ------------------
  |  Branch (848:13): [True: 2.53k, False: 300]
  ------------------
  849|  2.53k|            CScript script = CScript() << ToByteVector(XOnlyPubKey(keys[0])) << OP_CHECKSIG;
  850|  2.53k|            return Vector(std::move(script));
  851|  2.53k|        } else {
  852|    300|            return Vector(GetScriptForRawPubKey(keys[0]));
  853|    300|        }
  854|  2.83k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl23ToStringSubScriptHelperEPK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_10StringTypeEPK15DescriptorCache:
  636|  13.6k|    {
  637|  13.6k|        size_t pos = 0;
  638|  13.6k|        for (const auto& scriptarg : m_subdescriptor_args) {
  ------------------
  |  Branch (638:36): [True: 4.13k, False: 12.8k]
  ------------------
  639|  4.13k|            if (pos++) ret += ",";
  ------------------
  |  Branch (639:17): [True: 0, False: 4.13k]
  ------------------
  640|  4.13k|            std::string tmp;
  641|  4.13k|            if (!scriptarg->ToStringHelper(arg, tmp, type, cache)) return false;
  ------------------
  |  Branch (641:17): [True: 846, False: 3.28k]
  ------------------
  642|  3.28k|            ret += tmp;
  643|  3.28k|        }
  644|  12.8k|        return true;
  645|  13.6k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl14ToStringHelperEPK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_10StringTypeEPK15DescriptorCache:
  649|  18.1k|    {
  650|  18.1k|        std::string extra = ToStringExtra();
  651|  18.1k|        size_t pos = extra.size() > 0 ? 1 : 0;
  ------------------
  |  Branch (651:22): [True: 6.79k, False: 11.4k]
  ------------------
  652|  18.1k|        std::string ret = m_name + "(" + extra;
  653|   290k|        for (const auto& pubkey : m_pubkey_args) {
  ------------------
  |  Branch (653:33): [True: 290k, False: 16.5k]
  ------------------
  654|   290k|            if (pos++) ret += ",";
  ------------------
  |  Branch (654:17): [True: 283k, False: 7.26k]
  ------------------
  655|   290k|            std::string tmp;
  656|   290k|            switch (type) {
  ------------------
  |  Branch (656:21): [True: 0, False: 290k]
  ------------------
  657|   142k|                case StringType::NORMALIZED:
  ------------------
  |  Branch (657:17): [True: 142k, False: 147k]
  ------------------
  658|   142k|                    if (!pubkey->ToNormalizedString(*arg, tmp, cache)) return false;
  ------------------
  |  Branch (658:25): [True: 0, False: 142k]
  ------------------
  659|   142k|                    break;
  660|   142k|                case StringType::PRIVATE:
  ------------------
  |  Branch (660:17): [True: 5.07k, False: 285k]
  ------------------
  661|  5.07k|                    if (!pubkey->ToPrivateString(*arg, tmp)) return false;
  ------------------
  |  Branch (661:25): [True: 1.67k, False: 3.40k]
  ------------------
  662|  3.40k|                    break;
  663|   142k|                case StringType::PUBLIC:
  ------------------
  |  Branch (663:17): [True: 142k, False: 147k]
  ------------------
  664|   142k|                    tmp = pubkey->ToString();
  665|   142k|                    break;
  666|      0|                case StringType::COMPAT:
  ------------------
  |  Branch (666:17): [True: 0, False: 290k]
  ------------------
  667|      0|                    tmp = pubkey->ToString(PubkeyProvider::StringType::COMPAT);
  668|      0|                    break;
  669|   290k|            }
  670|   288k|            ret += tmp;
  671|   288k|        }
  672|  16.5k|        std::string subscript;
  673|  16.5k|        if (!ToStringSubScriptHelper(arg, subscript, type, cache)) return false;
  ------------------
  |  Branch (673:13): [True: 846, False: 15.6k]
  ------------------
  674|  15.6k|        if (pos && subscript.size()) ret += ',';
  ------------------
  |  Branch (674:13): [True: 12.3k, False: 3.28k]
  |  Branch (674:20): [True: 2.02k, False: 10.3k]
  ------------------
  675|  15.6k|        out = std::move(ret) + std::move(subscript) + ")";
  676|  15.6k|        return true;
  677|  16.5k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_112PKDescriptor10MaxSatSizeEb:
  863|    300|    std::optional<int64_t> MaxSatSize(bool use_max_sig) const override {
  864|    300|        const auto ecdsa_sig_size = use_max_sig ? 72 : 71;
  ------------------
  |  Branch (864:37): [True: 300, False: 0]
  ------------------
  865|    300|        return 1 + (m_xonly ? 65 : ecdsa_sig_size);
  ------------------
  |  Branch (865:21): [True: 0, False: 300]
  ------------------
  866|    300|    }
descriptor.cpp:_ZN12_GLOBAL__N_113PKHDescriptorC2ENSt3__110unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS3_EEEE:
  891|     15|    PKHDescriptor(std::unique_ptr<PubkeyProvider> prov) : DescriptorImpl(Vector(std::move(prov)), "pkh") {}
descriptor.cpp:_ZNK12_GLOBAL__N_113PKHDescriptor12IsSingleTypeEv:
  893|      6|    bool IsSingleType() const final { return true; }
descriptor.cpp:_ZNK12_GLOBAL__N_113PKHDescriptor13GetOutputTypeEv:
  892|     10|    std::optional<OutputType> GetOutputType() const override { return OutputType::LEGACY; }
descriptor.cpp:_ZNK12_GLOBAL__N_113PKHDescriptor10ScriptSizeEv:
  895|      9|    std::optional<int64_t> ScriptSize() const override { return 1 + 1 + 1 + 20 + 1 + 1; }
descriptor.cpp:_ZNK12_GLOBAL__N_113PKHDescriptor21MaxSatisfactionWeightEb:
  902|      6|    std::optional<int64_t> MaxSatisfactionWeight(bool use_max_sig) const override {
  903|      6|        return *MaxSatSize(use_max_sig) * WITNESS_SCALE_FACTOR;
  904|      6|    }
descriptor.cpp:_ZNK12_GLOBAL__N_113PKHDescriptor20MaxSatisfactionElemsEv:
  906|      6|    std::optional<int64_t> MaxSatisfactionElems() const override { return 2; }
descriptor.cpp:_ZNK12_GLOBAL__N_113PKHDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
  885|     12|    {
  886|     12|        CKeyID id = keys[0].GetID();
  887|     12|        out.pubkeys.emplace(id, keys[0]);
  888|     12|        return Vector(GetScriptForDestination(PKHash(id)));
  889|     12|    }
descriptor.cpp:_ZNK12_GLOBAL__N_113PKHDescriptor10MaxSatSizeEb:
  897|     12|    std::optional<int64_t> MaxSatSize(bool use_max_sig) const override {
  898|     12|        const auto sig_size = use_max_sig ? 72 : 71;
  ------------------
  |  Branch (898:31): [True: 12, False: 0]
  ------------------
  899|     12|        return 1 + sig_size + 1 + m_pubkey_args[0]->GetSize();
  900|     12|    }
descriptor.cpp:_ZN12_GLOBAL__N_115ComboDescriptorC2ENSt3__110unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS3_EEEE:
  968|      5|    ComboDescriptor(std::unique_ptr<PubkeyProvider> prov) : DescriptorImpl(Vector(std::move(prov)), "combo") {}
descriptor.cpp:_ZNK12_GLOBAL__N_115ComboDescriptor12IsSingleTypeEv:
  969|      8|    bool IsSingleType() const final { return false; }
descriptor.cpp:_ZNK12_GLOBAL__N_115ComboDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
  953|      8|    {
  954|      8|        std::vector<CScript> ret;
  955|      8|        CKeyID id = keys[0].GetID();
  956|      8|        out.pubkeys.emplace(id, keys[0]);
  957|      8|        ret.emplace_back(GetScriptForRawPubKey(keys[0])); // P2PK
  958|      8|        ret.emplace_back(GetScriptForDestination(PKHash(id))); // P2PKH
  959|      8|        if (keys[0].IsCompressed()) {
  ------------------
  |  Branch (959:13): [True: 8, False: 0]
  ------------------
  960|      8|            CScript p2wpkh = GetScriptForDestination(WitnessV0KeyHash(id));
  961|      8|            out.scripts.emplace(CScriptID(p2wpkh), p2wpkh);
  962|      8|            ret.emplace_back(p2wpkh);
  963|      8|            ret.emplace_back(GetScriptForDestination(ScriptHash(p2wpkh))); // P2SH-P2WPKH
  964|      8|        }
  965|      8|        return ret;
  966|      8|    }
descriptor.cpp:_ZN12_GLOBAL__N_118MultisigDescriptorC2EiNSt3__16vectorINS1_10unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS4_EEEENS1_9allocatorIS7_EEEEb:
  992|  1.80k|    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 (992:155): [True: 160, False: 1.64k]
  ------------------
descriptor.cpp:_ZNK12_GLOBAL__N_118MultisigDescriptor12IsSingleTypeEv:
  993|    556|    bool IsSingleType() const final { return true; }
descriptor.cpp:_ZNK12_GLOBAL__N_118MultisigDescriptor10ScriptSizeEv:
  995|  1.52k|    std::optional<int64_t> ScriptSize() const override {
  996|  1.52k|        const auto n_keys = m_pubkey_args.size();
  997|  1.52k|        auto op = [](int64_t acc, const std::unique_ptr<PubkeyProvider>& pk) { return acc + 1 + pk->GetSize();};
  998|  1.52k|        const auto pubkeys_size{std::accumulate(m_pubkey_args.begin(), m_pubkey_args.end(), int64_t{0}, op)};
  999|  1.52k|        return 1 + BuildScript(n_keys).size() + BuildScript(m_threshold).size() + pubkeys_size;
 1000|  1.52k|    }
descriptor.cpp:_ZZNK12_GLOBAL__N_118MultisigDescriptor10ScriptSizeEvENKUllRKNSt3__110unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS3_EEEEE_clElS8_:
  997|  9.39k|        auto op = [](int64_t acc, const std::unique_ptr<PubkeyProvider>& pk) { return acc + 1 + pk->GetSize();};
descriptor.cpp:_ZNK12_GLOBAL__N_118MultisigDescriptor21MaxSatisfactionWeightEb:
 1007|    556|    std::optional<int64_t> MaxSatisfactionWeight(bool use_max_sig) const override {
 1008|    556|        return *MaxSatSize(use_max_sig) * WITNESS_SCALE_FACTOR;
 1009|    556|    }
descriptor.cpp:_ZNK12_GLOBAL__N_118MultisigDescriptor20MaxSatisfactionElemsEv:
 1011|    901|    std::optional<int64_t> MaxSatisfactionElems() const override { return 1 + m_threshold; }
descriptor.cpp:_ZNK12_GLOBAL__N_118MultisigDescriptor13ToStringExtraEv:
  982|  2.70k|    std::string ToStringExtra() const override { return strprintf("%i", m_threshold); }
  ------------------
  |  | 1172|  2.70k|#define strprintf tfm::format
  ------------------
descriptor.cpp:_ZNK12_GLOBAL__N_118MultisigDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
  983|  1.80k|    std::vector<CScript> MakeScripts(const std::vector<CPubKey>& keys, Span<const CScript>, FlatSigningProvider&) const override {
  984|  1.80k|        if (m_sorted) {
  ------------------
  |  Branch (984:13): [True: 320, False: 1.48k]
  ------------------
  985|    320|            std::vector<CPubKey> sorted_keys(keys);
  986|    320|            std::sort(sorted_keys.begin(), sorted_keys.end());
  987|    320|            return Vector(GetScriptForMultisig(m_threshold, sorted_keys));
  988|    320|        }
  989|  1.48k|        return Vector(GetScriptForMultisig(m_threshold, keys));
  990|  1.80k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_118MultisigDescriptor10MaxSatSizeEb:
 1002|  1.80k|    std::optional<int64_t> MaxSatSize(bool use_max_sig) const override {
 1003|  1.80k|        const auto sig_size = use_max_sig ? 72 : 71;
  ------------------
  |  Branch (1003:31): [True: 1.80k, False: 0]
  ------------------
 1004|  1.80k|        return (1 + (1 + sig_size) * m_threshold);
 1005|  1.80k|    }
descriptor.cpp:_ZN12_GLOBAL__N_116MultiADescriptorC2EiNSt3__16vectorINS1_10unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS4_EEEENS1_9allocatorIS7_EEEEb:
 1043|  3.39k|    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 (1043:153): [True: 1.08k, False: 2.31k]
  ------------------
descriptor.cpp:_ZNK12_GLOBAL__N_116MultiADescriptor13ToStringExtraEv:
 1028|  3.06k|    std::string ToStringExtra() const override { return strprintf("%i", m_threshold); }
  ------------------
  |  | 1172|  3.06k|#define strprintf tfm::format
  ------------------
descriptor.cpp:_ZNK12_GLOBAL__N_116MultiADescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
 1029|  3.06k|    std::vector<CScript> MakeScripts(const std::vector<CPubKey>& keys, Span<const CScript>, FlatSigningProvider&) const override {
 1030|  3.06k|        CScript ret;
 1031|  3.06k|        std::vector<XOnlyPubKey> xkeys;
 1032|  3.06k|        xkeys.reserve(keys.size());
 1033|   269k|        for (const auto& key : keys) xkeys.emplace_back(key);
  ------------------
  |  Branch (1033:30): [True: 269k, False: 3.06k]
  ------------------
 1034|  3.06k|        if (m_sorted) std::sort(xkeys.begin(), xkeys.end());
  ------------------
  |  Branch (1034:13): [True: 1.92k, False: 1.14k]
  ------------------
 1035|  3.06k|        ret << ToByteVector(xkeys[0]) << OP_CHECKSIG;
 1036|   269k|        for (size_t i = 1; i < keys.size(); ++i) {
  ------------------
  |  Branch (1036:28): [True: 266k, False: 3.06k]
  ------------------
 1037|   266k|            ret << ToByteVector(xkeys[i]) << OP_CHECKSIGADD;
 1038|   266k|        }
 1039|  3.06k|        ret << m_threshold << OP_NUMEQUAL;
 1040|  3.06k|        return Vector(std::move(ret));
 1041|  3.06k|    }
descriptor.cpp:_ZN12_GLOBAL__N_114WPKHDescriptorC2ENSt3__110unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS3_EEEE:
  925|      8|    WPKHDescriptor(std::unique_ptr<PubkeyProvider> prov) : DescriptorImpl(Vector(std::move(prov)), "wpkh") {}
descriptor.cpp:_ZNK12_GLOBAL__N_114WPKHDescriptor12IsSingleTypeEv:
  927|      2|    bool IsSingleType() const final { return true; }
descriptor.cpp:_ZNK12_GLOBAL__N_114WPKHDescriptor13GetOutputTypeEv:
  926|      6|    std::optional<OutputType> GetOutputType() const override { return OutputType::BECH32; }
descriptor.cpp:_ZNK12_GLOBAL__N_114WPKHDescriptor10ScriptSizeEv:
  929|      3|    std::optional<int64_t> ScriptSize() const override { return 1 + 1 + 20; }
descriptor.cpp:_ZNK12_GLOBAL__N_114WPKHDescriptor21MaxSatisfactionWeightEb:
  936|      2|    std::optional<int64_t> MaxSatisfactionWeight(bool use_max_sig) const override {
  937|      2|        return MaxSatSize(use_max_sig);
  938|      2|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114WPKHDescriptor20MaxSatisfactionElemsEv:
  940|      2|    std::optional<int64_t> MaxSatisfactionElems() const override { return 2; }
descriptor.cpp:_ZNK12_GLOBAL__N_114WPKHDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
  919|      4|    {
  920|      4|        CKeyID id = keys[0].GetID();
  921|      4|        out.pubkeys.emplace(id, keys[0]);
  922|      4|        return Vector(GetScriptForDestination(WitnessV0KeyHash(id)));
  923|      4|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114WPKHDescriptor10MaxSatSizeEb:
  931|      4|    std::optional<int64_t> MaxSatSize(bool use_max_sig) const override {
  932|      4|        const auto sig_size = use_max_sig ? 72 : 71;
  ------------------
  |  Branch (932:31): [True: 4, False: 0]
  ------------------
  933|      4|        return (1 + sig_size + 1 + 33);
  934|      4|    }
descriptor.cpp:_ZN12_GLOBAL__N_112SHDescriptorC2ENSt3__110unique_ptrINS_14DescriptorImplENS1_14default_deleteIS3_EEEE:
 1082|  1.22k|    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:
  602|  2.77k|    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:
 1090|  1.21k|    bool IsSingleType() const final { return true; }
descriptor.cpp:_ZNK12_GLOBAL__N_112SHDescriptor13GetOutputTypeEv:
 1085|  1.21k|    {
 1086|  1.21k|        assert(m_subdescriptor_args.size() == 1);
 1087|  1.21k|        if (IsSegwit()) return OutputType::P2SH_SEGWIT;
  ------------------
  |  Branch (1087:13): [True: 286, False: 932]
  ------------------
 1088|    932|        return OutputType::LEGACY;
 1089|  1.21k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_112SHDescriptor8IsSegwitEv:
 1079|  2.43k|    bool IsSegwit() const { return m_subdescriptor_args[0]->GetOutputType() == OutputType::BECH32; }
descriptor.cpp:_ZNK12_GLOBAL__N_112SHDescriptor10ScriptSizeEv:
 1092|    609|    std::optional<int64_t> ScriptSize() const override { return 1 + 1 + 20 + 1; }
descriptor.cpp:_ZNK12_GLOBAL__N_112SHDescriptor21MaxSatisfactionWeightEb:
 1094|  1.21k|    std::optional<int64_t> MaxSatisfactionWeight(bool use_max_sig) const override {
 1095|  1.21k|        if (const auto sat_size = m_subdescriptor_args[0]->MaxSatSize(use_max_sig)) {
  ------------------
  |  Branch (1095:24): [True: 1.21k, False: 0]
  ------------------
 1096|  1.21k|            if (const auto subscript_size = m_subdescriptor_args[0]->ScriptSize()) {
  ------------------
  |  Branch (1096:28): [True: 1.21k, False: 0]
  ------------------
 1097|       |                // The subscript is never witness data.
 1098|  1.21k|                const auto subscript_weight = (1 + *subscript_size) * WITNESS_SCALE_FACTOR;
 1099|       |                // The weight depends on whether the inner descriptor is satisfied using the witness stack.
 1100|  1.21k|                if (IsSegwit()) return subscript_weight + *sat_size;
  ------------------
  |  Branch (1100:21): [True: 286, False: 932]
  ------------------
 1101|    932|                return subscript_weight + *sat_size * WITNESS_SCALE_FACTOR;
 1102|  1.21k|            }
 1103|  1.21k|        }
 1104|      0|        return {};
 1105|  1.21k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_112SHDescriptor20MaxSatisfactionElemsEv:
 1107|    609|    std::optional<int64_t> MaxSatisfactionElems() const override {
 1108|    609|        if (const auto sub_elems = m_subdescriptor_args[0]->MaxSatisfactionElems()) return 1 + *sub_elems;
  ------------------
  |  Branch (1108:24): [True: 609, False: 0]
  ------------------
 1109|      0|        return {};
 1110|    609|    }
descriptor.cpp:_ZNK12_GLOBAL__N_112SHDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
 1073|  1.21k|    {
 1074|  1.21k|        auto ret = Vector(GetScriptForDestination(ScriptHash(scripts[0])));
 1075|  1.21k|        if (ret.size()) out.scripts.emplace(CScriptID(scripts[0]), scripts[0]);
  ------------------
  |  Branch (1075:13): [True: 1.21k, False: 0]
  ------------------
 1076|  1.21k|        return ret;
 1077|  1.21k|    }
descriptor.cpp:_ZN12_GLOBAL__N_113WSHDescriptorC2ENSt3__110unique_ptrINS_14DescriptorImplENS1_14default_deleteIS3_EEEE:
 1129|  1.54k|    WSHDescriptor(std::unique_ptr<DescriptorImpl> desc) : DescriptorImpl({}, std::move(desc), "wsh") {}
descriptor.cpp:_ZNK12_GLOBAL__N_113WSHDescriptor12IsSingleTypeEv:
 1131|  1.25k|    bool IsSingleType() const final { return true; }
descriptor.cpp:_ZNK12_GLOBAL__N_113WSHDescriptor13GetOutputTypeEv:
 1130|  1.82k|    std::optional<OutputType> GetOutputType() const override { return OutputType::BECH32; }
descriptor.cpp:_ZNK12_GLOBAL__N_113WSHDescriptor10ScriptSizeEv:
 1133|    911|    std::optional<int64_t> ScriptSize() const override { return 1 + 1 + 32; }
descriptor.cpp:_ZNK12_GLOBAL__N_113WSHDescriptor21MaxSatisfactionWeightEb:
 1144|  1.25k|    std::optional<int64_t> MaxSatisfactionWeight(bool use_max_sig) const override {
 1145|  1.25k|        return MaxSatSize(use_max_sig);
 1146|  1.25k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_113WSHDescriptor20MaxSatisfactionElemsEv:
 1148|    769|    std::optional<int64_t> MaxSatisfactionElems() const override {
 1149|    769|        if (const auto sub_elems = m_subdescriptor_args[0]->MaxSatisfactionElems()) return 1 + *sub_elems;
  ------------------
  |  Branch (1149:24): [True: 769, False: 0]
  ------------------
 1150|      0|        return {};
 1151|    769|    }
descriptor.cpp:_ZNK12_GLOBAL__N_113WSHDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
 1123|  1.53k|    {
 1124|  1.53k|        auto ret = Vector(GetScriptForDestination(WitnessV0ScriptHash(scripts[0])));
 1125|  1.53k|        if (ret.size()) out.scripts.emplace(CScriptID(scripts[0]), scripts[0]);
  ------------------
  |  Branch (1125:13): [True: 1.53k, False: 0]
  ------------------
 1126|  1.53k|        return ret;
 1127|  1.53k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_113WSHDescriptor10MaxSatSizeEb:
 1135|  1.53k|    std::optional<int64_t> MaxSatSize(bool use_max_sig) const override {
 1136|  1.53k|        if (const auto sat_size = m_subdescriptor_args[0]->MaxSatSize(use_max_sig)) {
  ------------------
  |  Branch (1136:24): [True: 1.53k, False: 0]
  ------------------
 1137|  1.53k|            if (const auto subscript_size = m_subdescriptor_args[0]->ScriptSize()) {
  ------------------
  |  Branch (1137:28): [True: 1.53k, False: 0]
  ------------------
 1138|  1.53k|                return GetSizeOfCompactSize(*subscript_size) + *subscript_size + *sat_size;
 1139|  1.53k|            }
 1140|  1.53k|        }
 1141|      0|        return {};
 1142|  1.53k|    }
descriptor.cpp:_ZN12_GLOBAL__N_117AddressDescriptorC2ENSt3__17variantIJ14CNoDestination17PubKeyDestination6PKHash10ScriptHash19WitnessV0ScriptHash16WitnessV0KeyHash16WitnessV1Taproot11PayToAnchor14WitnessUnknownEEE:
  795|     35|    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:
 1204|  2.82k|        DescriptorImpl(Vector(std::move(internal_key)), std::move(descs), "tr"), m_depths(std::move(depths))
 1205|  2.82k|    {
 1206|  2.82k|        assert(m_subdescriptor_args.size() == m_depths.size());
 1207|  2.82k|    }
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:
  603|  2.82k|    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:
 1209|  2.82k|    bool IsSingleType() const final { return true; }
descriptor.cpp:_ZNK12_GLOBAL__N_112TRDescriptor13GetOutputTypeEv:
 1208|  2.82k|    std::optional<OutputType> GetOutputType() const override { return OutputType::BECH32M; }
descriptor.cpp:_ZNK12_GLOBAL__N_112TRDescriptor10ScriptSizeEv:
 1211|  1.41k|    std::optional<int64_t> ScriptSize() const override { return 1 + 1 + 32; }
descriptor.cpp:_ZNK12_GLOBAL__N_112TRDescriptor21MaxSatisfactionWeightEb:
 1213|  2.82k|    std::optional<int64_t> MaxSatisfactionWeight(bool) const override {
 1214|       |        // FIXME: We assume keypath spend, which can lead to very large underestimations.
 1215|  2.82k|        return 1 + 65;
 1216|  2.82k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_112TRDescriptor20MaxSatisfactionElemsEv:
 1218|  1.41k|    std::optional<int64_t> MaxSatisfactionElems() const override {
 1219|       |        // FIXME: See above, we assume keypath spend.
 1220|  1.41k|        return 1;
 1221|  1.41k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_112TRDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
 1165|  2.82k|    {
 1166|  2.82k|        TaprootBuilder builder;
 1167|  2.82k|        assert(m_depths.size() == scripts.size());
 1168|  9.92k|        for (size_t pos = 0; pos < m_depths.size(); ++pos) {
  ------------------
  |  Branch (1168:30): [True: 7.10k, False: 2.82k]
  ------------------
 1169|  7.10k|            builder.Add(m_depths[pos], scripts[pos], TAPROOT_LEAF_TAPSCRIPT);
 1170|  7.10k|        }
 1171|  2.82k|        if (!builder.IsComplete()) return {};
  ------------------
  |  Branch (1171:13): [True: 0, False: 2.82k]
  ------------------
 1172|  2.82k|        assert(keys.size() == 1);
 1173|  2.82k|        XOnlyPubKey xpk(keys[0]);
 1174|  2.82k|        if (!xpk.IsFullyValid()) return {};
  ------------------
  |  Branch (1174:13): [True: 0, False: 2.82k]
  ------------------
 1175|  2.82k|        builder.Finalize(xpk);
 1176|  2.82k|        WitnessV1Taproot output = builder.GetOutput();
 1177|  2.82k|        out.tr_trees[output] = builder;
 1178|  2.82k|        out.pubkeys.emplace(keys[0].GetID(), keys[0]);
 1179|  2.82k|        return Vector(GetScriptForDestination(output));
 1180|  2.82k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_112TRDescriptor23ToStringSubScriptHelperEPK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS_14DescriptorImpl10StringTypeEPK15DescriptorCache:
 1182|  2.85k|    {
 1183|  2.85k|        if (m_depths.empty()) return true;
  ------------------
  |  Branch (1183:13): [True: 829, False: 2.02k]
  ------------------
 1184|  2.02k|        std::vector<bool> path;
 1185|  9.12k|        for (size_t pos = 0; pos < m_depths.size(); ++pos) {
  ------------------
  |  Branch (1185:30): [True: 7.10k, False: 2.02k]
  ------------------
 1186|  7.10k|            if (pos) ret += ',';
  ------------------
  |  Branch (1186:17): [True: 5.08k, False: 2.02k]
  ------------------
 1187|  14.2k|            while ((int)path.size() <= m_depths[pos]) {
  ------------------
  |  Branch (1187:20): [True: 7.10k, False: 7.10k]
  ------------------
 1188|  7.10k|                if (path.size()) ret += '{';
  ------------------
  |  Branch (1188:21): [True: 5.08k, False: 2.02k]
  ------------------
 1189|  7.10k|                path.push_back(false);
 1190|  7.10k|            }
 1191|  7.10k|            std::string tmp;
 1192|  7.10k|            if (!m_subdescriptor_args[pos]->ToStringHelper(arg, tmp, type, cache)) return false;
  ------------------
  |  Branch (1192:17): [True: 0, False: 7.10k]
  ------------------
 1193|  7.10k|            ret += tmp;
 1194|  12.1k|            while (!path.empty() && path.back()) {
  ------------------
  |  Branch (1194:20): [True: 12.1k, False: 0]
  |  Branch (1194:20): [True: 5.08k, False: 7.10k]
  |  Branch (1194:37): [True: 5.08k, False: 7.10k]
  ------------------
 1195|  5.08k|                if (path.size() > 1) ret += '}';
  ------------------
  |  Branch (1195:21): [True: 5.08k, False: 0]
  ------------------
 1196|  5.08k|                path.pop_back();
 1197|  5.08k|            }
 1198|  7.10k|            if (!path.empty()) path.back() = true;
  ------------------
  |  Branch (1198:17): [True: 7.10k, False: 0]
  ------------------
 1199|  7.10k|        }
 1200|  2.02k|        return true;
 1201|  2.02k|    }
descriptor.cpp:_ZN12_GLOBAL__N_115RawTRDescriptorC2ENSt3__110unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS3_EEEE:
 1373|     13|    RawTRDescriptor(std::unique_ptr<PubkeyProvider> output_key) : DescriptorImpl(Vector(std::move(output_key)), "rawtr") {}
descriptor.cpp:_ZNK12_GLOBAL__N_115RawTRDescriptor12IsSingleTypeEv:
 1375|      4|    bool IsSingleType() const final { return true; }
descriptor.cpp:_ZNK12_GLOBAL__N_115RawTRDescriptor13GetOutputTypeEv:
 1374|      4|    std::optional<OutputType> GetOutputType() const override { return OutputType::BECH32M; }
descriptor.cpp:_ZNK12_GLOBAL__N_115RawTRDescriptor10ScriptSizeEv:
 1377|      2|    std::optional<int64_t> ScriptSize() const override { return 1 + 1 + 32; }
descriptor.cpp:_ZNK12_GLOBAL__N_115RawTRDescriptor21MaxSatisfactionWeightEb:
 1379|      4|    std::optional<int64_t> MaxSatisfactionWeight(bool) const override {
 1380|       |        // We can't know whether there is a script path, so assume key path spend.
 1381|      4|        return 1 + 65;
 1382|      4|    }
descriptor.cpp:_ZNK12_GLOBAL__N_115RawTRDescriptor20MaxSatisfactionElemsEv:
 1384|      2|    std::optional<int64_t> MaxSatisfactionElems() const override {
 1385|       |        // See above, we assume keypath spend.
 1386|      2|        return 1;
 1387|      2|    }
descriptor.cpp:_ZNK12_GLOBAL__N_115RawTRDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
 1365|      4|    {
 1366|      4|        assert(keys.size() == 1);
 1367|      4|        XOnlyPubKey xpk(keys[0]);
 1368|      4|        if (!xpk.IsFullyValid()) return {};
  ------------------
  |  Branch (1368:13): [True: 0, False: 4]
  ------------------
 1369|      4|        WitnessV1Taproot output{xpk};
 1370|      4|        return Vector(GetScriptForDestination(output));
 1371|      4|    }
descriptor.cpp:_ZN12_GLOBAL__N_113RawDescriptorC2E7CScript:
  820|    985|    RawDescriptor(CScript script) : DescriptorImpl({}, "raw"), m_script(std::move(script)) {}
descriptor.cpp:_ZNK12_GLOBAL__N_113RawDescriptor10IsSolvableEv:
  821|    511|    bool IsSolvable() const final { return false; }
descriptor.cpp:_ZNK12_GLOBAL__N_113RawDescriptor12IsSingleTypeEv:
  829|  1.02k|    bool IsSingleType() const final { return true; }
descriptor.cpp:_ZNK12_GLOBAL__N_113RawDescriptor15ToPrivateStringERK15SigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
  830|    511|    bool ToPrivateString(const SigningProvider& arg, std::string& out) const final { return false; }
descriptor.cpp:_ZNK12_GLOBAL__N_113RawDescriptor13GetOutputTypeEv:
  824|    511|    {
  825|    511|        CTxDestination dest;
  826|    511|        ExtractDestination(m_script, dest);
  827|    511|        return OutputTypeFromDestination(dest);
  828|    511|    }
descriptor.cpp:_ZNK12_GLOBAL__N_113RawDescriptor10ScriptSizeEv:
  832|    511|    std::optional<int64_t> ScriptSize() const override { return m_script.size(); }
descriptor.cpp:_ZNK12_GLOBAL__N_113RawDescriptor13ToStringExtraEv:
  817|  1.02k|    std::string ToStringExtra() const override { return HexStr(m_script); }
descriptor.cpp:_ZNK12_GLOBAL__N_113RawDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
  818|  1.02k|    std::vector<CScript> MakeScripts(const std::vector<CPubKey>&, Span<const CScript>, FlatSigningProvider&) const override { return Vector(m_script); }
descriptor.cpp:_ZN12_GLOBAL__N_19KeyParserC2EP19FlatSigningProviderPK15SigningProviderN10miniscript17MiniscriptContextEj:
 1676|  8.81k|        : m_out(out), m_in(in), m_script_ctx(ctx), m_offset(offset) {}
descriptor.cpp:_ZNK12_GLOBAL__N_19KeyParser9MsContextEv:
 1747|  1.78M|    miniscript::MiniscriptContext MsContext() const {
 1748|  1.78M|        return m_script_ctx;
 1749|  1.78M|    }
descriptor.cpp:_ZNK12_GLOBAL__N_19KeyParser10FromStringIPKcEENSt3__18optionalIjEET_S7_:
 1691|  14.5k|    {
 1692|  14.5k|        assert(m_out);
 1693|  14.5k|        Key key = m_keys.size();
 1694|  14.5k|        auto pk = ParsePubkey(m_offset + key, {&*begin, &*end}, ParseContext(), *m_out, m_key_parsing_error);
 1695|  14.5k|        if (pk.empty()) return {};
  ------------------
  |  Branch (1695:13): [True: 194, False: 14.3k]
  ------------------
 1696|  14.3k|        m_keys.emplace_back(std::move(pk));
 1697|  14.3k|        return key;
 1698|  14.5k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_19KeyParser12ParseContextEv:
 1682|  17.2k|    ParseScriptContext ParseContext() const {
 1683|  17.2k|        switch (m_script_ctx) {
  ------------------
  |  Branch (1683:17): [True: 0, False: 17.2k]
  ------------------
 1684|  8.34k|            case miniscript::MiniscriptContext::P2WSH: return ParseScriptContext::P2WSH;
  ------------------
  |  Branch (1684:13): [True: 8.34k, False: 8.93k]
  ------------------
 1685|  8.93k|            case miniscript::MiniscriptContext::TAPSCRIPT: return ParseScriptContext::P2TR;
  ------------------
  |  Branch (1685:13): [True: 8.93k, False: 8.34k]
  ------------------
 1686|  17.2k|        }
 1687|      0|        assert(false);
 1688|      0|    }
descriptor.cpp:_ZNK12_GLOBAL__N_19KeyParser10KeyCompareERKjS2_:
 1678|  39.5k|    bool KeyCompare(const Key& a, const Key& b) const {
 1679|  39.5k|        return *m_keys.at(a).at(0) < *m_keys.at(b).at(0);
 1680|  39.5k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114PubkeyProviderltERS0_:
  176|  39.5k|    bool operator<(PubkeyProvider& other) const {
  177|  39.5k|        CPubKey a, b;
  178|  39.5k|        SigningProvider dummy;
  179|  39.5k|        KeyOriginInfo dummy_info;
  180|       |
  181|  39.5k|        GetPubKey(0, dummy, a, dummy_info);
  182|  39.5k|        other.GetPubKey(0, dummy, b, dummy_info);
  183|       |
  184|  39.5k|        return a < b;
  185|  39.5k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_19KeyParser8ToStringERKj:
 1701|  2.92k|    {
 1702|  2.92k|        return m_keys.at(key).at(0)->ToString();
 1703|  2.92k|    }
descriptor.cpp:_ZZN12_GLOBAL__N_111ParseScriptERjR4SpanIKcENS_18ParseScriptContextER19FlatSigningProviderRNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEENK3$_0clERKNS8_6vectorINS8_10unique_ptrINS_14PubkeyProviderENS8_14default_deleteISJ_EEEENSC_ISM_EEEESQ_:
 2123|  1.57k|                    [](const std::vector<std::unique_ptr<PubkeyProvider>>& a, const std::vector<std::unique_ptr<PubkeyProvider>>& b) {
 2124|  1.57k|                        return a.size() < b.size();
 2125|  1.57k|                    })->size();
descriptor.cpp:_ZN12_GLOBAL__N_120MiniscriptDescriptorC2ENSt3__16vectorINS1_10unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS4_EEEENS1_9allocatorIS7_EEEENS3_IKN10miniscript4NodeIjEENS5_ISE_EEEE:
 1323|  3.91k|        : DescriptorImpl(std::move(providers), "?"), m_node(std::move(node)) {}
descriptor.cpp:_ZNK12_GLOBAL__N_120MiniscriptDescriptor10IsSolvableEv:
 1335|  1.34k|    bool IsSolvable() const override { return true; }
descriptor.cpp:_ZNK12_GLOBAL__N_120MiniscriptDescriptor10ScriptSizeEv:
 1338|  1.19k|    std::optional<int64_t> ScriptSize() const override { return m_node->ScriptSize(); }
descriptor.cpp:_ZNK12_GLOBAL__N_120MiniscriptDescriptor20MaxSatisfactionElemsEv:
 1345|    595|    std::optional<int64_t> MaxSatisfactionElems() const override {
 1346|    595|        return m_node->GetStackSize();
 1347|    595|    }
descriptor.cpp:_ZNK12_GLOBAL__N_120MiniscriptDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
 1309|  2.68k|    {
 1310|  2.68k|        const auto script_ctx{m_node->GetMsCtx()};
 1311|  5.47k|        for (const auto& key : keys) {
  ------------------
  |  Branch (1311:30): [True: 5.47k, False: 2.68k]
  ------------------
 1312|  5.47k|            if (miniscript::IsTapscript(script_ctx)) {
  ------------------
  |  Branch (1312:17): [True: 2.40k, False: 3.07k]
  ------------------
 1313|  2.40k|                provider.pubkeys.emplace(Hash160(XOnlyPubKey{key}), key);
 1314|  3.07k|            } else {
 1315|  3.07k|                provider.pubkeys.emplace(key.GetID(), key);
 1316|  3.07k|            }
 1317|  5.47k|        }
 1318|  2.68k|        return Vector(m_node->ToScript(ScriptMaker(keys, script_ctx)));
 1319|  2.68k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_111ScriptMaker9ToPKBytesEj:
 1259|  4.49k|    std::vector<unsigned char> ToPKBytes(uint32_t key) const {
 1260|       |        // In Tapscript keys always serialize as x-only, whether an x-only key was used in the descriptor or not.
 1261|  4.49k|        if (!miniscript::IsTapscript(m_script_ctx)) {
  ------------------
  |  Branch (1261:13): [True: 2.99k, False: 1.49k]
  ------------------
 1262|  2.99k|            return {m_keys[key].begin(), m_keys[key].end()};
 1263|  2.99k|        }
 1264|  1.49k|        const XOnlyPubKey xonly_pubkey{m_keys[key]};
 1265|  1.49k|        return {xonly_pubkey.begin(), xonly_pubkey.end()};
 1266|  4.49k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_111ScriptMaker10ToPKHBytesEj:
 1268|    984|    std::vector<unsigned char> ToPKHBytes(uint32_t key) const {
 1269|    984|        auto id = GetHash160(key);
 1270|    984|        return {id.begin(), id.end()};
 1271|    984|    }
descriptor.cpp:_ZNK12_GLOBAL__N_111ScriptMaker10GetHash160Ej:
 1249|    984|    uint160 GetHash160(uint32_t key) const {
 1250|    984|        if (miniscript::IsTapscript(m_script_ctx)) {
  ------------------
  |  Branch (1250:13): [True: 906, False: 78]
  ------------------
 1251|    906|            return Hash160(XOnlyPubKey{m_keys[key]});
 1252|    906|        }
 1253|     78|        return m_keys[key].GetID();
 1254|    984|    }
descriptor.cpp:_ZN12_GLOBAL__N_111ScriptMakerC2ERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEEN10miniscript17MiniscriptContextE:
 1257|  2.68k|    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:
 1327|  3.28k|    {
 1328|  3.28k|        if (const auto res = m_node->ToString(StringMaker(arg, m_pubkey_args, type == StringType::PRIVATE))) {
  ------------------
  |  Branch (1328:24): [True: 2.79k, False: 487]
  ------------------
 1329|  2.79k|            out = *res;
 1330|  2.79k|            return true;
 1331|  2.79k|        }
 1332|    487|        return false;
 1333|  3.28k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_111StringMaker8ToStringEj:
 1290|  8.24k|    {
 1291|  8.24k|        std::string ret;
 1292|  8.24k|        if (m_private) {
  ------------------
  |  Branch (1292:13): [True: 1.06k, False: 7.18k]
  ------------------
 1293|  1.06k|            if (!m_pubkeys[key]->ToPrivateString(*m_arg, ret)) return {};
  ------------------
  |  Branch (1293:17): [True: 487, False: 574]
  ------------------
 1294|  7.18k|        } else {
 1295|  7.18k|            ret = m_pubkeys[key]->ToString();
 1296|  7.18k|        }
 1297|  7.76k|        return ret;
 1298|  8.24k|    }
descriptor.cpp:_ZN12_GLOBAL__N_111StringMakerC2EPK15SigningProviderRKNSt3__16vectorINS4_10unique_ptrINS_14PubkeyProviderENS4_14default_deleteIS7_EEEENS4_9allocatorISA_EEEEb:
 1287|  3.28k|        : m_arg(arg), m_pubkeys(pubkeys), m_private(priv) {}
descriptor.cpp:_ZNK12_GLOBAL__N_120MiniscriptDescriptor10MaxSatSizeEb:
 1340|  1.19k|    std::optional<int64_t> MaxSatSize(bool) const override {
 1341|       |        // For Miniscript we always assume high-R ECDSA signatures.
 1342|  1.19k|        return m_node->GetWitnessSize();
 1343|  1.19k|    }
descriptor.cpp:_ZN12_GLOBAL__N_111InferScriptERK7CScriptNS_18ParseScriptContextERK15SigningProvider:
 2179|  8.48k|{
 2180|  8.48k|    if (ctx == ParseScriptContext::P2TR && script.size() == 34 && script[0] == 32 && script[33] == OP_CHECKSIG) {
  ------------------
  |  Branch (2180:9): [True: 3.52k, False: 4.96k]
  |  Branch (2180:44): [True: 1.25k, False: 2.26k]
  |  Branch (2180:67): [True: 1.25k, False: 5]
  |  Branch (2180:86): [True: 1.25k, False: 0]
  ------------------
 2181|  1.25k|        XOnlyPubKey key{Span{script}.subspan(1, 32)};
 2182|  1.25k|        return std::make_unique<PKDescriptor>(InferXOnlyPubkey(key, ctx, provider), true);
 2183|  1.25k|    }
 2184|       |
 2185|  7.23k|    if (ctx == ParseScriptContext::P2TR) {
  ------------------
  |  Branch (2185:9): [True: 2.26k, False: 4.96k]
  ------------------
 2186|  2.26k|        auto ret = InferMultiA(script, ctx, provider);
 2187|  2.26k|        if (ret) return ret;
  ------------------
  |  Branch (2187:13): [True: 1.52k, False: 747]
  ------------------
 2188|  2.26k|    }
 2189|       |
 2190|  5.71k|    std::vector<std::vector<unsigned char>> data;
 2191|  5.71k|    TxoutType txntype = Solver(script, data);
 2192|       |
 2193|  5.71k|    if (txntype == TxoutType::PUBKEY && (ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH || ctx == ParseScriptContext::P2WSH)) {
  ------------------
  |  Branch (2193:9): [True: 155, False: 5.55k]
  |  Branch (2193:42): [True: 141, False: 14]
  |  Branch (2193:76): [True: 1, False: 13]
  |  Branch (2193:111): [True: 13, False: 0]
  ------------------
 2194|    155|        CPubKey pubkey(data[0]);
 2195|    155|        if (auto pubkey_provider = InferPubkey(pubkey, ctx, provider)) {
  ------------------
  |  Branch (2195:18): [True: 153, False: 2]
  ------------------
 2196|    153|            return std::make_unique<PKDescriptor>(std::move(pubkey_provider));
 2197|    153|        }
 2198|    155|    }
 2199|  5.56k|    if (txntype == TxoutType::PUBKEYHASH && (ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH || ctx == ParseScriptContext::P2WSH)) {
  ------------------
  |  Branch (2199:9): [True: 438, False: 5.12k]
  |  Branch (2199:46): [True: 3, False: 435]
  |  Branch (2199:80): [True: 1, False: 434]
  |  Branch (2199:115): [True: 2, False: 432]
  ------------------
 2200|      6|        uint160 hash(data[0]);
 2201|      6|        CKeyID keyid(hash);
 2202|      6|        CPubKey pubkey;
 2203|      6|        if (provider.GetPubKey(keyid, pubkey)) {
  ------------------
  |  Branch (2203:13): [True: 6, False: 0]
  ------------------
 2204|      6|            if (auto pubkey_provider = InferPubkey(pubkey, ctx, provider)) {
  ------------------
  |  Branch (2204:22): [True: 6, False: 0]
  ------------------
 2205|      6|                return std::make_unique<PKHDescriptor>(std::move(pubkey_provider));
 2206|      6|            }
 2207|      6|        }
 2208|      6|    }
 2209|  5.55k|    if (txntype == TxoutType::WITNESS_V0_KEYHASH && (ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH)) {
  ------------------
  |  Branch (2209:9): [True: 7, False: 5.54k]
  |  Branch (2209:54): [True: 2, False: 5]
  |  Branch (2209:88): [True: 5, False: 0]
  ------------------
 2210|      7|        uint160 hash(data[0]);
 2211|      7|        CKeyID keyid(hash);
 2212|      7|        CPubKey pubkey;
 2213|      7|        if (provider.GetPubKey(keyid, pubkey)) {
  ------------------
  |  Branch (2213:13): [True: 6, False: 1]
  ------------------
 2214|      6|            if (auto pubkey_provider = InferPubkey(pubkey, ParseScriptContext::P2WPKH, provider)) {
  ------------------
  |  Branch (2214:22): [True: 6, False: 0]
  ------------------
 2215|      6|                return std::make_unique<WPKHDescriptor>(std::move(pubkey_provider));
 2216|      6|            }
 2217|      6|        }
 2218|      7|    }
 2219|  5.54k|    if (txntype == TxoutType::MULTISIG && (ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH || ctx == ParseScriptContext::P2WSH)) {
  ------------------
  |  Branch (2219:9): [True: 901, False: 4.64k]
  |  Branch (2219:44): [True: 278, False: 623]
  |  Branch (2219:78): [True: 464, False: 159]
  |  Branch (2219:113): [True: 159, False: 0]
  ------------------
 2220|    901|        bool ok = true;
 2221|    901|        std::vector<std::unique_ptr<PubkeyProvider>> providers;
 2222|  5.77k|        for (size_t i = 1; i + 1 < data.size(); ++i) {
  ------------------
  |  Branch (2222:28): [True: 4.87k, False: 901]
  ------------------
 2223|  4.87k|            CPubKey pubkey(data[i]);
 2224|  4.87k|            if (auto pubkey_provider = InferPubkey(pubkey, ctx, provider)) {
  ------------------
  |  Branch (2224:22): [True: 4.87k, False: 0]
  ------------------
 2225|  4.87k|                providers.push_back(std::move(pubkey_provider));
 2226|  4.87k|            } else {
 2227|      0|                ok = false;
 2228|      0|                break;
 2229|      0|            }
 2230|  4.87k|        }
 2231|    901|        if (ok) return std::make_unique<MultisigDescriptor>((int)data[0][0], std::move(providers));
  ------------------
  |  Branch (2231:13): [True: 901, False: 0]
  ------------------
 2232|    901|    }
 2233|  4.64k|    if (txntype == TxoutType::SCRIPTHASH && ctx == ParseScriptContext::TOP) {
  ------------------
  |  Branch (2233:9): [True: 614, False: 4.03k]
  |  Branch (2233:45): [True: 614, False: 0]
  ------------------
 2234|    614|        uint160 hash(data[0]);
 2235|    614|        CScriptID scriptid(hash);
 2236|    614|        CScript subscript;
 2237|    614|        if (provider.GetCScript(scriptid, subscript)) {
  ------------------
  |  Branch (2237:13): [True: 613, False: 1]
  ------------------
 2238|    613|            auto sub = InferScript(subscript, ParseScriptContext::P2SH, provider);
 2239|    613|            if (sub) return std::make_unique<SHDescriptor>(std::move(sub));
  ------------------
  |  Branch (2239:17): [True: 613, False: 0]
  ------------------
 2240|    613|        }
 2241|    614|    }
 2242|  4.03k|    if (txntype == TxoutType::WITNESS_V0_SCRIPTHASH && (ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH)) {
  ------------------
  |  Branch (2242:9): [True: 770, False: 3.26k]
  |  Branch (2242:57): [True: 628, False: 142]
  |  Branch (2242:91): [True: 142, False: 0]
  ------------------
 2243|    770|        CScriptID scriptid{RIPEMD160(data[0])};
 2244|    770|        CScript subscript;
 2245|    770|        if (provider.GetCScript(scriptid, subscript)) {
  ------------------
  |  Branch (2245:13): [True: 769, False: 1]
  ------------------
 2246|    769|            auto sub = InferScript(subscript, ParseScriptContext::P2WSH, provider);
 2247|    769|            if (sub) return std::make_unique<WSHDescriptor>(std::move(sub));
  ------------------
  |  Branch (2247:17): [True: 769, False: 0]
  ------------------
 2248|    769|        }
 2249|    770|    }
 2250|  3.26k|    if (txntype == TxoutType::WITNESS_V1_TAPROOT && ctx == ParseScriptContext::TOP) {
  ------------------
  |  Branch (2250:9): [True: 1.41k, False: 1.84k]
  |  Branch (2250:53): [True: 1.41k, False: 0]
  ------------------
 2251|       |        // Extract x-only pubkey from output.
 2252|  1.41k|        XOnlyPubKey pubkey;
 2253|  1.41k|        std::copy(data[0].begin(), data[0].end(), pubkey.begin());
 2254|       |        // Request spending data.
 2255|  1.41k|        TaprootSpendData tap;
 2256|  1.41k|        if (provider.GetTaprootSpendData(pubkey, tap)) {
  ------------------
  |  Branch (2256:13): [True: 1.41k, False: 5]
  ------------------
 2257|       |            // If found, convert it back to tree form.
 2258|  1.41k|            auto tree = InferTaprootTree(tap, pubkey);
 2259|  1.41k|            if (tree) {
  ------------------
  |  Branch (2259:17): [True: 1.40k, False: 4]
  ------------------
 2260|       |                // If that works, try to infer subdescriptors for all leaves.
 2261|  1.40k|                bool ok = true;
 2262|  1.40k|                std::vector<std::unique_ptr<DescriptorImpl>> subscripts; //!< list of script subexpressions
 2263|  1.40k|                std::vector<int> depths; //!< depth in the tree of each subexpression (same length subscripts)
 2264|  3.52k|                for (const auto& [depth, script, leaf_ver] : *tree) {
  ------------------
  |  Branch (2264:60): [True: 3.52k, False: 1.40k]
  ------------------
 2265|  3.52k|                    std::unique_ptr<DescriptorImpl> subdesc;
 2266|  3.52k|                    if (leaf_ver == TAPROOT_LEAF_TAPSCRIPT) {
  ------------------
  |  Branch (2266:25): [True: 3.52k, False: 0]
  ------------------
 2267|  3.52k|                        subdesc = InferScript(CScript(script.begin(), script.end()), ParseScriptContext::P2TR, provider);
 2268|  3.52k|                    }
 2269|  3.52k|                    if (!subdesc) {
  ------------------
  |  Branch (2269:25): [True: 3, False: 3.51k]
  ------------------
 2270|      3|                        ok = false;
 2271|      3|                        break;
 2272|  3.51k|                    } else {
 2273|  3.51k|                        subscripts.push_back(std::move(subdesc));
 2274|  3.51k|                        depths.push_back(depth);
 2275|  3.51k|                    }
 2276|  3.52k|                }
 2277|  1.40k|                if (ok) {
  ------------------
  |  Branch (2277:21): [True: 1.40k, False: 3]
  ------------------
 2278|  1.40k|                    auto key = InferXOnlyPubkey(tap.internal_key, ParseScriptContext::P2TR, provider);
 2279|  1.40k|                    return std::make_unique<TRDescriptor>(std::move(key), std::move(subscripts), std::move(depths));
 2280|  1.40k|                }
 2281|  1.40k|            }
 2282|  1.41k|        }
 2283|       |        // If the above doesn't work, construct a rawtr() descriptor with just the encoded x-only pubkey.
 2284|     12|        if (pubkey.IsFullyValid()) {
  ------------------
  |  Branch (2284:13): [True: 10, False: 2]
  ------------------
 2285|     10|            auto key = InferXOnlyPubkey(pubkey, ParseScriptContext::P2TR, provider);
 2286|     10|            if (key) {
  ------------------
  |  Branch (2286:17): [True: 10, False: 0]
  ------------------
 2287|     10|                return std::make_unique<RawTRDescriptor>(std::move(key));
 2288|     10|            }
 2289|     10|        }
 2290|     12|    }
 2291|       |
 2292|  1.84k|    if (ctx == ParseScriptContext::P2WSH || ctx == ParseScriptContext::P2TR) {
  ------------------
  |  Branch (2292:9): [True: 595, False: 1.25k]
  |  Branch (2292:45): [True: 747, False: 507]
  ------------------
 2293|  1.34k|        const auto script_ctx{ctx == ParseScriptContext::P2WSH ? miniscript::MiniscriptContext::P2WSH : miniscript::MiniscriptContext::TAPSCRIPT};
  ------------------
  |  Branch (2293:31): [True: 595, False: 747]
  ------------------
 2294|  1.34k|        KeyParser parser(/* out = */nullptr, /* in = */&provider, /* ctx = */script_ctx);
 2295|  1.34k|        auto node = miniscript::FromScript(script, parser);
 2296|  1.34k|        if (node && node->IsSane()) {
  ------------------
  |  Branch (2296:13): [True: 1.34k, False: 0]
  |  Branch (2296:21): [True: 1.33k, False: 3]
  ------------------
 2297|  1.33k|            std::vector<std::unique_ptr<PubkeyProvider>> keys;
 2298|  1.33k|            keys.reserve(parser.m_keys.size());
 2299|  2.71k|            for (auto& key : parser.m_keys) {
  ------------------
  |  Branch (2299:28): [True: 2.71k, False: 1.33k]
  ------------------
 2300|  2.71k|                keys.emplace_back(std::move(key.at(0)));
 2301|  2.71k|            }
 2302|  1.33k|            return std::make_unique<MiniscriptDescriptor>(std::move(keys), std::move(node));
 2303|  1.33k|        }
 2304|  1.34k|    }
 2305|       |
 2306|       |    // The following descriptors are all top-level only descriptors.
 2307|       |    // So if we are not at the top level, return early.
 2308|    510|    if (ctx != ParseScriptContext::TOP) return nullptr;
  ------------------
  |  Branch (2308:9): [True: 3, False: 507]
  ------------------
 2309|       |
 2310|    507|    CTxDestination dest;
 2311|    507|    if (ExtractDestination(script, dest)) {
  ------------------
  |  Branch (2311:9): [True: 35, False: 472]
  ------------------
 2312|     35|        if (GetScriptForDestination(dest) == script) {
  ------------------
  |  Branch (2312:13): [True: 35, False: 0]
  ------------------
 2313|     35|            return std::make_unique<AddressDescriptor>(std::move(dest));
 2314|     35|        }
 2315|     35|    }
 2316|       |
 2317|    472|    return std::make_unique<RawDescriptor>(script);
 2318|    507|}
descriptor.cpp:_ZN12_GLOBAL__N_116InferXOnlyPubkeyERK11XOnlyPubKeyNS_18ParseScriptContextERK15SigningProvider:
 1645|   138k|{
 1646|   138k|    CPubKey pubkey{xkey.GetEvenCorrespondingCPubKey()};
 1647|   138k|    std::unique_ptr<PubkeyProvider> key_provider = std::make_unique<ConstPubkeyProvider>(0, pubkey, true);
 1648|   138k|    KeyOriginInfo info;
 1649|   138k|    if (provider.GetKeyOriginByXOnly(xkey, info)) {
  ------------------
  |  Branch (1649:9): [True: 138k, False: 8]
  ------------------
 1650|   138k|        return std::make_unique<OriginPubkeyProvider>(0, std::move(info), std::move(key_provider), /*apostrophe=*/false);
 1651|   138k|    }
 1652|      8|    return key_provider;
 1653|   138k|}
descriptor.cpp:_ZN12_GLOBAL__N_111InferMultiAERK7CScriptNS_18ParseScriptContextERK15SigningProvider:
 2163|  2.26k|{
 2164|  2.26k|    auto match = MatchMultiA(script);
 2165|  2.26k|    if (!match) return {};
  ------------------
  |  Branch (2165:9): [True: 747, False: 1.52k]
  ------------------
 2166|  1.52k|    std::vector<std::unique_ptr<PubkeyProvider>> keys;
 2167|  1.52k|    keys.reserve(match->second.size());
 2168|   134k|    for (const auto keyspan : match->second) {
  ------------------
  |  Branch (2168:29): [True: 134k, False: 1.52k]
  ------------------
 2169|   134k|        if (keyspan.size() != 32) return {};
  ------------------
  |  Branch (2169:13): [True: 0, False: 134k]
  ------------------
 2170|   134k|        auto key = InferXOnlyPubkey(XOnlyPubKey{keyspan}, ctx, provider);
 2171|   134k|        if (!key) return {};
  ------------------
  |  Branch (2171:13): [True: 0, False: 134k]
  ------------------
 2172|   134k|        keys.push_back(std::move(key));
 2173|   134k|    }
 2174|  1.52k|    return std::make_unique<MultiADescriptor>(match->first, std::move(keys));
 2175|  1.52k|}
descriptor.cpp:_ZN12_GLOBAL__N_111InferPubkeyERK7CPubKeyNS_18ParseScriptContextERK15SigningProvider:
 1627|  7.03k|{
 1628|       |    // Key cannot be hybrid
 1629|  7.03k|    if (!pubkey.IsValidNonHybrid()) {
  ------------------
  |  Branch (1629:9): [True: 2, False: 7.03k]
  ------------------
 1630|      2|        return nullptr;
 1631|      2|    }
 1632|       |    // Uncompressed is only allowed in TOP and P2SH contexts
 1633|  7.03k|    if (ctx != ParseScriptContext::TOP && ctx != ParseScriptContext::P2SH && !pubkey.IsCompressed()) {
  ------------------
  |  Branch (1633:9): [True: 6.53k, False: 499]
  |  Branch (1633:43): [True: 3.57k, False: 2.95k]
  |  Branch (1633:78): [True: 0, False: 3.57k]
  ------------------
 1634|      0|        return nullptr;
 1635|      0|    }
 1636|  7.03k|    std::unique_ptr<PubkeyProvider> key_provider = std::make_unique<ConstPubkeyProvider>(0, pubkey, false);
 1637|  7.03k|    KeyOriginInfo info;
 1638|  7.03k|    if (provider.GetKeyOrigin(pubkey.GetID(), info)) {
  ------------------
  |  Branch (1638:9): [True: 7.02k, False: 3]
  ------------------
 1639|  7.02k|        return std::make_unique<OriginPubkeyProvider>(0, std::move(info), std::move(key_provider), /*apostrophe=*/false);
 1640|  7.02k|    }
 1641|      3|    return key_provider;
 1642|  7.03k|}
descriptor.cpp:_ZNK12_GLOBAL__N_19KeyParser11FromPKBytesINSt3__111__wrap_iterIPhEEEENS2_8optionalIjEET_S8_:
 1706|  2.24k|    {
 1707|  2.24k|        assert(m_in);
 1708|  2.24k|        Key key = m_keys.size();
 1709|  2.24k|        if (miniscript::IsTapscript(m_script_ctx) && end - begin == 32) {
  ------------------
  |  Branch (1709:13): [True: 747, False: 1.49k]
  |  Branch (1709:54): [True: 747, False: 0]
  ------------------
 1710|    747|            XOnlyPubKey pubkey;
 1711|    747|            std::copy(begin, end, pubkey.begin());
 1712|    747|            if (auto pubkey_provider = InferXOnlyPubkey(pubkey, ParseContext(), *m_in)) {
  ------------------
  |  Branch (1712:22): [True: 747, False: 0]
  ------------------
 1713|    747|                m_keys.emplace_back();
 1714|    747|                m_keys.back().push_back(std::move(pubkey_provider));
 1715|    747|                return key;
 1716|    747|            }
 1717|  1.49k|        } else if (!miniscript::IsTapscript(m_script_ctx)) {
  ------------------
  |  Branch (1717:20): [True: 1.49k, False: 0]
  ------------------
 1718|  1.49k|            CPubKey pubkey(begin, end);
 1719|  1.49k|            if (auto pubkey_provider = InferPubkey(pubkey, ParseContext(), *m_in)) {
  ------------------
  |  Branch (1719:22): [True: 1.49k, False: 0]
  ------------------
 1720|  1.49k|                m_keys.emplace_back();
 1721|  1.49k|                m_keys.back().push_back(std::move(pubkey_provider));
 1722|  1.49k|                return key;
 1723|  1.49k|            }
 1724|  1.49k|        }
 1725|      0|        return {};
 1726|  2.24k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_19KeyParser12FromPKHBytesINSt3__111__wrap_iterIPhEEEENS2_8optionalIjEET_S8_:
 1729|    492|    {
 1730|    492|        assert(end - begin == 20);
 1731|    492|        assert(m_in);
 1732|    492|        uint160 hash;
 1733|    492|        std::copy(begin, end, hash.begin());
 1734|    492|        CKeyID keyid(hash);
 1735|    492|        CPubKey pubkey;
 1736|    492|        if (m_in->GetPubKey(keyid, pubkey)) {
  ------------------
  |  Branch (1736:13): [True: 492, False: 0]
  ------------------
 1737|    492|            if (auto pubkey_provider = InferPubkey(pubkey, ParseContext(), *m_in)) {
  ------------------
  |  Branch (1737:22): [True: 492, False: 0]
  ------------------
 1738|    492|                Key key = m_keys.size();
 1739|    492|                m_keys.emplace_back();
 1740|    492|                m_keys.back().push_back(std::move(pubkey_provider));
 1741|    492|                return key;
 1742|    492|            }
 1743|    492|        }
 1744|      0|        return {};
 1745|    492|    }

_ZN10DescriptorD2Ev:
   99|  19.5k|    virtual ~Descriptor() = default;

_Z18ComputeTapleafHashh4SpanIKhE:
 1829|  10.5k|{
 1830|  10.5k|    return (HashWriter{HASHER_TAPLEAF} << leaf_version << CompactSizeWriter(script.size()) << script).GetSHA256();
 1831|  10.5k|}
_Z20ComputeTapbranchHash4SpanIKhES1_:
 1834|  32.2k|{
 1835|  32.2k|    HashWriter ss_branch{HASHER_TAPBRANCH};
 1836|  32.2k|    if (std::lexicographical_compare(a.begin(), a.end(), b.begin(), b.end())) {
  ------------------
  |  Branch (1836:9): [True: 11.6k, False: 20.6k]
  ------------------
 1837|  11.6k|        ss_branch << a << b;
 1838|  20.6k|    } else {
 1839|  20.6k|        ss_branch << b << a;
 1840|  20.6k|    }
 1841|  32.2k|    return ss_branch.GetSHA256();
 1842|  32.2k|}
_Z24ComputeTaprootMerkleRoot4SpanIKhERK7uint256:
 1845|  3.45k|{
 1846|  3.45k|    assert(control.size() >= TAPROOT_CONTROL_BASE_SIZE);
 1847|  3.45k|    assert(control.size() <= TAPROOT_CONTROL_MAX_SIZE);
 1848|  3.45k|    assert((control.size() - TAPROOT_CONTROL_BASE_SIZE) % TAPROOT_CONTROL_NODE_SIZE == 0);
 1849|       |
 1850|  3.45k|    const int path_len = (control.size() - TAPROOT_CONTROL_BASE_SIZE) / TAPROOT_CONTROL_NODE_SIZE;
 1851|  3.45k|    uint256 k = tapleaf_hash;
 1852|  30.5k|    for (int i = 0; i < path_len; ++i) {
  ------------------
  |  Branch (1852:21): [True: 27.1k, False: 3.45k]
  ------------------
 1853|  27.1k|        Span node{Span{control}.subspan(TAPROOT_CONTROL_BASE_SIZE + TAPROOT_CONTROL_NODE_SIZE * i, TAPROOT_CONTROL_NODE_SIZE)};
 1854|  27.1k|        k = ComputeTapbranchHash(k, node);
 1855|  27.1k|    }
 1856|  3.45k|    return k;
 1857|  3.45k|}

_ZN10miniscript8internal12SanitizeTypeENS_4TypeE:
   19|  1.84M|Type SanitizeType(Type e) {
   20|  1.84M|    int num_types = (e << "K"_mst) + (e << "V"_mst) + (e << "B"_mst) + (e << "W"_mst);
   21|  1.84M|    if (num_types == 0) return ""_mst; // No valid type, don't care about the rest
  ------------------
  |  Branch (21:9): [True: 436k, False: 1.40M]
  ------------------
   22|  1.40M|    assert(num_types == 1); // K, V, B, W all conflict with each other
   23|  1.40M|    assert(!(e << "z"_mst) || !(e << "o"_mst)); // z conflicts with o
   24|  1.40M|    assert(!(e << "n"_mst) || !(e << "z"_mst)); // n conflicts with z
   25|  1.40M|    assert(!(e << "n"_mst) || !(e << "W"_mst)); // n conflicts with W
   26|  1.40M|    assert(!(e << "V"_mst) || !(e << "d"_mst)); // V conflicts with d
   27|  1.40M|    assert(!(e << "K"_mst) ||  (e << "u"_mst)); // K implies u
   28|  1.40M|    assert(!(e << "V"_mst) || !(e << "u"_mst)); // V conflicts with u
   29|  1.40M|    assert(!(e << "e"_mst) || !(e << "f"_mst)); // e conflicts with f
   30|  1.40M|    assert(!(e << "e"_mst) ||  (e << "d"_mst)); // e implies d
   31|  1.40M|    assert(!(e << "V"_mst) || !(e << "e"_mst)); // V conflicts with e
   32|  1.40M|    assert(!(e << "d"_mst) || !(e << "f"_mst)); // d conflicts with f
   33|  1.40M|    assert(!(e << "V"_mst) ||  (e << "f"_mst)); // V implies f
   34|  1.40M|    assert(!(e << "K"_mst) ||  (e << "s"_mst)); // K implies s
   35|  1.40M|    assert(!(e << "z"_mst) ||  (e << "m"_mst)); // z implies m
   36|  1.40M|    return e;
   37|  1.40M|}
_ZN10miniscript8internal11ComputeTypeENS_8FragmentENS_4TypeES2_S2_RKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEEjmmmNS_17MiniscriptContextE:
   40|  1.84M|                 size_t data_size, size_t n_subs, size_t n_keys, MiniscriptContext ms_ctx) {
   41|       |    // Sanity check on data
   42|  1.84M|    if (fragment == Fragment::SHA256 || fragment == Fragment::HASH256) {
  ------------------
  |  Branch (42:9): [True: 72, False: 1.84M]
  |  Branch (42:41): [True: 150, False: 1.84M]
  ------------------
   43|    222|        assert(data_size == 32);
   44|  1.84M|    } else if (fragment == Fragment::RIPEMD160 || fragment == Fragment::HASH160) {
  ------------------
  |  Branch (44:16): [True: 230, False: 1.84M]
  |  Branch (44:51): [True: 277, False: 1.83M]
  ------------------
   45|    507|        assert(data_size == 20);
   46|  1.83M|    } else {
   47|  1.83M|        assert(data_size == 0);
   48|  1.83M|    }
   49|       |    // Sanity check on k
   50|  1.84M|    if (fragment == Fragment::OLDER || fragment == Fragment::AFTER) {
  ------------------
  |  Branch (50:9): [True: 3.74k, False: 1.83M]
  |  Branch (50:40): [True: 6.72k, False: 1.83M]
  ------------------
   51|  10.4k|        assert(k >= 1 && k < 0x80000000UL);
   52|  1.83M|    } else if (fragment == Fragment::MULTI || fragment == Fragment::MULTI_A) {
  ------------------
  |  Branch (52:16): [True: 1.82k, False: 1.82M]
  |  Branch (52:47): [True: 751, False: 1.82M]
  ------------------
   53|  2.57k|        assert(k >= 1 && k <= n_keys);
   54|  1.82M|    } else if (fragment == Fragment::THRESH) {
  ------------------
  |  Branch (54:16): [True: 9.44k, False: 1.81M]
  ------------------
   55|  9.44k|        assert(k >= 1 && k <= n_subs);
   56|  1.81M|    } else {
   57|  1.81M|        assert(k == 0);
   58|  1.81M|    }
   59|       |    // Sanity check on subs
   60|  1.84M|    if (fragment == Fragment::AND_V || fragment == Fragment::AND_B || fragment == Fragment::OR_B ||
  ------------------
  |  Branch (60:9): [True: 81.9k, False: 1.75M]
  |  Branch (60:40): [True: 9.76k, False: 1.74M]
  |  Branch (60:71): [True: 4.93k, False: 1.74M]
  ------------------
   61|  1.84M|        fragment == Fragment::OR_C || fragment == Fragment::OR_I || fragment == Fragment::OR_D) {
  ------------------
  |  Branch (61:9): [True: 3.83k, False: 1.73M]
  |  Branch (61:39): [True: 493k, False: 1.24M]
  |  Branch (61:69): [True: 4.25k, False: 1.24M]
  ------------------
   62|   598k|        assert(n_subs == 2);
   63|  1.24M|    } else if (fragment == Fragment::ANDOR) {
  ------------------
  |  Branch (63:16): [True: 12.2k, False: 1.23M]
  ------------------
   64|  12.2k|        assert(n_subs == 3);
   65|  1.23M|    } else if (fragment == Fragment::WRAP_A || fragment == Fragment::WRAP_S || fragment == Fragment::WRAP_C ||
  ------------------
  |  Branch (65:16): [True: 62.2k, False: 1.16M]
  |  Branch (65:48): [True: 6.23k, False: 1.16M]
  |  Branch (65:80): [True: 127k, False: 1.03M]
  ------------------
   66|  1.23M|               fragment == Fragment::WRAP_D || fragment == Fragment::WRAP_V || fragment == Fragment::WRAP_J ||
  ------------------
  |  Branch (66:16): [True: 53.3k, False: 980k]
  |  Branch (66:48): [True: 33.8k, False: 946k]
  |  Branch (66:80): [True: 10.6k, False: 935k]
  ------------------
   67|  1.23M|               fragment == Fragment::WRAP_N) {
  ------------------
  |  Branch (67:16): [True: 137k, False: 798k]
  ------------------
   68|   431k|        assert(n_subs == 1);
   69|   798k|    } else if (fragment != Fragment::THRESH) {
  ------------------
  |  Branch (69:16): [True: 789k, False: 9.44k]
  ------------------
   70|   789k|        assert(n_subs == 0);
   71|   789k|    }
   72|       |    // Sanity check on keys
   73|  1.84M|    if (fragment == Fragment::PK_K || fragment == Fragment::PK_H) {
  ------------------
  |  Branch (73:9): [True: 6.19k, False: 1.83M]
  |  Branch (73:39): [True: 2.16k, False: 1.83M]
  ------------------
   74|  8.35k|        assert(n_keys == 1);
   75|  1.83M|    } else if (fragment == Fragment::MULTI) {
  ------------------
  |  Branch (75:16): [True: 1.82k, False: 1.83M]
  ------------------
   76|  1.82k|        assert(n_keys >= 1 && n_keys <= MAX_PUBKEYS_PER_MULTISIG);
   77|  1.82k|        assert(!IsTapscript(ms_ctx));
   78|  1.83M|    } else if (fragment == Fragment::MULTI_A) {
  ------------------
  |  Branch (78:16): [True: 751, False: 1.82M]
  ------------------
   79|    751|        assert(n_keys >= 1 && n_keys <= MAX_PUBKEYS_PER_MULTI_A);
   80|    751|        assert(IsTapscript(ms_ctx));
   81|  1.82M|    } else {
   82|  1.82M|        assert(n_keys == 0);
   83|  1.82M|    }
   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|  1.84M|    switch (fragment) {
  ------------------
  |  Branch (88:13): [True: 0, False: 1.84M]
  ------------------
   89|  6.19k|        case Fragment::PK_K: return "Konudemsxk"_mst;
  ------------------
  |  Branch (89:9): [True: 6.19k, False: 1.83M]
  ------------------
   90|  2.16k|        case Fragment::PK_H: return "Knudemsxk"_mst;
  ------------------
  |  Branch (90:9): [True: 2.16k, False: 1.83M]
  ------------------
   91|  3.74k|        case Fragment::OLDER: return
  ------------------
  |  Branch (91:9): [True: 3.74k, False: 1.83M]
  ------------------
   92|  3.74k|            "g"_mst.If(k & CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG) |
   93|  3.74k|            "h"_mst.If(!(k & CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG)) |
   94|  3.74k|            "Bzfmxk"_mst;
   95|  6.72k|        case Fragment::AFTER: return
  ------------------
  |  Branch (95:9): [True: 6.72k, False: 1.83M]
  ------------------
   96|  6.72k|            "i"_mst.If(k >= LOCKTIME_THRESHOLD) |
   97|  6.72k|            "j"_mst.If(k < LOCKTIME_THRESHOLD) |
   98|  6.72k|            "Bzfmxk"_mst;
   99|     72|        case Fragment::SHA256: return "Bonudmk"_mst;
  ------------------
  |  Branch (99:9): [True: 72, False: 1.84M]
  ------------------
  100|    230|        case Fragment::RIPEMD160: return "Bonudmk"_mst;
  ------------------
  |  Branch (100:9): [True: 230, False: 1.84M]
  ------------------
  101|    150|        case Fragment::HASH256: return "Bonudmk"_mst;
  ------------------
  |  Branch (101:9): [True: 150, False: 1.84M]
  ------------------
  102|    277|        case Fragment::HASH160: return "Bonudmk"_mst;
  ------------------
  |  Branch (102:9): [True: 277, False: 1.84M]
  ------------------
  103|   186k|        case Fragment::JUST_1: return "Bzufmxk"_mst;
  ------------------
  |  Branch (103:9): [True: 186k, False: 1.65M]
  ------------------
  104|   580k|        case Fragment::JUST_0: return "Bzudemsxk"_mst;
  ------------------
  |  Branch (104:9): [True: 580k, False: 1.25M]
  ------------------
  105|  62.2k|        case Fragment::WRAP_A: return
  ------------------
  |  Branch (105:9): [True: 62.2k, False: 1.77M]
  ------------------
  106|  62.2k|            "W"_mst.If(x << "B"_mst) | // W=B_x
  107|  62.2k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  108|  62.2k|            (x & "udfems"_mst) | // u=u_x, d=d_x, f=f_x, e=e_x, m=m_x, s=s_x
  109|  62.2k|            "x"_mst; // x
  110|  6.23k|        case Fragment::WRAP_S: return
  ------------------
  |  Branch (110:9): [True: 6.23k, False: 1.83M]
  ------------------
  111|  6.23k|            "W"_mst.If(x << "Bo"_mst) | // W=B_x*o_x
  112|  6.23k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  113|  6.23k|            (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|   127k|        case Fragment::WRAP_C: return
  ------------------
  |  Branch (114:9): [True: 127k, False: 1.71M]
  ------------------
  115|   127k|            "B"_mst.If(x << "K"_mst) | // B=K_x
  116|   127k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  117|   127k|            (x & "ondfem"_mst) | // o=o_x, n=n_x, d=d_x, f=f_x, e=e_x, m=m_x
  118|   127k|            "us"_mst; // u, s
  119|  53.3k|        case Fragment::WRAP_D: return
  ------------------
  |  Branch (119:9): [True: 53.3k, False: 1.78M]
  ------------------
  120|  53.3k|            "B"_mst.If(x << "Vz"_mst) | // B=V_x*z_x
  121|  53.3k|            "o"_mst.If(x << "z"_mst) | // o=z_x
  122|  53.3k|            "e"_mst.If(x << "f"_mst) | // e=f_x
  123|  53.3k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  124|  53.3k|            (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|  53.3k|            "u"_mst.If(IsTapscript(ms_ctx)) |
  127|  53.3k|            "ndx"_mst; // n, d, x
  128|  33.8k|        case Fragment::WRAP_V: return
  ------------------
  |  Branch (128:9): [True: 33.8k, False: 1.80M]
  ------------------
  129|  33.8k|            "V"_mst.If(x << "B"_mst) | // V=B_x
  130|  33.8k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  131|  33.8k|            (x & "zonms"_mst) | // z=z_x, o=o_x, n=n_x, m=m_x, s=s_x
  132|  33.8k|            "fx"_mst; // f, x
  133|  10.6k|        case Fragment::WRAP_J: return
  ------------------
  |  Branch (133:9): [True: 10.6k, False: 1.82M]
  ------------------
  134|  10.6k|            "B"_mst.If(x << "Bn"_mst) | // B=B_x*n_x
  135|  10.6k|            "e"_mst.If(x << "f"_mst) | // e=f_x
  136|  10.6k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  137|  10.6k|            (x & "oums"_mst) | // o=o_x, u=u_x, m=m_x, s=s_x
  138|  10.6k|            "ndx"_mst; // n, d, x
  139|   137k|        case Fragment::WRAP_N: return
  ------------------
  |  Branch (139:9): [True: 137k, False: 1.70M]
  ------------------
  140|   137k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  141|   137k|            (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|   137k|            "ux"_mst; // u, x
  143|  81.9k|        case Fragment::AND_V: return
  ------------------
  |  Branch (143:9): [True: 81.9k, False: 1.75M]
  ------------------
  144|  81.9k|            (y & "KVB"_mst).If(x << "V"_mst) | // B=V_x*B_y, V=V_x*V_y, K=V_x*K_y
  145|  81.9k|            (x & "n"_mst) | (y & "n"_mst).If(x << "z"_mst) | // n=n_x+z_x*n_y
  146|  81.9k|            ((x | y) & "o"_mst).If((x | y) << "z"_mst) | // o=o_x*z_y+z_x*o_y
  147|  81.9k|            (x & y & "dmz"_mst) | // d=d_x*d_y, m=m_x*m_y, z=z_x*z_y
  148|  81.9k|            ((x | y) & "s"_mst) | // s=s_x+s_y
  149|  81.9k|            "f"_mst.If((y << "f"_mst) || (x << "s"_mst)) | // f=f_y+s_x
  ------------------
  |  Branch (149:24): [True: 81.1k, False: 861]
  |  Branch (149:42): [True: 52, False: 809]
  ------------------
  150|  81.9k|            (y & "ux"_mst) | // u=u_y, x=x_y
  151|  81.9k|            ((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|  81.9k|            "k"_mst.If(((x & y) << "k"_mst) &&
  ------------------
  |  Branch (152:24): [True: 15.0k, False: 66.9k]
  ------------------
  153|  81.9k|                !(((x << "g"_mst) && (y << "h"_mst)) ||
  ------------------
  |  Branch (153:20): [True: 297, False: 14.7k]
  |  Branch (153:38): [True: 27, False: 270]
  ------------------
  154|  15.0k|                ((x << "h"_mst) && (y << "g"_mst)) ||
  ------------------
  |  Branch (154:18): [True: 2.07k, False: 12.9k]
  |  Branch (154:36): [True: 67, False: 2.00k]
  ------------------
  155|  15.0k|                ((x << "i"_mst) && (y << "j"_mst)) ||
  ------------------
  |  Branch (155:18): [True: 576, False: 14.3k]
  |  Branch (155:36): [True: 201, False: 375]
  ------------------
  156|  15.0k|                ((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: 434, False: 14.3k]
  |  Branch (156:36): [True: 0, False: 434]
  ------------------
  157|  9.76k|        case Fragment::AND_B: return
  ------------------
  |  Branch (157:9): [True: 9.76k, False: 1.83M]
  ------------------
  158|  9.76k|            (x & "B"_mst).If(y << "W"_mst) | // B=B_x*W_y
  159|  9.76k|            ((x | y) & "o"_mst).If((x | y) << "z"_mst) | // o=o_x*z_y+z_x*o_y
  160|  9.76k|            (x & "n"_mst) | (y & "n"_mst).If(x << "z"_mst) | // n=n_x+z_x*n_y
  161|  9.76k|            (x & y & "e"_mst).If((x & y) << "s"_mst) | // e=e_x*e_y*s_x*s_y
  162|  9.76k|            (x & y & "dzm"_mst) | // d=d_x*d_y, z=z_x*z_y, m=m_x*m_y
  163|  9.76k|            "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: 737, False: 9.02k]
  |  Branch (163:48): [True: 360, False: 8.66k]
  |  Branch (163:67): [True: 1, False: 8.66k]
  ------------------
  164|  9.76k|            ((x | y) & "s"_mst) | // s=s_x+s_y
  165|  9.76k|            "ux"_mst | // u, x
  166|  9.76k|            ((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|  9.76k|            "k"_mst.If(((x & y) << "k"_mst) &&
  ------------------
  |  Branch (167:24): [True: 2.37k, False: 7.38k]
  ------------------
  168|  9.76k|                !(((x << "g"_mst) && (y << "h"_mst)) ||
  ------------------
  |  Branch (168:20): [True: 174, False: 2.20k]
  |  Branch (168:38): [True: 99, False: 75]
  ------------------
  169|  2.37k|                ((x << "h"_mst) && (y << "g"_mst)) ||
  ------------------
  |  Branch (169:18): [True: 808, False: 1.46k]
  |  Branch (169:36): [True: 92, False: 716]
  ------------------
  170|  2.37k|                ((x << "i"_mst) && (y << "j"_mst)) ||
  ------------------
  |  Branch (170:18): [True: 661, False: 1.52k]
  |  Branch (170:36): [True: 73, False: 588]
  ------------------
  171|  2.37k|                ((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: 588, False: 1.52k]
  |  Branch (171:36): [True: 1, False: 587]
  ------------------
  172|  4.93k|        case Fragment::OR_B: return
  ------------------
  |  Branch (172:9): [True: 4.93k, False: 1.83M]
  ------------------
  173|  4.93k|            "B"_mst.If(x << "Bd"_mst && y << "Wd"_mst) | // B=B_x*d_x*W_x*d_y
  ------------------
  |  Branch (173:24): [True: 2.31k, False: 2.61k]
  |  Branch (173:41): [True: 1.43k, False: 878]
  ------------------
  174|  4.93k|            ((x | y) & "o"_mst).If((x | y) << "z"_mst) | // o=o_x*z_y+z_x*o_y
  175|  4.93k|            (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: 3.12k, False: 1.80k]
  |  Branch (175:56): [True: 1.50k, False: 1.62k]
  ------------------
  176|  4.93k|            (x & y & "zse"_mst) | // z=z_x*z_y, s=s_x*s_y, e=e_x*e_y
  177|  4.93k|            "dux"_mst | // d, u, x
  178|  4.93k|            ((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|  4.93k|            (x & y & "k"_mst); // k=k_x*k_y
  180|  4.25k|        case Fragment::OR_D: return
  ------------------
  |  Branch (180:9): [True: 4.25k, False: 1.83M]
  ------------------
  181|  4.25k|            (y & "B"_mst).If(x << "Bdu"_mst) | // B=B_y*B_x*d_x*u_x
  182|  4.25k|            (x & "o"_mst).If(y << "z"_mst) | // o=o_x*z_y
  183|  4.25k|            (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: 3.48k, False: 767]
  |  Branch (183:50): [True: 1.49k, False: 1.99k]
  ------------------
  184|  4.25k|            (x & y & "zs"_mst) | // z=z_x*z_y, s=s_x*s_y
  185|  4.25k|            (y & "ufde"_mst) | // u=u_y, f=f_y, d=d_y, e=e_y
  186|  4.25k|            "x"_mst | // x
  187|  4.25k|            ((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|  4.25k|            (x & y & "k"_mst); // k=k_x*k_y
  189|  3.83k|        case Fragment::OR_C: return
  ------------------
  |  Branch (189:9): [True: 3.83k, False: 1.83M]
  ------------------
  190|  3.83k|            (y & "V"_mst).If(x << "Bdu"_mst) | // V=V_y*B_x*u_x*d_x
  191|  3.83k|            (x & "o"_mst).If(y << "z"_mst) | // o=o_x*z_y
  192|  3.83k|            (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: 1.51k, False: 2.32k]
  |  Branch (192:50): [True: 1.39k, False: 119]
  ------------------
  193|  3.83k|            (x & y & "zs"_mst) | // z=z_x*z_y, s=s_x*s_y
  194|  3.83k|            "fx"_mst | // f, x
  195|  3.83k|            ((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.83k|            (x & y & "k"_mst); // k=k_x*k_y
  197|   493k|        case Fragment::OR_I: return
  ------------------
  |  Branch (197:9): [True: 493k, False: 1.34M]
  ------------------
  198|   493k|            (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|   493k|            "o"_mst.If((x & y) << "z"_mst) | // o=z_x*z_y
  200|   493k|            ((x | y) & "e"_mst).If((x | y) << "f"_mst) | // e=e_x*f_y+f_x*e_y
  201|   493k|            (x & y & "m"_mst).If((x | y) << "s"_mst) | // m=m_x*m_y*(s_x+s_y)
  202|   493k|            ((x | y) & "d"_mst) | // d=d_x+d_y
  203|   493k|            "x"_mst | // x
  204|   493k|            ((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|   493k|            (x & y & "k"_mst); // k=k_x*k_y
  206|  12.2k|        case Fragment::ANDOR: return
  ------------------
  |  Branch (206:9): [True: 12.2k, False: 1.82M]
  ------------------
  207|  12.2k|            (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|  12.2k|            (x & y & z & "z"_mst) | // z=z_x*z_y*z_z
  209|  12.2k|            ((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|  12.2k|            (y & z & "u"_mst) | // u=u_y*u_z
  211|  12.2k|            (z & "f"_mst).If((x << "s"_mst) || (y << "f"_mst)) | // f=(s_x+f_y)*f_z
  ------------------
  |  Branch (211:30): [True: 1.86k, False: 10.3k]
  |  Branch (211:48): [True: 7.82k, False: 2.57k]
  ------------------
  212|  12.2k|            (z & "d"_mst) | // d=d_z
  213|  12.2k|            (z & "e"_mst).If(x << "s"_mst || y << "f"_mst) | // e=e_z*(s_x+f_y)
  ------------------
  |  Branch (213:30): [True: 1.86k, False: 10.3k]
  |  Branch (213:46): [True: 7.82k, False: 2.57k]
  ------------------
  214|  12.2k|            (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: 5.53k, False: 6.72k]
  |  Branch (214:54): [True: 2.60k, False: 2.93k]
  ------------------
  215|  12.2k|            (z & (x | y) & "s"_mst) | // s=s_z*(s_x+s_y)
  216|  12.2k|            "x"_mst | // x
  217|  12.2k|            ((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|  12.2k|            "k"_mst.If(((x & y & z) << "k"_mst) &&
  ------------------
  |  Branch (218:24): [True: 4.67k, False: 7.58k]
  ------------------
  219|  12.2k|                !(((x << "g"_mst) && (y << "h"_mst)) ||
  ------------------
  |  Branch (219:20): [True: 76, False: 4.60k]
  |  Branch (219:38): [True: 10, False: 66]
  ------------------
  220|  4.67k|                ((x << "h"_mst) && (y << "g"_mst)) ||
  ------------------
  |  Branch (220:18): [True: 525, False: 4.14k]
  |  Branch (220:36): [True: 20, False: 505]
  ------------------
  221|  4.67k|                ((x << "i"_mst) && (y << "j"_mst)) ||
  ------------------
  |  Branch (221:18): [True: 518, False: 4.13k]
  |  Branch (221:36): [True: 294, False: 224]
  ------------------
  222|  4.67k|                ((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: 323, False: 4.03k]
  |  Branch (222:36): [True: 90, False: 233]
  ------------------
  223|  1.82k|        case Fragment::MULTI: {
  ------------------
  |  Branch (223:9): [True: 1.82k, False: 1.83M]
  ------------------
  224|  1.82k|            return "Bnudemsk"_mst;
  225|      0|        }
  226|    751|        case Fragment::MULTI_A: {
  ------------------
  |  Branch (226:9): [True: 751, False: 1.83M]
  ------------------
  227|    751|            return "Budemsk"_mst;
  228|      0|        }
  229|  9.44k|        case Fragment::THRESH: {
  ------------------
  |  Branch (229:9): [True: 9.44k, False: 1.83M]
  ------------------
  230|  9.44k|            bool all_e = true;
  231|  9.44k|            bool all_m = true;
  232|  9.44k|            uint32_t args = 0;
  233|  9.44k|            uint32_t num_s = 0;
  234|  9.44k|            Type acc_tl = "k"_mst;
  235|  29.6k|            for (size_t i = 0; i < sub_types.size(); ++i) {
  ------------------
  |  Branch (235:32): [True: 25.3k, False: 4.33k]
  ------------------
  236|  25.3k|                Type t = sub_types[i];
  237|  25.3k|                static constexpr auto WDU{"Wdu"_mst}, BDU{"Bdu"_mst};
  238|  25.3k|                if (!(t << (i ? WDU : BDU))) return ""_mst; // Require Bdu, Wdu, Wdu, ...
  ------------------
  |  Branch (238:21): [True: 5.10k, False: 20.2k]
  |  Branch (238:29): [True: 15.8k, False: 9.44k]
  ------------------
  239|  20.2k|                if (!(t << "e"_mst)) all_e = false;
  ------------------
  |  Branch (239:21): [True: 6.71k, False: 13.4k]
  ------------------
  240|  20.2k|                if (!(t << "m"_mst)) all_m = false;
  ------------------
  |  Branch (240:21): [True: 2.80k, False: 17.4k]
  ------------------
  241|  20.2k|                if (t << "s"_mst) num_s += 1;
  ------------------
  |  Branch (241:21): [True: 4.77k, False: 15.4k]
  ------------------
  242|  20.2k|                args += (t << "z"_mst) ? 0 : (t << "o"_mst) ? 1 : 2;
  ------------------
  |  Branch (242:25): [True: 824, False: 19.3k]
  |  Branch (242:46): [True: 1.73k, False: 17.6k]
  ------------------
  243|  20.2k|                acc_tl = ((acc_tl | t) & "ghij"_mst) |
  244|       |                    // Thresh contains a combination of timelocks if it has threshold > 1 and
  245|       |                    // it contains two different children that have different types of timelocks
  246|       |                    // Note how if any of the children don't have "k", the parent also does not have "k"
  247|  20.2k|                    "k"_mst.If(((acc_tl & t) << "k"_mst) && ((k <= 1) ||
  ------------------
  |  Branch (247:32): [True: 19.5k, False: 654]
  |  Branch (247:62): [True: 5.46k, False: 14.0k]
  ------------------
  248|  19.5k|                        ((k > 1) && !(((acc_tl << "g"_mst) && (t << "h"_mst)) ||
  ------------------
  |  Branch (248:26): [True: 14.0k, False: 0]
  |  Branch (248:40): [True: 268, False: 13.8k]
  |  Branch (248:63): [True: 74, False: 194]
  ------------------
  249|  14.0k|                        ((acc_tl << "h"_mst) && (t << "g"_mst)) ||
  ------------------
  |  Branch (249:26): [True: 400, False: 13.6k]
  |  Branch (249:49): [True: 67, False: 333]
  ------------------
  250|  14.0k|                        ((acc_tl << "i"_mst) && (t << "j"_mst)) ||
  ------------------
  |  Branch (250:26): [True: 405, False: 13.5k]
  |  Branch (250:49): [True: 206, False: 199]
  ------------------
  251|  14.0k|                        ((acc_tl << "j"_mst) && (t << "i"_mst))))));
  ------------------
  |  Branch (251:26): [True: 428, False: 13.3k]
  |  Branch (251:49): [True: 5, False: 423]
  ------------------
  252|  20.2k|            }
  253|  4.33k|            return "Bdu"_mst |
  254|  4.33k|                   "z"_mst.If(args == 0) | // z=all z
  255|  4.33k|                   "o"_mst.If(args == 1) | // o=all z except one o
  256|  4.33k|                   "e"_mst.If(all_e && num_s == n_subs) | // e=all e and all s
  ------------------
  |  Branch (256:31): [True: 2.64k, False: 1.68k]
  |  Branch (256:40): [True: 344, False: 2.30k]
  ------------------
  257|  4.33k|                   "m"_mst.If(all_e && all_m && num_s >= n_subs - k) | // m=all e, >=(n-k) s
  ------------------
  |  Branch (257:31): [True: 2.64k, False: 1.68k]
  |  Branch (257:40): [True: 745, False: 1.90k]
  |  Branch (257:49): [True: 585, False: 160]
  ------------------
  258|  4.33k|                   "s"_mst.If(num_s >= n_subs - k + 1) |  // s= >=(n-k+1) s
  259|  4.33k|                   acc_tl; // timelock info
  260|  9.44k|            }
  261|  1.84M|    }
  262|      0|    assert(false);
  263|      0|}
_ZN10miniscript8internal16ComputeScriptLenENS_8FragmentENS_4TypeEmjmmNS_17MiniscriptContextE:
  266|  1.84M|                        size_t n_keys, MiniscriptContext ms_ctx) {
  267|  1.84M|    switch (fragment) {
  ------------------
  |  Branch (267:13): [True: 0, False: 1.84M]
  ------------------
  268|   186k|        case Fragment::JUST_1:
  ------------------
  |  Branch (268:9): [True: 186k, False: 1.65M]
  ------------------
  269|   766k|        case Fragment::JUST_0: return 1;
  ------------------
  |  Branch (269:9): [True: 580k, False: 1.25M]
  ------------------
  270|  6.19k|        case Fragment::PK_K: return IsTapscript(ms_ctx) ? 33 : 34;
  ------------------
  |  Branch (270:9): [True: 6.19k, False: 1.83M]
  |  Branch (270:37): [True: 5.20k, False: 987]
  ------------------
  271|  2.16k|        case Fragment::PK_H: return 3 + 21;
  ------------------
  |  Branch (271:9): [True: 2.16k, False: 1.83M]
  ------------------
  272|  3.74k|        case Fragment::OLDER:
  ------------------
  |  Branch (272:9): [True: 3.74k, False: 1.83M]
  ------------------
  273|  10.4k|        case Fragment::AFTER: return 1 + BuildScript(k).size();
  ------------------
  |  Branch (273:9): [True: 6.72k, False: 1.83M]
  ------------------
  274|    150|        case Fragment::HASH256:
  ------------------
  |  Branch (274:9): [True: 150, False: 1.84M]
  ------------------
  275|    222|        case Fragment::SHA256: return 4 + 2 + 33;
  ------------------
  |  Branch (275:9): [True: 72, False: 1.84M]
  ------------------
  276|    277|        case Fragment::HASH160:
  ------------------
  |  Branch (276:9): [True: 277, False: 1.84M]
  ------------------
  277|    507|        case Fragment::RIPEMD160: return 4 + 2 + 21;
  ------------------
  |  Branch (277:9): [True: 230, False: 1.84M]
  ------------------
  278|  1.82k|        case Fragment::MULTI: return 1 + BuildScript(n_keys).size() + BuildScript(k).size() + 34 * n_keys;
  ------------------
  |  Branch (278:9): [True: 1.82k, False: 1.83M]
  ------------------
  279|    751|        case Fragment::MULTI_A: return (1 + 32 + 1) * n_keys + BuildScript(k).size() + 1;
  ------------------
  |  Branch (279:9): [True: 751, False: 1.83M]
  ------------------
  280|  81.9k|        case Fragment::AND_V: return subsize;
  ------------------
  |  Branch (280:9): [True: 81.9k, False: 1.75M]
  ------------------
  281|  33.8k|        case Fragment::WRAP_V: return subsize + (sub0typ << "x"_mst);
  ------------------
  |  Branch (281:9): [True: 33.8k, False: 1.80M]
  ------------------
  282|  6.23k|        case Fragment::WRAP_S:
  ------------------
  |  Branch (282:9): [True: 6.23k, False: 1.83M]
  ------------------
  283|   133k|        case Fragment::WRAP_C:
  ------------------
  |  Branch (283:9): [True: 127k, False: 1.71M]
  ------------------
  284|   271k|        case Fragment::WRAP_N:
  ------------------
  |  Branch (284:9): [True: 137k, False: 1.70M]
  ------------------
  285|   281k|        case Fragment::AND_B:
  ------------------
  |  Branch (285:9): [True: 9.76k, False: 1.83M]
  ------------------
  286|   286k|        case Fragment::OR_B: return subsize + 1;
  ------------------
  |  Branch (286:9): [True: 4.93k, False: 1.83M]
  ------------------
  287|  62.2k|        case Fragment::WRAP_A:
  ------------------
  |  Branch (287:9): [True: 62.2k, False: 1.77M]
  ------------------
  288|  66.1k|        case Fragment::OR_C: return subsize + 2;
  ------------------
  |  Branch (288:9): [True: 3.83k, False: 1.83M]
  ------------------
  289|  53.3k|        case Fragment::WRAP_D:
  ------------------
  |  Branch (289:9): [True: 53.3k, False: 1.78M]
  ------------------
  290|  57.6k|        case Fragment::OR_D:
  ------------------
  |  Branch (290:9): [True: 4.25k, False: 1.83M]
  ------------------
  291|   550k|        case Fragment::OR_I:
  ------------------
  |  Branch (291:9): [True: 493k, False: 1.34M]
  ------------------
  292|   563k|        case Fragment::ANDOR: return subsize + 3;
  ------------------
  |  Branch (292:9): [True: 12.2k, False: 1.82M]
  ------------------
  293|  10.6k|        case Fragment::WRAP_J: return subsize + 4;
  ------------------
  |  Branch (293:9): [True: 10.6k, False: 1.82M]
  ------------------
  294|  9.44k|        case Fragment::THRESH: return subsize + n_subs + BuildScript(k).size();
  ------------------
  |  Branch (294:9): [True: 9.44k, False: 1.83M]
  ------------------
  295|  1.84M|    }
  296|      0|    assert(false);
  297|      0|}
_ZN10miniscript8internal15DecomposeScriptERK7CScript:
  370|  1.34k|{
  371|  1.34k|    std::vector<Opcode> out;
  372|  1.34k|    CScript::const_iterator it = script.begin(), itend = script.end();
  373|  51.8k|    while (it != itend) {
  ------------------
  |  Branch (373:12): [True: 50.5k, False: 1.34k]
  ------------------
  374|  50.5k|        std::vector<unsigned char> push_data;
  375|  50.5k|        opcodetype opcode;
  376|  50.5k|        if (!script.GetOp(it, opcode, push_data)) {
  ------------------
  |  Branch (376:13): [True: 0, False: 50.5k]
  ------------------
  377|      0|            return {};
  378|  50.5k|        } else if (opcode >= OP_1 && opcode <= OP_16) {
  ------------------
  |  Branch (378:20): [True: 38.8k, False: 11.6k]
  |  Branch (378:38): [True: 2.24k, False: 36.6k]
  ------------------
  379|       |            // Deal with OP_n (GetOp does not turn them into pushes).
  380|  2.24k|            push_data.assign(1, CScript::DecodeOP_N(opcode));
  381|  48.3k|        } else if (opcode == OP_CHECKSIGVERIFY) {
  ------------------
  |  Branch (381:20): [True: 130, False: 48.1k]
  ------------------
  382|       |            // Decompose OP_CHECKSIGVERIFY into OP_CHECKSIG OP_VERIFY
  383|    130|            out.emplace_back(OP_CHECKSIG, std::vector<unsigned char>());
  384|    130|            opcode = OP_VERIFY;
  385|  48.1k|        } else if (opcode == OP_CHECKMULTISIGVERIFY) {
  ------------------
  |  Branch (385:20): [True: 20, False: 48.1k]
  ------------------
  386|       |            // Decompose OP_CHECKMULTISIGVERIFY into OP_CHECKMULTISIG OP_VERIFY
  387|     20|            out.emplace_back(OP_CHECKMULTISIG, std::vector<unsigned char>());
  388|     20|            opcode = OP_VERIFY;
  389|  48.1k|        } else if (opcode == OP_EQUALVERIFY) {
  ------------------
  |  Branch (389:20): [True: 554, False: 47.5k]
  ------------------
  390|       |            // Decompose OP_EQUALVERIFY into OP_EQUAL OP_VERIFY
  391|    554|            out.emplace_back(OP_EQUAL, std::vector<unsigned char>());
  392|    554|            opcode = OP_VERIFY;
  393|  47.5k|        } else if (opcode == OP_NUMEQUALVERIFY) {
  ------------------
  |  Branch (393:20): [True: 17, False: 47.5k]
  ------------------
  394|       |            // Decompose OP_NUMEQUALVERIFY into OP_NUMEQUAL OP_VERIFY
  395|     17|            out.emplace_back(OP_NUMEQUAL, std::vector<unsigned char>());
  396|     17|            opcode = OP_VERIFY;
  397|  47.5k|        } else if (IsPushdataOp(opcode)) {
  ------------------
  |  Branch (397:20): [True: 2.90k, False: 44.6k]
  ------------------
  398|  2.90k|            if (!CheckMinimalPush(push_data, opcode)) return {};
  ------------------
  |  Branch (398:17): [True: 0, False: 2.90k]
  ------------------
  399|  44.6k|        } else if (it != itend && (opcode == OP_CHECKSIG || opcode == OP_CHECKMULTISIG || opcode == OP_EQUAL || opcode == OP_NUMEQUAL) && (*it == OP_VERIFY)) {
  ------------------
  |  Branch (399:20): [True: 43.4k, False: 1.26k]
  |  Branch (399:36): [True: 458, False: 42.9k]
  |  Branch (399:61): [True: 377, False: 42.5k]
  |  Branch (399:91): [True: 13, False: 42.5k]
  |  Branch (399:113): [True: 154, False: 42.4k]
  |  Branch (399:139): [True: 0, False: 1.00k]
  ------------------
  400|       |            // Rule out non minimal VERIFY sequences
  401|      0|            return {};
  402|      0|        }
  403|  50.5k|        out.emplace_back(opcode, std::move(push_data));
  404|  50.5k|    }
  405|  1.34k|    std::reverse(out.begin(), out.end());
  406|  1.34k|    return out;
  407|  1.34k|}
_ZN10miniscript8internal17ParseScriptNumberERKNSt3__14pairI10opcodetypeNS1_6vectorIhNS1_9allocatorIhEEEEEE:
  409|  1.17k|std::optional<int64_t> ParseScriptNumber(const Opcode& in) {
  410|  1.17k|    if (in.first == OP_0) {
  ------------------
  |  Branch (410:9): [True: 0, False: 1.17k]
  ------------------
  411|      0|        return 0;
  412|      0|    }
  413|  1.17k|    if (!in.second.empty()) {
  ------------------
  |  Branch (413:9): [True: 1.17k, False: 0]
  ------------------
  414|  1.17k|        if (IsPushdataOp(in.first) && !CheckMinimalPush(in.second, in.first)) return {};
  ------------------
  |  Branch (414:13): [True: 134, False: 1.03k]
  |  Branch (414:39): [True: 0, False: 134]
  ------------------
  415|  1.17k|        try {
  416|  1.17k|            return CScriptNum(in.second, true).GetInt64();
  417|  1.17k|        } catch(const scriptnum_error&) {}
  418|  1.17k|    }
  419|      3|    return {};
  420|  1.17k|}
_ZN10miniscript8internal12FindNextCharE4SpanIKcEc:
  423|  50.3k|{
  424|  23.6M|    for (int i = 0; i < (int)sp.size(); ++i) {
  ------------------
  |  Branch (424:21): [True: 23.6M, False: 259]
  ------------------
  425|  23.6M|        if (sp[i] == m) return i;
  ------------------
  |  Branch (425:13): [True: 48.5k, False: 23.5M]
  ------------------
  426|       |        // We only search within the current parentheses
  427|  23.5M|        if (sp[i] == ')') break;
  ------------------
  |  Branch (427:13): [True: 1.50k, False: 23.5M]
  ------------------
  428|  23.5M|    }
  429|  1.76k|    return -1;
  430|  50.3k|}

_ZNK10miniscript4TypeorES0_:
  138|  8.85M|    constexpr Type operator|(Type x) const { return Type(m_flags | x.m_flags); }
_ZN10miniscript4TypeC2Ej:
  131|  18.7M|    explicit constexpr Type(uint32_t flags) noexcept : m_flags(flags) {}
_ZN10miniscript11IsTapscriptENS_17MiniscriptContextE:
  246|  4.46M|{
  247|  4.46M|    switch (ms_ctx) {
  ------------------
  |  Branch (247:13): [True: 0, False: 4.46M]
  ------------------
  248|   539k|        case MiniscriptContext::P2WSH: return false;
  ------------------
  |  Branch (248:9): [True: 539k, False: 3.92M]
  ------------------
  249|  3.92M|        case MiniscriptContext::TAPSCRIPT: return true;
  ------------------
  |  Branch (249:9): [True: 3.92M, False: 539k]
  ------------------
  250|  4.46M|    }
  251|      0|    assert(false);
  252|      0|}
_ZNK10miniscript4TypelsES0_:
  144|  33.4M|    constexpr bool operator<<(Type x) const { return (x.m_flags & ~m_flags) == 0; }
_ZNK10miniscript4TypeanES0_:
  141|  7.28M|    constexpr Type operator&(Type x) const { return Type(m_flags & x.m_flags); }
_ZN10miniscript8internal13MaxScriptSizeENS_17MiniscriptContextE:
  271|   296k|{
  272|   296k|    if (IsTapscript(ms_ctx)) {
  ------------------
  |  Branch (272:9): [True: 189k, False: 106k]
  ------------------
  273|       |        // Leaf scripts under Tapscript are not explicitly limited in size. They are only implicitly
  274|       |        // bounded by the maximum standard size of a spending transaction. Let the maximum script
  275|       |        // size conservatively be small enough such that even a maximum sized witness and a reasonably
  276|       |        // sized spending transaction can spend an output paying to this script without running into
  277|       |        // the maximum standard tx size limit.
  278|   189k|        constexpr auto max_size{MAX_STANDARD_TX_WEIGHT - TX_BODY_LEEWAY_WEIGHT - MAX_TAPSCRIPT_SAT_SIZE};
  279|   189k|        return max_size - GetSizeOfCompactSize(max_size);
  280|   189k|    }
  281|   106k|    return MAX_STANDARD_P2WSH_SCRIPT_SIZE;
  282|   296k|}
_ZN10miniscript8internal6MaxIntIjEC2Ej:
  356|  19.3M|    MaxInt(I val) : valid(true), value(val) {}
_ZN10miniscript8internal6MaxIntIjEC2Ev:
  355|  14.1M|    MaxInt() : valid(false), value(0) {}
_ZN10miniscript8internal3OpsC2EjNS0_6MaxIntIjEES3_:
  378|  1.84M|    Ops(uint32_t in_count, MaxInt<uint32_t> in_sat, MaxInt<uint32_t> in_dsat) : count(in_count), sat(in_sat), dsat(in_dsat) {};
_ZN10miniscript8internalplERKNS0_6MaxIntIjEES4_:
  358|  22.5M|    friend MaxInt<I> operator+(const MaxInt<I>& a, const MaxInt<I>& b) {
  359|  22.5M|        if (!a.valid || !b.valid) return {};
  ------------------
  |  Branch (359:13): [True: 11.8M, False: 10.7M]
  |  Branch (359:25): [True: 524k, False: 10.1M]
  ------------------
  360|  10.1M|        return a.value + b.value;
  361|  22.5M|    }
_ZN10miniscript8internalorERKNS0_6MaxIntIjEES4_:
  363|  11.4M|    friend MaxInt<I> operator|(const MaxInt<I>& a, const MaxInt<I>& b) {
  364|  11.4M|        if (!a.valid) return b;
  ------------------
  |  Branch (364:13): [True: 6.00M, False: 5.49M]
  ------------------
  365|  5.49M|        if (!b.valid) return a;
  ------------------
  |  Branch (365:13): [True: 1.11M, False: 4.38M]
  ------------------
  366|  4.38M|        return std::max(a.value, b.value);
  367|  5.49M|    }
_ZN10miniscript8internal7SatInfoC2Ev:
  431|  9.54M|    constexpr SatInfo() noexcept : valid(false), netdiff(0), exec(0) {}
_ZN10miniscript8internal7SatInfo4PushEv:
  461|   806k|    static constexpr SatInfo Push() noexcept { return {-1, 0}; }
_ZN10miniscript8internal9StackSizeC2ENS0_7SatInfoES2_:
  485|  1.62M|    constexpr StackSize(SatInfo in_sat, SatInfo in_dsat) noexcept : sat(in_sat), dsat(in_dsat) {};
_ZN10miniscript8internalplERKNS0_7SatInfoES3_:
  449|  16.3M|    {
  450|       |        // Concatenation with an empty set yields an empty set.
  451|  16.3M|        if (!a.valid || !b.valid) return {};
  ------------------
  |  Branch (451:13): [True: 8.33M, False: 7.98M]
  |  Branch (451:25): [True: 312k, False: 7.67M]
  ------------------
  452|       |        // Otherwise, the maximum stack size difference for the combined scripts is the sum of the
  453|       |        // netdiffs, and the maximum stack size difference anywhere is either b.exec (if the
  454|       |        // maximum occurred in b) or b.netdiff+a.exec (if the maximum occurred in a).
  455|  7.67M|        return {a.netdiff + b.netdiff, std::max(b.exec, b.netdiff + a.exec)};
  456|  16.3M|    }
_ZN10miniscript8internal7SatInfo3NopEv:
  465|  10.4k|    static constexpr SatInfo Nop() noexcept { return {0, 0}; }
_ZN10miniscript8internal9StackSizeC2ENS0_7SatInfoE:
  486|  10.9k|    constexpr StackSize(SatInfo in_both) noexcept : sat(in_both), dsat(in_both) {};
_ZN10miniscript8internal7SatInfo6OP_DUPEv:
  472|   108k|    static constexpr SatInfo OP_DUP() noexcept { return {-1, 0}; }
_ZN10miniscript8internal7SatInfo4HashEv:
  463|  2.89k|    static constexpr SatInfo Hash() noexcept { return {0, 0}; }
_ZN10miniscript8internal7SatInfo14OP_EQUALVERIFYEv:
  474|  2.89k|    static constexpr SatInfo OP_EQUALVERIFY() noexcept { return {2, 2}; }
_ZN10miniscript8internal7SatInfo7OP_SIZEEv:
  476|  22.0k|    static constexpr SatInfo OP_SIZE() noexcept { return {-1, 0}; }
_ZN10miniscript8internal7SatInfo8OP_EQUALEv:
  475|  19.6k|    static constexpr SatInfo OP_EQUAL() noexcept { return {1, 1}; }
_ZN10miniscript8internalorERKNS0_7SatInfoES3_:
  439|  5.74M|    {
  440|       |        // Union with an empty set is itself.
  441|  5.74M|        if (!a.valid) return b;
  ------------------
  |  Branch (441:13): [True: 3.00M, False: 2.74M]
  ------------------
  442|  2.74M|        if (!b.valid) return a;
  ------------------
  |  Branch (442:13): [True: 556k, False: 2.19M]
  ------------------
  443|       |        // Otherwise the netdiff and exec of the union is the maximum of the individual values.
  444|  2.19M|        return {std::max(a.netdiff, b.netdiff), std::max(a.exec, b.exec)};
  445|  2.74M|    }
_ZN10miniscript8internal7SatInfo2IfEv:
  467|  1.17M|    static constexpr SatInfo If() noexcept { return {1, 1}; }
_ZN10miniscript8internal7SatInfo8BinaryOpEv:
  469|  94.0k|    static constexpr SatInfo BinaryOp() noexcept { return {1, 1}; }
_ZN10miniscript8internal7SatInfo8OP_IFDUPEb:
  473|  12.7k|    static constexpr SatInfo OP_IFDUP(bool nonzero) noexcept { return {nonzero ? -1 : 0, 0}; }
  ------------------
  |  Branch (473:72): [True: 4.25k, False: 8.51k]
  ------------------
_ZN10miniscript8internal7SatInfoC2Eii:
  435|  12.4M|        valid{true}, netdiff{in_netdiff}, exec{in_exec} {}
_ZN10miniscript8internal7SatInfo11OP_CHECKSIGEv:
  477|   255k|    static constexpr SatInfo OP_CHECKSIG() noexcept { return {1, 1}; }
_ZN10miniscript8internal7SatInfo9OP_VERIFYEv:
  479|  33.8k|    static constexpr SatInfo OP_VERIFY() noexcept { return {1, 1}; }
_ZN10miniscript8internal7SatInfo12OP_0NOTEQUALEv:
  478|  21.3k|    static constexpr SatInfo OP_0NOTEQUAL() noexcept { return {0, 0}; }
_ZN10miniscript8internal7SatInfo5EmptyEv:
  459|  18.8k|    static constexpr SatInfo Empty() noexcept { return {0, 0}; }
_ZN10miniscript8internal11WitnessSizeC2ENS0_6MaxIntIjEES3_:
  495|  1.50M|    WitnessSize(MaxInt<uint32_t> in_sat, MaxInt<uint32_t> in_dsat) : sat(in_sat), dsat(in_dsat) {};
_ZNK10miniscript4TypeeqES0_:
  150|   423k|    constexpr bool operator==(Type x) const { return m_flags == x.m_flags; }
_ZNK10miniscript4Type2IfEb:
  153|  2.58M|    constexpr Type If(bool x) const { return Type(x ? m_flags : 0); }
  ------------------
  |  Branch (153:51): [True: 1.12M, False: 1.46M]
  ------------------
descriptor.cpp:_ZN10miniscript10FromStringIN12_GLOBAL__N_19KeyParserEEENSt3__110unique_ptrIKNS_4NodeINT_3KeyEEENS3_14default_deleteIS9_EEEERKNS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKS6_:
 2640|  7.46k|inline NodeRef<typename Ctx::Key> FromString(const std::string& str, const Ctx& ctx) {
 2641|  7.46k|    return internal::Parse<typename Ctx::Key>(str, ctx);
 2642|  7.46k|}
descriptor.cpp:_ZN10miniscript8internal5ParseIjN12_GLOBAL__N_19KeyParserEEENSt3__110unique_ptrIKNS_4NodeIT_EENS4_14default_deleteIS9_EEEE4SpanIKcERKT0_:
 1794|  7.46k|{
 1795|  7.46k|    using namespace script;
 1796|       |
 1797|       |    // Account for the minimum script size for all parsed fragments so far. It "borrows" 1
 1798|       |    // script byte from all leaf nodes, counting it instead whenever a space for a recursive
 1799|       |    // expression is added (through andor, and_*, or_*, thresh). This guarantees that all fragments
 1800|       |    // increment the script_size by at least one, except for:
 1801|       |    // - "0", "1": these leafs are only a single byte, so their subtracted-from increment is 0.
 1802|       |    //   This is not an issue however, as "space" for them has to be created by combinators,
 1803|       |    //   which do increment script_size.
 1804|       |    // - "v:": the v wrapper adds nothing as in some cases it results in no opcode being added
 1805|       |    //   (instead transforming another opcode into its VERIFY form). However, the v: wrapper has
 1806|       |    //   to be interleaved with other fragments to be valid, so this is not a concern.
 1807|  7.46k|    size_t script_size{1};
 1808|  7.46k|    size_t max_size{internal::MaxScriptSize(ctx.MsContext())};
 1809|       |
 1810|       |    // The two integers are used to hold state for thresh()
 1811|  7.46k|    std::vector<std::tuple<ParseContext, int64_t, int64_t>> to_parse;
 1812|  7.46k|    std::vector<NodeRef<Key>> constructed;
 1813|       |
 1814|  7.46k|    to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 1815|       |
 1816|       |    // Parses a multi() or multi_a() from its string representation. Returns false on parsing error.
 1817|  7.46k|    const auto parse_multi_exp = [&](Span<const char>& in, const bool is_multi_a) -> bool {
 1818|  7.46k|        const auto max_keys{is_multi_a ? MAX_PUBKEYS_PER_MULTI_A : MAX_PUBKEYS_PER_MULTISIG};
 1819|  7.46k|        const auto required_ctx{is_multi_a ? MiniscriptContext::TAPSCRIPT : MiniscriptContext::P2WSH};
 1820|  7.46k|        if (ctx.MsContext() != required_ctx) return false;
 1821|       |        // Get threshold
 1822|  7.46k|        int next_comma = FindNextChar(in, ',');
 1823|  7.46k|        if (next_comma < 1) return false;
 1824|  7.46k|        const auto k_to_integral{ToIntegral<int64_t>(std::string_view(in.data(), next_comma))};
 1825|  7.46k|        if (!k_to_integral.has_value()) return false;
 1826|  7.46k|        const int64_t k{k_to_integral.value()};
 1827|  7.46k|        in = in.subspan(next_comma + 1);
 1828|       |        // Get keys. It is compatible for both compressed and x-only keys.
 1829|  7.46k|        std::vector<Key> keys;
 1830|  7.46k|        while (next_comma != -1) {
 1831|  7.46k|            next_comma = FindNextChar(in, ',');
 1832|  7.46k|            int key_length = (next_comma == -1) ? FindNextChar(in, ')') : next_comma;
 1833|  7.46k|            if (key_length < 1) return false;
 1834|  7.46k|            auto key = ctx.FromString(in.begin(), in.begin() + key_length);
 1835|  7.46k|            if (!key) return false;
 1836|  7.46k|            keys.push_back(std::move(*key));
 1837|  7.46k|            in = in.subspan(key_length + 1);
 1838|  7.46k|        }
 1839|  7.46k|        if (keys.size() < 1 || keys.size() > max_keys) return false;
 1840|  7.46k|        if (k < 1 || k > (int64_t)keys.size()) return false;
 1841|  7.46k|        if (is_multi_a) {
 1842|       |            // (push + xonly-key + CHECKSIG[ADD]) * n + k + OP_NUMEQUAL(VERIFY), minus one.
 1843|  7.46k|            script_size += (1 + 32 + 1) * keys.size() + BuildScript(k).size();
 1844|  7.46k|            constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::MULTI_A, std::move(keys), k));
 1845|  7.46k|        } else {
 1846|  7.46k|            script_size += 2 + (keys.size() > 16) + (k > 16) + 34 * keys.size();
 1847|  7.46k|            constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::MULTI, std::move(keys), k));
 1848|  7.46k|        }
 1849|  7.46k|        return true;
 1850|  7.46k|    };
 1851|       |
 1852|  1.66M|    while (!to_parse.empty()) {
  ------------------
  |  Branch (1852:12): [True: 1.66M, False: 4.76k]
  ------------------
 1853|  1.66M|        if (script_size > max_size) return {};
  ------------------
  |  Branch (1853:13): [True: 2, False: 1.66M]
  ------------------
 1854|       |
 1855|       |        // Get the current context we are decoding within
 1856|  1.66M|        auto [cur_context, n, k] = to_parse.back();
 1857|  1.66M|        to_parse.pop_back();
 1858|       |
 1859|  1.66M|        switch (cur_context) {
  ------------------
  |  Branch (1859:17): [True: 0, False: 1.66M]
  ------------------
 1860|   240k|        case ParseContext::WRAPPED_EXPR: {
  ------------------
  |  Branch (1860:9): [True: 240k, False: 1.42M]
  ------------------
 1861|   240k|            std::optional<size_t> colon_index{};
 1862|  1.44M|            for (size_t i = 1; i < in.size(); ++i) {
  ------------------
  |  Branch (1862:32): [True: 1.44M, False: 460]
  ------------------
 1863|  1.44M|                if (in[i] == ':') {
  ------------------
  |  Branch (1863:21): [True: 133k, False: 1.31M]
  ------------------
 1864|   133k|                    colon_index = i;
 1865|   133k|                    break;
 1866|   133k|                }
 1867|  1.31M|                if (in[i] < 'a' || in[i] > 'z') break;
  ------------------
  |  Branch (1867:21): [True: 106k, False: 1.20M]
  |  Branch (1867:36): [True: 13, False: 1.20M]
  ------------------
 1868|  1.31M|            }
 1869|       |            // If there is no colon, this loop won't execute
 1870|   240k|            bool last_was_v{false};
 1871|  1.39M|            for (size_t j = 0; colon_index && j < *colon_index; ++j) {
  ------------------
  |  Branch (1871:32): [True: 1.28M, False: 107k]
  |  Branch (1871:47): [True: 1.15M, False: 133k]
  ------------------
 1872|  1.15M|                if (script_size > max_size) return {};
  ------------------
  |  Branch (1872:21): [True: 1, False: 1.15M]
  ------------------
 1873|  1.15M|                if (in[j] == 'a') {
  ------------------
  |  Branch (1873:21): [True: 168k, False: 983k]
  ------------------
 1874|   168k|                    script_size += 2;
 1875|   168k|                    to_parse.emplace_back(ParseContext::ALT, -1, -1);
 1876|   983k|                } else if (in[j] == 's') {
  ------------------
  |  Branch (1876:28): [True: 7.18k, False: 976k]
  ------------------
 1877|  7.18k|                    script_size += 1;
 1878|  7.18k|                    to_parse.emplace_back(ParseContext::SWAP, -1, -1);
 1879|   976k|                } else if (in[j] == 'c') {
  ------------------
  |  Branch (1879:28): [True: 125k, False: 850k]
  ------------------
 1880|   125k|                    script_size += 1;
 1881|   125k|                    to_parse.emplace_back(ParseContext::CHECK, -1, -1);
 1882|   850k|                } else if (in[j] == 'd') {
  ------------------
  |  Branch (1882:28): [True: 71.1k, False: 779k]
  ------------------
 1883|  71.1k|                    script_size += 3;
 1884|  71.1k|                    to_parse.emplace_back(ParseContext::DUP_IF, -1, -1);
 1885|   779k|                } else if (in[j] == 'j') {
  ------------------
  |  Branch (1885:28): [True: 9.83k, False: 770k]
  ------------------
 1886|  9.83k|                    script_size += 4;
 1887|  9.83k|                    to_parse.emplace_back(ParseContext::NON_ZERO, -1, -1);
 1888|   770k|                } else if (in[j] == 'n') {
  ------------------
  |  Branch (1888:28): [True: 158k, False: 611k]
  ------------------
 1889|   158k|                    script_size += 1;
 1890|   158k|                    to_parse.emplace_back(ParseContext::ZERO_NOTEQUAL, -1, -1);
 1891|   611k|                } else if (in[j] == 'v') {
  ------------------
  |  Branch (1891:28): [True: 30.8k, False: 580k]
  ------------------
 1892|       |                    // do not permit "...vv...:"; it's not valid, and also doesn't trigger early
 1893|       |                    // failure as script_size isn't incremented.
 1894|  30.8k|                    if (last_was_v) return {};
  ------------------
  |  Branch (1894:25): [True: 1, False: 30.8k]
  ------------------
 1895|  30.8k|                    to_parse.emplace_back(ParseContext::VERIFY, -1, -1);
 1896|   580k|                } else if (in[j] == 'u') {
  ------------------
  |  Branch (1896:28): [True: 281k, False: 298k]
  ------------------
 1897|   281k|                    script_size += 4;
 1898|   281k|                    to_parse.emplace_back(ParseContext::WRAP_U, -1, -1);
 1899|   298k|                } else if (in[j] == 't') {
  ------------------
  |  Branch (1899:28): [True: 78.1k, False: 220k]
  ------------------
 1900|  78.1k|                    script_size += 1;
 1901|  78.1k|                    to_parse.emplace_back(ParseContext::WRAP_T, -1, -1);
 1902|   220k|                } else if (in[j] == 'l') {
  ------------------
  |  Branch (1902:28): [True: 220k, False: 51]
  ------------------
 1903|       |                    // The l: wrapper is equivalent to or_i(0,X)
 1904|   220k|                    script_size += 4;
 1905|   220k|                    constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_0));
 1906|   220k|                    to_parse.emplace_back(ParseContext::OR_I, -1, -1);
 1907|   220k|                } else {
 1908|     51|                    return {};
 1909|     51|                }
 1910|  1.15M|                last_was_v = (in[j] == 'v');
 1911|  1.15M|            }
 1912|   240k|            to_parse.emplace_back(ParseContext::EXPR, -1, -1);
 1913|   240k|            if (colon_index) in = in.subspan(*colon_index + 1);
  ------------------
  |  Branch (1913:17): [True: 133k, False: 107k]
  ------------------
 1914|   240k|            break;
 1915|   240k|        }
 1916|   240k|        case ParseContext::EXPR: {
  ------------------
  |  Branch (1916:9): [True: 240k, False: 1.42M]
  ------------------
 1917|   240k|            if (Const("0", in)) {
  ------------------
  |  Branch (1917:17): [True: 34.5k, False: 206k]
  ------------------
 1918|  34.5k|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_0));
 1919|   206k|            } else if (Const("1", in)) {
  ------------------
  |  Branch (1919:24): [True: 106k, False: 100k]
  ------------------
 1920|   106k|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_1));
 1921|   106k|            } else if (Const("pk(", in)) {
  ------------------
  |  Branch (1921:24): [True: 4.52k, False: 95.6k]
  ------------------
 1922|  4.52k|                auto res = ParseKeyEnd<Key, Ctx>(in, ctx);
 1923|  4.52k|                if (!res) return {};
  ------------------
  |  Branch (1923:21): [True: 100, False: 4.42k]
  ------------------
 1924|  4.42k|                auto& [key, key_size] = *res;
 1925|  4.42k|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_C, Vector(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::PK_K, Vector(std::move(key))))));
 1926|  4.42k|                in = in.subspan(key_size + 1);
 1927|  4.42k|                script_size += IsTapscript(ctx.MsContext()) ? 33 : 34;
  ------------------
  |  Branch (1927:32): [True: 4.01k, False: 412]
  ------------------
 1928|  95.6k|            } else if (Const("pkh(", in)) {
  ------------------
  |  Branch (1928:24): [True: 838, False: 94.7k]
  ------------------
 1929|    838|                auto res = ParseKeyEnd<Key>(in, ctx);
 1930|    838|                if (!res) return {};
  ------------------
  |  Branch (1930:21): [True: 33, False: 805]
  ------------------
 1931|    805|                auto& [key, key_size] = *res;
 1932|    805|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_C, Vector(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::PK_H, Vector(std::move(key))))));
 1933|    805|                in = in.subspan(key_size + 1);
 1934|    805|                script_size += 24;
 1935|  94.7k|            } else if (Const("pk_k(", in)) {
  ------------------
  |  Branch (1935:24): [True: 151, False: 94.6k]
  ------------------
 1936|    151|                auto res = ParseKeyEnd<Key>(in, ctx);
 1937|    151|                if (!res) return {};
  ------------------
  |  Branch (1937:21): [True: 3, False: 148]
  ------------------
 1938|    148|                auto& [key, key_size] = *res;
 1939|    148|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::PK_K, Vector(std::move(key))));
 1940|    148|                in = in.subspan(key_size + 1);
 1941|    148|                script_size += IsTapscript(ctx.MsContext()) ? 32 : 33;
  ------------------
  |  Branch (1941:32): [True: 77, False: 71]
  ------------------
 1942|  94.6k|            } else if (Const("pk_h(", in)) {
  ------------------
  |  Branch (1942:24): [True: 159, False: 94.4k]
  ------------------
 1943|    159|                auto res = ParseKeyEnd<Key>(in, ctx);
 1944|    159|                if (!res) return {};
  ------------------
  |  Branch (1944:21): [True: 22, False: 137]
  ------------------
 1945|    137|                auto& [key, key_size] = *res;
 1946|    137|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::PK_H, Vector(std::move(key))));
 1947|    137|                in = in.subspan(key_size + 1);
 1948|    137|                script_size += 23;
 1949|  94.4k|            } else if (Const("sha256(", in)) {
  ------------------
  |  Branch (1949:24): [True: 93, False: 94.3k]
  ------------------
 1950|     93|                auto res = ParseHexStrEnd(in, 32, ctx);
 1951|     93|                if (!res) return {};
  ------------------
  |  Branch (1951:21): [True: 21, False: 72]
  ------------------
 1952|     72|                auto& [hash, hash_size] = *res;
 1953|     72|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::SHA256, std::move(hash)));
 1954|     72|                in = in.subspan(hash_size + 1);
 1955|     72|                script_size += 38;
 1956|  94.3k|            } else if (Const("ripemd160(", in)) {
  ------------------
  |  Branch (1956:24): [True: 250, False: 94.1k]
  ------------------
 1957|    250|                auto res = ParseHexStrEnd(in, 20, ctx);
 1958|    250|                if (!res) return {};
  ------------------
  |  Branch (1958:21): [True: 20, False: 230]
  ------------------
 1959|    230|                auto& [hash, hash_size] = *res;
 1960|    230|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::RIPEMD160, std::move(hash)));
 1961|    230|                in = in.subspan(hash_size + 1);
 1962|    230|                script_size += 26;
 1963|  94.1k|            } else if (Const("hash256(", in)) {
  ------------------
  |  Branch (1963:24): [True: 79, False: 94.0k]
  ------------------
 1964|     79|                auto res = ParseHexStrEnd(in, 32, ctx);
 1965|     79|                if (!res) return {};
  ------------------
  |  Branch (1965:21): [True: 4, False: 75]
  ------------------
 1966|     75|                auto& [hash, hash_size] = *res;
 1967|     75|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::HASH256, std::move(hash)));
 1968|     75|                in = in.subspan(hash_size + 1);
 1969|     75|                script_size += 38;
 1970|  94.0k|            } else if (Const("hash160(", in)) {
  ------------------
  |  Branch (1970:24): [True: 310, False: 93.7k]
  ------------------
 1971|    310|                auto res = ParseHexStrEnd(in, 20, ctx);
 1972|    310|                if (!res) return {};
  ------------------
  |  Branch (1972:21): [True: 33, False: 277]
  ------------------
 1973|    277|                auto& [hash, hash_size] = *res;
 1974|    277|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::HASH160, std::move(hash)));
 1975|    277|                in = in.subspan(hash_size + 1);
 1976|    277|                script_size += 26;
 1977|  93.7k|            } else if (Const("after(", in)) {
  ------------------
  |  Branch (1977:24): [True: 6.82k, False: 86.9k]
  ------------------
 1978|  6.82k|                int arg_size = FindNextChar(in, ')');
 1979|  6.82k|                if (arg_size < 1) return {};
  ------------------
  |  Branch (1979:21): [True: 3, False: 6.81k]
  ------------------
 1980|  6.81k|                const auto num{ToIntegral<int64_t>(std::string_view(in.data(), arg_size))};
 1981|  6.81k|                if (!num.has_value() || *num < 1 || *num >= 0x80000000L) return {};
  ------------------
  |  Branch (1981:21): [True: 72, False: 6.74k]
  |  Branch (1981:41): [True: 84, False: 6.66k]
  |  Branch (1981:53): [True: 46, False: 6.61k]
  ------------------
 1982|  6.61k|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::AFTER, *num));
 1983|  6.61k|                in = in.subspan(arg_size + 1);
 1984|  6.61k|                script_size += 1 + (*num > 16) + (*num > 0x7f) + (*num > 0x7fff) + (*num > 0x7fffff);
 1985|  86.9k|            } else if (Const("older(", in)) {
  ------------------
  |  Branch (1985:24): [True: 3.78k, False: 83.1k]
  ------------------
 1986|  3.78k|                int arg_size = FindNextChar(in, ')');
 1987|  3.78k|                if (arg_size < 1) return {};
  ------------------
  |  Branch (1987:21): [True: 6, False: 3.77k]
  ------------------
 1988|  3.77k|                const auto num{ToIntegral<int64_t>(std::string_view(in.data(), arg_size))};
 1989|  3.77k|                if (!num.has_value() || *num < 1 || *num >= 0x80000000L) return {};
  ------------------
  |  Branch (1989:21): [True: 62, False: 3.71k]
  |  Branch (1989:41): [True: 101, False: 3.61k]
  |  Branch (1989:53): [True: 58, False: 3.55k]
  ------------------
 1990|  3.55k|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::OLDER, *num));
 1991|  3.55k|                in = in.subspan(arg_size + 1);
 1992|  3.55k|                script_size += 1 + (*num > 16) + (*num > 0x7f) + (*num > 0x7fff) + (*num > 0x7fffff);
 1993|  83.1k|            } else if (Const("multi(", in)) {
  ------------------
  |  Branch (1993:24): [True: 1.30k, False: 81.8k]
  ------------------
 1994|  1.30k|                if (!parse_multi_exp(in, /* is_multi_a = */false)) return {};
  ------------------
  |  Branch (1994:21): [True: 299, False: 1.00k]
  ------------------
 1995|  81.8k|            } else if (Const("multi_a(", in)) {
  ------------------
  |  Branch (1995:24): [True: 454, False: 81.3k]
  ------------------
 1996|    454|                if (!parse_multi_exp(in, /* is_multi_a = */true)) return {};
  ------------------
  |  Branch (1996:21): [True: 143, False: 311]
  ------------------
 1997|  81.3k|            } else if (Const("thresh(", in)) {
  ------------------
  |  Branch (1997:24): [True: 20.9k, False: 60.4k]
  ------------------
 1998|  20.9k|                int next_comma = FindNextChar(in, ',');
 1999|  20.9k|                if (next_comma < 1) return {};
  ------------------
  |  Branch (1999:21): [True: 4, False: 20.9k]
  ------------------
 2000|  20.9k|                const auto k{ToIntegral<int64_t>(std::string_view(in.data(), next_comma))};
 2001|  20.9k|                if (!k.has_value() || *k < 1) return {};
  ------------------
  |  Branch (2001:21): [True: 22, False: 20.9k]
  |  Branch (2001:39): [True: 90, False: 20.8k]
  ------------------
 2002|  20.8k|                in = in.subspan(next_comma + 1);
 2003|       |                // n = 1 here because we read the first WRAPPED_EXPR before reaching THRESH
 2004|  20.8k|                to_parse.emplace_back(ParseContext::THRESH, 1, *k);
 2005|  20.8k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2006|  20.8k|                script_size += 2 + (*k > 16) + (*k > 0x7f) + (*k > 0x7fff) + (*k > 0x7fffff);
 2007|  60.4k|            } else if (Const("andor(", in)) {
  ------------------
  |  Branch (2007:24): [True: 12.0k, False: 48.3k]
  ------------------
 2008|  12.0k|                to_parse.emplace_back(ParseContext::ANDOR, -1, -1);
 2009|  12.0k|                to_parse.emplace_back(ParseContext::CLOSE_BRACKET, -1, -1);
 2010|  12.0k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2011|  12.0k|                to_parse.emplace_back(ParseContext::COMMA, -1, -1);
 2012|  12.0k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2013|  12.0k|                to_parse.emplace_back(ParseContext::COMMA, -1, -1);
 2014|  12.0k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2015|  12.0k|                script_size += 5;
 2016|  48.3k|            } else {
 2017|  48.3k|                if (Const("and_n(", in)) {
  ------------------
  |  Branch (2017:21): [True: 7.58k, False: 40.7k]
  ------------------
 2018|  7.58k|                    to_parse.emplace_back(ParseContext::AND_N, -1, -1);
 2019|  7.58k|                    script_size += 5;
 2020|  40.7k|                } else if (Const("and_b(", in)) {
  ------------------
  |  Branch (2020:28): [True: 11.4k, False: 29.2k]
  ------------------
 2021|  11.4k|                    to_parse.emplace_back(ParseContext::AND_B, -1, -1);
 2022|  11.4k|                    script_size += 2;
 2023|  29.2k|                } else if (Const("and_v(", in)) {
  ------------------
  |  Branch (2023:28): [True: 2.44k, False: 26.8k]
  ------------------
 2024|  2.44k|                    to_parse.emplace_back(ParseContext::AND_V, -1, -1);
 2025|  2.44k|                    script_size += 1;
 2026|  26.8k|                } else if (Const("or_b(", in)) {
  ------------------
  |  Branch (2026:28): [True: 8.35k, False: 18.4k]
  ------------------
 2027|  8.35k|                    to_parse.emplace_back(ParseContext::OR_B, -1, -1);
 2028|  8.35k|                    script_size += 2;
 2029|  18.4k|                } else if (Const("or_c(", in)) {
  ------------------
  |  Branch (2029:28): [True: 4.25k, False: 14.2k]
  ------------------
 2030|  4.25k|                    to_parse.emplace_back(ParseContext::OR_C, -1, -1);
 2031|  4.25k|                    script_size += 3;
 2032|  14.2k|                } else if (Const("or_d(", in)) {
  ------------------
  |  Branch (2032:28): [True: 5.85k, False: 8.37k]
  ------------------
 2033|  5.85k|                    to_parse.emplace_back(ParseContext::OR_D, -1, -1);
 2034|  5.85k|                    script_size += 4;
 2035|  8.37k|                } else if (Const("or_i(", in)) {
  ------------------
  |  Branch (2035:28): [True: 7.47k, False: 898]
  ------------------
 2036|  7.47k|                    to_parse.emplace_back(ParseContext::OR_I, -1, -1);
 2037|  7.47k|                    script_size += 4;
 2038|  7.47k|                } else {
 2039|    898|                    return {};
 2040|    898|                }
 2041|  47.4k|                to_parse.emplace_back(ParseContext::CLOSE_BRACKET, -1, -1);
 2042|  47.4k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2043|  47.4k|                to_parse.emplace_back(ParseContext::COMMA, -1, -1);
 2044|  47.4k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2045|  47.4k|            }
 2046|   238k|            break;
 2047|   240k|        }
 2048|   238k|        case ParseContext::ALT: {
  ------------------
  |  Branch (2048:9): [True: 62.2k, False: 1.60M]
  ------------------
 2049|  62.2k|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_A, Vector(std::move(constructed.back())));
 2050|  62.2k|            break;
 2051|   240k|        }
 2052|  6.21k|        case ParseContext::SWAP: {
  ------------------
  |  Branch (2052:9): [True: 6.21k, False: 1.65M]
  ------------------
 2053|  6.21k|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_S, Vector(std::move(constructed.back())));
 2054|  6.21k|            break;
 2055|   240k|        }
 2056|   119k|        case ParseContext::CHECK: {
  ------------------
  |  Branch (2056:9): [True: 119k, False: 1.54M]
  ------------------
 2057|   119k|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_C, Vector(std::move(constructed.back())));
 2058|   119k|            break;
 2059|   240k|        }
 2060|  53.3k|        case ParseContext::DUP_IF: {
  ------------------
  |  Branch (2060:9): [True: 53.3k, False: 1.61M]
  ------------------
 2061|  53.3k|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_D, Vector(std::move(constructed.back())));
 2062|  53.3k|            break;
 2063|   240k|        }
 2064|  8.91k|        case ParseContext::NON_ZERO: {
  ------------------
  |  Branch (2064:9): [True: 8.91k, False: 1.65M]
  ------------------
 2065|  8.91k|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_J, Vector(std::move(constructed.back())));
 2066|  8.91k|            break;
 2067|   240k|        }
 2068|   131k|        case ParseContext::ZERO_NOTEQUAL: {
  ------------------
  |  Branch (2068:9): [True: 131k, False: 1.53M]
  ------------------
 2069|   131k|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_N, Vector(std::move(constructed.back())));
 2070|   131k|            break;
 2071|   240k|        }
 2072|  30.6k|        case ParseContext::VERIFY: {
  ------------------
  |  Branch (2072:9): [True: 30.6k, False: 1.63M]
  ------------------
 2073|  30.6k|            script_size += (constructed.back()->GetType() << "x"_mst);
 2074|  30.6k|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_V, Vector(std::move(constructed.back())));
 2075|  30.6k|            break;
 2076|   240k|        }
 2077|   280k|        case ParseContext::WRAP_U: {
  ------------------
  |  Branch (2077:9): [True: 280k, False: 1.38M]
  ------------------
 2078|   280k|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::OR_I, Vector(std::move(constructed.back()), MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_0)));
 2079|   280k|            break;
 2080|   240k|        }
 2081|  77.1k|        case ParseContext::WRAP_T: {
  ------------------
  |  Branch (2081:9): [True: 77.1k, False: 1.58M]
  ------------------
 2082|  77.1k|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::AND_V, Vector(std::move(constructed.back()), MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_1)));
 2083|  77.1k|            break;
 2084|   240k|        }
 2085|  9.76k|        case ParseContext::AND_B: {
  ------------------
  |  Branch (2085:9): [True: 9.76k, False: 1.65M]
  ------------------
 2086|  9.76k|            BuildBack(ctx.MsContext(), Fragment::AND_B, constructed);
 2087|  9.76k|            break;
 2088|   240k|        }
 2089|  6.92k|        case ParseContext::AND_N: {
  ------------------
  |  Branch (2089:9): [True: 6.92k, False: 1.65M]
  ------------------
 2090|  6.92k|            auto mid = std::move(constructed.back());
 2091|  6.92k|            constructed.pop_back();
 2092|  6.92k|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::ANDOR, Vector(std::move(constructed.back()), std::move(mid), MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_0)));
 2093|  6.92k|            break;
 2094|   240k|        }
 2095|  1.87k|        case ParseContext::AND_V: {
  ------------------
  |  Branch (2095:9): [True: 1.87k, False: 1.66M]
  ------------------
 2096|  1.87k|            BuildBack(ctx.MsContext(), Fragment::AND_V, constructed);
 2097|  1.87k|            break;
 2098|   240k|        }
 2099|  4.93k|        case ParseContext::OR_B: {
  ------------------
  |  Branch (2099:9): [True: 4.93k, False: 1.65M]
  ------------------
 2100|  4.93k|            BuildBack(ctx.MsContext(), Fragment::OR_B, constructed);
 2101|  4.93k|            break;
 2102|   240k|        }
 2103|  3.68k|        case ParseContext::OR_C: {
  ------------------
  |  Branch (2103:9): [True: 3.68k, False: 1.65M]
  ------------------
 2104|  3.68k|            BuildBack(ctx.MsContext(), Fragment::OR_C, constructed);
 2105|  3.68k|            break;
 2106|   240k|        }
 2107|  4.25k|        case ParseContext::OR_D: {
  ------------------
  |  Branch (2107:9): [True: 4.25k, False: 1.65M]
  ------------------
 2108|  4.25k|            BuildBack(ctx.MsContext(), Fragment::OR_D, constructed);
 2109|  4.25k|            break;
 2110|   240k|        }
 2111|   174k|        case ParseContext::OR_I: {
  ------------------
  |  Branch (2111:9): [True: 174k, False: 1.48M]
  ------------------
 2112|   174k|            BuildBack(ctx.MsContext(), Fragment::OR_I, constructed);
 2113|   174k|            break;
 2114|   240k|        }
 2115|  5.15k|        case ParseContext::ANDOR: {
  ------------------
  |  Branch (2115:9): [True: 5.15k, False: 1.65M]
  ------------------
 2116|  5.15k|            auto right = std::move(constructed.back());
 2117|  5.15k|            constructed.pop_back();
 2118|  5.15k|            auto mid = std::move(constructed.back());
 2119|  5.15k|            constructed.pop_back();
 2120|  5.15k|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::ANDOR, Vector(std::move(constructed.back()), std::move(mid), std::move(right)));
 2121|  5.15k|            break;
 2122|   240k|        }
 2123|   109k|        case ParseContext::THRESH: {
  ------------------
  |  Branch (2123:9): [True: 109k, False: 1.55M]
  ------------------
 2124|   109k|            if (in.size() < 1) return {};
  ------------------
  |  Branch (2124:17): [True: 107, False: 109k]
  ------------------
 2125|   109k|            if (in[0] == ',') {
  ------------------
  |  Branch (2125:17): [True: 99.7k, False: 9.53k]
  ------------------
 2126|  99.7k|                in = in.subspan(1);
 2127|  99.7k|                to_parse.emplace_back(ParseContext::THRESH, n+1, k);
 2128|  99.7k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2129|  99.7k|                script_size += 2;
 2130|  99.7k|            } else if (in[0] == ')') {
  ------------------
  |  Branch (2130:24): [True: 9.49k, False: 37]
  ------------------
 2131|  9.49k|                if (k > n) return {};
  ------------------
  |  Branch (2131:21): [True: 102, False: 9.39k]
  ------------------
 2132|  9.39k|                in = in.subspan(1);
 2133|       |                // Children are constructed in reverse order, so iterate from end to beginning
 2134|  9.39k|                std::vector<NodeRef<Key>> subs;
 2135|  83.4k|                for (int i = 0; i < n; ++i) {
  ------------------
  |  Branch (2135:33): [True: 74.0k, False: 9.39k]
  ------------------
 2136|  74.0k|                    subs.push_back(std::move(constructed.back()));
 2137|  74.0k|                    constructed.pop_back();
 2138|  74.0k|                }
 2139|  9.39k|                std::reverse(subs.begin(), subs.end());
 2140|  9.39k|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::THRESH, std::move(subs), k));
 2141|  9.39k|            } else {
 2142|     37|                return {};
 2143|     37|            }
 2144|   109k|            break;
 2145|   109k|        }
 2146|   109k|        case ParseContext::COMMA: {
  ------------------
  |  Branch (2146:9): [True: 53.4k, False: 1.60M]
  ------------------
 2147|  53.4k|            if (in.size() < 1 || in[0] != ',') return {};
  ------------------
  |  Branch (2147:17): [True: 25, False: 53.4k]
  |  Branch (2147:34): [True: 89, False: 53.3k]
  ------------------
 2148|  53.3k|            in = in.subspan(1);
 2149|  53.3k|            break;
 2150|  53.4k|        }
 2151|  38.1k|        case ParseContext::CLOSE_BRACKET: {
  ------------------
  |  Branch (2151:9): [True: 38.1k, False: 1.62M]
  ------------------
 2152|  38.1k|            if (in.size() < 1 || in[0] != ')') return {};
  ------------------
  |  Branch (2152:17): [True: 95, False: 38.0k]
  |  Branch (2152:34): [True: 72, False: 37.9k]
  ------------------
 2153|  37.9k|            in = in.subspan(1);
 2154|  37.9k|            break;
 2155|  38.1k|        }
 2156|  1.66M|        }
 2157|  1.66M|    }
 2158|       |
 2159|       |    // Sanity checks on the produced miniscript
 2160|  4.76k|    assert(constructed.size() == 1);
 2161|  4.76k|    assert(constructed[0]->ScriptSize() == script_size);
 2162|  4.76k|    if (in.size() > 0) return {};
  ------------------
  |  Branch (2162:9): [True: 78, False: 4.68k]
  ------------------
 2163|  4.68k|    NodeRef<Key> tl_node = std::move(constructed.front());
 2164|  4.68k|    tl_node->DuplicateKeyCheck(ctx);
 2165|  4.68k|    return tl_node;
 2166|  4.76k|}
_ZN10miniscript11MakeNodeRefIjJNS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentEEEENSt3__110unique_ptrIKNS_4NodeIT_EENS5_14default_deleteISA_EEEEDpOT0_:
  196|   735k|NodeRef<Key> MakeNodeRef(Args&&... args) { return std::make_unique<const Node<Key>>(std::forward<Args>(args)...); }
_ZN10miniscript4NodeIjEC2ENS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentEj:
 1670|   745k|        : fragment(nt), k(val), m_script_ctx{script_ctx}, ops(CalcOps()), ss(CalcStackSize()), ws(CalcWitnessSize()), typ(CalcType()), scriptlen(CalcScriptLen()) {}
_ZNK10miniscript4NodeIjE7CalcOpsEv:
  944|  1.84M|    internal::Ops CalcOps() const {
  945|  1.84M|        switch (fragment) {
  ------------------
  |  Branch (945:17): [True: 0, False: 1.84M]
  ------------------
  946|   186k|            case Fragment::JUST_1: return {0, 0, {}};
  ------------------
  |  Branch (946:13): [True: 186k, False: 1.65M]
  ------------------
  947|   580k|            case Fragment::JUST_0: return {0, {}, 0};
  ------------------
  |  Branch (947:13): [True: 580k, False: 1.25M]
  ------------------
  948|  6.19k|            case Fragment::PK_K: return {0, 0, 0};
  ------------------
  |  Branch (948:13): [True: 6.19k, False: 1.83M]
  ------------------
  949|  2.16k|            case Fragment::PK_H: return {3, 0, 0};
  ------------------
  |  Branch (949:13): [True: 2.16k, False: 1.83M]
  ------------------
  950|  3.74k|            case Fragment::OLDER:
  ------------------
  |  Branch (950:13): [True: 3.74k, False: 1.83M]
  ------------------
  951|  10.4k|            case Fragment::AFTER: return {1, 0, {}};
  ------------------
  |  Branch (951:13): [True: 6.72k, False: 1.83M]
  ------------------
  952|     72|            case Fragment::SHA256:
  ------------------
  |  Branch (952:13): [True: 72, False: 1.84M]
  ------------------
  953|    302|            case Fragment::RIPEMD160:
  ------------------
  |  Branch (953:13): [True: 230, False: 1.84M]
  ------------------
  954|    452|            case Fragment::HASH256:
  ------------------
  |  Branch (954:13): [True: 150, False: 1.84M]
  ------------------
  955|    729|            case Fragment::HASH160: return {4, 0, {}};
  ------------------
  |  Branch (955:13): [True: 277, False: 1.84M]
  ------------------
  956|  81.9k|            case Fragment::AND_V: return {subs[0]->ops.count + subs[1]->ops.count, subs[0]->ops.sat + subs[1]->ops.sat, {}};
  ------------------
  |  Branch (956:13): [True: 81.9k, False: 1.75M]
  ------------------
  957|  9.76k|            case Fragment::AND_B: {
  ------------------
  |  Branch (957:13): [True: 9.76k, False: 1.83M]
  ------------------
  958|  9.76k|                const auto count{1 + subs[0]->ops.count + subs[1]->ops.count};
  959|  9.76k|                const auto sat{subs[0]->ops.sat + subs[1]->ops.sat};
  960|  9.76k|                const auto dsat{subs[0]->ops.dsat + subs[1]->ops.dsat};
  961|  9.76k|                return {count, sat, dsat};
  962|    452|            }
  963|  4.93k|            case Fragment::OR_B: {
  ------------------
  |  Branch (963:13): [True: 4.93k, False: 1.83M]
  ------------------
  964|  4.93k|                const auto count{1 + subs[0]->ops.count + subs[1]->ops.count};
  965|  4.93k|                const auto sat{(subs[0]->ops.sat + subs[1]->ops.dsat) | (subs[1]->ops.sat + subs[0]->ops.dsat)};
  966|  4.93k|                const auto dsat{subs[0]->ops.dsat + subs[1]->ops.dsat};
  967|  4.93k|                return {count, sat, dsat};
  968|    452|            }
  969|  4.25k|            case Fragment::OR_D: {
  ------------------
  |  Branch (969:13): [True: 4.25k, False: 1.83M]
  ------------------
  970|  4.25k|                const auto count{3 + subs[0]->ops.count + subs[1]->ops.count};
  971|  4.25k|                const auto sat{subs[0]->ops.sat | (subs[1]->ops.sat + subs[0]->ops.dsat)};
  972|  4.25k|                const auto dsat{subs[0]->ops.dsat + subs[1]->ops.dsat};
  973|  4.25k|                return {count, sat, dsat};
  974|    452|            }
  975|  3.83k|            case Fragment::OR_C: {
  ------------------
  |  Branch (975:13): [True: 3.83k, False: 1.83M]
  ------------------
  976|  3.83k|                const auto count{2 + subs[0]->ops.count + subs[1]->ops.count};
  977|  3.83k|                const auto sat{subs[0]->ops.sat | (subs[1]->ops.sat + subs[0]->ops.dsat)};
  978|  3.83k|                return {count, sat, {}};
  979|    452|            }
  980|   493k|            case Fragment::OR_I: {
  ------------------
  |  Branch (980:13): [True: 493k, False: 1.34M]
  ------------------
  981|   493k|                const auto count{3 + subs[0]->ops.count + subs[1]->ops.count};
  982|   493k|                const auto sat{subs[0]->ops.sat | subs[1]->ops.sat};
  983|   493k|                const auto dsat{subs[0]->ops.dsat | subs[1]->ops.dsat};
  984|   493k|                return {count, sat, dsat};
  985|    452|            }
  986|  12.2k|            case Fragment::ANDOR: {
  ------------------
  |  Branch (986:13): [True: 12.2k, False: 1.82M]
  ------------------
  987|  12.2k|                const auto count{3 + subs[0]->ops.count + subs[1]->ops.count + subs[2]->ops.count};
  988|  12.2k|                const auto sat{(subs[1]->ops.sat + subs[0]->ops.sat) | (subs[0]->ops.dsat + subs[2]->ops.sat)};
  989|  12.2k|                const auto dsat{subs[0]->ops.dsat + subs[2]->ops.dsat};
  990|  12.2k|                return {count, sat, dsat};
  991|    452|            }
  992|  1.82k|            case Fragment::MULTI: return {1, (uint32_t)keys.size(), (uint32_t)keys.size()};
  ------------------
  |  Branch (992:13): [True: 1.82k, False: 1.83M]
  ------------------
  993|    751|            case Fragment::MULTI_A: return {(uint32_t)keys.size() + 1, 0, 0};
  ------------------
  |  Branch (993:13): [True: 751, False: 1.83M]
  ------------------
  994|  6.23k|            case Fragment::WRAP_S:
  ------------------
  |  Branch (994:13): [True: 6.23k, False: 1.83M]
  ------------------
  995|   133k|            case Fragment::WRAP_C:
  ------------------
  |  Branch (995:13): [True: 127k, False: 1.71M]
  ------------------
  996|   271k|            case Fragment::WRAP_N: return {1 + subs[0]->ops.count, subs[0]->ops.sat, subs[0]->ops.dsat};
  ------------------
  |  Branch (996:13): [True: 137k, False: 1.70M]
  ------------------
  997|  62.2k|            case Fragment::WRAP_A: return {2 + subs[0]->ops.count, subs[0]->ops.sat, subs[0]->ops.dsat};
  ------------------
  |  Branch (997:13): [True: 62.2k, False: 1.77M]
  ------------------
  998|  53.3k|            case Fragment::WRAP_D: return {3 + subs[0]->ops.count, subs[0]->ops.sat, 0};
  ------------------
  |  Branch (998:13): [True: 53.3k, False: 1.78M]
  ------------------
  999|  10.6k|            case Fragment::WRAP_J: return {4 + subs[0]->ops.count, subs[0]->ops.sat, 0};
  ------------------
  |  Branch (999:13): [True: 10.6k, False: 1.82M]
  ------------------
 1000|  33.8k|            case Fragment::WRAP_V: return {subs[0]->ops.count + (subs[0]->GetType() << "x"_mst), subs[0]->ops.sat, {}};
  ------------------
  |  Branch (1000:13): [True: 33.8k, False: 1.80M]
  ------------------
 1001|  9.44k|            case Fragment::THRESH: {
  ------------------
  |  Branch (1001:13): [True: 9.44k, False: 1.83M]
  ------------------
 1002|  9.44k|                uint32_t count = 0;
 1003|  9.44k|                auto sats = Vector(internal::MaxInt<uint32_t>(0));
 1004|  74.1k|                for (const auto& sub : subs) {
  ------------------
  |  Branch (1004:38): [True: 74.1k, False: 9.44k]
  ------------------
 1005|  74.1k|                    count += sub->ops.count + 1;
 1006|  74.1k|                    auto next_sats = Vector(sats[0] + sub->ops.dsat);
 1007|  4.81M|                    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 (1007:40): [True: 4.73M, False: 74.1k]
  ------------------
 1008|  74.1k|                    next_sats.push_back(sats[sats.size() - 1] + sub->ops.sat);
 1009|  74.1k|                    sats = std::move(next_sats);
 1010|  74.1k|                }
 1011|  9.44k|                assert(k <= sats.size());
 1012|  9.44k|                return {count, sats[k], sats[0]};
 1013|  9.44k|            }
 1014|  1.84M|        }
 1015|      0|        assert(false);
 1016|      0|    }
_ZNK10miniscript4NodeIjE13CalcStackSizeEv:
 1018|  1.84M|    internal::StackSize CalcStackSize() const {
 1019|  1.84M|        using namespace internal;
 1020|  1.84M|        switch (fragment) {
  ------------------
  |  Branch (1020:17): [True: 0, False: 1.84M]
  ------------------
 1021|   580k|            case Fragment::JUST_0: return {{}, SatInfo::Push()};
  ------------------
  |  Branch (1021:13): [True: 580k, False: 1.25M]
  ------------------
 1022|   186k|            case Fragment::JUST_1: return {SatInfo::Push(), {}};
  ------------------
  |  Branch (1022:13): [True: 186k, False: 1.65M]
  ------------------
 1023|  3.74k|            case Fragment::OLDER:
  ------------------
  |  Branch (1023:13): [True: 3.74k, False: 1.83M]
  ------------------
 1024|  10.4k|            case Fragment::AFTER: return {SatInfo::Push() + SatInfo::Nop(), {}};
  ------------------
  |  Branch (1024:13): [True: 6.72k, False: 1.83M]
  ------------------
 1025|  6.19k|            case Fragment::PK_K: return {SatInfo::Push()};
  ------------------
  |  Branch (1025:13): [True: 6.19k, False: 1.83M]
  ------------------
 1026|  2.16k|            case Fragment::PK_H: return {SatInfo::OP_DUP() + SatInfo::Hash() + SatInfo::Push() + SatInfo::OP_EQUALVERIFY()};
  ------------------
  |  Branch (1026:13): [True: 2.16k, False: 1.83M]
  ------------------
 1027|     72|            case Fragment::SHA256:
  ------------------
  |  Branch (1027:13): [True: 72, False: 1.84M]
  ------------------
 1028|    302|            case Fragment::RIPEMD160:
  ------------------
  |  Branch (1028:13): [True: 230, False: 1.84M]
  ------------------
 1029|    452|            case Fragment::HASH256:
  ------------------
  |  Branch (1029:13): [True: 150, False: 1.84M]
  ------------------
 1030|    729|            case Fragment::HASH160: return {
  ------------------
  |  Branch (1030:13): [True: 277, False: 1.84M]
  ------------------
 1031|    729|                SatInfo::OP_SIZE() + SatInfo::Push() + SatInfo::OP_EQUALVERIFY() + SatInfo::Hash() + SatInfo::Push() + SatInfo::OP_EQUAL(),
 1032|    729|                {}
 1033|    729|            };
 1034|  12.2k|            case Fragment::ANDOR: {
  ------------------
  |  Branch (1034:13): [True: 12.2k, False: 1.82M]
  ------------------
 1035|  12.2k|                const auto& x{subs[0]->ss};
 1036|  12.2k|                const auto& y{subs[1]->ss};
 1037|  12.2k|                const auto& z{subs[2]->ss};
 1038|  12.2k|                return {
 1039|  12.2k|                    (x.sat + SatInfo::If() + y.sat) | (x.dsat + SatInfo::If() + z.sat),
 1040|  12.2k|                    x.dsat + SatInfo::If() + z.dsat
 1041|  12.2k|                };
 1042|    452|            }
 1043|  81.9k|            case Fragment::AND_V: {
  ------------------
  |  Branch (1043:13): [True: 81.9k, False: 1.75M]
  ------------------
 1044|  81.9k|                const auto& x{subs[0]->ss};
 1045|  81.9k|                const auto& y{subs[1]->ss};
 1046|  81.9k|                return {x.sat + y.sat, {}};
 1047|    452|            }
 1048|  9.76k|            case Fragment::AND_B: {
  ------------------
  |  Branch (1048:13): [True: 9.76k, False: 1.83M]
  ------------------
 1049|  9.76k|                const auto& x{subs[0]->ss};
 1050|  9.76k|                const auto& y{subs[1]->ss};
 1051|  9.76k|                return {x.sat + y.sat + SatInfo::BinaryOp(), x.dsat + y.dsat + SatInfo::BinaryOp()};
 1052|    452|            }
 1053|  4.93k|            case Fragment::OR_B: {
  ------------------
  |  Branch (1053:13): [True: 4.93k, False: 1.83M]
  ------------------
 1054|  4.93k|                const auto& x{subs[0]->ss};
 1055|  4.93k|                const auto& y{subs[1]->ss};
 1056|  4.93k|                return {
 1057|  4.93k|                    ((x.sat + y.dsat) | (x.dsat + y.sat)) + SatInfo::BinaryOp(),
 1058|  4.93k|                    x.dsat + y.dsat + SatInfo::BinaryOp()
 1059|  4.93k|                };
 1060|    452|            }
 1061|  3.83k|            case Fragment::OR_C: {
  ------------------
  |  Branch (1061:13): [True: 3.83k, False: 1.83M]
  ------------------
 1062|  3.83k|                const auto& x{subs[0]->ss};
 1063|  3.83k|                const auto& y{subs[1]->ss};
 1064|  3.83k|                return {(x.sat + SatInfo::If()) | (x.dsat + SatInfo::If() + y.sat), {}};
 1065|    452|            }
 1066|  4.25k|            case Fragment::OR_D: {
  ------------------
  |  Branch (1066:13): [True: 4.25k, False: 1.83M]
  ------------------
 1067|  4.25k|                const auto& x{subs[0]->ss};
 1068|  4.25k|                const auto& y{subs[1]->ss};
 1069|  4.25k|                return {
 1070|  4.25k|                    (x.sat + SatInfo::OP_IFDUP(true) + SatInfo::If()) | (x.dsat + SatInfo::OP_IFDUP(false) + SatInfo::If() + y.sat),
 1071|  4.25k|                    x.dsat + SatInfo::OP_IFDUP(false) + SatInfo::If() + y.dsat
 1072|  4.25k|                };
 1073|    452|            }
 1074|   493k|            case Fragment::OR_I: {
  ------------------
  |  Branch (1074:13): [True: 493k, False: 1.34M]
  ------------------
 1075|   493k|                const auto& x{subs[0]->ss};
 1076|   493k|                const auto& y{subs[1]->ss};
 1077|   493k|                return {SatInfo::If() + (x.sat | y.sat), SatInfo::If() + (x.dsat | y.dsat)};
 1078|    452|            }
 1079|       |            // multi(k, key1, key2, ..., key_n) starts off with k+1 stack elements (a 0, plus k
 1080|       |            // signatures), then reaches n+k+3 stack elements after pushing the n keys, plus k and
 1081|       |            // n itself, and ends with 1 stack element (success or failure). Thus, it net removes
 1082|       |            // k elements (from k+1 to 1), while reaching k+n+2 more than it ends with.
 1083|  1.82k|            case Fragment::MULTI: return {SatInfo(k, k + keys.size() + 2)};
  ------------------
  |  Branch (1083:13): [True: 1.82k, False: 1.83M]
  ------------------
 1084|       |            // multi_a(k, key1, key2, ..., key_n) starts off with n stack elements (the
 1085|       |            // signatures), reaches 1 more (after the first key push), and ends with 1. Thus it net
 1086|       |            // removes n-1 elements (from n to 1) while reaching n more than it ends with.
 1087|    751|            case Fragment::MULTI_A: return {SatInfo(keys.size() - 1, keys.size())};
  ------------------
  |  Branch (1087:13): [True: 751, False: 1.83M]
  ------------------
 1088|  62.2k|            case Fragment::WRAP_A:
  ------------------
  |  Branch (1088:13): [True: 62.2k, False: 1.77M]
  ------------------
 1089|   199k|            case Fragment::WRAP_N:
  ------------------
  |  Branch (1089:13): [True: 137k, False: 1.70M]
  ------------------
 1090|   205k|            case Fragment::WRAP_S: return subs[0]->ss;
  ------------------
  |  Branch (1090:13): [True: 6.23k, False: 1.83M]
  ------------------
 1091|   127k|            case Fragment::WRAP_C: return {
  ------------------
  |  Branch (1091:13): [True: 127k, False: 1.71M]
  ------------------
 1092|   127k|                subs[0]->ss.sat + SatInfo::OP_CHECKSIG(),
 1093|   127k|                subs[0]->ss.dsat + SatInfo::OP_CHECKSIG()
 1094|   127k|            };
 1095|  53.3k|            case Fragment::WRAP_D: return {
  ------------------
  |  Branch (1095:13): [True: 53.3k, False: 1.78M]
  ------------------
 1096|  53.3k|                SatInfo::OP_DUP() + SatInfo::If() + subs[0]->ss.sat,
 1097|  53.3k|                SatInfo::OP_DUP() + SatInfo::If()
 1098|  53.3k|            };
 1099|  33.8k|            case Fragment::WRAP_V: return {subs[0]->ss.sat + SatInfo::OP_VERIFY(), {}};
  ------------------
  |  Branch (1099:13): [True: 33.8k, False: 1.80M]
  ------------------
 1100|  10.6k|            case Fragment::WRAP_J: return {
  ------------------
  |  Branch (1100:13): [True: 10.6k, False: 1.82M]
  ------------------
 1101|  10.6k|                SatInfo::OP_SIZE() + SatInfo::OP_0NOTEQUAL() + SatInfo::If() + subs[0]->ss.sat,
 1102|  10.6k|                SatInfo::OP_SIZE() + SatInfo::OP_0NOTEQUAL() + SatInfo::If()
 1103|  10.6k|            };
 1104|  9.44k|            case Fragment::THRESH: {
  ------------------
  |  Branch (1104:13): [True: 9.44k, False: 1.83M]
  ------------------
 1105|       |                // sats[j] is the SatInfo corresponding to all traces reaching j satisfactions.
 1106|  9.44k|                auto sats = Vector(SatInfo::Empty());
 1107|  83.5k|                for (size_t i = 0; i < subs.size(); ++i) {
  ------------------
  |  Branch (1107:36): [True: 74.1k, False: 9.44k]
  ------------------
 1108|       |                    // Loop over the subexpressions, processing them one by one. After adding
 1109|       |                    // element i we need to add OP_ADD (if i>0).
 1110|  74.1k|                    auto add = i ? SatInfo::BinaryOp() : SatInfo::Empty();
  ------------------
  |  Branch (1110:32): [True: 64.6k, False: 9.44k]
  ------------------
 1111|       |                    // Construct a variable that will become the next sats, starting with index 0.
 1112|  74.1k|                    auto next_sats = Vector(sats[0] + subs[i]->ss.dsat + add);
 1113|       |                    // Then loop to construct next_sats[1..i].
 1114|  4.81M|                    for (size_t j = 1; j < sats.size(); ++j) {
  ------------------
  |  Branch (1114:40): [True: 4.73M, False: 74.1k]
  ------------------
 1115|  4.73M|                        next_sats.push_back(((sats[j] + subs[i]->ss.dsat) | (sats[j - 1] + subs[i]->ss.sat)) + add);
 1116|  4.73M|                    }
 1117|       |                    // Finally construct next_sats[i+1].
 1118|  74.1k|                    next_sats.push_back(sats[sats.size() - 1] + subs[i]->ss.sat + add);
 1119|       |                    // Switch over.
 1120|  74.1k|                    sats = std::move(next_sats);
 1121|  74.1k|                }
 1122|       |                // To satisfy thresh we need k satisfactions; to dissatisfy we need 0. In both
 1123|       |                // cases a push of k and an OP_EQUAL follow.
 1124|  9.44k|                return {
 1125|  9.44k|                    sats[k] + SatInfo::Push() + SatInfo::OP_EQUAL(),
 1126|  9.44k|                    sats[0] + SatInfo::Push() + SatInfo::OP_EQUAL()
 1127|  9.44k|                };
 1128|   199k|            }
 1129|  1.84M|        }
 1130|      0|        assert(false);
 1131|      0|    }
_ZNK10miniscript4NodeIjE15CalcWitnessSizeEv:
 1133|  1.84M|    internal::WitnessSize CalcWitnessSize() const {
 1134|  1.84M|        const uint32_t sig_size = IsTapscript(m_script_ctx) ? 1 + 65 : 1 + 72;
  ------------------
  |  Branch (1134:35): [True: 1.69M, False: 147k]
  ------------------
 1135|  1.84M|        const uint32_t pubkey_size = IsTapscript(m_script_ctx) ? 1 + 32 : 1 + 33;
  ------------------
  |  Branch (1135:38): [True: 1.69M, False: 147k]
  ------------------
 1136|  1.84M|        switch (fragment) {
  ------------------
  |  Branch (1136:17): [True: 0, False: 1.84M]
  ------------------
 1137|   580k|            case Fragment::JUST_0: return {{}, 0};
  ------------------
  |  Branch (1137:13): [True: 580k, False: 1.25M]
  ------------------
 1138|   186k|            case Fragment::JUST_1:
  ------------------
  |  Branch (1138:13): [True: 186k, False: 1.65M]
  ------------------
 1139|   189k|            case Fragment::OLDER:
  ------------------
  |  Branch (1139:13): [True: 3.74k, False: 1.83M]
  ------------------
 1140|   196k|            case Fragment::AFTER: return {0, {}};
  ------------------
  |  Branch (1140:13): [True: 6.72k, False: 1.83M]
  ------------------
 1141|  6.19k|            case Fragment::PK_K: return {sig_size, 1};
  ------------------
  |  Branch (1141:13): [True: 6.19k, False: 1.83M]
  ------------------
 1142|  2.16k|            case Fragment::PK_H: return {sig_size + pubkey_size, 1 + pubkey_size};
  ------------------
  |  Branch (1142:13): [True: 2.16k, False: 1.83M]
  ------------------
 1143|     72|            case Fragment::SHA256:
  ------------------
  |  Branch (1143:13): [True: 72, False: 1.84M]
  ------------------
 1144|    302|            case Fragment::RIPEMD160:
  ------------------
  |  Branch (1144:13): [True: 230, False: 1.84M]
  ------------------
 1145|    452|            case Fragment::HASH256:
  ------------------
  |  Branch (1145:13): [True: 150, False: 1.84M]
  ------------------
 1146|    729|            case Fragment::HASH160: return {1 + 32, {}};
  ------------------
  |  Branch (1146:13): [True: 277, False: 1.84M]
  ------------------
 1147|  12.2k|            case Fragment::ANDOR: {
  ------------------
  |  Branch (1147:13): [True: 12.2k, False: 1.82M]
  ------------------
 1148|  12.2k|                const auto sat{(subs[0]->ws.sat + subs[1]->ws.sat) | (subs[0]->ws.dsat + subs[2]->ws.sat)};
 1149|  12.2k|                const auto dsat{subs[0]->ws.dsat + subs[2]->ws.dsat};
 1150|  12.2k|                return {sat, dsat};
 1151|    452|            }
 1152|  81.9k|            case Fragment::AND_V: return {subs[0]->ws.sat + subs[1]->ws.sat, {}};
  ------------------
  |  Branch (1152:13): [True: 81.9k, False: 1.75M]
  ------------------
 1153|  9.76k|            case Fragment::AND_B: return {subs[0]->ws.sat + subs[1]->ws.sat, subs[0]->ws.dsat + subs[1]->ws.dsat};
  ------------------
  |  Branch (1153:13): [True: 9.76k, False: 1.83M]
  ------------------
 1154|  4.93k|            case Fragment::OR_B: {
  ------------------
  |  Branch (1154:13): [True: 4.93k, False: 1.83M]
  ------------------
 1155|  4.93k|                const auto sat{(subs[0]->ws.dsat + subs[1]->ws.sat) | (subs[0]->ws.sat + subs[1]->ws.dsat)};
 1156|  4.93k|                const auto dsat{subs[0]->ws.dsat + subs[1]->ws.dsat};
 1157|  4.93k|                return {sat, dsat};
 1158|    452|            }
 1159|  3.83k|            case Fragment::OR_C: return {subs[0]->ws.sat | (subs[0]->ws.dsat + subs[1]->ws.sat), {}};
  ------------------
  |  Branch (1159:13): [True: 3.83k, False: 1.83M]
  ------------------
 1160|  4.25k|            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 (1160:13): [True: 4.25k, False: 1.83M]
  ------------------
 1161|   493k|            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 (1161:13): [True: 493k, False: 1.34M]
  ------------------
 1162|  1.82k|            case Fragment::MULTI: return {k * sig_size + 1, k + 1};
  ------------------
  |  Branch (1162:13): [True: 1.82k, False: 1.83M]
  ------------------
 1163|    751|            case Fragment::MULTI_A: return {k * sig_size + static_cast<uint32_t>(keys.size()) - k, static_cast<uint32_t>(keys.size())};
  ------------------
  |  Branch (1163:13): [True: 751, False: 1.83M]
  ------------------
 1164|  62.2k|            case Fragment::WRAP_A:
  ------------------
  |  Branch (1164:13): [True: 62.2k, False: 1.77M]
  ------------------
 1165|   199k|            case Fragment::WRAP_N:
  ------------------
  |  Branch (1165:13): [True: 137k, False: 1.70M]
  ------------------
 1166|   205k|            case Fragment::WRAP_S:
  ------------------
  |  Branch (1166:13): [True: 6.23k, False: 1.83M]
  ------------------
 1167|   333k|            case Fragment::WRAP_C: return subs[0]->ws;
  ------------------
  |  Branch (1167:13): [True: 127k, False: 1.71M]
  ------------------
 1168|  53.3k|            case Fragment::WRAP_D: return {1 + 1 + subs[0]->ws.sat, 1};
  ------------------
  |  Branch (1168:13): [True: 53.3k, False: 1.78M]
  ------------------
 1169|  33.8k|            case Fragment::WRAP_V: return {subs[0]->ws.sat, {}};
  ------------------
  |  Branch (1169:13): [True: 33.8k, False: 1.80M]
  ------------------
 1170|  10.6k|            case Fragment::WRAP_J: return {subs[0]->ws.sat, 1};
  ------------------
  |  Branch (1170:13): [True: 10.6k, False: 1.82M]
  ------------------
 1171|  9.44k|            case Fragment::THRESH: {
  ------------------
  |  Branch (1171:13): [True: 9.44k, False: 1.83M]
  ------------------
 1172|  9.44k|                auto sats = Vector(internal::MaxInt<uint32_t>(0));
 1173|  74.1k|                for (const auto& sub : subs) {
  ------------------
  |  Branch (1173:38): [True: 74.1k, False: 9.44k]
  ------------------
 1174|  74.1k|                    auto next_sats = Vector(sats[0] + sub->ws.dsat);
 1175|  4.81M|                    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 (1175:40): [True: 4.73M, False: 74.1k]
  ------------------
 1176|  74.1k|                    next_sats.push_back(sats[sats.size() - 1] + sub->ws.sat);
 1177|  74.1k|                    sats = std::move(next_sats);
 1178|  74.1k|                }
 1179|  9.44k|                assert(k <= sats.size());
 1180|  9.44k|                return {sats[k], sats[0]};
 1181|  9.44k|            }
 1182|  1.84M|        }
 1183|      0|        assert(false);
 1184|      0|    }
_ZNK10miniscript4NodeIjE8CalcTypeEv:
  731|  1.84M|    Type CalcType() const {
  732|  1.84M|        using namespace internal;
  733|       |
  734|       |        // THRESH has a variable number of subexpressions
  735|  1.84M|        std::vector<Type> sub_types;
  736|  1.84M|        if (fragment == Fragment::THRESH) {
  ------------------
  |  Branch (736:13): [True: 9.44k, False: 1.83M]
  ------------------
  737|  74.1k|            for (const auto& sub : subs) sub_types.push_back(sub->GetType());
  ------------------
  |  Branch (737:34): [True: 74.1k, False: 9.44k]
  ------------------
  738|  9.44k|        }
  739|       |        // All other nodes than THRESH can be computed just from the types of the 0-3 subexpressions.
  740|  1.84M|        static constexpr auto NONE_MST{""_mst};
  741|  1.84M|        Type x = subs.size() > 0 ? subs[0]->GetType() : NONE_MST;
  ------------------
  |  Branch (741:18): [True: 1.05M, False: 789k]
  ------------------
  742|  1.84M|        Type y = subs.size() > 1 ? subs[1]->GetType() : NONE_MST;
  ------------------
  |  Branch (742:18): [True: 615k, False: 1.22M]
  ------------------
  743|  1.84M|        Type z = subs.size() > 2 ? subs[2]->GetType() : NONE_MST;
  ------------------
  |  Branch (743:18): [True: 15.4k, False: 1.82M]
  ------------------
  744|       |
  745|  1.84M|        return SanitizeType(ComputeType(fragment, x, y, z, sub_types, k, data.size(), subs.size(), keys.size(), m_script_ctx));
  746|  1.84M|    }
_ZNK10miniscript4NodeIjE13CalcScriptLenEv:
  570|  1.84M|    size_t CalcScriptLen() const {
  571|  1.84M|        size_t subsize = 0;
  572|  1.84M|        for (const auto& sub : subs) {
  ------------------
  |  Branch (572:30): [True: 1.73M, False: 1.84M]
  ------------------
  573|  1.73M|            subsize += sub->ScriptSize();
  574|  1.73M|        }
  575|  1.84M|        static constexpr auto NONE_MST{""_mst};
  576|  1.84M|        Type sub0type = subs.size() > 0 ? subs[0]->GetType() : NONE_MST;
  ------------------
  |  Branch (576:25): [True: 1.05M, False: 789k]
  ------------------
  577|  1.84M|        return internal::ComputeScriptLen(fragment, sub0type, subsize, k, subs.size(), keys.size(), m_script_ctx);
  578|  1.84M|    }
descriptor.cpp:_ZN10miniscript8internal11ParseKeyEndIjN12_GLOBAL__N_19KeyParserEEENSt3__18optionalINS4_4pairIT_iEEEE4SpanIKcERKT0_:
 1752|  5.67k|{
 1753|  5.67k|    int key_size = FindNextChar(in, ')');
 1754|  5.67k|    if (key_size < 1) return {};
  ------------------
  |  Branch (1754:9): [True: 38, False: 5.63k]
  ------------------
 1755|  5.63k|    auto key = ctx.FromString(in.begin(), in.begin() + key_size);
 1756|  5.63k|    if (!key) return {};
  ------------------
  |  Branch (1756:9): [True: 120, False: 5.51k]
  ------------------
 1757|  5.51k|    return {{std::move(*key), key_size}};
 1758|  5.63k|}
_ZN10miniscript11MakeNodeRefIjJNS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentENSt3__16vectorINS5_10unique_ptrIKNS_4NodeIjEENS5_14default_deleteISA_EEEENS5_9allocatorISD_EEEEEEENS7_IKNS8_IT_EENSB_ISJ_EEEEDpOT0_:
  196|   792k|NodeRef<Key> MakeNodeRef(Args&&... args) { return std::make_unique<const Node<Key>>(std::forward<Args>(args)...); }
_ZN10miniscript4NodeIjEC2ENS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentENSt3__16vectorINS6_10unique_ptrIKS1_NS6_14default_deleteIS9_EEEENS6_9allocatorISC_EEEEj:
 1668|  1.01M|        : fragment(nt), k(val), subs(std::move(sub)), m_script_ctx{script_ctx}, ops(CalcOps()), ss(CalcStackSize()), ws(CalcWitnessSize()), typ(CalcType()), scriptlen(CalcScriptLen()) {}
_ZN10miniscript11MakeNodeRefIjJNS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentENSt3__16vectorIjNS5_9allocatorIjEEEEEEENS5_10unique_ptrIKNS_4NodeIT_EENS5_14default_deleteISE_EEEEDpOT0_:
  196|  6.37k|NodeRef<Key> MakeNodeRef(Args&&... args) { return std::make_unique<const Node<Key>>(std::forward<Args>(args)...); }
_ZN10miniscript4NodeIjEC2ENS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentENSt3__16vectorIjNS6_9allocatorIjEEEEj:
 1666|  8.26k|        : fragment(nt), k(val), keys(std::move(key)), m_script_ctx{script_ctx}, ops(CalcOps()), ss(CalcStackSize()), ws(CalcWitnessSize()), typ(CalcType()), scriptlen(CalcScriptLen()) {}
descriptor.cpp:_ZN10miniscript8internal14ParseHexStrEndIN12_GLOBAL__N_19KeyParserEEENSt3__18optionalINS4_4pairINS4_6vectorIhNS4_9allocatorIhEEEEiEEEE4SpanIKcEmRKT_:
 1764|    732|{
 1765|    732|    int hash_size = FindNextChar(in, ')');
 1766|    732|    if (hash_size < 1) return {};
  ------------------
  |  Branch (1766:9): [True: 9, False: 723]
  ------------------
 1767|    723|    std::string val = std::string(in.begin(), in.begin() + hash_size);
 1768|    723|    if (!IsHex(val)) return {};
  ------------------
  |  Branch (1768:9): [True: 42, False: 681]
  ------------------
 1769|    681|    auto hash = ParseHex(val);
 1770|    681|    if (hash.size() != expected_size) return {};
  ------------------
  |  Branch (1770:9): [True: 27, False: 654]
  ------------------
 1771|    654|    return {{std::move(hash), hash_size}};
 1772|    681|}
_ZN10miniscript11MakeNodeRefIjJNS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentENSt3__16vectorIhNS5_9allocatorIhEEEEEEENS5_10unique_ptrIKNS_4NodeIT_EENS5_14default_deleteISE_EEEEDpOT0_:
  196|    654|NodeRef<Key> MakeNodeRef(Args&&... args) { return std::make_unique<const Node<Key>>(std::forward<Args>(args)...); }
_ZN10miniscript4NodeIjEC2ENS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentENSt3__16vectorIhNS6_9allocatorIhEEEEj:
 1662|    691|        : fragment(nt), k(val), data(std::move(arg)), m_script_ctx{script_ctx}, ops(CalcOps()), ss(CalcStackSize()), ws(CalcWitnessSize()), typ(CalcType()), scriptlen(CalcScriptLen()) {}
_ZN10miniscript11MakeNodeRefIjJNS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentERKlEEENSt3__110unique_ptrIKNS_4NodeIT_EENS7_14default_deleteISC_EEEEDpOT0_:
  196|  10.1k|NodeRef<Key> MakeNodeRef(Args&&... args) { return std::make_unique<const Node<Key>>(std::forward<Args>(args)...); }
descriptor.cpp:_ZZN10miniscript8internal5ParseIjN12_GLOBAL__N_19KeyParserEEENSt3__110unique_ptrIKNS_4NodeIT_EENS4_14default_deleteIS9_EEEE4SpanIKcERKT0_ENKUlRSF_bE_clESJ_b:
 1817|  1.76k|    const auto parse_multi_exp = [&](Span<const char>& in, const bool is_multi_a) -> bool {
 1818|  1.76k|        const auto max_keys{is_multi_a ? MAX_PUBKEYS_PER_MULTI_A : MAX_PUBKEYS_PER_MULTISIG};
  ------------------
  |  Branch (1818:29): [True: 454, False: 1.30k]
  ------------------
 1819|  1.76k|        const auto required_ctx{is_multi_a ? MiniscriptContext::TAPSCRIPT : MiniscriptContext::P2WSH};
  ------------------
  |  Branch (1819:33): [True: 454, False: 1.30k]
  ------------------
 1820|  1.76k|        if (ctx.MsContext() != required_ctx) return false;
  ------------------
  |  Branch (1820:13): [True: 3, False: 1.75k]
  ------------------
 1821|       |        // Get threshold
 1822|  1.75k|        int next_comma = FindNextChar(in, ',');
 1823|  1.75k|        if (next_comma < 1) return false;
  ------------------
  |  Branch (1823:13): [True: 5, False: 1.75k]
  ------------------
 1824|  1.75k|        const auto k_to_integral{ToIntegral<int64_t>(std::string_view(in.data(), next_comma))};
 1825|  1.75k|        if (!k_to_integral.has_value()) return false;
  ------------------
  |  Branch (1825:13): [True: 97, False: 1.65k]
  ------------------
 1826|  1.65k|        const int64_t k{k_to_integral.value()};
 1827|  1.65k|        in = in.subspan(next_comma + 1);
 1828|       |        // Get keys. It is compatible for both compressed and x-only keys.
 1829|  1.65k|        std::vector<Key> keys;
 1830|  10.4k|        while (next_comma != -1) {
  ------------------
  |  Branch (1830:16): [True: 9.01k, False: 1.47k]
  ------------------
 1831|  9.01k|            next_comma = FindNextChar(in, ',');
 1832|  9.01k|            int key_length = (next_comma == -1) ? FindNextChar(in, ')') : next_comma;
  ------------------
  |  Branch (1832:30): [True: 1.59k, False: 7.41k]
  ------------------
 1833|  9.01k|            if (key_length < 1) return false;
  ------------------
  |  Branch (1833:17): [True: 111, False: 8.90k]
  ------------------
 1834|  8.90k|            auto key = ctx.FromString(in.begin(), in.begin() + key_length);
 1835|  8.90k|            if (!key) return false;
  ------------------
  |  Branch (1835:17): [True: 74, False: 8.83k]
  ------------------
 1836|  8.83k|            keys.push_back(std::move(*key));
 1837|  8.83k|            in = in.subspan(key_length + 1);
 1838|  8.83k|        }
 1839|  1.47k|        if (keys.size() < 1 || keys.size() > max_keys) return false;
  ------------------
  |  Branch (1839:13): [True: 0, False: 1.47k]
  |  Branch (1839:32): [True: 3, False: 1.46k]
  ------------------
 1840|  1.46k|        if (k < 1 || k > (int64_t)keys.size()) return false;
  ------------------
  |  Branch (1840:13): [True: 63, False: 1.40k]
  |  Branch (1840:22): [True: 86, False: 1.31k]
  ------------------
 1841|  1.31k|        if (is_multi_a) {
  ------------------
  |  Branch (1841:13): [True: 311, False: 1.00k]
  ------------------
 1842|       |            // (push + xonly-key + CHECKSIG[ADD]) * n + k + OP_NUMEQUAL(VERIFY), minus one.
 1843|    311|            script_size += (1 + 32 + 1) * keys.size() + BuildScript(k).size();
 1844|    311|            constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::MULTI_A, std::move(keys), k));
 1845|  1.00k|        } else {
 1846|  1.00k|            script_size += 2 + (keys.size() > 16) + (k > 16) + 34 * keys.size();
 1847|  1.00k|            constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::MULTI, std::move(keys), k));
 1848|  1.00k|        }
 1849|  1.31k|        return true;
 1850|  1.46k|    };
_ZN10miniscript11MakeNodeRefIjJNS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentENSt3__16vectorIjNS5_9allocatorIjEEEERKlEEENS5_10unique_ptrIKNS_4NodeIT_EENS5_14default_deleteISG_EEEEDpOT0_:
  196|  1.88k|NodeRef<Key> MakeNodeRef(Args&&... args) { return std::make_unique<const Node<Key>>(std::forward<Args>(args)...); }
_ZN10miniscript4NodeIjED2Ev:
  520|  1.84M|    ~Node() {
  521|  3.57M|        while (!subs.empty()) {
  ------------------
  |  Branch (521:16): [True: 1.73M, False: 1.84M]
  ------------------
  522|  1.73M|            auto node = std::move(subs.back());
  523|  1.73M|            subs.pop_back();
  524|  3.39M|            while (!node->subs.empty()) {
  ------------------
  |  Branch (524:20): [True: 1.65M, False: 1.73M]
  ------------------
  525|  1.65M|                subs.push_back(std::move(node->subs.back()));
  526|  1.65M|                node->subs.pop_back();
  527|  1.65M|            }
  528|  1.73M|        }
  529|  1.84M|    }
_ZNK10miniscript4NodeIjE7GetTypeEv:
 1557|  3.70M|    Type GetType() const { return typ; }
_ZN10miniscript8internal9BuildBackIjEEvNS_17MiniscriptContextENS_8FragmentERNSt3__16vectorINS4_10unique_ptrIKNS_4NodeIT_EENS4_14default_deleteISA_EEEENS4_9allocatorISD_EEEEb:
 1777|   209k|{
 1778|   209k|    NodeRef<Key> child = std::move(constructed.back());
 1779|   209k|    constructed.pop_back();
 1780|   209k|    if (reverse) {
  ------------------
  |  Branch (1780:9): [True: 10.0k, False: 199k]
  ------------------
 1781|  10.0k|        constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, script_ctx, nt, Vector(std::move(child), std::move(constructed.back())));
 1782|   199k|    } else {
 1783|   199k|        constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, script_ctx, nt, Vector(std::move(constructed.back()), std::move(child)));
 1784|   199k|    }
 1785|   209k|}
_ZN10miniscript11MakeNodeRefIjJNS_8internal10NoDupCheckERKNS_17MiniscriptContextERNS_8FragmentENSt3__16vectorINS8_10unique_ptrIKNS_4NodeIjEENS8_14default_deleteISD_EEEENS8_9allocatorISG_EEEEEEENSA_IKNSB_IT_EENSE_ISM_EEEEDpOT0_:
  196|   209k|NodeRef<Key> MakeNodeRef(Args&&... args) { return std::make_unique<const Node<Key>>(std::forward<Args>(args)...); }
_ZN10miniscript11MakeNodeRefIjJNS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentENSt3__16vectorINS5_10unique_ptrIKNS_4NodeIjEENS5_14default_deleteISA_EEEENS5_9allocatorISD_EEEERlEEENS7_IKNS8_IT_EENSB_ISK_EEEEDpOT0_:
  196|  9.41k|NodeRef<Key> MakeNodeRef(Args&&... args) { return std::make_unique<const Node<Key>>(std::forward<Args>(args)...); }
_ZNK10miniscript4NodeIjE10ScriptSizeEv:
 1499|  2.03M|    size_t ScriptSize() const { return scriptlen; }
descriptor.cpp:_ZNK10miniscript4NodeIjE17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_:
 1441|  6.02k|    {
 1442|       |        // We cannot use a lambda here, as lambdas are non assignable, and the set operations
 1443|       |        // below require moving the comparators around.
 1444|  6.02k|        struct Comp {
 1445|  6.02k|            const Ctx* ctx_ptr;
 1446|  6.02k|            Comp(const Ctx& ctx) : ctx_ptr(&ctx) {}
 1447|  6.02k|            bool operator()(const Key& a, const Key& b) const { return ctx_ptr->KeyCompare(a, b); }
 1448|  6.02k|        };
 1449|       |
 1450|       |        // state in the recursive computation:
 1451|       |        // - std::nullopt means "this node has duplicates"
 1452|       |        // - an std::set means "this node has no duplicate keys, and they are: ...".
 1453|  6.02k|        using keyset = std::set<Key, Comp>;
 1454|  6.02k|        using state = std::optional<keyset>;
 1455|       |
 1456|  6.02k|        auto upfn = [&ctx](const Node& node, Span<state> subs) -> state {
 1457|       |            // If this node is already known to have duplicates, nothing left to do.
 1458|  6.02k|            if (node.has_duplicate_keys.has_value() && *node.has_duplicate_keys) return {};
 1459|       |
 1460|       |            // Check if one of the children is already known to have duplicates.
 1461|  6.02k|            for (auto& sub : subs) {
 1462|  6.02k|                if (!sub.has_value()) {
 1463|  6.02k|                    node.has_duplicate_keys = true;
 1464|  6.02k|                    return {};
 1465|  6.02k|                }
 1466|  6.02k|            }
 1467|       |
 1468|       |            // Start building the set of keys involved in this node and children.
 1469|       |            // Start by keys in this node directly.
 1470|  6.02k|            size_t keys_count = node.keys.size();
 1471|  6.02k|            keyset key_set{node.keys.begin(), node.keys.end(), Comp(ctx)};
 1472|  6.02k|            if (key_set.size() != keys_count) {
 1473|       |                // It already has duplicates; bail out.
 1474|  6.02k|                node.has_duplicate_keys = true;
 1475|  6.02k|                return {};
 1476|  6.02k|            }
 1477|       |
 1478|       |            // Merge the keys from the children into this set.
 1479|  6.02k|            for (auto& sub : subs) {
 1480|  6.02k|                keys_count += sub->size();
 1481|       |                // Small optimization: std::set::merge is linear in the size of the second arg but
 1482|       |                // logarithmic in the size of the first.
 1483|  6.02k|                if (key_set.size() < sub->size()) std::swap(key_set, *sub);
 1484|  6.02k|                key_set.merge(*sub);
 1485|  6.02k|                if (key_set.size() != keys_count) {
 1486|  6.02k|                    node.has_duplicate_keys = true;
 1487|  6.02k|                    return {};
 1488|  6.02k|                }
 1489|  6.02k|            }
 1490|       |
 1491|  6.02k|            node.has_duplicate_keys = false;
 1492|  6.02k|            return key_set;
 1493|  6.02k|        };
 1494|       |
 1495|  6.02k|        TreeEval<state>(upfn);
 1496|  6.02k|    }
descriptor.cpp:_ZNK10miniscript4NodeIjE8TreeEvalINSt3__18optionalINS3_3setIjZNKS1_17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_E4CompNS3_9allocatorIjEEEEEEZNKS6_IS8_EEvSB_EUlRKS1_4SpanISG_EE_EES9_T0_:
  699|  6.02k|    {
  700|  6.02k|        struct DummyState {};
  701|  6.02k|        return std::move(*TreeEvalMaybe<Result>(DummyState{},
  702|  6.02k|            [](DummyState, const Node&, size_t) { return DummyState{}; },
  703|  6.02k|            [&upfn](DummyState, const Node& node, Span<Result> subs) {
  704|  6.02k|                Result res{upfn(node, subs)};
  705|  6.02k|                return std::optional<Result>(std::move(res));
  706|  6.02k|            }
  707|  6.02k|        ));
  708|  6.02k|    }
descriptor.cpp:_ZNK10miniscript4NodeIjE13TreeEvalMaybeINSt3__18optionalINS3_3setIjZNKS1_17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_E4CompNS3_9allocatorIjEEEEEEZNKS1_8TreeEvalISG_ZNKS6_IS8_EEvSB_EUlRKS1_4SpanISG_EE_EES9_T0_E10DummyStateZNKSH_ISG_SM_EES9_SN_EUlSO_SJ_mE_ZNKSH_ISG_SM_EES9_SN_EUlSO_SJ_SL_E_EENS4_IS9_EESN_T1_T2_:
  605|  6.02k|    {
  606|       |        /** Entries of the explicit stack tracked in this algorithm. */
  607|  6.02k|        struct StackElem
  608|  6.02k|        {
  609|  6.02k|            const Node& node; //!< The node being evaluated.
  610|  6.02k|            size_t expanded; //!< How many children of this node have been expanded.
  611|  6.02k|            State state; //!< The state for that node.
  612|       |
  613|  6.02k|            StackElem(const Node& node_, size_t exp_, State&& state_) :
  614|  6.02k|                node(node_), expanded(exp_), state(std::move(state_)) {}
  615|  6.02k|        };
  616|       |        /* Stack of tree nodes being explored. */
  617|  6.02k|        std::vector<StackElem> stack;
  618|       |        /* Results of subtrees so far. Their order and mapping to tree nodes
  619|       |         * is implicitly defined by stack. */
  620|  6.02k|        std::vector<Result> results;
  621|  6.02k|        stack.emplace_back(*this, 0, std::move(root_state));
  622|       |
  623|       |        /* Here is a demonstration of the algorithm, for an example tree A(B,C(D,E),F).
  624|       |         * State variables are omitted for simplicity.
  625|       |         *
  626|       |         * First: stack=[(A,0)] results=[]
  627|       |         *        stack=[(A,1),(B,0)] results=[]
  628|       |         *        stack=[(A,1)] results=[B]
  629|       |         *        stack=[(A,2),(C,0)] results=[B]
  630|       |         *        stack=[(A,2),(C,1),(D,0)] results=[B]
  631|       |         *        stack=[(A,2),(C,1)] results=[B,D]
  632|       |         *        stack=[(A,2),(C,2),(E,0)] results=[B,D]
  633|       |         *        stack=[(A,2),(C,2)] results=[B,D,E]
  634|       |         *        stack=[(A,2)] results=[B,C]
  635|       |         *        stack=[(A,3),(F,0)] results=[B,C]
  636|       |         *        stack=[(A,3)] results=[B,C,F]
  637|       |         * Final: stack=[] results=[A]
  638|       |         */
  639|  1.18M|        while (stack.size()) {
  ------------------
  |  Branch (639:16): [True: 1.17M, False: 6.02k]
  ------------------
  640|  1.17M|            const Node& node = stack.back().node;
  641|  1.17M|            if (stack.back().expanded < node.subs.size()) {
  ------------------
  |  Branch (641:17): [True: 584k, False: 590k]
  ------------------
  642|       |                /* We encounter a tree node with at least one unexpanded child.
  643|       |                 * Expand it. By the time we hit this node again, the result of
  644|       |                 * that child (and all earlier children) will be at the end of `results`. */
  645|   584k|                size_t child_index = stack.back().expanded++;
  646|   584k|                State child_state = downfn(stack.back().state, node, child_index);
  647|   584k|                stack.emplace_back(*node.subs[child_index], 0, std::move(child_state));
  648|   584k|                continue;
  649|   584k|            }
  650|       |            // Invoke upfn with the last node.subs.size() elements of results as input.
  651|   590k|            assert(results.size() >= node.subs.size());
  652|   590k|            std::optional<Result> result{upfn(std::move(stack.back().state), node,
  653|   590k|                Span<Result>{results}.last(node.subs.size()))};
  654|       |            // If evaluation returns std::nullopt, abort immediately.
  655|   590k|            if (!result) return {};
  ------------------
  |  Branch (655:17): [True: 0, False: 590k]
  ------------------
  656|       |            // Replace the last node.subs.size() elements of results with the new result.
  657|   590k|            results.erase(results.end() - node.subs.size(), results.end());
  658|   590k|            results.push_back(std::move(*result));
  659|   590k|            stack.pop_back();
  660|   590k|        }
  661|       |        // The final remaining results element is the root result, return it.
  662|  6.02k|        assert(results.size() == 1);
  663|  6.02k|        return std::move(results[0]);
  664|  6.02k|    }
descriptor.cpp:_ZZNK10miniscript4NodeIjE13TreeEvalMaybeINSt3__18optionalINS3_3setIjZNKS1_17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_E4CompNS3_9allocatorIjEEEEEEZNKS1_8TreeEvalISG_ZNKS6_IS8_EEvSB_EUlRKS1_4SpanISG_EE_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_:
  614|   590k|                node(node_), expanded(exp_), state(std::move(state_)) {}
descriptor.cpp:_ZZNK10miniscript4NodeIjE8TreeEvalINSt3__18optionalINS3_3setIjZNKS1_17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_E4CompNS3_9allocatorIjEEEEEEZNKS6_IS8_EEvSB_EUlRKS1_4SpanISG_EE_EES9_T0_ENKUlZNKS2_ISG_SL_EES9_SM_E10DummyStateSI_mE_clESN_SI_m:
  702|   584k|            [](DummyState, const Node&, size_t) { return DummyState{}; },
descriptor.cpp:_ZZNK10miniscript4NodeIjE8TreeEvalINSt3__18optionalINS3_3setIjZNKS1_17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_E4CompNS3_9allocatorIjEEEEEEZNKS6_IS8_EEvSB_EUlRKS1_4SpanISG_EE_EES9_T0_ENKUlZNKS2_ISG_SL_EES9_SM_E10DummyStateSI_SK_E_clESN_SI_SK_:
  703|   590k|            [&upfn](DummyState, const Node& node, Span<Result> subs) {
  704|   590k|                Result res{upfn(node, subs)};
  705|   590k|                return std::optional<Result>(std::move(res));
  706|   590k|            }
descriptor.cpp:_ZZNK10miniscript4NodeIjE17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_ENKUlRKS1_4SpanINSt3__18optionalINSB_3setIjZNKS2_IS4_EEvS7_E4CompNSB_9allocatorIjEEEEEEEE_clES9_SJ_:
 1456|   590k|        auto upfn = [&ctx](const Node& node, Span<state> subs) -> state {
 1457|       |            // If this node is already known to have duplicates, nothing left to do.
 1458|   590k|            if (node.has_duplicate_keys.has_value() && *node.has_duplicate_keys) return {};
  ------------------
  |  Branch (1458:17): [True: 0, False: 590k]
  |  Branch (1458:56): [True: 0, False: 0]
  ------------------
 1459|       |
 1460|       |            // Check if one of the children is already known to have duplicates.
 1461|   590k|            for (auto& sub : subs) {
  ------------------
  |  Branch (1461:28): [True: 580k, False: 583k]
  ------------------
 1462|   580k|                if (!sub.has_value()) {
  ------------------
  |  Branch (1462:21): [True: 6.56k, False: 574k]
  ------------------
 1463|  6.56k|                    node.has_duplicate_keys = true;
 1464|  6.56k|                    return {};
 1465|  6.56k|                }
 1466|   580k|            }
 1467|       |
 1468|       |            // Start building the set of keys involved in this node and children.
 1469|       |            // Start by keys in this node directly.
 1470|   583k|            size_t keys_count = node.keys.size();
 1471|   583k|            keyset key_set{node.keys.begin(), node.keys.end(), Comp(ctx)};
 1472|   583k|            if (key_set.size() != keys_count) {
  ------------------
  |  Branch (1472:17): [True: 184, False: 583k]
  ------------------
 1473|       |                // It already has duplicates; bail out.
 1474|    184|                node.has_duplicate_keys = true;
 1475|    184|                return {};
 1476|    184|            }
 1477|       |
 1478|       |            // Merge the keys from the children into this set.
 1479|   583k|            for (auto& sub : subs) {
  ------------------
  |  Branch (1479:28): [True: 566k, False: 583k]
  ------------------
 1480|   566k|                keys_count += sub->size();
 1481|       |                // Small optimization: std::set::merge is linear in the size of the second arg but
 1482|       |                // logarithmic in the size of the first.
 1483|   566k|                if (key_set.size() < sub->size()) std::swap(key_set, *sub);
  ------------------
  |  Branch (1483:21): [True: 88.8k, False: 477k]
  ------------------
 1484|   566k|                key_set.merge(*sub);
 1485|   566k|                if (key_set.size() != keys_count) {
  ------------------
  |  Branch (1485:21): [True: 253, False: 566k]
  ------------------
 1486|    253|                    node.has_duplicate_keys = true;
 1487|    253|                    return {};
 1488|    253|                }
 1489|   566k|            }
 1490|       |
 1491|   583k|            node.has_duplicate_keys = false;
 1492|   583k|            return key_set;
 1493|   583k|        };
descriptor.cpp:_ZZNK10miniscript4NodeIjE17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_EN4CompC2ERKS4_:
 1446|   583k|            Comp(const Ctx& ctx) : ctx_ptr(&ctx) {}
descriptor.cpp:_ZZNK10miniscript4NodeIjE17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_ENK4CompclERKjSA_:
 1447|  39.5k|            bool operator()(const Key& a, const Key& b) const { return ctx_ptr->KeyCompare(a, b); }
_ZNK10miniscript4NodeIjE6IsSaneEv:
 1641|  4.86k|    bool IsSane() const { return IsValidTopLevel() && IsSaneSubexpression() && NeedsSignature(); }
  ------------------
  |  Branch (1641:34): [True: 4.37k, False: 486]
  |  Branch (1641:55): [True: 4.16k, False: 215]
  |  Branch (1641:80): [True: 4.06k, False: 100]
  ------------------
_ZNK10miniscript4NodeIjE15IsValidTopLevelEv:
 1620|  6.20k|    bool IsValidTopLevel() const { return IsValid() && GetType() << "B"_mst; }
  ------------------
  |  Branch (1620:43): [True: 5.76k, False: 438]
  |  Branch (1620:56): [True: 5.72k, False: 48]
  ------------------
_ZNK10miniscript4NodeIjE19IsSaneSubexpressionEv:
 1638|   214k|    bool IsSaneSubexpression() const { return ValidSatisfactions() && IsNonMalleable() && CheckTimeLocksMix() && CheckDuplicateKey(); }
  ------------------
  |  Branch (1638:47): [True: 199k, False: 14.5k]
  |  Branch (1638:71): [True: 199k, False: 255]
  |  Branch (1638:91): [True: 199k, False: 42]
  |  Branch (1638:114): [True: 198k, False: 321]
  ------------------
_ZNK10miniscript4NodeIjE16IsNotSatisfiableEv:
 1547|  2.65k|    bool IsNotSatisfiable() const { return !GetStackSize(); }
_ZNK10miniscript4NodeIjE12GetStackSizeEv:
 1523|  63.5k|    std::optional<uint32_t> GetStackSize() const {
 1524|  63.5k|        if (!ss.sat.valid) return {};
  ------------------
  |  Branch (1524:13): [True: 29.8k, False: 33.7k]
  ------------------
 1525|  33.7k|        return ss.sat.netdiff + static_cast<int32_t>(IsBKW());
 1526|  63.5k|    }
_ZNK10miniscript4NodeIjE5IsBKWEv:
 1518|   121k|    bool IsBKW() const {
 1519|   121k|        return !((GetType() & "BKW"_mst) == ""_mst);
 1520|   121k|    }
_ZNK10miniscript4NodeIjE13FindInsaneSubEv:
 1563|    646|    const Node* FindInsaneSub() const {
 1564|    646|        return TreeEval<const Node*>([](const Node& node, Span<const Node*> subs) -> const Node* {
 1565|    646|            for (auto& sub: subs) if (sub) return sub;
 1566|    646|            if (!node.IsSaneSubexpression()) return &node;
 1567|    646|            return nullptr;
 1568|    646|        });
 1569|    646|    }
_ZNK10miniscript4NodeIjE8TreeEvalIPKS1_ZNKS1_13FindInsaneSubEvEUlRS3_4SpanIS4_EE_EET_T0_:
  699|    646|    {
  700|    646|        struct DummyState {};
  701|    646|        return std::move(*TreeEvalMaybe<Result>(DummyState{},
  702|    646|            [](DummyState, const Node&, size_t) { return DummyState{}; },
  703|    646|            [&upfn](DummyState, const Node& node, Span<Result> subs) {
  704|    646|                Result res{upfn(node, subs)};
  705|    646|                return std::optional<Result>(std::move(res));
  706|    646|            }
  707|    646|        ));
  708|    646|    }
_ZNK10miniscript4NodeIjE13TreeEvalMaybeIPKS1_ZNKS1_8TreeEvalIS4_ZNKS1_13FindInsaneSubEvEUlRS3_4SpanIS4_EE_EET_T0_E10DummyStateZNKS5_IS4_S9_EESA_SB_EUlSC_S6_mE_ZNKS5_IS4_S9_EESA_SB_EUlSC_S6_S8_E_EENSt3__18optionalISA_EESB_T1_T2_:
  605|    646|    {
  606|       |        /** Entries of the explicit stack tracked in this algorithm. */
  607|    646|        struct StackElem
  608|    646|        {
  609|    646|            const Node& node; //!< The node being evaluated.
  610|    646|            size_t expanded; //!< How many children of this node have been expanded.
  611|    646|            State state; //!< The state for that node.
  612|       |
  613|    646|            StackElem(const Node& node_, size_t exp_, State&& state_) :
  614|    646|                node(node_), expanded(exp_), state(std::move(state_)) {}
  615|    646|        };
  616|       |        /* Stack of tree nodes being explored. */
  617|    646|        std::vector<StackElem> stack;
  618|       |        /* Results of subtrees so far. Their order and mapping to tree nodes
  619|       |         * is implicitly defined by stack. */
  620|    646|        std::vector<Result> results;
  621|    646|        stack.emplace_back(*this, 0, std::move(root_state));
  622|       |
  623|       |        /* Here is a demonstration of the algorithm, for an example tree A(B,C(D,E),F).
  624|       |         * State variables are omitted for simplicity.
  625|       |         *
  626|       |         * First: stack=[(A,0)] results=[]
  627|       |         *        stack=[(A,1),(B,0)] results=[]
  628|       |         *        stack=[(A,1)] results=[B]
  629|       |         *        stack=[(A,2),(C,0)] results=[B]
  630|       |         *        stack=[(A,2),(C,1),(D,0)] results=[B]
  631|       |         *        stack=[(A,2),(C,1)] results=[B,D]
  632|       |         *        stack=[(A,2),(C,2),(E,0)] results=[B,D]
  633|       |         *        stack=[(A,2),(C,2)] results=[B,D,E]
  634|       |         *        stack=[(A,2)] results=[B,C]
  635|       |         *        stack=[(A,3),(F,0)] results=[B,C]
  636|       |         *        stack=[(A,3)] results=[B,C,F]
  637|       |         * Final: stack=[] results=[A]
  638|       |         */
  639|   780k|        while (stack.size()) {
  ------------------
  |  Branch (639:16): [True: 780k, False: 646]
  ------------------
  640|   780k|            const Node& node = stack.back().node;
  641|   780k|            if (stack.back().expanded < node.subs.size()) {
  ------------------
  |  Branch (641:17): [True: 389k, False: 390k]
  ------------------
  642|       |                /* We encounter a tree node with at least one unexpanded child.
  643|       |                 * Expand it. By the time we hit this node again, the result of
  644|       |                 * that child (and all earlier children) will be at the end of `results`. */
  645|   389k|                size_t child_index = stack.back().expanded++;
  646|   389k|                State child_state = downfn(stack.back().state, node, child_index);
  647|   389k|                stack.emplace_back(*node.subs[child_index], 0, std::move(child_state));
  648|   389k|                continue;
  649|   389k|            }
  650|       |            // Invoke upfn with the last node.subs.size() elements of results as input.
  651|   390k|            assert(results.size() >= node.subs.size());
  652|   390k|            std::optional<Result> result{upfn(std::move(stack.back().state), node,
  653|   390k|                Span<Result>{results}.last(node.subs.size()))};
  654|       |            // If evaluation returns std::nullopt, abort immediately.
  655|   390k|            if (!result) return {};
  ------------------
  |  Branch (655:17): [True: 0, False: 390k]
  ------------------
  656|       |            // Replace the last node.subs.size() elements of results with the new result.
  657|   390k|            results.erase(results.end() - node.subs.size(), results.end());
  658|   390k|            results.push_back(std::move(*result));
  659|   390k|            stack.pop_back();
  660|   390k|        }
  661|       |        // The final remaining results element is the root result, return it.
  662|    646|        assert(results.size() == 1);
  663|    646|        return std::move(results[0]);
  664|    646|    }
_ZZNK10miniscript4NodeIjE13TreeEvalMaybeIPKS1_ZNKS1_8TreeEvalIS4_ZNKS1_13FindInsaneSubEvEUlRS3_4SpanIS4_EE_EET_T0_E10DummyStateZNKS5_IS4_S9_EESA_SB_EUlSC_S6_mE_ZNKS5_IS4_S9_EESA_SB_EUlSC_S6_S8_E_EENSt3__18optionalISA_EESB_T1_T2_EN9StackElemC2ES6_mOSC_:
  614|   390k|                node(node_), expanded(exp_), state(std::move(state_)) {}
_ZZNK10miniscript4NodeIjE8TreeEvalIPKS1_ZNKS1_13FindInsaneSubEvEUlRS3_4SpanIS4_EE_EET_T0_ENKUlZNKS2_IS4_S8_EES9_SA_E10DummyStateS5_mE_clESB_S5_m:
  702|   389k|            [](DummyState, const Node&, size_t) { return DummyState{}; },
_ZZNK10miniscript4NodeIjE8TreeEvalIPKS1_ZNKS1_13FindInsaneSubEvEUlRS3_4SpanIS4_EE_EET_T0_ENKUlZNKS2_IS4_S8_EES9_SA_E10DummyStateS5_S7_E_clESB_S5_S7_:
  703|   390k|            [&upfn](DummyState, const Node& node, Span<Result> subs) {
  704|   390k|                Result res{upfn(node, subs)};
  705|   390k|                return std::optional<Result>(std::move(res));
  706|   390k|            }
_ZZNK10miniscript4NodeIjE13FindInsaneSubEvENKUlRKS1_4SpanIPS2_EE_clES3_S6_:
 1564|   390k|        return TreeEval<const Node*>([](const Node& node, Span<const Node*> subs) -> const Node* {
 1565|   390k|            for (auto& sub: subs) if (sub) return sub;
  ------------------
  |  Branch (1565:27): [True: 310k, False: 209k]
  |  Branch (1565:39): [True: 180k, False: 129k]
  ------------------
 1566|   209k|            if (!node.IsSaneSubexpression()) return &node;
  ------------------
  |  Branch (1566:17): [True: 14.9k, False: 194k]
  ------------------
 1567|   194k|            return nullptr;
 1568|   209k|        });
descriptor.cpp:_ZNK10miniscript4NodeIjE8ToStringIN12_GLOBAL__N_19KeyParserEEENSt3__18optionalINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEERKT_:
  829|    646|    std::optional<std::string> ToString(const CTx& ctx) const {
  830|       |        // To construct the std::string representation for a Miniscript object, we use
  831|       |        // the TreeEvalMaybe algorithm. The State is a boolean: whether the parent node is a
  832|       |        // wrapper. If so, non-wrapper expressions must be prefixed with a ":".
  833|    646|        auto downfn = [](bool, const Node& node, size_t) {
  834|    646|            return (node.fragment == Fragment::WRAP_A || node.fragment == Fragment::WRAP_S ||
  835|    646|                    node.fragment == Fragment::WRAP_D || node.fragment == Fragment::WRAP_V ||
  836|    646|                    node.fragment == Fragment::WRAP_J || node.fragment == Fragment::WRAP_N ||
  837|    646|                    node.fragment == Fragment::WRAP_C ||
  838|    646|                    (node.fragment == Fragment::AND_V && node.subs[1]->fragment == Fragment::JUST_1) ||
  839|    646|                    (node.fragment == Fragment::OR_I && node.subs[0]->fragment == Fragment::JUST_0) ||
  840|    646|                    (node.fragment == Fragment::OR_I && node.subs[1]->fragment == Fragment::JUST_0));
  841|    646|        };
  842|       |        // The upward function computes for a node, given whether its parent is a wrapper,
  843|       |        // and the string representations of its child nodes, the string representation of the node.
  844|    646|        const bool is_tapscript{IsTapscript(m_script_ctx)};
  845|    646|        auto upfn = [&ctx, is_tapscript](bool wrapped, const Node& node, Span<std::string> subs) -> std::optional<std::string> {
  846|    646|            std::string ret = wrapped ? ":" : "";
  847|       |
  848|    646|            switch (node.fragment) {
  849|    646|                case Fragment::WRAP_A: return "a" + std::move(subs[0]);
  850|    646|                case Fragment::WRAP_S: return "s" + std::move(subs[0]);
  851|    646|                case Fragment::WRAP_C:
  852|    646|                    if (node.subs[0]->fragment == Fragment::PK_K) {
  853|       |                        // pk(K) is syntactic sugar for c:pk_k(K)
  854|    646|                        auto key_str = ctx.ToString(node.subs[0]->keys[0]);
  855|    646|                        if (!key_str) return {};
  856|    646|                        return std::move(ret) + "pk(" + std::move(*key_str) + ")";
  857|    646|                    }
  858|    646|                    if (node.subs[0]->fragment == Fragment::PK_H) {
  859|       |                        // pkh(K) is syntactic sugar for c:pk_h(K)
  860|    646|                        auto key_str = ctx.ToString(node.subs[0]->keys[0]);
  861|    646|                        if (!key_str) return {};
  862|    646|                        return std::move(ret) + "pkh(" + std::move(*key_str) + ")";
  863|    646|                    }
  864|    646|                    return "c" + std::move(subs[0]);
  865|    646|                case Fragment::WRAP_D: return "d" + std::move(subs[0]);
  866|    646|                case Fragment::WRAP_V: return "v" + std::move(subs[0]);
  867|    646|                case Fragment::WRAP_J: return "j" + std::move(subs[0]);
  868|    646|                case Fragment::WRAP_N: return "n" + std::move(subs[0]);
  869|    646|                case Fragment::AND_V:
  870|       |                    // t:X is syntactic sugar for and_v(X,1).
  871|    646|                    if (node.subs[1]->fragment == Fragment::JUST_1) return "t" + std::move(subs[0]);
  872|    646|                    break;
  873|    646|                case Fragment::OR_I:
  874|    646|                    if (node.subs[0]->fragment == Fragment::JUST_0) return "l" + std::move(subs[1]);
  875|    646|                    if (node.subs[1]->fragment == Fragment::JUST_0) return "u" + std::move(subs[0]);
  876|    646|                    break;
  877|    646|                default: break;
  878|    646|            }
  879|    646|            switch (node.fragment) {
  880|    646|                case Fragment::PK_K: {
  881|    646|                    auto key_str = ctx.ToString(node.keys[0]);
  882|    646|                    if (!key_str) return {};
  883|    646|                    return std::move(ret) + "pk_k(" + std::move(*key_str) + ")";
  884|    646|                }
  885|    646|                case Fragment::PK_H: {
  886|    646|                    auto key_str = ctx.ToString(node.keys[0]);
  887|    646|                    if (!key_str) return {};
  888|    646|                    return std::move(ret) + "pk_h(" + std::move(*key_str) + ")";
  889|    646|                }
  890|    646|                case Fragment::AFTER: return std::move(ret) + "after(" + util::ToString(node.k) + ")";
  891|    646|                case Fragment::OLDER: return std::move(ret) + "older(" + util::ToString(node.k) + ")";
  892|    646|                case Fragment::HASH256: return std::move(ret) + "hash256(" + HexStr(node.data) + ")";
  893|    646|                case Fragment::HASH160: return std::move(ret) + "hash160(" + HexStr(node.data) + ")";
  894|    646|                case Fragment::SHA256: return std::move(ret) + "sha256(" + HexStr(node.data) + ")";
  895|    646|                case Fragment::RIPEMD160: return std::move(ret) + "ripemd160(" + HexStr(node.data) + ")";
  896|    646|                case Fragment::JUST_1: return std::move(ret) + "1";
  897|    646|                case Fragment::JUST_0: return std::move(ret) + "0";
  898|    646|                case Fragment::AND_V: return std::move(ret) + "and_v(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  899|    646|                case Fragment::AND_B: return std::move(ret) + "and_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  900|    646|                case Fragment::OR_B: return std::move(ret) + "or_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  901|    646|                case Fragment::OR_D: return std::move(ret) + "or_d(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  902|    646|                case Fragment::OR_C: return std::move(ret) + "or_c(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  903|    646|                case Fragment::OR_I: return std::move(ret) + "or_i(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  904|    646|                case Fragment::ANDOR:
  905|       |                    // and_n(X,Y) is syntactic sugar for andor(X,Y,0).
  906|    646|                    if (node.subs[2]->fragment == Fragment::JUST_0) return std::move(ret) + "and_n(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  907|    646|                    return std::move(ret) + "andor(" + std::move(subs[0]) + "," + std::move(subs[1]) + "," + std::move(subs[2]) + ")";
  908|    646|                case Fragment::MULTI: {
  909|    646|                    CHECK_NONFATAL(!is_tapscript);
  910|    646|                    auto str = std::move(ret) + "multi(" + util::ToString(node.k);
  911|    646|                    for (const auto& key : node.keys) {
  912|    646|                        auto key_str = ctx.ToString(key);
  913|    646|                        if (!key_str) return {};
  914|    646|                        str += "," + std::move(*key_str);
  915|    646|                    }
  916|    646|                    return std::move(str) + ")";
  917|    646|                }
  918|    646|                case Fragment::MULTI_A: {
  919|    646|                    CHECK_NONFATAL(is_tapscript);
  920|    646|                    auto str = std::move(ret) + "multi_a(" + util::ToString(node.k);
  921|    646|                    for (const auto& key : node.keys) {
  922|    646|                        auto key_str = ctx.ToString(key);
  923|    646|                        if (!key_str) return {};
  924|    646|                        str += "," + std::move(*key_str);
  925|    646|                    }
  926|    646|                    return std::move(str) + ")";
  927|    646|                }
  928|    646|                case Fragment::THRESH: {
  929|    646|                    auto str = std::move(ret) + "thresh(" + util::ToString(node.k);
  930|    646|                    for (auto& sub : subs) {
  931|    646|                        str += "," + std::move(sub);
  932|    646|                    }
  933|    646|                    return std::move(str) + ")";
  934|    646|                }
  935|    646|                default: break;
  936|    646|            }
  937|    646|            assert(false);
  938|    646|        };
  939|       |
  940|    646|        return TreeEvalMaybe<std::string>(false, downfn, upfn);
  941|    646|    }
descriptor.cpp:_ZNK10miniscript4NodeIjE13TreeEvalMaybeINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEbZNKS1_8ToStringIN12_GLOBAL__N_19KeyParserEEENS3_8optionalIS9_EERKT_EUlbRKS1_mE_ZNKSA_ISC_EESE_SH_EUlbSJ_4SpanIS9_EE_EENSD_ISF_EET0_T1_T2_:
  605|    646|    {
  606|       |        /** Entries of the explicit stack tracked in this algorithm. */
  607|    646|        struct StackElem
  608|    646|        {
  609|    646|            const Node& node; //!< The node being evaluated.
  610|    646|            size_t expanded; //!< How many children of this node have been expanded.
  611|    646|            State state; //!< The state for that node.
  612|       |
  613|    646|            StackElem(const Node& node_, size_t exp_, State&& state_) :
  614|    646|                node(node_), expanded(exp_), state(std::move(state_)) {}
  615|    646|        };
  616|       |        /* Stack of tree nodes being explored. */
  617|    646|        std::vector<StackElem> stack;
  618|       |        /* Results of subtrees so far. Their order and mapping to tree nodes
  619|       |         * is implicitly defined by stack. */
  620|    646|        std::vector<Result> results;
  621|    646|        stack.emplace_back(*this, 0, std::move(root_state));
  622|       |
  623|       |        /* Here is a demonstration of the algorithm, for an example tree A(B,C(D,E),F).
  624|       |         * State variables are omitted for simplicity.
  625|       |         *
  626|       |         * First: stack=[(A,0)] results=[]
  627|       |         *        stack=[(A,1),(B,0)] results=[]
  628|       |         *        stack=[(A,1)] results=[B]
  629|       |         *        stack=[(A,2),(C,0)] results=[B]
  630|       |         *        stack=[(A,2),(C,1),(D,0)] results=[B]
  631|       |         *        stack=[(A,2),(C,1)] results=[B,D]
  632|       |         *        stack=[(A,2),(C,2),(E,0)] results=[B,D]
  633|       |         *        stack=[(A,2),(C,2)] results=[B,D,E]
  634|       |         *        stack=[(A,2)] results=[B,C]
  635|       |         *        stack=[(A,3),(F,0)] results=[B,C]
  636|       |         *        stack=[(A,3)] results=[B,C,F]
  637|       |         * Final: stack=[] results=[A]
  638|       |         */
  639|  73.0k|        while (stack.size()) {
  ------------------
  |  Branch (639:16): [True: 72.3k, False: 646]
  ------------------
  640|  72.3k|            const Node& node = stack.back().node;
  641|  72.3k|            if (stack.back().expanded < node.subs.size()) {
  ------------------
  |  Branch (641:17): [True: 35.8k, False: 36.5k]
  ------------------
  642|       |                /* We encounter a tree node with at least one unexpanded child.
  643|       |                 * Expand it. By the time we hit this node again, the result of
  644|       |                 * that child (and all earlier children) will be at the end of `results`. */
  645|  35.8k|                size_t child_index = stack.back().expanded++;
  646|  35.8k|                State child_state = downfn(stack.back().state, node, child_index);
  647|  35.8k|                stack.emplace_back(*node.subs[child_index], 0, std::move(child_state));
  648|  35.8k|                continue;
  649|  35.8k|            }
  650|       |            // Invoke upfn with the last node.subs.size() elements of results as input.
  651|  36.5k|            assert(results.size() >= node.subs.size());
  652|  36.5k|            std::optional<Result> result{upfn(std::move(stack.back().state), node,
  653|  36.5k|                Span<Result>{results}.last(node.subs.size()))};
  654|       |            // If evaluation returns std::nullopt, abort immediately.
  655|  36.5k|            if (!result) return {};
  ------------------
  |  Branch (655:17): [True: 0, False: 36.5k]
  ------------------
  656|       |            // Replace the last node.subs.size() elements of results with the new result.
  657|  36.5k|            results.erase(results.end() - node.subs.size(), results.end());
  658|  36.5k|            results.push_back(std::move(*result));
  659|  36.5k|            stack.pop_back();
  660|  36.5k|        }
  661|       |        // The final remaining results element is the root result, return it.
  662|    646|        assert(results.size() == 1);
  663|    646|        return std::move(results[0]);
  664|    646|    }
descriptor.cpp:_ZZNK10miniscript4NodeIjE13TreeEvalMaybeINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEbZNKS1_8ToStringIN12_GLOBAL__N_19KeyParserEEENS3_8optionalIS9_EERKT_EUlbRKS1_mE_ZNKSA_ISC_EESE_SH_EUlbSJ_4SpanIS9_EE_EENSD_ISF_EET0_T1_T2_EN9StackElemC2ESJ_mOb:
  614|  36.5k|                node(node_), expanded(exp_), state(std::move(state_)) {}
descriptor.cpp:_ZZNK10miniscript4NodeIjE8ToStringIN12_GLOBAL__N_19KeyParserEEENSt3__18optionalINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEERKT_ENKUlbRKS1_mE_clEbSI_m:
  833|  35.8k|        auto downfn = [](bool, const Node& node, size_t) {
  834|  35.8k|            return (node.fragment == Fragment::WRAP_A || node.fragment == Fragment::WRAP_S ||
  ------------------
  |  Branch (834:21): [True: 852, False: 35.0k]
  |  Branch (834:58): [True: 695, False: 34.3k]
  ------------------
  835|  35.8k|                    node.fragment == Fragment::WRAP_D || node.fragment == Fragment::WRAP_V ||
  ------------------
  |  Branch (835:21): [True: 368, False: 33.9k]
  |  Branch (835:58): [True: 1.14k, False: 32.8k]
  ------------------
  836|  35.8k|                    node.fragment == Fragment::WRAP_J || node.fragment == Fragment::WRAP_N ||
  ------------------
  |  Branch (836:21): [True: 838, False: 31.9k]
  |  Branch (836:58): [True: 5.03k, False: 26.9k]
  ------------------
  837|  35.8k|                    node.fragment == Fragment::WRAP_C ||
  ------------------
  |  Branch (837:21): [True: 139, False: 26.7k]
  ------------------
  838|  35.8k|                    (node.fragment == Fragment::AND_V && node.subs[1]->fragment == Fragment::JUST_1) ||
  ------------------
  |  Branch (838:22): [True: 1.62k, False: 25.1k]
  |  Branch (838:58): [True: 1.06k, False: 556]
  ------------------
  839|  35.8k|                    (node.fragment == Fragment::OR_I && node.subs[0]->fragment == Fragment::JUST_0) ||
  ------------------
  |  Branch (839:22): [True: 15.0k, False: 10.6k]
  |  Branch (839:57): [True: 5.40k, False: 9.67k]
  ------------------
  840|  35.8k|                    (node.fragment == Fragment::OR_I && node.subs[1]->fragment == Fragment::JUST_0));
  ------------------
  |  Branch (840:22): [True: 9.67k, False: 10.6k]
  |  Branch (840:57): [True: 8.99k, False: 682]
  ------------------
  841|  35.8k|        };
descriptor.cpp:_ZZNK10miniscript4NodeIjE8ToStringIN12_GLOBAL__N_19KeyParserEEENSt3__18optionalINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEERKT_ENKUlbRKS1_4SpanISC_EE_clEbSI_SK_:
  845|  36.5k|        auto upfn = [&ctx, is_tapscript](bool wrapped, const Node& node, Span<std::string> subs) -> std::optional<std::string> {
  846|  36.5k|            std::string ret = wrapped ? ":" : "";
  ------------------
  |  Branch (846:31): [True: 24.5k, False: 11.9k]
  ------------------
  847|       |
  848|  36.5k|            switch (node.fragment) {
  849|    852|                case Fragment::WRAP_A: return "a" + std::move(subs[0]);
  ------------------
  |  Branch (849:17): [True: 852, False: 35.6k]
  ------------------
  850|    695|                case Fragment::WRAP_S: return "s" + std::move(subs[0]);
  ------------------
  |  Branch (850:17): [True: 695, False: 35.8k]
  ------------------
  851|    139|                case Fragment::WRAP_C:
  ------------------
  |  Branch (851:17): [True: 139, False: 36.3k]
  ------------------
  852|    139|                    if (node.subs[0]->fragment == Fragment::PK_K) {
  ------------------
  |  Branch (852:25): [True: 91, False: 48]
  ------------------
  853|       |                        // pk(K) is syntactic sugar for c:pk_k(K)
  854|     91|                        auto key_str = ctx.ToString(node.subs[0]->keys[0]);
  855|     91|                        if (!key_str) return {};
  ------------------
  |  Branch (855:29): [True: 0, False: 91]
  ------------------
  856|     91|                        return std::move(ret) + "pk(" + std::move(*key_str) + ")";
  857|     91|                    }
  858|     48|                    if (node.subs[0]->fragment == Fragment::PK_H) {
  ------------------
  |  Branch (858:25): [True: 37, False: 11]
  ------------------
  859|       |                        // pkh(K) is syntactic sugar for c:pk_h(K)
  860|     37|                        auto key_str = ctx.ToString(node.subs[0]->keys[0]);
  861|     37|                        if (!key_str) return {};
  ------------------
  |  Branch (861:29): [True: 0, False: 37]
  ------------------
  862|     37|                        return std::move(ret) + "pkh(" + std::move(*key_str) + ")";
  863|     37|                    }
  864|     11|                    return "c" + std::move(subs[0]);
  865|    368|                case Fragment::WRAP_D: return "d" + std::move(subs[0]);
  ------------------
  |  Branch (865:17): [True: 368, False: 36.1k]
  ------------------
  866|  1.14k|                case Fragment::WRAP_V: return "v" + std::move(subs[0]);
  ------------------
  |  Branch (866:17): [True: 1.14k, False: 35.3k]
  ------------------
  867|    838|                case Fragment::WRAP_J: return "j" + std::move(subs[0]);
  ------------------
  |  Branch (867:17): [True: 838, False: 35.6k]
  ------------------
  868|  5.03k|                case Fragment::WRAP_N: return "n" + std::move(subs[0]);
  ------------------
  |  Branch (868:17): [True: 5.03k, False: 31.4k]
  ------------------
  869|    812|                case Fragment::AND_V:
  ------------------
  |  Branch (869:17): [True: 812, False: 35.6k]
  ------------------
  870|       |                    // t:X is syntactic sugar for and_v(X,1).
  871|    812|                    if (node.subs[1]->fragment == Fragment::JUST_1) return "t" + std::move(subs[0]);
  ------------------
  |  Branch (871:25): [True: 534, False: 278]
  ------------------
  872|    278|                    break;
  873|  7.53k|                case Fragment::OR_I:
  ------------------
  |  Branch (873:17): [True: 7.53k, False: 28.9k]
  ------------------
  874|  7.53k|                    if (node.subs[0]->fragment == Fragment::JUST_0) return "l" + std::move(subs[1]);
  ------------------
  |  Branch (874:25): [True: 2.70k, False: 4.83k]
  ------------------
  875|  4.83k|                    if (node.subs[1]->fragment == Fragment::JUST_0) return "u" + std::move(subs[0]);
  ------------------
  |  Branch (875:25): [True: 4.49k, False: 341]
  ------------------
  876|    341|                    break;
  877|  19.0k|                default: break;
  ------------------
  |  Branch (877:17): [True: 19.0k, False: 17.4k]
  ------------------
  878|  36.5k|            }
  879|  19.7k|            switch (node.fragment) {
  880|    111|                case Fragment::PK_K: {
  ------------------
  |  Branch (880:17): [True: 111, False: 19.5k]
  ------------------
  881|    111|                    auto key_str = ctx.ToString(node.keys[0]);
  882|    111|                    if (!key_str) return {};
  ------------------
  |  Branch (882:25): [True: 0, False: 111]
  ------------------
  883|    111|                    return std::move(ret) + "pk_k(" + std::move(*key_str) + ")";
  884|    111|                }
  885|     80|                case Fragment::PK_H: {
  ------------------
  |  Branch (885:17): [True: 80, False: 19.6k]
  ------------------
  886|     80|                    auto key_str = ctx.ToString(node.keys[0]);
  887|     80|                    if (!key_str) return {};
  ------------------
  |  Branch (887:25): [True: 0, False: 80]
  ------------------
  888|     80|                    return std::move(ret) + "pk_h(" + std::move(*key_str) + ")";
  889|     80|                }
  890|    580|                case Fragment::AFTER: return std::move(ret) + "after(" + util::ToString(node.k) + ")";
  ------------------
  |  Branch (890:17): [True: 580, False: 19.1k]
  ------------------
  891|    231|                case Fragment::OLDER: return std::move(ret) + "older(" + util::ToString(node.k) + ")";
  ------------------
  |  Branch (891:17): [True: 231, False: 19.4k]
  ------------------
  892|      5|                case Fragment::HASH256: return std::move(ret) + "hash256(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (892:17): [True: 5, False: 19.6k]
  ------------------
  893|     61|                case Fragment::HASH160: return std::move(ret) + "hash160(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (893:17): [True: 61, False: 19.6k]
  ------------------
  894|      3|                case Fragment::SHA256: return std::move(ret) + "sha256(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (894:17): [True: 3, False: 19.6k]
  ------------------
  895|     10|                case Fragment::RIPEMD160: return std::move(ret) + "ripemd160(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (895:17): [True: 10, False: 19.6k]
  ------------------
  896|  4.61k|                case Fragment::JUST_1: return std::move(ret) + "1";
  ------------------
  |  Branch (896:17): [True: 4.61k, False: 15.0k]
  ------------------
  897|  11.7k|                case Fragment::JUST_0: return std::move(ret) + "0";
  ------------------
  |  Branch (897:17): [True: 11.7k, False: 7.96k]
  ------------------
  898|    278|                case Fragment::AND_V: return std::move(ret) + "and_v(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (898:17): [True: 278, False: 19.4k]
  ------------------
  899|     91|                case Fragment::AND_B: return std::move(ret) + "and_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (899:17): [True: 91, False: 19.6k]
  ------------------
  900|     85|                case Fragment::OR_B: return std::move(ret) + "or_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (900:17): [True: 85, False: 19.6k]
  ------------------
  901|    113|                case Fragment::OR_D: return std::move(ret) + "or_d(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (901:17): [True: 113, False: 19.5k]
  ------------------
  902|     46|                case Fragment::OR_C: return std::move(ret) + "or_c(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (902:17): [True: 46, False: 19.6k]
  ------------------
  903|    341|                case Fragment::OR_I: return std::move(ret) + "or_i(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (903:17): [True: 341, False: 19.3k]
  ------------------
  904|    680|                case Fragment::ANDOR:
  ------------------
  |  Branch (904:17): [True: 680, False: 19.0k]
  ------------------
  905|       |                    // and_n(X,Y) is syntactic sugar for andor(X,Y,0).
  906|    680|                    if (node.subs[2]->fragment == Fragment::JUST_0) return std::move(ret) + "and_n(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (906:25): [True: 229, False: 451]
  ------------------
  907|    451|                    return std::move(ret) + "andor(" + std::move(subs[0]) + "," + std::move(subs[1]) + "," + std::move(subs[2]) + ")";
  908|    337|                case Fragment::MULTI: {
  ------------------
  |  Branch (908:17): [True: 337, False: 19.3k]
  ------------------
  909|    337|                    CHECK_NONFATAL(!is_tapscript);
  ------------------
  |  |   82|    337|    inline_check_non_fatal(condition, __FILE__, __LINE__, __func__, #condition)
  ------------------
  910|    337|                    auto str = std::move(ret) + "multi(" + util::ToString(node.k);
  911|  1.82k|                    for (const auto& key : node.keys) {
  ------------------
  |  Branch (911:42): [True: 1.82k, False: 337]
  ------------------
  912|  1.82k|                        auto key_str = ctx.ToString(key);
  913|  1.82k|                        if (!key_str) return {};
  ------------------
  |  Branch (913:29): [True: 0, False: 1.82k]
  ------------------
  914|  1.82k|                        str += "," + std::move(*key_str);
  915|  1.82k|                    }
  916|    337|                    return std::move(str) + ")";
  917|    337|                }
  918|     23|                case Fragment::MULTI_A: {
  ------------------
  |  Branch (918:17): [True: 23, False: 19.6k]
  ------------------
  919|     23|                    CHECK_NONFATAL(is_tapscript);
  ------------------
  |  |   82|     23|    inline_check_non_fatal(condition, __FILE__, __LINE__, __func__, #condition)
  ------------------
  920|     23|                    auto str = std::move(ret) + "multi_a(" + util::ToString(node.k);
  921|    785|                    for (const auto& key : node.keys) {
  ------------------
  |  Branch (921:42): [True: 785, False: 23]
  ------------------
  922|    785|                        auto key_str = ctx.ToString(key);
  923|    785|                        if (!key_str) return {};
  ------------------
  |  Branch (923:29): [True: 0, False: 785]
  ------------------
  924|    785|                        str += "," + std::move(*key_str);
  925|    785|                    }
  926|     23|                    return std::move(str) + ")";
  927|     23|                }
  928|    272|                case Fragment::THRESH: {
  ------------------
  |  Branch (928:17): [True: 272, False: 19.4k]
  ------------------
  929|    272|                    auto str = std::move(ret) + "thresh(" + util::ToString(node.k);
  930|  7.37k|                    for (auto& sub : subs) {
  ------------------
  |  Branch (930:36): [True: 7.37k, False: 272]
  ------------------
  931|  7.37k|                        str += "," + std::move(sub);
  932|  7.37k|                    }
  933|    272|                    return std::move(str) + ")";
  934|     23|                }
  935|      0|                default: break;
  ------------------
  |  Branch (935:17): [True: 0, False: 19.7k]
  ------------------
  936|  19.7k|            }
  937|      0|            assert(false);
  938|      0|        };
_ZNK10miniscript4NodeIjE7IsValidEv:
 1614|   302k|    bool IsValid() const {
 1615|   302k|        if (GetType() == ""_mst) return false;
  ------------------
  |  Branch (1615:13): [True: 15.3k, False: 287k]
  ------------------
 1616|   287k|        return ScriptSize() <= internal::MaxScriptSize(m_script_ctx);
 1617|   302k|    }
_ZNK10miniscript4NodeIjE14IsNonMalleableEv:
 1623|   199k|    bool IsNonMalleable() const { return GetType() << "m"_mst; }
_ZNK10miniscript4NodeIjE14NeedsSignatureEv:
 1626|  4.24k|    bool NeedsSignature() const { return GetType() << "s"_mst; }
_ZNK10miniscript4NodeIjE17CheckTimeLocksMixEv:
 1629|   199k|    bool CheckTimeLocksMix() const { return GetType() << "k"_mst; }
_ZNK10miniscript4NodeIjE17CheckDuplicateKeyEv:
 1632|   199k|    bool CheckDuplicateKey() const { return has_duplicate_keys && !*has_duplicate_keys; }
  ------------------
  |  Branch (1632:45): [True: 199k, False: 0]
  |  Branch (1632:67): [True: 199k, False: 423]
  ------------------
_ZNK10miniscript4NodeIjE18ValidSatisfactionsEv:
 1635|   214k|    bool ValidSatisfactions() const { return IsValid() && CheckOpsLimit() && CheckStackSize(); }
  ------------------
  |  Branch (1635:46): [True: 199k, False: 14.5k]
  |  Branch (1635:59): [True: 199k, False: 70]
  |  Branch (1635:78): [True: 199k, False: 0]
  ------------------
_ZNK10miniscript4NodeIjE13CheckOpsLimitEv:
 1511|   199k|    bool CheckOpsLimit() const {
 1512|   199k|        if (IsTapscript(m_script_ctx)) return true;
  ------------------
  |  Branch (1512:13): [True: 139k, False: 60.4k]
  ------------------
 1513|  60.4k|        if (const auto ops = GetOps()) return *ops <= MAX_OPS_PER_SCRIPT;
  ------------------
  |  Branch (1513:24): [True: 30.6k, False: 29.7k]
  ------------------
 1514|  29.7k|        return true;
 1515|  60.4k|    }
_ZNK10miniscript4NodeIjE6GetOpsEv:
 1502|  60.4k|    std::optional<uint32_t> GetOps() const {
 1503|  60.4k|        if (!ops.sat.valid) return {};
  ------------------
  |  Branch (1503:13): [True: 29.7k, False: 30.6k]
  ------------------
 1504|  30.6k|        return ops.count + ops.sat.value;
 1505|  60.4k|    }
_ZNK10miniscript4NodeIjE14CheckStackSizeEv:
 1535|   199k|    bool CheckStackSize() const {
 1536|       |        // Since in Tapscript there is no standardness limit on the script and witness sizes, we may run
 1537|       |        // into the maximum stack size while executing the script. Make sure it doesn't happen.
 1538|   199k|        if (IsTapscript(m_script_ctx)) {
  ------------------
  |  Branch (1538:13): [True: 139k, False: 60.3k]
  ------------------
 1539|   139k|            if (const auto exec_ss = GetExecStackSize()) return exec_ss <= MAX_STACK_SIZE;
  ------------------
  |  Branch (1539:28): [True: 87.4k, False: 51.8k]
  ------------------
 1540|  51.8k|            return true;
 1541|   139k|        }
 1542|  60.3k|        if (const auto ss = GetStackSize()) return *ss <= MAX_STANDARD_P2WSH_STACK_ITEMS;
  ------------------
  |  Branch (1542:24): [True: 30.5k, False: 29.7k]
  ------------------
 1543|  29.7k|        return true;
 1544|  60.3k|    }
_ZNK10miniscript4NodeIjE16GetExecStackSizeEv:
 1529|   139k|    std::optional<uint32_t> GetExecStackSize() const {
 1530|   139k|        if (!ss.sat.valid) return {};
  ------------------
  |  Branch (1530:13): [True: 51.8k, False: 87.4k]
  ------------------
 1531|  87.4k|        return ss.sat.exec + static_cast<int32_t>(IsBKW());
 1532|   139k|    }
_ZNK10miniscript4NodeIjE8GetMsCtxEv:
 1560|  2.68k|    MiniscriptContext GetMsCtx() const { return m_script_ctx; }
descriptor.cpp:_ZNK10miniscript4NodeIjE8ToScriptIN12_GLOBAL__N_111ScriptMakerEEE7CScriptRKT_:
  751|  2.68k|    {
  752|       |        // To construct the CScript for a Miniscript object, we use the TreeEval algorithm.
  753|       |        // The State is a boolean: whether or not the node's script expansion is followed
  754|       |        // by an OP_VERIFY (which may need to be combined with the last script opcode).
  755|  2.68k|        auto downfn = [](bool verify, const Node& node, size_t index) {
  756|       |            // For WRAP_V, the subexpression is certainly followed by OP_VERIFY.
  757|  2.68k|            if (node.fragment == Fragment::WRAP_V) return true;
  758|       |            // The subexpression of WRAP_S, and the last subexpression of AND_V
  759|       |            // inherit the followed-by-OP_VERIFY property from the parent.
  760|  2.68k|            if (node.fragment == Fragment::WRAP_S ||
  761|  2.68k|                (node.fragment == Fragment::AND_V && index == 1)) return verify;
  762|  2.68k|            return false;
  763|  2.68k|        };
  764|       |        // The upward function computes for a node, given its followed-by-OP_VERIFY status
  765|       |        // and the CScripts of its child nodes, the CScript of the node.
  766|  2.68k|        const bool is_tapscript{IsTapscript(m_script_ctx)};
  767|  2.68k|        auto upfn = [&ctx, is_tapscript](bool verify, const Node& node, Span<CScript> subs) -> CScript {
  768|  2.68k|            switch (node.fragment) {
  769|  2.68k|                case Fragment::PK_K: return BuildScript(ctx.ToPKBytes(node.keys[0]));
  770|  2.68k|                case Fragment::PK_H: return BuildScript(OP_DUP, OP_HASH160, ctx.ToPKHBytes(node.keys[0]), OP_EQUALVERIFY);
  771|  2.68k|                case Fragment::OLDER: return BuildScript(node.k, OP_CHECKSEQUENCEVERIFY);
  772|  2.68k|                case Fragment::AFTER: return BuildScript(node.k, OP_CHECKLOCKTIMEVERIFY);
  773|  2.68k|                case Fragment::SHA256: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_SHA256, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  774|  2.68k|                case Fragment::RIPEMD160: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_RIPEMD160, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  775|  2.68k|                case Fragment::HASH256: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_HASH256, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  776|  2.68k|                case Fragment::HASH160: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_HASH160, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  777|  2.68k|                case Fragment::WRAP_A: return BuildScript(OP_TOALTSTACK, subs[0], OP_FROMALTSTACK);
  778|  2.68k|                case Fragment::WRAP_S: return BuildScript(OP_SWAP, subs[0]);
  779|  2.68k|                case Fragment::WRAP_C: return BuildScript(std::move(subs[0]), verify ? OP_CHECKSIGVERIFY : OP_CHECKSIG);
  780|  2.68k|                case Fragment::WRAP_D: return BuildScript(OP_DUP, OP_IF, subs[0], OP_ENDIF);
  781|  2.68k|                case Fragment::WRAP_V: {
  782|  2.68k|                    if (node.subs[0]->GetType() << "x"_mst) {
  783|  2.68k|                        return BuildScript(std::move(subs[0]), OP_VERIFY);
  784|  2.68k|                    } else {
  785|  2.68k|                        return std::move(subs[0]);
  786|  2.68k|                    }
  787|  2.68k|                }
  788|  2.68k|                case Fragment::WRAP_J: return BuildScript(OP_SIZE, OP_0NOTEQUAL, OP_IF, subs[0], OP_ENDIF);
  789|  2.68k|                case Fragment::WRAP_N: return BuildScript(std::move(subs[0]), OP_0NOTEQUAL);
  790|  2.68k|                case Fragment::JUST_1: return BuildScript(OP_1);
  791|  2.68k|                case Fragment::JUST_0: return BuildScript(OP_0);
  792|  2.68k|                case Fragment::AND_V: return BuildScript(std::move(subs[0]), subs[1]);
  793|  2.68k|                case Fragment::AND_B: return BuildScript(std::move(subs[0]), subs[1], OP_BOOLAND);
  794|  2.68k|                case Fragment::OR_B: return BuildScript(std::move(subs[0]), subs[1], OP_BOOLOR);
  795|  2.68k|                case Fragment::OR_D: return BuildScript(std::move(subs[0]), OP_IFDUP, OP_NOTIF, subs[1], OP_ENDIF);
  796|  2.68k|                case Fragment::OR_C: return BuildScript(std::move(subs[0]), OP_NOTIF, subs[1], OP_ENDIF);
  797|  2.68k|                case Fragment::OR_I: return BuildScript(OP_IF, subs[0], OP_ELSE, subs[1], OP_ENDIF);
  798|  2.68k|                case Fragment::ANDOR: return BuildScript(std::move(subs[0]), OP_NOTIF, subs[2], OP_ELSE, subs[1], OP_ENDIF);
  799|  2.68k|                case Fragment::MULTI: {
  800|  2.68k|                    CHECK_NONFATAL(!is_tapscript);
  801|  2.68k|                    CScript script = BuildScript(node.k);
  802|  2.68k|                    for (const auto& key : node.keys) {
  803|  2.68k|                        script = BuildScript(std::move(script), ctx.ToPKBytes(key));
  804|  2.68k|                    }
  805|  2.68k|                    return BuildScript(std::move(script), node.keys.size(), verify ? OP_CHECKMULTISIGVERIFY : OP_CHECKMULTISIG);
  806|  2.68k|                }
  807|  2.68k|                case Fragment::MULTI_A: {
  808|  2.68k|                    CHECK_NONFATAL(is_tapscript);
  809|  2.68k|                    CScript script = BuildScript(ctx.ToPKBytes(*node.keys.begin()), OP_CHECKSIG);
  810|  2.68k|                    for (auto it = node.keys.begin() + 1; it != node.keys.end(); ++it) {
  811|  2.68k|                        script = BuildScript(std::move(script), ctx.ToPKBytes(*it), OP_CHECKSIGADD);
  812|  2.68k|                    }
  813|  2.68k|                    return BuildScript(std::move(script), node.k, verify ? OP_NUMEQUALVERIFY : OP_NUMEQUAL);
  814|  2.68k|                }
  815|  2.68k|                case Fragment::THRESH: {
  816|  2.68k|                    CScript script = std::move(subs[0]);
  817|  2.68k|                    for (size_t i = 1; i < subs.size(); ++i) {
  818|  2.68k|                        script = BuildScript(std::move(script), subs[i], OP_ADD);
  819|  2.68k|                    }
  820|  2.68k|                    return BuildScript(std::move(script), node.k, verify ? OP_EQUALVERIFY : OP_EQUAL);
  821|  2.68k|                }
  822|  2.68k|            }
  823|  2.68k|            assert(false);
  824|  2.68k|        };
  825|  2.68k|        return TreeEval<CScript>(false, downfn, upfn);
  826|  2.68k|    }
descriptor.cpp:_ZNK10miniscript4NodeIjE8TreeEvalI7CScriptbRZNKS1_8ToScriptIN12_GLOBAL__N_111ScriptMakerEEES3_RKT_EUlbRKS1_mE_ZNKS4_IS6_EES3_S9_EUlbSB_4SpanIS3_EE_EES7_T0_OT1_T2_:
  683|  2.68k|    {
  684|       |        // Invoke TreeEvalMaybe with upfn wrapped to return std::optional<Result>, and then
  685|       |        // unconditionally dereference the result (it cannot be std::nullopt).
  686|  2.68k|        return std::move(*TreeEvalMaybe<Result>(std::move(root_state),
  687|  2.68k|            std::forward<DownFn>(downfn),
  688|  2.68k|            [&upfn](State&& state, const Node& node, Span<Result> subs) {
  689|  2.68k|                Result res{upfn(std::move(state), node, subs)};
  690|  2.68k|                return std::optional<Result>(std::move(res));
  691|  2.68k|            }
  692|  2.68k|        ));
  693|  2.68k|    }
descriptor.cpp:_ZNK10miniscript4NodeIjE13TreeEvalMaybeI7CScriptbZNKS1_8ToScriptIN12_GLOBAL__N_111ScriptMakerEEES3_RKT_EUlbRKS1_mE_ZNKS1_8TreeEvalIS3_bRSC_ZNKS4_IS6_EES3_S9_EUlbSB_4SpanIS3_EE_EES7_T0_OT1_T2_EUlObSB_SG_E_EENSt3__18optionalIS7_EESI_SJ_SL_:
  605|  2.68k|    {
  606|       |        /** Entries of the explicit stack tracked in this algorithm. */
  607|  2.68k|        struct StackElem
  608|  2.68k|        {
  609|  2.68k|            const Node& node; //!< The node being evaluated.
  610|  2.68k|            size_t expanded; //!< How many children of this node have been expanded.
  611|  2.68k|            State state; //!< The state for that node.
  612|       |
  613|  2.68k|            StackElem(const Node& node_, size_t exp_, State&& state_) :
  614|  2.68k|                node(node_), expanded(exp_), state(std::move(state_)) {}
  615|  2.68k|        };
  616|       |        /* Stack of tree nodes being explored. */
  617|  2.68k|        std::vector<StackElem> stack;
  618|       |        /* Results of subtrees so far. Their order and mapping to tree nodes
  619|       |         * is implicitly defined by stack. */
  620|  2.68k|        std::vector<Result> results;
  621|  2.68k|        stack.emplace_back(*this, 0, std::move(root_state));
  622|       |
  623|       |        /* Here is a demonstration of the algorithm, for an example tree A(B,C(D,E),F).
  624|       |         * State variables are omitted for simplicity.
  625|       |         *
  626|       |         * First: stack=[(A,0)] results=[]
  627|       |         *        stack=[(A,1),(B,0)] results=[]
  628|       |         *        stack=[(A,1)] results=[B]
  629|       |         *        stack=[(A,2),(C,0)] results=[B]
  630|       |         *        stack=[(A,2),(C,1),(D,0)] results=[B]
  631|       |         *        stack=[(A,2),(C,1)] results=[B,D]
  632|       |         *        stack=[(A,2),(C,2),(E,0)] results=[B,D]
  633|       |         *        stack=[(A,2),(C,2)] results=[B,D,E]
  634|       |         *        stack=[(A,2)] results=[B,C]
  635|       |         *        stack=[(A,3),(F,0)] results=[B,C]
  636|       |         *        stack=[(A,3)] results=[B,C,F]
  637|       |         * Final: stack=[] results=[A]
  638|       |         */
  639|   108k|        while (stack.size()) {
  ------------------
  |  Branch (639:16): [True: 105k, False: 2.68k]
  ------------------
  640|   105k|            const Node& node = stack.back().node;
  641|   105k|            if (stack.back().expanded < node.subs.size()) {
  ------------------
  |  Branch (641:17): [True: 51.6k, False: 54.3k]
  ------------------
  642|       |                /* We encounter a tree node with at least one unexpanded child.
  643|       |                 * Expand it. By the time we hit this node again, the result of
  644|       |                 * that child (and all earlier children) will be at the end of `results`. */
  645|  51.6k|                size_t child_index = stack.back().expanded++;
  646|  51.6k|                State child_state = downfn(stack.back().state, node, child_index);
  647|  51.6k|                stack.emplace_back(*node.subs[child_index], 0, std::move(child_state));
  648|  51.6k|                continue;
  649|  51.6k|            }
  650|       |            // Invoke upfn with the last node.subs.size() elements of results as input.
  651|  54.3k|            assert(results.size() >= node.subs.size());
  652|  54.3k|            std::optional<Result> result{upfn(std::move(stack.back().state), node,
  653|  54.3k|                Span<Result>{results}.last(node.subs.size()))};
  654|       |            // If evaluation returns std::nullopt, abort immediately.
  655|  54.3k|            if (!result) return {};
  ------------------
  |  Branch (655:17): [True: 0, False: 54.3k]
  ------------------
  656|       |            // Replace the last node.subs.size() elements of results with the new result.
  657|  54.3k|            results.erase(results.end() - node.subs.size(), results.end());
  658|  54.3k|            results.push_back(std::move(*result));
  659|  54.3k|            stack.pop_back();
  660|  54.3k|        }
  661|       |        // The final remaining results element is the root result, return it.
  662|  2.68k|        assert(results.size() == 1);
  663|  2.68k|        return std::move(results[0]);
  664|  2.68k|    }
descriptor.cpp:_ZZNK10miniscript4NodeIjE13TreeEvalMaybeI7CScriptbZNKS1_8ToScriptIN12_GLOBAL__N_111ScriptMakerEEES3_RKT_EUlbRKS1_mE_ZNKS1_8TreeEvalIS3_bRSC_ZNKS4_IS6_EES3_S9_EUlbSB_4SpanIS3_EE_EES7_T0_OT1_T2_EUlObSB_SG_E_EENSt3__18optionalIS7_EESI_SJ_SL_EN9StackElemC2ESB_mSM_:
  614|  54.3k|                node(node_), expanded(exp_), state(std::move(state_)) {}
descriptor.cpp:_ZZNK10miniscript4NodeIjE8ToScriptIN12_GLOBAL__N_111ScriptMakerEEE7CScriptRKT_ENKUlbRKS1_mE_clEbSA_m:
  755|  51.6k|        auto downfn = [](bool verify, const Node& node, size_t index) {
  756|       |            // For WRAP_V, the subexpression is certainly followed by OP_VERIFY.
  757|  51.6k|            if (node.fragment == Fragment::WRAP_V) return true;
  ------------------
  |  Branch (757:17): [True: 2.93k, False: 48.6k]
  ------------------
  758|       |            // The subexpression of WRAP_S, and the last subexpression of AND_V
  759|       |            // inherit the followed-by-OP_VERIFY property from the parent.
  760|  48.6k|            if (node.fragment == Fragment::WRAP_S ||
  ------------------
  |  Branch (760:17): [True: 20, False: 48.6k]
  ------------------
  761|  48.6k|                (node.fragment == Fragment::AND_V && index == 1)) return verify;
  ------------------
  |  Branch (761:18): [True: 5.42k, False: 43.2k]
  |  Branch (761:54): [True: 2.71k, False: 2.71k]
  ------------------
  762|  45.9k|            return false;
  763|  48.6k|        };
descriptor.cpp:_ZZNK10miniscript4NodeIjE8TreeEvalI7CScriptbRZNKS1_8ToScriptIN12_GLOBAL__N_111ScriptMakerEEES3_RKT_EUlbRKS1_mE_ZNKS4_IS6_EES3_S9_EUlbSB_4SpanIS3_EE_EES7_T0_OT1_T2_ENKUlObSB_SF_E_clESL_SB_SF_:
  688|  54.3k|            [&upfn](State&& state, const Node& node, Span<Result> subs) {
  689|  54.3k|                Result res{upfn(std::move(state), node, subs)};
  690|  54.3k|                return std::optional<Result>(std::move(res));
  691|  54.3k|            }
descriptor.cpp:_ZZNK10miniscript4NodeIjE8ToScriptIN12_GLOBAL__N_111ScriptMakerEEE7CScriptRKT_ENKUlbRKS1_4SpanIS5_EE_clEbSA_SC_:
  767|  54.3k|        auto upfn = [&ctx, is_tapscript](bool verify, const Node& node, Span<CScript> subs) -> CScript {
  768|  54.3k|            switch (node.fragment) {
  ------------------
  |  Branch (768:21): [True: 0, False: 54.3k]
  ------------------
  769|    736|                case Fragment::PK_K: return BuildScript(ctx.ToPKBytes(node.keys[0]));
  ------------------
  |  Branch (769:17): [True: 736, False: 53.5k]
  ------------------
  770|    984|                case Fragment::PK_H: return BuildScript(OP_DUP, OP_HASH160, ctx.ToPKHBytes(node.keys[0]), OP_EQUALVERIFY);
  ------------------
  |  Branch (770:17): [True: 984, False: 53.3k]
  ------------------
  771|    182|                case Fragment::OLDER: return BuildScript(node.k, OP_CHECKSEQUENCEVERIFY);
  ------------------
  |  Branch (771:17): [True: 182, False: 54.1k]
  ------------------
  772|    102|                case Fragment::AFTER: return BuildScript(node.k, OP_CHECKLOCKTIMEVERIFY);
  ------------------
  |  Branch (772:17): [True: 102, False: 54.1k]
  ------------------
  773|      0|                case Fragment::SHA256: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_SHA256, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  ------------------
  |  Branch (773:17): [True: 0, False: 54.3k]
  |  Branch (773:110): [True: 0, False: 0]
  ------------------
  774|      0|                case Fragment::RIPEMD160: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_RIPEMD160, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  ------------------
  |  Branch (774:17): [True: 0, False: 54.3k]
  |  Branch (774:116): [True: 0, False: 0]
  ------------------
  775|     74|                case Fragment::HASH256: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_HASH256, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  ------------------
  |  Branch (775:17): [True: 74, False: 54.2k]
  |  Branch (775:112): [True: 50, False: 24]
  ------------------
  776|      0|                case Fragment::HASH160: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_HASH160, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  ------------------
  |  Branch (776:17): [True: 0, False: 54.3k]
  |  Branch (776:112): [True: 0, False: 0]
  ------------------
  777|     14|                case Fragment::WRAP_A: return BuildScript(OP_TOALTSTACK, subs[0], OP_FROMALTSTACK);
  ------------------
  |  Branch (777:17): [True: 14, False: 54.2k]
  ------------------
  778|     20|                case Fragment::WRAP_S: return BuildScript(OP_SWAP, subs[0]);
  ------------------
  |  Branch (778:17): [True: 20, False: 54.2k]
  ------------------
  779|  1.71k|                case Fragment::WRAP_C: return BuildScript(std::move(subs[0]), verify ? OP_CHECKSIGVERIFY : OP_CHECKSIG);
  ------------------
  |  Branch (779:17): [True: 1.71k, False: 52.5k]
  |  Branch (779:79): [True: 260, False: 1.45k]
  ------------------
  780|     58|                case Fragment::WRAP_D: return BuildScript(OP_DUP, OP_IF, subs[0], OP_ENDIF);
  ------------------
  |  Branch (780:17): [True: 58, False: 54.2k]
  ------------------
  781|  2.93k|                case Fragment::WRAP_V: {
  ------------------
  |  Branch (781:17): [True: 2.93k, False: 51.3k]
  ------------------
  782|  2.93k|                    if (node.subs[0]->GetType() << "x"_mst) {
  ------------------
  |  Branch (782:25): [True: 2.55k, False: 384]
  ------------------
  783|  2.55k|                        return BuildScript(std::move(subs[0]), OP_VERIFY);
  784|  2.55k|                    } else {
  785|    384|                        return std::move(subs[0]);
  786|    384|                    }
  787|  2.93k|                }
  788|  1.46k|                case Fragment::WRAP_J: return BuildScript(OP_SIZE, OP_0NOTEQUAL, OP_IF, subs[0], OP_ENDIF);
  ------------------
  |  Branch (788:17): [True: 1.46k, False: 52.8k]
  ------------------
  789|  4.63k|                case Fragment::WRAP_N: return BuildScript(std::move(subs[0]), OP_0NOTEQUAL);
  ------------------
  |  Branch (789:17): [True: 4.63k, False: 49.6k]
  ------------------
  790|  2.41k|                case Fragment::JUST_1: return BuildScript(OP_1);
  ------------------
  |  Branch (790:17): [True: 2.41k, False: 51.8k]
  ------------------
  791|  17.5k|                case Fragment::JUST_0: return BuildScript(OP_0);
  ------------------
  |  Branch (791:17): [True: 17.5k, False: 36.7k]
  ------------------
  792|  2.71k|                case Fragment::AND_V: return BuildScript(std::move(subs[0]), subs[1]);
  ------------------
  |  Branch (792:17): [True: 2.71k, False: 51.5k]
  ------------------
  793|      0|                case Fragment::AND_B: return BuildScript(std::move(subs[0]), subs[1], OP_BOOLAND);
  ------------------
  |  Branch (793:17): [True: 0, False: 54.3k]
  ------------------
  794|      0|                case Fragment::OR_B: return BuildScript(std::move(subs[0]), subs[1], OP_BOOLOR);
  ------------------
  |  Branch (794:17): [True: 0, False: 54.3k]
  ------------------
  795|      0|                case Fragment::OR_D: return BuildScript(std::move(subs[0]), OP_IFDUP, OP_NOTIF, subs[1], OP_ENDIF);
  ------------------
  |  Branch (795:17): [True: 0, False: 54.3k]
  ------------------
  796|    142|                case Fragment::OR_C: return BuildScript(std::move(subs[0]), OP_NOTIF, subs[1], OP_ENDIF);
  ------------------
  |  Branch (796:17): [True: 142, False: 54.1k]
  ------------------
  797|  17.2k|                case Fragment::OR_I: return BuildScript(OP_IF, subs[0], OP_ELSE, subs[1], OP_ENDIF);
  ------------------
  |  Branch (797:17): [True: 17.2k, False: 37.0k]
  ------------------
  798|    188|                case Fragment::ANDOR: return BuildScript(std::move(subs[0]), OP_NOTIF, subs[2], OP_ELSE, subs[1], OP_ENDIF);
  ------------------
  |  Branch (798:17): [True: 188, False: 54.1k]
  ------------------
  799|    794|                case Fragment::MULTI: {
  ------------------
  |  Branch (799:17): [True: 794, False: 53.5k]
  ------------------
  800|    794|                    CHECK_NONFATAL(!is_tapscript);
  ------------------
  |  |   82|    794|    inline_check_non_fatal(condition, __FILE__, __LINE__, __func__, #condition)
  ------------------
  801|    794|                    CScript script = BuildScript(node.k);
  802|  2.50k|                    for (const auto& key : node.keys) {
  ------------------
  |  Branch (802:42): [True: 2.50k, False: 794]
  ------------------
  803|  2.50k|                        script = BuildScript(std::move(script), ctx.ToPKBytes(key));
  804|  2.50k|                    }
  805|    794|                    return BuildScript(std::move(script), node.keys.size(), verify ? OP_CHECKMULTISIGVERIFY : OP_CHECKMULTISIG);
  ------------------
  |  Branch (805:77): [True: 40, False: 754]
  ------------------
  806|  2.93k|                }
  807|    342|                case Fragment::MULTI_A: {
  ------------------
  |  Branch (807:17): [True: 342, False: 53.9k]
  ------------------
  808|    342|                    CHECK_NONFATAL(is_tapscript);
  ------------------
  |  |   82|    342|    inline_check_non_fatal(condition, __FILE__, __LINE__, __func__, #condition)
  ------------------
  809|    342|                    CScript script = BuildScript(ctx.ToPKBytes(*node.keys.begin()), OP_CHECKSIG);
  810|  1.24k|                    for (auto it = node.keys.begin() + 1; it != node.keys.end(); ++it) {
  ------------------
  |  Branch (810:59): [True: 906, False: 342]
  ------------------
  811|    906|                        script = BuildScript(std::move(script), ctx.ToPKBytes(*it), OP_CHECKSIGADD);
  812|    906|                    }
  813|    342|                    return BuildScript(std::move(script), node.k, verify ? OP_NUMEQUALVERIFY : OP_NUMEQUAL);
  ------------------
  |  Branch (813:67): [True: 34, False: 308]
  ------------------
  814|  2.93k|                }
  815|     46|                case Fragment::THRESH: {
  ------------------
  |  Branch (815:17): [True: 46, False: 54.2k]
  ------------------
  816|     46|                    CScript script = std::move(subs[0]);
  817|     80|                    for (size_t i = 1; i < subs.size(); ++i) {
  ------------------
  |  Branch (817:40): [True: 34, False: 46]
  ------------------
  818|     34|                        script = BuildScript(std::move(script), subs[i], OP_ADD);
  819|     34|                    }
  820|     46|                    return BuildScript(std::move(script), node.k, verify ? OP_EQUALVERIFY : OP_EQUAL);
  ------------------
  |  Branch (820:67): [True: 0, False: 46]
  ------------------
  821|  2.93k|                }
  822|  54.3k|            }
  823|      0|            assert(false);
  824|      0|        };
descriptor.cpp:_ZNK10miniscript4NodeIjE8ToStringIN12_GLOBAL__N_111StringMakerEEENSt3__18optionalINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEERKT_:
  829|  3.28k|    std::optional<std::string> ToString(const CTx& ctx) const {
  830|       |        // To construct the std::string representation for a Miniscript object, we use
  831|       |        // the TreeEvalMaybe algorithm. The State is a boolean: whether the parent node is a
  832|       |        // wrapper. If so, non-wrapper expressions must be prefixed with a ":".
  833|  3.28k|        auto downfn = [](bool, const Node& node, size_t) {
  834|  3.28k|            return (node.fragment == Fragment::WRAP_A || node.fragment == Fragment::WRAP_S ||
  835|  3.28k|                    node.fragment == Fragment::WRAP_D || node.fragment == Fragment::WRAP_V ||
  836|  3.28k|                    node.fragment == Fragment::WRAP_J || node.fragment == Fragment::WRAP_N ||
  837|  3.28k|                    node.fragment == Fragment::WRAP_C ||
  838|  3.28k|                    (node.fragment == Fragment::AND_V && node.subs[1]->fragment == Fragment::JUST_1) ||
  839|  3.28k|                    (node.fragment == Fragment::OR_I && node.subs[0]->fragment == Fragment::JUST_0) ||
  840|  3.28k|                    (node.fragment == Fragment::OR_I && node.subs[1]->fragment == Fragment::JUST_0));
  841|  3.28k|        };
  842|       |        // The upward function computes for a node, given whether its parent is a wrapper,
  843|       |        // and the string representations of its child nodes, the string representation of the node.
  844|  3.28k|        const bool is_tapscript{IsTapscript(m_script_ctx)};
  845|  3.28k|        auto upfn = [&ctx, is_tapscript](bool wrapped, const Node& node, Span<std::string> subs) -> std::optional<std::string> {
  846|  3.28k|            std::string ret = wrapped ? ":" : "";
  847|       |
  848|  3.28k|            switch (node.fragment) {
  849|  3.28k|                case Fragment::WRAP_A: return "a" + std::move(subs[0]);
  850|  3.28k|                case Fragment::WRAP_S: return "s" + std::move(subs[0]);
  851|  3.28k|                case Fragment::WRAP_C:
  852|  3.28k|                    if (node.subs[0]->fragment == Fragment::PK_K) {
  853|       |                        // pk(K) is syntactic sugar for c:pk_k(K)
  854|  3.28k|                        auto key_str = ctx.ToString(node.subs[0]->keys[0]);
  855|  3.28k|                        if (!key_str) return {};
  856|  3.28k|                        return std::move(ret) + "pk(" + std::move(*key_str) + ")";
  857|  3.28k|                    }
  858|  3.28k|                    if (node.subs[0]->fragment == Fragment::PK_H) {
  859|       |                        // pkh(K) is syntactic sugar for c:pk_h(K)
  860|  3.28k|                        auto key_str = ctx.ToString(node.subs[0]->keys[0]);
  861|  3.28k|                        if (!key_str) return {};
  862|  3.28k|                        return std::move(ret) + "pkh(" + std::move(*key_str) + ")";
  863|  3.28k|                    }
  864|  3.28k|                    return "c" + std::move(subs[0]);
  865|  3.28k|                case Fragment::WRAP_D: return "d" + std::move(subs[0]);
  866|  3.28k|                case Fragment::WRAP_V: return "v" + std::move(subs[0]);
  867|  3.28k|                case Fragment::WRAP_J: return "j" + std::move(subs[0]);
  868|  3.28k|                case Fragment::WRAP_N: return "n" + std::move(subs[0]);
  869|  3.28k|                case Fragment::AND_V:
  870|       |                    // t:X is syntactic sugar for and_v(X,1).
  871|  3.28k|                    if (node.subs[1]->fragment == Fragment::JUST_1) return "t" + std::move(subs[0]);
  872|  3.28k|                    break;
  873|  3.28k|                case Fragment::OR_I:
  874|  3.28k|                    if (node.subs[0]->fragment == Fragment::JUST_0) return "l" + std::move(subs[1]);
  875|  3.28k|                    if (node.subs[1]->fragment == Fragment::JUST_0) return "u" + std::move(subs[0]);
  876|  3.28k|                    break;
  877|  3.28k|                default: break;
  878|  3.28k|            }
  879|  3.28k|            switch (node.fragment) {
  880|  3.28k|                case Fragment::PK_K: {
  881|  3.28k|                    auto key_str = ctx.ToString(node.keys[0]);
  882|  3.28k|                    if (!key_str) return {};
  883|  3.28k|                    return std::move(ret) + "pk_k(" + std::move(*key_str) + ")";
  884|  3.28k|                }
  885|  3.28k|                case Fragment::PK_H: {
  886|  3.28k|                    auto key_str = ctx.ToString(node.keys[0]);
  887|  3.28k|                    if (!key_str) return {};
  888|  3.28k|                    return std::move(ret) + "pk_h(" + std::move(*key_str) + ")";
  889|  3.28k|                }
  890|  3.28k|                case Fragment::AFTER: return std::move(ret) + "after(" + util::ToString(node.k) + ")";
  891|  3.28k|                case Fragment::OLDER: return std::move(ret) + "older(" + util::ToString(node.k) + ")";
  892|  3.28k|                case Fragment::HASH256: return std::move(ret) + "hash256(" + HexStr(node.data) + ")";
  893|  3.28k|                case Fragment::HASH160: return std::move(ret) + "hash160(" + HexStr(node.data) + ")";
  894|  3.28k|                case Fragment::SHA256: return std::move(ret) + "sha256(" + HexStr(node.data) + ")";
  895|  3.28k|                case Fragment::RIPEMD160: return std::move(ret) + "ripemd160(" + HexStr(node.data) + ")";
  896|  3.28k|                case Fragment::JUST_1: return std::move(ret) + "1";
  897|  3.28k|                case Fragment::JUST_0: return std::move(ret) + "0";
  898|  3.28k|                case Fragment::AND_V: return std::move(ret) + "and_v(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  899|  3.28k|                case Fragment::AND_B: return std::move(ret) + "and_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  900|  3.28k|                case Fragment::OR_B: return std::move(ret) + "or_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  901|  3.28k|                case Fragment::OR_D: return std::move(ret) + "or_d(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  902|  3.28k|                case Fragment::OR_C: return std::move(ret) + "or_c(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  903|  3.28k|                case Fragment::OR_I: return std::move(ret) + "or_i(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  904|  3.28k|                case Fragment::ANDOR:
  905|       |                    // and_n(X,Y) is syntactic sugar for andor(X,Y,0).
  906|  3.28k|                    if (node.subs[2]->fragment == Fragment::JUST_0) return std::move(ret) + "and_n(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  907|  3.28k|                    return std::move(ret) + "andor(" + std::move(subs[0]) + "," + std::move(subs[1]) + "," + std::move(subs[2]) + ")";
  908|  3.28k|                case Fragment::MULTI: {
  909|  3.28k|                    CHECK_NONFATAL(!is_tapscript);
  910|  3.28k|                    auto str = std::move(ret) + "multi(" + util::ToString(node.k);
  911|  3.28k|                    for (const auto& key : node.keys) {
  912|  3.28k|                        auto key_str = ctx.ToString(key);
  913|  3.28k|                        if (!key_str) return {};
  914|  3.28k|                        str += "," + std::move(*key_str);
  915|  3.28k|                    }
  916|  3.28k|                    return std::move(str) + ")";
  917|  3.28k|                }
  918|  3.28k|                case Fragment::MULTI_A: {
  919|  3.28k|                    CHECK_NONFATAL(is_tapscript);
  920|  3.28k|                    auto str = std::move(ret) + "multi_a(" + util::ToString(node.k);
  921|  3.28k|                    for (const auto& key : node.keys) {
  922|  3.28k|                        auto key_str = ctx.ToString(key);
  923|  3.28k|                        if (!key_str) return {};
  924|  3.28k|                        str += "," + std::move(*key_str);
  925|  3.28k|                    }
  926|  3.28k|                    return std::move(str) + ")";
  927|  3.28k|                }
  928|  3.28k|                case Fragment::THRESH: {
  929|  3.28k|                    auto str = std::move(ret) + "thresh(" + util::ToString(node.k);
  930|  3.28k|                    for (auto& sub : subs) {
  931|  3.28k|                        str += "," + std::move(sub);
  932|  3.28k|                    }
  933|  3.28k|                    return std::move(str) + ")";
  934|  3.28k|                }
  935|  3.28k|                default: break;
  936|  3.28k|            }
  937|  3.28k|            assert(false);
  938|  3.28k|        };
  939|       |
  940|  3.28k|        return TreeEvalMaybe<std::string>(false, downfn, upfn);
  941|  3.28k|    }
descriptor.cpp:_ZNK10miniscript4NodeIjE13TreeEvalMaybeINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEbZNKS1_8ToStringIN12_GLOBAL__N_111StringMakerEEENS3_8optionalIS9_EERKT_EUlbRKS1_mE_ZNKSA_ISC_EESE_SH_EUlbSJ_4SpanIS9_EE_EENSD_ISF_EET0_T1_T2_:
  605|  3.28k|    {
  606|       |        /** Entries of the explicit stack tracked in this algorithm. */
  607|  3.28k|        struct StackElem
  608|  3.28k|        {
  609|  3.28k|            const Node& node; //!< The node being evaluated.
  610|  3.28k|            size_t expanded; //!< How many children of this node have been expanded.
  611|  3.28k|            State state; //!< The state for that node.
  612|       |
  613|  3.28k|            StackElem(const Node& node_, size_t exp_, State&& state_) :
  614|  3.28k|                node(node_), expanded(exp_), state(std::move(state_)) {}
  615|  3.28k|        };
  616|       |        /* Stack of tree nodes being explored. */
  617|  3.28k|        std::vector<StackElem> stack;
  618|       |        /* Results of subtrees so far. Their order and mapping to tree nodes
  619|       |         * is implicitly defined by stack. */
  620|  3.28k|        std::vector<Result> results;
  621|  3.28k|        stack.emplace_back(*this, 0, std::move(root_state));
  622|       |
  623|       |        /* Here is a demonstration of the algorithm, for an example tree A(B,C(D,E),F).
  624|       |         * State variables are omitted for simplicity.
  625|       |         *
  626|       |         * First: stack=[(A,0)] results=[]
  627|       |         *        stack=[(A,1),(B,0)] results=[]
  628|       |         *        stack=[(A,1)] results=[B]
  629|       |         *        stack=[(A,2),(C,0)] results=[B]
  630|       |         *        stack=[(A,2),(C,1),(D,0)] results=[B]
  631|       |         *        stack=[(A,2),(C,1)] results=[B,D]
  632|       |         *        stack=[(A,2),(C,2),(E,0)] results=[B,D]
  633|       |         *        stack=[(A,2),(C,2)] results=[B,D,E]
  634|       |         *        stack=[(A,2)] results=[B,C]
  635|       |         *        stack=[(A,3),(F,0)] results=[B,C]
  636|       |         *        stack=[(A,3)] results=[B,C,F]
  637|       |         * Final: stack=[] results=[A]
  638|       |         */
  639|   123k|        while (stack.size()) {
  ------------------
  |  Branch (639:16): [True: 121k, False: 2.79k]
  ------------------
  640|   121k|            const Node& node = stack.back().node;
  641|   121k|            if (stack.back().expanded < node.subs.size()) {
  ------------------
  |  Branch (641:17): [True: 61.6k, False: 59.3k]
  ------------------
  642|       |                /* We encounter a tree node with at least one unexpanded child.
  643|       |                 * Expand it. By the time we hit this node again, the result of
  644|       |                 * that child (and all earlier children) will be at the end of `results`. */
  645|  61.6k|                size_t child_index = stack.back().expanded++;
  646|  61.6k|                State child_state = downfn(stack.back().state, node, child_index);
  647|  61.6k|                stack.emplace_back(*node.subs[child_index], 0, std::move(child_state));
  648|  61.6k|                continue;
  649|  61.6k|            }
  650|       |            // Invoke upfn with the last node.subs.size() elements of results as input.
  651|  59.3k|            assert(results.size() >= node.subs.size());
  652|  59.3k|            std::optional<Result> result{upfn(std::move(stack.back().state), node,
  653|  59.3k|                Span<Result>{results}.last(node.subs.size()))};
  654|       |            // If evaluation returns std::nullopt, abort immediately.
  655|  59.3k|            if (!result) return {};
  ------------------
  |  Branch (655:17): [True: 487, False: 58.8k]
  ------------------
  656|       |            // Replace the last node.subs.size() elements of results with the new result.
  657|  58.8k|            results.erase(results.end() - node.subs.size(), results.end());
  658|  58.8k|            results.push_back(std::move(*result));
  659|  58.8k|            stack.pop_back();
  660|  58.8k|        }
  661|       |        // The final remaining results element is the root result, return it.
  662|  2.79k|        assert(results.size() == 1);
  663|  2.79k|        return std::move(results[0]);
  664|  2.79k|    }
descriptor.cpp:_ZZNK10miniscript4NodeIjE13TreeEvalMaybeINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEbZNKS1_8ToStringIN12_GLOBAL__N_111StringMakerEEENS3_8optionalIS9_EERKT_EUlbRKS1_mE_ZNKSA_ISC_EESE_SH_EUlbSJ_4SpanIS9_EE_EENSD_ISF_EET0_T1_T2_EN9StackElemC2ESJ_mOb:
  614|  64.9k|                node(node_), expanded(exp_), state(std::move(state_)) {}
descriptor.cpp:_ZZNK10miniscript4NodeIjE8ToStringIN12_GLOBAL__N_111StringMakerEEENSt3__18optionalINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEERKT_ENKUlbRKS1_mE_clEbSI_m:
  833|  61.6k|        auto downfn = [](bool, const Node& node, size_t) {
  834|  61.6k|            return (node.fragment == Fragment::WRAP_A || node.fragment == Fragment::WRAP_S ||
  ------------------
  |  Branch (834:21): [True: 17, False: 61.6k]
  |  Branch (834:58): [True: 29, False: 61.6k]
  ------------------
  835|  61.6k|                    node.fragment == Fragment::WRAP_D || node.fragment == Fragment::WRAP_V ||
  ------------------
  |  Branch (835:21): [True: 69, False: 61.5k]
  |  Branch (835:58): [True: 3.79k, False: 57.7k]
  ------------------
  836|  61.6k|                    node.fragment == Fragment::WRAP_J || node.fragment == Fragment::WRAP_N ||
  ------------------
  |  Branch (836:21): [True: 1.99k, False: 55.7k]
  |  Branch (836:58): [True: 5.56k, False: 50.2k]
  ------------------
  837|  61.6k|                    node.fragment == Fragment::WRAP_C ||
  ------------------
  |  Branch (837:21): [True: 1.91k, False: 48.2k]
  ------------------
  838|  61.6k|                    (node.fragment == Fragment::AND_V && node.subs[1]->fragment == Fragment::JUST_1) ||
  ------------------
  |  Branch (838:22): [True: 6.64k, False: 41.6k]
  |  Branch (838:58): [True: 5.85k, False: 786]
  ------------------
  839|  61.6k|                    (node.fragment == Fragment::OR_I && node.subs[0]->fragment == Fragment::JUST_0) ||
  ------------------
  |  Branch (839:22): [True: 40.4k, False: 1.96k]
  |  Branch (839:57): [True: 23.9k, False: 16.5k]
  ------------------
  840|  61.6k|                    (node.fragment == Fragment::OR_I && node.subs[1]->fragment == Fragment::JUST_0));
  ------------------
  |  Branch (840:22): [True: 16.5k, False: 1.96k]
  |  Branch (840:57): [True: 16.5k, False: 10]
  ------------------
  841|  61.6k|        };
descriptor.cpp:_ZZNK10miniscript4NodeIjE8ToStringIN12_GLOBAL__N_111StringMakerEEENSt3__18optionalINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEERKT_ENKUlbRKS1_4SpanISC_EE_clEbSI_SK_:
  845|  59.3k|        auto upfn = [&ctx, is_tapscript](bool wrapped, const Node& node, Span<std::string> subs) -> std::optional<std::string> {
  846|  59.3k|            std::string ret = wrapped ? ":" : "";
  ------------------
  |  Branch (846:31): [True: 54.8k, False: 4.53k]
  ------------------
  847|       |
  848|  59.3k|            switch (node.fragment) {
  849|     17|                case Fragment::WRAP_A: return "a" + std::move(subs[0]);
  ------------------
  |  Branch (849:17): [True: 17, False: 59.3k]
  ------------------
  850|     29|                case Fragment::WRAP_S: return "s" + std::move(subs[0]);
  ------------------
  |  Branch (850:17): [True: 29, False: 59.3k]
  ------------------
  851|  1.72k|                case Fragment::WRAP_C:
  ------------------
  |  Branch (851:17): [True: 1.72k, False: 57.6k]
  ------------------
  852|  1.72k|                    if (node.subs[0]->fragment == Fragment::PK_K) {
  ------------------
  |  Branch (852:25): [True: 741, False: 988]
  ------------------
  853|       |                        // pk(K) is syntactic sugar for c:pk_k(K)
  854|    741|                        auto key_str = ctx.ToString(node.subs[0]->keys[0]);
  855|    741|                        if (!key_str) return {};
  ------------------
  |  Branch (855:29): [True: 0, False: 741]
  ------------------
  856|    741|                        return std::move(ret) + "pk(" + std::move(*key_str) + ")";
  857|    741|                    }
  858|    988|                    if (node.subs[0]->fragment == Fragment::PK_H) {
  ------------------
  |  Branch (858:25): [True: 984, False: 4]
  ------------------
  859|       |                        // pkh(K) is syntactic sugar for c:pk_h(K)
  860|    984|                        auto key_str = ctx.ToString(node.subs[0]->keys[0]);
  861|    984|                        if (!key_str) return {};
  ------------------
  |  Branch (861:29): [True: 0, False: 984]
  ------------------
  862|    984|                        return std::move(ret) + "pkh(" + std::move(*key_str) + ")";
  863|    984|                    }
  864|      4|                    return "c" + std::move(subs[0]);
  865|     69|                case Fragment::WRAP_D: return "d" + std::move(subs[0]);
  ------------------
  |  Branch (865:17): [True: 69, False: 59.3k]
  ------------------
  866|  3.31k|                case Fragment::WRAP_V: return "v" + std::move(subs[0]);
  ------------------
  |  Branch (866:17): [True: 3.31k, False: 56.0k]
  ------------------
  867|  1.55k|                case Fragment::WRAP_J: return "j" + std::move(subs[0]);
  ------------------
  |  Branch (867:17): [True: 1.55k, False: 57.8k]
  ------------------
  868|  4.89k|                case Fragment::WRAP_N: return "n" + std::move(subs[0]);
  ------------------
  |  Branch (868:17): [True: 4.89k, False: 54.4k]
  ------------------
  869|  3.02k|                case Fragment::AND_V:
  ------------------
  |  Branch (869:17): [True: 3.02k, False: 56.3k]
  ------------------
  870|       |                    // t:X is syntactic sugar for and_v(X,1).
  871|  3.02k|                    if (node.subs[1]->fragment == Fragment::JUST_1) return "t" + std::move(subs[0]);
  ------------------
  |  Branch (871:25): [True: 2.69k, False: 338]
  ------------------
  872|    338|                    break;
  873|  17.5k|                case Fragment::OR_I:
  ------------------
  |  Branch (873:17): [True: 17.5k, False: 41.8k]
  ------------------
  874|  17.5k|                    if (node.subs[0]->fragment == Fragment::JUST_0) return "l" + std::move(subs[1]);
  ------------------
  |  Branch (874:25): [True: 9.59k, False: 7.90k]
  ------------------
  875|  7.90k|                    if (node.subs[1]->fragment == Fragment::JUST_0) return "u" + std::move(subs[0]);
  ------------------
  |  Branch (875:25): [True: 7.90k, False: 4]
  ------------------
  876|      4|                    break;
  877|  27.2k|                default: break;
  ------------------
  |  Branch (877:17): [True: 27.2k, False: 32.1k]
  ------------------
  878|  59.3k|            }
  879|  27.5k|            switch (node.fragment) {
  880|    903|                case Fragment::PK_K: {
  ------------------
  |  Branch (880:17): [True: 903, False: 26.6k]
  ------------------
  881|    903|                    auto key_str = ctx.ToString(node.keys[0]);
  882|    903|                    if (!key_str) return {};
  ------------------
  |  Branch (882:25): [True: 156, False: 747]
  ------------------
  883|    747|                    return std::move(ret) + "pk_k(" + std::move(*key_str) + ")";
  884|    903|                }
  885|  1.01k|                case Fragment::PK_H: {
  ------------------
  |  Branch (885:17): [True: 1.01k, False: 26.5k]
  ------------------
  886|  1.01k|                    auto key_str = ctx.ToString(node.keys[0]);
  887|  1.01k|                    if (!key_str) return {};
  ------------------
  |  Branch (887:25): [True: 30, False: 986]
  ------------------
  888|    986|                    return std::move(ret) + "pk_h(" + std::move(*key_str) + ")";
  889|  1.01k|                }
  890|    109|                case Fragment::AFTER: return std::move(ret) + "after(" + util::ToString(node.k) + ")";
  ------------------
  |  Branch (890:17): [True: 109, False: 27.4k]
  ------------------
  891|    219|                case Fragment::OLDER: return std::move(ret) + "older(" + util::ToString(node.k) + ")";
  ------------------
  |  Branch (891:17): [True: 219, False: 27.3k]
  ------------------
  892|     74|                case Fragment::HASH256: return std::move(ret) + "hash256(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (892:17): [True: 74, False: 27.5k]
  ------------------
  893|      0|                case Fragment::HASH160: return std::move(ret) + "hash160(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (893:17): [True: 0, False: 27.5k]
  ------------------
  894|      0|                case Fragment::SHA256: return std::move(ret) + "sha256(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (894:17): [True: 0, False: 27.5k]
  ------------------
  895|      0|                case Fragment::RIPEMD160: return std::move(ret) + "ripemd160(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (895:17): [True: 0, False: 27.5k]
  ------------------
  896|  2.74k|                case Fragment::JUST_1: return std::move(ret) + "1";
  ------------------
  |  Branch (896:17): [True: 2.74k, False: 24.8k]
  ------------------
  897|  20.2k|                case Fragment::JUST_0: return std::move(ret) + "0";
  ------------------
  |  Branch (897:17): [True: 20.2k, False: 7.32k]
  ------------------
  898|    338|                case Fragment::AND_V: return std::move(ret) + "and_v(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (898:17): [True: 338, False: 27.2k]
  ------------------
  899|      0|                case Fragment::AND_B: return std::move(ret) + "and_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (899:17): [True: 0, False: 27.5k]
  ------------------
  900|      0|                case Fragment::OR_B: return std::move(ret) + "or_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (900:17): [True: 0, False: 27.5k]
  ------------------
  901|      0|                case Fragment::OR_D: return std::move(ret) + "or_d(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (901:17): [True: 0, False: 27.5k]
  ------------------
  902|    142|                case Fragment::OR_C: return std::move(ret) + "or_c(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (902:17): [True: 142, False: 27.4k]
  ------------------
  903|      4|                case Fragment::OR_I: return std::move(ret) + "or_i(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (903:17): [True: 4, False: 27.5k]
  ------------------
  904|    188|                case Fragment::ANDOR:
  ------------------
  |  Branch (904:17): [True: 188, False: 27.3k]
  ------------------
  905|       |                    // and_n(X,Y) is syntactic sugar for andor(X,Y,0).
  906|    188|                    if (node.subs[2]->fragment == Fragment::JUST_0) return std::move(ret) + "and_n(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (906:25): [True: 6, False: 182]
  ------------------
  907|    182|                    return std::move(ret) + "andor(" + std::move(subs[0]) + "," + std::move(subs[1]) + "," + std::move(subs[2]) + ")";
  908|  1.19k|                case Fragment::MULTI: {
  ------------------
  |  Branch (908:17): [True: 1.19k, False: 26.3k]
  ------------------
  909|  1.19k|                    CHECK_NONFATAL(!is_tapscript);
  ------------------
  |  |   82|  1.19k|    inline_check_non_fatal(condition, __FILE__, __LINE__, __func__, #condition)
  ------------------
  910|  1.19k|                    auto str = std::move(ret) + "multi(" + util::ToString(node.k);
  911|  3.35k|                    for (const auto& key : node.keys) {
  ------------------
  |  Branch (911:42): [True: 3.35k, False: 889]
  ------------------
  912|  3.35k|                        auto key_str = ctx.ToString(key);
  913|  3.35k|                        if (!key_str) return {};
  ------------------
  |  Branch (913:29): [True: 301, False: 3.05k]
  ------------------
  914|  3.05k|                        str += "," + std::move(*key_str);
  915|  3.05k|                    }
  916|    889|                    return std::move(str) + ")";
  917|  1.19k|                }
  918|    342|                case Fragment::MULTI_A: {
  ------------------
  |  Branch (918:17): [True: 342, False: 27.2k]
  ------------------
  919|    342|                    CHECK_NONFATAL(is_tapscript);
  ------------------
  |  |   82|    342|    inline_check_non_fatal(condition, __FILE__, __LINE__, __func__, #condition)
  ------------------
  920|    342|                    auto str = std::move(ret) + "multi_a(" + util::ToString(node.k);
  921|  1.24k|                    for (const auto& key : node.keys) {
  ------------------
  |  Branch (921:42): [True: 1.24k, False: 342]
  ------------------
  922|  1.24k|                        auto key_str = ctx.ToString(key);
  923|  1.24k|                        if (!key_str) return {};
  ------------------
  |  Branch (923:29): [True: 0, False: 1.24k]
  ------------------
  924|  1.24k|                        str += "," + std::move(*key_str);
  925|  1.24k|                    }
  926|    342|                    return std::move(str) + ")";
  927|    342|                }
  928|     60|                case Fragment::THRESH: {
  ------------------
  |  Branch (928:17): [True: 60, False: 27.5k]
  ------------------
  929|     60|                    auto str = std::move(ret) + "thresh(" + util::ToString(node.k);
  930|    106|                    for (auto& sub : subs) {
  ------------------
  |  Branch (930:36): [True: 106, False: 60]
  ------------------
  931|    106|                        str += "," + std::move(sub);
  932|    106|                    }
  933|     60|                    return std::move(str) + ")";
  934|    342|                }
  935|      0|                default: break;
  ------------------
  |  Branch (935:17): [True: 0, False: 27.5k]
  ------------------
  936|  27.5k|            }
  937|      0|            assert(false);
  938|      0|        };
_ZNK10miniscript4NodeIjE14GetWitnessSizeEv:
 1551|  1.19k|    std::optional<uint32_t> GetWitnessSize() const {
 1552|  1.19k|        if (!ws.sat.valid) return {};
  ------------------
  |  Branch (1552:13): [True: 0, False: 1.19k]
  ------------------
 1553|  1.19k|        return ws.sat.value;
 1554|  1.19k|    }
_ZNK10miniscript4NodeIjE5CloneEv:
  532|  2.57k|    {
  533|       |        // Use TreeEval() to avoid a stack-overflow due to recursion
  534|  2.57k|        auto upfn = [](const Node& node, Span<NodeRef<Key>> children) {
  535|  2.57k|            std::vector<NodeRef<Key>> new_subs;
  536|  2.57k|            for (auto child = children.begin(); child != children.end(); ++child) {
  537|  2.57k|                new_subs.emplace_back(std::move(*child));
  538|  2.57k|            }
  539|       |            // std::make_unique (and therefore MakeNodeRef) doesn't work on private constructors
  540|  2.57k|            return std::unique_ptr<Node>{new Node{internal::NoDupCheck{}, node.m_script_ctx, node.fragment, std::move(new_subs), node.keys, node.data, node.k}};
  541|  2.57k|        };
  542|  2.57k|        return TreeEval<NodeRef<Key>>(upfn);
  543|  2.57k|    }
_ZNK10miniscript4NodeIjE8TreeEvalINSt3__110unique_ptrIKS1_NS3_14default_deleteIS5_EEEEZNKS1_5CloneEvEUlRS5_4SpanIS8_EE_EET_T0_:
  699|  2.57k|    {
  700|  2.57k|        struct DummyState {};
  701|  2.57k|        return std::move(*TreeEvalMaybe<Result>(DummyState{},
  702|  2.57k|            [](DummyState, const Node&, size_t) { return DummyState{}; },
  703|  2.57k|            [&upfn](DummyState, const Node& node, Span<Result> subs) {
  704|  2.57k|                Result res{upfn(node, subs)};
  705|  2.57k|                return std::optional<Result>(std::move(res));
  706|  2.57k|            }
  707|  2.57k|        ));
  708|  2.57k|    }
_ZNK10miniscript4NodeIjE13TreeEvalMaybeINSt3__110unique_ptrIKS1_NS3_14default_deleteIS5_EEEEZNKS1_8TreeEvalIS8_ZNKS1_5CloneEvEUlRS5_4SpanIS8_EE_EET_T0_E10DummyStateZNKS9_IS8_SD_EESE_SF_EUlSG_SA_mE_ZNKS9_IS8_SD_EESE_SF_EUlSG_SA_SC_E_EENS3_8optionalISE_EESF_T1_T2_:
  605|  2.57k|    {
  606|       |        /** Entries of the explicit stack tracked in this algorithm. */
  607|  2.57k|        struct StackElem
  608|  2.57k|        {
  609|  2.57k|            const Node& node; //!< The node being evaluated.
  610|  2.57k|            size_t expanded; //!< How many children of this node have been expanded.
  611|  2.57k|            State state; //!< The state for that node.
  612|       |
  613|  2.57k|            StackElem(const Node& node_, size_t exp_, State&& state_) :
  614|  2.57k|                node(node_), expanded(exp_), state(std::move(state_)) {}
  615|  2.57k|        };
  616|       |        /* Stack of tree nodes being explored. */
  617|  2.57k|        std::vector<StackElem> stack;
  618|       |        /* Results of subtrees so far. Their order and mapping to tree nodes
  619|       |         * is implicitly defined by stack. */
  620|  2.57k|        std::vector<Result> results;
  621|  2.57k|        stack.emplace_back(*this, 0, std::move(root_state));
  622|       |
  623|       |        /* Here is a demonstration of the algorithm, for an example tree A(B,C(D,E),F).
  624|       |         * State variables are omitted for simplicity.
  625|       |         *
  626|       |         * First: stack=[(A,0)] results=[]
  627|       |         *        stack=[(A,1),(B,0)] results=[]
  628|       |         *        stack=[(A,1)] results=[B]
  629|       |         *        stack=[(A,2),(C,0)] results=[B]
  630|       |         *        stack=[(A,2),(C,1),(D,0)] results=[B]
  631|       |         *        stack=[(A,2),(C,1)] results=[B,D]
  632|       |         *        stack=[(A,2),(C,2),(E,0)] results=[B,D]
  633|       |         *        stack=[(A,2),(C,2)] results=[B,D,E]
  634|       |         *        stack=[(A,2)] results=[B,C]
  635|       |         *        stack=[(A,3),(F,0)] results=[B,C]
  636|       |         *        stack=[(A,3)] results=[B,C,F]
  637|       |         * Final: stack=[] results=[A]
  638|       |         */
  639|   150k|        while (stack.size()) {
  ------------------
  |  Branch (639:16): [True: 147k, False: 2.57k]
  ------------------
  640|   147k|            const Node& node = stack.back().node;
  641|   147k|            if (stack.back().expanded < node.subs.size()) {
  ------------------
  |  Branch (641:17): [True: 72.5k, False: 75.1k]
  ------------------
  642|       |                /* We encounter a tree node with at least one unexpanded child.
  643|       |                 * Expand it. By the time we hit this node again, the result of
  644|       |                 * that child (and all earlier children) will be at the end of `results`. */
  645|  72.5k|                size_t child_index = stack.back().expanded++;
  646|  72.5k|                State child_state = downfn(stack.back().state, node, child_index);
  647|  72.5k|                stack.emplace_back(*node.subs[child_index], 0, std::move(child_state));
  648|  72.5k|                continue;
  649|  72.5k|            }
  650|       |            // Invoke upfn with the last node.subs.size() elements of results as input.
  651|  75.1k|            assert(results.size() >= node.subs.size());
  652|  75.1k|            std::optional<Result> result{upfn(std::move(stack.back().state), node,
  653|  75.1k|                Span<Result>{results}.last(node.subs.size()))};
  654|       |            // If evaluation returns std::nullopt, abort immediately.
  655|  75.1k|            if (!result) return {};
  ------------------
  |  Branch (655:17): [True: 0, False: 75.1k]
  ------------------
  656|       |            // Replace the last node.subs.size() elements of results with the new result.
  657|  75.1k|            results.erase(results.end() - node.subs.size(), results.end());
  658|  75.1k|            results.push_back(std::move(*result));
  659|  75.1k|            stack.pop_back();
  660|  75.1k|        }
  661|       |        // The final remaining results element is the root result, return it.
  662|  2.57k|        assert(results.size() == 1);
  663|  2.57k|        return std::move(results[0]);
  664|  2.57k|    }
_ZZNK10miniscript4NodeIjE13TreeEvalMaybeINSt3__110unique_ptrIKS1_NS3_14default_deleteIS5_EEEEZNKS1_8TreeEvalIS8_ZNKS1_5CloneEvEUlRS5_4SpanIS8_EE_EET_T0_E10DummyStateZNKS9_IS8_SD_EESE_SF_EUlSG_SA_mE_ZNKS9_IS8_SD_EESE_SF_EUlSG_SA_SC_E_EENS3_8optionalISE_EESF_T1_T2_EN9StackElemC2ESA_mOSG_:
  614|  75.1k|                node(node_), expanded(exp_), state(std::move(state_)) {}
_ZZNK10miniscript4NodeIjE8TreeEvalINSt3__110unique_ptrIKS1_NS3_14default_deleteIS5_EEEEZNKS1_5CloneEvEUlRS5_4SpanIS8_EE_EET_T0_ENKUlZNKS2_IS8_SC_EESD_SE_E10DummyStateS9_mE_clESF_S9_m:
  702|  72.5k|            [](DummyState, const Node&, size_t) { return DummyState{}; },
_ZZNK10miniscript4NodeIjE8TreeEvalINSt3__110unique_ptrIKS1_NS3_14default_deleteIS5_EEEEZNKS1_5CloneEvEUlRS5_4SpanIS8_EE_EET_T0_ENKUlZNKS2_IS8_SC_EESD_SE_E10DummyStateS9_SB_E_clESF_S9_SB_:
  703|  75.1k|            [&upfn](DummyState, const Node& node, Span<Result> subs) {
  704|  75.1k|                Result res{upfn(node, subs)};
  705|  75.1k|                return std::optional<Result>(std::move(res));
  706|  75.1k|            }
_ZZNK10miniscript4NodeIjE5CloneEvENKUlRKS1_4SpanINSt3__110unique_ptrIS2_NS5_14default_deleteIS2_EEEEEE_clES3_SA_:
  534|  75.1k|        auto upfn = [](const Node& node, Span<NodeRef<Key>> children) {
  535|  75.1k|            std::vector<NodeRef<Key>> new_subs;
  536|   147k|            for (auto child = children.begin(); child != children.end(); ++child) {
  ------------------
  |  Branch (536:49): [True: 72.5k, False: 75.1k]
  ------------------
  537|  72.5k|                new_subs.emplace_back(std::move(*child));
  538|  72.5k|            }
  539|       |            // std::make_unique (and therefore MakeNodeRef) doesn't work on private constructors
  540|  75.1k|            return std::unique_ptr<Node>{new Node{internal::NoDupCheck{}, node.m_script_ctx, node.fragment, std::move(new_subs), node.keys, node.data, node.k}};
  541|  75.1k|        };
_ZN10miniscript4NodeIjEC2ENS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentENSt3__16vectorINS6_10unique_ptrIKS1_NS6_14default_deleteIS9_EEEENS6_9allocatorISC_EEEENS7_IjNSD_IjEEEENS7_IhNSD_IhEEEEj:
  567|  75.1k|        : fragment(nt), k(val), keys(key), data(std::move(arg)), subs(std::move(sub)), m_script_ctx{script_ctx}, ops(CalcOps()), ss(CalcStackSize()), ws(CalcWitnessSize()), typ(CalcType()), scriptlen(CalcScriptLen()) {}
descriptor.cpp:_ZN10miniscript10FromScriptIN12_GLOBAL__N_19KeyParserEEENSt3__110unique_ptrIKNS_4NodeINT_3KeyEEENS3_14default_deleteIS9_EEEERK7CScriptRKS6_:
 2645|  1.34k|inline NodeRef<typename Ctx::Key> FromScript(const CScript& script, const Ctx& ctx) {
 2646|  1.34k|    using namespace internal;
 2647|       |    // A too large Script is necessarily invalid, don't bother parsing it.
 2648|  1.34k|    if (script.size() > MaxScriptSize(ctx.MsContext())) return {};
  ------------------
  |  Branch (2648:9): [True: 0, False: 1.34k]
  ------------------
 2649|  1.34k|    auto decomposed = DecomposeScript(script);
 2650|  1.34k|    if (!decomposed) return {};
  ------------------
  |  Branch (2650:9): [True: 0, False: 1.34k]
  ------------------
 2651|  1.34k|    auto it = decomposed->begin();
 2652|  1.34k|    auto ret = DecodeScript<typename Ctx::Key>(it, decomposed->end(), ctx);
 2653|  1.34k|    if (!ret) return {};
  ------------------
  |  Branch (2653:9): [True: 0, False: 1.34k]
  ------------------
 2654|  1.34k|    if (it != decomposed->end()) return {};
  ------------------
  |  Branch (2654:9): [True: 0, False: 1.34k]
  ------------------
 2655|  1.34k|    return ret;
 2656|  1.34k|}
descriptor.cpp:_ZN10miniscript8internal12DecodeScriptIjN12_GLOBAL__N_19KeyParserENSt3__111__wrap_iterIPNS4_4pairI10opcodetypeNS4_6vectorIhNS4_9allocatorIhEEEEEEEEEENS4_10unique_ptrIKNS_4NodeIT_EENS4_14default_deleteISJ_EEEERT1_SN_RKT0_:
 2252|  1.34k|{
 2253|       |    // The two integers are used to hold state for thresh()
 2254|  1.34k|    std::vector<std::tuple<DecodeContext, int64_t, int64_t>> to_parse;
 2255|  1.34k|    std::vector<NodeRef<Key>> constructed;
 2256|       |
 2257|       |    // This is the top level, so we assume the type is B
 2258|       |    // (in particular, disallowing top level W expressions)
 2259|  1.34k|    to_parse.emplace_back(DecodeContext::BKV_EXPR, -1, -1);
 2260|       |
 2261|  94.1k|    while (!to_parse.empty()) {
  ------------------
  |  Branch (2261:12): [True: 92.8k, False: 1.34k]
  ------------------
 2262|       |        // Exit early if the Miniscript is not going to be valid.
 2263|  92.8k|        if (!constructed.empty() && !constructed.back()->IsValid()) return {};
  ------------------
  |  Branch (2263:13): [True: 81.6k, False: 11.1k]
  |  Branch (2263:37): [True: 0, False: 81.6k]
  ------------------
 2264|       |
 2265|       |        // Get the current context we are decoding within
 2266|  92.8k|        auto [cur_context, n, k] = to_parse.back();
 2267|  92.8k|        to_parse.pop_back();
 2268|       |
 2269|  92.8k|        switch(cur_context) {
  ------------------
  |  Branch (2269:16): [True: 0, False: 92.8k]
  ------------------
 2270|  25.7k|        case DecodeContext::SINGLE_BKV_EXPR: {
  ------------------
  |  Branch (2270:9): [True: 25.7k, False: 67.0k]
  ------------------
 2271|  25.7k|            if (in >= last) return {};
  ------------------
  |  Branch (2271:17): [True: 0, False: 25.7k]
  ------------------
 2272|       |
 2273|       |            // Constants
 2274|  25.7k|            if (in[0].first == OP_1) {
  ------------------
  |  Branch (2274:17): [True: 1.20k, False: 24.5k]
  ------------------
 2275|  1.20k|                ++in;
 2276|  1.20k|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_1));
 2277|  1.20k|                break;
 2278|  1.20k|            }
 2279|  24.5k|            if (in[0].first == OP_0) {
  ------------------
  |  Branch (2279:17): [True: 8.74k, False: 15.7k]
  ------------------
 2280|  8.74k|                ++in;
 2281|  8.74k|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_0));
 2282|  8.74k|                break;
 2283|  8.74k|            }
 2284|       |            // Public keys
 2285|  15.7k|            if (in[0].second.size() == 33 || in[0].second.size() == 32) {
  ------------------
  |  Branch (2285:17): [True: 244, False: 15.5k]
  |  Branch (2285:46): [True: 123, False: 15.4k]
  ------------------
 2286|    367|                auto key = ctx.FromPKBytes(in[0].second.begin(), in[0].second.end());
 2287|    367|                if (!key) return {};
  ------------------
  |  Branch (2287:21): [True: 0, False: 367]
  ------------------
 2288|    367|                ++in;
 2289|    367|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::PK_K, Vector(std::move(*key))));
 2290|    367|                break;
 2291|    367|            }
 2292|  15.4k|            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 (2292:17): [True: 15.1k, False: 260]
  |  Branch (2292:35): [True: 1.95k, False: 13.1k]
  |  Branch (2292:63): [True: 517, False: 1.43k]
  |  Branch (2292:90): [True: 492, False: 25]
  |  Branch (2292:119): [True: 492, False: 0]
  |  Branch (2292:144): [True: 492, False: 0]
  ------------------
 2293|    492|                auto key = ctx.FromPKHBytes(in[2].second.begin(), in[2].second.end());
 2294|    492|                if (!key) return {};
  ------------------
  |  Branch (2294:21): [True: 0, False: 492]
  ------------------
 2295|    492|                in += 5;
 2296|    492|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::PK_H, Vector(std::move(*key))));
 2297|    492|                break;
 2298|    492|            }
 2299|       |            // Time locks
 2300|  14.9k|            std::optional<int64_t> num;
 2301|  14.9k|            if (last - in >= 2 && in[0].first == OP_CHECKSEQUENCEVERIFY && (num = ParseScriptNumber(in[1]))) {
  ------------------
  |  Branch (2301:17): [True: 14.9k, False: 0]
  |  Branch (2301:17): [True: 91, False: 14.8k]
  |  Branch (2301:35): [True: 91, False: 14.8k]
  |  Branch (2301:76): [True: 91, False: 0]
  ------------------
 2302|     91|                in += 2;
 2303|     91|                if (*num < 1 || *num > 0x7FFFFFFFL) return {};
  ------------------
  |  Branch (2303:21): [True: 0, False: 91]
  |  Branch (2303:33): [True: 0, False: 91]
  ------------------
 2304|     91|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::OLDER, *num));
 2305|     91|                break;
 2306|     91|            }
 2307|  14.8k|            if (last - in >= 2 && in[0].first == OP_CHECKLOCKTIMEVERIFY && (num = ParseScriptNumber(in[1]))) {
  ------------------
  |  Branch (2307:17): [True: 14.8k, False: 0]
  |  Branch (2307:17): [True: 51, False: 14.7k]
  |  Branch (2307:35): [True: 51, False: 14.7k]
  |  Branch (2307:76): [True: 51, False: 0]
  ------------------
 2308|     51|                in += 2;
 2309|     51|                if (num < 1 || num > 0x7FFFFFFFL) return {};
  ------------------
  |  Branch (2309:21): [True: 0, False: 51]
  |  Branch (2309:21): [True: 0, False: 51]
  |  Branch (2309:32): [True: 0, False: 51]
  ------------------
 2310|     51|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::AFTER, *num));
 2311|     51|                break;
 2312|     51|            }
 2313|       |            // Hashes
 2314|  14.7k|            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 (2314:17): [True: 13.7k, False: 1.05k]
  |  Branch (2314:17): [True: 37, False: 14.7k]
  |  Branch (2314:35): [True: 56, False: 13.6k]
  |  Branch (2314:62): [True: 40, False: 16]
  |  Branch (2314:90): [True: 40, False: 0]
  |  Branch (2314:117): [True: 37, False: 3]
  |  Branch (2314:153): [True: 37, False: 0]
  |  Branch (2314:166): [True: 37, False: 0]
  ------------------
 2315|     37|                if (in[2].first == OP_SHA256 && in[1].second.size() == 32) {
  ------------------
  |  Branch (2315:21): [True: 0, False: 37]
  |  Branch (2315:49): [True: 0, False: 0]
  ------------------
 2316|      0|                    constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::SHA256, in[1].second));
 2317|      0|                    in += 7;
 2318|      0|                    break;
 2319|     37|                } else if (in[2].first == OP_RIPEMD160 && in[1].second.size() == 20) {
  ------------------
  |  Branch (2319:28): [True: 0, False: 37]
  |  Branch (2319:59): [True: 0, False: 0]
  ------------------
 2320|      0|                    constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::RIPEMD160, in[1].second));
 2321|      0|                    in += 7;
 2322|      0|                    break;
 2323|     37|                } else if (in[2].first == OP_HASH256 && in[1].second.size() == 32) {
  ------------------
  |  Branch (2323:28): [True: 37, False: 0]
  |  Branch (2323:57): [True: 37, False: 0]
  ------------------
 2324|     37|                    constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::HASH256, in[1].second));
 2325|     37|                    in += 7;
 2326|     37|                    break;
 2327|     37|                } else if (in[2].first == OP_HASH160 && in[1].second.size() == 20) {
  ------------------
  |  Branch (2327:28): [True: 0, False: 0]
  |  Branch (2327:57): [True: 0, False: 0]
  ------------------
 2328|      0|                    constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::HASH160, in[1].second));
 2329|      0|                    in += 7;
 2330|      0|                    break;
 2331|      0|                }
 2332|     37|            }
 2333|       |            // Multi
 2334|  14.7k|            if (last - in >= 3 && in[0].first == OP_CHECKMULTISIG) {
  ------------------
  |  Branch (2334:17): [True: 14.6k, False: 94]
  |  Branch (2334:35): [True: 397, False: 14.2k]
  ------------------
 2335|    397|                if (IsTapscript(ctx.MsContext())) return {};
  ------------------
  |  Branch (2335:21): [True: 0, False: 397]
  ------------------
 2336|    397|                std::vector<Key> keys;
 2337|    397|                const auto n = ParseScriptNumber(in[1]);
 2338|    397|                if (!n || last - in < 3 + *n) return {};
  ------------------
  |  Branch (2338:21): [True: 0, False: 397]
  |  Branch (2338:27): [True: 0, False: 397]
  ------------------
 2339|    397|                if (*n < 1 || *n > 20) return {};
  ------------------
  |  Branch (2339:21): [True: 0, False: 397]
  |  Branch (2339:31): [True: 0, False: 397]
  ------------------
 2340|  1.65k|                for (int i = 0; i < *n; ++i) {
  ------------------
  |  Branch (2340:33): [True: 1.25k, False: 397]
  ------------------
 2341|  1.25k|                    if (in[2 + i].second.size() != 33) return {};
  ------------------
  |  Branch (2341:25): [True: 0, False: 1.25k]
  ------------------
 2342|  1.25k|                    auto key = ctx.FromPKBytes(in[2 + i].second.begin(), in[2 + i].second.end());
 2343|  1.25k|                    if (!key) return {};
  ------------------
  |  Branch (2343:25): [True: 0, False: 1.25k]
  ------------------
 2344|  1.25k|                    keys.push_back(std::move(*key));
 2345|  1.25k|                }
 2346|    397|                const auto k = ParseScriptNumber(in[2 + *n]);
 2347|    397|                if (!k || *k < 1 || *k > *n) return {};
  ------------------
  |  Branch (2347:21): [True: 0, False: 397]
  |  Branch (2347:27): [True: 0, False: 397]
  |  Branch (2347:37): [True: 0, False: 397]
  ------------------
 2348|    397|                in += 3 + *n;
 2349|    397|                std::reverse(keys.begin(), keys.end());
 2350|    397|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::MULTI, std::move(keys), *k));
 2351|    397|                break;
 2352|    397|            }
 2353|       |            // Tapscript's equivalent of multi
 2354|  14.3k|            if (last - in >= 4 && in[0].first == OP_NUMEQUAL) {
  ------------------
  |  Branch (2354:17): [True: 14.2k, False: 139]
  |  Branch (2354:35): [True: 171, False: 14.0k]
  ------------------
 2355|    171|                if (!IsTapscript(ctx.MsContext())) return {};
  ------------------
  |  Branch (2355:21): [True: 0, False: 171]
  ------------------
 2356|       |                // The necessary threshold of signatures.
 2357|    171|                const auto k = ParseScriptNumber(in[1]);
 2358|    171|                if (!k) return {};
  ------------------
  |  Branch (2358:21): [True: 0, False: 171]
  ------------------
 2359|    171|                if (*k < 1 || *k > MAX_PUBKEYS_PER_MULTI_A) return {};
  ------------------
  |  Branch (2359:21): [True: 0, False: 171]
  |  Branch (2359:31): [True: 0, False: 171]
  ------------------
 2360|    171|                if (last - in < 2 + *k * 2) return {};
  ------------------
  |  Branch (2360:21): [True: 0, False: 171]
  ------------------
 2361|    171|                std::vector<Key> keys;
 2362|    171|                keys.reserve(*k);
 2363|       |                // Walk through the expected (pubkey, CHECKSIG[ADD]) pairs.
 2364|    624|                for (int pos = 2;; pos += 2) {
 2365|    624|                    if (last - in < pos + 2) return {};
  ------------------
  |  Branch (2365:25): [True: 0, False: 624]
  ------------------
 2366|       |                    // Make sure it's indeed an x-only pubkey and a CHECKSIG[ADD], then parse the key.
 2367|    624|                    if (in[pos].first != OP_CHECKSIGADD && in[pos].first != OP_CHECKSIG) return {};
  ------------------
  |  Branch (2367:25): [True: 171, False: 453]
  |  Branch (2367:60): [True: 0, False: 171]
  ------------------
 2368|    624|                    if (in[pos + 1].second.size() != 32) return {};
  ------------------
  |  Branch (2368:25): [True: 0, False: 624]
  ------------------
 2369|    624|                    auto key = ctx.FromPKBytes(in[pos + 1].second.begin(), in[pos + 1].second.end());
 2370|    624|                    if (!key) return {};
  ------------------
  |  Branch (2370:25): [True: 0, False: 624]
  ------------------
 2371|    624|                    keys.push_back(std::move(*key));
 2372|       |                    // Make sure early we don't parse an arbitrary large expression.
 2373|    624|                    if (keys.size() > MAX_PUBKEYS_PER_MULTI_A) return {};
  ------------------
  |  Branch (2373:25): [True: 0, False: 624]
  ------------------
 2374|       |                    // OP_CHECKSIG means it was the last one to parse.
 2375|    624|                    if (in[pos].first == OP_CHECKSIG) break;
  ------------------
  |  Branch (2375:25): [True: 171, False: 453]
  ------------------
 2376|    624|                }
 2377|    171|                if (keys.size() < (size_t)*k) return {};
  ------------------
  |  Branch (2377:21): [True: 0, False: 171]
  ------------------
 2378|    171|                in += 2 + keys.size() * 2;
 2379|    171|                std::reverse(keys.begin(), keys.end());
 2380|    171|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::MULTI_A, std::move(keys), *k));
 2381|    171|                break;
 2382|    171|            }
 2383|       |            /** In the following wrappers, we only need to push SINGLE_BKV_EXPR rather
 2384|       |             * than BKV_EXPR, because and_v commutes with these wrappers. For example,
 2385|       |             * c:and_v(X,Y) produces the same script as and_v(X,c:Y). */
 2386|       |            // c: wrapper
 2387|  14.1k|            if (in[0].first == OP_CHECKSIG) {
  ------------------
  |  Branch (2387:17): [True: 857, False: 13.3k]
  ------------------
 2388|    857|                ++in;
 2389|    857|                to_parse.emplace_back(DecodeContext::CHECK, -1, -1);
 2390|    857|                to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2391|    857|                break;
 2392|    857|            }
 2393|       |            // v: wrapper
 2394|  13.3k|            if (in[0].first == OP_VERIFY) {
  ------------------
  |  Branch (2394:17): [True: 1.46k, False: 11.8k]
  ------------------
 2395|  1.46k|                ++in;
 2396|  1.46k|                to_parse.emplace_back(DecodeContext::VERIFY, -1, -1);
 2397|  1.46k|                to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2398|  1.46k|                break;
 2399|  1.46k|            }
 2400|       |            // n: wrapper
 2401|  11.8k|            if (in[0].first == OP_0NOTEQUAL) {
  ------------------
  |  Branch (2401:17): [True: 2.31k, False: 9.53k]
  ------------------
 2402|  2.31k|                ++in;
 2403|  2.31k|                to_parse.emplace_back(DecodeContext::ZERO_NOTEQUAL, -1, -1);
 2404|  2.31k|                to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2405|  2.31k|                break;
 2406|  2.31k|            }
 2407|       |            // Thresh
 2408|  9.53k|            if (last - in >= 3 && in[0].first == OP_EQUAL && (num = ParseScriptNumber(in[1]))) {
  ------------------
  |  Branch (2408:17): [True: 9.53k, False: 0]
  |  Branch (2408:17): [True: 23, False: 9.50k]
  |  Branch (2408:35): [True: 23, False: 9.50k]
  |  Branch (2408:62): [True: 23, False: 0]
  ------------------
 2409|     23|                if (*num < 1) return {};
  ------------------
  |  Branch (2409:21): [True: 0, False: 23]
  ------------------
 2410|     23|                in += 2;
 2411|     23|                to_parse.emplace_back(DecodeContext::THRESH_W, 0, *num);
 2412|     23|                break;
 2413|     23|            }
 2414|       |            // OP_ENDIF can be WRAP_J, WRAP_D, ANDOR, OR_C, OR_D, or OR_I
 2415|  9.50k|            if (in[0].first == OP_ENDIF) {
  ------------------
  |  Branch (2415:17): [True: 9.50k, False: 0]
  ------------------
 2416|  9.50k|                ++in;
 2417|  9.50k|                to_parse.emplace_back(DecodeContext::ENDIF, -1, -1);
 2418|  9.50k|                to_parse.emplace_back(DecodeContext::BKV_EXPR, -1, -1);
 2419|  9.50k|                break;
 2420|  9.50k|            }
 2421|       |            /** In and_b and or_b nodes, we only look for SINGLE_BKV_EXPR, because
 2422|       |             * or_b(and_v(X,Y),Z) has script [X] [Y] [Z] OP_BOOLOR, the same as
 2423|       |             * and_v(X,or_b(Y,Z)). In this example, the former of these is invalid as
 2424|       |             * miniscript, while the latter is valid. So we leave the and_v "outside"
 2425|       |             * while decoding. */
 2426|       |            // and_b
 2427|      0|            if (in[0].first == OP_BOOLAND) {
  ------------------
  |  Branch (2427:17): [True: 0, False: 0]
  ------------------
 2428|      0|                ++in;
 2429|      0|                to_parse.emplace_back(DecodeContext::AND_B, -1, -1);
 2430|      0|                to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2431|      0|                to_parse.emplace_back(DecodeContext::W_EXPR, -1, -1);
 2432|      0|                break;
 2433|      0|            }
 2434|       |            // or_b
 2435|      0|            if (in[0].first == OP_BOOLOR) {
  ------------------
  |  Branch (2435:17): [True: 0, False: 0]
  ------------------
 2436|      0|                ++in;
 2437|      0|                to_parse.emplace_back(DecodeContext::OR_B, -1, -1);
 2438|      0|                to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2439|      0|                to_parse.emplace_back(DecodeContext::W_EXPR, -1, -1);
 2440|      0|                break;
 2441|      0|            }
 2442|       |            // Unrecognised expression
 2443|      0|            return {};
 2444|      0|        }
 2445|  20.8k|        case DecodeContext::BKV_EXPR: {
  ------------------
  |  Branch (2445:9): [True: 20.8k, False: 71.9k]
  ------------------
 2446|  20.8k|            to_parse.emplace_back(DecodeContext::MAYBE_AND_V, -1, -1);
 2447|  20.8k|            to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2448|  20.8k|            break;
 2449|      0|        }
 2450|     17|        case DecodeContext::W_EXPR: {
  ------------------
  |  Branch (2450:9): [True: 17, False: 92.7k]
  ------------------
 2451|       |            // a: wrapper
 2452|     17|            if (in >= last) return {};
  ------------------
  |  Branch (2452:17): [True: 0, False: 17]
  ------------------
 2453|     17|            if (in[0].first == OP_FROMALTSTACK) {
  ------------------
  |  Branch (2453:17): [True: 7, False: 10]
  ------------------
 2454|      7|                ++in;
 2455|      7|                to_parse.emplace_back(DecodeContext::ALT, -1, -1);
 2456|     10|            } else {
 2457|     10|                to_parse.emplace_back(DecodeContext::SWAP, -1, -1);
 2458|     10|            }
 2459|     17|            to_parse.emplace_back(DecodeContext::BKV_EXPR, -1, -1);
 2460|     17|            break;
 2461|     17|        }
 2462|  20.8k|        case DecodeContext::MAYBE_AND_V: {
  ------------------
  |  Branch (2462:9): [True: 20.8k, False: 71.9k]
  ------------------
 2463|       |            // If we reach a potential AND_V top-level, check if the next part of the script could be another AND_V child
 2464|       |            // These op-codes cannot end any well-formed miniscript so cannot be used in an and_v node.
 2465|  20.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 (2465:17): [True: 19.5k, False: 1.34k]
  |  Branch (2465:30): [True: 10.2k, False: 9.34k]
  |  Branch (2465:54): [True: 1.53k, False: 8.67k]
  |  Branch (2465:80): [True: 1.37k, False: 165]
  |  Branch (2465:107): [True: 1.36k, False: 7]
  |  Branch (2465:139): [True: 1.35k, False: 10]
  ------------------
 2466|  1.35k|                to_parse.emplace_back(DecodeContext::AND_V, -1, -1);
 2467|       |                // BKV_EXPR can contain more AND_V nodes
 2468|  1.35k|                to_parse.emplace_back(DecodeContext::BKV_EXPR, -1, -1);
 2469|  1.35k|            }
 2470|  20.8k|            break;
 2471|     17|        }
 2472|     10|        case DecodeContext::SWAP: {
  ------------------
  |  Branch (2472:9): [True: 10, False: 92.7k]
  ------------------
 2473|     10|            if (in >= last || in[0].first != OP_SWAP || constructed.empty()) return {};
  ------------------
  |  Branch (2473:17): [True: 0, False: 10]
  |  Branch (2473:31): [True: 0, False: 10]
  |  Branch (2473:57): [True: 0, False: 10]
  ------------------
 2474|     10|            ++in;
 2475|     10|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_S, Vector(std::move(constructed.back())));
 2476|     10|            break;
 2477|     10|        }
 2478|      7|        case DecodeContext::ALT: {
  ------------------
  |  Branch (2478:9): [True: 7, False: 92.7k]
  ------------------
 2479|      7|            if (in >= last || in[0].first != OP_TOALTSTACK || constructed.empty()) return {};
  ------------------
  |  Branch (2479:17): [True: 0, False: 7]
  |  Branch (2479:31): [True: 0, False: 7]
  |  Branch (2479:63): [True: 0, False: 7]
  ------------------
 2480|      7|            ++in;
 2481|      7|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_A, Vector(std::move(constructed.back())));
 2482|      7|            break;
 2483|      7|        }
 2484|    857|        case DecodeContext::CHECK: {
  ------------------
  |  Branch (2484:9): [True: 857, False: 91.9k]
  ------------------
 2485|    857|            if (constructed.empty()) return {};
  ------------------
  |  Branch (2485:17): [True: 0, False: 857]
  ------------------
 2486|    857|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_C, Vector(std::move(constructed.back())));
 2487|    857|            break;
 2488|    857|        }
 2489|     29|        case DecodeContext::DUP_IF: {
  ------------------
  |  Branch (2489:9): [True: 29, False: 92.7k]
  ------------------
 2490|     29|            if (constructed.empty()) return {};
  ------------------
  |  Branch (2490:17): [True: 0, False: 29]
  ------------------
 2491|     29|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_D, Vector(std::move(constructed.back())));
 2492|     29|            break;
 2493|     29|        }
 2494|  1.46k|        case DecodeContext::VERIFY: {
  ------------------
  |  Branch (2494:9): [True: 1.46k, False: 91.3k]
  ------------------
 2495|  1.46k|            if (constructed.empty()) return {};
  ------------------
  |  Branch (2495:17): [True: 0, False: 1.46k]
  ------------------
 2496|  1.46k|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_V, Vector(std::move(constructed.back())));
 2497|  1.46k|            break;
 2498|  1.46k|        }
 2499|    730|        case DecodeContext::NON_ZERO: {
  ------------------
  |  Branch (2499:9): [True: 730, False: 92.0k]
  ------------------
 2500|    730|            if (constructed.empty()) return {};
  ------------------
  |  Branch (2500:17): [True: 0, False: 730]
  ------------------
 2501|    730|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_J, Vector(std::move(constructed.back())));
 2502|    730|            break;
 2503|    730|        }
 2504|  2.31k|        case DecodeContext::ZERO_NOTEQUAL: {
  ------------------
  |  Branch (2504:9): [True: 2.31k, False: 90.4k]
  ------------------
 2505|  2.31k|            if (constructed.empty()) return {};
  ------------------
  |  Branch (2505:17): [True: 0, False: 2.31k]
  ------------------
 2506|  2.31k|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_N, Vector(std::move(constructed.back())));
 2507|  2.31k|            break;
 2508|  2.31k|        }
 2509|  1.35k|        case DecodeContext::AND_V: {
  ------------------
  |  Branch (2509:9): [True: 1.35k, False: 91.4k]
  ------------------
 2510|  1.35k|            if (constructed.size() < 2) return {};
  ------------------
  |  Branch (2510:17): [True: 0, False: 1.35k]
  ------------------
 2511|  1.35k|            BuildBack(ctx.MsContext(), Fragment::AND_V, constructed, /*reverse=*/true);
 2512|  1.35k|            break;
 2513|  1.35k|        }
 2514|      0|        case DecodeContext::AND_B: {
  ------------------
  |  Branch (2514:9): [True: 0, False: 92.8k]
  ------------------
 2515|      0|            if (constructed.size() < 2) return {};
  ------------------
  |  Branch (2515:17): [True: 0, False: 0]
  ------------------
 2516|      0|            BuildBack(ctx.MsContext(), Fragment::AND_B, constructed, /*reverse=*/true);
 2517|      0|            break;
 2518|      0|        }
 2519|      0|        case DecodeContext::OR_B: {
  ------------------
  |  Branch (2519:9): [True: 0, False: 92.8k]
  ------------------
 2520|      0|            if (constructed.size() < 2) return {};
  ------------------
  |  Branch (2520:17): [True: 0, False: 0]
  ------------------
 2521|      0|            BuildBack(ctx.MsContext(), Fragment::OR_B, constructed, /*reverse=*/true);
 2522|      0|            break;
 2523|      0|        }
 2524|     71|        case DecodeContext::OR_C: {
  ------------------
  |  Branch (2524:9): [True: 71, False: 92.7k]
  ------------------
 2525|     71|            if (constructed.size() < 2) return {};
  ------------------
  |  Branch (2525:17): [True: 0, False: 71]
  ------------------
 2526|     71|            BuildBack(ctx.MsContext(), Fragment::OR_C, constructed, /*reverse=*/true);
 2527|     71|            break;
 2528|     71|        }
 2529|      0|        case DecodeContext::OR_D: {
  ------------------
  |  Branch (2529:9): [True: 0, False: 92.8k]
  ------------------
 2530|      0|            if (constructed.size() < 2) return {};
  ------------------
  |  Branch (2530:17): [True: 0, False: 0]
  ------------------
 2531|      0|            BuildBack(ctx.MsContext(), Fragment::OR_D, constructed, /*reverse=*/true);
 2532|      0|            break;
 2533|      0|        }
 2534|     94|        case DecodeContext::ANDOR: {
  ------------------
  |  Branch (2534:9): [True: 94, False: 92.7k]
  ------------------
 2535|     94|            if (constructed.size() < 3) return {};
  ------------------
  |  Branch (2535:17): [True: 0, False: 94]
  ------------------
 2536|     94|            NodeRef<Key> left = std::move(constructed.back());
 2537|     94|            constructed.pop_back();
 2538|     94|            NodeRef<Key> right = std::move(constructed.back());
 2539|     94|            constructed.pop_back();
 2540|     94|            NodeRef<Key> mid = std::move(constructed.back());
 2541|     94|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::ANDOR, Vector(std::move(left), std::move(mid), std::move(right)));
 2542|     94|            break;
 2543|     94|        }
 2544|     40|        case DecodeContext::THRESH_W: {
  ------------------
  |  Branch (2544:9): [True: 40, False: 92.7k]
  ------------------
 2545|     40|            if (in >= last) return {};
  ------------------
  |  Branch (2545:17): [True: 0, False: 40]
  ------------------
 2546|     40|            if (in[0].first == OP_ADD) {
  ------------------
  |  Branch (2546:17): [True: 17, False: 23]
  ------------------
 2547|     17|                ++in;
 2548|     17|                to_parse.emplace_back(DecodeContext::THRESH_W, n+1, k);
 2549|     17|                to_parse.emplace_back(DecodeContext::W_EXPR, -1, -1);
 2550|     23|            } else {
 2551|     23|                to_parse.emplace_back(DecodeContext::THRESH_E, n+1, k);
 2552|       |                // All children of thresh have type modifier d, so cannot be and_v
 2553|     23|                to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2554|     23|            }
 2555|     40|            break;
 2556|     40|        }
 2557|     23|        case DecodeContext::THRESH_E: {
  ------------------
  |  Branch (2557:9): [True: 23, False: 92.7k]
  ------------------
 2558|     23|            if (k < 1 || k > n || constructed.size() < static_cast<size_t>(n)) return {};
  ------------------
  |  Branch (2558:17): [True: 0, False: 23]
  |  Branch (2558:26): [True: 0, False: 23]
  |  Branch (2558:35): [True: 0, False: 23]
  ------------------
 2559|     23|            std::vector<NodeRef<Key>> subs;
 2560|     63|            for (int i = 0; i < n; ++i) {
  ------------------
  |  Branch (2560:29): [True: 40, False: 23]
  ------------------
 2561|     40|                NodeRef<Key> sub = std::move(constructed.back());
 2562|     40|                constructed.pop_back();
 2563|     40|                subs.push_back(std::move(sub));
 2564|     40|            }
 2565|     23|            constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::THRESH, std::move(subs), k));
 2566|     23|            break;
 2567|     23|        }
 2568|  9.50k|        case DecodeContext::ENDIF: {
  ------------------
  |  Branch (2568:9): [True: 9.50k, False: 83.2k]
  ------------------
 2569|  9.50k|            if (in >= last) return {};
  ------------------
  |  Branch (2569:17): [True: 0, False: 9.50k]
  ------------------
 2570|       |
 2571|       |            // could be andor or or_i
 2572|  9.50k|            if (in[0].first == OP_ELSE) {
  ------------------
  |  Branch (2572:17): [True: 8.67k, False: 830]
  ------------------
 2573|  8.67k|                ++in;
 2574|  8.67k|                to_parse.emplace_back(DecodeContext::ENDIF_ELSE, -1, -1);
 2575|  8.67k|                to_parse.emplace_back(DecodeContext::BKV_EXPR, -1, -1);
 2576|  8.67k|            }
 2577|       |            // could be j: or d: wrapper
 2578|    830|            else if (in[0].first == OP_IF) {
  ------------------
  |  Branch (2578:22): [True: 759, False: 71]
  ------------------
 2579|    759|                if (last - in >= 2 && in[1].first == OP_DUP) {
  ------------------
  |  Branch (2579:21): [True: 759, False: 0]
  |  Branch (2579:39): [True: 29, False: 730]
  ------------------
 2580|     29|                    in += 2;
 2581|     29|                    to_parse.emplace_back(DecodeContext::DUP_IF, -1, -1);
 2582|    730|                } else if (last - in >= 3 && in[1].first == OP_0NOTEQUAL && in[2].first == OP_SIZE) {
  ------------------
  |  Branch (2582:28): [True: 730, False: 0]
  |  Branch (2582:46): [True: 730, False: 0]
  |  Branch (2582:77): [True: 730, False: 0]
  ------------------
 2583|    730|                    in += 3;
 2584|    730|                    to_parse.emplace_back(DecodeContext::NON_ZERO, -1, -1);
 2585|    730|                }
 2586|      0|                else {
 2587|      0|                    return {};
 2588|      0|                }
 2589|       |            // could be or_c or or_d
 2590|    759|            } else if (in[0].first == OP_NOTIF) {
  ------------------
  |  Branch (2590:24): [True: 71, False: 0]
  ------------------
 2591|     71|                ++in;
 2592|     71|                to_parse.emplace_back(DecodeContext::ENDIF_NOTIF, -1, -1);
 2593|     71|            }
 2594|      0|            else {
 2595|      0|                return {};
 2596|      0|            }
 2597|  9.50k|            break;
 2598|  9.50k|        }
 2599|  9.50k|        case DecodeContext::ENDIF_NOTIF: {
  ------------------
  |  Branch (2599:9): [True: 71, False: 92.7k]
  ------------------
 2600|     71|            if (in >= last) return {};
  ------------------
  |  Branch (2600:17): [True: 0, False: 71]
  ------------------
 2601|     71|            if (in[0].first == OP_IFDUP) {
  ------------------
  |  Branch (2601:17): [True: 0, False: 71]
  ------------------
 2602|      0|                ++in;
 2603|      0|                to_parse.emplace_back(DecodeContext::OR_D, -1, -1);
 2604|     71|            } else {
 2605|     71|                to_parse.emplace_back(DecodeContext::OR_C, -1, -1);
 2606|     71|            }
 2607|       |            // or_c and or_d both require X to have type modifier d so, can't contain and_v
 2608|     71|            to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2609|     71|            break;
 2610|     71|        }
 2611|  8.67k|        case DecodeContext::ENDIF_ELSE: {
  ------------------
  |  Branch (2611:9): [True: 8.67k, False: 84.1k]
  ------------------
 2612|  8.67k|            if (in >= last) return {};
  ------------------
  |  Branch (2612:17): [True: 0, False: 8.67k]
  ------------------
 2613|  8.67k|            if (in[0].first == OP_IF) {
  ------------------
  |  Branch (2613:17): [True: 8.58k, False: 94]
  ------------------
 2614|  8.58k|                ++in;
 2615|  8.58k|                BuildBack(ctx.MsContext(), Fragment::OR_I, constructed, /*reverse=*/true);
 2616|  8.58k|            } else if (in[0].first == OP_NOTIF) {
  ------------------
  |  Branch (2616:24): [True: 94, False: 0]
  ------------------
 2617|     94|                ++in;
 2618|     94|                to_parse.emplace_back(DecodeContext::ANDOR, -1, -1);
 2619|       |                // andor requires X to have type modifier d, so it can't be and_v
 2620|     94|                to_parse.emplace_back(DecodeContext::SINGLE_BKV_EXPR, -1, -1);
 2621|     94|            } else {
 2622|      0|                return {};
 2623|      0|            }
 2624|  8.67k|            break;
 2625|  8.67k|        }
 2626|  92.8k|        }
 2627|  92.8k|    }
 2628|  1.34k|    if (constructed.size() != 1) return {};
  ------------------
  |  Branch (2628:9): [True: 0, False: 1.34k]
  ------------------
 2629|  1.34k|    NodeRef<Key> tl_node = std::move(constructed.front());
 2630|  1.34k|    tl_node->DuplicateKeyCheck(ctx);
 2631|       |    // Note that due to how ComputeType works (only assign the type to the node if the
 2632|       |    // subs' types are valid) this would fail if any node of tree is badly typed.
 2633|  1.34k|    if (!tl_node->IsValidTopLevel()) return {};
  ------------------
  |  Branch (2633:9): [True: 0, False: 1.34k]
  ------------------
 2634|  1.34k|    return tl_node;
 2635|  1.34k|}
_ZN10miniscript11MakeNodeRefIjJNS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentERlEEENSt3__110unique_ptrIKNS_4NodeIT_EENS6_14default_deleteISB_EEEEDpOT0_:
  196|    142|NodeRef<Key> MakeNodeRef(Args&&... args) { return std::make_unique<const Node<Key>>(std::forward<Args>(args)...); }
_ZN10miniscript11MakeNodeRefIjJNS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentERNSt3__16vectorIhNS5_9allocatorIhEEEEEEENS5_10unique_ptrIKNS_4NodeIT_EENS5_14default_deleteISF_EEEEDpOT0_:
  196|     37|NodeRef<Key> MakeNodeRef(Args&&... args) { return std::make_unique<const Node<Key>>(std::forward<Args>(args)...); }

_ZN6script5ConstERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEER4SpanIKcE:
   16|  2.05M|{
   17|  2.05M|    if ((size_t)sp.size() >= str.size() && std::equal(str.begin(), str.end(), sp.begin())) {
  ------------------
  |  Branch (17:9): [True: 2.03M, False: 15.1k]
  |  Branch (17:44): [True: 401k, False: 1.63M]
  ------------------
   18|   401k|        sp = sp.subspan(str.size());
   19|   401k|        return true;
   20|   401k|    }
   21|  1.64M|    return false;
   22|  2.05M|}
_ZN6script4FuncERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEER4SpanIKcE:
   25|   236k|{
   26|   236k|    if ((size_t)sp.size() >= str.size() + 2 && sp[str.size()] == '(' && sp[sp.size() - 1] == ')' && std::equal(str.begin(), str.end(), sp.begin())) {
  ------------------
  |  Branch (26:9): [True: 226k, False: 10.1k]
  |  Branch (26:48): [True: 38.0k, False: 188k]
  |  Branch (26:73): [True: 35.2k, False: 2.79k]
  |  Branch (26:101): [True: 11.5k, False: 23.7k]
  ------------------
   27|  11.5k|        sp = sp.subspan(str.size() + 1, sp.size() - str.size() - 2);
   28|  11.5k|        return true;
   29|  11.5k|    }
   30|   225k|    return false;
   31|   236k|}
_ZN6script4ExprER4SpanIKcE:
   34|   176k|{
   35|   176k|    int level = 0;
   36|   176k|    auto it = sp.begin();
   37|   435M|    while (it != sp.end()) {
  ------------------
  |  Branch (37:12): [True: 435M, False: 22.4k]
  ------------------
   38|   435M|        if (*it == '(' || *it == '{') {
  ------------------
  |  Branch (38:13): [True: 189k, False: 434M]
  |  Branch (38:27): [True: 16.1k, False: 434M]
  ------------------
   39|   205k|            ++level;
   40|   434M|        } else if (level && (*it == ')' || *it == '}')) {
  ------------------
  |  Branch (40:20): [True: 349M, False: 85.7M]
  |  Branch (40:30): [True: 132k, False: 349M]
  |  Branch (40:44): [True: 3.86k, False: 349M]
  ------------------
   41|   136k|            --level;
   42|   434M|        } else if (level == 0 && (*it == ')' || *it == '}' || *it == ',')) {
  ------------------
  |  Branch (42:20): [True: 85.7M, False: 349M]
  |  Branch (42:35): [True: 307, False: 85.7M]
  |  Branch (42:49): [True: 2.10k, False: 85.7M]
  |  Branch (42:63): [True: 151k, False: 85.5M]
  ------------------
   43|   153k|            break;
   44|   153k|        }
   45|   435M|        ++it;
   46|   435M|    }
   47|   176k|    Span<const char> ret = sp.first(it - sp.begin());
   48|   176k|    sp = sp.subspan(it - sp.begin());
   49|   176k|    return ret;
   50|   176k|}

_ZN9CScriptIDC2ERK7CScript:
   16|  2.76k|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|     96|        (*this)[0] == OP_1 &&
  ------------------
  |  Branch (210:9): [True: 24, False: 18]
  ------------------
  211|     96|        (*this)[1] == 0x02 &&
  ------------------
  |  Branch (211:9): [True: 24, False: 0]
  ------------------
  212|     96|        (*this)[2] == 0x4e &&
  ------------------
  |  Branch (212:9): [True: 15, False: 9]
  ------------------
  213|     96|        (*this)[3] == 0x73);
  ------------------
  |  Branch (213:9): [True: 0, False: 15]
  ------------------
  214|     96|}
_ZNK7CScript17IsPayToScriptHashEv:
  225|  6.73k|{
  226|       |    // Extra-fast test for pay-to-script-hash CScripts:
  227|  6.73k|    return (this->size() == 23 &&
  ------------------
  |  Branch (227:13): [True: 649, False: 6.08k]
  ------------------
  228|  6.73k|            (*this)[0] == OP_HASH160 &&
  ------------------
  |  Branch (228:13): [True: 631, False: 18]
  ------------------
  229|  6.73k|            (*this)[1] == 0x14 &&
  ------------------
  |  Branch (229:13): [True: 628, False: 3]
  ------------------
  230|  6.73k|            (*this)[22] == OP_EQUAL);
  ------------------
  |  Branch (230:13): [True: 616, False: 12]
  ------------------
  231|  6.73k|}
_ZNK7CScript16IsWitnessProgramERiRNSt3__16vectorIhNS1_9allocatorIhEEEE:
  244|  6.11k|{
  245|  6.11k|    if (this->size() < 4 || this->size() > 42) {
  ------------------
  |  Branch (245:9): [True: 237, False: 5.87k]
  |  Branch (245:29): [True: 1.83k, False: 4.04k]
  ------------------
  246|  2.06k|        return false;
  247|  2.06k|    }
  248|  4.04k|    if ((*this)[0] != OP_0 && ((*this)[0] < OP_1 || (*this)[0] > OP_16)) {
  ------------------
  |  Branch (248:9): [True: 3.24k, False: 806]
  |  Branch (248:32): [True: 636, False: 2.60k]
  |  Branch (248:53): [True: 745, False: 1.86k]
  ------------------
  249|  1.38k|        return false;
  250|  1.38k|    }
  251|  2.66k|    if ((size_t)((*this)[1] + 2) == this->size()) {
  ------------------
  |  Branch (251:9): [True: 2.30k, False: 367]
  ------------------
  252|  2.30k|        version = DecodeOP_N((opcodetype)(*this)[0]);
  253|  2.30k|        program = std::vector<unsigned char>(this->begin() + 2, this->end());
  254|  2.30k|        return true;
  255|  2.30k|    }
  256|    367|    return false;
  257|  2.66k|}
_ZNK7CScript10IsPushOnlyEN9prevectorILj28EhjiE14const_iteratorE:
  260|    432|{
  261|  2.14M|    while (pc < end())
  ------------------
  |  Branch (261:12): [True: 2.14M, False: 90]
  ------------------
  262|  2.14M|    {
  263|  2.14M|        opcodetype opcode;
  264|  2.14M|        if (!GetOp(pc, opcode))
  ------------------
  |  Branch (264:13): [True: 276, False: 2.14M]
  ------------------
  265|    276|            return false;
  266|       |        // Note that IsPushOnly() *does* consider OP_RESERVED to be a
  267|       |        // push-type opcode, however execution of OP_RESERVED fails, so
  268|       |        // it's not relevant to P2SH/BIP62 as the scriptSig would fail prior to
  269|       |        // the P2SH special validation code being executed.
  270|  2.14M|        if (opcode > OP_16)
  ------------------
  |  Branch (270:13): [True: 66, False: 2.14M]
  ------------------
  271|     66|            return false;
  272|  2.14M|    }
  273|     90|    return true;
  274|    432|}
_Z11GetScriptOpRN9prevectorILj28EhjiE14const_iteratorES1_R10opcodetypePNSt3__16vectorIhNS5_9allocatorIhEEEE:
  307|  2.20M|{
  308|  2.20M|    opcodeRet = OP_INVALIDOPCODE;
  309|  2.20M|    if (pvchRet)
  ------------------
  |  Branch (309:9): [True: 60.3k, False: 2.14M]
  ------------------
  310|  60.3k|        pvchRet->clear();
  311|  2.20M|    if (pc >= end)
  ------------------
  |  Branch (311:9): [True: 12, False: 2.20M]
  ------------------
  312|     12|        return false;
  313|       |
  314|       |    // Read instruction
  315|  2.20M|    if (end - pc < 1)
  ------------------
  |  Branch (315:9): [True: 0, False: 2.20M]
  ------------------
  316|      0|        return false;
  317|  2.20M|    unsigned int opcode = *pc++;
  318|       |
  319|       |    // Immediate operand
  320|  2.20M|    if (opcode <= OP_PUSHDATA4)
  ------------------
  |  Branch (320:9): [True: 2.15M, False: 44.5k]
  ------------------
  321|  2.15M|    {
  322|  2.15M|        unsigned int nSize = 0;
  323|  2.15M|        if (opcode < OP_PUSHDATA1)
  ------------------
  |  Branch (323:13): [True: 2.15M, False: 5.52k]
  ------------------
  324|  2.15M|        {
  325|  2.15M|            nSize = opcode;
  326|  2.15M|        }
  327|  5.52k|        else if (opcode == OP_PUSHDATA1)
  ------------------
  |  Branch (327:18): [True: 1.05k, False: 4.47k]
  ------------------
  328|  1.05k|        {
  329|  1.05k|            if (end - pc < 1)
  ------------------
  |  Branch (329:17): [True: 3, False: 1.05k]
  ------------------
  330|      3|                return false;
  331|  1.05k|            nSize = *pc++;
  332|  1.05k|        }
  333|  4.47k|        else if (opcode == OP_PUSHDATA2)
  ------------------
  |  Branch (333:18): [True: 2.60k, False: 1.86k]
  ------------------
  334|  2.60k|        {
  335|  2.60k|            if (end - pc < 2)
  ------------------
  |  Branch (335:17): [True: 9, False: 2.59k]
  ------------------
  336|      9|                return false;
  337|  2.59k|            nSize = ReadLE16(&pc[0]);
  338|  2.59k|            pc += 2;
  339|  2.59k|        }
  340|  1.86k|        else if (opcode == OP_PUSHDATA4)
  ------------------
  |  Branch (340:18): [True: 1.86k, False: 0]
  ------------------
  341|  1.86k|        {
  342|  1.86k|            if (end - pc < 4)
  ------------------
  |  Branch (342:17): [True: 21, False: 1.84k]
  ------------------
  343|     21|                return false;
  344|  1.84k|            nSize = ReadLE32(&pc[0]);
  345|  1.84k|            pc += 4;
  346|  1.84k|        }
  347|  2.15M|        if (end - pc < 0 || (unsigned int)(end - pc) < nSize)
  ------------------
  |  Branch (347:13): [True: 0, False: 2.15M]
  |  Branch (347:29): [True: 399, False: 2.15M]
  ------------------
  348|    399|            return false;
  349|  2.15M|        if (pvchRet)
  ------------------
  |  Branch (349:13): [True: 17.7k, False: 2.14M]
  ------------------
  350|  17.7k|            pvchRet->assign(pc, pc + nSize);
  351|  2.15M|        pc += nSize;
  352|  2.15M|    }
  353|       |
  354|  2.20M|    opcodeRet = static_cast<opcodetype>(opcode);
  355|  2.20M|    return true;
  356|  2.20M|}
_Z16CheckMinimalPushRKNSt3__16vectorIhNS_9allocatorIhEEEE10opcodetype:
  366|  3.59k|bool CheckMinimalPush(const std::vector<unsigned char>& data, opcodetype opcode) {
  367|       |    // Excludes OP_1NEGATE, OP_1-16 since they are by definition minimal
  368|  3.59k|    assert(0 <= opcode && opcode <= OP_PUSHDATA4);
  369|  3.59k|    if (data.size() == 0) {
  ------------------
  |  Branch (369:9): [True: 6, False: 3.58k]
  ------------------
  370|       |        // Should have used OP_0.
  371|      6|        return opcode == OP_0;
  372|  3.58k|    } else if (data.size() == 1 && data[0] >= 1 && data[0] <= 16) {
  ------------------
  |  Branch (372:16): [True: 285, False: 3.29k]
  |  Branch (372:36): [True: 279, False: 6]
  |  Branch (372:52): [True: 30, False: 249]
  ------------------
  373|       |        // Should have used OP_1 .. OP_16.
  374|     30|        return false;
  375|  3.55k|    } else if (data.size() == 1 && data[0] == 0x81) {
  ------------------
  |  Branch (375:16): [True: 255, False: 3.29k]
  |  Branch (375:36): [True: 3, False: 252]
  ------------------
  376|       |        // Should have used OP_1NEGATE.
  377|      3|        return false;
  378|  3.55k|    } else if (data.size() <= 75) {
  ------------------
  |  Branch (378:16): [True: 3.52k, False: 24]
  ------------------
  379|       |        // Must have used a direct push (opcode indicating number of bytes pushed + those bytes).
  380|  3.52k|        return opcode == data.size();
  381|  3.52k|    } else if (data.size() <= 255) {
  ------------------
  |  Branch (381:16): [True: 6, False: 18]
  ------------------
  382|       |        // Must have used OP_PUSHDATA.
  383|      6|        return opcode == OP_PUSHDATA1;
  384|     18|    } else if (data.size() <= 65535) {
  ------------------
  |  Branch (384:16): [True: 18, False: 0]
  ------------------
  385|       |        // Must have used OP_PUSHDATA2.
  386|     18|        return opcode == OP_PUSHDATA2;
  387|     18|    }
  388|      0|    return true;
  389|  3.59k|}

_ZN15scriptnum_errorC2ERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
  223|     84|    explicit scriptnum_error(const std::string& str) : std::runtime_error(str) {}
_ZN10CScriptNumC2ERKNSt3__16vectorIhNS0_9allocatorIhEEEEbm:
  247|  1.67k|    {
  248|  1.67k|        if (vch.size() > nMaxNumSize) {
  ------------------
  |  Branch (248:13): [True: 72, False: 1.60k]
  ------------------
  249|     72|            throw scriptnum_error("script number overflow");
  250|     72|        }
  251|  1.60k|        if (fRequireMinimal && vch.size() > 0) {
  ------------------
  |  Branch (251:13): [True: 1.60k, False: 0]
  |  Branch (251:32): [True: 1.60k, False: 0]
  ------------------
  252|       |            // Check that the number is encoded with the minimum possible
  253|       |            // number of bytes.
  254|       |            //
  255|       |            // If the most-significant-byte - excluding the sign bit - is zero
  256|       |            // then we're not minimal. Note how this test also rejects the
  257|       |            // negative-zero encoding, 0x80.
  258|  1.60k|            if ((vch.back() & 0x7f) == 0) {
  ------------------
  |  Branch (258:17): [True: 39, False: 1.56k]
  ------------------
  259|       |                // One exception: if there's more than one byte and the most
  260|       |                // significant bit of the second-most-significant-byte is set
  261|       |                // it would conflict with the sign bit. An example of this case
  262|       |                // is +-255, which encode to 0xff00 and 0xff80 respectively.
  263|       |                // (big-endian).
  264|     39|                if (vch.size() <= 1 || (vch[vch.size() - 2] & 0x80) == 0) {
  ------------------
  |  Branch (264:21): [True: 6, False: 33]
  |  Branch (264:40): [True: 6, False: 27]
  ------------------
  265|     12|                    throw scriptnum_error("non-minimally encoded script number");
  266|     12|                }
  267|     39|            }
  268|  1.60k|        }
  269|  1.58k|        m_value = set_vch(vch);
  270|  1.58k|    }
_ZNK10CScriptNum6getintEv:
  334|    422|    {
  335|    422|        if (m_value > std::numeric_limits<int>::max())
  ------------------
  |  Branch (335:13): [True: 0, False: 422]
  ------------------
  336|      0|            return std::numeric_limits<int>::max();
  337|    422|        else if (m_value < std::numeric_limits<int>::min())
  ------------------
  |  Branch (337:18): [True: 0, False: 422]
  ------------------
  338|      0|            return std::numeric_limits<int>::min();
  339|    422|        return m_value;
  340|    422|    }
_ZNK10CScriptNum8GetInt64Ev:
  342|  1.16k|    int64_t GetInt64() const { return m_value; }
_ZN10CScriptNum9serializeERKl:
  350|  8.83k|    {
  351|  8.83k|        if(value == 0)
  ------------------
  |  Branch (351:12): [True: 0, False: 8.83k]
  ------------------
  352|      0|            return std::vector<unsigned char>();
  353|       |
  354|  8.83k|        std::vector<unsigned char> result;
  355|  8.83k|        const bool neg = value < 0;
  356|  8.83k|        uint64_t absvalue = neg ? ~static_cast<uint64_t>(value) + 1 : static_cast<uint64_t>(value);
  ------------------
  |  Branch (356:29): [True: 0, False: 8.83k]
  ------------------
  357|       |
  358|  35.6k|        while(absvalue)
  ------------------
  |  Branch (358:15): [True: 26.8k, False: 8.83k]
  ------------------
  359|  26.8k|        {
  360|  26.8k|            result.push_back(absvalue & 0xff);
  361|  26.8k|            absvalue >>= 8;
  362|  26.8k|        }
  363|       |
  364|       |//    - If the most significant byte is >= 0x80 and the value is positive, push a
  365|       |//    new zero-byte to make the significant byte < 0x80 again.
  366|       |
  367|       |//    - If the most significant byte is >= 0x80 and the value is negative, push a
  368|       |//    new 0x80 byte that will be popped off when converting to an integral.
  369|       |
  370|       |//    - If the most significant byte is < 0x80 and the value is negative, add
  371|       |//    0x80 to it, since it will be subtracted and interpreted as a negative when
  372|       |//    converting to an integral.
  373|       |
  374|  8.83k|        if (result.back() & 0x80)
  ------------------
  |  Branch (374:13): [True: 690, False: 8.14k]
  ------------------
  375|    690|            result.push_back(neg ? 0x80 : 0);
  ------------------
  |  Branch (375:30): [True: 0, False: 690]
  ------------------
  376|  8.14k|        else if (neg)
  ------------------
  |  Branch (376:18): [True: 0, False: 8.14k]
  ------------------
  377|      0|            result.back() |= 0x80;
  378|       |
  379|  8.83k|        return result;
  380|  8.83k|    }
_ZN10CScriptNum7set_vchERKNSt3__16vectorIhNS0_9allocatorIhEEEE:
  384|  1.58k|    {
  385|  1.58k|      if (vch.empty())
  ------------------
  |  Branch (385:11): [True: 0, False: 1.58k]
  ------------------
  386|      0|          return 0;
  387|       |
  388|  1.58k|      int64_t result = 0;
  389|  3.98k|      for (size_t i = 0; i != vch.size(); ++i)
  ------------------
  |  Branch (389:26): [True: 2.39k, False: 1.58k]
  ------------------
  390|  2.39k|          result |= static_cast<int64_t>(vch[i]) << 8*i;
  391|       |
  392|       |      // If the input vector's most significant byte is 0x80, remove it from
  393|       |      // the result's msb and return a negative.
  394|  1.58k|      if (vch.back() & 0x80)
  ------------------
  |  Branch (394:11): [True: 129, False: 1.46k]
  ------------------
  395|    129|          return -((int64_t)(result & ~(0x80ULL << (8 * (vch.size() - 1)))));
  396|       |
  397|  1.46k|      return result;
  398|  1.58k|    }
_ZN7CScript14AppendDataSizeEj:
  418|   302k|    {
  419|   302k|        if (size < OP_PUSHDATA1) {
  ------------------
  |  Branch (419:13): [True: 302k, False: 0]
  ------------------
  420|   302k|            insert(end(), static_cast<value_type>(size));
  421|   302k|        } else if (size <= 0xff) {
  ------------------
  |  Branch (421:20): [True: 0, False: 0]
  ------------------
  422|      0|            insert(end(), OP_PUSHDATA1);
  423|      0|            insert(end(), static_cast<value_type>(size));
  424|      0|        } else if (size <= 0xffff) {
  ------------------
  |  Branch (424:20): [True: 0, False: 0]
  ------------------
  425|      0|            insert(end(), OP_PUSHDATA2);
  426|      0|            value_type data[2];
  427|      0|            WriteLE16(data, size);
  428|      0|            insert(end(), std::cbegin(data), std::cend(data));
  429|      0|        } else {
  430|      0|            insert(end(), OP_PUSHDATA4);
  431|      0|            value_type data[4];
  432|      0|            WriteLE32(data, size);
  433|      0|            insert(end(), std::cbegin(data), std::cend(data));
  434|      0|        }
  435|   302k|    }
_ZN7CScript10AppendDataENSt3__14spanIKhLm18446744073709551615EEE:
  438|   302k|    {
  439|   302k|        insert(end(), data.begin(), data.end());
  440|   302k|    }
_ZN7CScript10push_int64El:
  444|  36.6k|    {
  445|  36.6k|        if (n == -1 || (n >= 1 && n <= 16))
  ------------------
  |  Branch (445:13): [True: 0, False: 36.6k]
  |  Branch (445:25): [True: 36.6k, False: 0]
  |  Branch (445:35): [True: 27.8k, False: 8.83k]
  ------------------
  446|  27.8k|        {
  447|  27.8k|            push_back(n + (OP_1 - 1));
  448|  27.8k|        }
  449|  8.83k|        else if (n == 0)
  ------------------
  |  Branch (449:18): [True: 0, False: 8.83k]
  ------------------
  450|      0|        {
  451|      0|            push_back(OP_0);
  452|      0|        }
  453|  8.83k|        else
  454|  8.83k|        {
  455|  8.83k|            *this << CScriptNum::serialize(n);
  456|  8.83k|        }
  457|  36.6k|        return *this;
  458|  36.6k|    }
_ZN7CScriptlsEl:
  477|  36.6k|    CScript& operator<<(int64_t b) LIFETIMEBOUND { return push_int64(b); }
_ZN7CScriptlsE10opcodetype:
  480|   377k|    {
  481|   377k|        if (opcode < 0 || opcode > 0xff)
  ------------------
  |  Branch (481:13): [True: 0, False: 377k]
  |  Branch (481:27): [True: 0, False: 377k]
  ------------------
  482|      0|            throw std::runtime_error("CScript::operator<<(): invalid opcode");
  483|   377k|        insert(end(), (unsigned char)opcode);
  484|   377k|        return *this;
  485|   377k|    }
_ZN7CScriptlsENSt3__14spanIKSt4byteLm18446744073709551615EEE:
  494|   302k|    {
  495|   302k|        AppendDataSize(b.size());
  496|   302k|        AppendData({reinterpret_cast<const value_type*>(b.data()), b.size()});
  497|   302k|        return *this;
  498|   302k|    }
_ZN7CScriptlsENSt3__14spanIKhLm18446744073709551615EEE:
  502|   302k|    {
  503|   302k|        return *this << std::as_bytes(b);
  504|   302k|    }
_ZNK7CScript5GetOpERN9prevectorILj28EhjiE14const_iteratorER10opcodetypeRNSt3__16vectorIhNS6_9allocatorIhEEEE:
  507|  60.3k|    {
  508|  60.3k|        return GetScriptOp(pc, end(), opcodeRet, &vchRet);
  509|  60.3k|    }
_ZNK7CScript5GetOpERN9prevectorILj28EhjiE14const_iteratorER10opcodetype:
  512|  2.14M|    {
  513|  2.14M|        return GetScriptOp(pc, end(), opcodeRet, nullptr);
  514|  2.14M|    }
_ZN7CScript10DecodeOP_NE10opcodetype:
  518|  7.99k|    {
  519|  7.99k|        if (opcode == OP_0)
  ------------------
  |  Branch (519:13): [True: 787, False: 7.20k]
  ------------------
  520|    787|            return 0;
  521|  7.20k|        assert(opcode >= OP_1 && opcode <= OP_16);
  522|  7.20k|        return (int)opcode - (int)(OP_1 - 1);
  523|  7.20k|    }
_ZN7CScript10EncodeOP_NEi:
  525|     30|    {
  526|     30|        assert(n >= 0 && n <= 16);
  527|     30|        if (n == 0)
  ------------------
  |  Branch (527:13): [True: 0, False: 30]
  ------------------
  528|      0|            return OP_0;
  529|     30|        return (opcodetype)(OP_1+n-1);
  530|     30|    }
_ZN9CScriptIDC2ERK7uint160:
  606|  1.38k|    explicit CScriptID(const uint160& in) : BaseHash(in) {}
_ZN7CScriptC2Ev:
  461|   102k|    CScript() = default;
_Z12ToByteVectorI11XOnlyPubKeyENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   68|   272k|{
   69|   272k|    return std::vector<unsigned char>(in.begin(), in.end());
   70|   272k|}
_ZN7CScriptC2ITkNSt3__114input_iteratorENS1_11__wrap_iterIPKhEEEET_S6_:
  463|  3.52k|    CScript(InputIterator first, InputIterator last) : CScriptBase{first, last} { }
_Z11BuildScriptIJNSt3__16vectorIhNS0_9allocatorIhEEEEEE7CScriptDpOT_:
  617|    736|{
  618|    736|    CScript ret;
  619|    736|    int cnt{0};
  620|       |
  621|    736|    ([&ret, &cnt] (Ts&& input) {
  622|    736|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|    736|            if (cnt == 0) {
  625|    736|                ret = std::forward<Ts>(input);
  626|    736|            } else {
  627|    736|                ret.insert(ret.end(), input.begin(), input.end());
  628|    736|            }
  629|    736|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    736|            ret << input;
  632|    736|        }
  633|    736|        cnt++;
  634|    736|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|    736|    return ret;
  637|    736|}
_ZZ11BuildScriptIJNSt3__16vectorIhNS0_9allocatorIhEEEEEE7CScriptDpOT_ENKUlOS4_E_clES9_:
  621|    736|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|    736|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    736|            ret << input;
  632|    736|        }
  633|    736|        cnt++;
  634|    736|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeS0_NSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_:
  617|    984|{
  618|    984|    CScript ret;
  619|    984|    int cnt{0};
  620|       |
  621|    984|    ([&ret, &cnt] (Ts&& input) {
  622|    984|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|    984|            if (cnt == 0) {
  625|    984|                ret = std::forward<Ts>(input);
  626|    984|            } else {
  627|    984|                ret.insert(ret.end(), input.begin(), input.end());
  628|    984|            }
  629|    984|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    984|            ret << input;
  632|    984|        }
  633|    984|        cnt++;
  634|    984|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|    984|    return ret;
  637|    984|}
_ZZ11BuildScriptIJ10opcodetypeS0_NSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E1_clESA_:
  621|    984|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|    984|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    984|            ret << input;
  632|    984|        }
  633|    984|        cnt++;
  634|    984|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_NSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E0_clESA_:
  621|    984|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|    984|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    984|            ret << input;
  632|    984|        }
  633|    984|        cnt++;
  634|    984|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_NSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS5_E_clESA_:
  621|    984|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|    984|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    984|            ret << input;
  632|    984|        }
  633|    984|        cnt++;
  634|    984|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_NSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E_clESA_:
  621|    984|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|    984|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    984|            ret << input;
  632|    984|        }
  633|    984|        cnt++;
  634|    984|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJRKj10opcodetypeEE7CScriptDpOT_:
  617|    284|{
  618|    284|    CScript ret;
  619|    284|    int cnt{0};
  620|       |
  621|    284|    ([&ret, &cnt] (Ts&& input) {
  622|    284|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|    284|            if (cnt == 0) {
  625|    284|                ret = std::forward<Ts>(input);
  626|    284|            } else {
  627|    284|                ret.insert(ret.end(), input.begin(), input.end());
  628|    284|            }
  629|    284|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    284|            ret << input;
  632|    284|        }
  633|    284|        cnt++;
  634|    284|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|    284|    return ret;
  637|    284|}
_ZZ11BuildScriptIJRKj10opcodetypeEE7CScriptDpOT_ENKUlS1_E_clES1_:
  621|    284|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|    284|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    284|            ret << input;
  632|    284|        }
  633|    284|        cnt++;
  634|    284|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJRKj10opcodetypeEE7CScriptDpOT_ENKUlOS2_E_clES7_:
  621|    284|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|    284|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    284|            ret << input;
  632|    284|        }
  633|    284|        cnt++;
  634|    284|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeiS0_S0_RKNSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_:
  617|     74|{
  618|     74|    CScript ret;
  619|     74|    int cnt{0};
  620|       |
  621|     74|    ([&ret, &cnt] (Ts&& input) {
  622|     74|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|     74|            if (cnt == 0) {
  625|     74|                ret = std::forward<Ts>(input);
  626|     74|            } else {
  627|     74|                ret.insert(ret.end(), input.begin(), input.end());
  628|     74|            }
  629|     74|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     74|            ret << input;
  632|     74|        }
  633|     74|        cnt++;
  634|     74|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|     74|    return ret;
  637|     74|}
_ZZ11BuildScriptIJ10opcodetypeiS0_S0_RKNSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E2_clESC_:
  621|     74|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|     74|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     74|            ret << input;
  632|     74|        }
  633|     74|        cnt++;
  634|     74|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeiS0_S0_RKNSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOiE_clESC_:
  621|     74|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|     74|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     74|            ret << input;
  632|     74|        }
  633|     74|        cnt++;
  634|     74|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeiS0_S0_RKNSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E1_clESC_:
  621|     74|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|     74|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     74|            ret << input;
  632|     74|        }
  633|     74|        cnt++;
  634|     74|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeiS0_S0_RKNSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E0_clESC_:
  621|     74|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|     74|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     74|            ret << input;
  632|     74|        }
  633|     74|        cnt++;
  634|     74|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeiS0_S0_RKNSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlS7_E_clES7_:
  621|     74|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|     74|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     74|            ret << input;
  632|     74|        }
  633|     74|        cnt++;
  634|     74|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeiS0_S0_RKNSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E_clESC_:
  621|     74|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|     74|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     74|            ret << input;
  632|     74|        }
  633|     74|        cnt++;
  634|     74|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeR7CScriptS0_EES1_DpOT_:
  617|     14|{
  618|     14|    CScript ret;
  619|     14|    int cnt{0};
  620|       |
  621|     14|    ([&ret, &cnt] (Ts&& input) {
  622|     14|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|     14|            if (cnt == 0) {
  625|     14|                ret = std::forward<Ts>(input);
  626|     14|            } else {
  627|     14|                ret.insert(ret.end(), input.begin(), input.end());
  628|     14|            }
  629|     14|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     14|            ret << input;
  632|     14|        }
  633|     14|        cnt++;
  634|     14|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|     14|    return ret;
  637|     14|}
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_EES1_DpOT_ENKUlOS0_E0_clES6_:
  621|     14|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|     14|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     14|            ret << input;
  632|     14|        }
  633|     14|        cnt++;
  634|     14|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_EES1_DpOT_ENKUlS2_E_clES2_:
  621|     14|    ([&ret, &cnt] (Ts&& input) {
  622|     14|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|     14|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 0, False: 14]
  ------------------
  625|      0|                ret = std::forward<Ts>(input);
  626|     14|            } else {
  627|     14|                ret.insert(ret.end(), input.begin(), input.end());
  628|     14|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|     14|        cnt++;
  634|     14|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_EES1_DpOT_ENKUlOS0_E_clES6_:
  621|     14|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|     14|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     14|            ret << input;
  632|     14|        }
  633|     14|        cnt++;
  634|     14|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeR7CScriptEES1_DpOT_:
  617|     20|{
  618|     20|    CScript ret;
  619|     20|    int cnt{0};
  620|       |
  621|     20|    ([&ret, &cnt] (Ts&& input) {
  622|     20|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|     20|            if (cnt == 0) {
  625|     20|                ret = std::forward<Ts>(input);
  626|     20|            } else {
  627|     20|                ret.insert(ret.end(), input.begin(), input.end());
  628|     20|            }
  629|     20|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     20|            ret << input;
  632|     20|        }
  633|     20|        cnt++;
  634|     20|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|     20|    return ret;
  637|     20|}
_ZZ11BuildScriptIJ10opcodetypeR7CScriptEES1_DpOT_ENKUlOS0_E_clES6_:
  621|     20|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|     20|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     20|            ret << input;
  632|     20|        }
  633|     20|        cnt++;
  634|     20|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptEES1_DpOT_ENKUlS2_E_clES2_:
  621|     20|    ([&ret, &cnt] (Ts&& input) {
  622|     20|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|     20|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 0, False: 20]
  ------------------
  625|      0|                ret = std::forward<Ts>(input);
  626|     20|            } else {
  627|     20|                ret.insert(ret.end(), input.begin(), input.end());
  628|     20|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|     20|        cnt++;
  634|     20|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScript10opcodetypeEES0_DpOT_:
  617|  8.90k|{
  618|  8.90k|    CScript ret;
  619|  8.90k|    int cnt{0};
  620|       |
  621|  8.90k|    ([&ret, &cnt] (Ts&& input) {
  622|  8.90k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|  8.90k|            if (cnt == 0) {
  625|  8.90k|                ret = std::forward<Ts>(input);
  626|  8.90k|            } else {
  627|  8.90k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  8.90k|            }
  629|  8.90k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  8.90k|            ret << input;
  632|  8.90k|        }
  633|  8.90k|        cnt++;
  634|  8.90k|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|  8.90k|    return ret;
  637|  8.90k|}
_ZZ11BuildScriptIJ7CScript10opcodetypeEES0_DpOT_ENKUlOS0_E_clES5_:
  621|  8.90k|    ([&ret, &cnt] (Ts&& input) {
  622|  8.90k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|  8.90k|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 8.90k, False: 0]
  ------------------
  625|  8.90k|                ret = std::forward<Ts>(input);
  626|  8.90k|            } else {
  627|      0|                ret.insert(ret.end(), input.begin(), input.end());
  628|      0|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|  8.90k|        cnt++;
  634|  8.90k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeEES0_DpOT_ENKUlOS1_E_clES5_:
  621|  8.90k|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|  8.90k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  8.90k|            ret << input;
  632|  8.90k|        }
  633|  8.90k|        cnt++;
  634|  8.90k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeS0_R7CScriptS0_EES1_DpOT_:
  617|     58|{
  618|     58|    CScript ret;
  619|     58|    int cnt{0};
  620|       |
  621|     58|    ([&ret, &cnt] (Ts&& input) {
  622|     58|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|     58|            if (cnt == 0) {
  625|     58|                ret = std::forward<Ts>(input);
  626|     58|            } else {
  627|     58|                ret.insert(ret.end(), input.begin(), input.end());
  628|     58|            }
  629|     58|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     58|            ret << input;
  632|     58|        }
  633|     58|        cnt++;
  634|     58|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|     58|    return ret;
  637|     58|}
_ZZ11BuildScriptIJ10opcodetypeS0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E1_clES6_:
  621|     58|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|     58|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     58|            ret << input;
  632|     58|        }
  633|     58|        cnt++;
  634|     58|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E0_clES6_:
  621|     58|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|     58|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     58|            ret << input;
  632|     58|        }
  633|     58|        cnt++;
  634|     58|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_R7CScriptS0_EES1_DpOT_ENKUlS2_E_clES2_:
  621|     58|    ([&ret, &cnt] (Ts&& input) {
  622|     58|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|     58|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 0, False: 58]
  ------------------
  625|      0|                ret = std::forward<Ts>(input);
  626|     58|            } else {
  627|     58|                ret.insert(ret.end(), input.begin(), input.end());
  628|     58|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|     58|        cnt++;
  634|     58|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E_clES6_:
  621|     58|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|     58|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     58|            ret << input;
  632|     58|        }
  633|     58|        cnt++;
  634|     58|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_:
  617|  1.46k|{
  618|  1.46k|    CScript ret;
  619|  1.46k|    int cnt{0};
  620|       |
  621|  1.46k|    ([&ret, &cnt] (Ts&& input) {
  622|  1.46k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|  1.46k|            if (cnt == 0) {
  625|  1.46k|                ret = std::forward<Ts>(input);
  626|  1.46k|            } else {
  627|  1.46k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  1.46k|            }
  629|  1.46k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  1.46k|            ret << input;
  632|  1.46k|        }
  633|  1.46k|        cnt++;
  634|  1.46k|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|  1.46k|    return ret;
  637|  1.46k|}
_ZZ11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E2_clES6_:
  621|  1.46k|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|  1.46k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  1.46k|            ret << input;
  632|  1.46k|        }
  633|  1.46k|        cnt++;
  634|  1.46k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E1_clES6_:
  621|  1.46k|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|  1.46k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  1.46k|            ret << input;
  632|  1.46k|        }
  633|  1.46k|        cnt++;
  634|  1.46k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E0_clES6_:
  621|  1.46k|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|  1.46k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  1.46k|            ret << input;
  632|  1.46k|        }
  633|  1.46k|        cnt++;
  634|  1.46k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_ENKUlS2_E_clES2_:
  621|  1.46k|    ([&ret, &cnt] (Ts&& input) {
  622|  1.46k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|  1.46k|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 0, False: 1.46k]
  ------------------
  625|      0|                ret = std::forward<Ts>(input);
  626|  1.46k|            } else {
  627|  1.46k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  1.46k|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|  1.46k|        cnt++;
  634|  1.46k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E_clES6_:
  621|  1.46k|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|  1.46k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  1.46k|            ret << input;
  632|  1.46k|        }
  633|  1.46k|        cnt++;
  634|  1.46k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeEE7CScriptDpOT_:
  617|  19.9k|{
  618|  19.9k|    CScript ret;
  619|  19.9k|    int cnt{0};
  620|       |
  621|  19.9k|    ([&ret, &cnt] (Ts&& input) {
  622|  19.9k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|  19.9k|            if (cnt == 0) {
  625|  19.9k|                ret = std::forward<Ts>(input);
  626|  19.9k|            } else {
  627|  19.9k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  19.9k|            }
  629|  19.9k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  19.9k|            ret << input;
  632|  19.9k|        }
  633|  19.9k|        cnt++;
  634|  19.9k|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|  19.9k|    return ret;
  637|  19.9k|}
_ZZ11BuildScriptIJ10opcodetypeEE7CScriptDpOT_ENKUlOS0_E_clES5_:
  621|  19.9k|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|  19.9k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  19.9k|            ret << input;
  632|  19.9k|        }
  633|  19.9k|        cnt++;
  634|  19.9k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptRS0_EES0_DpOT_:
  617|  2.71k|{
  618|  2.71k|    CScript ret;
  619|  2.71k|    int cnt{0};
  620|       |
  621|  2.71k|    ([&ret, &cnt] (Ts&& input) {
  622|  2.71k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|  2.71k|            if (cnt == 0) {
  625|  2.71k|                ret = std::forward<Ts>(input);
  626|  2.71k|            } else {
  627|  2.71k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  2.71k|            }
  629|  2.71k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  2.71k|            ret << input;
  632|  2.71k|        }
  633|  2.71k|        cnt++;
  634|  2.71k|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|  2.71k|    return ret;
  637|  2.71k|}
_ZZ11BuildScriptIJ7CScriptRS0_EES0_DpOT_ENKUlOS0_E_clES5_:
  621|  2.71k|    ([&ret, &cnt] (Ts&& input) {
  622|  2.71k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|  2.71k|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 2.71k, False: 0]
  ------------------
  625|  2.71k|                ret = std::forward<Ts>(input);
  626|  2.71k|            } else {
  627|      0|                ret.insert(ret.end(), input.begin(), input.end());
  628|      0|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|  2.71k|        cnt++;
  634|  2.71k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptRS0_EES0_DpOT_ENKUlS1_E_clES1_:
  621|  2.71k|    ([&ret, &cnt] (Ts&& input) {
  622|  2.71k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|  2.71k|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 0, False: 2.71k]
  ------------------
  625|      0|                ret = std::forward<Ts>(input);
  626|  2.71k|            } else {
  627|  2.71k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  2.71k|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|  2.71k|        cnt++;
  634|  2.71k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptRS0_10opcodetypeEES0_DpOT_:
  617|     34|{
  618|     34|    CScript ret;
  619|     34|    int cnt{0};
  620|       |
  621|     34|    ([&ret, &cnt] (Ts&& input) {
  622|     34|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|     34|            if (cnt == 0) {
  625|     34|                ret = std::forward<Ts>(input);
  626|     34|            } else {
  627|     34|                ret.insert(ret.end(), input.begin(), input.end());
  628|     34|            }
  629|     34|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     34|            ret << input;
  632|     34|        }
  633|     34|        cnt++;
  634|     34|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|     34|    return ret;
  637|     34|}
_ZZ11BuildScriptIJ7CScriptRS0_10opcodetypeEES0_DpOT_ENKUlOS0_E_clES6_:
  621|     34|    ([&ret, &cnt] (Ts&& input) {
  622|     34|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|     34|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 34, False: 0]
  ------------------
  625|     34|                ret = std::forward<Ts>(input);
  626|     34|            } else {
  627|      0|                ret.insert(ret.end(), input.begin(), input.end());
  628|      0|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|     34|        cnt++;
  634|     34|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptRS0_10opcodetypeEES0_DpOT_ENKUlS1_E_clES1_:
  621|     34|    ([&ret, &cnt] (Ts&& input) {
  622|     34|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|     34|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 0, False: 34]
  ------------------
  625|      0|                ret = std::forward<Ts>(input);
  626|     34|            } else {
  627|     34|                ret.insert(ret.end(), input.begin(), input.end());
  628|     34|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|     34|        cnt++;
  634|     34|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptRS0_10opcodetypeEES0_DpOT_ENKUlOS2_E_clES6_:
  621|     34|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|     34|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     34|            ret << input;
  632|     34|        }
  633|     34|        cnt++;
  634|     34|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScript10opcodetypeRS0_S1_EES0_DpOT_:
  617|    142|{
  618|    142|    CScript ret;
  619|    142|    int cnt{0};
  620|       |
  621|    142|    ([&ret, &cnt] (Ts&& input) {
  622|    142|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|    142|            if (cnt == 0) {
  625|    142|                ret = std::forward<Ts>(input);
  626|    142|            } else {
  627|    142|                ret.insert(ret.end(), input.begin(), input.end());
  628|    142|            }
  629|    142|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    142|            ret << input;
  632|    142|        }
  633|    142|        cnt++;
  634|    142|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|    142|    return ret;
  637|    142|}
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_EES0_DpOT_ENKUlOS0_E_clES6_:
  621|    142|    ([&ret, &cnt] (Ts&& input) {
  622|    142|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|    142|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 142, False: 0]
  ------------------
  625|    142|                ret = std::forward<Ts>(input);
  626|    142|            } else {
  627|      0|                ret.insert(ret.end(), input.begin(), input.end());
  628|      0|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|    142|        cnt++;
  634|    142|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_EES0_DpOT_ENKUlOS1_E0_clES6_:
  621|    142|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|    142|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    142|            ret << input;
  632|    142|        }
  633|    142|        cnt++;
  634|    142|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_EES0_DpOT_ENKUlS2_E_clES2_:
  621|    142|    ([&ret, &cnt] (Ts&& input) {
  622|    142|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|    142|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 0, False: 142]
  ------------------
  625|      0|                ret = std::forward<Ts>(input);
  626|    142|            } else {
  627|    142|                ret.insert(ret.end(), input.begin(), input.end());
  628|    142|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|    142|        cnt++;
  634|    142|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_EES0_DpOT_ENKUlOS1_E_clES6_:
  621|    142|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|    142|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    142|            ret << input;
  632|    142|        }
  633|    142|        cnt++;
  634|    142|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_:
  617|  17.2k|{
  618|  17.2k|    CScript ret;
  619|  17.2k|    int cnt{0};
  620|       |
  621|  17.2k|    ([&ret, &cnt] (Ts&& input) {
  622|  17.2k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|  17.2k|            if (cnt == 0) {
  625|  17.2k|                ret = std::forward<Ts>(input);
  626|  17.2k|            } else {
  627|  17.2k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  17.2k|            }
  629|  17.2k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  17.2k|            ret << input;
  632|  17.2k|        }
  633|  17.2k|        cnt++;
  634|  17.2k|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|  17.2k|    return ret;
  637|  17.2k|}
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_ENKUlOS0_E1_clES6_:
  621|  17.2k|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|  17.2k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  17.2k|            ret << input;
  632|  17.2k|        }
  633|  17.2k|        cnt++;
  634|  17.2k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_ENKUlS2_E0_clES2_:
  621|  17.2k|    ([&ret, &cnt] (Ts&& input) {
  622|  17.2k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|  17.2k|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 0, False: 17.2k]
  ------------------
  625|      0|                ret = std::forward<Ts>(input);
  626|  17.2k|            } else {
  627|  17.2k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  17.2k|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|  17.2k|        cnt++;
  634|  17.2k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_ENKUlOS0_E0_clES6_:
  621|  17.2k|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|  17.2k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  17.2k|            ret << input;
  632|  17.2k|        }
  633|  17.2k|        cnt++;
  634|  17.2k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_ENKUlS2_E_clES2_:
  621|  17.2k|    ([&ret, &cnt] (Ts&& input) {
  622|  17.2k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|  17.2k|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 0, False: 17.2k]
  ------------------
  625|      0|                ret = std::forward<Ts>(input);
  626|  17.2k|            } else {
  627|  17.2k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  17.2k|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|  17.2k|        cnt++;
  634|  17.2k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_ENKUlOS0_E_clES6_:
  621|  17.2k|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|  17.2k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  17.2k|            ret << input;
  632|  17.2k|        }
  633|  17.2k|        cnt++;
  634|  17.2k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScript10opcodetypeRS0_S1_S2_S1_EES0_DpOT_:
  617|    188|{
  618|    188|    CScript ret;
  619|    188|    int cnt{0};
  620|       |
  621|    188|    ([&ret, &cnt] (Ts&& input) {
  622|    188|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|    188|            if (cnt == 0) {
  625|    188|                ret = std::forward<Ts>(input);
  626|    188|            } else {
  627|    188|                ret.insert(ret.end(), input.begin(), input.end());
  628|    188|            }
  629|    188|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    188|            ret << input;
  632|    188|        }
  633|    188|        cnt++;
  634|    188|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|    188|    return ret;
  637|    188|}
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_S2_S1_EES0_DpOT_ENKUlOS0_E_clES6_:
  621|    188|    ([&ret, &cnt] (Ts&& input) {
  622|    188|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|    188|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 188, False: 0]
  ------------------
  625|    188|                ret = std::forward<Ts>(input);
  626|    188|            } else {
  627|      0|                ret.insert(ret.end(), input.begin(), input.end());
  628|      0|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|    188|        cnt++;
  634|    188|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_S2_S1_EES0_DpOT_ENKUlOS1_E1_clES6_:
  621|    188|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|    188|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    188|            ret << input;
  632|    188|        }
  633|    188|        cnt++;
  634|    188|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_S2_S1_EES0_DpOT_ENKUlS2_E0_clES2_:
  621|    188|    ([&ret, &cnt] (Ts&& input) {
  622|    188|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|    188|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 0, False: 188]
  ------------------
  625|      0|                ret = std::forward<Ts>(input);
  626|    188|            } else {
  627|    188|                ret.insert(ret.end(), input.begin(), input.end());
  628|    188|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|    188|        cnt++;
  634|    188|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_S2_S1_EES0_DpOT_ENKUlOS1_E0_clES6_:
  621|    188|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|    188|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    188|            ret << input;
  632|    188|        }
  633|    188|        cnt++;
  634|    188|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_S2_S1_EES0_DpOT_ENKUlS2_E_clES2_:
  621|    188|    ([&ret, &cnt] (Ts&& input) {
  622|    188|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|    188|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 0, False: 188]
  ------------------
  625|      0|                ret = std::forward<Ts>(input);
  626|    188|            } else {
  627|    188|                ret.insert(ret.end(), input.begin(), input.end());
  628|    188|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|    188|        cnt++;
  634|    188|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeRS0_S1_S2_S1_EES0_DpOT_ENKUlOS1_E_clES6_:
  621|    188|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|    188|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    188|            ret << input;
  632|    188|        }
  633|    188|        cnt++;
  634|    188|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJRKjEE7CScriptDpOT_:
  617|    794|{
  618|    794|    CScript ret;
  619|    794|    int cnt{0};
  620|       |
  621|    794|    ([&ret, &cnt] (Ts&& input) {
  622|    794|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|    794|            if (cnt == 0) {
  625|    794|                ret = std::forward<Ts>(input);
  626|    794|            } else {
  627|    794|                ret.insert(ret.end(), input.begin(), input.end());
  628|    794|            }
  629|    794|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    794|            ret << input;
  632|    794|        }
  633|    794|        cnt++;
  634|    794|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|    794|    return ret;
  637|    794|}
_ZZ11BuildScriptIJRKjEE7CScriptDpOT_ENKUlS1_E_clES1_:
  621|    794|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|    794|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    794|            ret << input;
  632|    794|        }
  633|    794|        cnt++;
  634|    794|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEEEES0_DpOT_:
  617|  2.50k|{
  618|  2.50k|    CScript ret;
  619|  2.50k|    int cnt{0};
  620|       |
  621|  2.50k|    ([&ret, &cnt] (Ts&& input) {
  622|  2.50k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|  2.50k|            if (cnt == 0) {
  625|  2.50k|                ret = std::forward<Ts>(input);
  626|  2.50k|            } else {
  627|  2.50k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  2.50k|            }
  629|  2.50k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  2.50k|            ret << input;
  632|  2.50k|        }
  633|  2.50k|        cnt++;
  634|  2.50k|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|  2.50k|    return ret;
  637|  2.50k|}
_ZZ11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEEEES0_DpOT_ENKUlOS0_E_clES9_:
  621|  2.50k|    ([&ret, &cnt] (Ts&& input) {
  622|  2.50k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|  2.50k|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 2.50k, False: 0]
  ------------------
  625|  2.50k|                ret = std::forward<Ts>(input);
  626|  2.50k|            } else {
  627|      0|                ret.insert(ret.end(), input.begin(), input.end());
  628|      0|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|  2.50k|        cnt++;
  634|  2.50k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEEEES0_DpOT_ENKUlOS5_E_clES9_:
  621|  2.50k|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|  2.50k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  2.50k|            ret << input;
  632|  2.50k|        }
  633|  2.50k|        cnt++;
  634|  2.50k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptm10opcodetypeEES0_DpOT_:
  617|    794|{
  618|    794|    CScript ret;
  619|    794|    int cnt{0};
  620|       |
  621|    794|    ([&ret, &cnt] (Ts&& input) {
  622|    794|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|    794|            if (cnt == 0) {
  625|    794|                ret = std::forward<Ts>(input);
  626|    794|            } else {
  627|    794|                ret.insert(ret.end(), input.begin(), input.end());
  628|    794|            }
  629|    794|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    794|            ret << input;
  632|    794|        }
  633|    794|        cnt++;
  634|    794|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|    794|    return ret;
  637|    794|}
_ZZ11BuildScriptIJ7CScriptm10opcodetypeEES0_DpOT_ENKUlOS0_E_clES5_:
  621|    794|    ([&ret, &cnt] (Ts&& input) {
  622|    794|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|    794|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 794, False: 0]
  ------------------
  625|    794|                ret = std::forward<Ts>(input);
  626|    794|            } else {
  627|      0|                ret.insert(ret.end(), input.begin(), input.end());
  628|      0|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|    794|        cnt++;
  634|    794|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptm10opcodetypeEES0_DpOT_ENKUlOmE_clES5_:
  621|    794|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|    794|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    794|            ret << input;
  632|    794|        }
  633|    794|        cnt++;
  634|    794|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptm10opcodetypeEES0_DpOT_ENKUlOS1_E_clES5_:
  621|    794|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|    794|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    794|            ret << input;
  632|    794|        }
  633|    794|        cnt++;
  634|    794|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJNSt3__16vectorIhNS0_9allocatorIhEEEE10opcodetypeEE7CScriptDpOT_:
  617|    342|{
  618|    342|    CScript ret;
  619|    342|    int cnt{0};
  620|       |
  621|    342|    ([&ret, &cnt] (Ts&& input) {
  622|    342|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|    342|            if (cnt == 0) {
  625|    342|                ret = std::forward<Ts>(input);
  626|    342|            } else {
  627|    342|                ret.insert(ret.end(), input.begin(), input.end());
  628|    342|            }
  629|    342|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    342|            ret << input;
  632|    342|        }
  633|    342|        cnt++;
  634|    342|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|    342|    return ret;
  637|    342|}
_ZZ11BuildScriptIJNSt3__16vectorIhNS0_9allocatorIhEEEE10opcodetypeEE7CScriptDpOT_ENKUlOS4_E_clESA_:
  621|    342|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|    342|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    342|            ret << input;
  632|    342|        }
  633|    342|        cnt++;
  634|    342|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJNSt3__16vectorIhNS0_9allocatorIhEEEE10opcodetypeEE7CScriptDpOT_ENKUlOS5_E_clESA_:
  621|    342|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|    342|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    342|            ret << input;
  632|    342|        }
  633|    342|        cnt++;
  634|    342|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEE10opcodetypeEES0_DpOT_:
  617|    906|{
  618|    906|    CScript ret;
  619|    906|    int cnt{0};
  620|       |
  621|    906|    ([&ret, &cnt] (Ts&& input) {
  622|    906|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|    906|            if (cnt == 0) {
  625|    906|                ret = std::forward<Ts>(input);
  626|    906|            } else {
  627|    906|                ret.insert(ret.end(), input.begin(), input.end());
  628|    906|            }
  629|    906|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    906|            ret << input;
  632|    906|        }
  633|    906|        cnt++;
  634|    906|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|    906|    return ret;
  637|    906|}
_ZZ11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEE10opcodetypeEES0_DpOT_ENKUlOS0_E_clESA_:
  621|    906|    ([&ret, &cnt] (Ts&& input) {
  622|    906|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|    906|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 906, False: 0]
  ------------------
  625|    906|                ret = std::forward<Ts>(input);
  626|    906|            } else {
  627|      0|                ret.insert(ret.end(), input.begin(), input.end());
  628|      0|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|    906|        cnt++;
  634|    906|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEE10opcodetypeEES0_DpOT_ENKUlOS5_E_clESA_:
  621|    906|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|    906|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    906|            ret << input;
  632|    906|        }
  633|    906|        cnt++;
  634|    906|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEE10opcodetypeEES0_DpOT_ENKUlOS6_E_clESA_:
  621|    906|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|    906|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    906|            ret << input;
  632|    906|        }
  633|    906|        cnt++;
  634|    906|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptRKj10opcodetypeEES0_DpOT_:
  617|    388|{
  618|    388|    CScript ret;
  619|    388|    int cnt{0};
  620|       |
  621|    388|    ([&ret, &cnt] (Ts&& input) {
  622|    388|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|    388|            if (cnt == 0) {
  625|    388|                ret = std::forward<Ts>(input);
  626|    388|            } else {
  627|    388|                ret.insert(ret.end(), input.begin(), input.end());
  628|    388|            }
  629|    388|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    388|            ret << input;
  632|    388|        }
  633|    388|        cnt++;
  634|    388|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|    388|    return ret;
  637|    388|}
_ZZ11BuildScriptIJ7CScriptRKj10opcodetypeEES0_DpOT_ENKUlOS0_E_clES7_:
  621|    388|    ([&ret, &cnt] (Ts&& input) {
  622|    388|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|    388|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 388, False: 0]
  ------------------
  625|    388|                ret = std::forward<Ts>(input);
  626|    388|            } else {
  627|      0|                ret.insert(ret.end(), input.begin(), input.end());
  628|      0|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|    388|        cnt++;
  634|    388|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptRKj10opcodetypeEES0_DpOT_ENKUlS2_E_clES2_:
  621|    388|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|    388|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    388|            ret << input;
  632|    388|        }
  633|    388|        cnt++;
  634|    388|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptRKj10opcodetypeEES0_DpOT_ENKUlOS3_E_clES7_:
  621|    388|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|    388|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    388|            ret << input;
  632|    388|        }
  633|    388|        cnt++;
  634|    388|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJRKlEE7CScriptDpOT_:
  617|    311|{
  618|    311|    CScript ret;
  619|    311|    int cnt{0};
  620|       |
  621|    311|    ([&ret, &cnt] (Ts&& input) {
  622|    311|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|    311|            if (cnt == 0) {
  625|    311|                ret = std::forward<Ts>(input);
  626|    311|            } else {
  627|    311|                ret.insert(ret.end(), input.begin(), input.end());
  628|    311|            }
  629|    311|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    311|            ret << input;
  632|    311|        }
  633|    311|        cnt++;
  634|    311|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|    311|    return ret;
  637|    311|}
_ZZ11BuildScriptIJRKlEE7CScriptDpOT_ENKUlS1_E_clES1_:
  621|    311|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|    311|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    311|            ret << input;
  632|    311|        }
  633|    311|        cnt++;
  634|    311|    } (std::forward<Ts>(inputs)), ...);
_ZN7CScriptC2ITkNSt3__114input_iteratorENS1_11__wrap_iterIPhEEEET_S5_:
  463|    513|    CScript(InputIterator first, InputIterator last) : CScriptBase{first, last} { }
_Z12ToByteVectorI7CPubKeyENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   68|  9.75k|{
   69|  9.75k|    return std::vector<unsigned char>(in.begin(), in.end());
   70|  9.75k|}
_Z12ToByteVectorI6PKHashENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   68|     20|{
   69|     20|    return std::vector<unsigned char>(in.begin(), in.end());
   70|     20|}
_Z12ToByteVectorI10ScriptHashENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   68|  1.22k|{
   69|  1.22k|    return std::vector<unsigned char>(in.begin(), in.end());
   70|  1.22k|}
_Z12ToByteVectorI19WitnessV0ScriptHashENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   68|  1.53k|{
   69|  1.53k|    return std::vector<unsigned char>(in.begin(), in.end());
   70|  1.53k|}
_Z12ToByteVectorI16WitnessV0KeyHashENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   68|     13|{
   69|     13|    return std::vector<unsigned char>(in.begin(), in.end());
   70|     13|}
_Z12ToByteVectorI16WitnessV1TaprootENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   68|  2.83k|{
   69|  2.83k|    return std::vector<unsigned char>(in.begin(), in.end());
   70|  2.83k|}
_Z11BuildScriptIJRKmEE7CScriptDpOT_:
  617|  1.52k|{
  618|  1.52k|    CScript ret;
  619|  1.52k|    int cnt{0};
  620|       |
  621|  1.52k|    ([&ret, &cnt] (Ts&& input) {
  622|  1.52k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|  1.52k|            if (cnt == 0) {
  625|  1.52k|                ret = std::forward<Ts>(input);
  626|  1.52k|            } else {
  627|  1.52k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  1.52k|            }
  629|  1.52k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  1.52k|            ret << input;
  632|  1.52k|        }
  633|  1.52k|        cnt++;
  634|  1.52k|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|  1.52k|    return ret;
  637|  1.52k|}
_ZZ11BuildScriptIJRKmEE7CScriptDpOT_ENKUlS1_E_clES1_:
  621|  1.52k|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|  1.52k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  1.52k|            ret << input;
  632|  1.52k|        }
  633|  1.52k|        cnt++;
  634|  1.52k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJRKiEE7CScriptDpOT_:
  617|  1.52k|{
  618|  1.52k|    CScript ret;
  619|  1.52k|    int cnt{0};
  620|       |
  621|  1.52k|    ([&ret, &cnt] (Ts&& input) {
  622|  1.52k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|  1.52k|            if (cnt == 0) {
  625|  1.52k|                ret = std::forward<Ts>(input);
  626|  1.52k|            } else {
  627|  1.52k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  1.52k|            }
  629|  1.52k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  1.52k|            ret << input;
  632|  1.52k|        }
  633|  1.52k|        cnt++;
  634|  1.52k|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|  1.52k|    return ret;
  637|  1.52k|}
_ZZ11BuildScriptIJRKiEE7CScriptDpOT_ENKUlS1_E_clES1_:
  621|  1.52k|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|  1.52k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  1.52k|            ret << input;
  632|  1.52k|        }
  633|  1.52k|        cnt++;
  634|  1.52k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJRjEE7CScriptDpOT_:
  617|  22.4k|{
  618|  22.4k|    CScript ret;
  619|  22.4k|    int cnt{0};
  620|       |
  621|  22.4k|    ([&ret, &cnt] (Ts&& input) {
  622|  22.4k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|  22.4k|            if (cnt == 0) {
  625|  22.4k|                ret = std::forward<Ts>(input);
  626|  22.4k|            } else {
  627|  22.4k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  22.4k|            }
  629|  22.4k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  22.4k|            ret << input;
  632|  22.4k|        }
  633|  22.4k|        cnt++;
  634|  22.4k|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|  22.4k|    return ret;
  637|  22.4k|}
_ZZ11BuildScriptIJRjEE7CScriptDpOT_ENKUlS0_E_clES0_:
  621|  22.4k|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|  22.4k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  22.4k|            ret << input;
  632|  22.4k|        }
  633|  22.4k|        cnt++;
  634|  22.4k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJRmEE7CScriptDpOT_:
  617|  1.82k|{
  618|  1.82k|    CScript ret;
  619|  1.82k|    int cnt{0};
  620|       |
  621|  1.82k|    ([&ret, &cnt] (Ts&& input) {
  622|  1.82k|        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|  1.82k|            if (cnt == 0) {
  625|  1.82k|                ret = std::forward<Ts>(input);
  626|  1.82k|            } else {
  627|  1.82k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  1.82k|            }
  629|  1.82k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  1.82k|            ret << input;
  632|  1.82k|        }
  633|  1.82k|        cnt++;
  634|  1.82k|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|  1.82k|    return ret;
  637|  1.82k|}
_ZZ11BuildScriptIJRmEE7CScriptDpOT_ENKUlS0_E_clES0_:
  621|  1.82k|    ([&ret, &cnt] (Ts&& input) {
  622|       |        if constexpr (std::is_same_v<std::remove_cv_t<std::remove_reference_t<Ts>>, CScript>) {
  623|       |            // If it is a CScript, extend ret with it. Move or copy the first element instead.
  624|       |            if (cnt == 0) {
  625|       |                ret = std::forward<Ts>(input);
  626|       |            } else {
  627|       |                ret.insert(ret.end(), input.begin(), input.end());
  628|       |            }
  629|  1.82k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  1.82k|            ret << input;
  632|  1.82k|        }
  633|  1.82k|        cnt++;
  634|  1.82k|    } (std::forward<Ts>(inputs)), ...);

_ZNK19FlatSigningProvider10GetCScriptERK9CScriptIDR7CScript:
   56|  1.38k|bool FlatSigningProvider::GetCScript(const CScriptID& scriptid, CScript& script) const { return LookupHelper(scripts, scriptid, script); }
_ZNK19FlatSigningProvider9GetPubKeyERK6CKeyIDR7CPubKey:
   57|    505|bool FlatSigningProvider::GetPubKey(const CKeyID& keyid, CPubKey& pubkey) const { return LookupHelper(pubkeys, keyid, pubkey); }
_ZNK19FlatSigningProvider12GetKeyOriginERK6CKeyIDR13KeyOriginInfo:
   59|   217k|{
   60|   217k|    std::pair<CPubKey, KeyOriginInfo> out;
   61|   217k|    bool ret = LookupHelper(origins, keyid, out);
   62|   217k|    if (ret) info = std::move(out.second);
  ------------------
  |  Branch (62:9): [True: 145k, False: 71.8k]
  ------------------
   63|   217k|    return ret;
   64|   217k|}
_ZNK19FlatSigningProvider6GetKeyERK6CKeyIDR4CKey:
   70|   262k|bool FlatSigningProvider::GetKey(const CKeyID& keyid, CKey& key) const { return LookupHelper(keys, keyid, key); }
_ZNK19FlatSigningProvider19GetTaprootSpendDataERK11XOnlyPubKeyR16TaprootSpendData:
   72|  1.41k|{
   73|  1.41k|    TaprootBuilder builder;
   74|  1.41k|    if (LookupHelper(tr_trees, output_key, builder)) {
  ------------------
  |  Branch (74:9): [True: 1.41k, False: 5]
  ------------------
   75|  1.41k|        spenddata = builder.GetSpendData();
   76|  1.41k|        return true;
   77|  1.41k|    }
   78|      5|    return false;
   79|  1.41k|}
_ZN19FlatSigningProvider5MergeEOS_:
   86|  17.0k|{
   87|  17.0k|    scripts.merge(b.scripts);
   88|  17.0k|    pubkeys.merge(b.pubkeys);
   89|  17.0k|    keys.merge(b.keys);
   90|  17.0k|    origins.merge(b.origins);
   91|  17.0k|    tr_trees.merge(b.tr_trees);
   92|  17.0k|    return *this;
   93|  17.0k|}
_ZN14TaprootBuilder7CombineEONS_8NodeInfoES1_:
  291|  5.08k|{
  292|  5.08k|    NodeInfo ret;
  293|       |    /* Iterate over all tracked leaves in a, add b's hash to their Merkle branch, and move them to ret. */
  294|  47.0k|    for (auto& leaf : a.leaves) {
  ------------------
  |  Branch (294:21): [True: 47.0k, False: 5.08k]
  ------------------
  295|  47.0k|        leaf.merkle_branch.push_back(b.hash);
  296|  47.0k|        ret.leaves.emplace_back(std::move(leaf));
  297|  47.0k|    }
  298|       |    /* Iterate over all tracked leaves in b, add a's hash to their Merkle branch, and move them to ret. */
  299|  7.90k|    for (auto& leaf : b.leaves) {
  ------------------
  |  Branch (299:21): [True: 7.90k, False: 5.08k]
  ------------------
  300|  7.90k|        leaf.merkle_branch.push_back(a.hash);
  301|  7.90k|        ret.leaves.emplace_back(std::move(leaf));
  302|  7.90k|    }
  303|  5.08k|    ret.hash = ComputeTapbranchHash(a.hash, b.hash);
  304|  5.08k|    return ret;
  305|  5.08k|}
_ZN14TaprootBuilder6InsertEONS_8NodeInfoEi:
  323|  7.10k|{
  324|  7.10k|    assert(depth >= 0 && (size_t)depth <= TAPROOT_CONTROL_MAX_NODE_COUNT);
  325|       |    /* We cannot insert a leaf at a lower depth while a deeper branch is unfinished. Doing
  326|       |     * so would mean the Add() invocations do not correspond to a DFS traversal of a
  327|       |     * binary tree. */
  328|  7.10k|    if ((size_t)depth + 1 < m_branch.size()) {
  ------------------
  |  Branch (328:9): [True: 0, False: 7.10k]
  ------------------
  329|      0|        m_valid = false;
  330|      0|        return;
  331|      0|    }
  332|       |    /* As long as an entry in the branch exists at the specified depth, combine it and propagate up.
  333|       |     * The 'node' variable is overwritten here with the newly combined node. */
  334|  12.1k|    while (m_valid && m_branch.size() > (size_t)depth && m_branch[depth].has_value()) {
  ------------------
  |  Branch (334:12): [True: 12.1k, False: 0]
  |  Branch (334:23): [True: 8.45k, False: 3.72k]
  |  Branch (334:58): [True: 5.08k, False: 3.37k]
  ------------------
  335|  5.08k|        node = Combine(std::move(node), std::move(*m_branch[depth]));
  336|  5.08k|        m_branch.pop_back();
  337|  5.08k|        if (depth == 0) m_valid = false; /* Can't propagate further up than the root */
  ------------------
  |  Branch (337:13): [True: 0, False: 5.08k]
  ------------------
  338|  5.08k|        --depth;
  339|  5.08k|    }
  340|  7.10k|    if (m_valid) {
  ------------------
  |  Branch (340:9): [True: 7.10k, False: 0]
  ------------------
  341|       |        /* Make sure the branch is big enough to place the new node. */
  342|  7.10k|        if (m_branch.size() <= (size_t)depth) m_branch.resize((size_t)depth + 1);
  ------------------
  |  Branch (342:13): [True: 3.72k, False: 3.37k]
  ------------------
  343|  7.10k|        assert(!m_branch[depth].has_value());
  344|  7.10k|        m_branch[depth] = std::move(node);
  345|  7.10k|    }
  346|  7.10k|}
_ZN14TaprootBuilder11ValidDepthsERKNSt3__16vectorIiNS0_9allocatorIiEEEE:
  349|  1.41k|{
  350|  1.41k|    std::vector<bool> branch;
  351|  3.56k|    for (int depth : depths) {
  ------------------
  |  Branch (351:20): [True: 3.56k, False: 1.41k]
  ------------------
  352|       |        // This inner loop corresponds to effectively the same logic on branch
  353|       |        // as what Insert() performs on the m_branch variable. Instead of
  354|       |        // storing a NodeInfo object, just remember whether or not there is one
  355|       |        // at that depth.
  356|  3.56k|        if (depth < 0 || (size_t)depth > TAPROOT_CONTROL_MAX_NODE_COUNT) return false;
  ------------------
  |  Branch (356:13): [True: 0, False: 3.56k]
  |  Branch (356:26): [True: 0, False: 3.56k]
  ------------------
  357|  3.56k|        if ((size_t)depth + 1 < branch.size()) return false;
  ------------------
  |  Branch (357:13): [True: 0, False: 3.56k]
  ------------------
  358|  6.10k|        while (branch.size() > (size_t)depth && branch[depth]) {
  ------------------
  |  Branch (358:16): [True: 4.23k, False: 1.87k]
  |  Branch (358:16): [True: 2.54k, False: 3.56k]
  |  Branch (358:49): [True: 2.54k, False: 1.69k]
  ------------------
  359|  2.54k|            branch.pop_back();
  360|  2.54k|            if (depth == 0) return false;
  ------------------
  |  Branch (360:17): [True: 0, False: 2.54k]
  ------------------
  361|  2.54k|            --depth;
  362|  2.54k|        }
  363|  3.56k|        if (branch.size() <= (size_t)depth) branch.resize((size_t)depth + 1);
  ------------------
  |  Branch (363:13): [True: 1.87k, False: 1.69k]
  ------------------
  364|  3.56k|        assert(!branch[depth]);
  365|  3.56k|        branch[depth] = true;
  366|  3.56k|    }
  367|       |    // And this check corresponds to the IsComplete() check on m_branch.
  368|  1.41k|    return branch.size() == 0 || (branch.size() == 1 && branch[0]);
  ------------------
  |  Branch (368:12): [True: 403, False: 1.01k]
  |  Branch (368:35): [True: 1.01k, False: 0]
  |  Branch (368:57): [True: 1.01k, False: 0]
  ------------------
  369|  1.41k|}
_ZN14TaprootBuilder3AddEi4SpanIKhEib:
  372|  7.10k|{
  373|  7.10k|    assert((leaf_version & ~TAPROOT_LEAF_MASK) == 0);
  374|  7.10k|    if (!IsValid()) return *this;
  ------------------
  |  Branch (374:9): [True: 0, False: 7.10k]
  ------------------
  375|       |    /* Construct NodeInfo object with leaf hash and (if track is true) also leaf information. */
  376|  7.10k|    NodeInfo node;
  377|  7.10k|    node.hash = ComputeTapleafHash(leaf_version, script);
  378|  7.10k|    if (track) node.leaves.emplace_back(LeafInfo{std::vector<unsigned char>(script.begin(), script.end()), leaf_version, {}});
  ------------------
  |  Branch (378:9): [True: 7.10k, False: 0]
  ------------------
  379|       |    /* Insert into the branch. */
  380|  7.10k|    Insert(std::move(node), depth);
  381|  7.10k|    return *this;
  382|  7.10k|}
_ZN14TaprootBuilder8FinalizeERK11XOnlyPubKey:
  395|  2.82k|{
  396|       |    /* Can only call this function when IsComplete() is true. */
  397|  2.82k|    assert(IsComplete());
  398|  2.82k|    m_internal_key = internal_key;
  399|  2.82k|    auto ret = m_internal_key.CreateTapTweak(m_branch.size() == 0 ? nullptr : &m_branch[0]->hash);
  ------------------
  |  Branch (399:46): [True: 804, False: 2.02k]
  ------------------
  400|  2.82k|    assert(ret.has_value());
  401|  2.82k|    std::tie(m_output_key, m_parity) = *ret;
  402|  2.82k|    return *this;
  403|  2.82k|}
_ZN14TaprootBuilder9GetOutputEv:
  405|  2.82k|WitnessV1Taproot TaprootBuilder::GetOutput() { return WitnessV1Taproot{m_output_key}; }
_ZNK14TaprootBuilder12GetSpendDataEv:
  408|  1.41k|{
  409|  1.41k|    assert(IsComplete());
  410|  1.41k|    assert(m_output_key.IsFullyValid());
  411|  1.41k|    TaprootSpendData spd;
  412|  1.41k|    spd.merkle_root = m_branch.size() == 0 ? uint256() : m_branch[0]->hash;
  ------------------
  |  Branch (412:23): [True: 402, False: 1.01k]
  ------------------
  413|  1.41k|    spd.internal_key = m_internal_key;
  414|  1.41k|    if (m_branch.size()) {
  ------------------
  |  Branch (414:9): [True: 1.01k, False: 402]
  ------------------
  415|       |        // If any script paths exist, they have been combined into the root m_branch[0]
  416|       |        // by now. Compute the control block for each of its tracked leaves, and put them in
  417|       |        // spd.scripts.
  418|  3.55k|        for (const auto& leaf : m_branch[0]->leaves) {
  ------------------
  |  Branch (418:31): [True: 3.55k, False: 1.01k]
  ------------------
  419|  3.55k|            std::vector<unsigned char> control_block;
  420|  3.55k|            control_block.resize(TAPROOT_CONTROL_BASE_SIZE + TAPROOT_CONTROL_NODE_SIZE * leaf.merkle_branch.size());
  421|  3.55k|            control_block[0] = leaf.leaf_version | (m_parity ? 1 : 0);
  ------------------
  |  Branch (421:53): [True: 1.96k, False: 1.58k]
  ------------------
  422|  3.55k|            std::copy(m_internal_key.begin(), m_internal_key.end(), control_block.begin() + 1);
  423|  3.55k|            if (leaf.merkle_branch.size()) {
  ------------------
  |  Branch (423:17): [True: 3.52k, False: 23]
  ------------------
  424|  3.52k|                std::copy(leaf.merkle_branch[0].begin(),
  425|  3.52k|                          leaf.merkle_branch[0].begin() + TAPROOT_CONTROL_NODE_SIZE * leaf.merkle_branch.size(),
  426|  3.52k|                          control_block.begin() + TAPROOT_CONTROL_BASE_SIZE);
  427|  3.52k|            }
  428|  3.55k|            spd.scripts[{leaf.script, leaf.leaf_version}].insert(std::move(control_block));
  429|  3.55k|        }
  430|  1.01k|    }
  431|  1.41k|    return spd;
  432|  1.41k|}
_Z16InferTaprootTreeRK16TaprootSpendDataRK11XOnlyPubKey:
  435|  1.41k|{
  436|       |    // Verify that the output matches the assumed Merkle root and internal key.
  437|  1.41k|    auto tweak = spenddata.internal_key.CreateTapTweak(spenddata.merkle_root.IsNull() ? nullptr : &spenddata.merkle_root);
  ------------------
  |  Branch (437:56): [True: 402, False: 1.01k]
  ------------------
  438|  1.41k|    if (!tweak || tweak->first != output) return std::nullopt;
  ------------------
  |  Branch (438:9): [True: 0, False: 1.41k]
  |  Branch (438:19): [True: 0, False: 1.41k]
  ------------------
  439|       |    // If the Merkle root is 0, the tree is empty, and we're done.
  440|  1.41k|    std::vector<std::tuple<int, std::vector<unsigned char>, int>> ret;
  441|  1.41k|    if (spenddata.merkle_root.IsNull()) return ret;
  ------------------
  |  Branch (441:9): [True: 402, False: 1.01k]
  ------------------
  442|       |
  443|       |    /** Data structure to represent the nodes of the tree we're going to build. */
  444|  1.01k|    struct TreeNode {
  445|       |        /** Hash of this node, if known; 0 otherwise. */
  446|  1.01k|        uint256 hash;
  447|       |        /** The left and right subtrees (note that their order is irrelevant). */
  448|  1.01k|        std::unique_ptr<TreeNode> sub[2];
  449|       |        /** If this is known to be a leaf node, a pointer to the (script, leaf_ver) pair.
  450|       |         *  nullptr otherwise. */
  451|  1.01k|        const std::pair<std::vector<unsigned char>, int>* leaf = nullptr;
  452|       |        /** Whether or not this node has been explored (is known to be a leaf, or known to have children). */
  453|  1.01k|        bool explored = false;
  454|       |        /** Whether or not this node is an inner node (unknown until explored = true). */
  455|  1.01k|        bool inner;
  456|       |        /** Whether or not we have produced output for this subtree. */
  457|  1.01k|        bool done = false;
  458|  1.01k|    };
  459|       |
  460|       |    // Build tree from the provided branches.
  461|  1.01k|    TreeNode root;
  462|  1.01k|    root.hash = spenddata.merkle_root;
  463|  2.48k|    for (const auto& [key, control_blocks] : spenddata.scripts) {
  ------------------
  |  Branch (463:44): [True: 2.48k, False: 1.01k]
  ------------------
  464|  2.48k|        const auto& [script, leaf_ver] = key;
  465|  3.45k|        for (const auto& control : control_blocks) {
  ------------------
  |  Branch (465:34): [True: 3.45k, False: 2.48k]
  ------------------
  466|       |            // Skip script records with nonsensical leaf version.
  467|  3.45k|            if (leaf_ver < 0 || leaf_ver >= 0x100 || leaf_ver & 1) continue;
  ------------------
  |  Branch (467:17): [True: 0, False: 3.45k]
  |  Branch (467:33): [True: 0, False: 3.45k]
  |  Branch (467:54): [True: 0, False: 3.45k]
  ------------------
  468|       |            // Skip script records with invalid control block sizes.
  469|  3.45k|            if (control.size() < TAPROOT_CONTROL_BASE_SIZE || control.size() > TAPROOT_CONTROL_MAX_SIZE ||
  ------------------
  |  Branch (469:17): [True: 0, False: 3.45k]
  |  Branch (469:63): [True: 0, False: 3.45k]
  ------------------
  470|  3.45k|                ((control.size() - TAPROOT_CONTROL_BASE_SIZE) % TAPROOT_CONTROL_NODE_SIZE) != 0) continue;
  ------------------
  |  Branch (470:17): [True: 0, False: 3.45k]
  ------------------
  471|       |            // Skip script records that don't match the control block.
  472|  3.45k|            if ((control[0] & TAPROOT_LEAF_MASK) != leaf_ver) continue;
  ------------------
  |  Branch (472:17): [True: 0, False: 3.45k]
  ------------------
  473|       |            // Skip script records that don't match the provided Merkle root.
  474|  3.45k|            const uint256 leaf_hash = ComputeTapleafHash(leaf_ver, script);
  475|  3.45k|            const uint256 merkle_root = ComputeTaprootMerkleRoot(control, leaf_hash);
  476|  3.45k|            if (merkle_root != spenddata.merkle_root) continue;
  ------------------
  |  Branch (476:17): [True: 0, False: 3.45k]
  ------------------
  477|       |
  478|  3.45k|            TreeNode* node = &root;
  479|  3.45k|            size_t levels = (control.size() - TAPROOT_CONTROL_BASE_SIZE) / TAPROOT_CONTROL_NODE_SIZE;
  480|  30.5k|            for (size_t depth = 0; depth < levels; ++depth) {
  ------------------
  |  Branch (480:36): [True: 27.1k, False: 3.45k]
  ------------------
  481|       |                // Can't descend into a node which we already know is a leaf.
  482|  27.1k|                if (node->explored && !node->inner) return std::nullopt;
  ------------------
  |  Branch (482:21): [True: 24.5k, False: 2.53k]
  |  Branch (482:39): [True: 0, False: 24.5k]
  ------------------
  483|       |
  484|       |                // Extract partner hash from Merkle branch in control block.
  485|  27.1k|                uint256 hash;
  486|  27.1k|                std::copy(control.begin() + TAPROOT_CONTROL_BASE_SIZE + (levels - 1 - depth) * TAPROOT_CONTROL_NODE_SIZE,
  487|  27.1k|                          control.begin() + TAPROOT_CONTROL_BASE_SIZE + (levels - depth) * TAPROOT_CONTROL_NODE_SIZE,
  488|  27.1k|                          hash.begin());
  489|       |
  490|  27.1k|                if (node->sub[0]) {
  ------------------
  |  Branch (490:21): [True: 24.5k, False: 2.53k]
  ------------------
  491|       |                    // Descend into the existing left or right branch.
  492|  24.5k|                    bool desc = false;
  493|  44.9k|                    for (int i = 0; i < 2; ++i) {
  ------------------
  |  Branch (493:37): [True: 44.9k, False: 0]
  ------------------
  494|  44.9k|                        if (node->sub[i]->hash == hash || (node->sub[i]->hash.IsNull() && node->sub[1-i]->hash != hash)) {
  ------------------
  |  Branch (494:29): [True: 23.6k, False: 21.2k]
  |  Branch (494:60): [True: 2.51k, False: 18.7k]
  |  Branch (494:91): [True: 873, False: 1.64k]
  ------------------
  495|  24.5k|                            node->sub[i]->hash = hash;
  496|  24.5k|                            node = &*node->sub[1-i];
  497|  24.5k|                            desc = true;
  498|  24.5k|                            break;
  499|  24.5k|                        }
  500|  44.9k|                    }
  501|  24.5k|                    if (!desc) return std::nullopt; // This probably requires a hash collision to hit.
  ------------------
  |  Branch (501:25): [True: 0, False: 24.5k]
  ------------------
  502|  24.5k|                } else {
  503|       |                    // We're in an unexplored node. Create subtrees and descend.
  504|  2.53k|                    node->explored = true;
  505|  2.53k|                    node->inner = true;
  506|  2.53k|                    node->sub[0] = std::make_unique<TreeNode>();
  507|  2.53k|                    node->sub[1] = std::make_unique<TreeNode>();
  508|  2.53k|                    node->sub[1]->hash = hash;
  509|  2.53k|                    node = &*node->sub[0];
  510|  2.53k|                }
  511|  27.1k|            }
  512|       |            // Cannot turn a known inner node into a leaf.
  513|  3.45k|            if (node->sub[0]) return std::nullopt;
  ------------------
  |  Branch (513:17): [True: 0, False: 3.45k]
  ------------------
  514|  3.45k|            node->explored = true;
  515|  3.45k|            node->inner = false;
  516|  3.45k|            node->leaf = &key;
  517|  3.45k|            node->hash = leaf_hash;
  518|  3.45k|        }
  519|  2.48k|    }
  520|       |
  521|       |    // Recursive processing to turn the tree into flattened output. Use an explicit stack here to avoid
  522|       |    // overflowing the call stack (the tree may be 128 levels deep).
  523|  1.01k|    std::vector<TreeNode*> stack{&root};
  524|  12.2k|    while (!stack.empty()) {
  ------------------
  |  Branch (524:12): [True: 11.2k, False: 1.00k]
  ------------------
  525|  11.2k|        TreeNode& node = *stack.back();
  526|  11.2k|        if (!node.explored) {
  ------------------
  |  Branch (526:13): [True: 4, False: 11.2k]
  ------------------
  527|       |            // Unexplored node, which means the tree is incomplete.
  528|      4|            return std::nullopt;
  529|  11.2k|        } else if (!node.inner) {
  ------------------
  |  Branch (529:20): [True: 3.53k, False: 7.67k]
  ------------------
  530|       |            // Leaf node; produce output.
  531|  3.53k|            ret.emplace_back(stack.size() - 1, node.leaf->first, node.leaf->second);
  532|  3.53k|            node.done = true;
  533|  3.53k|            stack.pop_back();
  534|  7.67k|        } else if (node.sub[0]->done && !node.sub[1]->done && !node.sub[1]->explored && !node.sub[1]->hash.IsNull() &&
  ------------------
  |  Branch (534:20): [True: 5.05k, False: 2.61k]
  |  Branch (534:20): [True: 85, False: 7.58k]
  |  Branch (534:41): [True: 2.52k, False: 2.52k]
  |  Branch (534:63): [True: 89, False: 2.44k]
  |  Branch (534:89): [True: 89, False: 0]
  ------------------
  535|  7.67k|                   ComputeTapbranchHash(node.sub[1]->hash, node.sub[1]->hash) == node.hash) {
  ------------------
  |  Branch (535:20): [True: 85, False: 4]
  ------------------
  536|       |            // Whenever there are nodes with two identical subtrees under it, we run into a problem:
  537|       |            // the control blocks for the leaves underneath those will be identical as well, and thus
  538|       |            // they will all be matched to the same path in the tree. The result is that at the location
  539|       |            // where the duplicate occurred, the left child will contain a normal tree that can be explored
  540|       |            // and processed, but the right one will remain unexplored.
  541|       |            //
  542|       |            // This situation can be detected, by encountering an inner node with unexplored right subtree
  543|       |            // with known hash, and H_TapBranch(hash, hash) is equal to the parent node (this node)'s hash.
  544|       |            //
  545|       |            // To deal with this, simply process the left tree a second time (set its done flag to false;
  546|       |            // noting that the done flag of its children have already been set to false after processing
  547|       |            // those). To avoid ending up in an infinite loop, set the done flag of the right (unexplored)
  548|       |            // subtree to true.
  549|     85|            node.sub[0]->done = false;
  550|     85|            node.sub[1]->done = true;
  551|  7.58k|        } else if (node.sub[0]->done && node.sub[1]->done) {
  ------------------
  |  Branch (551:20): [True: 4.96k, False: 2.61k]
  |  Branch (551:41): [True: 2.52k, False: 2.44k]
  ------------------
  552|       |            // An internal node which we're finished with.
  553|  2.52k|            node.sub[0]->done = false;
  554|  2.52k|            node.sub[1]->done = false;
  555|  2.52k|            node.done = true;
  556|  2.52k|            stack.pop_back();
  557|  5.06k|        } else if (!node.sub[0]->done) {
  ------------------
  |  Branch (557:20): [True: 2.61k, False: 2.44k]
  ------------------
  558|       |            // An internal node whose left branch hasn't been processed yet. Do so first.
  559|  2.61k|            stack.push_back(&*node.sub[0]);
  560|  2.61k|        } else if (!node.sub[1]->done) {
  ------------------
  |  Branch (560:20): [True: 2.44k, False: 0]
  ------------------
  561|       |            // An internal node whose right branch hasn't been processed yet. Do so first.
  562|  2.44k|            stack.push_back(&*node.sub[1]);
  563|  2.44k|        }
  564|  11.2k|    }
  565|       |
  566|  1.00k|    return ret;
  567|  1.01k|}
_Z12LookupHelperINSt3__13mapI9CScriptID7CScriptNS0_4lessIS2_EENS0_9allocatorINS0_4pairIKS2_S3_EEEEEES2_S3_EbRKT_RKT0_RT1_:
   16|  1.38k|{
   17|  1.38k|    auto it = map.find(key);
   18|  1.38k|    if (it != map.end()) {
  ------------------
  |  Branch (18:9): [True: 1.38k, False: 2]
  ------------------
   19|  1.38k|        value = it->second;
   20|  1.38k|        return true;
   21|  1.38k|    }
   22|      2|    return false;
   23|  1.38k|}
_Z12LookupHelperINSt3__13mapI6CKeyID7CPubKeyNS0_4lessIS2_EENS0_9allocatorINS0_4pairIKS2_S3_EEEEEES2_S3_EbRKT_RKT0_RT1_:
   16|    505|{
   17|    505|    auto it = map.find(key);
   18|    505|    if (it != map.end()) {
  ------------------
  |  Branch (18:9): [True: 504, False: 1]
  ------------------
   19|    504|        value = it->second;
   20|    504|        return true;
   21|    504|    }
   22|      1|    return false;
   23|    505|}
_Z12LookupHelperINSt3__13mapI6CKeyIDNS0_4pairI7CPubKey13KeyOriginInfoEENS0_4lessIS2_EENS0_9allocatorINS3_IKS2_S6_EEEEEES2_S6_EbRKT_RKT0_RT1_:
   16|   217k|{
   17|   217k|    auto it = map.find(key);
   18|   217k|    if (it != map.end()) {
  ------------------
  |  Branch (18:9): [True: 145k, False: 71.8k]
  ------------------
   19|   145k|        value = it->second;
   20|   145k|        return true;
   21|   145k|    }
   22|  71.8k|    return false;
   23|   217k|}
_Z12LookupHelperINSt3__13mapI6CKeyID4CKeyNS0_4lessIS2_EENS0_9allocatorINS0_4pairIKS2_S3_EEEEEES2_S3_EbRKT_RKT0_RT1_:
   16|   262k|{
   17|   262k|    auto it = map.find(key);
   18|   262k|    if (it != map.end()) {
  ------------------
  |  Branch (18:9): [True: 221k, False: 40.6k]
  ------------------
   19|   221k|        value = it->second;
   20|   221k|        return true;
   21|   221k|    }
   22|  40.6k|    return false;
   23|   262k|}
_Z12LookupHelperINSt3__13mapI11XOnlyPubKey14TaprootBuilderNS0_4lessIS2_EENS0_9allocatorINS0_4pairIKS2_S3_EEEEEES2_S3_EbRKT_RKT0_RT1_:
   16|  1.41k|{
   17|  1.41k|    auto it = map.find(key);
   18|  1.41k|    if (it != map.end()) {
  ------------------
  |  Branch (18:9): [True: 1.41k, False: 5]
  ------------------
   19|  1.41k|        value = it->second;
   20|  1.41k|        return true;
   21|  1.41k|    }
   22|      5|    return false;
   23|  1.41k|}

_ZNK29ShortestVectorFirstComparatorclERKNSt3__16vectorIhNS0_9allocatorIhEEEES6_:
   20|  5.52k|    {
   21|  5.52k|        if (a.size() < b.size()) return true;
  ------------------
  |  Branch (21:13): [True: 4.89k, False: 627]
  ------------------
   22|    627|        if (a.size() > b.size()) return false;
  ------------------
  |  Branch (22:13): [True: 219, False: 408]
  ------------------
   23|    408|        return a < b;
   24|    627|    }
_ZNK14TaprootBuilder7IsValidEv:
  126|  7.10k|    bool IsValid() const { return m_valid; }
_ZNK14TaprootBuilder10IsCompleteEv:
  128|  7.06k|    bool IsComplete() const { return m_valid && (m_branch.size() == 0 || (m_branch.size() == 1 && m_branch[0].has_value())); }
  ------------------
  |  Branch (128:38): [True: 7.06k, False: 0]
  |  Branch (128:50): [True: 2.01k, False: 5.05k]
  |  Branch (128:75): [True: 5.05k, False: 0]
  |  Branch (128:99): [True: 5.05k, False: 0]
  ------------------
_ZNK15SigningProvider6GetKeyERK6CKeyIDR4CKey:
  159|  3.08k|    virtual bool GetKey(const CKeyID &address, CKey& key) const { return false; }
_ZNK15SigningProvider13GetKeyByXOnlyERK11XOnlyPubKeyR4CKey:
  166|  18.5k|    {
  167|  37.0k|        for (const auto& id : pubkey.GetKeyIDs()) {
  ------------------
  |  Branch (167:29): [True: 37.0k, False: 18.5k]
  ------------------
  168|  37.0k|            if (GetKey(id, key)) return true;
  ------------------
  |  Branch (168:17): [True: 15, False: 37.0k]
  ------------------
  169|  37.0k|        }
  170|  18.5k|        return false;
  171|  18.5k|    }
_ZNK15SigningProvider19GetKeyOriginByXOnlyERK11XOnlyPubKeyR13KeyOriginInfo:
  182|   138k|    {
  183|   210k|        for (const auto& id : pubkey.GetKeyIDs()) {
  ------------------
  |  Branch (183:29): [True: 210k, False: 8]
  ------------------
  184|   210k|            if (GetKeyOrigin(id, info)) return true;
  ------------------
  |  Branch (184:17): [True: 138k, False: 71.8k]
  ------------------
  185|   210k|        }
  186|      8|        return false;
  187|   138k|    }
_ZN15SigningProviderD2Ev:
  155|  27.2k|    virtual ~SigningProvider() = default;

_Z11MatchMultiARK7CScript:
  108|  2.26k|{
  109|  2.26k|    std::vector<Span<const unsigned char>> keyspans;
  110|       |
  111|       |    // Redundant, but very fast and selective test.
  112|  2.26k|    if (script.size() == 0 || script[0] != 32 || script.back() != OP_NUMEQUAL) return {};
  ------------------
  |  Branch (112:9): [True: 0, False: 2.26k]
  |  Branch (112:31): [True: 677, False: 1.59k]
  |  Branch (112:50): [True: 70, False: 1.52k]
  ------------------
  113|       |
  114|       |    // Parse keys
  115|  1.52k|    auto it = script.begin();
  116|   136k|    while (script.end() - it >= 34) {
  ------------------
  |  Branch (116:12): [True: 134k, False: 1.52k]
  ------------------
  117|   134k|        if (*it != 32) return {};
  ------------------
  |  Branch (117:13): [True: 0, False: 134k]
  ------------------
  118|   134k|        ++it;
  119|   134k|        keyspans.emplace_back(&*it, 32);
  120|   134k|        it += 32;
  121|   134k|        if (*it != (keyspans.size() == 1 ? OP_CHECKSIG : OP_CHECKSIGADD)) return {};
  ------------------
  |  Branch (121:13): [True: 0, False: 134k]
  |  Branch (121:21): [True: 1.52k, False: 133k]
  ------------------
  122|   134k|        ++it;
  123|   134k|    }
  124|  1.52k|    if (keyspans.size() == 0 || keyspans.size() > MAX_PUBKEYS_PER_MULTI_A) return {};
  ------------------
  |  Branch (124:9): [True: 0, False: 1.52k]
  |  Branch (124:33): [True: 0, False: 1.52k]
  ------------------
  125|       |
  126|       |    // Parse threshold.
  127|  1.52k|    opcodetype opcode;
  128|  1.52k|    std::vector<unsigned char> data;
  129|  1.52k|    if (!script.GetOp(it, opcode, data)) return {};
  ------------------
  |  Branch (129:9): [True: 0, False: 1.52k]
  ------------------
  130|  1.52k|    if (it == script.end()) return {};
  ------------------
  |  Branch (130:9): [True: 0, False: 1.52k]
  ------------------
  131|  1.52k|    if (*it != OP_NUMEQUAL) return {};
  ------------------
  |  Branch (131:9): [True: 0, False: 1.52k]
  ------------------
  132|  1.52k|    ++it;
  133|  1.52k|    if (it != script.end()) return {};
  ------------------
  |  Branch (133:9): [True: 0, False: 1.52k]
  ------------------
  134|  1.52k|    auto threshold = GetScriptNumber(opcode, data, 1, (int)keyspans.size());
  135|  1.52k|    if (!threshold) return {};
  ------------------
  |  Branch (135:9): [True: 0, False: 1.52k]
  ------------------
  136|       |
  137|       |    // Construct result.
  138|  1.52k|    return std::pair{*threshold, std::move(keyspans)};
  139|  1.52k|}
_Z6SolverRK7CScriptRNSt3__16vectorINS3_IhNS2_9allocatorIhEEEENS4_IS6_EEEE:
  142|  6.73k|{
  143|  6.73k|    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|  6.73k|    if (scriptPubKey.IsPayToScriptHash())
  ------------------
  |  Branch (147:9): [True: 616, False: 6.11k]
  ------------------
  148|    616|    {
  149|    616|        std::vector<unsigned char> hashBytes(scriptPubKey.begin()+2, scriptPubKey.begin()+22);
  150|    616|        vSolutionsRet.push_back(hashBytes);
  151|    616|        return TxoutType::SCRIPTHASH;
  152|    616|    }
  153|       |
  154|  6.11k|    int witnessversion;
  155|  6.11k|    std::vector<unsigned char> witnessprogram;
  156|  6.11k|    if (scriptPubKey.IsWitnessProgram(witnessversion, witnessprogram)) {
  ------------------
  |  Branch (156:9): [True: 2.30k, False: 3.81k]
  ------------------
  157|  2.30k|        if (witnessversion == 0 && witnessprogram.size() == WITNESS_V0_KEYHASH_SIZE) {
  ------------------
  |  Branch (157:13): [True: 787, False: 1.51k]
  |  Branch (157:36): [True: 9, False: 778]
  ------------------
  158|      9|            vSolutionsRet.push_back(std::move(witnessprogram));
  159|      9|            return TxoutType::WITNESS_V0_KEYHASH;
  160|      9|        }
  161|  2.29k|        if (witnessversion == 0 && witnessprogram.size() == WITNESS_V0_SCRIPTHASH_SIZE) {
  ------------------
  |  Branch (161:13): [True: 778, False: 1.51k]
  |  Branch (161:36): [True: 772, False: 6]
  ------------------
  162|    772|            vSolutionsRet.push_back(std::move(witnessprogram));
  163|    772|            return TxoutType::WITNESS_V0_SCRIPTHASH;
  164|    772|        }
  165|  1.51k|        if (witnessversion == 1 && witnessprogram.size() == WITNESS_V1_TAPROOT_SIZE) {
  ------------------
  |  Branch (165:13): [True: 1.46k, False: 54]
  |  Branch (165:36): [True: 1.42k, False: 42]
  ------------------
  166|  1.42k|            vSolutionsRet.push_back(std::move(witnessprogram));
  167|  1.42k|            return TxoutType::WITNESS_V1_TAPROOT;
  168|  1.42k|        }
  169|     96|        if (scriptPubKey.IsPayToAnchor()) {
  ------------------
  |  Branch (169:13): [True: 0, False: 96]
  ------------------
  170|      0|            return TxoutType::ANCHOR;
  171|      0|        }
  172|     96|        if (witnessversion != 0) {
  ------------------
  |  Branch (172:13): [True: 90, False: 6]
  ------------------
  173|     90|            vSolutionsRet.push_back(std::vector<unsigned char>{(unsigned char)witnessversion});
  174|     90|            vSolutionsRet.push_back(std::move(witnessprogram));
  175|     90|            return TxoutType::WITNESS_UNKNOWN;
  176|     90|        }
  177|      6|        return TxoutType::NONSTANDARD;
  178|     96|    }
  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|  3.81k|    if (scriptPubKey.size() >= 1 && scriptPubKey[0] == OP_RETURN && scriptPubKey.IsPushOnly(scriptPubKey.begin()+1)) {
  ------------------
  |  Branch (185:9): [True: 3.81k, False: 0]
  |  Branch (185:9): [True: 90, False: 3.72k]
  |  Branch (185:37): [True: 432, False: 3.38k]
  |  Branch (185:69): [True: 90, False: 342]
  ------------------
  186|     90|        return TxoutType::NULL_DATA;
  187|     90|    }
  188|       |
  189|  3.72k|    std::vector<unsigned char> data;
  190|  3.72k|    if (MatchPayToPubkey(scriptPubKey, data)) {
  ------------------
  |  Branch (190:9): [True: 162, False: 3.56k]
  ------------------
  191|    162|        vSolutionsRet.push_back(std::move(data));
  192|    162|        return TxoutType::PUBKEY;
  193|    162|    }
  194|       |
  195|  3.56k|    if (MatchPayToPubkeyHash(scriptPubKey, data)) {
  ------------------
  |  Branch (195:9): [True: 438, False: 3.12k]
  ------------------
  196|    438|        vSolutionsRet.push_back(std::move(data));
  197|    438|        return TxoutType::PUBKEYHASH;
  198|    438|    }
  199|       |
  200|  3.12k|    int required;
  201|  3.12k|    std::vector<std::vector<unsigned char>> keys;
  202|  3.12k|    if (MatchMultisig(scriptPubKey, required, keys)) {
  ------------------
  |  Branch (202:9): [True: 901, False: 2.22k]
  ------------------
  203|    901|        vSolutionsRet.push_back({static_cast<unsigned char>(required)}); // safe as required is in range 1..20
  204|    901|        vSolutionsRet.insert(vSolutionsRet.end(), keys.begin(), keys.end());
  205|    901|        vSolutionsRet.push_back({static_cast<unsigned char>(keys.size())}); // safe as size is in range 1..20
  206|    901|        return TxoutType::MULTISIG;
  207|    901|    }
  208|       |
  209|  2.22k|    vSolutionsRet.clear();
  210|  2.22k|    return TxoutType::NONSTANDARD;
  211|  3.12k|}
_Z21GetScriptForRawPubKeyRK7CPubKey:
  214|    308|{
  215|    308|    return CScript() << std::vector<unsigned char>(pubKey.begin(), pubKey.end()) << OP_CHECKSIG;
  216|    308|}
_Z20GetScriptForMultisigiRKNSt3__16vectorI7CPubKeyNS_9allocatorIS1_EEEE:
  219|  1.80k|{
  220|  1.80k|    CScript script;
  221|       |
  222|  1.80k|    script << nRequired;
  223|  1.80k|    for (const CPubKey& key : keys)
  ------------------
  |  Branch (223:29): [True: 9.75k, False: 1.80k]
  ------------------
  224|  9.75k|        script << ToByteVector(key);
  225|  1.80k|    script << keys.size() << OP_CHECKMULTISIG;
  226|       |
  227|  1.80k|    return script;
  228|  1.80k|}
solver.cpp:_ZL15GetScriptNumber10opcodetypeNSt3__16vectorIhNS0_9allocatorIhEEEEii:
   67|  4.15k|{
   68|  4.15k|    int count;
   69|  4.15k|    if (IsSmallInteger(opcode)) {
  ------------------
  |  Branch (69:9): [True: 3.45k, False: 701]
  ------------------
   70|  3.45k|        count = CScript::DecodeOP_N(opcode);
   71|  3.45k|    } else if (IsPushdataOp(opcode)) {
  ------------------
  |  Branch (71:16): [True: 551, False: 150]
  ------------------
   72|    551|        if (!CheckMinimalPush(data, opcode)) return {};
  ------------------
  |  Branch (72:13): [True: 48, False: 503]
  ------------------
   73|    503|        try {
   74|    503|            count = CScriptNum(data, /* fRequireMinimal = */ true).getint();
   75|    503|        } catch (const scriptnum_error&) {
   76|     81|            return {};
   77|     81|        }
   78|    503|    } else {
   79|    150|        return {};
   80|    150|    }
   81|  3.87k|    if (count < min || count > max) return {};
  ------------------
  |  Branch (81:9): [True: 129, False: 3.74k]
  |  Branch (81:24): [True: 225, False: 3.51k]
  ------------------
   82|  3.51k|    return count;
   83|  3.87k|}
solver.cpp:_ZL14IsSmallInteger10opcodetype:
   60|  4.15k|{
   61|  4.15k|    return opcode >= OP_1 && opcode <= OP_16;
  ------------------
  |  Branch (61:12): [True: 3.56k, False: 584]
  |  Branch (61:30): [True: 3.45k, False: 117]
  ------------------
   62|  4.15k|}
solver.cpp:_ZL16MatchPayToPubkeyRK7CScriptRNSt3__16vectorIhNS2_9allocatorIhEEEE:
   37|  3.72k|{
   38|  3.72k|    if (script.size() == CPubKey::SIZE + 2 && script[0] == CPubKey::SIZE && script.back() == OP_CHECKSIG) {
  ------------------
  |  Branch (38:9): [True: 41, False: 3.68k]
  |  Branch (38:47): [True: 26, False: 15]
  |  Branch (38:77): [True: 20, False: 6]
  ------------------
   39|     20|        pubkey = valtype(script.begin() + 1, script.begin() + CPubKey::SIZE + 1);
   40|     20|        return CPubKey::ValidSize(pubkey);
   41|     20|    }
   42|  3.70k|    if (script.size() == CPubKey::COMPRESSED_SIZE + 2 && script[0] == CPubKey::COMPRESSED_SIZE && script.back() == OP_CHECKSIG) {
  ------------------
  |  Branch (42:9): [True: 201, False: 3.50k]
  |  Branch (42:58): [True: 181, False: 20]
  |  Branch (42:99): [True: 172, False: 9]
  ------------------
   43|    172|        pubkey = valtype(script.begin() + 1, script.begin() + CPubKey::COMPRESSED_SIZE + 1);
   44|    172|        return CPubKey::ValidSize(pubkey);
   45|    172|    }
   46|  3.53k|    return false;
   47|  3.70k|}
solver.cpp:_ZL20MatchPayToPubkeyHashRK7CScriptRNSt3__16vectorIhNS2_9allocatorIhEEEE:
   50|  3.56k|{
   51|  3.56k|    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: 447, False: 3.11k]
  |  Branch (51:32): [True: 441, False: 6]
  |  Branch (51:55): [True: 438, False: 3]
  |  Branch (51:82): [True: 438, False: 0]
  |  Branch (51:101): [True: 438, False: 0]
  |  Branch (51:133): [True: 438, False: 0]
  ------------------
   52|    438|        pubkeyhash = valtype(script.begin () + 3, script.begin() + 23);
   53|    438|        return true;
   54|    438|    }
   55|  3.12k|    return false;
   56|  3.56k|}
solver.cpp:_ZL13MatchMultisigRK7CScriptRiRNSt3__16vectorINS4_IhNS3_9allocatorIhEEEENS5_IS7_EEEE:
   86|  3.12k|{
   87|  3.12k|    opcodetype opcode;
   88|  3.12k|    valtype data;
   89|       |
   90|  3.12k|    CScript::const_iterator it = script.begin();
   91|  3.12k|    if (script.size() < 1 || script.back() != OP_CHECKMULTISIG) return false;
  ------------------
  |  Branch (91:9): [True: 0, False: 3.12k]
  |  Branch (91:30): [True: 1.45k, False: 1.66k]
  ------------------
   92|       |
   93|  1.66k|    if (!script.GetOp(it, opcode, data)) return false;
  ------------------
  |  Branch (93:9): [True: 126, False: 1.54k]
  ------------------
   94|  1.54k|    auto req_sigs = GetScriptNumber(opcode, data, 1, MAX_PUBKEYS_PER_MULTISIG);
   95|  1.54k|    if (!req_sigs) return false;
  ------------------
  |  Branch (95:9): [True: 450, False: 1.09k]
  ------------------
   96|  1.09k|    required_sigs = *req_sigs;
   97|  6.63k|    while (script.GetOp(it, opcode, data) && CPubKey::ValidSize(data)) {
  ------------------
  |  Branch (97:12): [True: 6.59k, False: 42]
  |  Branch (97:46): [True: 5.54k, False: 1.04k]
  ------------------
   98|  5.54k|        pubkeys.emplace_back(std::move(data));
   99|  5.54k|    }
  100|  1.09k|    auto num_keys = GetScriptNumber(opcode, data, required_sigs, MAX_PUBKEYS_PER_MULTISIG);
  101|  1.09k|    if (!num_keys) return false;
  ------------------
  |  Branch (101:9): [True: 183, False: 907]
  ------------------
  102|    907|    if (pubkeys.size() != static_cast<unsigned long>(*num_keys)) return false;
  ------------------
  |  Branch (102:9): [True: 3, False: 904]
  ------------------
  103|       |
  104|    904|    return (it + 1 == script.end());
  105|    907|}

_Z12IsPushdataOp10opcodetype:
   41|  49.4k|{
   42|  49.4k|    return opcode > OP_FALSE && opcode <= OP_PUSHDATA4;
  ------------------
  |  Branch (42:12): [True: 40.6k, False: 8.77k]
  |  Branch (42:33): [True: 3.59k, False: 37.0k]
  ------------------
   43|  49.4k|}

secp256k1.c:secp256k1_eckey_pubkey_parse:
   17|   186k|static int secp256k1_eckey_pubkey_parse(secp256k1_ge *elem, const unsigned char *pub, size_t size) {
   18|   186k|    if (size == 33 && (pub[0] == SECP256K1_TAG_PUBKEY_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_ODD)) {
  ------------------
  |  |  216|   372k|#define SECP256K1_TAG_PUBKEY_EVEN 0x02
  ------------------
                  if (size == 33 && (pub[0] == SECP256K1_TAG_PUBKEY_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_ODD)) {
  ------------------
  |  |  217|  45.4k|#define SECP256K1_TAG_PUBKEY_ODD 0x03
  ------------------
  |  Branch (18:9): [True: 186k, False: 180]
  |  Branch (18:24): [True: 140k, False: 45.4k]
  |  Branch (18:63): [True: 45.4k, False: 0]
  ------------------
   19|   186k|        secp256k1_fe x;
   20|   186k|        return secp256k1_fe_set_b32_limit(&x, pub+1) && secp256k1_ge_set_xo_var(elem, &x, pub[0] == SECP256K1_TAG_PUBKEY_ODD);
  ------------------
  |  |   88|   186k|#  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);
  ------------------
  |  |  217|   186k|#define SECP256K1_TAG_PUBKEY_ODD 0x03
  ------------------
  |  Branch (20:16): [True: 186k, False: 1]
  |  Branch (20:57): [True: 186k, False: 75]
  ------------------
   21|   186k|    } else if (size == 65 && (pub[0] == SECP256K1_TAG_PUBKEY_UNCOMPRESSED || pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_ODD)) {
  ------------------
  |  |  218|    360|#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)) {
  ------------------
  |  |  219|    180|#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)) {
  ------------------
  |  |  220|      0|#define SECP256K1_TAG_PUBKEY_HYBRID_ODD 0x07
  ------------------
  |  Branch (21:16): [True: 180, False: 0]
  |  Branch (21:31): [True: 180, False: 0]
  |  Branch (21:78): [True: 0, False: 0]
  |  Branch (21:124): [True: 0, False: 0]
  ------------------
   22|    180|        secp256k1_fe x, y;
   23|    180|        if (!secp256k1_fe_set_b32_limit(&x, pub+1) || !secp256k1_fe_set_b32_limit(&y, pub+33)) {
  ------------------
  |  |   88|    180|#  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|    179|#  define secp256k1_fe_set_b32_limit secp256k1_fe_impl_set_b32_limit
  ------------------
  |  Branch (23:13): [True: 1, False: 179]
  |  Branch (23:55): [True: 1, False: 178]
  ------------------
   24|      2|            return 0;
   25|      2|        }
   26|    178|        secp256k1_ge_set_xy(elem, &x, &y);
   27|    178|        if ((pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_ODD) &&
  ------------------
  |  |  219|    356|#define SECP256K1_TAG_PUBKEY_HYBRID_EVEN 0x06
  ------------------
                      if ((pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_ODD) &&
  ------------------
  |  |  220|    178|#define SECP256K1_TAG_PUBKEY_HYBRID_ODD 0x07
  ------------------
  |  Branch (27:14): [True: 0, False: 178]
  |  Branch (27:60): [True: 0, False: 178]
  ------------------
   28|    178|            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)) {
  ------------------
  |  |  220|      0|#define SECP256K1_TAG_PUBKEY_HYBRID_ODD 0x07
  ------------------
  |  Branch (28:13): [True: 0, False: 0]
  ------------------
   29|      0|            return 0;
   30|      0|        }
   31|    178|        return secp256k1_ge_is_valid_var(elem);
   32|    178|    } else {
   33|      0|        return 0;
   34|      0|    }
   35|   186k|}
secp256k1.c:secp256k1_eckey_pubkey_serialize:
   37|  1.24M|static int secp256k1_eckey_pubkey_serialize(secp256k1_ge *elem, unsigned char *pub, size_t *size, int compressed) {
   38|  1.24M|    if (secp256k1_ge_is_infinity(elem)) {
  ------------------
  |  Branch (38:9): [True: 0, False: 1.24M]
  ------------------
   39|      0|        return 0;
   40|      0|    }
   41|  1.24M|    secp256k1_fe_normalize_var(&elem->x);
  ------------------
  |  |   80|  1.24M|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
   42|  1.24M|    secp256k1_fe_normalize_var(&elem->y);
  ------------------
  |  |   80|  1.24M|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
   43|  1.24M|    secp256k1_fe_get_b32(&pub[1], &elem->x);
  ------------------
  |  |   89|  1.24M|#  define secp256k1_fe_get_b32 secp256k1_fe_impl_get_b32
  ------------------
   44|  1.24M|    if (compressed) {
  ------------------
  |  Branch (44:9): [True: 1.24M, False: 0]
  ------------------
   45|  1.24M|        *size = 33;
   46|  1.24M|        pub[0] = secp256k1_fe_is_odd(&elem->y) ? SECP256K1_TAG_PUBKEY_ODD : SECP256K1_TAG_PUBKEY_EVEN;
  ------------------
  |  |   85|  1.24M|#  define secp256k1_fe_is_odd secp256k1_fe_impl_is_odd
  ------------------
                      pub[0] = secp256k1_fe_is_odd(&elem->y) ? SECP256K1_TAG_PUBKEY_ODD : SECP256K1_TAG_PUBKEY_EVEN;
  ------------------
  |  |  217|   470k|#define SECP256K1_TAG_PUBKEY_ODD 0x03
  ------------------
                      pub[0] = secp256k1_fe_is_odd(&elem->y) ? SECP256K1_TAG_PUBKEY_ODD : SECP256K1_TAG_PUBKEY_EVEN;
  ------------------
  |  |  216|  2.02M|#define SECP256K1_TAG_PUBKEY_EVEN 0x02
  ------------------
  |  Branch (46:18): [True: 470k, False: 778k]
  ------------------
   47|  1.24M|    } else {
   48|      0|        *size = 65;
   49|      0|        pub[0] = SECP256K1_TAG_PUBKEY_UNCOMPRESSED;
  ------------------
  |  |  218|      0|#define SECP256K1_TAG_PUBKEY_UNCOMPRESSED 0x04
  ------------------
   50|      0|        secp256k1_fe_get_b32(&pub[33], &elem->y);
  ------------------
  |  |   89|      0|#  define secp256k1_fe_get_b32 secp256k1_fe_impl_get_b32
  ------------------
   51|      0|    }
   52|  1.24M|    return 1;
   53|  1.24M|}
secp256k1.c:secp256k1_eckey_privkey_tweak_add:
   55|   396k|static int secp256k1_eckey_privkey_tweak_add(secp256k1_scalar *key, const secp256k1_scalar *tweak) {
   56|   396k|    secp256k1_scalar_add(key, key, tweak);
   57|   396k|    return !secp256k1_scalar_is_zero(key);
   58|   396k|}
secp256k1.c:secp256k1_eckey_pubkey_tweak_add:
   60|   158k|static int secp256k1_eckey_pubkey_tweak_add(secp256k1_ge *key, const secp256k1_scalar *tweak) {
   61|   158k|    secp256k1_gej pt;
   62|   158k|    secp256k1_gej_set_ge(&pt, key);
   63|   158k|    secp256k1_ecmult(&pt, &pt, &secp256k1_scalar_one, tweak);
   64|       |
   65|   158k|    if (secp256k1_gej_is_infinity(&pt)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 158k]
  ------------------
   66|      0|        return 0;
   67|      0|    }
   68|   158k|    secp256k1_ge_set_gej(key, &pt);
   69|   158k|    return 1;
   70|   158k|}

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|  1.09M|static int secp256k1_ecmult_gen_context_is_built(const secp256k1_ecmult_gen_context* ctx) {
   23|  1.09M|    return ctx->built;
   24|  1.09M|}
secp256k1.c:secp256k1_ecmult_gen:
   54|  1.09M|static void secp256k1_ecmult_gen(const secp256k1_ecmult_gen_context *ctx, secp256k1_gej *r, const secp256k1_scalar *gn) {
   55|  1.09M|    uint32_t comb_off;
   56|  1.09M|    secp256k1_ge add;
   57|  1.09M|    secp256k1_fe neg;
   58|  1.09M|    secp256k1_ge_storage adds;
   59|  1.09M|    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|  1.09M|    uint32_t recoded[(COMB_BITS + 31) >> 5] = {0};
   64|  1.09M|    int first = 1, i;
   65|       |
   66|  1.09M|    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|  1.09M|    secp256k1_scalar_add(&d, &ctx->scalar_offset, gn);
  111|       |    /* Convert to recoded array. */
  112|  9.85M|    for (i = 0; i < 8 && i < ((COMB_BITS + 31) >> 5); ++i) {
  ------------------
  |  |   84|  8.76M|#define COMB_BITS (COMB_BLOCKS * COMB_TEETH * COMB_SPACING)
  |  |  ------------------
  |  |  |  |   78|  8.76M|#define COMB_SPACING CEIL_DIV(COMB_RANGE, COMB_BLOCKS * COMB_TEETH)
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|  8.76M|#define CEIL_DIV(x, y) (1 + ((x) - 1) / (y))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (112:17): [True: 8.76M, False: 1.09M]
  |  Branch (112:26): [True: 8.76M, False: 0]
  ------------------
  113|  8.76M|        recoded[i] = secp256k1_scalar_get_bits_limb32(&d, 32 * i, 32);
  114|  8.76M|    }
  115|  1.09M|    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|  1.09M|    comb_off = COMB_SPACING - 1;
  ------------------
  |  |   78|  1.09M|#define COMB_SPACING CEIL_DIV(COMB_RANGE, COMB_BLOCKS * COMB_TEETH)
  |  |  ------------------
  |  |  |  |  180|  1.09M|#define CEIL_DIV(x, y) (1 + ((x) - 1) / (y))
  |  |  ------------------
  ------------------
  193|  1.09M|    while (1) {
  ------------------
  |  Branch (193:12): [Folded - Ignored]
  ------------------
  194|  1.09M|        uint32_t block;
  195|  1.09M|        uint32_t bit_pos = comb_off;
  196|       |        /* Inner loop: for each block, add table entries to the result. */
  197|  48.1M|        for (block = 0; block < COMB_BLOCKS; ++block) {
  ------------------
  |  Branch (197:25): [True: 47.0M, False: 1.09M]
  ------------------
  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|  47.0M|            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|   329M|            for (tooth = 0; tooth < COMB_TEETH; ++tooth) {
  ------------------
  |  Branch (209:29): [True: 282M, False: 47.0M]
  ------------------
  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 loose entropy. This relies on the
  217|       |                 * rotation being atomic, i.e., the compiler emitting an actual rot
  218|       |                 * instruction. */
  219|   282M|                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|   282M|                uint32_t volatile vmask = ~(1 << tooth);
  223|   282M|                bits &= vmask;
  224|       |
  225|       |                /* Write the bit into position tooth (and junk into higher bits). */
  226|   282M|                bits ^= bitdata << tooth;
  227|   282M|                bit_pos += COMB_SPACING;
  ------------------
  |  |   78|   282M|#define COMB_SPACING CEIL_DIV(COMB_RANGE, COMB_BLOCKS * COMB_TEETH)
  |  |  ------------------
  |  |  |  |  180|   282M|#define CEIL_DIV(x, y) (1 + ((x) - 1) / (y))
  |  |  ------------------
  ------------------
  228|   282M|            }
  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|  47.0M|            sign = (bits >> (COMB_TEETH - 1)) & 1;
  233|  47.0M|            abs = (bits ^ -sign) & (COMB_POINTS - 1);
  ------------------
  |  |   86|  47.0M|#define COMB_POINTS (1 << (COMB_TEETH - 1))
  ------------------
  234|  47.0M|            VERIFY_CHECK(sign == 0 || sign == 1);
  235|  47.0M|            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://www.tau.ac.il/~tromer/papers/cache.pdf)
  246|       |             */
  247|  1.55G|            for (index = 0; index < COMB_POINTS; ++index) {
  ------------------
  |  |   86|  1.55G|#define COMB_POINTS (1 << (COMB_TEETH - 1))
  ------------------
  |  Branch (247:29): [True: 1.50G, False: 47.0M]
  ------------------
  248|  1.50G|                secp256k1_ge_storage_cmov(&adds, &secp256k1_ecmult_gen_prec_table[block][index], index == abs);
  249|  1.50G|            }
  250|       |
  251|       |            /* Set add=adds or add=-adds, in constant time, based on sign. */
  252|  47.0M|            secp256k1_ge_from_storage(&add, &adds);
  253|  47.0M|            secp256k1_fe_negate(&neg, &add.y, 1);
  ------------------
  |  |  211|  47.0M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  47.0M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  47.0M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 47.0M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  47.0M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 47.0M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  47.0M|    } \
  |  |  |  |   84|  47.0M|    stmt; \
  |  |  |  |   85|  47.0M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  254|  47.0M|            secp256k1_fe_cmov(&add.y, &neg, sign);
  ------------------
  |  |   95|  47.0M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  255|       |
  256|       |            /* Add the looked up and conditionally negated value to r. */
  257|  47.0M|            if (EXPECT(first, 0)) {
  ------------------
  |  |  136|  47.0M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  ------------------
  |  |  |  Branch (136:21): [True: 1.09M, False: 46.0M]
  |  |  ------------------
  ------------------
  258|       |                /* If this is the first table lookup, we can skip addition. */
  259|  1.09M|                secp256k1_gej_set_ge(r, &add);
  260|       |                /* Give the entry a random Z coordinate to blind intermediary results. */
  261|  1.09M|                secp256k1_gej_rescale(r, &ctx->proj_blind);
  262|  1.09M|                first = 0;
  263|  46.0M|            } else {
  264|  46.0M|                secp256k1_gej_add_ge(r, r, &add);
  265|  46.0M|            }
  266|  47.0M|        }
  267|       |
  268|       |        /* Double the result, except in the last iteration. */
  269|  1.09M|        if (comb_off-- == 0) break;
  ------------------
  |  Branch (269:13): [True: 1.09M, 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|  1.09M|    secp256k1_gej_add_ge(r, r, &ctx->ge_offset);
  276|       |
  277|       |    /* Cleanup. */
  278|  1.09M|    secp256k1_fe_clear(&neg);
  279|  1.09M|    secp256k1_ge_clear(&add);
  280|  1.09M|    secp256k1_memclear(&adds, sizeof(adds));
  281|  1.09M|    secp256k1_memclear(&recoded, sizeof(recoded));
  282|  1.09M|}

secp256k1.c:secp256k1_ecmult:
  349|   158k|static void secp256k1_ecmult(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_scalar *na, const secp256k1_scalar *ng) {
  350|   158k|    secp256k1_fe aux[ECMULT_TABLE_SIZE(WINDOW_A)];
  351|   158k|    secp256k1_ge pre_a[ECMULT_TABLE_SIZE(WINDOW_A)];
  352|   158k|    struct secp256k1_strauss_point_state ps[1];
  353|   158k|    struct secp256k1_strauss_state state;
  354|       |
  355|   158k|    state.aux = aux;
  356|   158k|    state.pre_a = pre_a;
  357|   158k|    state.ps = ps;
  358|   158k|    secp256k1_ecmult_strauss_wnaf(&state, r, 1, a, na, ng);
  359|   158k|}
secp256k1.c:secp256k1_ecmult_strauss_wnaf:
  237|   158k|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) {
  238|   158k|    secp256k1_ge tmpa;
  239|   158k|    secp256k1_fe Z;
  240|       |    /* Split G factors. */
  241|   158k|    secp256k1_scalar ng_1, ng_128;
  242|   158k|    int wnaf_ng_1[129];
  243|   158k|    int bits_ng_1 = 0;
  244|   158k|    int wnaf_ng_128[129];
  245|   158k|    int bits_ng_128 = 0;
  246|   158k|    int i;
  247|   158k|    int bits = 0;
  248|   158k|    size_t np;
  249|   158k|    size_t no = 0;
  250|       |
  251|   158k|    secp256k1_fe_set_int(&Z, 1);
  ------------------
  |  |   83|   158k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  252|   316k|    for (np = 0; np < num; ++np) {
  ------------------
  |  Branch (252:18): [True: 158k, False: 158k]
  ------------------
  253|   158k|        secp256k1_gej tmp;
  254|   158k|        secp256k1_scalar na_1, na_lam;
  255|   158k|        if (secp256k1_scalar_is_zero(&na[np]) || secp256k1_gej_is_infinity(&a[np])) {
  ------------------
  |  Branch (255:13): [True: 0, False: 158k]
  |  Branch (255:50): [True: 0, False: 158k]
  ------------------
  256|      0|            continue;
  257|      0|        }
  258|       |        /* split na into na_1 and na_lam (where na = na_1 + na_lam*lambda, and na_1 and na_lam are ~128 bit) */
  259|   158k|        secp256k1_scalar_split_lambda(&na_1, &na_lam, &na[np]);
  260|       |
  261|       |        /* build wnaf representation for na_1 and na_lam. */
  262|   158k|        state->ps[no].bits_na_1   = secp256k1_ecmult_wnaf(state->ps[no].wnaf_na_1,   129, &na_1,   WINDOW_A);
  ------------------
  |  |   32|   158k|#  define WINDOW_A 5
  ------------------
  263|   158k|        state->ps[no].bits_na_lam = secp256k1_ecmult_wnaf(state->ps[no].wnaf_na_lam, 129, &na_lam, WINDOW_A);
  ------------------
  |  |   32|   158k|#  define WINDOW_A 5
  ------------------
  264|   158k|        VERIFY_CHECK(state->ps[no].bits_na_1 <= 129);
  265|   158k|        VERIFY_CHECK(state->ps[no].bits_na_lam <= 129);
  266|   158k|        if (state->ps[no].bits_na_1 > bits) {
  ------------------
  |  Branch (266:13): [True: 158k, False: 0]
  ------------------
  267|   158k|            bits = state->ps[no].bits_na_1;
  268|   158k|        }
  269|   158k|        if (state->ps[no].bits_na_lam > bits) {
  ------------------
  |  Branch (269:13): [True: 0, False: 158k]
  ------------------
  270|      0|            bits = state->ps[no].bits_na_lam;
  271|      0|        }
  272|       |
  273|       |        /* Calculate odd multiples of a.
  274|       |         * All multiples are brought to the same Z 'denominator', which is stored
  275|       |         * in Z. Due to secp256k1' isomorphism we can do all operations pretending
  276|       |         * that the Z coordinate was 1, use affine addition formulae, and correct
  277|       |         * the Z coordinate of the result once at the end.
  278|       |         * The exception is the precomputed G table points, which are actually
  279|       |         * affine. Compared to the base used for other points, they have a Z ratio
  280|       |         * of 1/Z, so we can use secp256k1_gej_add_zinv_var, which uses the same
  281|       |         * isomorphism to efficiently add with a known Z inverse.
  282|       |         */
  283|   158k|        tmp = a[np];
  284|   158k|        if (no) {
  ------------------
  |  Branch (284:13): [True: 0, False: 158k]
  ------------------
  285|      0|            secp256k1_gej_rescale(&tmp, &Z);
  286|      0|        }
  287|   158k|        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|   158k|#define ECMULT_TABLE_SIZE(w) (1L << ((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|   158k|#define ECMULT_TABLE_SIZE(w) (1L << ((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|   158k|#define ECMULT_TABLE_SIZE(w) (1L << ((w)-2))
  ------------------
  288|   158k|        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) (1L << ((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) (1L << ((w)-2))
  ------------------
  |  Branch (288:13): [True: 0, False: 158k]
  ------------------
  289|       |
  290|   158k|        ++no;
  291|   158k|    }
  292|       |
  293|       |    /* Bring them to the same Z denominator. */
  294|   158k|    if (no) {
  ------------------
  |  Branch (294:9): [True: 158k, False: 0]
  ------------------
  295|   158k|        secp256k1_ge_table_set_globalz(ECMULT_TABLE_SIZE(WINDOW_A) * no, state->pre_a, state->aux);
  ------------------
  |  |   41|   158k|#define ECMULT_TABLE_SIZE(w) (1L << ((w)-2))
  ------------------
  296|   158k|    }
  297|       |
  298|   316k|    for (np = 0; np < no; ++np) {
  ------------------
  |  Branch (298:18): [True: 158k, False: 158k]
  ------------------
  299|  1.42M|        for (i = 0; i < ECMULT_TABLE_SIZE(WINDOW_A); i++) {
  ------------------
  |  |   41|  1.42M|#define ECMULT_TABLE_SIZE(w) (1L << ((w)-2))
  ------------------
  |  Branch (299:21): [True: 1.26M, False: 158k]
  ------------------
  300|  1.26M|            secp256k1_fe_mul(&state->aux[np * ECMULT_TABLE_SIZE(WINDOW_A) + i], &state->pre_a[np * ECMULT_TABLE_SIZE(WINDOW_A) + i].x, &secp256k1_const_beta);
  ------------------
  |  |   93|  1.26M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
                          secp256k1_fe_mul(&state->aux[np * ECMULT_TABLE_SIZE(WINDOW_A) + i], &state->pre_a[np * ECMULT_TABLE_SIZE(WINDOW_A) + i].x, &secp256k1_const_beta);
  ------------------
  |  |   41|  1.26M|#define ECMULT_TABLE_SIZE(w) (1L << ((w)-2))
  ------------------
                          secp256k1_fe_mul(&state->aux[np * ECMULT_TABLE_SIZE(WINDOW_A) + i], &state->pre_a[np * ECMULT_TABLE_SIZE(WINDOW_A) + i].x, &secp256k1_const_beta);
  ------------------
  |  |   41|  1.26M|#define ECMULT_TABLE_SIZE(w) (1L << ((w)-2))
  ------------------
  301|  1.26M|        }
  302|   158k|    }
  303|       |
  304|   158k|    if (ng) {
  ------------------
  |  Branch (304:9): [True: 158k, False: 0]
  ------------------
  305|       |        /* 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) */
  306|   158k|        secp256k1_scalar_split_128(&ng_1, &ng_128, ng);
  307|       |
  308|       |        /* Build wnaf representation for ng_1 and ng_128 */
  309|   158k|        bits_ng_1   = secp256k1_ecmult_wnaf(wnaf_ng_1,   129, &ng_1,   WINDOW_G);
  ------------------
  |  |   29|   158k|#    define WINDOW_G ECMULT_WINDOW_SIZE
  ------------------
  310|   158k|        bits_ng_128 = secp256k1_ecmult_wnaf(wnaf_ng_128, 129, &ng_128, WINDOW_G);
  ------------------
  |  |   29|   158k|#    define WINDOW_G ECMULT_WINDOW_SIZE
  ------------------
  311|   158k|        if (bits_ng_1 > bits) {
  ------------------
  |  Branch (311:13): [True: 158k, False: 0]
  ------------------
  312|   158k|            bits = bits_ng_1;
  313|   158k|        }
  314|   158k|        if (bits_ng_128 > bits) {
  ------------------
  |  Branch (314:13): [True: 88.0k, False: 70.0k]
  ------------------
  315|  88.0k|            bits = bits_ng_128;
  316|  88.0k|        }
  317|   158k|    }
  318|       |
  319|   158k|    secp256k1_gej_set_infinity(r);
  320|       |
  321|  19.8M|    for (i = bits - 1; i >= 0; i--) {
  ------------------
  |  Branch (321:24): [True: 19.7M, False: 158k]
  ------------------
  322|  19.7M|        int n;
  323|  19.7M|        secp256k1_gej_double_var(r, r, NULL);
  324|  39.4M|        for (np = 0; np < no; ++np) {
  ------------------
  |  Branch (324:22): [True: 19.7M, False: 19.7M]
  ------------------
  325|  19.7M|            if (i < state->ps[np].bits_na_1 && (n = state->ps[np].wnaf_na_1[i])) {
  ------------------
  |  Branch (325:17): [True: 158k, False: 19.5M]
  |  Branch (325:48): [True: 158k, False: 0]
  ------------------
  326|   158k|                secp256k1_ecmult_table_get_ge(&tmpa, state->pre_a + np * ECMULT_TABLE_SIZE(WINDOW_A), n, WINDOW_A);
  ------------------
  |  |   41|   158k|#define ECMULT_TABLE_SIZE(w) (1L << ((w)-2))
  ------------------
                              secp256k1_ecmult_table_get_ge(&tmpa, state->pre_a + np * ECMULT_TABLE_SIZE(WINDOW_A), n, WINDOW_A);
  ------------------
  |  |   32|   158k|#  define WINDOW_A 5
  ------------------
  327|   158k|                secp256k1_gej_add_ge_var(r, r, &tmpa, NULL);
  328|   158k|            }
  329|  19.7M|            if (i < state->ps[np].bits_na_lam && (n = state->ps[np].wnaf_na_lam[i])) {
  ------------------
  |  Branch (329:17): [True: 0, False: 19.7M]
  |  Branch (329:50): [True: 0, False: 0]
  ------------------
  330|      0|                secp256k1_ecmult_table_get_ge_lambda(&tmpa, state->pre_a + np * ECMULT_TABLE_SIZE(WINDOW_A), state->aux + np * ECMULT_TABLE_SIZE(WINDOW_A), n, WINDOW_A);
  ------------------
  |  |   41|      0|#define ECMULT_TABLE_SIZE(w) (1L << ((w)-2))
  ------------------
                              secp256k1_ecmult_table_get_ge_lambda(&tmpa, state->pre_a + np * ECMULT_TABLE_SIZE(WINDOW_A), state->aux + np * ECMULT_TABLE_SIZE(WINDOW_A), n, WINDOW_A);
  ------------------
  |  |   41|      0|#define ECMULT_TABLE_SIZE(w) (1L << ((w)-2))
  ------------------
                              secp256k1_ecmult_table_get_ge_lambda(&tmpa, state->pre_a + np * ECMULT_TABLE_SIZE(WINDOW_A), state->aux + np * ECMULT_TABLE_SIZE(WINDOW_A), n, WINDOW_A);
  ------------------
  |  |   32|      0|#  define WINDOW_A 5
  ------------------
  331|      0|                secp256k1_gej_add_ge_var(r, r, &tmpa, NULL);
  332|      0|            }
  333|  19.7M|        }
  334|  19.7M|        if (i < bits_ng_1 && (n = wnaf_ng_1[i])) {
  ------------------
  |  Branch (334:13): [True: 19.2M, False: 433k]
  |  Branch (334:30): [True: 1.36M, False: 17.9M]
  ------------------
  335|  1.36M|            secp256k1_ecmult_table_get_ge_storage(&tmpa, secp256k1_pre_g, n, WINDOW_G);
  ------------------
  |  |   29|  1.36M|#    define WINDOW_G ECMULT_WINDOW_SIZE
  ------------------
  336|  1.36M|            secp256k1_gej_add_zinv_var(r, r, &tmpa, &Z);
  337|  1.36M|        }
  338|  19.7M|        if (i < bits_ng_128 && (n = wnaf_ng_128[i])) {
  ------------------
  |  Branch (338:13): [True: 19.0M, False: 622k]
  |  Branch (338:32): [True: 1.32M, False: 17.7M]
  ------------------
  339|  1.32M|            secp256k1_ecmult_table_get_ge_storage(&tmpa, secp256k1_pre_g_128, n, WINDOW_G);
  ------------------
  |  |   29|  1.32M|#    define WINDOW_G ECMULT_WINDOW_SIZE
  ------------------
  340|  1.32M|            secp256k1_gej_add_zinv_var(r, r, &tmpa, &Z);
  341|  1.32M|        }
  342|  19.7M|    }
  343|       |
  344|   158k|    if (!r->infinity) {
  ------------------
  |  Branch (344:9): [True: 158k, False: 0]
  ------------------
  345|   158k|        secp256k1_fe_mul(&r->z, &r->z, &Z);
  ------------------
  |  |   93|   158k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  346|   158k|    }
  347|   158k|}
secp256k1.c:secp256k1_ecmult_wnaf:
  162|   632k|static int secp256k1_ecmult_wnaf(int *wnaf, int len, const secp256k1_scalar *a, int w) {
  163|   632k|    secp256k1_scalar s;
  164|   632k|    int last_set_bit = -1;
  165|   632k|    int bit = 0;
  166|   632k|    int sign = 1;
  167|   632k|    int carry = 0;
  168|       |
  169|   632k|    VERIFY_CHECK(wnaf != NULL);
  170|   632k|    VERIFY_CHECK(0 <= len && len <= 256);
  171|   632k|    VERIFY_CHECK(a != NULL);
  172|   632k|    VERIFY_CHECK(2 <= w && w <= 31);
  173|       |
  174|  82.2M|    for (bit = 0; bit < len; bit++) {
  ------------------
  |  Branch (174:19): [True: 81.6M, False: 632k]
  ------------------
  175|  81.6M|        wnaf[bit] = 0;
  176|  81.6M|    }
  177|       |
  178|   632k|    s = *a;
  179|   632k|    if (secp256k1_scalar_get_bits_limb32(&s, 255, 1)) {
  ------------------
  |  Branch (179:9): [True: 0, False: 632k]
  ------------------
  180|      0|        secp256k1_scalar_negate(&s, &s);
  181|      0|        sign = -1;
  182|      0|    }
  183|       |
  184|   632k|    bit = 0;
  185|  46.0M|    while (bit < len) {
  ------------------
  |  Branch (185:12): [True: 45.4M, False: 632k]
  ------------------
  186|  45.4M|        int now;
  187|  45.4M|        int word;
  188|  45.4M|        if (secp256k1_scalar_get_bits_limb32(&s, bit, 1) == (unsigned int)carry) {
  ------------------
  |  Branch (188:13): [True: 42.6M, False: 2.84M]
  ------------------
  189|  42.6M|            bit++;
  190|  42.6M|            continue;
  191|  42.6M|        }
  192|       |
  193|  2.84M|        now = w;
  194|  2.84M|        if (now > len - bit) {
  ------------------
  |  Branch (194:13): [True: 235k, False: 2.61M]
  ------------------
  195|   235k|            now = len - bit;
  196|   235k|        }
  197|       |
  198|  2.84M|        word = secp256k1_scalar_get_bits_var(&s, bit, now) + carry;
  199|       |
  200|  2.84M|        carry = (word >> (w-1)) & 1;
  201|  2.84M|        word -= carry << w;
  202|       |
  203|  2.84M|        wnaf[bit] = sign * word;
  204|  2.84M|        last_set_bit = bit;
  205|       |
  206|  2.84M|        bit += now;
  207|  2.84M|    }
  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|   632k|    return last_set_bit + 1;
  221|   632k|}
secp256k1.c:secp256k1_ecmult_odd_multiples_table:
   73|   158k|static void secp256k1_ecmult_odd_multiples_table(int n, secp256k1_ge *pre_a, secp256k1_fe *zr, secp256k1_fe *z, const secp256k1_gej *a) {
   74|   158k|    secp256k1_gej d, ai;
   75|   158k|    secp256k1_ge d_ge;
   76|   158k|    int i;
   77|       |
   78|   158k|    VERIFY_CHECK(!a->infinity);
   79|       |
   80|   158k|    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|   158k|    secp256k1_ge_set_xy(&d_ge, &d.x, &d.y);
   96|   158k|    secp256k1_ge_set_gej_zinv(&pre_a[0], a, &d.z);
   97|   158k|    secp256k1_gej_set_ge(&ai, &pre_a[0]);
   98|   158k|    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|   158k|    zr[0] = d.z;
  104|       |
  105|  1.26M|    for (i = 1; i < n; i++) {
  ------------------
  |  Branch (105:17): [True: 1.10M, False: 158k]
  ------------------
  106|  1.10M|        secp256k1_gej_add_ge_var(&ai, &ai, &d_ge, &zr[i]);
  107|  1.10M|        secp256k1_ge_set_xy(&pre_a[i], &ai.x, &ai.y);
  108|  1.10M|    }
  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|   158k|    secp256k1_fe_mul(z, &ai.z, &d.z);
  ------------------
  |  |   93|   158k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  115|   158k|}
secp256k1.c:secp256k1_ecmult_table_get_ge:
  125|   158k|SECP256K1_INLINE static void secp256k1_ecmult_table_get_ge(secp256k1_ge *r, const secp256k1_ge *pre, int n, int w) {
  126|   158k|    secp256k1_ecmult_table_verify(n,w);
  127|   158k|    if (n > 0) {
  ------------------
  |  Branch (127:9): [True: 158k, False: 0]
  ------------------
  128|   158k|        *r = pre[(n-1)/2];
  129|   158k|    } else {
  130|      0|        *r = pre[(-n-1)/2];
  131|      0|        secp256k1_fe_negate(&(r->y), &(r->y), 1);
  ------------------
  |  |  211|      0|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|      0|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|      0|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|      0|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|      0|    } \
  |  |  |  |   84|      0|    stmt; \
  |  |  |  |   85|      0|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  132|      0|    }
  133|   158k|}
secp256k1.c:secp256k1_ecmult_table_verify:
  117|  2.84M|SECP256K1_INLINE static void secp256k1_ecmult_table_verify(int n, int w) {
  118|  2.84M|    (void)n;
  119|  2.84M|    (void)w;
  120|  2.84M|    VERIFY_CHECK(((n) & 1) == 1);
  121|  2.84M|    VERIFY_CHECK((n) >= -((1 << ((w)-1)) - 1));
  122|  2.84M|    VERIFY_CHECK((n) <=  ((1 << ((w)-1)) - 1));
  123|  2.84M|}
secp256k1.c:secp256k1_ecmult_table_get_ge_storage:
  145|  2.68M|SECP256K1_INLINE static void secp256k1_ecmult_table_get_ge_storage(secp256k1_ge *r, const secp256k1_ge_storage *pre, int n, int w) {
  146|  2.68M|    secp256k1_ecmult_table_verify(n,w);
  147|  2.68M|    if (n > 0) {
  ------------------
  |  Branch (147:9): [True: 1.46M, False: 1.22M]
  ------------------
  148|  1.46M|        secp256k1_ge_from_storage(r, &pre[(n-1)/2]);
  149|  1.46M|    } else {
  150|  1.22M|        secp256k1_ge_from_storage(r, &pre[(-n-1)/2]);
  151|  1.22M|        secp256k1_fe_negate(&(r->y), &(r->y), 1);
  ------------------
  |  |  211|  1.22M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  1.22M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  1.22M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 1.22M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  1.22M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 1.22M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  1.22M|    } \
  |  |  |  |   84|  1.22M|    stmt; \
  |  |  |  |   85|  1.22M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  152|  1.22M|    }
  153|  2.68M|}

secp256k1.c:secp256k1_fe_impl_sqr:
  345|   379M|SECP256K1_INLINE static void secp256k1_fe_impl_sqr(secp256k1_fe *r, const secp256k1_fe *a) {
  346|   379M|    secp256k1_fe_sqr_inner(r->n, a->n);
  347|   379M|}
secp256k1.c:secp256k1_fe_impl_mul:
  341|   439M|SECP256K1_INLINE static void secp256k1_fe_impl_mul(secp256k1_fe *r, const secp256k1_fe *a, const secp256k1_fe * SECP256K1_RESTRICT b) {
  342|   439M|    secp256k1_fe_mul_inner(r->n, a->n, b->n);
  343|   439M|}
secp256k1.c:secp256k1_fe_impl_add_int:
  329|   195k|SECP256K1_INLINE static void secp256k1_fe_impl_add_int(secp256k1_fe *r, int a) {
  330|   195k|    r->n[0] += a;
  331|   195k|}
secp256k1.c:secp256k1_fe_impl_to_storage:
  428|  2.90M|static void secp256k1_fe_impl_to_storage(secp256k1_fe_storage *r, const secp256k1_fe *a) {
  429|  2.90M|    r->n[0] = a->n[0] | a->n[1] << 52;
  430|  2.90M|    r->n[1] = a->n[1] >> 12 | a->n[2] << 40;
  431|  2.90M|    r->n[2] = a->n[2] >> 24 | a->n[3] << 28;
  432|  2.90M|    r->n[3] = a->n[3] >> 36 | a->n[4] << 16;
  433|  2.90M|}
secp256k1.c:secp256k1_fe_impl_from_storage:
  435|   102M|static SECP256K1_INLINE void secp256k1_fe_impl_from_storage(secp256k1_fe *r, const secp256k1_fe_storage *a) {
  436|   102M|    r->n[0] = a->n[0] & 0xFFFFFFFFFFFFFULL;
  437|   102M|    r->n[1] = a->n[0] >> 52 | ((a->n[1] << 12) & 0xFFFFFFFFFFFFFULL);
  438|   102M|    r->n[2] = a->n[1] >> 40 | ((a->n[2] << 24) & 0xFFFFFFFFFFFFFULL);
  439|   102M|    r->n[3] = a->n[2] >> 28 | ((a->n[3] << 36) & 0xFFFFFFFFFFFFFULL);
  440|   102M|    r->n[4] = a->n[3] >> 16;
  441|   102M|}
secp256k1.c:secp256k1_fe_impl_is_zero:
  206|  1.41M|SECP256K1_INLINE static int secp256k1_fe_impl_is_zero(const secp256k1_fe *a) {
  207|  1.41M|    const uint64_t *t = a->n;
  208|  1.41M|    return (t[0] | t[1] | t[2] | t[3] | t[4]) == 0;
  209|  1.41M|}
secp256k1.c:secp256k1_fe_impl_add:
  333|   435M|SECP256K1_INLINE static void secp256k1_fe_impl_add(secp256k1_fe *r, const secp256k1_fe *a) {
  334|   435M|    r->n[0] += a->n[0];
  335|   435M|    r->n[1] += a->n[1];
  336|   435M|    r->n[2] += a->n[2];
  337|   435M|    r->n[3] += a->n[3];
  338|   435M|    r->n[4] += a->n[4];
  339|   435M|}
secp256k1.c:secp256k1_fe_storage_cmov:
  416|  3.01G|static SECP256K1_INLINE void secp256k1_fe_storage_cmov(secp256k1_fe_storage *r, const secp256k1_fe_storage *a, int flag) {
  417|  3.01G|    uint64_t mask0, mask1;
  418|  3.01G|    volatile int vflag = flag;
  419|  3.01G|    SECP256K1_CHECKMEM_CHECK_VERIFY(r->n, sizeof(r->n));
  ------------------
  |  |   99|  3.01G|#define SECP256K1_CHECKMEM_CHECK_VERIFY(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  3.01G|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  420|  3.01G|    mask0 = vflag + ~((uint64_t)0);
  421|  3.01G|    mask1 = ~mask0;
  422|  3.01G|    r->n[0] = (r->n[0] & mask0) | (a->n[0] & mask1);
  423|  3.01G|    r->n[1] = (r->n[1] & mask0) | (a->n[1] & mask1);
  424|  3.01G|    r->n[2] = (r->n[2] & mask0) | (a->n[2] & mask1);
  425|  3.01G|    r->n[3] = (r->n[3] & mask0) | (a->n[3] & mask1);
  426|  3.01G|}
secp256k1.c:secp256k1_fe_impl_negate_unchecked:
  306|   240M|SECP256K1_INLINE static void secp256k1_fe_impl_negate_unchecked(secp256k1_fe *r, const secp256k1_fe *a, int m) {
  307|       |    /* For all legal values of m (0..31), the following properties hold: */
  308|   240M|    VERIFY_CHECK(0xFFFFEFFFFFC2FULL * 2 * (m + 1) >= 0xFFFFFFFFFFFFFULL * 2 * m);
  309|   240M|    VERIFY_CHECK(0xFFFFFFFFFFFFFULL * 2 * (m + 1) >= 0xFFFFFFFFFFFFFULL * 2 * m);
  310|   240M|    VERIFY_CHECK(0x0FFFFFFFFFFFFULL * 2 * (m + 1) >= 0x0FFFFFFFFFFFFULL * 2 * m);
  311|       |
  312|       |    /* Due to the properties above, the left hand in the subtractions below is never less than
  313|       |     * the right hand. */
  314|   240M|    r->n[0] = 0xFFFFEFFFFFC2FULL * 2 * (m + 1) - a->n[0];
  315|   240M|    r->n[1] = 0xFFFFFFFFFFFFFULL * 2 * (m + 1) - a->n[1];
  316|   240M|    r->n[2] = 0xFFFFFFFFFFFFFULL * 2 * (m + 1) - a->n[2];
  317|   240M|    r->n[3] = 0xFFFFFFFFFFFFFULL * 2 * (m + 1) - a->n[3];
  318|   240M|    r->n[4] = 0x0FFFFFFFFFFFFULL * 2 * (m + 1) - a->n[4];
  319|   240M|}
secp256k1.c:secp256k1_fe_impl_cmov:
  349|   329M|SECP256K1_INLINE static void secp256k1_fe_impl_cmov(secp256k1_fe *r, const secp256k1_fe *a, int flag) {
  350|   329M|    uint64_t mask0, mask1;
  351|   329M|    volatile int vflag = flag;
  352|   329M|    SECP256K1_CHECKMEM_CHECK_VERIFY(r->n, sizeof(r->n));
  ------------------
  |  |   99|   329M|#define SECP256K1_CHECKMEM_CHECK_VERIFY(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|   329M|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  353|   329M|    mask0 = vflag + ~((uint64_t)0);
  354|   329M|    mask1 = ~mask0;
  355|   329M|    r->n[0] = (r->n[0] & mask0) | (a->n[0] & mask1);
  356|   329M|    r->n[1] = (r->n[1] & mask0) | (a->n[1] & mask1);
  357|   329M|    r->n[2] = (r->n[2] & mask0) | (a->n[2] & mask1);
  358|   329M|    r->n[3] = (r->n[3] & mask0) | (a->n[3] & mask1);
  359|   329M|    r->n[4] = (r->n[4] & mask0) | (a->n[4] & mask1);
  360|   329M|}
secp256k1.c:secp256k1_fe_impl_mul_int_unchecked:
  321|   113M|SECP256K1_INLINE static void secp256k1_fe_impl_mul_int_unchecked(secp256k1_fe *r, int a) {
  322|   113M|    r->n[0] *= a;
  323|   113M|    r->n[1] *= a;
  324|   113M|    r->n[2] *= a;
  325|   113M|    r->n[3] *= a;
  326|   113M|    r->n[4] *= a;
  327|   113M|}
secp256k1.c:secp256k1_fe_impl_half:
  362|  66.8M|static SECP256K1_INLINE void secp256k1_fe_impl_half(secp256k1_fe *r) {
  363|  66.8M|    uint64_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4];
  364|  66.8M|    uint64_t one = (uint64_t)1;
  365|  66.8M|    uint64_t mask = -(t0 & one) >> 12;
  366|       |
  367|       |    /* Bounds analysis (over the rationals).
  368|       |     *
  369|       |     * Let m = r->magnitude
  370|       |     *     C = 0xFFFFFFFFFFFFFULL * 2
  371|       |     *     D = 0x0FFFFFFFFFFFFULL * 2
  372|       |     *
  373|       |     * Initial bounds: t0..t3 <= C * m
  374|       |     *                     t4 <= D * m
  375|       |     */
  376|       |
  377|  66.8M|    t0 += 0xFFFFEFFFFFC2FULL & mask;
  378|  66.8M|    t1 += mask;
  379|  66.8M|    t2 += mask;
  380|  66.8M|    t3 += mask;
  381|  66.8M|    t4 += mask >> 4;
  382|       |
  383|  66.8M|    VERIFY_CHECK((t0 & one) == 0);
  384|       |
  385|       |    /* t0..t3: added <= C/2
  386|       |     *     t4: added <= D/2
  387|       |     *
  388|       |     * Current bounds: t0..t3 <= C * (m + 1/2)
  389|       |     *                     t4 <= D * (m + 1/2)
  390|       |     */
  391|       |
  392|  66.8M|    r->n[0] = (t0 >> 1) + ((t1 & one) << 51);
  393|  66.8M|    r->n[1] = (t1 >> 1) + ((t2 & one) << 51);
  394|  66.8M|    r->n[2] = (t2 >> 1) + ((t3 & one) << 51);
  395|  66.8M|    r->n[3] = (t3 >> 1) + ((t4 & one) << 51);
  396|  66.8M|    r->n[4] = (t4 >> 1);
  397|       |
  398|       |    /* t0..t3: shifted right and added <= C/4 + 1/2
  399|       |     *     t4: shifted right
  400|       |     *
  401|       |     * Current bounds: t0..t3 <= C * (m/2 + 1/2)
  402|       |     *                     t4 <= D * (m/2 + 1/4)
  403|       |     *
  404|       |     * Therefore the output magnitude (M) has to be set such that:
  405|       |     *     t0..t3: C * M >= C * (m/2 + 1/2)
  406|       |     *         t4: D * M >= D * (m/2 + 1/4)
  407|       |     *
  408|       |     * It suffices for all limbs that, for any input magnitude m:
  409|       |     *     M >= m/2 + 1/2
  410|       |     *
  411|       |     * and since we want the smallest such integer value for M:
  412|       |     *     M == floor(m/2) + 1
  413|       |     */
  414|  66.8M|}
secp256k1.c:secp256k1_fe_impl_normalize_weak:
   80|   158k|static void secp256k1_fe_impl_normalize_weak(secp256k1_fe *r) {
   81|   158k|    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|   158k|    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;
   85|       |
   86|       |    /* The first pass ensures the magnitude is 1, ... */
   87|   158k|    t0 += x * 0x1000003D1ULL;
   88|   158k|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;
   89|   158k|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL;
   90|   158k|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL;
   91|   158k|    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|   158k|    VERIFY_CHECK(t4 >> 49 == 0);
   95|       |
   96|   158k|    r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;
   97|   158k|}
secp256k1.c:secp256k1_fe_impl_normalizes_to_zero:
  137|  94.3M|static int secp256k1_fe_impl_normalizes_to_zero(const secp256k1_fe *r) {
  138|  94.3M|    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|  94.3M|    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|  94.3M|    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;
  145|       |
  146|       |    /* The first pass ensures the magnitude is 1, ... */
  147|  94.3M|    t0 += x * 0x1000003D1ULL;
  148|  94.3M|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL; z0  = t0; z1  = t0 ^ 0x1000003D0ULL;
  149|  94.3M|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; z0 |= t1; z1 &= t1;
  150|  94.3M|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; z0 |= t2; z1 &= t2;
  151|  94.3M|    t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL; z0 |= t3; z1 &= t3;
  152|  94.3M|                                                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|  94.3M|    VERIFY_CHECK(t4 >> 49 == 0);
  156|       |
  157|  94.3M|    return (z0 == 0) | (z1 == 0xFFFFFFFFFFFFFULL);
  158|  94.3M|}
secp256k1.c:secp256k1_fe_impl_set_int:
  201|  3.93M|SECP256K1_INLINE static void secp256k1_fe_impl_set_int(secp256k1_fe *r, int a) {
  202|  3.93M|    r->n[0] = a;
  203|  3.93M|    r->n[1] = r->n[2] = r->n[3] = r->n[4] = 0;
  204|  3.93M|}
secp256k1.c:secp256k1_fe_impl_inv:
  479|  1.25M|static void secp256k1_fe_impl_inv(secp256k1_fe *r, const secp256k1_fe *x) {
  480|  1.25M|    secp256k1_fe tmp = *x;
  481|  1.25M|    secp256k1_modinv64_signed62 s;
  482|       |
  483|  1.25M|    secp256k1_fe_normalize(&tmp);
  ------------------
  |  |   78|  1.25M|#  define secp256k1_fe_normalize secp256k1_fe_impl_normalize
  ------------------
  484|  1.25M|    secp256k1_fe_to_signed62(&s, &tmp);
  485|  1.25M|    secp256k1_modinv64(&s, &secp256k1_const_modinfo_fe);
  486|  1.25M|    secp256k1_fe_from_signed62(r, &s);
  487|  1.25M|}
secp256k1.c:secp256k1_fe_to_signed62:
  463|  1.25M|static void secp256k1_fe_to_signed62(secp256k1_modinv64_signed62 *r, const secp256k1_fe *a) {
  464|  1.25M|    const uint64_t M62 = UINT64_MAX >> 2;
  465|  1.25M|    const uint64_t a0 = a->n[0], a1 = a->n[1], a2 = a->n[2], a3 = a->n[3], a4 = a->n[4];
  466|       |
  467|  1.25M|    r->v[0] = (a0       | a1 << 52) & M62;
  468|  1.25M|    r->v[1] = (a1 >> 10 | a2 << 42) & M62;
  469|  1.25M|    r->v[2] = (a2 >> 20 | a3 << 32) & M62;
  470|  1.25M|    r->v[3] = (a3 >> 30 | a4 << 22) & M62;
  471|  1.25M|    r->v[4] =  a4 >> 40;
  472|  1.25M|}
secp256k1.c:secp256k1_fe_from_signed62:
  443|  1.25M|static void secp256k1_fe_from_signed62(secp256k1_fe *r, const secp256k1_modinv64_signed62 *a) {
  444|  1.25M|    const uint64_t M52 = UINT64_MAX >> 12;
  445|  1.25M|    const uint64_t a0 = a->v[0], a1 = a->v[1], a2 = a->v[2], a3 = a->v[3], a4 = a->v[4];
  446|       |
  447|       |    /* The output from secp256k1_modinv64{_var} should be normalized to range [0,modulus), and
  448|       |     * have limbs in [0,2^62). The modulus is < 2^256, so the top limb must be below 2^(256-62*4).
  449|       |     */
  450|  1.25M|    VERIFY_CHECK(a0 >> 62 == 0);
  451|  1.25M|    VERIFY_CHECK(a1 >> 62 == 0);
  452|  1.25M|    VERIFY_CHECK(a2 >> 62 == 0);
  453|  1.25M|    VERIFY_CHECK(a3 >> 62 == 0);
  454|  1.25M|    VERIFY_CHECK(a4 >> 8 == 0);
  455|       |
  456|  1.25M|    r->n[0] =  a0                   & M52;
  457|  1.25M|    r->n[1] = (a0 >> 52 | a1 << 10) & M52;
  458|  1.25M|    r->n[2] = (a1 >> 42 | a2 << 20) & M52;
  459|  1.25M|    r->n[3] = (a2 >> 32 | a3 << 30) & M52;
  460|  1.25M|    r->n[4] = (a3 >> 22 | a4 << 40);
  461|  1.25M|}
secp256k1.c:secp256k1_fe_impl_set_b32_limit:
  265|   195k|static int secp256k1_fe_impl_set_b32_limit(secp256k1_fe *r, const unsigned char *a) {
  266|   195k|    secp256k1_fe_impl_set_b32_mod(r, a);
  267|   195k|    return !((r->n[4] == 0x0FFFFFFFFFFFFULL) & ((r->n[3] & r->n[2] & r->n[1]) == 0xFFFFFFFFFFFFFULL) & (r->n[0] >= 0xFFFFEFFFFFC2FULL));
  268|   195k|}
secp256k1.c:secp256k1_fe_impl_get_b32:
  271|  1.25M|static void secp256k1_fe_impl_get_b32(unsigned char *r, const secp256k1_fe *a) {
  272|  1.25M|    r[0] = (a->n[4] >> 40) & 0xFF;
  273|  1.25M|    r[1] = (a->n[4] >> 32) & 0xFF;
  274|  1.25M|    r[2] = (a->n[4] >> 24) & 0xFF;
  275|  1.25M|    r[3] = (a->n[4] >> 16) & 0xFF;
  276|  1.25M|    r[4] = (a->n[4] >> 8) & 0xFF;
  277|  1.25M|    r[5] = a->n[4] & 0xFF;
  278|  1.25M|    r[6] = (a->n[3] >> 44) & 0xFF;
  279|  1.25M|    r[7] = (a->n[3] >> 36) & 0xFF;
  280|  1.25M|    r[8] = (a->n[3] >> 28) & 0xFF;
  281|  1.25M|    r[9] = (a->n[3] >> 20) & 0xFF;
  282|  1.25M|    r[10] = (a->n[3] >> 12) & 0xFF;
  283|  1.25M|    r[11] = (a->n[3] >> 4) & 0xFF;
  284|  1.25M|    r[12] = ((a->n[2] >> 48) & 0xF) | ((a->n[3] & 0xF) << 4);
  285|  1.25M|    r[13] = (a->n[2] >> 40) & 0xFF;
  286|  1.25M|    r[14] = (a->n[2] >> 32) & 0xFF;
  287|  1.25M|    r[15] = (a->n[2] >> 24) & 0xFF;
  288|  1.25M|    r[16] = (a->n[2] >> 16) & 0xFF;
  289|  1.25M|    r[17] = (a->n[2] >> 8) & 0xFF;
  290|  1.25M|    r[18] = a->n[2] & 0xFF;
  291|  1.25M|    r[19] = (a->n[1] >> 44) & 0xFF;
  292|  1.25M|    r[20] = (a->n[1] >> 36) & 0xFF;
  293|  1.25M|    r[21] = (a->n[1] >> 28) & 0xFF;
  294|  1.25M|    r[22] = (a->n[1] >> 20) & 0xFF;
  295|  1.25M|    r[23] = (a->n[1] >> 12) & 0xFF;
  296|  1.25M|    r[24] = (a->n[1] >> 4) & 0xFF;
  297|  1.25M|    r[25] = ((a->n[0] >> 48) & 0xF) | ((a->n[1] & 0xF) << 4);
  298|  1.25M|    r[26] = (a->n[0] >> 40) & 0xFF;
  299|  1.25M|    r[27] = (a->n[0] >> 32) & 0xFF;
  300|  1.25M|    r[28] = (a->n[0] >> 24) & 0xFF;
  301|  1.25M|    r[29] = (a->n[0] >> 16) & 0xFF;
  302|  1.25M|    r[30] = (a->n[0] >> 8) & 0xFF;
  303|  1.25M|    r[31] = a->n[0] & 0xFF;
  304|  1.25M|}
secp256k1.c:secp256k1_fe_impl_normalize_var:
   99|  2.69M|static void secp256k1_fe_impl_normalize_var(secp256k1_fe *r) {
  100|  2.69M|    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|  2.69M|    uint64_t m;
  104|  2.69M|    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;
  105|       |
  106|       |    /* The first pass ensures the magnitude is 1, ... */
  107|  2.69M|    t0 += x * 0x1000003D1ULL;
  108|  2.69M|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;
  109|  2.69M|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; m = t1;
  110|  2.69M|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; m &= t2;
  111|  2.69M|    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|  2.69M|    VERIFY_CHECK(t4 >> 49 == 0);
  115|       |
  116|       |    /* At most a single final reduction is needed; check if the value is >= the field characteristic */
  117|  2.69M|    x = (t4 >> 48) | ((t4 == 0x0FFFFFFFFFFFFULL) & (m == 0xFFFFFFFFFFFFFULL)
  118|  2.69M|        & (t0 >= 0xFFFFEFFFFFC2FULL));
  119|       |
  120|  2.69M|    if (x) {
  ------------------
  |  Branch (120:9): [True: 2, False: 2.69M]
  ------------------
  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|  2.69M|    r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;
  135|  2.69M|}
secp256k1.c:secp256k1_fe_impl_is_odd:
  211|  1.44M|SECP256K1_INLINE static int secp256k1_fe_impl_is_odd(const secp256k1_fe *a) {
  212|  1.44M|    return a->n[0] & 1;
  213|  1.44M|}
secp256k1.c:secp256k1_fe_impl_normalizes_to_zero_var:
  160|  3.79M|static int secp256k1_fe_impl_normalizes_to_zero_var(const secp256k1_fe *r) {
  161|  3.79M|    uint64_t t0, t1, t2, t3, t4;
  162|  3.79M|    uint64_t z0, z1;
  163|  3.79M|    uint64_t x;
  164|       |
  165|  3.79M|    t0 = r->n[0];
  166|  3.79M|    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|  3.79M|    x = t4 >> 48;
  170|       |
  171|       |    /* The first pass ensures the magnitude is 1, ... */
  172|  3.79M|    t0 += x * 0x1000003D1ULL;
  173|       |
  174|       |    /* z0 tracks a possible raw value of 0, z1 tracks a possible raw value of P */
  175|  3.79M|    z0 = t0 & 0xFFFFFFFFFFFFFULL;
  176|  3.79M|    z1 = z0 ^ 0x1000003D0ULL;
  177|       |
  178|       |    /* Fast return path should catch the majority of cases */
  179|  3.79M|    if ((z0 != 0ULL) & (z1 != 0xFFFFFFFFFFFFFULL)) {
  ------------------
  |  Branch (179:9): [True: 3.79M, False: 222]
  ------------------
  180|  3.79M|        return 0;
  181|  3.79M|    }
  182|       |
  183|    222|    t1 = r->n[1];
  184|    222|    t2 = r->n[2];
  185|    222|    t3 = r->n[3];
  186|       |
  187|    222|    t4 &= 0x0FFFFFFFFFFFFULL;
  188|       |
  189|    222|    t1 += (t0 >> 52);
  190|    222|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; z0 |= t1; z1 &= t1;
  191|    222|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; z0 |= t2; z1 &= t2;
  192|    222|    t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL; z0 |= t3; z1 &= t3;
  193|    222|                                                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|    222|    VERIFY_CHECK(t4 >> 49 == 0);
  197|       |
  198|    222|    return (z0 == 0) | (z1 == 0xFFFFFFFFFFFFFULL);
  199|  3.79M|}
secp256k1.c:secp256k1_fe_impl_set_b32_mod:
  228|   195k|static void secp256k1_fe_impl_set_b32_mod(secp256k1_fe *r, const unsigned char *a) {
  229|   195k|    r->n[0] = (uint64_t)a[31]
  230|   195k|            | ((uint64_t)a[30] << 8)
  231|   195k|            | ((uint64_t)a[29] << 16)
  232|   195k|            | ((uint64_t)a[28] << 24)
  233|   195k|            | ((uint64_t)a[27] << 32)
  234|   195k|            | ((uint64_t)a[26] << 40)
  235|   195k|            | ((uint64_t)(a[25] & 0xF)  << 48);
  236|   195k|    r->n[1] = (uint64_t)((a[25] >> 4) & 0xF)
  237|   195k|            | ((uint64_t)a[24] << 4)
  238|   195k|            | ((uint64_t)a[23] << 12)
  239|   195k|            | ((uint64_t)a[22] << 20)
  240|   195k|            | ((uint64_t)a[21] << 28)
  241|   195k|            | ((uint64_t)a[20] << 36)
  242|   195k|            | ((uint64_t)a[19] << 44);
  243|   195k|    r->n[2] = (uint64_t)a[18]
  244|   195k|            | ((uint64_t)a[17] << 8)
  245|   195k|            | ((uint64_t)a[16] << 16)
  246|   195k|            | ((uint64_t)a[15] << 24)
  247|   195k|            | ((uint64_t)a[14] << 32)
  248|   195k|            | ((uint64_t)a[13] << 40)
  249|   195k|            | ((uint64_t)(a[12] & 0xF) << 48);
  250|   195k|    r->n[3] = (uint64_t)((a[12] >> 4) & 0xF)
  251|   195k|            | ((uint64_t)a[11] << 4)
  252|   195k|            | ((uint64_t)a[10] << 12)
  253|   195k|            | ((uint64_t)a[9]  << 20)
  254|   195k|            | ((uint64_t)a[8]  << 28)
  255|   195k|            | ((uint64_t)a[7]  << 36)
  256|   195k|            | ((uint64_t)a[6]  << 44);
  257|   195k|    r->n[4] = (uint64_t)a[5]
  258|   195k|            | ((uint64_t)a[4] << 8)
  259|   195k|            | ((uint64_t)a[3] << 16)
  260|   195k|            | ((uint64_t)a[2] << 24)
  261|   195k|            | ((uint64_t)a[1] << 32)
  262|   195k|            | ((uint64_t)a[0] << 40);
  263|   195k|}
secp256k1.c:secp256k1_fe_impl_normalize:
   43|  4.15M|static void secp256k1_fe_impl_normalize(secp256k1_fe *r) {
   44|  4.15M|    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|  4.15M|    uint64_t m;
   48|  4.15M|    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;
   49|       |
   50|       |    /* The first pass ensures the magnitude is 1, ... */
   51|  4.15M|    t0 += x * 0x1000003D1ULL;
   52|  4.15M|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;
   53|  4.15M|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; m = t1;
   54|  4.15M|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; m &= t2;
   55|  4.15M|    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|  4.15M|    VERIFY_CHECK(t4 >> 49 == 0);
   59|       |
   60|       |    /* At most a single final reduction is needed; check if the value is >= the field characteristic */
   61|  4.15M|    x = (t4 >> 48) | ((t4 == 0x0FFFFFFFFFFFFULL) & (m == 0xFFFFFFFFFFFFFULL)
   62|  4.15M|        & (t0 >= 0xFFFFEFFFFFC2FULL));
   63|       |
   64|       |    /* Apply the final reduction (for constant-time behaviour, we do it always) */
   65|  4.15M|    t0 += x * 0x1000003D1ULL;
   66|  4.15M|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;
   67|  4.15M|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL;
   68|  4.15M|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL;
   69|  4.15M|    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|  4.15M|    VERIFY_CHECK(t4 >> 48 == x);
   73|       |
   74|       |    /* Mask off the possible multiple of 2^256 from the final reduction */
   75|  4.15M|    t4 &= 0x0FFFFFFFFFFFFULL;
   76|       |
   77|  4.15M|    r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;
   78|  4.15M|}

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

secp256k1.c:secp256k1_fe_verify:
  149|   796M|static void secp256k1_fe_verify(const secp256k1_fe *a) { (void)a; }
secp256k1.c:secp256k1_fe_verify_magnitude:
  150|   787M|static void secp256k1_fe_verify_magnitude(const secp256k1_fe *a, int m) { (void)a; (void)m; }
secp256k1.c:secp256k1_fe_sqrt:
   37|   194k|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|   194k|    secp256k1_fe x2, x3, x6, x9, x11, x22, x44, x88, x176, x220, x223, t1;
   48|   194k|    int j, ret;
   49|       |
   50|   194k|    VERIFY_CHECK(r != a);
   51|   194k|    SECP256K1_FE_VERIFY(a);
  ------------------
  |  |  344|   194k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   52|   194k|    SECP256K1_FE_VERIFY_MAGNITUDE(a, 8);
  ------------------
  |  |  348|   194k|#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|   194k|    secp256k1_fe_sqr(&x2, a);
  ------------------
  |  |   94|   194k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   60|   194k|    secp256k1_fe_mul(&x2, &x2, a);
  ------------------
  |  |   93|   194k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
   61|       |
   62|   194k|    secp256k1_fe_sqr(&x3, &x2);
  ------------------
  |  |   94|   194k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   63|   194k|    secp256k1_fe_mul(&x3, &x3, a);
  ------------------
  |  |   93|   194k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
   64|       |
   65|   194k|    x6 = x3;
   66|   779k|    for (j=0; j<3; j++) {
  ------------------
  |  Branch (66:15): [True: 584k, False: 194k]
  ------------------
   67|   584k|        secp256k1_fe_sqr(&x6, &x6);
  ------------------
  |  |   94|   584k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   68|   584k|    }
   69|   194k|    secp256k1_fe_mul(&x6, &x6, &x3);
  ------------------
  |  |   93|   194k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
   70|       |
   71|   194k|    x9 = x6;
   72|   779k|    for (j=0; j<3; j++) {
  ------------------
  |  Branch (72:15): [True: 584k, False: 194k]
  ------------------
   73|   584k|        secp256k1_fe_sqr(&x9, &x9);
  ------------------
  |  |   94|   584k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   74|   584k|    }
   75|   194k|    secp256k1_fe_mul(&x9, &x9, &x3);
  ------------------
  |  |   93|   194k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
   76|       |
   77|   194k|    x11 = x9;
   78|   584k|    for (j=0; j<2; j++) {
  ------------------
  |  Branch (78:15): [True: 389k, False: 194k]
  ------------------
   79|   389k|        secp256k1_fe_sqr(&x11, &x11);
  ------------------
  |  |   94|   389k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   80|   389k|    }
   81|   194k|    secp256k1_fe_mul(&x11, &x11, &x2);
  ------------------
  |  |   93|   194k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
   82|       |
   83|   194k|    x22 = x11;
   84|  2.33M|    for (j=0; j<11; j++) {
  ------------------
  |  Branch (84:15): [True: 2.14M, False: 194k]
  ------------------
   85|  2.14M|        secp256k1_fe_sqr(&x22, &x22);
  ------------------
  |  |   94|  2.14M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   86|  2.14M|    }
   87|   194k|    secp256k1_fe_mul(&x22, &x22, &x11);
  ------------------
  |  |   93|   194k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
   88|       |
   89|   194k|    x44 = x22;
   90|  4.48M|    for (j=0; j<22; j++) {
  ------------------
  |  Branch (90:15): [True: 4.28M, False: 194k]
  ------------------
   91|  4.28M|        secp256k1_fe_sqr(&x44, &x44);
  ------------------
  |  |   94|  4.28M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   92|  4.28M|    }
   93|   194k|    secp256k1_fe_mul(&x44, &x44, &x22);
  ------------------
  |  |   93|   194k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
   94|       |
   95|   194k|    x88 = x44;
   96|  8.76M|    for (j=0; j<44; j++) {
  ------------------
  |  Branch (96:15): [True: 8.57M, False: 194k]
  ------------------
   97|  8.57M|        secp256k1_fe_sqr(&x88, &x88);
  ------------------
  |  |   94|  8.57M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
   98|  8.57M|    }
   99|   194k|    secp256k1_fe_mul(&x88, &x88, &x44);
  ------------------
  |  |   93|   194k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  100|       |
  101|   194k|    x176 = x88;
  102|  17.3M|    for (j=0; j<88; j++) {
  ------------------
  |  Branch (102:15): [True: 17.1M, False: 194k]
  ------------------
  103|  17.1M|        secp256k1_fe_sqr(&x176, &x176);
  ------------------
  |  |   94|  17.1M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  104|  17.1M|    }
  105|   194k|    secp256k1_fe_mul(&x176, &x176, &x88);
  ------------------
  |  |   93|   194k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  106|       |
  107|   194k|    x220 = x176;
  108|  8.76M|    for (j=0; j<44; j++) {
  ------------------
  |  Branch (108:15): [True: 8.57M, False: 194k]
  ------------------
  109|  8.57M|        secp256k1_fe_sqr(&x220, &x220);
  ------------------
  |  |   94|  8.57M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  110|  8.57M|    }
  111|   194k|    secp256k1_fe_mul(&x220, &x220, &x44);
  ------------------
  |  |   93|   194k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  112|       |
  113|   194k|    x223 = x220;
  114|   779k|    for (j=0; j<3; j++) {
  ------------------
  |  Branch (114:15): [True: 584k, False: 194k]
  ------------------
  115|   584k|        secp256k1_fe_sqr(&x223, &x223);
  ------------------
  |  |   94|   584k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  116|   584k|    }
  117|   194k|    secp256k1_fe_mul(&x223, &x223, &x3);
  ------------------
  |  |   93|   194k|#  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|   194k|    t1 = x223;
  122|  4.67M|    for (j=0; j<23; j++) {
  ------------------
  |  Branch (122:15): [True: 4.48M, False: 194k]
  ------------------
  123|  4.48M|        secp256k1_fe_sqr(&t1, &t1);
  ------------------
  |  |   94|  4.48M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  124|  4.48M|    }
  125|   194k|    secp256k1_fe_mul(&t1, &t1, &x22);
  ------------------
  |  |   93|   194k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  126|  1.36M|    for (j=0; j<6; j++) {
  ------------------
  |  Branch (126:15): [True: 1.16M, False: 194k]
  ------------------
  127|  1.16M|        secp256k1_fe_sqr(&t1, &t1);
  ------------------
  |  |   94|  1.16M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  128|  1.16M|    }
  129|   194k|    secp256k1_fe_mul(&t1, &t1, &x2);
  ------------------
  |  |   93|   194k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  130|   194k|    secp256k1_fe_sqr(&t1, &t1);
  ------------------
  |  |   94|   194k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  131|   194k|    secp256k1_fe_sqr(r, &t1);
  ------------------
  |  |   94|   194k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  132|       |
  133|       |    /* Check that a square root was actually calculated */
  134|       |
  135|   194k|    secp256k1_fe_sqr(&t1, r);
  ------------------
  |  |   94|   194k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  136|   194k|    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|   194k|    return ret;
  146|   194k|}
secp256k1.c:secp256k1_fe_equal:
   25|   195k|SECP256K1_INLINE static int secp256k1_fe_equal(const secp256k1_fe *a, const secp256k1_fe *b) {
   26|   195k|    secp256k1_fe na;
   27|   195k|    SECP256K1_FE_VERIFY(a);
  ------------------
  |  |  344|   195k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   28|   195k|    SECP256K1_FE_VERIFY(b);
  ------------------
  |  |  344|   195k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   29|   195k|    SECP256K1_FE_VERIFY_MAGNITUDE(a, 1);
  ------------------
  |  |  348|   195k|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   30|   195k|    SECP256K1_FE_VERIFY_MAGNITUDE(b, 31);
  ------------------
  |  |  348|   195k|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   31|       |
   32|   195k|    secp256k1_fe_negate(&na, a, 1);
  ------------------
  |  |  211|   195k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|   195k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|   195k|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 195k]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|   195k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 195k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|   195k|    } \
  |  |  |  |   84|   195k|    stmt; \
  |  |  |  |   85|   195k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   33|   195k|    secp256k1_fe_add(&na, b);
  ------------------
  |  |   92|   195k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
   34|   195k|    return secp256k1_fe_normalizes_to_zero(&na);
  ------------------
  |  |   81|   195k|#  define secp256k1_fe_normalizes_to_zero secp256k1_fe_impl_normalizes_to_zero
  ------------------
   35|   195k|}
secp256k1.c:secp256k1_fe_clear:
   21|  1.09M|SECP256K1_INLINE static void secp256k1_fe_clear(secp256k1_fe *a) {
   22|  1.09M|    secp256k1_memclear(a, sizeof(secp256k1_fe));
   23|  1.09M|}

secp256k1.c:secp256k1_ge_set_xy:
  132|  1.26M|static void secp256k1_ge_set_xy(secp256k1_ge *r, const secp256k1_fe *x, const secp256k1_fe *y) {
  133|  1.26M|    SECP256K1_FE_VERIFY(x);
  ------------------
  |  |  344|  1.26M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  134|  1.26M|    SECP256K1_FE_VERIFY(y);
  ------------------
  |  |  344|  1.26M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  135|       |
  136|  1.26M|    r->infinity = 0;
  137|  1.26M|    r->x = *x;
  138|  1.26M|    r->y = *y;
  139|       |
  140|  1.26M|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  206|  1.26M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  141|  1.26M|}
secp256k1.c:secp256k1_ge_verify:
   78|   111M|static void secp256k1_ge_verify(const secp256k1_ge *a) {
   79|   111M|    SECP256K1_FE_VERIFY(&a->x);
  ------------------
  |  |  344|   111M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   80|   111M|    SECP256K1_FE_VERIFY(&a->y);
  ------------------
  |  |  344|   111M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   81|   111M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->x, SECP256K1_GE_X_MAGNITUDE_MAX);
  ------------------
  |  |  348|   111M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   82|   111M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->y, SECP256K1_GE_Y_MAGNITUDE_MAX);
  ------------------
  |  |  348|   111M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   83|   111M|    VERIFY_CHECK(a->infinity == 0 || a->infinity == 1);
   84|   111M|    (void)a;
   85|   111M|}
secp256k1.c:secp256k1_ge_is_valid_var:
  408|    178|static int secp256k1_ge_is_valid_var(const secp256k1_ge *a) {
  409|    178|    secp256k1_fe y2, x3;
  410|    178|    SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  206|    178|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  411|       |
  412|    178|    if (a->infinity) {
  ------------------
  |  Branch (412:9): [True: 0, False: 178]
  ------------------
  413|      0|        return 0;
  414|      0|    }
  415|       |    /* y^2 = x^3 + 7 */
  416|    178|    secp256k1_fe_sqr(&y2, &a->y);
  ------------------
  |  |   94|    178|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  417|    178|    secp256k1_fe_sqr(&x3, &a->x); secp256k1_fe_mul(&x3, &x3, &a->x);
  ------------------
  |  |   94|    178|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
                  secp256k1_fe_sqr(&x3, &a->x); secp256k1_fe_mul(&x3, &x3, &a->x);
  ------------------
  |  |   93|    178|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  418|    178|    secp256k1_fe_add_int(&x3, SECP256K1_B);
  ------------------
  |  |  102|    178|#  define secp256k1_fe_add_int secp256k1_fe_impl_add_int
  ------------------
                  secp256k1_fe_add_int(&x3, SECP256K1_B);
  ------------------
  |  |   73|    178|#define SECP256K1_B 7
  ------------------
  419|    178|    return secp256k1_fe_equal(&y2, &x3);
  420|    178|}
secp256k1.c:secp256k1_ge_is_in_correct_subgroup:
  886|   194k|static int secp256k1_ge_is_in_correct_subgroup(const secp256k1_ge* ge) {
  887|       |#ifdef EXHAUSTIVE_TEST_ORDER
  888|       |    secp256k1_gej out;
  889|       |    int i;
  890|       |    SECP256K1_GE_VERIFY(ge);
  891|       |
  892|       |    /* A very simple EC multiplication ladder that avoids a dependency on ecmult. */
  893|       |    secp256k1_gej_set_infinity(&out);
  894|       |    for (i = 0; i < 32; ++i) {
  895|       |        secp256k1_gej_double_var(&out, &out, NULL);
  896|       |        if ((((uint32_t)EXHAUSTIVE_TEST_ORDER) >> (31 - i)) & 1) {
  897|       |            secp256k1_gej_add_ge_var(&out, &out, ge, NULL);
  898|       |        }
  899|       |    }
  900|       |    return secp256k1_gej_is_infinity(&out);
  901|       |#else
  902|   194k|    SECP256K1_GE_VERIFY(ge);
  ------------------
  |  |  206|   194k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  903|       |
  904|   194k|    (void)ge;
  905|       |    /* The real secp256k1 group has cofactor 1, so the subgroup is the entire curve. */
  906|   194k|    return 1;
  907|   194k|#endif
  908|   194k|}
secp256k1.c:secp256k1_ge_to_bytes:
  937|  1.45M|static void secp256k1_ge_to_bytes(unsigned char *buf, const secp256k1_ge *a) {
  938|  1.45M|    secp256k1_ge_storage s;
  939|       |
  940|       |    /* We require that the secp256k1_ge_storage type is exactly 64 bytes.
  941|       |     * This is formally not guaranteed by the C standard, but should hold on any
  942|       |     * sane compiler in the real world. */
  943|  1.45M|    STATIC_ASSERT(sizeof(secp256k1_ge_storage) == 64);
  ------------------
  |  |   64|  1.45M|#define STATIC_ASSERT(expr) do { \
  |  |   65|  1.45M|    switch(0) { \
  |  |  ------------------
  |  |  |  Branch (65:12): [Folded - Ignored]
  |  |  ------------------
  |  |   66|  1.45M|        case 0: \
  |  |  ------------------
  |  |  |  Branch (66:9): [True: 1.45M, False: 0]
  |  |  ------------------
  |  |   67|  1.45M|        /* If expr evaluates to 0, we have two case labels "0", which is illegal. */ \
  |  |   68|  1.45M|        case /* ERROR: static assertion failed */ (expr): \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 0, False: 1.45M]
  |  |  ------------------
  |  |   69|  1.45M|        ; \
  |  |   70|  1.45M|    } \
  |  |   71|  1.45M|} while(0)
  |  |  ------------------
  |  |  |  Branch (71:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  944|  1.45M|    VERIFY_CHECK(!secp256k1_ge_is_infinity(a));
  945|  1.45M|    secp256k1_ge_to_storage(&s, a);
  946|  1.45M|    memcpy(buf, &s, 64);
  947|  1.45M|}
secp256k1.c:secp256k1_ge_to_storage:
  839|  1.45M|static void secp256k1_ge_to_storage(secp256k1_ge_storage *r, const secp256k1_ge *a) {
  840|  1.45M|    secp256k1_fe x, y;
  841|  1.45M|    SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  206|  1.45M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  842|  1.45M|    VERIFY_CHECK(!a->infinity);
  843|       |
  844|  1.45M|    x = a->x;
  845|  1.45M|    secp256k1_fe_normalize(&x);
  ------------------
  |  |   78|  1.45M|#  define secp256k1_fe_normalize secp256k1_fe_impl_normalize
  ------------------
  846|  1.45M|    y = a->y;
  847|  1.45M|    secp256k1_fe_normalize(&y);
  ------------------
  |  |   78|  1.45M|#  define secp256k1_fe_normalize secp256k1_fe_impl_normalize
  ------------------
  848|  1.45M|    secp256k1_fe_to_storage(&r->x, &x);
  ------------------
  |  |   96|  1.45M|#  define secp256k1_fe_to_storage secp256k1_fe_impl_to_storage
  ------------------
  849|  1.45M|    secp256k1_fe_to_storage(&r->y, &y);
  ------------------
  |  |   96|  1.45M|#  define secp256k1_fe_to_storage secp256k1_fe_impl_to_storage
  ------------------
  850|  1.45M|}
secp256k1.c:secp256k1_ge_clear:
  305|  1.28M|static void secp256k1_ge_clear(secp256k1_ge *r) {
  306|  1.28M|    secp256k1_memclear(r, sizeof(secp256k1_ge));
  307|  1.28M|}
secp256k1.c:secp256k1_ge_from_bytes:
  949|  1.41M|static void secp256k1_ge_from_bytes(secp256k1_ge *r, const unsigned char *buf) {
  950|  1.41M|    secp256k1_ge_storage s;
  951|       |
  952|  1.41M|    STATIC_ASSERT(sizeof(secp256k1_ge_storage) == 64);
  ------------------
  |  |   64|  1.41M|#define STATIC_ASSERT(expr) do { \
  |  |   65|  1.41M|    switch(0) { \
  |  |  ------------------
  |  |  |  Branch (65:12): [Folded - Ignored]
  |  |  ------------------
  |  |   66|  1.41M|        case 0: \
  |  |  ------------------
  |  |  |  Branch (66:9): [True: 1.41M, False: 0]
  |  |  ------------------
  |  |   67|  1.41M|        /* If expr evaluates to 0, we have two case labels "0", which is illegal. */ \
  |  |   68|  1.41M|        case /* ERROR: static assertion failed */ (expr): \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 0, False: 1.41M]
  |  |  ------------------
  |  |   69|  1.41M|        ; \
  |  |   70|  1.41M|    } \
  |  |   71|  1.41M|} while(0)
  |  |  ------------------
  |  |  |  Branch (71:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  953|  1.41M|    memcpy(&s, buf, 64);
  954|  1.41M|    secp256k1_ge_from_storage(r, &s);
  955|  1.41M|}
secp256k1.c:secp256k1_ge_from_storage:
  852|  51.2M|static void secp256k1_ge_from_storage(secp256k1_ge *r, const secp256k1_ge_storage *a) {
  853|  51.2M|    secp256k1_fe_from_storage(&r->x, &a->x);
  ------------------
  |  |   97|  51.2M|#  define secp256k1_fe_from_storage secp256k1_fe_impl_from_storage
  ------------------
  854|  51.2M|    secp256k1_fe_from_storage(&r->y, &a->y);
  ------------------
  |  |   97|  51.2M|#  define secp256k1_fe_from_storage secp256k1_fe_impl_from_storage
  ------------------
  855|  51.2M|    r->infinity = 0;
  856|       |
  857|  51.2M|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  206|  51.2M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  858|  51.2M|}
secp256k1.c:secp256k1_gej_verify:
   87|   188M|static void secp256k1_gej_verify(const secp256k1_gej *a) {
   88|   188M|    SECP256K1_FE_VERIFY(&a->x);
  ------------------
  |  |  344|   188M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   89|   188M|    SECP256K1_FE_VERIFY(&a->y);
  ------------------
  |  |  344|   188M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   90|   188M|    SECP256K1_FE_VERIFY(&a->z);
  ------------------
  |  |  344|   188M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   91|   188M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->x, SECP256K1_GEJ_X_MAGNITUDE_MAX);
  ------------------
  |  |  348|   188M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   92|   188M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->y, SECP256K1_GEJ_Y_MAGNITUDE_MAX);
  ------------------
  |  |  348|   188M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   93|   188M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->z, SECP256K1_GEJ_Z_MAGNITUDE_MAX);
  ------------------
  |  |  348|   188M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   94|   188M|    VERIFY_CHECK(a->infinity == 0 || a->infinity == 1);
   95|   188M|    (void)a;
   96|   188M|}
secp256k1.c:secp256k1_ge_storage_cmov:
  872|  1.50G|static SECP256K1_INLINE void secp256k1_ge_storage_cmov(secp256k1_ge_storage *r, const secp256k1_ge_storage *a, int flag) {
  873|  1.50G|    secp256k1_fe_storage_cmov(&r->x, &a->x, flag);
  874|  1.50G|    secp256k1_fe_storage_cmov(&r->y, &a->y, flag);
  875|  1.50G|}
secp256k1.c:secp256k1_gej_rescale:
  823|  1.09M|static void secp256k1_gej_rescale(secp256k1_gej *r, const secp256k1_fe *s) {
  824|       |    /* Operations: 4 mul, 1 sqr */
  825|  1.09M|    secp256k1_fe zz;
  826|  1.09M|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|  1.09M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  827|  1.09M|    SECP256K1_FE_VERIFY(s);
  ------------------
  |  |  344|  1.09M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  828|  1.09M|    VERIFY_CHECK(!secp256k1_fe_normalizes_to_zero_var(s));
  829|       |
  830|  1.09M|    secp256k1_fe_sqr(&zz, s);
  ------------------
  |  |   94|  1.09M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  831|  1.09M|    secp256k1_fe_mul(&r->x, &r->x, &zz);                /* r->x *= s^2 */
  ------------------
  |  |   93|  1.09M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  832|  1.09M|    secp256k1_fe_mul(&r->y, &r->y, &zz);
  ------------------
  |  |   93|  1.09M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  833|  1.09M|    secp256k1_fe_mul(&r->y, &r->y, s);                  /* r->y *= s^3 */
  ------------------
  |  |   93|  1.09M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  834|  1.09M|    secp256k1_fe_mul(&r->z, &r->z, s);                  /* r->z *= s   */
  ------------------
  |  |   93|  1.09M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  835|       |
  836|  1.09M|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|  1.09M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  837|  1.09M|}
secp256k1.c:secp256k1_gej_double:
  422|  19.7M|static SECP256K1_INLINE void secp256k1_gej_double(secp256k1_gej *r, const secp256k1_gej *a) {
  423|       |    /* Operations: 3 mul, 4 sqr, 8 add/half/mul_int/negate */
  424|  19.7M|    secp256k1_fe l, s, t;
  425|  19.7M|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|  19.7M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  426|       |
  427|  19.7M|    r->infinity = a->infinity;
  428|       |
  429|       |    /* Formula used:
  430|       |     * L = (3/2) * X1^2
  431|       |     * S = Y1^2
  432|       |     * T = -X1*S
  433|       |     * X3 = L^2 + 2*T
  434|       |     * Y3 = -(L*(X3 + T) + S^2)
  435|       |     * Z3 = Y1*Z1
  436|       |     */
  437|       |
  438|  19.7M|    secp256k1_fe_mul(&r->z, &a->z, &a->y); /* Z3 = Y1*Z1 (1) */
  ------------------
  |  |   93|  19.7M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  439|  19.7M|    secp256k1_fe_sqr(&s, &a->y);           /* S = Y1^2 (1) */
  ------------------
  |  |   94|  19.7M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  440|  19.7M|    secp256k1_fe_sqr(&l, &a->x);           /* L = X1^2 (1) */
  ------------------
  |  |   94|  19.7M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  441|  19.7M|    secp256k1_fe_mul_int(&l, 3);           /* L = 3*X1^2 (3) */
  ------------------
  |  |  233|  19.7M|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   77|  19.7M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  19.7M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 19.7M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  19.7M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 19.7M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  19.7M|    } \
  |  |  |  |   84|  19.7M|    stmt; \
  |  |  |  |   85|  19.7M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  442|  19.7M|    secp256k1_fe_half(&l);                 /* L = 3/2*X1^2 (2) */
  ------------------
  |  |  101|  19.7M|#  define secp256k1_fe_half secp256k1_fe_impl_half
  ------------------
  443|  19.7M|    secp256k1_fe_negate(&t, &s, 1);        /* T = -S (2) */
  ------------------
  |  |  211|  19.7M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  19.7M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  19.7M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 19.7M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  19.7M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 19.7M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  19.7M|    } \
  |  |  |  |   84|  19.7M|    stmt; \
  |  |  |  |   85|  19.7M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  444|  19.7M|    secp256k1_fe_mul(&t, &t, &a->x);       /* T = -X1*S (1) */
  ------------------
  |  |   93|  19.7M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  445|  19.7M|    secp256k1_fe_sqr(&r->x, &l);           /* X3 = L^2 (1) */
  ------------------
  |  |   94|  19.7M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  446|  19.7M|    secp256k1_fe_add(&r->x, &t);           /* X3 = L^2 + T (2) */
  ------------------
  |  |   92|  19.7M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  447|  19.7M|    secp256k1_fe_add(&r->x, &t);           /* X3 = L^2 + 2*T (3) */
  ------------------
  |  |   92|  19.7M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  448|  19.7M|    secp256k1_fe_sqr(&s, &s);              /* S' = S^2 (1) */
  ------------------
  |  |   94|  19.7M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  449|  19.7M|    secp256k1_fe_add(&t, &r->x);           /* T' = X3 + T (4) */
  ------------------
  |  |   92|  19.7M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  450|  19.7M|    secp256k1_fe_mul(&r->y, &t, &l);       /* Y3 = L*(X3 + T) (1) */
  ------------------
  |  |   93|  19.7M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  451|  19.7M|    secp256k1_fe_add(&r->y, &s);           /* Y3 = L*(X3 + T) + S^2 (2) */
  ------------------
  |  |   92|  19.7M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  452|  19.7M|    secp256k1_fe_negate(&r->y, &r->y, 2);  /* Y3 = -(L*(X3 + T) + S^2) (3) */
  ------------------
  |  |  211|  19.7M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  19.7M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  19.7M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 19.7M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  19.7M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 19.7M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  19.7M|    } \
  |  |  |  |   84|  19.7M|    stmt; \
  |  |  |  |   85|  19.7M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  453|       |
  454|  19.7M|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|  19.7M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  455|  19.7M|}
secp256k1.c:secp256k1_gej_clear:
  301|  1.09M|static void secp256k1_gej_clear(secp256k1_gej *r) {
  302|  1.09M|    secp256k1_memclear(r, sizeof(secp256k1_gej));
  303|  1.09M|}
secp256k1.c:secp256k1_gej_set_infinity:
  284|   316k|static void secp256k1_gej_set_infinity(secp256k1_gej *r) {
  285|   316k|    r->infinity = 1;
  286|   316k|    secp256k1_fe_set_int(&r->x, 0);
  ------------------
  |  |   83|   316k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  287|   316k|    secp256k1_fe_set_int(&r->y, 0);
  ------------------
  |  |   83|   316k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  288|   316k|    secp256k1_fe_set_int(&r->z, 0);
  ------------------
  |  |   83|   316k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  289|       |
  290|   316k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|   316k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  291|   316k|}
secp256k1.c:secp256k1_gej_add_ge:
  686|  47.0M|static void secp256k1_gej_add_ge(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b) {
  687|       |    /* Operations: 7 mul, 5 sqr, 21 add/cmov/half/mul_int/negate/normalizes_to_zero */
  688|  47.0M|    secp256k1_fe zz, u1, u2, s1, s2, t, tt, m, n, q, rr;
  689|  47.0M|    secp256k1_fe m_alt, rr_alt;
  690|  47.0M|    int degenerate;
  691|  47.0M|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|  47.0M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  692|  47.0M|    SECP256K1_GE_VERIFY(b);
  ------------------
  |  |  206|  47.0M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  693|  47.0M|    VERIFY_CHECK(!b->infinity);
  694|       |
  695|       |    /*  In:
  696|       |     *    Eric Brier and Marc Joye, Weierstrass Elliptic Curves and Side-Channel Attacks.
  697|       |     *    In D. Naccache and P. Paillier, Eds., Public Key Cryptography, vol. 2274 of Lecture Notes in Computer Science, pages 335-345. Springer-Verlag, 2002.
  698|       |     *  we find as solution for a unified addition/doubling formula:
  699|       |     *    lambda = ((x1 + x2)^2 - x1 * x2 + a) / (y1 + y2), with a = 0 for secp256k1's curve equation.
  700|       |     *    x3 = lambda^2 - (x1 + x2)
  701|       |     *    2*y3 = lambda * (x1 + x2 - 2 * x3) - (y1 + y2).
  702|       |     *
  703|       |     *  Substituting x_i = Xi / Zi^2 and yi = Yi / Zi^3, for i=1,2,3, gives:
  704|       |     *    U1 = X1*Z2^2, U2 = X2*Z1^2
  705|       |     *    S1 = Y1*Z2^3, S2 = Y2*Z1^3
  706|       |     *    Z = Z1*Z2
  707|       |     *    T = U1+U2
  708|       |     *    M = S1+S2
  709|       |     *    Q = -T*M^2
  710|       |     *    R = T^2-U1*U2
  711|       |     *    X3 = R^2+Q
  712|       |     *    Y3 = -(R*(2*X3+Q)+M^4)/2
  713|       |     *    Z3 = M*Z
  714|       |     *  (Note that the paper uses xi = Xi / Zi and yi = Yi / Zi instead.)
  715|       |     *
  716|       |     *  This formula has the benefit of being the same for both addition
  717|       |     *  of distinct points and doubling. However, it breaks down in the
  718|       |     *  case that either point is infinity, or that y1 = -y2. We handle
  719|       |     *  these cases in the following ways:
  720|       |     *
  721|       |     *    - If b is infinity we simply bail by means of a VERIFY_CHECK.
  722|       |     *
  723|       |     *    - If a is infinity, we detect this, and at the end of the
  724|       |     *      computation replace the result (which will be meaningless,
  725|       |     *      but we compute to be constant-time) with b.x : b.y : 1.
  726|       |     *
  727|       |     *    - If a = -b, we have y1 = -y2, which is a degenerate case.
  728|       |     *      But here the answer is infinity, so we simply set the
  729|       |     *      infinity flag of the result, overriding the computed values
  730|       |     *      without even needing to cmov.
  731|       |     *
  732|       |     *    - If y1 = -y2 but x1 != x2, which does occur thanks to certain
  733|       |     *      properties of our curve (specifically, 1 has nontrivial cube
  734|       |     *      roots in our field, and the curve equation has no x coefficient)
  735|       |     *      then the answer is not infinity but also not given by the above
  736|       |     *      equation. In this case, we cmov in place an alternate expression
  737|       |     *      for lambda. Specifically (y1 - y2)/(x1 - x2). Where both these
  738|       |     *      expressions for lambda are defined, they are equal, and can be
  739|       |     *      obtained from each other by multiplication by (y1 + y2)/(y1 + y2)
  740|       |     *      then substitution of x^3 + 7 for y^2 (using the curve equation).
  741|       |     *      For all pairs of nonzero points (a, b) at least one is defined,
  742|       |     *      so this covers everything.
  743|       |     */
  744|       |
  745|  47.0M|    secp256k1_fe_sqr(&zz, &a->z);                       /* z = Z1^2 */
  ------------------
  |  |   94|  47.0M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  746|  47.0M|    u1 = a->x;                                          /* u1 = U1 = X1*Z2^2 (GEJ_X_M) */
  747|  47.0M|    secp256k1_fe_mul(&u2, &b->x, &zz);                  /* u2 = U2 = X2*Z1^2 (1) */
  ------------------
  |  |   93|  47.0M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  748|  47.0M|    s1 = a->y;                                          /* s1 = S1 = Y1*Z2^3 (GEJ_Y_M) */
  749|  47.0M|    secp256k1_fe_mul(&s2, &b->y, &zz);                  /* s2 = Y2*Z1^2 (1) */
  ------------------
  |  |   93|  47.0M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  750|  47.0M|    secp256k1_fe_mul(&s2, &s2, &a->z);                  /* s2 = S2 = Y2*Z1^3 (1) */
  ------------------
  |  |   93|  47.0M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  751|  47.0M|    t = u1; secp256k1_fe_add(&t, &u2);                  /* t = T = U1+U2 (GEJ_X_M+1) */
  ------------------
  |  |   92|  47.0M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  752|  47.0M|    m = s1; secp256k1_fe_add(&m, &s2);                  /* m = M = S1+S2 (GEJ_Y_M+1) */
  ------------------
  |  |   92|  47.0M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  753|  47.0M|    secp256k1_fe_sqr(&rr, &t);                          /* rr = T^2 (1) */
  ------------------
  |  |   94|  47.0M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  754|  47.0M|    secp256k1_fe_negate(&m_alt, &u2, 1);                /* Malt = -X2*Z1^2 (2) */
  ------------------
  |  |  211|  47.0M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  47.0M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  47.0M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 47.0M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  47.0M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 47.0M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  47.0M|    } \
  |  |  |  |   84|  47.0M|    stmt; \
  |  |  |  |   85|  47.0M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  755|  47.0M|    secp256k1_fe_mul(&tt, &u1, &m_alt);                 /* tt = -U1*U2 (1) */
  ------------------
  |  |   93|  47.0M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  756|  47.0M|    secp256k1_fe_add(&rr, &tt);                         /* rr = R = T^2-U1*U2 (2) */
  ------------------
  |  |   92|  47.0M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  757|       |    /* If lambda = R/M = R/0 we have a problem (except in the "trivial"
  758|       |     * case that Z = z1z2 = 0, and this is special-cased later on). */
  759|  47.0M|    degenerate = secp256k1_fe_normalizes_to_zero(&m);
  ------------------
  |  |   81|  47.0M|#  define secp256k1_fe_normalizes_to_zero secp256k1_fe_impl_normalizes_to_zero
  ------------------
  760|       |    /* This only occurs when y1 == -y2 and x1^3 == x2^3, but x1 != x2.
  761|       |     * This means either x1 == beta*x2 or beta*x1 == x2, where beta is
  762|       |     * a nontrivial cube root of one. In either case, an alternate
  763|       |     * non-indeterminate expression for lambda is (y1 - y2)/(x1 - x2),
  764|       |     * so we set R/M equal to this. */
  765|  47.0M|    rr_alt = s1;
  766|  47.0M|    secp256k1_fe_mul_int(&rr_alt, 2);       /* rr_alt = Y1*Z2^3 - Y2*Z1^3 (GEJ_Y_M*2) */
  ------------------
  |  |  233|  47.0M|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   77|  47.0M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  47.0M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 47.0M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  47.0M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 47.0M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  47.0M|    } \
  |  |  |  |   84|  47.0M|    stmt; \
  |  |  |  |   85|  47.0M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  767|  47.0M|    secp256k1_fe_add(&m_alt, &u1);          /* Malt = X1*Z2^2 - X2*Z1^2 (GEJ_X_M+2) */
  ------------------
  |  |   92|  47.0M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  768|       |
  769|  47.0M|    secp256k1_fe_cmov(&rr_alt, &rr, !degenerate);       /* rr_alt (GEJ_Y_M*2) */
  ------------------
  |  |   95|  47.0M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  770|  47.0M|    secp256k1_fe_cmov(&m_alt, &m, !degenerate);         /* m_alt (GEJ_X_M+2) */
  ------------------
  |  |   95|  47.0M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  771|       |    /* Now Ralt / Malt = lambda and is guaranteed not to be Ralt / 0.
  772|       |     * From here on out Ralt and Malt represent the numerator
  773|       |     * and denominator of lambda; R and M represent the explicit
  774|       |     * expressions x1^2 + x2^2 + x1x2 and y1 + y2. */
  775|  47.0M|    secp256k1_fe_sqr(&n, &m_alt);                       /* n = Malt^2 (1) */
  ------------------
  |  |   94|  47.0M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  776|  47.0M|    secp256k1_fe_negate(&q, &t,
  ------------------
  |  |  211|  47.0M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  47.0M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  47.0M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 47.0M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  47.0M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 47.0M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  47.0M|    } \
  |  |  |  |   84|  47.0M|    stmt; \
  |  |  |  |   85|  47.0M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  777|  47.0M|        SECP256K1_GEJ_X_MAGNITUDE_MAX + 1);             /* q = -T (GEJ_X_M+2) */
  778|  47.0M|    secp256k1_fe_mul(&q, &q, &n);                       /* q = Q = -T*Malt^2 (1) */
  ------------------
  |  |   93|  47.0M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  779|       |    /* These two lines use the observation that either M == Malt or M == 0,
  780|       |     * so M^3 * Malt is either Malt^4 (which is computed by squaring), or
  781|       |     * zero (which is "computed" by cmov). So the cost is one squaring
  782|       |     * versus two multiplications. */
  783|  47.0M|    secp256k1_fe_sqr(&n, &n);                           /* n = Malt^4 (1) */
  ------------------
  |  |   94|  47.0M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  784|  47.0M|    secp256k1_fe_cmov(&n, &m, degenerate);              /* n = M^3 * Malt (GEJ_Y_M+1) */
  ------------------
  |  |   95|  47.0M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  785|  47.0M|    secp256k1_fe_sqr(&t, &rr_alt);                      /* t = Ralt^2 (1) */
  ------------------
  |  |   94|  47.0M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  786|  47.0M|    secp256k1_fe_mul(&r->z, &a->z, &m_alt);             /* r->z = Z3 = Malt*Z (1) */
  ------------------
  |  |   93|  47.0M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  787|  47.0M|    secp256k1_fe_add(&t, &q);                           /* t = Ralt^2 + Q (2) */
  ------------------
  |  |   92|  47.0M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  788|  47.0M|    r->x = t;                                           /* r->x = X3 = Ralt^2 + Q (2) */
  789|  47.0M|    secp256k1_fe_mul_int(&t, 2);                        /* t = 2*X3 (4) */
  ------------------
  |  |  233|  47.0M|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   77|  47.0M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  47.0M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 47.0M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  47.0M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 47.0M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  47.0M|    } \
  |  |  |  |   84|  47.0M|    stmt; \
  |  |  |  |   85|  47.0M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  790|  47.0M|    secp256k1_fe_add(&t, &q);                           /* t = 2*X3 + Q (5) */
  ------------------
  |  |   92|  47.0M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  791|  47.0M|    secp256k1_fe_mul(&t, &t, &rr_alt);                  /* t = Ralt*(2*X3 + Q) (1) */
  ------------------
  |  |   93|  47.0M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  792|  47.0M|    secp256k1_fe_add(&t, &n);                           /* t = Ralt*(2*X3 + Q) + M^3*Malt (GEJ_Y_M+2) */
  ------------------
  |  |   92|  47.0M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  793|  47.0M|    secp256k1_fe_negate(&r->y, &t,
  ------------------
  |  |  211|  47.0M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  47.0M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  47.0M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 47.0M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  47.0M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 47.0M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  47.0M|    } \
  |  |  |  |   84|  47.0M|    stmt; \
  |  |  |  |   85|  47.0M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  794|  47.0M|        SECP256K1_GEJ_Y_MAGNITUDE_MAX + 2);             /* r->y = -(Ralt*(2*X3 + Q) + M^3*Malt) (GEJ_Y_M+3) */
  795|  47.0M|    secp256k1_fe_half(&r->y);                           /* r->y = Y3 = -(Ralt*(2*X3 + Q) + M^3*Malt)/2 ((GEJ_Y_M+3)/2 + 1) */
  ------------------
  |  |  101|  47.0M|#  define secp256k1_fe_half secp256k1_fe_impl_half
  ------------------
  796|       |
  797|       |    /* In case a->infinity == 1, replace r with (b->x, b->y, 1). */
  798|  47.0M|    secp256k1_fe_cmov(&r->x, &b->x, a->infinity);
  ------------------
  |  |   95|  47.0M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  799|  47.0M|    secp256k1_fe_cmov(&r->y, &b->y, a->infinity);
  ------------------
  |  |   95|  47.0M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  800|  47.0M|    secp256k1_fe_cmov(&r->z, &secp256k1_fe_one, a->infinity);
  ------------------
  |  |   95|  47.0M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  801|       |
  802|       |    /* Set r->infinity if r->z is 0.
  803|       |     *
  804|       |     * If a->infinity is set, then r->infinity = (r->z == 0) = (1 == 0) = false,
  805|       |     * which is correct because the function assumes that b is not infinity.
  806|       |     *
  807|       |     * Now assume !a->infinity. This implies Z = Z1 != 0.
  808|       |     *
  809|       |     * Case y1 = -y2:
  810|       |     * In this case we could have a = -b, namely if x1 = x2.
  811|       |     * We have degenerate = true, r->z = (x1 - x2) * Z.
  812|       |     * Then r->infinity = ((x1 - x2)Z == 0) = (x1 == x2) = (a == -b).
  813|       |     *
  814|       |     * Case y1 != -y2:
  815|       |     * In this case, we can't have a = -b.
  816|       |     * We have degenerate = false, r->z = (y1 + y2) * Z.
  817|       |     * Then r->infinity = ((y1 + y2)Z == 0) = (y1 == -y2) = false. */
  818|  47.0M|    r->infinity = secp256k1_fe_normalizes_to_zero(&r->z);
  ------------------
  |  |   81|  47.0M|#  define secp256k1_fe_normalizes_to_zero secp256k1_fe_impl_normalizes_to_zero
  ------------------
  819|       |
  820|  47.0M|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|  47.0M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  821|  47.0M|}
secp256k1.c:secp256k1_gej_is_infinity:
  402|   316k|static int secp256k1_gej_is_infinity(const secp256k1_gej *a) {
  403|   316k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|   316k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  404|       |
  405|   316k|    return a->infinity;
  406|   316k|}
secp256k1.c:secp256k1_ge_set_gej:
  159|  1.25M|static void secp256k1_ge_set_gej(secp256k1_ge *r, secp256k1_gej *a) {
  160|  1.25M|    secp256k1_fe z2, z3;
  161|  1.25M|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|  1.25M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  162|       |
  163|  1.25M|    r->infinity = a->infinity;
  164|  1.25M|    secp256k1_fe_inv(&a->z, &a->z);
  ------------------
  |  |   98|  1.25M|#  define secp256k1_fe_inv secp256k1_fe_impl_inv
  ------------------
  165|  1.25M|    secp256k1_fe_sqr(&z2, &a->z);
  ------------------
  |  |   94|  1.25M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  166|  1.25M|    secp256k1_fe_mul(&z3, &a->z, &z2);
  ------------------
  |  |   93|  1.25M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  167|  1.25M|    secp256k1_fe_mul(&a->x, &a->x, &z2);
  ------------------
  |  |   93|  1.25M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  168|  1.25M|    secp256k1_fe_mul(&a->y, &a->y, &z3);
  ------------------
  |  |   93|  1.25M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  169|  1.25M|    secp256k1_fe_set_int(&a->z, 1);
  ------------------
  |  |   83|  1.25M|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  170|  1.25M|    r->x = a->x;
  171|  1.25M|    r->y = a->y;
  172|       |
  173|  1.25M|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|  1.25M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  174|  1.25M|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  206|  1.25M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  175|  1.25M|}
secp256k1.c:secp256k1_ge_set_xo_var:
  309|   194k|static int secp256k1_ge_set_xo_var(secp256k1_ge *r, const secp256k1_fe *x, int odd) {
  310|   194k|    secp256k1_fe x2, x3;
  311|   194k|    int ret;
  312|   194k|    SECP256K1_FE_VERIFY(x);
  ------------------
  |  |  344|   194k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  313|       |
  314|   194k|    r->x = *x;
  315|   194k|    secp256k1_fe_sqr(&x2, x);
  ------------------
  |  |   94|   194k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  316|   194k|    secp256k1_fe_mul(&x3, x, &x2);
  ------------------
  |  |   93|   194k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  317|   194k|    r->infinity = 0;
  318|   194k|    secp256k1_fe_add_int(&x3, SECP256K1_B);
  ------------------
  |  |  102|   194k|#  define secp256k1_fe_add_int secp256k1_fe_impl_add_int
  ------------------
                  secp256k1_fe_add_int(&x3, SECP256K1_B);
  ------------------
  |  |   73|   194k|#define SECP256K1_B 7
  ------------------
  319|   194k|    ret = secp256k1_fe_sqrt(&r->y, &x3);
  320|   194k|    secp256k1_fe_normalize_var(&r->y);
  ------------------
  |  |   80|   194k|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
  321|   194k|    if (secp256k1_fe_is_odd(&r->y) != odd) {
  ------------------
  |  |   85|   194k|#  define secp256k1_fe_is_odd secp256k1_fe_impl_is_odd
  ------------------
  |  Branch (321:9): [True: 36.2k, False: 158k]
  ------------------
  322|  36.2k|        secp256k1_fe_negate(&r->y, &r->y, 1);
  ------------------
  |  |  211|  36.2k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  36.2k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  36.2k|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 36.2k]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  36.2k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 36.2k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  36.2k|    } \
  |  |  |  |   84|  36.2k|    stmt; \
  |  |  |  |   85|  36.2k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  323|  36.2k|    }
  324|       |
  325|   194k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  206|   194k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  326|   194k|    return ret;
  327|   194k|}
secp256k1.c:secp256k1_gej_set_ge:
  329|  1.41M|static void secp256k1_gej_set_ge(secp256k1_gej *r, const secp256k1_ge *a) {
  330|  1.41M|   SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  206|  1.41M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  331|       |
  332|  1.41M|   r->infinity = a->infinity;
  333|  1.41M|   r->x = a->x;
  334|  1.41M|   r->y = a->y;
  335|  1.41M|   secp256k1_fe_set_int(&r->z, 1);
  ------------------
  |  |   83|  1.41M|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  336|       |
  337|  1.41M|   SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|  1.41M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  338|  1.41M|}
secp256k1.c:secp256k1_ge_set_gej_zinv:
   99|   158k|static void secp256k1_ge_set_gej_zinv(secp256k1_ge *r, const secp256k1_gej *a, const secp256k1_fe *zi) {
  100|   158k|    secp256k1_fe zi2;
  101|   158k|    secp256k1_fe zi3;
  102|   158k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|   158k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  103|   158k|    SECP256K1_FE_VERIFY(zi);
  ------------------
  |  |  344|   158k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  104|   158k|    VERIFY_CHECK(!a->infinity);
  105|       |
  106|   158k|    secp256k1_fe_sqr(&zi2, zi);
  ------------------
  |  |   94|   158k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  107|   158k|    secp256k1_fe_mul(&zi3, &zi2, zi);
  ------------------
  |  |   93|   158k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  108|   158k|    secp256k1_fe_mul(&r->x, &a->x, &zi2);
  ------------------
  |  |   93|   158k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  109|   158k|    secp256k1_fe_mul(&r->y, &a->y, &zi3);
  ------------------
  |  |   93|   158k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  110|   158k|    r->infinity = a->infinity;
  111|       |
  112|   158k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  206|   158k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  113|   158k|}
secp256k1.c:secp256k1_ge_table_set_globalz:
  251|   158k|static void secp256k1_ge_table_set_globalz(size_t len, secp256k1_ge *a, const secp256k1_fe *zr) {
  252|   158k|    size_t i;
  253|   158k|    secp256k1_fe zs;
  254|       |#ifdef VERIFY
  255|       |    for (i = 0; i < len; i++) {
  256|       |        SECP256K1_GE_VERIFY(&a[i]);
  257|       |        SECP256K1_FE_VERIFY(&zr[i]);
  258|       |    }
  259|       |#endif
  260|       |
  261|   158k|    if (len > 0) {
  ------------------
  |  Branch (261:9): [True: 158k, False: 0]
  ------------------
  262|   158k|        i = len - 1;
  263|       |        /* Ensure all y values are in weak normal form for fast negation of points */
  264|   158k|        secp256k1_fe_normalize_weak(&a[i].y);
  ------------------
  |  |   79|   158k|#  define secp256k1_fe_normalize_weak secp256k1_fe_impl_normalize_weak
  ------------------
  265|   158k|        zs = zr[i];
  266|       |
  267|       |        /* Work our way backwards, using the z-ratios to scale the x/y values. */
  268|  1.26M|        while (i > 0) {
  ------------------
  |  Branch (268:16): [True: 1.10M, False: 158k]
  ------------------
  269|  1.10M|            if (i != len - 1) {
  ------------------
  |  Branch (269:17): [True: 949k, False: 158k]
  ------------------
  270|   949k|                secp256k1_fe_mul(&zs, &zs, &zr[i]);
  ------------------
  |  |   93|   949k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  271|   949k|            }
  272|  1.10M|            i--;
  273|  1.10M|            secp256k1_ge_set_ge_zinv(&a[i], &a[i], &zs);
  274|  1.10M|        }
  275|   158k|    }
  276|       |
  277|       |#ifdef VERIFY
  278|       |    for (i = 0; i < len; i++) {
  279|       |        SECP256K1_GE_VERIFY(&a[i]);
  280|       |    }
  281|       |#endif
  282|   158k|}
secp256k1.c:secp256k1_ge_set_ge_zinv:
  116|  1.10M|static void secp256k1_ge_set_ge_zinv(secp256k1_ge *r, const secp256k1_ge *a, const secp256k1_fe *zi) {
  117|  1.10M|    secp256k1_fe zi2;
  118|  1.10M|    secp256k1_fe zi3;
  119|  1.10M|    SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  206|  1.10M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  120|  1.10M|    SECP256K1_FE_VERIFY(zi);
  ------------------
  |  |  344|  1.10M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  121|  1.10M|    VERIFY_CHECK(!a->infinity);
  122|       |
  123|  1.10M|    secp256k1_fe_sqr(&zi2, zi);
  ------------------
  |  |   94|  1.10M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  124|  1.10M|    secp256k1_fe_mul(&zi3, &zi2, zi);
  ------------------
  |  |   93|  1.10M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  125|  1.10M|    secp256k1_fe_mul(&r->x, &a->x, &zi2);
  ------------------
  |  |   93|  1.10M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  126|  1.10M|    secp256k1_fe_mul(&r->y, &a->y, &zi3);
  ------------------
  |  |   93|  1.10M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  127|  1.10M|    r->infinity = a->infinity;
  128|       |
  129|  1.10M|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  206|  1.10M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  130|  1.10M|}
secp256k1.c:secp256k1_gej_double_var:
  457|  19.8M|static void secp256k1_gej_double_var(secp256k1_gej *r, const secp256k1_gej *a, secp256k1_fe *rzr) {
  458|  19.8M|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|  19.8M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  459|       |
  460|       |    /** For secp256k1, 2Q is infinity if and only if Q is infinity. This is because if 2Q = infinity,
  461|       |     *  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
  462|       |     *  y=0, x^3 must be -7 mod p. However, -7 has no cube root mod p.
  463|       |     *
  464|       |     *  Having said this, if this function receives a point on a sextic twist, e.g. by
  465|       |     *  a fault attack, it is possible for y to be 0. This happens for y^2 = x^3 + 6,
  466|       |     *  since -6 does have a cube root mod p. For this point, this function will not set
  467|       |     *  the infinity flag even though the point doubles to infinity, and the result
  468|       |     *  point will be gibberish (z = 0 but infinity = 0).
  469|       |     */
  470|  19.8M|    if (a->infinity) {
  ------------------
  |  Branch (470:9): [True: 158k, False: 19.7M]
  ------------------
  471|   158k|        secp256k1_gej_set_infinity(r);
  472|   158k|        if (rzr != NULL) {
  ------------------
  |  Branch (472:13): [True: 0, False: 158k]
  ------------------
  473|      0|            secp256k1_fe_set_int(rzr, 1);
  ------------------
  |  |   83|      0|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  474|      0|        }
  475|   158k|        return;
  476|   158k|    }
  477|       |
  478|  19.7M|    if (rzr != NULL) {
  ------------------
  |  Branch (478:9): [True: 0, False: 19.7M]
  ------------------
  479|      0|        *rzr = a->y;
  480|      0|        secp256k1_fe_normalize_weak(rzr);
  ------------------
  |  |   79|      0|#  define secp256k1_fe_normalize_weak secp256k1_fe_impl_normalize_weak
  ------------------
  481|      0|    }
  482|       |
  483|  19.7M|    secp256k1_gej_double(r, a);
  484|       |
  485|  19.7M|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|  19.7M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  486|  19.7M|}
secp256k1.c:secp256k1_gej_add_ge_var:
  552|  1.26M|static void secp256k1_gej_add_ge_var(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b, secp256k1_fe *rzr) {
  553|       |    /* Operations: 8 mul, 3 sqr, 11 add/negate/normalizes_to_zero (ignoring special cases) */
  554|  1.26M|    secp256k1_fe z12, u1, u2, s1, s2, h, i, h2, h3, t;
  555|  1.26M|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|  1.26M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  556|  1.26M|    SECP256K1_GE_VERIFY(b);
  ------------------
  |  |  206|  1.26M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  557|       |
  558|  1.26M|    if (a->infinity) {
  ------------------
  |  Branch (558:9): [True: 0, False: 1.26M]
  ------------------
  559|      0|        VERIFY_CHECK(rzr == NULL);
  560|      0|        secp256k1_gej_set_ge(r, b);
  561|      0|        return;
  562|      0|    }
  563|  1.26M|    if (b->infinity) {
  ------------------
  |  Branch (563:9): [True: 0, False: 1.26M]
  ------------------
  564|      0|        if (rzr != NULL) {
  ------------------
  |  Branch (564:13): [True: 0, False: 0]
  ------------------
  565|      0|            secp256k1_fe_set_int(rzr, 1);
  ------------------
  |  |   83|      0|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  566|      0|        }
  567|      0|        *r = *a;
  568|      0|        return;
  569|      0|    }
  570|       |
  571|  1.26M|    secp256k1_fe_sqr(&z12, &a->z);
  ------------------
  |  |   94|  1.26M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  572|  1.26M|    u1 = a->x;
  573|  1.26M|    secp256k1_fe_mul(&u2, &b->x, &z12);
  ------------------
  |  |   93|  1.26M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  574|  1.26M|    s1 = a->y;
  575|  1.26M|    secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &a->z);
  ------------------
  |  |   93|  1.26M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
                  secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &a->z);
  ------------------
  |  |   93|  1.26M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  576|  1.26M|    secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |  211|  1.26M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  1.26M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  1.26M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 1.26M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  1.26M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 1.26M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  1.26M|    } \
  |  |  |  |   84|  1.26M|    stmt; \
  |  |  |  |   85|  1.26M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |   92|  1.26M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  577|  1.26M|    secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |  211|  1.26M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  1.26M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  1.26M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 1.26M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  1.26M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 1.26M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  1.26M|    } \
  |  |  |  |   84|  1.26M|    stmt; \
  |  |  |  |   85|  1.26M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |   92|  1.26M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  578|  1.26M|    if (secp256k1_fe_normalizes_to_zero_var(&h)) {
  ------------------
  |  |   82|  1.26M|#  define secp256k1_fe_normalizes_to_zero_var secp256k1_fe_impl_normalizes_to_zero_var
  ------------------
  |  Branch (578:9): [True: 0, False: 1.26M]
  ------------------
  579|      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 (579:13): [True: 0, False: 0]
  ------------------
  580|      0|            secp256k1_gej_double_var(r, a, rzr);
  581|      0|        } else {
  582|      0|            if (rzr != NULL) {
  ------------------
  |  Branch (582:17): [True: 0, False: 0]
  ------------------
  583|      0|                secp256k1_fe_set_int(rzr, 0);
  ------------------
  |  |   83|      0|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  584|      0|            }
  585|      0|            secp256k1_gej_set_infinity(r);
  586|      0|        }
  587|      0|        return;
  588|      0|    }
  589|       |
  590|  1.26M|    r->infinity = 0;
  591|  1.26M|    if (rzr != NULL) {
  ------------------
  |  Branch (591:9): [True: 1.10M, False: 158k]
  ------------------
  592|  1.10M|        *rzr = h;
  593|  1.10M|    }
  594|  1.26M|    secp256k1_fe_mul(&r->z, &a->z, &h);
  ------------------
  |  |   93|  1.26M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  595|       |
  596|  1.26M|    secp256k1_fe_sqr(&h2, &h);
  ------------------
  |  |   94|  1.26M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  597|  1.26M|    secp256k1_fe_negate(&h2, &h2, 1);
  ------------------
  |  |  211|  1.26M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  1.26M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  1.26M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 1.26M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  1.26M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 1.26M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  1.26M|    } \
  |  |  |  |   84|  1.26M|    stmt; \
  |  |  |  |   85|  1.26M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  598|  1.26M|    secp256k1_fe_mul(&h3, &h2, &h);
  ------------------
  |  |   93|  1.26M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  599|  1.26M|    secp256k1_fe_mul(&t, &u1, &h2);
  ------------------
  |  |   93|  1.26M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  600|       |
  601|  1.26M|    secp256k1_fe_sqr(&r->x, &i);
  ------------------
  |  |   94|  1.26M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  602|  1.26M|    secp256k1_fe_add(&r->x, &h3);
  ------------------
  |  |   92|  1.26M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  603|  1.26M|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|  1.26M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  604|  1.26M|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|  1.26M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  605|       |
  606|  1.26M|    secp256k1_fe_add(&t, &r->x);
  ------------------
  |  |   92|  1.26M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  607|  1.26M|    secp256k1_fe_mul(&r->y, &t, &i);
  ------------------
  |  |   93|  1.26M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  608|  1.26M|    secp256k1_fe_mul(&h3, &h3, &s1);
  ------------------
  |  |   93|  1.26M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  609|  1.26M|    secp256k1_fe_add(&r->y, &h3);
  ------------------
  |  |   92|  1.26M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  610|       |
  611|  1.26M|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|  1.26M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  612|  1.26M|    if (rzr != NULL) SECP256K1_FE_VERIFY(rzr);
  ------------------
  |  |  344|  1.10M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  |  Branch (612:9): [True: 1.10M, False: 158k]
  ------------------
  613|  1.26M|}
secp256k1.c:secp256k1_gej_add_zinv_var:
  615|  2.68M|static void secp256k1_gej_add_zinv_var(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b, const secp256k1_fe *bzinv) {
  616|       |    /* Operations: 9 mul, 3 sqr, 11 add/negate/normalizes_to_zero (ignoring special cases) */
  617|  2.68M|    secp256k1_fe az, z12, u1, u2, s1, s2, h, i, h2, h3, t;
  618|  2.68M|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|  2.68M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  619|  2.68M|    SECP256K1_GE_VERIFY(b);
  ------------------
  |  |  206|  2.68M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  620|  2.68M|    SECP256K1_FE_VERIFY(bzinv);
  ------------------
  |  |  344|  2.68M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  621|       |
  622|  2.68M|    if (a->infinity) {
  ------------------
  |  Branch (622:9): [True: 158k, False: 2.53M]
  ------------------
  623|   158k|        secp256k1_fe bzinv2, bzinv3;
  624|   158k|        r->infinity = b->infinity;
  625|   158k|        secp256k1_fe_sqr(&bzinv2, bzinv);
  ------------------
  |  |   94|   158k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  626|   158k|        secp256k1_fe_mul(&bzinv3, &bzinv2, bzinv);
  ------------------
  |  |   93|   158k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  627|   158k|        secp256k1_fe_mul(&r->x, &b->x, &bzinv2);
  ------------------
  |  |   93|   158k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  628|   158k|        secp256k1_fe_mul(&r->y, &b->y, &bzinv3);
  ------------------
  |  |   93|   158k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  629|   158k|        secp256k1_fe_set_int(&r->z, 1);
  ------------------
  |  |   83|   158k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  630|   158k|        SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|   158k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  631|   158k|        return;
  632|   158k|    }
  633|  2.53M|    if (b->infinity) {
  ------------------
  |  Branch (633:9): [True: 0, False: 2.53M]
  ------------------
  634|      0|        *r = *a;
  635|      0|        return;
  636|      0|    }
  637|       |
  638|       |    /** We need to calculate (rx,ry,rz) = (ax,ay,az) + (bx,by,1/bzinv). Due to
  639|       |     *  secp256k1's isomorphism we can multiply the Z coordinates on both sides
  640|       |     *  by bzinv, and get: (rx,ry,rz*bzinv) = (ax,ay,az*bzinv) + (bx,by,1).
  641|       |     *  This means that (rx,ry,rz) can be calculated as
  642|       |     *  (ax,ay,az*bzinv) + (bx,by,1), when not applying the bzinv factor to rz.
  643|       |     *  The variable az below holds the modified Z coordinate for a, which is used
  644|       |     *  for the computation of rx and ry, but not for rz.
  645|       |     */
  646|  2.53M|    secp256k1_fe_mul(&az, &a->z, bzinv);
  ------------------
  |  |   93|  2.53M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  647|       |
  648|  2.53M|    secp256k1_fe_sqr(&z12, &az);
  ------------------
  |  |   94|  2.53M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  649|  2.53M|    u1 = a->x;
  650|  2.53M|    secp256k1_fe_mul(&u2, &b->x, &z12);
  ------------------
  |  |   93|  2.53M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  651|  2.53M|    s1 = a->y;
  652|  2.53M|    secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &az);
  ------------------
  |  |   93|  2.53M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
                  secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &az);
  ------------------
  |  |   93|  2.53M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  653|  2.53M|    secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |  211|  2.53M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  2.53M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  2.53M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 2.53M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  2.53M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 2.53M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  2.53M|    } \
  |  |  |  |   84|  2.53M|    stmt; \
  |  |  |  |   85|  2.53M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |   92|  2.53M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  654|  2.53M|    secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |  211|  2.53M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  2.53M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  2.53M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 2.53M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  2.53M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 2.53M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  2.53M|    } \
  |  |  |  |   84|  2.53M|    stmt; \
  |  |  |  |   85|  2.53M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |   92|  2.53M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  655|  2.53M|    if (secp256k1_fe_normalizes_to_zero_var(&h)) {
  ------------------
  |  |   82|  2.53M|#  define secp256k1_fe_normalizes_to_zero_var secp256k1_fe_impl_normalizes_to_zero_var
  ------------------
  |  Branch (655:9): [True: 0, False: 2.53M]
  ------------------
  656|      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 (656:13): [True: 0, False: 0]
  ------------------
  657|      0|            secp256k1_gej_double_var(r, a, NULL);
  658|      0|        } else {
  659|      0|            secp256k1_gej_set_infinity(r);
  660|      0|        }
  661|      0|        return;
  662|      0|    }
  663|       |
  664|  2.53M|    r->infinity = 0;
  665|  2.53M|    secp256k1_fe_mul(&r->z, &a->z, &h);
  ------------------
  |  |   93|  2.53M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  666|       |
  667|  2.53M|    secp256k1_fe_sqr(&h2, &h);
  ------------------
  |  |   94|  2.53M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  668|  2.53M|    secp256k1_fe_negate(&h2, &h2, 1);
  ------------------
  |  |  211|  2.53M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  2.53M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  2.53M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 2.53M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  2.53M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 2.53M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  2.53M|    } \
  |  |  |  |   84|  2.53M|    stmt; \
  |  |  |  |   85|  2.53M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  669|  2.53M|    secp256k1_fe_mul(&h3, &h2, &h);
  ------------------
  |  |   93|  2.53M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  670|  2.53M|    secp256k1_fe_mul(&t, &u1, &h2);
  ------------------
  |  |   93|  2.53M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  671|       |
  672|  2.53M|    secp256k1_fe_sqr(&r->x, &i);
  ------------------
  |  |   94|  2.53M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  673|  2.53M|    secp256k1_fe_add(&r->x, &h3);
  ------------------
  |  |   92|  2.53M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  674|  2.53M|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|  2.53M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  675|  2.53M|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|  2.53M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  676|       |
  677|  2.53M|    secp256k1_fe_add(&t, &r->x);
  ------------------
  |  |   92|  2.53M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  678|  2.53M|    secp256k1_fe_mul(&r->y, &t, &i);
  ------------------
  |  |   93|  2.53M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  679|  2.53M|    secp256k1_fe_mul(&h3, &h3, &s1);
  ------------------
  |  |   93|  2.53M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  680|  2.53M|    secp256k1_fe_add(&r->y, &h3);
  ------------------
  |  |   92|  2.53M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  681|       |
  682|  2.53M|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|  2.53M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  683|  2.53M|}
secp256k1.c:secp256k1_ge_is_infinity:
  143|  1.24M|static int secp256k1_ge_is_infinity(const secp256k1_ge *a) {
  144|  1.24M|    SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  206|  1.24M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  145|       |
  146|  1.24M|    return a->infinity;
  147|  1.24M|}

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

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

secp256k1_xonly_pubkey_parse:
   22|  8.49k|int secp256k1_xonly_pubkey_parse(const secp256k1_context* ctx, secp256k1_xonly_pubkey *pubkey, const unsigned char *input32) {
   23|  8.49k|    secp256k1_ge pk;
   24|  8.49k|    secp256k1_fe x;
   25|       |
   26|  8.49k|    VERIFY_CHECK(ctx != NULL);
   27|  8.49k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  8.49k|#define ARG_CHECK(cond) do { \
  |  |   46|  8.49k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  8.49k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 8.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  8.49k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   28|  8.49k|    memset(pubkey, 0, sizeof(*pubkey));
   29|  8.49k|    ARG_CHECK(input32 != NULL);
  ------------------
  |  |   45|  8.49k|#define ARG_CHECK(cond) do { \
  |  |   46|  8.49k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  8.49k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 8.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  8.49k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   30|       |
   31|  8.49k|    if (!secp256k1_fe_set_b32_limit(&x, input32)) {
  ------------------
  |  |   88|  8.49k|#  define secp256k1_fe_set_b32_limit secp256k1_fe_impl_set_b32_limit
  ------------------
  |  Branch (31:9): [True: 1, False: 8.49k]
  ------------------
   32|      1|        return 0;
   33|      1|    }
   34|  8.49k|    if (!secp256k1_ge_set_xo_var(&pk, &x, 0)) {
  ------------------
  |  Branch (34:9): [True: 1, False: 8.49k]
  ------------------
   35|      1|        return 0;
   36|      1|    }
   37|  8.49k|    if (!secp256k1_ge_is_in_correct_subgroup(&pk)) {
  ------------------
  |  Branch (37:9): [True: 0, False: 8.49k]
  ------------------
   38|      0|        return 0;
   39|      0|    }
   40|  8.49k|    secp256k1_xonly_pubkey_save(pubkey, &pk);
   41|  8.49k|    return 1;
   42|  8.49k|}
secp256k1_xonly_pubkey_serialize:
   44|  4.23k|int secp256k1_xonly_pubkey_serialize(const secp256k1_context* ctx, unsigned char *output32, const secp256k1_xonly_pubkey *pubkey) {
   45|  4.23k|    secp256k1_ge pk;
   46|       |
   47|  4.23k|    VERIFY_CHECK(ctx != NULL);
   48|  4.23k|    ARG_CHECK(output32 != NULL);
  ------------------
  |  |   45|  4.23k|#define ARG_CHECK(cond) do { \
  |  |   46|  4.23k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  4.23k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 4.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  4.23k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   49|  4.23k|    memset(output32, 0, 32);
   50|  4.23k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  4.23k|#define ARG_CHECK(cond) do { \
  |  |   46|  4.23k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  4.23k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 4.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  4.23k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   51|       |
   52|  4.23k|    if (!secp256k1_xonly_pubkey_load(ctx, &pk, pubkey)) {
  ------------------
  |  Branch (52:9): [True: 0, False: 4.23k]
  ------------------
   53|      0|        return 0;
   54|      0|    }
   55|  4.23k|    secp256k1_fe_get_b32(output32, &pk.x);
  ------------------
  |  |   89|  4.23k|#  define secp256k1_fe_get_b32 secp256k1_fe_impl_get_b32
  ------------------
   56|  4.23k|    return 1;
   57|  4.23k|}
secp256k1_xonly_pubkey_from_pubkey:
   99|  4.23k|int secp256k1_xonly_pubkey_from_pubkey(const secp256k1_context* ctx, secp256k1_xonly_pubkey *xonly_pubkey, int *pk_parity, const secp256k1_pubkey *pubkey) {
  100|  4.23k|    secp256k1_ge pk;
  101|  4.23k|    int tmp;
  102|       |
  103|  4.23k|    VERIFY_CHECK(ctx != NULL);
  104|  4.23k|    ARG_CHECK(xonly_pubkey != NULL);
  ------------------
  |  |   45|  4.23k|#define ARG_CHECK(cond) do { \
  |  |   46|  4.23k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  4.23k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 4.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  4.23k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  105|  4.23k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  4.23k|#define ARG_CHECK(cond) do { \
  |  |   46|  4.23k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  4.23k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 4.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  4.23k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  106|       |
  107|  4.23k|    if (!secp256k1_pubkey_load(ctx, &pk, pubkey)) {
  ------------------
  |  Branch (107:9): [True: 0, False: 4.23k]
  ------------------
  108|      0|        return 0;
  109|      0|    }
  110|  4.23k|    tmp = secp256k1_extrakeys_ge_even_y(&pk);
  111|  4.23k|    if (pk_parity != NULL) {
  ------------------
  |  Branch (111:9): [True: 4.23k, False: 0]
  ------------------
  112|  4.23k|        *pk_parity = tmp;
  113|  4.23k|    }
  114|  4.23k|    secp256k1_xonly_pubkey_save(xonly_pubkey, &pk);
  115|  4.23k|    return 1;
  116|  4.23k|}
secp256k1_xonly_pubkey_tweak_add:
  118|  4.23k|int secp256k1_xonly_pubkey_tweak_add(const secp256k1_context* ctx, secp256k1_pubkey *output_pubkey, const secp256k1_xonly_pubkey *internal_pubkey, const unsigned char *tweak32) {
  119|  4.23k|    secp256k1_ge pk;
  120|       |
  121|  4.23k|    VERIFY_CHECK(ctx != NULL);
  122|  4.23k|    ARG_CHECK(output_pubkey != NULL);
  ------------------
  |  |   45|  4.23k|#define ARG_CHECK(cond) do { \
  |  |   46|  4.23k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  4.23k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 4.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  4.23k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  123|  4.23k|    memset(output_pubkey, 0, sizeof(*output_pubkey));
  124|  4.23k|    ARG_CHECK(internal_pubkey != NULL);
  ------------------
  |  |   45|  4.23k|#define ARG_CHECK(cond) do { \
  |  |   46|  4.23k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  4.23k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 4.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  4.23k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  125|  4.23k|    ARG_CHECK(tweak32 != NULL);
  ------------------
  |  |   45|  4.23k|#define ARG_CHECK(cond) do { \
  |  |   46|  4.23k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  4.23k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 4.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  4.23k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  126|       |
  127|  4.23k|    if (!secp256k1_xonly_pubkey_load(ctx, &pk, internal_pubkey)
  ------------------
  |  Branch (127:9): [True: 0, False: 4.23k]
  ------------------
  128|  4.23k|        || !secp256k1_ec_pubkey_tweak_add_helper(&pk, tweak32)) {
  ------------------
  |  Branch (128:12): [True: 0, False: 4.23k]
  ------------------
  129|      0|        return 0;
  130|      0|    }
  131|  4.23k|    secp256k1_pubkey_save(output_pubkey, &pk);
  132|  4.23k|    return 1;
  133|  4.23k|}
secp256k1.c:secp256k1_xonly_pubkey_save:
   18|  12.7k|static SECP256K1_INLINE void secp256k1_xonly_pubkey_save(secp256k1_xonly_pubkey *pubkey, secp256k1_ge *ge) {
   19|  12.7k|    secp256k1_pubkey_save((secp256k1_pubkey *) pubkey, ge);
   20|  12.7k|}
secp256k1.c:secp256k1_xonly_pubkey_load:
   14|  8.47k|static SECP256K1_INLINE int secp256k1_xonly_pubkey_load(const secp256k1_context* ctx, secp256k1_ge *ge, const secp256k1_xonly_pubkey *pubkey) {
   15|  8.47k|    return secp256k1_pubkey_load(ctx, ge, (const secp256k1_pubkey *) pubkey);
   16|  8.47k|}
secp256k1.c:secp256k1_extrakeys_ge_even_y:
   88|  4.23k|static int secp256k1_extrakeys_ge_even_y(secp256k1_ge *r) {
   89|  4.23k|    int y_parity = 0;
   90|  4.23k|    VERIFY_CHECK(!secp256k1_ge_is_infinity(r));
   91|       |
   92|  4.23k|    if (secp256k1_fe_is_odd(&r->y)) {
  ------------------
  |  |   85|  4.23k|#  define secp256k1_fe_is_odd secp256k1_fe_impl_is_odd
  ------------------
  |  Branch (92:9): [True: 2.15k, False: 2.08k]
  ------------------
   93|  2.15k|        secp256k1_fe_negate(&r->y, &r->y, 1);
  ------------------
  |  |  211|  2.15k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  2.15k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  2.15k|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 2.15k]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  2.15k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 2.15k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  2.15k|    } \
  |  |  |  |   84|  2.15k|    stmt; \
  |  |  |  |   85|  2.15k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   94|  2.15k|        y_parity = 1;
   95|  2.15k|    }
   96|  4.23k|    return y_parity;
   97|  4.23k|}

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

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

secp256k1_context_preallocated_destroy:
  176|      2|void secp256k1_context_preallocated_destroy(secp256k1_context* ctx) {
  177|      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)) { \
  |  |  ------------------
  |  |  |  |  136|      4|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 2]
  |  |  |  |  |  Branch (136:39): [True: 0, False: 2]
  |  |  |  |  |  Branch (136: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 - Ignored]
  |  |  ------------------
  ------------------
  178|       |
  179|       |    /* Defined as noop */
  180|      2|    if (ctx == NULL) {
  ------------------
  |  Branch (180:9): [True: 0, False: 2]
  ------------------
  181|      0|        return;
  182|      0|    }
  183|       |
  184|      2|    secp256k1_ecmult_gen_context_clear(&ctx->ecmult_gen_ctx);
  185|      2|}
secp256k1_context_destroy:
  187|      2|void secp256k1_context_destroy(secp256k1_context* ctx) {
  188|      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)) { \
  |  |  ------------------
  |  |  |  |  136|      4|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 2]
  |  |  |  |  |  Branch (136:39): [True: 0, False: 2]
  |  |  |  |  |  Branch (136: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 - Ignored]
  |  |  ------------------
  ------------------
  189|       |
  190|       |    /* Defined as noop */
  191|      2|    if (ctx == NULL) {
  ------------------
  |  Branch (191:9): [True: 0, False: 2]
  ------------------
  192|      0|        return;
  193|      0|    }
  194|       |
  195|      2|    secp256k1_context_preallocated_destroy(ctx);
  196|      2|    free(ctx);
  197|      2|}
secp256k1_ec_pubkey_parse:
  250|   186k|int secp256k1_ec_pubkey_parse(const secp256k1_context* ctx, secp256k1_pubkey* pubkey, const unsigned char *input, size_t inputlen) {
  251|   186k|    secp256k1_ge Q;
  252|       |
  253|   186k|    VERIFY_CHECK(ctx != NULL);
  254|   186k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|   186k|#define ARG_CHECK(cond) do { \
  |  |   46|   186k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|   186k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 186k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|   186k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  255|   186k|    memset(pubkey, 0, sizeof(*pubkey));
  256|   186k|    ARG_CHECK(input != NULL);
  ------------------
  |  |   45|   186k|#define ARG_CHECK(cond) do { \
  |  |   46|   186k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|   186k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 186k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|   186k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  257|   186k|    if (!secp256k1_eckey_pubkey_parse(&Q, input, inputlen)) {
  ------------------
  |  Branch (257:9): [True: 256, False: 186k]
  ------------------
  258|    256|        return 0;
  259|    256|    }
  260|   186k|    if (!secp256k1_ge_is_in_correct_subgroup(&Q)) {
  ------------------
  |  Branch (260:9): [True: 0, False: 186k]
  ------------------
  261|      0|        return 0;
  262|      0|    }
  263|   186k|    secp256k1_pubkey_save(pubkey, &Q);
  264|   186k|    secp256k1_ge_clear(&Q);
  265|   186k|    return 1;
  266|   186k|}
secp256k1_ec_pubkey_serialize:
  268|  1.24M|int secp256k1_ec_pubkey_serialize(const secp256k1_context* ctx, unsigned char *output, size_t *outputlen, const secp256k1_pubkey* pubkey, unsigned int flags) {
  269|  1.24M|    secp256k1_ge Q;
  270|  1.24M|    size_t len;
  271|  1.24M|    int ret = 0;
  272|       |
  273|  1.24M|    VERIFY_CHECK(ctx != NULL);
  274|  1.24M|    ARG_CHECK(outputlen != NULL);
  ------------------
  |  |   45|  1.24M|#define ARG_CHECK(cond) do { \
  |  |   46|  1.24M|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  1.24M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.24M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.24M|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  275|  1.24M|    ARG_CHECK(*outputlen >= ((flags & SECP256K1_FLAGS_BIT_COMPRESSION) ? 33u : 65u));
  ------------------
  |  |   45|  1.24M|#define ARG_CHECK(cond) do { \
  |  |   46|  1.24M|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  2.49M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.24M]
  |  |  |  |  |  Branch (136:39): [True: 1.24M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.24M|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  276|  1.24M|    len = *outputlen;
  277|  1.24M|    *outputlen = 0;
  278|  1.24M|    ARG_CHECK(output != NULL);
  ------------------
  |  |   45|  1.24M|#define ARG_CHECK(cond) do { \
  |  |   46|  1.24M|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  1.24M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.24M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.24M|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  279|  1.24M|    memset(output, 0, len);
  280|  1.24M|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  1.24M|#define ARG_CHECK(cond) do { \
  |  |   46|  1.24M|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  1.24M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.24M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.24M|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  281|  1.24M|    ARG_CHECK((flags & SECP256K1_FLAGS_TYPE_MASK) == SECP256K1_FLAGS_TYPE_COMPRESSION);
  ------------------
  |  |   45|  1.24M|#define ARG_CHECK(cond) do { \
  |  |   46|  1.24M|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  1.24M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.24M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.24M|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  282|  1.24M|    if (secp256k1_pubkey_load(ctx, &Q, pubkey)) {
  ------------------
  |  Branch (282:9): [True: 1.24M, False: 0]
  ------------------
  283|  1.24M|        ret = secp256k1_eckey_pubkey_serialize(&Q, output, &len, flags & SECP256K1_FLAGS_BIT_COMPRESSION);
  ------------------
  |  |  198|  1.24M|#define SECP256K1_FLAGS_BIT_COMPRESSION (1 << 8)
  ------------------
  284|  1.24M|        if (ret) {
  ------------------
  |  Branch (284:13): [True: 1.24M, False: 0]
  ------------------
  285|  1.24M|            *outputlen = len;
  286|  1.24M|        }
  287|  1.24M|    }
  288|  1.24M|    return ret;
  289|  1.24M|}
secp256k1_ec_seckey_verify:
  580|   527k|int secp256k1_ec_seckey_verify(const secp256k1_context* ctx, const unsigned char *seckey) {
  581|   527k|    secp256k1_scalar sec;
  582|   527k|    int ret;
  583|   527k|    VERIFY_CHECK(ctx != NULL);
  584|   527k|    ARG_CHECK(seckey != NULL);
  ------------------
  |  |   45|   527k|#define ARG_CHECK(cond) do { \
  |  |   46|   527k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|   527k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 527k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|   527k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  585|       |
  586|   527k|    ret = secp256k1_scalar_set_b32_seckey(&sec, seckey);
  587|   527k|    secp256k1_scalar_clear(&sec);
  588|   527k|    return ret;
  589|   527k|}
secp256k1_ec_pubkey_create:
  604|  1.09M|int secp256k1_ec_pubkey_create(const secp256k1_context* ctx, secp256k1_pubkey *pubkey, const unsigned char *seckey) {
  605|  1.09M|    secp256k1_ge p;
  606|  1.09M|    secp256k1_scalar seckey_scalar;
  607|  1.09M|    int ret = 0;
  608|  1.09M|    VERIFY_CHECK(ctx != NULL);
  609|  1.09M|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  1.09M|#define ARG_CHECK(cond) do { \
  |  |   46|  1.09M|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  1.09M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.09M|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  610|  1.09M|    memset(pubkey, 0, sizeof(*pubkey));
  611|  1.09M|    ARG_CHECK(secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx));
  ------------------
  |  |   45|  1.09M|#define ARG_CHECK(cond) do { \
  |  |   46|  1.09M|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  1.09M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.09M|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  612|  1.09M|    ARG_CHECK(seckey != NULL);
  ------------------
  |  |   45|  1.09M|#define ARG_CHECK(cond) do { \
  |  |   46|  1.09M|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  1.09M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.09M|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  613|       |
  614|  1.09M|    ret = secp256k1_ec_pubkey_create_helper(&ctx->ecmult_gen_ctx, &seckey_scalar, &p, seckey);
  615|  1.09M|    secp256k1_pubkey_save(pubkey, &p);
  616|  1.09M|    secp256k1_memczero(pubkey, sizeof(*pubkey), !ret);
  617|       |
  618|  1.09M|    secp256k1_scalar_clear(&seckey_scalar);
  619|  1.09M|    return ret;
  620|  1.09M|}
secp256k1_ec_seckey_tweak_add:
  668|   396k|int secp256k1_ec_seckey_tweak_add(const secp256k1_context* ctx, unsigned char *seckey, const unsigned char *tweak32) {
  669|   396k|    secp256k1_scalar sec;
  670|   396k|    int ret = 0;
  671|   396k|    VERIFY_CHECK(ctx != NULL);
  672|   396k|    ARG_CHECK(seckey != NULL);
  ------------------
  |  |   45|   396k|#define ARG_CHECK(cond) do { \
  |  |   46|   396k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|   396k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 396k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|   396k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  673|   396k|    ARG_CHECK(tweak32 != NULL);
  ------------------
  |  |   45|   396k|#define ARG_CHECK(cond) do { \
  |  |   46|   396k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|   396k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 396k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|   396k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  674|       |
  675|   396k|    ret = secp256k1_scalar_set_b32_seckey(&sec, seckey);
  676|   396k|    ret &= secp256k1_ec_seckey_tweak_add_helper(&sec, tweak32);
  677|   396k|    secp256k1_scalar_cmov(&sec, &secp256k1_scalar_zero, !ret);
  678|   396k|    secp256k1_scalar_get_b32(seckey, &sec);
  679|       |
  680|   396k|    secp256k1_scalar_clear(&sec);
  681|   396k|    return ret;
  682|   396k|}
secp256k1_ec_pubkey_tweak_add:
  695|   153k|int secp256k1_ec_pubkey_tweak_add(const secp256k1_context* ctx, secp256k1_pubkey *pubkey, const unsigned char *tweak32) {
  696|   153k|    secp256k1_ge p;
  697|   153k|    int ret = 0;
  698|   153k|    VERIFY_CHECK(ctx != NULL);
  699|   153k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|   153k|#define ARG_CHECK(cond) do { \
  |  |   46|   153k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|   153k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 153k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|   153k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  700|   153k|    ARG_CHECK(tweak32 != NULL);
  ------------------
  |  |   45|   153k|#define ARG_CHECK(cond) do { \
  |  |   46|   153k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|   153k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 153k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|   153k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  701|       |
  702|   153k|    ret = secp256k1_pubkey_load(ctx, &p, pubkey);
  703|   153k|    memset(pubkey, 0, sizeof(*pubkey));
  704|   153k|    ret = ret && secp256k1_ec_pubkey_tweak_add_helper(&p, tweak32);
  ------------------
  |  Branch (704:11): [True: 153k, False: 0]
  |  Branch (704:18): [True: 153k, False: 0]
  ------------------
  705|   153k|    if (ret) {
  ------------------
  |  Branch (705:9): [True: 153k, False: 0]
  ------------------
  706|   153k|        secp256k1_pubkey_save(pubkey, &p);
  707|   153k|    }
  708|       |
  709|   153k|    return ret;
  710|   153k|}
secp256k1.c:secp256k1_context_is_proper:
   82|      4|static int secp256k1_context_is_proper(const secp256k1_context* ctx) {
   83|      4|    return secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx);
   84|      4|}
secp256k1.c:secp256k1_pubkey_save:
  246|  1.45M|static void secp256k1_pubkey_save(secp256k1_pubkey* pubkey, secp256k1_ge* ge) {
  247|  1.45M|    secp256k1_ge_to_bytes(pubkey->data, ge);
  248|  1.45M|}
secp256k1.c:secp256k1_pubkey_load:
  240|  1.41M|static int secp256k1_pubkey_load(const secp256k1_context* ctx, secp256k1_ge* ge, const secp256k1_pubkey* pubkey) {
  241|  1.41M|    secp256k1_ge_from_bytes(ge, pubkey->data);
  242|  1.41M|    ARG_CHECK(!secp256k1_fe_is_zero(&ge->x));
  ------------------
  |  |   45|  1.41M|#define ARG_CHECK(cond) do { \
  |  |   46|  1.41M|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  1.41M|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.41M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.41M|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  243|  1.41M|    return 1;
  244|  1.41M|}
secp256k1.c:secp256k1_ec_pubkey_create_helper:
  591|  1.09M|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) {
  592|  1.09M|    secp256k1_gej pj;
  593|  1.09M|    int ret;
  594|       |
  595|  1.09M|    ret = secp256k1_scalar_set_b32_seckey(seckey_scalar, seckey);
  596|  1.09M|    secp256k1_scalar_cmov(seckey_scalar, &secp256k1_scalar_one, !ret);
  597|       |
  598|  1.09M|    secp256k1_ecmult_gen(ecmult_gen_ctx, &pj, seckey_scalar);
  599|  1.09M|    secp256k1_ge_set_gej(p, &pj);
  600|  1.09M|    secp256k1_gej_clear(&pj);
  601|  1.09M|    return ret;
  602|  1.09M|}
secp256k1.c:secp256k1_ec_seckey_tweak_add_helper:
  657|   396k|static int secp256k1_ec_seckey_tweak_add_helper(secp256k1_scalar *sec, const unsigned char *tweak32) {
  658|   396k|    secp256k1_scalar term;
  659|   396k|    int overflow = 0;
  660|   396k|    int ret = 0;
  661|       |
  662|   396k|    secp256k1_scalar_set_b32(&term, tweak32, &overflow);
  663|   396k|    ret = (!overflow) & secp256k1_eckey_privkey_tweak_add(sec, &term);
  664|   396k|    secp256k1_scalar_clear(&term);
  665|   396k|    return ret;
  666|   396k|}
secp256k1.c:secp256k1_ec_pubkey_tweak_add_helper:
  688|   158k|static int secp256k1_ec_pubkey_tweak_add_helper(secp256k1_ge *p, const unsigned char *tweak32) {
  689|   158k|    secp256k1_scalar term;
  690|   158k|    int overflow = 0;
  691|   158k|    secp256k1_scalar_set_b32(&term, tweak32, &overflow);
  692|   158k|    return !overflow && secp256k1_eckey_pubkey_tweak_add(p, &term);
  ------------------
  |  Branch (692:12): [True: 158k, False: 0]
  |  Branch (692:25): [True: 158k, False: 0]
  ------------------
  693|   158k|}

secp256k1.c:secp256k1_read_be64:
  416|  10.2M|SECP256K1_INLINE static uint64_t secp256k1_read_be64(const unsigned char* p) {
  417|  10.2M|    return (uint64_t)p[0] << 56 |
  418|  10.2M|           (uint64_t)p[1] << 48 |
  419|  10.2M|           (uint64_t)p[2] << 40 |
  420|  10.2M|           (uint64_t)p[3] << 32 |
  421|  10.2M|           (uint64_t)p[4] << 24 |
  422|  10.2M|           (uint64_t)p[5] << 16 |
  423|  10.2M|           (uint64_t)p[6] << 8  |
  424|  10.2M|           (uint64_t)p[7];
  425|  10.2M|}
secp256k1.c:secp256k1_write_be64:
  428|  1.58M|SECP256K1_INLINE static void secp256k1_write_be64(unsigned char* p, uint64_t x) {
  429|  1.58M|    p[7] = x;
  430|  1.58M|    p[6] = x >>  8;
  431|  1.58M|    p[5] = x >> 16;
  432|  1.58M|    p[4] = x >> 24;
  433|  1.58M|    p[3] = x >> 32;
  434|  1.58M|    p[2] = x >> 40;
  435|  1.58M|    p[1] = x >> 48;
  436|  1.58M|    p[0] = x >> 56;
  437|  1.58M|}
secp256k1.c:secp256k1_rotr32:
  440|   282M|SECP256K1_INLINE static uint32_t secp256k1_rotr32(const uint32_t x, const unsigned int by) {
  441|       |#if defined(_MSC_VER)
  442|       |    return _rotr(x, by);  /* needs <stdlib.h> */
  443|       |#else
  444|       |    /* Reduce rotation amount to avoid UB when shifting. */
  445|   282M|    const unsigned int mask = CHAR_BIT * sizeof(x) - 1;
  446|       |    /* Turned into a rot instruction by GCC and clang. */
  447|   282M|    return (x >> (by & mask)) | (x << ((-by) & mask));
  448|   282M|#endif
  449|   282M|}
secp256k1.c:secp256k1_memczero:
  208|  1.09M|static SECP256K1_INLINE void secp256k1_memczero(void *s, size_t len, int flag) {
  209|  1.09M|    unsigned char *p = (unsigned char *)s;
  210|       |    /* Access flag with a volatile-qualified lvalue.
  211|       |       This prevents clang from figuring out (after inlining) that flag can
  212|       |       take only be 0 or 1, which leads to variable time code. */
  213|  1.09M|    volatile int vflag = flag;
  214|  1.09M|    unsigned char mask = -(unsigned char) vflag;
  215|  71.1M|    while (len) {
  ------------------
  |  Branch (215:12): [True: 70.0M, False: 1.09M]
  ------------------
  216|  70.0M|        *p &= ~mask;
  217|  70.0M|        p++;
  218|  70.0M|        len--;
  219|  70.0M|    }
  220|  1.09M|}
secp256k1.c:secp256k1_memclear:
  223|  9.17M|static SECP256K1_INLINE void secp256k1_memclear(void *ptr, size_t len) {
  224|       |#if defined(_MSC_VER)
  225|       |    /* SecureZeroMemory is guaranteed not to be optimized out by MSVC. */
  226|       |    SecureZeroMemory(ptr, len);
  227|       |#elif defined(__GNUC__)
  228|       |    /* We use a memory barrier that scares the compiler away from optimizing out the memset.
  229|       |     *
  230|       |     * Quoting Adam Langley <agl@google.com> in commit ad1907fe73334d6c696c8539646c21b11178f20f
  231|       |     * in BoringSSL (ISC License):
  232|       |     *    As best as we can tell, this is sufficient to break any optimisations that
  233|       |     *    might try to eliminate "superfluous" memsets.
  234|       |     * This method is used in memzero_explicit() the Linux kernel, too. Its advantage is that it
  235|       |     * is pretty efficient, because the compiler can still implement the memset() efficently,
  236|       |     * just not remove it entirely. See "Dead Store Elimination (Still) Considered Harmful" by
  237|       |     * Yang et al. (USENIX Security 2017) for more background.
  238|       |     */
  239|  9.17M|    memset(ptr, 0, len);
  240|  9.17M|    __asm__ __volatile__("" : : "r"(ptr) : "memory");
  241|       |#else
  242|       |    void *(*volatile const volatile_memset)(void *, int, size_t) = memset;
  243|       |    volatile_memset(ptr, 0, len);
  244|       |#endif
  245|       |#ifdef VERIFY
  246|       |    SECP256K1_CHECKMEM_UNDEFINE(ptr, len);
  247|       |#endif
  248|  9.17M|}

_Z20GetSizeOfCompactSizem:
  298|   191k|{
  299|   191k|    if (nSize < 253)             return sizeof(unsigned char);
  ------------------
  |  Branch (299:9): [True: 1.24k, False: 189k]
  ------------------
  300|   189k|    else if (nSize <= std::numeric_limits<uint16_t>::max()) return sizeof(unsigned char) + sizeof(uint16_t);
  ------------------
  |  Branch (300:14): [True: 294, False: 189k]
  ------------------
  301|   189k|    else if (nSize <= std::numeric_limits<unsigned int>::max())  return sizeof(unsigned char) + sizeof(unsigned int);
  ------------------
  |  Branch (301:14): [True: 189k, False: 0]
  ------------------
  302|      0|    else                         return sizeof(unsigned char) + sizeof(uint64_t);
  303|   191k|}
_ZN17CompactSizeWriterC2Em:
  615|  10.5k|    explicit CompactSizeWriter(uint64_t n_in) : n(n_in) { }
_Z16WriteCompactSizeI10HashWriterEvRT_m:
  309|  10.5k|{
  310|  10.5k|    if (nSize < 253)
  ------------------
  |  Branch (310:9): [True: 7.51k, False: 3.03k]
  ------------------
  311|  7.51k|    {
  312|  7.51k|        ser_writedata8(os, nSize);
  313|  7.51k|    }
  314|  3.03k|    else if (nSize <= std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (314:14): [True: 3.03k, False: 0]
  ------------------
  315|  3.03k|    {
  316|  3.03k|        ser_writedata8(os, 253);
  317|  3.03k|        ser_writedata16(os, nSize);
  318|  3.03k|    }
  319|      0|    else if (nSize <= std::numeric_limits<unsigned int>::max())
  ------------------
  |  Branch (319:14): [True: 0, False: 0]
  ------------------
  320|      0|    {
  321|      0|        ser_writedata8(os, 254);
  322|      0|        ser_writedata32(os, nSize);
  323|      0|    }
  324|      0|    else
  325|      0|    {
  326|      0|        ser_writedata8(os, 255);
  327|      0|        ser_writedata64(os, nSize);
  328|      0|    }
  329|  10.5k|    return;
  330|  10.5k|}
_Z14ser_writedata8I10HashWriterEvRT_h:
   55|  21.1k|{
   56|  21.1k|    s.write(AsBytes(Span{&obj, 1}));
   57|  21.1k|}
_Z15ser_writedata16I10HashWriterEvRT_t:
   59|  3.03k|{
   60|  3.03k|    obj = htole16_internal(obj);
   61|  3.03k|    s.write(AsBytes(Span{&obj, 1}));
   62|  3.03k|}
_Z9SerializeI10HashWriter7uint256Q12SerializableIT0_T_EEvRS3_RKS2_:
  753|  7.27k|{
  754|  7.27k|    a.Serialize(os);
  755|  7.27k|}
_Z9SerializeI10HashWriterTk9BasicByteKhEvRT_4SpanIT0_E:
  268|  82.3k|template <typename Stream, BasicByte B> void Serialize(Stream& s, Span<B> span) { s.write(AsBytes(span)); }
_Z9SerializeI10HashWriterEvRT_h:
  258|  10.5k|template<typename Stream> inline void Serialize(Stream& s, uint8_t a ) { ser_writedata8(s, a); }
_Z9SerializeI10HashWriter17CompactSizeWriterQ12SerializableIT0_T_EEvRS3_RKS2_:
  753|  10.5k|{
  754|  10.5k|    a.Serialize(os);
  755|  10.5k|}
_ZNK17CompactSizeWriter9SerializeI10HashWriterEEvRT_:
  618|  10.5k|    void Serialize(Stream &s) const {
  619|  10.5k|        WriteCompactSize<Stream>(s, n);
  620|  10.5k|    }

_Z9UCharCastPh:
  281|   263k|inline unsigned char* UCharCast(unsigned char* c) { return c; }
_Z9UCharCastPKh:
  285|  2.46M|inline const unsigned char* UCharCast(const unsigned char* c) { return c; }
_Z9UCharCastPKSt4byte:
  287|  1.73M|inline const unsigned char* UCharCast(const std::byte* c) { return reinterpret_cast<const unsigned char*>(c); }
_ZNK4SpanIKSt4byteE4sizeEv:
  187|   106k|    constexpr std::size_t size() const noexcept { return m_size; }
_ZNK4SpanIKcE4dataEv:
  174|  33.2k|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIKcE4sizeEv:
  187|  29.5M|    constexpr std::size_t size() const noexcept { return m_size; }
_ZNK4SpanIKSt4byteE4dataEv:
  174|   106k|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIKcE5beginEv:
  175|  3.68M|    constexpr C* begin() const noexcept { return m_data; }
_ZNK4SpanIKcE3endEv:
  176|  1.01G|    constexpr C* end() const noexcept { return m_data + m_size; }
_ZNK4SpanIKhE4sizeEv:
  187|  28.0M|    constexpr std::size_t size() const noexcept { return m_size; }
_ZNK4SpanIKhE5beginEv:
  175|  1.27M|    constexpr C* begin() const noexcept { return m_data; }
_ZNK4SpanIKhE3endEv:
  176|  1.27M|    constexpr C* end() const noexcept { return m_data + m_size; }
_ZNK4SpanIhE4sizeEv:
  187|  2.85M|    constexpr std::size_t size() const noexcept { return m_size; }
_ZNK4SpanIhE4dataEv:
  174|  2.87M|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIKhE4dataEv:
  174|  5.44M|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIKhE5firstEm:
  206|  2.06M|    {
  207|  2.06M|        ASSERT_IF_DEBUG(size() >= count);
  208|  2.06M|        return Span<C>(m_data, count);
  209|  2.06M|    }
_ZNK4SpanIKhE7subspanEmm:
  201|   326k|    {
  202|   326k|        ASSERT_IF_DEBUG(size() >= offset + count);
  203|   326k|        return Span<C>(m_data + offset, count);
  204|   326k|    }
_ZNK4SpanIKhE7subspanEm:
  196|  20.9M|    {
  197|  20.9M|        ASSERT_IF_DEBUG(size() >= offset);
  198|  20.9M|        return Span<C>(m_data + offset, m_size - offset);
  199|  20.9M|    }
_Z13UCharSpanCastIKhE4SpanINSt3__114remove_pointerIDTcl9UCharCastcldtfp_4dataEEEE4typeEES1_IT_E:
  293|  2.33M|template <typename T> constexpr auto UCharSpanCast(Span<T> s) -> Span<typename std::remove_pointer<decltype(UCharCast(s.data()))>::type> { return {UCharCast(s.data()), s.size()}; }
_Z13MakeUCharSpanIRK4SpanIKhEEDTcl13UCharSpanCasttlS0_clsr3stdE7forwardIT_Efp_EEEEOS5_:
  296|  2.06M|template <typename V> constexpr auto MakeUCharSpan(V&& v) -> decltype(UCharSpanCast(Span{std::forward<V>(v)})) { return UCharSpanCast(Span{std::forward<V>(v)}); }
_ZNK4SpanIKhE10size_bytesEv:
  188|  82.3k|    constexpr std::size_t size_bytes() const noexcept { return sizeof(C) * m_size; }
_Z7AsBytesIKhE4SpanIKSt4byteES1_IT_E:
  259|  82.3k|{
  260|  82.3k|    return {reinterpret_cast<const std::byte*>(s.data()), s.size_bytes()};
  261|  82.3k|}
_ZN4SpanIKhEC2INSt3__16vectorIhNS3_9allocatorIhEEEEEERKT_NS3_9enable_ifIXaaaantsr7is_SpanIS8_EE5valuesr3std14is_convertibleIPA_NS3_14remove_pointerIDTcldtclsr3stdE7declvalISA_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalISA_EE4sizeEEmEE5valueEDnE4typeE:
  172|   262k|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIKSt4byteEC2IS1_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S1_EE5valueEiE4typeELi0EEEPS6_m:
  119|   106k|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_ZN4SpanIKhEC2INSt3__16vectorIhNS3_9allocatorIhEEEEEERT_NS3_9enable_ifIXaaaantsr7is_SpanIS8_EE5valuesr3std14is_convertibleIPA_NS3_14remove_pointerIDTcldtclsr3stdE7declvalIS9_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS9_EE4sizeEEmEE5valueEDnE4typeE:
  165|   550k|        : m_data(other.data()), m_size(other.size()){}
_ZNK4SpanIhE10size_bytesEv:
  188|  21.1k|    constexpr std::size_t size_bytes() const noexcept { return sizeof(C) * m_size; }
_Z7AsBytesIhE4SpanIKSt4byteES0_IT_E:
  259|  21.1k|{
  260|  21.1k|    return {reinterpret_cast<const std::byte*>(s.data()), s.size_bytes()};
  261|  21.1k|}
_ZNK4SpanItE4dataEv:
  174|  3.03k|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanItE10size_bytesEv:
  188|  3.03k|    constexpr std::size_t size_bytes() const noexcept { return sizeof(C) * m_size; }
_Z7AsBytesItE4SpanIKSt4byteES0_IT_E:
  259|  3.03k|{
  260|  3.03k|    return {reinterpret_cast<const std::byte*>(s.data()), s.size_bytes()};
  261|  3.03k|}
_ZN4SpanIKhEC2IS0_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S0_EE5valueEiE4typeELi0EEEPS5_m:
  119|  25.8M|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_ZN4SpanIhEC2IhTnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_hEE5valueEiE4typeELi0EEEPS4_m:
  119|   547k|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_ZN4SpanItEC2ItTnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_tEE5valueEiE4typeELi0EEEPS4_m:
  119|  3.03k|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_ZN4SpanIKcEC2INSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEERKT_NS3_9enable_ifIXaaaantsr7is_SpanISA_EE5valuesr3std14is_convertibleIPA_NS3_14remove_pointerIDTcldtclsr3stdE7declvalISC_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalISC_EE4sizeEEmEE5valueEDnE4typeE:
  172|  38.1k|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIKhEC2INSt3__14spanIS0_Lm18446744073709551615EEEEERT_NS3_9enable_ifIXaaaantsr7is_SpanIS6_EE5valuesr3std14is_convertibleIPA_NS3_14remove_pointerIDTcldtclsr3stdE7declvalIS7_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS7_EE4sizeEEmEE5valueEDnE4typeE:
  165|   434k|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIKhEC2INSt3__15arrayIhLm32EEEEERKT_NS3_9enable_ifIXaaaantsr7is_SpanIS6_EE5valuesr3std14is_convertibleIPA_NS3_14remove_pointerIDTcldtclsr3stdE7declvalIS8_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS8_EE4sizeEEmEE5valueEDnE4typeE:
  172|  7.27k|        : m_data(other.data()), m_size(other.size()){}
_Z13MakeUCharSpanIRKNSt3__16vectorIhNS0_9allocatorIhEEEEEDTcl13UCharSpanCasttl4Spanclsr3stdE7forwardIT_Efp_EEEEOS8_:
  296|   255k|template <typename V> constexpr auto MakeUCharSpan(V&& v) -> decltype(UCharSpanCast(Span{std::forward<V>(v)})) { return UCharSpanCast(Span{std::forward<V>(v)}); }
_ZN4SpanIhEC2I7uint256EERT_NSt3__19enable_ifIXaaaantsr7is_SpanIS3_EE5valuesr3std14is_convertibleIPA_NS5_14remove_pointerIDTcldtclsr3stdE7declvalIS4_EE4dataEEE4typeEPA_hEE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS4_EE4sizeEEmEE5valueEDnE4typeE:
  165|   519k|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIhEC2I7uint160EERT_NSt3__19enable_ifIXaaaantsr7is_SpanIS3_EE5valuesr3std14is_convertibleIPA_NS5_14remove_pointerIDTcldtclsr3stdE7declvalIS4_EE4dataEEE4typeEPA_hEE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS4_EE4sizeEEmEE5valueEDnE4typeE:
  165|  2.07M|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIhEC2INSt3__16vectorIhNS2_9allocatorIhEEEEEERT_NS2_9enable_ifIXaaaantsr7is_SpanIS7_EE5valuesr3std14is_convertibleIPA_NS2_14remove_pointerIDTcldtclsr3stdE7declvalIS8_EE4dataEEE4typeEPA_hEE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS8_EE4sizeEEmEE5valueEDnE4typeE:
  165|   263k|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIKhEC2ILi4EEERAT__S0_:
  151|   295k|    constexpr Span(C (&a)[N]) noexcept : m_data(a), m_size(N) {}
_ZN4SpanIKhEC2ILi65EEERAT__S0_:
  151|  2.06M|    constexpr Span(C (&a)[N]) noexcept : m_data(a), m_size(N) {}
_ZN4SpanIKhEC2IhTnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S0_EE5valueEiE4typeELi0EEERKS_IS5_E:
  141|   263k|    constexpr Span(const Span<O>& other) noexcept : m_data(other.m_data), m_size(other.m_size) {}
_ZN4SpanIKhEC2I7CPubKeyEERKT_NSt3__19enable_ifIXaaaantsr7is_SpanIS4_EE5valuesr3std14is_convertibleIPA_NS7_14remove_pointerIDTcldtclsr3stdE7declvalIS6_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS6_EE4sizeEEmEE5valueEDnE4typeE:
  172|   342k|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIKhEC2I7CScriptEERKT_NSt3__19enable_ifIXaaaantsr7is_SpanIS4_EE5valuesr3std14is_convertibleIPA_NS7_14remove_pointerIDTcldtclsr3stdE7declvalIS6_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS6_EE4sizeEEmEE5valueEDnE4typeE:
  172|  13.3k|        : m_data(other.data()), m_size(other.size()){}
_Z13MakeUCharSpanIRK11XOnlyPubKeyEDTcl13UCharSpanCasttl4Spanclsr3stdE7forwardIT_Efp_EEEEOS4_:
  296|  3.30k|template <typename V> constexpr auto MakeUCharSpan(V&& v) -> decltype(UCharSpanCast(Span{std::forward<V>(v)})) { return UCharSpanCast(Span{std::forward<V>(v)}); }
_ZN4SpanIKhEC2I11XOnlyPubKeyEERKT_NSt3__19enable_ifIXaaaantsr7is_SpanIS4_EE5valuesr3std14is_convertibleIPA_NS7_14remove_pointerIDTcldtclsr3stdE7declvalIS6_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS6_EE4sizeEEmEE5valueEDnE4typeE:
  172|  3.30k|        : m_data(other.data()), m_size(other.size()){}
_ZNK4SpanI7CScriptEixEm:
  191|  51.6k|    {
  192|  51.6k|        ASSERT_IF_DEBUG(size() > pos);
  193|  51.6k|        return m_data[pos];
  194|  51.6k|    }
_ZNK4SpanI7CScriptE4sizeEv:
  187|     80|    constexpr std::size_t size() const noexcept { return m_size; }
_ZN4SpanI7CScriptEC2INSt3__16vectorIS0_NS3_9allocatorIS0_EEEEEERT_NS3_9enable_ifIXaaaantsr7is_SpanIS8_EE5valuesr3std14is_convertibleIPA_NS3_14remove_pointerIDTcldtclsr3stdE7declvalIS9_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS9_EE4sizeEEmEE5valueEDnE4typeE:
  165|  71.3k|        : m_data(other.data()), m_size(other.size()){}
_ZNK4SpanI7CScriptE4lastEm:
  211|  54.3k|    {
  212|  54.3k|         ASSERT_IF_DEBUG(size() >= count);
  213|  54.3k|         return Span<C>(m_data + m_size - count, count);
  214|  54.3k|    }
_ZN4SpanI7CScriptEC2IS0_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S0_EE5valueEiE4typeELi0EEEPS5_m:
  119|  54.3k|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_ZNK4SpanINSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEEixEm:
  191|  51.9k|    {
  192|  51.9k|        ASSERT_IF_DEBUG(size() > pos);
  193|  51.9k|        return m_data[pos];
  194|  51.9k|    }
_ZNK4SpanINSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEE5beginEv:
  175|    332|    constexpr C* begin() const noexcept { return m_data; }
_ZNK4SpanINSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEE3endEv:
  176|    332|    constexpr C* end() const noexcept { return m_data + m_size; }
_ZN4SpanINSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEEC2INS0_6vectorIS6_NS4_IS6_EEEEEERT_NS0_9enable_ifIXaaaantsr7is_SpanISC_EE5valuesr3std14is_convertibleIPA_NS0_14remove_pointerIDTcldtclsr3stdE7declvalISD_EE4dataEEE4typeEPA_S6_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalISD_EE4sizeEEmEE5valueEDnE4typeE:
  165|  95.8k|        : m_data(other.data()), m_size(other.size()){}
_ZNK4SpanINSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEE4lastEm:
  211|  95.8k|    {
  212|  95.8k|         ASSERT_IF_DEBUG(size() >= count);
  213|  95.8k|         return Span<C>(m_data + m_size - count, count);
  214|  95.8k|    }
_ZN4SpanINSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEEC2IS6_TnNS0_9enable_ifIXsr3std14is_convertibleIPA_T_PA_S6_EE5valueEiE4typeELi0EEEPSA_m:
  119|  95.8k|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_ZNK4SpanIKcEixEm:
  191|  60.3M|    {
  192|  60.3M|        ASSERT_IF_DEBUG(size() > pos);
  193|  60.3M|        return m_data[pos];
  194|  60.3M|    }
_ZNK4SpanIKcE7subspanEm:
  196|  1.08M|    {
  197|  1.08M|        ASSERT_IF_DEBUG(size() >= offset);
  198|  1.08M|        return Span<C>(m_data + offset, m_size - offset);
  199|  1.08M|    }
_ZN4SpanIKcEC2IS0_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S0_EE5valueEiE4typeELi0EEEPS5_m:
  119|  1.71M|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_ZNK4SpanIhE5firstEm:
  206|   263k|    {
  207|   263k|        ASSERT_IF_DEBUG(size() >= count);
  208|   263k|        return Span<C>(m_data, count);
  209|   263k|    }
_ZN4SpanIKcEC2IS0_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S0_EE5valueEiE4typeELi0EEEPS5_SC_:
  127|  3.57M|    CONSTEXPR_IF_NOT_DEBUG Span(T* begin, T* end) noexcept : m_data(begin), m_size(end - begin)
  128|  3.57M|    {
  129|  3.57M|        ASSERT_IF_DEBUG(end >= begin);
  130|  3.57M|    }
_ZNK4SpanIKcE5firstEm:
  206|   617k|    {
  207|   617k|        ASSERT_IF_DEBUG(size() >= count);
  208|   617k|        return Span<C>(m_data, count);
  209|   617k|    }
_ZNK4SpanIKcE7subspanEmm:
  201|  11.5k|    {
  202|  11.5k|        ASSERT_IF_DEBUG(size() >= offset + count);
  203|  11.5k|        return Span<C>(m_data + offset, count);
  204|  11.5k|    }
_Z13MakeUCharSpanIRK7CScriptEDTcl13UCharSpanCasttl4Spanclsr3stdE7forwardIT_Efp_EEEEOS4_:
  296|  3.99k|template <typename V> constexpr auto MakeUCharSpan(V&& v) -> decltype(UCharSpanCast(Span{std::forward<V>(v)})) { return UCharSpanCast(Span{std::forward<V>(v)}); }
_ZNK4SpanIKhEixEm:
  191|  21.2M|    {
  192|  21.2M|        ASSERT_IF_DEBUG(size() > pos);
  193|  21.2M|        return m_data[pos];
  194|  21.2M|    }
_Z13MakeUCharSpanIRK4SpanIhEEDTcl13UCharSpanCasttlS0_clsr3stdE7forwardIT_Efp_EEEEOS4_:
  296|   263k|template <typename V> constexpr auto MakeUCharSpan(V&& v) -> decltype(UCharSpanCast(Span{std::forward<V>(v)})) { return UCharSpanCast(Span{std::forward<V>(v)}); }
_Z13UCharSpanCastIhE4SpanINSt3__114remove_pointerIDTcl9UCharCastcldtfp_4dataEEEE4typeEES0_IT_E:
  293|   263k|template <typename T> constexpr auto UCharSpanCast(Span<T> s) -> Span<typename std::remove_pointer<decltype(UCharCast(s.data()))>::type> { return {UCharCast(s.data()), s.size()}; }
_ZN4SpanIKhEC2ILi33EEERAT__S0_:
  151|   138k|    constexpr Span(C (&a)[N]) noexcept : m_data(a), m_size(N) {}
_ZN4SpanIKcEC2ILi2EEERAT__S0_:
  151|   131k|    constexpr Span(C (&a)[N]) noexcept : m_data(a), m_size(N) {}
_ZN4SpanIKcEC2ILi3EEERAT__S0_:
  151|   262k|    constexpr Span(C (&a)[N]) noexcept : m_data(a), m_size(N) {}
_ZNK4SpanIKcE5emptyEv:
  189|   359k|    constexpr bool empty() const noexcept { return size() == 0; }
_ZNK4SpanIKcE5frontEv:
  178|   229k|    {
  179|   229k|        ASSERT_IF_DEBUG(size() > 0);
  180|   229k|        return m_data[0];
  181|   229k|    }
_ZNK4SpanIKcE4backEv:
  183|     62|    {
  184|     62|        ASSERT_IF_DEBUG(size() > 0);
  185|     62|        return m_data[m_size - 1];
  186|     62|    }
_ZN4SpanIK7CScriptEC2IS0_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S1_EE5valueEiE4typeELi0EEERKS_IS6_E:
  141|  17.0k|    constexpr Span(const Span<O>& other) noexcept : m_data(other.m_data), m_size(other.m_size) {}
_ZNK4SpanIK7CScriptEixEm:
  191|  15.3k|    {
  192|  15.3k|        ASSERT_IF_DEBUG(size() > pos);
  193|  15.3k|        return m_data[pos];
  194|  15.3k|    }
_ZNK4SpanIK7CScriptE4sizeEv:
  187|  2.82k|    constexpr std::size_t size() const noexcept { return m_size; }
descriptor.cpp:_ZNK4SpanINSt3__18optionalINS0_3setIjZNK10miniscript4NodeIjE17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_E4CompNS0_9allocatorIjEEEEEEE5beginEv:
  175|  1.17M|    constexpr C* begin() const noexcept { return m_data; }
descriptor.cpp:_ZNK4SpanINSt3__18optionalINS0_3setIjZNK10miniscript4NodeIjE17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_E4CompNS0_9allocatorIjEEEEEEE3endEv:
  176|  1.17M|    constexpr C* end() const noexcept { return m_data + m_size; }
descriptor.cpp:_ZN4SpanINSt3__18optionalINS0_3setIjZNK10miniscript4NodeIjE17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_E4CompNS0_9allocatorIjEEEEEEEC2INS0_6vectorISG_NSD_ISG_EEEEEERS9_NS0_9enable_ifIXaaaantsr7is_SpanIS9_EE5valuesr3std14is_convertibleIPA_NS0_14remove_pointerIDTcldtclsr3stdE7declvalISM_EE4dataEEE4typeEPA_SG_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalISM_EE4sizeEEmEE5valueEDnE4typeE:
  165|   590k|        : m_data(other.data()), m_size(other.size()){}
descriptor.cpp:_ZNK4SpanINSt3__18optionalINS0_3setIjZNK10miniscript4NodeIjE17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_E4CompNS0_9allocatorIjEEEEEEE4lastEm:
  211|   590k|    {
  212|   590k|         ASSERT_IF_DEBUG(size() >= count);
  213|   590k|         return Span<C>(m_data + m_size - count, count);
  214|   590k|    }
descriptor.cpp:_ZN4SpanINSt3__18optionalINS0_3setIjZNK10miniscript4NodeIjE17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_E4CompNS0_9allocatorIjEEEEEEEC2ISG_TnNS0_9enable_ifIXsr3std14is_convertibleIPA_S9_PA_SG_EE5valueEiE4typeELi0EEEPS9_m:
  119|   590k|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_ZNK4SpanIPKN10miniscript4NodeIjEEE5beginEv:
  175|   390k|    constexpr C* begin() const noexcept { return m_data; }
_ZNK4SpanIPKN10miniscript4NodeIjEEE3endEv:
  176|   390k|    constexpr C* end() const noexcept { return m_data + m_size; }
_ZN4SpanIPKN10miniscript4NodeIjEEEC2INSt3__16vectorIS4_NS7_9allocatorIS4_EEEEEERT_NS7_9enable_ifIXaaaantsr7is_SpanISC_EE5valuesr3std14is_convertibleIPA_NS7_14remove_pointerIDTcldtclsr3stdE7declvalISD_EE4dataEEE4typeEPA_S4_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalISD_EE4sizeEEmEE5valueEDnE4typeE:
  165|   390k|        : m_data(other.data()), m_size(other.size()){}
_ZNK4SpanIPKN10miniscript4NodeIjEEE4lastEm:
  211|   390k|    {
  212|   390k|         ASSERT_IF_DEBUG(size() >= count);
  213|   390k|         return Span<C>(m_data + m_size - count, count);
  214|   390k|    }
_ZN4SpanIPKN10miniscript4NodeIjEEEC2IS4_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S4_EE5valueEiE4typeELi0EEEPS9_m:
  119|   390k|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_ZNK4SpanINSt3__110unique_ptrIKN10miniscript4NodeIjEENS0_14default_deleteIS5_EEEEE5beginEv:
  175|  75.1k|    constexpr C* begin() const noexcept { return m_data; }
_ZNK4SpanINSt3__110unique_ptrIKN10miniscript4NodeIjEENS0_14default_deleteIS5_EEEEE3endEv:
  176|   147k|    constexpr C* end() const noexcept { return m_data + m_size; }
_ZN4SpanINSt3__110unique_ptrIKN10miniscript4NodeIjEENS0_14default_deleteIS5_EEEEEC2INS0_6vectorIS8_NS0_9allocatorIS8_EEEEEERT_NS0_9enable_ifIXaaaantsr7is_SpanISF_EE5valuesr3std14is_convertibleIPA_NS0_14remove_pointerIDTcldtclsr3stdE7declvalISG_EE4dataEEE4typeEPA_S8_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalISG_EE4sizeEEmEE5valueEDnE4typeE:
  165|  75.1k|        : m_data(other.data()), m_size(other.size()){}
_ZNK4SpanINSt3__110unique_ptrIKN10miniscript4NodeIjEENS0_14default_deleteIS5_EEEEE4lastEm:
  211|  75.1k|    {
  212|  75.1k|         ASSERT_IF_DEBUG(size() >= count);
  213|  75.1k|         return Span<C>(m_data + m_size - count, count);
  214|  75.1k|    }
_ZN4SpanINSt3__110unique_ptrIKN10miniscript4NodeIjEENS0_14default_deleteIS5_EEEEEC2IS8_TnNS0_9enable_ifIXsr3std14is_convertibleIPA_T_PA_S8_EE5valueEiE4typeELi0EEEPSC_m:
  119|  75.1k|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_ZN4SpanIKhEC2I7uint256EERT_NSt3__19enable_ifIXaaaantsr7is_SpanIS4_EE5valuesr3std14is_convertibleIPA_NS6_14remove_pointerIDTcldtclsr3stdE7declvalIS5_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS5_EE4sizeEEmEE5valueEDnE4typeE:
  165|  37.4k|        : m_data(other.data()), m_size(other.size()){}

_Z18make_secure_uniqueINSt3__15arrayIhLm32EEEJEENS0_10unique_ptrIT_19SecureUniqueDeleterIS4_EEEDpOT0_:
   72|   855k|{
   73|   855k|    T* p = secure_allocator<T>().allocate(1);
   74|       |
   75|       |    // initialize in place, and return as secure_unique_ptr
   76|   855k|    try {
   77|   855k|        return secure_unique_ptr<T>(new (p) T(std::forward<Args>(as)...));
   78|   855k|    } catch (...) {
   79|      0|        secure_allocator<T>().deallocate(p, 1);
   80|      0|        throw;
   81|      0|    }
   82|   855k|}
_ZN16secure_allocatorINSt3__15arrayIhLm32EEEE8allocateEm:
   28|   855k|    {
   29|   855k|        T* allocation = static_cast<T*>(LockedPoolManager::Instance().alloc(sizeof(T) * n));
   30|   855k|        if (!allocation) {
  ------------------
  |  Branch (30:13): [True: 0, False: 855k]
  ------------------
   31|      0|            throw std::bad_alloc();
   32|      0|        }
   33|   855k|        return allocation;
   34|   855k|    }
_ZN16secure_allocatorINSt3__15arrayIhLm32EEEE10deallocateEPS2_m:
   37|   855k|    {
   38|   855k|        if (p != nullptr) {
  ------------------
  |  Branch (38:13): [True: 855k, False: 0]
  ------------------
   39|   855k|            memory_cleanse(p, sizeof(T) * n);
   40|   855k|        }
   41|   855k|        LockedPoolManager::Instance().free(p);
   42|   855k|    }
_ZN19SecureUniqueDeleterINSt3__15arrayIhLm32EEEEclEPS2_:
   62|   855k|    void operator()(T* t) noexcept {
   63|   855k|        secure_allocator<T>().deallocate(t, 1);
   64|   855k|    }
_ZN16secure_allocatorIhE10deallocateEPhm:
   37|   396k|    {
   38|   396k|        if (p != nullptr) {
  ------------------
  |  Branch (38:13): [True: 396k, False: 0]
  ------------------
   39|   396k|            memory_cleanse(p, sizeof(T) * n);
   40|   396k|        }
   41|   396k|        LockedPoolManager::Instance().free(p);
   42|   396k|    }
_ZN16secure_allocatorIhE8allocateEm:
   28|   396k|    {
   29|   396k|        T* allocation = static_cast<T*>(LockedPoolManager::Instance().alloc(sizeof(T) * n));
   30|   396k|        if (!allocation) {
  ------------------
  |  Branch (30:13): [True: 0, False: 396k]
  ------------------
   31|      0|            throw std::bad_alloc();
   32|      0|        }
   33|   396k|        return allocation;
   34|   396k|    }

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

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

_ZNK5Arena14addressInArenaEPv:
   90|  1.25M|    bool addressInArena(void *ptr) const { return ptr >= base && ptr < end; }
  ------------------
  |  Branch (90:51): [True: 1.25M, False: 0]
  |  Branch (90:66): [True: 1.25M, False: 0]
  ------------------
_ZN17LockedPoolManager8InstanceEv:
  223|  2.50M|    {
  224|  2.50M|        static std::once_flag init_flag;
  225|  2.50M|        std::call_once(init_flag, LockedPoolManager::CreateInstance);
  226|  2.50M|        return *LockedPoolManager::_instance;
  227|  2.50M|    }

_Z28descriptor_parse_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEE:
  108|  10.2k|{
  109|       |    // See comments above for rationales.
  110|  10.2k|    if (HasDeepDerivPath(buffer)) return;
  ------------------
  |  Branch (110:9): [True: 1, False: 10.2k]
  ------------------
  111|  10.2k|    if (HasTooManySubFrag(buffer)) return;
  ------------------
  |  Branch (111:9): [True: 2, False: 10.2k]
  ------------------
  112|  10.2k|    if (HasTooManyWrappers(buffer)) return;
  ------------------
  |  Branch (112:9): [True: 8, False: 10.2k]
  ------------------
  113|       |
  114|  10.2k|    const std::string descriptor(buffer.begin(), buffer.end());
  115|  10.2k|    FlatSigningProvider signing_provider;
  116|  10.2k|    std::string error;
  117|  20.4k|    for (const bool require_checksum : {true, false}) {
  ------------------
  |  Branch (117:38): [True: 20.4k, False: 10.2k]
  ------------------
  118|  20.4k|        const auto desc = Parse(descriptor, signing_provider, error, require_checksum);
  119|  20.4k|        std::optional<bool> is_ranged;
  120|  20.4k|        std::optional<bool> is_solvable;
  121|  20.4k|        for (const auto& d : desc) {
  ------------------
  |  Branch (121:28): [True: 3.58k, False: 20.4k]
  ------------------
  122|  3.58k|            assert(d);
  123|  3.58k|            TestDescriptor(*d, signing_provider, error, is_ranged, is_solvable);
  124|  3.58k|        }
  125|  20.4k|    }
  126|  10.2k|}
descriptor_parse.cpp:_ZL14TestDescriptorRK10DescriptorR19FlatSigningProviderRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEERNS4_8optionalIbEESE_:
   19|  3.58k|{
   20|       |    // Trivial helpers.
   21|  3.58k|    (void)desc.IsRange();
   22|  3.58k|    (void)desc.IsSingleType();
   23|  3.58k|    (void)desc.GetOutputType();
   24|       |
   25|  3.58k|    if (is_ranged.has_value()) {
  ------------------
  |  Branch (25:9): [True: 0, False: 3.58k]
  ------------------
   26|      0|        assert(desc.IsRange() == *is_ranged);
   27|  3.58k|    } else {
   28|  3.58k|        is_ranged = desc.IsRange();
   29|  3.58k|    }
   30|  3.58k|    if (is_solvable.has_value()) {
  ------------------
  |  Branch (30:9): [True: 0, False: 3.58k]
  ------------------
   31|      0|        assert(desc.IsSolvable() == *is_solvable);
   32|  3.58k|    } else {
   33|  3.58k|        is_solvable = desc.IsSolvable();
   34|  3.58k|    }
   35|       |
   36|       |    // Serialization to string representation.
   37|  3.58k|    (void)desc.ToString();
   38|  3.58k|    (void)desc.ToPrivateString(sig_provider, dummy);
   39|  3.58k|    (void)desc.ToNormalizedString(sig_provider, dummy);
   40|       |
   41|       |    // Serialization to Script.
   42|  3.58k|    DescriptorCache cache;
   43|  3.58k|    std::vector<CScript> out_scripts;
   44|  3.58k|    (void)desc.Expand(0, sig_provider, out_scripts, sig_provider, &cache);
   45|  3.58k|    (void)desc.ExpandPrivate(0, sig_provider, sig_provider);
   46|  3.58k|    (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|  3.58k|    if (!out_scripts.empty()) {
  ------------------
  |  Branch (49:9): [True: 3.58k, False: 0]
  ------------------
   50|  3.58k|        assert(InferDescriptor(out_scripts.back(), sig_provider));
   51|       |
   52|       |        // The ScriptSize() must match the size of the serialized Script. (ScriptSize() is set for all descs but 'combo()'.)
   53|  3.58k|        const bool is_combo{!desc.IsSingleType()};
   54|  3.58k|        assert(is_combo || desc.ScriptSize() == out_scripts.back().size());
   55|  3.58k|    }
   56|       |
   57|  3.58k|    const auto max_sat_maxsig{desc.MaxSatisfactionWeight(true)};
   58|  3.58k|    const auto max_sat_nonmaxsig{desc.MaxSatisfactionWeight(true)};
   59|  3.58k|    const auto max_elems{desc.MaxSatisfactionElems()};
   60|       |    // We must be able to estimate the max satisfaction size for any solvable descriptor (but combo).
   61|  3.58k|    const bool is_nontop_or_nonsolvable{!*is_solvable || !desc.GetOutputType()};
  ------------------
  |  Branch (61:41): [True: 511, False: 3.07k]
  |  Branch (61:58): [True: 418, False: 2.65k]
  ------------------
   62|  3.58k|    const bool is_input_size_info_set{max_sat_maxsig && max_sat_nonmaxsig && max_elems};
  ------------------
  |  Branch (62:39): [True: 3.06k, False: 515]
  |  Branch (62:57): [True: 3.06k, False: 0]
  |  Branch (62:78): [True: 3.06k, False: 0]
  ------------------
   63|  3.58k|    assert(is_input_size_info_set || is_nontop_or_nonsolvable);
   64|  3.58k|}

LLVMFuzzerTestOneInput:
  222|  10.2k|{
  223|  10.2k|    test_one_input({data, size});
  224|  10.2k|    return 0;
  225|  10.2k|}
fuzz.cpp:_ZL14test_one_inputNSt3__14spanIKhLm18446744073709551615EEE:
   83|  10.2k|{
   84|  10.2k|    CheckGlobals check{};
   85|  10.2k|    (*Assert(g_test_one_input))(buffer);
  ------------------
  |  |   85|  10.2k|#define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
   86|  10.2k|}

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

_Z16HasDeepDerivPathRKNSt3__14spanIKhLm18446744073709551615EEEi:
   78|  10.2k|{
   79|  10.2k|    auto depth{0};
   80|   179M|    for (const auto& ch: buff) {
  ------------------
  |  Branch (80:24): [True: 179M, False: 10.2k]
  ------------------
   81|   179M|        if (ch == ',') {
  ------------------
  |  Branch (81:13): [True: 765k, False: 178M]
  ------------------
   82|       |            // A comma is always present between two key expressions, so we use that as a delimiter.
   83|   765k|            depth = 0;
   84|   178M|        } else if (ch == '/') {
  ------------------
  |  Branch (84:20): [True: 242k, False: 178M]
  ------------------
   85|   242k|            if (++depth > max_depth) return true;
  ------------------
  |  Branch (85:17): [True: 1, False: 242k]
  ------------------
   86|   242k|        }
   87|   179M|    }
   88|  10.2k|    return false;
   89|  10.2k|}
_Z17HasTooManySubFragRKNSt3__14spanIKhLm18446744073709551615EEEim:
   92|  10.2k|{
   93|       |    // We use a stack because there may be many nested sub-frags.
   94|  10.2k|    std::stack<int> counts;
   95|   179M|    for (const auto& ch: buff) {
  ------------------
  |  Branch (95:24): [True: 179M, False: 10.2k]
  ------------------
   96|       |        // The fuzzer may generate an input with a ton of parentheses. Rule out pathological cases.
   97|   179M|        if (counts.size() > max_nested_subs) return true;
  ------------------
  |  Branch (97:13): [True: 1, False: 179M]
  ------------------
   98|       |
   99|   179M|        if (ch == '(') {
  ------------------
  |  Branch (99:13): [True: 571k, False: 178M]
  ------------------
  100|       |            // A new fragment was opened, create a new sub-count for it and start as one since any fragment with
  101|       |            // parentheses has at least one sub.
  102|   571k|            counts.push(1);
  103|   178M|        } else if (ch == ',' && !counts.empty()) {
  ------------------
  |  Branch (103:20): [True: 765k, False: 178M]
  |  Branch (103:33): [True: 763k, False: 2.29k]
  ------------------
  104|       |            // When encountering a comma, account for an additional sub in the last opened fragment. If it exceeds the
  105|       |            // limit, bail.
  106|   763k|            if (++counts.top() > max_subs) return true;
  ------------------
  |  Branch (106:17): [True: 1, False: 763k]
  ------------------
  107|   178M|        } else if (ch == ')' && !counts.empty()) {
  ------------------
  |  Branch (107:20): [True: 370k, False: 177M]
  |  Branch (107:33): [True: 363k, False: 6.28k]
  ------------------
  108|       |            // Fragment closed! Drop its sub count and resume to counting the number of subs for its parent.
  109|   363k|            counts.pop();
  110|   363k|        }
  111|   179M|    }
  112|  10.2k|    return false;
  113|  10.2k|}
_Z18HasTooManyWrappersRKNSt3__14spanIKhLm18446744073709551615EEEi:
  116|  10.2k|{
  117|       |    // The number of nested wrappers. Nested wrappers are always characters which follow each other so we don't have to
  118|       |    // use a stack as we do above when counting the number of sub-fragments.
  119|  10.2k|    std::optional<int> count;
  120|       |
  121|       |    // We want to detect nested wrappers. A wrapper is a character prepended to a fragment, separated by a colon. There
  122|       |    // may be more than one wrapper, in which case the colon is not repeated. For instance `jjjjj:pk()`.  To count
  123|       |    // wrappers we iterate in reverse and use the colon to detect the end of a wrapper expression and count how many
  124|       |    // characters there are since the beginning of the expression. We stop counting when we encounter a character
  125|       |    // indicating the beginning of a new expression.
  126|   179M|    for (const auto ch: buff | std::views::reverse) {
  ------------------
  |  Branch (126:23): [True: 179M, False: 10.2k]
  ------------------
  127|       |        // A colon, start counting.
  128|   179M|        if (ch == ':') {
  ------------------
  |  Branch (128:13): [True: 439k, False: 178M]
  ------------------
  129|       |            // The colon itself is not a wrapper so we start at 0.
  130|   439k|            count = 0;
  131|   178M|        } else if (count) {
  ------------------
  |  Branch (131:20): [True: 2.90M, False: 175M]
  ------------------
  132|       |            // If we are counting wrappers, stop when we crossed the beginning of the wrapper expression. Otherwise keep
  133|       |            // counting and bail if we reached the limit.
  134|       |            // A wrapper may only ever occur as the first sub of a descriptor/miniscript expression ('('), as the
  135|       |            // first Taproot leaf in a pair ('{') or as the nth sub in each case (',').
  136|  2.90M|            if (ch == ',' || ch == '(' || ch == '{') {
  ------------------
  |  Branch (136:17): [True: 408k, False: 2.49M]
  |  Branch (136:30): [True: 27.8k, False: 2.46M]
  |  Branch (136:43): [True: 1.54k, False: 2.46M]
  ------------------
  137|   437k|                count.reset();
  138|  2.46M|            } else if (++*count > max_wrappers) {
  ------------------
  |  Branch (138:24): [True: 8, False: 2.46M]
  ------------------
  139|      8|                return true;
  140|      8|            }
  141|  2.90M|        }
  142|   179M|    }
  143|       |
  144|  10.2k|    return false;
  145|  10.2k|}

_ZNK10tinyformat6detail9FormatArg6formatERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEEPKcS9_i:
  541|   452k|        {
  542|   452k|            TINYFORMAT_ASSERT(m_value);
  ------------------
  |  |  153|   452k|#   define TINYFORMAT_ASSERT(cond) assert(cond)
  ------------------
  543|   452k|            TINYFORMAT_ASSERT(m_formatImpl);
  ------------------
  |  |  153|   452k|#   define TINYFORMAT_ASSERT(cond) assert(cond)
  ------------------
  544|   452k|            m_formatImpl(out, fmtBegin, fmtEnd, ntrunc, m_value);
  545|   452k|        }
_ZN10tinyformat10FormatListC2EPNS_6detail9FormatArgEi:
  966|   452k|            : m_args(args), m_N(N) { }
_ZN10tinyformat6detail11FormatListNILi0EEC2Ev:
 1025|     30|    FormatListN() : FormatList(nullptr, 0) {}
_ZN10tinyformat11formatValueERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEPKcS7_ic:
  385|     29|                        const char* fmtEnd, int /**/, charType value) \
  386|     29|{                                                                     \
  387|     29|    switch (*(fmtEnd-1)) {                                            \
  388|      0|        case 'u': case 'd': case 'i': case 'o': case 'X': case 'x':   \
  ------------------
  |  Branch (388:9): [True: 0, False: 29]
  |  Branch (388:19): [True: 0, False: 29]
  |  Branch (388:29): [True: 0, False: 29]
  |  Branch (388:39): [True: 0, False: 29]
  |  Branch (388:49): [True: 0, False: 29]
  |  Branch (388:59): [True: 0, False: 29]
  ------------------
  389|      0|            out << static_cast<int>(value); break;                    \
  390|     29|        default:                                                      \
  ------------------
  |  Branch (390:9): [True: 29, False: 0]
  ------------------
  391|     29|            out << value;                   break;                    \
  392|     29|    }                                                                 \
  393|     29|}
_ZN10tinyformat6detail21parseWidthOrPrecisionERiRPKcbPKNS0_9FormatArgES1_i:
  593|   452k|{
  594|   452k|    if (*c >= '0' && *c <= '9') {
  ------------------
  |  Branch (594:9): [True: 452k, False: 0]
  |  Branch (594:22): [True: 0, False: 452k]
  ------------------
  595|      0|        n = parseIntAndAdvance(c);
  596|      0|    }
  597|   452k|    else if (*c == '*') {
  ------------------
  |  Branch (597:14): [True: 0, False: 452k]
  ------------------
  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|   452k|    else {
  618|   452k|        return false;
  619|   452k|    }
  620|      0|    return true;
  621|   452k|}
_ZN10tinyformat6detail24printFormatStringLiteralERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKc:
  629|   905k|{
  630|   905k|    const char* c = fmt;
  631|  1.48M|    for (;; ++c) {
  632|  1.48M|        if (*c == '\0') {
  ------------------
  |  Branch (632:13): [True: 452k, False: 1.02M]
  ------------------
  633|   452k|            out.write(fmt, c - fmt);
  634|   452k|            return c;
  635|   452k|        }
  636|  1.02M|        else if (*c == '%') {
  ------------------
  |  Branch (636:18): [True: 452k, False: 575k]
  ------------------
  637|   452k|            out.write(fmt, c - fmt);
  638|   452k|            if (*(c+1) != '%')
  ------------------
  |  Branch (638:17): [True: 452k, False: 0]
  ------------------
  639|   452k|                return c;
  640|       |            // for "%%", tack trailing % onto next literal section.
  641|      0|            fmt = ++c;
  642|      0|        }
  643|  1.48M|    }
  644|   905k|}
_ZN10tinyformat6detail21streamStateFromFormatERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEERbS7_RiPKcPKNS0_9FormatArgES8_i:
  685|   452k|{
  686|   452k|    TINYFORMAT_ASSERT(*fmtStart == '%');
  ------------------
  |  |  153|   452k|#   define TINYFORMAT_ASSERT(cond) assert(cond)
  ------------------
  687|       |    // Reset stream state to defaults.
  688|   452k|    out.width(0);
  689|   452k|    out.precision(6);
  690|   452k|    out.fill(' ');
  691|       |    // Reset most flags; ignore irrelevant unitbuf & skipws.
  692|   452k|    out.unsetf(std::ios::adjustfield | std::ios::basefield |
  693|   452k|               std::ios::floatfield | std::ios::showbase | std::ios::boolalpha |
  694|   452k|               std::ios::showpoint | std::ios::showpos | std::ios::uppercase);
  695|   452k|    bool precisionSet = false;
  696|   452k|    bool widthSet = false;
  697|   452k|    int widthExtra = 0;
  698|   452k|    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|   452k|    if (*c >= '0' && *c <= '9') {
  ------------------
  |  Branch (702:9): [True: 452k, False: 0]
  |  Branch (702:22): [True: 0, False: 452k]
  ------------------
  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|   452k|    else if (positionalMode) {
  ------------------
  |  Branch (731:14): [True: 0, False: 452k]
  ------------------
  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|   452k|    if (!widthSet) {
  ------------------
  |  Branch (735:9): [True: 452k, False: 0]
  ------------------
  736|       |        // Parse flags
  737|   452k|        for (;; ++c) {
  738|   452k|            switch (*c) {
  739|      0|                case '#':
  ------------------
  |  Branch (739:17): [True: 0, False: 452k]
  ------------------
  740|      0|                    out.setf(std::ios::showpoint | std::ios::showbase);
  741|      0|                    continue;
  742|      0|                case '0':
  ------------------
  |  Branch (742:17): [True: 0, False: 452k]
  ------------------
  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: 452k]
  ------------------
  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: 452k]
  ------------------
  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: 452k]
  ------------------
  761|      0|                    out.setf(std::ios::showpos);
  762|      0|                    spacePadPositive = false;
  763|      0|                    widthExtra = 1;
  764|      0|                    continue;
  765|   452k|                default:
  ------------------
  |  Branch (765:17): [True: 452k, False: 0]
  ------------------
  766|   452k|                    break;
  767|   452k|            }
  768|   452k|            break;
  769|   452k|        }
  770|       |        // Parse width
  771|   452k|        int width = 0;
  772|   452k|        widthSet = parseWidthOrPrecision(width, c, positionalMode,
  773|   452k|                                         args, argIndex, numArgs);
  774|   452k|        if (widthSet) {
  ------------------
  |  Branch (774:13): [True: 0, False: 452k]
  ------------------
  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|   452k|    }
  784|       |    // 3) Parse precision
  785|   452k|    if (*c == '.') {
  ------------------
  |  Branch (785:9): [True: 0, False: 452k]
  ------------------
  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|   452k|    while (*c == 'l' || *c == 'h' || *c == 'L' ||
  ------------------
  |  Branch (797:12): [True: 0, False: 452k]
  |  Branch (797:25): [True: 0, False: 452k]
  |  Branch (797:38): [True: 0, False: 452k]
  ------------------
  798|   452k|           *c == 'j' || *c == 'z' || *c == 't') {
  ------------------
  |  Branch (798:12): [True: 0, False: 452k]
  |  Branch (798:25): [True: 0, False: 452k]
  |  Branch (798:38): [True: 0, False: 452k]
  ------------------
  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|   452k|    bool intConversion = false;
  805|   452k|    switch (*c) {
  806|   448k|        case 'u': case 'd': case 'i':
  ------------------
  |  Branch (806:9): [True: 162, False: 452k]
  |  Branch (806:19): [True: 108, False: 452k]
  |  Branch (806:29): [True: 448k, False: 4.48k]
  ------------------
  807|   448k|            out.setf(std::ios::dec, std::ios::basefield);
  808|   448k|            intConversion = true;
  809|   448k|            break;
  810|      0|        case 'o':
  ------------------
  |  Branch (810:9): [True: 0, False: 452k]
  ------------------
  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: 452k]
  ------------------
  815|      0|            out.setf(std::ios::uppercase);
  816|      0|            [[fallthrough]];
  817|      0|        case 'x': case 'p':
  ------------------
  |  Branch (817:9): [True: 0, False: 452k]
  |  Branch (817:19): [True: 0, False: 452k]
  ------------------
  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: 452k]
  ------------------
  822|      0|            out.setf(std::ios::uppercase);
  823|      0|            [[fallthrough]];
  824|      0|        case 'e':
  ------------------
  |  Branch (824:9): [True: 0, False: 452k]
  ------------------
  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: 452k]
  ------------------
  829|      0|            out.setf(std::ios::uppercase);
  830|      0|            [[fallthrough]];
  831|      0|        case 'f':
  ------------------
  |  Branch (831:9): [True: 0, False: 452k]
  ------------------
  832|      0|            out.setf(std::ios::fixed, std::ios::floatfield);
  833|      0|            break;
  834|      0|        case 'A':
  ------------------
  |  Branch (834:9): [True: 0, False: 452k]
  ------------------
  835|      0|            out.setf(std::ios::uppercase);
  836|      0|            [[fallthrough]];
  837|      0|        case 'a':
  ------------------
  |  Branch (837:9): [True: 0, False: 452k]
  ------------------
  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: 452k]
  ------------------
  847|      0|            out.setf(std::ios::uppercase);
  848|      0|            [[fallthrough]];
  849|      0|        case 'g':
  ------------------
  |  Branch (849:9): [True: 0, False: 452k]
  ------------------
  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|     29|        case 'c':
  ------------------
  |  Branch (854:9): [True: 29, False: 452k]
  ------------------
  855|       |            // Handled as special case inside formatValue()
  856|     29|            break;
  857|  4.19k|        case 's':
  ------------------
  |  Branch (857:9): [True: 4.19k, False: 448k]
  ------------------
  858|  4.19k|            if (precisionSet)
  ------------------
  |  Branch (858:17): [True: 0, False: 4.19k]
  ------------------
  859|      0|                ntrunc = static_cast<int>(out.precision());
  860|       |            // Make %s print Booleans as "true" and "false"
  861|  4.19k|            out.setf(std::ios::boolalpha);
  862|  4.19k|            break;
  863|      0|        case 'n':
  ------------------
  |  Branch (863:9): [True: 0, False: 452k]
  ------------------
  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: 452k]
  ------------------
  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: 452k]
  ------------------
  872|      0|            break;
  873|   452k|    }
  874|   452k|    if (intConversion && precisionSet && !widthSet) {
  ------------------
  |  Branch (874:9): [True: 448k, False: 4.21k]
  |  Branch (874:26): [True: 0, False: 448k]
  |  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|   452k|    return c+1;
  884|   452k|}
_ZN10tinyformat6detail10formatImplERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKcPKNS0_9FormatArgEi:
  891|   452k|{
  892|       |    // Saved stream state
  893|   452k|    std::streamsize origWidth = out.width();
  894|   452k|    std::streamsize origPrecision = out.precision();
  895|   452k|    std::ios::fmtflags origFlags = out.flags();
  896|   452k|    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|   452k|    bool positionalMode = false;
  901|   452k|    int argIndex = 0;
  902|   905k|    while (true) {
  ------------------
  |  Branch (902:12): [Folded - Ignored]
  ------------------
  903|   905k|        fmt = printFormatStringLiteral(out, fmt);
  904|   905k|        if (*fmt == '\0') {
  ------------------
  |  Branch (904:13): [True: 452k, False: 452k]
  ------------------
  905|   452k|            if (!positionalMode && argIndex < numArgs) {
  ------------------
  |  Branch (905:17): [True: 452k, False: 0]
  |  Branch (905:36): [True: 0, False: 452k]
  ------------------
  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|   452k|            break;
  909|   452k|        }
  910|   452k|        bool spacePadPositive = false;
  911|   452k|        int ntrunc = -1;
  912|   452k|        const char* fmtEnd = streamStateFromFormat(out, positionalMode, spacePadPositive, ntrunc, fmt,
  913|   452k|                                                   args, argIndex, numArgs);
  914|       |        // NB: argIndex may be incremented by reading variable width/precision
  915|       |        // in `streamStateFromFormat`, so do the bounds check here.
  916|   452k|        if (argIndex >= numArgs) {
  ------------------
  |  Branch (916:13): [True: 0, False: 452k]
  ------------------
  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|   452k|        const FormatArg& arg = args[argIndex];
  921|       |        // Format the arg into the stream.
  922|   452k|        if (!spacePadPositive) {
  ------------------
  |  Branch (922:13): [True: 452k, False: 0]
  ------------------
  923|   452k|            arg.format(out, fmt, fmtEnd, ntrunc);
  924|   452k|        }
  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|   452k|        if (!positionalMode)
  ------------------
  |  Branch (941:13): [True: 452k, False: 0]
  ------------------
  942|   452k|            ++argIndex;
  943|   452k|        fmt = fmtEnd;
  944|   452k|    }
  945|       |
  946|       |    // Restore stream state
  947|   452k|    out.width(origWidth);
  948|   452k|    out.precision(origPrecision);
  949|   452k|    out.flags(origFlags);
  950|   452k|    out.fill(origFill);
  951|   452k|}
_ZN10tinyformat7vformatERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEPKcRKNS_10FormatListE:
 1070|   452k|{
 1071|   452k|    detail::formatImpl(out, fmt, list.m_args, list.m_N);
 1072|   452k|}
_ZN10tinyformat6formatIJiEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|  5.77k|{
 1089|  5.77k|    std::ostringstream oss;
 1090|  5.77k|    format(oss, fmt, args...);
 1091|  5.77k|    return oss.str();
 1092|  5.77k|}
_ZN10tinyformat6formatIJiEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|  5.77k|{
 1081|  5.77k|    vformat(out, fmt, makeFormatList(args...));
 1082|  5.77k|}
_ZN10tinyformat17FormatStringCheckILj1EEcvPKcEv:
  197|   452k|    operator const char*() { return fmt; }
_ZN10tinyformat14makeFormatListIJiEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|  5.77k|{
 1045|  5.77k|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|  5.77k|}
_ZN10tinyformat6detail11FormatListNILi1EEC2IJiEEEDpRKT_:
  990|  5.77k|            : FormatList(&m_formatterStore[0], N),
  991|  5.77k|            m_formatterStore { FormatArg(args)... }
  992|  5.77k|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6detail9FormatArgC2IiEERKT_:
  534|  5.81k|            : m_value(static_cast<const void*>(&value)),
  535|  5.81k|            m_formatImpl(&formatImpl<T>),
  536|  5.81k|            m_toIntImpl(&toIntImpl<T>)
  537|  5.81k|        { }
_ZN10tinyformat6detail9FormatArg10formatImplIiEEvRNSt3__113basic_ostreamIcNS3_11char_traitsIcEEEEPKcSA_iPKv:
  558|  5.81k|        {
  559|  5.81k|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|  5.81k|        }
_ZN10tinyformat11formatValueIiEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKcS8_iRKT_:
  351|  5.81k|{
  352|  5.81k|#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|  5.81k|    typedef typename detail::is_wchar<T>::tinyformat_wchar_is_not_supported DummyType;
  356|  5.81k|    (void) DummyType(); // avoid unused type warning with gcc-4.8
  357|  5.81k|#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|  5.81k|    const bool canConvertToChar = detail::is_convertible<T,char>::value;
  364|  5.81k|    const bool canConvertToVoidPtr = detail::is_convertible<T, const void*>::value;
  365|  5.81k|    if (canConvertToChar && *(fmtEnd-1) == 'c')
  ------------------
  |  Branch (365:9): [Folded - Ignored]
  |  Branch (365:29): [True: 0, False: 5.81k]
  ------------------
  366|      0|        detail::formatValueAsType<T, char>::invoke(out, value);
  367|  5.81k|    else if (canConvertToVoidPtr && *(fmtEnd-1) == 'p')
  ------------------
  |  Branch (367:14): [Folded - Ignored]
  |  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|  5.81k|    else if (ntrunc >= 0) {
  ------------------
  |  Branch (372:14): [True: 0, False: 5.81k]
  ------------------
  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|  5.81k|    else
  378|  5.81k|        out << value;
  379|  5.81k|}
_ZN10tinyformat17FormatStringCheckILj2EEcvPKcEv:
  197|    140|    operator const char*() { return fmt; }
_ZN10tinyformat6detail9FormatArgC2ImEERKT_:
  534|    146|            : m_value(static_cast<const void*>(&value)),
  535|    146|            m_formatImpl(&formatImpl<T>),
  536|    146|            m_toIntImpl(&toIntImpl<T>)
  537|    146|        { }
_ZN10tinyformat6detail9FormatArg10formatImplImEEvRNSt3__113basic_ostreamIcNS3_11char_traitsIcEEEEPKcSA_iPKv:
  558|    146|        {
  559|    146|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|    146|        }
_ZN10tinyformat11formatValueImEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKcS8_iRKT_:
  351|    146|{
  352|    146|#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|    146|    typedef typename detail::is_wchar<T>::tinyformat_wchar_is_not_supported DummyType;
  356|    146|    (void) DummyType(); // avoid unused type warning with gcc-4.8
  357|    146|#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|    146|    const bool canConvertToChar = detail::is_convertible<T,char>::value;
  364|    146|    const bool canConvertToVoidPtr = detail::is_convertible<T, const void*>::value;
  365|    146|    if (canConvertToChar && *(fmtEnd-1) == 'c')
  ------------------
  |  Branch (365:9): [Folded - Ignored]
  |  Branch (365:29): [True: 0, False: 146]
  ------------------
  366|      0|        detail::formatValueAsType<T, char>::invoke(out, value);
  367|    146|    else if (canConvertToVoidPtr && *(fmtEnd-1) == 'p')
  ------------------
  |  Branch (367:14): [Folded - Ignored]
  |  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|    146|    else if (ntrunc >= 0) {
  ------------------
  |  Branch (372:14): [True: 0, False: 146]
  ------------------
  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|    146|    else
  378|    146|        out << value;
  379|    146|}
_ZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES7_EEES7_NS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|     47|{
 1089|     47|    std::ostringstream oss;
 1090|     47|    format(oss, fmt, args...);
 1091|     47|    return oss.str();
 1092|     47|}
_ZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES7_EEEvRNS1_13basic_ostreamIcS4_EENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|     47|{
 1081|     47|    vformat(out, fmt, makeFormatList(args...));
 1082|     47|}
_ZN10tinyformat14makeFormatListIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES7_EEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|     47|{
 1045|     47|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|     47|}
_ZN10tinyformat6detail11FormatListNILi2EEC2IJNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEESA_EEEDpRKT_:
  990|     47|            : FormatList(&m_formatterStore[0], N),
  991|     47|            m_formatterStore { FormatArg(args)... }
  992|     47|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6detail9FormatArgC2INSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEERKT_:
  534|  4.19k|            : m_value(static_cast<const void*>(&value)),
  535|  4.19k|            m_formatImpl(&formatImpl<T>),
  536|  4.19k|            m_toIntImpl(&toIntImpl<T>)
  537|  4.19k|        { }
_ZN10tinyformat6detail9FormatArg10formatImplINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEvRNS3_13basic_ostreamIcS6_EEPKcSE_iPKv:
  558|  4.19k|        {
  559|  4.19k|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|  4.19k|        }
_ZN10tinyformat11formatValueINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvRNS1_13basic_ostreamIcS4_EEPKcSC_iRKT_:
  351|  4.19k|{
  352|  4.19k|#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.19k|    typedef typename detail::is_wchar<T>::tinyformat_wchar_is_not_supported DummyType;
  356|  4.19k|    (void) DummyType(); // avoid unused type warning with gcc-4.8
  357|  4.19k|#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.19k|    const bool canConvertToChar = detail::is_convertible<T,char>::value;
  364|  4.19k|    const bool canConvertToVoidPtr = detail::is_convertible<T, const void*>::value;
  365|  4.19k|    if (canConvertToChar && *(fmtEnd-1) == 'c')
  ------------------
  |  Branch (365:9): [Folded - Ignored]
  |  Branch (365:29): [True: 0, False: 0]
  ------------------
  366|      0|        detail::formatValueAsType<T, char>::invoke(out, value);
  367|  4.19k|    else if (canConvertToVoidPtr && *(fmtEnd-1) == 'p')
  ------------------
  |  Branch (367:14): [Folded - Ignored]
  |  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.19k|    else if (ntrunc >= 0) {
  ------------------
  |  Branch (372:14): [True: 0, False: 4.19k]
  ------------------
  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.19k|    else
  378|  4.19k|        out << value;
  379|  4.19k|}
_ZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEES7_NS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|  4.09k|{
 1089|  4.09k|    std::ostringstream oss;
 1090|  4.09k|    format(oss, fmt, args...);
 1091|  4.09k|    return oss.str();
 1092|  4.09k|}
_ZN10tinyformat6formatIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEEvRNS1_13basic_ostreamIcS4_EENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|  4.09k|{
 1081|  4.09k|    vformat(out, fmt, makeFormatList(args...));
 1082|  4.09k|}
_ZN10tinyformat14makeFormatListIJNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|  4.09k|{
 1045|  4.09k|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|  4.09k|}
_ZN10tinyformat6detail11FormatListNILi1EEC2IJNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEEEEEDpRKT_:
  990|  4.09k|            : FormatList(&m_formatterStore[0], N),
  991|  4.09k|            m_formatterStore { FormatArg(args)... }
  992|  4.09k|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6formatIJcEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|     29|{
 1089|     29|    std::ostringstream oss;
 1090|     29|    format(oss, fmt, args...);
 1091|     29|    return oss.str();
 1092|     29|}
_ZN10tinyformat6formatIJcEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|     29|{
 1081|     29|    vformat(out, fmt, makeFormatList(args...));
 1082|     29|}
_ZN10tinyformat14makeFormatListIJcEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|     29|{
 1045|     29|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|     29|}
_ZN10tinyformat6detail11FormatListNILi1EEC2IJcEEEDpRKT_:
  990|     29|            : FormatList(&m_formatterStore[0], N),
  991|     29|            m_formatterStore { FormatArg(args)... }
  992|     29|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6detail9FormatArgC2IcEERKT_:
  534|     29|            : m_value(static_cast<const void*>(&value)),
  535|     29|            m_formatImpl(&formatImpl<T>),
  536|     29|            m_toIntImpl(&toIntImpl<T>)
  537|     29|        { }
_ZN10tinyformat6detail9FormatArg10formatImplIcEEvRNSt3__113basic_ostreamIcNS3_11char_traitsIcEEEEPKcSA_iPKv:
  558|     29|        {
  559|     29|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|     29|        }
_ZN10tinyformat6formatIJjEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|   442k|{
 1089|   442k|    std::ostringstream oss;
 1090|   442k|    format(oss, fmt, args...);
 1091|   442k|    return oss.str();
 1092|   442k|}
_ZN10tinyformat6formatIJjEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|   442k|{
 1081|   442k|    vformat(out, fmt, makeFormatList(args...));
 1082|   442k|}
_ZN10tinyformat14makeFormatListIJjEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|   442k|{
 1045|   442k|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|   442k|}
_ZN10tinyformat6detail11FormatListNILi1EEC2IJjEEEDpRKT_:
  990|   442k|            : FormatList(&m_formatterStore[0], N),
  991|   442k|            m_formatterStore { FormatArg(args)... }
  992|   442k|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6detail9FormatArgC2IjEERKT_:
  534|   442k|            : m_value(static_cast<const void*>(&value)),
  535|   442k|            m_formatImpl(&formatImpl<T>),
  536|   442k|            m_toIntImpl(&toIntImpl<T>)
  537|   442k|        { }
_ZN10tinyformat6detail9FormatArg10formatImplIjEEvRNSt3__113basic_ostreamIcNS3_11char_traitsIcEEEEPKcSA_iPKv:
  558|   442k|        {
  559|   442k|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|   442k|        }
_ZN10tinyformat11formatValueIjEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKcS8_iRKT_:
  351|   442k|{
  352|   442k|#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|   442k|    typedef typename detail::is_wchar<T>::tinyformat_wchar_is_not_supported DummyType;
  356|   442k|    (void) DummyType(); // avoid unused type warning with gcc-4.8
  357|   442k|#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|   442k|    const bool canConvertToChar = detail::is_convertible<T,char>::value;
  364|   442k|    const bool canConvertToVoidPtr = detail::is_convertible<T, const void*>::value;
  365|   442k|    if (canConvertToChar && *(fmtEnd-1) == 'c')
  ------------------
  |  Branch (365:9): [Folded - Ignored]
  |  Branch (365:29): [True: 0, False: 442k]
  ------------------
  366|      0|        detail::formatValueAsType<T, char>::invoke(out, value);
  367|   442k|    else if (canConvertToVoidPtr && *(fmtEnd-1) == 'p')
  ------------------
  |  Branch (367:14): [Folded - Ignored]
  |  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|   442k|    else if (ntrunc >= 0) {
  ------------------
  |  Branch (372:14): [True: 0, False: 442k]
  ------------------
  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|   442k|    else
  378|   442k|        out << value;
  379|   442k|}
_ZN10tinyformat6formatIJmEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|     53|{
 1089|     53|    std::ostringstream oss;
 1090|     53|    format(oss, fmt, args...);
 1091|     53|    return oss.str();
 1092|     53|}
_ZN10tinyformat6formatIJmEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|     53|{
 1081|     53|    vformat(out, fmt, makeFormatList(args...));
 1082|     53|}
_ZN10tinyformat14makeFormatListIJmEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|     53|{
 1045|     53|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|     53|}
_ZN10tinyformat6detail11FormatListNILi1EEC2IJmEEEDpRKT_:
  990|     53|            : FormatList(&m_formatterStore[0], N),
  991|     53|            m_formatterStore { FormatArg(args)... }
  992|     53|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6formatIJEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|     30|{
 1089|     30|    std::ostringstream oss;
 1090|     30|    format(oss, fmt, args...);
 1091|     30|    return oss.str();
 1092|     30|}
_ZN10tinyformat6formatIJEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|     30|{
 1081|     30|    vformat(out, fmt, makeFormatList(args...));
 1082|     30|}
_ZN10tinyformat14makeFormatListIJEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|     30|{
 1045|     30|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|     30|}
_ZN10tinyformat17FormatStringCheckILj0EEcvPKcEv:
  197|     30|    operator const char*() { return fmt; }
_ZN10tinyformat6formatIJmiEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|     46|{
 1089|     46|    std::ostringstream oss;
 1090|     46|    format(oss, fmt, args...);
 1091|     46|    return oss.str();
 1092|     46|}
_ZN10tinyformat6formatIJmiEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|     46|{
 1081|     46|    vformat(out, fmt, makeFormatList(args...));
 1082|     46|}
_ZN10tinyformat14makeFormatListIJmiEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|     46|{
 1045|     46|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|     46|}
_ZN10tinyformat6detail11FormatListNILi2EEC2IJmiEEEDpRKT_:
  990|     46|            : FormatList(&m_formatterStore[0], N),
  991|     46|            m_formatterStore { FormatArg(args)... }
  992|     46|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6formatIJmjEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|     13|{
 1089|     13|    std::ostringstream oss;
 1090|     13|    format(oss, fmt, args...);
 1091|     13|    return oss.str();
 1092|     13|}
_ZN10tinyformat6formatIJmjEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|     13|{
 1081|     13|    vformat(out, fmt, makeFormatList(args...));
 1082|     13|}
_ZN10tinyformat14makeFormatListIJmjEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|     13|{
 1045|     13|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|     13|}
_ZN10tinyformat6detail11FormatListNILi2EEC2IJmjEEEDpRKT_:
  990|     13|            : FormatList(&m_formatterStore[0], N),
  991|     13|            m_formatterStore { FormatArg(args)... }
  992|     13|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }
_ZN10tinyformat6formatIJjmEEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|     34|{
 1089|     34|    std::ostringstream oss;
 1090|     34|    format(oss, fmt, args...);
 1091|     34|    return oss.str();
 1092|     34|}
_ZN10tinyformat6formatIJjmEEEvRNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|     34|{
 1081|     34|    vformat(out, fmt, makeFormatList(args...));
 1082|     34|}
_ZN10tinyformat14makeFormatListIJjmEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|     34|{
 1045|     34|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|     34|}
_ZN10tinyformat6detail11FormatListNILi2EEC2IJjmEEEDpRKT_:
  990|     34|            : FormatList(&m_formatterStore[0], N),
  991|     34|            m_formatterStore { FormatArg(args)... }
  992|     34|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }

_ZN7uint160C2E4SpanIKhE:
  193|    629|    constexpr explicit uint160(Span<const unsigned char> vch) : base_blob<160>(vch) {}
_ZN7uint256C2E4SpanIKhE:
  208|   434k|    constexpr explicit uint256(Span<const unsigned char> vch) : base_blob<256>(vch) {}
_ZN9base_blobILj256EE5beginEv:
  115|   763k|    constexpr unsigned char* begin() { return m_data.data(); }
_ZN9base_blobILj160EE5beginEv:
  115|   833k|    constexpr unsigned char* begin() { return m_data.data(); }
_ZNK9base_blobILj256EE6IsNullEv:
   49|  24.2k|    {
   50|  24.2k|        return std::all_of(m_data.begin(), m_data.end(), [](uint8_t val) {
   51|  24.2k|            return val == 0;
   52|  24.2k|        });
   53|  24.2k|    }
_ZNK9base_blobILj256EE5beginEv:
  118|  1.39M|    constexpr const unsigned char* begin() const { return m_data.data(); }
_ZN9base_blobILj256EE4sizeEv:
  121|  1.11M|    static constexpr unsigned int size() { return WIDTH; }
_ZNK9base_blobILj256EE3endEv:
  119|   576k|    constexpr const unsigned char* end() const { return m_data.data() + WIDTH; }
_ZNK9base_blobILj256EE7CompareERKS0_:
   64|  12.0M|    constexpr int Compare(const base_blob& other) const { return std::memcmp(m_data.data(), other.m_data.data(), WIDTH); }
_ZeqRK9base_blobILj256EES2_:
   66|  45.0k|    friend constexpr bool operator==(const base_blob& a, const base_blob& b) { return a.Compare(b) == 0; }
_ZneRK9base_blobILj256EES2_:
   67|  7.38k|    friend constexpr bool operator!=(const base_blob& a, const base_blob& b) { return a.Compare(b) != 0; }
_ZltRK9base_blobILj256EES2_:
   68|  12.0M|    friend constexpr bool operator<(const base_blob& a, const base_blob& b) { return a.Compare(b) < 0; }
_ZNK9base_blobILj256EE4dataEv:
  112|  4.25k|    constexpr const unsigned char* data() const { return m_data.data(); }
_ZN9base_blobILj160EE4sizeEv:
  121|  2.07M|    static constexpr unsigned int size() { return WIDTH; }
_ZN9base_blobILj160EE4dataEv:
  113|  2.07M|    constexpr unsigned char* data() { return m_data.data(); }
_ZN9base_blobILj256EE4dataEv:
  113|  1.07M|    constexpr unsigned char* data() { return m_data.data(); }
_ZN7uint256C2Ev:
  205|  2.14M|    constexpr uint256() = default;
_ZN9base_blobILj256EEC2Ev:
   35|  2.14M|    constexpr base_blob() : m_data() {}
_ZN9base_blobILj256EEC2E4SpanIKhE:
   41|   434k|    {
   42|   434k|        assert(vch.size() == WIDTH);
   43|   434k|        std::copy(vch.begin(), vch.end(), m_data.begin());
   44|   434k|    }
_ZNK9base_blobILj160EE7CompareERKS0_:
   64|  6.04M|    constexpr int Compare(const base_blob& other) const { return std::memcmp(m_data.data(), other.m_data.data(), WIDTH); }
_ZltRK9base_blobILj160EES2_:
   68|  6.04M|    friend constexpr bool operator<(const base_blob& a, const base_blob& b) { return a.Compare(b) < 0; }
_ZZNK9base_blobILj256EE6IsNullEvENKUlhE_clEh:
   50|   127k|        return std::all_of(m_data.begin(), m_data.end(), [](uint8_t val) {
   51|   127k|            return val == 0;
   52|   127k|        });
_ZN7uint160C2Ev:
  192|  2.07M|    constexpr uint160() = default;
_ZN9base_blobILj160EEC2Ev:
   35|  2.07M|    constexpr base_blob() : m_data() {}
_ZN9base_blobILj160EEC2E4SpanIKhE:
   41|    629|    {
   42|    629|        assert(vch.size() == WIDTH);
   43|    629|        std::copy(vch.begin(), vch.end(), m_data.begin());
   44|    629|    }
_ZNK9base_blobILj160EE5beginEv:
  118|  1.26k|    constexpr const unsigned char* begin() const { return m_data.data(); }
_ZNK9base_blobILj160EE3endEv:
  119|  1.26k|    constexpr const unsigned char* end() const { return m_data.data() + WIDTH; }
_ZN9base_blobILj160EE3endEv:
  116|    984|    constexpr unsigned char* end() { return m_data.data() + WIDTH; }
_ZNK9base_blobILj256EE9SerializeI10HashWriterEEvRT_:
  127|  7.27k|    {
  128|  7.27k|        s << Span(m_data);
  129|  7.27k|    }

_Z15FormatHDKeypathRKNSt3__16vectorIjNS_9allocatorIjEEEEb:
   55|   551k|{
   56|   551k|    std::string ret;
   57|   551k|    for (auto i : path) {
  ------------------
  |  Branch (57:17): [True: 442k, False: 551k]
  ------------------
   58|   442k|        ret += strprintf("/%i", (i << 1) >> 1);
  ------------------
  |  | 1172|   442k|#define strprintf tfm::format
  ------------------
   59|   442k|        if (i >> 31) ret += apostrophe ? '\'' : 'h';
  ------------------
  |  Branch (59:13): [True: 93.9k, False: 348k]
  |  Branch (59:29): [True: 47.7k, False: 46.1k]
  ------------------
   60|   442k|    }
   61|   551k|    return ret;
   62|   551k|}

_Z22inline_assertion_checkILb0EbEOT0_S1_PKciS3_S3_:
   52|  18.9k|{
   53|  18.9k|    if (IS_ASSERT || std::is_constant_evaluated() || G_FUZZING
  ------------------
  |  Branch (53:9): [Folded - Ignored]
  |  Branch (53:22): [Folded - Ignored]
  |  Branch (53:54): [Folded - Ignored]
  ------------------
   54|       |#ifdef ABORT_ON_FAILED_ASSUME
   55|       |        || true
   56|       |#endif
   57|  18.9k|    ) {
   58|  18.9k|        if (!val) {
  ------------------
  |  Branch (58:13): [True: 0, False: 18.9k]
  ------------------
   59|      0|            assertion_fail(file, line, func, assertion);
   60|      0|        }
   61|  18.9k|    }
   62|  18.9k|    return std::forward<T>(val);
   63|  18.9k|}
_Z22inline_check_non_fatalIbEOT_S1_PKciS3_S3_:
   35|  4.90k|{
   36|  4.90k|    if (!val) {
  ------------------
  |  Branch (36:9): [True: 0, False: 4.90k]
  ------------------
   37|      0|        throw NonFatalCheckError{assertion, file, line, func};
   38|      0|    }
   39|  4.90k|    return std::forward<T>(val);
   40|  4.90k|}
_Z22inline_check_non_fatalIRKbEOT_S3_PKciS5_S5_:
   35|    707|{
   36|    707|    if (!val) {
  ------------------
  |  Branch (36:9): [True: 0, False: 707]
  ------------------
   37|      0|        throw NonFatalCheckError{assertion, file, line, func};
   38|      0|    }
   39|    707|    return std::forward<T>(val);
   40|    707|}
_Z22inline_assertion_checkILb1EbEOT0_S1_PKciS3_S3_:
   52|  10.2k|{
   53|  10.2k|    if (IS_ASSERT || std::is_constant_evaluated() || G_FUZZING
  ------------------
  |  Branch (53:9): [Folded - Ignored]
  |  Branch (53:22): [Folded - Ignored]
  |  Branch (53:54): [Folded - Ignored]
  ------------------
   54|       |#ifdef ABORT_ON_FAILED_ASSUME
   55|       |        || true
   56|       |#endif
   57|  10.2k|    ) {
   58|  10.2k|        if (!val) {
  ------------------
  |  Branch (58:13): [True: 0, False: 10.2k]
  ------------------
   59|      0|            assertion_fail(file, line, func, assertion);
   60|      0|        }
   61|  10.2k|    }
   62|  10.2k|    return std::forward<T>(val);
   63|  10.2k|}
_Z22inline_assertion_checkILb1ERPKNSt3__18functionIFvNS0_4spanIKhLm18446744073709551615EEEEEEEOT0_SB_PKciSD_SD_:
   52|  10.2k|{
   53|  10.2k|    if (IS_ASSERT || std::is_constant_evaluated() || G_FUZZING
  ------------------
  |  Branch (53:9): [Folded - Ignored]
  |  Branch (53:22): [Folded - Ignored]
  |  Branch (53:54): [Folded - Ignored]
  ------------------
   54|       |#ifdef ABORT_ON_FAILED_ASSUME
   55|       |        || true
   56|       |#endif
   57|  10.2k|    ) {
   58|  10.2k|        if (!val) {
  ------------------
  |  Branch (58:13): [True: 0, False: 10.2k]
  ------------------
   59|      0|            assertion_fail(file, line, func, assertion);
   60|      0|        }
   61|  10.2k|    }
   62|  10.2k|    return std::forward<T>(val);
   63|  10.2k|}

_ZN8BaseHashI7uint160EC2ERKS0_:
   16|  5.40k|    explicit BaseHash(const HashType& in) : m_hash(in) {}
_ZN8BaseHashI7uint256E5beginEv:
   19|  1.54k|    {
   20|  1.54k|        return m_hash.begin();
   21|  1.54k|    }
_ZNK8BaseHashI7uint160EltERKS1_:
   59|  6.17k|    {
   60|  6.17k|        return m_hash < other.m_hash;
   61|  6.17k|    }
_ZN8BaseHashI7uint160EC2Ev:
   15|      2|    BaseHash() : m_hash() {}
_ZNK8BaseHashI7uint160E5beginEv:
   24|  1.26k|    {
   25|  1.26k|        return m_hash.begin();
   26|  1.26k|    }
_ZNK8BaseHashI7uint160E3endEv:
   34|  1.26k|    {
   35|  1.26k|        return m_hash.end();
   36|  1.26k|    }
_ZNK8BaseHashI7uint256E5beginEv:
   24|  1.53k|    {
   25|  1.53k|        return m_hash.begin();
   26|  1.53k|    }
_ZNK8BaseHashI7uint256E3endEv:
   34|  1.53k|    {
   35|  1.53k|        return m_hash.end();
   36|  1.53k|    }
_ZN8BaseHashI7uint256EC2Ev:
   15|  1.54k|    BaseHash() : m_hash() {}
_ZN8BaseHashI7uint160E5beginEv:
   19|      2|    {
   20|      2|        return m_hash.begin();
   21|      2|    }

_Z5IsHexNSt3__117basic_string_viewIcNS_11char_traitsIcEEEE:
   42|   166k|{
   43|  28.5M|    for (char c : str) {
  ------------------
  |  Branch (43:17): [True: 28.5M, False: 164k]
  ------------------
   44|  28.5M|        if (HexDigit(c) < 0) return false;
  ------------------
  |  Branch (44:13): [True: 2.07k, False: 28.5M]
  ------------------
   45|  28.5M|    }
   46|   164k|    return (str.size() > 0) && (str.size()%2 == 0);
  ------------------
  |  Branch (46:12): [True: 164k, False: 1]
  |  Branch (46:32): [True: 164k, False: 92]
  ------------------
   47|   166k|}
_Z11TryParseHexIhENSt3__18optionalINS0_6vectorIT_NS0_9allocatorIS3_EEEEEENS0_17basic_string_viewIcNS0_11char_traitsIcEEEE:
   51|   164k|{
   52|   164k|    std::vector<Byte> vch;
   53|   164k|    vch.reserve(str.size() / 2); // two hex characters form a single byte
   54|       |
   55|   164k|    auto it = str.begin();
   56|  12.7M|    while (it != str.end()) {
  ------------------
  |  Branch (56:12): [True: 12.5M, False: 164k]
  ------------------
   57|  12.5M|        if (IsSpace(*it)) {
  ------------------
  |  Branch (57:13): [True: 0, False: 12.5M]
  ------------------
   58|      0|            ++it;
   59|      0|            continue;
   60|      0|        }
   61|  12.5M|        auto c1 = HexDigit(*(it++));
   62|  12.5M|        if (it == str.end()) return std::nullopt;
  ------------------
  |  Branch (62:13): [True: 0, False: 12.5M]
  ------------------
   63|  12.5M|        auto c2 = HexDigit(*(it++));
   64|  12.5M|        if (c1 < 0 || c2 < 0) return std::nullopt;
  ------------------
  |  Branch (64:13): [True: 0, False: 12.5M]
  |  Branch (64:23): [True: 0, False: 12.5M]
  ------------------
   65|  12.5M|        vch.push_back(Byte(c1 << 4) | Byte(c2));
   66|  12.5M|    }
   67|   164k|    return vch;
   68|   164k|}
_Z11ParseUInt32NSt3__117basic_string_viewIcNS_11char_traitsIcEEEEPj:
  245|   232k|{
  246|   232k|    return ParseIntegral<uint32_t>(str, out);
  247|   232k|}
_Z7ToLowerNSt3__117basic_string_viewIcNS_11char_traitsIcEEEE:
  416|    454|{
  417|    454|    std::string r;
  418|    454|    r.reserve(str.size());
  419|    893|    for (auto ch : str) r += ToLower(ch);
  ------------------
  |  Branch (419:18): [True: 893, False: 454]
  ------------------
  420|    454|    return r;
  421|    454|}
strencodings.cpp:_ZN12_GLOBAL__N_113ParseIntegralIjEEbNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPT_:
  206|   232k|{
  207|   232k|    static_assert(std::is_integral<T>::value);
  208|       |    // Replicate the exact behavior of strtol/strtoll/strtoul/strtoull when
  209|       |    // handling leading +/- for backwards compatibility.
  210|   232k|    if (str.length() >= 2 && str[0] == '+' && str[1] == '-') {
  ------------------
  |  Branch (210:9): [True: 221k, False: 11.1k]
  |  Branch (210:30): [True: 70, False: 221k]
  |  Branch (210:47): [True: 1, False: 69]
  ------------------
  211|      1|        return false;
  212|      1|    }
  213|   232k|    const std::optional<T> opt_int = ToIntegral<T>((!str.empty() && str[0] == '+') ? str.substr(1) : str);
  ------------------
  |  Branch (213:53): [True: 232k, False: 16]
  |  Branch (213:69): [True: 72, False: 232k]
  ------------------
  214|   232k|    if (!opt_int) {
  ------------------
  |  Branch (214:9): [True: 245, False: 232k]
  ------------------
  215|    245|        return false;
  216|    245|    }
  217|   232k|    if (out != nullptr) {
  ------------------
  |  Branch (217:9): [True: 232k, False: 0]
  ------------------
  218|   232k|        *out = *opt_int;
  219|   232k|    }
  220|   232k|    return true;
  221|   232k|}

_Z7IsSpacec:
  166|  42.3M|constexpr inline bool IsSpace(char c) noexcept {
  167|  42.3M|    return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v';
  ------------------
  |  Branch (167:12): [True: 672, False: 42.3M]
  |  Branch (167:24): [True: 0, False: 42.3M]
  |  Branch (167:37): [True: 0, False: 42.3M]
  |  Branch (167:50): [True: 0, False: 42.3M]
  |  Branch (167:63): [True: 0, False: 42.3M]
  |  Branch (167:76): [True: 0, False: 42.3M]
  ------------------
  168|  42.3M|}
_Z7ToLowerc:
  305|    893|{
  306|    893|    return (c >= 'A' && c <= 'Z' ? (c - 'A') + 'a' : c);
  ------------------
  |  Branch (306:13): [True: 842, False: 51]
  |  Branch (306:25): [True: 373, False: 469]
  ------------------
  307|    893|}
_Z8ParseHexIhENSt3__16vectorIT_NS0_9allocatorIS2_EEEENS0_17basic_string_viewIcNS0_11char_traitsIcEEEE:
   69|   164k|{
   70|   164k|    return TryParseHex<Byte>(hex_str).value_or(std::vector<Byte>{});
   71|   164k|}
key_io.cpp:_ZNK12_GLOBAL__N_111IntIdentityclEi:
  263|     68|    [[maybe_unused]] int operator()(int x) const { return x; }
_Z10ToIntegralIlENSt3__18optionalIT_EENS0_17basic_string_viewIcNS0_11char_traitsIcEEEE:
  180|  33.2k|{
  181|  33.2k|    static_assert(std::is_integral<T>::value);
  182|  33.2k|    T result;
  183|  33.2k|    const auto [first_nonmatching, error_condition] = std::from_chars(str.data(), str.data() + str.size(), result);
  184|  33.2k|    if (first_nonmatching != str.data() + str.size() || error_condition != std::errc{}) {
  ------------------
  |  Branch (184:9): [True: 140, False: 33.1k]
  |  Branch (184:57): [True: 113, False: 33.0k]
  ------------------
  185|    253|        return std::nullopt;
  186|    253|    }
  187|  33.0k|    return result;
  188|  33.2k|}
key_io.cpp:_Z11ConvertBitsILi5ELi8ELb0EZN12_GLOBAL__N_117DecodeDestinationERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERK12CChainParamsRS7_PNS1_6vectorIiNS5_IiEEEEE3$_0NS1_11__wrap_iterIPKhEENS0_11IntIdentityEEbT2_T3_SP_T4_:
  270|      1|bool ConvertBits(O outfn, It it, It end, I infn = {}) {
  271|      1|    size_t acc = 0;
  272|      1|    size_t bits = 0;
  273|      1|    constexpr size_t maxv = (1 << tobits) - 1;
  274|      1|    constexpr size_t max_acc = (1 << (frombits + tobits - 1)) - 1;
  275|     69|    while (it != end) {
  ------------------
  |  Branch (275:12): [True: 68, False: 1]
  ------------------
  276|     68|        int v = infn(*it);
  277|     68|        if (v < 0) return false;
  ------------------
  |  Branch (277:13): [True: 0, False: 68]
  ------------------
  278|     68|        acc = ((acc << frombits) | v) & max_acc;
  279|     68|        bits += frombits;
  280|    110|        while (bits >= tobits) {
  ------------------
  |  Branch (280:16): [True: 42, False: 68]
  ------------------
  281|     42|            bits -= tobits;
  282|     42|            outfn((acc >> bits) & maxv);
  283|     42|        }
  284|     68|        ++it;
  285|     68|    }
  286|      1|    if (pad) {
  ------------------
  |  Branch (286:9): [Folded - Ignored]
  ------------------
  287|      0|        if (bits) outfn((acc << (tobits - bits)) & maxv);
  ------------------
  |  Branch (287:13): [True: 0, False: 0]
  ------------------
  288|      1|    } else if (bits >= frombits || ((acc << (tobits - bits)) & maxv)) {
  ------------------
  |  Branch (288:16): [True: 0, False: 1]
  |  Branch (288:36): [True: 1, False: 0]
  ------------------
  289|      1|        return false;
  290|      1|    }
  291|      0|    return true;
  292|      1|}
_Z10ToIntegralIjENSt3__18optionalIT_EENS0_17basic_string_viewIcNS0_11char_traitsIcEEEE:
  180|   232k|{
  181|   232k|    static_assert(std::is_integral<T>::value);
  182|   232k|    T result;
  183|   232k|    const auto [first_nonmatching, error_condition] = std::from_chars(str.data(), str.data() + str.size(), result);
  184|   232k|    if (first_nonmatching != str.data() + str.size() || error_condition != std::errc{}) {
  ------------------
  |  Branch (184:9): [True: 208, False: 232k]
  |  Branch (184:57): [True: 37, False: 232k]
  ------------------
  185|    245|        return std::nullopt;
  186|    245|    }
  187|   232k|    return result;
  188|   232k|}

_ZN4util13ContainsNoNULENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
  222|   265k|{
  223|  64.8M|    for (auto c : str) {
  ------------------
  |  Branch (223:17): [True: 64.8M, False: 265k]
  ------------------
  224|  64.8M|        if (c == 0) return false;
  ------------------
  |  Branch (224:13): [True: 0, False: 64.8M]
  ------------------
  225|  64.8M|    }
  226|   265k|    return true;
  227|   265k|}
_ZN4util8ToStringIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  234|  3.36k|{
  235|  3.36k|    std::ostringstream oss;
  236|  3.36k|    oss.imbue(std::locale::classic());
  237|  3.36k|    oss << t;
  238|  3.36k|    return oss.str();
  239|  3.36k|}
_ZN4util5SplitI4SpanIKcEEENSt3__16vectorIT_NS4_9allocatorIS6_EEEERKS3_c:
  132|   480k|{
  133|   480k|    return Split<T>(sp, std::string_view{&sep, 1});
  134|   480k|}
_ZN4util5SplitI4SpanIKcEEENSt3__16vectorIT_NS4_9allocatorIS6_EEEERKS3_NS4_17basic_string_viewIcNS4_11char_traitsIcEEEE:
  108|   480k|{
  109|   480k|    std::vector<T> ret;
  110|   480k|    auto it = sp.begin();
  111|   480k|    auto start = it;
  112|   578M|    while (it != sp.end()) {
  ------------------
  |  Branch (112:12): [True: 577M, False: 480k]
  ------------------
  113|   577M|        if (separators.find(*it) != std::string::npos) {
  ------------------
  |  Branch (113:13): [True: 3.08M, False: 574M]
  ------------------
  114|  3.08M|            ret.emplace_back(start, it);
  115|  3.08M|            start = it + 1;
  116|  3.08M|        }
  117|   577M|        ++it;
  118|   577M|    }
  119|   480k|    ret.emplace_back(start, it);
  120|   480k|    return ret;
  121|   480k|}

_Z11SetMockTimeNSt3__16chrono8durationIxNS_5ratioILl1ELl1EEEEE:
   42|  10.2k|{
   43|  10.2k|    Assert(mock_time_in >= 0s);
  ------------------
  |  |   85|  10.2k|#define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
   44|  10.2k|    g_mock_time.store(mock_time_in, std::memory_order_relaxed);
   45|  10.2k|}

_Z6VectorIJN10miniscript8internal6MaxIntIjEEEENSt3__16vectorINS4_11common_typeIJDpT_EE4typeENS4_9allocatorISA_EEEEDpOS7_:
   24|   167k|{
   25|   167k|    std::vector<typename std::common_type<Args...>::type> ret;
   26|   167k|    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|   167k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|   167k|    return ret;
   30|   167k|}
_Z6VectorIJN10miniscript8internal7SatInfoEEENSt3__16vectorINS3_11common_typeIJDpT_EE4typeENS3_9allocatorIS9_EEEEDpOS6_:
   24|  83.5k|{
   25|  83.5k|    std::vector<typename std::common_type<Args...>::type> ret;
   26|  83.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|  83.5k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  83.5k|    return ret;
   30|  83.5k|}
descriptor.cpp:_Z6VectorIJNSt3__110unique_ptrIN12_GLOBAL__N_114PubkeyProviderENS0_14default_deleteIS3_EEEEEENS0_6vectorINS0_11common_typeIJDpT_EE4typeENS0_9allocatorISC_EEEEDpOS9_:
   24|  6.63k|{
   25|  6.63k|    std::vector<typename std::common_type<Args...>::type> ret;
   26|  6.63k|    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|  6.63k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  6.63k|    return ret;
   30|  6.63k|}
_Z6VectorIJ7CScriptEENSt3__16vectorINS1_11common_typeIJDpT_EE4typeENS1_9allocatorIS7_EEEEDpOS4_:
   24|  15.9k|{
   25|  15.9k|    std::vector<typename std::common_type<Args...>::type> ret;
   26|  15.9k|    ret.reserve(sizeof...(args));
   27|       |    // The line below uses the trick from https://www.experts-exchange.com/articles/32502/None-recursive-variadic-templates-with-std-initializer-list.html
   28|  15.9k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  15.9k|    return ret;
   30|  15.9k|}
descriptor.cpp:_Z6VectorIJNSt3__110unique_ptrIN12_GLOBAL__N_114DescriptorImplENS0_14default_deleteIS3_EEEEEENS0_6vectorINS0_11common_typeIJDpT_EE4typeENS0_9allocatorISC_EEEEDpOS9_:
   24|  2.77k|{
   25|  2.77k|    std::vector<typename std::common_type<Args...>::type> ret;
   26|  2.77k|    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|  2.77k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  2.77k|    return ret;
   30|  2.77k|}
_Z6VectorIJRK7CScriptEENSt3__16vectorINS3_11common_typeIJDpT_EE4typeENS3_9allocatorIS9_EEEEDpOS6_:
   24|  1.02k|{
   25|  1.02k|    std::vector<typename std::common_type<Args...>::type> ret;
   26|  1.02k|    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.02k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  1.02k|    return ret;
   30|  1.02k|}
_Z6VectorIJNSt3__110unique_ptrIKN10miniscript4NodeIjEENS0_14default_deleteIS5_EEEEEENS0_6vectorINS0_11common_typeIJDpT_EE4typeENS0_9allocatorISE_EEEEDpOSB_:
   24|   422k|{
   25|   422k|    std::vector<typename std::common_type<Args...>::type> ret;
   26|   422k|    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|   422k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|   422k|    return ret;
   30|   422k|}
_Z6VectorIJjEENSt3__16vectorINS0_11common_typeIJDpT_EE4typeENS0_9allocatorIS6_EEEEDpOS3_:
   24|  6.37k|{
   25|  6.37k|    std::vector<typename std::common_type<Args...>::type> ret;
   26|  6.37k|    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|  6.37k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  6.37k|    return ret;
   30|  6.37k|}
_Z6VectorIJNSt3__110unique_ptrIKN10miniscript4NodeIjEENS0_14default_deleteIS5_EEEES8_EENS0_6vectorINS0_11common_typeIJDpT_EE4typeENS0_9allocatorISE_EEEEDpOSB_:
   24|   566k|{
   25|   566k|    std::vector<typename std::common_type<Args...>::type> ret;
   26|   566k|    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|   566k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|   566k|    return ret;
   30|   566k|}
_Z6VectorIJNSt3__110unique_ptrIKN10miniscript4NodeIjEENS0_14default_deleteIS5_EEEES8_S8_EENS0_6vectorINS0_11common_typeIJDpT_EE4typeENS0_9allocatorISE_EEEEDpOSB_:
   24|  12.1k|{
   25|  12.1k|    std::vector<typename std::common_type<Args...>::type> ret;
   26|  12.1k|    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|  12.1k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  12.1k|    return ret;
   30|  12.1k|}

