_ZN10ScriptHashC2ERK7CScript:
   20|    268|ScriptHash::ScriptHash(const CScript& in) : BaseHash(Hash160(in)) {}
_ZN6PKHashC2ERK6CKeyID:
   24|      8|PKHash::PKHash(const CKeyID& pubkey_id) : BaseHash(pubkey_id) {}
_ZN19WitnessV0ScriptHashC2ERK7CScript:
   45|    369|{
   46|    369|    CSHA256().Write(in.data(), in.size()).Finalize(begin());
   47|    369|}
_Z23GetScriptForDestinationRKNSt3__17variantIJ14CNoDestination17PubKeyDestination6PKHash10ScriptHash19WitnessV0ScriptHash16WitnessV0KeyHash16WitnessV1Taproot11PayToAnchor14WitnessUnknownEEE:
  167|  1.25k|{
  168|  1.25k|    return std::visit(CScriptVisitor(), dest);
  169|  1.25k|}
_Z18IsValidDestinationRKNSt3__17variantIJ14CNoDestination17PubKeyDestination6PKHash10ScriptHash19WitnessV0ScriptHash16WitnessV0KeyHash16WitnessV1Taproot11PayToAnchor14WitnessUnknownEEE:
  171|    417|bool IsValidDestination(const CTxDestination& dest) {
  172|    417|    return std::visit(ValidDestinationVisitor(), dest);
  173|    417|}
addresstype.cpp:_ZNK12_GLOBAL__N_114CScriptVisitorclERK6PKHash:
  122|      8|    {
  123|      8|        return CScript() << OP_DUP << OP_HASH160 << ToByteVector(keyID) << OP_EQUALVERIFY << OP_CHECKSIG;
  124|      8|    }
addresstype.cpp:_ZNK12_GLOBAL__N_114CScriptVisitorclERK10ScriptHash:
  127|    268|    {
  128|    268|        return CScript() << OP_HASH160 << ToByteVector(scriptID) << OP_EQUAL;
  129|    268|    }
addresstype.cpp:_ZNK12_GLOBAL__N_114CScriptVisitorclERK19WitnessV0ScriptHash:
  137|    369|    {
  138|    369|        return CScript() << OP_0 << ToByteVector(id);
  139|    369|    }
addresstype.cpp:_ZNK12_GLOBAL__N_114CScriptVisitorclERK16WitnessV0KeyHash:
  132|      4|    {
  133|      4|        return CScript() << OP_0 << ToByteVector(id);
  134|      4|    }
addresstype.cpp:_ZNK12_GLOBAL__N_114CScriptVisitorclERK16WitnessV1Taproot:
  142|    609|    {
  143|    609|        return CScript() << OP_1 << ToByteVector(tap);
  144|    609|    }
addresstype.cpp:_ZNK12_GLOBAL__N_123ValidDestinationVisitorclERK14CNoDestination:
  155|    417|    bool operator()(const CNoDestination& dest) const { return false; }

_ZN16WitnessV0KeyHashC2ERK7uint160:
   82|      4|    explicit WitnessV0KeyHash(const uint160& hash) : BaseHash(hash) {}
_ZN16WitnessV1TaprootC2ERK11XOnlyPubKey:
   91|    609|    explicit WitnessV1Taproot(const XOnlyPubKey& xpk) : XOnlyPubKey(xpk) {}
_ZN14CNoDestinationC2Ev:
   25|    417|    CNoDestination() = default;

_Z12DecodeBase58RKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS_6vectorIhNS3_IhEEEEi:
  130|     55|{
  131|     55|    if (!ContainsNoNUL(str)) {
  ------------------
  |  Branch (131:9): [True: 0, False: 55]
  ------------------
  132|      0|        return false;
  133|      0|    }
  134|     55|    return DecodeBase58(str.c_str(), vchRet, max_ret_len);
  135|     55|}
_Z17DecodeBase58CheckRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERNS_6vectorIhNS3_IhEEEEi:
  164|    835|{
  165|    835|    if (!ContainsNoNUL(str)) {
  ------------------
  |  Branch (165:9): [True: 0, False: 835]
  ------------------
  166|      0|        return false;
  167|      0|    }
  168|    835|    return DecodeBase58Check(str.c_str(), vchRet, max_ret);
  169|    835|}
base58.cpp:_ZL12DecodeBase58PKcRNSt3__16vectorIhNS1_9allocatorIhEEEEi:
   41|    890|{
   42|       |    // Skip leading spaces.
   43|  1.68k|    while (*psz && IsSpace(*psz))
  ------------------
  |  Branch (43:12): [True: 1.64k, False: 33]
  |  Branch (43:20): [True: 792, False: 857]
  ------------------
   44|    792|        psz++;
   45|       |    // Skip and count leading '1's.
   46|    890|    int zeroes = 0;
   47|    890|    int length = 0;
   48|  3.37k|    while (*psz == '1') {
  ------------------
  |  Branch (48:12): [True: 2.49k, False: 875]
  ------------------
   49|  2.49k|        zeroes++;
   50|  2.49k|        if (zeroes > max_ret_len) return false;
  ------------------
  |  Branch (50:13): [True: 15, False: 2.48k]
  ------------------
   51|  2.48k|        psz++;
   52|  2.48k|    }
   53|       |    // Allocate enough space in big-endian base256 representation.
   54|    875|    int size = strlen(psz) * 733 /1000 + 1; // log(58) / log(256), rounded up.
   55|    875|    std::vector<unsigned char> b256(size);
   56|       |    // Process the characters.
   57|    875|    static_assert(std::size(mapBase58) == 256, "mapBase58.size() should be 256"); // guarantee not out of range
   58|  5.17k|    while (*psz && !IsSpace(*psz)) {
  ------------------
  |  Branch (58:12): [True: 4.86k, False: 309]
  |  Branch (58:20): [True: 4.80k, False: 54]
  ------------------
   59|       |        // Decode base58 character
   60|  4.80k|        int carry = mapBase58[(uint8_t)*psz];
   61|  4.80k|        if (carry == -1)  // Invalid b58 character
  ------------------
  |  Branch (61:13): [True: 490, False: 4.31k]
  ------------------
   62|    490|            return false;
   63|  4.31k|        int i = 0;
   64|  67.9k|        for (std::vector<unsigned char>::reverse_iterator it = b256.rbegin(); (carry != 0 || i < length) && (it != b256.rend()); ++it, ++i) {
  ------------------
  |  Branch (64:79): [True: 63.6k, False: 4.31k]
  |  Branch (64:80): [True: 61.7k, False: 6.21k]
  |  Branch (64:94): [True: 1.89k, False: 4.31k]
  |  Branch (64:109): [True: 63.6k, False: 0]
  ------------------
   65|  63.6k|            carry += 58 * (*it);
   66|  63.6k|            *it = carry % 256;
   67|  63.6k|            carry /= 256;
   68|  63.6k|        }
   69|  4.31k|        assert(carry == 0);
   70|  4.31k|        length = i;
   71|  4.31k|        if (length + zeroes > max_ret_len) return false;
  ------------------
  |  Branch (71:13): [True: 22, False: 4.29k]
  ------------------
   72|  4.29k|        psz++;
   73|  4.29k|    }
   74|       |    // Skip trailing spaces.
   75|    673|    while (IsSpace(*psz))
  ------------------
  |  Branch (75:12): [True: 310, False: 363]
  ------------------
   76|    310|        psz++;
   77|    363|    if (*psz != 0)
  ------------------
  |  Branch (77:9): [True: 28, False: 335]
  ------------------
   78|     28|        return false;
   79|       |    // Skip leading zeroes in b256.
   80|    335|    std::vector<unsigned char>::iterator it = b256.begin() + (size - length);
   81|       |    // Copy result into output vector.
   82|    335|    vch.reserve(zeroes + (b256.end() - it));
   83|    335|    vch.assign(zeroes, 0x00);
   84|  1.73k|    while (it != b256.end())
  ------------------
  |  Branch (84:12): [True: 1.39k, False: 335]
  ------------------
   85|  1.39k|        vch.push_back(*(it++));
   86|    335|    return true;
   87|    363|}
base58.cpp:_ZL17DecodeBase58CheckPKcRNSt3__16vectorIhNS1_9allocatorIhEEEEi:
  147|    835|{
  148|    835|    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: 527, False: 308]
  |  Branch (148:36): [True: 0, False: 835]
  ------------------
  149|    835|        (vchRet.size() < 4)) {
  ------------------
  |  Branch (149:9): [True: 197, False: 111]
  ------------------
  150|    724|        vchRet.clear();
  151|    724|        return false;
  152|    724|    }
  153|       |    // re-calculate the checksum, ensure it matches the included 4-byte checksum
  154|    111|    uint256 hash = Hash(Span{vchRet}.first(vchRet.size() - 4));
  155|    111|    if (memcmp(&hash, &vchRet[vchRet.size() - 4], 4) != 0) {
  ------------------
  |  Branch (155:9): [True: 111, False: 0]
  ------------------
  156|    111|        vchRet.clear();
  157|    111|        return false;
  158|    111|    }
  159|      0|    vchRet.resize(vchRet.size() - 4);
  160|      0|    return true;
  161|    111|}

_ZN6bech326DecodeERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS_9CharLimitE:
  374|    362|DecodeResult Decode(const std::string& str, CharLimit limit) {
  375|    362|    std::vector<int> errors;
  376|    362|    if (!CheckCharacters(str, errors)) return {};
  ------------------
  |  Branch (376:9): [True: 88, False: 274]
  ------------------
  377|    274|    size_t pos = str.rfind(SEPARATOR);
  378|    274|    if (str.size() > limit) return {};
  ------------------
  |  Branch (378:9): [True: 19, False: 255]
  ------------------
  379|    255|    if (pos == str.npos || pos == 0 || pos + CHECKSUM_SIZE >= str.size()) {
  ------------------
  |  Branch (379:9): [True: 16, False: 239]
  |  Branch (379:28): [True: 0, False: 239]
  |  Branch (379:40): [True: 10, False: 229]
  ------------------
  380|     26|        return {};
  381|     26|    }
  382|    229|    data values(str.size() - 1 - pos);
  383|  3.37k|    for (size_t i = 0; i < str.size() - 1 - pos; ++i) {
  ------------------
  |  Branch (383:24): [True: 3.15k, False: 216]
  ------------------
  384|  3.15k|        unsigned char c = str[i + pos + 1];
  385|  3.15k|        int8_t rev = CHARSET_REV[c];
  386|       |
  387|  3.15k|        if (rev == -1) {
  ------------------
  |  Branch (387:13): [True: 13, False: 3.14k]
  ------------------
  388|     13|            return {};
  389|     13|        }
  390|  3.14k|        values[i] = rev;
  391|  3.14k|    }
  392|    216|    std::string hrp;
  393|    216|    hrp.reserve(pos);
  394|  3.46k|    for (size_t i = 0; i < pos; ++i) {
  ------------------
  |  Branch (394:24): [True: 3.24k, False: 216]
  ------------------
  395|  3.24k|        hrp += LowerCase(str[i]);
  396|  3.24k|    }
  397|    216|    Encoding result = VerifyChecksum(hrp, values);
  398|    216|    if (result == Encoding::INVALID) return {};
  ------------------
  |  Branch (398:9): [True: 211, False: 5]
  ------------------
  399|      5|    return {result, std::move(hrp), data(values.begin(), values.end() - CHECKSUM_SIZE)};
  400|    216|}
_ZN6bech3212LocateErrorsERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEENS_9CharLimitE:
  403|    357|std::pair<std::string, std::vector<int>> LocateErrors(const std::string& str, CharLimit limit) {
  404|    357|    std::vector<int> error_locations{};
  405|       |
  406|    357|    if (str.size() > limit) {
  ------------------
  |  Branch (406:9): [True: 67, False: 290]
  ------------------
  407|     67|        error_locations.resize(str.size() - limit);
  408|     67|        std::iota(error_locations.begin(), error_locations.end(), static_cast<int>(limit));
  409|     67|        return std::make_pair("Bech32 string too long", std::move(error_locations));
  410|     67|    }
  411|       |
  412|    290|    if (!CheckCharacters(str, error_locations)){
  ------------------
  |  Branch (412:9): [True: 40, False: 250]
  ------------------
  413|     40|        return std::make_pair("Invalid character or mixed case", std::move(error_locations));
  414|     40|    }
  415|       |
  416|    250|    size_t pos = str.rfind(SEPARATOR);
  417|    250|    if (pos == str.npos) {
  ------------------
  |  Branch (417:9): [True: 16, False: 234]
  ------------------
  418|     16|        return std::make_pair("Missing separator", std::vector<int>{});
  419|     16|    }
  420|    234|    if (pos == 0 || pos + CHECKSUM_SIZE >= str.size()) {
  ------------------
  |  Branch (420:9): [True: 0, False: 234]
  |  Branch (420:21): [True: 10, False: 224]
  ------------------
  421|     10|        error_locations.push_back(pos);
  422|     10|        return std::make_pair("Invalid separator position", std::move(error_locations));
  423|     10|    }
  424|       |
  425|    224|    std::string hrp;
  426|    224|    hrp.reserve(pos);
  427|  3.61k|    for (size_t i = 0; i < pos; ++i) {
  ------------------
  |  Branch (427:24): [True: 3.39k, False: 224]
  ------------------
  428|  3.39k|        hrp += LowerCase(str[i]);
  429|  3.39k|    }
  430|       |
  431|    224|    size_t length = str.size() - 1 - pos; // length of data part
  432|    224|    data values(length);
  433|  3.31k|    for (size_t i = pos + 1; i < str.size(); ++i) {
  ------------------
  |  Branch (433:30): [True: 3.09k, False: 211]
  ------------------
  434|  3.09k|        unsigned char c = str[i];
  435|  3.09k|        int8_t rev = CHARSET_REV[c];
  436|  3.09k|        if (rev == -1) {
  ------------------
  |  Branch (436:13): [True: 13, False: 3.08k]
  ------------------
  437|     13|            error_locations.push_back(i);
  438|     13|            return std::make_pair("Invalid Base 32 character", std::move(error_locations));
  439|     13|        }
  440|  3.08k|        values[i - pos - 1] = rev;
  441|  3.08k|    }
  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|    211|    std::optional<Encoding> error_encoding;
  446|    422|    for (Encoding encoding : {Encoding::BECH32, Encoding::BECH32M}) {
  ------------------
  |  Branch (446:28): [True: 422, False: 211]
  ------------------
  447|    422|        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|    422|        auto enc = PreparePolynomialCoefficients(hrp, values);
  451|    422|        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|    422|        if (residue != 0) {
  ------------------
  |  Branch (455:13): [True: 422, 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|    422|            uint32_t syn = Syndrome(residue);
  459|       |
  460|       |            // Unpack the three 10-bit syndrome values
  461|    422|            int s0 = syn & 0x3FF;
  462|    422|            int s1 = (syn >> 10) & 0x3FF;
  463|    422|            int s2 = syn >> 20;
  464|       |
  465|       |            // Get the discrete logs of these values in GF1024 for more efficient computation
  466|    422|            int l_s0 = GF1024_LOG.at(s0);
  467|    422|            int l_s1 = GF1024_LOG.at(s1);
  468|    422|            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|    422|            if (l_s0 != -1 && l_s1 != -1 && l_s2 != -1 && (2 * l_s1 - l_s2 - l_s0 + 2046) % 1023 == 0) {
  ------------------
  |  Branch (474:17): [True: 395, False: 27]
  |  Branch (474:31): [True: 380, False: 15]
  |  Branch (474:45): [True: 378, False: 2]
  |  Branch (474:59): [True: 18, False: 360]
  ------------------
  475|       |                // Compute the error position p1 as l_s1 - l_s0 = p1 (mod 1023)
  476|     18|                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|     18|                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|     18|                if (p1 < length && !(l_e1 % 33)) {
  ------------------
  |  Branch (484:21): [True: 6, False: 12]
  |  Branch (484:36): [True: 4, 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|      4|                    possible_errors.push_back(str.size() - p1 - 1);
  489|      4|                }
  490|       |            // Otherwise, suppose there are two errors. Then E(x) = e1*x^p1 + e2*x^p2.
  491|    404|            } else {
  492|       |                // For all possible first error positions p1
  493|  5.53k|                for (size_t p1 = 0; p1 < length; ++p1) {
  ------------------
  |  Branch (493:37): [True: 5.15k, False: 377]
  ------------------
  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.15k|                    int s2_s1p1 = s2 ^ (s1 == 0 ? 0 : GF1024_EXP.at((l_s1 + p1) % 1023));
  ------------------
  |  Branch (503:41): [True: 361, False: 4.79k]
  ------------------
  504|  5.15k|                    if (s2_s1p1 == 0) continue;
  ------------------
  |  Branch (504:25): [True: 76, False: 5.07k]
  ------------------
  505|  5.07k|                    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|  5.07k|                    int s1_s0p1 = s1 ^ (s0 == 0 ? 0 : GF1024_EXP.at((l_s0 + p1) % 1023));
  ------------------
  |  Branch (509:41): [True: 496, False: 4.58k]
  ------------------
  510|  5.07k|                    if (s1_s0p1 == 0) continue;
  ------------------
  |  Branch (510:25): [True: 84, False: 4.99k]
  ------------------
  511|  4.99k|                    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.99k|                    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.99k|                    if (p2 >= length || p1 == p2) continue;
  ------------------
  |  Branch (519:25): [True: 4.53k, False: 462]
  |  Branch (519:41): [True: 88, False: 374]
  ------------------
  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|    374|                    int s1_s0p2 = s1 ^ (s0 == 0 ? 0 : GF1024_EXP.at((l_s0 + p2) % 1023));
  ------------------
  |  Branch (524:41): [True: 38, False: 336]
  ------------------
  525|    374|                    if (s1_s0p2 == 0) continue;
  ------------------
  |  Branch (525:25): [True: 0, False: 374]
  ------------------
  526|    374|                    int l_s1_s0p2 = GF1024_LOG.at(s1_s0p2);
  527|       |
  528|       |                    // And compute (the log of) 1/((e)^p1 + (e)^p2))
  529|    374|                    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|    374|                    int l_e2 = l_s1_s0p1 + inv_p1_p2 + (1023 - 997) * p2;
  535|       |                    // Check that e2 is in GF(32)
  536|    374|                    if (l_e2 % 33) continue;
  ------------------
  |  Branch (536:25): [True: 319, False: 55]
  ------------------
  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|     55|                    int l_e1 = l_s1_s0p2 + inv_p1_p2 + (1023 - 997) * p1;
  542|       |                    // Check that e1 is in GF(32)
  543|     55|                    if (l_e1 % 33) continue;
  ------------------
  |  Branch (543:25): [True: 28, False: 27]
  ------------------
  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|     27|                    if (p1 > p2) {
  ------------------
  |  Branch (547:25): [True: 0, False: 27]
  ------------------
  548|      0|                        possible_errors.push_back(str.size() - p1 - 1);
  549|      0|                        possible_errors.push_back(str.size() - p2 - 1);
  550|     27|                    } else {
  551|     27|                        possible_errors.push_back(str.size() - p2 - 1);
  552|     27|                        possible_errors.push_back(str.size() - p1 - 1);
  553|     27|                    }
  554|     27|                    break;
  555|     55|                }
  556|    404|            }
  557|    422|        } else {
  558|       |            // No errors
  559|      0|            return std::make_pair("", std::vector<int>{});
  560|      0|        }
  561|       |
  562|    422|        if (error_locations.empty() || (!possible_errors.empty() && possible_errors.size() < error_locations.size())) {
  ------------------
  |  Branch (562:13): [True: 413, False: 9]
  |  Branch (562:41): [True: 3, False: 6]
  |  Branch (562:69): [True: 1, False: 2]
  ------------------
  563|    414|            error_locations = std::move(possible_errors);
  564|    414|            if (!error_locations.empty()) error_encoding = encoding;
  ------------------
  |  Branch (564:17): [True: 29, False: 385]
  ------------------
  565|    414|        }
  566|    422|    }
  567|    211|    std::string error_message = error_encoding == Encoding::BECH32M ? "Invalid Bech32m checksum"
  ------------------
  |  Branch (567:33): [True: 20, False: 191]
  ------------------
  568|    211|                              : error_encoding == Encoding::BECH32 ? "Invalid Bech32 checksum"
  ------------------
  |  Branch (568:33): [True: 8, False: 183]
  ------------------
  569|    191|                              : "Invalid checksum";
  570|       |
  571|    211|    return std::make_pair(error_message, std::move(error_locations));
  572|    211|}
bech32.cpp:_ZN6bech3212_GLOBAL__N_115CheckCharactersERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERNS1_6vectorIiNS5_IiEEEE:
  288|    652|{
  289|    652|    bool lower = false, upper = false;
  290|   108k|    for (size_t i = 0; i < str.size(); ++i) {
  ------------------
  |  Branch (290:24): [True: 107k, False: 652]
  ------------------
  291|   107k|        unsigned char c{(unsigned char)(str[i])};
  292|   107k|        if (c >= 'a' && c <= 'z') {
  ------------------
  |  Branch (292:13): [True: 68.0k, False: 39.5k]
  |  Branch (292:25): [True: 67.3k, False: 699]
  ------------------
  293|  67.3k|            if (upper) {
  ------------------
  |  Branch (293:17): [True: 24.2k, False: 43.0k]
  ------------------
  294|  24.2k|                errors.push_back(i);
  295|  43.0k|            } else {
  296|  43.0k|                lower = true;
  297|  43.0k|            }
  298|  67.3k|        } else if (c >= 'A' && c <= 'Z') {
  ------------------
  |  Branch (298:20): [True: 6.07k, False: 34.2k]
  |  Branch (298:32): [True: 4.41k, False: 1.65k]
  ------------------
  299|  4.41k|            if (lower) {
  ------------------
  |  Branch (299:17): [True: 3.04k, False: 1.36k]
  ------------------
  300|  3.04k|                errors.push_back(i);
  301|  3.04k|            } else {
  302|  1.36k|                upper = true;
  303|  1.36k|            }
  304|  35.8k|        } else if (c < 33 || c > 126) {
  ------------------
  |  Branch (304:20): [True: 2.29k, False: 33.5k]
  |  Branch (304:30): [True: 0, False: 33.5k]
  ------------------
  305|  2.29k|            errors.push_back(i);
  306|  2.29k|        }
  307|   107k|    }
  308|    652|    return errors.empty();
  309|    652|}
bech32.cpp:_ZN6bech3212_GLOBAL__N_19LowerCaseEh:
  282|  6.63k|{
  283|  6.63k|    return (c >= 'A' && c <= 'Z') ? (c - 'A') + 'a' : c;
  ------------------
  |  Branch (283:13): [True: 4.04k, False: 2.59k]
  |  Branch (283:25): [True: 511, False: 3.53k]
  ------------------
  284|  6.63k|}
bech32.cpp:_ZN6bech3212_GLOBAL__N_114VerifyChecksumERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS1_6vectorIhNS5_IhEEEE:
  328|    216|{
  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|    216|    auto enc = PreparePolynomialCoefficients(hrp, values);
  335|    216|    const uint32_t check = PolyMod(enc);
  336|    216|    if (check == EncodingConstant(Encoding::BECH32)) return Encoding::BECH32;
  ------------------
  |  Branch (336:9): [True: 4, False: 212]
  ------------------
  337|    212|    if (check == EncodingConstant(Encoding::BECH32M)) return Encoding::BECH32M;
  ------------------
  |  Branch (337:9): [True: 1, False: 211]
  ------------------
  338|    211|    return Encoding::INVALID;
  339|    212|}
bech32.cpp:_ZN6bech3212_GLOBAL__N_129PreparePolynomialCoefficientsERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKNS1_6vectorIhNS5_IhEEEE:
  312|    638|{
  313|    638|    data ret;
  314|    638|    ret.reserve(hrp.size() + 1 + hrp.size() + values.size() + CHECKSUM_SIZE);
  315|       |
  316|       |    /** Expand a HRP for use in checksum computation. */
  317|  10.2k|    for (size_t i = 0; i < hrp.size(); ++i) ret.push_back(hrp[i] >> 5);
  ------------------
  |  Branch (317:24): [True: 9.61k, False: 638]
  ------------------
  318|    638|    ret.push_back(0);
  319|  10.2k|    for (size_t i = 0; i < hrp.size(); ++i) ret.push_back(hrp[i] & 0x1f);
  ------------------
  |  Branch (319:24): [True: 9.61k, False: 638]
  ------------------
  320|       |
  321|    638|    ret.insert(ret.end(), values.begin(), values.end());
  322|       |
  323|    638|    return ret;
  324|    638|}
bech32.cpp:_ZN6bech3212_GLOBAL__N_17PolyModERKNSt3__16vectorIhNS1_9allocatorIhEEEE:
  131|    638|{
  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|    638|    uint32_t c = 1;
  178|  29.1k|    for (const auto v_i : v) {
  ------------------
  |  Branch (178:25): [True: 29.1k, False: 638]
  ------------------
  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|  29.1k|        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|  29.1k|        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|  29.1k|        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: 12.7k, False: 16.3k]
  ------------------
  209|  29.1k|        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: 13.8k, False: 15.2k]
  ------------------
  210|  29.1k|        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: 13.0k, False: 16.0k]
  ------------------
  211|  29.1k|        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: 12.8k, False: 16.2k]
  ------------------
  212|  29.1k|        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: 12.4k, False: 16.7k]
  ------------------
  213|       |
  214|  29.1k|    }
  215|    638|    return c;
  216|    638|}
bech32.cpp:_ZN6bech3212_GLOBAL__N_116EncodingConstantENS_8EncodingE:
  122|    850|uint32_t EncodingConstant(Encoding encoding) {
  123|    850|    assert(encoding == Encoding::BECH32 || encoding == Encoding::BECH32M);
  124|    850|    return encoding == Encoding::BECH32 ? 1 : 0x2bc830a3;
  ------------------
  |  Branch (124:12): [True: 427, False: 423]
  ------------------
  125|    850|}
bech32.cpp:_ZN6bech3212_GLOBAL__N_18SyndromeEj:
  261|    422|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|    422|    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|    422|    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|  10.9k|    for (int i = 0; i < 25; ++i) {
  ------------------
  |  Branch (274:21): [True: 10.5k, False: 422]
  ------------------
  275|  10.5k|        result ^= ((residue >> (5+i)) & 1 ? SYNDROME_CONSTS.at(i) : 0);
  ------------------
  |  Branch (275:20): [True: 5.21k, False: 5.33k]
  ------------------
  276|  10.5k|    }
  277|    422|    return result;
  278|    422|}

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

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

_Z17internal_bswap_32j:
   54|  1.79M|{
   55|  1.79M|#ifdef bitcoin_builtin_bswap32
   56|  1.79M|    return bitcoin_builtin_bswap32(x);
  ------------------
  |  |   24|  1.79M|#      define bitcoin_builtin_bswap32(x) __builtin_bswap32(x)
  ------------------
   57|       |#else
   58|       |    return (((x & 0xff000000U) >> 24) | ((x & 0x00ff0000U) >>  8) |
   59|       |            ((x & 0x0000ff00U) <<  8) | ((x & 0x000000ffU) << 24));
   60|       |#endif
   61|  1.79M|}
_Z17internal_bswap_64m:
   64|  63.0k|{
   65|  63.0k|#ifdef bitcoin_builtin_bswap64
   66|  63.0k|    return bitcoin_builtin_bswap64(x);
  ------------------
  |  |   27|  63.0k|#      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|  63.0k|}

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

_Z10MoneyRangeRKl:
   27|    550|inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
  ------------------
  |  Branch (27:57): [True: 397, False: 153]
  |  Branch (27:72): [True: 208, False: 189]
  ------------------

_Z14SighashFromStrRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  238|  7.52k|{
  239|  7.52k|    static const std::map<std::string, int> map_sighash_values = {
  240|  7.52k|        {std::string("DEFAULT"), int(SIGHASH_DEFAULT)},
  241|  7.52k|        {std::string("ALL"), int(SIGHASH_ALL)},
  242|  7.52k|        {std::string("ALL|ANYONECANPAY"), int(SIGHASH_ALL|SIGHASH_ANYONECANPAY)},
  243|  7.52k|        {std::string("NONE"), int(SIGHASH_NONE)},
  244|  7.52k|        {std::string("NONE|ANYONECANPAY"), int(SIGHASH_NONE|SIGHASH_ANYONECANPAY)},
  245|  7.52k|        {std::string("SINGLE"), int(SIGHASH_SINGLE)},
  246|  7.52k|        {std::string("SINGLE|ANYONECANPAY"), int(SIGHASH_SINGLE|SIGHASH_ANYONECANPAY)},
  247|  7.52k|    };
  248|  7.52k|    const auto& it = map_sighash_values.find(sighash);
  249|  7.52k|    if (it != map_sighash_values.end()) {
  ------------------
  |  Branch (249:9): [True: 2, False: 7.51k]
  ------------------
  250|      2|        return it->second;
  251|  7.51k|    } else {
  252|  7.51k|        return util::Error{Untranslated("'" + sighash + "' is not a valid sighash parameter.")};
  253|  7.51k|    }
  254|  7.52k|}

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

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

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

_ZN8CHash2568FinalizeE4SpanIhE:
   30|    111|    void Finalize(Span<unsigned char> output) {
   31|    111|        assert(output.size() == OUTPUT_SIZE);
   32|    111|        unsigned char buf[CSHA256::OUTPUT_SIZE];
   33|    111|        sha.Finalize(buf);
   34|    111|        sha.Reset().Write(buf, CSHA256::OUTPUT_SIZE).Finalize(output.data());
   35|    111|    }
_ZN8CHash2565WriteE4SpanIKhE:
   37|    111|    CHash256& Write(Span<const unsigned char> input) {
   38|    111|        sha.Write(input.data(), input.size());
   39|    111|        return *this;
   40|    111|    }
_ZN8CHash1608FinalizeE4SpanIhE:
   55|  59.5k|    void Finalize(Span<unsigned char> output) {
   56|  59.5k|        assert(output.size() == OUTPUT_SIZE);
   57|  59.5k|        unsigned char buf[CSHA256::OUTPUT_SIZE];
   58|  59.5k|        sha.Finalize(buf);
   59|  59.5k|        CRIPEMD160().Write(buf, CSHA256::OUTPUT_SIZE).Finalize(output.data());
   60|  59.5k|    }
_ZN8CHash1605WriteE4SpanIKhE:
   62|  59.5k|    CHash160& Write(Span<const unsigned char> input) {
   63|  59.5k|        sha.Write(input.data(), input.size());
   64|  59.5k|        return *this;
   65|  59.5k|    }
_ZN10HashWriter5writeE4SpanIKSt4byteE:
  107|  6.62k|    {
  108|  6.62k|        ctx.Write(UCharCast(src.data()), src.size());
  109|  6.62k|    }
_ZN10HashWriter9GetSHA256Ev:
  126|  2.82k|    uint256 GetSHA256() {
  127|  2.82k|        uint256 result;
  128|  2.82k|        ctx.Finalize(result.begin());
  129|  2.82k|        return result;
  130|  2.82k|    }
_Z7Hash160I4SpanIKhEE7uint160RKT_:
   93|  58.1k|{
   94|  58.1k|    uint160 result;
   95|  58.1k|    CHash160().Write(MakeUCharSpan(in1)).Finalize(result);
   96|  58.1k|    return result;
   97|  58.1k|}
_Z7Hash160I11XOnlyPubKeyE7uint160RKT_:
   93|    559|{
   94|    559|    uint160 result;
   95|    559|    CHash160().Write(MakeUCharSpan(in1)).Finalize(result);
   96|    559|    return result;
   97|    559|}
_Z7Hash160I7CScriptE7uint160RKT_:
   93|    905|{
   94|    905|    uint160 result;
   95|    905|    CHash160().Write(MakeUCharSpan(in1)).Finalize(result);
   96|    905|    return result;
   97|    905|}
_Z4HashI4SpanIhEE7uint256RKT_:
   76|    111|{
   77|    111|    uint256 result;
   78|    111|    CHash256().Write(MakeUCharSpan(in1)).Finalize(result);
   79|    111|    return result;
   80|    111|}
_ZN10HashWriterlsI7uint256EERS_RKT_:
  142|    839|    {
  143|    839|        ::Serialize(*this, obj);
  144|    839|        return *this;
  145|    839|    }
_ZN10HashWriterlsI4SpanIKhEEERS_RKT_:
  142|  4.04k|    {
  143|  4.04k|        ::Serialize(*this, obj);
  144|  4.04k|        return *this;
  145|  4.04k|    }
_ZN10HashWriterlsIhEERS_RKT_:
  142|  1.22k|    {
  143|  1.22k|        ::Serialize(*this, obj);
  144|  1.22k|        return *this;
  145|  1.22k|    }
_ZN10HashWriterlsI17CompactSizeWriterEERS_RKT_:
  142|  1.22k|    {
  143|  1.22k|        ::Serialize(*this, obj);
  144|  1.22k|        return *this;
  145|  1.22k|    }

_ZNK12CChainParams9Bech32HRPEv:
  119|    841|    const std::string& Bech32HRP() const { return bech32_hrp; }

_ZNK4CKey7IsValidEv:
  123|    510|    bool IsValid() const { return !!keydata; }
_ZN4CKeyC2Ev:
   74|    510|    CKey() noexcept = default;
_ZN7CExtKeyC2Ev:
  243|    270|    CExtKey() = default;

_Z12DecodeSecretRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  214|    240|{
  215|    240|    CKey key;
  216|    240|    std::vector<unsigned char> data;
  217|    240|    if (DecodeBase58Check(str, data, 34)) {
  ------------------
  |  Branch (217:9): [True: 0, False: 240]
  ------------------
  218|      0|        const std::vector<unsigned char>& privkey_prefix = Params().Base58Prefix(CChainParams::SECRET_KEY);
  219|      0|        if ((data.size() == 32 + privkey_prefix.size() || (data.size() == 33 + privkey_prefix.size() && data.back() == 1)) &&
  ------------------
  |  Branch (219:14): [True: 0, False: 0]
  |  Branch (219:60): [True: 0, False: 0]
  |  Branch (219:105): [True: 0, False: 0]
  ------------------
  220|      0|            std::equal(privkey_prefix.begin(), privkey_prefix.end(), data.begin())) {
  ------------------
  |  Branch (220:13): [True: 0, False: 0]
  ------------------
  221|      0|            bool compressed = data.size() == 33 + privkey_prefix.size();
  222|      0|            key.Set(data.begin() + privkey_prefix.size(), data.begin() + privkey_prefix.size() + 32, compressed);
  223|      0|        }
  224|      0|    }
  225|    240|    if (!data.empty()) {
  ------------------
  |  Branch (225:9): [True: 0, False: 240]
  ------------------
  226|      0|        memory_cleanse(data.data(), data.size());
  227|      0|    }
  228|    240|    return key;
  229|    240|}
_Z15DecodeExtPubKeyRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  245|    270|{
  246|    270|    CExtPubKey key;
  247|    270|    std::vector<unsigned char> data;
  248|    270|    if (DecodeBase58Check(str, data, 78)) {
  ------------------
  |  Branch (248:9): [True: 0, False: 270]
  ------------------
  249|      0|        const std::vector<unsigned char>& prefix = Params().Base58Prefix(CChainParams::EXT_PUBLIC_KEY);
  250|      0|        if (data.size() == BIP32_EXTKEY_SIZE + prefix.size() && std::equal(prefix.begin(), prefix.end(), data.begin())) {
  ------------------
  |  Branch (250:13): [True: 0, False: 0]
  |  Branch (250:65): [True: 0, False: 0]
  ------------------
  251|      0|            key.Decode(data.data() + prefix.size());
  252|      0|        }
  253|      0|    }
  254|    270|    return key;
  255|    270|}
_Z12DecodeExtKeyRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  268|    270|{
  269|    270|    CExtKey key;
  270|    270|    std::vector<unsigned char> data;
  271|    270|    if (DecodeBase58Check(str, data, 78)) {
  ------------------
  |  Branch (271:9): [True: 0, False: 270]
  ------------------
  272|      0|        const std::vector<unsigned char>& prefix = Params().Base58Prefix(CChainParams::EXT_SECRET_KEY);
  273|      0|        if (data.size() == BIP32_EXTKEY_SIZE + prefix.size() && std::equal(prefix.begin(), prefix.end(), data.begin())) {
  ------------------
  |  Branch (273:13): [True: 0, False: 0]
  |  Branch (273:65): [True: 0, False: 0]
  ------------------
  274|      0|            key.Decode(data.data() + prefix.size());
  275|      0|        }
  276|      0|    }
  277|    270|    if (!data.empty()) {
  ------------------
  |  Branch (277:9): [True: 0, False: 270]
  ------------------
  278|      0|        memory_cleanse(data.data(), data.size());
  279|      0|    }
  280|    270|    return key;
  281|    270|}
_Z17DecodeDestinationRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERS5_PNS_6vectorIiNS3_IiEEEE:
  300|    417|{
  301|    417|    return DecodeDestination(str, Params(), error_msg, error_locations);
  302|    417|}
_Z17DecodeDestinationRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  305|    417|{
  306|    417|    std::string error_msg;
  307|    417|    return DecodeDestination(str, error_msg);
  308|    417|}
key_io.cpp:_ZN12_GLOBAL__N_117DecodeDestinationERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERK12CChainParamsRS6_PNS0_6vectorIiNS4_IiEEEE:
   85|    417|{
   86|    417|    std::vector<unsigned char> data;
   87|    417|    uint160 hash;
   88|    417|    error_str = "";
   89|       |
   90|       |    // Note this will be false if it is a valid Bech32 address for a different network
   91|    417|    bool is_bech32 = (ToLower(str.substr(0, params.Bech32HRP().size())) == params.Bech32HRP());
   92|       |
   93|    417|    if (!is_bech32 && DecodeBase58Check(str, data, 21)) {
  ------------------
  |  Branch (93:9): [True: 55, False: 362]
  |  Branch (93:23): [True: 0, False: 55]
  ------------------
   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|    417|    } else if (!is_bech32) {
  ------------------
  |  Branch (120:16): [True: 55, False: 362]
  ------------------
  121|       |        // Try Base58 decoding without the checksum, using a much larger max length
  122|     55|        if (!DecodeBase58(str, data, 100)) {
  ------------------
  |  Branch (122:13): [True: 28, False: 27]
  ------------------
  123|     28|            error_str = "Invalid or unsupported Segwit (Bech32) or Base58 encoding.";
  124|     28|        } else {
  125|     27|            error_str = "Invalid checksum or length of Base58 address (P2PKH or P2SH)";
  126|     27|        }
  127|     55|        return CNoDestination();
  128|     55|    }
  129|       |
  130|    362|    data.clear();
  131|    362|    const auto dec = bech32::Decode(str);
  132|    362|    if (dec.encoding == bech32::Encoding::BECH32 || dec.encoding == bech32::Encoding::BECH32M) {
  ------------------
  |  Branch (132:9): [True: 4, False: 358]
  |  Branch (132:53): [True: 1, False: 357]
  ------------------
  133|      5|        if (dec.data.empty()) {
  ------------------
  |  Branch (133:13): [True: 1, False: 4]
  ------------------
  134|      1|            error_str = "Empty Bech32 data section";
  135|      1|            return CNoDestination();
  136|      1|        }
  137|       |        // Bech32 decoding
  138|      4|        if (dec.hrp != params.Bech32HRP()) {
  ------------------
  |  Branch (138:13): [True: 3, False: 1]
  ------------------
  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|      1|        int version = dec.data[0]; // The first 5 bit symbol is the witness version (0-16)
  143|      1|        if (version == 0 && dec.encoding != bech32::Encoding::BECH32) {
  ------------------
  |  Branch (143:13): [True: 0, False: 1]
  |  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|      1|        if (version != 0 && dec.encoding != bech32::Encoding::BECH32M) {
  ------------------
  |  Branch (147:13): [True: 1, False: 0]
  |  Branch (147:29): [True: 1, False: 0]
  ------------------
  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|      0|        data.reserve(((dec.data.size() - 1) * 5) / 8);
  153|      0|        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: 0]
  ------------------
  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|      0|        } else {
  200|      0|            error_str = strprintf("Invalid padding in Bech32 data section");
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
  201|      0|            return CNoDestination();
  202|      0|        }
  203|      0|    }
  204|       |
  205|       |    // Perform Bech32 error location
  206|    357|    auto res = bech32::LocateErrors(str);
  207|    357|    error_str = res.first;
  208|    357|    if (error_locations) *error_locations = std::move(res.second);
  ------------------
  |  Branch (208:9): [True: 0, False: 357]
  ------------------
  209|    357|    return CNoDestination();
  210|    362|}

_ZN9prevectorILj28EhjiE3endEv:
  304|  1.32M|    iterator end() { return iterator(item_ptr(size())); }
_ZN9prevectorILj28EhjiE8item_ptrEi:
  206|  3.76M|    T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  ------------------
  |  Branch (206:47): [True: 2.39M, False: 1.36M]
  ------------------
_ZNK9prevectorILj28EhjiE9is_directEv:
  173|  9.69M|    bool is_direct() const { return _size <= N; }
_ZN9prevectorILj28EhjiE10direct_ptrEi:
  169|  2.60M|    T* direct_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.direct) + pos; }
_ZN9prevectorILj28EhjiE12indirect_ptrEi:
  171|  1.36M|    T* indirect_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.indirect_contents.indirect) + pos; }
_ZN9prevectorILj28EhjiE6insertENS0_8iteratorERKh:
  359|   860k|    iterator insert(iterator pos, const T& value) {
  360|   860k|        size_type p = pos - begin();
  361|   860k|        size_type new_size = size() + 1;
  362|   860k|        if (capacity() < new_size) {
  ------------------
  |  Branch (362:13): [True: 530, False: 859k]
  ------------------
  363|    530|            change_capacity(new_size + (new_size >> 1));
  364|    530|        }
  365|   860k|        T* ptr = item_ptr(p);
  366|   860k|        T* dst = ptr + 1;
  367|   860k|        memmove(dst, ptr, (size() - p) * sizeof(T));
  368|   860k|        _size++;
  369|   860k|        new(static_cast<void*>(ptr)) T(value);
  370|   860k|        return iterator(ptr);
  371|   860k|    }
_ZN9prevectorILj28EhjiE5beginEv:
  302|  1.32M|    iterator begin() { return iterator(item_ptr(0)); }
_ZmiN9prevectorILj28EhjiE8iteratorES1_:
   66|  1.32M|        difference_type friend operator-(iterator a, iterator b) { return (&(*a) - &(*b)); }
_ZNK9prevectorILj28EhjiE8iteratordeEv:
   59|  2.01G|        T& operator*() const { return *ptr; }
_ZNK9prevectorILj28EhjiE8capacityEv:
  312|  1.10M|    size_t capacity() const {
  313|  1.10M|        if (is_direct()) {
  ------------------
  |  Branch (313:13): [True: 861k, False: 248k]
  ------------------
  314|   861k|            return N;
  315|   861k|        } else {
  316|   248k|            return _union.indirect_contents.capacity;
  317|   248k|        }
  318|  1.10M|    }
_ZN9prevectorILj28EhjiE15change_capacityEj:
  175|   213k|    void change_capacity(size_type new_capacity) {
  176|   213k|        if (new_capacity <= N) {
  ------------------
  |  Branch (176:13): [True: 317, False: 212k]
  ------------------
  177|    317|            if (!is_direct()) {
  ------------------
  |  Branch (177:17): [True: 0, False: 317]
  ------------------
  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|   212k|        } else {
  186|   212k|            if (!is_direct()) {
  ------------------
  |  Branch (186:17): [True: 1.44k, False: 211k]
  ------------------
  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|  1.44k|                _union.indirect_contents.indirect = static_cast<char*>(realloc(_union.indirect_contents.indirect, ((size_t)sizeof(T)) * new_capacity));
  191|  1.44k|                assert(_union.indirect_contents.indirect);
  192|  1.44k|                _union.indirect_contents.capacity = new_capacity;
  193|   211k|            } else {
  194|   211k|                char* new_indirect = static_cast<char*>(malloc(((size_t)sizeof(T)) * new_capacity));
  195|   211k|                assert(new_indirect);
  196|   211k|                T* src = direct_ptr(0);
  197|   211k|                T* dst = reinterpret_cast<T*>(new_indirect);
  198|   211k|                memcpy(dst, src, size() * sizeof(T));
  199|   211k|                _union.indirect_contents.indirect = new_indirect;
  200|   211k|                _union.indirect_contents.capacity = new_capacity;
  201|   211k|                _size += N + 1;
  202|   211k|            }
  203|   212k|        }
  204|   213k|    }
_ZN9prevectorILj28EhjiE6insertITkNSt3__114input_iteratorENS2_11__wrap_iterIPKhEEEEvNS0_8iteratorET_S8_:
  387|  10.8k|    void insert(iterator pos, InputIterator first, InputIterator last) {
  388|  10.8k|        size_type p = pos - begin();
  389|  10.8k|        difference_type count = last - first;
  390|  10.8k|        size_type new_size = size() + count;
  391|  10.8k|        if (capacity() < new_size) {
  ------------------
  |  Branch (391:13): [True: 3.54k, False: 7.31k]
  ------------------
  392|  3.54k|            change_capacity(new_size + (new_size >> 1));
  393|  3.54k|        }
  394|  10.8k|        T* ptr = item_ptr(p);
  395|  10.8k|        T* dst = ptr + count;
  396|  10.8k|        memmove(dst, ptr, (size() - p) * sizeof(T));
  397|  10.8k|        _size += count;
  398|  10.8k|        fill(ptr, first, last);
  399|  10.8k|    }
_ZN9prevectorILj28EhjiE4fillITkNSt3__114input_iteratorENS2_11__wrap_iterIPKhEEEEvPhT_S8_:
  214|  10.8k|    void fill(T* dst, InputIterator first, InputIterator last) {
  215|   206k|        while (first != last) {
  ------------------
  |  Branch (215:16): [True: 196k, False: 10.8k]
  ------------------
  216|   196k|            new(static_cast<void*>(dst)) T(*first);
  217|   196k|            ++dst;
  218|   196k|            ++first;
  219|   196k|        }
  220|  10.8k|    }
_ZN9prevectorILj28EhjiE9push_backERKh:
  444|  12.4k|    void push_back(const T& value) {
  445|  12.4k|        emplace_back(value);
  446|  12.4k|    }
_ZN9prevectorILj28EhjiE12emplace_backIJRKhEEEvDpOT_:
  435|  12.4k|    void emplace_back(Args&&... args) {
  436|  12.4k|        size_type new_size = size() + 1;
  437|  12.4k|        if (capacity() < new_size) {
  ------------------
  |  Branch (437:13): [True: 72, False: 12.4k]
  ------------------
  438|     72|            change_capacity(new_size + (new_size >> 1));
  439|     72|        }
  440|  12.4k|        new(item_ptr(size())) T(std::forward<Args>(args)...);
  441|  12.4k|        _size++;
  442|  12.4k|    }
_ZNK9prevectorILj28EhjiE3endEv:
  305|  2.89k|    const_iterator end() const { return const_iterator(item_ptr(size())); }
_ZNK9prevectorILj28EhjiE8item_ptrEi:
  207|  8.29k|    const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  ------------------
  |  Branch (207:59): [True: 673, False: 7.62k]
  ------------------
_ZNK9prevectorILj28EhjiE10direct_ptrEi:
  170|    673|    const T* direct_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.direct) + pos; }
_ZNK9prevectorILj28EhjiE12indirect_ptrEi:
  172|  7.62k|    const T* indirect_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.indirect_contents.indirect) + pos; }
_ZNK9prevectorILj28EhjiE4sizeEv:
  294|  3.77M|    size_type size() const {
  295|  3.77M|        return is_direct() ? _size : _size - N - 1;
  ------------------
  |  Branch (295:16): [True: 2.61M, False: 1.16M]
  ------------------
  296|  3.77M|    }
_ZNK9prevectorILj28EhjiE5beginEv:
  303|  2.89k|    const_iterator begin() const { return const_iterator(item_ptr(0)); }
_ZNK9prevectorILj28EhjiE14const_iteratordeEv:
  111|   184k|        const T& operator*() const { return *ptr; }
_ZN9prevectorILj28EhjiE4fillITkNSt3__114input_iteratorENS0_14const_iteratorEEEvPhT_S5_:
  214|  2.89k|    void fill(T* dst, InputIterator first, InputIterator last) {
  215|   187k|        while (first != last) {
  ------------------
  |  Branch (215:16): [True: 184k, False: 2.89k]
  ------------------
  216|   184k|            new(static_cast<void*>(dst)) T(*first);
  217|   184k|            ++dst;
  218|   184k|            ++first;
  219|   184k|        }
  220|  2.89k|    }
_ZNK9prevectorILj28EhjiE14const_iteratorneES1_:
  125|   187k|        bool operator!=(const_iterator x) const { return ptr != x.ptr; }
_ZN9prevectorILj28EhjiE14const_iteratorppEv:
  114|   184k|        const_iterator& operator++() { ptr++; return *this; }
_ZNK9prevectorILj28EhjiE4dataEv:
  537|  2.49k|    const value_type* data() const {
  538|  2.49k|        return item_ptr(0);
  539|  2.49k|    }
_ZN9prevectorILj28EhjiED2Ev:
  474|   794k|    ~prevector() {
  475|   794k|        if (!is_direct()) {
  ------------------
  |  Branch (475:13): [True: 211k, False: 582k]
  ------------------
  476|   211k|            free(_union.indirect_contents.indirect);
  477|   211k|            _union.indirect_contents.indirect = nullptr;
  478|   211k|        }
  479|   794k|    }
_ZN9prevectorILj28EhjiEC2EOS0_:
  271|   521k|        : _union(std::move(other._union)), _size(other._size)
  272|   521k|    {
  273|   521k|        other._size = 0;
  274|   521k|    }
_ZN9prevectorILj28EhjiEC2Ev:
  243|   269k|    prevector() = default;
_ZN9prevectorILj28EhjiE8iteratorC2EPh:
   58|  3.50M|        iterator(T* ptr_) : ptr(ptr_) {}
_ZN9prevectorILj28EhjiE14const_iteratorC2EPKh:
  109|  5.79k|        const_iterator(const T* ptr_) : ptr(ptr_) {}
_ZN9prevectorILj28EhjiEC2ERKS0_:
  263|  2.89k|    prevector(const prevector<N, T, Size, Diff>& other) {
  264|  2.89k|        size_type n = other.size();
  265|  2.89k|        change_capacity(n);
  266|  2.89k|        _size += n;
  267|  2.89k|        fill(item_ptr(0), other.begin(),  other.end());
  268|  2.89k|    }
_ZN9prevectorILj28EhjiEaSEOS0_:
  284|  24.9k|    prevector& operator=(prevector<N, T, Size, Diff>&& other) noexcept {
  285|  24.9k|        if (!is_direct()) {
  ------------------
  |  Branch (285:13): [True: 0, False: 24.9k]
  ------------------
  286|      0|            free(_union.indirect_contents.indirect);
  287|      0|        }
  288|  24.9k|        _union = std::move(other._union);
  289|  24.9k|        _size = other._size;
  290|  24.9k|        other._size = 0;
  291|  24.9k|        return *this;
  292|  24.9k|    }
_ZN9prevectorILj28EhjiE6insertITkNSt3__114input_iteratorENS0_8iteratorEEEvS3_T_S4_:
  387|   226k|    void insert(iterator pos, InputIterator first, InputIterator last) {
  388|   226k|        size_type p = pos - begin();
  389|   226k|        difference_type count = last - first;
  390|   226k|        size_type new_size = size() + count;
  391|   226k|        if (capacity() < new_size) {
  ------------------
  |  Branch (391:13): [True: 205k, False: 20.4k]
  ------------------
  392|   205k|            change_capacity(new_size + (new_size >> 1));
  393|   205k|        }
  394|   226k|        T* ptr = item_ptr(p);
  395|   226k|        T* dst = ptr + count;
  396|   226k|        memmove(dst, ptr, (size() - p) * sizeof(T));
  397|   226k|        _size += count;
  398|   226k|        fill(ptr, first, last);
  399|   226k|    }
_ZN9prevectorILj28EhjiE4fillITkNSt3__114input_iteratorENS0_8iteratorEEEvPhT_S5_:
  214|   226k|    void fill(T* dst, InputIterator first, InputIterator last) {
  215|  2.01G|        while (first != last) {
  ------------------
  |  Branch (215:16): [True: 2.01G, False: 226k]
  ------------------
  216|  2.01G|            new(static_cast<void*>(dst)) T(*first);
  217|  2.01G|            ++dst;
  218|  2.01G|            ++first;
  219|  2.01G|        }
  220|   226k|    }
_ZNK9prevectorILj28EhjiE8iteratorneES1_:
   73|  2.01G|        bool operator!=(iterator x) const { return ptr != x.ptr; }
_ZN9prevectorILj28EhjiE8iteratorppEv:
   62|  2.01G|        iterator& operator++() { ptr++; return *this; }
_ZN9prevectorILj28EhjiEC2ITkNSt3__114input_iteratorENS2_11__wrap_iterIPhEEEET_S6_:
  256|     20|    prevector(InputIterator first, InputIterator last) {
  257|     20|        size_type n = last - first;
  258|     20|        change_capacity(n);
  259|     20|        _size += n;
  260|     20|        fill(item_ptr(0), first, last);
  261|     20|    }
_ZN9prevectorILj28EhjiE4fillITkNSt3__114input_iteratorENS2_11__wrap_iterIPhEEEEvS4_T_S6_:
  214|     20|    void fill(T* dst, InputIterator first, InputIterator last) {
  215|  1.30k|        while (first != last) {
  ------------------
  |  Branch (215:16): [True: 1.28k, False: 20]
  ------------------
  216|  1.28k|            new(static_cast<void*>(dst)) T(*first);
  217|  1.28k|            ++dst;
  218|  1.28k|            ++first;
  219|  1.28k|        }
  220|     20|    }

_ZNK11XOnlyPubKey12IsFullyValidEv:
  225|    609|{
  226|    609|    secp256k1_xonly_pubkey pubkey;
  227|    609|    return secp256k1_xonly_pubkey_parse(secp256k1_context_static, &pubkey, m_keydata.data());
  228|    609|}
_ZNK11XOnlyPubKey19ComputeTapTweakHashEPK7uint256:
  241|    608|{
  242|    608|    if (merkle_root == nullptr) {
  ------------------
  |  Branch (242:9): [True: 377, False: 231]
  ------------------
  243|       |        // We have no scripts. The actual tweak does not matter, but follow BIP341 here to
  244|       |        // allow for reproducible tweaking.
  245|    377|        return (HashWriter{HASHER_TAPTWEAK} << m_keydata).GetSHA256();
  246|    377|    } else {
  247|    231|        return (HashWriter{HASHER_TAPTWEAK} << m_keydata << *merkle_root).GetSHA256();
  248|    231|    }
  249|    608|}
_ZNK11XOnlyPubKey14CreateTapTweakEPK7uint256:
  260|    608|{
  261|    608|    secp256k1_xonly_pubkey base_point;
  262|    608|    if (!secp256k1_xonly_pubkey_parse(secp256k1_context_static, &base_point, data())) return std::nullopt;
  ------------------
  |  Branch (262:9): [True: 0, False: 608]
  ------------------
  263|    608|    secp256k1_pubkey out;
  264|    608|    uint256 tweak = ComputeTapTweakHash(merkle_root);
  265|    608|    if (!secp256k1_xonly_pubkey_tweak_add(secp256k1_context_static, &out, &base_point, tweak.data())) return std::nullopt;
  ------------------
  |  Branch (265:9): [True: 0, False: 608]
  ------------------
  266|    608|    int parity = -1;
  267|    608|    std::pair<XOnlyPubKey, bool> ret;
  268|    608|    secp256k1_xonly_pubkey out_xonly;
  269|    608|    if (!secp256k1_xonly_pubkey_from_pubkey(secp256k1_context_static, &out_xonly, &parity, &out)) return std::nullopt;
  ------------------
  |  Branch (269:9): [True: 0, False: 608]
  ------------------
  270|    608|    secp256k1_xonly_pubkey_serialize(secp256k1_context_static, ret.first.begin(), &out_xonly);
  271|    608|    assert(parity == 0 || parity == 1);
  272|    608|    ret.second = parity;
  273|    608|    return ret;
  274|    608|}
_ZNK7CPubKey12IsFullyValidEv:
  314|  22.3k|bool CPubKey::IsFullyValid() const {
  315|  22.3k|    if (!IsValid())
  ------------------
  |  Branch (315:9): [True: 5.70k, False: 16.6k]
  ------------------
  316|  5.70k|        return false;
  317|  16.6k|    secp256k1_pubkey pubkey;
  318|  16.6k|    return secp256k1_ec_pubkey_parse(secp256k1_context_static, &pubkey, vch, size());
  319|  22.3k|}

_ZN6CKeyIDC2ERK7uint160:
   27|  58.5k|    explicit CKeyID(const uint160& in) : uint160(in) {}
_ZN7CPubKey6GetLenEh:
   61|   194k|    {
   62|   194k|        if (chHeader == 2 || chHeader == 3)
  ------------------
  |  Branch (62:13): [True: 119k, False: 75.3k]
  |  Branch (62:30): [True: 57.2k, False: 18.0k]
  ------------------
   63|   176k|            return COMPRESSED_SIZE;
   64|  18.0k|        if (chHeader == 4 || chHeader == 6 || chHeader == 7)
  ------------------
  |  Branch (64:13): [True: 1.05k, False: 17.0k]
  |  Branch (64:30): [True: 22, False: 17.0k]
  |  Branch (64:47): [True: 13, False: 17.0k]
  ------------------
   65|  1.09k|            return SIZE;
   66|  17.0k|        return 0;
   67|  18.0k|    }
_ZN7CPubKey10InvalidateEv:
   71|  56.8k|    {
   72|  56.8k|        vch[0] = 0xFF;
   73|  56.8k|    }
_ZN7CPubKeyC2Ev:
   83|  51.1k|    {
   84|  51.1k|        Invalidate();
   85|  51.1k|    }
_ZN7CPubKeyC2E4SpanIKhE:
  107|  16.8k|    {
  108|  16.8k|        Set(_vch.begin(), _vch.end());
  109|  16.8k|    }
_ZNK7CPubKey4sizeEv:
  112|   172k|    unsigned int size() const { return GetLen(vch[0]); }
_ZNK7CPubKey4dataEv:
  113|  4.23k|    const unsigned char* data() const { return vch; }
_ZNK7CPubKey5beginEv:
  114|  2.85k|    const unsigned char* begin() const { return vch; }
_ZNK7CPubKey3endEv:
  115|  2.85k|    const unsigned char* end() const { return vch + size(); }
_ZltRK7CPubKeyS1_:
  129|  35.3k|    {
  130|  35.3k|        return a.vch[0] < b.vch[0] ||
  ------------------
  |  Branch (130:16): [True: 4.17k, False: 31.2k]
  ------------------
  131|  35.3k|               (a.vch[0] == b.vch[0] && memcmp(a.vch, b.vch, a.size()) < 0);
  ------------------
  |  Branch (131:17): [True: 27.9k, False: 3.32k]
  |  Branch (131:41): [True: 14.5k, False: 13.3k]
  ------------------
  132|  35.3k|    }
_ZNK7CPubKey5GetIDEv:
  165|  58.1k|    {
  166|  58.1k|        return CKeyID(Hash160(Span{vch}.first(size())));
  167|  58.1k|    }
_ZNK7CPubKey7IsValidEv:
  190|  39.4k|    {
  191|  39.4k|        return size() > 0;
  192|  39.4k|    }
_ZNK7CPubKey16IsValidNonHybridEv:
  196|  11.1k|    {
  197|  11.1k|        return size() > 0 && (vch[0] == 0x02 || vch[0] == 0x03 || vch[0] == 0x04);
  ------------------
  |  Branch (197:16): [True: 11.1k, False: 0]
  |  Branch (197:31): [True: 6.55k, False: 4.56k]
  |  Branch (197:49): [True: 4.37k, False: 195]
  |  Branch (197:67): [True: 193, False: 2]
  ------------------
  198|  11.1k|    }
_ZNK7CPubKey12IsCompressedEv:
  205|  7.28k|    {
  206|  7.28k|        return size() == COMPRESSED_SIZE;
  207|  7.28k|    }
_ZN11XOnlyPubKeyC2ENSt3__14spanIKhLm18446744073709551615EEE:
  257|  2.61k|    constexpr explicit XOnlyPubKey(std::span<const unsigned char> bytes) : m_keydata{bytes} {}
_ZN11XOnlyPubKeyC2ERK7CPubKey:
  260|  2.61k|    explicit XOnlyPubKey(const CPubKey& pubkey) : XOnlyPubKey(Span{pubkey}.subspan(1, 32)) {}
_ZN11XOnlyPubKey4sizeEv:
  293|    559|    static constexpr size_t size() { return decltype(m_keydata)::size(); }
_ZNK11XOnlyPubKey4dataEv:
  294|  1.16k|    const unsigned char* data() const { return m_keydata.begin(); }
_ZNK11XOnlyPubKey5beginEv:
  295|  2.06k|    const unsigned char* begin() const { return m_keydata.begin(); }
_ZNK11XOnlyPubKey3endEv:
  296|  2.06k|    const unsigned char* end() const { return m_keydata.end(); }
_ZN11XOnlyPubKey5beginEv:
  298|    608|    unsigned char* begin() { return m_keydata.begin(); }
_ZN7CPubKey3SetIPKhEEvT_S3_:
   90|  16.8k|    {
   91|  16.8k|        int len = pend == pbegin ? 0 : GetLen(pbegin[0]);
  ------------------
  |  Branch (91:19): [True: 0, False: 16.8k]
  ------------------
   92|  16.8k|        if (len && len == (pend - pbegin))
  ------------------
  |  Branch (92:13): [True: 11.4k, False: 5.33k]
  |  Branch (92:20): [True: 11.1k, False: 366]
  ------------------
   93|  11.1k|            memcpy(vch, (unsigned char*)&pbegin[0], len);
   94|  5.70k|        else
   95|  5.70k|            Invalidate();
   96|  16.8k|    }
_ZN11XOnlyPubKeyC2Ev:
  242|  3.04k|    XOnlyPubKey() = default;
_ZN7CPubKey3SetIPhEEvT_S2_:
   90|  5.58k|    {
   91|  5.58k|        int len = pend == pbegin ? 0 : GetLen(pbegin[0]);
  ------------------
  |  Branch (91:19): [True: 0, False: 5.58k]
  ------------------
   92|  5.58k|        if (len && len == (pend - pbegin))
  ------------------
  |  Branch (92:13): [True: 5.58k, False: 0]
  |  Branch (92:20): [True: 5.58k, False: 0]
  ------------------
   93|  5.58k|            memcpy(vch, (unsigned char*)&pbegin[0], len);
   94|      0|        else
   95|      0|            Invalidate();
   96|  5.58k|    }

_Z12JSONRPCErroriRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
   71|  85.0k|{
   72|  85.0k|    UniValue error(UniValue::VOBJ);
   73|  85.0k|    error.pushKV("code", code);
   74|  85.0k|    error.pushKV("message", message);
   75|  85.0k|    return error;
   76|  85.0k|}

_Z15AmountFromValueRK8UniValuei:
  102|  9.26k|{
  103|  9.26k|    if (!value.isNum() && !value.isStr())
  ------------------
  |  Branch (103:9): [True: 7.91k, False: 1.34k]
  |  Branch (103:27): [True: 397, False: 7.52k]
  ------------------
  104|    397|        throw JSONRPCError(RPC_TYPE_ERROR, "Amount is not a number or string");
  105|  8.86k|    CAmount amount;
  106|  8.86k|    if (!ParseFixedPoint(value.getValStr(), decimals, &amount))
  ------------------
  |  Branch (106:9): [True: 8.31k, False: 550]
  ------------------
  107|  8.31k|        throw JSONRPCError(RPC_TYPE_ERROR, "Invalid amount");
  108|    550|    if (!MoneyRange(amount))
  ------------------
  |  Branch (108:9): [True: 342, False: 208]
  ------------------
  109|    342|        throw JSONRPCError(RPC_TYPE_ERROR, "Amount out of range");
  110|    208|    return amount;
  111|    550|}
_Z10ParseHashVRK8UniValueNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  121|  37.0k|{
  122|  37.0k|    const std::string& strHex(v.get_str());
  123|  37.0k|    if (auto rv{uint256::FromHex(strHex)}) return *rv;
  ------------------
  |  Branch (123:14): [True: 30, False: 37.0k]
  ------------------
  124|  37.0k|    if (auto expected_len{uint256::size() * 2}; strHex.length() != expected_len) {
  ------------------
  |  Branch (124:49): [True: 15.0k, False: 22.0k]
  ------------------
  125|  15.0k|        throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("%s must be of length %d (not %d, for '%s')", name, expected_len, strHex.length(), strHex));
  ------------------
  |  | 1172|  15.0k|#define strprintf tfm::format
  ------------------
  126|  15.0k|    }
  127|  22.0k|    throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("%s must be hexadecimal string (not '%s')", name, strHex));
  ------------------
  |  | 1172|  22.0k|#define strprintf tfm::format
  ------------------
  128|  37.0k|}
_Z10ParseHashORK8UniValueNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  130|  18.5k|{
  131|  18.5k|    return ParseHashV(o.find_value(strKey), strKey);
  132|  18.5k|}
_Z9ParseHexVRK8UniValueNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  134|  37.0k|{
  135|  37.0k|    std::string strHex;
  136|  37.0k|    if (v.isStr())
  ------------------
  |  Branch (136:9): [True: 15.0k, False: 21.9k]
  ------------------
  137|  15.0k|        strHex = v.get_str();
  138|  37.0k|    if (!IsHex(strHex))
  ------------------
  |  Branch (138:9): [True: 36.9k, False: 101]
  ------------------
  139|  36.9k|        throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("%s must be hexadecimal string (not '%s')", name, strHex));
  ------------------
  |  | 1172|  36.9k|#define strprintf tfm::format
  ------------------
  140|    101|    return ParseHex(strHex);
  141|  37.0k|}
_Z9ParseHexORK8UniValueNSt3__117basic_string_viewIcNS2_11char_traitsIcEEEE:
  143|  18.5k|{
  144|  18.5k|    return ParseHexV(o.find_value(strKey), strKey);
  145|  18.5k|}
_Z18ParseSighashStringRK8UniValue:
  382|  7.52k|{
  383|  7.52k|    if (sighash.isNull()) {
  ------------------
  |  Branch (383:9): [True: 1, False: 7.52k]
  ------------------
  384|      1|        return SIGHASH_DEFAULT;
  385|      1|    }
  386|  7.52k|    const auto result{SighashFromStr(sighash.get_str())};
  387|  7.52k|    if (!result) {
  ------------------
  |  Branch (387:9): [True: 7.51k, False: 2]
  ------------------
  388|  7.51k|        throw JSONRPCError(RPC_INVALID_PARAMETER, util::ErrorString(result).original);
  389|  7.51k|    }
  390|      2|    return result.value();
  391|  7.52k|}
_Z18ParseConfirmTargetRK8UniValuej:
  394|  9.26k|{
  395|  9.26k|    const int target{value.getInt<int>()};
  396|  9.26k|    const unsigned int unsigned_target{static_cast<unsigned int>(target)};
  397|  9.26k|    if (target < 1 || unsigned_target > max_target) {
  ------------------
  |  Branch (397:9): [True: 9.09k, False: 171]
  |  Branch (397:23): [True: 0, False: 171]
  ------------------
  398|     92|        throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Invalid conf_target, must be between %u and %u", 1, max_target));
  ------------------
  |  | 1172|     92|#define strprintf tfm::format
  ------------------
  399|     92|    }
  400|  9.17k|    return unsigned_target;
  401|  9.26k|}
_Z20ParseDescriptorRangeRK8UniValue:
 1332|  9.26k|{
 1333|  9.26k|    int64_t low, high;
 1334|  9.26k|    std::tie(low, high) = ParseRange(value);
 1335|  9.26k|    if (low < 0) {
  ------------------
  |  Branch (1335:9): [True: 75, False: 9.18k]
  ------------------
 1336|     75|        throw JSONRPCError(RPC_INVALID_PARAMETER, "Range should be greater or equal than 0");
 1337|     75|    }
 1338|  9.18k|    if ((high >> 31) != 0) {
  ------------------
  |  Branch (1338:9): [True: 487, False: 8.70k]
  ------------------
 1339|    487|        throw JSONRPCError(RPC_INVALID_PARAMETER, "End of range is too high");
 1340|    487|    }
 1341|  8.70k|    if (high >= low + 1000000) {
  ------------------
  |  Branch (1341:9): [True: 103, False: 8.59k]
  ------------------
 1342|    103|        throw JSONRPCError(RPC_INVALID_PARAMETER, "Range is too large");
 1343|    103|    }
 1344|  8.59k|    return {low, high};
 1345|  8.70k|}
_Z28EvalDescriptorStringOrObjectRK8UniValueR19FlatSigningProviderb:
 1348|  9.11k|{
 1349|  9.11k|    std::string desc_str;
 1350|  9.11k|    std::pair<int64_t, int64_t> range = {0, 1000};
 1351|  9.11k|    if (scanobject.isStr()) {
  ------------------
  |  Branch (1351:9): [True: 7.45k, False: 1.66k]
  ------------------
 1352|  7.45k|        desc_str = scanobject.get_str();
 1353|  7.45k|    } else if (scanobject.isObject()) {
  ------------------
  |  Branch (1353:16): [True: 110, False: 1.55k]
  ------------------
 1354|    110|        const UniValue& desc_uni{scanobject.find_value("desc")};
 1355|    110|        if (desc_uni.isNull()) throw JSONRPCError(RPC_INVALID_PARAMETER, "Descriptor needs to be provided in scan object");
  ------------------
  |  Branch (1355:13): [True: 97, False: 13]
  ------------------
 1356|     13|        desc_str = desc_uni.get_str();
 1357|     13|        const UniValue& range_uni{scanobject.find_value("range")};
 1358|     13|        if (!range_uni.isNull()) {
  ------------------
  |  Branch (1358:13): [True: 0, False: 13]
  ------------------
 1359|      0|            range = ParseDescriptorRange(range_uni);
 1360|      0|        }
 1361|  1.55k|    } else {
 1362|  1.55k|        throw JSONRPCError(RPC_INVALID_PARAMETER, "Scan object needs to be either a string or an object");
 1363|  1.55k|    }
 1364|       |
 1365|  7.46k|    std::string error;
 1366|  7.46k|    auto descs = Parse(desc_str, provider, error);
 1367|  7.46k|    if (descs.empty()) {
  ------------------
  |  Branch (1367:9): [True: 6.25k, False: 1.21k]
  ------------------
 1368|  6.25k|        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, error);
 1369|  6.25k|    }
 1370|  1.21k|    if (!descs.at(0)->IsRange()) {
  ------------------
  |  Branch (1370:9): [True: 1.20k, False: 8]
  ------------------
 1371|  1.20k|        range.first = 0;
 1372|  1.20k|        range.second = 0;
 1373|  1.20k|    }
 1374|  1.21k|    std::vector<CScript> ret;
 1375|  2.41k|    for (int i = range.first; i <= range.second; ++i) {
  ------------------
  |  Branch (1375:31): [True: 1.20k, False: 1.21k]
  ------------------
 1376|  1.20k|        for (const auto& desc : descs) {
  ------------------
  |  Branch (1376:31): [True: 1.20k, False: 1.20k]
  ------------------
 1377|  1.20k|            std::vector<CScript> scripts;
 1378|  1.20k|            if (!desc->Expand(i, provider, scripts, provider)) {
  ------------------
  |  Branch (1378:17): [True: 0, False: 1.20k]
  ------------------
 1379|      0|                throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("Cannot derive script without private keys: '%s'", desc_str));
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
 1380|      0|            }
 1381|  1.20k|            if (expand_priv) {
  ------------------
  |  Branch (1381:17): [True: 0, False: 1.20k]
  ------------------
 1382|      0|                desc->ExpandPrivate(/*pos=*/i, provider, /*out=*/provider);
 1383|      0|            }
 1384|  1.20k|            std::move(scripts.begin(), scripts.end(), std::back_inserter(ret));
 1385|  1.20k|        }
 1386|  1.20k|    }
 1387|  1.21k|    return ret;
 1388|  1.21k|}
util.cpp:_ZL10ParseRangeRK8UniValue:
 1318|  9.26k|{
 1319|  9.26k|    if (value.isNum()) {
  ------------------
  |  Branch (1319:9): [True: 1.34k, False: 7.91k]
  ------------------
 1320|  1.34k|        return {0, value.getInt<int64_t>()};
 1321|  1.34k|    }
 1322|  7.91k|    if (value.isArray() && value.size() == 2 && value[0].isNum() && value[1].isNum()) {
  ------------------
  |  Branch (1322:9): [True: 250, False: 7.66k]
  |  Branch (1322:28): [True: 165, False: 85]
  |  Branch (1322:49): [True: 164, False: 1]
  |  Branch (1322:69): [True: 163, False: 1]
  ------------------
 1323|    163|        int64_t low = value[0].getInt<int64_t>();
 1324|    163|        int64_t high = value[1].getInt<int64_t>();
 1325|    163|        if (low > high) throw JSONRPCError(RPC_INVALID_PARAMETER, "Range specified as [begin,end] must not have begin after end");
  ------------------
  |  Branch (1325:13): [True: 66, False: 97]
  ------------------
 1326|     97|        return {low, high};
 1327|    163|    }
 1328|  7.75k|    throw JSONRPCError(RPC_INVALID_PARAMETER, "Range must be specified as end or as [begin,end]");
 1329|  7.91k|}

_Z13CheckChecksumR4SpanIKcEbRNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEPS9_:
 2325|  7.45k|{
 2326|  7.45k|    auto check_split = Split(sp, '#');
 2327|  7.45k|    if (check_split.size() > 2) {
  ------------------
  |  Branch (2327:9): [True: 14, False: 7.44k]
  ------------------
 2328|     14|        error = "Multiple '#' symbols";
 2329|     14|        return false;
 2330|     14|    }
 2331|  7.44k|    if (check_split.size() == 1 && require_checksum){
  ------------------
  |  Branch (2331:9): [True: 7.41k, False: 29]
  |  Branch (2331:36): [True: 0, False: 7.41k]
  ------------------
 2332|      0|        error = "Missing checksum";
 2333|      0|        return false;
 2334|      0|    }
 2335|  7.44k|    if (check_split.size() == 2) {
  ------------------
  |  Branch (2335:9): [True: 29, False: 7.41k]
  ------------------
 2336|     29|        if (check_split[1].size() != 8) {
  ------------------
  |  Branch (2336:13): [True: 10, False: 19]
  ------------------
 2337|     10|            error = strprintf("Expected 8 character checksum, not %u characters", check_split[1].size());
  ------------------
  |  | 1172|     10|#define strprintf tfm::format
  ------------------
 2338|     10|            return false;
 2339|     10|        }
 2340|     29|    }
 2341|  7.43k|    auto checksum = DescriptorChecksum(check_split[0]);
 2342|  7.43k|    if (checksum.empty()) {
  ------------------
  |  Branch (2342:9): [True: 30, False: 7.40k]
  ------------------
 2343|     30|        error = "Invalid characters in payload";
 2344|     30|        return false;
 2345|     30|    }
 2346|  7.40k|    if (check_split.size() == 2) {
  ------------------
  |  Branch (2346:9): [True: 19, False: 7.38k]
  ------------------
 2347|     19|        if (!std::equal(checksum.begin(), checksum.end(), check_split[1].begin())) {
  ------------------
  |  Branch (2347:13): [True: 18, False: 1]
  ------------------
 2348|     18|            error = strprintf("Provided checksum '%s' does not match computed checksum '%s'", std::string(check_split[1].begin(), check_split[1].end()), checksum);
  ------------------
  |  | 1172|     18|#define strprintf tfm::format
  ------------------
 2349|     18|            return false;
 2350|     18|        }
 2351|     19|    }
 2352|  7.38k|    if (out_checksum) *out_checksum = std::move(checksum);
  ------------------
  |  Branch (2352:9): [True: 0, False: 7.38k]
  ------------------
 2353|  7.38k|    sp = check_split[0];
 2354|  7.38k|    return true;
 2355|  7.40k|}
_Z5ParseRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEER19FlatSigningProviderRS5_b:
 2358|  7.45k|{
 2359|  7.45k|    Span<const char> sp{descriptor};
 2360|  7.45k|    if (!CheckChecksum(sp, require_checksum, error)) return {};
  ------------------
  |  Branch (2360:9): [True: 72, False: 7.38k]
  ------------------
 2361|  7.38k|    uint32_t key_exp_index = 0;
 2362|  7.38k|    auto ret = ParseScript(key_exp_index, sp, ParseScriptContext::TOP, out, error);
 2363|  7.38k|    if (sp.size() == 0 && !ret.empty()) {
  ------------------
  |  Branch (2363:9): [True: 6.96k, False: 416]
  |  Branch (2363:27): [True: 1.20k, False: 5.76k]
  ------------------
 2364|  1.20k|        std::vector<std::unique_ptr<Descriptor>> descs;
 2365|  1.20k|        descs.reserve(ret.size());
 2366|  1.20k|        for (auto& r : ret) {
  ------------------
  |  Branch (2366:22): [True: 1.20k, False: 1.20k]
  ------------------
 2367|  1.20k|            descs.emplace_back(std::unique_ptr<Descriptor>(std::move(r)));
 2368|  1.20k|        }
 2369|  1.20k|        return descs;
 2370|  1.20k|    }
 2371|  6.17k|    return {};
 2372|  7.38k|}
descriptor.cpp:_ZN12_GLOBAL__N_118DescriptorChecksumERK4SpanIKcE:
  106|  7.43k|{
  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|  7.43k|    static const std::string INPUT_CHARSET =
  121|  7.43k|        "0123456789()[],'/*abcdefgh@:$%{}"
  122|  7.43k|        "IJKLMNOPQRSTUVWXYZ&+-.;<=>?!^_|~"
  123|  7.43k|        "ijklmnopqrstuvwxyzABCDEFGH`#\"\\ ";
  124|       |
  125|       |    /** The character set for the checksum itself (same as bech32). */
  126|  7.43k|    static const std::string CHECKSUM_CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l";
  127|       |
  128|  7.43k|    uint64_t c = 1;
  129|  7.43k|    int cls = 0;
  130|  7.43k|    int clscount = 0;
  131|  3.91M|    for (auto ch : span) {
  ------------------
  |  Branch (131:18): [True: 3.91M, False: 7.40k]
  ------------------
  132|  3.91M|        auto pos = INPUT_CHARSET.find(ch);
  133|  3.91M|        if (pos == std::string::npos) return "";
  ------------------
  |  Branch (133:13): [True: 30, False: 3.91M]
  ------------------
  134|  3.91M|        c = PolyMod(c, pos & 31); // Emit a symbol for the position inside the group, for every character.
  135|  3.91M|        cls = cls * 3 + (pos >> 5); // Accumulate the group numbers
  136|  3.91M|        if (++clscount == 3) {
  ------------------
  |  Branch (136:13): [True: 1.30M, False: 2.61M]
  ------------------
  137|       |            // Emit an extra symbol representing the group numbers, for every 3 characters.
  138|  1.30M|            c = PolyMod(c, cls);
  139|  1.30M|            cls = 0;
  140|  1.30M|            clscount = 0;
  141|  1.30M|        }
  142|  3.91M|    }
  143|  7.40k|    if (clscount > 0) c = PolyMod(c, cls);
  ------------------
  |  Branch (143:9): [True: 5.13k, False: 2.26k]
  ------------------
  144|  66.6k|    for (int j = 0; j < 8; ++j) c = PolyMod(c, 0); // Shift further to determine the checksum.
  ------------------
  |  Branch (144:21): [True: 59.2k, False: 7.40k]
  ------------------
  145|  7.40k|    c ^= 1; // Prevent appending zeroes from not affecting the checksum.
  146|       |
  147|  7.40k|    std::string ret(8, ' ');
  148|  66.6k|    for (int j = 0; j < 8; ++j) ret[j] = CHECKSUM_CHARSET[(c >> (5 * (7 - j))) & 31];
  ------------------
  |  Branch (148:21): [True: 59.2k, False: 7.40k]
  ------------------
  149|  7.40k|    return ret;
  150|  7.43k|}
descriptor.cpp:_ZN12_GLOBAL__N_17PolyModEmi:
   94|  5.28M|{
   95|  5.28M|    uint8_t c0 = c >> 35;
   96|  5.28M|    c = ((c & 0x7ffffffff) << 5) ^ val;
   97|  5.28M|    if (c0 & 1) c ^= 0xf5dee51989;
  ------------------
  |  Branch (97:9): [True: 2.62M, False: 2.66M]
  ------------------
   98|  5.28M|    if (c0 & 2) c ^= 0xa9fdca3312;
  ------------------
  |  Branch (98:9): [True: 2.60M, False: 2.68M]
  ------------------
   99|  5.28M|    if (c0 & 4) c ^= 0x1bab10e32d;
  ------------------
  |  Branch (99:9): [True: 2.61M, False: 2.67M]
  ------------------
  100|  5.28M|    if (c0 & 8) c ^= 0x3706b1677a;
  ------------------
  |  Branch (100:9): [True: 2.60M, False: 2.67M]
  ------------------
  101|  5.28M|    if (c0 & 16) c ^= 0x644d626ffd;
  ------------------
  |  Branch (101:9): [True: 2.61M, False: 2.67M]
  ------------------
  102|  5.28M|    return c;
  103|  5.28M|}
descriptor.cpp:_ZN12_GLOBAL__N_111ParseScriptERjR4SpanIKcENS_18ParseScriptContextER19FlatSigningProviderRNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEE:
 1755|  13.1k|{
 1756|  13.1k|    using namespace script;
 1757|  13.1k|    Assume(ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH || ctx == ParseScriptContext::P2WSH || ctx == ParseScriptContext::P2TR);
  ------------------
  |  |   97|  54.6k|#define Assume(val) inline_assertion_check<false>(val, __FILE__, __LINE__, __func__, #val)
  |  |  ------------------
  |  |  |  Branch (97:51): [True: 7.38k, False: 5.76k]
  |  |  |  Branch (97:51): [True: 361, False: 5.40k]
  |  |  |  Branch (97:51): [True: 1.40k, False: 4.00k]
  |  |  |  Branch (97:51): [True: 4.00k, False: 0]
  |  |  ------------------
  ------------------
 1758|  13.1k|    std::vector<std::unique_ptr<DescriptorImpl>> ret;
 1759|  13.1k|    auto expr = Expr(sp);
 1760|  13.1k|    if (Func("pk", expr)) {
  ------------------
  |  Branch (1760:9): [True: 3.12k, False: 10.0k]
  ------------------
 1761|  3.12k|        auto pubkeys = ParsePubkey(key_exp_index, expr, ctx, out, error);
 1762|  3.12k|        if (pubkeys.empty()) {
  ------------------
  |  Branch (1762:13): [True: 296, False: 2.82k]
  ------------------
 1763|    296|            error = strprintf("pk(): %s", error);
  ------------------
  |  | 1172|    296|#define strprintf tfm::format
  ------------------
 1764|    296|            return {};
 1765|    296|        }
 1766|  2.82k|        ++key_exp_index;
 1767|  2.82k|        for (auto& pubkey : pubkeys) {
  ------------------
  |  Branch (1767:27): [True: 2.82k, False: 2.82k]
  ------------------
 1768|  2.82k|            ret.emplace_back(std::make_unique<PKDescriptor>(std::move(pubkey), ctx == ParseScriptContext::P2TR));
 1769|  2.82k|        }
 1770|  2.82k|        return ret;
 1771|  3.12k|    }
 1772|  10.0k|    if ((ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH || ctx == ParseScriptContext::P2WSH) && Func("pkh", expr)) {
  ------------------
  |  Branch (1772:9): [True: 20, False: 10.0k]
  |  Branch (1772:10): [True: 7.10k, False: 2.92k]
  |  Branch (1772:44): [True: 359, False: 2.56k]
  |  Branch (1772:79): [True: 1.38k, False: 1.18k]
  |  Branch (1772:116): [True: 20, False: 8.82k]
  ------------------
 1773|     20|        auto pubkeys = ParsePubkey(key_exp_index, expr, ctx, out, error);
 1774|     20|        if (pubkeys.empty()) {
  ------------------
  |  Branch (1774:13): [True: 10, False: 10]
  ------------------
 1775|     10|            error = strprintf("pkh(): %s", error);
  ------------------
  |  | 1172|     10|#define strprintf tfm::format
  ------------------
 1776|     10|            return {};
 1777|     10|        }
 1778|     10|        ++key_exp_index;
 1779|     10|        for (auto& pubkey : pubkeys) {
  ------------------
  |  Branch (1779:27): [True: 10, False: 10]
  ------------------
 1780|     10|            ret.emplace_back(std::make_unique<PKHDescriptor>(std::move(pubkey)));
 1781|     10|        }
 1782|     10|        return ret;
 1783|     20|    }
 1784|  10.0k|    if (ctx == ParseScriptContext::TOP && Func("combo", expr)) {
  ------------------
  |  Branch (1784:9): [True: 7.09k, False: 2.91k]
  |  Branch (1784:9): [True: 6, False: 9.99k]
  |  Branch (1784:43): [True: 6, False: 7.08k]
  ------------------
 1785|      6|        auto pubkeys = ParsePubkey(key_exp_index, expr, ctx, out, error);
 1786|      6|        if (pubkeys.empty()) {
  ------------------
  |  Branch (1786:13): [True: 3, False: 3]
  ------------------
 1787|      3|            error = strprintf("combo(): %s", error);
  ------------------
  |  | 1172|      3|#define strprintf tfm::format
  ------------------
 1788|      3|            return {};
 1789|      3|        }
 1790|      3|        ++key_exp_index;
 1791|      3|        for (auto& pubkey : pubkeys) {
  ------------------
  |  Branch (1791:27): [True: 3, False: 3]
  ------------------
 1792|      3|            ret.emplace_back(std::make_unique<ComboDescriptor>(std::move(pubkey)));
 1793|      3|        }
 1794|      3|        return ret;
 1795|  9.99k|    } else if (Func("combo", expr)) {
  ------------------
  |  Branch (1795:16): [True: 1, False: 9.99k]
  ------------------
 1796|      1|        error = "Can only have combo() at top level";
 1797|      1|        return {};
 1798|      1|    }
 1799|  9.99k|    const bool multi = Func("multi", expr);
 1800|  9.99k|    const bool sortedmulti = !multi && Func("sortedmulti", expr);
  ------------------
  |  Branch (1800:30): [True: 9.72k, False: 276]
  |  Branch (1800:40): [True: 177, False: 9.54k]
  ------------------
 1801|  9.99k|    const bool multi_a = !(multi || sortedmulti) && Func("multi_a", expr);
  ------------------
  |  Branch (1801:28): [True: 276, False: 9.72k]
  |  Branch (1801:37): [True: 177, False: 9.54k]
  |  Branch (1801:53): [True: 22, False: 9.52k]
  ------------------
 1802|  9.99k|    const bool sortedmulti_a = !(multi || sortedmulti || multi_a) && Func("sortedmulti_a", expr);
  ------------------
  |  Branch (1802:34): [True: 276, False: 9.72k]
  |  Branch (1802:43): [True: 177, False: 9.54k]
  |  Branch (1802:58): [True: 22, False: 9.52k]
  |  Branch (1802:70): [True: 3, False: 9.51k]
  ------------------
 1803|  9.99k|    if (((ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH || ctx == ParseScriptContext::P2WSH) && (multi || sortedmulti)) ||
  ------------------
  |  Branch (1803:11): [True: 7.08k, False: 2.91k]
  |  Branch (1803:45): [True: 356, False: 2.55k]
  |  Branch (1803:80): [True: 1.37k, False: 1.18k]
  |  Branch (1803:118): [True: 275, False: 8.54k]
  |  Branch (1803:127): [True: 176, False: 8.36k]
  ------------------
 1804|  9.99k|        (ctx == ParseScriptContext::P2TR && (multi_a || sortedmulti_a))) {
  ------------------
  |  Branch (1804:10): [True: 1.18k, False: 8.36k]
  |  Branch (1804:46): [True: 21, False: 1.16k]
  |  Branch (1804:57): [True: 2, False: 1.15k]
  ------------------
 1805|    474|        auto threshold = Expr(expr);
 1806|    474|        uint32_t thres;
 1807|    474|        std::vector<std::vector<std::unique_ptr<PubkeyProvider>>> providers; // List of multipath expanded pubkeys
 1808|    474|        if (!ParseUInt32(std::string(threshold.begin(), threshold.end()), &thres)) {
  ------------------
  |  Branch (1808:13): [True: 70, False: 404]
  ------------------
 1809|     70|            error = strprintf("Multi threshold '%s' is not valid", std::string(threshold.begin(), threshold.end()));
  ------------------
  |  | 1172|     70|#define strprintf tfm::format
  ------------------
 1810|     70|            return {};
 1811|     70|        }
 1812|    404|        size_t script_size = 0;
 1813|    404|        size_t max_providers_len = 0;
 1814|  5.26k|        while (expr.size()) {
  ------------------
  |  Branch (1814:16): [True: 4.96k, False: 303]
  ------------------
 1815|  4.96k|            if (!Const(",", expr)) {
  ------------------
  |  Branch (1815:17): [True: 1, False: 4.96k]
  ------------------
 1816|      1|                error = strprintf("Multi: expected ',', got '%c'", expr[0]);
  ------------------
  |  | 1172|      1|#define strprintf tfm::format
  ------------------
 1817|      1|                return {};
 1818|      1|            }
 1819|  4.96k|            auto arg = Expr(expr);
 1820|  4.96k|            auto pks = ParsePubkey(key_exp_index, arg, ctx, out, error);
 1821|  4.96k|            if (pks.empty()) {
  ------------------
  |  Branch (1821:17): [True: 100, False: 4.86k]
  ------------------
 1822|    100|                error = strprintf("Multi: %s", error);
  ------------------
  |  | 1172|    100|#define strprintf tfm::format
  ------------------
 1823|    100|                return {};
 1824|    100|            }
 1825|  4.86k|            script_size += pks.at(0)->GetSize() + 1;
 1826|  4.86k|            max_providers_len = std::max(max_providers_len, pks.size());
 1827|  4.86k|            providers.emplace_back(std::move(pks));
 1828|  4.86k|            key_exp_index++;
 1829|  4.86k|        }
 1830|    303|        if ((multi || sortedmulti) && (providers.empty() || providers.size() > MAX_PUBKEYS_PER_MULTISIG)) {
  ------------------
  |  Branch (1830:14): [True: 117, False: 186]
  |  Branch (1830:23): [True: 166, False: 20]
  |  Branch (1830:40): [True: 6, False: 277]
  |  Branch (1830:61): [True: 12, False: 265]
  ------------------
 1831|     18|            error = strprintf("Cannot have %u keys in multisig; must have between 1 and %d keys, inclusive", providers.size(), MAX_PUBKEYS_PER_MULTISIG);
  ------------------
  |  | 1172|     18|#define strprintf tfm::format
  ------------------
 1832|     18|            return {};
 1833|    285|        } else if ((multi_a || sortedmulti_a) && (providers.empty() || providers.size() > MAX_PUBKEYS_PER_MULTI_A)) {
  ------------------
  |  Branch (1833:21): [True: 19, False: 266]
  |  Branch (1833:32): [True: 1, False: 265]
  |  Branch (1833:51): [True: 2, False: 18]
  |  Branch (1833:72): [True: 0, False: 18]
  ------------------
 1834|      2|            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|      2|#define strprintf tfm::format
  ------------------
 1835|      2|            return {};
 1836|    283|        } else if (thres < 1) {
  ------------------
  |  Branch (1836:20): [True: 1, False: 282]
  ------------------
 1837|      1|            error = strprintf("Multisig threshold cannot be %d, must be at least 1", thres);
  ------------------
  |  | 1172|      1|#define strprintf tfm::format
  ------------------
 1838|      1|            return {};
 1839|    282|        } else if (thres > providers.size()) {
  ------------------
  |  Branch (1839:20): [True: 27, False: 255]
  ------------------
 1840|     27|            error = strprintf("Multisig threshold cannot be larger than the number of keys; threshold is %d but only %u keys specified", thres, providers.size());
  ------------------
  |  | 1172|     27|#define strprintf tfm::format
  ------------------
 1841|     27|            return {};
 1842|     27|        }
 1843|    255|        if (ctx == ParseScriptContext::TOP) {
  ------------------
  |  Branch (1843:13): [True: 53, False: 202]
  ------------------
 1844|     53|            if (providers.size() > 3) {
  ------------------
  |  Branch (1844:17): [True: 11, False: 42]
  ------------------
 1845|     11|                error = strprintf("Cannot have %u pubkeys in bare multisig; only at most 3 pubkeys", providers.size());
  ------------------
  |  | 1172|     11|#define strprintf tfm::format
  ------------------
 1846|     11|                return {};
 1847|     11|            }
 1848|     53|        }
 1849|    244|        if (ctx == ParseScriptContext::P2SH) {
  ------------------
  |  Branch (1849:13): [True: 151, False: 93]
  ------------------
 1850|       |            // This limits the maximum number of compressed pubkeys to 15.
 1851|    151|            if (script_size + 3 > MAX_SCRIPT_ELEMENT_SIZE) {
  ------------------
  |  Branch (1851:17): [True: 2, False: 149]
  ------------------
 1852|      2|                error = strprintf("P2SH script is too large, %d bytes is larger than %d bytes", script_size + 3, MAX_SCRIPT_ELEMENT_SIZE);
  ------------------
  |  | 1172|      2|#define strprintf tfm::format
  ------------------
 1853|      2|                return {};
 1854|      2|            }
 1855|    151|        }
 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|  1.53k|        for (auto& vec : providers) {
  ------------------
  |  Branch (1859:24): [True: 1.53k, False: 242]
  ------------------
 1860|  1.53k|            if (vec.size() == 1) {
  ------------------
  |  Branch (1860:17): [True: 1.53k, False: 0]
  ------------------
 1861|  1.53k|                for (size_t i = 1; i < max_providers_len; ++i) {
  ------------------
  |  Branch (1861:36): [True: 0, False: 1.53k]
  ------------------
 1862|      0|                    vec.emplace_back(vec.at(0)->Clone());
 1863|      0|                }
 1864|  1.53k|            } 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|  1.53k|        }
 1869|       |
 1870|       |        // Build the final descriptors vector
 1871|    484|        for (size_t i = 0; i < max_providers_len; ++i) {
  ------------------
  |  Branch (1871:28): [True: 242, False: 242]
  ------------------
 1872|       |            // Build final pubkeys vectors by retrieving the i'th subscript for each vector in subscripts
 1873|    242|            std::vector<std::unique_ptr<PubkeyProvider>> pubs;
 1874|    242|            pubs.reserve(providers.size());
 1875|  1.53k|            for (auto& pub : providers) {
  ------------------
  |  Branch (1875:28): [True: 1.53k, False: 242]
  ------------------
 1876|  1.53k|                pubs.emplace_back(std::move(pub.at(i)));
 1877|  1.53k|            }
 1878|    242|            if (multi || sortedmulti) {
  ------------------
  |  Branch (1878:17): [True: 61, False: 181]
  |  Branch (1878:26): [True: 163, False: 18]
  ------------------
 1879|    224|                ret.emplace_back(std::make_unique<MultisigDescriptor>(thres, std::move(pubs), sortedmulti));
 1880|    224|            } else {
 1881|     18|                ret.emplace_back(std::make_unique<MultiADescriptor>(thres, std::move(pubs), sortedmulti_a));
 1882|     18|            }
 1883|    242|        }
 1884|    242|        return ret;
 1885|  9.52k|    } else if (multi || sortedmulti) {
  ------------------
  |  Branch (1885:16): [True: 1, False: 9.52k]
  |  Branch (1885:25): [True: 1, False: 9.52k]
  ------------------
 1886|      2|        error = "Can only have multi/sortedmulti at top level, in sh(), or in wsh()";
 1887|      2|        return {};
 1888|  9.52k|    } else if (multi_a || sortedmulti_a) {
  ------------------
  |  Branch (1888:16): [True: 1, False: 9.51k]
  |  Branch (1888:27): [True: 1, False: 9.51k]
  ------------------
 1889|      2|        error = "Can only have multi_a/sortedmulti_a inside tr()";
 1890|      2|        return {};
 1891|      2|    }
 1892|  9.51k|    if ((ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH) && Func("wpkh", expr)) {
  ------------------
  |  Branch (1892:9): [True: 8, False: 9.51k]
  |  Branch (1892:10): [True: 6.85k, False: 2.66k]
  |  Branch (1892:44): [True: 187, False: 2.47k]
  |  Branch (1892:80): [True: 8, False: 7.03k]
  ------------------
 1893|      8|        auto pubkeys = ParsePubkey(key_exp_index, expr, ParseScriptContext::P2WPKH, out, error);
 1894|      8|        if (pubkeys.empty()) {
  ------------------
  |  Branch (1894:13): [True: 5, False: 3]
  ------------------
 1895|      5|            error = strprintf("wpkh(): %s", error);
  ------------------
  |  | 1172|      5|#define strprintf tfm::format
  ------------------
 1896|      5|            return {};
 1897|      5|        }
 1898|      3|        key_exp_index++;
 1899|      3|        for (auto& pubkey : pubkeys) {
  ------------------
  |  Branch (1899:27): [True: 3, False: 3]
  ------------------
 1900|      3|            ret.emplace_back(std::make_unique<WPKHDescriptor>(std::move(pubkey)));
 1901|      3|        }
 1902|      3|        return ret;
 1903|  9.51k|    } else if (Func("wpkh", expr)) {
  ------------------
  |  Branch (1903:16): [True: 1, False: 9.50k]
  ------------------
 1904|      1|        error = "Can only have wpkh() at top level or inside sh()";
 1905|      1|        return {};
 1906|      1|    }
 1907|  9.50k|    if (ctx == ParseScriptContext::TOP && Func("sh", expr)) {
  ------------------
  |  Branch (1907:9): [True: 6.84k, False: 2.66k]
  |  Branch (1907:9): [True: 361, False: 9.14k]
  |  Branch (1907:43): [True: 361, False: 6.48k]
  ------------------
 1908|    361|        auto descs = ParseScript(key_exp_index, expr, ParseScriptContext::P2SH, out, error);
 1909|    361|        if (descs.empty() || expr.size()) return {};
  ------------------
  |  Branch (1909:13): [True: 91, False: 270]
  |  Branch (1909:30): [True: 4, False: 266]
  ------------------
 1910|    266|        std::vector<std::unique_ptr<DescriptorImpl>> ret;
 1911|    266|        ret.reserve(descs.size());
 1912|    266|        for (auto& desc : descs) {
  ------------------
  |  Branch (1912:25): [True: 266, False: 266]
  ------------------
 1913|    266|            ret.push_back(std::make_unique<SHDescriptor>(std::move(desc)));
 1914|    266|        }
 1915|    266|        return ret;
 1916|  9.14k|    } else if (Func("sh", expr)) {
  ------------------
  |  Branch (1916:16): [True: 1, False: 9.14k]
  ------------------
 1917|      1|        error = "Can only have sh() at top level";
 1918|      1|        return {};
 1919|      1|    }
 1920|  9.14k|    if ((ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH) && Func("wsh", expr)) {
  ------------------
  |  Branch (1920:9): [True: 1.40k, False: 7.74k]
  |  Branch (1920:10): [True: 6.48k, False: 2.66k]
  |  Branch (1920:44): [True: 185, False: 2.47k]
  |  Branch (1920:80): [True: 1.40k, False: 5.27k]
  ------------------
 1921|  1.40k|        auto descs = ParseScript(key_exp_index, expr, ParseScriptContext::P2WSH, out, error);
 1922|  1.40k|        if (descs.empty() || expr.size()) return {};
  ------------------
  |  Branch (1922:13): [True: 1.01k, False: 387]
  |  Branch (1922:30): [True: 14, False: 373]
  ------------------
 1923|    373|        for (auto& desc : descs) {
  ------------------
  |  Branch (1923:25): [True: 373, False: 373]
  ------------------
 1924|    373|            ret.emplace_back(std::make_unique<WSHDescriptor>(std::move(desc)));
 1925|    373|        }
 1926|    373|        return ret;
 1927|  7.74k|    } else if (Func("wsh", expr)) {
  ------------------
  |  Branch (1927:16): [True: 1, False: 7.74k]
  ------------------
 1928|      1|        error = "Can only have wsh() at top level or inside sh()";
 1929|      1|        return {};
 1930|      1|    }
 1931|  7.74k|    if (ctx == ParseScriptContext::TOP && Func("addr", expr)) {
  ------------------
  |  Branch (1931:9): [True: 5.22k, False: 2.51k]
  |  Branch (1931:9): [True: 417, False: 7.32k]
  |  Branch (1931:43): [True: 417, False: 4.80k]
  ------------------
 1932|    417|        CTxDestination dest = DecodeDestination(std::string(expr.begin(), expr.end()));
 1933|    417|        if (!IsValidDestination(dest)) {
  ------------------
  |  Branch (1933:13): [True: 417, False: 0]
  ------------------
 1934|    417|            error = "Address is not valid";
 1935|    417|            return {};
 1936|    417|        }
 1937|      0|        ret.emplace_back(std::make_unique<AddressDescriptor>(std::move(dest)));
 1938|      0|        return ret;
 1939|  7.32k|    } else if (Func("addr", expr)) {
  ------------------
  |  Branch (1939:16): [True: 1, False: 7.32k]
  ------------------
 1940|      1|        error = "Can only have addr() at top level";
 1941|      1|        return {};
 1942|      1|    }
 1943|  7.32k|    if (ctx == ParseScriptContext::TOP && Func("tr", expr)) {
  ------------------
  |  Branch (1943:9): [True: 4.80k, False: 2.51k]
  |  Branch (1943:9): [True: 1.21k, False: 6.11k]
  |  Branch (1943:43): [True: 1.21k, False: 3.59k]
  ------------------
 1944|  1.21k|        auto arg = Expr(expr);
 1945|  1.21k|        auto internal_keys = ParsePubkey(key_exp_index, arg, ParseScriptContext::P2TR, out, error);
 1946|  1.21k|        if (internal_keys.empty()) {
  ------------------
  |  Branch (1946:13): [True: 366, False: 844]
  ------------------
 1947|    366|            error = strprintf("tr(): %s", error);
  ------------------
  |  | 1172|    366|#define strprintf tfm::format
  ------------------
 1948|    366|            return {};
 1949|    366|        }
 1950|    844|        size_t max_providers_len = internal_keys.size();
 1951|    844|        ++key_exp_index;
 1952|    844|        std::vector<std::vector<std::unique_ptr<DescriptorImpl>>> subscripts; //!< list of multipath expanded script subexpressions
 1953|    844|        std::vector<int> depths; //!< depth in the tree of each subexpression (same length subscripts)
 1954|    844|        if (expr.size()) {
  ------------------
  |  Branch (1954:13): [True: 466, False: 378]
  ------------------
 1955|    466|            if (!Const(",", expr)) {
  ------------------
  |  Branch (1955:17): [True: 2, False: 464]
  ------------------
 1956|      2|                error = strprintf("tr: expected ',', got '%c'", expr[0]);
  ------------------
  |  | 1172|      2|#define strprintf tfm::format
  ------------------
 1957|      2|                return {};
 1958|      2|            }
 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|    464|            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|  4.00k|            do {
 1966|       |                // First process all open braces.
 1967|  9.07k|                while (Const("{", expr)) {
  ------------------
  |  Branch (1967:24): [True: 5.07k, False: 4.00k]
  ------------------
 1968|  5.07k|                    branches.push_back(false); // new left branch
 1969|  5.07k|                    if (branches.size() > TAPROOT_CONTROL_MAX_NODE_COUNT) {
  ------------------
  |  Branch (1969:25): [True: 5, False: 5.06k]
  ------------------
 1970|      5|                        error = strprintf("tr() supports at most %i nesting levels", TAPROOT_CONTROL_MAX_NODE_COUNT);
  ------------------
  |  | 1172|      5|#define strprintf tfm::format
  ------------------
 1971|      5|                        return {};
 1972|      5|                    }
 1973|  5.07k|                }
 1974|       |                // Process the actual script expression.
 1975|  4.00k|                auto sarg = Expr(expr);
 1976|  4.00k|                subscripts.emplace_back(ParseScript(key_exp_index, sarg, ParseScriptContext::P2TR, out, error));
 1977|  4.00k|                if (subscripts.back().empty()) return {};
  ------------------
  |  Branch (1977:21): [True: 203, False: 3.79k]
  ------------------
 1978|  3.79k|                max_providers_len = std::max(max_providers_len, subscripts.back().size());
 1979|  3.79k|                depths.push_back(branches.size());
 1980|       |                // Process closing braces; one is expected for every right branch we were in.
 1981|  4.96k|                while (branches.size() && branches.back()) {
  ------------------
  |  Branch (1981:24): [True: 4.72k, False: 234]
  |  Branch (1981:24): [True: 1.17k, False: 3.78k]
  |  Branch (1981:43): [True: 1.17k, False: 3.55k]
  ------------------
 1982|  1.17k|                    if (!Const("}", expr)) {
  ------------------
  |  Branch (1982:25): [True: 11, False: 1.16k]
  ------------------
 1983|     11|                        error = strprintf("tr(): expected '}' after script expression");
  ------------------
  |  | 1172|     11|#define strprintf tfm::format
  ------------------
 1984|     11|                        return {};
 1985|     11|                    }
 1986|  1.16k|                    branches.pop_back(); // move up one level after encountering '}'
 1987|  1.16k|                }
 1988|       |                // If after that, we're at the end of a left branch, expect a comma.
 1989|  3.78k|                if (branches.size() && !branches.back()) {
  ------------------
  |  Branch (1989:21): [True: 3.55k, False: 234]
  |  Branch (1989:21): [True: 3.55k, False: 234]
  |  Branch (1989:40): [True: 3.55k, False: 0]
  ------------------
 1990|  3.55k|                    if (!Const(",", expr)) {
  ------------------
  |  Branch (1990:25): [True: 11, False: 3.54k]
  ------------------
 1991|     11|                        error = strprintf("tr(): expected ',' after script expression");
  ------------------
  |  | 1172|     11|#define strprintf tfm::format
  ------------------
 1992|     11|                        return {};
 1993|     11|                    }
 1994|  3.54k|                    branches.back() = true; // And now we're in a right branch.
 1995|  3.54k|                }
 1996|  3.78k|            } while (branches.size());
  ------------------
  |  Branch (1996:22): [True: 3.54k, False: 234]
  ------------------
 1997|       |            // After we've explored a whole tree, we must be at the end of the expression.
 1998|    234|            if (expr.size()) {
  ------------------
  |  Branch (1998:17): [True: 1, False: 233]
  ------------------
 1999|      1|                error = strprintf("tr(): expected ')' after script expression");
  ------------------
  |  | 1172|      1|#define strprintf tfm::format
  ------------------
 2000|      1|                return {};
 2001|      1|            }
 2002|    234|        }
 2003|    611|        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|  1.22k|        for (auto& vec : subscripts) {
  ------------------
  |  Branch (2007:24): [True: 1.22k, False: 611]
  ------------------
 2008|  1.22k|            if (vec.size() == 1) {
  ------------------
  |  Branch (2008:17): [True: 1.22k, False: 0]
  ------------------
 2009|  1.22k|                for (size_t i = 1; i < max_providers_len; ++i) {
  ------------------
  |  Branch (2009:36): [True: 0, False: 1.22k]
  ------------------
 2010|      0|                    vec.emplace_back(vec.at(0)->Clone());
 2011|      0|                }
 2012|  1.22k|            } 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|  1.22k|        }
 2017|       |
 2018|    611|        if (internal_keys.size() > 1 && internal_keys.size() != max_providers_len) {
  ------------------
  |  Branch (2018:13): [True: 0, False: 611]
  |  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|    611|        while (internal_keys.size() < max_providers_len) {
  ------------------
  |  Branch (2023:16): [True: 0, False: 611]
  ------------------
 2024|      0|            internal_keys.emplace_back(internal_keys.at(0)->Clone());
 2025|      0|        }
 2026|       |
 2027|       |        // Build the final descriptors vector
 2028|  1.22k|        for (size_t i = 0; i < max_providers_len; ++i) {
  ------------------
  |  Branch (2028:28): [True: 611, False: 611]
  ------------------
 2029|       |            // Build final subscripts vectors by retrieving the i'th subscript for each vector in subscripts
 2030|    611|            std::vector<std::unique_ptr<DescriptorImpl>> this_subs;
 2031|    611|            this_subs.reserve(subscripts.size());
 2032|  1.22k|            for (auto& subs : subscripts) {
  ------------------
  |  Branch (2032:29): [True: 1.22k, False: 611]
  ------------------
 2033|  1.22k|                this_subs.emplace_back(std::move(subs.at(i)));
 2034|  1.22k|            }
 2035|    611|            ret.emplace_back(std::make_unique<TRDescriptor>(std::move(internal_keys.at(i)), std::move(this_subs), depths));
 2036|    611|        }
 2037|    611|        return ret;
 2038|       |
 2039|       |
 2040|  6.11k|    } else if (Func("tr", expr)) {
  ------------------
  |  Branch (2040:16): [True: 1, False: 6.11k]
  ------------------
 2041|      1|        error = "Can only have tr at top level";
 2042|      1|        return {};
 2043|      1|    }
 2044|  6.11k|    if (ctx == ParseScriptContext::TOP && Func("rawtr", expr)) {
  ------------------
  |  Branch (2044:9): [True: 3.59k, False: 2.51k]
  |  Branch (2044:9): [True: 8, False: 6.10k]
  |  Branch (2044:43): [True: 8, False: 3.59k]
  ------------------
 2045|      8|        auto arg = Expr(expr);
 2046|      8|        if (expr.size()) {
  ------------------
  |  Branch (2046:13): [True: 4, False: 4]
  ------------------
 2047|      4|            error = strprintf("rawtr(): only one key expected.");
  ------------------
  |  | 1172|      4|#define strprintf tfm::format
  ------------------
 2048|      4|            return {};
 2049|      4|        }
 2050|      4|        auto output_keys = ParsePubkey(key_exp_index, arg, ParseScriptContext::P2TR, out, error);
 2051|      4|        if (output_keys.empty()) {
  ------------------
  |  Branch (2051:13): [True: 3, False: 1]
  ------------------
 2052|      3|            error = strprintf("rawtr(): %s", error);
  ------------------
  |  | 1172|      3|#define strprintf tfm::format
  ------------------
 2053|      3|            return {};
 2054|      3|        }
 2055|      1|        ++key_exp_index;
 2056|      1|        for (auto& pubkey : output_keys) {
  ------------------
  |  Branch (2056:27): [True: 1, False: 1]
  ------------------
 2057|      1|            ret.emplace_back(std::make_unique<RawTRDescriptor>(std::move(pubkey)));
 2058|      1|        }
 2059|      1|        return ret;
 2060|  6.10k|    } else if (Func("rawtr", expr)) {
  ------------------
  |  Branch (2060:16): [True: 1, False: 6.10k]
  ------------------
 2061|      1|        error = "Can only have rawtr at top level";
 2062|      1|        return {};
 2063|      1|    }
 2064|  6.10k|    if (ctx == ParseScriptContext::TOP && Func("raw", expr)) {
  ------------------
  |  Branch (2064:9): [True: 3.59k, False: 2.51k]
  |  Branch (2064:9): [True: 29, False: 6.07k]
  |  Branch (2064:43): [True: 29, False: 3.56k]
  ------------------
 2065|     29|        std::string str(expr.begin(), expr.end());
 2066|     29|        if (!IsHex(str)) {
  ------------------
  |  Branch (2066:13): [True: 9, False: 20]
  ------------------
 2067|      9|            error = "Raw script is not hex";
 2068|      9|            return {};
 2069|      9|        }
 2070|     20|        auto bytes = ParseHex(str);
 2071|     20|        ret.emplace_back(std::make_unique<RawDescriptor>(CScript(bytes.begin(), bytes.end())));
 2072|     20|        return ret;
 2073|  6.07k|    } else if (Func("raw", expr)) {
  ------------------
  |  Branch (2073:16): [True: 1, False: 6.07k]
  ------------------
 2074|      1|        error = "Can only have raw() at top level";
 2075|      1|        return {};
 2076|      1|    }
 2077|       |    // Process miniscript expressions.
 2078|  6.07k|    {
 2079|  6.07k|        const auto script_ctx{ctx == ParseScriptContext::P2WSH ? miniscript::MiniscriptContext::P2WSH : miniscript::MiniscriptContext::TAPSCRIPT};
  ------------------
  |  Branch (2079:31): [True: 1.31k, False: 4.75k]
  ------------------
 2080|  6.07k|        KeyParser parser(/*out = */&out, /* in = */nullptr, /* ctx = */script_ctx, key_exp_index);
 2081|  6.07k|        auto node = miniscript::FromString(std::string(expr.begin(), expr.end()), parser);
 2082|  6.07k|        if (parser.m_key_parsing_error != "") {
  ------------------
  |  Branch (2082:13): [True: 182, False: 5.89k]
  ------------------
 2083|    182|            error = std::move(parser.m_key_parsing_error);
 2084|    182|            return {};
 2085|    182|        }
 2086|  5.89k|        if (node) {
  ------------------
  |  Branch (2086:13): [True: 3.51k, False: 2.37k]
  ------------------
 2087|  3.51k|            if (ctx != ParseScriptContext::P2WSH && ctx != ParseScriptContext::P2TR) {
  ------------------
  |  Branch (2087:17): [True: 2.53k, False: 978]
  |  Branch (2087:53): [True: 1.49k, False: 1.04k]
  ------------------
 2088|  1.49k|                error = "Miniscript expressions can only be used in wsh or tr.";
 2089|  1.49k|                return {};
 2090|  1.49k|            }
 2091|  2.02k|            if (!node->IsSane() || node->IsNotSatisfiable()) {
  ------------------
  |  Branch (2091:17): [True: 648, False: 1.37k]
  |  Branch (2091:36): [True: 64, False: 1.31k]
  ------------------
 2092|       |                // Try to find the first insane sub for better error reporting.
 2093|    712|                auto insane_node = node.get();
 2094|    712|                if (const auto sub = node->FindInsaneSub()) insane_node = sub;
  ------------------
  |  Branch (2094:32): [True: 568, False: 144]
  ------------------
 2095|    712|                if (const auto str = insane_node->ToString(parser)) error = *str;
  ------------------
  |  Branch (2095:32): [True: 712, False: 0]
  ------------------
 2096|    712|                if (!insane_node->IsValid()) {
  ------------------
  |  Branch (2096:21): [True: 432, False: 280]
  ------------------
 2097|    432|                    error += " is invalid";
 2098|    432|                } else if (!node->IsSane()) {
  ------------------
  |  Branch (2098:28): [True: 216, False: 64]
  ------------------
 2099|    216|                    error += " is not sane";
 2100|    216|                    if (!insane_node->IsNonMalleable()) {
  ------------------
  |  Branch (2100:25): [True: 52, False: 164]
  ------------------
 2101|     52|                        error += ": malleable witnesses exist";
 2102|    164|                    } else if (insane_node == node.get() && !insane_node->NeedsSignature()) {
  ------------------
  |  Branch (2102:32): [True: 84, False: 80]
  |  Branch (2102:61): [True: 61, False: 23]
  ------------------
 2103|     61|                        error += ": witnesses without signature exist";
 2104|    103|                    } else if (!insane_node->CheckTimeLocksMix()) {
  ------------------
  |  Branch (2104:32): [True: 7, False: 96]
  ------------------
 2105|      7|                        error += ": contains mixes of timelocks expressed in blocks and seconds";
 2106|     96|                    } else if (!insane_node->CheckDuplicateKey()) {
  ------------------
  |  Branch (2106:32): [True: 62, False: 34]
  ------------------
 2107|     62|                        error += ": contains duplicate public keys";
 2108|     62|                    } else if (!insane_node->ValidSatisfactions()) {
  ------------------
  |  Branch (2108:32): [True: 11, False: 23]
  ------------------
 2109|     11|                        error += ": needs witnesses that may exceed resource limits";
 2110|     11|                    }
 2111|    216|                } else {
 2112|     64|                    error += " is not satisfiable";
 2113|     64|                }
 2114|    712|                return {};
 2115|    712|            }
 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|  1.31k|            CHECK_NONFATAL(!parser.m_keys.empty());
  ------------------
  |  |   82|  1.31k|    inline_check_non_fatal(condition, __FILE__, __LINE__, __func__, #condition)
  ------------------
 2119|  1.31k|            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|  1.31k|            size_t num_multipath = std::max_element(parser.m_keys.begin(), parser.m_keys.end(),
 2123|  1.31k|                    [](const std::vector<std::unique_ptr<PubkeyProvider>>& a, const std::vector<std::unique_ptr<PubkeyProvider>>& b) {
 2124|  1.31k|                        return a.size() < b.size();
 2125|  1.31k|                    })->size();
 2126|       |
 2127|  2.90k|            for (auto& vec : parser.m_keys) {
  ------------------
  |  Branch (2127:28): [True: 2.90k, False: 1.31k]
  ------------------
 2128|  2.90k|                if (vec.size() == 1) {
  ------------------
  |  Branch (2128:21): [True: 2.90k, False: 0]
  ------------------
 2129|  2.90k|                    for (size_t i = 1; i < num_multipath; ++i) {
  ------------------
  |  Branch (2129:40): [True: 0, False: 2.90k]
  ------------------
 2130|      0|                        vec.emplace_back(vec.at(0)->Clone());
 2131|      0|                    }
 2132|  2.90k|                } 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|  2.90k|            }
 2137|       |
 2138|       |            // Build the final descriptors vector
 2139|  2.62k|            for (size_t i = 0; i < num_multipath; ++i) {
  ------------------
  |  Branch (2139:32): [True: 1.31k, False: 1.31k]
  ------------------
 2140|       |                // Build final pubkeys vectors by retrieving the i'th subscript for each vector in subscripts
 2141|  1.31k|                std::vector<std::unique_ptr<PubkeyProvider>> pubs;
 2142|  1.31k|                pubs.reserve(parser.m_keys.size());
 2143|  2.90k|                for (auto& pub : parser.m_keys) {
  ------------------
  |  Branch (2143:32): [True: 2.90k, False: 1.31k]
  ------------------
 2144|  2.90k|                    pubs.emplace_back(std::move(pub.at(i)));
 2145|  2.90k|                }
 2146|  1.31k|                ret.emplace_back(std::make_unique<MiniscriptDescriptor>(std::move(pubs), node->Clone()));
 2147|  1.31k|            }
 2148|  1.31k|            return ret;
 2149|  1.31k|        }
 2150|  5.89k|    }
 2151|  2.37k|    if (ctx == ParseScriptContext::P2SH) {
  ------------------
  |  Branch (2151:9): [True: 29, False: 2.35k]
  ------------------
 2152|     29|        error = "A function is needed within P2SH";
 2153|     29|        return {};
 2154|  2.35k|    } else if (ctx == ParseScriptContext::P2WSH) {
  ------------------
  |  Branch (2154:16): [True: 262, False: 2.08k]
  ------------------
 2155|    262|        error = "A function is needed within P2WSH";
 2156|    262|        return {};
 2157|    262|    }
 2158|  2.08k|    error = strprintf("'%s' is not a valid descriptor function", std::string(expr.begin(), expr.end()));
  ------------------
  |  | 1172|  2.08k|#define strprintf tfm::format
  ------------------
 2159|  2.08k|    return {};
 2160|  2.37k|}
descriptor.cpp:_ZN12_GLOBAL__N_111ParsePubkeyEjRK4SpanIKcENS_18ParseScriptContextER19FlatSigningProviderRNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEE:
 1582|  17.3k|{
 1583|  17.3k|    std::vector<std::unique_ptr<PubkeyProvider>> ret;
 1584|  17.3k|    auto origin_split = Split(sp, ']');
 1585|  17.3k|    if (origin_split.size() > 2) {
  ------------------
  |  Branch (1585:9): [True: 4, False: 17.3k]
  ------------------
 1586|      4|        error = "Multiple ']' characters found for a single pubkey";
 1587|      4|        return {};
 1588|      4|    }
 1589|       |    // This is set if either the origin or path suffix contains a hardened derivation.
 1590|  17.3k|    bool apostrophe = false;
 1591|  17.3k|    if (origin_split.size() == 1) {
  ------------------
  |  Branch (1591:9): [True: 15.0k, False: 2.36k]
  ------------------
 1592|  15.0k|        return ParsePubkeyInner(key_exp_index, origin_split[0], ctx, out, apostrophe, error);
 1593|  15.0k|    }
 1594|  2.36k|    if (origin_split[0].empty() || origin_split[0][0] != '[') {
  ------------------
  |  Branch (1594:9): [True: 9, False: 2.35k]
  |  Branch (1594:36): [True: 9, False: 2.34k]
  ------------------
 1595|     18|        error = strprintf("Key origin start '[ character expected but not found, got '%c' instead",
  ------------------
  |  | 1172|     18|#define strprintf tfm::format
  ------------------
 1596|     18|                          origin_split[0].empty() ? /** empty, implies split char */ ']' : origin_split[0][0]);
  ------------------
  |  Branch (1596:27): [True: 9, False: 9]
  ------------------
 1597|     18|        return {};
 1598|     18|    }
 1599|  2.34k|    auto slash_split = Split(origin_split[0].subspan(1), '/');
 1600|  2.34k|    if (slash_split[0].size() != 8) {
  ------------------
  |  Branch (1600:9): [True: 12, False: 2.33k]
  ------------------
 1601|     12|        error = strprintf("Fingerprint is not 4 bytes (%u characters instead of 8 characters)", slash_split[0].size());
  ------------------
  |  | 1172|     12|#define strprintf tfm::format
  ------------------
 1602|     12|        return {};
 1603|     12|    }
 1604|  2.33k|    std::string fpr_hex = std::string(slash_split[0].begin(), slash_split[0].end());
 1605|  2.33k|    if (!IsHex(fpr_hex)) {
  ------------------
  |  Branch (1605:9): [True: 2, False: 2.32k]
  ------------------
 1606|      2|        error = strprintf("Fingerprint '%s' is not hex", fpr_hex);
  ------------------
  |  | 1172|      2|#define strprintf tfm::format
  ------------------
 1607|      2|        return {};
 1608|      2|    }
 1609|  2.32k|    auto fpr_bytes = ParseHex(fpr_hex);
 1610|  2.32k|    KeyOriginInfo info;
 1611|  2.32k|    static_assert(sizeof(info.fingerprint) == 4, "Fingerprint must be 4 bytes");
 1612|  2.32k|    assert(fpr_bytes.size() == 4);
 1613|  2.32k|    std::copy(fpr_bytes.begin(), fpr_bytes.end(), info.fingerprint);
 1614|  2.32k|    std::vector<KeyPath> path;
 1615|  2.32k|    if (!ParseKeyPath(slash_split, path, apostrophe, error, /*allow_multipath=*/false)) return {};
  ------------------
  |  Branch (1615:9): [True: 181, False: 2.14k]
  ------------------
 1616|  2.14k|    info.path = path.at(0);
 1617|  2.14k|    auto providers = ParsePubkeyInner(key_exp_index, origin_split[1], ctx, out, apostrophe, error);
 1618|  2.14k|    if (providers.empty()) return {};
  ------------------
  |  Branch (1618:9): [True: 106, False: 2.04k]
  ------------------
 1619|  2.04k|    ret.reserve(providers.size());
 1620|  2.04k|    for (auto& prov : providers) {
  ------------------
  |  Branch (1620:21): [True: 2.04k, False: 2.04k]
  ------------------
 1621|  2.04k|        ret.emplace_back(std::make_unique<OriginPubkeyProvider>(key_exp_index, info, std::move(prov), apostrophe));
 1622|  2.04k|    }
 1623|  2.04k|    return ret;
 1624|  2.14k|}
descriptor.cpp:_ZN12_GLOBAL__N_116ParsePubkeyInnerEjRK4SpanIKcENS_18ParseScriptContextER19FlatSigningProviderRbRNSt3__112basic_stringIcNS9_11char_traitsIcEENS9_9allocatorIcEEEE:
 1503|  17.1k|{
 1504|  17.1k|    std::vector<std::unique_ptr<PubkeyProvider>> ret;
 1505|  17.1k|    bool permit_uncompressed = ctx == ParseScriptContext::TOP || ctx == ParseScriptContext::P2SH;
  ------------------
  |  Branch (1505:32): [True: 2.89k, False: 14.2k]
  |  Branch (1505:66): [True: 967, False: 13.3k]
  ------------------
 1506|  17.1k|    auto split = Split(sp, '/');
 1507|  17.1k|    std::string str(split[0].begin(), split[0].end());
 1508|  17.1k|    if (str.size() == 0) {
  ------------------
  |  Branch (1508:9): [True: 71, False: 17.0k]
  ------------------
 1509|     71|        error = "No key provided";
 1510|     71|        return {};
 1511|     71|    }
 1512|  17.0k|    if (split.size() == 1) {
  ------------------
  |  Branch (1512:9): [True: 17.0k, False: 30]
  ------------------
 1513|  17.0k|        if (IsHex(str)) {
  ------------------
  |  Branch (1513:13): [True: 16.8k, False: 240]
  ------------------
 1514|  16.8k|            std::vector<unsigned char> data = ParseHex(str);
 1515|  16.8k|            CPubKey pubkey(data);
 1516|  16.8k|            if (pubkey.IsValid() && !pubkey.IsValidNonHybrid()) {
  ------------------
  |  Branch (1516:17): [True: 11.1k, False: 5.70k]
  |  Branch (1516:37): [True: 2, False: 11.1k]
  ------------------
 1517|      2|                error = "Hybrid public keys are not allowed";
 1518|      2|                return {};
 1519|      2|            }
 1520|  16.8k|            if (pubkey.IsFullyValid()) {
  ------------------
  |  Branch (1520:17): [True: 10.9k, False: 5.89k]
  ------------------
 1521|  10.9k|                if (permit_uncompressed || pubkey.IsCompressed()) {
  ------------------
  |  Branch (1521:21): [True: 3.64k, False: 7.27k]
  |  Branch (1521:44): [True: 7.27k, False: 0]
  ------------------
 1522|  10.9k|                    ret.emplace_back(std::make_unique<ConstPubkeyProvider>(key_exp_index, pubkey, false));
 1523|  10.9k|                    return ret;
 1524|  10.9k|                } else {
 1525|      0|                    error = "Uncompressed keys are not allowed";
 1526|      0|                    return {};
 1527|      0|                }
 1528|  10.9k|            } else if (data.size() == 32 && ctx == ParseScriptContext::P2TR) {
  ------------------
  |  Branch (1528:24): [True: 5.58k, False: 309]
  |  Branch (1528:45): [True: 5.58k, False: 1]
  ------------------
 1529|  5.58k|                unsigned char fullkey[33] = {0x02};
 1530|  5.58k|                std::copy(data.begin(), data.end(), fullkey + 1);
 1531|  5.58k|                pubkey.Set(std::begin(fullkey), std::end(fullkey));
 1532|  5.58k|                if (pubkey.IsFullyValid()) {
  ------------------
  |  Branch (1532:21): [True: 5.49k, False: 95]
  ------------------
 1533|  5.49k|                    ret.emplace_back(std::make_unique<ConstPubkeyProvider>(key_exp_index, pubkey, true));
 1534|  5.49k|                    return ret;
 1535|  5.49k|                }
 1536|  5.58k|            }
 1537|    405|            error = strprintf("Pubkey '%s' is invalid", str);
  ------------------
  |  | 1172|    405|#define strprintf tfm::format
  ------------------
 1538|    405|            return {};
 1539|  16.8k|        }
 1540|    240|        CKey key = DecodeSecret(str);
 1541|    240|        if (key.IsValid()) {
  ------------------
  |  Branch (1541:13): [True: 0, False: 240]
  ------------------
 1542|      0|            if (permit_uncompressed || key.IsCompressed()) {
  ------------------
  |  Branch (1542:17): [True: 0, False: 0]
  |  Branch (1542:40): [True: 0, False: 0]
  ------------------
 1543|      0|                CPubKey pubkey = key.GetPubKey();
 1544|      0|                out.keys.emplace(pubkey.GetID(), key);
 1545|      0|                ret.emplace_back(std::make_unique<ConstPubkeyProvider>(key_exp_index, pubkey, ctx == ParseScriptContext::P2TR));
 1546|      0|                return ret;
 1547|      0|            } else {
 1548|      0|                error = "Uncompressed keys are not allowed";
 1549|      0|                return {};
 1550|      0|            }
 1551|      0|        }
 1552|    240|    }
 1553|    270|    CExtKey extkey = DecodeExtKey(str);
 1554|    270|    CExtPubKey extpubkey = DecodeExtPubKey(str);
 1555|    270|    if (!extkey.key.IsValid() && !extpubkey.pubkey.IsValid()) {
  ------------------
  |  Branch (1555:9): [True: 270, False: 0]
  |  Branch (1555:34): [True: 270, False: 0]
  ------------------
 1556|    270|        error = strprintf("key '%s' is not valid", str);
  ------------------
  |  | 1172|    270|#define strprintf tfm::format
  ------------------
 1557|    270|        return {};
 1558|    270|    }
 1559|      0|    std::vector<KeyPath> paths;
 1560|      0|    DeriveType type = DeriveType::NO;
 1561|      0|    if (std::ranges::equal(split.back(), Span{"*"}.first(1))) {
  ------------------
  |  Branch (1561:9): [True: 0, False: 0]
  ------------------
 1562|      0|        split.pop_back();
 1563|      0|        type = DeriveType::UNHARDENED;
 1564|      0|    } else if (std::ranges::equal(split.back(), Span{"*'"}.first(2)) || std::ranges::equal(split.back(), Span{"*h"}.first(2))) {
  ------------------
  |  Branch (1564:16): [True: 0, False: 0]
  |  Branch (1564:16): [True: 0, False: 0]
  |  Branch (1564:73): [True: 0, False: 0]
  ------------------
 1565|      0|        apostrophe = std::ranges::equal(split.back(), Span{"*'"}.first(2));
 1566|      0|        split.pop_back();
 1567|      0|        type = DeriveType::HARDENED;
 1568|      0|    }
 1569|      0|    if (!ParseKeyPath(split, paths, apostrophe, error, /*allow_multipath=*/true)) return {};
  ------------------
  |  Branch (1569:9): [True: 0, False: 0]
  ------------------
 1570|      0|    if (extkey.key.IsValid()) {
  ------------------
  |  Branch (1570:9): [True: 0, False: 0]
  ------------------
 1571|      0|        extpubkey = extkey.Neuter();
 1572|      0|        out.keys.emplace(extpubkey.pubkey.GetID(), extkey.key);
 1573|      0|    }
 1574|      0|    for (auto& path : paths) {
  ------------------
  |  Branch (1574:21): [True: 0, False: 0]
  ------------------
 1575|      0|        ret.emplace_back(std::make_unique<BIP32PubkeyProvider>(key_exp_index, extpubkey, std::move(path), type, apostrophe));
 1576|      0|    }
 1577|      0|    return ret;
 1578|      0|}
descriptor.cpp:_ZN12_GLOBAL__N_119ConstPubkeyProviderC2EjRK7CPubKeyb:
  300|  16.4k|    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|  18.4k|    explicit PubkeyProvider(uint32_t exp_index) : m_expr_index(exp_index) {}
descriptor.cpp:_ZN12_GLOBAL__N_114PubkeyProviderD2Ev:
  171|  18.4k|    virtual ~PubkeyProvider() = default;
descriptor.cpp:_ZNK12_GLOBAL__N_119ConstPubkeyProvider9GetPubKeyEiRK15SigningProviderR7CPubKeyR13KeyOriginInfoPK15DescriptorCachePS8_:
  302|  50.8k|    {
  303|  50.8k|        key = m_pubkey;
  304|  50.8k|        info.path.clear();
  305|  50.8k|        CKeyID keyid = m_pubkey.GetID();
  306|  50.8k|        std::copy(keyid.begin(), keyid.begin() + sizeof(info.fingerprint), info.fingerprint);
  307|  50.8k|        return true;
  308|  50.8k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_119ConstPubkeyProvider7IsRangeEv:
  309|  5.05k|    bool IsRange() const override { return false; }
descriptor.cpp:_ZNK12_GLOBAL__N_119ConstPubkeyProvider7GetSizeEv:
  310|  4.86k|    size_t GetSize() const override { return m_pubkey.size(); }
descriptor.cpp:_ZNK12_GLOBAL__N_119ConstPubkeyProvider8ToStringENS_14PubkeyProvider10StringTypeE:
  311|  1.61k|    std::string ToString(StringType type) const override { return m_xonly ? HexStr(m_pubkey).substr(2) : HexStr(m_pubkey); }
  ------------------
  |  Branch (311:67): [True: 182, False: 1.43k]
  ------------------
descriptor.cpp:_ZN12_GLOBAL__N_112ParseKeyPathERKNSt3__16vectorI4SpanIKcENS0_9allocatorIS4_EEEERNS1_INS1_IjNS5_IjEEEENS5_ISB_EEEERbRNS0_12basic_stringIcNS0_11char_traitsIcEENS5_IcEEEEb:
 1441|  2.32k|{
 1442|  2.32k|    KeyPath path;
 1443|  2.32k|    std::optional<size_t> multipath_segment_index;
 1444|  2.32k|    std::vector<uint32_t> multipath_values;
 1445|  2.32k|    std::unordered_set<uint32_t> seen_multipath;
 1446|       |
 1447|  34.4k|    for (size_t i = 1; i < split.size(); ++i) {
  ------------------
  |  Branch (1447:24): [True: 32.3k, False: 2.14k]
  ------------------
 1448|  32.3k|        const Span<const char>& elem = split[i];
 1449|       |
 1450|       |        // Check if element contain multipath specifier
 1451|  32.3k|        if (!elem.empty() && elem.front() == '<' && elem.back() == '>') {
  ------------------
  |  Branch (1451:13): [True: 32.3k, False: 10]
  |  Branch (1451:30): [True: 58, False: 32.2k]
  |  Branch (1451:53): [True: 40, False: 18]
  ------------------
 1452|     40|            if (!allow_multipath) {
  ------------------
  |  Branch (1452:17): [True: 40, False: 0]
  ------------------
 1453|     40|                error = strprintf("Key path value '%s' specifies multipath in a section where multipath is not allowed", std::string(elem.begin(), elem.end()));
  ------------------
  |  | 1172|     40|#define strprintf tfm::format
  ------------------
 1454|     40|                return false;
 1455|     40|            }
 1456|      0|            if (multipath_segment_index) {
  ------------------
  |  Branch (1456:17): [True: 0, False: 0]
  ------------------
 1457|      0|                error = "Multiple multipath key path specifiers found";
 1458|      0|                return false;
 1459|      0|            }
 1460|       |
 1461|       |            // Parse each possible value
 1462|      0|            std::vector<Span<const char>> nums = Split(Span(elem.begin()+1, elem.end()-1), ";");
 1463|      0|            if (nums.size() < 2) {
  ------------------
  |  Branch (1463:17): [True: 0, False: 0]
  ------------------
 1464|      0|                error = "Multipath key path specifiers must have at least two items";
 1465|      0|                return false;
 1466|      0|            }
 1467|       |
 1468|      0|            for (const auto& num : nums) {
  ------------------
  |  Branch (1468:34): [True: 0, False: 0]
  ------------------
 1469|      0|                const auto& op_num = ParseKeyPathNum(num, apostrophe, error);
 1470|      0|                if (!op_num) return false;
  ------------------
  |  Branch (1470:21): [True: 0, False: 0]
  ------------------
 1471|      0|                auto [_, inserted] = seen_multipath.insert(*op_num);
 1472|      0|                if (!inserted) {
  ------------------
  |  Branch (1472:21): [True: 0, False: 0]
  ------------------
 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|      0|                multipath_values.emplace_back(*op_num);
 1477|      0|            }
 1478|       |
 1479|      0|            path.emplace_back(); // Placeholder for multipath segment
 1480|      0|            multipath_segment_index = path.size()-1;
 1481|  32.2k|        } else {
 1482|  32.2k|            const auto& op_num = ParseKeyPathNum(elem, apostrophe, error);
 1483|  32.2k|            if (!op_num) return false;
  ------------------
  |  Branch (1483:17): [True: 141, False: 32.1k]
  ------------------
 1484|  32.1k|            path.emplace_back(*op_num);
 1485|  32.1k|        }
 1486|  32.3k|    }
 1487|       |
 1488|  2.14k|    if (!multipath_segment_index) {
  ------------------
  |  Branch (1488:9): [True: 2.14k, False: 0]
  ------------------
 1489|  2.14k|        out.emplace_back(std::move(path));
 1490|  2.14k|    } 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|  2.14k|    return true;
 1499|  2.32k|}
descriptor.cpp:_ZN12_GLOBAL__N_115ParseKeyPathNumE4SpanIKcERbRNSt3__112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEE:
 1408|  32.2k|{
 1409|  32.2k|    bool hardened = false;
 1410|  32.2k|    if (elem.size() > 0) {
  ------------------
  |  Branch (1410:9): [True: 32.2k, False: 10]
  ------------------
 1411|  32.2k|        const char last = elem[elem.size() - 1];
 1412|  32.2k|        if (last == '\'' || last == 'h') {
  ------------------
  |  Branch (1412:13): [True: 278, False: 32.0k]
  |  Branch (1412:29): [True: 600, False: 31.4k]
  ------------------
 1413|    878|            elem = elem.first(elem.size() - 1);
 1414|    878|            hardened = true;
 1415|    878|            apostrophe = last == '\'';
 1416|    878|        }
 1417|  32.2k|    }
 1418|  32.2k|    uint32_t p;
 1419|  32.2k|    if (!ParseUInt32(std::string(elem.begin(), elem.end()), &p)) {
  ------------------
  |  Branch (1419:9): [True: 112, False: 32.1k]
  ------------------
 1420|    112|        error = strprintf("Key path value '%s' is not a valid uint32", std::string(elem.begin(), elem.end()));
  ------------------
  |  | 1172|    112|#define strprintf tfm::format
  ------------------
 1421|    112|        return std::nullopt;
 1422|  32.1k|    } else if (p > 0x7FFFFFFFUL) {
  ------------------
  |  Branch (1422:16): [True: 29, False: 32.1k]
  ------------------
 1423|     29|        error = strprintf("Key path value %u is out of range", p);
  ------------------
  |  | 1172|     29|#define strprintf tfm::format
  ------------------
 1424|     29|        return std::nullopt;
 1425|     29|    }
 1426|       |
 1427|  32.1k|    return std::make_optional<uint32_t>(p | (((uint32_t)hardened) << 31));
 1428|  32.2k|}
descriptor.cpp:_ZN12_GLOBAL__N_120OriginPubkeyProviderC2Ej13KeyOriginInfoNSt3__110unique_ptrINS_14PubkeyProviderENS2_14default_deleteIS4_EEEEb:
  242|  2.04k|    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|  3.60k|    {
  245|  3.60k|        if (!m_provider->GetPubKey(pos, arg, key, info, read_cache, write_cache)) return false;
  ------------------
  |  Branch (245:13): [True: 0, False: 3.60k]
  ------------------
  246|  3.60k|        std::copy(std::begin(m_origin.fingerprint), std::end(m_origin.fingerprint), info.fingerprint);
  247|  3.60k|        info.path.insert(info.path.begin(), m_origin.path.begin(), m_origin.path.end());
  248|  3.60k|        return true;
  249|  3.60k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_120OriginPubkeyProvider7IsRangeEv:
  250|    254|    bool IsRange() const override { return m_provider->IsRange(); }
descriptor.cpp:_ZNK12_GLOBAL__N_120OriginPubkeyProvider7GetSizeEv:
  251|  1.21k|    size_t GetSize() const override { return m_provider->GetSize(); }
descriptor.cpp:_ZNK12_GLOBAL__N_120OriginPubkeyProvider8ToStringENS_14PubkeyProvider10StringTypeE:
  252|    429|    std::string ToString(StringType type) const override { return "[" + OriginString(type) + "]" + m_provider->ToString(type); }
descriptor.cpp:_ZNK12_GLOBAL__N_120OriginPubkeyProvider12OriginStringENS_14PubkeyProvider10StringTypeEb:
  235|    429|    {
  236|       |        // If StringType==COMPAT, always use the apostrophe to stay compatible with previous versions
  237|    429|        bool use_apostrophe = (!normalized && m_apostrophe) || type == StringType::COMPAT;
  ------------------
  |  Branch (237:32): [True: 429, False: 0]
  |  Branch (237:47): [True: 52, False: 377]
  |  Branch (237:64): [True: 0, False: 377]
  ------------------
  238|    429|        return HexStr(m_origin.fingerprint) + FormatHDKeypath(m_origin.path, use_apostrophe);
  239|    429|    }
descriptor.cpp:_ZN12_GLOBAL__N_112PKDescriptorC2ENSt3__110unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS3_EEEEb:
  856|  2.82k|    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|  4.42k|    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_114DescriptorImpl7IsRangeEv:
  624|  3.06k|    {
  625|  5.05k|        for (const auto& pubkey : m_pubkey_args) {
  ------------------
  |  Branch (625:33): [True: 5.05k, False: 3.06k]
  ------------------
  626|  5.05k|            if (pubkey->IsRange()) return true;
  ------------------
  |  Branch (626:17): [True: 0, False: 5.05k]
  ------------------
  627|  5.05k|        }
  628|  3.06k|        for (const auto& arg : m_subdescriptor_args) {
  ------------------
  |  Branch (628:30): [True: 1.85k, False: 3.06k]
  ------------------
  629|  1.85k|            if (arg->IsRange()) return true;
  ------------------
  |  Branch (629:17): [True: 0, False: 1.85k]
  ------------------
  630|  1.85k|        }
  631|  3.06k|        return false;
  632|  3.06k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl6ExpandEiRK15SigningProviderRNSt3__16vectorI7CScriptNS4_9allocatorIS6_EEEER19FlatSigningProviderP15DescriptorCache:
  733|  1.20k|    {
  734|  1.20k|        return ExpandHelper(pos, provider, nullptr, output_scripts, out, write_cache);
  735|  1.20k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114DescriptorImpl12ExpandHelperEiRK15SigningProviderPK15DescriptorCacheRNSt3__16vectorI7CScriptNS7_9allocatorIS9_EEEER19FlatSigningProviderPS4_:
  702|  3.06k|    {
  703|  3.06k|        std::vector<std::pair<CPubKey, KeyOriginInfo>> entries;
  704|  3.06k|        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|  5.05k|        for (const auto& p : m_pubkey_args) {
  ------------------
  |  Branch (707:28): [True: 5.05k, False: 3.06k]
  ------------------
  708|  5.05k|            entries.emplace_back();
  709|  5.05k|            if (!p->GetPubKey(pos, arg, entries.back().first, entries.back().second, read_cache, write_cache)) return false;
  ------------------
  |  Branch (709:17): [True: 0, False: 5.05k]
  ------------------
  710|  5.05k|        }
  711|  3.06k|        std::vector<CScript> subscripts;
  712|  3.06k|        FlatSigningProvider subprovider;
  713|  3.06k|        for (const auto& subarg : m_subdescriptor_args) {
  ------------------
  |  Branch (713:33): [True: 1.85k, False: 3.06k]
  ------------------
  714|  1.85k|            std::vector<CScript> outscripts;
  715|  1.85k|            if (!subarg->ExpandHelper(pos, arg, read_cache, outscripts, subprovider, write_cache)) return false;
  ------------------
  |  Branch (715:17): [True: 0, False: 1.85k]
  ------------------
  716|  1.85k|            assert(outscripts.size() == 1);
  717|  1.85k|            subscripts.emplace_back(std::move(outscripts[0]));
  718|  1.85k|        }
  719|  3.06k|        out.Merge(std::move(subprovider));
  720|       |
  721|  3.06k|        std::vector<CPubKey> pubkeys;
  722|  3.06k|        pubkeys.reserve(entries.size());
  723|  5.05k|        for (auto& entry : entries) {
  ------------------
  |  Branch (723:26): [True: 5.05k, False: 3.06k]
  ------------------
  724|  5.05k|            pubkeys.push_back(entry.first);
  725|  5.05k|            out.origins.emplace(entry.first.GetID(), std::make_pair<CPubKey, KeyOriginInfo>(CPubKey(entry.first), std::move(entry.second)));
  726|  5.05k|        }
  727|       |
  728|  3.06k|        output_scripts = MakeScripts(pubkeys, Span{subscripts}, out);
  729|  3.06k|        return true;
  730|  3.06k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_112PKDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
  847|    981|    {
  848|    981|        if (m_xonly) {
  ------------------
  |  Branch (848:13): [True: 949, False: 32]
  ------------------
  849|    949|            CScript script = CScript() << ToByteVector(XOnlyPubKey(keys[0])) << OP_CHECKSIG;
  850|    949|            return Vector(std::move(script));
  851|    949|        } else {
  852|     32|            return Vector(GetScriptForRawPubKey(keys[0]));
  853|     32|        }
  854|    981|    }
descriptor.cpp:_ZN12_GLOBAL__N_113PKHDescriptorC2ENSt3__110unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS3_EEEE:
  891|     10|    PKHDescriptor(std::unique_ptr<PubkeyProvider> prov) : DescriptorImpl(Vector(std::move(prov)), "pkh") {}
descriptor.cpp:_ZNK12_GLOBAL__N_113PKHDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
  885|      6|    {
  886|      6|        CKeyID id = keys[0].GetID();
  887|      6|        out.pubkeys.emplace(id, keys[0]);
  888|      6|        return Vector(GetScriptForDestination(PKHash(id)));
  889|      6|    }
descriptor.cpp:_ZN12_GLOBAL__N_115ComboDescriptorC2ENSt3__110unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS3_EEEE:
  968|      3|    ComboDescriptor(std::unique_ptr<PubkeyProvider> prov) : DescriptorImpl(Vector(std::move(prov)), "combo") {}
descriptor.cpp:_ZNK12_GLOBAL__N_115ComboDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
  953|      2|    {
  954|      2|        std::vector<CScript> ret;
  955|      2|        CKeyID id = keys[0].GetID();
  956|      2|        out.pubkeys.emplace(id, keys[0]);
  957|      2|        ret.emplace_back(GetScriptForRawPubKey(keys[0])); // P2PK
  958|      2|        ret.emplace_back(GetScriptForDestination(PKHash(id))); // P2PKH
  959|      2|        if (keys[0].IsCompressed()) {
  ------------------
  |  Branch (959:13): [True: 2, False: 0]
  ------------------
  960|      2|            CScript p2wpkh = GetScriptForDestination(WitnessV0KeyHash(id));
  961|      2|            out.scripts.emplace(CScriptID(p2wpkh), p2wpkh);
  962|      2|            ret.emplace_back(p2wpkh);
  963|      2|            ret.emplace_back(GetScriptForDestination(ScriptHash(p2wpkh))); // P2SH-P2WPKH
  964|      2|        }
  965|      2|        return ret;
  966|      2|    }
descriptor.cpp:_ZN12_GLOBAL__N_118MultisigDescriptorC2EiNSt3__16vectorINS1_10unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS4_EEEENS1_9allocatorIS7_EEEEb:
  992|    224|    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: 163, False: 61]
  ------------------
descriptor.cpp:_ZNK12_GLOBAL__N_118MultisigDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
  983|    222|    std::vector<CScript> MakeScripts(const std::vector<CPubKey>& keys, Span<const CScript>, FlatSigningProvider&) const override {
  984|    222|        if (m_sorted) {
  ------------------
  |  Branch (984:13): [True: 163, False: 59]
  ------------------
  985|    163|            std::vector<CPubKey> sorted_keys(keys);
  986|    163|            std::sort(sorted_keys.begin(), sorted_keys.end());
  987|    163|            return Vector(GetScriptForMultisig(m_threshold, sorted_keys));
  988|    163|        }
  989|     59|        return Vector(GetScriptForMultisig(m_threshold, keys));
  990|    222|    }
descriptor.cpp:_ZN12_GLOBAL__N_116MultiADescriptorC2EiNSt3__16vectorINS1_10unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS4_EEEENS1_9allocatorIS7_EEEEb:
 1043|     18|    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: 0, False: 18]
  ------------------
descriptor.cpp:_ZNK12_GLOBAL__N_116MultiADescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
 1029|     13|    std::vector<CScript> MakeScripts(const std::vector<CPubKey>& keys, Span<const CScript>, FlatSigningProvider&) const override {
 1030|     13|        CScript ret;
 1031|     13|        std::vector<XOnlyPubKey> xkeys;
 1032|     13|        xkeys.reserve(keys.size());
 1033|    131|        for (const auto& key : keys) xkeys.emplace_back(key);
  ------------------
  |  Branch (1033:30): [True: 131, False: 13]
  ------------------
 1034|     13|        if (m_sorted) std::sort(xkeys.begin(), xkeys.end());
  ------------------
  |  Branch (1034:13): [True: 0, False: 13]
  ------------------
 1035|     13|        ret << ToByteVector(xkeys[0]) << OP_CHECKSIG;
 1036|    131|        for (size_t i = 1; i < keys.size(); ++i) {
  ------------------
  |  Branch (1036:28): [True: 118, False: 13]
  ------------------
 1037|    118|            ret << ToByteVector(xkeys[i]) << OP_CHECKSIGADD;
 1038|    118|        }
 1039|     13|        ret << m_threshold << OP_NUMEQUAL;
 1040|     13|        return Vector(std::move(ret));
 1041|     13|    }
descriptor.cpp:_ZN12_GLOBAL__N_114WPKHDescriptorC2ENSt3__110unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS3_EEEE:
  925|      3|    WPKHDescriptor(std::unique_ptr<PubkeyProvider> prov) : DescriptorImpl(Vector(std::move(prov)), "wpkh") {}
descriptor.cpp:_ZNK12_GLOBAL__N_114WPKHDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
  919|      2|    {
  920|      2|        CKeyID id = keys[0].GetID();
  921|      2|        out.pubkeys.emplace(id, keys[0]);
  922|      2|        return Vector(GetScriptForDestination(WitnessV0KeyHash(id)));
  923|      2|    }
descriptor.cpp:_ZN12_GLOBAL__N_112SHDescriptorC2ENSt3__110unique_ptrINS_14DescriptorImplENS1_14default_deleteIS3_EEEE:
 1082|    266|    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|    639|    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_112SHDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
 1073|    266|    {
 1074|    266|        auto ret = Vector(GetScriptForDestination(ScriptHash(scripts[0])));
 1075|    266|        if (ret.size()) out.scripts.emplace(CScriptID(scripts[0]), scripts[0]);
  ------------------
  |  Branch (1075:13): [True: 266, False: 0]
  ------------------
 1076|    266|        return ret;
 1077|    266|    }
descriptor.cpp:_ZN12_GLOBAL__N_113WSHDescriptorC2ENSt3__110unique_ptrINS_14DescriptorImplENS1_14default_deleteIS3_EEEE:
 1129|    373|    WSHDescriptor(std::unique_ptr<DescriptorImpl> desc) : DescriptorImpl({}, std::move(desc), "wsh") {}
descriptor.cpp:_ZNK12_GLOBAL__N_113WSHDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
 1123|    369|    {
 1124|    369|        auto ret = Vector(GetScriptForDestination(WitnessV0ScriptHash(scripts[0])));
 1125|    369|        if (ret.size()) out.scripts.emplace(CScriptID(scripts[0]), scripts[0]);
  ------------------
  |  Branch (1125:13): [True: 369, False: 0]
  ------------------
 1126|    369|        return ret;
 1127|    369|    }
descriptor.cpp:_ZN12_GLOBAL__N_112TRDescriptorC2ENSt3__110unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS3_EEEENS1_6vectorINS2_INS_14DescriptorImplENS4_IS8_EEEENS1_9allocatorISA_EEEENS7_IiNSB_IiEEEE:
 1204|    611|        DescriptorImpl(Vector(std::move(internal_key)), std::move(descs), "tr"), m_depths(std::move(depths))
 1205|    611|    {
 1206|    611|        assert(m_subdescriptor_args.size() == m_depths.size());
 1207|    611|    }
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|    611|    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_112TRDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
 1165|    608|    {
 1166|    608|        TaprootBuilder builder;
 1167|    608|        assert(m_depths.size() == scripts.size());
 1168|  1.83k|        for (size_t pos = 0; pos < m_depths.size(); ++pos) {
  ------------------
  |  Branch (1168:30): [True: 1.22k, False: 608]
  ------------------
 1169|  1.22k|            builder.Add(m_depths[pos], scripts[pos], TAPROOT_LEAF_TAPSCRIPT);
 1170|  1.22k|        }
 1171|    608|        if (!builder.IsComplete()) return {};
  ------------------
  |  Branch (1171:13): [True: 0, False: 608]
  ------------------
 1172|    608|        assert(keys.size() == 1);
 1173|    608|        XOnlyPubKey xpk(keys[0]);
 1174|    608|        if (!xpk.IsFullyValid()) return {};
  ------------------
  |  Branch (1174:13): [True: 0, False: 608]
  ------------------
 1175|    608|        builder.Finalize(xpk);
 1176|    608|        WitnessV1Taproot output = builder.GetOutput();
 1177|    608|        out.tr_trees[output] = builder;
 1178|    608|        out.pubkeys.emplace(keys[0].GetID(), keys[0]);
 1179|    608|        return Vector(GetScriptForDestination(output));
 1180|    608|    }
descriptor.cpp:_ZN12_GLOBAL__N_115RawTRDescriptorC2ENSt3__110unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS3_EEEE:
 1373|      1|    RawTRDescriptor(std::unique_ptr<PubkeyProvider> output_key) : DescriptorImpl(Vector(std::move(output_key)), "rawtr") {}
descriptor.cpp:_ZNK12_GLOBAL__N_115RawTRDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
 1365|      1|    {
 1366|      1|        assert(keys.size() == 1);
 1367|      1|        XOnlyPubKey xpk(keys[0]);
 1368|      1|        if (!xpk.IsFullyValid()) return {};
  ------------------
  |  Branch (1368:13): [True: 0, False: 1]
  ------------------
 1369|      1|        WitnessV1Taproot output{xpk};
 1370|      1|        return Vector(GetScriptForDestination(output));
 1371|      1|    }
descriptor.cpp:_ZN12_GLOBAL__N_113RawDescriptorC2E7CScript:
  820|     20|    RawDescriptor(CScript script) : DescriptorImpl({}, "raw"), m_script(std::move(script)) {}
descriptor.cpp:_ZNK12_GLOBAL__N_113RawDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
  818|     18|    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|  6.07k|        : m_out(out), m_in(in), m_script_ctx(ctx), m_offset(offset) {}
descriptor.cpp:_ZNK12_GLOBAL__N_19KeyParser9MsContextEv:
 1747|  2.11M|    miniscript::MiniscriptContext MsContext() const {
 1748|  2.11M|        return m_script_ctx;
 1749|  2.11M|    }
descriptor.cpp:_ZNK12_GLOBAL__N_19KeyParser10FromStringIPKcEENSt3__18optionalIjEET_S7_:
 1691|  8.03k|    {
 1692|  8.03k|        assert(m_out);
 1693|  8.03k|        Key key = m_keys.size();
 1694|  8.03k|        auto pk = ParsePubkey(m_offset + key, {&*begin, &*end}, ParseContext(), *m_out, m_key_parsing_error);
 1695|  8.03k|        if (pk.empty()) return {};
  ------------------
  |  Branch (1695:13): [True: 182, False: 7.85k]
  ------------------
 1696|  7.85k|        m_keys.emplace_back(std::move(pk));
 1697|  7.85k|        return key;
 1698|  8.03k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_19KeyParser12ParseContextEv:
 1682|  8.03k|    ParseScriptContext ParseContext() const {
 1683|  8.03k|        switch (m_script_ctx) {
  ------------------
  |  Branch (1683:17): [True: 0, False: 8.03k]
  ------------------
 1684|  5.71k|            case miniscript::MiniscriptContext::P2WSH: return ParseScriptContext::P2WSH;
  ------------------
  |  Branch (1684:13): [True: 5.71k, False: 2.32k]
  ------------------
 1685|  2.32k|            case miniscript::MiniscriptContext::TAPSCRIPT: return ParseScriptContext::P2TR;
  ------------------
  |  Branch (1685:13): [True: 2.32k, False: 5.71k]
  ------------------
 1686|  8.03k|        }
 1687|      0|        assert(false);
 1688|      0|    }
descriptor.cpp:_ZNK12_GLOBAL__N_19KeyParser10KeyCompareERKjS2_:
 1678|  22.9k|    bool KeyCompare(const Key& a, const Key& b) const {
 1679|  22.9k|        return *m_keys.at(a).at(0) < *m_keys.at(b).at(0);
 1680|  22.9k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_114PubkeyProviderltERS0_:
  176|  22.9k|    bool operator<(PubkeyProvider& other) const {
  177|  22.9k|        CPubKey a, b;
  178|  22.9k|        SigningProvider dummy;
  179|  22.9k|        KeyOriginInfo dummy_info;
  180|       |
  181|  22.9k|        GetPubKey(0, dummy, a, dummy_info);
  182|  22.9k|        other.GetPubKey(0, dummy, b, dummy_info);
  183|       |
  184|  22.9k|        return a < b;
  185|  22.9k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_19KeyParser8ToStringERKj:
 1701|  1.61k|    {
 1702|  1.61k|        return m_keys.at(key).at(0)->ToString();
 1703|  1.61k|    }
descriptor.cpp:_ZZN12_GLOBAL__N_111ParseScriptERjR4SpanIKcENS_18ParseScriptContextER19FlatSigningProviderRNSt3__112basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEEENK3$_0clERKNS8_6vectorINS8_10unique_ptrINS_14PubkeyProviderENS8_14default_deleteISJ_EEEENSC_ISM_EEEESQ_:
 2123|  1.59k|                    [](const std::vector<std::unique_ptr<PubkeyProvider>>& a, const std::vector<std::unique_ptr<PubkeyProvider>>& b) {
 2124|  1.59k|                        return a.size() < b.size();
 2125|  1.59k|                    })->size();
descriptor.cpp:_ZN12_GLOBAL__N_120MiniscriptDescriptorC2ENSt3__16vectorINS1_10unique_ptrINS_14PubkeyProviderENS1_14default_deleteIS4_EEEENS1_9allocatorIS7_EEEENS3_IKN10miniscript4NodeIjEENS5_ISE_EEEE:
 1323|  1.31k|        : DescriptorImpl(std::move(providers), "?"), m_node(std::move(node)) {}
descriptor.cpp:_ZNK12_GLOBAL__N_120MiniscriptDescriptor11MakeScriptsERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEE4SpanIK7CScriptER19FlatSigningProvider:
 1309|    575|    {
 1310|    575|        const auto script_ctx{m_node->GetMsCtx()};
 1311|  1.99k|        for (const auto& key : keys) {
  ------------------
  |  Branch (1311:30): [True: 1.99k, False: 575]
  ------------------
 1312|  1.99k|            if (miniscript::IsTapscript(script_ctx)) {
  ------------------
  |  Branch (1312:17): [True: 465, False: 1.53k]
  ------------------
 1313|    465|                provider.pubkeys.emplace(Hash160(XOnlyPubKey{key}), key);
 1314|  1.53k|            } else {
 1315|  1.53k|                provider.pubkeys.emplace(key.GetID(), key);
 1316|  1.53k|            }
 1317|  1.99k|        }
 1318|    575|        return Vector(m_node->ToScript(ScriptMaker(keys, script_ctx)));
 1319|    575|    }
descriptor.cpp:_ZNK12_GLOBAL__N_111ScriptMaker9ToPKBytesEj:
 1259|  1.85k|    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|  1.85k|        if (!miniscript::IsTapscript(m_script_ctx)) {
  ------------------
  |  Branch (1261:13): [True: 1.48k, False: 371]
  ------------------
 1262|  1.48k|            return {m_keys[key].begin(), m_keys[key].end()};
 1263|  1.48k|        }
 1264|    371|        const XOnlyPubKey xonly_pubkey{m_keys[key]};
 1265|    371|        return {xonly_pubkey.begin(), xonly_pubkey.end()};
 1266|  1.85k|    }
descriptor.cpp:_ZNK12_GLOBAL__N_111ScriptMaker10ToPKHBytesEj:
 1268|    138|    std::vector<unsigned char> ToPKHBytes(uint32_t key) const {
 1269|    138|        auto id = GetHash160(key);
 1270|    138|        return {id.begin(), id.end()};
 1271|    138|    }
descriptor.cpp:_ZNK12_GLOBAL__N_111ScriptMaker10GetHash160Ej:
 1249|    138|    uint160 GetHash160(uint32_t key) const {
 1250|    138|        if (miniscript::IsTapscript(m_script_ctx)) {
  ------------------
  |  Branch (1250:13): [True: 94, False: 44]
  ------------------
 1251|     94|            return Hash160(XOnlyPubKey{m_keys[key]});
 1252|     94|        }
 1253|     44|        return m_keys[key].GetID();
 1254|    138|    }
descriptor.cpp:_ZN12_GLOBAL__N_111ScriptMakerC2ERKNSt3__16vectorI7CPubKeyNS1_9allocatorIS3_EEEEN10miniscript17MiniscriptContextE:
 1257|    575|    ScriptMaker(const std::vector<CPubKey>& keys LIFETIMEBOUND, const miniscript::MiniscriptContext script_ctx) : m_keys(keys), m_script_ctx{script_ctx} {}

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

_Z18ComputeTapleafHashh4SpanIKhE:
 1829|  1.22k|{
 1830|  1.22k|    return (HashWriter{HASHER_TAPLEAF} << leaf_version << CompactSizeWriter(script.size()) << script).GetSHA256();
 1831|  1.22k|}
_Z20ComputeTapbranchHash4SpanIKhES1_:
 1834|    992|{
 1835|    992|    HashWriter ss_branch{HASHER_TAPBRANCH};
 1836|    992|    if (std::lexicographical_compare(a.begin(), a.end(), b.begin(), b.end())) {
  ------------------
  |  Branch (1836:9): [True: 427, False: 565]
  ------------------
 1837|    427|        ss_branch << a << b;
 1838|    565|    } else {
 1839|    565|        ss_branch << b << a;
 1840|    565|    }
 1841|    992|    return ss_branch.GetSHA256();
 1842|    992|}

_ZN10miniscript8internal12SanitizeTypeENS_4TypeE:
   19|  2.38M|Type SanitizeType(Type e) {
   20|  2.38M|    int num_types = (e << "K"_mst) + (e << "V"_mst) + (e << "B"_mst) + (e << "W"_mst);
   21|  2.38M|    if (num_types == 0) return ""_mst; // No valid type, don't care about the rest
  ------------------
  |  Branch (21:9): [True: 808k, False: 1.57M]
  ------------------
   22|  1.57M|    assert(num_types == 1); // K, V, B, W all conflict with each other
   23|  1.57M|    assert(!(e << "z"_mst) || !(e << "o"_mst)); // z conflicts with o
   24|  1.57M|    assert(!(e << "n"_mst) || !(e << "z"_mst)); // n conflicts with z
   25|  1.57M|    assert(!(e << "n"_mst) || !(e << "W"_mst)); // n conflicts with W
   26|  1.57M|    assert(!(e << "V"_mst) || !(e << "d"_mst)); // V conflicts with d
   27|  1.57M|    assert(!(e << "K"_mst) ||  (e << "u"_mst)); // K implies u
   28|  1.57M|    assert(!(e << "V"_mst) || !(e << "u"_mst)); // V conflicts with u
   29|  1.57M|    assert(!(e << "e"_mst) || !(e << "f"_mst)); // e conflicts with f
   30|  1.57M|    assert(!(e << "e"_mst) ||  (e << "d"_mst)); // e implies d
   31|  1.57M|    assert(!(e << "V"_mst) || !(e << "e"_mst)); // V conflicts with e
   32|  1.57M|    assert(!(e << "d"_mst) || !(e << "f"_mst)); // d conflicts with f
   33|  1.57M|    assert(!(e << "V"_mst) ||  (e << "f"_mst)); // V implies f
   34|  1.57M|    assert(!(e << "K"_mst) ||  (e << "s"_mst)); // K implies s
   35|  1.57M|    assert(!(e << "z"_mst) ||  (e << "m"_mst)); // z implies m
   36|  1.57M|    return e;
   37|  1.57M|}
_ZN10miniscript8internal11ComputeTypeENS_8FragmentENS_4TypeES2_S2_RKNSt3__16vectorIS2_NS3_9allocatorIS2_EEEEjmmmNS_17MiniscriptContextE:
   40|  2.38M|                 size_t data_size, size_t n_subs, size_t n_keys, MiniscriptContext ms_ctx) {
   41|       |    // Sanity check on data
   42|  2.38M|    if (fragment == Fragment::SHA256 || fragment == Fragment::HASH256) {
  ------------------
  |  Branch (42:9): [True: 2, False: 2.38M]
  |  Branch (42:41): [True: 1, False: 2.38M]
  ------------------
   43|      3|        assert(data_size == 32);
   44|  2.38M|    } else if (fragment == Fragment::RIPEMD160 || fragment == Fragment::HASH160) {
  ------------------
  |  Branch (44:16): [True: 11, False: 2.38M]
  |  Branch (44:51): [True: 108, False: 2.38M]
  ------------------
   45|    119|        assert(data_size == 20);
   46|  2.38M|    } else {
   47|  2.38M|        assert(data_size == 0);
   48|  2.38M|    }
   49|       |    // Sanity check on k
   50|  2.38M|    if (fragment == Fragment::OLDER || fragment == Fragment::AFTER) {
  ------------------
  |  Branch (50:9): [True: 2.84k, False: 2.38M]
  |  Branch (50:40): [True: 3.39k, False: 2.38M]
  ------------------
   51|  6.24k|        assert(k >= 1 && k < 0x80000000UL);
   52|  2.38M|    } else if (fragment == Fragment::MULTI || fragment == Fragment::MULTI_A) {
  ------------------
  |  Branch (52:16): [True: 2.72k, False: 2.37M]
  |  Branch (52:47): [True: 123, False: 2.37M]
  ------------------
   53|  2.84k|        assert(k >= 1 && k <= n_keys);
   54|  2.37M|    } else if (fragment == Fragment::THRESH) {
  ------------------
  |  Branch (54:16): [True: 4.73k, False: 2.37M]
  ------------------
   55|  4.73k|        assert(k >= 1 && k <= n_subs);
   56|  2.37M|    } else {
   57|  2.37M|        assert(k == 0);
   58|  2.37M|    }
   59|       |    // Sanity check on subs
   60|  2.38M|    if (fragment == Fragment::AND_V || fragment == Fragment::AND_B || fragment == Fragment::OR_B ||
  ------------------
  |  Branch (60:9): [True: 310k, False: 2.07M]
  |  Branch (60:40): [True: 5.71k, False: 2.07M]
  |  Branch (60:71): [True: 6.25k, False: 2.06M]
  ------------------
   61|  2.38M|        fragment == Fragment::OR_C || fragment == Fragment::OR_I || fragment == Fragment::OR_D) {
  ------------------
  |  Branch (61:9): [True: 2.75k, False: 2.06M]
  |  Branch (61:39): [True: 524k, False: 1.53M]
  |  Branch (61:69): [True: 3.75k, False: 1.53M]
  ------------------
   62|   853k|        assert(n_subs == 2);
   63|  1.53M|    } else if (fragment == Fragment::ANDOR) {
  ------------------
  |  Branch (63:16): [True: 3.99k, False: 1.53M]
  ------------------
   64|  3.99k|        assert(n_subs == 3);
   65|  1.53M|    } else if (fragment == Fragment::WRAP_A || fragment == Fragment::WRAP_S || fragment == Fragment::WRAP_C ||
  ------------------
  |  Branch (65:16): [True: 16.7k, False: 1.51M]
  |  Branch (65:48): [True: 5.05k, False: 1.50M]
  |  Branch (65:80): [True: 34.1k, False: 1.47M]
  ------------------
   66|  1.53M|               fragment == Fragment::WRAP_D || fragment == Fragment::WRAP_V || fragment == Fragment::WRAP_J ||
  ------------------
  |  Branch (66:16): [True: 17.2k, False: 1.45M]
  |  Branch (66:48): [True: 15.4k, False: 1.44M]
  |  Branch (66:80): [True: 407k, False: 1.03M]
  ------------------
   67|  1.53M|               fragment == Fragment::WRAP_N) {
  ------------------
  |  Branch (67:16): [True: 82.9k, False: 952k]
  ------------------
   68|   578k|        assert(n_subs == 1);
   69|   952k|    } else if (fragment != Fragment::THRESH) {
  ------------------
  |  Branch (69:16): [True: 947k, False: 4.73k]
  ------------------
   70|   947k|        assert(n_subs == 0);
   71|   947k|    }
   72|       |    // Sanity check on keys
   73|  2.38M|    if (fragment == Fragment::PK_K || fragment == Fragment::PK_H) {
  ------------------
  |  Branch (73:9): [True: 2.23k, False: 2.38M]
  |  Branch (73:39): [True: 503, False: 2.38M]
  ------------------
   74|  2.73k|        assert(n_keys == 1);
   75|  2.38M|    } else if (fragment == Fragment::MULTI) {
  ------------------
  |  Branch (75:16): [True: 2.72k, False: 2.38M]
  ------------------
   76|  2.72k|        assert(n_keys >= 1 && n_keys <= MAX_PUBKEYS_PER_MULTISIG);
   77|  2.72k|        assert(!IsTapscript(ms_ctx));
   78|  2.38M|    } else if (fragment == Fragment::MULTI_A) {
  ------------------
  |  Branch (78:16): [True: 123, False: 2.38M]
  ------------------
   79|    123|        assert(n_keys >= 1 && n_keys <= MAX_PUBKEYS_PER_MULTI_A);
   80|    123|        assert(IsTapscript(ms_ctx));
   81|  2.38M|    } else {
   82|  2.38M|        assert(n_keys == 0);
   83|  2.38M|    }
   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|  2.38M|    switch (fragment) {
  ------------------
  |  Branch (88:13): [True: 0, False: 2.38M]
  ------------------
   89|  2.23k|        case Fragment::PK_K: return "Konudemsxk"_mst;
  ------------------
  |  Branch (89:9): [True: 2.23k, False: 2.38M]
  ------------------
   90|    503|        case Fragment::PK_H: return "Knudemsxk"_mst;
  ------------------
  |  Branch (90:9): [True: 503, False: 2.38M]
  ------------------
   91|  2.84k|        case Fragment::OLDER: return
  ------------------
  |  Branch (91:9): [True: 2.84k, False: 2.38M]
  ------------------
   92|  2.84k|            "g"_mst.If(k & CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG) |
   93|  2.84k|            "h"_mst.If(!(k & CTxIn::SEQUENCE_LOCKTIME_TYPE_FLAG)) |
   94|  2.84k|            "Bzfmxk"_mst;
   95|  3.39k|        case Fragment::AFTER: return
  ------------------
  |  Branch (95:9): [True: 3.39k, False: 2.38M]
  ------------------
   96|  3.39k|            "i"_mst.If(k >= LOCKTIME_THRESHOLD) |
   97|  3.39k|            "j"_mst.If(k < LOCKTIME_THRESHOLD) |
   98|  3.39k|            "Bzfmxk"_mst;
   99|      2|        case Fragment::SHA256: return "Bonudmk"_mst;
  ------------------
  |  Branch (99:9): [True: 2, False: 2.38M]
  ------------------
  100|     11|        case Fragment::RIPEMD160: return "Bonudmk"_mst;
  ------------------
  |  Branch (100:9): [True: 11, False: 2.38M]
  ------------------
  101|      1|        case Fragment::HASH256: return "Bonudmk"_mst;
  ------------------
  |  Branch (101:9): [True: 1, False: 2.38M]
  ------------------
  102|    108|        case Fragment::HASH160: return "Bonudmk"_mst;
  ------------------
  |  Branch (102:9): [True: 108, False: 2.38M]
  ------------------
  103|   365k|        case Fragment::JUST_1: return "Bzufmxk"_mst;
  ------------------
  |  Branch (103:9): [True: 365k, False: 2.02M]
  ------------------
  104|   570k|        case Fragment::JUST_0: return "Bzudemsxk"_mst;
  ------------------
  |  Branch (104:9): [True: 570k, False: 1.81M]
  ------------------
  105|  16.7k|        case Fragment::WRAP_A: return
  ------------------
  |  Branch (105:9): [True: 16.7k, False: 2.37M]
  ------------------
  106|  16.7k|            "W"_mst.If(x << "B"_mst) | // W=B_x
  107|  16.7k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  108|  16.7k|            (x & "udfems"_mst) | // u=u_x, d=d_x, f=f_x, e=e_x, m=m_x, s=s_x
  109|  16.7k|            "x"_mst; // x
  110|  5.05k|        case Fragment::WRAP_S: return
  ------------------
  |  Branch (110:9): [True: 5.05k, False: 2.38M]
  ------------------
  111|  5.05k|            "W"_mst.If(x << "Bo"_mst) | // W=B_x*o_x
  112|  5.05k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  113|  5.05k|            (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|  34.1k|        case Fragment::WRAP_C: return
  ------------------
  |  Branch (114:9): [True: 34.1k, False: 2.35M]
  ------------------
  115|  34.1k|            "B"_mst.If(x << "K"_mst) | // B=K_x
  116|  34.1k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  117|  34.1k|            (x & "ondfem"_mst) | // o=o_x, n=n_x, d=d_x, f=f_x, e=e_x, m=m_x
  118|  34.1k|            "us"_mst; // u, s
  119|  17.2k|        case Fragment::WRAP_D: return
  ------------------
  |  Branch (119:9): [True: 17.2k, False: 2.37M]
  ------------------
  120|  17.2k|            "B"_mst.If(x << "Vz"_mst) | // B=V_x*z_x
  121|  17.2k|            "o"_mst.If(x << "z"_mst) | // o=z_x
  122|  17.2k|            "e"_mst.If(x << "f"_mst) | // e=f_x
  123|  17.2k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  124|  17.2k|            (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|  17.2k|            "u"_mst.If(IsTapscript(ms_ctx)) |
  127|  17.2k|            "ndx"_mst; // n, d, x
  128|  15.4k|        case Fragment::WRAP_V: return
  ------------------
  |  Branch (128:9): [True: 15.4k, False: 2.37M]
  ------------------
  129|  15.4k|            "V"_mst.If(x << "B"_mst) | // V=B_x
  130|  15.4k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  131|  15.4k|            (x & "zonms"_mst) | // z=z_x, o=o_x, n=n_x, m=m_x, s=s_x
  132|  15.4k|            "fx"_mst; // f, x
  133|   407k|        case Fragment::WRAP_J: return
  ------------------
  |  Branch (133:9): [True: 407k, False: 1.98M]
  ------------------
  134|   407k|            "B"_mst.If(x << "Bn"_mst) | // B=B_x*n_x
  135|   407k|            "e"_mst.If(x << "f"_mst) | // e=f_x
  136|   407k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  137|   407k|            (x & "oums"_mst) | // o=o_x, u=u_x, m=m_x, s=s_x
  138|   407k|            "ndx"_mst; // n, d, x
  139|  82.9k|        case Fragment::WRAP_N: return
  ------------------
  |  Branch (139:9): [True: 82.9k, False: 2.30M]
  ------------------
  140|  82.9k|            (x & "ghijk"_mst) | // g=g_x, h=h_x, i=i_x, j=j_x, k=k_x
  141|  82.9k|            (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|  82.9k|            "ux"_mst; // u, x
  143|   310k|        case Fragment::AND_V: return
  ------------------
  |  Branch (143:9): [True: 310k, False: 2.07M]
  ------------------
  144|   310k|            (y & "KVB"_mst).If(x << "V"_mst) | // B=V_x*B_y, V=V_x*V_y, K=V_x*K_y
  145|   310k|            (x & "n"_mst) | (y & "n"_mst).If(x << "z"_mst) | // n=n_x+z_x*n_y
  146|   310k|            ((x | y) & "o"_mst).If((x | y) << "z"_mst) | // o=o_x*z_y+z_x*o_y
  147|   310k|            (x & y & "dmz"_mst) | // d=d_x*d_y, m=m_x*m_y, z=z_x*z_y
  148|   310k|            ((x | y) & "s"_mst) | // s=s_x+s_y
  149|   310k|            "f"_mst.If((y << "f"_mst) || (x << "s"_mst)) | // f=f_y+s_x
  ------------------
  |  Branch (149:24): [True: 310k, False: 174]
  |  Branch (149:42): [True: 9, False: 165]
  ------------------
  150|   310k|            (y & "ux"_mst) | // u=u_y, x=x_y
  151|   310k|            ((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|   310k|            "k"_mst.If(((x & y) << "k"_mst) &&
  ------------------
  |  Branch (152:24): [True: 12.8k, False: 297k]
  ------------------
  153|   310k|                !(((x << "g"_mst) && (y << "h"_mst)) ||
  ------------------
  |  Branch (153:20): [True: 546, False: 12.2k]
  |  Branch (153:38): [True: 143, False: 403]
  ------------------
  154|  12.8k|                ((x << "h"_mst) && (y << "g"_mst)) ||
  ------------------
  |  Branch (154:18): [True: 1.01k, False: 11.6k]
  |  Branch (154:36): [True: 98, False: 912]
  ------------------
  155|  12.8k|                ((x << "i"_mst) && (y << "j"_mst)) ||
  ------------------
  |  Branch (155:18): [True: 214, False: 12.3k]
  |  Branch (155:36): [True: 18, False: 196]
  ------------------
  156|  12.8k|                ((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: 203, False: 12.3k]
  |  Branch (156:36): [True: 5, False: 198]
  ------------------
  157|  5.71k|        case Fragment::AND_B: return
  ------------------
  |  Branch (157:9): [True: 5.71k, False: 2.38M]
  ------------------
  158|  5.71k|            (x & "B"_mst).If(y << "W"_mst) | // B=B_x*W_y
  159|  5.71k|            ((x | y) & "o"_mst).If((x | y) << "z"_mst) | // o=o_x*z_y+z_x*o_y
  160|  5.71k|            (x & "n"_mst) | (y & "n"_mst).If(x << "z"_mst) | // n=n_x+z_x*n_y
  161|  5.71k|            (x & y & "e"_mst).If((x & y) << "s"_mst) | // e=e_x*e_y*s_x*s_y
  162|  5.71k|            (x & y & "dzm"_mst) | // d=d_x*d_y, z=z_x*z_y, m=m_x*m_y
  163|  5.71k|            "f"_mst.If(((x & y) << "f"_mst) || (x << "sf"_mst) || (y << "sf"_mst)) | // f=f_x*f_y + f_x*s_x + f_y*s_y
  ------------------
  |  Branch (163:24): [True: 1.49k, False: 4.21k]
  |  Branch (163:48): [True: 83, False: 4.13k]
  |  Branch (163:67): [True: 7, False: 4.12k]
  ------------------
  164|  5.71k|            ((x | y) & "s"_mst) | // s=s_x+s_y
  165|  5.71k|            "ux"_mst | // u, x
  166|  5.71k|            ((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|  5.71k|            "k"_mst.If(((x & y) << "k"_mst) &&
  ------------------
  |  Branch (167:24): [True: 3.31k, False: 2.39k]
  ------------------
  168|  5.71k|                !(((x << "g"_mst) && (y << "h"_mst)) ||
  ------------------
  |  Branch (168:20): [True: 28, False: 3.28k]
  |  Branch (168:38): [True: 10, False: 18]
  ------------------
  169|  3.31k|                ((x << "h"_mst) && (y << "g"_mst)) ||
  ------------------
  |  Branch (169:18): [True: 76, False: 3.22k]
  |  Branch (169:36): [True: 10, False: 66]
  ------------------
  170|  3.31k|                ((x << "i"_mst) && (y << "j"_mst)) ||
  ------------------
  |  Branch (170:18): [True: 31, False: 3.26k]
  |  Branch (170:36): [True: 10, False: 21]
  ------------------
  171|  3.31k|                ((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: 352, False: 2.93k]
  |  Branch (171:36): [True: 299, False: 53]
  ------------------
  172|  6.25k|        case Fragment::OR_B: return
  ------------------
  |  Branch (172:9): [True: 6.25k, False: 2.38M]
  ------------------
  173|  6.25k|            "B"_mst.If(x << "Bd"_mst && y << "Wd"_mst) | // B=B_x*d_x*W_x*d_y
  ------------------
  |  Branch (173:24): [True: 3.14k, False: 3.11k]
  |  Branch (173:41): [True: 584, False: 2.55k]
  ------------------
  174|  6.25k|            ((x | y) & "o"_mst).If((x | y) << "z"_mst) | // o=o_x*z_y+z_x*o_y
  175|  6.25k|            (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.21k, False: 3.03k]
  |  Branch (175:56): [True: 1.03k, False: 2.18k]
  ------------------
  176|  6.25k|            (x & y & "zse"_mst) | // z=z_x*z_y, s=s_x*s_y, e=e_x*e_y
  177|  6.25k|            "dux"_mst | // d, u, x
  178|  6.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
  179|  6.25k|            (x & y & "k"_mst); // k=k_x*k_y
  180|  3.75k|        case Fragment::OR_D: return
  ------------------
  |  Branch (180:9): [True: 3.75k, False: 2.38M]
  ------------------
  181|  3.75k|            (y & "B"_mst).If(x << "Bdu"_mst) | // B=B_y*B_x*d_x*u_x
  182|  3.75k|            (x & "o"_mst).If(y << "z"_mst) | // o=o_x*z_y
  183|  3.75k|            (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: 867, False: 2.89k]
  |  Branch (183:50): [True: 810, False: 57]
  ------------------
  184|  3.75k|            (x & y & "zs"_mst) | // z=z_x*z_y, s=s_x*s_y
  185|  3.75k|            (y & "ufde"_mst) | // u=u_y, f=f_y, d=d_y, e=e_y
  186|  3.75k|            "x"_mst | // x
  187|  3.75k|            ((x | y) & "ghij"_mst) | // g=g_x+g_y, h=h_x+h_y, i=i_x+i_y, j=j_x+j_y
  188|  3.75k|            (x & y & "k"_mst); // k=k_x*k_y
  189|  2.75k|        case Fragment::OR_C: return
  ------------------
  |  Branch (189:9): [True: 2.75k, False: 2.38M]
  ------------------
  190|  2.75k|            (y & "V"_mst).If(x << "Bdu"_mst) | // V=V_y*B_x*u_x*d_x
  191|  2.75k|            (x & "o"_mst).If(y << "z"_mst) | // o=o_x*z_y
  192|  2.75k|            (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.12k, False: 1.62k]
  |  Branch (192:50): [True: 994, False: 132]
  ------------------
  193|  2.75k|            (x & y & "zs"_mst) | // z=z_x*z_y, s=s_x*s_y
  194|  2.75k|            "fx"_mst | // f, x
  195|  2.75k|            ((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|  2.75k|            (x & y & "k"_mst); // k=k_x*k_y
  197|   524k|        case Fragment::OR_I: return
  ------------------
  |  Branch (197:9): [True: 524k, False: 1.86M]
  ------------------
  198|   524k|            (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|   524k|            "o"_mst.If((x & y) << "z"_mst) | // o=z_x*z_y
  200|   524k|            ((x | y) & "e"_mst).If((x | y) << "f"_mst) | // e=e_x*f_y+f_x*e_y
  201|   524k|            (x & y & "m"_mst).If((x | y) << "s"_mst) | // m=m_x*m_y*(s_x+s_y)
  202|   524k|            ((x | y) & "d"_mst) | // d=d_x+d_y
  203|   524k|            "x"_mst | // x
  204|   524k|            ((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|   524k|            (x & y & "k"_mst); // k=k_x*k_y
  206|  3.99k|        case Fragment::ANDOR: return
  ------------------
  |  Branch (206:9): [True: 3.99k, False: 2.38M]
  ------------------
  207|  3.99k|            (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|  3.99k|            (x & y & z & "z"_mst) | // z=z_x*z_y*z_z
  209|  3.99k|            ((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|  3.99k|            (y & z & "u"_mst) | // u=u_y*u_z
  211|  3.99k|            (z & "f"_mst).If((x << "s"_mst) || (y << "f"_mst)) | // f=(s_x+f_y)*f_z
  ------------------
  |  Branch (211:30): [True: 1.16k, False: 2.82k]
  |  Branch (211:48): [True: 1.34k, False: 1.48k]
  ------------------
  212|  3.99k|            (z & "d"_mst) | // d=d_z
  213|  3.99k|            (z & "e"_mst).If(x << "s"_mst || y << "f"_mst) | // e=e_z*(s_x+f_y)
  ------------------
  |  Branch (213:30): [True: 1.16k, False: 2.82k]
  |  Branch (213:46): [True: 1.34k, False: 1.48k]
  ------------------
  214|  3.99k|            (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: 1.59k, False: 2.39k]
  |  Branch (214:54): [True: 762, False: 832]
  ------------------
  215|  3.99k|            (z & (x | y) & "s"_mst) | // s=s_z*(s_x+s_y)
  216|  3.99k|            "x"_mst | // x
  217|  3.99k|            ((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|  3.99k|            "k"_mst.If(((x & y & z) << "k"_mst) &&
  ------------------
  |  Branch (218:24): [True: 2.21k, False: 1.77k]
  ------------------
  219|  3.99k|                !(((x << "g"_mst) && (y << "h"_mst)) ||
  ------------------
  |  Branch (219:20): [True: 20, False: 2.19k]
  |  Branch (219:38): [True: 10, False: 10]
  ------------------
  220|  2.21k|                ((x << "h"_mst) && (y << "g"_mst)) ||
  ------------------
  |  Branch (220:18): [True: 84, False: 2.12k]
  |  Branch (220:36): [True: 18, False: 66]
  ------------------
  221|  2.21k|                ((x << "i"_mst) && (y << "j"_mst)) ||
  ------------------
  |  Branch (221:18): [True: 28, False: 2.15k]
  |  Branch (221:36): [True: 18, False: 10]
  ------------------
  222|  2.21k|                ((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: 37, False: 2.13k]
  |  Branch (222:36): [True: 3, False: 34]
  ------------------
  223|  2.72k|        case Fragment::MULTI: {
  ------------------
  |  Branch (223:9): [True: 2.72k, False: 2.38M]
  ------------------
  224|  2.72k|            return "Bnudemsk"_mst;
  225|      0|        }
  226|    123|        case Fragment::MULTI_A: {
  ------------------
  |  Branch (226:9): [True: 123, False: 2.38M]
  ------------------
  227|    123|            return "Budemsk"_mst;
  228|      0|        }
  229|  4.73k|        case Fragment::THRESH: {
  ------------------
  |  Branch (229:9): [True: 4.73k, False: 2.38M]
  ------------------
  230|  4.73k|            bool all_e = true;
  231|  4.73k|            bool all_m = true;
  232|  4.73k|            uint32_t args = 0;
  233|  4.73k|            uint32_t num_s = 0;
  234|  4.73k|            Type acc_tl = "k"_mst;
  235|  12.6k|            for (size_t i = 0; i < sub_types.size(); ++i) {
  ------------------
  |  Branch (235:32): [True: 10.0k, False: 2.57k]
  ------------------
  236|  10.0k|                Type t = sub_types[i];
  237|  10.0k|                static constexpr auto WDU{"Wdu"_mst}, BDU{"Bdu"_mst};
  238|  10.0k|                if (!(t << (i ? WDU : BDU))) return ""_mst; // Require Bdu, Wdu, Wdu, ...
  ------------------
  |  Branch (238:21): [True: 2.15k, False: 7.90k]
  |  Branch (238:29): [True: 5.32k, False: 4.73k]
  ------------------
  239|  7.90k|                if (!(t << "e"_mst)) all_e = false;
  ------------------
  |  Branch (239:21): [True: 2.83k, False: 5.07k]
  ------------------
  240|  7.90k|                if (!(t << "m"_mst)) all_m = false;
  ------------------
  |  Branch (240:21): [True: 489, False: 7.41k]
  ------------------
  241|  7.90k|                if (t << "s"_mst) num_s += 1;
  ------------------
  |  Branch (241:21): [True: 5.44k, False: 2.46k]
  ------------------
  242|  7.90k|                args += (t << "z"_mst) ? 0 : (t << "o"_mst) ? 1 : 2;
  ------------------
  |  Branch (242:25): [True: 1.63k, False: 6.26k]
  |  Branch (242:46): [True: 923, False: 5.34k]
  ------------------
  243|  7.90k|                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|  7.90k|                    "k"_mst.If(((acc_tl & t) << "k"_mst) && ((k <= 1) ||
  ------------------
  |  Branch (247:32): [True: 7.68k, False: 215]
  |  Branch (247:62): [True: 3.41k, False: 4.27k]
  ------------------
  248|  7.68k|                        ((k > 1) && !(((acc_tl << "g"_mst) && (t << "h"_mst)) ||
  ------------------
  |  Branch (248:26): [True: 4.27k, False: 0]
  |  Branch (248:40): [True: 302, False: 3.96k]
  |  Branch (248:63): [True: 74, False: 228]
  ------------------
  249|  4.27k|                        ((acc_tl << "h"_mst) && (t << "g"_mst)) ||
  ------------------
  |  Branch (249:26): [True: 485, False: 3.71k]
  |  Branch (249:49): [True: 110, False: 375]
  ------------------
  250|  4.27k|                        ((acc_tl << "i"_mst) && (t << "j"_mst)) ||
  ------------------
  |  Branch (250:26): [True: 195, False: 3.89k]
  |  Branch (250:49): [True: 1, False: 194]
  ------------------
  251|  4.27k|                        ((acc_tl << "j"_mst) && (t << "i"_mst))))));
  ------------------
  |  Branch (251:26): [True: 221, False: 3.86k]
  |  Branch (251:49): [True: 0, False: 221]
  ------------------
  252|  7.90k|            }
  253|  2.57k|            return "Bdu"_mst |
  254|  2.57k|                   "z"_mst.If(args == 0) | // z=all z
  255|  2.57k|                   "o"_mst.If(args == 1) | // o=all z except one o
  256|  2.57k|                   "e"_mst.If(all_e && num_s == n_subs) | // e=all e and all s
  ------------------
  |  Branch (256:31): [True: 1.02k, False: 1.54k]
  |  Branch (256:40): [True: 636, False: 390]
  ------------------
  257|  2.57k|                   "m"_mst.If(all_e && all_m && num_s >= n_subs - k) | // m=all e, >=(n-k) s
  ------------------
  |  Branch (257:31): [True: 1.02k, False: 1.54k]
  |  Branch (257:40): [True: 1.01k, False: 10]
  |  Branch (257:49): [True: 1.00k, False: 10]
  ------------------
  258|  2.57k|                   "s"_mst.If(num_s >= n_subs - k + 1) |  // s= >=(n-k+1) s
  259|  2.57k|                   acc_tl; // timelock info
  260|  4.73k|            }
  261|  2.38M|    }
  262|      0|    assert(false);
  263|      0|}
_ZN10miniscript8internal16ComputeScriptLenENS_8FragmentENS_4TypeEmjmmNS_17MiniscriptContextE:
  266|  2.38M|                        size_t n_keys, MiniscriptContext ms_ctx) {
  267|  2.38M|    switch (fragment) {
  ------------------
  |  Branch (267:13): [True: 0, False: 2.38M]
  ------------------
  268|   365k|        case Fragment::JUST_1:
  ------------------
  |  Branch (268:9): [True: 365k, False: 2.02M]
  ------------------
  269|   935k|        case Fragment::JUST_0: return 1;
  ------------------
  |  Branch (269:9): [True: 570k, False: 1.81M]
  ------------------
  270|  2.23k|        case Fragment::PK_K: return IsTapscript(ms_ctx) ? 33 : 34;
  ------------------
  |  Branch (270:9): [True: 2.23k, False: 2.38M]
  |  Branch (270:37): [True: 2.07k, False: 163]
  ------------------
  271|    503|        case Fragment::PK_H: return 3 + 21;
  ------------------
  |  Branch (271:9): [True: 503, False: 2.38M]
  ------------------
  272|  2.84k|        case Fragment::OLDER:
  ------------------
  |  Branch (272:9): [True: 2.84k, False: 2.38M]
  ------------------
  273|  6.24k|        case Fragment::AFTER: return 1 + BuildScript(k).size();
  ------------------
  |  Branch (273:9): [True: 3.39k, False: 2.38M]
  ------------------
  274|      1|        case Fragment::HASH256:
  ------------------
  |  Branch (274:9): [True: 1, False: 2.38M]
  ------------------
  275|      3|        case Fragment::SHA256: return 4 + 2 + 33;
  ------------------
  |  Branch (275:9): [True: 2, False: 2.38M]
  ------------------
  276|    108|        case Fragment::HASH160:
  ------------------
  |  Branch (276:9): [True: 108, False: 2.38M]
  ------------------
  277|    119|        case Fragment::RIPEMD160: return 4 + 2 + 21;
  ------------------
  |  Branch (277:9): [True: 11, False: 2.38M]
  ------------------
  278|  2.72k|        case Fragment::MULTI: return 1 + BuildScript(n_keys).size() + BuildScript(k).size() + 34 * n_keys;
  ------------------
  |  Branch (278:9): [True: 2.72k, False: 2.38M]
  ------------------
  279|    123|        case Fragment::MULTI_A: return (1 + 32 + 1) * n_keys + BuildScript(k).size() + 1;
  ------------------
  |  Branch (279:9): [True: 123, False: 2.38M]
  ------------------
  280|   310k|        case Fragment::AND_V: return subsize;
  ------------------
  |  Branch (280:9): [True: 310k, False: 2.07M]
  ------------------
  281|  15.4k|        case Fragment::WRAP_V: return subsize + (sub0typ << "x"_mst);
  ------------------
  |  Branch (281:9): [True: 15.4k, False: 2.37M]
  ------------------
  282|  5.05k|        case Fragment::WRAP_S:
  ------------------
  |  Branch (282:9): [True: 5.05k, False: 2.38M]
  ------------------
  283|  39.2k|        case Fragment::WRAP_C:
  ------------------
  |  Branch (283:9): [True: 34.1k, False: 2.35M]
  ------------------
  284|   122k|        case Fragment::WRAP_N:
  ------------------
  |  Branch (284:9): [True: 82.9k, False: 2.30M]
  ------------------
  285|   127k|        case Fragment::AND_B:
  ------------------
  |  Branch (285:9): [True: 5.71k, False: 2.38M]
  ------------------
  286|   134k|        case Fragment::OR_B: return subsize + 1;
  ------------------
  |  Branch (286:9): [True: 6.25k, False: 2.38M]
  ------------------
  287|  16.7k|        case Fragment::WRAP_A:
  ------------------
  |  Branch (287:9): [True: 16.7k, False: 2.37M]
  ------------------
  288|  19.4k|        case Fragment::OR_C: return subsize + 2;
  ------------------
  |  Branch (288:9): [True: 2.75k, False: 2.38M]
  ------------------
  289|  17.2k|        case Fragment::WRAP_D:
  ------------------
  |  Branch (289:9): [True: 17.2k, False: 2.37M]
  ------------------
  290|  21.0k|        case Fragment::OR_D:
  ------------------
  |  Branch (290:9): [True: 3.75k, False: 2.38M]
  ------------------
  291|   545k|        case Fragment::OR_I:
  ------------------
  |  Branch (291:9): [True: 524k, False: 1.86M]
  ------------------
  292|   549k|        case Fragment::ANDOR: return subsize + 3;
  ------------------
  |  Branch (292:9): [True: 3.99k, False: 2.38M]
  ------------------
  293|   407k|        case Fragment::WRAP_J: return subsize + 4;
  ------------------
  |  Branch (293:9): [True: 407k, False: 1.98M]
  ------------------
  294|  4.73k|        case Fragment::THRESH: return subsize + n_subs + BuildScript(k).size();
  ------------------
  |  Branch (294:9): [True: 4.73k, False: 2.38M]
  ------------------
  295|  2.38M|    }
  296|      0|    assert(false);
  297|      0|}
_ZN10miniscript8internal12FindNextCharE4SpanIKcEc:
  423|  26.5k|{
  424|  1.17M|    for (int i = 0; i < (int)sp.size(); ++i) {
  ------------------
  |  Branch (424:21): [True: 1.17M, False: 156]
  ------------------
  425|  1.17M|        if (sp[i] == m) return i;
  ------------------
  |  Branch (425:13): [True: 23.6k, False: 1.14M]
  ------------------
  426|       |        // We only search within the current parentheses
  427|  1.14M|        if (sp[i] == ')') break;
  ------------------
  |  Branch (427:13): [True: 2.72k, False: 1.14M]
  ------------------
  428|  1.14M|    }
  429|  2.88k|    return -1;
  430|  26.5k|}

_ZNK10miniscript4TypeorES0_:
  138|  12.7M|    constexpr Type operator|(Type x) const { return Type(m_flags | x.m_flags); }
_ZN10miniscript4TypeC2Ej:
  131|  26.8M|    explicit constexpr Type(uint32_t flags) noexcept : m_flags(flags) {}
_ZN10miniscript11IsTapscriptENS_17MiniscriptContextE:
  246|  5.20M|{
  247|  5.20M|    switch (ms_ctx) {
  ------------------
  |  Branch (247:13): [True: 0, False: 5.20M]
  ------------------
  248|   537k|        case MiniscriptContext::P2WSH: return false;
  ------------------
  |  Branch (248:9): [True: 537k, False: 4.66M]
  ------------------
  249|  4.66M|        case MiniscriptContext::TAPSCRIPT: return true;
  ------------------
  |  Branch (249:9): [True: 4.66M, False: 537k]
  ------------------
  250|  5.20M|    }
  251|      0|    assert(false);
  252|      0|}
_ZNK10miniscript4TypelsES0_:
  144|  40.0M|    constexpr bool operator<<(Type x) const { return (x.m_flags & ~m_flags) == 0; }
_ZNK10miniscript4TypeanES0_:
  141|  9.85M|    constexpr Type operator&(Type x) const { return Type(m_flags & x.m_flags); }
_ZN10miniscript8internal13MaxScriptSizeENS_17MiniscriptContextE:
  271|   137k|{
  272|   137k|    if (IsTapscript(ms_ctx)) {
  ------------------
  |  Branch (272:9): [True: 53.0k, False: 84.9k]
  ------------------
  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|  53.0k|        constexpr auto max_size{MAX_STANDARD_TX_WEIGHT - TX_BODY_LEEWAY_WEIGHT - MAX_TAPSCRIPT_SAT_SIZE};
  279|  53.0k|        return max_size - GetSizeOfCompactSize(max_size);
  280|  53.0k|    }
  281|  84.9k|    return MAX_STANDARD_P2WSH_SCRIPT_SIZE;
  282|   137k|}
_ZN10miniscript8internal6MaxIntIjEC2Ej:
  356|  11.4M|    MaxInt(I val) : valid(true), value(val) {}
_ZN10miniscript8internal6MaxIntIjEC2Ev:
  355|   185M|    MaxInt() : valid(false), value(0) {}
_ZN10miniscript8internal3OpsC2EjNS0_6MaxIntIjEES3_:
  378|  2.38M|    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|   186M|    friend MaxInt<I> operator+(const MaxInt<I>& a, const MaxInt<I>& b) {
  359|   186M|        if (!a.valid || !b.valid) return {};
  ------------------
  |  Branch (359:13): [True: 182M, False: 4.45M]
  |  Branch (359:25): [True: 310k, False: 4.14M]
  ------------------
  360|  4.14M|        return a.value + b.value;
  361|   186M|    }
_ZN10miniscript8internalorERKNS0_6MaxIntIjEES4_:
  363|  93.5M|    friend MaxInt<I> operator|(const MaxInt<I>& a, const MaxInt<I>& b) {
  364|  93.5M|        if (!a.valid) return b;
  ------------------
  |  Branch (364:13): [True: 91.1M, False: 2.34M]
  ------------------
  365|  2.34M|        if (!b.valid) return a;
  ------------------
  |  Branch (365:13): [True: 961k, False: 1.38M]
  ------------------
  366|  1.38M|        return std::max(a.value, b.value);
  367|  2.34M|    }
_ZN10miniscript8internal7SatInfoC2Ev:
  431|   137M|    constexpr SatInfo() noexcept : valid(false), netdiff(0), exec(0) {}
_ZN10miniscript8internal7SatInfo4PushEv:
  461|   954k|    static constexpr SatInfo Push() noexcept { return {-1, 0}; }
_ZN10miniscript8internal9StackSizeC2ENS0_7SatInfoES2_:
  485|  2.27M|    constexpr StackSize(SatInfo in_sat, SatInfo in_dsat) noexcept : sat(in_sat), dsat(in_dsat) {};
_ZN10miniscript8internalplERKNS0_7SatInfoES3_:
  449|   141M|    {
  450|       |        // Concatenation with an empty set yields an empty set.
  451|   141M|        if (!a.valid || !b.valid) return {};
  ------------------
  |  Branch (451:13): [True: 136M, False: 4.63M]
  |  Branch (451:25): [True: 188k, False: 4.44M]
  ------------------
  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|  4.44M|        return {a.netdiff + b.netdiff, std::max(b.exec, b.netdiff + a.exec)};
  456|   141M|    }
_ZN10miniscript8internal7SatInfo3NopEv:
  465|  6.24k|    static constexpr SatInfo Nop() noexcept { return {0, 0}; }
_ZN10miniscript8internal9StackSizeC2ENS0_7SatInfoE:
  486|  5.58k|    constexpr StackSize(SatInfo in_both) noexcept : sat(in_both), dsat(in_both) {};
_ZN10miniscript8internal7SatInfo6OP_DUPEv:
  472|  35.0k|    static constexpr SatInfo OP_DUP() noexcept { return {-1, 0}; }
_ZN10miniscript8internal7SatInfo4HashEv:
  463|    625|    static constexpr SatInfo Hash() noexcept { return {0, 0}; }
_ZN10miniscript8internal7SatInfo14OP_EQUALVERIFYEv:
  474|    625|    static constexpr SatInfo OP_EQUALVERIFY() noexcept { return {2, 2}; }
_ZN10miniscript8internal7SatInfo7OP_SIZEEv:
  476|   814k|    static constexpr SatInfo OP_SIZE() noexcept { return {-1, 0}; }
_ZN10miniscript8internal7SatInfo8OP_EQUALEv:
  475|  9.58k|    static constexpr SatInfo OP_EQUAL() noexcept { return {1, 1}; }
_ZN10miniscript8internalorERKNS0_7SatInfoES3_:
  439|  46.7M|    {
  440|       |        // Union with an empty set is itself.
  441|  46.7M|        if (!a.valid) return b;
  ------------------
  |  Branch (441:13): [True: 45.5M, False: 1.17M]
  ------------------
  442|  1.17M|        if (!b.valid) return a;
  ------------------
  |  Branch (442:13): [True: 480k, False: 692k]
  ------------------
  443|       |        // Otherwise the netdiff and exec of the union is the maximum of the individual values.
  444|   692k|        return {std::max(a.netdiff, b.netdiff), std::max(a.exec, b.exec)};
  445|  1.17M|    }
_ZN10miniscript8internal7SatInfo2IfEv:
  467|  1.92M|    static constexpr SatInfo If() noexcept { return {1, 1}; }
_ZN10miniscript8internal7SatInfo8BinaryOpEv:
  469|  83.9k|    static constexpr SatInfo BinaryOp() noexcept { return {1, 1}; }
_ZN10miniscript8internal7SatInfo8OP_IFDUPEb:
  473|  11.2k|    static constexpr SatInfo OP_IFDUP(bool nonzero) noexcept { return {nonzero ? -1 : 0, 0}; }
  ------------------
  |  Branch (473:72): [True: 3.75k, False: 7.51k]
  ------------------
_ZN10miniscript8internal7SatInfoC2Eii:
  435|  9.88M|        valid{true}, netdiff{in_netdiff}, exec{in_exec} {}
_ZN10miniscript8internal7SatInfo11OP_CHECKSIGEv:
  477|  68.3k|    static constexpr SatInfo OP_CHECKSIG() noexcept { return {1, 1}; }
_ZN10miniscript8internal7SatInfo9OP_VERIFYEv:
  479|  15.4k|    static constexpr SatInfo OP_VERIFY() noexcept { return {1, 1}; }
_ZN10miniscript8internal7SatInfo12OP_0NOTEQUALEv:
  478|   814k|    static constexpr SatInfo OP_0NOTEQUAL() noexcept { return {0, 0}; }
_ZN10miniscript8internal7SatInfo5EmptyEv:
  459|  9.46k|    static constexpr SatInfo Empty() noexcept { return {0, 0}; }
_ZN10miniscript8internal11WitnessSizeC2ENS0_6MaxIntIjEES3_:
  495|  2.24M|    WitnessSize(MaxInt<uint32_t> in_sat, MaxInt<uint32_t> in_dsat) : sat(in_sat), dsat(in_dsat) {};
_ZNK10miniscript4TypeeqES0_:
  150|   194k|    constexpr bool operator==(Type x) const { return m_flags == x.m_flags; }
_ZNK10miniscript4Type2IfEb:
  153|  4.20M|    constexpr Type If(bool x) const { return Type(x ? m_flags : 0); }
  ------------------
  |  Branch (153:51): [True: 1.70M, False: 2.50M]
  ------------------
descriptor.cpp:_ZN10miniscript10FromStringIN12_GLOBAL__N_19KeyParserEEENSt3__110unique_ptrIKNS_4NodeINT_3KeyEEENS3_14default_deleteIS9_EEEERKNS3_12basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKS6_:
 2640|  6.07k|inline NodeRef<typename Ctx::Key> FromString(const std::string& str, const Ctx& ctx) {
 2641|  6.07k|    return internal::Parse<typename Ctx::Key>(str, ctx);
 2642|  6.07k|}
descriptor.cpp:_ZN10miniscript8internal5ParseIjN12_GLOBAL__N_19KeyParserEEENSt3__110unique_ptrIKNS_4NodeIT_EENS4_14default_deleteIS9_EEEE4SpanIKcERKT0_:
 1794|  6.07k|{
 1795|  6.07k|    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|  6.07k|    size_t script_size{1};
 1808|  6.07k|    size_t max_size{internal::MaxScriptSize(ctx.MsContext())};
 1809|       |
 1810|       |    // The two integers are used to hold state for thresh()
 1811|  6.07k|    std::vector<std::tuple<ParseContext, int64_t, int64_t>> to_parse;
 1812|  6.07k|    std::vector<NodeRef<Key>> constructed;
 1813|       |
 1814|  6.07k|    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|  6.07k|    const auto parse_multi_exp = [&](Span<const char>& in, const bool is_multi_a) -> bool {
 1818|  6.07k|        const auto max_keys{is_multi_a ? MAX_PUBKEYS_PER_MULTI_A : MAX_PUBKEYS_PER_MULTISIG};
 1819|  6.07k|        const auto required_ctx{is_multi_a ? MiniscriptContext::TAPSCRIPT : MiniscriptContext::P2WSH};
 1820|  6.07k|        if (ctx.MsContext() != required_ctx) return false;
 1821|       |        // Get threshold
 1822|  6.07k|        int next_comma = FindNextChar(in, ',');
 1823|  6.07k|        if (next_comma < 1) return false;
 1824|  6.07k|        const auto k_to_integral{ToIntegral<int64_t>(std::string_view(in.data(), next_comma))};
 1825|  6.07k|        if (!k_to_integral.has_value()) return false;
 1826|  6.07k|        const int64_t k{k_to_integral.value()};
 1827|  6.07k|        in = in.subspan(next_comma + 1);
 1828|       |        // Get keys. It is compatible for both compressed and x-only keys.
 1829|  6.07k|        std::vector<Key> keys;
 1830|  6.07k|        while (next_comma != -1) {
 1831|  6.07k|            next_comma = FindNextChar(in, ',');
 1832|  6.07k|            int key_length = (next_comma == -1) ? FindNextChar(in, ')') : next_comma;
 1833|  6.07k|            if (key_length < 1) return false;
 1834|  6.07k|            auto key = ctx.FromString(in.begin(), in.begin() + key_length);
 1835|  6.07k|            if (!key) return false;
 1836|  6.07k|            keys.push_back(std::move(*key));
 1837|  6.07k|            in = in.subspan(key_length + 1);
 1838|  6.07k|        }
 1839|  6.07k|        if (keys.size() < 1 || keys.size() > max_keys) return false;
 1840|  6.07k|        if (k < 1 || k > (int64_t)keys.size()) return false;
 1841|  6.07k|        if (is_multi_a) {
 1842|       |            // (push + xonly-key + CHECKSIG[ADD]) * n + k + OP_NUMEQUAL(VERIFY), minus one.
 1843|  6.07k|            script_size += (1 + 32 + 1) * keys.size() + BuildScript(k).size();
 1844|  6.07k|            constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::MULTI_A, std::move(keys), k));
 1845|  6.07k|        } else {
 1846|  6.07k|            script_size += 2 + (keys.size() > 16) + (k > 16) + 34 * keys.size();
 1847|  6.07k|            constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::MULTI, std::move(keys), k));
 1848|  6.07k|        }
 1849|  6.07k|        return true;
 1850|  6.07k|    };
 1851|       |
 1852|  1.62M|    while (!to_parse.empty()) {
  ------------------
  |  Branch (1852:12): [True: 1.62M, False: 3.63k]
  ------------------
 1853|  1.62M|        if (script_size > max_size) return {};
  ------------------
  |  Branch (1853:13): [True: 5, False: 1.62M]
  ------------------
 1854|       |
 1855|       |        // Get the current context we are decoding within
 1856|  1.62M|        auto [cur_context, n, k] = to_parse.back();
 1857|  1.62M|        to_parse.pop_back();
 1858|       |
 1859|  1.62M|        switch (cur_context) {
  ------------------
  |  Branch (1859:17): [True: 0, False: 1.62M]
  ------------------
 1860|   152k|        case ParseContext::WRAPPED_EXPR: {
  ------------------
  |  Branch (1860:9): [True: 152k, False: 1.46M]
  ------------------
 1861|   152k|            std::optional<size_t> colon_index{};
 1862|  1.39M|            for (size_t i = 1; i < in.size(); ++i) {
  ------------------
  |  Branch (1862:32): [True: 1.39M, False: 374]
  ------------------
 1863|  1.39M|                if (in[i] == ':') {
  ------------------
  |  Branch (1863:21): [True: 35.6k, False: 1.36M]
  ------------------
 1864|  35.6k|                    colon_index = i;
 1865|  35.6k|                    break;
 1866|  35.6k|                }
 1867|  1.36M|                if (in[i] < 'a' || in[i] > 'z') break;
  ------------------
  |  Branch (1867:21): [True: 116k, False: 1.24M]
  |  Branch (1867:36): [True: 17, False: 1.24M]
  ------------------
 1868|  1.36M|            }
 1869|       |            // If there is no colon, this loop won't execute
 1870|   152k|            bool last_was_v{false};
 1871|  1.33M|            for (size_t j = 0; colon_index && j < *colon_index; ++j) {
  ------------------
  |  Branch (1871:32): [True: 1.21M, False: 116k]
  |  Branch (1871:47): [True: 1.17M, False: 35.6k]
  ------------------
 1872|  1.17M|                if (script_size > max_size) return {};
  ------------------
  |  Branch (1872:21): [True: 1, False: 1.17M]
  ------------------
 1873|  1.17M|                if (in[j] == 'a') {
  ------------------
  |  Branch (1873:21): [True: 20.8k, False: 1.15M]
  ------------------
 1874|  20.8k|                    script_size += 2;
 1875|  20.8k|                    to_parse.emplace_back(ParseContext::ALT, -1, -1);
 1876|  1.15M|                } else if (in[j] == 's') {
  ------------------
  |  Branch (1876:28): [True: 5.41k, False: 1.15M]
  ------------------
 1877|  5.41k|                    script_size += 1;
 1878|  5.41k|                    to_parse.emplace_back(ParseContext::SWAP, -1, -1);
 1879|  1.15M|                } else if (in[j] == 'c') {
  ------------------
  |  Branch (1879:28): [True: 32.6k, False: 1.11M]
  ------------------
 1880|  32.6k|                    script_size += 1;
 1881|  32.6k|                    to_parse.emplace_back(ParseContext::CHECK, -1, -1);
 1882|  1.11M|                } else if (in[j] == 'd') {
  ------------------
  |  Branch (1882:28): [True: 17.9k, False: 1.10M]
  ------------------
 1883|  17.9k|                    script_size += 3;
 1884|  17.9k|                    to_parse.emplace_back(ParseContext::DUP_IF, -1, -1);
 1885|  1.10M|                } else if (in[j] == 'j') {
  ------------------
  |  Branch (1885:28): [True: 216k, False: 884k]
  ------------------
 1886|   216k|                    script_size += 4;
 1887|   216k|                    to_parse.emplace_back(ParseContext::NON_ZERO, -1, -1);
 1888|   884k|                } else if (in[j] == 'n') {
  ------------------
  |  Branch (1888:28): [True: 60.6k, False: 824k]
  ------------------
 1889|  60.6k|                    script_size += 1;
 1890|  60.6k|                    to_parse.emplace_back(ParseContext::ZERO_NOTEQUAL, -1, -1);
 1891|   824k|                } else if (in[j] == 'v') {
  ------------------
  |  Branch (1891:28): [True: 13.8k, False: 810k]
  ------------------
 1892|       |                    // do not permit "...vv...:"; it's not valid, and also doesn't trigger early
 1893|       |                    // failure as script_size isn't incremented.
 1894|  13.8k|                    if (last_was_v) return {};
  ------------------
  |  Branch (1894:25): [True: 2, False: 13.8k]
  ------------------
 1895|  13.8k|                    to_parse.emplace_back(ParseContext::VERIFY, -1, -1);
 1896|   810k|                } else if (in[j] == 'u') {
  ------------------
  |  Branch (1896:28): [True: 385k, False: 424k]
  ------------------
 1897|   385k|                    script_size += 4;
 1898|   385k|                    to_parse.emplace_back(ParseContext::WRAP_U, -1, -1);
 1899|   424k|                } else if (in[j] == 't') {
  ------------------
  |  Branch (1899:28): [True: 309k, False: 115k]
  ------------------
 1900|   309k|                    script_size += 1;
 1901|   309k|                    to_parse.emplace_back(ParseContext::WRAP_T, -1, -1);
 1902|   309k|                } else if (in[j] == 'l') {
  ------------------
  |  Branch (1902:28): [True: 115k, False: 27]
  ------------------
 1903|       |                    // The l: wrapper is equivalent to or_i(0,X)
 1904|   115k|                    script_size += 4;
 1905|   115k|                    constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_0));
 1906|   115k|                    to_parse.emplace_back(ParseContext::OR_I, -1, -1);
 1907|   115k|                } else {
 1908|     27|                    return {};
 1909|     27|                }
 1910|  1.17M|                last_was_v = (in[j] == 'v');
 1911|  1.17M|            }
 1912|   152k|            to_parse.emplace_back(ParseContext::EXPR, -1, -1);
 1913|   152k|            if (colon_index) in = in.subspan(*colon_index + 1);
  ------------------
  |  Branch (1913:17): [True: 35.6k, False: 116k]
  ------------------
 1914|   152k|            break;
 1915|   152k|        }
 1916|   152k|        case ParseContext::EXPR: {
  ------------------
  |  Branch (1916:9): [True: 152k, False: 1.46M]
  ------------------
 1917|   152k|            if (Const("0", in)) {
  ------------------
  |  Branch (1917:17): [True: 40.5k, False: 112k]
  ------------------
 1918|  40.5k|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_0));
 1919|   112k|            } else if (Const("1", in)) {
  ------------------
  |  Branch (1919:24): [True: 55.4k, False: 56.5k]
  ------------------
 1920|  55.4k|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::JUST_1));
 1921|  56.5k|            } else if (Const("pk(", in)) {
  ------------------
  |  Branch (1921:24): [True: 1.29k, False: 55.2k]
  ------------------
 1922|  1.29k|                auto res = ParseKeyEnd<Key, Ctx>(in, ctx);
 1923|  1.29k|                if (!res) return {};
  ------------------
  |  Branch (1923:21): [True: 99, False: 1.19k]
  ------------------
 1924|  1.19k|                auto& [key, key_size] = *res;
 1925|  1.19k|                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|  1.19k|                in = in.subspan(key_size + 1);
 1927|  1.19k|                script_size += IsTapscript(ctx.MsContext()) ? 33 : 34;
  ------------------
  |  Branch (1927:32): [True: 1.08k, False: 111]
  ------------------
 1928|  55.2k|            } else if (Const("pkh(", in)) {
  ------------------
  |  Branch (1928:24): [True: 343, False: 54.9k]
  ------------------
 1929|    343|                auto res = ParseKeyEnd<Key>(in, ctx);
 1930|    343|                if (!res) return {};
  ------------------
  |  Branch (1930:21): [True: 19, False: 324]
  ------------------
 1931|    324|                auto& [key, key_size] = *res;
 1932|    324|                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|    324|                in = in.subspan(key_size + 1);
 1934|    324|                script_size += 24;
 1935|  54.9k|            } else if (Const("pk_k(", in)) {
  ------------------
  |  Branch (1935:24): [True: 23, False: 54.9k]
  ------------------
 1936|     23|                auto res = ParseKeyEnd<Key>(in, ctx);
 1937|     23|                if (!res) return {};
  ------------------
  |  Branch (1937:21): [True: 1, False: 22]
  ------------------
 1938|     22|                auto& [key, key_size] = *res;
 1939|     22|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::PK_K, Vector(std::move(key))));
 1940|     22|                in = in.subspan(key_size + 1);
 1941|     22|                script_size += IsTapscript(ctx.MsContext()) ? 32 : 33;
  ------------------
  |  Branch (1941:32): [True: 18, False: 4]
  ------------------
 1942|  54.9k|            } else if (Const("pk_h(", in)) {
  ------------------
  |  Branch (1942:24): [True: 42, False: 54.8k]
  ------------------
 1943|     42|                auto res = ParseKeyEnd<Key>(in, ctx);
 1944|     42|                if (!res) return {};
  ------------------
  |  Branch (1944:21): [True: 13, False: 29]
  ------------------
 1945|     29|                auto& [key, key_size] = *res;
 1946|     29|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::PK_H, Vector(std::move(key))));
 1947|     29|                in = in.subspan(key_size + 1);
 1948|     29|                script_size += 23;
 1949|  54.8k|            } else if (Const("sha256(", in)) {
  ------------------
  |  Branch (1949:24): [True: 28, False: 54.8k]
  ------------------
 1950|     28|                auto res = ParseHexStrEnd(in, 32, ctx);
 1951|     28|                if (!res) return {};
  ------------------
  |  Branch (1951:21): [True: 26, False: 2]
  ------------------
 1952|      2|                auto& [hash, hash_size] = *res;
 1953|      2|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::SHA256, std::move(hash)));
 1954|      2|                in = in.subspan(hash_size + 1);
 1955|      2|                script_size += 38;
 1956|  54.8k|            } else if (Const("ripemd160(", in)) {
  ------------------
  |  Branch (1956:24): [True: 22, False: 54.8k]
  ------------------
 1957|     22|                auto res = ParseHexStrEnd(in, 20, ctx);
 1958|     22|                if (!res) return {};
  ------------------
  |  Branch (1958:21): [True: 11, False: 11]
  ------------------
 1959|     11|                auto& [hash, hash_size] = *res;
 1960|     11|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::RIPEMD160, std::move(hash)));
 1961|     11|                in = in.subspan(hash_size + 1);
 1962|     11|                script_size += 26;
 1963|  54.8k|            } else if (Const("hash256(", in)) {
  ------------------
  |  Branch (1963:24): [True: 2, False: 54.8k]
  ------------------
 1964|      2|                auto res = ParseHexStrEnd(in, 32, ctx);
 1965|      2|                if (!res) return {};
  ------------------
  |  Branch (1965:21): [True: 1, False: 1]
  ------------------
 1966|      1|                auto& [hash, hash_size] = *res;
 1967|      1|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::HASH256, std::move(hash)));
 1968|      1|                in = in.subspan(hash_size + 1);
 1969|      1|                script_size += 38;
 1970|  54.8k|            } else if (Const("hash160(", in)) {
  ------------------
  |  Branch (1970:24): [True: 115, False: 54.7k]
  ------------------
 1971|    115|                auto res = ParseHexStrEnd(in, 20, ctx);
 1972|    115|                if (!res) return {};
  ------------------
  |  Branch (1972:21): [True: 7, False: 108]
  ------------------
 1973|    108|                auto& [hash, hash_size] = *res;
 1974|    108|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::HASH160, std::move(hash)));
 1975|    108|                in = in.subspan(hash_size + 1);
 1976|    108|                script_size += 26;
 1977|  54.7k|            } else if (Const("after(", in)) {
  ------------------
  |  Branch (1977:24): [True: 3.59k, False: 51.1k]
  ------------------
 1978|  3.59k|                int arg_size = FindNextChar(in, ')');
 1979|  3.59k|                if (arg_size < 1) return {};
  ------------------
  |  Branch (1979:21): [True: 2, False: 3.58k]
  ------------------
 1980|  3.58k|                const auto num{ToIntegral<int64_t>(std::string_view(in.data(), arg_size))};
 1981|  3.58k|                if (!num.has_value() || *num < 1 || *num >= 0x80000000L) return {};
  ------------------
  |  Branch (1981:21): [True: 47, False: 3.54k]
  |  Branch (1981:41): [True: 121, False: 3.42k]
  |  Branch (1981:53): [True: 32, False: 3.38k]
  ------------------
 1982|  3.38k|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::AFTER, *num));
 1983|  3.38k|                in = in.subspan(arg_size + 1);
 1984|  3.38k|                script_size += 1 + (*num > 16) + (*num > 0x7f) + (*num > 0x7fff) + (*num > 0x7fffff);
 1985|  51.1k|            } else if (Const("older(", in)) {
  ------------------
  |  Branch (1985:24): [True: 3.00k, False: 48.1k]
  ------------------
 1986|  3.00k|                int arg_size = FindNextChar(in, ')');
 1987|  3.00k|                if (arg_size < 1) return {};
  ------------------
  |  Branch (1987:21): [True: 3, False: 3.00k]
  ------------------
 1988|  3.00k|                const auto num{ToIntegral<int64_t>(std::string_view(in.data(), arg_size))};
 1989|  3.00k|                if (!num.has_value() || *num < 1 || *num >= 0x80000000L) return {};
  ------------------
  |  Branch (1989:21): [True: 46, False: 2.95k]
  |  Branch (1989:41): [True: 81, False: 2.87k]
  |  Branch (1989:53): [True: 30, False: 2.84k]
  ------------------
 1990|  2.84k|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::OLDER, *num));
 1991|  2.84k|                in = in.subspan(arg_size + 1);
 1992|  2.84k|                script_size += 1 + (*num > 16) + (*num > 0x7f) + (*num > 0x7fff) + (*num > 0x7fffff);
 1993|  48.1k|            } else if (Const("multi(", in)) {
  ------------------
  |  Branch (1993:24): [True: 2.73k, False: 45.3k]
  ------------------
 1994|  2.73k|                if (!parse_multi_exp(in, /* is_multi_a = */false)) return {};
  ------------------
  |  Branch (1994:21): [True: 244, False: 2.48k]
  ------------------
 1995|  45.3k|            } else if (Const("multi_a(", in)) {
  ------------------
  |  Branch (1995:24): [True: 207, False: 45.1k]
  ------------------
 1996|    207|                if (!parse_multi_exp(in, /* is_multi_a = */true)) return {};
  ------------------
  |  Branch (1996:21): [True: 130, False: 77]
  ------------------
 1997|  45.1k|            } else if (Const("thresh(", in)) {
  ------------------
  |  Branch (1997:24): [True: 5.92k, False: 39.2k]
  ------------------
 1998|  5.92k|                int next_comma = FindNextChar(in, ',');
 1999|  5.92k|                if (next_comma < 1) return {};
  ------------------
  |  Branch (1999:21): [True: 4, False: 5.91k]
  ------------------
 2000|  5.91k|                const auto k{ToIntegral<int64_t>(std::string_view(in.data(), next_comma))};
 2001|  5.91k|                if (!k.has_value() || *k < 1) return {};
  ------------------
  |  Branch (2001:21): [True: 14, False: 5.90k]
  |  Branch (2001:39): [True: 56, False: 5.84k]
  ------------------
 2002|  5.84k|                in = in.subspan(next_comma + 1);
 2003|       |                // n = 1 here because we read the first WRAPPED_EXPR before reaching THRESH
 2004|  5.84k|                to_parse.emplace_back(ParseContext::THRESH, 1, *k);
 2005|  5.84k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2006|  5.84k|                script_size += 2 + (*k > 16) + (*k > 0x7f) + (*k > 0x7fff) + (*k > 0x7fffff);
 2007|  39.2k|            } else if (Const("andor(", in)) {
  ------------------
  |  Branch (2007:24): [True: 4.94k, False: 34.3k]
  ------------------
 2008|  4.94k|                to_parse.emplace_back(ParseContext::ANDOR, -1, -1);
 2009|  4.94k|                to_parse.emplace_back(ParseContext::CLOSE_BRACKET, -1, -1);
 2010|  4.94k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2011|  4.94k|                to_parse.emplace_back(ParseContext::COMMA, -1, -1);
 2012|  4.94k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2013|  4.94k|                to_parse.emplace_back(ParseContext::COMMA, -1, -1);
 2014|  4.94k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2015|  4.94k|                script_size += 5;
 2016|  34.3k|            } else {
 2017|  34.3k|                if (Const("and_n(", in)) {
  ------------------
  |  Branch (2017:21): [True: 1.89k, False: 32.4k]
  ------------------
 2018|  1.89k|                    to_parse.emplace_back(ParseContext::AND_N, -1, -1);
 2019|  1.89k|                    script_size += 5;
 2020|  32.4k|                } else if (Const("and_b(", in)) {
  ------------------
  |  Branch (2020:28): [True: 8.86k, False: 23.5k]
  ------------------
 2021|  8.86k|                    to_parse.emplace_back(ParseContext::AND_B, -1, -1);
 2022|  8.86k|                    script_size += 2;
 2023|  23.5k|                } else if (Const("and_v(", in)) {
  ------------------
  |  Branch (2023:28): [True: 1.28k, False: 22.2k]
  ------------------
 2024|  1.28k|                    to_parse.emplace_back(ParseContext::AND_V, -1, -1);
 2025|  1.28k|                    script_size += 1;
 2026|  22.2k|                } else if (Const("or_b(", in)) {
  ------------------
  |  Branch (2026:28): [True: 9.72k, False: 12.5k]
  ------------------
 2027|  9.72k|                    to_parse.emplace_back(ParseContext::OR_B, -1, -1);
 2028|  9.72k|                    script_size += 2;
 2029|  12.5k|                } else if (Const("or_c(", in)) {
  ------------------
  |  Branch (2029:28): [True: 4.28k, False: 8.27k]
  ------------------
 2030|  4.28k|                    to_parse.emplace_back(ParseContext::OR_C, -1, -1);
 2031|  4.28k|                    script_size += 3;
 2032|  8.27k|                } else if (Const("or_d(", in)) {
  ------------------
  |  Branch (2032:28): [True: 5.01k, False: 3.25k]
  ------------------
 2033|  5.01k|                    to_parse.emplace_back(ParseContext::OR_D, -1, -1);
 2034|  5.01k|                    script_size += 4;
 2035|  5.01k|                } else if (Const("or_i(", in)) {
  ------------------
  |  Branch (2035:28): [True: 2.29k, False: 958]
  ------------------
 2036|  2.29k|                    to_parse.emplace_back(ParseContext::OR_I, -1, -1);
 2037|  2.29k|                    script_size += 4;
 2038|  2.29k|                } else {
 2039|    958|                    return {};
 2040|    958|                }
 2041|  33.3k|                to_parse.emplace_back(ParseContext::CLOSE_BRACKET, -1, -1);
 2042|  33.3k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2043|  33.3k|                to_parse.emplace_back(ParseContext::COMMA, -1, -1);
 2044|  33.3k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2045|  33.3k|            }
 2046|   150k|            break;
 2047|   152k|        }
 2048|   150k|        case ParseContext::ALT: {
  ------------------
  |  Branch (2048:9): [True: 16.5k, False: 1.60M]
  ------------------
 2049|  16.5k|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_A, Vector(std::move(constructed.back())));
 2050|  16.5k|            break;
 2051|   152k|        }
 2052|  4.98k|        case ParseContext::SWAP: {
  ------------------
  |  Branch (2052:9): [True: 4.98k, False: 1.61M]
  ------------------
 2053|  4.98k|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_S, Vector(std::move(constructed.back())));
 2054|  4.98k|            break;
 2055|   152k|        }
 2056|  31.5k|        case ParseContext::CHECK: {
  ------------------
  |  Branch (2056:9): [True: 31.5k, False: 1.58M]
  ------------------
 2057|  31.5k|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_C, Vector(std::move(constructed.back())));
 2058|  31.5k|            break;
 2059|   152k|        }
 2060|  17.1k|        case ParseContext::DUP_IF: {
  ------------------
  |  Branch (2060:9): [True: 17.1k, False: 1.60M]
  ------------------
 2061|  17.1k|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_D, Vector(std::move(constructed.back())));
 2062|  17.1k|            break;
 2063|   152k|        }
 2064|   215k|        case ParseContext::NON_ZERO: {
  ------------------
  |  Branch (2064:9): [True: 215k, False: 1.40M]
  ------------------
 2065|   215k|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_J, Vector(std::move(constructed.back())));
 2066|   215k|            break;
 2067|   152k|        }
 2068|  58.8k|        case ParseContext::ZERO_NOTEQUAL: {
  ------------------
  |  Branch (2068:9): [True: 58.8k, False: 1.56M]
  ------------------
 2069|  58.8k|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_N, Vector(std::move(constructed.back())));
 2070|  58.8k|            break;
 2071|   152k|        }
 2072|  13.4k|        case ParseContext::VERIFY: {
  ------------------
  |  Branch (2072:9): [True: 13.4k, False: 1.60M]
  ------------------
 2073|  13.4k|            script_size += (constructed.back()->GetType() << "x"_mst);
 2074|  13.4k|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::WRAP_V, Vector(std::move(constructed.back())));
 2075|  13.4k|            break;
 2076|   152k|        }
 2077|   382k|        case ParseContext::WRAP_U: {
  ------------------
  |  Branch (2077:9): [True: 382k, False: 1.23M]
  ------------------
 2078|   382k|            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|   382k|            break;
 2080|   152k|        }
 2081|   307k|        case ParseContext::WRAP_T: {
  ------------------
  |  Branch (2081:9): [True: 307k, False: 1.31M]
  ------------------
 2082|   307k|            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|   307k|            break;
 2084|   152k|        }
 2085|  5.69k|        case ParseContext::AND_B: {
  ------------------
  |  Branch (2085:9): [True: 5.69k, False: 1.61M]
  ------------------
 2086|  5.69k|            BuildBack(ctx.MsContext(), Fragment::AND_B, constructed);
 2087|  5.69k|            break;
 2088|   152k|        }
 2089|  1.09k|        case ParseContext::AND_N: {
  ------------------
  |  Branch (2089:9): [True: 1.09k, False: 1.61M]
  ------------------
 2090|  1.09k|            auto mid = std::move(constructed.back());
 2091|  1.09k|            constructed.pop_back();
 2092|  1.09k|            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|  1.09k|            break;
 2094|   152k|        }
 2095|    458|        case ParseContext::AND_V: {
  ------------------
  |  Branch (2095:9): [True: 458, False: 1.62M]
  ------------------
 2096|    458|            BuildBack(ctx.MsContext(), Fragment::AND_V, constructed);
 2097|    458|            break;
 2098|   152k|        }
 2099|  6.25k|        case ParseContext::OR_B: {
  ------------------
  |  Branch (2099:9): [True: 6.25k, False: 1.61M]
  ------------------
 2100|  6.25k|            BuildBack(ctx.MsContext(), Fragment::OR_B, constructed);
 2101|  6.25k|            break;
 2102|   152k|        }
 2103|  2.75k|        case ParseContext::OR_C: {
  ------------------
  |  Branch (2103:9): [True: 2.75k, False: 1.61M]
  ------------------
 2104|  2.75k|            BuildBack(ctx.MsContext(), Fragment::OR_C, constructed);
 2105|  2.75k|            break;
 2106|   152k|        }
 2107|  3.62k|        case ParseContext::OR_D: {
  ------------------
  |  Branch (2107:9): [True: 3.62k, False: 1.61M]
  ------------------
 2108|  3.62k|            BuildBack(ctx.MsContext(), Fragment::OR_D, constructed);
 2109|  3.62k|            break;
 2110|   152k|        }
 2111|   112k|        case ParseContext::OR_I: {
  ------------------
  |  Branch (2111:9): [True: 112k, False: 1.50M]
  ------------------
 2112|   112k|            BuildBack(ctx.MsContext(), Fragment::OR_I, constructed);
 2113|   112k|            break;
 2114|   152k|        }
 2115|  2.89k|        case ParseContext::ANDOR: {
  ------------------
  |  Branch (2115:9): [True: 2.89k, False: 1.61M]
  ------------------
 2116|  2.89k|            auto right = std::move(constructed.back());
 2117|  2.89k|            constructed.pop_back();
 2118|  2.89k|            auto mid = std::move(constructed.back());
 2119|  2.89k|            constructed.pop_back();
 2120|  2.89k|            constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::ANDOR, Vector(std::move(constructed.back()), std::move(mid), std::move(right)));
 2121|  2.89k|            break;
 2122|   152k|        }
 2123|  69.6k|        case ParseContext::THRESH: {
  ------------------
  |  Branch (2123:9): [True: 69.6k, False: 1.55M]
  ------------------
 2124|  69.6k|            if (in.size() < 1) return {};
  ------------------
  |  Branch (2124:17): [True: 95, False: 69.5k]
  ------------------
 2125|  69.5k|            if (in[0] == ',') {
  ------------------
  |  Branch (2125:17): [True: 64.7k, False: 4.82k]
  ------------------
 2126|  64.7k|                in = in.subspan(1);
 2127|  64.7k|                to_parse.emplace_back(ParseContext::THRESH, n+1, k);
 2128|  64.7k|                to_parse.emplace_back(ParseContext::WRAPPED_EXPR, -1, -1);
 2129|  64.7k|                script_size += 2;
 2130|  64.7k|            } else if (in[0] == ')') {
  ------------------
  |  Branch (2130:24): [True: 4.76k, False: 58]
  ------------------
 2131|  4.76k|                if (k > n) return {};
  ------------------
  |  Branch (2131:21): [True: 87, False: 4.67k]
  ------------------
 2132|  4.67k|                in = in.subspan(1);
 2133|       |                // Children are constructed in reverse order, so iterate from end to beginning
 2134|  4.67k|                std::vector<NodeRef<Key>> subs;
 2135|  69.1k|                for (int i = 0; i < n; ++i) {
  ------------------
  |  Branch (2135:33): [True: 64.4k, False: 4.67k]
  ------------------
 2136|  64.4k|                    subs.push_back(std::move(constructed.back()));
 2137|  64.4k|                    constructed.pop_back();
 2138|  64.4k|                }
 2139|  4.67k|                std::reverse(subs.begin(), subs.end());
 2140|  4.67k|                constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::THRESH, std::move(subs), k));
 2141|  4.67k|            } else {
 2142|     58|                return {};
 2143|     58|            }
 2144|  69.4k|            break;
 2145|  69.5k|        }
 2146|  69.4k|        case ParseContext::COMMA: {
  ------------------
  |  Branch (2146:9): [True: 37.6k, False: 1.58M]
  ------------------
 2147|  37.6k|            if (in.size() < 1 || in[0] != ',') return {};
  ------------------
  |  Branch (2147:17): [True: 11, False: 37.6k]
  |  Branch (2147:34): [True: 80, False: 37.5k]
  ------------------
 2148|  37.5k|            in = in.subspan(1);
 2149|  37.5k|            break;
 2150|  37.6k|        }
 2151|  24.6k|        case ParseContext::CLOSE_BRACKET: {
  ------------------
  |  Branch (2151:9): [True: 24.6k, False: 1.59M]
  ------------------
 2152|  24.6k|            if (in.size() < 1 || in[0] != ')') return {};
  ------------------
  |  Branch (2152:17): [True: 48, False: 24.5k]
  |  Branch (2152:34): [True: 81, False: 24.4k]
  ------------------
 2153|  24.4k|            in = in.subspan(1);
 2154|  24.4k|            break;
 2155|  24.6k|        }
 2156|  1.62M|        }
 2157|  1.62M|    }
 2158|       |
 2159|       |    // Sanity checks on the produced miniscript
 2160|  3.63k|    assert(constructed.size() == 1);
 2161|  3.63k|    assert(constructed[0]->ScriptSize() == script_size);
 2162|  3.63k|    if (in.size() > 0) return {};
  ------------------
  |  Branch (2162:9): [True: 121, False: 3.51k]
  ------------------
 2163|  3.51k|    NodeRef<Key> tl_node = std::move(constructed.front());
 2164|  3.51k|    tl_node->DuplicateKeyCheck(ctx);
 2165|  3.51k|    return tl_node;
 2166|  3.63k|}
_ZN10miniscript11MakeNodeRefIjJNS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentEEEENSt3__110unique_ptrIKNS_4NodeIT_EENS5_14default_deleteISA_EEEEDpOT0_:
  196|   903k|NodeRef<Key> MakeNodeRef(Args&&... args) { return std::make_unique<const Node<Key>>(std::forward<Args>(args)...); }
_ZN10miniscript4NodeIjEC2ENS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentEj:
 1670|   909k|        : fragment(nt), k(val), m_script_ctx{script_ctx}, ops(CalcOps()), ss(CalcStackSize()), ws(CalcWitnessSize()), typ(CalcType()), scriptlen(CalcScriptLen()) {}
_ZNK10miniscript4NodeIjE7CalcOpsEv:
  944|  2.38M|    internal::Ops CalcOps() const {
  945|  2.38M|        switch (fragment) {
  ------------------
  |  Branch (945:17): [True: 0, False: 2.38M]
  ------------------
  946|   365k|            case Fragment::JUST_1: return {0, 0, {}};
  ------------------
  |  Branch (946:13): [True: 365k, False: 2.02M]
  ------------------
  947|   570k|            case Fragment::JUST_0: return {0, {}, 0};
  ------------------
  |  Branch (947:13): [True: 570k, False: 1.81M]
  ------------------
  948|  2.23k|            case Fragment::PK_K: return {0, 0, 0};
  ------------------
  |  Branch (948:13): [True: 2.23k, False: 2.38M]
  ------------------
  949|    503|            case Fragment::PK_H: return {3, 0, 0};
  ------------------
  |  Branch (949:13): [True: 503, False: 2.38M]
  ------------------
  950|  2.84k|            case Fragment::OLDER:
  ------------------
  |  Branch (950:13): [True: 2.84k, False: 2.38M]
  ------------------
  951|  6.24k|            case Fragment::AFTER: return {1, 0, {}};
  ------------------
  |  Branch (951:13): [True: 3.39k, False: 2.38M]
  ------------------
  952|      2|            case Fragment::SHA256:
  ------------------
  |  Branch (952:13): [True: 2, False: 2.38M]
  ------------------
  953|     13|            case Fragment::RIPEMD160:
  ------------------
  |  Branch (953:13): [True: 11, False: 2.38M]
  ------------------
  954|     14|            case Fragment::HASH256:
  ------------------
  |  Branch (954:13): [True: 1, False: 2.38M]
  ------------------
  955|    122|            case Fragment::HASH160: return {4, 0, {}};
  ------------------
  |  Branch (955:13): [True: 108, False: 2.38M]
  ------------------
  956|   310k|            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: 310k, False: 2.07M]
  ------------------
  957|  5.71k|            case Fragment::AND_B: {
  ------------------
  |  Branch (957:13): [True: 5.71k, False: 2.38M]
  ------------------
  958|  5.71k|                const auto count{1 + subs[0]->ops.count + subs[1]->ops.count};
  959|  5.71k|                const auto sat{subs[0]->ops.sat + subs[1]->ops.sat};
  960|  5.71k|                const auto dsat{subs[0]->ops.dsat + subs[1]->ops.dsat};
  961|  5.71k|                return {count, sat, dsat};
  962|     14|            }
  963|  6.25k|            case Fragment::OR_B: {
  ------------------
  |  Branch (963:13): [True: 6.25k, False: 2.38M]
  ------------------
  964|  6.25k|                const auto count{1 + subs[0]->ops.count + subs[1]->ops.count};
  965|  6.25k|                const auto sat{(subs[0]->ops.sat + subs[1]->ops.dsat) | (subs[1]->ops.sat + subs[0]->ops.dsat)};
  966|  6.25k|                const auto dsat{subs[0]->ops.dsat + subs[1]->ops.dsat};
  967|  6.25k|                return {count, sat, dsat};
  968|     14|            }
  969|  3.75k|            case Fragment::OR_D: {
  ------------------
  |  Branch (969:13): [True: 3.75k, False: 2.38M]
  ------------------
  970|  3.75k|                const auto count{3 + subs[0]->ops.count + subs[1]->ops.count};
  971|  3.75k|                const auto sat{subs[0]->ops.sat | (subs[1]->ops.sat + subs[0]->ops.dsat)};
  972|  3.75k|                const auto dsat{subs[0]->ops.dsat + subs[1]->ops.dsat};
  973|  3.75k|                return {count, sat, dsat};
  974|     14|            }
  975|  2.75k|            case Fragment::OR_C: {
  ------------------
  |  Branch (975:13): [True: 2.75k, False: 2.38M]
  ------------------
  976|  2.75k|                const auto count{2 + subs[0]->ops.count + subs[1]->ops.count};
  977|  2.75k|                const auto sat{subs[0]->ops.sat | (subs[1]->ops.sat + subs[0]->ops.dsat)};
  978|  2.75k|                return {count, sat, {}};
  979|     14|            }
  980|   524k|            case Fragment::OR_I: {
  ------------------
  |  Branch (980:13): [True: 524k, False: 1.86M]
  ------------------
  981|   524k|                const auto count{3 + subs[0]->ops.count + subs[1]->ops.count};
  982|   524k|                const auto sat{subs[0]->ops.sat | subs[1]->ops.sat};
  983|   524k|                const auto dsat{subs[0]->ops.dsat | subs[1]->ops.dsat};
  984|   524k|                return {count, sat, dsat};
  985|     14|            }
  986|  3.99k|            case Fragment::ANDOR: {
  ------------------
  |  Branch (986:13): [True: 3.99k, False: 2.38M]
  ------------------
  987|  3.99k|                const auto count{3 + subs[0]->ops.count + subs[1]->ops.count + subs[2]->ops.count};
  988|  3.99k|                const auto sat{(subs[1]->ops.sat + subs[0]->ops.sat) | (subs[0]->ops.dsat + subs[2]->ops.sat)};
  989|  3.99k|                const auto dsat{subs[0]->ops.dsat + subs[2]->ops.dsat};
  990|  3.99k|                return {count, sat, dsat};
  991|     14|            }
  992|  2.72k|            case Fragment::MULTI: return {1, (uint32_t)keys.size(), (uint32_t)keys.size()};
  ------------------
  |  Branch (992:13): [True: 2.72k, False: 2.38M]
  ------------------
  993|    123|            case Fragment::MULTI_A: return {(uint32_t)keys.size() + 1, 0, 0};
  ------------------
  |  Branch (993:13): [True: 123, False: 2.38M]
  ------------------
  994|  5.05k|            case Fragment::WRAP_S:
  ------------------
  |  Branch (994:13): [True: 5.05k, False: 2.38M]
  ------------------
  995|  39.2k|            case Fragment::WRAP_C:
  ------------------
  |  Branch (995:13): [True: 34.1k, False: 2.35M]
  ------------------
  996|   122k|            case Fragment::WRAP_N: return {1 + subs[0]->ops.count, subs[0]->ops.sat, subs[0]->ops.dsat};
  ------------------
  |  Branch (996:13): [True: 82.9k, False: 2.30M]
  ------------------
  997|  16.7k|            case Fragment::WRAP_A: return {2 + subs[0]->ops.count, subs[0]->ops.sat, subs[0]->ops.dsat};
  ------------------
  |  Branch (997:13): [True: 16.7k, False: 2.37M]
  ------------------
  998|  17.2k|            case Fragment::WRAP_D: return {3 + subs[0]->ops.count, subs[0]->ops.sat, 0};
  ------------------
  |  Branch (998:13): [True: 17.2k, False: 2.37M]
  ------------------
  999|   407k|            case Fragment::WRAP_J: return {4 + subs[0]->ops.count, subs[0]->ops.sat, 0};
  ------------------
  |  Branch (999:13): [True: 407k, False: 1.98M]
  ------------------
 1000|  15.4k|            case Fragment::WRAP_V: return {subs[0]->ops.count + (subs[0]->GetType() << "x"_mst), subs[0]->ops.sat, {}};
  ------------------
  |  Branch (1000:13): [True: 15.4k, False: 2.37M]
  ------------------
 1001|  4.73k|            case Fragment::THRESH: {
  ------------------
  |  Branch (1001:13): [True: 4.73k, False: 2.38M]
  ------------------
 1002|  4.73k|                uint32_t count = 0;
 1003|  4.73k|                auto sats = Vector(internal::MaxInt<uint32_t>(0));
 1004|  64.7k|                for (const auto& sub : subs) {
  ------------------
  |  Branch (1004:38): [True: 64.7k, False: 4.73k]
  ------------------
 1005|  64.7k|                    count += sub->ops.count + 1;
 1006|  64.7k|                    auto next_sats = Vector(sats[0] + sub->ops.dsat);
 1007|  45.7M|                    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: 45.7M, False: 64.7k]
  ------------------
 1008|  64.7k|                    next_sats.push_back(sats[sats.size() - 1] + sub->ops.sat);
 1009|  64.7k|                    sats = std::move(next_sats);
 1010|  64.7k|                }
 1011|  4.73k|                assert(k <= sats.size());
 1012|  4.73k|                return {count, sats[k], sats[0]};
 1013|  4.73k|            }
 1014|  2.38M|        }
 1015|      0|        assert(false);
 1016|      0|    }
_ZNK10miniscript4NodeIjE13CalcStackSizeEv:
 1018|  2.38M|    internal::StackSize CalcStackSize() const {
 1019|  2.38M|        using namespace internal;
 1020|  2.38M|        switch (fragment) {
  ------------------
  |  Branch (1020:17): [True: 0, False: 2.38M]
  ------------------
 1021|   570k|            case Fragment::JUST_0: return {{}, SatInfo::Push()};
  ------------------
  |  Branch (1021:13): [True: 570k, False: 1.81M]
  ------------------
 1022|   365k|            case Fragment::JUST_1: return {SatInfo::Push(), {}};
  ------------------
  |  Branch (1022:13): [True: 365k, False: 2.02M]
  ------------------
 1023|  2.84k|            case Fragment::OLDER:
  ------------------
  |  Branch (1023:13): [True: 2.84k, False: 2.38M]
  ------------------
 1024|  6.24k|            case Fragment::AFTER: return {SatInfo::Push() + SatInfo::Nop(), {}};
  ------------------
  |  Branch (1024:13): [True: 3.39k, False: 2.38M]
  ------------------
 1025|  2.23k|            case Fragment::PK_K: return {SatInfo::Push()};
  ------------------
  |  Branch (1025:13): [True: 2.23k, False: 2.38M]
  ------------------
 1026|    503|            case Fragment::PK_H: return {SatInfo::OP_DUP() + SatInfo::Hash() + SatInfo::Push() + SatInfo::OP_EQUALVERIFY()};
  ------------------
  |  Branch (1026:13): [True: 503, False: 2.38M]
  ------------------
 1027|      2|            case Fragment::SHA256:
  ------------------
  |  Branch (1027:13): [True: 2, False: 2.38M]
  ------------------
 1028|     13|            case Fragment::RIPEMD160:
  ------------------
  |  Branch (1028:13): [True: 11, False: 2.38M]
  ------------------
 1029|     14|            case Fragment::HASH256:
  ------------------
  |  Branch (1029:13): [True: 1, False: 2.38M]
  ------------------
 1030|    122|            case Fragment::HASH160: return {
  ------------------
  |  Branch (1030:13): [True: 108, False: 2.38M]
  ------------------
 1031|    122|                SatInfo::OP_SIZE() + SatInfo::Push() + SatInfo::OP_EQUALVERIFY() + SatInfo::Hash() + SatInfo::Push() + SatInfo::OP_EQUAL(),
 1032|    122|                {}
 1033|    122|            };
 1034|  3.99k|            case Fragment::ANDOR: {
  ------------------
  |  Branch (1034:13): [True: 3.99k, False: 2.38M]
  ------------------
 1035|  3.99k|                const auto& x{subs[0]->ss};
 1036|  3.99k|                const auto& y{subs[1]->ss};
 1037|  3.99k|                const auto& z{subs[2]->ss};
 1038|  3.99k|                return {
 1039|  3.99k|                    (x.sat + SatInfo::If() + y.sat) | (x.dsat + SatInfo::If() + z.sat),
 1040|  3.99k|                    x.dsat + SatInfo::If() + z.dsat
 1041|  3.99k|                };
 1042|     14|            }
 1043|   310k|            case Fragment::AND_V: {
  ------------------
  |  Branch (1043:13): [True: 310k, False: 2.07M]
  ------------------
 1044|   310k|                const auto& x{subs[0]->ss};
 1045|   310k|                const auto& y{subs[1]->ss};
 1046|   310k|                return {x.sat + y.sat, {}};
 1047|     14|            }
 1048|  5.71k|            case Fragment::AND_B: {
  ------------------
  |  Branch (1048:13): [True: 5.71k, False: 2.38M]
  ------------------
 1049|  5.71k|                const auto& x{subs[0]->ss};
 1050|  5.71k|                const auto& y{subs[1]->ss};
 1051|  5.71k|                return {x.sat + y.sat + SatInfo::BinaryOp(), x.dsat + y.dsat + SatInfo::BinaryOp()};
 1052|     14|            }
 1053|  6.25k|            case Fragment::OR_B: {
  ------------------
  |  Branch (1053:13): [True: 6.25k, False: 2.38M]
  ------------------
 1054|  6.25k|                const auto& x{subs[0]->ss};
 1055|  6.25k|                const auto& y{subs[1]->ss};
 1056|  6.25k|                return {
 1057|  6.25k|                    ((x.sat + y.dsat) | (x.dsat + y.sat)) + SatInfo::BinaryOp(),
 1058|  6.25k|                    x.dsat + y.dsat + SatInfo::BinaryOp()
 1059|  6.25k|                };
 1060|     14|            }
 1061|  2.75k|            case Fragment::OR_C: {
  ------------------
  |  Branch (1061:13): [True: 2.75k, False: 2.38M]
  ------------------
 1062|  2.75k|                const auto& x{subs[0]->ss};
 1063|  2.75k|                const auto& y{subs[1]->ss};
 1064|  2.75k|                return {(x.sat + SatInfo::If()) | (x.dsat + SatInfo::If() + y.sat), {}};
 1065|     14|            }
 1066|  3.75k|            case Fragment::OR_D: {
  ------------------
  |  Branch (1066:13): [True: 3.75k, False: 2.38M]
  ------------------
 1067|  3.75k|                const auto& x{subs[0]->ss};
 1068|  3.75k|                const auto& y{subs[1]->ss};
 1069|  3.75k|                return {
 1070|  3.75k|                    (x.sat + SatInfo::OP_IFDUP(true) + SatInfo::If()) | (x.dsat + SatInfo::OP_IFDUP(false) + SatInfo::If() + y.sat),
 1071|  3.75k|                    x.dsat + SatInfo::OP_IFDUP(false) + SatInfo::If() + y.dsat
 1072|  3.75k|                };
 1073|     14|            }
 1074|   524k|            case Fragment::OR_I: {
  ------------------
  |  Branch (1074:13): [True: 524k, False: 1.86M]
  ------------------
 1075|   524k|                const auto& x{subs[0]->ss};
 1076|   524k|                const auto& y{subs[1]->ss};
 1077|   524k|                return {SatInfo::If() + (x.sat | y.sat), SatInfo::If() + (x.dsat | y.dsat)};
 1078|     14|            }
 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|  2.72k|            case Fragment::MULTI: return {SatInfo(k, k + keys.size() + 2)};
  ------------------
  |  Branch (1083:13): [True: 2.72k, False: 2.38M]
  ------------------
 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|    123|            case Fragment::MULTI_A: return {SatInfo(keys.size() - 1, keys.size())};
  ------------------
  |  Branch (1087:13): [True: 123, False: 2.38M]
  ------------------
 1088|  16.7k|            case Fragment::WRAP_A:
  ------------------
  |  Branch (1088:13): [True: 16.7k, False: 2.37M]
  ------------------
 1089|  99.7k|            case Fragment::WRAP_N:
  ------------------
  |  Branch (1089:13): [True: 82.9k, False: 2.30M]
  ------------------
 1090|   104k|            case Fragment::WRAP_S: return subs[0]->ss;
  ------------------
  |  Branch (1090:13): [True: 5.05k, False: 2.38M]
  ------------------
 1091|  34.1k|            case Fragment::WRAP_C: return {
  ------------------
  |  Branch (1091:13): [True: 34.1k, False: 2.35M]
  ------------------
 1092|  34.1k|                subs[0]->ss.sat + SatInfo::OP_CHECKSIG(),
 1093|  34.1k|                subs[0]->ss.dsat + SatInfo::OP_CHECKSIG()
 1094|  34.1k|            };
 1095|  17.2k|            case Fragment::WRAP_D: return {
  ------------------
  |  Branch (1095:13): [True: 17.2k, False: 2.37M]
  ------------------
 1096|  17.2k|                SatInfo::OP_DUP() + SatInfo::If() + subs[0]->ss.sat,
 1097|  17.2k|                SatInfo::OP_DUP() + SatInfo::If()
 1098|  17.2k|            };
 1099|  15.4k|            case Fragment::WRAP_V: return {subs[0]->ss.sat + SatInfo::OP_VERIFY(), {}};
  ------------------
  |  Branch (1099:13): [True: 15.4k, False: 2.37M]
  ------------------
 1100|   407k|            case Fragment::WRAP_J: return {
  ------------------
  |  Branch (1100:13): [True: 407k, False: 1.98M]
  ------------------
 1101|   407k|                SatInfo::OP_SIZE() + SatInfo::OP_0NOTEQUAL() + SatInfo::If() + subs[0]->ss.sat,
 1102|   407k|                SatInfo::OP_SIZE() + SatInfo::OP_0NOTEQUAL() + SatInfo::If()
 1103|   407k|            };
 1104|  4.73k|            case Fragment::THRESH: {
  ------------------
  |  Branch (1104:13): [True: 4.73k, False: 2.38M]
  ------------------
 1105|       |                // sats[j] is the SatInfo corresponding to all traces reaching j satisfactions.
 1106|  4.73k|                auto sats = Vector(SatInfo::Empty());
 1107|  69.4k|                for (size_t i = 0; i < subs.size(); ++i) {
  ------------------
  |  Branch (1107:36): [True: 64.7k, False: 4.73k]
  ------------------
 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|  64.7k|                    auto add = i ? SatInfo::BinaryOp() : SatInfo::Empty();
  ------------------
  |  Branch (1110:32): [True: 60.0k, False: 4.73k]
  ------------------
 1111|       |                    // Construct a variable that will become the next sats, starting with index 0.
 1112|  64.7k|                    auto next_sats = Vector(sats[0] + subs[i]->ss.dsat + add);
 1113|       |                    // Then loop to construct next_sats[1..i].
 1114|  45.7M|                    for (size_t j = 1; j < sats.size(); ++j) {
  ------------------
  |  Branch (1114:40): [True: 45.7M, False: 64.7k]
  ------------------
 1115|  45.7M|                        next_sats.push_back(((sats[j] + subs[i]->ss.dsat) | (sats[j - 1] + subs[i]->ss.sat)) + add);
 1116|  45.7M|                    }
 1117|       |                    // Finally construct next_sats[i+1].
 1118|  64.7k|                    next_sats.push_back(sats[sats.size() - 1] + subs[i]->ss.sat + add);
 1119|       |                    // Switch over.
 1120|  64.7k|                    sats = std::move(next_sats);
 1121|  64.7k|                }
 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|  4.73k|                return {
 1125|  4.73k|                    sats[k] + SatInfo::Push() + SatInfo::OP_EQUAL(),
 1126|  4.73k|                    sats[0] + SatInfo::Push() + SatInfo::OP_EQUAL()
 1127|  4.73k|                };
 1128|  99.7k|            }
 1129|  2.38M|        }
 1130|      0|        assert(false);
 1131|      0|    }
_ZNK10miniscript4NodeIjE15CalcWitnessSizeEv:
 1133|  2.38M|    internal::WitnessSize CalcWitnessSize() const {
 1134|  2.38M|        const uint32_t sig_size = IsTapscript(m_script_ctx) ? 1 + 65 : 1 + 72;
  ------------------
  |  Branch (1134:35): [True: 2.25M, False: 137k]
  ------------------
 1135|  2.38M|        const uint32_t pubkey_size = IsTapscript(m_script_ctx) ? 1 + 32 : 1 + 33;
  ------------------
  |  Branch (1135:38): [True: 2.25M, False: 137k]
  ------------------
 1136|  2.38M|        switch (fragment) {
  ------------------
  |  Branch (1136:17): [True: 0, False: 2.38M]
  ------------------
 1137|   570k|            case Fragment::JUST_0: return {{}, 0};
  ------------------
  |  Branch (1137:13): [True: 570k, False: 1.81M]
  ------------------
 1138|   365k|            case Fragment::JUST_1:
  ------------------
  |  Branch (1138:13): [True: 365k, False: 2.02M]
  ------------------
 1139|   368k|            case Fragment::OLDER:
  ------------------
  |  Branch (1139:13): [True: 2.84k, False: 2.38M]
  ------------------
 1140|   371k|            case Fragment::AFTER: return {0, {}};
  ------------------
  |  Branch (1140:13): [True: 3.39k, False: 2.38M]
  ------------------
 1141|  2.23k|            case Fragment::PK_K: return {sig_size, 1};
  ------------------
  |  Branch (1141:13): [True: 2.23k, False: 2.38M]
  ------------------
 1142|    503|            case Fragment::PK_H: return {sig_size + pubkey_size, 1 + pubkey_size};
  ------------------
  |  Branch (1142:13): [True: 503, False: 2.38M]
  ------------------
 1143|      2|            case Fragment::SHA256:
  ------------------
  |  Branch (1143:13): [True: 2, False: 2.38M]
  ------------------
 1144|     13|            case Fragment::RIPEMD160:
  ------------------
  |  Branch (1144:13): [True: 11, False: 2.38M]
  ------------------
 1145|     14|            case Fragment::HASH256:
  ------------------
  |  Branch (1145:13): [True: 1, False: 2.38M]
  ------------------
 1146|    122|            case Fragment::HASH160: return {1 + 32, {}};
  ------------------
  |  Branch (1146:13): [True: 108, False: 2.38M]
  ------------------
 1147|  3.99k|            case Fragment::ANDOR: {
  ------------------
  |  Branch (1147:13): [True: 3.99k, False: 2.38M]
  ------------------
 1148|  3.99k|                const auto sat{(subs[0]->ws.sat + subs[1]->ws.sat) | (subs[0]->ws.dsat + subs[2]->ws.sat)};
 1149|  3.99k|                const auto dsat{subs[0]->ws.dsat + subs[2]->ws.dsat};
 1150|  3.99k|                return {sat, dsat};
 1151|     14|            }
 1152|   310k|            case Fragment::AND_V: return {subs[0]->ws.sat + subs[1]->ws.sat, {}};
  ------------------
  |  Branch (1152:13): [True: 310k, False: 2.07M]
  ------------------
 1153|  5.71k|            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: 5.71k, False: 2.38M]
  ------------------
 1154|  6.25k|            case Fragment::OR_B: {
  ------------------
  |  Branch (1154:13): [True: 6.25k, False: 2.38M]
  ------------------
 1155|  6.25k|                const auto sat{(subs[0]->ws.dsat + subs[1]->ws.sat) | (subs[0]->ws.sat + subs[1]->ws.dsat)};
 1156|  6.25k|                const auto dsat{subs[0]->ws.dsat + subs[1]->ws.dsat};
 1157|  6.25k|                return {sat, dsat};
 1158|     14|            }
 1159|  2.75k|            case Fragment::OR_C: return {subs[0]->ws.sat | (subs[0]->ws.dsat + subs[1]->ws.sat), {}};
  ------------------
  |  Branch (1159:13): [True: 2.75k, False: 2.38M]
  ------------------
 1160|  3.75k|            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: 3.75k, False: 2.38M]
  ------------------
 1161|   524k|            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: 524k, False: 1.86M]
  ------------------
 1162|  2.72k|            case Fragment::MULTI: return {k * sig_size + 1, k + 1};
  ------------------
  |  Branch (1162:13): [True: 2.72k, False: 2.38M]
  ------------------
 1163|    123|            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: 123, False: 2.38M]
  ------------------
 1164|  16.7k|            case Fragment::WRAP_A:
  ------------------
  |  Branch (1164:13): [True: 16.7k, False: 2.37M]
  ------------------
 1165|  99.7k|            case Fragment::WRAP_N:
  ------------------
  |  Branch (1165:13): [True: 82.9k, False: 2.30M]
  ------------------
 1166|   104k|            case Fragment::WRAP_S:
  ------------------
  |  Branch (1166:13): [True: 5.05k, False: 2.38M]
  ------------------
 1167|   138k|            case Fragment::WRAP_C: return subs[0]->ws;
  ------------------
  |  Branch (1167:13): [True: 34.1k, False: 2.35M]
  ------------------
 1168|  17.2k|            case Fragment::WRAP_D: return {1 + 1 + subs[0]->ws.sat, 1};
  ------------------
  |  Branch (1168:13): [True: 17.2k, False: 2.37M]
  ------------------
 1169|  15.4k|            case Fragment::WRAP_V: return {subs[0]->ws.sat, {}};
  ------------------
  |  Branch (1169:13): [True: 15.4k, False: 2.37M]
  ------------------
 1170|   407k|            case Fragment::WRAP_J: return {subs[0]->ws.sat, 1};
  ------------------
  |  Branch (1170:13): [True: 407k, False: 1.98M]
  ------------------
 1171|  4.73k|            case Fragment::THRESH: {
  ------------------
  |  Branch (1171:13): [True: 4.73k, False: 2.38M]
  ------------------
 1172|  4.73k|                auto sats = Vector(internal::MaxInt<uint32_t>(0));
 1173|  64.7k|                for (const auto& sub : subs) {
  ------------------
  |  Branch (1173:38): [True: 64.7k, False: 4.73k]
  ------------------
 1174|  64.7k|                    auto next_sats = Vector(sats[0] + sub->ws.dsat);
 1175|  45.7M|                    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: 45.7M, False: 64.7k]
  ------------------
 1176|  64.7k|                    next_sats.push_back(sats[sats.size() - 1] + sub->ws.sat);
 1177|  64.7k|                    sats = std::move(next_sats);
 1178|  64.7k|                }
 1179|  4.73k|                assert(k <= sats.size());
 1180|  4.73k|                return {sats[k], sats[0]};
 1181|  4.73k|            }
 1182|  2.38M|        }
 1183|      0|        assert(false);
 1184|      0|    }
_ZNK10miniscript4NodeIjE8CalcTypeEv:
  731|  2.38M|    Type CalcType() const {
  732|  2.38M|        using namespace internal;
  733|       |
  734|       |        // THRESH has a variable number of subexpressions
  735|  2.38M|        std::vector<Type> sub_types;
  736|  2.38M|        if (fragment == Fragment::THRESH) {
  ------------------
  |  Branch (736:13): [True: 4.73k, False: 2.38M]
  ------------------
  737|  64.7k|            for (const auto& sub : subs) sub_types.push_back(sub->GetType());
  ------------------
  |  Branch (737:34): [True: 64.7k, False: 4.73k]
  ------------------
  738|  4.73k|        }
  739|       |        // All other nodes than THRESH can be computed just from the types of the 0-3 subexpressions.
  740|  2.38M|        static constexpr auto NONE_MST{""_mst};
  741|  2.38M|        Type x = subs.size() > 0 ? subs[0]->GetType() : NONE_MST;
  ------------------
  |  Branch (741:18): [True: 1.44M, False: 947k]
  ------------------
  742|  2.38M|        Type y = subs.size() > 1 ? subs[1]->GetType() : NONE_MST;
  ------------------
  |  Branch (742:18): [True: 860k, False: 1.52M]
  ------------------
  743|  2.38M|        Type z = subs.size() > 2 ? subs[2]->GetType() : NONE_MST;
  ------------------
  |  Branch (743:18): [True: 5.97k, False: 2.38M]
  ------------------
  744|       |
  745|  2.38M|        return SanitizeType(ComputeType(fragment, x, y, z, sub_types, k, data.size(), subs.size(), keys.size(), m_script_ctx));
  746|  2.38M|    }
_ZNK10miniscript4NodeIjE13CalcScriptLenEv:
  570|  2.38M|    size_t CalcScriptLen() const {
  571|  2.38M|        size_t subsize = 0;
  572|  2.38M|        for (const auto& sub : subs) {
  ------------------
  |  Branch (572:30): [True: 2.36M, False: 2.38M]
  ------------------
  573|  2.36M|            subsize += sub->ScriptSize();
  574|  2.36M|        }
  575|  2.38M|        static constexpr auto NONE_MST{""_mst};
  576|  2.38M|        Type sub0type = subs.size() > 0 ? subs[0]->GetType() : NONE_MST;
  ------------------
  |  Branch (576:25): [True: 1.44M, False: 947k]
  ------------------
  577|  2.38M|        return internal::ComputeScriptLen(fragment, sub0type, subsize, k, subs.size(), keys.size(), m_script_ctx);
  578|  2.38M|    }
descriptor.cpp:_ZN10miniscript8internal11ParseKeyEndIjN12_GLOBAL__N_19KeyParserEEENSt3__18optionalINS4_4pairIT_iEEEE4SpanIKcERKT0_:
 1752|  1.70k|{
 1753|  1.70k|    int key_size = FindNextChar(in, ')');
 1754|  1.70k|    if (key_size < 1) return {};
  ------------------
  |  Branch (1754:9): [True: 28, False: 1.67k]
  ------------------
 1755|  1.67k|    auto key = ctx.FromString(in.begin(), in.begin() + key_size);
 1756|  1.67k|    if (!key) return {};
  ------------------
  |  Branch (1756:9): [True: 104, False: 1.56k]
  ------------------
 1757|  1.56k|    return {{std::move(*key), key_size}};
 1758|  1.67k|}
_ZN10miniscript11MakeNodeRefIjJNS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentENSt3__16vectorINS5_10unique_ptrIKNS_4NodeIjEENS5_14default_deleteISA_EEEENS5_9allocatorISD_EEEEEEENS7_IKNS8_IT_EENSB_ISJ_EEEEDpOT0_:
  196|  1.05M|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.18M|        : 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|  1.56k|NodeRef<Key> MakeNodeRef(Args&&... args) { return std::make_unique<const Node<Key>>(std::forward<Args>(args)...); }
_ZN10miniscript4NodeIjEC2ENS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentENSt3__16vectorIjNS6_9allocatorIjEEEEj:
 1666|  4.13k|        : 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|    167|{
 1765|    167|    int hash_size = FindNextChar(in, ')');
 1766|    167|    if (hash_size < 1) return {};
  ------------------
  |  Branch (1766:9): [True: 4, False: 163]
  ------------------
 1767|    163|    std::string val = std::string(in.begin(), in.begin() + hash_size);
 1768|    163|    if (!IsHex(val)) return {};
  ------------------
  |  Branch (1768:9): [True: 21, False: 142]
  ------------------
 1769|    142|    auto hash = ParseHex(val);
 1770|    142|    if (hash.size() != expected_size) return {};
  ------------------
  |  Branch (1770:9): [True: 20, False: 122]
  ------------------
 1771|    122|    return {{std::move(hash), hash_size}};
 1772|    142|}
_ZN10miniscript11MakeNodeRefIjJNS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentENSt3__16vectorIhNS5_9allocatorIhEEEEEEENS5_10unique_ptrIKNS_4NodeIT_EENS5_14default_deleteISE_EEEEDpOT0_:
  196|    122|NodeRef<Key> MakeNodeRef(Args&&... args) { return std::make_unique<const Node<Key>>(std::forward<Args>(args)...); }
_ZN10miniscript4NodeIjEC2ENS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentENSt3__16vectorIhNS6_9allocatorIhEEEEj:
 1662|    122|        : 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|  6.23k|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|  2.93k|    const auto parse_multi_exp = [&](Span<const char>& in, const bool is_multi_a) -> bool {
 1818|  2.93k|        const auto max_keys{is_multi_a ? MAX_PUBKEYS_PER_MULTI_A : MAX_PUBKEYS_PER_MULTISIG};
  ------------------
  |  Branch (1818:29): [True: 207, False: 2.73k]
  ------------------
 1819|  2.93k|        const auto required_ctx{is_multi_a ? MiniscriptContext::TAPSCRIPT : MiniscriptContext::P2WSH};
  ------------------
  |  Branch (1819:33): [True: 207, False: 2.73k]
  ------------------
 1820|  2.93k|        if (ctx.MsContext() != required_ctx) return false;
  ------------------
  |  Branch (1820:13): [True: 2, False: 2.93k]
  ------------------
 1821|       |        // Get threshold
 1822|  2.93k|        int next_comma = FindNextChar(in, ',');
 1823|  2.93k|        if (next_comma < 1) return false;
  ------------------
  |  Branch (1823:13): [True: 4, False: 2.93k]
  ------------------
 1824|  2.93k|        const auto k_to_integral{ToIntegral<int64_t>(std::string_view(in.data(), next_comma))};
 1825|  2.93k|        if (!k_to_integral.has_value()) return false;
  ------------------
  |  Branch (1825:13): [True: 124, False: 2.80k]
  ------------------
 1826|  2.80k|        const int64_t k{k_to_integral.value()};
 1827|  2.80k|        in = in.subspan(next_comma + 1);
 1828|       |        // Get keys. It is compatible for both compressed and x-only keys.
 1829|  2.80k|        std::vector<Key> keys;
 1830|  9.09k|        while (next_comma != -1) {
  ------------------
  |  Branch (1830:16): [True: 6.42k, False: 2.66k]
  ------------------
 1831|  6.42k|            next_comma = FindNextChar(in, ',');
 1832|  6.42k|            int key_length = (next_comma == -1) ? FindNextChar(in, ')') : next_comma;
  ------------------
  |  Branch (1832:30): [True: 2.78k, False: 3.64k]
  ------------------
 1833|  6.42k|            if (key_length < 1) return false;
  ------------------
  |  Branch (1833:17): [True: 63, False: 6.36k]
  ------------------
 1834|  6.36k|            auto key = ctx.FromString(in.begin(), in.begin() + key_length);
 1835|  6.36k|            if (!key) return false;
  ------------------
  |  Branch (1835:17): [True: 78, False: 6.28k]
  ------------------
 1836|  6.28k|            keys.push_back(std::move(*key));
 1837|  6.28k|            in = in.subspan(key_length + 1);
 1838|  6.28k|        }
 1839|  2.66k|        if (keys.size() < 1 || keys.size() > max_keys) return false;
  ------------------
  |  Branch (1839:13): [True: 0, False: 2.66k]
  |  Branch (1839:32): [True: 2, False: 2.66k]
  ------------------
 1840|  2.66k|        if (k < 1 || k > (int64_t)keys.size()) return false;
  ------------------
  |  Branch (1840:13): [True: 21, False: 2.64k]
  |  Branch (1840:22): [True: 80, False: 2.56k]
  ------------------
 1841|  2.56k|        if (is_multi_a) {
  ------------------
  |  Branch (1841:13): [True: 77, False: 2.48k]
  ------------------
 1842|       |            // (push + xonly-key + CHECKSIG[ADD]) * n + k + OP_NUMEQUAL(VERIFY), minus one.
 1843|     77|            script_size += (1 + 32 + 1) * keys.size() + BuildScript(k).size();
 1844|     77|            constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::MULTI_A, std::move(keys), k));
 1845|  2.48k|        } else {
 1846|  2.48k|            script_size += 2 + (keys.size() > 16) + (k > 16) + 34 * keys.size();
 1847|  2.48k|            constructed.push_back(MakeNodeRef<Key>(internal::NoDupCheck{}, ctx.MsContext(), Fragment::MULTI, std::move(keys), k));
 1848|  2.48k|        }
 1849|  2.56k|        return true;
 1850|  2.66k|    };
_ZN10miniscript11MakeNodeRefIjJNS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentENSt3__16vectorIjNS5_9allocatorIjEEEERKlEEENS5_10unique_ptrIKNS_4NodeIT_EENS5_14default_deleteISG_EEEEDpOT0_:
  196|  2.56k|NodeRef<Key> MakeNodeRef(Args&&... args) { return std::make_unique<const Node<Key>>(std::forward<Args>(args)...); }
_ZN10miniscript4NodeIjED2Ev:
  520|  2.38M|    ~Node() {
  521|  4.75M|        while (!subs.empty()) {
  ------------------
  |  Branch (521:16): [True: 2.36M, False: 2.38M]
  ------------------
  522|  2.36M|            auto node = std::move(subs.back());
  523|  2.36M|            subs.pop_back();
  524|  4.64M|            while (!node->subs.empty()) {
  ------------------
  |  Branch (524:20): [True: 2.28M, False: 2.36M]
  ------------------
  525|  2.28M|                subs.push_back(std::move(node->subs.back()));
  526|  2.28M|                node->subs.pop_back();
  527|  2.28M|            }
  528|  2.36M|        }
  529|  2.38M|    }
_ZNK10miniscript4NodeIjE7GetTypeEv:
 1557|  4.30M|    Type GetType() const { return typ; }
_ZN10miniscript8internal9BuildBackIjEEvNS_17MiniscriptContextENS_8FragmentERNSt3__16vectorINS4_10unique_ptrIKNS_4NodeIT_EENS4_14default_deleteISA_EEEENS4_9allocatorISD_EEEEb:
 1777|   130k|{
 1778|   130k|    NodeRef<Key> child = std::move(constructed.back());
 1779|   130k|    constructed.pop_back();
 1780|   130k|    if (reverse) {
  ------------------
  |  Branch (1780:9): [True: 0, False: 130k]
  ------------------
 1781|      0|        constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, script_ctx, nt, Vector(std::move(child), std::move(constructed.back())));
 1782|   130k|    } else {
 1783|   130k|        constructed.back() = MakeNodeRef<Key>(internal::NoDupCheck{}, script_ctx, nt, Vector(std::move(constructed.back()), std::move(child)));
 1784|   130k|    }
 1785|   130k|}
_ZN10miniscript11MakeNodeRefIjJNS_8internal10NoDupCheckERKNS_17MiniscriptContextERNS_8FragmentENSt3__16vectorINS8_10unique_ptrIKNS_4NodeIjEENS8_14default_deleteISD_EEEENS8_9allocatorISG_EEEEEEENSA_IKNSB_IT_EENSE_ISM_EEEEDpOT0_:
  196|   130k|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|  4.67k|NodeRef<Key> MakeNodeRef(Args&&... args) { return std::make_unique<const Node<Key>>(std::forward<Args>(args)...); }
_ZNK10miniscript4NodeIjE10ScriptSizeEv:
 1499|  2.49M|    size_t ScriptSize() const { return scriptlen; }
descriptor.cpp:_ZNK10miniscript4NodeIjE17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_:
 1441|  3.51k|    {
 1442|       |        // We cannot use a lambda here, as lambdas are non assignable, and the set operations
 1443|       |        // below require moving the comparators around.
 1444|  3.51k|        struct Comp {
 1445|  3.51k|            const Ctx* ctx_ptr;
 1446|  3.51k|            Comp(const Ctx& ctx) : ctx_ptr(&ctx) {}
 1447|  3.51k|            bool operator()(const Key& a, const Key& b) const { return ctx_ptr->KeyCompare(a, b); }
 1448|  3.51k|        };
 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|  3.51k|        using keyset = std::set<Key, Comp>;
 1454|  3.51k|        using state = std::optional<keyset>;
 1455|       |
 1456|  3.51k|        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|  3.51k|            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|  3.51k|            for (auto& sub : subs) {
 1462|  3.51k|                if (!sub.has_value()) {
 1463|  3.51k|                    node.has_duplicate_keys = true;
 1464|  3.51k|                    return {};
 1465|  3.51k|                }
 1466|  3.51k|            }
 1467|       |
 1468|       |            // Start building the set of keys involved in this node and children.
 1469|       |            // Start by keys in this node directly.
 1470|  3.51k|            size_t keys_count = node.keys.size();
 1471|  3.51k|            keyset key_set{node.keys.begin(), node.keys.end(), Comp(ctx)};
 1472|  3.51k|            if (key_set.size() != keys_count) {
 1473|       |                // It already has duplicates; bail out.
 1474|  3.51k|                node.has_duplicate_keys = true;
 1475|  3.51k|                return {};
 1476|  3.51k|            }
 1477|       |
 1478|       |            // Merge the keys from the children into this set.
 1479|  3.51k|            for (auto& sub : subs) {
 1480|  3.51k|                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|  3.51k|                if (key_set.size() < sub->size()) std::swap(key_set, *sub);
 1484|  3.51k|                key_set.merge(*sub);
 1485|  3.51k|                if (key_set.size() != keys_count) {
 1486|  3.51k|                    node.has_duplicate_keys = true;
 1487|  3.51k|                    return {};
 1488|  3.51k|                }
 1489|  3.51k|            }
 1490|       |
 1491|  3.51k|            node.has_duplicate_keys = false;
 1492|  3.51k|            return key_set;
 1493|  3.51k|        };
 1494|       |
 1495|  3.51k|        TreeEval<state>(upfn);
 1496|  3.51k|    }
descriptor.cpp:_ZNK10miniscript4NodeIjE8TreeEvalINSt3__18optionalINS3_3setIjZNKS1_17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_E4CompNS3_9allocatorIjEEEEEEZNKS6_IS8_EEvSB_EUlRKS1_4SpanISG_EE_EES9_T0_:
  699|  3.51k|    {
  700|  3.51k|        struct DummyState {};
  701|  3.51k|        return std::move(*TreeEvalMaybe<Result>(DummyState{},
  702|  3.51k|            [](DummyState, const Node&, size_t) { return DummyState{}; },
  703|  3.51k|            [&upfn](DummyState, const Node& node, Span<Result> subs) {
  704|  3.51k|                Result res{upfn(node, subs)};
  705|  3.51k|                return std::optional<Result>(std::move(res));
  706|  3.51k|            }
  707|  3.51k|        ));
  708|  3.51k|    }
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|  3.51k|    {
  606|       |        /** Entries of the explicit stack tracked in this algorithm. */
  607|  3.51k|        struct StackElem
  608|  3.51k|        {
  609|  3.51k|            const Node& node; //!< The node being evaluated.
  610|  3.51k|            size_t expanded; //!< How many children of this node have been expanded.
  611|  3.51k|            State state; //!< The state for that node.
  612|       |
  613|  3.51k|            StackElem(const Node& node_, size_t exp_, State&& state_) :
  614|  3.51k|                node(node_), expanded(exp_), state(std::move(state_)) {}
  615|  3.51k|        };
  616|       |        /* Stack of tree nodes being explored. */
  617|  3.51k|        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.51k|        std::vector<Result> results;
  621|  3.51k|        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|  3.15M|        while (stack.size()) {
  ------------------
  |  Branch (639:16): [True: 3.15M, False: 3.51k]
  ------------------
  640|  3.15M|            const Node& node = stack.back().node;
  641|  3.15M|            if (stack.back().expanded < node.subs.size()) {
  ------------------
  |  Branch (641:17): [True: 1.57M, False: 1.57M]
  ------------------
  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|  1.57M|                size_t child_index = stack.back().expanded++;
  646|  1.57M|                State child_state = downfn(stack.back().state, node, child_index);
  647|  1.57M|                stack.emplace_back(*node.subs[child_index], 0, std::move(child_state));
  648|  1.57M|                continue;
  649|  1.57M|            }
  650|       |            // Invoke upfn with the last node.subs.size() elements of results as input.
  651|  1.57M|            assert(results.size() >= node.subs.size());
  652|  1.57M|            std::optional<Result> result{upfn(std::move(stack.back().state), node,
  653|  1.57M|                Span<Result>{results}.last(node.subs.size()))};
  654|       |            // If evaluation returns std::nullopt, abort immediately.
  655|  1.57M|            if (!result) return {};
  ------------------
  |  Branch (655:17): [True: 0, False: 1.57M]
  ------------------
  656|       |            // Replace the last node.subs.size() elements of results with the new result.
  657|  1.57M|            results.erase(results.end() - node.subs.size(), results.end());
  658|  1.57M|            results.push_back(std::move(*result));
  659|  1.57M|            stack.pop_back();
  660|  1.57M|        }
  661|       |        // The final remaining results element is the root result, return it.
  662|  3.51k|        assert(results.size() == 1);
  663|  3.51k|        return std::move(results[0]);
  664|  3.51k|    }
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|  1.57M|                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|  1.57M|            [](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|  1.57M|            [&upfn](DummyState, const Node& node, Span<Result> subs) {
  704|  1.57M|                Result res{upfn(node, subs)};
  705|  1.57M|                return std::optional<Result>(std::move(res));
  706|  1.57M|            }
descriptor.cpp:_ZZNK10miniscript4NodeIjE17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_ENKUlRKS1_4SpanINSt3__18optionalINSB_3setIjZNKS2_IS4_EEvS7_E4CompNSB_9allocatorIjEEEEEEEE_clES9_SJ_:
 1456|  1.57M|        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|  1.57M|            if (node.has_duplicate_keys.has_value() && *node.has_duplicate_keys) return {};
  ------------------
  |  Branch (1458:17): [True: 0, False: 1.57M]
  |  Branch (1458:56): [True: 0, False: 0]
  ------------------
 1459|       |
 1460|       |            // Check if one of the children is already known to have duplicates.
 1461|  1.57M|            for (auto& sub : subs) {
  ------------------
  |  Branch (1461:28): [True: 1.57M, False: 1.57M]
  ------------------
 1462|  1.57M|                if (!sub.has_value()) {
  ------------------
  |  Branch (1462:21): [True: 3.05k, False: 1.57M]
  ------------------
 1463|  3.05k|                    node.has_duplicate_keys = true;
 1464|  3.05k|                    return {};
 1465|  3.05k|                }
 1466|  1.57M|            }
 1467|       |
 1468|       |            // Start building the set of keys involved in this node and children.
 1469|       |            // Start by keys in this node directly.
 1470|  1.57M|            size_t keys_count = node.keys.size();
 1471|  1.57M|            keyset key_set{node.keys.begin(), node.keys.end(), Comp(ctx)};
 1472|  1.57M|            if (key_set.size() != keys_count) {
  ------------------
  |  Branch (1472:17): [True: 109, False: 1.57M]
  ------------------
 1473|       |                // It already has duplicates; bail out.
 1474|    109|                node.has_duplicate_keys = true;
 1475|    109|                return {};
 1476|    109|            }
 1477|       |
 1478|       |            // Merge the keys from the children into this set.
 1479|  1.57M|            for (auto& sub : subs) {
  ------------------
  |  Branch (1479:28): [True: 1.56M, False: 1.57M]
  ------------------
 1480|  1.56M|                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|  1.56M|                if (key_set.size() < sub->size()) std::swap(key_set, *sub);
  ------------------
  |  Branch (1483:21): [True: 318k, False: 1.25M]
  ------------------
 1484|  1.56M|                key_set.merge(*sub);
 1485|  1.56M|                if (key_set.size() != keys_count) {
  ------------------
  |  Branch (1485:21): [True: 112, False: 1.56M]
  ------------------
 1486|    112|                    node.has_duplicate_keys = true;
 1487|    112|                    return {};
 1488|    112|                }
 1489|  1.56M|            }
 1490|       |
 1491|  1.57M|            node.has_duplicate_keys = false;
 1492|  1.57M|            return key_set;
 1493|  1.57M|        };
descriptor.cpp:_ZZNK10miniscript4NodeIjE17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_EN4CompC2ERKS4_:
 1446|  1.57M|            Comp(const Ctx& ctx) : ctx_ptr(&ctx) {}
descriptor.cpp:_ZZNK10miniscript4NodeIjE17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_ENK4CompclERKjSA_:
 1447|  22.9k|            bool operator()(const Key& a, const Key& b) const { return ctx_ptr->KeyCompare(a, b); }
_ZNK10miniscript4NodeIjE6IsSaneEv:
 1641|  2.30k|    bool IsSane() const { return IsValidTopLevel() && IsSaneSubexpression() && NeedsSignature(); }
  ------------------
  |  Branch (1641:34): [True: 1.65k, False: 652]
  |  Branch (1641:55): [True: 1.54k, False: 110]
  |  Branch (1641:80): [True: 1.44k, False: 102]
  ------------------
_ZNK10miniscript4NodeIjE15IsValidTopLevelEv:
 1620|  2.30k|    bool IsValidTopLevel() const { return IsValid() && GetType() << "B"_mst; }
  ------------------
  |  Branch (1620:43): [True: 1.72k, False: 582]
  |  Branch (1620:56): [True: 1.65k, False: 70]
  ------------------
_ZNK10miniscript4NodeIjE19IsSaneSubexpressionEv:
 1638|   132k|    bool IsSaneSubexpression() const { return ValidSatisfactions() && IsNonMalleable() && CheckTimeLocksMix() && CheckDuplicateKey(); }
  ------------------
  |  Branch (1638:47): [True: 129k, False: 3.01k]
  |  Branch (1638:71): [True: 129k, False: 524]
  |  Branch (1638:91): [True: 129k, False: 69]
  |  Branch (1638:114): [True: 129k, False: 168]
  ------------------
_ZNK10miniscript4NodeIjE16IsNotSatisfiableEv:
 1547|  1.37k|    bool IsNotSatisfiable() const { return !GetStackSize(); }
_ZNK10miniscript4NodeIjE12GetStackSizeEv:
 1523|  84.0k|    std::optional<uint32_t> GetStackSize() const {
 1524|  84.0k|        if (!ss.sat.valid) return {};
  ------------------
  |  Branch (1524:13): [True: 50.6k, False: 33.3k]
  ------------------
 1525|  33.3k|        return ss.sat.netdiff + static_cast<int32_t>(IsBKW());
 1526|  84.0k|    }
_ZNK10miniscript4NodeIjE5IsBKWEv:
 1518|  58.8k|    bool IsBKW() const {
 1519|  58.8k|        return !((GetType() & "BKW"_mst) == ""_mst);
 1520|  58.8k|    }
_ZNK10miniscript4NodeIjE13FindInsaneSubEv:
 1563|    712|    const Node* FindInsaneSub() const {
 1564|    712|        return TreeEval<const Node*>([](const Node& node, Span<const Node*> subs) -> const Node* {
 1565|    712|            for (auto& sub: subs) if (sub) return sub;
 1566|    712|            if (!node.IsSaneSubexpression()) return &node;
 1567|    712|            return nullptr;
 1568|    712|        });
 1569|    712|    }
_ZNK10miniscript4NodeIjE8TreeEvalIPKS1_ZNKS1_13FindInsaneSubEvEUlRS3_4SpanIS4_EE_EET_T0_:
  699|    712|    {
  700|    712|        struct DummyState {};
  701|    712|        return std::move(*TreeEvalMaybe<Result>(DummyState{},
  702|    712|            [](DummyState, const Node&, size_t) { return DummyState{}; },
  703|    712|            [&upfn](DummyState, const Node& node, Span<Result> subs) {
  704|    712|                Result res{upfn(node, subs)};
  705|    712|                return std::optional<Result>(std::move(res));
  706|    712|            }
  707|    712|        ));
  708|    712|    }
_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|    712|    {
  606|       |        /** Entries of the explicit stack tracked in this algorithm. */
  607|    712|        struct StackElem
  608|    712|        {
  609|    712|            const Node& node; //!< The node being evaluated.
  610|    712|            size_t expanded; //!< How many children of this node have been expanded.
  611|    712|            State state; //!< The state for that node.
  612|       |
  613|    712|            StackElem(const Node& node_, size_t exp_, State&& state_) :
  614|    712|                node(node_), expanded(exp_), state(std::move(state_)) {}
  615|    712|        };
  616|       |        /* Stack of tree nodes being explored. */
  617|    712|        std::vector<StackElem> stack;
  618|       |        /* Results of subtrees so far. Their order and mapping to tree nodes
  619|       |         * is implicitly defined by stack. */
  620|    712|        std::vector<Result> results;
  621|    712|        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|   369k|        while (stack.size()) {
  ------------------
  |  Branch (639:16): [True: 368k, False: 712]
  ------------------
  640|   368k|            const Node& node = stack.back().node;
  641|   368k|            if (stack.back().expanded < node.subs.size()) {
  ------------------
  |  Branch (641:17): [True: 183k, False: 184k]
  ------------------
  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|   183k|                size_t child_index = stack.back().expanded++;
  646|   183k|                State child_state = downfn(stack.back().state, node, child_index);
  647|   183k|                stack.emplace_back(*node.subs[child_index], 0, std::move(child_state));
  648|   183k|                continue;
  649|   183k|            }
  650|       |            // Invoke upfn with the last node.subs.size() elements of results as input.
  651|   184k|            assert(results.size() >= node.subs.size());
  652|   184k|            std::optional<Result> result{upfn(std::move(stack.back().state), node,
  653|   184k|                Span<Result>{results}.last(node.subs.size()))};
  654|       |            // If evaluation returns std::nullopt, abort immediately.
  655|   184k|            if (!result) return {};
  ------------------
  |  Branch (655:17): [True: 0, False: 184k]
  ------------------
  656|       |            // Replace the last node.subs.size() elements of results with the new result.
  657|   184k|            results.erase(results.end() - node.subs.size(), results.end());
  658|   184k|            results.push_back(std::move(*result));
  659|   184k|            stack.pop_back();
  660|   184k|        }
  661|       |        // The final remaining results element is the root result, return it.
  662|    712|        assert(results.size() == 1);
  663|    712|        return std::move(results[0]);
  664|    712|    }
_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|   184k|                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|   183k|            [](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|   184k|            [&upfn](DummyState, const Node& node, Span<Result> subs) {
  704|   184k|                Result res{upfn(node, subs)};
  705|   184k|                return std::optional<Result>(std::move(res));
  706|   184k|            }
_ZZNK10miniscript4NodeIjE13FindInsaneSubEvENKUlRKS1_4SpanIPS2_EE_clES3_S6_:
 1564|   184k|        return TreeEval<const Node*>([](const Node& node, Span<const Node*> subs) -> const Node* {
 1565|   184k|            for (auto& sub: subs) if (sub) return sub;
  ------------------
  |  Branch (1565:27): [True: 169k, False: 131k]
  |  Branch (1565:39): [True: 53.3k, False: 116k]
  ------------------
 1566|   131k|            if (!node.IsSaneSubexpression()) return &node;
  ------------------
  |  Branch (1566:17): [True: 3.66k, False: 127k]
  ------------------
 1567|   127k|            return nullptr;
 1568|   131k|        });
descriptor.cpp:_ZNK10miniscript4NodeIjE8ToStringIN12_GLOBAL__N_19KeyParserEEENSt3__18optionalINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEERKT_:
  829|    712|    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|    712|        auto downfn = [](bool, const Node& node, size_t) {
  834|    712|            return (node.fragment == Fragment::WRAP_A || node.fragment == Fragment::WRAP_S ||
  835|    712|                    node.fragment == Fragment::WRAP_D || node.fragment == Fragment::WRAP_V ||
  836|    712|                    node.fragment == Fragment::WRAP_J || node.fragment == Fragment::WRAP_N ||
  837|    712|                    node.fragment == Fragment::WRAP_C ||
  838|    712|                    (node.fragment == Fragment::AND_V && node.subs[1]->fragment == Fragment::JUST_1) ||
  839|    712|                    (node.fragment == Fragment::OR_I && node.subs[0]->fragment == Fragment::JUST_0) ||
  840|    712|                    (node.fragment == Fragment::OR_I && node.subs[1]->fragment == Fragment::JUST_0));
  841|    712|        };
  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|    712|        const bool is_tapscript{IsTapscript(m_script_ctx)};
  845|    712|        auto upfn = [&ctx, is_tapscript](bool wrapped, const Node& node, Span<std::string> subs) -> std::optional<std::string> {
  846|    712|            std::string ret = wrapped ? ":" : "";
  847|       |
  848|    712|            switch (node.fragment) {
  849|    712|                case Fragment::WRAP_A: return "a" + std::move(subs[0]);
  850|    712|                case Fragment::WRAP_S: return "s" + std::move(subs[0]);
  851|    712|                case Fragment::WRAP_C:
  852|    712|                    if (node.subs[0]->fragment == Fragment::PK_K) {
  853|       |                        // pk(K) is syntactic sugar for c:pk_k(K)
  854|    712|                        auto key_str = ctx.ToString(node.subs[0]->keys[0]);
  855|    712|                        if (!key_str) return {};
  856|    712|                        return std::move(ret) + "pk(" + std::move(*key_str) + ")";
  857|    712|                    }
  858|    712|                    if (node.subs[0]->fragment == Fragment::PK_H) {
  859|       |                        // pkh(K) is syntactic sugar for c:pk_h(K)
  860|    712|                        auto key_str = ctx.ToString(node.subs[0]->keys[0]);
  861|    712|                        if (!key_str) return {};
  862|    712|                        return std::move(ret) + "pkh(" + std::move(*key_str) + ")";
  863|    712|                    }
  864|    712|                    return "c" + std::move(subs[0]);
  865|    712|                case Fragment::WRAP_D: return "d" + std::move(subs[0]);
  866|    712|                case Fragment::WRAP_V: return "v" + std::move(subs[0]);
  867|    712|                case Fragment::WRAP_J: return "j" + std::move(subs[0]);
  868|    712|                case Fragment::WRAP_N: return "n" + std::move(subs[0]);
  869|    712|                case Fragment::AND_V:
  870|       |                    // t:X is syntactic sugar for and_v(X,1).
  871|    712|                    if (node.subs[1]->fragment == Fragment::JUST_1) return "t" + std::move(subs[0]);
  872|    712|                    break;
  873|    712|                case Fragment::OR_I:
  874|    712|                    if (node.subs[0]->fragment == Fragment::JUST_0) return "l" + std::move(subs[1]);
  875|    712|                    if (node.subs[1]->fragment == Fragment::JUST_0) return "u" + std::move(subs[0]);
  876|    712|                    break;
  877|    712|                default: break;
  878|    712|            }
  879|    712|            switch (node.fragment) {
  880|    712|                case Fragment::PK_K: {
  881|    712|                    auto key_str = ctx.ToString(node.keys[0]);
  882|    712|                    if (!key_str) return {};
  883|    712|                    return std::move(ret) + "pk_k(" + std::move(*key_str) + ")";
  884|    712|                }
  885|    712|                case Fragment::PK_H: {
  886|    712|                    auto key_str = ctx.ToString(node.keys[0]);
  887|    712|                    if (!key_str) return {};
  888|    712|                    return std::move(ret) + "pk_h(" + std::move(*key_str) + ")";
  889|    712|                }
  890|    712|                case Fragment::AFTER: return std::move(ret) + "after(" + util::ToString(node.k) + ")";
  891|    712|                case Fragment::OLDER: return std::move(ret) + "older(" + util::ToString(node.k) + ")";
  892|    712|                case Fragment::HASH256: return std::move(ret) + "hash256(" + HexStr(node.data) + ")";
  893|    712|                case Fragment::HASH160: return std::move(ret) + "hash160(" + HexStr(node.data) + ")";
  894|    712|                case Fragment::SHA256: return std::move(ret) + "sha256(" + HexStr(node.data) + ")";
  895|    712|                case Fragment::RIPEMD160: return std::move(ret) + "ripemd160(" + HexStr(node.data) + ")";
  896|    712|                case Fragment::JUST_1: return std::move(ret) + "1";
  897|    712|                case Fragment::JUST_0: return std::move(ret) + "0";
  898|    712|                case Fragment::AND_V: return std::move(ret) + "and_v(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  899|    712|                case Fragment::AND_B: return std::move(ret) + "and_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  900|    712|                case Fragment::OR_B: return std::move(ret) + "or_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  901|    712|                case Fragment::OR_D: return std::move(ret) + "or_d(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  902|    712|                case Fragment::OR_C: return std::move(ret) + "or_c(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  903|    712|                case Fragment::OR_I: return std::move(ret) + "or_i(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  904|    712|                case Fragment::ANDOR:
  905|       |                    // and_n(X,Y) is syntactic sugar for andor(X,Y,0).
  906|    712|                    if (node.subs[2]->fragment == Fragment::JUST_0) return std::move(ret) + "and_n(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  907|    712|                    return std::move(ret) + "andor(" + std::move(subs[0]) + "," + std::move(subs[1]) + "," + std::move(subs[2]) + ")";
  908|    712|                case Fragment::MULTI: {
  909|    712|                    CHECK_NONFATAL(!is_tapscript);
  910|    712|                    auto str = std::move(ret) + "multi(" + util::ToString(node.k);
  911|    712|                    for (const auto& key : node.keys) {
  912|    712|                        auto key_str = ctx.ToString(key);
  913|    712|                        if (!key_str) return {};
  914|    712|                        str += "," + std::move(*key_str);
  915|    712|                    }
  916|    712|                    return std::move(str) + ")";
  917|    712|                }
  918|    712|                case Fragment::MULTI_A: {
  919|    712|                    CHECK_NONFATAL(is_tapscript);
  920|    712|                    auto str = std::move(ret) + "multi_a(" + util::ToString(node.k);
  921|    712|                    for (const auto& key : node.keys) {
  922|    712|                        auto key_str = ctx.ToString(key);
  923|    712|                        if (!key_str) return {};
  924|    712|                        str += "," + std::move(*key_str);
  925|    712|                    }
  926|    712|                    return std::move(str) + ")";
  927|    712|                }
  928|    712|                case Fragment::THRESH: {
  929|    712|                    auto str = std::move(ret) + "thresh(" + util::ToString(node.k);
  930|    712|                    for (auto& sub : subs) {
  931|    712|                        str += "," + std::move(sub);
  932|    712|                    }
  933|    712|                    return std::move(str) + ")";
  934|    712|                }
  935|    712|                default: break;
  936|    712|            }
  937|    712|            assert(false);
  938|    712|        };
  939|       |
  940|    712|        return TreeEvalMaybe<std::string>(false, downfn, upfn);
  941|    712|    }
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|    712|    {
  606|       |        /** Entries of the explicit stack tracked in this algorithm. */
  607|    712|        struct StackElem
  608|    712|        {
  609|    712|            const Node& node; //!< The node being evaluated.
  610|    712|            size_t expanded; //!< How many children of this node have been expanded.
  611|    712|            State state; //!< The state for that node.
  612|       |
  613|    712|            StackElem(const Node& node_, size_t exp_, State&& state_) :
  614|    712|                node(node_), expanded(exp_), state(std::move(state_)) {}
  615|    712|        };
  616|       |        /* Stack of tree nodes being explored. */
  617|    712|        std::vector<StackElem> stack;
  618|       |        /* Results of subtrees so far. Their order and mapping to tree nodes
  619|       |         * is implicitly defined by stack. */
  620|    712|        std::vector<Result> results;
  621|    712|        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|   146k|        while (stack.size()) {
  ------------------
  |  Branch (639:16): [True: 145k, False: 712]
  ------------------
  640|   145k|            const Node& node = stack.back().node;
  641|   145k|            if (stack.back().expanded < node.subs.size()) {
  ------------------
  |  Branch (641:17): [True: 72.4k, False: 73.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.4k|                size_t child_index = stack.back().expanded++;
  646|  72.4k|                State child_state = downfn(stack.back().state, node, child_index);
  647|  72.4k|                stack.emplace_back(*node.subs[child_index], 0, std::move(child_state));
  648|  72.4k|                continue;
  649|  72.4k|            }
  650|       |            // Invoke upfn with the last node.subs.size() elements of results as input.
  651|  73.1k|            assert(results.size() >= node.subs.size());
  652|  73.1k|            std::optional<Result> result{upfn(std::move(stack.back().state), node,
  653|  73.1k|                Span<Result>{results}.last(node.subs.size()))};
  654|       |            // If evaluation returns std::nullopt, abort immediately.
  655|  73.1k|            if (!result) return {};
  ------------------
  |  Branch (655:17): [True: 0, False: 73.1k]
  ------------------
  656|       |            // Replace the last node.subs.size() elements of results with the new result.
  657|  73.1k|            results.erase(results.end() - node.subs.size(), results.end());
  658|  73.1k|            results.push_back(std::move(*result));
  659|  73.1k|            stack.pop_back();
  660|  73.1k|        }
  661|       |        // The final remaining results element is the root result, return it.
  662|    712|        assert(results.size() == 1);
  663|    712|        return std::move(results[0]);
  664|    712|    }
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|  73.1k|                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|  72.4k|        auto downfn = [](bool, const Node& node, size_t) {
  834|  72.4k|            return (node.fragment == Fragment::WRAP_A || node.fragment == Fragment::WRAP_S ||
  ------------------
  |  Branch (834:21): [True: 2.42k, False: 70.0k]
  |  Branch (834:58): [True: 499, False: 69.5k]
  ------------------
  835|  72.4k|                    node.fragment == Fragment::WRAP_D || node.fragment == Fragment::WRAP_V ||
  ------------------
  |  Branch (835:21): [True: 772, False: 68.7k]
  |  Branch (835:58): [True: 2.73k, False: 66.0k]
  ------------------
  836|  72.4k|                    node.fragment == Fragment::WRAP_J || node.fragment == Fragment::WRAP_N ||
  ------------------
  |  Branch (836:21): [True: 12.8k, False: 53.1k]
  |  Branch (836:58): [True: 6.68k, False: 46.4k]
  ------------------
  837|  72.4k|                    node.fragment == Fragment::WRAP_C ||
  ------------------
  |  Branch (837:21): [True: 181, False: 46.2k]
  ------------------
  838|  72.4k|                    (node.fragment == Fragment::AND_V && node.subs[1]->fragment == Fragment::JUST_1) ||
  ------------------
  |  Branch (838:22): [True: 3.89k, False: 42.3k]
  |  Branch (838:58): [True: 3.88k, False: 4]
  ------------------
  839|  72.4k|                    (node.fragment == Fragment::OR_I && node.subs[0]->fragment == Fragment::JUST_0) ||
  ------------------
  |  Branch (839:22): [True: 25.4k, False: 16.9k]
  |  Branch (839:57): [True: 17.9k, False: 7.51k]
  ------------------
  840|  72.4k|                    (node.fragment == Fragment::OR_I && node.subs[1]->fragment == Fragment::JUST_0));
  ------------------
  |  Branch (840:22): [True: 7.51k, False: 16.9k]
  |  Branch (840:57): [True: 7.36k, False: 154]
  ------------------
  841|  72.4k|        };
descriptor.cpp:_ZZNK10miniscript4NodeIjE8ToStringIN12_GLOBAL__N_19KeyParserEEENSt3__18optionalINS5_12basic_stringIcNS5_11char_traitsIcEENS5_9allocatorIcEEEEEERKT_ENKUlbRKS1_4SpanISC_EE_clEbSI_SK_:
  845|  73.1k|        auto upfn = [&ctx, is_tapscript](bool wrapped, const Node& node, Span<std::string> subs) -> std::optional<std::string> {
  846|  73.1k|            std::string ret = wrapped ? ":" : "";
  ------------------
  |  Branch (846:31): [True: 55.3k, False: 17.8k]
  ------------------
  847|       |
  848|  73.1k|            switch (node.fragment) {
  849|  2.42k|                case Fragment::WRAP_A: return "a" + std::move(subs[0]);
  ------------------
  |  Branch (849:17): [True: 2.42k, False: 70.7k]
  ------------------
  850|    499|                case Fragment::WRAP_S: return "s" + std::move(subs[0]);
  ------------------
  |  Branch (850:17): [True: 499, False: 72.6k]
  ------------------
  851|    181|                case Fragment::WRAP_C:
  ------------------
  |  Branch (851:17): [True: 181, False: 72.9k]
  ------------------
  852|    181|                    if (node.subs[0]->fragment == Fragment::PK_K) {
  ------------------
  |  Branch (852:25): [True: 43, False: 138]
  ------------------
  853|       |                        // pk(K) is syntactic sugar for c:pk_k(K)
  854|     43|                        auto key_str = ctx.ToString(node.subs[0]->keys[0]);
  855|     43|                        if (!key_str) return {};
  ------------------
  |  Branch (855:29): [True: 0, False: 43]
  ------------------
  856|     43|                        return std::move(ret) + "pk(" + std::move(*key_str) + ")";
  857|     43|                    }
  858|    138|                    if (node.subs[0]->fragment == Fragment::PK_H) {
  ------------------
  |  Branch (858:25): [True: 76, False: 62]
  ------------------
  859|       |                        // pkh(K) is syntactic sugar for c:pk_h(K)
  860|     76|                        auto key_str = ctx.ToString(node.subs[0]->keys[0]);
  861|     76|                        if (!key_str) return {};
  ------------------
  |  Branch (861:29): [True: 0, False: 76]
  ------------------
  862|     76|                        return std::move(ret) + "pkh(" + std::move(*key_str) + ")";
  863|     76|                    }
  864|     62|                    return "c" + std::move(subs[0]);
  865|    772|                case Fragment::WRAP_D: return "d" + std::move(subs[0]);
  ------------------
  |  Branch (865:17): [True: 772, False: 72.3k]
  ------------------
  866|  2.73k|                case Fragment::WRAP_V: return "v" + std::move(subs[0]);
  ------------------
  |  Branch (866:17): [True: 2.73k, False: 70.4k]
  ------------------
  867|  12.8k|                case Fragment::WRAP_J: return "j" + std::move(subs[0]);
  ------------------
  |  Branch (867:17): [True: 12.8k, False: 60.2k]
  ------------------
  868|  6.68k|                case Fragment::WRAP_N: return "n" + std::move(subs[0]);
  ------------------
  |  Branch (868:17): [True: 6.68k, False: 66.4k]
  ------------------
  869|  1.94k|                case Fragment::AND_V:
  ------------------
  |  Branch (869:17): [True: 1.94k, False: 71.2k]
  ------------------
  870|       |                    // t:X is syntactic sugar for and_v(X,1).
  871|  1.94k|                    if (node.subs[1]->fragment == Fragment::JUST_1) return "t" + std::move(subs[0]);
  ------------------
  |  Branch (871:25): [True: 1.94k, False: 2]
  ------------------
  872|      2|                    break;
  873|  12.7k|                case Fragment::OR_I:
  ------------------
  |  Branch (873:17): [True: 12.7k, False: 60.4k]
  ------------------
  874|  12.7k|                    if (node.subs[0]->fragment == Fragment::JUST_0) return "l" + std::move(subs[1]);
  ------------------
  |  Branch (874:25): [True: 8.95k, False: 3.75k]
  ------------------
  875|  3.75k|                    if (node.subs[1]->fragment == Fragment::JUST_0) return "u" + std::move(subs[0]);
  ------------------
  |  Branch (875:25): [True: 3.68k, False: 77]
  ------------------
  876|     77|                    break;
  877|  32.3k|                default: break;
  ------------------
  |  Branch (877:17): [True: 32.3k, False: 40.8k]
  ------------------
  878|  73.1k|            }
  879|  32.4k|            switch (node.fragment) {
  880|     45|                case Fragment::PK_K: {
  ------------------
  |  Branch (880:17): [True: 45, False: 32.3k]
  ------------------
  881|     45|                    auto key_str = ctx.ToString(node.keys[0]);
  882|     45|                    if (!key_str) return {};
  ------------------
  |  Branch (882:25): [True: 0, False: 45]
  ------------------
  883|     45|                    return std::move(ret) + "pk_k(" + std::move(*key_str) + ")";
  884|     45|                }
  885|     77|                case Fragment::PK_H: {
  ------------------
  |  Branch (885:17): [True: 77, False: 32.3k]
  ------------------
  886|     77|                    auto key_str = ctx.ToString(node.keys[0]);
  887|     77|                    if (!key_str) return {};
  ------------------
  |  Branch (887:25): [True: 0, False: 77]
  ------------------
  888|     77|                    return std::move(ret) + "pk_h(" + std::move(*key_str) + ")";
  889|     77|                }
  890|    561|                case Fragment::AFTER: return std::move(ret) + "after(" + util::ToString(node.k) + ")";
  ------------------
  |  Branch (890:17): [True: 561, False: 31.8k]
  ------------------
  891|    729|                case Fragment::OLDER: return std::move(ret) + "older(" + util::ToString(node.k) + ")";
  ------------------
  |  Branch (891:17): [True: 729, False: 31.6k]
  ------------------
  892|      0|                case Fragment::HASH256: return std::move(ret) + "hash256(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (892:17): [True: 0, False: 32.4k]
  ------------------
  893|     93|                case Fragment::HASH160: return std::move(ret) + "hash160(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (893:17): [True: 93, False: 32.3k]
  ------------------
  894|      1|                case Fragment::SHA256: return std::move(ret) + "sha256(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (894:17): [True: 1, False: 32.4k]
  ------------------
  895|      1|                case Fragment::RIPEMD160: return std::move(ret) + "ripemd160(" + HexStr(node.data) + ")";
  ------------------
  |  Branch (895:17): [True: 1, False: 32.4k]
  ------------------
  896|  3.74k|                case Fragment::JUST_1: return std::move(ret) + "1";
  ------------------
  |  Branch (896:17): [True: 3.74k, False: 28.6k]
  ------------------
  897|  25.3k|                case Fragment::JUST_0: return std::move(ret) + "0";
  ------------------
  |  Branch (897:17): [True: 25.3k, False: 7.04k]
  ------------------
  898|      2|                case Fragment::AND_V: return std::move(ret) + "and_v(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (898:17): [True: 2, False: 32.4k]
  ------------------
  899|     86|                case Fragment::AND_B: return std::move(ret) + "and_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (899:17): [True: 86, False: 32.3k]
  ------------------
  900|    437|                case Fragment::OR_B: return std::move(ret) + "or_b(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (900:17): [True: 437, False: 31.9k]
  ------------------
  901|     76|                case Fragment::OR_D: return std::move(ret) + "or_d(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (901:17): [True: 76, False: 32.3k]
  ------------------
  902|     36|                case Fragment::OR_C: return std::move(ret) + "or_c(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (902:17): [True: 36, False: 32.3k]
  ------------------
  903|     77|                case Fragment::OR_I: return std::move(ret) + "or_i(" + std::move(subs[0]) + "," + std::move(subs[1]) + ")";
  ------------------
  |  Branch (903:17): [True: 77, False: 32.3k]
  ------------------
  904|    298|                case Fragment::ANDOR:
  ------------------
  |  Branch (904:17): [True: 298, False: 32.1k]
  ------------------
  905|       |                    // and_n(X,Y) is syntactic sugar for andor(X,Y,0).
  906|    298|                    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: 209, False: 89]
  ------------------
  907|     89|                    return std::move(ret) + "andor(" + std::move(subs[0]) + "," + std::move(subs[1]) + "," + std::move(subs[2]) + ")";
  908|    393|                case Fragment::MULTI: {
  ------------------
  |  Branch (908:17): [True: 393, False: 32.0k]
  ------------------
  909|    393|                    CHECK_NONFATAL(!is_tapscript);
  ------------------
  |  |   82|    393|    inline_check_non_fatal(condition, __FILE__, __LINE__, __func__, #condition)
  ------------------
  910|    393|                    auto str = std::move(ret) + "multi(" + util::ToString(node.k);
  911|    872|                    for (const auto& key : node.keys) {
  ------------------
  |  Branch (911:42): [True: 872, False: 393]
  ------------------
  912|    872|                        auto key_str = ctx.ToString(key);
  913|    872|                        if (!key_str) return {};
  ------------------
  |  Branch (913:29): [True: 0, False: 872]
  ------------------
  914|    872|                        str += "," + std::move(*key_str);
  915|    872|                    }
  916|    393|                    return std::move(str) + ")";
  917|    393|                }
  918|     19|                case Fragment::MULTI_A: {
  ------------------
  |  Branch (918:17): [True: 19, False: 32.3k]
  ------------------
  919|     19|                    CHECK_NONFATAL(is_tapscript);
  ------------------
  |  |   82|     19|    inline_check_non_fatal(condition, __FILE__, __LINE__, __func__, #condition)
  ------------------
  920|     19|                    auto str = std::move(ret) + "multi_a(" + util::ToString(node.k);
  921|    500|                    for (const auto& key : node.keys) {
  ------------------
  |  Branch (921:42): [True: 500, False: 19]
  ------------------
  922|    500|                        auto key_str = ctx.ToString(key);
  923|    500|                        if (!key_str) return {};
  ------------------
  |  Branch (923:29): [True: 0, False: 500]
  ------------------
  924|    500|                        str += "," + std::move(*key_str);
  925|    500|                    }
  926|     19|                    return std::move(str) + ")";
  927|     19|                }
  928|    360|                case Fragment::THRESH: {
  ------------------
  |  Branch (928:17): [True: 360, False: 32.0k]
  ------------------
  929|    360|                    auto str = std::move(ret) + "thresh(" + util::ToString(node.k);
  930|  14.8k|                    for (auto& sub : subs) {
  ------------------
  |  Branch (930:36): [True: 14.8k, False: 360]
  ------------------
  931|  14.8k|                        str += "," + std::move(sub);
  932|  14.8k|                    }
  933|    360|                    return std::move(str) + ")";
  934|     19|                }
  935|      0|                default: break;
  ------------------
  |  Branch (935:17): [True: 0, False: 32.4k]
  ------------------
  936|  32.4k|            }
  937|      0|            assert(false);
  938|      0|        };
_ZNK10miniscript4NodeIjE7IsValidEv:
 1614|   135k|    bool IsValid() const {
 1615|   135k|        if (GetType() == ""_mst) return false;
  ------------------
  |  Branch (1615:13): [True: 3.95k, False: 131k]
  ------------------
 1616|   131k|        return ScriptSize() <= internal::MaxScriptSize(m_script_ctx);
 1617|   135k|    }
_ZNK10miniscript4NodeIjE14IsNonMalleableEv:
 1623|   130k|    bool IsNonMalleable() const { return GetType() << "m"_mst; }
_ZNK10miniscript4NodeIjE14NeedsSignatureEv:
 1626|  1.62k|    bool NeedsSignature() const { return GetType() << "s"_mst; }
_ZNK10miniscript4NodeIjE17CheckTimeLocksMixEv:
 1629|   129k|    bool CheckTimeLocksMix() const { return GetType() << "k"_mst; }
_ZNK10miniscript4NodeIjE17CheckDuplicateKeyEv:
 1632|   129k|    bool CheckDuplicateKey() const { return has_duplicate_keys && !*has_duplicate_keys; }
  ------------------
  |  Branch (1632:45): [True: 129k, False: 0]
  |  Branch (1632:67): [True: 129k, False: 230]
  ------------------
_ZNK10miniscript4NodeIjE18ValidSatisfactionsEv:
 1635|   132k|    bool ValidSatisfactions() const { return IsValid() && CheckOpsLimit() && CheckStackSize(); }
  ------------------
  |  Branch (1635:46): [True: 129k, False: 2.93k]
  |  Branch (1635:59): [True: 129k, False: 79]
  |  Branch (1635:78): [True: 129k, False: 10]
  ------------------
_ZNK10miniscript4NodeIjE13CheckOpsLimitEv:
 1511|   129k|    bool CheckOpsLimit() const {
 1512|   129k|        if (IsTapscript(m_script_ctx)) return true;
  ------------------
  |  Branch (1512:13): [True: 47.1k, False: 82.7k]
  ------------------
 1513|  82.7k|        if (const auto ops = GetOps()) return *ops <= MAX_OPS_PER_SCRIPT;
  ------------------
  |  Branch (1513:24): [True: 32.1k, False: 50.6k]
  ------------------
 1514|  50.6k|        return true;
 1515|  82.7k|    }
_ZNK10miniscript4NodeIjE6GetOpsEv:
 1502|  82.7k|    std::optional<uint32_t> GetOps() const {
 1503|  82.7k|        if (!ops.sat.valid) return {};
  ------------------
  |  Branch (1503:13): [True: 50.6k, False: 32.1k]
  ------------------
 1504|  32.1k|        return ops.count + ops.sat.value;
 1505|  82.7k|    }
_ZNK10miniscript4NodeIjE14CheckStackSizeEv:
 1535|   129k|    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|   129k|        if (IsTapscript(m_script_ctx)) {
  ------------------
  |  Branch (1538:13): [True: 47.1k, False: 82.6k]
  ------------------
 1539|  47.1k|            if (const auto exec_ss = GetExecStackSize()) return exec_ss <= MAX_STACK_SIZE;
  ------------------
  |  Branch (1539:28): [True: 25.5k, False: 21.6k]
  ------------------
 1540|  21.6k|            return true;
 1541|  47.1k|        }
 1542|  82.6k|        if (const auto ss = GetStackSize()) return *ss <= MAX_STANDARD_P2WSH_STACK_ITEMS;
  ------------------
  |  Branch (1542:24): [True: 32.0k, False: 50.6k]
  ------------------
 1543|  50.6k|        return true;
 1544|  82.6k|    }
_ZNK10miniscript4NodeIjE16GetExecStackSizeEv:
 1529|  47.1k|    std::optional<uint32_t> GetExecStackSize() const {
 1530|  47.1k|        if (!ss.sat.valid) return {};
  ------------------
  |  Branch (1530:13): [True: 21.6k, False: 25.5k]
  ------------------
 1531|  25.5k|        return ss.sat.exec + static_cast<int32_t>(IsBKW());
 1532|  47.1k|    }
_ZNK10miniscript4NodeIjE8GetMsCtxEv:
 1560|    575|    MiniscriptContext GetMsCtx() const { return m_script_ctx; }
descriptor.cpp:_ZNK10miniscript4NodeIjE8ToScriptIN12_GLOBAL__N_111ScriptMakerEEE7CScriptRKT_:
  751|    575|    {
  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|    575|        auto downfn = [](bool verify, const Node& node, size_t index) {
  756|       |            // For WRAP_V, the subexpression is certainly followed by OP_VERIFY.
  757|    575|            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|    575|            if (node.fragment == Fragment::WRAP_S ||
  761|    575|                (node.fragment == Fragment::AND_V && index == 1)) return verify;
  762|    575|            return false;
  763|    575|        };
  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|    575|        const bool is_tapscript{IsTapscript(m_script_ctx)};
  767|    575|        auto upfn = [&ctx, is_tapscript](bool verify, const Node& node, Span<CScript> subs) -> CScript {
  768|    575|            switch (node.fragment) {
  769|    575|                case Fragment::PK_K: return BuildScript(ctx.ToPKBytes(node.keys[0]));
  770|    575|                case Fragment::PK_H: return BuildScript(OP_DUP, OP_HASH160, ctx.ToPKHBytes(node.keys[0]), OP_EQUALVERIFY);
  771|    575|                case Fragment::OLDER: return BuildScript(node.k, OP_CHECKSEQUENCEVERIFY);
  772|    575|                case Fragment::AFTER: return BuildScript(node.k, OP_CHECKLOCKTIMEVERIFY);
  773|    575|                case Fragment::SHA256: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_SHA256, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  774|    575|                case Fragment::RIPEMD160: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_RIPEMD160, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  775|    575|                case Fragment::HASH256: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_HASH256, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  776|    575|                case Fragment::HASH160: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_HASH160, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  777|    575|                case Fragment::WRAP_A: return BuildScript(OP_TOALTSTACK, subs[0], OP_FROMALTSTACK);
  778|    575|                case Fragment::WRAP_S: return BuildScript(OP_SWAP, subs[0]);
  779|    575|                case Fragment::WRAP_C: return BuildScript(std::move(subs[0]), verify ? OP_CHECKSIGVERIFY : OP_CHECKSIG);
  780|    575|                case Fragment::WRAP_D: return BuildScript(OP_DUP, OP_IF, subs[0], OP_ENDIF);
  781|    575|                case Fragment::WRAP_V: {
  782|    575|                    if (node.subs[0]->GetType() << "x"_mst) {
  783|    575|                        return BuildScript(std::move(subs[0]), OP_VERIFY);
  784|    575|                    } else {
  785|    575|                        return std::move(subs[0]);
  786|    575|                    }
  787|    575|                }
  788|    575|                case Fragment::WRAP_J: return BuildScript(OP_SIZE, OP_0NOTEQUAL, OP_IF, subs[0], OP_ENDIF);
  789|    575|                case Fragment::WRAP_N: return BuildScript(std::move(subs[0]), OP_0NOTEQUAL);
  790|    575|                case Fragment::JUST_1: return BuildScript(OP_1);
  791|    575|                case Fragment::JUST_0: return BuildScript(OP_0);
  792|    575|                case Fragment::AND_V: return BuildScript(std::move(subs[0]), subs[1]);
  793|    575|                case Fragment::AND_B: return BuildScript(std::move(subs[0]), subs[1], OP_BOOLAND);
  794|    575|                case Fragment::OR_B: return BuildScript(std::move(subs[0]), subs[1], OP_BOOLOR);
  795|    575|                case Fragment::OR_D: return BuildScript(std::move(subs[0]), OP_IFDUP, OP_NOTIF, subs[1], OP_ENDIF);
  796|    575|                case Fragment::OR_C: return BuildScript(std::move(subs[0]), OP_NOTIF, subs[1], OP_ENDIF);
  797|    575|                case Fragment::OR_I: return BuildScript(OP_IF, subs[0], OP_ELSE, subs[1], OP_ENDIF);
  798|    575|                case Fragment::ANDOR: return BuildScript(std::move(subs[0]), OP_NOTIF, subs[2], OP_ELSE, subs[1], OP_ENDIF);
  799|    575|                case Fragment::MULTI: {
  800|    575|                    CHECK_NONFATAL(!is_tapscript);
  801|    575|                    CScript script = BuildScript(node.k);
  802|    575|                    for (const auto& key : node.keys) {
  803|    575|                        script = BuildScript(std::move(script), ctx.ToPKBytes(key));
  804|    575|                    }
  805|    575|                    return BuildScript(std::move(script), node.keys.size(), verify ? OP_CHECKMULTISIGVERIFY : OP_CHECKMULTISIG);
  806|    575|                }
  807|    575|                case Fragment::MULTI_A: {
  808|    575|                    CHECK_NONFATAL(is_tapscript);
  809|    575|                    CScript script = BuildScript(ctx.ToPKBytes(*node.keys.begin()), OP_CHECKSIG);
  810|    575|                    for (auto it = node.keys.begin() + 1; it != node.keys.end(); ++it) {
  811|    575|                        script = BuildScript(std::move(script), ctx.ToPKBytes(*it), OP_CHECKSIGADD);
  812|    575|                    }
  813|    575|                    return BuildScript(std::move(script), node.k, verify ? OP_NUMEQUALVERIFY : OP_NUMEQUAL);
  814|    575|                }
  815|    575|                case Fragment::THRESH: {
  816|    575|                    CScript script = std::move(subs[0]);
  817|    575|                    for (size_t i = 1; i < subs.size(); ++i) {
  818|    575|                        script = BuildScript(std::move(script), subs[i], OP_ADD);
  819|    575|                    }
  820|    575|                    return BuildScript(std::move(script), node.k, verify ? OP_EQUALVERIFY : OP_EQUAL);
  821|    575|                }
  822|    575|            }
  823|    575|            assert(false);
  824|    575|        };
  825|    575|        return TreeEval<CScript>(false, downfn, upfn);
  826|    575|    }
descriptor.cpp:_ZNK10miniscript4NodeIjE8TreeEvalI7CScriptbRZNKS1_8ToScriptIN12_GLOBAL__N_111ScriptMakerEEES3_RKT_EUlbRKS1_mE_ZNKS4_IS6_EES3_S9_EUlbSB_4SpanIS3_EE_EES7_T0_OT1_T2_:
  683|    575|    {
  684|       |        // Invoke TreeEvalMaybe with upfn wrapped to return std::optional<Result>, and then
  685|       |        // unconditionally dereference the result (it cannot be std::nullopt).
  686|    575|        return std::move(*TreeEvalMaybe<Result>(std::move(root_state),
  687|    575|            std::forward<DownFn>(downfn),
  688|    575|            [&upfn](State&& state, const Node& node, Span<Result> subs) {
  689|    575|                Result res{upfn(std::move(state), node, subs)};
  690|    575|                return std::optional<Result>(std::move(res));
  691|    575|            }
  692|    575|        ));
  693|    575|    }
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|    575|    {
  606|       |        /** Entries of the explicit stack tracked in this algorithm. */
  607|    575|        struct StackElem
  608|    575|        {
  609|    575|            const Node& node; //!< The node being evaluated.
  610|    575|            size_t expanded; //!< How many children of this node have been expanded.
  611|    575|            State state; //!< The state for that node.
  612|       |
  613|    575|            StackElem(const Node& node_, size_t exp_, State&& state_) :
  614|    575|                node(node_), expanded(exp_), state(std::move(state_)) {}
  615|    575|        };
  616|       |        /* Stack of tree nodes being explored. */
  617|    575|        std::vector<StackElem> stack;
  618|       |        /* Results of subtrees so far. Their order and mapping to tree nodes
  619|       |         * is implicitly defined by stack. */
  620|    575|        std::vector<Result> results;
  621|    575|        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|   495k|        while (stack.size()) {
  ------------------
  |  Branch (639:16): [True: 495k, False: 575]
  ------------------
  640|   495k|            const Node& node = stack.back().node;
  641|   495k|            if (stack.back().expanded < node.subs.size()) {
  ------------------
  |  Branch (641:17): [True: 247k, False: 247k]
  ------------------
  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|   247k|                size_t child_index = stack.back().expanded++;
  646|   247k|                State child_state = downfn(stack.back().state, node, child_index);
  647|   247k|                stack.emplace_back(*node.subs[child_index], 0, std::move(child_state));
  648|   247k|                continue;
  649|   247k|            }
  650|       |            // Invoke upfn with the last node.subs.size() elements of results as input.
  651|   247k|            assert(results.size() >= node.subs.size());
  652|   247k|            std::optional<Result> result{upfn(std::move(stack.back().state), node,
  653|   247k|                Span<Result>{results}.last(node.subs.size()))};
  654|       |            // If evaluation returns std::nullopt, abort immediately.
  655|   247k|            if (!result) return {};
  ------------------
  |  Branch (655:17): [True: 0, False: 247k]
  ------------------
  656|       |            // Replace the last node.subs.size() elements of results with the new result.
  657|   247k|            results.erase(results.end() - node.subs.size(), results.end());
  658|   247k|            results.push_back(std::move(*result));
  659|   247k|            stack.pop_back();
  660|   247k|        }
  661|       |        // The final remaining results element is the root result, return it.
  662|    575|        assert(results.size() == 1);
  663|    575|        return std::move(results[0]);
  664|    575|    }
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|   247k|                node(node_), expanded(exp_), state(std::move(state_)) {}
descriptor.cpp:_ZZNK10miniscript4NodeIjE8ToScriptIN12_GLOBAL__N_111ScriptMakerEEE7CScriptRKT_ENKUlbRKS1_mE_clEbSA_m:
  755|   247k|        auto downfn = [](bool verify, const Node& node, size_t index) {
  756|       |            // For WRAP_V, the subexpression is certainly followed by OP_VERIFY.
  757|   247k|            if (node.fragment == Fragment::WRAP_V) return true;
  ------------------
  |  Branch (757:17): [True: 2.01k, False: 245k]
  ------------------
  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|   245k|            if (node.fragment == Fragment::WRAP_S ||
  ------------------
  |  Branch (760:17): [True: 69, False: 245k]
  ------------------
  761|   245k|                (node.fragment == Fragment::AND_V && index == 1)) return verify;
  ------------------
  |  Branch (761:18): [True: 3.87k, False: 241k]
  |  Branch (761:54): [True: 1.93k, False: 1.93k]
  ------------------
  762|   243k|            return false;
  763|   245k|        };
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|   247k|            [&upfn](State&& state, const Node& node, Span<Result> subs) {
  689|   247k|                Result res{upfn(std::move(state), node, subs)};
  690|   247k|                return std::optional<Result>(std::move(res));
  691|   247k|            }
descriptor.cpp:_ZZNK10miniscript4NodeIjE8ToScriptIN12_GLOBAL__N_111ScriptMakerEEE7CScriptRKT_ENKUlbRKS1_4SpanIS5_EE_clEbSA_SC_:
  767|   247k|        auto upfn = [&ctx, is_tapscript](bool verify, const Node& node, Span<CScript> subs) -> CScript {
  768|   247k|            switch (node.fragment) {
  ------------------
  |  Branch (768:21): [True: 0, False: 247k]
  ------------------
  769|    169|                case Fragment::PK_K: return BuildScript(ctx.ToPKBytes(node.keys[0]));
  ------------------
  |  Branch (769:17): [True: 169, False: 247k]
  ------------------
  770|    138|                case Fragment::PK_H: return BuildScript(OP_DUP, OP_HASH160, ctx.ToPKHBytes(node.keys[0]), OP_EQUALVERIFY);
  ------------------
  |  Branch (770:17): [True: 138, False: 247k]
  ------------------
  771|      2|                case Fragment::OLDER: return BuildScript(node.k, OP_CHECKSEQUENCEVERIFY);
  ------------------
  |  Branch (771:17): [True: 2, False: 247k]
  ------------------
  772|      3|                case Fragment::AFTER: return BuildScript(node.k, OP_CHECKLOCKTIMEVERIFY);
  ------------------
  |  Branch (772:17): [True: 3, False: 247k]
  ------------------
  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: 247k]
  |  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: 247k]
  |  Branch (774:116): [True: 0, False: 0]
  ------------------
  775|      0|                case Fragment::HASH256: return BuildScript(OP_SIZE, 32, OP_EQUALVERIFY, OP_HASH256, node.data, verify ? OP_EQUALVERIFY : OP_EQUAL);
  ------------------
  |  Branch (775:17): [True: 0, False: 247k]
  |  Branch (775:112): [True: 0, False: 0]
  ------------------
  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: 247k]
  |  Branch (776:112): [True: 0, False: 0]
  ------------------
  777|    160|                case Fragment::WRAP_A: return BuildScript(OP_TOALTSTACK, subs[0], OP_FROMALTSTACK);
  ------------------
  |  Branch (777:17): [True: 160, False: 247k]
  ------------------
  778|     69|                case Fragment::WRAP_S: return BuildScript(OP_SWAP, subs[0]);
  ------------------
  |  Branch (778:17): [True: 69, False: 247k]
  ------------------
  779|    307|                case Fragment::WRAP_C: return BuildScript(std::move(subs[0]), verify ? OP_CHECKSIGVERIFY : OP_CHECKSIG);
  ------------------
  |  Branch (779:17): [True: 307, False: 247k]
  |  Branch (779:79): [True: 6, False: 301]
  ------------------
  780|     75|                case Fragment::WRAP_D: return BuildScript(OP_DUP, OP_IF, subs[0], OP_ENDIF);
  ------------------
  |  Branch (780:17): [True: 75, False: 247k]
  ------------------
  781|  2.01k|                case Fragment::WRAP_V: {
  ------------------
  |  Branch (781:17): [True: 2.01k, False: 245k]
  ------------------
  782|  2.01k|                    if (node.subs[0]->GetType() << "x"_mst) {
  ------------------
  |  Branch (782:25): [True: 1.97k, False: 42]
  ------------------
  783|  1.97k|                        return BuildScript(std::move(subs[0]), OP_VERIFY);
  784|  1.97k|                    } else {
  785|     42|                        return std::move(subs[0]);
  786|     42|                    }
  787|  2.01k|                }
  788|   187k|                case Fragment::WRAP_J: return BuildScript(OP_SIZE, OP_0NOTEQUAL, OP_IF, subs[0], OP_ENDIF);
  ------------------
  |  Branch (788:17): [True: 187k, False: 60.0k]
  ------------------
  789|  16.6k|                case Fragment::WRAP_N: return BuildScript(std::move(subs[0]), OP_0NOTEQUAL);
  ------------------
  |  Branch (789:17): [True: 16.6k, False: 231k]
  ------------------
  790|  1.94k|                case Fragment::JUST_1: return BuildScript(OP_1);
  ------------------
  |  Branch (790:17): [True: 1.94k, False: 245k]
  ------------------
  791|  18.2k|                case Fragment::JUST_0: return BuildScript(OP_0);
  ------------------
  |  Branch (791:17): [True: 18.2k, False: 229k]
  ------------------
  792|  1.93k|                case Fragment::AND_V: return BuildScript(std::move(subs[0]), subs[1]);
  ------------------
  |  Branch (792:17): [True: 1.93k, False: 245k]
  ------------------
  793|     11|                case Fragment::AND_B: return BuildScript(std::move(subs[0]), subs[1], OP_BOOLAND);
  ------------------
  |  Branch (793:17): [True: 11, False: 247k]
  ------------------
  794|      0|                case Fragment::OR_B: return BuildScript(std::move(subs[0]), subs[1], OP_BOOLOR);
  ------------------
  |  Branch (794:17): [True: 0, False: 247k]
  ------------------
  795|      2|                case Fragment::OR_D: return BuildScript(std::move(subs[0]), OP_IFDUP, OP_NOTIF, subs[1], OP_ENDIF);
  ------------------
  |  Branch (795:17): [True: 2, False: 247k]
  ------------------
  796|      0|                case Fragment::OR_C: return BuildScript(std::move(subs[0]), OP_NOTIF, subs[1], OP_ENDIF);
  ------------------
  |  Branch (796:17): [True: 0, False: 247k]
  ------------------
  797|  18.0k|                case Fragment::OR_I: return BuildScript(OP_IF, subs[0], OP_ELSE, subs[1], OP_ENDIF);
  ------------------
  |  Branch (797:17): [True: 18.0k, False: 229k]
  ------------------
  798|      0|                case Fragment::ANDOR: return BuildScript(std::move(subs[0]), OP_NOTIF, subs[2], OP_ELSE, subs[1], OP_ENDIF);
  ------------------
  |  Branch (798:17): [True: 0, False: 247k]
  ------------------
  799|    230|                case Fragment::MULTI: {
  ------------------
  |  Branch (799:17): [True: 230, False: 247k]
  ------------------
  800|    230|                    CHECK_NONFATAL(!is_tapscript);
  ------------------
  |  |   82|    230|    inline_check_non_fatal(condition, __FILE__, __LINE__, __func__, #condition)
  ------------------
  801|    230|                    CScript script = BuildScript(node.k);
  802|  1.44k|                    for (const auto& key : node.keys) {
  ------------------
  |  Branch (802:42): [True: 1.44k, False: 230]
  ------------------
  803|  1.44k|                        script = BuildScript(std::move(script), ctx.ToPKBytes(key));
  804|  1.44k|                    }
  805|    230|                    return BuildScript(std::move(script), node.keys.size(), verify ? OP_CHECKMULTISIGVERIFY : OP_CHECKMULTISIG);
  ------------------
  |  Branch (805:77): [True: 35, False: 195]
  ------------------
  806|  2.01k|                }
  807|     46|                case Fragment::MULTI_A: {
  ------------------
  |  Branch (807:17): [True: 46, False: 247k]
  ------------------
  808|     46|                    CHECK_NONFATAL(is_tapscript);
  ------------------
  |  |   82|     46|    inline_check_non_fatal(condition, __FILE__, __LINE__, __func__, #condition)
  ------------------
  809|     46|                    CScript script = BuildScript(ctx.ToPKBytes(*node.keys.begin()), OP_CHECKSIG);
  810|    248|                    for (auto it = node.keys.begin() + 1; it != node.keys.end(); ++it) {
  ------------------
  |  Branch (810:59): [True: 202, False: 46]
  ------------------
  811|    202|                        script = BuildScript(std::move(script), ctx.ToPKBytes(*it), OP_CHECKSIGADD);
  812|    202|                    }
  813|     46|                    return BuildScript(std::move(script), node.k, verify ? OP_NUMEQUALVERIFY : OP_NUMEQUAL);
  ------------------
  |  Branch (813:67): [True: 1, False: 45]
  ------------------
  814|  2.01k|                }
  815|     52|                case Fragment::THRESH: {
  ------------------
  |  Branch (815:17): [True: 52, False: 247k]
  ------------------
  816|     52|                    CScript script = std::move(subs[0]);
  817|    270|                    for (size_t i = 1; i < subs.size(); ++i) {
  ------------------
  |  Branch (817:40): [True: 218, False: 52]
  ------------------
  818|    218|                        script = BuildScript(std::move(script), subs[i], OP_ADD);
  819|    218|                    }
  820|     52|                    return BuildScript(std::move(script), node.k, verify ? OP_EQUALVERIFY : OP_EQUAL);
  ------------------
  |  Branch (820:67): [True: 0, False: 52]
  ------------------
  821|  2.01k|                }
  822|   247k|            }
  823|      0|            assert(false);
  824|      0|        };
_ZNK10miniscript4NodeIjE5CloneEv:
  532|  1.31k|    {
  533|       |        // Use TreeEval() to avoid a stack-overflow due to recursion
  534|  1.31k|        auto upfn = [](const Node& node, Span<NodeRef<Key>> children) {
  535|  1.31k|            std::vector<NodeRef<Key>> new_subs;
  536|  1.31k|            for (auto child = children.begin(); child != children.end(); ++child) {
  537|  1.31k|                new_subs.emplace_back(std::move(*child));
  538|  1.31k|            }
  539|       |            // std::make_unique (and therefore MakeNodeRef) doesn't work on private constructors
  540|  1.31k|            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|  1.31k|        };
  542|  1.31k|        return TreeEval<NodeRef<Key>>(upfn);
  543|  1.31k|    }
_ZNK10miniscript4NodeIjE8TreeEvalINSt3__110unique_ptrIKS1_NS3_14default_deleteIS5_EEEEZNKS1_5CloneEvEUlRS5_4SpanIS8_EE_EET_T0_:
  699|  1.31k|    {
  700|  1.31k|        struct DummyState {};
  701|  1.31k|        return std::move(*TreeEvalMaybe<Result>(DummyState{},
  702|  1.31k|            [](DummyState, const Node&, size_t) { return DummyState{}; },
  703|  1.31k|            [&upfn](DummyState, const Node& node, Span<Result> subs) {
  704|  1.31k|                Result res{upfn(node, subs)};
  705|  1.31k|                return std::optional<Result>(std::move(res));
  706|  1.31k|            }
  707|  1.31k|        ));
  708|  1.31k|    }
_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|  1.31k|    {
  606|       |        /** Entries of the explicit stack tracked in this algorithm. */
  607|  1.31k|        struct StackElem
  608|  1.31k|        {
  609|  1.31k|            const Node& node; //!< The node being evaluated.
  610|  1.31k|            size_t expanded; //!< How many children of this node have been expanded.
  611|  1.31k|            State state; //!< The state for that node.
  612|       |
  613|  1.31k|            StackElem(const Node& node_, size_t exp_, State&& state_) :
  614|  1.31k|                node(node_), expanded(exp_), state(std::move(state_)) {}
  615|  1.31k|        };
  616|       |        /* Stack of tree nodes being explored. */
  617|  1.31k|        std::vector<StackElem> stack;
  618|       |        /* Results of subtrees so far. Their order and mapping to tree nodes
  619|       |         * is implicitly defined by stack. */
  620|  1.31k|        std::vector<Result> results;
  621|  1.31k|        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|   568k|        while (stack.size()) {
  ------------------
  |  Branch (639:16): [True: 567k, False: 1.31k]
  ------------------
  640|   567k|            const Node& node = stack.back().node;
  641|   567k|            if (stack.back().expanded < node.subs.size()) {
  ------------------
  |  Branch (641:17): [True: 283k, False: 284k]
  ------------------
  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|   283k|                size_t child_index = stack.back().expanded++;
  646|   283k|                State child_state = downfn(stack.back().state, node, child_index);
  647|   283k|                stack.emplace_back(*node.subs[child_index], 0, std::move(child_state));
  648|   283k|                continue;
  649|   283k|            }
  650|       |            // Invoke upfn with the last node.subs.size() elements of results as input.
  651|   284k|            assert(results.size() >= node.subs.size());
  652|   284k|            std::optional<Result> result{upfn(std::move(stack.back().state), node,
  653|   284k|                Span<Result>{results}.last(node.subs.size()))};
  654|       |            // If evaluation returns std::nullopt, abort immediately.
  655|   284k|            if (!result) return {};
  ------------------
  |  Branch (655:17): [True: 0, False: 284k]
  ------------------
  656|       |            // Replace the last node.subs.size() elements of results with the new result.
  657|   284k|            results.erase(results.end() - node.subs.size(), results.end());
  658|   284k|            results.push_back(std::move(*result));
  659|   284k|            stack.pop_back();
  660|   284k|        }
  661|       |        // The final remaining results element is the root result, return it.
  662|  1.31k|        assert(results.size() == 1);
  663|  1.31k|        return std::move(results[0]);
  664|  1.31k|    }
_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|   284k|                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|   283k|            [](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|   284k|            [&upfn](DummyState, const Node& node, Span<Result> subs) {
  704|   284k|                Result res{upfn(node, subs)};
  705|   284k|                return std::optional<Result>(std::move(res));
  706|   284k|            }
_ZZNK10miniscript4NodeIjE5CloneEvENKUlRKS1_4SpanINSt3__110unique_ptrIS2_NS5_14default_deleteIS2_EEEEEE_clES3_SA_:
  534|   284k|        auto upfn = [](const Node& node, Span<NodeRef<Key>> children) {
  535|   284k|            std::vector<NodeRef<Key>> new_subs;
  536|   567k|            for (auto child = children.begin(); child != children.end(); ++child) {
  ------------------
  |  Branch (536:49): [True: 283k, False: 284k]
  ------------------
  537|   283k|                new_subs.emplace_back(std::move(*child));
  538|   283k|            }
  539|       |            // std::make_unique (and therefore MakeNodeRef) doesn't work on private constructors
  540|   284k|            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|   284k|        };
_ZN10miniscript4NodeIjEC2ENS_8internal10NoDupCheckENS_17MiniscriptContextENS_8FragmentENSt3__16vectorINS6_10unique_ptrIKS1_NS6_14default_deleteIS9_EEEENS6_9allocatorISC_EEEENS7_IjNSD_IjEEEENS7_IhNSD_IhEEEEj:
  567|   284k|        : 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()) {}

_ZN6script5ConstERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEER4SpanIKcE:
   16|  1.14M|{
   17|  1.14M|    if ((size_t)sp.size() >= str.size() && std::equal(str.begin(), str.end(), sp.begin())) {
  ------------------
  |  Branch (17:9): [True: 1.13M, False: 14.5k]
  |  Branch (17:44): [True: 166k, False: 964k]
  ------------------
   18|   166k|        sp = sp.subspan(str.size());
   19|   166k|        return true;
   20|   166k|    }
   21|   978k|    return false;
   22|  1.14M|}
_ZN6script4FuncERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEER4SpanIKcE:
   25|   167k|{
   26|   167k|    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: 158k, False: 9.50k]
  |  Branch (26:48): [True: 23.7k, False: 134k]
  |  Branch (26:73): [True: 21.2k, False: 2.51k]
  |  Branch (26:101): [True: 7.07k, False: 14.1k]
  ------------------
   27|  7.07k|        sp = sp.subspan(str.size() + 1, sp.size() - str.size() - 2);
   28|  7.07k|        return true;
   29|  7.07k|    }
   30|   160k|    return false;
   31|   167k|}
_ZN6script4ExprER4SpanIKcE:
   34|  23.8k|{
   35|  23.8k|    int level = 0;
   36|  23.8k|    auto it = sp.begin();
   37|  6.68M|    while (it != sp.end()) {
  ------------------
  |  Branch (37:12): [True: 6.66M, False: 13.9k]
  ------------------
   38|  6.66M|        if (*it == '(' || *it == '{') {
  ------------------
  |  Branch (38:13): [True: 122k, False: 6.54M]
  |  Branch (38:27): [True: 7.70k, False: 6.53M]
  ------------------
   39|   130k|            ++level;
   40|  6.53M|        } else if (level && (*it == ')' || *it == '}')) {
  ------------------
  |  Branch (40:20): [True: 5.31M, False: 1.22M]
  |  Branch (40:30): [True: 72.7k, False: 5.24M]
  |  Branch (40:44): [True: 1.75k, False: 5.24M]
  ------------------
   41|  74.4k|            --level;
   42|  6.46M|        } else if (level == 0 && (*it == ')' || *it == '}' || *it == ',')) {
  ------------------
  |  Branch (42:20): [True: 1.22M, False: 5.24M]
  |  Branch (42:35): [True: 310, False: 1.22M]
  |  Branch (42:49): [True: 234, False: 1.22M]
  |  Branch (42:63): [True: 9.29k, False: 1.21M]
  ------------------
   43|  9.83k|            break;
   44|  9.83k|        }
   45|  6.65M|        ++it;
   46|  6.65M|    }
   47|  23.8k|    Span<const char> ret = sp.first(it - sp.begin());
   48|  23.8k|    sp = sp.subspan(it - sp.begin());
   49|  23.8k|    return ret;
   50|  23.8k|}

_ZN9CScriptIDC2ERK7CScript:
   16|    637|CScriptID::CScriptID(const CScript& in) : BaseHash(Hash160(in)) {}

_ZN10CScriptNum9serializeERKl:
  350|  5.16k|    {
  351|  5.16k|        if(value == 0)
  ------------------
  |  Branch (351:12): [True: 0, False: 5.16k]
  ------------------
  352|      0|            return std::vector<unsigned char>();
  353|       |
  354|  5.16k|        std::vector<unsigned char> result;
  355|  5.16k|        const bool neg = value < 0;
  356|  5.16k|        uint64_t absvalue = neg ? ~static_cast<uint64_t>(value) + 1 : static_cast<uint64_t>(value);
  ------------------
  |  Branch (356:29): [True: 0, False: 5.16k]
  ------------------
  357|       |
  358|  20.1k|        while(absvalue)
  ------------------
  |  Branch (358:15): [True: 14.9k, False: 5.16k]
  ------------------
  359|  14.9k|        {
  360|  14.9k|            result.push_back(absvalue & 0xff);
  361|  14.9k|            absvalue >>= 8;
  362|  14.9k|        }
  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|  5.16k|        if (result.back() & 0x80)
  ------------------
  |  Branch (374:13): [True: 899, False: 4.26k]
  ------------------
  375|    899|            result.push_back(neg ? 0x80 : 0);
  ------------------
  |  Branch (375:30): [True: 0, False: 899]
  ------------------
  376|  4.26k|        else if (neg)
  ------------------
  |  Branch (376:18): [True: 0, False: 4.26k]
  ------------------
  377|      0|            result.back() |= 0x80;
  378|       |
  379|  5.16k|        return result;
  380|  5.16k|    }
_ZN7CScript14AppendDataSizeEj:
  418|  10.8k|    {
  419|  10.8k|        if (size < OP_PUSHDATA1) {
  ------------------
  |  Branch (419:13): [True: 10.8k, False: 0]
  ------------------
  420|  10.8k|            insert(end(), static_cast<value_type>(size));
  421|  10.8k|        } 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|  10.8k|    }
_ZN7CScript10AppendDataENSt3__14spanIKhLm18446744073709551615EEE:
  438|  10.8k|    {
  439|  10.8k|        insert(end(), data.begin(), data.end());
  440|  10.8k|    }
_ZN7CScript10push_int64El:
  444|  17.6k|    {
  445|  17.6k|        if (n == -1 || (n >= 1 && n <= 16))
  ------------------
  |  Branch (445:13): [True: 0, False: 17.6k]
  |  Branch (445:25): [True: 17.6k, False: 0]
  |  Branch (445:35): [True: 12.4k, False: 5.16k]
  ------------------
  446|  12.4k|        {
  447|  12.4k|            push_back(n + (OP_1 - 1));
  448|  12.4k|        }
  449|  5.16k|        else if (n == 0)
  ------------------
  |  Branch (449:18): [True: 0, False: 5.16k]
  ------------------
  450|      0|        {
  451|      0|            push_back(OP_0);
  452|      0|        }
  453|  5.16k|        else
  454|  5.16k|        {
  455|  5.16k|            *this << CScriptNum::serialize(n);
  456|  5.16k|        }
  457|  17.6k|        return *this;
  458|  17.6k|    }
_ZN7CScriptlsEl:
  477|  17.6k|    CScript& operator<<(int64_t b) LIFETIMEBOUND { return push_int64(b); }
_ZN7CScriptlsE10opcodetype:
  480|   849k|    {
  481|   849k|        if (opcode < 0 || opcode > 0xff)
  ------------------
  |  Branch (481:13): [True: 0, False: 849k]
  |  Branch (481:27): [True: 0, False: 849k]
  ------------------
  482|      0|            throw std::runtime_error("CScript::operator<<(): invalid opcode");
  483|   849k|        insert(end(), (unsigned char)opcode);
  484|   849k|        return *this;
  485|   849k|    }
_ZN7CScriptlsENSt3__14spanIKSt4byteLm18446744073709551615EEE:
  494|  10.8k|    {
  495|  10.8k|        AppendDataSize(b.size());
  496|  10.8k|        AppendData({reinterpret_cast<const value_type*>(b.data()), b.size()});
  497|  10.8k|        return *this;
  498|  10.8k|    }
_ZN7CScriptlsENSt3__14spanIKhLm18446744073709551615EEE:
  502|  10.8k|    {
  503|  10.8k|        return *this << std::as_bytes(b);
  504|  10.8k|    }
_ZN7CScriptC2Ev:
  461|   269k|    CScript() = default;
_Z12ToByteVectorI11XOnlyPubKeyENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   68|  1.08k|{
   69|  1.08k|    return std::vector<unsigned char>(in.begin(), in.end());
   70|  1.08k|}
_Z11BuildScriptIJNSt3__16vectorIhNS0_9allocatorIhEEEEEE7CScriptDpOT_:
  617|    169|{
  618|    169|    CScript ret;
  619|    169|    int cnt{0};
  620|       |
  621|    169|    ([&ret, &cnt] (Ts&& input) {
  622|    169|        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|    169|            if (cnt == 0) {
  625|    169|                ret = std::forward<Ts>(input);
  626|    169|            } else {
  627|    169|                ret.insert(ret.end(), input.begin(), input.end());
  628|    169|            }
  629|    169|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    169|            ret << input;
  632|    169|        }
  633|    169|        cnt++;
  634|    169|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|    169|    return ret;
  637|    169|}
_ZZ11BuildScriptIJNSt3__16vectorIhNS0_9allocatorIhEEEEEE7CScriptDpOT_ENKUlOS4_E_clES9_:
  621|    169|    ([&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|    169|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    169|            ret << input;
  632|    169|        }
  633|    169|        cnt++;
  634|    169|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeS0_NSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_:
  617|    138|{
  618|    138|    CScript ret;
  619|    138|    int cnt{0};
  620|       |
  621|    138|    ([&ret, &cnt] (Ts&& input) {
  622|    138|        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|    138|            if (cnt == 0) {
  625|    138|                ret = std::forward<Ts>(input);
  626|    138|            } else {
  627|    138|                ret.insert(ret.end(), input.begin(), input.end());
  628|    138|            }
  629|    138|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    138|            ret << input;
  632|    138|        }
  633|    138|        cnt++;
  634|    138|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|    138|    return ret;
  637|    138|}
_ZZ11BuildScriptIJ10opcodetypeS0_NSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E1_clESA_:
  621|    138|    ([&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|    138|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    138|            ret << input;
  632|    138|        }
  633|    138|        cnt++;
  634|    138|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_NSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E0_clESA_:
  621|    138|    ([&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|    138|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    138|            ret << input;
  632|    138|        }
  633|    138|        cnt++;
  634|    138|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_NSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS5_E_clESA_:
  621|    138|    ([&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|    138|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    138|            ret << input;
  632|    138|        }
  633|    138|        cnt++;
  634|    138|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_NSt3__16vectorIhNS1_9allocatorIhEEEES0_EE7CScriptDpOT_ENKUlOS0_E_clESA_:
  621|    138|    ([&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|    138|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    138|            ret << input;
  632|    138|        }
  633|    138|        cnt++;
  634|    138|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJRKj10opcodetypeEE7CScriptDpOT_:
  617|      5|{
  618|      5|    CScript ret;
  619|      5|    int cnt{0};
  620|       |
  621|      5|    ([&ret, &cnt] (Ts&& input) {
  622|      5|        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|      5|            if (cnt == 0) {
  625|      5|                ret = std::forward<Ts>(input);
  626|      5|            } else {
  627|      5|                ret.insert(ret.end(), input.begin(), input.end());
  628|      5|            }
  629|      5|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|      5|            ret << input;
  632|      5|        }
  633|      5|        cnt++;
  634|      5|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|      5|    return ret;
  637|      5|}
_ZZ11BuildScriptIJRKj10opcodetypeEE7CScriptDpOT_ENKUlS1_E_clES1_:
  621|      5|    ([&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|      5|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|      5|            ret << input;
  632|      5|        }
  633|      5|        cnt++;
  634|      5|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJRKj10opcodetypeEE7CScriptDpOT_ENKUlOS2_E_clES7_:
  621|      5|    ([&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|      5|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|      5|            ret << input;
  632|      5|        }
  633|      5|        cnt++;
  634|      5|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeR7CScriptS0_EES1_DpOT_:
  617|    160|{
  618|    160|    CScript ret;
  619|    160|    int cnt{0};
  620|       |
  621|    160|    ([&ret, &cnt] (Ts&& input) {
  622|    160|        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|    160|            if (cnt == 0) {
  625|    160|                ret = std::forward<Ts>(input);
  626|    160|            } else {
  627|    160|                ret.insert(ret.end(), input.begin(), input.end());
  628|    160|            }
  629|    160|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    160|            ret << input;
  632|    160|        }
  633|    160|        cnt++;
  634|    160|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|    160|    return ret;
  637|    160|}
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_EES1_DpOT_ENKUlOS0_E0_clES6_:
  621|    160|    ([&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|    160|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    160|            ret << input;
  632|    160|        }
  633|    160|        cnt++;
  634|    160|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_EES1_DpOT_ENKUlS2_E_clES2_:
  621|    160|    ([&ret, &cnt] (Ts&& input) {
  622|    160|        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|    160|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 0, False: 160]
  ------------------
  625|      0|                ret = std::forward<Ts>(input);
  626|    160|            } else {
  627|    160|                ret.insert(ret.end(), input.begin(), input.end());
  628|    160|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|    160|        cnt++;
  634|    160|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_EES1_DpOT_ENKUlOS0_E_clES6_:
  621|    160|    ([&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|    160|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    160|            ret << input;
  632|    160|        }
  633|    160|        cnt++;
  634|    160|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeR7CScriptEES1_DpOT_:
  617|     69|{
  618|     69|    CScript ret;
  619|     69|    int cnt{0};
  620|       |
  621|     69|    ([&ret, &cnt] (Ts&& input) {
  622|     69|        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|     69|            if (cnt == 0) {
  625|     69|                ret = std::forward<Ts>(input);
  626|     69|            } else {
  627|     69|                ret.insert(ret.end(), input.begin(), input.end());
  628|     69|            }
  629|     69|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     69|            ret << input;
  632|     69|        }
  633|     69|        cnt++;
  634|     69|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|     69|    return ret;
  637|     69|}
_ZZ11BuildScriptIJ10opcodetypeR7CScriptEES1_DpOT_ENKUlOS0_E_clES6_:
  621|     69|    ([&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|     69|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     69|            ret << input;
  632|     69|        }
  633|     69|        cnt++;
  634|     69|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptEES1_DpOT_ENKUlS2_E_clES2_:
  621|     69|    ([&ret, &cnt] (Ts&& input) {
  622|     69|        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|     69|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 0, False: 69]
  ------------------
  625|      0|                ret = std::forward<Ts>(input);
  626|     69|            } else {
  627|     69|                ret.insert(ret.end(), input.begin(), input.end());
  628|     69|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|     69|        cnt++;
  634|     69|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScript10opcodetypeEES0_DpOT_:
  617|  18.9k|{
  618|  18.9k|    CScript ret;
  619|  18.9k|    int cnt{0};
  620|       |
  621|  18.9k|    ([&ret, &cnt] (Ts&& input) {
  622|  18.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|  18.9k|            if (cnt == 0) {
  625|  18.9k|                ret = std::forward<Ts>(input);
  626|  18.9k|            } else {
  627|  18.9k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  18.9k|            }
  629|  18.9k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  18.9k|            ret << input;
  632|  18.9k|        }
  633|  18.9k|        cnt++;
  634|  18.9k|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|  18.9k|    return ret;
  637|  18.9k|}
_ZZ11BuildScriptIJ7CScript10opcodetypeEES0_DpOT_ENKUlOS0_E_clES5_:
  621|  18.9k|    ([&ret, &cnt] (Ts&& input) {
  622|  18.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|  18.9k|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 18.9k, False: 0]
  ------------------
  625|  18.9k|                ret = std::forward<Ts>(input);
  626|  18.9k|            } 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|  18.9k|        cnt++;
  634|  18.9k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeEES0_DpOT_ENKUlOS1_E_clES5_:
  621|  18.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|  18.9k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  18.9k|            ret << input;
  632|  18.9k|        }
  633|  18.9k|        cnt++;
  634|  18.9k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeS0_R7CScriptS0_EES1_DpOT_:
  617|     75|{
  618|     75|    CScript ret;
  619|     75|    int cnt{0};
  620|       |
  621|     75|    ([&ret, &cnt] (Ts&& input) {
  622|     75|        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|     75|            if (cnt == 0) {
  625|     75|                ret = std::forward<Ts>(input);
  626|     75|            } else {
  627|     75|                ret.insert(ret.end(), input.begin(), input.end());
  628|     75|            }
  629|     75|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     75|            ret << input;
  632|     75|        }
  633|     75|        cnt++;
  634|     75|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|     75|    return ret;
  637|     75|}
_ZZ11BuildScriptIJ10opcodetypeS0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E1_clES6_:
  621|     75|    ([&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|     75|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     75|            ret << input;
  632|     75|        }
  633|     75|        cnt++;
  634|     75|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E0_clES6_:
  621|     75|    ([&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|     75|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     75|            ret << input;
  632|     75|        }
  633|     75|        cnt++;
  634|     75|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_R7CScriptS0_EES1_DpOT_ENKUlS2_E_clES2_:
  621|     75|    ([&ret, &cnt] (Ts&& input) {
  622|     75|        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|     75|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 0, False: 75]
  ------------------
  625|      0|                ret = std::forward<Ts>(input);
  626|     75|            } else {
  627|     75|                ret.insert(ret.end(), input.begin(), input.end());
  628|     75|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|     75|        cnt++;
  634|     75|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E_clES6_:
  621|     75|    ([&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|     75|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     75|            ret << input;
  632|     75|        }
  633|     75|        cnt++;
  634|     75|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_:
  617|   187k|{
  618|   187k|    CScript ret;
  619|   187k|    int cnt{0};
  620|       |
  621|   187k|    ([&ret, &cnt] (Ts&& input) {
  622|   187k|        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|   187k|            if (cnt == 0) {
  625|   187k|                ret = std::forward<Ts>(input);
  626|   187k|            } else {
  627|   187k|                ret.insert(ret.end(), input.begin(), input.end());
  628|   187k|            }
  629|   187k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|   187k|            ret << input;
  632|   187k|        }
  633|   187k|        cnt++;
  634|   187k|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|   187k|    return ret;
  637|   187k|}
_ZZ11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E2_clES6_:
  621|   187k|    ([&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|   187k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|   187k|            ret << input;
  632|   187k|        }
  633|   187k|        cnt++;
  634|   187k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E1_clES6_:
  621|   187k|    ([&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|   187k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|   187k|            ret << input;
  632|   187k|        }
  633|   187k|        cnt++;
  634|   187k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E0_clES6_:
  621|   187k|    ([&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|   187k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|   187k|            ret << input;
  632|   187k|        }
  633|   187k|        cnt++;
  634|   187k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_ENKUlS2_E_clES2_:
  621|   187k|    ([&ret, &cnt] (Ts&& input) {
  622|   187k|        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|   187k|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 0, False: 187k]
  ------------------
  625|      0|                ret = std::forward<Ts>(input);
  626|   187k|            } else {
  627|   187k|                ret.insert(ret.end(), input.begin(), input.end());
  628|   187k|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|   187k|        cnt++;
  634|   187k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeS0_S0_R7CScriptS0_EES1_DpOT_ENKUlOS0_E_clES6_:
  621|   187k|    ([&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|   187k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|   187k|            ret << input;
  632|   187k|        }
  633|   187k|        cnt++;
  634|   187k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeEE7CScriptDpOT_:
  617|  20.1k|{
  618|  20.1k|    CScript ret;
  619|  20.1k|    int cnt{0};
  620|       |
  621|  20.1k|    ([&ret, &cnt] (Ts&& input) {
  622|  20.1k|        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.1k|            if (cnt == 0) {
  625|  20.1k|                ret = std::forward<Ts>(input);
  626|  20.1k|            } else {
  627|  20.1k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  20.1k|            }
  629|  20.1k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  20.1k|            ret << input;
  632|  20.1k|        }
  633|  20.1k|        cnt++;
  634|  20.1k|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|  20.1k|    return ret;
  637|  20.1k|}
_ZZ11BuildScriptIJ10opcodetypeEE7CScriptDpOT_ENKUlOS0_E_clES5_:
  621|  20.1k|    ([&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.1k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  20.1k|            ret << input;
  632|  20.1k|        }
  633|  20.1k|        cnt++;
  634|  20.1k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptRS0_EES0_DpOT_:
  617|  1.93k|{
  618|  1.93k|    CScript ret;
  619|  1.93k|    int cnt{0};
  620|       |
  621|  1.93k|    ([&ret, &cnt] (Ts&& input) {
  622|  1.93k|        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.93k|            if (cnt == 0) {
  625|  1.93k|                ret = std::forward<Ts>(input);
  626|  1.93k|            } else {
  627|  1.93k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  1.93k|            }
  629|  1.93k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  1.93k|            ret << input;
  632|  1.93k|        }
  633|  1.93k|        cnt++;
  634|  1.93k|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|  1.93k|    return ret;
  637|  1.93k|}
_ZZ11BuildScriptIJ7CScriptRS0_EES0_DpOT_ENKUlOS0_E_clES5_:
  621|  1.93k|    ([&ret, &cnt] (Ts&& input) {
  622|  1.93k|        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.93k|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 1.93k, False: 0]
  ------------------
  625|  1.93k|                ret = std::forward<Ts>(input);
  626|  1.93k|            } 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|  1.93k|        cnt++;
  634|  1.93k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptRS0_EES0_DpOT_ENKUlS1_E_clES1_:
  621|  1.93k|    ([&ret, &cnt] (Ts&& input) {
  622|  1.93k|        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.93k|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 0, False: 1.93k]
  ------------------
  625|      0|                ret = std::forward<Ts>(input);
  626|  1.93k|            } else {
  627|  1.93k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  1.93k|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|  1.93k|        cnt++;
  634|  1.93k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptRS0_10opcodetypeEES0_DpOT_:
  617|    229|{
  618|    229|    CScript ret;
  619|    229|    int cnt{0};
  620|       |
  621|    229|    ([&ret, &cnt] (Ts&& input) {
  622|    229|        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|    229|            if (cnt == 0) {
  625|    229|                ret = std::forward<Ts>(input);
  626|    229|            } else {
  627|    229|                ret.insert(ret.end(), input.begin(), input.end());
  628|    229|            }
  629|    229|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    229|            ret << input;
  632|    229|        }
  633|    229|        cnt++;
  634|    229|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|    229|    return ret;
  637|    229|}
_ZZ11BuildScriptIJ7CScriptRS0_10opcodetypeEES0_DpOT_ENKUlOS0_E_clES6_:
  621|    229|    ([&ret, &cnt] (Ts&& input) {
  622|    229|        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|    229|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 229, False: 0]
  ------------------
  625|    229|                ret = std::forward<Ts>(input);
  626|    229|            } 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|    229|        cnt++;
  634|    229|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptRS0_10opcodetypeEES0_DpOT_ENKUlS1_E_clES1_:
  621|    229|    ([&ret, &cnt] (Ts&& input) {
  622|    229|        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|    229|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 0, False: 229]
  ------------------
  625|      0|                ret = std::forward<Ts>(input);
  626|    229|            } else {
  627|    229|                ret.insert(ret.end(), input.begin(), input.end());
  628|    229|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|    229|        cnt++;
  634|    229|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptRS0_10opcodetypeEES0_DpOT_ENKUlOS2_E_clES6_:
  621|    229|    ([&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|    229|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    229|            ret << input;
  632|    229|        }
  633|    229|        cnt++;
  634|    229|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScript10opcodetypeS1_RS0_S1_EES0_DpOT_:
  617|      2|{
  618|      2|    CScript ret;
  619|      2|    int cnt{0};
  620|       |
  621|      2|    ([&ret, &cnt] (Ts&& input) {
  622|      2|        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|            if (cnt == 0) {
  625|      2|                ret = std::forward<Ts>(input);
  626|      2|            } else {
  627|      2|                ret.insert(ret.end(), input.begin(), input.end());
  628|      2|            }
  629|      2|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|      2|            ret << input;
  632|      2|        }
  633|      2|        cnt++;
  634|      2|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|      2|    return ret;
  637|      2|}
_ZZ11BuildScriptIJ7CScript10opcodetypeS1_RS0_S1_EES0_DpOT_ENKUlOS0_E_clES6_:
  621|      2|    ([&ret, &cnt] (Ts&& input) {
  622|      2|        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|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 2, False: 0]
  ------------------
  625|      2|                ret = std::forward<Ts>(input);
  626|      2|            } 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|        cnt++;
  634|      2|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeS1_RS0_S1_EES0_DpOT_ENKUlOS1_E1_clES6_:
  621|      2|    ([&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|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|      2|            ret << input;
  632|      2|        }
  633|      2|        cnt++;
  634|      2|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeS1_RS0_S1_EES0_DpOT_ENKUlOS1_E0_clES6_:
  621|      2|    ([&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|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|      2|            ret << input;
  632|      2|        }
  633|      2|        cnt++;
  634|      2|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeS1_RS0_S1_EES0_DpOT_ENKUlS2_E_clES2_:
  621|      2|    ([&ret, &cnt] (Ts&& input) {
  622|      2|        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|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 0, False: 2]
  ------------------
  625|      0|                ret = std::forward<Ts>(input);
  626|      2|            } else {
  627|      2|                ret.insert(ret.end(), input.begin(), input.end());
  628|      2|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|      2|        cnt++;
  634|      2|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScript10opcodetypeS1_RS0_S1_EES0_DpOT_ENKUlOS1_E_clES6_:
  621|      2|    ([&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|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|      2|            ret << input;
  632|      2|        }
  633|      2|        cnt++;
  634|      2|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_:
  617|  18.0k|{
  618|  18.0k|    CScript ret;
  619|  18.0k|    int cnt{0};
  620|       |
  621|  18.0k|    ([&ret, &cnt] (Ts&& input) {
  622|  18.0k|        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|  18.0k|            if (cnt == 0) {
  625|  18.0k|                ret = std::forward<Ts>(input);
  626|  18.0k|            } else {
  627|  18.0k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  18.0k|            }
  629|  18.0k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  18.0k|            ret << input;
  632|  18.0k|        }
  633|  18.0k|        cnt++;
  634|  18.0k|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|  18.0k|    return ret;
  637|  18.0k|}
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_ENKUlOS0_E1_clES6_:
  621|  18.0k|    ([&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|  18.0k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  18.0k|            ret << input;
  632|  18.0k|        }
  633|  18.0k|        cnt++;
  634|  18.0k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_ENKUlS2_E0_clES2_:
  621|  18.0k|    ([&ret, &cnt] (Ts&& input) {
  622|  18.0k|        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|  18.0k|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 0, False: 18.0k]
  ------------------
  625|      0|                ret = std::forward<Ts>(input);
  626|  18.0k|            } else {
  627|  18.0k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  18.0k|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|  18.0k|        cnt++;
  634|  18.0k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_ENKUlOS0_E0_clES6_:
  621|  18.0k|    ([&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|  18.0k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  18.0k|            ret << input;
  632|  18.0k|        }
  633|  18.0k|        cnt++;
  634|  18.0k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_ENKUlS2_E_clES2_:
  621|  18.0k|    ([&ret, &cnt] (Ts&& input) {
  622|  18.0k|        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|  18.0k|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 0, False: 18.0k]
  ------------------
  625|      0|                ret = std::forward<Ts>(input);
  626|  18.0k|            } else {
  627|  18.0k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  18.0k|            }
  629|       |        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|       |            ret << input;
  632|       |        }
  633|  18.0k|        cnt++;
  634|  18.0k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ10opcodetypeR7CScriptS0_S2_S0_EES1_DpOT_ENKUlOS0_E_clES6_:
  621|  18.0k|    ([&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|  18.0k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  18.0k|            ret << input;
  632|  18.0k|        }
  633|  18.0k|        cnt++;
  634|  18.0k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJRKjEE7CScriptDpOT_:
  617|    230|{
  618|    230|    CScript ret;
  619|    230|    int cnt{0};
  620|       |
  621|    230|    ([&ret, &cnt] (Ts&& input) {
  622|    230|        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|    230|            if (cnt == 0) {
  625|    230|                ret = std::forward<Ts>(input);
  626|    230|            } else {
  627|    230|                ret.insert(ret.end(), input.begin(), input.end());
  628|    230|            }
  629|    230|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    230|            ret << input;
  632|    230|        }
  633|    230|        cnt++;
  634|    230|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|    230|    return ret;
  637|    230|}
_ZZ11BuildScriptIJRKjEE7CScriptDpOT_ENKUlS1_E_clES1_:
  621|    230|    ([&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|    230|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    230|            ret << input;
  632|    230|        }
  633|    230|        cnt++;
  634|    230|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEEEES0_DpOT_:
  617|  1.44k|{
  618|  1.44k|    CScript ret;
  619|  1.44k|    int cnt{0};
  620|       |
  621|  1.44k|    ([&ret, &cnt] (Ts&& input) {
  622|  1.44k|        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.44k|            if (cnt == 0) {
  625|  1.44k|                ret = std::forward<Ts>(input);
  626|  1.44k|            } else {
  627|  1.44k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  1.44k|            }
  629|  1.44k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  1.44k|            ret << input;
  632|  1.44k|        }
  633|  1.44k|        cnt++;
  634|  1.44k|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|  1.44k|    return ret;
  637|  1.44k|}
_ZZ11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEEEES0_DpOT_ENKUlOS0_E_clES9_:
  621|  1.44k|    ([&ret, &cnt] (Ts&& input) {
  622|  1.44k|        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.44k|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 1.44k, False: 0]
  ------------------
  625|  1.44k|                ret = std::forward<Ts>(input);
  626|  1.44k|            } 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|  1.44k|        cnt++;
  634|  1.44k|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEEEES0_DpOT_ENKUlOS5_E_clES9_:
  621|  1.44k|    ([&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.44k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  1.44k|            ret << input;
  632|  1.44k|        }
  633|  1.44k|        cnt++;
  634|  1.44k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptm10opcodetypeEES0_DpOT_:
  617|    230|{
  618|    230|    CScript ret;
  619|    230|    int cnt{0};
  620|       |
  621|    230|    ([&ret, &cnt] (Ts&& input) {
  622|    230|        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|    230|            if (cnt == 0) {
  625|    230|                ret = std::forward<Ts>(input);
  626|    230|            } else {
  627|    230|                ret.insert(ret.end(), input.begin(), input.end());
  628|    230|            }
  629|    230|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    230|            ret << input;
  632|    230|        }
  633|    230|        cnt++;
  634|    230|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|    230|    return ret;
  637|    230|}
_ZZ11BuildScriptIJ7CScriptm10opcodetypeEES0_DpOT_ENKUlOS0_E_clES5_:
  621|    230|    ([&ret, &cnt] (Ts&& input) {
  622|    230|        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|    230|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 230, False: 0]
  ------------------
  625|    230|                ret = std::forward<Ts>(input);
  626|    230|            } 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|    230|        cnt++;
  634|    230|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptm10opcodetypeEES0_DpOT_ENKUlOmE_clES5_:
  621|    230|    ([&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|    230|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    230|            ret << input;
  632|    230|        }
  633|    230|        cnt++;
  634|    230|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptm10opcodetypeEES0_DpOT_ENKUlOS1_E_clES5_:
  621|    230|    ([&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|    230|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    230|            ret << input;
  632|    230|        }
  633|    230|        cnt++;
  634|    230|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJNSt3__16vectorIhNS0_9allocatorIhEEEE10opcodetypeEE7CScriptDpOT_:
  617|     46|{
  618|     46|    CScript ret;
  619|     46|    int cnt{0};
  620|       |
  621|     46|    ([&ret, &cnt] (Ts&& input) {
  622|     46|        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|     46|            if (cnt == 0) {
  625|     46|                ret = std::forward<Ts>(input);
  626|     46|            } else {
  627|     46|                ret.insert(ret.end(), input.begin(), input.end());
  628|     46|            }
  629|     46|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     46|            ret << input;
  632|     46|        }
  633|     46|        cnt++;
  634|     46|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|     46|    return ret;
  637|     46|}
_ZZ11BuildScriptIJNSt3__16vectorIhNS0_9allocatorIhEEEE10opcodetypeEE7CScriptDpOT_ENKUlOS4_E_clESA_:
  621|     46|    ([&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|     46|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     46|            ret << input;
  632|     46|        }
  633|     46|        cnt++;
  634|     46|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJNSt3__16vectorIhNS0_9allocatorIhEEEE10opcodetypeEE7CScriptDpOT_ENKUlOS5_E_clESA_:
  621|     46|    ([&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|     46|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     46|            ret << input;
  632|     46|        }
  633|     46|        cnt++;
  634|     46|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEE10opcodetypeEES0_DpOT_:
  617|    202|{
  618|    202|    CScript ret;
  619|    202|    int cnt{0};
  620|       |
  621|    202|    ([&ret, &cnt] (Ts&& input) {
  622|    202|        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|    202|            if (cnt == 0) {
  625|    202|                ret = std::forward<Ts>(input);
  626|    202|            } else {
  627|    202|                ret.insert(ret.end(), input.begin(), input.end());
  628|    202|            }
  629|    202|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    202|            ret << input;
  632|    202|        }
  633|    202|        cnt++;
  634|    202|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|    202|    return ret;
  637|    202|}
_ZZ11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEE10opcodetypeEES0_DpOT_ENKUlOS0_E_clESA_:
  621|    202|    ([&ret, &cnt] (Ts&& input) {
  622|    202|        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|    202|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 202, False: 0]
  ------------------
  625|    202|                ret = std::forward<Ts>(input);
  626|    202|            } 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|    202|        cnt++;
  634|    202|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEE10opcodetypeEES0_DpOT_ENKUlOS5_E_clESA_:
  621|    202|    ([&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|    202|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    202|            ret << input;
  632|    202|        }
  633|    202|        cnt++;
  634|    202|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptNSt3__16vectorIhNS1_9allocatorIhEEEE10opcodetypeEES0_DpOT_ENKUlOS6_E_clESA_:
  621|    202|    ([&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|    202|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|    202|            ret << input;
  632|    202|        }
  633|    202|        cnt++;
  634|    202|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJ7CScriptRKj10opcodetypeEES0_DpOT_:
  617|     98|{
  618|     98|    CScript ret;
  619|     98|    int cnt{0};
  620|       |
  621|     98|    ([&ret, &cnt] (Ts&& input) {
  622|     98|        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|     98|            if (cnt == 0) {
  625|     98|                ret = std::forward<Ts>(input);
  626|     98|            } else {
  627|     98|                ret.insert(ret.end(), input.begin(), input.end());
  628|     98|            }
  629|     98|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     98|            ret << input;
  632|     98|        }
  633|     98|        cnt++;
  634|     98|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|     98|    return ret;
  637|     98|}
_ZZ11BuildScriptIJ7CScriptRKj10opcodetypeEES0_DpOT_ENKUlOS0_E_clES7_:
  621|     98|    ([&ret, &cnt] (Ts&& input) {
  622|     98|        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|     98|            if (cnt == 0) {
  ------------------
  |  Branch (624:17): [True: 98, False: 0]
  ------------------
  625|     98|                ret = std::forward<Ts>(input);
  626|     98|            } 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|     98|        cnt++;
  634|     98|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptRKj10opcodetypeEES0_DpOT_ENKUlS2_E_clES2_:
  621|     98|    ([&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|     98|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     98|            ret << input;
  632|     98|        }
  633|     98|        cnt++;
  634|     98|    } (std::forward<Ts>(inputs)), ...);
_ZZ11BuildScriptIJ7CScriptRKj10opcodetypeEES0_DpOT_ENKUlOS3_E_clES7_:
  621|     98|    ([&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|     98|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     98|            ret << input;
  632|     98|        }
  633|     98|        cnt++;
  634|     98|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJRKlEE7CScriptDpOT_:
  617|     77|{
  618|     77|    CScript ret;
  619|     77|    int cnt{0};
  620|       |
  621|     77|    ([&ret, &cnt] (Ts&& input) {
  622|     77|        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|     77|            if (cnt == 0) {
  625|     77|                ret = std::forward<Ts>(input);
  626|     77|            } else {
  627|     77|                ret.insert(ret.end(), input.begin(), input.end());
  628|     77|            }
  629|     77|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     77|            ret << input;
  632|     77|        }
  633|     77|        cnt++;
  634|     77|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|     77|    return ret;
  637|     77|}
_ZZ11BuildScriptIJRKlEE7CScriptDpOT_ENKUlS1_E_clES1_:
  621|     77|    ([&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|     77|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|     77|            ret << input;
  632|     77|        }
  633|     77|        cnt++;
  634|     77|    } (std::forward<Ts>(inputs)), ...);
_ZN7CScriptC2ITkNSt3__114input_iteratorENS1_11__wrap_iterIPhEEEET_S5_:
  463|     20|    CScript(InputIterator first, InputIterator last) : CScriptBase{first, last} { }
_Z12ToByteVectorI7CPubKeyENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   68|  1.33k|{
   69|  1.33k|    return std::vector<unsigned char>(in.begin(), in.end());
   70|  1.33k|}
_Z12ToByteVectorI6PKHashENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   68|      8|{
   69|      8|    return std::vector<unsigned char>(in.begin(), in.end());
   70|      8|}
_Z12ToByteVectorI10ScriptHashENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   68|    268|{
   69|    268|    return std::vector<unsigned char>(in.begin(), in.end());
   70|    268|}
_Z12ToByteVectorI19WitnessV0ScriptHashENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   68|    369|{
   69|    369|    return std::vector<unsigned char>(in.begin(), in.end());
   70|    369|}
_Z12ToByteVectorI16WitnessV0KeyHashENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   68|      4|{
   69|      4|    return std::vector<unsigned char>(in.begin(), in.end());
   70|      4|}
_Z12ToByteVectorI16WitnessV1TaprootENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   68|    609|{
   69|    609|    return std::vector<unsigned char>(in.begin(), in.end());
   70|    609|}
_Z11BuildScriptIJRjEE7CScriptDpOT_:
  617|  13.8k|{
  618|  13.8k|    CScript ret;
  619|  13.8k|    int cnt{0};
  620|       |
  621|  13.8k|    ([&ret, &cnt] (Ts&& input) {
  622|  13.8k|        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|  13.8k|            if (cnt == 0) {
  625|  13.8k|                ret = std::forward<Ts>(input);
  626|  13.8k|            } else {
  627|  13.8k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  13.8k|            }
  629|  13.8k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  13.8k|            ret << input;
  632|  13.8k|        }
  633|  13.8k|        cnt++;
  634|  13.8k|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|  13.8k|    return ret;
  637|  13.8k|}
_ZZ11BuildScriptIJRjEE7CScriptDpOT_ENKUlS0_E_clES0_:
  621|  13.8k|    ([&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|  13.8k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  13.8k|            ret << input;
  632|  13.8k|        }
  633|  13.8k|        cnt++;
  634|  13.8k|    } (std::forward<Ts>(inputs)), ...);
_Z11BuildScriptIJRmEE7CScriptDpOT_:
  617|  2.72k|{
  618|  2.72k|    CScript ret;
  619|  2.72k|    int cnt{0};
  620|       |
  621|  2.72k|    ([&ret, &cnt] (Ts&& input) {
  622|  2.72k|        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.72k|            if (cnt == 0) {
  625|  2.72k|                ret = std::forward<Ts>(input);
  626|  2.72k|            } else {
  627|  2.72k|                ret.insert(ret.end(), input.begin(), input.end());
  628|  2.72k|            }
  629|  2.72k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  2.72k|            ret << input;
  632|  2.72k|        }
  633|  2.72k|        cnt++;
  634|  2.72k|    } (std::forward<Ts>(inputs)), ...);
  635|       |
  636|  2.72k|    return ret;
  637|  2.72k|}
_ZZ11BuildScriptIJRmEE7CScriptDpOT_ENKUlS0_E_clES0_:
  621|  2.72k|    ([&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.72k|        } else {
  630|       |            // Otherwise invoke CScript::operator<<.
  631|  2.72k|            ret << input;
  632|  2.72k|        }
  633|  2.72k|        cnt++;
  634|  2.72k|    } (std::forward<Ts>(inputs)), ...);

_ZN19FlatSigningProvider5MergeEOS_:
   86|  3.06k|{
   87|  3.06k|    scripts.merge(b.scripts);
   88|  3.06k|    pubkeys.merge(b.pubkeys);
   89|  3.06k|    keys.merge(b.keys);
   90|  3.06k|    origins.merge(b.origins);
   91|  3.06k|    tr_trees.merge(b.tr_trees);
   92|  3.06k|    return *this;
   93|  3.06k|}
_ZN14TaprootBuilder7CombineEONS_8NodeInfoES1_:
  291|    992|{
  292|    992|    NodeInfo ret;
  293|       |    /* Iterate over all tracked leaves in a, add b's hash to their Merkle branch, and move them to ret. */
  294|  22.2k|    for (auto& leaf : a.leaves) {
  ------------------
  |  Branch (294:21): [True: 22.2k, False: 992]
  ------------------
  295|  22.2k|        leaf.merkle_branch.push_back(b.hash);
  296|  22.2k|        ret.leaves.emplace_back(std::move(leaf));
  297|  22.2k|    }
  298|       |    /* Iterate over all tracked leaves in b, add a's hash to their Merkle branch, and move them to ret. */
  299|    992|    for (auto& leaf : b.leaves) {
  ------------------
  |  Branch (299:21): [True: 992, False: 992]
  ------------------
  300|    992|        leaf.merkle_branch.push_back(a.hash);
  301|    992|        ret.leaves.emplace_back(std::move(leaf));
  302|    992|    }
  303|    992|    ret.hash = ComputeTapbranchHash(a.hash, b.hash);
  304|    992|    return ret;
  305|    992|}
_ZN14TaprootBuilder6InsertEONS_8NodeInfoEi:
  323|  1.22k|{
  324|  1.22k|    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|  1.22k|    if ((size_t)depth + 1 < m_branch.size()) {
  ------------------
  |  Branch (328:9): [True: 0, False: 1.22k]
  ------------------
  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|  2.21k|    while (m_valid && m_branch.size() > (size_t)depth && m_branch[depth].has_value()) {
  ------------------
  |  Branch (334:12): [True: 2.21k, False: 0]
  |  Branch (334:23): [True: 1.15k, False: 1.05k]
  |  Branch (334:58): [True: 992, False: 166]
  ------------------
  335|    992|        node = Combine(std::move(node), std::move(*m_branch[depth]));
  336|    992|        m_branch.pop_back();
  337|    992|        if (depth == 0) m_valid = false; /* Can't propagate further up than the root */
  ------------------
  |  Branch (337:13): [True: 0, False: 992]
  ------------------
  338|    992|        --depth;
  339|    992|    }
  340|  1.22k|    if (m_valid) {
  ------------------
  |  Branch (340:9): [True: 1.22k, False: 0]
  ------------------
  341|       |        /* Make sure the branch is big enough to place the new node. */
  342|  1.22k|        if (m_branch.size() <= (size_t)depth) m_branch.resize((size_t)depth + 1);
  ------------------
  |  Branch (342:13): [True: 1.05k, False: 166]
  ------------------
  343|  1.22k|        assert(!m_branch[depth].has_value());
  344|  1.22k|        m_branch[depth] = std::move(node);
  345|  1.22k|    }
  346|  1.22k|}
_ZN14TaprootBuilder11ValidDepthsERKNSt3__16vectorIiNS0_9allocatorIiEEEE:
  349|    611|{
  350|    611|    std::vector<bool> branch;
  351|  1.22k|    for (int depth : depths) {
  ------------------
  |  Branch (351:20): [True: 1.22k, False: 611]
  ------------------
  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|  1.22k|        if (depth < 0 || (size_t)depth > TAPROOT_CONTROL_MAX_NODE_COUNT) return false;
  ------------------
  |  Branch (356:13): [True: 0, False: 1.22k]
  |  Branch (356:26): [True: 0, False: 1.22k]
  ------------------
  357|  1.22k|        if ((size_t)depth + 1 < branch.size()) return false;
  ------------------
  |  Branch (357:13): [True: 0, False: 1.22k]
  ------------------
  358|  2.21k|        while (branch.size() > (size_t)depth && branch[depth]) {
  ------------------
  |  Branch (358:16): [True: 1.15k, False: 1.05k]
  |  Branch (358:16): [True: 992, False: 1.22k]
  |  Branch (358:49): [True: 992, False: 166]
  ------------------
  359|    992|            branch.pop_back();
  360|    992|            if (depth == 0) return false;
  ------------------
  |  Branch (360:17): [True: 0, False: 992]
  ------------------
  361|    992|            --depth;
  362|    992|        }
  363|  1.22k|        if (branch.size() <= (size_t)depth) branch.resize((size_t)depth + 1);
  ------------------
  |  Branch (363:13): [True: 1.05k, False: 166]
  ------------------
  364|  1.22k|        assert(!branch[depth]);
  365|  1.22k|        branch[depth] = true;
  366|  1.22k|    }
  367|       |    // And this check corresponds to the IsComplete() check on m_branch.
  368|    611|    return branch.size() == 0 || (branch.size() == 1 && branch[0]);
  ------------------
  |  Branch (368:12): [True: 378, False: 233]
  |  Branch (368:35): [True: 233, False: 0]
  |  Branch (368:57): [True: 233, False: 0]
  ------------------
  369|    611|}
_ZN14TaprootBuilder3AddEi4SpanIKhEib:
  372|  1.22k|{
  373|  1.22k|    assert((leaf_version & ~TAPROOT_LEAF_MASK) == 0);
  374|  1.22k|    if (!IsValid()) return *this;
  ------------------
  |  Branch (374:9): [True: 0, False: 1.22k]
  ------------------
  375|       |    /* Construct NodeInfo object with leaf hash and (if track is true) also leaf information. */
  376|  1.22k|    NodeInfo node;
  377|  1.22k|    node.hash = ComputeTapleafHash(leaf_version, script);
  378|  1.22k|    if (track) node.leaves.emplace_back(LeafInfo{std::vector<unsigned char>(script.begin(), script.end()), leaf_version, {}});
  ------------------
  |  Branch (378:9): [True: 1.22k, False: 0]
  ------------------
  379|       |    /* Insert into the branch. */
  380|  1.22k|    Insert(std::move(node), depth);
  381|  1.22k|    return *this;
  382|  1.22k|}
_ZN14TaprootBuilder8FinalizeERK11XOnlyPubKey:
  395|    608|{
  396|       |    /* Can only call this function when IsComplete() is true. */
  397|    608|    assert(IsComplete());
  398|    608|    m_internal_key = internal_key;
  399|    608|    auto ret = m_internal_key.CreateTapTweak(m_branch.size() == 0 ? nullptr : &m_branch[0]->hash);
  ------------------
  |  Branch (399:46): [True: 377, False: 231]
  ------------------
  400|    608|    assert(ret.has_value());
  401|    608|    std::tie(m_output_key, m_parity) = *ret;
  402|    608|    return *this;
  403|    608|}
_ZN14TaprootBuilder9GetOutputEv:
  405|    608|WitnessV1Taproot TaprootBuilder::GetOutput() { return WitnessV1Taproot{m_output_key}; }

_ZNK14TaprootBuilder7IsValidEv:
  126|  1.22k|    bool IsValid() const { return m_valid; }
_ZNK14TaprootBuilder10IsCompleteEv:
  128|  1.21k|    bool IsComplete() const { return m_valid && (m_branch.size() == 0 || (m_branch.size() == 1 && m_branch[0].has_value())); }
  ------------------
  |  Branch (128:38): [True: 1.21k, False: 0]
  |  Branch (128:50): [True: 754, False: 462]
  |  Branch (128:75): [True: 462, False: 0]
  |  Branch (128:99): [True: 462, False: 0]
  ------------------
_ZN15SigningProviderD2Ev:
  155|  12.3k|    virtual ~SigningProvider() = default;

_Z21GetScriptForRawPubKeyRK7CPubKey:
  214|     34|{
  215|     34|    return CScript() << std::vector<unsigned char>(pubKey.begin(), pubKey.end()) << OP_CHECKSIG;
  216|     34|}
_Z20GetScriptForMultisigiRKNSt3__16vectorI7CPubKeyNS_9allocatorIS1_EEEE:
  219|    222|{
  220|    222|    CScript script;
  221|       |
  222|    222|    script << nRequired;
  223|    222|    for (const CPubKey& key : keys)
  ------------------
  |  Branch (223:29): [True: 1.33k, False: 222]
  ------------------
  224|  1.33k|        script << ToByteVector(key);
  225|    222|    script << keys.size() << OP_CHECKMULTISIG;
  226|       |
  227|    222|    return script;
  228|    222|}

secp256k1.c:secp256k1_eckey_pubkey_parse:
   17|  16.6k|static int secp256k1_eckey_pubkey_parse(secp256k1_ge *elem, const unsigned char *pub, size_t size) {
   18|  16.6k|    if (size == 33 && (pub[0] == SECP256K1_TAG_PUBKEY_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_ODD)) {
  ------------------
  |  |  216|  33.0k|#define SECP256K1_TAG_PUBKEY_EVEN 0x02
  ------------------
                  if (size == 33 && (pub[0] == SECP256K1_TAG_PUBKEY_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_ODD)) {
  ------------------
  |  |  217|  4.37k|#define SECP256K1_TAG_PUBKEY_ODD 0x03
  ------------------
  |  Branch (18:9): [True: 16.5k, False: 193]
  |  Branch (18:24): [True: 12.1k, False: 4.37k]
  |  Branch (18:63): [True: 4.37k, False: 0]
  ------------------
   19|  16.5k|        secp256k1_fe x;
   20|  16.5k|        return secp256k1_fe_set_b32_limit(&x, pub+1) && secp256k1_ge_set_xo_var(elem, &x, pub[0] == SECP256K1_TAG_PUBKEY_ODD);
  ------------------
  |  |   88|  16.5k|#  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|  16.5k|#define SECP256K1_TAG_PUBKEY_ODD 0x03
  ------------------
  |  Branch (20:16): [True: 16.5k, False: 1]
  |  Branch (20:57): [True: 16.4k, False: 96]
  ------------------
   21|  16.5k|    } 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|    386|#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|    193|#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: 193, False: 0]
  |  Branch (21:31): [True: 193, False: 0]
  |  Branch (21:78): [True: 0, False: 0]
  |  Branch (21:124): [True: 0, False: 0]
  ------------------
   22|    193|        secp256k1_fe x, y;
   23|    193|        if (!secp256k1_fe_set_b32_limit(&x, pub+1) || !secp256k1_fe_set_b32_limit(&y, pub+33)) {
  ------------------
  |  |   88|    193|#  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|    192|#  define secp256k1_fe_set_b32_limit secp256k1_fe_impl_set_b32_limit
  ------------------
  |  Branch (23:13): [True: 1, False: 192]
  |  Branch (23:55): [True: 1, False: 191]
  ------------------
   24|      2|            return 0;
   25|      2|        }
   26|    191|        secp256k1_ge_set_xy(elem, &x, &y);
   27|    191|        if ((pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_ODD) &&
  ------------------
  |  |  219|    382|#define SECP256K1_TAG_PUBKEY_HYBRID_EVEN 0x06
  ------------------
                      if ((pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_ODD) &&
  ------------------
  |  |  220|    191|#define SECP256K1_TAG_PUBKEY_HYBRID_ODD 0x07
  ------------------
  |  Branch (27:14): [True: 0, False: 191]
  |  Branch (27:60): [True: 0, False: 191]
  ------------------
   28|    191|            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|    191|        return secp256k1_ge_is_valid_var(elem);
   32|    191|    } else {
   33|      0|        return 0;
   34|      0|    }
   35|  16.6k|}
secp256k1.c:secp256k1_eckey_pubkey_tweak_add:
   60|    608|static int secp256k1_eckey_pubkey_tweak_add(secp256k1_ge *key, const secp256k1_scalar *tweak) {
   61|    608|    secp256k1_gej pt;
   62|    608|    secp256k1_gej_set_ge(&pt, key);
   63|    608|    secp256k1_ecmult(&pt, &pt, &secp256k1_scalar_one, tweak);
   64|       |
   65|    608|    if (secp256k1_gej_is_infinity(&pt)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 608]
  ------------------
   66|      0|        return 0;
   67|      0|    }
   68|    608|    secp256k1_ge_set_gej(key, &pt);
   69|    608|    return 1;
   70|    608|}

secp256k1.c:secp256k1_ecmult:
  349|    608|static void secp256k1_ecmult(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_scalar *na, const secp256k1_scalar *ng) {
  350|    608|    secp256k1_fe aux[ECMULT_TABLE_SIZE(WINDOW_A)];
  351|    608|    secp256k1_ge pre_a[ECMULT_TABLE_SIZE(WINDOW_A)];
  352|    608|    struct secp256k1_strauss_point_state ps[1];
  353|    608|    struct secp256k1_strauss_state state;
  354|       |
  355|    608|    state.aux = aux;
  356|    608|    state.pre_a = pre_a;
  357|    608|    state.ps = ps;
  358|    608|    secp256k1_ecmult_strauss_wnaf(&state, r, 1, a, na, ng);
  359|    608|}
secp256k1.c:secp256k1_ecmult_strauss_wnaf:
  237|    608|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|    608|    secp256k1_ge tmpa;
  239|    608|    secp256k1_fe Z;
  240|       |    /* Split G factors. */
  241|    608|    secp256k1_scalar ng_1, ng_128;
  242|    608|    int wnaf_ng_1[129];
  243|    608|    int bits_ng_1 = 0;
  244|    608|    int wnaf_ng_128[129];
  245|    608|    int bits_ng_128 = 0;
  246|    608|    int i;
  247|    608|    int bits = 0;
  248|    608|    size_t np;
  249|    608|    size_t no = 0;
  250|       |
  251|    608|    secp256k1_fe_set_int(&Z, 1);
  ------------------
  |  |   83|    608|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  252|  1.21k|    for (np = 0; np < num; ++np) {
  ------------------
  |  Branch (252:18): [True: 608, False: 608]
  ------------------
  253|    608|        secp256k1_gej tmp;
  254|    608|        secp256k1_scalar na_1, na_lam;
  255|    608|        if (secp256k1_scalar_is_zero(&na[np]) || secp256k1_gej_is_infinity(&a[np])) {
  ------------------
  |  Branch (255:13): [True: 0, False: 608]
  |  Branch (255:50): [True: 0, False: 608]
  ------------------
  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|    608|        secp256k1_scalar_split_lambda(&na_1, &na_lam, &na[np]);
  260|       |
  261|       |        /* build wnaf representation for na_1 and na_lam. */
  262|    608|        state->ps[no].bits_na_1   = secp256k1_ecmult_wnaf(state->ps[no].wnaf_na_1,   129, &na_1,   WINDOW_A);
  ------------------
  |  |   32|    608|#  define WINDOW_A 5
  ------------------
  263|    608|        state->ps[no].bits_na_lam = secp256k1_ecmult_wnaf(state->ps[no].wnaf_na_lam, 129, &na_lam, WINDOW_A);
  ------------------
  |  |   32|    608|#  define WINDOW_A 5
  ------------------
  264|    608|        VERIFY_CHECK(state->ps[no].bits_na_1 <= 129);
  265|    608|        VERIFY_CHECK(state->ps[no].bits_na_lam <= 129);
  266|    608|        if (state->ps[no].bits_na_1 > bits) {
  ------------------
  |  Branch (266:13): [True: 608, False: 0]
  ------------------
  267|    608|            bits = state->ps[no].bits_na_1;
  268|    608|        }
  269|    608|        if (state->ps[no].bits_na_lam > bits) {
  ------------------
  |  Branch (269:13): [True: 0, False: 608]
  ------------------
  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|    608|        tmp = a[np];
  284|    608|        if (no) {
  ------------------
  |  Branch (284:13): [True: 0, False: 608]
  ------------------
  285|      0|            secp256k1_gej_rescale(&tmp, &Z);
  286|      0|        }
  287|    608|        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|    608|#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|    608|#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|    608|#define ECMULT_TABLE_SIZE(w) (1L << ((w)-2))
  ------------------
  288|    608|        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: 608]
  ------------------
  289|       |
  290|    608|        ++no;
  291|    608|    }
  292|       |
  293|       |    /* Bring them to the same Z denominator. */
  294|    608|    if (no) {
  ------------------
  |  Branch (294:9): [True: 608, False: 0]
  ------------------
  295|    608|        secp256k1_ge_table_set_globalz(ECMULT_TABLE_SIZE(WINDOW_A) * no, state->pre_a, state->aux);
  ------------------
  |  |   41|    608|#define ECMULT_TABLE_SIZE(w) (1L << ((w)-2))
  ------------------
  296|    608|    }
  297|       |
  298|  1.21k|    for (np = 0; np < no; ++np) {
  ------------------
  |  Branch (298:18): [True: 608, False: 608]
  ------------------
  299|  5.47k|        for (i = 0; i < ECMULT_TABLE_SIZE(WINDOW_A); i++) {
  ------------------
  |  |   41|  5.47k|#define ECMULT_TABLE_SIZE(w) (1L << ((w)-2))
  ------------------
  |  Branch (299:21): [True: 4.86k, False: 608]
  ------------------
  300|  4.86k|            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|  4.86k|#  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|  4.86k|#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|  4.86k|#define ECMULT_TABLE_SIZE(w) (1L << ((w)-2))
  ------------------
  301|  4.86k|        }
  302|    608|    }
  303|       |
  304|    608|    if (ng) {
  ------------------
  |  Branch (304:9): [True: 608, 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|    608|        secp256k1_scalar_split_128(&ng_1, &ng_128, ng);
  307|       |
  308|       |        /* Build wnaf representation for ng_1 and ng_128 */
  309|    608|        bits_ng_1   = secp256k1_ecmult_wnaf(wnaf_ng_1,   129, &ng_1,   WINDOW_G);
  ------------------
  |  |   29|    608|#    define WINDOW_G ECMULT_WINDOW_SIZE
  ------------------
  310|    608|        bits_ng_128 = secp256k1_ecmult_wnaf(wnaf_ng_128, 129, &ng_128, WINDOW_G);
  ------------------
  |  |   29|    608|#    define WINDOW_G ECMULT_WINDOW_SIZE
  ------------------
  311|    608|        if (bits_ng_1 > bits) {
  ------------------
  |  Branch (311:13): [True: 608, False: 0]
  ------------------
  312|    608|            bits = bits_ng_1;
  313|    608|        }
  314|    608|        if (bits_ng_128 > bits) {
  ------------------
  |  Branch (314:13): [True: 286, False: 322]
  ------------------
  315|    286|            bits = bits_ng_128;
  316|    286|        }
  317|    608|    }
  318|       |
  319|    608|    secp256k1_gej_set_infinity(r);
  320|       |
  321|  76.4k|    for (i = bits - 1; i >= 0; i--) {
  ------------------
  |  Branch (321:24): [True: 75.8k, False: 608]
  ------------------
  322|  75.8k|        int n;
  323|  75.8k|        secp256k1_gej_double_var(r, r, NULL);
  324|   151k|        for (np = 0; np < no; ++np) {
  ------------------
  |  Branch (324:22): [True: 75.8k, False: 75.8k]
  ------------------
  325|  75.8k|            if (i < state->ps[np].bits_na_1 && (n = state->ps[np].wnaf_na_1[i])) {
  ------------------
  |  Branch (325:17): [True: 608, False: 75.2k]
  |  Branch (325:48): [True: 608, False: 0]
  ------------------
  326|    608|                secp256k1_ecmult_table_get_ge(&tmpa, state->pre_a + np * ECMULT_TABLE_SIZE(WINDOW_A), n, WINDOW_A);
  ------------------
  |  |   41|    608|#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|    608|#  define WINDOW_A 5
  ------------------
  327|    608|                secp256k1_gej_add_ge_var(r, r, &tmpa, NULL);
  328|    608|            }
  329|  75.8k|            if (i < state->ps[np].bits_na_lam && (n = state->ps[np].wnaf_na_lam[i])) {
  ------------------
  |  Branch (329:17): [True: 0, False: 75.8k]
  |  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|  75.8k|        }
  334|  75.8k|        if (i < bits_ng_1 && (n = wnaf_ng_1[i])) {
  ------------------
  |  Branch (334:13): [True: 73.8k, False: 1.95k]
  |  Branch (334:30): [True: 5.15k, False: 68.7k]
  ------------------
  335|  5.15k|            secp256k1_ecmult_table_get_ge_storage(&tmpa, secp256k1_pre_g, n, WINDOW_G);
  ------------------
  |  |   29|  5.15k|#    define WINDOW_G ECMULT_WINDOW_SIZE
  ------------------
  336|  5.15k|            secp256k1_gej_add_zinv_var(r, r, &tmpa, &Z);
  337|  5.15k|        }
  338|  75.8k|        if (i < bits_ng_128 && (n = wnaf_ng_128[i])) {
  ------------------
  |  Branch (338:13): [True: 73.8k, False: 2.00k]
  |  Branch (338:32): [True: 5.14k, False: 68.6k]
  ------------------
  339|  5.14k|            secp256k1_ecmult_table_get_ge_storage(&tmpa, secp256k1_pre_g_128, n, WINDOW_G);
  ------------------
  |  |   29|  5.14k|#    define WINDOW_G ECMULT_WINDOW_SIZE
  ------------------
  340|  5.14k|            secp256k1_gej_add_zinv_var(r, r, &tmpa, &Z);
  341|  5.14k|        }
  342|  75.8k|    }
  343|       |
  344|    608|    if (!r->infinity) {
  ------------------
  |  Branch (344:9): [True: 608, False: 0]
  ------------------
  345|    608|        secp256k1_fe_mul(&r->z, &r->z, &Z);
  ------------------
  |  |   93|    608|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  346|    608|    }
  347|    608|}
secp256k1.c:secp256k1_ecmult_wnaf:
  162|  2.43k|static int secp256k1_ecmult_wnaf(int *wnaf, int len, const secp256k1_scalar *a, int w) {
  163|  2.43k|    secp256k1_scalar s;
  164|  2.43k|    int last_set_bit = -1;
  165|  2.43k|    int bit = 0;
  166|  2.43k|    int sign = 1;
  167|  2.43k|    int carry = 0;
  168|       |
  169|  2.43k|    VERIFY_CHECK(wnaf != NULL);
  170|  2.43k|    VERIFY_CHECK(0 <= len && len <= 256);
  171|  2.43k|    VERIFY_CHECK(a != NULL);
  172|  2.43k|    VERIFY_CHECK(2 <= w && w <= 31);
  173|       |
  174|   316k|    for (bit = 0; bit < len; bit++) {
  ------------------
  |  Branch (174:19): [True: 313k, False: 2.43k]
  ------------------
  175|   313k|        wnaf[bit] = 0;
  176|   313k|    }
  177|       |
  178|  2.43k|    s = *a;
  179|  2.43k|    if (secp256k1_scalar_get_bits_limb32(&s, 255, 1)) {
  ------------------
  |  Branch (179:9): [True: 0, False: 2.43k]
  ------------------
  180|      0|        secp256k1_scalar_negate(&s, &s);
  181|      0|        sign = -1;
  182|      0|    }
  183|       |
  184|  2.43k|    bit = 0;
  185|   177k|    while (bit < len) {
  ------------------
  |  Branch (185:12): [True: 175k, False: 2.43k]
  ------------------
  186|   175k|        int now;
  187|   175k|        int word;
  188|   175k|        if (secp256k1_scalar_get_bits_limb32(&s, bit, 1) == (unsigned int)carry) {
  ------------------
  |  Branch (188:13): [True: 164k, False: 10.9k]
  ------------------
  189|   164k|            bit++;
  190|   164k|            continue;
  191|   164k|        }
  192|       |
  193|  10.9k|        now = w;
  194|  10.9k|        if (now > len - bit) {
  ------------------
  |  Branch (194:13): [True: 960, False: 9.95k]
  ------------------
  195|    960|            now = len - bit;
  196|    960|        }
  197|       |
  198|  10.9k|        word = secp256k1_scalar_get_bits_var(&s, bit, now) + carry;
  199|       |
  200|  10.9k|        carry = (word >> (w-1)) & 1;
  201|  10.9k|        word -= carry << w;
  202|       |
  203|  10.9k|        wnaf[bit] = sign * word;
  204|  10.9k|        last_set_bit = bit;
  205|       |
  206|  10.9k|        bit += now;
  207|  10.9k|    }
  208|       |#ifdef VERIFY
  209|       |    {
  210|       |        int verify_bit = bit;
  211|       |
  212|       |        VERIFY_CHECK(carry == 0);
  213|       |
  214|       |        while (verify_bit < 256) {
  215|       |            VERIFY_CHECK(secp256k1_scalar_get_bits_limb32(&s, verify_bit, 1) == 0);
  216|       |            verify_bit++;
  217|       |        }
  218|       |    }
  219|       |#endif
  220|  2.43k|    return last_set_bit + 1;
  221|  2.43k|}
secp256k1.c:secp256k1_ecmult_odd_multiples_table:
   73|    608|static void secp256k1_ecmult_odd_multiples_table(int n, secp256k1_ge *pre_a, secp256k1_fe *zr, secp256k1_fe *z, const secp256k1_gej *a) {
   74|    608|    secp256k1_gej d, ai;
   75|    608|    secp256k1_ge d_ge;
   76|    608|    int i;
   77|       |
   78|    608|    VERIFY_CHECK(!a->infinity);
   79|       |
   80|    608|    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|    608|    secp256k1_ge_set_xy(&d_ge, &d.x, &d.y);
   96|    608|    secp256k1_ge_set_gej_zinv(&pre_a[0], a, &d.z);
   97|    608|    secp256k1_gej_set_ge(&ai, &pre_a[0]);
   98|    608|    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|    608|    zr[0] = d.z;
  104|       |
  105|  4.86k|    for (i = 1; i < n; i++) {
  ------------------
  |  Branch (105:17): [True: 4.25k, False: 608]
  ------------------
  106|  4.25k|        secp256k1_gej_add_ge_var(&ai, &ai, &d_ge, &zr[i]);
  107|  4.25k|        secp256k1_ge_set_xy(&pre_a[i], &ai.x, &ai.y);
  108|  4.25k|    }
  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|    608|    secp256k1_fe_mul(z, &ai.z, &d.z);
  ------------------
  |  |   93|    608|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  115|    608|}
secp256k1.c:secp256k1_ecmult_table_get_ge:
  125|    608|SECP256K1_INLINE static void secp256k1_ecmult_table_get_ge(secp256k1_ge *r, const secp256k1_ge *pre, int n, int w) {
  126|    608|    secp256k1_ecmult_table_verify(n,w);
  127|    608|    if (n > 0) {
  ------------------
  |  Branch (127:9): [True: 608, False: 0]
  ------------------
  128|    608|        *r = pre[(n-1)/2];
  129|    608|    } 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|    608|}
secp256k1.c:secp256k1_ecmult_table_verify:
  117|  10.9k|SECP256K1_INLINE static void secp256k1_ecmult_table_verify(int n, int w) {
  118|  10.9k|    (void)n;
  119|  10.9k|    (void)w;
  120|  10.9k|    VERIFY_CHECK(((n) & 1) == 1);
  121|  10.9k|    VERIFY_CHECK((n) >= -((1 << ((w)-1)) - 1));
  122|  10.9k|    VERIFY_CHECK((n) <=  ((1 << ((w)-1)) - 1));
  123|  10.9k|}
secp256k1.c:secp256k1_ecmult_table_get_ge_storage:
  145|  10.3k|SECP256K1_INLINE static void secp256k1_ecmult_table_get_ge_storage(secp256k1_ge *r, const secp256k1_ge_storage *pre, int n, int w) {
  146|  10.3k|    secp256k1_ecmult_table_verify(n,w);
  147|  10.3k|    if (n > 0) {
  ------------------
  |  Branch (147:9): [True: 5.67k, False: 4.62k]
  ------------------
  148|  5.67k|        secp256k1_ge_from_storage(r, &pre[(n-1)/2]);
  149|  5.67k|    } else {
  150|  4.62k|        secp256k1_ge_from_storage(r, &pre[(-n-1)/2]);
  151|  4.62k|        secp256k1_fe_negate(&(r->y), &(r->y), 1);
  ------------------
  |  |  211|  4.62k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  4.62k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  4.62k|    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: 4.62k]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  4.62k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 4.62k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  4.62k|    } \
  |  |  |  |   84|  4.62k|    stmt; \
  |  |  |  |   85|  4.62k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  152|  4.62k|    }
  153|  10.3k|}

secp256k1.c:secp256k1_fe_impl_sqr:
  345|  4.87M|SECP256K1_INLINE static void secp256k1_fe_impl_sqr(secp256k1_fe *r, const secp256k1_fe *a) {
  346|  4.87M|    secp256k1_fe_sqr_inner(r->n, a->n);
  347|  4.87M|}
secp256k1.c:secp256k1_fe_impl_mul:
  341|   629k|SECP256K1_INLINE static void secp256k1_fe_impl_mul(secp256k1_fe *r, const secp256k1_fe *a, const secp256k1_fe * SECP256K1_RESTRICT b) {
  342|   629k|    secp256k1_fe_mul_inner(r->n, a->n, b->n);
  343|   629k|}
secp256k1.c:secp256k1_fe_impl_add_int:
  329|  17.9k|SECP256K1_INLINE static void secp256k1_fe_impl_add_int(secp256k1_fe *r, int a) {
  330|  17.9k|    r->n[0] += a;
  331|  17.9k|}
secp256k1.c:secp256k1_fe_impl_to_storage:
  428|  37.6k|static void secp256k1_fe_impl_to_storage(secp256k1_fe_storage *r, const secp256k1_fe *a) {
  429|  37.6k|    r->n[0] = a->n[0] | a->n[1] << 52;
  430|  37.6k|    r->n[1] = a->n[1] >> 12 | a->n[2] << 40;
  431|  37.6k|    r->n[2] = a->n[2] >> 24 | a->n[3] << 28;
  432|  37.6k|    r->n[3] = a->n[3] >> 36 | a->n[4] << 16;
  433|  37.6k|}
secp256k1.c:secp256k1_fe_impl_from_storage:
  435|  24.2k|static SECP256K1_INLINE void secp256k1_fe_impl_from_storage(secp256k1_fe *r, const secp256k1_fe_storage *a) {
  436|  24.2k|    r->n[0] = a->n[0] & 0xFFFFFFFFFFFFFULL;
  437|  24.2k|    r->n[1] = a->n[0] >> 52 | ((a->n[1] << 12) & 0xFFFFFFFFFFFFFULL);
  438|  24.2k|    r->n[2] = a->n[1] >> 40 | ((a->n[2] << 24) & 0xFFFFFFFFFFFFFULL);
  439|  24.2k|    r->n[3] = a->n[2] >> 28 | ((a->n[3] << 36) & 0xFFFFFFFFFFFFFULL);
  440|  24.2k|    r->n[4] = a->n[3] >> 16;
  441|  24.2k|}
secp256k1.c:secp256k1_fe_impl_is_zero:
  206|  1.82k|SECP256K1_INLINE static int secp256k1_fe_impl_is_zero(const secp256k1_fe *a) {
  207|  1.82k|    const uint64_t *t = a->n;
  208|  1.82k|    return (t[0] | t[1] | t[2] | t[3] | t[4]) == 0;
  209|  1.82k|}
secp256k1.c:secp256k1_fe_impl_add:
  333|   423k|SECP256K1_INLINE static void secp256k1_fe_impl_add(secp256k1_fe *r, const secp256k1_fe *a) {
  334|   423k|    r->n[0] += a->n[0];
  335|   423k|    r->n[1] += a->n[1];
  336|   423k|    r->n[2] += a->n[2];
  337|   423k|    r->n[3] += a->n[3];
  338|   423k|    r->n[4] += a->n[4];
  339|   423k|}
secp256k1.c:secp256k1_fe_impl_negate_unchecked:
  306|   227k|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|   227k|    VERIFY_CHECK(0xFFFFEFFFFFC2FULL * 2 * (m + 1) >= 0xFFFFFFFFFFFFFULL * 2 * m);
  309|   227k|    VERIFY_CHECK(0xFFFFFFFFFFFFFULL * 2 * (m + 1) >= 0xFFFFFFFFFFFFFULL * 2 * m);
  310|   227k|    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|   227k|    r->n[0] = 0xFFFFEFFFFFC2FULL * 2 * (m + 1) - a->n[0];
  315|   227k|    r->n[1] = 0xFFFFFFFFFFFFFULL * 2 * (m + 1) - a->n[1];
  316|   227k|    r->n[2] = 0xFFFFFFFFFFFFFULL * 2 * (m + 1) - a->n[2];
  317|   227k|    r->n[3] = 0xFFFFFFFFFFFFFULL * 2 * (m + 1) - a->n[3];
  318|   227k|    r->n[4] = 0x0FFFFFFFFFFFFULL * 2 * (m + 1) - a->n[4];
  319|   227k|}
secp256k1.c:secp256k1_fe_impl_mul_int_unchecked:
  321|  75.8k|SECP256K1_INLINE static void secp256k1_fe_impl_mul_int_unchecked(secp256k1_fe *r, int a) {
  322|  75.8k|    r->n[0] *= a;
  323|  75.8k|    r->n[1] *= a;
  324|  75.8k|    r->n[2] *= a;
  325|  75.8k|    r->n[3] *= a;
  326|  75.8k|    r->n[4] *= a;
  327|  75.8k|}
secp256k1.c:secp256k1_fe_impl_half:
  362|  75.8k|static SECP256K1_INLINE void secp256k1_fe_impl_half(secp256k1_fe *r) {
  363|  75.8k|    uint64_t t0 = r->n[0], t1 = r->n[1], t2 = r->n[2], t3 = r->n[3], t4 = r->n[4];
  364|  75.8k|    uint64_t one = (uint64_t)1;
  365|  75.8k|    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|  75.8k|    t0 += 0xFFFFEFFFFFC2FULL & mask;
  378|  75.8k|    t1 += mask;
  379|  75.8k|    t2 += mask;
  380|  75.8k|    t3 += mask;
  381|  75.8k|    t4 += mask >> 4;
  382|       |
  383|  75.8k|    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|  75.8k|    r->n[0] = (t0 >> 1) + ((t1 & one) << 51);
  393|  75.8k|    r->n[1] = (t1 >> 1) + ((t2 & one) << 51);
  394|  75.8k|    r->n[2] = (t2 >> 1) + ((t3 & one) << 51);
  395|  75.8k|    r->n[3] = (t3 >> 1) + ((t4 & one) << 51);
  396|  75.8k|    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|  75.8k|}
secp256k1.c:secp256k1_fe_impl_normalize_weak:
   80|    608|static void secp256k1_fe_impl_normalize_weak(secp256k1_fe *r) {
   81|    608|    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|    608|    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;
   85|       |
   86|       |    /* The first pass ensures the magnitude is 1, ... */
   87|    608|    t0 += x * 0x1000003D1ULL;
   88|    608|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;
   89|    608|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL;
   90|    608|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL;
   91|    608|    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|    608|    VERIFY_CHECK(t4 >> 49 == 0);
   95|       |
   96|    608|    r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;
   97|    608|}
secp256k1.c:secp256k1_fe_impl_normalizes_to_zero:
  137|  17.9k|static int secp256k1_fe_impl_normalizes_to_zero(const secp256k1_fe *r) {
  138|  17.9k|    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|  17.9k|    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|  17.9k|    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;
  145|       |
  146|       |    /* The first pass ensures the magnitude is 1, ... */
  147|  17.9k|    t0 += x * 0x1000003D1ULL;
  148|  17.9k|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL; z0  = t0; z1  = t0 ^ 0x1000003D0ULL;
  149|  17.9k|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; z0 |= t1; z1 &= t1;
  150|  17.9k|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; z0 |= t2; z1 &= t2;
  151|  17.9k|    t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL; z0 |= t3; z1 &= t3;
  152|  17.9k|                                                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|  17.9k|    VERIFY_CHECK(t4 >> 49 == 0);
  156|       |
  157|  17.9k|    return (z0 == 0) | (z1 == 0xFFFFFFFFFFFFFULL);
  158|  17.9k|}
secp256k1.c:secp256k1_fe_impl_set_int:
  201|  6.68k|SECP256K1_INLINE static void secp256k1_fe_impl_set_int(secp256k1_fe *r, int a) {
  202|  6.68k|    r->n[0] = a;
  203|  6.68k|    r->n[1] = r->n[2] = r->n[3] = r->n[4] = 0;
  204|  6.68k|}
secp256k1.c:secp256k1_fe_impl_inv:
  479|    608|static void secp256k1_fe_impl_inv(secp256k1_fe *r, const secp256k1_fe *x) {
  480|    608|    secp256k1_fe tmp = *x;
  481|    608|    secp256k1_modinv64_signed62 s;
  482|       |
  483|    608|    secp256k1_fe_normalize(&tmp);
  ------------------
  |  |   78|    608|#  define secp256k1_fe_normalize secp256k1_fe_impl_normalize
  ------------------
  484|    608|    secp256k1_fe_to_signed62(&s, &tmp);
  485|    608|    secp256k1_modinv64(&s, &secp256k1_const_modinfo_fe);
  486|    608|    secp256k1_fe_from_signed62(r, &s);
  487|    608|}
secp256k1.c:secp256k1_fe_to_signed62:
  463|    608|static void secp256k1_fe_to_signed62(secp256k1_modinv64_signed62 *r, const secp256k1_fe *a) {
  464|    608|    const uint64_t M62 = UINT64_MAX >> 2;
  465|    608|    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|    608|    r->v[0] = (a0       | a1 << 52) & M62;
  468|    608|    r->v[1] = (a1 >> 10 | a2 << 42) & M62;
  469|    608|    r->v[2] = (a2 >> 20 | a3 << 32) & M62;
  470|    608|    r->v[3] = (a3 >> 30 | a4 << 22) & M62;
  471|    608|    r->v[4] =  a4 >> 40;
  472|    608|}
secp256k1.c:secp256k1_fe_from_signed62:
  443|    608|static void secp256k1_fe_from_signed62(secp256k1_fe *r, const secp256k1_modinv64_signed62 *a) {
  444|    608|    const uint64_t M52 = UINT64_MAX >> 12;
  445|    608|    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|    608|    VERIFY_CHECK(a0 >> 62 == 0);
  451|    608|    VERIFY_CHECK(a1 >> 62 == 0);
  452|    608|    VERIFY_CHECK(a2 >> 62 == 0);
  453|    608|    VERIFY_CHECK(a3 >> 62 == 0);
  454|    608|    VERIFY_CHECK(a4 >> 8 == 0);
  455|       |
  456|    608|    r->n[0] =  a0                   & M52;
  457|    608|    r->n[1] = (a0 >> 52 | a1 << 10) & M52;
  458|    608|    r->n[2] = (a1 >> 42 | a2 << 20) & M52;
  459|    608|    r->n[3] = (a2 >> 32 | a3 << 30) & M52;
  460|    608|    r->n[4] = (a3 >> 22 | a4 << 40);
  461|    608|}
secp256k1.c:secp256k1_fe_impl_set_b32_limit:
  265|  18.1k|static int secp256k1_fe_impl_set_b32_limit(secp256k1_fe *r, const unsigned char *a) {
  266|  18.1k|    secp256k1_fe_impl_set_b32_mod(r, a);
  267|  18.1k|    return !((r->n[4] == 0x0FFFFFFFFFFFFULL) & ((r->n[3] & r->n[2] & r->n[1]) == 0xFFFFFFFFFFFFFULL) & (r->n[0] >= 0xFFFFEFFFFFC2FULL));
  268|  18.1k|}
secp256k1.c:secp256k1_fe_impl_get_b32:
  271|    608|static void secp256k1_fe_impl_get_b32(unsigned char *r, const secp256k1_fe *a) {
  272|    608|    r[0] = (a->n[4] >> 40) & 0xFF;
  273|    608|    r[1] = (a->n[4] >> 32) & 0xFF;
  274|    608|    r[2] = (a->n[4] >> 24) & 0xFF;
  275|    608|    r[3] = (a->n[4] >> 16) & 0xFF;
  276|    608|    r[4] = (a->n[4] >> 8) & 0xFF;
  277|    608|    r[5] = a->n[4] & 0xFF;
  278|    608|    r[6] = (a->n[3] >> 44) & 0xFF;
  279|    608|    r[7] = (a->n[3] >> 36) & 0xFF;
  280|    608|    r[8] = (a->n[3] >> 28) & 0xFF;
  281|    608|    r[9] = (a->n[3] >> 20) & 0xFF;
  282|    608|    r[10] = (a->n[3] >> 12) & 0xFF;
  283|    608|    r[11] = (a->n[3] >> 4) & 0xFF;
  284|    608|    r[12] = ((a->n[2] >> 48) & 0xF) | ((a->n[3] & 0xF) << 4);
  285|    608|    r[13] = (a->n[2] >> 40) & 0xFF;
  286|    608|    r[14] = (a->n[2] >> 32) & 0xFF;
  287|    608|    r[15] = (a->n[2] >> 24) & 0xFF;
  288|    608|    r[16] = (a->n[2] >> 16) & 0xFF;
  289|    608|    r[17] = (a->n[2] >> 8) & 0xFF;
  290|    608|    r[18] = a->n[2] & 0xFF;
  291|    608|    r[19] = (a->n[1] >> 44) & 0xFF;
  292|    608|    r[20] = (a->n[1] >> 36) & 0xFF;
  293|    608|    r[21] = (a->n[1] >> 28) & 0xFF;
  294|    608|    r[22] = (a->n[1] >> 20) & 0xFF;
  295|    608|    r[23] = (a->n[1] >> 12) & 0xFF;
  296|    608|    r[24] = (a->n[1] >> 4) & 0xFF;
  297|    608|    r[25] = ((a->n[0] >> 48) & 0xF) | ((a->n[1] & 0xF) << 4);
  298|    608|    r[26] = (a->n[0] >> 40) & 0xFF;
  299|    608|    r[27] = (a->n[0] >> 32) & 0xFF;
  300|    608|    r[28] = (a->n[0] >> 24) & 0xFF;
  301|    608|    r[29] = (a->n[0] >> 16) & 0xFF;
  302|    608|    r[30] = (a->n[0] >> 8) & 0xFF;
  303|    608|    r[31] = a->n[0] & 0xFF;
  304|    608|}
secp256k1.c:secp256k1_fe_impl_normalize_var:
   99|  17.7k|static void secp256k1_fe_impl_normalize_var(secp256k1_fe *r) {
  100|  17.7k|    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|  17.7k|    uint64_t m;
  104|  17.7k|    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;
  105|       |
  106|       |    /* The first pass ensures the magnitude is 1, ... */
  107|  17.7k|    t0 += x * 0x1000003D1ULL;
  108|  17.7k|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;
  109|  17.7k|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; m = t1;
  110|  17.7k|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; m &= t2;
  111|  17.7k|    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|  17.7k|    VERIFY_CHECK(t4 >> 49 == 0);
  115|       |
  116|       |    /* At most a single final reduction is needed; check if the value is >= the field characteristic */
  117|  17.7k|    x = (t4 >> 48) | ((t4 == 0x0FFFFFFFFFFFFULL) & (m == 0xFFFFFFFFFFFFFULL)
  118|  17.7k|        & (t0 >= 0xFFFFEFFFFFC2FULL));
  119|       |
  120|  17.7k|    if (x) {
  ------------------
  |  Branch (120:9): [True: 1, False: 17.7k]
  ------------------
  121|      1|        t0 += 0x1000003D1ULL;
  122|      1|        t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;
  123|      1|        t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL;
  124|      1|        t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL;
  125|      1|        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|      1|        VERIFY_CHECK(t4 >> 48 == x);
  129|       |
  130|       |        /* Mask off the possible multiple of 2^256 from the final reduction */
  131|      1|        t4 &= 0x0FFFFFFFFFFFFULL;
  132|      1|    }
  133|       |
  134|  17.7k|    r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;
  135|  17.7k|}
secp256k1.c:secp256k1_fe_impl_is_odd:
  211|  18.3k|SECP256K1_INLINE static int secp256k1_fe_impl_is_odd(const secp256k1_fe *a) {
  212|  18.3k|    return a->n[0] & 1;
  213|  18.3k|}
secp256k1.c:secp256k1_fe_impl_normalizes_to_zero_var:
  160|  14.5k|static int secp256k1_fe_impl_normalizes_to_zero_var(const secp256k1_fe *r) {
  161|  14.5k|    uint64_t t0, t1, t2, t3, t4;
  162|  14.5k|    uint64_t z0, z1;
  163|  14.5k|    uint64_t x;
  164|       |
  165|  14.5k|    t0 = r->n[0];
  166|  14.5k|    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|  14.5k|    x = t4 >> 48;
  170|       |
  171|       |    /* The first pass ensures the magnitude is 1, ... */
  172|  14.5k|    t0 += x * 0x1000003D1ULL;
  173|       |
  174|       |    /* z0 tracks a possible raw value of 0, z1 tracks a possible raw value of P */
  175|  14.5k|    z0 = t0 & 0xFFFFFFFFFFFFFULL;
  176|  14.5k|    z1 = z0 ^ 0x1000003D0ULL;
  177|       |
  178|       |    /* Fast return path should catch the majority of cases */
  179|  14.5k|    if ((z0 != 0ULL) & (z1 != 0xFFFFFFFFFFFFFULL)) {
  ------------------
  |  Branch (179:9): [True: 14.4k, False: 70]
  ------------------
  180|  14.4k|        return 0;
  181|  14.4k|    }
  182|       |
  183|     70|    t1 = r->n[1];
  184|     70|    t2 = r->n[2];
  185|     70|    t3 = r->n[3];
  186|       |
  187|     70|    t4 &= 0x0FFFFFFFFFFFFULL;
  188|       |
  189|     70|    t1 += (t0 >> 52);
  190|     70|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; z0 |= t1; z1 &= t1;
  191|     70|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; z0 |= t2; z1 &= t2;
  192|     70|    t4 += (t3 >> 52); t3 &= 0xFFFFFFFFFFFFFULL; z0 |= t3; z1 &= t3;
  193|     70|                                                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|     70|    VERIFY_CHECK(t4 >> 49 == 0);
  197|       |
  198|     70|    return (z0 == 0) | (z1 == 0xFFFFFFFFFFFFFULL);
  199|  14.5k|}
secp256k1.c:secp256k1_fe_impl_set_b32_mod:
  228|  18.1k|static void secp256k1_fe_impl_set_b32_mod(secp256k1_fe *r, const unsigned char *a) {
  229|  18.1k|    r->n[0] = (uint64_t)a[31]
  230|  18.1k|            | ((uint64_t)a[30] << 8)
  231|  18.1k|            | ((uint64_t)a[29] << 16)
  232|  18.1k|            | ((uint64_t)a[28] << 24)
  233|  18.1k|            | ((uint64_t)a[27] << 32)
  234|  18.1k|            | ((uint64_t)a[26] << 40)
  235|  18.1k|            | ((uint64_t)(a[25] & 0xF)  << 48);
  236|  18.1k|    r->n[1] = (uint64_t)((a[25] >> 4) & 0xF)
  237|  18.1k|            | ((uint64_t)a[24] << 4)
  238|  18.1k|            | ((uint64_t)a[23] << 12)
  239|  18.1k|            | ((uint64_t)a[22] << 20)
  240|  18.1k|            | ((uint64_t)a[21] << 28)
  241|  18.1k|            | ((uint64_t)a[20] << 36)
  242|  18.1k|            | ((uint64_t)a[19] << 44);
  243|  18.1k|    r->n[2] = (uint64_t)a[18]
  244|  18.1k|            | ((uint64_t)a[17] << 8)
  245|  18.1k|            | ((uint64_t)a[16] << 16)
  246|  18.1k|            | ((uint64_t)a[15] << 24)
  247|  18.1k|            | ((uint64_t)a[14] << 32)
  248|  18.1k|            | ((uint64_t)a[13] << 40)
  249|  18.1k|            | ((uint64_t)(a[12] & 0xF) << 48);
  250|  18.1k|    r->n[3] = (uint64_t)((a[12] >> 4) & 0xF)
  251|  18.1k|            | ((uint64_t)a[11] << 4)
  252|  18.1k|            | ((uint64_t)a[10] << 12)
  253|  18.1k|            | ((uint64_t)a[9]  << 20)
  254|  18.1k|            | ((uint64_t)a[8]  << 28)
  255|  18.1k|            | ((uint64_t)a[7]  << 36)
  256|  18.1k|            | ((uint64_t)a[6]  << 44);
  257|  18.1k|    r->n[4] = (uint64_t)a[5]
  258|  18.1k|            | ((uint64_t)a[4] << 8)
  259|  18.1k|            | ((uint64_t)a[3] << 16)
  260|  18.1k|            | ((uint64_t)a[2] << 24)
  261|  18.1k|            | ((uint64_t)a[1] << 32)
  262|  18.1k|            | ((uint64_t)a[0] << 40);
  263|  18.1k|}
secp256k1.c:secp256k1_fe_impl_normalize:
   43|  38.2k|static void secp256k1_fe_impl_normalize(secp256k1_fe *r) {
   44|  38.2k|    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|  38.2k|    uint64_t m;
   48|  38.2k|    uint64_t x = t4 >> 48; t4 &= 0x0FFFFFFFFFFFFULL;
   49|       |
   50|       |    /* The first pass ensures the magnitude is 1, ... */
   51|  38.2k|    t0 += x * 0x1000003D1ULL;
   52|  38.2k|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;
   53|  38.2k|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL; m = t1;
   54|  38.2k|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL; m &= t2;
   55|  38.2k|    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|  38.2k|    VERIFY_CHECK(t4 >> 49 == 0);
   59|       |
   60|       |    /* At most a single final reduction is needed; check if the value is >= the field characteristic */
   61|  38.2k|    x = (t4 >> 48) | ((t4 == 0x0FFFFFFFFFFFFULL) & (m == 0xFFFFFFFFFFFFFULL)
   62|  38.2k|        & (t0 >= 0xFFFFEFFFFFC2FULL));
   63|       |
   64|       |    /* Apply the final reduction (for constant-time behaviour, we do it always) */
   65|  38.2k|    t0 += x * 0x1000003D1ULL;
   66|  38.2k|    t1 += (t0 >> 52); t0 &= 0xFFFFFFFFFFFFFULL;
   67|  38.2k|    t2 += (t1 >> 52); t1 &= 0xFFFFFFFFFFFFFULL;
   68|  38.2k|    t3 += (t2 >> 52); t2 &= 0xFFFFFFFFFFFFFULL;
   69|  38.2k|    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|  38.2k|    VERIFY_CHECK(t4 >> 48 == x);
   73|       |
   74|       |    /* Mask off the possible multiple of 2^256 from the final reduction */
   75|  38.2k|    t4 &= 0x0FFFFFFFFFFFFULL;
   76|       |
   77|  38.2k|    r->n[0] = t0; r->n[1] = t1; r->n[2] = t2; r->n[3] = t3; r->n[4] = t4;
   78|  38.2k|}

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

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

secp256k1.c:secp256k1_ge_set_xy:
  132|  5.05k|static void secp256k1_ge_set_xy(secp256k1_ge *r, const secp256k1_fe *x, const secp256k1_fe *y) {
  133|  5.05k|    SECP256K1_FE_VERIFY(x);
  ------------------
  |  |  344|  5.05k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  134|  5.05k|    SECP256K1_FE_VERIFY(y);
  ------------------
  |  |  344|  5.05k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  135|       |
  136|  5.05k|    r->infinity = 0;
  137|  5.05k|    r->x = *x;
  138|  5.05k|    r->y = *y;
  139|       |
  140|  5.05k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  206|  5.05k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  141|  5.05k|}
secp256k1.c:secp256k1_ge_verify:
   78|  97.6k|static void secp256k1_ge_verify(const secp256k1_ge *a) {
   79|  97.6k|    SECP256K1_FE_VERIFY(&a->x);
  ------------------
  |  |  344|  97.6k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   80|  97.6k|    SECP256K1_FE_VERIFY(&a->y);
  ------------------
  |  |  344|  97.6k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   81|  97.6k|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->x, SECP256K1_GE_X_MAGNITUDE_MAX);
  ------------------
  |  |  348|  97.6k|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   82|  97.6k|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->y, SECP256K1_GE_Y_MAGNITUDE_MAX);
  ------------------
  |  |  348|  97.6k|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   83|  97.6k|    VERIFY_CHECK(a->infinity == 0 || a->infinity == 1);
   84|  97.6k|    (void)a;
   85|  97.6k|}
secp256k1.c:secp256k1_ge_is_valid_var:
  408|    191|static int secp256k1_ge_is_valid_var(const secp256k1_ge *a) {
  409|    191|    secp256k1_fe y2, x3;
  410|    191|    SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  206|    191|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  411|       |
  412|    191|    if (a->infinity) {
  ------------------
  |  Branch (412:9): [True: 0, False: 191]
  ------------------
  413|      0|        return 0;
  414|      0|    }
  415|       |    /* y^2 = x^3 + 7 */
  416|    191|    secp256k1_fe_sqr(&y2, &a->y);
  ------------------
  |  |   94|    191|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  417|    191|    secp256k1_fe_sqr(&x3, &a->x); secp256k1_fe_mul(&x3, &x3, &a->x);
  ------------------
  |  |   94|    191|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
                  secp256k1_fe_sqr(&x3, &a->x); secp256k1_fe_mul(&x3, &x3, &a->x);
  ------------------
  |  |   93|    191|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  418|    191|    secp256k1_fe_add_int(&x3, SECP256K1_B);
  ------------------
  |  |  102|    191|#  define secp256k1_fe_add_int secp256k1_fe_impl_add_int
  ------------------
                  secp256k1_fe_add_int(&x3, SECP256K1_B);
  ------------------
  |  |   73|    191|#define SECP256K1_B 7
  ------------------
  419|    191|    return secp256k1_fe_equal(&y2, &x3);
  420|    191|}
secp256k1.c:secp256k1_ge_is_in_correct_subgroup:
  886|  17.6k|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|  17.6k|    SECP256K1_GE_VERIFY(ge);
  ------------------
  |  |  206|  17.6k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  903|       |
  904|  17.6k|    (void)ge;
  905|       |    /* The real secp256k1 group has cofactor 1, so the subgroup is the entire curve. */
  906|  17.6k|    return 1;
  907|  17.6k|#endif
  908|  17.6k|}
secp256k1.c:secp256k1_ge_to_bytes:
  937|  18.8k|static void secp256k1_ge_to_bytes(unsigned char *buf, const secp256k1_ge *a) {
  938|  18.8k|    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|  18.8k|    STATIC_ASSERT(sizeof(secp256k1_ge_storage) == 64);
  ------------------
  |  |   64|  18.8k|#define STATIC_ASSERT(expr) do { \
  |  |   65|  18.8k|    switch(0) { \
  |  |  ------------------
  |  |  |  Branch (65:12): [Folded - Ignored]
  |  |  ------------------
  |  |   66|  18.8k|        case 0: \
  |  |  ------------------
  |  |  |  Branch (66:9): [True: 18.8k, False: 0]
  |  |  ------------------
  |  |   67|  18.8k|        /* If expr evaluates to 0, we have two case labels "0", which is illegal. */ \
  |  |   68|  18.8k|        case /* ERROR: static assertion failed */ (expr): \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 0, False: 18.8k]
  |  |  ------------------
  |  |   69|  18.8k|        ; \
  |  |   70|  18.8k|    } \
  |  |   71|  18.8k|} while(0)
  |  |  ------------------
  |  |  |  Branch (71:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  944|  18.8k|    VERIFY_CHECK(!secp256k1_ge_is_infinity(a));
  945|  18.8k|    secp256k1_ge_to_storage(&s, a);
  946|  18.8k|    memcpy(buf, &s, 64);
  947|  18.8k|}
secp256k1.c:secp256k1_ge_to_storage:
  839|  18.8k|static void secp256k1_ge_to_storage(secp256k1_ge_storage *r, const secp256k1_ge *a) {
  840|  18.8k|    secp256k1_fe x, y;
  841|  18.8k|    SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  206|  18.8k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  842|  18.8k|    VERIFY_CHECK(!a->infinity);
  843|       |
  844|  18.8k|    x = a->x;
  845|  18.8k|    secp256k1_fe_normalize(&x);
  ------------------
  |  |   78|  18.8k|#  define secp256k1_fe_normalize secp256k1_fe_impl_normalize
  ------------------
  846|  18.8k|    y = a->y;
  847|  18.8k|    secp256k1_fe_normalize(&y);
  ------------------
  |  |   78|  18.8k|#  define secp256k1_fe_normalize secp256k1_fe_impl_normalize
  ------------------
  848|  18.8k|    secp256k1_fe_to_storage(&r->x, &x);
  ------------------
  |  |   96|  18.8k|#  define secp256k1_fe_to_storage secp256k1_fe_impl_to_storage
  ------------------
  849|  18.8k|    secp256k1_fe_to_storage(&r->y, &y);
  ------------------
  |  |   96|  18.8k|#  define secp256k1_fe_to_storage secp256k1_fe_impl_to_storage
  ------------------
  850|  18.8k|}
secp256k1.c:secp256k1_ge_clear:
  305|  16.4k|static void secp256k1_ge_clear(secp256k1_ge *r) {
  306|  16.4k|    secp256k1_memclear(r, sizeof(secp256k1_ge));
  307|  16.4k|}
secp256k1.c:secp256k1_ge_from_bytes:
  949|  1.82k|static void secp256k1_ge_from_bytes(secp256k1_ge *r, const unsigned char *buf) {
  950|  1.82k|    secp256k1_ge_storage s;
  951|       |
  952|  1.82k|    STATIC_ASSERT(sizeof(secp256k1_ge_storage) == 64);
  ------------------
  |  |   64|  1.82k|#define STATIC_ASSERT(expr) do { \
  |  |   65|  1.82k|    switch(0) { \
  |  |  ------------------
  |  |  |  Branch (65:12): [Folded - Ignored]
  |  |  ------------------
  |  |   66|  1.82k|        case 0: \
  |  |  ------------------
  |  |  |  Branch (66:9): [True: 1.82k, False: 0]
  |  |  ------------------
  |  |   67|  1.82k|        /* If expr evaluates to 0, we have two case labels "0", which is illegal. */ \
  |  |   68|  1.82k|        case /* ERROR: static assertion failed */ (expr): \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 0, False: 1.82k]
  |  |  ------------------
  |  |   69|  1.82k|        ; \
  |  |   70|  1.82k|    } \
  |  |   71|  1.82k|} while(0)
  |  |  ------------------
  |  |  |  Branch (71:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  953|  1.82k|    memcpy(&s, buf, 64);
  954|  1.82k|    secp256k1_ge_from_storage(r, &s);
  955|  1.82k|}
secp256k1.c:secp256k1_ge_from_storage:
  852|  12.1k|static void secp256k1_ge_from_storage(secp256k1_ge *r, const secp256k1_ge_storage *a) {
  853|  12.1k|    secp256k1_fe_from_storage(&r->x, &a->x);
  ------------------
  |  |   97|  12.1k|#  define secp256k1_fe_from_storage secp256k1_fe_impl_from_storage
  ------------------
  854|  12.1k|    secp256k1_fe_from_storage(&r->y, &a->y);
  ------------------
  |  |   97|  12.1k|#  define secp256k1_fe_from_storage secp256k1_fe_impl_from_storage
  ------------------
  855|  12.1k|    r->infinity = 0;
  856|       |
  857|  12.1k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  206|  12.1k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  858|  12.1k|}
secp256k1.c:secp256k1_gej_verify:
   87|   339k|static void secp256k1_gej_verify(const secp256k1_gej *a) {
   88|   339k|    SECP256K1_FE_VERIFY(&a->x);
  ------------------
  |  |  344|   339k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   89|   339k|    SECP256K1_FE_VERIFY(&a->y);
  ------------------
  |  |  344|   339k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   90|   339k|    SECP256K1_FE_VERIFY(&a->z);
  ------------------
  |  |  344|   339k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   91|   339k|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->x, SECP256K1_GEJ_X_MAGNITUDE_MAX);
  ------------------
  |  |  348|   339k|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   92|   339k|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->y, SECP256K1_GEJ_Y_MAGNITUDE_MAX);
  ------------------
  |  |  348|   339k|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   93|   339k|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->z, SECP256K1_GEJ_Z_MAGNITUDE_MAX);
  ------------------
  |  |  348|   339k|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   94|   339k|    VERIFY_CHECK(a->infinity == 0 || a->infinity == 1);
   95|   339k|    (void)a;
   96|   339k|}
secp256k1.c:secp256k1_gej_double:
  422|  75.8k|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|  75.8k|    secp256k1_fe l, s, t;
  425|  75.8k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|  75.8k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  426|       |
  427|  75.8k|    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|  75.8k|    secp256k1_fe_mul(&r->z, &a->z, &a->y); /* Z3 = Y1*Z1 (1) */
  ------------------
  |  |   93|  75.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  439|  75.8k|    secp256k1_fe_sqr(&s, &a->y);           /* S = Y1^2 (1) */
  ------------------
  |  |   94|  75.8k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  440|  75.8k|    secp256k1_fe_sqr(&l, &a->x);           /* L = X1^2 (1) */
  ------------------
  |  |   94|  75.8k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  441|  75.8k|    secp256k1_fe_mul_int(&l, 3);           /* L = 3*X1^2 (3) */
  ------------------
  |  |  233|  75.8k|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   77|  75.8k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  75.8k|    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: 75.8k]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  75.8k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 75.8k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  75.8k|    } \
  |  |  |  |   84|  75.8k|    stmt; \
  |  |  |  |   85|  75.8k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  442|  75.8k|    secp256k1_fe_half(&l);                 /* L = 3/2*X1^2 (2) */
  ------------------
  |  |  101|  75.8k|#  define secp256k1_fe_half secp256k1_fe_impl_half
  ------------------
  443|  75.8k|    secp256k1_fe_negate(&t, &s, 1);        /* T = -S (2) */
  ------------------
  |  |  211|  75.8k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  75.8k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  75.8k|    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: 75.8k]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  75.8k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 75.8k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  75.8k|    } \
  |  |  |  |   84|  75.8k|    stmt; \
  |  |  |  |   85|  75.8k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  444|  75.8k|    secp256k1_fe_mul(&t, &t, &a->x);       /* T = -X1*S (1) */
  ------------------
  |  |   93|  75.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  445|  75.8k|    secp256k1_fe_sqr(&r->x, &l);           /* X3 = L^2 (1) */
  ------------------
  |  |   94|  75.8k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  446|  75.8k|    secp256k1_fe_add(&r->x, &t);           /* X3 = L^2 + T (2) */
  ------------------
  |  |   92|  75.8k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  447|  75.8k|    secp256k1_fe_add(&r->x, &t);           /* X3 = L^2 + 2*T (3) */
  ------------------
  |  |   92|  75.8k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  448|  75.8k|    secp256k1_fe_sqr(&s, &s);              /* S' = S^2 (1) */
  ------------------
  |  |   94|  75.8k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  449|  75.8k|    secp256k1_fe_add(&t, &r->x);           /* T' = X3 + T (4) */
  ------------------
  |  |   92|  75.8k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  450|  75.8k|    secp256k1_fe_mul(&r->y, &t, &l);       /* Y3 = L*(X3 + T) (1) */
  ------------------
  |  |   93|  75.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  451|  75.8k|    secp256k1_fe_add(&r->y, &s);           /* Y3 = L*(X3 + T) + S^2 (2) */
  ------------------
  |  |   92|  75.8k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  452|  75.8k|    secp256k1_fe_negate(&r->y, &r->y, 2);  /* Y3 = -(L*(X3 + T) + S^2) (3) */
  ------------------
  |  |  211|  75.8k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  75.8k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  75.8k|    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: 75.8k]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  75.8k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 75.8k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  75.8k|    } \
  |  |  |  |   84|  75.8k|    stmt; \
  |  |  |  |   85|  75.8k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  453|       |
  454|  75.8k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|  75.8k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  455|  75.8k|}
secp256k1.c:secp256k1_gej_set_infinity:
  284|  1.21k|static void secp256k1_gej_set_infinity(secp256k1_gej *r) {
  285|  1.21k|    r->infinity = 1;
  286|  1.21k|    secp256k1_fe_set_int(&r->x, 0);
  ------------------
  |  |   83|  1.21k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  287|  1.21k|    secp256k1_fe_set_int(&r->y, 0);
  ------------------
  |  |   83|  1.21k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  288|  1.21k|    secp256k1_fe_set_int(&r->z, 0);
  ------------------
  |  |   83|  1.21k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  289|       |
  290|  1.21k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|  1.21k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  291|  1.21k|}
secp256k1.c:secp256k1_gej_is_infinity:
  402|  1.21k|static int secp256k1_gej_is_infinity(const secp256k1_gej *a) {
  403|  1.21k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|  1.21k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  404|       |
  405|  1.21k|    return a->infinity;
  406|  1.21k|}
secp256k1.c:secp256k1_ge_set_gej:
  159|    608|static void secp256k1_ge_set_gej(secp256k1_ge *r, secp256k1_gej *a) {
  160|    608|    secp256k1_fe z2, z3;
  161|    608|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|    608|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  162|       |
  163|    608|    r->infinity = a->infinity;
  164|    608|    secp256k1_fe_inv(&a->z, &a->z);
  ------------------
  |  |   98|    608|#  define secp256k1_fe_inv secp256k1_fe_impl_inv
  ------------------
  165|    608|    secp256k1_fe_sqr(&z2, &a->z);
  ------------------
  |  |   94|    608|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  166|    608|    secp256k1_fe_mul(&z3, &a->z, &z2);
  ------------------
  |  |   93|    608|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  167|    608|    secp256k1_fe_mul(&a->x, &a->x, &z2);
  ------------------
  |  |   93|    608|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  168|    608|    secp256k1_fe_mul(&a->y, &a->y, &z3);
  ------------------
  |  |   93|    608|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  169|    608|    secp256k1_fe_set_int(&a->z, 1);
  ------------------
  |  |   83|    608|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  170|    608|    r->x = a->x;
  171|    608|    r->y = a->y;
  172|       |
  173|    608|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|    608|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  174|    608|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  206|    608|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  175|    608|}
secp256k1.c:secp256k1_ge_set_xo_var:
  309|  17.7k|static int secp256k1_ge_set_xo_var(secp256k1_ge *r, const secp256k1_fe *x, int odd) {
  310|  17.7k|    secp256k1_fe x2, x3;
  311|  17.7k|    int ret;
  312|  17.7k|    SECP256K1_FE_VERIFY(x);
  ------------------
  |  |  344|  17.7k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  313|       |
  314|  17.7k|    r->x = *x;
  315|  17.7k|    secp256k1_fe_sqr(&x2, x);
  ------------------
  |  |   94|  17.7k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  316|  17.7k|    secp256k1_fe_mul(&x3, x, &x2);
  ------------------
  |  |   93|  17.7k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  317|  17.7k|    r->infinity = 0;
  318|  17.7k|    secp256k1_fe_add_int(&x3, SECP256K1_B);
  ------------------
  |  |  102|  17.7k|#  define secp256k1_fe_add_int secp256k1_fe_impl_add_int
  ------------------
                  secp256k1_fe_add_int(&x3, SECP256K1_B);
  ------------------
  |  |   73|  17.7k|#define SECP256K1_B 7
  ------------------
  319|  17.7k|    ret = secp256k1_fe_sqrt(&r->y, &x3);
  320|  17.7k|    secp256k1_fe_normalize_var(&r->y);
  ------------------
  |  |   80|  17.7k|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
  321|  17.7k|    if (secp256k1_fe_is_odd(&r->y) != odd) {
  ------------------
  |  |   85|  17.7k|#  define secp256k1_fe_is_odd secp256k1_fe_impl_is_odd
  ------------------
  |  Branch (321:9): [True: 8.79k, False: 8.93k]
  ------------------
  322|  8.79k|        secp256k1_fe_negate(&r->y, &r->y, 1);
  ------------------
  |  |  211|  8.79k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  8.79k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  8.79k|    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: 8.79k]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  8.79k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 8.79k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  8.79k|    } \
  |  |  |  |   84|  8.79k|    stmt; \
  |  |  |  |   85|  8.79k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  323|  8.79k|    }
  324|       |
  325|  17.7k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  206|  17.7k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  326|  17.7k|    return ret;
  327|  17.7k|}
secp256k1.c:secp256k1_gej_set_ge:
  329|  1.21k|static void secp256k1_gej_set_ge(secp256k1_gej *r, const secp256k1_ge *a) {
  330|  1.21k|   SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  206|  1.21k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  331|       |
  332|  1.21k|   r->infinity = a->infinity;
  333|  1.21k|   r->x = a->x;
  334|  1.21k|   r->y = a->y;
  335|  1.21k|   secp256k1_fe_set_int(&r->z, 1);
  ------------------
  |  |   83|  1.21k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  336|       |
  337|  1.21k|   SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|  1.21k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  338|  1.21k|}
secp256k1.c:secp256k1_ge_set_gej_zinv:
   99|    608|static void secp256k1_ge_set_gej_zinv(secp256k1_ge *r, const secp256k1_gej *a, const secp256k1_fe *zi) {
  100|    608|    secp256k1_fe zi2;
  101|    608|    secp256k1_fe zi3;
  102|    608|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|    608|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  103|    608|    SECP256K1_FE_VERIFY(zi);
  ------------------
  |  |  344|    608|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  104|    608|    VERIFY_CHECK(!a->infinity);
  105|       |
  106|    608|    secp256k1_fe_sqr(&zi2, zi);
  ------------------
  |  |   94|    608|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  107|    608|    secp256k1_fe_mul(&zi3, &zi2, zi);
  ------------------
  |  |   93|    608|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  108|    608|    secp256k1_fe_mul(&r->x, &a->x, &zi2);
  ------------------
  |  |   93|    608|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  109|    608|    secp256k1_fe_mul(&r->y, &a->y, &zi3);
  ------------------
  |  |   93|    608|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  110|    608|    r->infinity = a->infinity;
  111|       |
  112|    608|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  206|    608|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  113|    608|}
secp256k1.c:secp256k1_ge_table_set_globalz:
  251|    608|static void secp256k1_ge_table_set_globalz(size_t len, secp256k1_ge *a, const secp256k1_fe *zr) {
  252|    608|    size_t i;
  253|    608|    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|    608|    if (len > 0) {
  ------------------
  |  Branch (261:9): [True: 608, False: 0]
  ------------------
  262|    608|        i = len - 1;
  263|       |        /* Ensure all y values are in weak normal form for fast negation of points */
  264|    608|        secp256k1_fe_normalize_weak(&a[i].y);
  ------------------
  |  |   79|    608|#  define secp256k1_fe_normalize_weak secp256k1_fe_impl_normalize_weak
  ------------------
  265|    608|        zs = zr[i];
  266|       |
  267|       |        /* Work our way backwards, using the z-ratios to scale the x/y values. */
  268|  4.86k|        while (i > 0) {
  ------------------
  |  Branch (268:16): [True: 4.25k, False: 608]
  ------------------
  269|  4.25k|            if (i != len - 1) {
  ------------------
  |  Branch (269:17): [True: 3.64k, False: 608]
  ------------------
  270|  3.64k|                secp256k1_fe_mul(&zs, &zs, &zr[i]);
  ------------------
  |  |   93|  3.64k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  271|  3.64k|            }
  272|  4.25k|            i--;
  273|  4.25k|            secp256k1_ge_set_ge_zinv(&a[i], &a[i], &zs);
  274|  4.25k|        }
  275|    608|    }
  276|       |
  277|       |#ifdef VERIFY
  278|       |    for (i = 0; i < len; i++) {
  279|       |        SECP256K1_GE_VERIFY(&a[i]);
  280|       |    }
  281|       |#endif
  282|    608|}
secp256k1.c:secp256k1_ge_set_ge_zinv:
  116|  4.25k|static void secp256k1_ge_set_ge_zinv(secp256k1_ge *r, const secp256k1_ge *a, const secp256k1_fe *zi) {
  117|  4.25k|    secp256k1_fe zi2;
  118|  4.25k|    secp256k1_fe zi3;
  119|  4.25k|    SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  206|  4.25k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  120|  4.25k|    SECP256K1_FE_VERIFY(zi);
  ------------------
  |  |  344|  4.25k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  121|  4.25k|    VERIFY_CHECK(!a->infinity);
  122|       |
  123|  4.25k|    secp256k1_fe_sqr(&zi2, zi);
  ------------------
  |  |   94|  4.25k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  124|  4.25k|    secp256k1_fe_mul(&zi3, &zi2, zi);
  ------------------
  |  |   93|  4.25k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  125|  4.25k|    secp256k1_fe_mul(&r->x, &a->x, &zi2);
  ------------------
  |  |   93|  4.25k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  126|  4.25k|    secp256k1_fe_mul(&r->y, &a->y, &zi3);
  ------------------
  |  |   93|  4.25k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  127|  4.25k|    r->infinity = a->infinity;
  128|       |
  129|  4.25k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  206|  4.25k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  130|  4.25k|}
secp256k1.c:secp256k1_gej_double_var:
  457|  76.4k|static void secp256k1_gej_double_var(secp256k1_gej *r, const secp256k1_gej *a, secp256k1_fe *rzr) {
  458|  76.4k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|  76.4k|#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|  76.4k|    if (a->infinity) {
  ------------------
  |  Branch (470:9): [True: 608, False: 75.8k]
  ------------------
  471|    608|        secp256k1_gej_set_infinity(r);
  472|    608|        if (rzr != NULL) {
  ------------------
  |  Branch (472:13): [True: 0, False: 608]
  ------------------
  473|      0|            secp256k1_fe_set_int(rzr, 1);
  ------------------
  |  |   83|      0|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  474|      0|        }
  475|    608|        return;
  476|    608|    }
  477|       |
  478|  75.8k|    if (rzr != NULL) {
  ------------------
  |  Branch (478:9): [True: 0, False: 75.8k]
  ------------------
  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|  75.8k|    secp256k1_gej_double(r, a);
  484|       |
  485|  75.8k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|  75.8k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  486|  75.8k|}
secp256k1.c:secp256k1_gej_add_ge_var:
  552|  4.86k|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|  4.86k|    secp256k1_fe z12, u1, u2, s1, s2, h, i, h2, h3, t;
  555|  4.86k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|  4.86k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  556|  4.86k|    SECP256K1_GE_VERIFY(b);
  ------------------
  |  |  206|  4.86k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  557|       |
  558|  4.86k|    if (a->infinity) {
  ------------------
  |  Branch (558:9): [True: 0, False: 4.86k]
  ------------------
  559|      0|        VERIFY_CHECK(rzr == NULL);
  560|      0|        secp256k1_gej_set_ge(r, b);
  561|      0|        return;
  562|      0|    }
  563|  4.86k|    if (b->infinity) {
  ------------------
  |  Branch (563:9): [True: 0, False: 4.86k]
  ------------------
  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|  4.86k|    secp256k1_fe_sqr(&z12, &a->z);
  ------------------
  |  |   94|  4.86k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  572|  4.86k|    u1 = a->x;
  573|  4.86k|    secp256k1_fe_mul(&u2, &b->x, &z12);
  ------------------
  |  |   93|  4.86k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  574|  4.86k|    s1 = a->y;
  575|  4.86k|    secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &a->z);
  ------------------
  |  |   93|  4.86k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
                  secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &a->z);
  ------------------
  |  |   93|  4.86k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  576|  4.86k|    secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |  211|  4.86k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  4.86k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  4.86k|    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: 4.86k]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  4.86k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 4.86k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  4.86k|    } \
  |  |  |  |   84|  4.86k|    stmt; \
  |  |  |  |   85|  4.86k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |   92|  4.86k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  577|  4.86k|    secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |  211|  4.86k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  4.86k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  4.86k|    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: 4.86k]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  4.86k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 4.86k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  4.86k|    } \
  |  |  |  |   84|  4.86k|    stmt; \
  |  |  |  |   85|  4.86k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |   92|  4.86k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  578|  4.86k|    if (secp256k1_fe_normalizes_to_zero_var(&h)) {
  ------------------
  |  |   82|  4.86k|#  define secp256k1_fe_normalizes_to_zero_var secp256k1_fe_impl_normalizes_to_zero_var
  ------------------
  |  Branch (578:9): [True: 0, False: 4.86k]
  ------------------
  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|  4.86k|    r->infinity = 0;
  591|  4.86k|    if (rzr != NULL) {
  ------------------
  |  Branch (591:9): [True: 4.25k, False: 608]
  ------------------
  592|  4.25k|        *rzr = h;
  593|  4.25k|    }
  594|  4.86k|    secp256k1_fe_mul(&r->z, &a->z, &h);
  ------------------
  |  |   93|  4.86k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  595|       |
  596|  4.86k|    secp256k1_fe_sqr(&h2, &h);
  ------------------
  |  |   94|  4.86k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  597|  4.86k|    secp256k1_fe_negate(&h2, &h2, 1);
  ------------------
  |  |  211|  4.86k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  4.86k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  4.86k|    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: 4.86k]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  4.86k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 4.86k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  4.86k|    } \
  |  |  |  |   84|  4.86k|    stmt; \
  |  |  |  |   85|  4.86k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  598|  4.86k|    secp256k1_fe_mul(&h3, &h2, &h);
  ------------------
  |  |   93|  4.86k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  599|  4.86k|    secp256k1_fe_mul(&t, &u1, &h2);
  ------------------
  |  |   93|  4.86k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  600|       |
  601|  4.86k|    secp256k1_fe_sqr(&r->x, &i);
  ------------------
  |  |   94|  4.86k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  602|  4.86k|    secp256k1_fe_add(&r->x, &h3);
  ------------------
  |  |   92|  4.86k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  603|  4.86k|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|  4.86k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  604|  4.86k|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|  4.86k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  605|       |
  606|  4.86k|    secp256k1_fe_add(&t, &r->x);
  ------------------
  |  |   92|  4.86k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  607|  4.86k|    secp256k1_fe_mul(&r->y, &t, &i);
  ------------------
  |  |   93|  4.86k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  608|  4.86k|    secp256k1_fe_mul(&h3, &h3, &s1);
  ------------------
  |  |   93|  4.86k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  609|  4.86k|    secp256k1_fe_add(&r->y, &h3);
  ------------------
  |  |   92|  4.86k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  610|       |
  611|  4.86k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|  4.86k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  612|  4.86k|    if (rzr != NULL) SECP256K1_FE_VERIFY(rzr);
  ------------------
  |  |  344|  4.25k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  |  Branch (612:9): [True: 4.25k, False: 608]
  ------------------
  613|  4.86k|}
secp256k1.c:secp256k1_gej_add_zinv_var:
  615|  10.3k|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|  10.3k|    secp256k1_fe az, z12, u1, u2, s1, s2, h, i, h2, h3, t;
  618|  10.3k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|  10.3k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  619|  10.3k|    SECP256K1_GE_VERIFY(b);
  ------------------
  |  |  206|  10.3k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  620|  10.3k|    SECP256K1_FE_VERIFY(bzinv);
  ------------------
  |  |  344|  10.3k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  621|       |
  622|  10.3k|    if (a->infinity) {
  ------------------
  |  Branch (622:9): [True: 608, False: 9.69k]
  ------------------
  623|    608|        secp256k1_fe bzinv2, bzinv3;
  624|    608|        r->infinity = b->infinity;
  625|    608|        secp256k1_fe_sqr(&bzinv2, bzinv);
  ------------------
  |  |   94|    608|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  626|    608|        secp256k1_fe_mul(&bzinv3, &bzinv2, bzinv);
  ------------------
  |  |   93|    608|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  627|    608|        secp256k1_fe_mul(&r->x, &b->x, &bzinv2);
  ------------------
  |  |   93|    608|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  628|    608|        secp256k1_fe_mul(&r->y, &b->y, &bzinv3);
  ------------------
  |  |   93|    608|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  629|    608|        secp256k1_fe_set_int(&r->z, 1);
  ------------------
  |  |   83|    608|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  630|    608|        SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|    608|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  631|    608|        return;
  632|    608|    }
  633|  9.69k|    if (b->infinity) {
  ------------------
  |  Branch (633:9): [True: 0, False: 9.69k]
  ------------------
  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|  9.69k|    secp256k1_fe_mul(&az, &a->z, bzinv);
  ------------------
  |  |   93|  9.69k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  647|       |
  648|  9.69k|    secp256k1_fe_sqr(&z12, &az);
  ------------------
  |  |   94|  9.69k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  649|  9.69k|    u1 = a->x;
  650|  9.69k|    secp256k1_fe_mul(&u2, &b->x, &z12);
  ------------------
  |  |   93|  9.69k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  651|  9.69k|    s1 = a->y;
  652|  9.69k|    secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &az);
  ------------------
  |  |   93|  9.69k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
                  secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &az);
  ------------------
  |  |   93|  9.69k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  653|  9.69k|    secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |  211|  9.69k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  9.69k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  9.69k|    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: 9.69k]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  9.69k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 9.69k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  9.69k|    } \
  |  |  |  |   84|  9.69k|    stmt; \
  |  |  |  |   85|  9.69k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |   92|  9.69k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  654|  9.69k|    secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |  211|  9.69k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  9.69k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  9.69k|    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: 9.69k]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  9.69k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 9.69k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  9.69k|    } \
  |  |  |  |   84|  9.69k|    stmt; \
  |  |  |  |   85|  9.69k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |   92|  9.69k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  655|  9.69k|    if (secp256k1_fe_normalizes_to_zero_var(&h)) {
  ------------------
  |  |   82|  9.69k|#  define secp256k1_fe_normalizes_to_zero_var secp256k1_fe_impl_normalizes_to_zero_var
  ------------------
  |  Branch (655:9): [True: 0, False: 9.69k]
  ------------------
  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|  9.69k|    r->infinity = 0;
  665|  9.69k|    secp256k1_fe_mul(&r->z, &a->z, &h);
  ------------------
  |  |   93|  9.69k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  666|       |
  667|  9.69k|    secp256k1_fe_sqr(&h2, &h);
  ------------------
  |  |   94|  9.69k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  668|  9.69k|    secp256k1_fe_negate(&h2, &h2, 1);
  ------------------
  |  |  211|  9.69k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  9.69k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  9.69k|    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: 9.69k]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  9.69k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 9.69k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  9.69k|    } \
  |  |  |  |   84|  9.69k|    stmt; \
  |  |  |  |   85|  9.69k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  669|  9.69k|    secp256k1_fe_mul(&h3, &h2, &h);
  ------------------
  |  |   93|  9.69k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  670|  9.69k|    secp256k1_fe_mul(&t, &u1, &h2);
  ------------------
  |  |   93|  9.69k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  671|       |
  672|  9.69k|    secp256k1_fe_sqr(&r->x, &i);
  ------------------
  |  |   94|  9.69k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  673|  9.69k|    secp256k1_fe_add(&r->x, &h3);
  ------------------
  |  |   92|  9.69k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  674|  9.69k|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|  9.69k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  675|  9.69k|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|  9.69k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  676|       |
  677|  9.69k|    secp256k1_fe_add(&t, &r->x);
  ------------------
  |  |   92|  9.69k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  678|  9.69k|    secp256k1_fe_mul(&r->y, &t, &i);
  ------------------
  |  |   93|  9.69k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  679|  9.69k|    secp256k1_fe_mul(&h3, &h3, &s1);
  ------------------
  |  |   93|  9.69k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  680|  9.69k|    secp256k1_fe_add(&r->y, &h3);
  ------------------
  |  |   92|  9.69k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  681|       |
  682|  9.69k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|  9.69k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  683|  9.69k|}

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

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

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

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

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

secp256k1_ec_pubkey_parse:
  250|  16.6k|int secp256k1_ec_pubkey_parse(const secp256k1_context* ctx, secp256k1_pubkey* pubkey, const unsigned char *input, size_t inputlen) {
  251|  16.6k|    secp256k1_ge Q;
  252|       |
  253|  16.6k|    VERIFY_CHECK(ctx != NULL);
  254|  16.6k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  16.6k|#define ARG_CHECK(cond) do { \
  |  |   46|  16.6k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  16.6k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 16.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  16.6k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  255|  16.6k|    memset(pubkey, 0, sizeof(*pubkey));
  256|  16.6k|    ARG_CHECK(input != NULL);
  ------------------
  |  |   45|  16.6k|#define ARG_CHECK(cond) do { \
  |  |   46|  16.6k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  16.6k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 16.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  16.6k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  257|  16.6k|    if (!secp256k1_eckey_pubkey_parse(&Q, input, inputlen)) {
  ------------------
  |  Branch (257:9): [True: 290, False: 16.4k]
  ------------------
  258|    290|        return 0;
  259|    290|    }
  260|  16.4k|    if (!secp256k1_ge_is_in_correct_subgroup(&Q)) {
  ------------------
  |  Branch (260:9): [True: 0, False: 16.4k]
  ------------------
  261|      0|        return 0;
  262|      0|    }
  263|  16.4k|    secp256k1_pubkey_save(pubkey, &Q);
  264|  16.4k|    secp256k1_ge_clear(&Q);
  265|  16.4k|    return 1;
  266|  16.4k|}
secp256k1.c:secp256k1_pubkey_save:
  246|  18.8k|static void secp256k1_pubkey_save(secp256k1_pubkey* pubkey, secp256k1_ge* ge) {
  247|  18.8k|    secp256k1_ge_to_bytes(pubkey->data, ge);
  248|  18.8k|}
secp256k1.c:secp256k1_pubkey_load:
  240|  1.82k|static int secp256k1_pubkey_load(const secp256k1_context* ctx, secp256k1_ge* ge, const secp256k1_pubkey* pubkey) {
  241|  1.82k|    secp256k1_ge_from_bytes(ge, pubkey->data);
  242|  1.82k|    ARG_CHECK(!secp256k1_fe_is_zero(&ge->x));
  ------------------
  |  |   45|  1.82k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.82k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  1.82k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.82k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.82k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  243|  1.82k|    return 1;
  244|  1.82k|}
secp256k1.c:secp256k1_ec_pubkey_tweak_add_helper:
  688|    608|static int secp256k1_ec_pubkey_tweak_add_helper(secp256k1_ge *p, const unsigned char *tweak32) {
  689|    608|    secp256k1_scalar term;
  690|    608|    int overflow = 0;
  691|    608|    secp256k1_scalar_set_b32(&term, tweak32, &overflow);
  692|    608|    return !overflow && secp256k1_eckey_pubkey_tweak_add(p, &term);
  ------------------
  |  Branch (692:12): [True: 608, False: 0]
  |  Branch (692:25): [True: 608, False: 0]
  ------------------
  693|    608|}

secp256k1.c:secp256k1_read_be64:
  416|  2.43k|SECP256K1_INLINE static uint64_t secp256k1_read_be64(const unsigned char* p) {
  417|  2.43k|    return (uint64_t)p[0] << 56 |
  418|  2.43k|           (uint64_t)p[1] << 48 |
  419|  2.43k|           (uint64_t)p[2] << 40 |
  420|  2.43k|           (uint64_t)p[3] << 32 |
  421|  2.43k|           (uint64_t)p[4] << 24 |
  422|  2.43k|           (uint64_t)p[5] << 16 |
  423|  2.43k|           (uint64_t)p[6] << 8  |
  424|  2.43k|           (uint64_t)p[7];
  425|  2.43k|}
secp256k1.c:secp256k1_memclear:
  223|  16.4k|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|  16.4k|    memset(ptr, 0, len);
  240|  16.4k|    __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|  16.4k|}

_Z20GetSizeOfCompactSizem:
  298|  53.0k|{
  299|  53.0k|    if (nSize < 253)             return sizeof(unsigned char);
  ------------------
  |  Branch (299:9): [True: 0, False: 53.0k]
  ------------------
  300|  53.0k|    else if (nSize <= std::numeric_limits<uint16_t>::max()) return sizeof(unsigned char) + sizeof(uint16_t);
  ------------------
  |  Branch (300:14): [True: 0, False: 53.0k]
  ------------------
  301|  53.0k|    else if (nSize <= std::numeric_limits<unsigned int>::max())  return sizeof(unsigned char) + sizeof(unsigned int);
  ------------------
  |  Branch (301:14): [True: 53.0k, False: 0]
  ------------------
  302|      0|    else                         return sizeof(unsigned char) + sizeof(uint64_t);
  303|  53.0k|}
_ZN17CompactSizeWriterC2Em:
  615|  1.22k|    explicit CompactSizeWriter(uint64_t n_in) : n(n_in) { }
_Z16WriteCompactSizeI10HashWriterEvRT_m:
  309|  1.22k|{
  310|  1.22k|    if (nSize < 253)
  ------------------
  |  Branch (310:9): [True: 1.09k, False: 133]
  ------------------
  311|  1.09k|    {
  312|  1.09k|        ser_writedata8(os, nSize);
  313|  1.09k|    }
  314|    133|    else if (nSize <= std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (314:14): [True: 133, False: 0]
  ------------------
  315|    133|    {
  316|    133|        ser_writedata8(os, 253);
  317|    133|        ser_writedata16(os, nSize);
  318|    133|    }
  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|  1.22k|    return;
  330|  1.22k|}
_Z14ser_writedata8I10HashWriterEvRT_h:
   55|  2.44k|{
   56|  2.44k|    s.write(AsBytes(Span{&obj, 1}));
   57|  2.44k|}
_Z15ser_writedata16I10HashWriterEvRT_t:
   59|    133|{
   60|    133|    obj = htole16_internal(obj);
   61|    133|    s.write(AsBytes(Span{&obj, 1}));
   62|    133|}
_Z9SerializeI10HashWriter7uint256Q12SerializableIT0_T_EEvRS3_RKS2_:
  753|    839|{
  754|    839|    a.Serialize(os);
  755|    839|}
_Z9SerializeI10HashWriterTk9BasicByteKhEvRT_4SpanIT0_E:
  268|  4.04k|template <typename Stream, BasicByte B> void Serialize(Stream& s, Span<B> span) { s.write(AsBytes(span)); }
_Z9SerializeI10HashWriterEvRT_h:
  258|  1.22k|template<typename Stream> inline void Serialize(Stream& s, uint8_t a ) { ser_writedata8(s, a); }
_Z9SerializeI10HashWriter17CompactSizeWriterQ12SerializableIT0_T_EEvRS3_RKS2_:
  753|  1.22k|{
  754|  1.22k|    a.Serialize(os);
  755|  1.22k|}
_ZNK17CompactSizeWriter9SerializeI10HashWriterEEvRT_:
  618|  1.22k|    void Serialize(Stream &s) const {
  619|  1.22k|        WriteCompactSize<Stream>(s, n);
  620|  1.22k|    }

_Z9UCharCastPh:
  281|    111|inline unsigned char* UCharCast(unsigned char* c) { return c; }
_Z9UCharCastPKh:
  285|  59.5k|inline const unsigned char* UCharCast(const unsigned char* c) { return c; }
_Z9UCharCastPKSt4byte:
  287|  6.62k|inline const unsigned char* UCharCast(const std::byte* c) { return reinterpret_cast<const unsigned char*>(c); }
_ZNK4SpanIKSt4byteE4sizeEv:
  187|  6.62k|    constexpr std::size_t size() const noexcept { return m_size; }
_ZNK4SpanIKcE4dataEv:
  174|  15.4k|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIKcE4sizeEv:
  187|  4.16M|    constexpr std::size_t size() const noexcept { return m_size; }
_ZNK4SpanIKSt4byteE4dataEv:
  174|  6.62k|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIKcE5beginEv:
  175|  1.35M|    constexpr C* begin() const noexcept { return m_data; }
_ZNK4SpanIKcE3endEv:
  176|  13.8M|    constexpr C* end() const noexcept { return m_data + m_size; }
_ZNK4SpanIKhE4sizeEv:
  187|   127k|    constexpr std::size_t size() const noexcept { return m_size; }
_ZNK4SpanIKhE5beginEv:
  175|  24.7k|    constexpr C* begin() const noexcept { return m_data; }
_ZNK4SpanIKhE3endEv:
  176|  24.7k|    constexpr C* end() const noexcept { return m_data + m_size; }
_ZNK4SpanIhE4sizeEv:
  187|  59.8k|    constexpr std::size_t size() const noexcept { return m_size; }
_ZNK4SpanIhE4dataEv:
  174|  62.2k|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIKhE4dataEv:
  174|   125k|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIKhE5firstEm:
  206|  58.1k|    {
  207|  58.1k|        ASSERT_IF_DEBUG(size() >= count);
  208|  58.1k|        return Span<C>(m_data, count);
  209|  58.1k|    }
_ZNK4SpanIKhE7subspanEmm:
  201|  2.61k|    {
  202|  2.61k|        ASSERT_IF_DEBUG(size() >= offset + count);
  203|  2.61k|        return Span<C>(m_data + offset, count);
  204|  2.61k|    }
_Z13UCharSpanCastIKhE4SpanINSt3__114remove_pointerIDTcl9UCharCastcldtfp_4dataEEEE4typeEES1_IT_E:
  293|  59.5k|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|  58.1k|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|  4.04k|    constexpr std::size_t size_bytes() const noexcept { return sizeof(C) * m_size; }
_Z7AsBytesIKhE4SpanIKSt4byteES1_IT_E:
  259|  4.04k|{
  260|  4.04k|    return {reinterpret_cast<const std::byte*>(s.data()), s.size_bytes()};
  261|  4.04k|}
_ZN4SpanIKhEC2INSt3__16vectorIhNS3_9allocatorIhEEEEEERKT_NS3_9enable_ifIXaaaantsr7is_SpanIS8_EE5valuesr3std14is_convertibleIPA_NS3_14remove_pointerIDTcldtclsr3stdE7declvalISA_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalISA_EE4sizeEEmEE5valueEDnE4typeE:
  172|     95|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIKSt4byteEC2IS1_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S1_EE5valueEiE4typeELi0EEEPS6_m:
  119|  6.62k|    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|  16.8k|        : m_data(other.data()), m_size(other.size()){}
_ZNK4SpanIhE10size_bytesEv:
  188|  2.44k|    constexpr std::size_t size_bytes() const noexcept { return sizeof(C) * m_size; }
_Z7AsBytesIhE4SpanIKSt4byteES0_IT_E:
  259|  2.44k|{
  260|  2.44k|    return {reinterpret_cast<const std::byte*>(s.data()), s.size_bytes()};
  261|  2.44k|}
_ZNK4SpanItE4dataEv:
  174|    133|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanItE10size_bytesEv:
  188|    133|    constexpr std::size_t size_bytes() const noexcept { return sizeof(C) * m_size; }
_Z7AsBytesItE4SpanIKSt4byteES0_IT_E:
  259|    133|{
  260|    133|    return {reinterpret_cast<const std::byte*>(s.data()), s.size_bytes()};
  261|    133|}
_ZN4SpanIKhEC2IS0_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S0_EE5valueEiE4typeELi0EEEPS5_m:
  119|   120k|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_ZN4SpanIhEC2IhTnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_hEE5valueEiE4typeELi0EEEPS4_m:
  119|  2.66k|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_ZN4SpanItEC2ItTnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_tEE5valueEiE4typeELi0EEEPS4_m:
  119|    133|    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|  13.5k|        : 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|  2.61k|        : 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|    839|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIhEC2I7uint256EERT_NSt3__19enable_ifIXaaaantsr7is_SpanIS3_EE5valuesr3std14is_convertibleIPA_NS5_14remove_pointerIDTcldtclsr3stdE7declvalIS4_EE4dataEEE4typeEPA_hEE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS4_EE4sizeEEmEE5valueEDnE4typeE:
  165|    111|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIhEC2I7uint160EERT_NSt3__19enable_ifIXaaaantsr7is_SpanIS3_EE5valuesr3std14is_convertibleIPA_NS5_14remove_pointerIDTcldtclsr3stdE7declvalIS4_EE4dataEEE4typeEPA_hEE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS4_EE4sizeEEmEE5valueEDnE4typeE:
  165|  59.5k|        : 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|    111|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIKhEC2ILi4EEERAT__S0_:
  151|    429|    constexpr Span(C (&a)[N]) noexcept : m_data(a), m_size(N) {}
_ZN4SpanIKhEC2ILi65EEERAT__S0_:
  151|  58.1k|    constexpr Span(C (&a)[N]) noexcept : m_data(a), m_size(N) {}
_ZN4SpanIKhEC2IhTnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S0_EE5valueEiE4typeELi0EEERKS_IS5_E:
  141|    111|    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|  4.23k|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIKhEC2I7CScriptEERKT_NSt3__19enable_ifIXaaaantsr7is_SpanIS4_EE5valuesr3std14is_convertibleIPA_NS7_14remove_pointerIDTcldtclsr3stdE7declvalIS6_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS6_EE4sizeEEmEE5valueEDnE4typeE:
  172|  2.12k|        : m_data(other.data()), m_size(other.size()){}
_Z13MakeUCharSpanIRK11XOnlyPubKeyEDTcl13UCharSpanCasttl4Spanclsr3stdE7forwardIT_Efp_EEEEOS4_:
  296|    559|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|    559|        : m_data(other.data()), m_size(other.size()){}
_ZNK4SpanI7CScriptEixEm:
  191|   247k|    {
  192|   247k|        ASSERT_IF_DEBUG(size() > pos);
  193|   247k|        return m_data[pos];
  194|   247k|    }
_ZNK4SpanI7CScriptE4sizeEv:
  187|    270|    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|   250k|        : m_data(other.data()), m_size(other.size()){}
_ZNK4SpanI7CScriptE4lastEm:
  211|   247k|    {
  212|   247k|         ASSERT_IF_DEBUG(size() >= count);
  213|   247k|         return Span<C>(m_data + m_size - count, count);
  214|   247k|    }
_ZN4SpanI7CScriptEC2IS0_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S0_EE5valueEiE4typeELi0EEEPS5_m:
  119|   247k|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_ZNK4SpanINSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEEixEm:
  191|  42.7k|    {
  192|  42.7k|        ASSERT_IF_DEBUG(size() > pos);
  193|  42.7k|        return m_data[pos];
  194|  42.7k|    }
_ZNK4SpanINSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEE5beginEv:
  175|    360|    constexpr C* begin() const noexcept { return m_data; }
_ZNK4SpanINSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEE3endEv:
  176|    360|    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|  73.1k|        : m_data(other.data()), m_size(other.size()){}
_ZNK4SpanINSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEE4lastEm:
  211|  73.1k|    {
  212|  73.1k|         ASSERT_IF_DEBUG(size() >= count);
  213|  73.1k|         return Span<C>(m_data + m_size - count, count);
  214|  73.1k|    }
_ZN4SpanINSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEEC2IS6_TnNS0_9enable_ifIXsr3std14is_convertibleIPA_T_PA_S6_EE5valueEiE4typeELi0EEEPSA_m:
  119|  73.1k|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_ZNK4SpanIKcEixEm:
  191|  16.6M|    {
  192|  16.6M|        ASSERT_IF_DEBUG(size() > pos);
  193|  16.6M|        return m_data[pos];
  194|  16.6M|    }
_ZNK4SpanIKcE7subspanEm:
  196|   383k|    {
  197|   383k|        ASSERT_IF_DEBUG(size() >= offset);
  198|   383k|        return Span<C>(m_data + offset, m_size - offset);
  199|   383k|    }
_ZN4SpanIKcEC2IS0_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S0_EE5valueEiE4typeELi0EEEPS5_m:
  119|   414k|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_ZNK4SpanIhE5firstEm:
  206|    111|    {
  207|    111|        ASSERT_IF_DEBUG(size() >= count);
  208|    111|        return Span<C>(m_data, count);
  209|    111|    }
_ZN4SpanIKcEC2IS0_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S0_EE5valueEiE4typeELi0EEEPS5_SC_:
  127|  92.9k|    CONSTEXPR_IF_NOT_DEBUG Span(T* begin, T* end) noexcept : m_data(begin), m_size(end - begin)
  128|  92.9k|    {
  129|  92.9k|        ASSERT_IF_DEBUG(end >= begin);
  130|  92.9k|    }
_ZNK4SpanIKcE5firstEm:
  206|  24.6k|    {
  207|  24.6k|        ASSERT_IF_DEBUG(size() >= count);
  208|  24.6k|        return Span<C>(m_data, count);
  209|  24.6k|    }
_ZNK4SpanIKcE7subspanEmm:
  201|  7.07k|    {
  202|  7.07k|        ASSERT_IF_DEBUG(size() >= offset + count);
  203|  7.07k|        return Span<C>(m_data + offset, count);
  204|  7.07k|    }
_Z13MakeUCharSpanIRK7CScriptEDTcl13UCharSpanCasttl4Spanclsr3stdE7forwardIT_Efp_EEEEOS4_:
  296|    905|template <typename V> constexpr auto MakeUCharSpan(V&& v) -> decltype(UCharSpanCast(Span{std::forward<V>(v)})) { return UCharSpanCast(Span{std::forward<V>(v)}); }
_Z13MakeUCharSpanIRK4SpanIhEEDTcl13UCharSpanCasttlS0_clsr3stdE7forwardIT_Efp_EEEEOS4_:
  296|    111|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|    111|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()}; }
_ZNK4SpanIKcE5emptyEv:
  189|  34.7k|    constexpr bool empty() const noexcept { return size() == 0; }
_ZNK4SpanIKcE5frontEv:
  178|  32.3k|    {
  179|  32.3k|        ASSERT_IF_DEBUG(size() > 0);
  180|  32.3k|        return m_data[0];
  181|  32.3k|    }
_ZNK4SpanIKcE4backEv:
  183|     58|    {
  184|     58|        ASSERT_IF_DEBUG(size() > 0);
  185|     58|        return m_data[m_size - 1];
  186|     58|    }
_ZN4SpanIK7CScriptEC2IS0_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S1_EE5valueEiE4typeELi0EEERKS_IS6_E:
  141|  3.06k|    constexpr Span(const Span<O>& other) noexcept : m_data(other.m_data), m_size(other.m_size) {}
_ZNK4SpanIK7CScriptEixEm:
  191|  3.12k|    {
  192|  3.12k|        ASSERT_IF_DEBUG(size() > pos);
  193|  3.12k|        return m_data[pos];
  194|  3.12k|    }
_ZNK4SpanIK7CScriptE4sizeEv:
  187|    608|    constexpr std::size_t size() const noexcept { return m_size; }
descriptor.cpp:_ZNK4SpanINSt3__18optionalINS0_3setIjZNK10miniscript4NodeIjE17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_E4CompNS0_9allocatorIjEEEEEEE5beginEv:
  175|  3.15M|    constexpr C* begin() const noexcept { return m_data; }
descriptor.cpp:_ZNK4SpanINSt3__18optionalINS0_3setIjZNK10miniscript4NodeIjE17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_E4CompNS0_9allocatorIjEEEEEEE3endEv:
  176|  3.15M|    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|  1.57M|        : m_data(other.data()), m_size(other.size()){}
descriptor.cpp:_ZNK4SpanINSt3__18optionalINS0_3setIjZNK10miniscript4NodeIjE17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_E4CompNS0_9allocatorIjEEEEEEE4lastEm:
  211|  1.57M|    {
  212|  1.57M|         ASSERT_IF_DEBUG(size() >= count);
  213|  1.57M|         return Span<C>(m_data + m_size - count, count);
  214|  1.57M|    }
descriptor.cpp:_ZN4SpanINSt3__18optionalINS0_3setIjZNK10miniscript4NodeIjE17DuplicateKeyCheckIN12_GLOBAL__N_19KeyParserEEEvRKT_E4CompNS0_9allocatorIjEEEEEEEC2ISG_TnNS0_9enable_ifIXsr3std14is_convertibleIPA_S9_PA_SG_EE5valueEiE4typeELi0EEEPS9_m:
  119|  1.57M|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_ZNK4SpanIPKN10miniscript4NodeIjEEE5beginEv:
  175|   184k|    constexpr C* begin() const noexcept { return m_data; }
_ZNK4SpanIPKN10miniscript4NodeIjEEE3endEv:
  176|   184k|    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|   184k|        : m_data(other.data()), m_size(other.size()){}
_ZNK4SpanIPKN10miniscript4NodeIjEEE4lastEm:
  211|   184k|    {
  212|   184k|         ASSERT_IF_DEBUG(size() >= count);
  213|   184k|         return Span<C>(m_data + m_size - count, count);
  214|   184k|    }
_ZN4SpanIPKN10miniscript4NodeIjEEEC2IS4_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S4_EE5valueEiE4typeELi0EEEPS9_m:
  119|   184k|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_ZNK4SpanINSt3__110unique_ptrIKN10miniscript4NodeIjEENS0_14default_deleteIS5_EEEEE5beginEv:
  175|   284k|    constexpr C* begin() const noexcept { return m_data; }
_ZNK4SpanINSt3__110unique_ptrIKN10miniscript4NodeIjEENS0_14default_deleteIS5_EEEEE3endEv:
  176|   567k|    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|   284k|        : m_data(other.data()), m_size(other.size()){}
_ZNK4SpanINSt3__110unique_ptrIKN10miniscript4NodeIjEENS0_14default_deleteIS5_EEEEE4lastEm:
  211|   284k|    {
  212|   284k|         ASSERT_IF_DEBUG(size() >= count);
  213|   284k|         return Span<C>(m_data + m_size - count, count);
  214|   284k|    }
_ZN4SpanINSt3__110unique_ptrIKN10miniscript4NodeIjEENS0_14default_deleteIS5_EEEEEC2IS8_TnNS0_9enable_ifIXsr3std14is_convertibleIPA_T_PA_S8_EE5valueEiE4typeELi0EEEPSC_m:
  119|   284k|    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|  1.98k|        : m_data(other.data()), m_size(other.size()){}

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

_Z26parse_univalue_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEE:
   20|  10.4k|{
   21|  10.4k|    const std::string random_string(buffer.begin(), buffer.end());
   22|  10.4k|    bool valid = true;
   23|  10.4k|    const UniValue univalue = [&] {
   24|  10.4k|        UniValue uv;
   25|  10.4k|        if (!uv.read(random_string)) valid = false;
   26|  10.4k|        return valid ? uv : UniValue{};
   27|  10.4k|    }();
   28|  10.4k|    if (!valid) {
  ------------------
  |  Branch (28:9): [True: 1.15k, False: 9.26k]
  ------------------
   29|  1.15k|        return;
   30|  1.15k|    }
   31|  9.26k|    try {
   32|  9.26k|        (void)ParseHashO(univalue, "A");
   33|  9.26k|    } catch (const UniValue&) {
   34|  9.25k|    } catch (const std::runtime_error&) {
   35|  9.25k|    }
   36|  9.26k|    try {
   37|  9.26k|        (void)ParseHashO(univalue, random_string);
   38|  9.26k|    } catch (const UniValue&) {
   39|  9.26k|    } catch (const std::runtime_error&) {
   40|  9.26k|    }
   41|  9.26k|    try {
   42|  9.26k|        (void)ParseHashV(univalue, "A");
   43|  9.26k|    } catch (const UniValue&) {
   44|  7.50k|    } catch (const std::runtime_error&) {
   45|  1.74k|    }
   46|  9.26k|    try {
   47|  9.26k|        (void)ParseHashV(univalue, random_string);
   48|  9.26k|    } catch (const UniValue&) {
   49|  7.50k|    } catch (const std::runtime_error&) {
   50|  1.74k|    }
   51|  9.26k|    try {
   52|  9.26k|        (void)ParseHexO(univalue, "A");
   53|  9.26k|    } catch (const UniValue&) {
   54|  9.25k|    }
   55|  9.26k|    try {
   56|  9.26k|        (void)ParseHexO(univalue, random_string);
   57|  9.26k|    } catch (const UniValue&) {
   58|  9.26k|    }
   59|  9.26k|    try {
   60|  9.26k|        (void)ParseHexV(univalue, "A");
   61|  9.26k|    } catch (const UniValue&) {
   62|  9.21k|    } catch (const std::runtime_error&) {
   63|      0|    }
   64|  9.26k|    try {
   65|  9.26k|        (void)ParseHexV(univalue, random_string);
   66|  9.26k|    } catch (const UniValue&) {
   67|  9.21k|    } catch (const std::runtime_error&) {
   68|      0|    }
   69|  9.26k|    try {
   70|  9.26k|        if (univalue.isNull() || univalue.isStr()) (void)ParseSighashString(univalue);
  ------------------
  |  Branch (70:13): [True: 1, False: 9.26k]
  |  Branch (70:34): [True: 7.52k, False: 1.74k]
  ------------------
   71|  9.26k|    } catch (const UniValue&) {
   72|  7.51k|    }
   73|  9.26k|    try {
   74|  9.26k|        (void)AmountFromValue(univalue);
   75|  9.26k|    } catch (const UniValue&) {
   76|  9.05k|    } catch (const std::runtime_error&) {
   77|      0|    }
   78|  9.26k|    try {
   79|  9.26k|        FlatSigningProvider provider;
   80|  9.26k|        if (buffer.size() < 10'000) (void)EvalDescriptorStringOrObject(univalue, provider);
  ------------------
  |  Branch (80:13): [True: 9.11k, False: 147]
  ------------------
   81|  9.26k|    } catch (const UniValue&) {
   82|  7.90k|    } catch (const std::runtime_error&) {
   83|      8|    }
   84|  9.26k|    try {
   85|  9.26k|        (void)ParseConfirmTarget(univalue, std::numeric_limits<unsigned int>::max());
   86|  9.26k|    } catch (const UniValue&) {
   87|  9.00k|    } catch (const std::runtime_error&) {
   88|  9.00k|    }
   89|  9.26k|    try {
   90|  9.26k|        (void)ParseDescriptorRange(univalue);
   91|  9.26k|    } catch (const UniValue&) {
   92|  8.48k|    } catch (const std::runtime_error&) {
   93|    691|    }
   94|  9.26k|}
parse_univalue.cpp:_ZZ26parse_univalue_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK3$_0clEv:
   23|  10.4k|    const UniValue univalue = [&] {
   24|  10.4k|        UniValue uv;
   25|  10.4k|        if (!uv.read(random_string)) valid = false;
  ------------------
  |  Branch (25:13): [True: 1.15k, False: 9.26k]
  ------------------
   26|  10.4k|        return valid ? uv : UniValue{};
  ------------------
  |  Branch (26:16): [True: 9.26k, False: 1.15k]
  ------------------
   27|  10.4k|    }();

_ZN12CheckGlobalsC2Ev:
   56|  10.4k|CheckGlobals::CheckGlobals() : m_impl(std::make_unique<CheckGlobalsImpl>()) {}
_ZN12CheckGlobalsD2Ev:
   57|  10.4k|CheckGlobals::~CheckGlobals() = default;
_ZN16CheckGlobalsImplC2Ev:
   17|  10.4k|    {
   18|  10.4k|        g_used_g_prng = false;
   19|  10.4k|        g_seeded_g_prng_zero = false;
   20|  10.4k|        g_used_system_time = false;
   21|  10.4k|        SetMockTime(0s);
   22|  10.4k|    }
_ZN16CheckGlobalsImplD2Ev:
   24|  10.4k|    {
   25|  10.4k|        if (g_used_g_prng && !g_seeded_g_prng_zero) {
  ------------------
  |  Branch (25:13): [True: 0, False: 10.4k]
  |  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.4k|        if (g_used_system_time) {
  ------------------
  |  Branch (41:13): [True: 0, False: 10.4k]
  ------------------
   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.4k|    }

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

_ZN9base_blobILj256EE16SetHexDeprecatedENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEE:
   22|     30|{
   23|     30|    std::fill(m_data.begin(), m_data.end(), 0);
   24|       |
   25|     30|    const auto trimmed = util::RemovePrefixView(util::TrimStringView(str), "0x");
   26|       |
   27|       |    // Note: if we are passed a greater number of digits than would fit as bytes
   28|       |    // in m_data, we will be discarding the leftmost ones.
   29|       |    // str="12bc" in a WIDTH=1 m_data => m_data[] == "\0xbc", not "0x12".
   30|     30|    size_t digits = 0;
   31|  1.92k|    for (const char c : trimmed) {
  ------------------
  |  Branch (31:23): [True: 1.92k, False: 30]
  ------------------
   32|  1.92k|        if (::HexDigit(c) == -1) break;
  ------------------
  |  Branch (32:13): [True: 0, False: 1.92k]
  ------------------
   33|  1.92k|        ++digits;
   34|  1.92k|    }
   35|     30|    unsigned char* p1 = m_data.data();
   36|     30|    unsigned char* pend = p1 + WIDTH;
   37|    990|    while (digits > 0 && p1 < pend) {
  ------------------
  |  Branch (37:12): [True: 960, False: 30]
  |  Branch (37:26): [True: 960, False: 0]
  ------------------
   38|    960|        *p1 = ::HexDigit(trimmed[--digits]);
   39|    960|        if (digits > 0) {
  ------------------
  |  Branch (39:13): [True: 960, False: 0]
  ------------------
   40|    960|            *p1 |= ((unsigned char)::HexDigit(trimmed[--digits]) << 4);
   41|    960|            p1++;
   42|    960|        }
   43|    960|    }
   44|     30|}

_ZN7uint2567FromHexENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
  203|  15.0k|    static std::optional<uint256> FromHex(std::string_view str) { return detail::FromHex<uint256>(str); }
_ZN7uint256C2E4SpanIKhE:
  208|  2.61k|    constexpr explicit uint256(Span<const unsigned char> vch) : base_blob<256>(vch) {}
_ZN9base_blobILj256EE5beginEv:
  115|  3.80k|    constexpr unsigned char* begin() { return m_data.data(); }
_ZN9base_blobILj160EE5beginEv:
  115|   101k|    constexpr unsigned char* begin() { return m_data.data(); }
_ZNK9base_blobILj256EE5beginEv:
  118|  3.59k|    constexpr const unsigned char* begin() const { return m_data.data(); }
_ZN9base_blobILj256EE4sizeEv:
  121|  32.7k|    static constexpr unsigned int size() { return WIDTH; }
_ZNK9base_blobILj256EE3endEv:
  119|  2.42k|    constexpr const unsigned char* end() const { return m_data.data() + WIDTH; }
_ZNK9base_blobILj256EE4dataEv:
  112|    609|    constexpr const unsigned char* data() const { return m_data.data(); }
_ZN9base_blobILj160EE4sizeEv:
  121|  59.5k|    static constexpr unsigned int size() { return WIDTH; }
_ZN6detail7FromHexI7uint256EENSt3__18optionalIT_EENS2_17basic_string_viewIcNS2_11char_traitsIcEEEE:
  158|  15.0k|{
  159|  15.0k|    if (uintN_t::size() * 2 != str.size() || !IsHex(str)) return std::nullopt;
  ------------------
  |  Branch (159:9): [True: 15.0k, False: 47]
  |  Branch (159:46): [True: 17, False: 30]
  ------------------
  160|     30|    uintN_t rv;
  161|     30|    rv.SetHexDeprecated(str);
  162|     30|    return rv;
  163|  15.0k|}
_ZN9base_blobILj160EE4dataEv:
  113|  59.5k|    constexpr unsigned char* data() { return m_data.data(); }
_ZN9base_blobILj256EE4dataEv:
  113|  2.70k|    constexpr unsigned char* data() { return m_data.data(); }
_ZN7uint256C2Ev:
  205|  9.12k|    constexpr uint256() = default;
_ZN9base_blobILj256EEC2Ev:
   35|  9.12k|    constexpr base_blob() : m_data() {}
_ZN9base_blobILj256EEC2E4SpanIKhE:
   41|  2.61k|    {
   42|  2.61k|        assert(vch.size() == WIDTH);
   43|  2.61k|        std::copy(vch.begin(), vch.end(), m_data.begin());
   44|  2.61k|    }
_ZNK9base_blobILj160EE7CompareERKS0_:
   64|  52.0k|    constexpr int Compare(const base_blob& other) const { return std::memcmp(m_data.data(), other.m_data.data(), WIDTH); }
_ZltRK9base_blobILj160EES2_:
   68|  52.0k|    friend constexpr bool operator<(const base_blob& a, const base_blob& b) { return a.Compare(b) < 0; }
_ZN7uint160C2Ev:
  192|  60.0k|    constexpr uint160() = default;
_ZN9base_blobILj160EEC2Ev:
   35|  60.0k|    constexpr base_blob() : m_data() {}
_ZNK9base_blobILj160EE5beginEv:
  118|    280|    constexpr const unsigned char* begin() const { return m_data.data(); }
_ZNK9base_blobILj160EE3endEv:
  119|    280|    constexpr const unsigned char* end() const { return m_data.data() + WIDTH; }
_ZN9base_blobILj160EE3endEv:
  116|    138|    constexpr unsigned char* end() { return m_data.data() + WIDTH; }
_ZNK9base_blobILj256EE9SerializeI10HashWriterEEvRT_:
  127|    839|    {
  128|    839|        s << Span(m_data);
  129|    839|    }

_ZN8UniValueC2Ev:
   31|  12.8k|    UniValue() { typ = VNULL; }
_ZN8UniValueC2ENS_5VTypeENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE:
   32|  1.79M|    UniValue(UniValue::VType type, std::string str = {}) : typ{type}, val{std::move(str)} {}
_ZNK8UniValue7getTypeEv:
   67|  2.14M|    enum VType getType() const { return typ; }
_ZNK8UniValue9getValStrEv:
   68|  53.9k|    const std::string& getValStr() const { return val; }
_ZNK8UniValue4sizeEv:
   71|    250|    size_t size() const { return values.size(); }
_ZNK8UniValue6isNullEv:
   79|  16.9k|    bool isNull() const { return (typ == VNULL); }
_ZNK8UniValue5isStrEv:
   83|  63.3k|    bool isStr() const { return (typ == VSTR); }
_ZNK8UniValue5isNumEv:
   84|  18.8k|    bool isNum() const { return (typ == VNUM); }
_ZNK8UniValue7isArrayEv:
   85|  7.91k|    bool isArray() const { return (typ == VARR); }
_ZNK8UniValue8isObjectEv:
   86|  1.66k|    bool isObject() const { return (typ == VOBJ); }
_ZNK8UniValue6getIntIlEET_v:
  139|  1.66k|{
  140|  1.66k|    static_assert(std::is_integral<Int>::value);
  141|  1.66k|    checkType(VNUM);
  142|  1.66k|    Int result;
  143|  1.66k|    const auto [first_nonmatching, error_condition] = std::from_chars(val.data(), val.data() + val.size(), result);
  144|  1.66k|    if (first_nonmatching != val.data() + val.size() || error_condition != std::errc{}) {
  ------------------
  |  Branch (144:9): [True: 568, False: 1.10k]
  |  Branch (144:57): [True: 123, False: 978]
  ------------------
  145|    691|        throw std::runtime_error("JSON integer out of range");
  146|    691|    }
  147|    978|    return result;
  148|  1.66k|}
_ZN8UniValueC2IRKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEES7_TnNS1_9enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbSB_Esr3stdE11is_signed_vISB_Esr3stdE13is_unsigned_vISB_Esr3stdE18is_constructible_vIS7_SB_EEbE4typeELb1EEEOT_:
   40|  85.0k|    {
   41|       |        if constexpr (std::is_floating_point_v<T>) {
   42|       |            setFloat(val);
   43|       |        } else if constexpr (std::is_same_v<bool, T>) {
   44|       |            setBool(val);
   45|       |        } else if constexpr (std::is_signed_v<T>) {
   46|       |            setInt(int64_t{val});
   47|       |        } else if constexpr (std::is_unsigned_v<T>) {
   48|       |            setInt(uint64_t{val});
   49|  85.0k|        } else {
   50|  85.0k|            setStr(std::string{std::forward<Ref>(val)});
   51|  85.0k|        }
   52|  85.0k|    }
_ZN8UniValueC2IRiiTnNSt3__19enable_ifIXoooooooosr3stdE19is_floating_point_vIT0_Esr3stdE9is_same_vIbS4_Esr3stdE11is_signed_vIS4_Esr3stdE13is_unsigned_vIS4_Esr3stdE18is_constructible_vINS2_12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEES4_EEbE4typeELb1EEEOT_:
   40|  85.0k|    {
   41|       |        if constexpr (std::is_floating_point_v<T>) {
   42|       |            setFloat(val);
   43|       |        } else if constexpr (std::is_same_v<bool, T>) {
   44|       |            setBool(val);
   45|  85.0k|        } else if constexpr (std::is_signed_v<T>) {
   46|  85.0k|            setInt(int64_t{val});
   47|       |        } else if constexpr (std::is_unsigned_v<T>) {
   48|       |            setInt(uint64_t{val});
   49|       |        } else {
   50|       |            setStr(std::string{std::forward<Ref>(val)});
   51|       |        }
   52|  85.0k|    }
_ZNK8UniValue6getIntIiEET_v:
  139|  9.26k|{
  140|  9.26k|    static_assert(std::is_integral<Int>::value);
  141|  9.26k|    checkType(VNUM);
  142|  9.26k|    Int result;
  143|  9.26k|    const auto [first_nonmatching, error_condition] = std::from_chars(val.data(), val.data() + val.size(), result);
  144|  9.26k|    if (first_nonmatching != val.data() + val.size() || error_condition != std::errc{}) {
  ------------------
  |  Branch (144:9): [True: 8.48k, False: 778]
  |  Branch (144:57): [True: 515, False: 263]
  ------------------
  145|  1.08k|        throw std::runtime_error("JSON integer out of range");
  146|  1.08k|    }
  147|  8.18k|    return result;
  148|  9.26k|}
univalue_read.cpp:_ZL12json_isspacei:
  188|  4.41M|{
  189|  4.41M|    switch (ch) {
  190|  9.94k|    case 0x20:
  ------------------
  |  Branch (190:5): [True: 9.94k, False: 4.40M]
  ------------------
  191|  10.0k|    case 0x09:
  ------------------
  |  Branch (191:5): [True: 60, False: 4.41M]
  ------------------
  192|  10.2k|    case 0x0a:
  ------------------
  |  Branch (192:5): [True: 211, False: 4.41M]
  ------------------
  193|  10.2k|    case 0x0d:
  ------------------
  |  Branch (193:5): [True: 10, False: 4.41M]
  ------------------
  194|  10.2k|        return true;
  195|       |
  196|  4.40M|    default:
  ------------------
  |  Branch (196:5): [True: 4.40M, False: 10.2k]
  ------------------
  197|  4.40M|        return false;
  198|  4.41M|    }
  199|       |
  200|       |    // not reached
  201|  4.41M|}
univalue_read.cpp:_ZL16jsonTokenIsValue10jtokentype:
  171|  4.31M|{
  172|  4.31M|    switch (jtt) {
  173|    267|    case JTOK_KW_NULL:
  ------------------
  |  Branch (173:5): [True: 267, False: 4.31M]
  ------------------
  174|    886|    case JTOK_KW_TRUE:
  ------------------
  |  Branch (174:5): [True: 619, False: 4.31M]
  ------------------
  175|  1.25k|    case JTOK_KW_FALSE:
  ------------------
  |  Branch (175:5): [True: 370, False: 4.31M]
  ------------------
  176|  1.65M|    case JTOK_NUMBER:
  ------------------
  |  Branch (176:5): [True: 1.65M, False: 2.65M]
  ------------------
  177|  2.15M|    case JTOK_STRING:
  ------------------
  |  Branch (177:5): [True: 492k, False: 3.82M]
  ------------------
  178|  2.15M|        return true;
  179|       |
  180|  2.16M|    default:
  ------------------
  |  Branch (180:5): [True: 2.16M, False: 2.15M]
  ------------------
  181|  2.16M|        return false;
  182|  4.31M|    }
  183|       |
  184|       |    // not reached
  185|  4.31M|}

_ZN20JSONUTF8StringFilterC2ERNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
   17|   492k|        : str(s)
   18|   492k|    {
   19|   492k|    }
_ZN20JSONUTF8StringFilter9push_backEh:
   22|  33.1M|    {
   23|  33.1M|        if (state == 0) {
  ------------------
  |  Branch (23:13): [True: 33.1M, False: 17.5k]
  ------------------
   24|  33.1M|            if (ch < 0x80) // 7-bit ASCII, fast direct pass-through
  ------------------
  |  Branch (24:17): [True: 33.0M, False: 14.6k]
  ------------------
   25|  33.0M|                str.push_back(ch);
   26|  14.6k|            else if (ch < 0xc0) // Mid-sequence character, invalid in this state
  ------------------
  |  Branch (26:22): [True: 299, False: 14.3k]
  ------------------
   27|    299|                is_valid = false;
   28|  14.3k|            else if (ch < 0xe0) { // Start of 2-byte sequence
  ------------------
  |  Branch (28:22): [True: 11.2k, False: 3.15k]
  ------------------
   29|  11.2k|                codepoint = (ch & 0x1f) << 6;
   30|  11.2k|                state = 6;
   31|  11.2k|            } else if (ch < 0xf0) { // Start of 3-byte sequence
  ------------------
  |  Branch (31:24): [True: 2.18k, False: 971]
  ------------------
   32|  2.18k|                codepoint = (ch & 0x0f) << 12;
   33|  2.18k|                state = 12;
   34|  2.18k|            } else if (ch < 0xf8) { // Start of 4-byte sequence
  ------------------
  |  Branch (34:24): [True: 696, False: 275]
  ------------------
   35|    696|                codepoint = (ch & 0x07) << 18;
   36|    696|                state = 18;
   37|    696|            } else // Reserved, invalid
   38|    275|                is_valid = false;
   39|  33.1M|        } else {
   40|  17.5k|            if ((ch & 0xc0) != 0x80) // Not a continuation, invalid
  ------------------
  |  Branch (40:17): [True: 6.58k, False: 10.9k]
  ------------------
   41|  6.58k|                is_valid = false;
   42|  17.5k|            state -= 6;
   43|  17.5k|            codepoint |= (ch & 0x3f) << state;
   44|  17.5k|            if (state == 0)
  ------------------
  |  Branch (44:17): [True: 14.0k, False: 3.53k]
  ------------------
   45|  14.0k|                push_back_u(codepoint);
   46|  17.5k|        }
   47|  33.1M|    }
_ZN20JSONUTF8StringFilter11push_back_uEj:
   50|  16.2k|    {
   51|  16.2k|        if (state) // Only accept full codepoints in open state
  ------------------
  |  Branch (51:13): [True: 743, False: 15.5k]
  ------------------
   52|    743|            is_valid = false;
   53|  16.2k|        if (codepoint_ >= 0xD800 && codepoint_ < 0xDC00) { // First half of surrogate pair
  ------------------
  |  Branch (53:13): [True: 3.80k, False: 12.4k]
  |  Branch (53:37): [True: 1.42k, False: 2.37k]
  ------------------
   54|  1.42k|            if (surpair) // Two subsequent surrogate pair openers - fail
  ------------------
  |  Branch (54:17): [True: 573, False: 853]
  ------------------
   55|    573|                is_valid = false;
   56|    853|            else
   57|    853|                surpair = codepoint_;
   58|  14.8k|        } else if (codepoint_ >= 0xDC00 && codepoint_ < 0xE000) { // Second half of surrogate pair
  ------------------
  |  Branch (58:20): [True: 2.37k, False: 12.4k]
  |  Branch (58:44): [True: 1.24k, False: 1.12k]
  ------------------
   59|  1.24k|            if (surpair) { // Open surrogate pair, expect second half
  ------------------
  |  Branch (59:17): [True: 738, False: 510]
  ------------------
   60|       |                // Compute code point from UTF-16 surrogate pair
   61|    738|                append_codepoint(0x10000 | ((surpair - 0xD800)<<10) | (codepoint_ - 0xDC00));
   62|    738|                surpair = 0;
   63|    738|            } else // Second half doesn't follow a first half - fail
   64|    510|                is_valid = false;
   65|  13.5k|        } else {
   66|  13.5k|            if (surpair) // First half of surrogate pair not followed by second - fail
  ------------------
  |  Branch (66:17): [True: 853, False: 12.7k]
  ------------------
   67|    853|                is_valid = false;
   68|  12.7k|            else
   69|  12.7k|                append_codepoint(codepoint_);
   70|  13.5k|        }
   71|  16.2k|    }
_ZN20JSONUTF8StringFilter16append_codepointEj:
  100|  13.4k|    {
  101|  13.4k|        if (codepoint_ <= 0x7f)
  ------------------
  |  Branch (101:13): [True: 388, False: 13.0k]
  ------------------
  102|    388|            str.push_back((char)codepoint_);
  103|  13.0k|        else if (codepoint_ <= 0x7FF) {
  ------------------
  |  Branch (103:18): [True: 10.6k, False: 2.42k]
  ------------------
  104|  10.6k|            str.push_back((char)(0xC0 | (codepoint_ >> 6)));
  105|  10.6k|            str.push_back((char)(0x80 | (codepoint_ & 0x3F)));
  106|  10.6k|        } else if (codepoint_ <= 0xFFFF) {
  ------------------
  |  Branch (106:20): [True: 1.01k, False: 1.40k]
  ------------------
  107|  1.01k|            str.push_back((char)(0xE0 | (codepoint_ >> 12)));
  108|  1.01k|            str.push_back((char)(0x80 | ((codepoint_ >> 6) & 0x3F)));
  109|  1.01k|            str.push_back((char)(0x80 | (codepoint_ & 0x3F)));
  110|  1.40k|        } else if (codepoint_ <= 0x1FFFFF) {
  ------------------
  |  Branch (110:20): [True: 1.40k, False: 0]
  ------------------
  111|  1.40k|            str.push_back((char)(0xF0 | (codepoint_ >> 18)));
  112|  1.40k|            str.push_back((char)(0x80 | ((codepoint_ >> 12) & 0x3F)));
  113|  1.40k|            str.push_back((char)(0x80 | ((codepoint_ >> 6) & 0x3F)));
  114|  1.40k|            str.push_back((char)(0x80 | (codepoint_ & 0x3F)));
  115|  1.40k|        }
  116|  13.4k|    }
_ZN20JSONUTF8StringFilter8finalizeEv:
   75|   492k|    {
   76|   492k|        if (state || surpair)
  ------------------
  |  Branch (76:13): [True: 2, False: 492k]
  |  Branch (76:22): [True: 20, False: 492k]
  ------------------
   77|     22|            is_valid = false;
   78|   492k|        return is_valid;
   79|   492k|    }

_ZN8UniValue5clearEv:
   19|   182k|{
   20|   182k|    typ = VNULL;
   21|   182k|    val.clear();
   22|   182k|    keys.clear();
   23|   182k|    values.clear();
   24|   182k|}
_ZN8UniValue7setBoolEb:
   32|    987|{
   33|    987|    clear();
   34|    987|    typ = VBOOL;
   35|    987|    if (val_)
  ------------------
  |  Branch (35:9): [True: 617, False: 370]
  ------------------
   36|    617|        val = "1";
   37|    987|}
_ZN8UniValue9setNumStrENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
   48|  85.0k|{
   49|  85.0k|    if (!validNumStr(str)) {
  ------------------
  |  Branch (49:9): [True: 0, False: 85.0k]
  ------------------
   50|      0|        throw std::runtime_error{"The string '" + str + "' is not a valid JSON number"};
   51|      0|    }
   52|       |
   53|  85.0k|    clear();
   54|  85.0k|    typ = VNUM;
   55|  85.0k|    val = std::move(str);
   56|  85.0k|}
_ZN8UniValue6setIntEl:
   68|  85.0k|{
   69|  85.0k|    std::ostringstream oss;
   70|       |
   71|  85.0k|    oss << val_;
   72|       |
   73|  85.0k|    return setNumStr(oss.str());
   74|  85.0k|}
_ZN8UniValue6setStrENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
   86|  85.0k|{
   87|  85.0k|    clear();
   88|  85.0k|    typ = VSTR;
   89|  85.0k|    val = std::move(str);
   90|  85.0k|}
_ZN8UniValue8setArrayEv:
   93|    579|{
   94|    579|    clear();
   95|    579|    typ = VARR;
   96|    579|}
_ZN8UniValue9setObjectEv:
   99|    248|{
  100|    248|    clear();
  101|    248|    typ = VOBJ;
  102|    248|}
_ZN8UniValue9pushKVEndENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES_:
  119|   170k|{
  120|   170k|    checkType(VOBJ);
  121|       |
  122|   170k|    keys.push_back(std::move(key));
  123|   170k|    values.push_back(std::move(val));
  124|   170k|}
_ZN8UniValue6pushKVENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEES_:
  127|   170k|{
  128|   170k|    checkType(VOBJ);
  129|       |
  130|   170k|    size_t idx;
  131|   170k|    if (findKey(key, idx))
  ------------------
  |  Branch (131:9): [True: 0, False: 170k]
  ------------------
  132|      0|        values[idx] = std::move(val);
  133|   170k|    else
  134|   170k|        pushKVEnd(std::move(key), std::move(val));
  135|   170k|}
_ZNK8UniValue7findKeyERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERm:
  157|   170k|{
  158|   255k|    for (size_t i = 0; i < keys.size(); i++) {
  ------------------
  |  Branch (158:24): [True: 85.0k, False: 170k]
  ------------------
  159|  85.0k|        if (keys[i] == key) {
  ------------------
  |  Branch (159:13): [True: 0, False: 85.0k]
  ------------------
  160|      0|            retIdx = i;
  161|      0|            return true;
  162|      0|        }
  163|  85.0k|    }
  164|       |
  165|   170k|    return false;
  166|   170k|}
_ZNK8UniValueixEm:
  201|    653|{
  202|    653|    if (typ != VOBJ && typ != VARR)
  ------------------
  |  Branch (202:9): [True: 653, False: 0]
  |  Branch (202:24): [True: 0, False: 653]
  ------------------
  203|      0|        return NullUniValue;
  204|    653|    if (index >= values.size())
  ------------------
  |  Branch (204:9): [True: 0, False: 653]
  ------------------
  205|      0|        return NullUniValue;
  206|       |
  207|    653|    return values.at(index);
  208|    653|}
_ZNK8UniValue9checkTypeERKNS_5VTypeE:
  211|   418k|{
  212|   418k|    if (typ != expected) {
  ------------------
  |  Branch (212:9): [True: 29.9k, False: 388k]
  ------------------
  213|  29.9k|        throw type_error{"JSON value of type " + std::string{uvTypeName(typ)} + " is not of expected type " +
  214|  29.9k|                                 std::string{uvTypeName(expected)}};
  215|  29.9k|    }
  216|   418k|}
_Z10uvTypeNameN8UniValue5VTypeE:
  219|  59.8k|{
  220|  59.8k|    switch (t) {
  ------------------
  |  Branch (220:13): [True: 0, False: 59.8k]
  ------------------
  221|  18.4k|    case UniValue::VNULL: return "null";
  ------------------
  |  Branch (221:5): [True: 18.4k, False: 41.3k]
  ------------------
  222|      6|    case UniValue::VBOOL: return "bool";
  ------------------
  |  Branch (222:5): [True: 6, False: 59.8k]
  ------------------
  223|    435|    case UniValue::VOBJ: return "object";
  ------------------
  |  Branch (223:5): [True: 435, False: 59.4k]
  ------------------
  224|    750|    case UniValue::VARR: return "array";
  ------------------
  |  Branch (224:5): [True: 750, False: 59.0k]
  ------------------
  225|  29.5k|    case UniValue::VSTR: return "string";
  ------------------
  |  Branch (225:5): [True: 29.5k, False: 30.3k]
  ------------------
  226|  10.6k|    case UniValue::VNUM: return "number";
  ------------------
  |  Branch (226:5): [True: 10.6k, False: 49.2k]
  ------------------
  227|  59.8k|    }
  228|       |
  229|       |    // not reached
  230|      0|    return nullptr;
  231|  59.8k|}
_ZNK8UniValue10find_valueENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
  234|  37.1k|{
  235|  1.27M|    for (unsigned int i = 0; i < keys.size(); ++i) {
  ------------------
  |  Branch (235:30): [True: 1.24M, False: 37.0k]
  ------------------
  236|  1.24M|        if (keys[i] == key) {
  ------------------
  |  Branch (236:13): [True: 85, False: 1.24M]
  ------------------
  237|     85|            return values.at(i);
  238|     85|        }
  239|  1.24M|    }
  240|  37.0k|    return NullUniValue;
  241|  37.1k|}
univalue.cpp:_ZL11validNumStrRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
   40|  85.0k|{
   41|  85.0k|    std::string tokenVal;
   42|  85.0k|    unsigned int consumed;
   43|  85.0k|    enum jtokentype tt = getJsonToken(tokenVal, consumed, s.data(), s.data() + s.size());
   44|  85.0k|    return (tt == JTOK_NUMBER);
   45|  85.0k|}

_ZNK8UniValue7get_strEv:
   67|  67.0k|{
   68|  67.0k|    checkType(VSTR);
   69|  67.0k|    return getValStr();
   70|  67.0k|}

_Z12getJsonTokenRNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERjPKcS9_:
   57|  4.41M|{
   58|  4.41M|    tokenVal.clear();
   59|  4.41M|    consumed = 0;
   60|       |
   61|  4.41M|    const char *rawStart = raw;
   62|       |
   63|  4.42M|    while (raw < end && (json_isspace(*raw)))          // skip whitespace
  ------------------
  |  Branch (63:12): [True: 4.41M, False: 9.56k]
  |  Branch (63:25): [True: 10.2k, False: 4.40M]
  ------------------
   64|  10.2k|        raw++;
   65|       |
   66|  4.41M|    if (raw >= end)
  ------------------
  |  Branch (66:9): [True: 9.56k, False: 4.40M]
  ------------------
   67|  9.56k|        return JTOK_NONE;
   68|       |
   69|  4.40M|    switch (*raw) {
   70|       |
   71|  2.16k|    case '{':
  ------------------
  |  Branch (71:5): [True: 2.16k, False: 4.39M]
  ------------------
   72|  2.16k|        raw++;
   73|  2.16k|        consumed = (raw - rawStart);
   74|  2.16k|        return JTOK_OBJ_OPEN;
   75|  1.16k|    case '}':
  ------------------
  |  Branch (75:5): [True: 1.16k, False: 4.40M]
  ------------------
   76|  1.16k|        raw++;
   77|  1.16k|        consumed = (raw - rawStart);
   78|  1.16k|        return JTOK_OBJ_CLOSE;
   79|  14.0k|    case '[':
  ------------------
  |  Branch (79:5): [True: 14.0k, False: 4.38M]
  ------------------
   80|  14.0k|        raw++;
   81|  14.0k|        consumed = (raw - rawStart);
   82|  14.0k|        return JTOK_ARR_OPEN;
   83|  5.66k|    case ']':
  ------------------
  |  Branch (83:5): [True: 5.66k, False: 4.39M]
  ------------------
   84|  5.66k|        raw++;
   85|  5.66k|        consumed = (raw - rawStart);
   86|  5.66k|        return JTOK_ARR_CLOSE;
   87|       |
   88|   458k|    case ':':
  ------------------
  |  Branch (88:5): [True: 458k, False: 3.94M]
  ------------------
   89|   458k|        raw++;
   90|   458k|        consumed = (raw - rawStart);
   91|   458k|        return JTOK_COLON;
   92|  1.68M|    case ',':
  ------------------
  |  Branch (92:5): [True: 1.68M, False: 2.71M]
  ------------------
   93|  1.68M|        raw++;
   94|  1.68M|        consumed = (raw - rawStart);
   95|  1.68M|        return JTOK_COMMA;
   96|       |
   97|    297|    case 'n':
  ------------------
  |  Branch (97:5): [True: 297, False: 4.40M]
  ------------------
   98|    950|    case 't':
  ------------------
  |  Branch (98:5): [True: 653, False: 4.40M]
  ------------------
   99|  1.35k|    case 'f':
  ------------------
  |  Branch (99:5): [True: 406, False: 4.40M]
  ------------------
  100|  1.35k|        if (!strncmp(raw, "null", 4)) {
  ------------------
  |  Branch (100:13): [True: 268, False: 1.08k]
  ------------------
  101|    268|            raw += 4;
  102|    268|            consumed = (raw - rawStart);
  103|    268|            return JTOK_KW_NULL;
  104|  1.08k|        } else if (!strncmp(raw, "true", 4)) {
  ------------------
  |  Branch (104:20): [True: 620, False: 468]
  ------------------
  105|    620|            raw += 4;
  106|    620|            consumed = (raw - rawStart);
  107|    620|            return JTOK_KW_TRUE;
  108|    620|        } else if (!strncmp(raw, "false", 5)) {
  ------------------
  |  Branch (108:20): [True: 371, False: 97]
  ------------------
  109|    371|            raw += 5;
  110|    371|            consumed = (raw - rawStart);
  111|    371|            return JTOK_KW_FALSE;
  112|    371|        } else
  113|     97|            return JTOK_ERR;
  114|       |
  115|  85.7k|    case '-':
  ------------------
  |  Branch (115:5): [True: 85.7k, False: 4.31M]
  ------------------
  116|   150k|    case '0':
  ------------------
  |  Branch (116:5): [True: 64.3k, False: 4.33M]
  ------------------
  117|   281k|    case '1':
  ------------------
  |  Branch (117:5): [True: 131k, False: 4.26M]
  ------------------
  118|   319k|    case '2':
  ------------------
  |  Branch (118:5): [True: 38.0k, False: 4.36M]
  ------------------
  119|   922k|    case '3':
  ------------------
  |  Branch (119:5): [True: 603k, False: 3.79M]
  ------------------
  120|  1.09M|    case '4':
  ------------------
  |  Branch (120:5): [True: 177k, False: 4.22M]
  ------------------
  121|  1.23M|    case '5':
  ------------------
  |  Branch (121:5): [True: 131k, False: 4.27M]
  ------------------
  122|  1.28M|    case '6':
  ------------------
  |  Branch (122:5): [True: 50.2k, False: 4.35M]
  ------------------
  123|  1.38M|    case '7':
  ------------------
  |  Branch (123:5): [True: 106k, False: 4.29M]
  ------------------
  124|  1.52M|    case '8':
  ------------------
  |  Branch (124:5): [True: 136k, False: 4.26M]
  ------------------
  125|  1.74M|    case '9': {
  ------------------
  |  Branch (125:5): [True: 217k, False: 4.18M]
  ------------------
  126|       |        // part 1: int
  127|  1.74M|        std::string numStr;
  128|       |
  129|  1.74M|        const char *first = raw;
  130|       |
  131|  1.74M|        const char *firstDigit = first;
  132|  1.74M|        if (!json_isdigit(*firstDigit))
  ------------------
  |  Branch (132:13): [True: 85.7k, False: 1.65M]
  ------------------
  133|  85.7k|            firstDigit++;
  134|  1.74M|        if ((*firstDigit == '0') && json_isdigit(firstDigit[1]))
  ------------------
  |  Branch (134:13): [True: 64.3k, False: 1.67M]
  |  Branch (134:37): [True: 4, False: 64.3k]
  ------------------
  135|      4|            return JTOK_ERR;
  136|       |
  137|  1.74M|        numStr += *raw;                       // copy first char
  138|  1.74M|        raw++;
  139|       |
  140|  1.74M|        if ((*first == '-') && (raw < end) && (!json_isdigit(*raw)))
  ------------------
  |  Branch (140:13): [True: 85.7k, False: 1.65M]
  |  Branch (140:32): [True: 85.7k, False: 8]
  |  Branch (140:47): [True: 14, False: 85.7k]
  ------------------
  141|     14|            return JTOK_ERR;
  142|       |
  143|  12.5M|        while (raw < end && json_isdigit(*raw)) {  // copy digits
  ------------------
  |  Branch (143:16): [True: 12.4M, False: 85.9k]
  |  Branch (143:29): [True: 10.8M, False: 1.65M]
  ------------------
  144|  10.8M|            numStr += *raw;
  145|  10.8M|            raw++;
  146|  10.8M|        }
  147|       |
  148|       |        // part 2: frac
  149|  1.74M|        if (raw < end && *raw == '.') {
  ------------------
  |  Branch (149:13): [True: 1.65M, False: 85.9k]
  |  Branch (149:26): [True: 1.56k, False: 1.65M]
  ------------------
  150|  1.56k|            numStr += *raw;                   // copy .
  151|  1.56k|            raw++;
  152|       |
  153|  1.56k|            if (raw >= end || !json_isdigit(*raw))
  ------------------
  |  Branch (153:17): [True: 4, False: 1.56k]
  |  Branch (153:31): [True: 11, False: 1.55k]
  ------------------
  154|     15|                return JTOK_ERR;
  155|  5.73M|            while (raw < end && json_isdigit(*raw)) { // copy digits
  ------------------
  |  Branch (155:20): [True: 5.73M, False: 247]
  |  Branch (155:33): [True: 5.73M, False: 1.30k]
  ------------------
  156|  5.73M|                numStr += *raw;
  157|  5.73M|                raw++;
  158|  5.73M|            }
  159|  1.55k|        }
  160|       |
  161|       |        // part 3: exp
  162|  1.74M|        if (raw < end && (*raw == 'e' || *raw == 'E')) {
  ------------------
  |  Branch (162:13): [True: 1.65M, False: 86.1k]
  |  Branch (162:27): [True: 973, False: 1.65M]
  |  Branch (162:42): [True: 600, False: 1.65M]
  ------------------
  163|  1.57k|            numStr += *raw;                   // copy E
  164|  1.57k|            raw++;
  165|       |
  166|  1.57k|            if (raw < end && (*raw == '-' || *raw == '+')) { // copy +/-
  ------------------
  |  Branch (166:17): [True: 1.55k, False: 14]
  |  Branch (166:31): [True: 286, False: 1.27k]
  |  Branch (166:46): [True: 195, False: 1.07k]
  ------------------
  167|    481|                numStr += *raw;
  168|    481|                raw++;
  169|    481|            }
  170|       |
  171|  1.57k|            if (raw >= end || !json_isdigit(*raw))
  ------------------
  |  Branch (171:17): [True: 26, False: 1.54k]
  |  Branch (171:31): [True: 14, False: 1.53k]
  ------------------
  172|     40|                return JTOK_ERR;
  173|   171k|            while (raw < end && json_isdigit(*raw)) { // copy digits
  ------------------
  |  Branch (173:20): [True: 171k, False: 328]
  |  Branch (173:33): [True: 170k, False: 1.20k]
  ------------------
  174|   170k|                numStr += *raw;
  175|   170k|                raw++;
  176|   170k|            }
  177|  1.53k|        }
  178|       |
  179|  1.74M|        tokenVal = numStr;
  180|  1.74M|        consumed = (raw - rawStart);
  181|  1.74M|        return JTOK_NUMBER;
  182|  1.74M|        }
  183|       |
  184|   492k|    case '"': {
  ------------------
  |  Branch (184:5): [True: 492k, False: 3.90M]
  ------------------
  185|   492k|        raw++;                                // skip "
  186|       |
  187|   492k|        std::string valStr;
  188|   492k|        JSONUTF8StringFilter writer(valStr);
  189|       |
  190|  33.6M|        while (true) {
  ------------------
  |  Branch (190:16): [Folded - Ignored]
  ------------------
  191|  33.6M|            if (raw >= end || (unsigned char)*raw < 0x20)
  ------------------
  |  Branch (191:17): [True: 412, False: 33.6M]
  |  Branch (191:31): [True: 20, False: 33.6M]
  ------------------
  192|    432|                return JTOK_ERR;
  193|       |
  194|  33.6M|            else if (*raw == '\\') {
  ------------------
  |  Branch (194:22): [True: 4.04k, False: 33.6M]
  ------------------
  195|  4.04k|                raw++;                        // skip backslash
  196|       |
  197|  4.04k|                if (raw >= end)
  ------------------
  |  Branch (197:21): [True: 18, False: 4.02k]
  ------------------
  198|     18|                    return JTOK_ERR;
  199|       |
  200|  4.02k|                switch (*raw) {
  201|    320|                case '"':  writer.push_back('\"'); break;
  ------------------
  |  Branch (201:17): [True: 320, False: 3.70k]
  ------------------
  202|    255|                case '\\': writer.push_back('\\'); break;
  ------------------
  |  Branch (202:17): [True: 255, False: 3.77k]
  ------------------
  203|    205|                case '/':  writer.push_back('/'); break;
  ------------------
  |  Branch (203:17): [True: 205, False: 3.82k]
  ------------------
  204|    199|                case 'b':  writer.push_back('\b'); break;
  ------------------
  |  Branch (204:17): [True: 199, False: 3.82k]
  ------------------
  205|    197|                case 'f':  writer.push_back('\f'); break;
  ------------------
  |  Branch (205:17): [True: 197, False: 3.82k]
  ------------------
  206|    201|                case 'n':  writer.push_back('\n'); break;
  ------------------
  |  Branch (206:17): [True: 201, False: 3.82k]
  ------------------
  207|    197|                case 'r':  writer.push_back('\r'); break;
  ------------------
  |  Branch (207:17): [True: 197, False: 3.82k]
  ------------------
  208|    208|                case 't':  writer.push_back('\t'); break;
  ------------------
  |  Branch (208:17): [True: 208, False: 3.81k]
  ------------------
  209|       |
  210|  2.24k|                case 'u': {
  ------------------
  |  Branch (210:17): [True: 2.24k, False: 1.78k]
  ------------------
  211|  2.24k|                    unsigned int codepoint;
  212|  2.24k|                    if (raw + 1 + 4 >= end ||
  ------------------
  |  Branch (212:25): [True: 3, False: 2.23k]
  ------------------
  213|  2.24k|                        hatoui(raw + 1, raw + 1 + 4, codepoint) !=
  ------------------
  |  Branch (213:25): [True: 18, False: 2.22k]
  ------------------
  214|  2.23k|                               raw + 1 + 4)
  215|     21|                        return JTOK_ERR;
  216|  2.22k|                    writer.push_back_u(codepoint);
  217|  2.22k|                    raw += 4;
  218|  2.22k|                    break;
  219|  2.24k|                    }
  220|      3|                default:
  ------------------
  |  Branch (220:17): [True: 3, False: 4.02k]
  ------------------
  221|      3|                    return JTOK_ERR;
  222|       |
  223|  4.02k|                }
  224|       |
  225|  4.00k|                raw++;                        // skip esc'd char
  226|  4.00k|            }
  227|       |
  228|  33.6M|            else if (*raw == '"') {
  ------------------
  |  Branch (228:22): [True: 492k, False: 33.1M]
  ------------------
  229|   492k|                raw++;                        // skip "
  230|   492k|                break;                        // stop scanning
  231|   492k|            }
  232|       |
  233|  33.1M|            else {
  234|  33.1M|                writer.push_back(static_cast<unsigned char>(*raw));
  235|  33.1M|                raw++;
  236|  33.1M|            }
  237|  33.6M|        }
  238|       |
  239|   492k|        if (!writer.finalize())
  ------------------
  |  Branch (239:13): [True: 25, False: 492k]
  ------------------
  240|     25|            return JTOK_ERR;
  241|   492k|        tokenVal = valStr;
  242|   492k|        consumed = (raw - rawStart);
  243|   492k|        return JTOK_STRING;
  244|   492k|        }
  245|       |
  246|     60|    default:
  ------------------
  |  Branch (246:5): [True: 60, False: 4.40M]
  ------------------
  247|     60|        return JTOK_ERR;
  248|  4.40M|    }
  249|  4.40M|}
_ZN8UniValue4readENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
  264|  10.4k|{
  265|  10.4k|    clear();
  266|       |
  267|  10.4k|    uint32_t expectMask = 0;
  268|  10.4k|    std::vector<UniValue*> stack;
  269|       |
  270|  10.4k|    std::string tokenVal;
  271|  10.4k|    unsigned int consumed;
  272|  10.4k|    enum jtokentype tok = JTOK_NONE;
  273|  10.4k|    enum jtokentype last_tok = JTOK_NONE;
  274|  10.4k|    const char* raw{str_in.data()};
  275|  10.4k|    const char* end{raw + str_in.size()};
  276|  4.31M|    do {
  277|  4.31M|        last_tok = tok;
  278|       |
  279|  4.31M|        tok = getJsonToken(tokenVal, consumed, raw, end);
  280|  4.31M|        if (tok == JTOK_NONE || tok == JTOK_ERR)
  ------------------
  |  Branch (280:13): [True: 304, False: 4.31M]
  |  Branch (280:33): [True: 682, False: 4.31M]
  ------------------
  281|    986|            return false;
  282|  4.31M|        raw += consumed;
  283|       |
  284|  4.31M|        bool isValueOpen = jsonTokenIsValue(tok) ||
  ------------------
  |  Branch (284:28): [True: 2.15M, False: 2.16M]
  ------------------
  285|  4.31M|            tok == JTOK_OBJ_OPEN || tok == JTOK_ARR_OPEN;
  ------------------
  |  Branch (285:13): [True: 2.16k, False: 2.16M]
  |  Branch (285:37): [True: 14.0k, False: 2.14M]
  ------------------
  286|       |
  287|  4.31M|        if (expect(VALUE)) {
  ------------------
  |  |  259|  4.31M|#define expect(bit) (expectMask & (EXP_##bit))
  |  |  ------------------
  |  |  |  Branch (259:21): [True: 458k, False: 3.85M]
  |  |  ------------------
  ------------------
  288|   458k|            if (!isValueOpen)
  ------------------
  |  Branch (288:17): [True: 6, False: 458k]
  ------------------
  289|      6|                return false;
  290|   458k|            clearExpect(VALUE);
  ------------------
  |  |  261|   458k|#define clearExpect(bit) (expectMask &= ~EXP_##bit)
  ------------------
  291|       |
  292|  3.85M|        } else if (expect(ARR_VALUE)) {
  ------------------
  |  |  259|  3.85M|#define expect(bit) (expectMask & (EXP_##bit))
  |  |  ------------------
  |  |  |  Branch (259:21): [True: 1.23M, False: 2.61M]
  |  |  ------------------
  ------------------
  293|  1.23M|            bool isArrValue = isValueOpen || (tok == JTOK_ARR_CLOSE);
  ------------------
  |  Branch (293:31): [True: 1.23M, False: 486]
  |  Branch (293:46): [True: 477, False: 9]
  ------------------
  294|  1.23M|            if (!isArrValue)
  ------------------
  |  Branch (294:17): [True: 9, False: 1.23M]
  ------------------
  295|      9|                return false;
  296|       |
  297|  1.23M|            clearExpect(ARR_VALUE);
  ------------------
  |  |  261|  1.23M|#define clearExpect(bit) (expectMask &= ~EXP_##bit)
  ------------------
  298|       |
  299|  2.61M|        } else if (expect(OBJ_NAME)) {
  ------------------
  |  |  259|  2.61M|#define expect(bit) (expectMask & (EXP_##bit))
  |  |  ------------------
  |  |  |  Branch (259:21): [True: 459k, False: 2.15M]
  |  |  ------------------
  ------------------
  300|   459k|            bool isObjName = (tok == JTOK_OBJ_CLOSE || tok == JTOK_STRING);
  ------------------
  |  Branch (300:31): [True: 512, False: 458k]
  |  Branch (300:56): [True: 458k, False: 11]
  ------------------
  301|   459k|            if (!isObjName)
  ------------------
  |  Branch (301:17): [True: 11, False: 459k]
  ------------------
  302|     11|                return false;
  303|       |
  304|  2.15M|        } else if (expect(COLON)) {
  ------------------
  |  |  259|  2.15M|#define expect(bit) (expectMask & (EXP_##bit))
  |  |  ------------------
  |  |  |  Branch (259:21): [True: 458k, False: 1.69M]
  |  |  ------------------
  ------------------
  305|   458k|            if (tok != JTOK_COLON)
  ------------------
  |  Branch (305:17): [True: 8, False: 458k]
  ------------------
  306|      8|                return false;
  307|   458k|            clearExpect(COLON);
  ------------------
  |  |  261|   458k|#define clearExpect(bit) (expectMask &= ~EXP_##bit)
  ------------------
  308|       |
  309|  1.69M|        } else if (!expect(COLON) && (tok == JTOK_COLON)) {
  ------------------
  |  |  259|  3.39M|#define expect(bit) (expectMask & (EXP_##bit))
  ------------------
  |  Branch (309:20): [True: 1.69M, False: 0]
  |  Branch (309:38): [True: 2, False: 1.69M]
  ------------------
  310|      2|            return false;
  311|      2|        }
  312|       |
  313|  4.31M|        if (expect(NOT_VALUE)) {
  ------------------
  |  |  259|  4.31M|#define expect(bit) (expectMask & (EXP_##bit))
  |  |  ------------------
  |  |  |  Branch (259:21): [True: 2.14M, False: 2.16M]
  |  |  ------------------
  ------------------
  314|  2.14M|            if (isValueOpen)
  ------------------
  |  Branch (314:17): [True: 16, False: 2.14M]
  ------------------
  315|     16|                return false;
  316|  2.14M|            clearExpect(NOT_VALUE);
  ------------------
  |  |  261|  2.14M|#define clearExpect(bit) (expectMask &= ~EXP_##bit)
  ------------------
  317|  2.14M|        }
  318|       |
  319|  4.31M|        switch (tok) {
  320|       |
  321|  2.16k|        case JTOK_OBJ_OPEN:
  ------------------
  |  Branch (321:9): [True: 2.16k, False: 4.31M]
  ------------------
  322|  16.2k|        case JTOK_ARR_OPEN: {
  ------------------
  |  Branch (322:9): [True: 14.0k, False: 4.30M]
  ------------------
  323|  16.2k|            VType utyp = (tok == JTOK_OBJ_OPEN ? VOBJ : VARR);
  ------------------
  |  Branch (323:27): [True: 2.16k, False: 14.0k]
  ------------------
  324|  16.2k|            if (!stack.size()) {
  ------------------
  |  Branch (324:17): [True: 827, False: 15.3k]
  ------------------
  325|    827|                if (utyp == VOBJ)
  ------------------
  |  Branch (325:21): [True: 248, False: 579]
  ------------------
  326|    248|                    setObject();
  327|    579|                else
  328|    579|                    setArray();
  329|    827|                stack.push_back(this);
  330|  15.3k|            } else {
  331|  15.3k|                UniValue tmpVal(utyp);
  332|  15.3k|                UniValue *top = stack.back();
  333|  15.3k|                top->values.push_back(tmpVal);
  334|       |
  335|  15.3k|                UniValue *newTop = &(top->values.back());
  336|  15.3k|                stack.push_back(newTop);
  337|  15.3k|            }
  338|       |
  339|  16.2k|            if (stack.size() > MAX_JSON_DEPTH)
  ------------------
  |  Branch (339:17): [True: 1, False: 16.2k]
  ------------------
  340|      1|                return false;
  341|       |
  342|  16.2k|            if (utyp == VOBJ)
  ------------------
  |  Branch (342:17): [True: 2.16k, False: 14.0k]
  ------------------
  343|  2.16k|                setExpect(OBJ_NAME);
  ------------------
  |  |  260|  2.16k|#define setExpect(bit) (expectMask |= EXP_##bit)
  ------------------
  344|  14.0k|            else
  345|  14.0k|                setExpect(ARR_VALUE);
  ------------------
  |  |  260|  14.0k|#define setExpect(bit) (expectMask |= EXP_##bit)
  ------------------
  346|  16.2k|            break;
  347|  16.2k|            }
  348|       |
  349|  1.15k|        case JTOK_OBJ_CLOSE:
  ------------------
  |  Branch (349:9): [True: 1.15k, False: 4.31M]
  ------------------
  350|  6.82k|        case JTOK_ARR_CLOSE: {
  ------------------
  |  Branch (350:9): [True: 5.66k, False: 4.30M]
  ------------------
  351|  6.82k|            if (!stack.size() || (last_tok == JTOK_COMMA))
  ------------------
  |  Branch (351:17): [True: 2, False: 6.81k]
  |  Branch (351:34): [True: 6, False: 6.81k]
  ------------------
  352|      8|                return false;
  353|       |
  354|  6.81k|            VType utyp = (tok == JTOK_OBJ_CLOSE ? VOBJ : VARR);
  ------------------
  |  Branch (354:27): [True: 1.15k, False: 5.65k]
  ------------------
  355|  6.81k|            UniValue *top = stack.back();
  356|  6.81k|            if (utyp != top->getType())
  ------------------
  |  Branch (356:17): [True: 7, False: 6.80k]
  ------------------
  357|      7|                return false;
  358|       |
  359|  6.80k|            stack.pop_back();
  360|  6.80k|            clearExpect(OBJ_NAME);
  ------------------
  |  |  261|  6.80k|#define clearExpect(bit) (expectMask &= ~EXP_##bit)
  ------------------
  361|  6.80k|            setExpect(NOT_VALUE);
  ------------------
  |  |  260|  6.80k|#define setExpect(bit) (expectMask |= EXP_##bit)
  ------------------
  362|  6.80k|            break;
  363|  6.81k|            }
  364|       |
  365|   458k|        case JTOK_COLON: {
  ------------------
  |  Branch (365:9): [True: 458k, False: 3.85M]
  ------------------
  366|   458k|            if (!stack.size())
  ------------------
  |  Branch (366:17): [True: 0, False: 458k]
  ------------------
  367|      0|                return false;
  368|       |
  369|   458k|            UniValue *top = stack.back();
  370|   458k|            if (top->getType() != VOBJ)
  ------------------
  |  Branch (370:17): [True: 0, False: 458k]
  ------------------
  371|      0|                return false;
  372|       |
  373|   458k|            setExpect(VALUE);
  ------------------
  |  |  260|   458k|#define setExpect(bit) (expectMask |= EXP_##bit)
  ------------------
  374|   458k|            break;
  375|   458k|            }
  376|       |
  377|  1.68M|        case JTOK_COMMA: {
  ------------------
  |  Branch (377:9): [True: 1.68M, False: 2.63M]
  ------------------
  378|  1.68M|            if (!stack.size() ||
  ------------------
  |  Branch (378:17): [True: 1, False: 1.68M]
  ------------------
  379|  1.68M|                (last_tok == JTOK_COMMA) || (last_tok == JTOK_ARR_OPEN))
  ------------------
  |  Branch (379:17): [True: 0, False: 1.68M]
  |  Branch (379:45): [True: 0, False: 1.68M]
  ------------------
  380|      1|                return false;
  381|       |
  382|  1.68M|            UniValue *top = stack.back();
  383|  1.68M|            if (top->getType() == VOBJ)
  ------------------
  |  Branch (383:17): [True: 457k, False: 1.22M]
  ------------------
  384|   457k|                setExpect(OBJ_NAME);
  ------------------
  |  |  260|   457k|#define setExpect(bit) (expectMask |= EXP_##bit)
  ------------------
  385|  1.22M|            else
  386|  1.22M|                setExpect(ARR_VALUE);
  ------------------
  |  |  260|  1.22M|#define setExpect(bit) (expectMask |= EXP_##bit)
  ------------------
  387|  1.68M|            break;
  388|  1.68M|            }
  389|       |
  390|    266|        case JTOK_KW_NULL:
  ------------------
  |  Branch (390:9): [True: 266, False: 4.31M]
  ------------------
  391|    883|        case JTOK_KW_TRUE:
  ------------------
  |  Branch (391:9): [True: 617, False: 4.31M]
  ------------------
  392|  1.25k|        case JTOK_KW_FALSE: {
  ------------------
  |  Branch (392:9): [True: 370, False: 4.31M]
  ------------------
  393|  1.25k|            UniValue tmpVal;
  394|  1.25k|            switch (tok) {
  395|    266|            case JTOK_KW_NULL:
  ------------------
  |  Branch (395:13): [True: 266, False: 987]
  ------------------
  396|       |                // do nothing more
  397|    266|                break;
  398|    617|            case JTOK_KW_TRUE:
  ------------------
  |  Branch (398:13): [True: 617, False: 636]
  ------------------
  399|    617|                tmpVal.setBool(true);
  400|    617|                break;
  401|    370|            case JTOK_KW_FALSE:
  ------------------
  |  Branch (401:13): [True: 370, False: 883]
  ------------------
  402|    370|                tmpVal.setBool(false);
  403|    370|                break;
  404|      0|            default: /* impossible */ break;
  ------------------
  |  Branch (404:13): [True: 0, False: 1.25k]
  ------------------
  405|  1.25k|            }
  406|       |
  407|  1.25k|            if (!stack.size()) {
  ------------------
  |  Branch (407:17): [True: 9, False: 1.24k]
  ------------------
  408|      9|                *this = tmpVal;
  409|      9|                break;
  410|      9|            }
  411|       |
  412|  1.24k|            UniValue *top = stack.back();
  413|  1.24k|            top->values.push_back(tmpVal);
  414|       |
  415|  1.24k|            setExpect(NOT_VALUE);
  ------------------
  |  |  260|  1.24k|#define setExpect(bit) (expectMask |= EXP_##bit)
  ------------------
  416|  1.24k|            break;
  417|  1.25k|            }
  418|       |
  419|  1.65M|        case JTOK_NUMBER: {
  ------------------
  |  Branch (419:9): [True: 1.65M, False: 2.65M]
  ------------------
  420|  1.65M|            UniValue tmpVal(VNUM, tokenVal);
  421|  1.65M|            if (!stack.size()) {
  ------------------
  |  Branch (421:17): [True: 1.41k, False: 1.65M]
  ------------------
  422|  1.41k|                *this = tmpVal;
  423|  1.41k|                break;
  424|  1.41k|            }
  425|       |
  426|  1.65M|            UniValue *top = stack.back();
  427|  1.65M|            top->values.push_back(tmpVal);
  428|       |
  429|  1.65M|            setExpect(NOT_VALUE);
  ------------------
  |  |  260|  1.65M|#define setExpect(bit) (expectMask |= EXP_##bit)
  ------------------
  430|  1.65M|            break;
  431|  1.65M|            }
  432|       |
  433|   492k|        case JTOK_STRING: {
  ------------------
  |  Branch (433:9): [True: 492k, False: 3.82M]
  ------------------
  434|   492k|            if (expect(OBJ_NAME)) {
  ------------------
  |  |  259|   492k|#define expect(bit) (expectMask & (EXP_##bit))
  |  |  ------------------
  |  |  |  Branch (259:21): [True: 458k, False: 33.5k]
  |  |  ------------------
  ------------------
  435|   458k|                UniValue *top = stack.back();
  436|   458k|                top->keys.push_back(tokenVal);
  437|   458k|                clearExpect(OBJ_NAME);
  ------------------
  |  |  261|   458k|#define clearExpect(bit) (expectMask &= ~EXP_##bit)
  ------------------
  438|   458k|                setExpect(COLON);
  ------------------
  |  |  260|   458k|#define setExpect(bit) (expectMask |= EXP_##bit)
  ------------------
  439|   458k|            } else {
  440|  33.5k|                UniValue tmpVal(VSTR, tokenVal);
  441|  33.5k|                if (!stack.size()) {
  ------------------
  |  Branch (441:21): [True: 7.53k, False: 26.0k]
  ------------------
  442|  7.53k|                    *this = tmpVal;
  443|  7.53k|                    break;
  444|  7.53k|                }
  445|  26.0k|                UniValue *top = stack.back();
  446|  26.0k|                top->values.push_back(tmpVal);
  447|  26.0k|            }
  448|       |
  449|   484k|            setExpect(NOT_VALUE);
  ------------------
  |  |  260|   484k|#define setExpect(bit) (expectMask |= EXP_##bit)
  ------------------
  450|   484k|            break;
  451|   492k|            }
  452|       |
  453|      0|        default:
  ------------------
  |  Branch (453:9): [True: 0, False: 4.31M]
  ------------------
  454|      0|            return false;
  455|  4.31M|        }
  456|  4.31M|    } while (!stack.empty ());
  ------------------
  |  Branch (456:14): [True: 4.30M, False: 9.36k]
  ------------------
  457|       |
  458|       |    /* Check that nothing follows the initial construct (parsed above).  */
  459|  9.36k|    tok = getJsonToken(tokenVal, consumed, raw, end);
  460|  9.36k|    if (tok != JTOK_NONE)
  ------------------
  |  Branch (460:9): [True: 101, False: 9.26k]
  ------------------
  461|    101|        return false;
  462|       |
  463|  9.26k|    return true;
  464|  9.36k|}
univalue_read.cpp:_ZL12json_isdigiti:
   24|  20.3M|{
   25|  20.3M|    return ((ch >= '0') && (ch <= '9'));
  ------------------
  |  Branch (25:13): [True: 18.5M, False: 1.80M]
  |  Branch (25:28): [True: 18.4M, False: 6.62k]
  ------------------
   26|  20.3M|}
univalue_read.cpp:_ZL6hatouiPKcS0_Rj:
   31|  2.23k|{
   32|  2.23k|    unsigned int result = 0;
   33|  11.1k|    for (; first != last; ++first)
  ------------------
  |  Branch (33:12): [True: 8.93k, False: 2.22k]
  ------------------
   34|  8.93k|    {
   35|  8.93k|        int digit;
   36|  8.93k|        if (json_isdigit(*first))
  ------------------
  |  Branch (36:13): [True: 4.68k, False: 4.24k]
  ------------------
   37|  4.68k|            digit = *first - '0';
   38|       |
   39|  4.24k|        else if (*first >= 'a' && *first <= 'f')
  ------------------
  |  Branch (39:18): [True: 1.98k, False: 2.26k]
  |  Branch (39:35): [True: 1.97k, False: 2]
  ------------------
   40|  1.97k|            digit = *first - 'a' + 10;
   41|       |
   42|  2.26k|        else if (*first >= 'A' && *first <= 'F')
  ------------------
  |  Branch (42:18): [True: 2.25k, False: 12]
  |  Branch (42:35): [True: 2.24k, False: 6]
  ------------------
   43|  2.24k|            digit = *first - 'A' + 10;
   44|       |
   45|     18|        else
   46|     18|            break;
   47|       |
   48|  8.91k|        result = 16 * result + digit;
   49|  8.91k|    }
   50|  2.23k|    out = result;
   51|       |
   52|  2.23k|    return first;
   53|  2.23k|}

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

_Z22inline_assertion_checkILb0EbEOT0_S1_PKciS3_S3_:
   52|  13.1k|{
   53|  13.1k|    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|  13.1k|    ) {
   58|  13.1k|        if (!val) {
  ------------------
  |  Branch (58:13): [True: 0, False: 13.1k]
  ------------------
   59|      0|            assertion_fail(file, line, func, assertion);
   60|      0|        }
   61|  13.1k|    }
   62|  13.1k|    return std::forward<T>(val);
   63|  13.1k|}
_Z22inline_check_non_fatalIbEOT_S1_PKciS3_S3_:
   35|  1.93k|{
   36|  1.93k|    if (!val) {
  ------------------
  |  Branch (36:9): [True: 0, False: 1.93k]
  ------------------
   37|      0|        throw NonFatalCheckError{assertion, file, line, func};
   38|      0|    }
   39|  1.93k|    return std::forward<T>(val);
   40|  1.93k|}
_Z22inline_check_non_fatalIRKbEOT_S3_PKciS5_S5_:
   35|     65|{
   36|     65|    if (!val) {
  ------------------
  |  Branch (36:9): [True: 0, False: 65]
  ------------------
   37|      0|        throw NonFatalCheckError{assertion, file, line, func};
   38|      0|    }
   39|     65|    return std::forward<T>(val);
   40|     65|}
_Z22inline_assertion_checkILb1EbEOT0_S1_PKciS3_S3_:
   52|  10.4k|{
   53|  10.4k|    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.4k|    ) {
   58|  10.4k|        if (!val) {
  ------------------
  |  Branch (58:13): [True: 0, False: 10.4k]
  ------------------
   59|      0|            assertion_fail(file, line, func, assertion);
   60|      0|        }
   61|  10.4k|    }
   62|  10.4k|    return std::forward<T>(val);
   63|  10.4k|}
_Z22inline_assertion_checkILb1ERPKNSt3__18functionIFvNS0_4spanIKhLm18446744073709551615EEEEEEEOT0_SB_PKciSD_SD_:
   52|  10.4k|{
   53|  10.4k|    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.4k|    ) {
   58|  10.4k|        if (!val) {
  ------------------
  |  Branch (58:13): [True: 0, False: 10.4k]
  ------------------
   59|      0|            assertion_fail(file, line, func, assertion);
   60|      0|        }
   61|  10.4k|    }
   62|  10.4k|    return std::forward<T>(val);
   63|  10.4k|}

_ZN8BaseHashI7uint160EC2ERKS0_:
   16|    917|    explicit BaseHash(const HashType& in) : m_hash(in) {}
_ZN8BaseHashI7uint256E5beginEv:
   19|    369|    {
   20|    369|        return m_hash.begin();
   21|    369|    }
_ZNK8BaseHashI7uint160EltERKS1_:
   59|    175|    {
   60|    175|        return m_hash < other.m_hash;
   61|    175|    }
_ZNK8BaseHashI7uint160E5beginEv:
   24|    280|    {
   25|    280|        return m_hash.begin();
   26|    280|    }
_ZNK8BaseHashI7uint160E3endEv:
   34|    280|    {
   35|    280|        return m_hash.end();
   36|    280|    }
_ZNK8BaseHashI7uint256E5beginEv:
   24|    369|    {
   25|    369|        return m_hash.begin();
   26|    369|    }
_ZNK8BaseHashI7uint256E3endEv:
   34|    369|    {
   35|    369|        return m_hash.end();
   36|    369|    }
_ZN8BaseHashI7uint256EC2Ev:
   15|    369|    BaseHash() : m_hash() {}

_ZN4util6ResultIiEC2Ei:
   57|      2|    Result(T obj) : m_variant{std::in_place_index_t<1>{}, std::move(obj)} {}
_ZN4util6ResultIiEC2ENS_5ErrorE:
   58|  7.51k|    Result(Error error) : m_variant{std::in_place_index_t<0>{}, std::move(error.message)} {}
_ZN4util6ResultIiED2Ev:
   60|  7.52k|    ~Result() = default;
_ZNK4util6ResultIiEcvbEv:
   85|  15.0k|    explicit operator bool() const noexcept { return has_value(); }
_ZNK4util6ResultIiE9has_valueEv:
   64|  15.0k|    bool has_value() const noexcept { return m_variant.index() == 1; }
_ZN4util11ErrorStringIiEE13bilingual_strRKNS_6ResultIT_EE:
   94|  7.51k|{
   95|  7.51k|    return result ? bilingual_str{} : std::get<0>(result.m_variant);
  ------------------
  |  Branch (95:12): [True: 0, False: 7.51k]
  ------------------
   96|  7.51k|}
_ZNK4util6ResultIiE5valueEv:
   66|      2|    {
   67|      2|        assert(has_value());
   68|      2|        return std::get<1>(m_variant);
   69|      2|    }

_Z5IsHexNSt3__117basic_string_viewIcNS_11char_traitsIcEEEE:
   42|  56.6k|{
   43|  4.59M|    for (char c : str) {
  ------------------
  |  Branch (43:17): [True: 4.59M, False: 41.5k]
  ------------------
   44|  4.59M|        if (HexDigit(c) < 0) return false;
  ------------------
  |  Branch (44:13): [True: 15.0k, False: 4.58M]
  ------------------
   45|  4.59M|    }
   46|  41.5k|    return (str.size() > 0) && (str.size()%2 == 0);
  ------------------
  |  Branch (46:12): [True: 19.5k, False: 22.0k]
  |  Branch (46:32): [True: 19.4k, False: 141]
  ------------------
   47|  56.6k|}
_Z11TryParseHexIhENSt3__18optionalINS0_6vectorIT_NS0_9allocatorIS3_EEEEEENS0_17basic_string_viewIcNS0_11char_traitsIcEEEE:
   51|  19.4k|{
   52|  19.4k|    std::vector<Byte> vch;
   53|  19.4k|    vch.reserve(str.size() / 2); // two hex characters form a single byte
   54|       |
   55|  19.4k|    auto it = str.begin();
   56|  1.54M|    while (it != str.end()) {
  ------------------
  |  Branch (56:12): [True: 1.52M, False: 19.4k]
  ------------------
   57|  1.52M|        if (IsSpace(*it)) {
  ------------------
  |  Branch (57:13): [True: 0, False: 1.52M]
  ------------------
   58|      0|            ++it;
   59|      0|            continue;
   60|      0|        }
   61|  1.52M|        auto c1 = HexDigit(*(it++));
   62|  1.52M|        if (it == str.end()) return std::nullopt;
  ------------------
  |  Branch (62:13): [True: 0, False: 1.52M]
  ------------------
   63|  1.52M|        auto c2 = HexDigit(*(it++));
   64|  1.52M|        if (c1 < 0 || c2 < 0) return std::nullopt;
  ------------------
  |  Branch (64:13): [True: 0, False: 1.52M]
  |  Branch (64:23): [True: 0, False: 1.52M]
  ------------------
   65|  1.52M|        vch.push_back(Byte(c1 << 4) | Byte(c2));
   66|  1.52M|    }
   67|  19.4k|    return vch;
   68|  19.4k|}
_Z11ParseUInt32NSt3__117basic_string_viewIcNS_11char_traitsIcEEEEPj:
  245|  32.7k|{
  246|  32.7k|    return ParseIntegral<uint32_t>(str, out);
  247|  32.7k|}
_Z15ParseFixedPointNSt3__117basic_string_viewIcNS_11char_traitsIcEEEEiPl:
  324|  8.86k|{
  325|  8.86k|    int64_t mantissa = 0;
  326|  8.86k|    int64_t exponent = 0;
  327|  8.86k|    int mantissa_tzeros = 0;
  328|  8.86k|    bool mantissa_sign = false;
  329|  8.86k|    bool exponent_sign = false;
  330|  8.86k|    int ptr = 0;
  331|  8.86k|    int end = val.size();
  332|  8.86k|    int point_ofs = 0;
  333|       |
  334|  8.86k|    if (ptr < end && val[ptr] == '-') {
  ------------------
  |  Branch (334:9): [True: 8.86k, False: 1]
  |  Branch (334:22): [True: 349, False: 8.51k]
  ------------------
  335|    349|        mantissa_sign = true;
  336|    349|        ++ptr;
  337|    349|    }
  338|  8.86k|    if (ptr < end)
  ------------------
  |  Branch (338:9): [True: 8.86k, False: 2]
  ------------------
  339|  8.86k|    {
  340|  8.86k|        if (val[ptr] == '0') {
  ------------------
  |  Branch (340:13): [True: 142, False: 8.72k]
  ------------------
  341|       |            /* pass single 0 */
  342|    142|            ++ptr;
  343|  8.72k|        } else if (val[ptr] >= '1' && val[ptr] <= '9') {
  ------------------
  |  Branch (343:20): [True: 8.64k, False: 77]
  |  Branch (343:39): [True: 1.34k, False: 7.29k]
  ------------------
  344|  9.56M|            while (ptr < end && IsDigit(val[ptr])) {
  ------------------
  |  Branch (344:20): [True: 9.56M, False: 595]
  |  Branch (344:33): [True: 9.56M, False: 556]
  ------------------
  345|  9.56M|                if (!ProcessMantissaDigit(val[ptr], mantissa, mantissa_tzeros))
  ------------------
  |  Branch (345:21): [True: 196, False: 9.55M]
  ------------------
  346|    196|                    return false; /* overflow */
  347|  9.55M|                ++ptr;
  348|  9.55M|            }
  349|  7.37k|        } else return false; /* missing expected digit */
  350|  8.86k|    } else return false; /* empty string or loose '-' */
  351|  1.29k|    if (ptr < end && val[ptr] == '.')
  ------------------
  |  Branch (351:9): [True: 695, False: 598]
  |  Branch (351:22): [True: 291, False: 404]
  ------------------
  352|    291|    {
  353|    291|        ++ptr;
  354|    291|        if (ptr < end && IsDigit(val[ptr]))
  ------------------
  |  Branch (354:13): [True: 290, False: 1]
  |  Branch (354:26): [True: 278, False: 12]
  ------------------
  355|    278|        {
  356|  5.64M|            while (ptr < end && IsDigit(val[ptr])) {
  ------------------
  |  Branch (356:20): [True: 5.64M, False: 189]
  |  Branch (356:33): [True: 5.64M, False: 29]
  ------------------
  357|  5.64M|                if (!ProcessMantissaDigit(val[ptr], mantissa, mantissa_tzeros))
  ------------------
  |  Branch (357:21): [True: 60, False: 5.64M]
  ------------------
  358|     60|                    return false; /* overflow */
  359|  5.64M|                ++ptr;
  360|  5.64M|                ++point_ofs;
  361|  5.64M|            }
  362|    278|        } else return false; /* missing expected digit */
  363|    291|    }
  364|  1.22k|    if (ptr < end && (val[ptr] == 'e' || val[ptr] == 'E'))
  ------------------
  |  Branch (364:9): [True: 433, False: 787]
  |  Branch (364:23): [True: 158, False: 275]
  |  Branch (364:42): [True: 209, False: 66]
  ------------------
  365|    367|    {
  366|    367|        ++ptr;
  367|    367|        if (ptr < end && val[ptr] == '+')
  ------------------
  |  Branch (367:13): [True: 364, False: 3]
  |  Branch (367:26): [True: 1, False: 363]
  ------------------
  368|      1|            ++ptr;
  369|    366|        else if (ptr < end && val[ptr] == '-') {
  ------------------
  |  Branch (369:18): [True: 363, False: 3]
  |  Branch (369:31): [True: 91, False: 272]
  ------------------
  370|     91|            exponent_sign = true;
  371|     91|            ++ptr;
  372|     91|        }
  373|    367|        if (ptr < end && IsDigit(val[ptr])) {
  ------------------
  |  Branch (373:13): [True: 364, False: 3]
  |  Branch (373:26): [True: 349, False: 15]
  ------------------
  374|  29.8k|            while (ptr < end && IsDigit(val[ptr])) {
  ------------------
  |  Branch (374:20): [True: 29.5k, False: 303]
  |  Branch (374:33): [True: 29.4k, False: 24]
  ------------------
  375|  29.4k|                if (exponent > (UPPER_BOUND / 10LL))
  ------------------
  |  Branch (375:21): [True: 22, False: 29.4k]
  ------------------
  376|     22|                    return false; /* overflow */
  377|  29.4k|                exponent = exponent * 10 + val[ptr] - '0';
  378|  29.4k|                ++ptr;
  379|  29.4k|            }
  380|    349|        } else return false; /* missing expected digit */
  381|    367|    }
  382|  1.18k|    if (ptr != end)
  ------------------
  |  Branch (382:9): [True: 90, False: 1.09k]
  ------------------
  383|     90|        return false; /* trailing garbage */
  384|       |
  385|       |    /* finalize exponent */
  386|  1.09k|    if (exponent_sign)
  ------------------
  |  Branch (386:9): [True: 86, False: 1.00k]
  ------------------
  387|     86|        exponent = -exponent;
  388|  1.09k|    exponent = exponent - point_ofs + mantissa_tzeros;
  389|       |
  390|       |    /* finalize mantissa */
  391|  1.09k|    if (mantissa_sign)
  ------------------
  |  Branch (391:9): [True: 274, False: 816]
  ------------------
  392|    274|        mantissa = -mantissa;
  393|       |
  394|       |    /* convert to one 64-bit fixed-point value */
  395|  1.09k|    exponent += decimals;
  396|  1.09k|    if (exponent < 0)
  ------------------
  |  Branch (396:9): [True: 105, False: 985]
  ------------------
  397|    105|        return false; /* cannot represent values smaller than 10^-decimals */
  398|    985|    if (exponent >= 18)
  ------------------
  |  Branch (398:9): [True: 128, False: 857]
  ------------------
  399|    128|        return false; /* cannot represent values larger than or equal to 10^(18-decimals) */
  400|       |
  401|  5.71k|    for (int i=0; i < exponent; ++i) {
  ------------------
  |  Branch (401:19): [True: 5.16k, False: 550]
  ------------------
  402|  5.16k|        if (mantissa > (UPPER_BOUND / 10LL) || mantissa < -(UPPER_BOUND / 10LL))
  ------------------
  |  Branch (402:13): [True: 190, False: 4.97k]
  |  Branch (402:48): [True: 117, False: 4.85k]
  ------------------
  403|    307|            return false; /* overflow */
  404|  4.85k|        mantissa *= 10;
  405|  4.85k|    }
  406|    550|    if (mantissa > UPPER_BOUND || mantissa < -UPPER_BOUND)
  ------------------
  |  Branch (406:9): [True: 0, False: 550]
  |  Branch (406:35): [True: 0, False: 550]
  ------------------
  407|      0|        return false; /* overflow */
  408|       |
  409|    550|    if (amount_out)
  ------------------
  |  Branch (409:9): [True: 550, False: 0]
  ------------------
  410|    550|        *amount_out = mantissa;
  411|       |
  412|    550|    return true;
  413|    550|}
_Z7ToLowerNSt3__117basic_string_viewIcNS_11char_traitsIcEEEE:
  416|    417|{
  417|    417|    std::string r;
  418|    417|    r.reserve(str.size());
  419|  1.62k|    for (auto ch : str) r += ToLower(ch);
  ------------------
  |  Branch (419:18): [True: 1.62k, False: 417]
  ------------------
  420|    417|    return r;
  421|    417|}
strencodings.cpp:_ZL20ProcessMantissaDigitcRlRi:
  308|  15.2M|{
  309|  15.2M|    if(ch == '0')
  ------------------
  |  Branch (309:8): [True: 15.1M, False: 11.9k]
  ------------------
  310|  15.1M|        ++mantissa_tzeros;
  311|  11.9k|    else {
  312|  2.25M|        for (int i=0; i<=mantissa_tzeros; ++i) {
  ------------------
  |  Branch (312:23): [True: 2.24M, False: 11.6k]
  ------------------
  313|  2.24M|            if (mantissa > (UPPER_BOUND / 10LL))
  ------------------
  |  Branch (313:17): [True: 256, False: 2.24M]
  ------------------
  314|    256|                return false; /* overflow */
  315|  2.24M|            mantissa *= 10;
  316|  2.24M|        }
  317|  11.6k|        mantissa += ch - '0';
  318|  11.6k|        mantissa_tzeros = 0;
  319|  11.6k|    }
  320|  15.2M|    return true;
  321|  15.2M|}
strencodings.cpp:_ZN12_GLOBAL__N_113ParseIntegralIjEEbNSt3__117basic_string_viewIcNS1_11char_traitsIcEEEEPT_:
  206|  32.7k|{
  207|  32.7k|    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|  32.7k|    if (str.length() >= 2 && str[0] == '+' && str[1] == '-') {
  ------------------
  |  Branch (210:9): [True: 9.94k, False: 22.8k]
  |  Branch (210:30): [True: 738, False: 9.21k]
  |  Branch (210:47): [True: 1, False: 737]
  ------------------
  211|      1|        return false;
  212|      1|    }
  213|  32.7k|    const std::optional<T> opt_int = ToIntegral<T>((!str.empty() && str[0] == '+') ? str.substr(1) : str);
  ------------------
  |  Branch (213:53): [True: 32.7k, False: 30]
  |  Branch (213:69): [True: 742, False: 31.9k]
  ------------------
  214|  32.7k|    if (!opt_int) {
  ------------------
  |  Branch (214:9): [True: 181, False: 32.5k]
  ------------------
  215|    181|        return false;
  216|    181|    }
  217|  32.5k|    if (out != nullptr) {
  ------------------
  |  Branch (217:9): [True: 32.5k, False: 0]
  ------------------
  218|  32.5k|        *out = *opt_int;
  219|  32.5k|    }
  220|  32.5k|    return true;
  221|  32.7k|}

_Z7IsDigitc:
  151|  15.2M|{
  152|  15.2M|    return c >= '0' && c <= '9';
  ------------------
  |  Branch (152:12): [True: 15.2M, False: 294]
  |  Branch (152:24): [True: 15.2M, False: 342]
  ------------------
  153|  15.2M|}
_Z7IsSpacec:
  166|  1.53M|constexpr inline bool IsSpace(char c) noexcept {
  167|  1.53M|    return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v';
  ------------------
  |  Branch (167:12): [True: 1.15k, False: 1.52M]
  |  Branch (167:24): [True: 0, False: 1.52M]
  |  Branch (167:37): [True: 0, False: 1.52M]
  |  Branch (167:50): [True: 0, False: 1.52M]
  |  Branch (167:63): [True: 0, False: 1.52M]
  |  Branch (167:76): [True: 0, False: 1.52M]
  ------------------
  168|  1.53M|}
_Z7ToLowerc:
  305|  1.62k|{
  306|  1.62k|    return (c >= 'A' && c <= 'Z' ? (c - 'A') + 'a' : c);
  ------------------
  |  Branch (306:13): [True: 1.51k, False: 105]
  |  Branch (306:25): [True: 218, False: 1.30k]
  ------------------
  307|  1.62k|}
_Z8ParseHexIhENSt3__16vectorIT_NS0_9allocatorIS2_EEEENS0_17basic_string_viewIcNS0_11char_traitsIcEEEE:
   69|  19.4k|{
   70|  19.4k|    return TryParseHex<Byte>(hex_str).value_or(std::vector<Byte>{});
   71|  19.4k|}
_Z10ToIntegralIlENSt3__18optionalIT_EENS0_17basic_string_viewIcNS0_11char_traitsIcEEEE:
  180|  15.4k|{
  181|  15.4k|    static_assert(std::is_integral<T>::value);
  182|  15.4k|    T result;
  183|  15.4k|    const auto [first_nonmatching, error_condition] = std::from_chars(str.data(), str.data() + str.size(), result);
  184|  15.4k|    if (first_nonmatching != str.data() + str.size() || error_condition != std::errc{}) {
  ------------------
  |  Branch (184:9): [True: 108, False: 15.3k]
  |  Branch (184:57): [True: 123, False: 15.2k]
  ------------------
  185|    231|        return std::nullopt;
  186|    231|    }
  187|  15.2k|    return result;
  188|  15.4k|}
_Z10ToIntegralIjENSt3__18optionalIT_EENS0_17basic_string_viewIcNS0_11char_traitsIcEEEE:
  180|  32.7k|{
  181|  32.7k|    static_assert(std::is_integral<T>::value);
  182|  32.7k|    T result;
  183|  32.7k|    const auto [first_nonmatching, error_condition] = std::from_chars(str.data(), str.data() + str.size(), result);
  184|  32.7k|    if (first_nonmatching != str.data() + str.size() || error_condition != std::errc{}) {
  ------------------
  |  Branch (184:9): [True: 144, False: 32.6k]
  |  Branch (184:57): [True: 37, False: 32.5k]
  ------------------
  185|    181|        return std::nullopt;
  186|    181|    }
  187|  32.5k|    return result;
  188|  32.7k|}

_ZN4util14TrimStringViewENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEES4_:
  147|     30|{
  148|     30|    std::string::size_type front = str.find_first_not_of(pattern);
  149|     30|    if (front == std::string::npos) {
  ------------------
  |  Branch (149:9): [True: 0, False: 30]
  ------------------
  150|      0|        return {};
  151|      0|    }
  152|     30|    std::string::size_type end = str.find_last_not_of(pattern);
  153|     30|    return str.substr(front, end - front + 1);
  154|     30|}
_ZN4util16RemovePrefixViewENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEES4_:
  170|     30|{
  171|     30|    if (str.substr(0, prefix.size()) == prefix) {
  ------------------
  |  Branch (171:9): [True: 0, False: 30]
  ------------------
  172|      0|        return str.substr(prefix.size());
  173|      0|    }
  174|     30|    return str;
  175|     30|}
_ZN4util13ContainsNoNULENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
  222|    890|{
  223|   368k|    for (auto c : str) {
  ------------------
  |  Branch (223:17): [True: 368k, False: 890]
  ------------------
  224|   368k|        if (c == 0) return false;
  ------------------
  |  Branch (224:13): [True: 0, False: 368k]
  ------------------
  225|   368k|    }
  226|    890|    return true;
  227|    890|}
_ZN4util8ToStringIjEENSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEERKT_:
  234|  2.06k|{
  235|  2.06k|    std::ostringstream oss;
  236|  2.06k|    oss.imbue(std::locale::classic());
  237|  2.06k|    oss << t;
  238|  2.06k|    return oss.str();
  239|  2.06k|}
_ZN4util5SplitI4SpanIKcEEENSt3__16vectorIT_NS4_9allocatorIS6_EEEERKS3_c:
  132|  44.3k|{
  133|  44.3k|    return Split<T>(sp, std::string_view{&sep, 1});
  134|  44.3k|}
_ZN4util5SplitI4SpanIKcEEENSt3__16vectorIT_NS4_9allocatorIS6_EEEERKS3_NS4_17basic_string_viewIcNS4_11char_traitsIcEEEE:
  108|  44.3k|{
  109|  44.3k|    std::vector<T> ret;
  110|  44.3k|    auto it = sp.begin();
  111|  44.3k|    auto start = it;
  112|  7.08M|    while (it != sp.end()) {
  ------------------
  |  Branch (112:12): [True: 7.03M, False: 44.3k]
  ------------------
  113|  7.03M|        if (separators.find(*it) != std::string::npos) {
  ------------------
  |  Branch (113:13): [True: 40.5k, False: 6.99M]
  ------------------
  114|  40.5k|            ret.emplace_back(start, it);
  115|  40.5k|            start = it + 1;
  116|  40.5k|        }
  117|  7.03M|        ++it;
  118|  7.03M|    }
  119|  44.3k|    ret.emplace_back(start, it);
  120|  44.3k|    return ret;
  121|  44.3k|}

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

_Z12UntranslatedNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
   82|  7.51k|inline bilingual_str Untranslated(std::string original) { return {original, original}; }

_Z6VectorIJN10miniscript8internal6MaxIntIjEEEENSt3__16vectorINS4_11common_typeIJDpT_EE4typeENS4_9allocatorISA_EEEEDpOS7_:
   24|   138k|{
   25|   138k|    std::vector<typename std::common_type<Args...>::type> ret;
   26|   138k|    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|   138k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|   138k|    return ret;
   30|   138k|}
_Z6VectorIJN10miniscript8internal7SatInfoEEENSt3__16vectorINS3_11common_typeIJDpT_EE4typeENS3_9allocatorIS9_EEEEDpOS6_:
   24|  69.4k|{
   25|  69.4k|    std::vector<typename std::common_type<Args...>::type> ret;
   26|  69.4k|    ret.reserve(sizeof...(args));
   27|       |    // The line below uses the trick from https://www.experts-exchange.com/articles/32502/None-recursive-variadic-templates-with-std-initializer-list.html
   28|  69.4k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  69.4k|    return ret;
   30|  69.4k|}
descriptor.cpp:_Z6VectorIJNSt3__110unique_ptrIN12_GLOBAL__N_114PubkeyProviderENS0_14default_deleteIS3_EEEEEENS0_6vectorINS0_11common_typeIJDpT_EE4typeENS0_9allocatorISC_EEEEDpOS9_:
   24|  3.45k|{
   25|  3.45k|    std::vector<typename std::common_type<Args...>::type> ret;
   26|  3.45k|    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|  3.45k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  3.45k|    return ret;
   30|  3.45k|}
_Z6VectorIJ7CScriptEENSt3__16vectorINS1_11common_typeIJDpT_EE4typeENS1_9allocatorIS7_EEEEDpOS4_:
   24|  3.04k|{
   25|  3.04k|    std::vector<typename std::common_type<Args...>::type> ret;
   26|  3.04k|    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|  3.04k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  3.04k|    return ret;
   30|  3.04k|}
descriptor.cpp:_Z6VectorIJNSt3__110unique_ptrIN12_GLOBAL__N_114DescriptorImplENS0_14default_deleteIS3_EEEEEENS0_6vectorINS0_11common_typeIJDpT_EE4typeENS0_9allocatorISC_EEEEDpOS9_:
   24|    639|{
   25|    639|    std::vector<typename std::common_type<Args...>::type> ret;
   26|    639|    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|    639|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|    639|    return ret;
   30|    639|}
_Z6VectorIJRK7CScriptEENSt3__16vectorINS3_11common_typeIJDpT_EE4typeENS3_9allocatorIS9_EEEEDpOS6_:
   24|     18|{
   25|     18|    std::vector<typename std::common_type<Args...>::type> ret;
   26|     18|    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|     18|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|     18|    return ret;
   30|     18|}
_Z6VectorIJNSt3__110unique_ptrIKN10miniscript4NodeIjEENS0_14default_deleteIS5_EEEEEENS0_6vectorINS0_11common_typeIJDpT_EE4typeENS0_9allocatorISE_EEEEDpOSB_:
   24|   359k|{
   25|   359k|    std::vector<typename std::common_type<Args...>::type> ret;
   26|   359k|    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|   359k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|   359k|    return ret;
   30|   359k|}
_Z6VectorIJjEENSt3__16vectorINS0_11common_typeIJDpT_EE4typeENS0_9allocatorIS6_EEEEDpOS3_:
   24|  1.56k|{
   25|  1.56k|    std::vector<typename std::common_type<Args...>::type> ret;
   26|  1.56k|    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.56k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  1.56k|    return ret;
   30|  1.56k|}
_Z6VectorIJNSt3__110unique_ptrIKN10miniscript4NodeIjEENS0_14default_deleteIS5_EEEES8_EENS0_6vectorINS0_11common_typeIJDpT_EE4typeENS0_9allocatorISE_EEEEDpOSB_:
   24|   821k|{
   25|   821k|    std::vector<typename std::common_type<Args...>::type> ret;
   26|   821k|    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|   821k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|   821k|    return ret;
   30|   821k|}
_Z6VectorIJNSt3__110unique_ptrIKN10miniscript4NodeIjEENS0_14default_deleteIS5_EEEES8_S8_EENS0_6vectorINS0_11common_typeIJDpT_EE4typeENS0_9allocatorISE_EEEEDpOSB_:
   24|  3.99k|{
   25|  3.99k|    std::vector<typename std::common_type<Args...>::type> ret;
   26|  3.99k|    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|  3.99k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  3.99k|    return ret;
   30|  3.99k|}

