_ZN10ScriptHashC2ERK7CScript:
   20|  1.97k|ScriptHash::ScriptHash(const CScript& in) : BaseHash(Hash160(in)) {}
_ZN6PKHashC2ERK7CPubKey:
   23|  5.91k|PKHash::PKHash(const CPubKey& pubkey) : BaseHash(pubkey.GetID()) {}
_ZN16WitnessV0KeyHashC2ERK6PKHash:
   27|  1.97k|WitnessV0KeyHash::WitnessV0KeyHash(const PKHash& pubkey_hash) : BaseHash{pubkey_hash} {}
_Z7ToKeyIDRK6PKHash:
   30|  3.94k|{
   31|  3.94k|    return CKeyID{uint160{key_hash}};
   32|  3.94k|}
_Z23GetScriptForDestinationRKNSt3__17variantIJ14CNoDestination17PubKeyDestination6PKHash10ScriptHash19WitnessV0ScriptHash16WitnessV0KeyHash16WitnessV1Taproot11PayToAnchor14WitnessUnknownEEE:
  167|  7.88k|{
  168|  7.88k|    return std::visit(CScriptVisitor(), dest);
  169|  7.88k|}
_Z18IsValidDestinationRKNSt3__17variantIJ14CNoDestination17PubKeyDestination6PKHash10ScriptHash19WitnessV0ScriptHash16WitnessV0KeyHash16WitnessV1Taproot11PayToAnchor14WitnessUnknownEEE:
  171|  3.94k|bool IsValidDestination(const CTxDestination& dest) {
  172|  3.94k|    return std::visit(ValidDestinationVisitor(), dest);
  173|  3.94k|}
addresstype.cpp:_ZNK12_GLOBAL__N_114CScriptVisitorclERK6PKHash:
  122|  1.97k|    {
  123|  1.97k|        return CScript() << OP_DUP << OP_HASH160 << ToByteVector(keyID) << OP_EQUALVERIFY << OP_CHECKSIG;
  124|  1.97k|    }
addresstype.cpp:_ZNK12_GLOBAL__N_114CScriptVisitorclERK16WitnessV0KeyHash:
  132|  5.91k|    {
  133|  5.91k|        return CScript() << OP_0 << ToByteVector(id);
  134|  5.91k|    }
addresstype.cpp:_ZNK12_GLOBAL__N_123ValidDestinationVisitorclERK6PKHash:
  157|  3.94k|    bool operator()(const PKHash& dest) const { return true; }

_ZN6PKHashC2ERK7uint160:
   50|  3.94k|    explicit PKHash(const uint160& hash) : BaseHash(hash) {}
_ZN16WitnessV0KeyHashC2ERK7uint160:
   82|  3.94k|    explicit WitnessV0KeyHash(const uint160& hash) : BaseHash(hash) {}

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

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

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

_Z16htobe32_internalj:
   34|   524k|{
   35|   524k|    if constexpr (std::endian::native == std::endian::little) return internal_bswap_32(host_32bits);
   36|       |        else return host_32bits;
   37|   524k|}
_Z16htole32_internalj:
   39|   189k|{
   40|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_32(host_32bits);
   41|   189k|        else return host_32bits;
   42|   189k|}
_Z16be32toh_internalj:
   44|  1.04M|{
   45|  1.04M|    if constexpr (std::endian::native == std::endian::little) return internal_bswap_32(big_endian_32bits);
   46|       |        else return big_endian_32bits;
   47|  1.04M|}
_Z16le32toh_internalj:
   49|   489k|{
   50|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_32(little_endian_32bits);
   51|   489k|        else return little_endian_32bits;
   52|   489k|}
_Z16htobe64_internalm:
   54|   171k|{
   55|   171k|    if constexpr (std::endian::native == std::endian::little) return internal_bswap_64(host_64bits);
   56|       |        else return host_64bits;
   57|   171k|}
_Z16htole64_internalm:
   59|  29.5k|{
   60|       |    if constexpr (std::endian::native == std::endian::big) return internal_bswap_64(host_64bits);
   61|  29.5k|        else return host_64bits;
   62|  29.5k|}
_Z16be64toh_internalm:
   64|   315k|{
   65|   315k|    if constexpr (std::endian::native == std::endian::little) return internal_bswap_64(big_endian_64bits);
   66|       |        else return big_endian_64bits;
   67|   315k|}

_ZN15ChaCha20Aligned6SetKeyE4SpanIKSt4byteE:
   26|  2.02k|{
   27|  2.02k|    assert(key.size() == KEYLEN);
   28|  2.02k|    input[0] = ReadLE32(key.data() + 0);
   29|  2.02k|    input[1] = ReadLE32(key.data() + 4);
   30|  2.02k|    input[2] = ReadLE32(key.data() + 8);
   31|  2.02k|    input[3] = ReadLE32(key.data() + 12);
   32|  2.02k|    input[4] = ReadLE32(key.data() + 16);
   33|  2.02k|    input[5] = ReadLE32(key.data() + 20);
   34|  2.02k|    input[6] = ReadLE32(key.data() + 24);
   35|  2.02k|    input[7] = ReadLE32(key.data() + 28);
   36|  2.02k|    input[8] = 0;
   37|  2.02k|    input[9] = 0;
   38|  2.02k|    input[10] = 0;
   39|  2.02k|    input[11] = 0;
   40|  2.02k|}
_ZN15ChaCha20AlignedD2Ev:
   43|  2.02k|{
   44|  2.02k|    memory_cleanse(input, sizeof(input));
   45|  2.02k|}
_ZN15ChaCha20AlignedC2E4SpanIKSt4byteE:
   48|  2.02k|{
   49|  2.02k|    SetKey(key);
   50|  2.02k|}
_ZN8ChaCha209KeystreamE4SpanISt4byteE:
  283|  3.94k|{
  284|  3.94k|    if (out.empty()) return;
  ------------------
  |  Branch (284:9): [True: 0, False: 3.94k]
  ------------------
  285|  3.94k|    if (m_bufleft) {
  ------------------
  |  Branch (285:9): [True: 1.97k, False: 1.97k]
  ------------------
  286|  1.97k|        unsigned reuse = std::min<size_t>(m_bufleft, out.size());
  287|  1.97k|        std::copy(m_buffer.end() - m_bufleft, m_buffer.end() - m_bufleft + reuse, out.begin());
  288|  1.97k|        m_bufleft -= reuse;
  289|  1.97k|        out = out.subspan(reuse);
  290|  1.97k|    }
  291|  3.94k|    if (out.size() >= m_aligned.BLOCKLEN) {
  ------------------
  |  Branch (291:9): [True: 0, False: 3.94k]
  ------------------
  292|      0|        size_t blocks = out.size() / m_aligned.BLOCKLEN;
  293|      0|        m_aligned.Keystream(out.first(blocks * m_aligned.BLOCKLEN));
  294|      0|        out = out.subspan(blocks * m_aligned.BLOCKLEN);
  295|      0|    }
  296|  3.94k|    if (!out.empty()) {
  ------------------
  |  Branch (296:9): [True: 1.97k, False: 1.97k]
  ------------------
  297|  1.97k|        m_aligned.Keystream(m_buffer);
  298|  1.97k|        std::copy(m_buffer.begin(), m_buffer.begin() + out.size(), out.begin());
  299|  1.97k|        m_bufleft = m_aligned.BLOCKLEN - out.size();
  300|  1.97k|    }
  301|  3.94k|}
_ZN8ChaCha20D2Ev:
  333|  2.02k|{
  334|  2.02k|    memory_cleanse(m_buffer.data(), m_buffer.size());
  335|  2.02k|}
_ZN15ChaCha20Aligned9KeystreamE4SpanISt4byteE:
   61|  1.97k|{
   62|  1.97k|    std::byte* c = output.data();
   63|  1.97k|    size_t blocks = output.size() / BLOCKLEN;
   64|  1.97k|    assert(blocks * BLOCKLEN == output.size());
   65|       |
   66|  1.97k|    uint32_t x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15;
   67|  1.97k|    uint32_t j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14, j15;
   68|       |
   69|  1.97k|    if (!blocks) return;
  ------------------
  |  Branch (69:9): [True: 0, False: 1.97k]
  ------------------
   70|       |
   71|  1.97k|    j4 = input[0];
   72|  1.97k|    j5 = input[1];
   73|  1.97k|    j6 = input[2];
   74|  1.97k|    j7 = input[3];
   75|  1.97k|    j8 = input[4];
   76|  1.97k|    j9 = input[5];
   77|  1.97k|    j10 = input[6];
   78|  1.97k|    j11 = input[7];
   79|  1.97k|    j12 = input[8];
   80|  1.97k|    j13 = input[9];
   81|  1.97k|    j14 = input[10];
   82|  1.97k|    j15 = input[11];
   83|       |
   84|  1.97k|    for (;;) {
   85|  1.97k|        x0 = 0x61707865;
   86|  1.97k|        x1 = 0x3320646e;
   87|  1.97k|        x2 = 0x79622d32;
   88|  1.97k|        x3 = 0x6b206574;
   89|  1.97k|        x4 = j4;
   90|  1.97k|        x5 = j5;
   91|  1.97k|        x6 = j6;
   92|  1.97k|        x7 = j7;
   93|  1.97k|        x8 = j8;
   94|  1.97k|        x9 = j9;
   95|  1.97k|        x10 = j10;
   96|  1.97k|        x11 = j11;
   97|  1.97k|        x12 = j12;
   98|  1.97k|        x13 = j13;
   99|  1.97k|        x14 = j14;
  100|  1.97k|        x15 = j15;
  101|       |
  102|       |        // The 20 inner ChaCha20 rounds are unrolled here for performance.
  103|  1.97k|        REPEAT10(
  ------------------
  |  |   23|  1.97k|#define REPEAT10(a) do { {a}; {a}; {a}; {a}; {a}; {a}; {a}; {a}; {a}; {a}; } while(0)
  |  |  ------------------
  |  |  |  Branch (23:84): [Folded - Ignored]
  |  |  ------------------
  ------------------
  104|  1.97k|            QUARTERROUND( x0, x4, x8,x12);
  105|  1.97k|            QUARTERROUND( x1, x5, x9,x13);
  106|  1.97k|            QUARTERROUND( x2, x6,x10,x14);
  107|  1.97k|            QUARTERROUND( x3, x7,x11,x15);
  108|  1.97k|            QUARTERROUND( x0, x5,x10,x15);
  109|  1.97k|            QUARTERROUND( x1, x6,x11,x12);
  110|  1.97k|            QUARTERROUND( x2, x7, x8,x13);
  111|  1.97k|            QUARTERROUND( x3, x4, x9,x14);
  112|  1.97k|        );
  113|       |
  114|  1.97k|        x0 += 0x61707865;
  115|  1.97k|        x1 += 0x3320646e;
  116|  1.97k|        x2 += 0x79622d32;
  117|  1.97k|        x3 += 0x6b206574;
  118|  1.97k|        x4 += j4;
  119|  1.97k|        x5 += j5;
  120|  1.97k|        x6 += j6;
  121|  1.97k|        x7 += j7;
  122|  1.97k|        x8 += j8;
  123|  1.97k|        x9 += j9;
  124|  1.97k|        x10 += j10;
  125|  1.97k|        x11 += j11;
  126|  1.97k|        x12 += j12;
  127|  1.97k|        x13 += j13;
  128|  1.97k|        x14 += j14;
  129|  1.97k|        x15 += j15;
  130|       |
  131|  1.97k|        ++j12;
  132|  1.97k|        if (!j12) ++j13;
  ------------------
  |  Branch (132:13): [True: 0, False: 1.97k]
  ------------------
  133|       |
  134|  1.97k|        WriteLE32(c + 0, x0);
  135|  1.97k|        WriteLE32(c + 4, x1);
  136|  1.97k|        WriteLE32(c + 8, x2);
  137|  1.97k|        WriteLE32(c + 12, x3);
  138|  1.97k|        WriteLE32(c + 16, x4);
  139|  1.97k|        WriteLE32(c + 20, x5);
  140|  1.97k|        WriteLE32(c + 24, x6);
  141|  1.97k|        WriteLE32(c + 28, x7);
  142|  1.97k|        WriteLE32(c + 32, x8);
  143|  1.97k|        WriteLE32(c + 36, x9);
  144|  1.97k|        WriteLE32(c + 40, x10);
  145|  1.97k|        WriteLE32(c + 44, x11);
  146|  1.97k|        WriteLE32(c + 48, x12);
  147|  1.97k|        WriteLE32(c + 52, x13);
  148|  1.97k|        WriteLE32(c + 56, x14);
  149|  1.97k|        WriteLE32(c + 60, x15);
  150|       |
  151|  1.97k|        if (blocks == 1) {
  ------------------
  |  Branch (151:13): [True: 1.97k, False: 0]
  ------------------
  152|  1.97k|            input[8] = j12;
  153|  1.97k|            input[9] = j13;
  154|  1.97k|            return;
  155|  1.97k|        }
  156|      0|        blocks -= 1;
  157|      0|        c += BLOCKLEN;
  158|      0|    }
  159|  1.97k|}

_ZN8ChaCha20C2E4SpanIKSt4byteE:
   92|  2.02k|    ChaCha20(Span<const std::byte> key) noexcept : m_aligned(key) {}

_Z9WriteLE32ITk8ByteTypehEvPT_j:
   51|   158k|{
   52|   158k|    uint32_t v = htole32_internal(x);
   53|   158k|    memcpy(ptr, &v, 4);
   54|   158k|}
_Z9WriteLE32ITk8ByteTypeSt4byteEvPT_j:
   51|  31.5k|{
   52|  31.5k|    uint32_t v = htole32_internal(x);
   53|  31.5k|    memcpy(ptr, &v, 4);
   54|  31.5k|}
_Z8ReadLE32ITk8ByteTypehEjPKT_:
   28|   473k|{
   29|   473k|    uint32_t x;
   30|   473k|    memcpy(&x, ptr, 4);
   31|   473k|    return le32toh_internal(x);
   32|   473k|}
_Z9WriteLE64ITk8ByteTypehEvPT_m:
   58|  29.5k|{
   59|  29.5k|    uint64_t v = htole64_internal(x);
   60|  29.5k|    memcpy(ptr, &v, 8);
   61|  29.5k|}
_Z9WriteBE32ITk8ByteTypehEvPT_j:
   96|   524k|{
   97|   524k|    uint32_t v = htobe32_internal(x);
   98|   524k|    memcpy(ptr, &v, 4);
   99|   524k|}
_Z8ReadBE32ITk8ByteTypehEjPKT_:
   73|  1.04M|{
   74|  1.04M|    uint32_t x;
   75|  1.04M|    memcpy(&x, ptr, 4);
   76|  1.04M|    return be32toh_internal(x);
   77|  1.04M|}
_Z9WriteBE64ITk8ByteTypehEvPT_m:
  103|   171k|{
  104|   171k|    uint64_t v = htobe64_internal(x);
  105|   171k|    memcpy(ptr, &v, 8);
  106|   171k|}
_Z8ReadBE64ITk8ByteTypehEmPKT_:
   81|   315k|{
   82|   315k|    uint64_t x;
   83|   315k|    memcpy(&x, ptr, 8);
   84|   315k|    return be64toh_internal(x);
   85|   315k|}
_Z8ReadLE32ITk8ByteTypeSt4byteEjPKT_:
   28|  16.2k|{
   29|  16.2k|    uint32_t x;
   30|  16.2k|    memcpy(&x, ptr, 4);
   31|  16.2k|    return le32toh_internal(x);
   32|  16.2k|}

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

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

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

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

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

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

_ZN8CHash2568FinalizeE4SpanIhE:
   30|  17.7k|    void Finalize(Span<unsigned char> output) {
   31|  17.7k|        assert(output.size() == OUTPUT_SIZE);
   32|  17.7k|        unsigned char buf[CSHA256::OUTPUT_SIZE];
   33|  17.7k|        sha.Finalize(buf);
   34|  17.7k|        sha.Reset().Write(buf, CSHA256::OUTPUT_SIZE).Finalize(output.data());
   35|  17.7k|    }
_ZN8CHash2565WriteE4SpanIKhE:
   37|  21.6k|    CHash256& Write(Span<const unsigned char> input) {
   38|  21.6k|        sha.Write(input.data(), input.size());
   39|  21.6k|        return *this;
   40|  21.6k|    }
_ZN8CHash1608FinalizeE4SpanIhE:
   55|  29.5k|    void Finalize(Span<unsigned char> output) {
   56|  29.5k|        assert(output.size() == OUTPUT_SIZE);
   57|  29.5k|        unsigned char buf[CSHA256::OUTPUT_SIZE];
   58|  29.5k|        sha.Finalize(buf);
   59|  29.5k|        CRIPEMD160().Write(buf, CSHA256::OUTPUT_SIZE).Finalize(output.data());
   60|  29.5k|    }
_ZN8CHash1605WriteE4SpanIKhE:
   62|  29.5k|    CHash160& Write(Span<const unsigned char> input) {
   63|  29.5k|        sha.Write(input.data(), input.size());
   64|  29.5k|        return *this;
   65|  29.5k|    }
_Z7Hash160I4SpanIKhEE7uint160RKT_:
   93|  23.6k|{
   94|  23.6k|    uint160 result;
   95|  23.6k|    CHash160().Write(MakeUCharSpan(in1)).Finalize(result);
   96|  23.6k|    return result;
   97|  23.6k|}
_Z4HashI4SpanIKhEE7uint256RKT_:
   76|  1.97k|{
   77|  1.97k|    uint256 result;
   78|  1.97k|    CHash256().Write(MakeUCharSpan(in1)).Finalize(result);
   79|  1.97k|    return result;
   80|  1.97k|}
_Z4HashINSt3__16vectorIhNS0_9allocatorIhEEEEE7uint256RKT_:
   76|  3.94k|{
   77|  3.94k|    uint256 result;
   78|  3.94k|    CHash256().Write(MakeUCharSpan(in1)).Finalize(result);
   79|  3.94k|    return result;
   80|  3.94k|}
_Z4HashINSt3__14spanIKhLm18446744073709551615EEEE7uint256RKT_:
   76|  1.97k|{
   77|  1.97k|    uint256 result;
   78|  1.97k|    CHash256().Write(MakeUCharSpan(in1)).Finalize(result);
   79|  1.97k|    return result;
   80|  1.97k|}
_Z7Hash160I7CScriptE7uint160RKT_:
   93|  5.91k|{
   94|  5.91k|    uint160 result;
   95|  5.91k|    CHash160().Write(MakeUCharSpan(in1)).Finalize(result);
   96|  5.91k|    return result;
   97|  5.91k|}
_Z4HashI4SpanIhEE7uint256RKT_:
   76|  5.91k|{
   77|  5.91k|    uint256 result;
   78|  5.91k|    CHash256().Write(MakeUCharSpan(in1)).Finalize(result);
   79|  5.91k|    return result;
   80|  5.91k|}
_Z4HashINSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEA8_hE7uint256RKT_RKT0_:
   84|  3.94k|inline uint256 Hash(const T1& in1, const T2& in2) {
   85|  3.94k|    uint256 result;
   86|  3.94k|    CHash256().Write(MakeUCharSpan(in1)).Write(MakeUCharSpan(in2)).Finalize(result);
   87|  3.94k|    return result;
   88|  3.94k|}

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

_Z20ec_seckey_import_derPK24secp256k1_context_structPhPKhm:
   38|  3.94k|int ec_seckey_import_der(const secp256k1_context* ctx, unsigned char *out32, const unsigned char *seckey, size_t seckeylen) {
   39|  3.94k|    const unsigned char *end = seckey + seckeylen;
   40|  3.94k|    memset(out32, 0, 32);
   41|       |    /* sequence header */
   42|  3.94k|    if (end - seckey < 1 || *seckey != 0x30u) {
  ------------------
  |  Branch (42:9): [True: 0, False: 3.94k]
  |  Branch (42:29): [True: 0, False: 3.94k]
  ------------------
   43|      0|        return 0;
   44|      0|    }
   45|  3.94k|    seckey++;
   46|       |    /* sequence length constructor */
   47|  3.94k|    if (end - seckey < 1 || !(*seckey & 0x80u)) {
  ------------------
  |  Branch (47:9): [True: 0, False: 3.94k]
  |  Branch (47:29): [True: 0, False: 3.94k]
  ------------------
   48|      0|        return 0;
   49|      0|    }
   50|  3.94k|    ptrdiff_t lenb = *seckey & ~0x80u; seckey++;
   51|  3.94k|    if (lenb < 1 || lenb > 2) {
  ------------------
  |  Branch (51:9): [True: 0, False: 3.94k]
  |  Branch (51:21): [True: 0, False: 3.94k]
  ------------------
   52|      0|        return 0;
   53|      0|    }
   54|  3.94k|    if (end - seckey < lenb) {
  ------------------
  |  Branch (54:9): [True: 0, False: 3.94k]
  ------------------
   55|      0|        return 0;
   56|      0|    }
   57|       |    /* sequence length */
   58|  3.94k|    ptrdiff_t len = seckey[lenb-1] | (lenb > 1 ? seckey[lenb-2] << 8 : 0u);
  ------------------
  |  Branch (58:39): [True: 0, False: 3.94k]
  ------------------
   59|  3.94k|    seckey += lenb;
   60|  3.94k|    if (end - seckey < len) {
  ------------------
  |  Branch (60:9): [True: 0, False: 3.94k]
  ------------------
   61|      0|        return 0;
   62|      0|    }
   63|       |    /* sequence element 0: version number (=1) */
   64|  3.94k|    if (end - seckey < 3 || seckey[0] != 0x02u || seckey[1] != 0x01u || seckey[2] != 0x01u) {
  ------------------
  |  Branch (64:9): [True: 0, False: 3.94k]
  |  Branch (64:29): [True: 0, False: 3.94k]
  |  Branch (64:51): [True: 0, False: 3.94k]
  |  Branch (64:73): [True: 0, False: 3.94k]
  ------------------
   65|      0|        return 0;
   66|      0|    }
   67|  3.94k|    seckey += 3;
   68|       |    /* sequence element 1: octet string, up to 32 bytes */
   69|  3.94k|    if (end - seckey < 2 || seckey[0] != 0x04u) {
  ------------------
  |  Branch (69:9): [True: 0, False: 3.94k]
  |  Branch (69:29): [True: 0, False: 3.94k]
  ------------------
   70|      0|        return 0;
   71|      0|    }
   72|  3.94k|    ptrdiff_t oslen = seckey[1];
   73|  3.94k|    seckey += 2;
   74|  3.94k|    if (oslen > 32 || end - seckey < oslen) {
  ------------------
  |  Branch (74:9): [True: 0, False: 3.94k]
  |  Branch (74:23): [True: 0, False: 3.94k]
  ------------------
   75|      0|        return 0;
   76|      0|    }
   77|  3.94k|    memcpy(out32 + (32 - oslen), seckey, oslen);
   78|  3.94k|    if (!secp256k1_ec_seckey_verify(ctx, out32)) {
  ------------------
  |  Branch (78:9): [True: 0, False: 3.94k]
  ------------------
   79|      0|        memset(out32, 0, 32);
   80|      0|        return 0;
   81|      0|    }
   82|  3.94k|    return 1;
   83|  3.94k|}
_Z20ec_seckey_export_derPK24secp256k1_context_structPhPmPKhb:
   95|  1.97k|int ec_seckey_export_der(const secp256k1_context *ctx, unsigned char *seckey, size_t *seckeylen, const unsigned char *key32, bool compressed) {
   96|  1.97k|    assert(*seckeylen >= CKey::SIZE);
   97|  1.97k|    secp256k1_pubkey pubkey;
   98|  1.97k|    size_t pubkeylen = 0;
   99|  1.97k|    if (!secp256k1_ec_pubkey_create(ctx, &pubkey, key32)) {
  ------------------
  |  Branch (99:9): [True: 0, False: 1.97k]
  ------------------
  100|      0|        *seckeylen = 0;
  101|      0|        return 0;
  102|      0|    }
  103|  1.97k|    if (compressed) {
  ------------------
  |  Branch (103:9): [True: 1.97k, False: 0]
  ------------------
  104|  1.97k|        static const unsigned char begin[] = {
  105|  1.97k|            0x30,0x81,0xD3,0x02,0x01,0x01,0x04,0x20
  106|  1.97k|        };
  107|  1.97k|        static const unsigned char middle[] = {
  108|  1.97k|            0xA0,0x81,0x85,0x30,0x81,0x82,0x02,0x01,0x01,0x30,0x2C,0x06,0x07,0x2A,0x86,0x48,
  109|  1.97k|            0xCE,0x3D,0x01,0x01,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  110|  1.97k|            0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  111|  1.97k|            0xFF,0xFF,0xFE,0xFF,0xFF,0xFC,0x2F,0x30,0x06,0x04,0x01,0x00,0x04,0x01,0x07,0x04,
  112|  1.97k|            0x21,0x02,0x79,0xBE,0x66,0x7E,0xF9,0xDC,0xBB,0xAC,0x55,0xA0,0x62,0x95,0xCE,0x87,
  113|  1.97k|            0x0B,0x07,0x02,0x9B,0xFC,0xDB,0x2D,0xCE,0x28,0xD9,0x59,0xF2,0x81,0x5B,0x16,0xF8,
  114|  1.97k|            0x17,0x98,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  115|  1.97k|            0xFF,0xFF,0xFF,0xFF,0xFE,0xBA,0xAE,0xDC,0xE6,0xAF,0x48,0xA0,0x3B,0xBF,0xD2,0x5E,
  116|  1.97k|            0x8C,0xD0,0x36,0x41,0x41,0x02,0x01,0x01,0xA1,0x24,0x03,0x22,0x00
  117|  1.97k|        };
  118|  1.97k|        unsigned char *ptr = seckey;
  119|  1.97k|        memcpy(ptr, begin, sizeof(begin)); ptr += sizeof(begin);
  120|  1.97k|        memcpy(ptr, key32, 32); ptr += 32;
  121|  1.97k|        memcpy(ptr, middle, sizeof(middle)); ptr += sizeof(middle);
  122|  1.97k|        pubkeylen = CPubKey::COMPRESSED_SIZE;
  123|  1.97k|        secp256k1_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_COMPRESSED);
  ------------------
  |  |  212|  1.97k|#define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  193|  1.97k|#define SECP256K1_FLAGS_TYPE_COMPRESSION (1 << 1)
  |  |  ------------------
  |  |               #define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  198|  1.97k|#define SECP256K1_FLAGS_BIT_COMPRESSION (1 << 8)
  |  |  ------------------
  ------------------
  124|  1.97k|        ptr += pubkeylen;
  125|  1.97k|        *seckeylen = ptr - seckey;
  126|  1.97k|        assert(*seckeylen == CKey::COMPRESSED_SIZE);
  127|  1.97k|    } else {
  128|      0|        static const unsigned char begin[] = {
  129|      0|            0x30,0x82,0x01,0x13,0x02,0x01,0x01,0x04,0x20
  130|      0|        };
  131|      0|        static const unsigned char middle[] = {
  132|      0|            0xA0,0x81,0xA5,0x30,0x81,0xA2,0x02,0x01,0x01,0x30,0x2C,0x06,0x07,0x2A,0x86,0x48,
  133|      0|            0xCE,0x3D,0x01,0x01,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  134|      0|            0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  135|      0|            0xFF,0xFF,0xFE,0xFF,0xFF,0xFC,0x2F,0x30,0x06,0x04,0x01,0x00,0x04,0x01,0x07,0x04,
  136|      0|            0x41,0x04,0x79,0xBE,0x66,0x7E,0xF9,0xDC,0xBB,0xAC,0x55,0xA0,0x62,0x95,0xCE,0x87,
  137|      0|            0x0B,0x07,0x02,0x9B,0xFC,0xDB,0x2D,0xCE,0x28,0xD9,0x59,0xF2,0x81,0x5B,0x16,0xF8,
  138|      0|            0x17,0x98,0x48,0x3A,0xDA,0x77,0x26,0xA3,0xC4,0x65,0x5D,0xA4,0xFB,0xFC,0x0E,0x11,
  139|      0|            0x08,0xA8,0xFD,0x17,0xB4,0x48,0xA6,0x85,0x54,0x19,0x9C,0x47,0xD0,0x8F,0xFB,0x10,
  140|      0|            0xD4,0xB8,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
  141|      0|            0xFF,0xFF,0xFF,0xFF,0xFE,0xBA,0xAE,0xDC,0xE6,0xAF,0x48,0xA0,0x3B,0xBF,0xD2,0x5E,
  142|      0|            0x8C,0xD0,0x36,0x41,0x41,0x02,0x01,0x01,0xA1,0x44,0x03,0x42,0x00
  143|      0|        };
  144|      0|        unsigned char *ptr = seckey;
  145|      0|        memcpy(ptr, begin, sizeof(begin)); ptr += sizeof(begin);
  146|      0|        memcpy(ptr, key32, 32); ptr += 32;
  147|      0|        memcpy(ptr, middle, sizeof(middle)); ptr += sizeof(middle);
  148|      0|        pubkeylen = CPubKey::SIZE;
  149|      0|        secp256k1_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_UNCOMPRESSED);
  ------------------
  |  |  213|      0|#define SECP256K1_EC_UNCOMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION)
  |  |  ------------------
  |  |  |  |  193|      0|#define SECP256K1_FLAGS_TYPE_COMPRESSION (1 << 1)
  |  |  ------------------
  ------------------
  150|      0|        ptr += pubkeylen;
  151|      0|        *seckeylen = ptr - seckey;
  152|      0|        assert(*seckeylen == CKey::SIZE);
  153|      0|    }
  154|  1.97k|    return 1;
  155|  1.97k|}
_ZN4CKey5CheckEPKh:
  157|  9.89k|bool CKey::Check(const unsigned char *vch) {
  158|  9.89k|    return secp256k1_ec_seckey_verify(secp256k1_context_sign, vch);
  159|  9.89k|}
_ZNK4CKey10GetPrivKeyEv:
  169|  1.97k|CPrivKey CKey::GetPrivKey() const {
  170|  1.97k|    assert(keydata);
  171|  1.97k|    CPrivKey seckey;
  172|  1.97k|    int ret;
  173|  1.97k|    size_t seckeylen;
  174|  1.97k|    seckey.resize(SIZE);
  175|  1.97k|    seckeylen = SIZE;
  176|  1.97k|    ret = ec_seckey_export_der(secp256k1_context_sign, seckey.data(), &seckeylen, UCharCast(begin()), fCompressed);
  177|  1.97k|    assert(ret);
  178|  1.97k|    seckey.resize(seckeylen);
  179|  1.97k|    return seckey;
  180|  1.97k|}
_ZNK4CKey9GetPubKeyEv:
  182|  9.85k|CPubKey CKey::GetPubKey() const {
  183|  9.85k|    assert(keydata);
  184|  9.85k|    secp256k1_pubkey pubkey;
  185|  9.85k|    size_t clen = CPubKey::SIZE;
  186|  9.85k|    CPubKey result;
  187|  9.85k|    int ret = secp256k1_ec_pubkey_create(secp256k1_context_sign, &pubkey, UCharCast(begin()));
  188|  9.85k|    assert(ret);
  189|  9.85k|    secp256k1_ec_pubkey_serialize(secp256k1_context_sign, (unsigned char*)result.begin(), &clen, &pubkey, fCompressed ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED);
  ------------------
  |  |  212|  9.85k|#define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  193|  9.85k|#define SECP256K1_FLAGS_TYPE_COMPRESSION (1 << 1)
  |  |  ------------------
  |  |               #define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  198|  9.85k|#define SECP256K1_FLAGS_BIT_COMPRESSION (1 << 8)
  |  |  ------------------
  ------------------
                  secp256k1_ec_pubkey_serialize(secp256k1_context_sign, (unsigned char*)result.begin(), &clen, &pubkey, fCompressed ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED);
  ------------------
  |  |  213|  9.85k|#define SECP256K1_EC_UNCOMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION)
  |  |  ------------------
  |  |  |  |  193|      0|#define SECP256K1_FLAGS_TYPE_COMPRESSION (1 << 1)
  |  |  ------------------
  ------------------
  |  Branch (189:107): [True: 9.85k, False: 0]
  ------------------
  190|  9.85k|    assert(result.size() == clen);
  191|  9.85k|    assert(result.IsValid());
  192|  9.85k|    return result;
  193|  9.85k|}
_Z10SigHasLowRPK25secp256k1_ecdsa_signature:
  197|  10.4k|{
  198|  10.4k|    unsigned char compact_sig[64];
  199|  10.4k|    secp256k1_ecdsa_signature_serialize_compact(secp256k1_context_sign, compact_sig, sig);
  200|       |
  201|       |    // In DER serialization, all values are interpreted as big-endian, signed integers. The highest bit in the integer indicates
  202|       |    // its signed-ness; 0 is positive, 1 is negative. When the value is interpreted as a negative integer, it must be converted
  203|       |    // to a positive value by prepending a 0x00 byte so that the highest bit is 0. We can avoid this prepending by ensuring that
  204|       |    // our highest bit is always 0, and thus we must check that the first byte is less than 0x80.
  205|  10.4k|    return compact_sig[0] < 0x80;
  206|  10.4k|}
_ZNK4CKey4SignERK7uint256RNSt3__16vectorIhNS3_9allocatorIhEEEEbj:
  208|  5.91k|bool CKey::Sign(const uint256 &hash, std::vector<unsigned char>& vchSig, bool grind, uint32_t test_case) const {
  209|  5.91k|    if (!keydata)
  ------------------
  |  Branch (209:9): [True: 0, False: 5.91k]
  ------------------
  210|      0|        return false;
  211|  5.91k|    vchSig.resize(CPubKey::SIGNATURE_SIZE);
  212|  5.91k|    size_t nSigLen = CPubKey::SIGNATURE_SIZE;
  213|  5.91k|    unsigned char extra_entropy[32] = {0};
  214|  5.91k|    WriteLE32(extra_entropy, test_case);
  215|  5.91k|    secp256k1_ecdsa_signature sig;
  216|  5.91k|    uint32_t counter = 0;
  217|  5.91k|    int ret = secp256k1_ecdsa_sign(secp256k1_context_sign, &sig, hash.begin(), UCharCast(begin()), secp256k1_nonce_function_rfc6979, (!grind && test_case) ? extra_entropy : nullptr);
  ------------------
  |  Branch (217:135): [True: 1.97k, False: 3.94k]
  |  Branch (217:145): [True: 0, False: 1.97k]
  ------------------
  218|       |
  219|       |    // Grind for low R
  220|  10.4k|    while (ret && !SigHasLowR(&sig) && grind) {
  ------------------
  |  Branch (220:12): [True: 10.4k, False: 0]
  |  Branch (220:19): [True: 5.48k, False: 4.91k]
  |  Branch (220:40): [True: 4.48k, False: 995]
  ------------------
  221|  4.48k|        WriteLE32(extra_entropy, ++counter);
  222|  4.48k|        ret = secp256k1_ecdsa_sign(secp256k1_context_sign, &sig, hash.begin(), UCharCast(begin()), secp256k1_nonce_function_rfc6979, extra_entropy);
  223|  4.48k|    }
  224|  5.91k|    assert(ret);
  225|  5.91k|    secp256k1_ecdsa_signature_serialize_der(secp256k1_context_sign, vchSig.data(), &nSigLen, &sig);
  226|  5.91k|    vchSig.resize(nSigLen);
  227|       |    // Additional verification step to prevent using a potentially corrupted signature
  228|  5.91k|    secp256k1_pubkey pk;
  229|  5.91k|    ret = secp256k1_ec_pubkey_create(secp256k1_context_sign, &pk, UCharCast(begin()));
  230|  5.91k|    assert(ret);
  231|  5.91k|    ret = secp256k1_ecdsa_verify(secp256k1_context_static, &sig, hash.begin(), &pk);
  232|  5.91k|    assert(ret);
  233|  5.91k|    return true;
  234|  5.91k|}
_ZNK4CKey12VerifyPubKeyERK7CPubKey:
  236|  3.94k|bool CKey::VerifyPubKey(const CPubKey& pubkey) const {
  237|  3.94k|    if (pubkey.IsCompressed() != fCompressed) {
  ------------------
  |  Branch (237:9): [True: 0, False: 3.94k]
  ------------------
  238|      0|        return false;
  239|      0|    }
  240|  3.94k|    unsigned char rnd[8];
  241|  3.94k|    std::string str = "Bitcoin key verification\n";
  242|  3.94k|    GetRandBytes(rnd);
  243|  3.94k|    uint256 hash{Hash(str, rnd)};
  244|  3.94k|    std::vector<unsigned char> vchSig;
  245|  3.94k|    Sign(hash, vchSig);
  246|  3.94k|    return pubkey.Verify(hash, vchSig);
  247|  3.94k|}
_ZNK4CKey11SignCompactERK7uint256RNSt3__16vectorIhNS3_9allocatorIhEEEE:
  249|  1.97k|bool CKey::SignCompact(const uint256 &hash, std::vector<unsigned char>& vchSig) const {
  250|  1.97k|    if (!keydata)
  ------------------
  |  Branch (250:9): [True: 0, False: 1.97k]
  ------------------
  251|      0|        return false;
  252|  1.97k|    vchSig.resize(CPubKey::COMPACT_SIGNATURE_SIZE);
  253|  1.97k|    int rec = -1;
  254|  1.97k|    secp256k1_ecdsa_recoverable_signature rsig;
  255|  1.97k|    int ret = secp256k1_ecdsa_sign_recoverable(secp256k1_context_sign, &rsig, hash.begin(), UCharCast(begin()), secp256k1_nonce_function_rfc6979, nullptr);
  256|  1.97k|    assert(ret);
  257|  1.97k|    ret = secp256k1_ecdsa_recoverable_signature_serialize_compact(secp256k1_context_sign, &vchSig[1], &rec, &rsig);
  258|  1.97k|    assert(ret);
  259|  1.97k|    assert(rec != -1);
  260|  1.97k|    vchSig[0] = 27 + rec + (fCompressed ? 4 : 0);
  ------------------
  |  Branch (260:29): [True: 1.97k, False: 0]
  ------------------
  261|       |    // Additional verification step to prevent using a potentially corrupted signature
  262|  1.97k|    secp256k1_pubkey epk, rpk;
  263|  1.97k|    ret = secp256k1_ec_pubkey_create(secp256k1_context_sign, &epk, UCharCast(begin()));
  264|  1.97k|    assert(ret);
  265|  1.97k|    ret = secp256k1_ecdsa_recover(secp256k1_context_static, &rpk, &rsig, hash.begin());
  266|  1.97k|    assert(ret);
  267|  1.97k|    ret = secp256k1_ec_pubkey_cmp(secp256k1_context_static, &epk, &rpk);
  268|  1.97k|    assert(ret == 0);
  269|  1.97k|    return true;
  270|  1.97k|}
_ZN4CKey4LoadERKNSt3__16vectorIh16secure_allocatorIhEEERK7CPubKeyb:
  278|  3.94k|bool CKey::Load(const CPrivKey &seckey, const CPubKey &vchPubKey, bool fSkipCheck=false) {
  279|  3.94k|    MakeKeyData();
  280|  3.94k|    if (!ec_seckey_import_der(secp256k1_context_sign, (unsigned char*)begin(), seckey.data(), seckey.size())) {
  ------------------
  |  Branch (280:9): [True: 0, False: 3.94k]
  ------------------
  281|      0|        ClearKeyData();
  282|      0|        return false;
  283|      0|    }
  284|  3.94k|    fCompressed = vchPubKey.IsCompressed();
  285|       |
  286|  3.94k|    if (fSkipCheck)
  ------------------
  |  Branch (286:9): [True: 1.97k, False: 1.97k]
  ------------------
  287|  1.97k|        return true;
  288|       |
  289|  1.97k|    return VerifyPubKey(vchPubKey);
  290|  3.94k|}
_ZNK4CKey6DeriveERS_R7uint256jRKS1_:
  292|  1.97k|bool CKey::Derive(CKey& keyChild, ChainCode &ccChild, unsigned int nChild, const ChainCode& cc) const {
  293|  1.97k|    assert(IsValid());
  294|  1.97k|    assert(IsCompressed());
  295|  1.97k|    std::vector<unsigned char, secure_allocator<unsigned char>> vout(64);
  296|  1.97k|    if ((nChild >> 31) == 0) {
  ------------------
  |  Branch (296:9): [True: 1.97k, False: 0]
  ------------------
  297|  1.97k|        CPubKey pubkey = GetPubKey();
  298|  1.97k|        assert(pubkey.size() == CPubKey::COMPRESSED_SIZE);
  299|  1.97k|        BIP32Hash(cc, nChild, *pubkey.begin(), pubkey.begin()+1, vout.data());
  300|  1.97k|    } else {
  301|      0|        assert(size() == 32);
  302|      0|        BIP32Hash(cc, nChild, 0, UCharCast(begin()), vout.data());
  303|      0|    }
  304|  1.97k|    memcpy(ccChild.begin(), vout.data()+32, 32);
  305|  1.97k|    keyChild.Set(begin(), begin() + 32, true);
  306|  1.97k|    bool ret = secp256k1_ec_seckey_tweak_add(secp256k1_context_sign, (unsigned char*)keyChild.begin(), vout.data());
  307|  1.97k|    if (!ret) keyChild.ClearKeyData();
  ------------------
  |  Branch (307:9): [True: 0, False: 1.97k]
  ------------------
  308|  1.97k|    return ret;
  309|  1.97k|}
_ZN11ECC_ContextD2Ev:
  482|      2|{
  483|      2|    ECC_Stop();
  484|      2|}
key.cpp:_ZL8ECC_Stopv:
  467|      2|static void ECC_Stop() {
  468|      2|    secp256k1_context *ctx = secp256k1_context_sign;
  469|      2|    secp256k1_context_sign = nullptr;
  470|       |
  471|      2|    if (ctx) {
  ------------------
  |  Branch (471:9): [True: 2, False: 0]
  ------------------
  472|      2|        secp256k1_context_destroy(ctx);
  473|      2|    }
  474|      2|}

_ZN4CKey11MakeKeyDataEv:
   64|  23.6k|    {
   65|  23.6k|        if (!keydata) keydata = make_secure_unique<KeyType>();
  ------------------
  |  Branch (65:13): [True: 23.6k, False: 0]
  ------------------
   66|  23.6k|    }
_ZN4CKey12ClearKeyDataEv:
   69|     56|    {
   70|     56|        keydata.reset();
   71|     56|    }
_ZN4CKeyaSERKS_:
   79|  9.85k|    {
   80|  9.85k|        if (this != &other) {
  ------------------
  |  Branch (80:13): [True: 9.85k, False: 0]
  ------------------
   81|  9.85k|            if (other.keydata) {
  ------------------
  |  Branch (81:17): [True: 9.85k, False: 0]
  ------------------
   82|  9.85k|                MakeKeyData();
   83|  9.85k|                *keydata = *other.keydata;
   84|  9.85k|            } else {
   85|      0|                ClearKeyData();
   86|      0|            }
   87|  9.85k|            fCompressed = other.fCompressed;
   88|  9.85k|        }
   89|  9.85k|        return *this;
   90|  9.85k|    }
_ZeqRK4CKeyS1_:
   95|  13.7k|    {
   96|  13.7k|        return a.fCompressed == b.fCompressed &&
  ------------------
  |  Branch (96:16): [True: 9.85k, False: 3.94k]
  ------------------
   97|  13.7k|            a.size() == b.size() &&
  ------------------
  |  Branch (97:13): [True: 9.85k, False: 0]
  ------------------
   98|  13.7k|            memcmp(a.data(), b.data(), a.size()) == 0;
  ------------------
  |  Branch (98:13): [True: 7.88k, False: 1.97k]
  ------------------
   99|  13.7k|    }
_ZNK4CKey4sizeEv:
  117|  47.3k|    unsigned int size() const { return keydata ? keydata->size() : 0; }
  ------------------
  |  Branch (117:40): [True: 45.3k, False: 1.97k]
  ------------------
_ZNK4CKey4dataEv:
  118|  77.4k|    const std::byte* data() const { return keydata ? reinterpret_cast<const std::byte*>(keydata->data()) : nullptr; }
  ------------------
  |  Branch (118:44): [True: 77.4k, False: 0]
  ------------------
_ZNK4CKey5beginEv:
  119|  49.8k|    const std::byte* begin() const { return data(); }
_ZNK4CKey3endEv:
  120|  7.88k|    const std::byte* end() const { return data() + size(); }
_ZNK4CKey7IsValidEv:
  123|  11.8k|    bool IsValid() const { return !!keydata; }
_ZNK4CKey12IsCompressedEv:
  126|  11.8k|    bool IsCompressed() const { return fCompressed; }
_ZN4CKeyC2Ev:
   74|  25.6k|    CKey() noexcept = default;
_ZN4CKey3SetINSt3__111__wrap_iterIPKhEEEEvT_S6_b:
  104|  3.99k|    {
  105|  3.99k|        if (size_t(pend - pbegin) != std::tuple_size_v<KeyType>) {
  ------------------
  |  Branch (105:13): [True: 12, False: 3.98k]
  ------------------
  106|     12|            ClearKeyData();
  107|  3.98k|        } else if (Check(UCharCast(&pbegin[0]))) {
  ------------------
  |  Branch (107:20): [True: 3.94k, False: 44]
  ------------------
  108|  3.94k|            MakeKeyData();
  109|  3.94k|            memcpy(keydata->data(), (unsigned char*)&pbegin[0], keydata->size());
  110|  3.94k|            fCompressed = fCompressedIn;
  111|  3.94k|        } else {
  112|     44|            ClearKeyData();
  113|     44|        }
  114|  3.99k|    }
_ZN4CKey3SetIPKSt4byteEEvT_S4_b:
  104|  3.94k|    {
  105|  3.94k|        if (size_t(pend - pbegin) != std::tuple_size_v<KeyType>) {
  ------------------
  |  Branch (105:13): [True: 0, False: 3.94k]
  ------------------
  106|      0|            ClearKeyData();
  107|  3.94k|        } else if (Check(UCharCast(&pbegin[0]))) {
  ------------------
  |  Branch (107:20): [True: 3.94k, False: 0]
  ------------------
  108|  3.94k|            MakeKeyData();
  109|  3.94k|            memcpy(keydata->data(), (unsigned char*)&pbegin[0], keydata->size());
  110|  3.94k|            fCompressed = fCompressedIn;
  111|  3.94k|        } else {
  112|      0|            ClearKeyData();
  113|      0|        }
  114|  3.94k|    }
_ZN4CKey3SetINSt3__111__wrap_iterIPhEEEEvT_S5_b:
  104|  1.97k|    {
  105|  1.97k|        if (size_t(pend - pbegin) != std::tuple_size_v<KeyType>) {
  ------------------
  |  Branch (105:13): [True: 0, False: 1.97k]
  ------------------
  106|      0|            ClearKeyData();
  107|  1.97k|        } else if (Check(UCharCast(&pbegin[0]))) {
  ------------------
  |  Branch (107:20): [True: 1.97k, False: 0]
  ------------------
  108|  1.97k|            MakeKeyData();
  109|  1.97k|            memcpy(keydata->data(), (unsigned char*)&pbegin[0], keydata->size());
  110|  1.97k|            fCompressed = fCompressedIn;
  111|  1.97k|        } else {
  112|      0|            ClearKeyData();
  113|      0|        }
  114|  1.97k|    }

_Z12DecodeSecretRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  214|  1.97k|{
  215|  1.97k|    CKey key;
  216|  1.97k|    std::vector<unsigned char> data;
  217|  1.97k|    if (DecodeBase58Check(str, data, 34)) {
  ------------------
  |  Branch (217:9): [True: 1.97k, False: 0]
  ------------------
  218|  1.97k|        const std::vector<unsigned char>& privkey_prefix = Params().Base58Prefix(CChainParams::SECRET_KEY);
  219|  1.97k|        if ((data.size() == 32 + privkey_prefix.size() || (data.size() == 33 + privkey_prefix.size() && data.back() == 1)) &&
  ------------------
  |  Branch (219:14): [True: 0, False: 1.97k]
  |  Branch (219:60): [True: 1.97k, False: 0]
  |  Branch (219:105): [True: 1.97k, False: 0]
  ------------------
  220|  1.97k|            std::equal(privkey_prefix.begin(), privkey_prefix.end(), data.begin())) {
  ------------------
  |  Branch (220:13): [True: 1.97k, False: 0]
  ------------------
  221|  1.97k|            bool compressed = data.size() == 33 + privkey_prefix.size();
  222|  1.97k|            key.Set(data.begin() + privkey_prefix.size(), data.begin() + privkey_prefix.size() + 32, compressed);
  223|  1.97k|        }
  224|  1.97k|    }
  225|  1.97k|    if (!data.empty()) {
  ------------------
  |  Branch (225:9): [True: 1.97k, False: 0]
  ------------------
  226|  1.97k|        memory_cleanse(data.data(), data.size());
  227|  1.97k|    }
  228|  1.97k|    return key;
  229|  1.97k|}
_Z12EncodeSecretRK4CKey:
  232|  1.97k|{
  233|  1.97k|    assert(key.IsValid());
  234|  1.97k|    std::vector<unsigned char> data = Params().Base58Prefix(CChainParams::SECRET_KEY);
  235|  1.97k|    data.insert(data.end(), UCharCast(key.begin()), UCharCast(key.end()));
  236|  1.97k|    if (key.IsCompressed()) {
  ------------------
  |  Branch (236:9): [True: 1.97k, False: 0]
  ------------------
  237|  1.97k|        data.push_back(1);
  238|  1.97k|    }
  239|  1.97k|    std::string ret = EncodeBase58Check(data);
  240|  1.97k|    memory_cleanse(data.data(), data.size());
  241|  1.97k|    return ret;
  242|  1.97k|}
_Z17EncodeDestinationRKNSt3__17variantIJ14CNoDestination17PubKeyDestination6PKHash10ScriptHash19WitnessV0ScriptHash16WitnessV0KeyHash16WitnessV1Taproot11PayToAnchor14WitnessUnknownEEE:
  295|  1.97k|{
  296|  1.97k|    return std::visit(DestinationEncoder(Params()), dest);
  297|  1.97k|}
_Z17DecodeDestinationRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEERS5_PNS_6vectorIiNS3_IiEEEE:
  300|  3.94k|{
  301|  3.94k|    return DecodeDestination(str, Params(), error_msg, error_locations);
  302|  3.94k|}
_Z17DecodeDestinationRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  305|  3.94k|{
  306|  3.94k|    std::string error_msg;
  307|  3.94k|    return DecodeDestination(str, error_msg);
  308|  3.94k|}
key_io.cpp:_ZNK12_GLOBAL__N_118DestinationEncoderclERK6PKHash:
   31|  1.97k|    {
   32|  1.97k|        std::vector<unsigned char> data = m_params.Base58Prefix(CChainParams::PUBKEY_ADDRESS);
   33|  1.97k|        data.insert(data.end(), id.begin(), id.end());
   34|  1.97k|        return EncodeBase58Check(data);
   35|  1.97k|    }
key_io.cpp:_ZN12_GLOBAL__N_118DestinationEncoderC2ERK12CChainParams:
   28|  1.97k|    explicit DestinationEncoder(const CChainParams& params) : m_params(params) {}
key_io.cpp:_ZN12_GLOBAL__N_117DecodeDestinationERKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEERK12CChainParamsRS6_PNS0_6vectorIiNS4_IiEEEE:
   85|  3.94k|{
   86|  3.94k|    std::vector<unsigned char> data;
   87|  3.94k|    uint160 hash;
   88|  3.94k|    error_str = "";
   89|       |
   90|       |    // Note this will be false if it is a valid Bech32 address for a different network
   91|  3.94k|    bool is_bech32 = (ToLower(str.substr(0, params.Bech32HRP().size())) == params.Bech32HRP());
   92|       |
   93|  3.94k|    if (!is_bech32 && DecodeBase58Check(str, data, 21)) {
  ------------------
  |  Branch (93:9): [True: 3.94k, False: 0]
  |  Branch (93:23): [True: 3.94k, False: 0]
  ------------------
   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|  3.94k|        const std::vector<unsigned char>& pubkey_prefix = params.Base58Prefix(CChainParams::PUBKEY_ADDRESS);
   98|  3.94k|        if (data.size() == hash.size() + pubkey_prefix.size() && std::equal(pubkey_prefix.begin(), pubkey_prefix.end(), data.begin())) {
  ------------------
  |  Branch (98:13): [True: 3.94k, False: 0]
  |  Branch (98:66): [True: 3.94k, False: 0]
  ------------------
   99|  3.94k|            std::copy(data.begin() + pubkey_prefix.size(), data.end(), hash.begin());
  100|  3.94k|            return PKHash(hash);
  101|  3.94k|        }
  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|      0|    } else if (!is_bech32) {
  ------------------
  |  Branch (120:16): [True: 0, False: 0]
  ------------------
  121|       |        // Try Base58 decoding without the checksum, using a much larger max length
  122|      0|        if (!DecodeBase58(str, data, 100)) {
  ------------------
  |  Branch (122:13): [True: 0, False: 0]
  ------------------
  123|      0|            error_str = "Invalid or unsupported Segwit (Bech32) or Base58 encoding.";
  124|      0|        } else {
  125|      0|            error_str = "Invalid checksum or length of Base58 address (P2PKH or P2SH)";
  126|      0|        }
  127|      0|        return CNoDestination();
  128|      0|    }
  129|       |
  130|      0|    data.clear();
  131|      0|    const auto dec = bech32::Decode(str);
  132|      0|    if (dec.encoding == bech32::Encoding::BECH32 || dec.encoding == bech32::Encoding::BECH32M) {
  ------------------
  |  Branch (132:9): [True: 0, False: 0]
  |  Branch (132:53): [True: 0, False: 0]
  ------------------
  133|      0|        if (dec.data.empty()) {
  ------------------
  |  Branch (133:13): [True: 0, False: 0]
  ------------------
  134|      0|            error_str = "Empty Bech32 data section";
  135|      0|            return CNoDestination();
  136|      0|        }
  137|       |        // Bech32 decoding
  138|      0|        if (dec.hrp != params.Bech32HRP()) {
  ------------------
  |  Branch (138:13): [True: 0, False: 0]
  ------------------
  139|      0|            error_str = strprintf("Invalid or unsupported prefix for Segwit (Bech32) address (expected %s, got %s).", params.Bech32HRP(), dec.hrp);
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
  140|      0|            return CNoDestination();
  141|      0|        }
  142|      0|        int version = dec.data[0]; // The first 5 bit symbol is the witness version (0-16)
  143|      0|        if (version == 0 && dec.encoding != bech32::Encoding::BECH32) {
  ------------------
  |  Branch (143:13): [True: 0, False: 0]
  |  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|      0|        if (version != 0 && dec.encoding != bech32::Encoding::BECH32M) {
  ------------------
  |  Branch (147:13): [True: 0, False: 0]
  |  Branch (147:29): [True: 0, False: 0]
  ------------------
  148|      0|            error_str = "Version 1+ witness address must use Bech32m checksum";
  149|      0|            return CNoDestination();
  150|      0|        }
  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|      0|    auto res = bech32::LocateErrors(str);
  207|      0|    error_str = res.first;
  208|      0|    if (error_locations) *error_locations = std::move(res.second);
  ------------------
  |  Branch (208:9): [True: 0, False: 0]
  ------------------
  209|      0|    return CNoDestination();
  210|      0|}

_Z11LogInstancev:
   25|  4.05k|{
   26|       |/**
   27|       | * NOTE: the logger instances is leaked on exit. This is ugly, but will be
   28|       | * cleaned up by the OS/libc. Defining a logger as a global object doesn't work
   29|       | * since the order of destruction of static/global objects is undefined.
   30|       | * Consider if the logger gets destroyed, and then some later destructor calls
   31|       | * LogPrintf, maybe indirectly, and you get a core dump at shutdown trying to
   32|       | * access the logger. When the shutdown sequence is fully audited and tested,
   33|       | * explicit destruction of these objects can be implemented by changing this
   34|       | * from a raw pointer to a std::unique_ptr.
   35|       | * Since the ~Logger() destructor is never called, the Logger class and all
   36|       | * its subclasses must have implicitly-defined destructors.
   37|       | *
   38|       | * This method of initialization was originally introduced in
   39|       | * ee3374234c60aba2cc4c5cd5cac1c0aefc2d817c.
   40|       | */
   41|  4.05k|    static BCLog::Logger* g_logger{new BCLog::Logger()};
   42|  4.05k|    return *g_logger;
   43|  4.05k|}
_ZN5BCLog16LogEscapeMessageENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
  325|  2.02k|    std::string LogEscapeMessage(std::string_view str) {
  326|  2.02k|        std::string ret;
  327|   247k|        for (char ch_in : str) {
  ------------------
  |  Branch (327:25): [True: 247k, False: 2.02k]
  ------------------
  328|   247k|            uint8_t ch = (uint8_t)ch_in;
  329|   247k|            if ((ch >= 32 || ch == '\n') && ch != '\x7f') {
  ------------------
  |  Branch (329:18): [True: 245k, False: 2.02k]
  |  Branch (329:30): [True: 2.02k, False: 0]
  |  Branch (329:45): [True: 247k, False: 0]
  ------------------
  330|   247k|                ret += ch_in;
  331|   247k|            } else {
  332|      0|                ret += strprintf("\\x%02x", ch);
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
  333|      0|            }
  334|   247k|        }
  335|  2.02k|        return ret;
  336|  2.02k|    }
_ZN5BCLog6Logger11LogPrintStrENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEES5_S5_iNS_8LogFlagsENS_5LevelE:
  388|  2.02k|{
  389|  2.02k|    StdLockGuard scoped_lock(m_cs);
  390|  2.02k|    return LogPrintStr_(str, logging_function, source_file, source_line, category, level);
  391|  2.02k|}
_ZN5BCLog6Logger12LogPrintStr_ENSt3__117basic_string_viewIcNS1_11char_traitsIcEEEES5_S5_iNS_8LogFlagsENS_5LevelE:
  394|  2.02k|{
  395|  2.02k|    std::string str_prefixed = LogEscapeMessage(str);
  396|       |
  397|  2.02k|    if (m_buffering) {
  ------------------
  |  Branch (397:9): [True: 2.02k, False: 0]
  ------------------
  398|  2.02k|        {
  399|  2.02k|            BufferedLog buf{
  400|  2.02k|                .now=SystemClock::now(),
  401|  2.02k|                .mocktime=GetMockTime(),
  402|  2.02k|                .str=str_prefixed,
  403|  2.02k|                .logging_function=std::string(logging_function),
  404|  2.02k|                .source_file=std::string(source_file),
  405|  2.02k|                .threadname=util::ThreadGetInternalName(),
  406|  2.02k|                .source_line=source_line,
  407|  2.02k|                .category=category,
  408|  2.02k|                .level=level,
  409|  2.02k|            };
  410|  2.02k|            m_cur_buffer_memusage += MemUsage(buf);
  411|  2.02k|            m_msgs_before_open.push_back(std::move(buf));
  412|  2.02k|        }
  413|       |
  414|  2.02k|        while (m_cur_buffer_memusage > m_max_buffer_memusage) {
  ------------------
  |  Branch (414:16): [True: 0, False: 2.02k]
  ------------------
  415|      0|            if (m_msgs_before_open.empty()) {
  ------------------
  |  Branch (415:17): [True: 0, False: 0]
  ------------------
  416|      0|                m_cur_buffer_memusage = 0;
  417|      0|                break;
  418|      0|            }
  419|      0|            m_cur_buffer_memusage -= MemUsage(m_msgs_before_open.front());
  420|      0|            m_msgs_before_open.pop_front();
  421|      0|            ++m_buffer_lines_discarded;
  422|      0|        }
  423|       |
  424|  2.02k|        return;
  425|  2.02k|    }
  426|       |
  427|      0|    FormatLogStrInPlace(str_prefixed, category, level, source_file, source_line, logging_function, util::ThreadGetInternalName(), SystemClock::now(), GetMockTime());
  428|       |
  429|      0|    if (m_print_to_console) {
  ------------------
  |  Branch (429:9): [True: 0, False: 0]
  ------------------
  430|       |        // print to console
  431|      0|        fwrite(str_prefixed.data(), 1, str_prefixed.size(), stdout);
  432|      0|        fflush(stdout);
  433|      0|    }
  434|      0|    for (const auto& cb : m_print_callbacks) {
  ------------------
  |  Branch (434:25): [True: 0, False: 0]
  ------------------
  435|      0|        cb(str_prefixed);
  436|      0|    }
  437|      0|    if (m_print_to_file) {
  ------------------
  |  Branch (437:9): [True: 0, False: 0]
  ------------------
  438|      0|        assert(m_fileout != nullptr);
  439|       |
  440|       |        // reopen the log file, if requested
  441|      0|        if (m_reopen_file) {
  ------------------
  |  Branch (441:13): [True: 0, False: 0]
  ------------------
  442|      0|            m_reopen_file = false;
  443|      0|            FILE* new_fileout = fsbridge::fopen(m_file_path, "a");
  444|      0|            if (new_fileout) {
  ------------------
  |  Branch (444:17): [True: 0, False: 0]
  ------------------
  445|      0|                setbuf(new_fileout, nullptr); // unbuffered
  446|      0|                fclose(m_fileout);
  447|      0|                m_fileout = new_fileout;
  448|      0|            }
  449|      0|        }
  450|      0|        FileWriteStr(str_prefixed, m_fileout);
  451|      0|    }
  452|      0|}
logging.cpp:_ZL8MemUsageRKN5BCLog6Logger11BufferedLogE:
  366|  2.02k|{
  367|  2.02k|    return buflog.str.size() + buflog.logging_function.size() + buflog.source_file.size() + buflog.threadname.size() + memusage::MallocUsage(sizeof(memusage::list_node<BCLog::Logger::BufferedLog>));
  368|  2.02k|}

_ZNK5BCLog6Logger7EnabledEv:
  150|  2.02k|        {
  151|  2.02k|            StdLockGuard scoped_lock(m_cs);
  152|  2.02k|            return m_buffering || m_print_to_console || m_print_to_file || !m_print_callbacks.empty();
  ------------------
  |  Branch (152:20): [True: 2.02k, False: 0]
  |  Branch (152:35): [True: 0, False: 0]
  |  Branch (152:57): [True: 0, False: 0]
  |  Branch (152:76): [True: 0, False: 0]
  ------------------
  153|  2.02k|        }
_Z22LogPrintFormatInternalIJPKcNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEEEvNS2_17basic_string_viewIcS5_EESA_iN5BCLog8LogFlagsENSB_5LevelEN4util21ConstevalFormatStringIXsZT_EEEDpRKT_:
  243|  2.02k|{
  244|  2.02k|    if (LogInstance().Enabled()) {
  ------------------
  |  Branch (244:9): [True: 2.02k, False: 0]
  ------------------
  245|  2.02k|        std::string log_msg;
  246|  2.02k|        try {
  247|  2.02k|            log_msg = tfm::format(fmt, args...);
  248|  2.02k|        } catch (tinyformat::format_error& fmterr) {
  249|      0|            log_msg = "Error \"" + std::string{fmterr.what()} + "\" while formatting log message: " + fmt.fmt;
  250|      0|        }
  251|  2.02k|        LogInstance().LogPrintStr(log_msg, logging_function, source_file, source_line, flag, level);
  252|  2.02k|    }
  253|  2.02k|}

logging.cpp:_ZN8memusageL11MallocUsageEm:
   53|  2.02k|{
   54|       |    // Measured on libc6 2.19 on Linux.
   55|  2.02k|    if (alloc == 0) {
  ------------------
  |  Branch (55:9): [True: 0, False: 2.02k]
  ------------------
   56|      0|        return 0;
   57|  2.02k|    } else if (sizeof(void*) == 8) {
  ------------------
  |  Branch (57:16): [Folded - Ignored]
  ------------------
   58|  2.02k|        return ((alloc + 31) >> 4) << 4;
   59|  2.02k|    } else if (sizeof(void*) == 4) {
  ------------------
  |  Branch (59:16): [Folded - Ignored]
  ------------------
   60|      0|        return ((alloc + 15) >> 3) << 3;
   61|      0|    } else {
   62|      0|        assert(0);
   63|      0|    }
   64|  2.02k|}

_Z20GetDestinationForKeyRK7CPubKey10OutputType:
   51|  1.97k|{
   52|  1.97k|    switch (type) {
  ------------------
  |  Branch (52:13): [True: 0, False: 1.97k]
  ------------------
   53|  1.97k|    case OutputType::LEGACY: return PKHash(key);
  ------------------
  |  Branch (53:5): [True: 1.97k, False: 0]
  ------------------
   54|      0|    case OutputType::P2SH_SEGWIT:
  ------------------
  |  Branch (54:5): [True: 0, False: 1.97k]
  ------------------
   55|      0|    case OutputType::BECH32: {
  ------------------
  |  Branch (55:5): [True: 0, False: 1.97k]
  ------------------
   56|      0|        if (!key.IsCompressed()) return PKHash(key);
  ------------------
  |  Branch (56:13): [True: 0, False: 0]
  ------------------
   57|      0|        CTxDestination witdest = WitnessV0KeyHash(key);
   58|      0|        CScript witprog = GetScriptForDestination(witdest);
   59|      0|        if (type == OutputType::P2SH_SEGWIT) {
  ------------------
  |  Branch (59:13): [True: 0, False: 0]
  ------------------
   60|      0|            return ScriptHash(witprog);
   61|      0|        } else {
   62|      0|            return witdest;
   63|      0|        }
   64|      0|    }
   65|      0|    case OutputType::BECH32M:
  ------------------
  |  Branch (65:5): [True: 0, False: 1.97k]
  ------------------
   66|      0|    case OutputType::UNKNOWN: {} // This function should never be used with BECH32M or UNKNOWN, so let it assert
  ------------------
  |  Branch (66:5): [True: 0, False: 1.97k]
  ------------------
   67|  1.97k|    } // no default case, so the compiler can warn about missing cases
   68|      0|    assert(false);
   69|      0|}
_Z24GetAllDestinationsForKeyRK7CPubKey:
   72|  1.97k|{
   73|  1.97k|    PKHash keyid(key);
   74|  1.97k|    CTxDestination p2pkh{keyid};
   75|  1.97k|    if (key.IsCompressed()) {
  ------------------
  |  Branch (75:9): [True: 1.97k, False: 0]
  ------------------
   76|  1.97k|        CTxDestination segwit = WitnessV0KeyHash(keyid);
   77|  1.97k|        CTxDestination p2sh = ScriptHash(GetScriptForDestination(segwit));
   78|  1.97k|        return Vector(std::move(p2pkh), std::move(p2sh), std::move(segwit));
   79|  1.97k|    } else {
   80|      0|        return Vector(std::move(p2pkh));
   81|      0|    }
   82|  1.97k|}

_Z10IsStandardRK7CScriptRKNSt3__18optionalIjEER9TxoutType:
   80|  3.94k|{
   81|  3.94k|    std::vector<std::vector<unsigned char> > vSolutions;
   82|  3.94k|    whichType = Solver(scriptPubKey, vSolutions);
   83|       |
   84|  3.94k|    if (whichType == TxoutType::NONSTANDARD) {
  ------------------
  |  Branch (84:9): [True: 0, False: 3.94k]
  ------------------
   85|      0|        return false;
   86|  3.94k|    } else if (whichType == TxoutType::MULTISIG) {
  ------------------
  |  Branch (86:16): [True: 1.97k, False: 1.97k]
  ------------------
   87|  1.97k|        unsigned char m = vSolutions.front()[0];
   88|  1.97k|        unsigned char n = vSolutions.back()[0];
   89|       |        // Support up to x-of-3 multisig txns as standard
   90|  1.97k|        if (n < 1 || n > 3)
  ------------------
  |  Branch (90:13): [True: 0, False: 1.97k]
  |  Branch (90:22): [True: 0, False: 1.97k]
  ------------------
   91|      0|            return false;
   92|  1.97k|        if (m < 1 || m > n)
  ------------------
  |  Branch (92:13): [True: 0, False: 1.97k]
  |  Branch (92:22): [True: 0, False: 1.97k]
  ------------------
   93|      0|            return false;
   94|  1.97k|    } else if (whichType == TxoutType::NULL_DATA) {
  ------------------
  |  Branch (94:16): [True: 0, False: 1.97k]
  ------------------
   95|      0|        if (!max_datacarrier_bytes || scriptPubKey.size() > *max_datacarrier_bytes) {
  ------------------
  |  Branch (95:13): [True: 0, False: 0]
  |  Branch (95:39): [True: 0, False: 0]
  ------------------
   96|      0|            return false;
   97|      0|        }
   98|      0|    }
   99|       |
  100|  3.94k|    return true;
  101|  3.94k|}

_ZN9prevectorILj28EhjiE3endEv:
  304|  41.3k|    iterator end() { return iterator(item_ptr(size())); }
_ZN9prevectorILj28EhjiE8item_ptrEi:
  206|   137k|    T* item_ptr(difference_type pos) { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  ------------------
  |  Branch (206:47): [True: 118k, False: 19.7k]
  ------------------
_ZNK9prevectorILj28EhjiE9is_directEv:
  173|   731k|    bool is_direct() const { return _size <= N; }
_ZN9prevectorILj28EhjiE10direct_ptrEi:
  169|   124k|    T* direct_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.direct) + pos; }
_ZN9prevectorILj28EhjiE12indirect_ptrEi:
  171|  19.7k|    T* indirect_ptr(difference_type pos) { return reinterpret_cast<T*>(_union.indirect_contents.indirect) + pos; }
_ZN9prevectorILj28EhjiE6insertENS0_8iteratorERKh:
  359|  29.5k|    iterator insert(iterator pos, const T& value) {
  360|  29.5k|        size_type p = pos - begin();
  361|  29.5k|        size_type new_size = size() + 1;
  362|  29.5k|        if (capacity() < new_size) {
  ------------------
  |  Branch (362:13): [True: 0, False: 29.5k]
  ------------------
  363|      0|            change_capacity(new_size + (new_size >> 1));
  364|      0|        }
  365|  29.5k|        T* ptr = item_ptr(p);
  366|  29.5k|        T* dst = ptr + 1;
  367|  29.5k|        memmove(dst, ptr, (size() - p) * sizeof(T));
  368|  29.5k|        _size++;
  369|  29.5k|        new(static_cast<void*>(ptr)) T(value);
  370|  29.5k|        return iterator(ptr);
  371|  29.5k|    }
_ZN9prevectorILj28EhjiE5beginEv:
  302|  41.3k|    iterator begin() { return iterator(item_ptr(0)); }
_ZmiN9prevectorILj28EhjiE8iteratorES1_:
   66|  41.3k|        difference_type friend operator-(iterator a, iterator b) { return (&(*a) - &(*b)); }
_ZNK9prevectorILj28EhjiE8iteratordeEv:
   59|  82.7k|        T& operator*() const { return *ptr; }
_ZNK9prevectorILj28EhjiE8capacityEv:
  312|  45.3k|    size_t capacity() const {
  313|  45.3k|        if (is_direct()) {
  ------------------
  |  Branch (313:13): [True: 39.4k, False: 5.91k]
  ------------------
  314|  39.4k|            return N;
  315|  39.4k|        } else {
  316|  5.91k|            return _union.indirect_contents.capacity;
  317|  5.91k|        }
  318|  45.3k|    }
_ZN9prevectorILj28EhjiE15change_capacityEj:
  175|  13.7k|    void change_capacity(size_type new_capacity) {
  176|  13.7k|        if (new_capacity <= N) {
  ------------------
  |  Branch (176:13): [True: 7.88k, False: 5.91k]
  ------------------
  177|  7.88k|            if (!is_direct()) {
  ------------------
  |  Branch (177:17): [True: 0, False: 7.88k]
  ------------------
  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|  7.88k|        } else {
  186|  5.91k|            if (!is_direct()) {
  ------------------
  |  Branch (186:17): [True: 0, False: 5.91k]
  ------------------
  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|      0|                _union.indirect_contents.indirect = static_cast<char*>(realloc(_union.indirect_contents.indirect, ((size_t)sizeof(T)) * new_capacity));
  191|      0|                assert(_union.indirect_contents.indirect);
  192|      0|                _union.indirect_contents.capacity = new_capacity;
  193|  5.91k|            } else {
  194|  5.91k|                char* new_indirect = static_cast<char*>(malloc(((size_t)sizeof(T)) * new_capacity));
  195|  5.91k|                assert(new_indirect);
  196|  5.91k|                T* src = direct_ptr(0);
  197|  5.91k|                T* dst = reinterpret_cast<T*>(new_indirect);
  198|  5.91k|                memcpy(dst, src, size() * sizeof(T));
  199|  5.91k|                _union.indirect_contents.indirect = new_indirect;
  200|  5.91k|                _union.indirect_contents.capacity = new_capacity;
  201|  5.91k|                _size += N + 1;
  202|  5.91k|            }
  203|  5.91k|        }
  204|  13.7k|    }
_ZN9prevectorILj28EhjiE6insertITkNSt3__114input_iteratorENS2_11__wrap_iterIPKhEEEEvNS0_8iteratorET_S8_:
  387|  11.8k|    void insert(iterator pos, InputIterator first, InputIterator last) {
  388|  11.8k|        size_type p = pos - begin();
  389|  11.8k|        difference_type count = last - first;
  390|  11.8k|        size_type new_size = size() + count;
  391|  11.8k|        if (capacity() < new_size) {
  ------------------
  |  Branch (391:13): [True: 3.94k, False: 7.88k]
  ------------------
  392|  3.94k|            change_capacity(new_size + (new_size >> 1));
  393|  3.94k|        }
  394|  11.8k|        T* ptr = item_ptr(p);
  395|  11.8k|        T* dst = ptr + count;
  396|  11.8k|        memmove(dst, ptr, (size() - p) * sizeof(T));
  397|  11.8k|        _size += count;
  398|  11.8k|        fill(ptr, first, last);
  399|  11.8k|    }
_ZN9prevectorILj28EhjiE4fillITkNSt3__114input_iteratorENS2_11__wrap_iterIPKhEEEEvPhT_S8_:
  214|  11.8k|    void fill(T* dst, InputIterator first, InputIterator last) {
  215|   299k|        while (first != last) {
  ------------------
  |  Branch (215:16): [True: 287k, False: 11.8k]
  ------------------
  216|   287k|            new(static_cast<void*>(dst)) T(*first);
  217|   287k|            ++dst;
  218|   287k|            ++first;
  219|   287k|        }
  220|  11.8k|    }
_ZN9prevectorILj28EhjiE9push_backERKh:
  444|  3.94k|    void push_back(const T& value) {
  445|  3.94k|        emplace_back(value);
  446|  3.94k|    }
_ZN9prevectorILj28EhjiE12emplace_backIJRKhEEEvDpOT_:
  435|  3.94k|    void emplace_back(Args&&... args) {
  436|  3.94k|        size_type new_size = size() + 1;
  437|  3.94k|        if (capacity() < new_size) {
  ------------------
  |  Branch (437:13): [True: 0, False: 3.94k]
  ------------------
  438|      0|            change_capacity(new_size + (new_size >> 1));
  439|      0|        }
  440|  3.94k|        new(item_ptr(size())) T(std::forward<Args>(args)...);
  441|  3.94k|        _size++;
  442|  3.94k|    }
_ZNK9prevectorILj28EhjiE3endEv:
  305|  76.8k|    const_iterator end() const { return const_iterator(item_ptr(size())); }
_ZNK9prevectorILj28EhjiE8item_ptrEi:
  207|   171k|    const T* item_ptr(difference_type pos) const { return is_direct() ? direct_ptr(pos) : indirect_ptr(pos); }
  ------------------
  |  Branch (207:59): [True: 21.6k, False: 149k]
  ------------------
_ZNK9prevectorILj28EhjiE10direct_ptrEi:
  170|  21.6k|    const T* direct_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.direct) + pos; }
_ZNK9prevectorILj28EhjiE12indirect_ptrEi:
  172|   149k|    const T* indirect_ptr(difference_type pos) const { return reinterpret_cast<const T*>(_union.indirect_contents.indirect) + pos; }
_ZNK9prevectorILj28EhjiE4sizeEv:
  294|   333k|    size_type size() const {
  295|   333k|        return is_direct() ? _size : _size - N - 1;
  ------------------
  |  Branch (295:16): [True: 141k, False: 191k]
  ------------------
  296|   333k|    }
_ZNK9prevectorILj28EhjiE5beginEv:
  303|  33.5k|    const_iterator begin() const { return const_iterator(item_ptr(0)); }
_ZNK9prevectorILj28EhjiE14const_iteratordeEv:
  111|   429k|        const T& operator*() const { return *ptr; }
_ZN9prevectorILj28EhjiE4fillITkNSt3__114input_iteratorENS0_14const_iteratorEEEvPhT_S5_:
  214|  9.85k|    void fill(T* dst, InputIterator first, InputIterator last) {
  215|   258k|        while (first != last) {
  ------------------
  |  Branch (215:16): [True: 248k, False: 9.85k]
  ------------------
  216|   248k|            new(static_cast<void*>(dst)) T(*first);
  217|   248k|            ++dst;
  218|   248k|            ++first;
  219|   248k|        }
  220|  9.85k|    }
_ZNK9prevectorILj28EhjiE14const_iteratorneES1_:
  125|   258k|        bool operator!=(const_iterator x) const { return ptr != x.ptr; }
_ZN9prevectorILj28EhjiE14const_iteratorppEv:
  114|   283k|        const_iterator& operator++() { ptr++; return *this; }
_ZNK9prevectorILj28EhjiE4dataEv:
  537|  5.91k|    const value_type* data() const {
  538|  5.91k|        return item_ptr(0);
  539|  5.91k|    }
_ZNK9prevectorILj28EhjiEixEj:
  324|  47.3k|    const T& operator[](size_type pos) const {
  325|  47.3k|        return *item_ptr(pos);
  326|  47.3k|    }
_ZN9prevectorILj28EhjiED2Ev:
  474|  25.6k|    ~prevector() {
  475|  25.6k|        if (!is_direct()) {
  ------------------
  |  Branch (475:13): [True: 5.91k, False: 19.7k]
  ------------------
  476|  5.91k|            free(_union.indirect_contents.indirect);
  477|  5.91k|            _union.indirect_contents.indirect = nullptr;
  478|  5.91k|        }
  479|  25.6k|    }
_ZN9prevectorILj28EhjiEC2Ev:
  243|  15.7k|    prevector() = default;
_ZN9prevectorILj28EhjiE8iteratorC2EPh:
   58|   112k|        iterator(T* ptr_) : ptr(ptr_) {}
_ZN9prevectorILj28EhjiE14const_iteratorC2EPKh:
  109|   134k|        const_iterator(const T* ptr_) : ptr(ptr_) {}
_ZN9prevectorILj28EhjiEC2ERKS0_:
  263|  9.85k|    prevector(const prevector<N, T, Size, Diff>& other) {
  264|  9.85k|        size_type n = other.size();
  265|  9.85k|        change_capacity(n);
  266|  9.85k|        _size += n;
  267|  9.85k|        fill(item_ptr(0), other.begin(),  other.end());
  268|  9.85k|    }
_ZmiN9prevectorILj28EhjiE14const_iteratorES1_:
  118|  70.9k|        difference_type friend operator-(const_iterator a, const_iterator b) { return (&(*a) - &(*b)); }
_ZN9prevectorILj28EhjiEaSEOS0_:
  284|  3.94k|    prevector& operator=(prevector<N, T, Size, Diff>&& other) noexcept {
  285|  3.94k|        if (!is_direct()) {
  ------------------
  |  Branch (285:13): [True: 0, False: 3.94k]
  ------------------
  286|      0|            free(_union.indirect_contents.indirect);
  287|      0|        }
  288|  3.94k|        _union = std::move(other._union);
  289|  3.94k|        _size = other._size;
  290|  3.94k|        other._size = 0;
  291|  3.94k|        return *this;
  292|  3.94k|    }
_ZNK9prevectorILj28EhjiE14const_iteratorptEv:
  112|  23.6k|        const T* operator->() const { return ptr; }
_ZNK9prevectorILj28EhjiE14const_iteratorltES1_:
  129|  27.5k|        bool operator<(const_iterator x) const { return ptr < x.ptr; }
_ZNK9prevectorILj28EhjiE4backEv:
  464|  7.88k|    const T& back() const {
  465|  7.88k|        return *item_ptr(size() - 1);
  466|  7.88k|    }
_ZNK9prevectorILj28EhjiE14const_iteratorplEj:
  119|  23.6k|        const_iterator operator+(size_type n) const { return const_iterator(ptr + n); }
_ZNK9prevectorILj28EhjiE14const_iteratoreqES1_:
  124|  3.94k|        bool operator==(const_iterator x) const { return ptr == x.ptr; }
_ZN9prevectorILj28EhjiE14const_iteratorpLEj:
  121|  11.8k|        const_iterator& operator+=(size_type n) { ptr += n; return *this; }
_ZNK9prevectorILj28EhjiE14const_iteratorgeES1_:
  126|  35.4k|        bool operator>=(const_iterator x) const { return ptr >= x.ptr; }
_ZN9prevectorILj28EhjiE14const_iteratorppEi:
  116|  35.4k|        const_iterator operator++(int) { const_iterator copy(*this); ++(*this); return copy; }

_Z29ecdsa_signature_parse_der_laxP25secp256k1_ecdsa_signaturePKhm:
   45|  11.8k|int ecdsa_signature_parse_der_lax(secp256k1_ecdsa_signature* sig, const unsigned char *input, size_t inputlen) {
   46|  11.8k|    size_t rpos, rlen, spos, slen;
   47|  11.8k|    size_t pos = 0;
   48|  11.8k|    size_t lenbyte;
   49|  11.8k|    unsigned char tmpsig[64] = {0};
   50|  11.8k|    int overflow = 0;
   51|       |
   52|       |    /* Hack to initialize sig with a correctly-parsed but invalid signature. */
   53|  11.8k|    secp256k1_ecdsa_signature_parse_compact(secp256k1_context_static, sig, tmpsig);
   54|       |
   55|       |    /* Sequence tag byte */
   56|  11.8k|    if (pos == inputlen || input[pos] != 0x30) {
  ------------------
  |  Branch (56:9): [True: 0, False: 11.8k]
  |  Branch (56:28): [True: 0, False: 11.8k]
  ------------------
   57|      0|        return 0;
   58|      0|    }
   59|  11.8k|    pos++;
   60|       |
   61|       |    /* Sequence length bytes */
   62|  11.8k|    if (pos == inputlen) {
  ------------------
  |  Branch (62:9): [True: 0, False: 11.8k]
  ------------------
   63|      0|        return 0;
   64|      0|    }
   65|  11.8k|    lenbyte = input[pos++];
   66|  11.8k|    if (lenbyte & 0x80) {
  ------------------
  |  Branch (66:9): [True: 0, False: 11.8k]
  ------------------
   67|      0|        lenbyte -= 0x80;
   68|      0|        if (lenbyte > inputlen - pos) {
  ------------------
  |  Branch (68:13): [True: 0, False: 0]
  ------------------
   69|      0|            return 0;
   70|      0|        }
   71|      0|        pos += lenbyte;
   72|      0|    }
   73|       |
   74|       |    /* Integer tag byte for R */
   75|  11.8k|    if (pos == inputlen || input[pos] != 0x02) {
  ------------------
  |  Branch (75:9): [True: 0, False: 11.8k]
  |  Branch (75:28): [True: 0, False: 11.8k]
  ------------------
   76|      0|        return 0;
   77|      0|    }
   78|  11.8k|    pos++;
   79|       |
   80|       |    /* Integer length for R */
   81|  11.8k|    if (pos == inputlen) {
  ------------------
  |  Branch (81:9): [True: 0, False: 11.8k]
  ------------------
   82|      0|        return 0;
   83|      0|    }
   84|  11.8k|    lenbyte = input[pos++];
   85|  11.8k|    if (lenbyte & 0x80) {
  ------------------
  |  Branch (85:9): [True: 0, False: 11.8k]
  ------------------
   86|      0|        lenbyte -= 0x80;
   87|      0|        if (lenbyte > inputlen - pos) {
  ------------------
  |  Branch (87:13): [True: 0, False: 0]
  ------------------
   88|      0|            return 0;
   89|      0|        }
   90|      0|        while (lenbyte > 0 && input[pos] == 0) {
  ------------------
  |  Branch (90:16): [True: 0, False: 0]
  |  Branch (90:31): [True: 0, False: 0]
  ------------------
   91|      0|            pos++;
   92|      0|            lenbyte--;
   93|      0|        }
   94|      0|        static_assert(sizeof(size_t) >= 4, "size_t too small");
   95|      0|        if (lenbyte >= 4) {
  ------------------
  |  Branch (95:13): [True: 0, False: 0]
  ------------------
   96|      0|            return 0;
   97|      0|        }
   98|      0|        rlen = 0;
   99|      0|        while (lenbyte > 0) {
  ------------------
  |  Branch (99:16): [True: 0, False: 0]
  ------------------
  100|      0|            rlen = (rlen << 8) + input[pos];
  101|      0|            pos++;
  102|      0|            lenbyte--;
  103|      0|        }
  104|  11.8k|    } else {
  105|  11.8k|        rlen = lenbyte;
  106|  11.8k|    }
  107|  11.8k|    if (rlen > inputlen - pos) {
  ------------------
  |  Branch (107:9): [True: 0, False: 11.8k]
  ------------------
  108|      0|        return 0;
  109|      0|    }
  110|  11.8k|    rpos = pos;
  111|  11.8k|    pos += rlen;
  112|       |
  113|       |    /* Integer tag byte for S */
  114|  11.8k|    if (pos == inputlen || input[pos] != 0x02) {
  ------------------
  |  Branch (114:9): [True: 0, False: 11.8k]
  |  Branch (114:28): [True: 0, False: 11.8k]
  ------------------
  115|      0|        return 0;
  116|      0|    }
  117|  11.8k|    pos++;
  118|       |
  119|       |    /* Integer length for S */
  120|  11.8k|    if (pos == inputlen) {
  ------------------
  |  Branch (120:9): [True: 0, False: 11.8k]
  ------------------
  121|      0|        return 0;
  122|      0|    }
  123|  11.8k|    lenbyte = input[pos++];
  124|  11.8k|    if (lenbyte & 0x80) {
  ------------------
  |  Branch (124:9): [True: 0, False: 11.8k]
  ------------------
  125|      0|        lenbyte -= 0x80;
  126|      0|        if (lenbyte > inputlen - pos) {
  ------------------
  |  Branch (126:13): [True: 0, False: 0]
  ------------------
  127|      0|            return 0;
  128|      0|        }
  129|      0|        while (lenbyte > 0 && input[pos] == 0) {
  ------------------
  |  Branch (129:16): [True: 0, False: 0]
  |  Branch (129:31): [True: 0, False: 0]
  ------------------
  130|      0|            pos++;
  131|      0|            lenbyte--;
  132|      0|        }
  133|      0|        static_assert(sizeof(size_t) >= 4, "size_t too small");
  134|      0|        if (lenbyte >= 4) {
  ------------------
  |  Branch (134:13): [True: 0, False: 0]
  ------------------
  135|      0|            return 0;
  136|      0|        }
  137|      0|        slen = 0;
  138|      0|        while (lenbyte > 0) {
  ------------------
  |  Branch (138:16): [True: 0, False: 0]
  ------------------
  139|      0|            slen = (slen << 8) + input[pos];
  140|      0|            pos++;
  141|      0|            lenbyte--;
  142|      0|        }
  143|  11.8k|    } else {
  144|  11.8k|        slen = lenbyte;
  145|  11.8k|    }
  146|  11.8k|    if (slen > inputlen - pos) {
  ------------------
  |  Branch (146:9): [True: 3.94k, False: 7.88k]
  ------------------
  147|  3.94k|        return 0;
  148|  3.94k|    }
  149|  7.88k|    spos = pos;
  150|       |
  151|       |    /* Ignore leading zeroes in R */
  152|  9.89k|    while (rlen > 0 && input[rpos] == 0) {
  ------------------
  |  Branch (152:12): [True: 9.89k, False: 0]
  |  Branch (152:24): [True: 2.00k, False: 7.88k]
  ------------------
  153|  2.00k|        rlen--;
  154|  2.00k|        rpos++;
  155|  2.00k|    }
  156|       |    /* Copy R value */
  157|  7.88k|    if (rlen > 32) {
  ------------------
  |  Branch (157:9): [True: 0, False: 7.88k]
  ------------------
  158|      0|        overflow = 1;
  159|  7.88k|    } else {
  160|  7.88k|        memcpy(tmpsig + 32 - rlen, input + rpos, rlen);
  161|  7.88k|    }
  162|       |
  163|       |    /* Ignore leading zeroes in S */
  164|  7.93k|    while (slen > 0 && input[spos] == 0) {
  ------------------
  |  Branch (164:12): [True: 7.93k, False: 0]
  |  Branch (164:24): [True: 49, False: 7.88k]
  ------------------
  165|     49|        slen--;
  166|     49|        spos++;
  167|     49|    }
  168|       |    /* Copy S value */
  169|  7.88k|    if (slen > 32) {
  ------------------
  |  Branch (169:9): [True: 0, False: 7.88k]
  ------------------
  170|      0|        overflow = 1;
  171|  7.88k|    } else {
  172|  7.88k|        memcpy(tmpsig + 64 - slen, input + spos, slen);
  173|  7.88k|    }
  174|       |
  175|  7.88k|    if (!overflow) {
  ------------------
  |  Branch (175:9): [True: 7.88k, False: 0]
  ------------------
  176|  7.88k|        overflow = !secp256k1_ecdsa_signature_parse_compact(secp256k1_context_static, sig, tmpsig);
  177|  7.88k|    }
  178|  7.88k|    if (overflow) {
  ------------------
  |  Branch (178:9): [True: 0, False: 7.88k]
  ------------------
  179|       |        /* Overwrite the result again with a correctly-parsed but invalid
  180|       |           signature if parsing failed. */
  181|      0|        memset(tmpsig, 0, 64);
  182|      0|        secp256k1_ecdsa_signature_parse_compact(secp256k1_context_static, sig, tmpsig);
  183|      0|    }
  184|  7.88k|    return 1;
  185|  11.8k|}
_ZNK7CPubKey6VerifyERK7uint256RKNSt3__16vectorIhNS3_9allocatorIhEEEE:
  277|  7.88k|bool CPubKey::Verify(const uint256 &hash, const std::vector<unsigned char>& vchSig) const {
  278|  7.88k|    if (!IsValid())
  ------------------
  |  Branch (278:9): [True: 0, False: 7.88k]
  ------------------
  279|      0|        return false;
  280|  7.88k|    secp256k1_pubkey pubkey;
  281|  7.88k|    secp256k1_ecdsa_signature sig;
  282|  7.88k|    if (!secp256k1_ec_pubkey_parse(secp256k1_context_static, &pubkey, vch, size())) {
  ------------------
  |  Branch (282:9): [True: 0, False: 7.88k]
  ------------------
  283|      0|        return false;
  284|      0|    }
  285|  7.88k|    if (!ecdsa_signature_parse_der_lax(&sig, vchSig.data(), vchSig.size())) {
  ------------------
  |  Branch (285:9): [True: 1.97k, False: 5.91k]
  ------------------
  286|  1.97k|        return false;
  287|  1.97k|    }
  288|       |    /* libsecp256k1's ECDSA verification requires lower-S signatures, which have
  289|       |     * not historically been enforced in Bitcoin, so normalize them first. */
  290|  5.91k|    secp256k1_ecdsa_signature_normalize(secp256k1_context_static, &sig, &sig);
  291|  5.91k|    return secp256k1_ecdsa_verify(secp256k1_context_static, &sig, hash.begin(), &pubkey);
  292|  7.88k|}
_ZN7CPubKey14RecoverCompactERK7uint256RKNSt3__16vectorIhNS3_9allocatorIhEEEE:
  294|  1.97k|bool CPubKey::RecoverCompact(const uint256 &hash, const std::vector<unsigned char>& vchSig) {
  295|  1.97k|    if (vchSig.size() != COMPACT_SIGNATURE_SIZE)
  ------------------
  |  Branch (295:9): [True: 0, False: 1.97k]
  ------------------
  296|      0|        return false;
  297|  1.97k|    int recid = (vchSig[0] - 27) & 3;
  298|  1.97k|    bool fComp = ((vchSig[0] - 27) & 4) != 0;
  299|  1.97k|    secp256k1_pubkey pubkey;
  300|  1.97k|    secp256k1_ecdsa_recoverable_signature sig;
  301|  1.97k|    if (!secp256k1_ecdsa_recoverable_signature_parse_compact(secp256k1_context_static, &sig, &vchSig[1], recid)) {
  ------------------
  |  Branch (301:9): [True: 0, False: 1.97k]
  ------------------
  302|      0|        return false;
  303|      0|    }
  304|  1.97k|    if (!secp256k1_ecdsa_recover(secp256k1_context_static, &pubkey, &sig, hash.begin())) {
  ------------------
  |  Branch (304:9): [True: 0, False: 1.97k]
  ------------------
  305|      0|        return false;
  306|      0|    }
  307|  1.97k|    unsigned char pub[SIZE];
  308|  1.97k|    size_t publen = SIZE;
  309|  1.97k|    secp256k1_ec_pubkey_serialize(secp256k1_context_static, pub, &publen, &pubkey, fComp ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED);
  ------------------
  |  |  212|  1.97k|#define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  193|  1.97k|#define SECP256K1_FLAGS_TYPE_COMPRESSION (1 << 1)
  |  |  ------------------
  |  |               #define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  198|  1.97k|#define SECP256K1_FLAGS_BIT_COMPRESSION (1 << 8)
  |  |  ------------------
  ------------------
                  secp256k1_ec_pubkey_serialize(secp256k1_context_static, pub, &publen, &pubkey, fComp ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED);
  ------------------
  |  |  213|  1.97k|#define SECP256K1_EC_UNCOMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION)
  |  |  ------------------
  |  |  |  |  193|      0|#define SECP256K1_FLAGS_TYPE_COMPRESSION (1 << 1)
  |  |  ------------------
  ------------------
  |  Branch (309:84): [True: 1.97k, False: 0]
  ------------------
  310|  1.97k|    Set(pub, pub + publen);
  311|  1.97k|    return true;
  312|  1.97k|}
_ZNK7CPubKey12IsFullyValidEv:
  314|  9.85k|bool CPubKey::IsFullyValid() const {
  315|  9.85k|    if (!IsValid())
  ------------------
  |  Branch (315:9): [True: 1.97k, False: 7.88k]
  ------------------
  316|  1.97k|        return false;
  317|  7.88k|    secp256k1_pubkey pubkey;
  318|  7.88k|    return secp256k1_ec_pubkey_parse(secp256k1_context_static, &pubkey, vch, size());
  319|  9.85k|}
_ZN7CPubKey10DecompressEv:
  321|  1.97k|bool CPubKey::Decompress() {
  322|  1.97k|    if (!IsValid())
  ------------------
  |  Branch (322:9): [True: 0, False: 1.97k]
  ------------------
  323|      0|        return false;
  324|  1.97k|    secp256k1_pubkey pubkey;
  325|  1.97k|    if (!secp256k1_ec_pubkey_parse(secp256k1_context_static, &pubkey, vch, size())) {
  ------------------
  |  Branch (325:9): [True: 0, False: 1.97k]
  ------------------
  326|      0|        return false;
  327|      0|    }
  328|  1.97k|    unsigned char pub[SIZE];
  329|  1.97k|    size_t publen = SIZE;
  330|  1.97k|    secp256k1_ec_pubkey_serialize(secp256k1_context_static, pub, &publen, &pubkey, SECP256K1_EC_UNCOMPRESSED);
  ------------------
  |  |  213|  1.97k|#define SECP256K1_EC_UNCOMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION)
  |  |  ------------------
  |  |  |  |  193|  1.97k|#define SECP256K1_FLAGS_TYPE_COMPRESSION (1 << 1)
  |  |  ------------------
  ------------------
  331|  1.97k|    Set(pub, pub + publen);
  332|  1.97k|    return true;
  333|  1.97k|}
_ZNK7CPubKey6DeriveERS_R7uint256jRKS1_:
  335|  1.97k|bool CPubKey::Derive(CPubKey& pubkeyChild, ChainCode &ccChild, unsigned int nChild, const ChainCode& cc) const {
  336|  1.97k|    assert(IsValid());
  337|  1.97k|    assert((nChild >> 31) == 0);
  338|  1.97k|    assert(size() == COMPRESSED_SIZE);
  339|  1.97k|    unsigned char out[64];
  340|  1.97k|    BIP32Hash(cc, nChild, *begin(), begin()+1, out);
  341|  1.97k|    memcpy(ccChild.begin(), out+32, 32);
  342|  1.97k|    secp256k1_pubkey pubkey;
  343|  1.97k|    if (!secp256k1_ec_pubkey_parse(secp256k1_context_static, &pubkey, vch, size())) {
  ------------------
  |  Branch (343:9): [True: 0, False: 1.97k]
  ------------------
  344|      0|        return false;
  345|      0|    }
  346|  1.97k|    if (!secp256k1_ec_pubkey_tweak_add(secp256k1_context_static, &pubkey, out)) {
  ------------------
  |  Branch (346:9): [True: 0, False: 1.97k]
  ------------------
  347|      0|        return false;
  348|      0|    }
  349|  1.97k|    unsigned char pub[COMPRESSED_SIZE];
  350|  1.97k|    size_t publen = COMPRESSED_SIZE;
  351|  1.97k|    secp256k1_ec_pubkey_serialize(secp256k1_context_static, pub, &publen, &pubkey, SECP256K1_EC_COMPRESSED);
  ------------------
  |  |  212|  1.97k|#define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  193|  1.97k|#define SECP256K1_FLAGS_TYPE_COMPRESSION (1 << 1)
  |  |  ------------------
  |  |               #define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  198|  1.97k|#define SECP256K1_FLAGS_BIT_COMPRESSION (1 << 8)
  |  |  ------------------
  ------------------
  352|  1.97k|    pubkeyChild.Set(pub, pub + publen);
  353|  1.97k|    return true;
  354|  1.97k|}
_ZN7CPubKey9CheckLowSERKNSt3__16vectorIhNS0_9allocatorIhEEEE:
  415|  3.94k|/* static */ bool CPubKey::CheckLowS(const std::vector<unsigned char>& vchSig) {
  416|  3.94k|    secp256k1_ecdsa_signature sig;
  417|  3.94k|    if (!ecdsa_signature_parse_der_lax(&sig, vchSig.data(), vchSig.size())) {
  ------------------
  |  Branch (417:9): [True: 1.97k, False: 1.97k]
  ------------------
  418|  1.97k|        return false;
  419|  1.97k|    }
  420|  1.97k|    return (!secp256k1_ecdsa_signature_normalize(secp256k1_context_static, nullptr, &sig));
  421|  3.94k|}

_ZN6CKeyIDC2ERK7uint160:
   27|  27.5k|    explicit CKeyID(const uint160& in) : uint160(in) {}
_ZN7CPubKey6GetLenEh:
   61|   251k|    {
   62|   251k|        if (chHeader == 2 || chHeader == 3)
  ------------------
  |  Branch (62:13): [True: 124k, False: 127k]
  |  Branch (62:30): [True: 117k, False: 9.85k]
  ------------------
   63|   241k|            return COMPRESSED_SIZE;
   64|  9.85k|        if (chHeader == 4 || chHeader == 6 || chHeader == 7)
  ------------------
  |  Branch (64:13): [True: 5.91k, False: 3.94k]
  |  Branch (64:30): [True: 0, False: 3.94k]
  |  Branch (64:47): [True: 0, False: 3.94k]
  ------------------
   65|  5.91k|            return SIZE;
   66|  3.94k|        return 0;
   67|  9.85k|    }
_ZN7CPubKey10InvalidateEv:
   71|  23.6k|    {
   72|  23.6k|        vch[0] = 0xFF;
   73|  23.6k|    }
_ZN7CPubKey9ValidSizeERKNSt3__16vectorIhNS0_9allocatorIhEEEE:
   77|  15.7k|    bool static ValidSize(const std::vector<unsigned char> &vch) {
   78|  15.7k|      return vch.size() > 0 && GetLen(vch[0]) == vch.size();
  ------------------
  |  Branch (78:14): [True: 11.8k, False: 3.94k]
  |  Branch (78:32): [True: 9.85k, False: 1.97k]
  ------------------
   79|  15.7k|    }
_ZN7CPubKeyC2Ev:
   83|  23.6k|    {
   84|  23.6k|        Invalidate();
   85|  23.6k|    }
_ZN7CPubKeyC2E4SpanIKhE:
  107|  3.94k|    {
  108|  3.94k|        Set(_vch.begin(), _vch.end());
  109|  3.94k|    }
_ZNK7CPubKey4sizeEv:
  112|   225k|    unsigned int size() const { return GetLen(vch[0]); }
_ZNK7CPubKey4dataEv:
  113|  3.94k|    const unsigned char* data() const { return vch; }
_ZNK7CPubKey5beginEv:
  114|  33.5k|    const unsigned char* begin() const { return vch; }
_ZNK7CPubKey3endEv:
  115|  9.85k|    const unsigned char* end() const { return vch + size(); }
_ZNK7CPubKeyixEj:
  116|  65.0k|    const unsigned char& operator[](unsigned int pos) const { return vch[pos]; }
_ZeqRK7CPubKeyS1_:
  120|  19.7k|    {
  121|  19.7k|        return a.vch[0] == b.vch[0] &&
  ------------------
  |  Branch (121:16): [True: 14.7k, False: 4.94k]
  ------------------
  122|  19.7k|               memcmp(a.vch, b.vch, a.size()) == 0;
  ------------------
  |  Branch (122:16): [True: 13.7k, False: 969]
  ------------------
  123|  19.7k|    }
_ZneRK7CPubKeyS1_:
  125|  3.94k|    {
  126|  3.94k|        return !(a == b);
  127|  3.94k|    }
_ZltRK7CPubKeyS1_:
  129|  1.97k|    {
  130|  1.97k|        return a.vch[0] < b.vch[0] ||
  ------------------
  |  Branch (130:16): [True: 1.97k, False: 0]
  ------------------
  131|  1.97k|               (a.vch[0] == b.vch[0] && memcmp(a.vch, b.vch, a.size()) < 0);
  ------------------
  |  Branch (131:17): [True: 0, False: 0]
  |  Branch (131:41): [True: 0, False: 0]
  ------------------
  132|  1.97k|    }
_ZNK7CPubKey5GetIDEv:
  165|  23.6k|    {
  166|  23.6k|        return CKeyID(Hash160(Span{vch}.first(size())));
  167|  23.6k|    }
_ZNK7CPubKey7GetHashEv:
  171|  1.97k|    {
  172|  1.97k|        return Hash(Span{vch}.first(size()));
  173|  1.97k|    }
_ZNK7CPubKey7IsValidEv:
  190|  37.4k|    {
  191|  37.4k|        return size() > 0;
  192|  37.4k|    }
_ZNK7CPubKey12IsCompressedEv:
  205|  21.6k|    {
  206|  21.6k|        return size() == COMPRESSED_SIZE;
  207|  21.6k|    }
_ZN7CPubKey3SetIPKhEEvT_S3_:
   90|  3.94k|    {
   91|  3.94k|        int len = pend == pbegin ? 0 : GetLen(pbegin[0]);
  ------------------
  |  Branch (91:19): [True: 0, False: 3.94k]
  ------------------
   92|  3.94k|        if (len && len == (pend - pbegin))
  ------------------
  |  Branch (92:13): [True: 3.94k, False: 0]
  |  Branch (92:20): [True: 3.94k, False: 0]
  ------------------
   93|  3.94k|            memcpy(vch, (unsigned char*)&pbegin[0], len);
   94|      0|        else
   95|      0|            Invalidate();
   96|  3.94k|    }
_ZN7CPubKey11UnserializeI10DataStreamEEvRT_:
  149|  1.97k|    {
  150|  1.97k|        const unsigned int len(::ReadCompactSize(s));
  151|  1.97k|        if (len <= SIZE) {
  ------------------
  |  Branch (151:13): [True: 1.97k, False: 0]
  ------------------
  152|  1.97k|            s >> Span{vch, len};
  153|  1.97k|            if (len != size()) {
  ------------------
  |  Branch (153:17): [True: 0, False: 1.97k]
  ------------------
  154|      0|                Invalidate();
  155|      0|            }
  156|  1.97k|        } else {
  157|       |            // invalid pubkey, skip available data
  158|      0|            s.ignore(len);
  159|      0|            Invalidate();
  160|      0|        }
  161|  1.97k|    }
_ZNK7CPubKey9SerializeI10DataStreamEEvRT_:
  142|  1.97k|    {
  143|  1.97k|        unsigned int len = size();
  144|  1.97k|        ::WriteCompactSize(s, len);
  145|  1.97k|        s << Span{vch, len};
  146|  1.97k|    }
_ZN7CPubKeyC2INSt3__111__wrap_iterIPKhEEEET_S6_:
  101|  1.97k|    {
  102|  1.97k|        Set(pbegin, pend);
  103|  1.97k|    }
_ZN7CPubKey3SetINSt3__111__wrap_iterIPKhEEEEvT_S6_:
   90|  3.94k|    {
   91|  3.94k|        int len = pend == pbegin ? 0 : GetLen(pbegin[0]);
  ------------------
  |  Branch (91:19): [True: 0, False: 3.94k]
  ------------------
   92|  3.94k|        if (len && len == (pend - pbegin))
  ------------------
  |  Branch (92:13): [True: 3.94k, False: 0]
  |  Branch (92:20): [True: 3.94k, False: 0]
  ------------------
   93|  3.94k|            memcpy(vch, (unsigned char*)&pbegin[0], len);
   94|      0|        else
   95|      0|            Invalidate();
   96|  3.94k|    }
_ZN7CPubKey3SetIPhEEvT_S2_:
   90|  5.91k|    {
   91|  5.91k|        int len = pend == pbegin ? 0 : GetLen(pbegin[0]);
  ------------------
  |  Branch (91:19): [True: 0, False: 5.91k]
  ------------------
   92|  5.91k|        if (len && len == (pend - pbegin))
  ------------------
  |  Branch (92:13): [True: 5.91k, False: 0]
  |  Branch (92:20): [True: 5.91k, False: 0]
  ------------------
   93|  5.91k|            memcpy(vch, (unsigned char*)&pbegin[0], len);
   94|      0|        else
   95|      0|            Invalidate();
   96|  5.91k|    }

_Z30MakeRandDeterministicDANGEROUSRK7uint256:
  671|  2.02k|{
  672|  2.02k|    GetRNGState().MakeDeterministic(seed);
  673|  2.02k|}
_Z12GetRandBytes4SpanIhE:
  677|  3.94k|{
  678|  3.94k|    g_used_g_prng = true;
  679|  3.94k|    ProcRand(bytes.data(), bytes.size(), RNGLevel::FAST, /*always_use_real_rng=*/false);
  680|  3.94k|}
random.cpp:_ZN12_GLOBAL__N_111GetRNGStateEv:
  526|  5.96k|{
  527|       |    // This idiom relies on the guarantee that static variable are initialized
  528|       |    // on first call, even when multiple parallel calls are permitted.
  529|  5.96k|    static std::vector<RNGState, secure_allocator<RNGState>> g_rng(1);
  530|  5.96k|    return g_rng[0];
  531|  5.96k|}
random.cpp:_ZN12_GLOBAL__N_18RNGState17MakeDeterministicERK7uint256:
  475|  2.02k|    {
  476|  2.02k|        LOCK(m_mutex);
  ------------------
  |  |  257|  2.02k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  2.02k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  2.02k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  2.02k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  477|  2.02k|        m_deterministic_prng.emplace(MakeByteSpan(seed));
  478|  2.02k|    }
random.cpp:_ZN12_GLOBAL__N_18ProcRandEPhiNS_8RNGLevelEb:
  638|  3.94k|{
  639|       |    // Make sure the RNG is initialized first (as all Seed* function possibly need hwrand to be available).
  640|  3.94k|    RNGState& rng = GetRNGState();
  641|       |
  642|  3.94k|    assert(num <= 32);
  643|       |
  644|  3.94k|    CSHA512 hasher;
  645|  3.94k|    switch (level) {
  ------------------
  |  Branch (645:13): [True: 0, False: 3.94k]
  ------------------
  646|  3.94k|    case RNGLevel::FAST:
  ------------------
  |  Branch (646:5): [True: 3.94k, False: 0]
  ------------------
  647|  3.94k|        SeedFast(hasher);
  648|  3.94k|        break;
  649|      0|    case RNGLevel::SLOW:
  ------------------
  |  Branch (649:5): [True: 0, False: 3.94k]
  ------------------
  650|      0|        SeedSlow(hasher, rng);
  651|      0|        break;
  652|      0|    case RNGLevel::PERIODIC:
  ------------------
  |  Branch (652:5): [True: 0, False: 3.94k]
  ------------------
  653|      0|        SeedPeriodic(hasher, rng);
  654|      0|        break;
  655|  3.94k|    }
  656|       |
  657|       |    // Combine with and update state
  658|  3.94k|    if (!rng.MixExtract(out, num, std::move(hasher), false, always_use_real_rng)) {
  ------------------
  |  Branch (658:9): [True: 0, False: 3.94k]
  ------------------
  659|       |        // On the first invocation, also seed with SeedStartup().
  660|      0|        CSHA512 startup_hasher;
  661|      0|        SeedStartup(startup_hasher, rng);
  662|      0|        rng.MixExtract(out, num, std::move(startup_hasher), true, always_use_real_rng);
  663|      0|    }
  664|  3.94k|}
random.cpp:_ZN12_GLOBAL__N_18SeedFastER7CSHA512:
  545|  3.94k|{
  546|  3.94k|    unsigned char buffer[32];
  547|       |
  548|       |    // Stack pointer to indirectly commit to thread/callstack
  549|  3.94k|    const unsigned char* ptr = buffer;
  550|  3.94k|    hasher.Write((const unsigned char*)&ptr, sizeof(ptr));
  551|       |
  552|       |    // Hardware randomness is very fast when available; use it always.
  553|  3.94k|    SeedHardwareFast(hasher);
  554|       |
  555|       |    // High-precision timestamp
  556|  3.94k|    SeedTimestamp(hasher);
  557|  3.94k|}
random.cpp:_ZN12_GLOBAL__N_116SeedHardwareFastER7CSHA512:
  259|  3.94k|void SeedHardwareFast(CSHA512& hasher) noexcept {
  260|  3.94k|#if defined(__x86_64__) || defined(__amd64__) || defined(__i386__)
  261|  3.94k|    if (g_rdrand_supported) {
  ------------------
  |  Branch (261:9): [True: 3.94k, False: 0]
  ------------------
  262|  3.94k|        uint64_t out = GetRdRand();
  263|  3.94k|        hasher.Write((const unsigned char*)&out, sizeof(out));
  264|  3.94k|        return;
  265|  3.94k|    }
  266|       |#elif defined(__aarch64__) && defined(HWCAP2_RNG)
  267|       |    if (g_rndr_supported) {
  268|       |        uint64_t out = GetRNDR();
  269|       |        hasher.Write((const unsigned char*)&out, sizeof(out));
  270|       |        return;
  271|       |    }
  272|       |#endif
  273|  3.94k|}
random.cpp:_ZN12_GLOBAL__N_19GetRdRandEv:
  126|  3.94k|{
  127|       |    // RdRand may very rarely fail. Invoke it up to 10 times in a loop to reduce this risk.
  128|       |#ifdef __i386__
  129|       |    uint8_t ok = 0;
  130|       |    // Initialize to 0 to silence a compiler warning that r1 or r2 may be used
  131|       |    // uninitialized. Even if rdrand fails (!ok) it will set the output to 0,
  132|       |    // but there is no way that the compiler could know that.
  133|       |    uint32_t r1 = 0, r2 = 0;
  134|       |    for (int i = 0; i < 10; ++i) {
  135|       |        __asm__ volatile (".byte 0x0f, 0xc7, 0xf0; setc %1" : "=a"(r1), "=q"(ok) :: "cc"); // rdrand %eax
  136|       |        if (ok) break;
  137|       |    }
  138|       |    for (int i = 0; i < 10; ++i) {
  139|       |        __asm__ volatile (".byte 0x0f, 0xc7, 0xf0; setc %1" : "=a"(r2), "=q"(ok) :: "cc"); // rdrand %eax
  140|       |        if (ok) break;
  141|       |    }
  142|       |    return (((uint64_t)r2) << 32) | r1;
  143|       |#elif defined(__x86_64__) || defined(__amd64__)
  144|       |    uint8_t ok = 0;
  145|  3.94k|    uint64_t r1 = 0; // See above why we initialize to 0.
  146|  3.94k|    for (int i = 0; i < 10; ++i) {
  ------------------
  |  Branch (146:21): [True: 3.94k, False: 0]
  ------------------
  147|  3.94k|        __asm__ volatile (".byte 0x48, 0x0f, 0xc7, 0xf0; setc %1" : "=a"(r1), "=q"(ok) :: "cc"); // rdrand %rax
  148|  3.94k|        if (ok) break;
  ------------------
  |  Branch (148:13): [True: 3.94k, False: 0]
  ------------------
  149|  3.94k|    }
  150|  3.94k|    return r1;
  151|       |#else
  152|       |#error "RdRand is only supported on x86 and x86_64"
  153|       |#endif
  154|  3.94k|}
random.cpp:_ZN12_GLOBAL__N_113SeedTimestampER7CSHA512:
  539|  3.94k|{
  540|  3.94k|    int64_t perfcounter = GetPerformanceCounter();
  541|  3.94k|    hasher.Write((const unsigned char*)&perfcounter, sizeof(perfcounter));
  542|  3.94k|}
random.cpp:_ZN12_GLOBAL__N_121GetPerformanceCounterEv:
   65|  3.94k|{
   66|       |    // Read the hardware time stamp counter when available.
   67|       |    // See https://en.wikipedia.org/wiki/Time_Stamp_Counter for more information.
   68|       |#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
   69|       |    return __rdtsc();
   70|       |#elif !defined(_MSC_VER) && defined(__i386__)
   71|       |    uint64_t r = 0;
   72|       |    __asm__ volatile ("rdtsc" : "=A"(r)); // Constrain the r variable to the eax:edx pair.
   73|       |    return r;
   74|       |#elif !defined(_MSC_VER) && (defined(__x86_64__) || defined(__amd64__))
   75|       |    uint64_t r1 = 0, r2 = 0;
   76|  3.94k|    __asm__ volatile ("rdtsc" : "=a"(r1), "=d"(r2)); // Constrain r1 to rax and r2 to rdx.
   77|  3.94k|    return (r2 << 32) | r1;
   78|       |#else
   79|       |    // Fall back to using standard library clock (usually microsecond or nanosecond precision)
   80|       |    return std::chrono::high_resolution_clock::now().time_since_epoch().count();
   81|       |#endif
   82|  3.94k|}
random.cpp:_ZN12_GLOBAL__N_18RNGState10MixExtractEPhmO7CSHA512bb:
  488|  3.94k|    {
  489|  3.94k|        assert(num <= 32);
  490|  3.94k|        unsigned char buf[64];
  491|  3.94k|        static_assert(sizeof(buf) == CSHA512::OUTPUT_SIZE, "Buffer needs to have hasher's output size");
  492|  3.94k|        bool ret;
  493|  3.94k|        {
  494|  3.94k|            LOCK(m_mutex);
  ------------------
  |  |  257|  3.94k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  3.94k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  3.94k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  3.94k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  495|  3.94k|            ret = (m_strongly_seeded |= strong_seed);
  496|       |            // Write the current state of the RNG into the hasher
  497|  3.94k|            hasher.Write(m_state, 32);
  498|       |            // Write a new counter number into the state
  499|  3.94k|            hasher.Write((const unsigned char*)&m_counter, sizeof(m_counter));
  500|  3.94k|            ++m_counter;
  501|       |            // Finalize the hasher
  502|  3.94k|            hasher.Finalize(buf);
  503|       |            // Store the last 32 bytes of the hash output as new RNG state.
  504|  3.94k|            memcpy(m_state, buf + 32, 32);
  505|       |            // Handle requests for deterministic randomness.
  506|  3.94k|            if (!always_use_real_rng && m_deterministic_prng.has_value()) [[unlikely]] {
  ------------------
  |  Branch (506:17): [True: 3.94k, False: 0]
  |  Branch (506:41): [True: 3.94k, False: 0]
  ------------------
  507|       |                // Overwrite the beginning of buf, which will be used for output.
  508|  3.94k|                m_deterministic_prng->Keystream(AsWritableBytes(Span{buf, num}));
  509|       |                // Do not require strong seeding for deterministic output.
  510|  3.94k|                ret = true;
  511|  3.94k|            }
  512|  3.94k|        }
  513|       |        // If desired, copy (up to) the first 32 bytes of the hash output as output.
  514|  3.94k|        if (num) {
  ------------------
  |  Branch (514:13): [True: 3.94k, False: 0]
  ------------------
  515|  3.94k|            assert(out != nullptr);
  516|  3.94k|            memcpy(out, buf, num);
  517|  3.94k|        }
  518|       |        // Best effort cleanup of internal state
  519|  3.94k|        hasher.Reset();
  520|  3.94k|        memory_cleanse(buf, 64);
  521|  3.94k|        return ret;
  522|  3.94k|    }

_Z11HexToPubKeyRKNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE:
  223|  1.97k|{
  224|  1.97k|    if (!IsHex(hex_in)) {
  ------------------
  |  Branch (224:9): [True: 0, False: 1.97k]
  ------------------
  225|      0|        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Pubkey \"" + hex_in + "\" must be a hex string");
  226|      0|    }
  227|  1.97k|    if (hex_in.length() != 66 && hex_in.length() != 130) {
  ------------------
  |  Branch (227:9): [True: 0, False: 1.97k]
  |  Branch (227:34): [True: 0, False: 0]
  ------------------
  228|      0|        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Pubkey \"" + hex_in + "\" must have a length of either 33 or 65 bytes");
  229|      0|    }
  230|  1.97k|    CPubKey vchPubKey(ParseHex(hex_in));
  231|  1.97k|    if (!vchPubKey.IsFullyValid()) {
  ------------------
  |  Branch (231:9): [True: 0, False: 1.97k]
  ------------------
  232|      0|        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Pubkey \"" + hex_in + "\" must be cryptographically valid.");
  233|      0|    }
  234|  1.97k|    return vchPubKey;
  235|  1.97k|}
_Z12AddrToPubKeyRK23FillableSigningProviderRKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEE:
  239|  1.97k|{
  240|  1.97k|    CTxDestination dest = DecodeDestination(addr_in);
  241|  1.97k|    if (!IsValidDestination(dest)) {
  ------------------
  |  Branch (241:9): [True: 0, False: 1.97k]
  ------------------
  242|      0|        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid address: " + addr_in);
  243|      0|    }
  244|  1.97k|    CKeyID key = GetKeyForDestination(keystore, dest);
  245|  1.97k|    if (key.IsNull()) {
  ------------------
  |  Branch (245:9): [True: 0, False: 1.97k]
  ------------------
  246|      0|        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("'%s' does not refer to a key", addr_in));
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
  247|      0|    }
  248|  1.97k|    CPubKey vchPubKey;
  249|  1.97k|    if (!keystore.GetPubKey(key, vchPubKey)) {
  ------------------
  |  Branch (249:9): [True: 0, False: 1.97k]
  ------------------
  250|      0|        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("no full public key for address %s", addr_in));
  ------------------
  |  | 1172|      0|#define strprintf tfm::format
  ------------------
  251|      0|    }
  252|  1.97k|    if (!vchPubKey.IsFullyValid()) {
  ------------------
  |  Branch (252:9): [True: 0, False: 1.97k]
  ------------------
  253|      0|       throw JSONRPCError(RPC_INTERNAL_ERROR, "Wallet contains an invalid public key");
  254|      0|    }
  255|  1.97k|    return vchPubKey;
  256|  1.97k|}

_ZN9CScriptIDC2ERK7CScript:
   16|  3.94k|CScriptID::CScriptID(const CScript& in) : BaseHash(Hash160(in)) {}
_ZNK7CScript17IsPayToScriptHashEv:
  225|  15.7k|{
  226|       |    // Extra-fast test for pay-to-script-hash CScripts:
  227|  15.7k|    return (this->size() == 23 &&
  ------------------
  |  Branch (227:13): [True: 0, False: 15.7k]
  ------------------
  228|  15.7k|            (*this)[0] == OP_HASH160 &&
  ------------------
  |  Branch (228:13): [True: 0, False: 0]
  ------------------
  229|  15.7k|            (*this)[1] == 0x14 &&
  ------------------
  |  Branch (229:13): [True: 0, False: 0]
  ------------------
  230|  15.7k|            (*this)[22] == OP_EQUAL);
  ------------------
  |  Branch (230:13): [True: 0, False: 0]
  ------------------
  231|  15.7k|}
_ZNK7CScript24IsPayToWitnessScriptHashEv:
  234|  3.94k|{
  235|       |    // Extra-fast test for pay-to-witness-script-hash CScripts:
  236|  3.94k|    return (this->size() == 34 &&
  ------------------
  |  Branch (236:13): [True: 0, False: 3.94k]
  ------------------
  237|  3.94k|            (*this)[0] == OP_0 &&
  ------------------
  |  Branch (237:13): [True: 0, False: 0]
  ------------------
  238|  3.94k|            (*this)[1] == 0x20);
  ------------------
  |  Branch (238:13): [True: 0, False: 0]
  ------------------
  239|  3.94k|}
_ZNK7CScript16IsWitnessProgramERiRNSt3__16vectorIhNS1_9allocatorIhEEEE:
  244|  11.8k|{
  245|  11.8k|    if (this->size() < 4 || this->size() > 42) {
  ------------------
  |  Branch (245:9): [True: 0, False: 11.8k]
  |  Branch (245:29): [True: 0, False: 11.8k]
  ------------------
  246|      0|        return false;
  247|      0|    }
  248|  11.8k|    if ((*this)[0] != OP_0 && ((*this)[0] < OP_1 || (*this)[0] > OP_16)) {
  ------------------
  |  Branch (248:9): [True: 11.8k, False: 0]
  |  Branch (248:32): [True: 5.91k, False: 5.91k]
  |  Branch (248:53): [True: 0, False: 5.91k]
  ------------------
  249|  5.91k|        return false;
  250|  5.91k|    }
  251|  5.91k|    if ((size_t)((*this)[1] + 2) == this->size()) {
  ------------------
  |  Branch (251:9): [True: 0, False: 5.91k]
  ------------------
  252|      0|        version = DecodeOP_N((opcodetype)(*this)[0]);
  253|      0|        program = std::vector<unsigned char>(this->begin() + 2, this->end());
  254|      0|        return true;
  255|      0|    }
  256|  5.91k|    return false;
  257|  5.91k|}
_ZNK7CScript10IsPushOnlyEN9prevectorILj28EhjiE14const_iteratorE:
  260|  3.94k|{
  261|  11.8k|    while (pc < end())
  ------------------
  |  Branch (261:12): [True: 11.8k, False: 0]
  ------------------
  262|  11.8k|    {
  263|  11.8k|        opcodetype opcode;
  264|  11.8k|        if (!GetOp(pc, opcode))
  ------------------
  |  Branch (264:13): [True: 0, False: 11.8k]
  ------------------
  265|      0|            return false;
  266|       |        // Note that IsPushOnly() *does* consider OP_RESERVED to be a
  267|       |        // push-type opcode, however execution of OP_RESERVED fails, so
  268|       |        // it's not relevant to P2SH/BIP62 as the scriptSig would fail prior to
  269|       |        // the P2SH special validation code being executed.
  270|  11.8k|        if (opcode > OP_16)
  ------------------
  |  Branch (270:13): [True: 3.94k, False: 7.88k]
  ------------------
  271|  3.94k|            return false;
  272|  11.8k|    }
  273|      0|    return true;
  274|  3.94k|}
_ZNK7CScript10IsPushOnlyEv:
  277|  3.94k|{
  278|  3.94k|    return this->IsPushOnly(begin());
  279|  3.94k|}
_ZNK7CScript11HasValidOpsEv:
  294|  3.94k|{
  295|  3.94k|    CScript::const_iterator it = begin();
  296|  15.7k|    while (it < end()) {
  ------------------
  |  Branch (296:12): [True: 11.8k, False: 3.94k]
  ------------------
  297|  11.8k|        opcodetype opcode;
  298|  11.8k|        std::vector<unsigned char> item;
  299|  11.8k|        if (!GetOp(it, opcode, item) || opcode > MAX_OPCODE || item.size() > MAX_SCRIPT_ELEMENT_SIZE) {
  ------------------
  |  Branch (299:13): [True: 0, False: 11.8k]
  |  Branch (299:41): [True: 0, False: 11.8k]
  |  Branch (299:64): [True: 0, False: 11.8k]
  ------------------
  300|      0|            return false;
  301|      0|        }
  302|  11.8k|    }
  303|  3.94k|    return true;
  304|  3.94k|}
_Z11GetScriptOpRN9prevectorILj28EhjiE14const_iteratorES1_R10opcodetypePNSt3__16vectorIhNS5_9allocatorIhEEEE:
  307|  35.4k|{
  308|  35.4k|    opcodeRet = OP_INVALIDOPCODE;
  309|  35.4k|    if (pvchRet)
  ------------------
  |  Branch (309:9): [True: 23.6k, False: 11.8k]
  ------------------
  310|  23.6k|        pvchRet->clear();
  311|  35.4k|    if (pc >= end)
  ------------------
  |  Branch (311:9): [True: 0, False: 35.4k]
  ------------------
  312|      0|        return false;
  313|       |
  314|       |    // Read instruction
  315|  35.4k|    if (end - pc < 1)
  ------------------
  |  Branch (315:9): [True: 0, False: 35.4k]
  ------------------
  316|      0|        return false;
  317|  35.4k|    unsigned int opcode = *pc++;
  318|       |
  319|       |    // Immediate operand
  320|  35.4k|    if (opcode <= OP_PUSHDATA4)
  ------------------
  |  Branch (320:9): [True: 11.8k, False: 23.6k]
  ------------------
  321|  11.8k|    {
  322|  11.8k|        unsigned int nSize = 0;
  323|  11.8k|        if (opcode < OP_PUSHDATA1)
  ------------------
  |  Branch (323:13): [True: 11.8k, False: 0]
  ------------------
  324|  11.8k|        {
  325|  11.8k|            nSize = opcode;
  326|  11.8k|        }
  327|      0|        else if (opcode == OP_PUSHDATA1)
  ------------------
  |  Branch (327:18): [True: 0, False: 0]
  ------------------
  328|      0|        {
  329|      0|            if (end - pc < 1)
  ------------------
  |  Branch (329:17): [True: 0, False: 0]
  ------------------
  330|      0|                return false;
  331|      0|            nSize = *pc++;
  332|      0|        }
  333|      0|        else if (opcode == OP_PUSHDATA2)
  ------------------
  |  Branch (333:18): [True: 0, False: 0]
  ------------------
  334|      0|        {
  335|      0|            if (end - pc < 2)
  ------------------
  |  Branch (335:17): [True: 0, False: 0]
  ------------------
  336|      0|                return false;
  337|      0|            nSize = ReadLE16(&pc[0]);
  338|      0|            pc += 2;
  339|      0|        }
  340|      0|        else if (opcode == OP_PUSHDATA4)
  ------------------
  |  Branch (340:18): [True: 0, False: 0]
  ------------------
  341|      0|        {
  342|      0|            if (end - pc < 4)
  ------------------
  |  Branch (342:17): [True: 0, False: 0]
  ------------------
  343|      0|                return false;
  344|      0|            nSize = ReadLE32(&pc[0]);
  345|      0|            pc += 4;
  346|      0|        }
  347|  11.8k|        if (end - pc < 0 || (unsigned int)(end - pc) < nSize)
  ------------------
  |  Branch (347:13): [True: 0, False: 11.8k]
  |  Branch (347:29): [True: 0, False: 11.8k]
  ------------------
  348|      0|            return false;
  349|  11.8k|        if (pvchRet)
  ------------------
  |  Branch (349:13): [True: 7.88k, False: 3.94k]
  ------------------
  350|  7.88k|            pvchRet->assign(pc, pc + nSize);
  351|  11.8k|        pc += nSize;
  352|  11.8k|    }
  353|       |
  354|  35.4k|    opcodeRet = static_cast<opcodetype>(opcode);
  355|  35.4k|    return true;
  356|  35.4k|}

_ZN7CScript14AppendDataSizeEj:
  418|  11.8k|    {
  419|  11.8k|        if (size < OP_PUSHDATA1) {
  ------------------
  |  Branch (419:13): [True: 11.8k, False: 0]
  ------------------
  420|  11.8k|            insert(end(), static_cast<value_type>(size));
  421|  11.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|  11.8k|    }
_ZN7CScript10AppendDataENSt3__14spanIKhLm18446744073709551615EEE:
  438|  11.8k|    {
  439|  11.8k|        insert(end(), data.begin(), data.end());
  440|  11.8k|    }
_ZN7CScript10push_int64El:
  444|  3.94k|    {
  445|  3.94k|        if (n == -1 || (n >= 1 && n <= 16))
  ------------------
  |  Branch (445:13): [True: 0, False: 3.94k]
  |  Branch (445:25): [True: 3.94k, False: 0]
  |  Branch (445:35): [True: 3.94k, False: 0]
  ------------------
  446|  3.94k|        {
  447|  3.94k|            push_back(n + (OP_1 - 1));
  448|  3.94k|        }
  449|      0|        else if (n == 0)
  ------------------
  |  Branch (449:18): [True: 0, False: 0]
  ------------------
  450|      0|        {
  451|      0|            push_back(OP_0);
  452|      0|        }
  453|      0|        else
  454|      0|        {
  455|      0|            *this << CScriptNum::serialize(n);
  456|      0|        }
  457|  3.94k|        return *this;
  458|  3.94k|    }
_ZN7CScriptlsEl:
  477|  3.94k|    CScript& operator<<(int64_t b) LIFETIMEBOUND { return push_int64(b); }
_ZN7CScriptlsE10opcodetype:
  480|  17.7k|    {
  481|  17.7k|        if (opcode < 0 || opcode > 0xff)
  ------------------
  |  Branch (481:13): [True: 0, False: 17.7k]
  |  Branch (481:27): [True: 0, False: 17.7k]
  ------------------
  482|      0|            throw std::runtime_error("CScript::operator<<(): invalid opcode");
  483|  17.7k|        insert(end(), (unsigned char)opcode);
  484|  17.7k|        return *this;
  485|  17.7k|    }
_ZN7CScriptlsENSt3__14spanIKSt4byteLm18446744073709551615EEE:
  494|  11.8k|    {
  495|  11.8k|        AppendDataSize(b.size());
  496|  11.8k|        AppendData({reinterpret_cast<const value_type*>(b.data()), b.size()});
  497|  11.8k|        return *this;
  498|  11.8k|    }
_ZN7CScriptlsENSt3__14spanIKhLm18446744073709551615EEE:
  502|  11.8k|    {
  503|  11.8k|        return *this << std::as_bytes(b);
  504|  11.8k|    }
_ZNK7CScript5GetOpERN9prevectorILj28EhjiE14const_iteratorER10opcodetypeRNSt3__16vectorIhNS6_9allocatorIhEEEE:
  507|  23.6k|    {
  508|  23.6k|        return GetScriptOp(pc, end(), opcodeRet, &vchRet);
  509|  23.6k|    }
_ZNK7CScript5GetOpERN9prevectorILj28EhjiE14const_iteratorER10opcodetype:
  512|  11.8k|    {
  513|  11.8k|        return GetScriptOp(pc, end(), opcodeRet, nullptr);
  514|  11.8k|    }
_ZN7CScript10DecodeOP_NE10opcodetype:
  518|  7.88k|    {
  519|  7.88k|        if (opcode == OP_0)
  ------------------
  |  Branch (519:13): [True: 0, False: 7.88k]
  ------------------
  520|      0|            return 0;
  521|  7.88k|        assert(opcode >= OP_1 && opcode <= OP_16);
  522|  7.88k|        return (int)opcode - (int)(OP_1 - 1);
  523|  7.88k|    }
_ZNK7CScript13IsUnspendableEv:
  572|  3.94k|    {
  573|  3.94k|        return (size() > 0 && *begin() == OP_RETURN) || (size() > MAX_SCRIPT_SIZE);
  ------------------
  |  Branch (573:17): [True: 3.94k, False: 0]
  |  Branch (573:31): [True: 0, False: 3.94k]
  |  Branch (573:57): [True: 0, False: 3.94k]
  ------------------
  574|  3.94k|    }
_ZN7CScriptC2Ev:
  461|  15.7k|    CScript() = default;
_Z12ToByteVectorI7CPubKeyENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   68|  1.97k|{
   69|  1.97k|    return std::vector<unsigned char>(in.begin(), in.end());
   70|  1.97k|}
_Z12ToByteVectorI6PKHashENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   68|  1.97k|{
   69|  1.97k|    return std::vector<unsigned char>(in.begin(), in.end());
   70|  1.97k|}
_Z12ToByteVectorI16WitnessV0KeyHashENSt3__16vectorIhNS1_9allocatorIhEEEERKT_:
   68|  5.91k|{
   69|  5.91k|    return std::vector<unsigned char>(in.begin(), in.end());
   70|  5.91k|}

_Z14IsSegWitOutputRK15SigningProviderRK7CScript:
  748|  3.94k|{
  749|  3.94k|    int version;
  750|  3.94k|    valtype program;
  751|  3.94k|    if (script.IsWitnessProgram(version, program)) return true;
  ------------------
  |  Branch (751:9): [True: 0, False: 3.94k]
  ------------------
  752|  3.94k|    if (script.IsPayToScriptHash()) {
  ------------------
  |  Branch (752:9): [True: 0, False: 3.94k]
  ------------------
  753|      0|        std::vector<valtype> solutions;
  754|      0|        auto whichtype = Solver(script, solutions);
  755|      0|        if (whichtype == TxoutType::SCRIPTHASH) {
  ------------------
  |  Branch (755:13): [True: 0, False: 0]
  ------------------
  756|      0|            auto h160 = uint160(solutions[0]);
  757|      0|            CScript subscript;
  758|      0|            if (provider.GetCScript(CScriptID{h160}, subscript)) {
  ------------------
  |  Branch (758:17): [True: 0, False: 0]
  ------------------
  759|      0|                if (subscript.IsWitnessProgram(version, program)) return true;
  ------------------
  |  Branch (759:21): [True: 0, False: 0]
  ------------------
  760|      0|            }
  761|      0|        }
  762|      0|    }
  763|  3.94k|    return false;
  764|  3.94k|}

_ZN23FillableSigningProvider32ImplicitlyLearnRelatedKeyScriptsERK7CPubKey:
   96|  3.94k|{
   97|  3.94k|    AssertLockHeld(cs_KeyStore);
  ------------------
  |  |  142|  3.94k|#define AssertLockHeld(cs) AssertLockHeldInternal(#cs, __FILE__, __LINE__, &cs)
  ------------------
   98|  3.94k|    CKeyID key_id = pubkey.GetID();
   99|       |    // This adds the redeemscripts necessary to detect P2WPKH and P2SH-P2WPKH
  100|       |    // outputs. Technically P2WPKH outputs don't have a redeemscript to be
  101|       |    // spent. However, our current IsMine logic requires the corresponding
  102|       |    // P2SH-P2WPKH redeemscript to be present in the wallet in order to accept
  103|       |    // payment even to P2WPKH outputs.
  104|       |    // Also note that having superfluous scripts in the keystore never hurts.
  105|       |    // They're only used to guide recursion in signing and IsMine logic - if
  106|       |    // a script is present but we can't do anything with it, it has no effect.
  107|       |    // "Implicitly" refers to fact that scripts are derived automatically from
  108|       |    // existing keys, and are present in memory, even without being explicitly
  109|       |    // loaded (e.g. from a file).
  110|  3.94k|    if (pubkey.IsCompressed()) {
  ------------------
  |  Branch (110:9): [True: 3.94k, False: 0]
  ------------------
  111|  3.94k|        CScript script = GetScriptForDestination(WitnessV0KeyHash(key_id));
  112|       |        // This does not use AddCScript, as it may be overridden.
  113|  3.94k|        CScriptID id(script);
  114|  3.94k|        mapScripts[id] = std::move(script);
  115|  3.94k|    }
  116|  3.94k|}
_ZNK23FillableSigningProvider9GetPubKeyERK6CKeyIDR7CPubKey:
  119|  3.94k|{
  120|  3.94k|    CKey key;
  121|  3.94k|    if (!GetKey(address, key)) {
  ------------------
  |  Branch (121:9): [True: 0, False: 3.94k]
  ------------------
  122|      0|        return false;
  123|      0|    }
  124|  3.94k|    vchPubKeyOut = key.GetPubKey();
  125|  3.94k|    return true;
  126|  3.94k|}
_ZN23FillableSigningProvider12AddKeyPubKeyERK4CKeyRK7CPubKey:
  129|  3.94k|{
  130|  3.94k|    LOCK(cs_KeyStore);
  ------------------
  |  |  257|  3.94k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  3.94k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  3.94k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  3.94k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  131|  3.94k|    mapKeys[pubkey.GetID()] = key;
  132|  3.94k|    ImplicitlyLearnRelatedKeyScripts(pubkey);
  133|  3.94k|    return true;
  134|  3.94k|}
_ZNK23FillableSigningProvider7HaveKeyERK6CKeyID:
  137|  9.85k|{
  138|  9.85k|    LOCK(cs_KeyStore);
  ------------------
  |  |  257|  9.85k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  9.85k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  9.85k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  9.85k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  139|  9.85k|    return mapKeys.count(address) > 0;
  140|  9.85k|}
_ZNK23FillableSigningProvider7GetKeysEv:
  143|  3.94k|{
  144|  3.94k|    LOCK(cs_KeyStore);
  ------------------
  |  |  257|  3.94k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  3.94k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  3.94k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  3.94k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  145|  3.94k|    std::set<CKeyID> set_address;
  146|  3.94k|    for (const auto& mi : mapKeys) {
  ------------------
  |  Branch (146:25): [True: 1.97k, False: 3.94k]
  ------------------
  147|  1.97k|        set_address.insert(mi.first);
  148|  1.97k|    }
  149|  3.94k|    return set_address;
  150|  3.94k|}
_ZNK23FillableSigningProvider6GetKeyERK6CKeyIDR4CKey:
  153|  5.91k|{
  154|  5.91k|    LOCK(cs_KeyStore);
  ------------------
  |  |  257|  5.91k|#define LOCK(cs) UniqueLock UNIQUE_NAME(criticalblock)(MaybeCheckNotHeld(cs), #cs, __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  |   11|  5.91k|#define UNIQUE_NAME(name) PASTE2(name, __COUNTER__)
  |  |  |  |  ------------------
  |  |  |  |  |  |    9|  5.91k|#define PASTE2(x, y) PASTE(x, y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |    8|  5.91k|#define PASTE(x, y) x ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  155|  5.91k|    KeyMap::const_iterator mi = mapKeys.find(address);
  156|  5.91k|    if (mi != mapKeys.end()) {
  ------------------
  |  Branch (156:9): [True: 5.91k, False: 0]
  ------------------
  157|  5.91k|        keyOut = mi->second;
  158|  5.91k|        return true;
  159|  5.91k|    }
  160|      0|    return false;
  161|  5.91k|}
_Z20GetKeyForDestinationRK15SigningProviderRKNSt3__17variantIJ14CNoDestination17PubKeyDestination6PKHash10ScriptHash19WitnessV0ScriptHash16WitnessV0KeyHash16WitnessV1Taproot11PayToAnchor14WitnessUnknownEEE:
  204|  3.94k|{
  205|       |    // Only supports destinations which map to single public keys:
  206|       |    // P2PKH, P2WPKH, P2SH-P2WPKH, P2TR
  207|  3.94k|    if (auto id = std::get_if<PKHash>(&dest)) {
  ------------------
  |  Branch (207:14): [True: 3.94k, False: 0]
  ------------------
  208|  3.94k|        return ToKeyID(*id);
  209|  3.94k|    }
  210|      0|    if (auto witness_id = std::get_if<WitnessV0KeyHash>(&dest)) {
  ------------------
  |  Branch (210:14): [True: 0, False: 0]
  ------------------
  211|      0|        return ToKeyID(*witness_id);
  212|      0|    }
  213|      0|    if (auto script_hash = std::get_if<ScriptHash>(&dest)) {
  ------------------
  |  Branch (213:14): [True: 0, False: 0]
  ------------------
  214|      0|        CScript script;
  215|      0|        CScriptID script_id = ToScriptID(*script_hash);
  216|      0|        CTxDestination inner_dest;
  217|      0|        if (store.GetCScript(script_id, script) && ExtractDestination(script, inner_dest)) {
  ------------------
  |  Branch (217:13): [True: 0, False: 0]
  |  Branch (217:52): [True: 0, False: 0]
  ------------------
  218|      0|            if (auto inner_witness_id = std::get_if<WitnessV0KeyHash>(&inner_dest)) {
  ------------------
  |  Branch (218:22): [True: 0, False: 0]
  ------------------
  219|      0|                return ToKeyID(*inner_witness_id);
  220|      0|            }
  221|      0|        }
  222|      0|    }
  223|      0|    if (auto output_key = std::get_if<WitnessV1Taproot>(&dest)) {
  ------------------
  |  Branch (223:14): [True: 0, False: 0]
  ------------------
  224|      0|        TaprootSpendData spenddata;
  225|      0|        CPubKey pub;
  226|      0|        if (store.GetTaprootSpendData(*output_key, spenddata)
  ------------------
  |  Branch (226:13): [True: 0, False: 0]
  ------------------
  227|      0|            && !spenddata.internal_key.IsNull()
  ------------------
  |  Branch (227:16): [True: 0, False: 0]
  ------------------
  228|      0|            && spenddata.merkle_root.IsNull()
  ------------------
  |  Branch (228:16): [True: 0, False: 0]
  ------------------
  229|      0|            && store.GetPubKeyByXOnly(spenddata.internal_key, pub)) {
  ------------------
  |  Branch (229:16): [True: 0, False: 0]
  ------------------
  230|      0|            return pub.GetID();
  231|      0|        }
  232|      0|    }
  233|      0|    return CKeyID();
  234|      0|}

_ZNK15SigningProvider12GetKeyOriginERK6CKeyIDR13KeyOriginInfo:
  161|  1.97k|    virtual bool GetKeyOrigin(const CKeyID& keyid, KeyOriginInfo& info) const { return false; }
_ZN23FillableSigningProvider6AddKeyERK4CKey:
  290|  1.97k|    virtual bool AddKey(const CKey &key) { return AddKeyPubKey(key, key.GetPubKey()); }
_ZN15SigningProviderD2Ev:
  155|  3.94k|    virtual ~SigningProvider() = default;

_Z6SolverRK7CScriptRNSt3__16vectorINS3_IhNS2_9allocatorIhEEEENS4_IS6_EEEE:
  142|  7.88k|{
  143|  7.88k|    vSolutionsRet.clear();
  144|       |
  145|       |    // Shortcut for pay-to-script-hash, which are more constrained than the other types:
  146|       |    // it is always OP_HASH160 20 [20 byte hash] OP_EQUAL
  147|  7.88k|    if (scriptPubKey.IsPayToScriptHash())
  ------------------
  |  Branch (147:9): [True: 0, False: 7.88k]
  ------------------
  148|      0|    {
  149|      0|        std::vector<unsigned char> hashBytes(scriptPubKey.begin()+2, scriptPubKey.begin()+22);
  150|      0|        vSolutionsRet.push_back(hashBytes);
  151|      0|        return TxoutType::SCRIPTHASH;
  152|      0|    }
  153|       |
  154|  7.88k|    int witnessversion;
  155|  7.88k|    std::vector<unsigned char> witnessprogram;
  156|  7.88k|    if (scriptPubKey.IsWitnessProgram(witnessversion, witnessprogram)) {
  ------------------
  |  Branch (156:9): [True: 0, False: 7.88k]
  ------------------
  157|      0|        if (witnessversion == 0 && witnessprogram.size() == WITNESS_V0_KEYHASH_SIZE) {
  ------------------
  |  Branch (157:13): [True: 0, False: 0]
  |  Branch (157:36): [True: 0, False: 0]
  ------------------
  158|      0|            vSolutionsRet.push_back(std::move(witnessprogram));
  159|      0|            return TxoutType::WITNESS_V0_KEYHASH;
  160|      0|        }
  161|      0|        if (witnessversion == 0 && witnessprogram.size() == WITNESS_V0_SCRIPTHASH_SIZE) {
  ------------------
  |  Branch (161:13): [True: 0, False: 0]
  |  Branch (161:36): [True: 0, False: 0]
  ------------------
  162|      0|            vSolutionsRet.push_back(std::move(witnessprogram));
  163|      0|            return TxoutType::WITNESS_V0_SCRIPTHASH;
  164|      0|        }
  165|      0|        if (witnessversion == 1 && witnessprogram.size() == WITNESS_V1_TAPROOT_SIZE) {
  ------------------
  |  Branch (165:13): [True: 0, False: 0]
  |  Branch (165:36): [True: 0, False: 0]
  ------------------
  166|      0|            vSolutionsRet.push_back(std::move(witnessprogram));
  167|      0|            return TxoutType::WITNESS_V1_TAPROOT;
  168|      0|        }
  169|      0|        if (scriptPubKey.IsPayToAnchor()) {
  ------------------
  |  Branch (169:13): [True: 0, False: 0]
  ------------------
  170|      0|            return TxoutType::ANCHOR;
  171|      0|        }
  172|      0|        if (witnessversion != 0) {
  ------------------
  |  Branch (172:13): [True: 0, False: 0]
  ------------------
  173|      0|            vSolutionsRet.push_back(std::vector<unsigned char>{(unsigned char)witnessversion});
  174|      0|            vSolutionsRet.push_back(std::move(witnessprogram));
  175|      0|            return TxoutType::WITNESS_UNKNOWN;
  176|      0|        }
  177|      0|        return TxoutType::NONSTANDARD;
  178|      0|    }
  179|       |
  180|       |    // Provably prunable, data-carrying output
  181|       |    //
  182|       |    // So long as script passes the IsUnspendable() test and all but the first
  183|       |    // byte passes the IsPushOnly() test we don't care what exactly is in the
  184|       |    // script.
  185|  7.88k|    if (scriptPubKey.size() >= 1 && scriptPubKey[0] == OP_RETURN && scriptPubKey.IsPushOnly(scriptPubKey.begin()+1)) {
  ------------------
  |  Branch (185:9): [True: 7.88k, False: 0]
  |  Branch (185:9): [True: 0, False: 7.88k]
  |  Branch (185:37): [True: 0, False: 7.88k]
  |  Branch (185:69): [True: 0, False: 0]
  ------------------
  186|      0|        return TxoutType::NULL_DATA;
  187|      0|    }
  188|       |
  189|  7.88k|    std::vector<unsigned char> data;
  190|  7.88k|    if (MatchPayToPubkey(scriptPubKey, data)) {
  ------------------
  |  Branch (190:9): [True: 3.94k, False: 3.94k]
  ------------------
  191|  3.94k|        vSolutionsRet.push_back(std::move(data));
  192|  3.94k|        return TxoutType::PUBKEY;
  193|  3.94k|    }
  194|       |
  195|  3.94k|    if (MatchPayToPubkeyHash(scriptPubKey, data)) {
  ------------------
  |  Branch (195:9): [True: 0, False: 3.94k]
  ------------------
  196|      0|        vSolutionsRet.push_back(std::move(data));
  197|      0|        return TxoutType::PUBKEYHASH;
  198|      0|    }
  199|       |
  200|  3.94k|    int required;
  201|  3.94k|    std::vector<std::vector<unsigned char>> keys;
  202|  3.94k|    if (MatchMultisig(scriptPubKey, required, keys)) {
  ------------------
  |  Branch (202:9): [True: 3.94k, False: 0]
  ------------------
  203|  3.94k|        vSolutionsRet.push_back({static_cast<unsigned char>(required)}); // safe as required is in range 1..20
  204|  3.94k|        vSolutionsRet.insert(vSolutionsRet.end(), keys.begin(), keys.end());
  205|  3.94k|        vSolutionsRet.push_back({static_cast<unsigned char>(keys.size())}); // safe as size is in range 1..20
  206|  3.94k|        return TxoutType::MULTISIG;
  207|  3.94k|    }
  208|       |
  209|      0|    vSolutionsRet.clear();
  210|      0|    return TxoutType::NONSTANDARD;
  211|  3.94k|}
_Z21GetScriptForRawPubKeyRK7CPubKey:
  214|  1.97k|{
  215|  1.97k|    return CScript() << std::vector<unsigned char>(pubKey.begin(), pubKey.end()) << OP_CHECKSIG;
  216|  1.97k|}
_Z20GetScriptForMultisigiRKNSt3__16vectorI7CPubKeyNS_9allocatorIS1_EEEE:
  219|  1.97k|{
  220|  1.97k|    CScript script;
  221|       |
  222|  1.97k|    script << nRequired;
  223|  1.97k|    for (const CPubKey& key : keys)
  ------------------
  |  Branch (223:29): [True: 1.97k, False: 1.97k]
  ------------------
  224|  1.97k|        script << ToByteVector(key);
  225|  1.97k|    script << keys.size() << OP_CHECKMULTISIG;
  226|       |
  227|  1.97k|    return script;
  228|  1.97k|}
solver.cpp:_ZL15GetScriptNumber10opcodetypeNSt3__16vectorIhNS0_9allocatorIhEEEEii:
   67|  7.88k|{
   68|  7.88k|    int count;
   69|  7.88k|    if (IsSmallInteger(opcode)) {
  ------------------
  |  Branch (69:9): [True: 7.88k, False: 0]
  ------------------
   70|  7.88k|        count = CScript::DecodeOP_N(opcode);
   71|  7.88k|    } else if (IsPushdataOp(opcode)) {
  ------------------
  |  Branch (71:16): [True: 0, False: 0]
  ------------------
   72|      0|        if (!CheckMinimalPush(data, opcode)) return {};
  ------------------
  |  Branch (72:13): [True: 0, False: 0]
  ------------------
   73|      0|        try {
   74|      0|            count = CScriptNum(data, /* fRequireMinimal = */ true).getint();
   75|      0|        } catch (const scriptnum_error&) {
   76|      0|            return {};
   77|      0|        }
   78|      0|    } else {
   79|      0|        return {};
   80|      0|    }
   81|  7.88k|    if (count < min || count > max) return {};
  ------------------
  |  Branch (81:9): [True: 0, False: 7.88k]
  |  Branch (81:24): [True: 0, False: 7.88k]
  ------------------
   82|  7.88k|    return count;
   83|  7.88k|}
solver.cpp:_ZL14IsSmallInteger10opcodetype:
   60|  7.88k|{
   61|  7.88k|    return opcode >= OP_1 && opcode <= OP_16;
  ------------------
  |  Branch (61:12): [True: 7.88k, False: 0]
  |  Branch (61:30): [True: 7.88k, False: 0]
  ------------------
   62|  7.88k|}
solver.cpp:_ZL16MatchPayToPubkeyRK7CScriptRNSt3__16vectorIhNS2_9allocatorIhEEEE:
   37|  7.88k|{
   38|  7.88k|    if (script.size() == CPubKey::SIZE + 2 && script[0] == CPubKey::SIZE && script.back() == OP_CHECKSIG) {
  ------------------
  |  Branch (38:9): [True: 0, False: 7.88k]
  |  Branch (38:47): [True: 0, False: 0]
  |  Branch (38:77): [True: 0, False: 0]
  ------------------
   39|      0|        pubkey = valtype(script.begin() + 1, script.begin() + CPubKey::SIZE + 1);
   40|      0|        return CPubKey::ValidSize(pubkey);
   41|      0|    }
   42|  7.88k|    if (script.size() == CPubKey::COMPRESSED_SIZE + 2 && script[0] == CPubKey::COMPRESSED_SIZE && script.back() == OP_CHECKSIG) {
  ------------------
  |  Branch (42:9): [True: 3.94k, False: 3.94k]
  |  Branch (42:58): [True: 3.94k, False: 0]
  |  Branch (42:99): [True: 3.94k, False: 0]
  ------------------
   43|  3.94k|        pubkey = valtype(script.begin() + 1, script.begin() + CPubKey::COMPRESSED_SIZE + 1);
   44|  3.94k|        return CPubKey::ValidSize(pubkey);
   45|  3.94k|    }
   46|  3.94k|    return false;
   47|  7.88k|}
solver.cpp:_ZL20MatchPayToPubkeyHashRK7CScriptRNSt3__16vectorIhNS2_9allocatorIhEEEE:
   50|  3.94k|{
   51|  3.94k|    if (script.size() == 25 && script[0] == OP_DUP && script[1] == OP_HASH160 && script[2] == 20 && script[23] == OP_EQUALVERIFY && script[24] == OP_CHECKSIG) {
  ------------------
  |  Branch (51:9): [True: 0, False: 3.94k]
  |  Branch (51:32): [True: 0, False: 0]
  |  Branch (51:55): [True: 0, False: 0]
  |  Branch (51:82): [True: 0, False: 0]
  |  Branch (51:101): [True: 0, False: 0]
  |  Branch (51:133): [True: 0, False: 0]
  ------------------
   52|      0|        pubkeyhash = valtype(script.begin () + 3, script.begin() + 23);
   53|      0|        return true;
   54|      0|    }
   55|  3.94k|    return false;
   56|  3.94k|}
solver.cpp:_ZL13MatchMultisigRK7CScriptRiRNSt3__16vectorINS4_IhNS3_9allocatorIhEEEENS5_IS7_EEEE:
   86|  3.94k|{
   87|  3.94k|    opcodetype opcode;
   88|  3.94k|    valtype data;
   89|       |
   90|  3.94k|    CScript::const_iterator it = script.begin();
   91|  3.94k|    if (script.size() < 1 || script.back() != OP_CHECKMULTISIG) return false;
  ------------------
  |  Branch (91:9): [True: 0, False: 3.94k]
  |  Branch (91:30): [True: 0, False: 3.94k]
  ------------------
   92|       |
   93|  3.94k|    if (!script.GetOp(it, opcode, data)) return false;
  ------------------
  |  Branch (93:9): [True: 0, False: 3.94k]
  ------------------
   94|  3.94k|    auto req_sigs = GetScriptNumber(opcode, data, 1, MAX_PUBKEYS_PER_MULTISIG);
   95|  3.94k|    if (!req_sigs) return false;
  ------------------
  |  Branch (95:9): [True: 0, False: 3.94k]
  ------------------
   96|  3.94k|    required_sigs = *req_sigs;
   97|  7.88k|    while (script.GetOp(it, opcode, data) && CPubKey::ValidSize(data)) {
  ------------------
  |  Branch (97:12): [True: 7.88k, False: 0]
  |  Branch (97:46): [True: 3.94k, False: 3.94k]
  ------------------
   98|  3.94k|        pubkeys.emplace_back(std::move(data));
   99|  3.94k|    }
  100|  3.94k|    auto num_keys = GetScriptNumber(opcode, data, required_sigs, MAX_PUBKEYS_PER_MULTISIG);
  101|  3.94k|    if (!num_keys) return false;
  ------------------
  |  Branch (101:9): [True: 0, False: 3.94k]
  ------------------
  102|  3.94k|    if (pubkeys.size() != static_cast<unsigned long>(*num_keys)) return false;
  ------------------
  |  Branch (102:9): [True: 0, False: 3.94k]
  ------------------
  103|       |
  104|  3.94k|    return (it + 1 == script.end());
  105|  3.94k|}

secp256k1.c:secp256k1_ecdsa_sig_serialize:
  171|  5.91k|static int secp256k1_ecdsa_sig_serialize(unsigned char *sig, size_t *size, const secp256k1_scalar* ar, const secp256k1_scalar* as) {
  172|  5.91k|    unsigned char r[33] = {0}, s[33] = {0};
  173|  5.91k|    unsigned char *rp = r, *sp = s;
  174|  5.91k|    size_t lenR = 33, lenS = 33;
  175|  5.91k|    secp256k1_scalar_get_b32(&r[1], ar);
  176|  5.91k|    secp256k1_scalar_get_b32(&s[1], as);
  177|  10.8k|    while (lenR > 1 && rp[0] == 0 && rp[1] < 0x80) { lenR--; rp++; }
  ------------------
  |  Branch (177:12): [True: 10.8k, False: 0]
  |  Branch (177:24): [True: 5.96k, False: 4.90k]
  |  Branch (177:38): [True: 4.95k, False: 1.01k]
  ------------------
  178|  11.8k|    while (lenS > 1 && sp[0] == 0 && sp[1] < 0x80) { lenS--; sp++; }
  ------------------
  |  Branch (178:12): [True: 11.8k, False: 0]
  |  Branch (178:24): [True: 5.98k, False: 5.87k]
  |  Branch (178:38): [True: 5.94k, False: 35]
  ------------------
  179|  5.91k|    if (*size < 6+lenS+lenR) {
  ------------------
  |  Branch (179:9): [True: 0, False: 5.91k]
  ------------------
  180|      0|        *size = 6 + lenS + lenR;
  181|      0|        return 0;
  182|      0|    }
  183|  5.91k|    *size = 6 + lenS + lenR;
  184|  5.91k|    sig[0] = 0x30;
  185|  5.91k|    sig[1] = 4 + lenS + lenR;
  186|  5.91k|    sig[2] = 0x02;
  187|  5.91k|    sig[3] = lenR;
  188|  5.91k|    memcpy(sig+4, rp, lenR);
  189|  5.91k|    sig[4+lenR] = 0x02;
  190|  5.91k|    sig[5+lenR] = lenS;
  191|  5.91k|    memcpy(sig+lenR+6, sp, lenS);
  192|  5.91k|    return 1;
  193|  5.91k|}
secp256k1.c:secp256k1_ecdsa_sig_verify:
  195|  11.8k|static int secp256k1_ecdsa_sig_verify(const secp256k1_scalar *sigr, const secp256k1_scalar *sigs, const secp256k1_ge *pubkey, const secp256k1_scalar *message) {
  196|  11.8k|    unsigned char c[32];
  197|  11.8k|    secp256k1_scalar sn, u1, u2;
  198|  11.8k|#if !defined(EXHAUSTIVE_TEST_ORDER)
  199|  11.8k|    secp256k1_fe xr;
  200|  11.8k|#endif
  201|  11.8k|    secp256k1_gej pubkeyj;
  202|  11.8k|    secp256k1_gej pr;
  203|       |
  204|  11.8k|    if (secp256k1_scalar_is_zero(sigr) || secp256k1_scalar_is_zero(sigs)) {
  ------------------
  |  Branch (204:9): [True: 0, False: 11.8k]
  |  Branch (204:43): [True: 0, False: 11.8k]
  ------------------
  205|      0|        return 0;
  206|      0|    }
  207|       |
  208|  11.8k|    secp256k1_scalar_inverse_var(&sn, sigs);
  209|  11.8k|    secp256k1_scalar_mul(&u1, &sn, message);
  210|  11.8k|    secp256k1_scalar_mul(&u2, &sn, sigr);
  211|  11.8k|    secp256k1_gej_set_ge(&pubkeyj, pubkey);
  212|  11.8k|    secp256k1_ecmult(&pr, &pubkeyj, &u2, &u1);
  213|  11.8k|    if (secp256k1_gej_is_infinity(&pr)) {
  ------------------
  |  Branch (213:9): [True: 0, False: 11.8k]
  ------------------
  214|      0|        return 0;
  215|      0|    }
  216|       |
  217|       |#if defined(EXHAUSTIVE_TEST_ORDER)
  218|       |{
  219|       |    secp256k1_scalar computed_r;
  220|       |    secp256k1_ge pr_ge;
  221|       |    secp256k1_ge_set_gej(&pr_ge, &pr);
  222|       |    secp256k1_fe_normalize(&pr_ge.x);
  223|       |
  224|       |    secp256k1_fe_get_b32(c, &pr_ge.x);
  225|       |    secp256k1_scalar_set_b32(&computed_r, c, NULL);
  226|       |    return secp256k1_scalar_eq(sigr, &computed_r);
  227|       |}
  228|       |#else
  229|  11.8k|    secp256k1_scalar_get_b32(c, sigr);
  230|       |    /* we can ignore the fe_set_b32_limit return value, because we know the input is in range */
  231|  11.8k|    (void)secp256k1_fe_set_b32_limit(&xr, c);
  ------------------
  |  |   88|  11.8k|#  define secp256k1_fe_set_b32_limit secp256k1_fe_impl_set_b32_limit
  ------------------
  232|       |
  233|       |    /** We now have the recomputed R point in pr, and its claimed x coordinate (modulo n)
  234|       |     *  in xr. Naively, we would extract the x coordinate from pr (requiring a inversion modulo p),
  235|       |     *  compute the remainder modulo n, and compare it to xr. However:
  236|       |     *
  237|       |     *        xr == X(pr) mod n
  238|       |     *    <=> exists h. (xr + h * n < p && xr + h * n == X(pr))
  239|       |     *    [Since 2 * n > p, h can only be 0 or 1]
  240|       |     *    <=> (xr == X(pr)) || (xr + n < p && xr + n == X(pr))
  241|       |     *    [In Jacobian coordinates, X(pr) is pr.x / pr.z^2 mod p]
  242|       |     *    <=> (xr == pr.x / pr.z^2 mod p) || (xr + n < p && xr + n == pr.x / pr.z^2 mod p)
  243|       |     *    [Multiplying both sides of the equations by pr.z^2 mod p]
  244|       |     *    <=> (xr * pr.z^2 mod p == pr.x) || (xr + n < p && (xr + n) * pr.z^2 mod p == pr.x)
  245|       |     *
  246|       |     *  Thus, we can avoid the inversion, but we have to check both cases separately.
  247|       |     *  secp256k1_gej_eq_x implements the (xr * pr.z^2 mod p == pr.x) test.
  248|       |     */
  249|  11.8k|    if (secp256k1_gej_eq_x_var(&xr, &pr)) {
  ------------------
  |  Branch (249:9): [True: 11.8k, False: 0]
  ------------------
  250|       |        /* xr * pr.z^2 mod p == pr.x, so the signature is valid. */
  251|  11.8k|        return 1;
  252|  11.8k|    }
  253|      0|    if (secp256k1_fe_cmp_var(&xr, &secp256k1_ecdsa_const_p_minus_order) >= 0) {
  ------------------
  |  |   86|      0|#  define secp256k1_fe_cmp_var secp256k1_fe_impl_cmp_var
  ------------------
  |  Branch (253:9): [True: 0, False: 0]
  ------------------
  254|       |        /* xr + n >= p, so we can skip testing the second case. */
  255|      0|        return 0;
  256|      0|    }
  257|      0|    secp256k1_fe_add(&xr, &secp256k1_ecdsa_const_order_as_fe);
  ------------------
  |  |   92|      0|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  258|      0|    if (secp256k1_gej_eq_x_var(&xr, &pr)) {
  ------------------
  |  Branch (258:9): [True: 0, False: 0]
  ------------------
  259|       |        /* (xr + n) * pr.z^2 mod p == pr.x, so the signature is valid. */
  260|      0|        return 1;
  261|      0|    }
  262|      0|    return 0;
  263|      0|#endif
  264|      0|}
secp256k1.c:secp256k1_ecdsa_sig_sign:
  266|  12.3k|static int secp256k1_ecdsa_sig_sign(const secp256k1_ecmult_gen_context *ctx, secp256k1_scalar *sigr, secp256k1_scalar *sigs, const secp256k1_scalar *seckey, const secp256k1_scalar *message, const secp256k1_scalar *nonce, int *recid) {
  267|  12.3k|    unsigned char b[32];
  268|  12.3k|    secp256k1_gej rp;
  269|  12.3k|    secp256k1_ge r;
  270|  12.3k|    secp256k1_scalar n;
  271|  12.3k|    int overflow = 0;
  272|  12.3k|    int high;
  273|       |
  274|  12.3k|    secp256k1_ecmult_gen(ctx, &rp, nonce);
  275|  12.3k|    secp256k1_ge_set_gej(&r, &rp);
  276|  12.3k|    secp256k1_fe_normalize(&r.x);
  ------------------
  |  |   78|  12.3k|#  define secp256k1_fe_normalize secp256k1_fe_impl_normalize
  ------------------
  277|  12.3k|    secp256k1_fe_normalize(&r.y);
  ------------------
  |  |   78|  12.3k|#  define secp256k1_fe_normalize secp256k1_fe_impl_normalize
  ------------------
  278|  12.3k|    secp256k1_fe_get_b32(b, &r.x);
  ------------------
  |  |   89|  12.3k|#  define secp256k1_fe_get_b32 secp256k1_fe_impl_get_b32
  ------------------
  279|  12.3k|    secp256k1_scalar_set_b32(sigr, b, &overflow);
  280|  12.3k|    if (recid) {
  ------------------
  |  Branch (280:9): [True: 1.97k, False: 10.4k]
  ------------------
  281|       |        /* The overflow condition is cryptographically unreachable as hitting it requires finding the discrete log
  282|       |         * of some P where P.x >= order, and only 1 in about 2^127 points meet this criteria.
  283|       |         */
  284|  1.97k|        *recid = (overflow << 1) | secp256k1_fe_is_odd(&r.y);
  ------------------
  |  |   85|  1.97k|#  define secp256k1_fe_is_odd secp256k1_fe_impl_is_odd
  ------------------
  285|  1.97k|    }
  286|  12.3k|    secp256k1_scalar_mul(&n, sigr, seckey);
  287|  12.3k|    secp256k1_scalar_add(&n, &n, message);
  288|  12.3k|    secp256k1_scalar_inverse(sigs, nonce);
  289|  12.3k|    secp256k1_scalar_mul(sigs, sigs, &n);
  290|  12.3k|    secp256k1_scalar_clear(&n);
  291|  12.3k|    secp256k1_gej_clear(&rp);
  292|  12.3k|    secp256k1_ge_clear(&r);
  293|  12.3k|    high = secp256k1_scalar_is_high(sigs);
  294|  12.3k|    secp256k1_scalar_cond_negate(sigs, high);
  295|  12.3k|    if (recid) {
  ------------------
  |  Branch (295:9): [True: 1.97k, False: 10.4k]
  ------------------
  296|  1.97k|        *recid ^= high;
  297|  1.97k|    }
  298|       |    /* P.x = order is on the curve, so technically sig->r could end up being zero, which would be an invalid signature.
  299|       |     * This is cryptographically unreachable as hitting it requires finding the discrete log of P.x = N.
  300|       |     */
  301|  12.3k|    return (int)(!secp256k1_scalar_is_zero(sigr)) & (int)(!secp256k1_scalar_is_zero(sigs));
  302|  12.3k|}

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

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

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

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

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

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

secp256k1.c:secp256k1_ge_set_xy:
  132|   485k|static void secp256k1_ge_set_xy(secp256k1_ge *r, const secp256k1_fe *x, const secp256k1_fe *y) {
  133|   485k|    SECP256K1_FE_VERIFY(x);
  ------------------
  |  |  344|   485k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  134|   485k|    SECP256K1_FE_VERIFY(y);
  ------------------
  |  |  344|   485k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  135|       |
  136|   485k|    r->infinity = 0;
  137|   485k|    r->x = *x;
  138|   485k|    r->y = *y;
  139|       |
  140|   485k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  206|   485k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  141|   485k|}
secp256k1.c:secp256k1_ge_verify:
   78|  5.18M|static void secp256k1_ge_verify(const secp256k1_ge *a) {
   79|  5.18M|    SECP256K1_FE_VERIFY(&a->x);
  ------------------
  |  |  344|  5.18M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   80|  5.18M|    SECP256K1_FE_VERIFY(&a->y);
  ------------------
  |  |  344|  5.18M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   81|  5.18M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->x, SECP256K1_GE_X_MAGNITUDE_MAX);
  ------------------
  |  |  348|  5.18M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   82|  5.18M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->y, SECP256K1_GE_Y_MAGNITUDE_MAX);
  ------------------
  |  |  348|  5.18M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   83|  5.18M|    VERIFY_CHECK(a->infinity == 0 || a->infinity == 1);
   84|  5.18M|    (void)a;
   85|  5.18M|}
secp256k1.c:secp256k1_ge_is_in_correct_subgroup:
  886|  19.7k|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|  19.7k|    SECP256K1_GE_VERIFY(ge);
  ------------------
  |  |  206|  19.7k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  903|       |
  904|  19.7k|    (void)ge;
  905|       |    /* The real secp256k1 group has cofactor 1, so the subgroup is the entire curve. */
  906|  19.7k|    return 1;
  907|  19.7k|#endif
  908|  19.7k|}
secp256k1.c:secp256k1_ge_to_bytes:
  937|  45.3k|static void secp256k1_ge_to_bytes(unsigned char *buf, const secp256k1_ge *a) {
  938|  45.3k|    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|  45.3k|    STATIC_ASSERT(sizeof(secp256k1_ge_storage) == 64);
  ------------------
  |  |   64|  45.3k|#define STATIC_ASSERT(expr) do { \
  |  |   65|  45.3k|    switch(0) { \
  |  |  ------------------
  |  |  |  Branch (65:12): [Folded - Ignored]
  |  |  ------------------
  |  |   66|  45.3k|        case 0: \
  |  |  ------------------
  |  |  |  Branch (66:9): [True: 45.3k, False: 0]
  |  |  ------------------
  |  |   67|  45.3k|        /* If expr evaluates to 0, we have two case labels "0", which is illegal. */ \
  |  |   68|  45.3k|        case /* ERROR: static assertion failed */ (expr): \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 0, False: 45.3k]
  |  |  ------------------
  |  |   69|  45.3k|        ; \
  |  |   70|  45.3k|    } \
  |  |   71|  45.3k|} while(0)
  |  |  ------------------
  |  |  |  Branch (71:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  944|  45.3k|    VERIFY_CHECK(!secp256k1_ge_is_infinity(a));
  945|  45.3k|    secp256k1_ge_to_storage(&s, a);
  946|  45.3k|    memcpy(buf, &s, 64);
  947|  45.3k|}
secp256k1.c:secp256k1_ge_to_storage:
  839|  45.3k|static void secp256k1_ge_to_storage(secp256k1_ge_storage *r, const secp256k1_ge *a) {
  840|  45.3k|    secp256k1_fe x, y;
  841|  45.3k|    SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  206|  45.3k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  842|  45.3k|    VERIFY_CHECK(!a->infinity);
  843|       |
  844|  45.3k|    x = a->x;
  845|  45.3k|    secp256k1_fe_normalize(&x);
  ------------------
  |  |   78|  45.3k|#  define secp256k1_fe_normalize secp256k1_fe_impl_normalize
  ------------------
  846|  45.3k|    y = a->y;
  847|  45.3k|    secp256k1_fe_normalize(&y);
  ------------------
  |  |   78|  45.3k|#  define secp256k1_fe_normalize secp256k1_fe_impl_normalize
  ------------------
  848|  45.3k|    secp256k1_fe_to_storage(&r->x, &x);
  ------------------
  |  |   96|  45.3k|#  define secp256k1_fe_to_storage secp256k1_fe_impl_to_storage
  ------------------
  849|  45.3k|    secp256k1_fe_to_storage(&r->y, &y);
  ------------------
  |  |   96|  45.3k|#  define secp256k1_fe_to_storage secp256k1_fe_impl_to_storage
  ------------------
  850|  45.3k|}
secp256k1.c:secp256k1_ge_clear:
  305|  64.1k|static void secp256k1_ge_clear(secp256k1_ge *r) {
  306|  64.1k|    secp256k1_memclear(r, sizeof(secp256k1_ge));
  307|  64.1k|}
secp256k1.c:secp256k1_ge_from_bytes:
  949|  35.4k|static void secp256k1_ge_from_bytes(secp256k1_ge *r, const unsigned char *buf) {
  950|  35.4k|    secp256k1_ge_storage s;
  951|       |
  952|  35.4k|    STATIC_ASSERT(sizeof(secp256k1_ge_storage) == 64);
  ------------------
  |  |   64|  35.4k|#define STATIC_ASSERT(expr) do { \
  |  |   65|  35.4k|    switch(0) { \
  |  |  ------------------
  |  |  |  Branch (65:12): [Folded - Ignored]
  |  |  ------------------
  |  |   66|  35.4k|        case 0: \
  |  |  ------------------
  |  |  |  Branch (66:9): [True: 35.4k, False: 0]
  |  |  ------------------
  |  |   67|  35.4k|        /* If expr evaluates to 0, we have two case labels "0", which is illegal. */ \
  |  |   68|  35.4k|        case /* ERROR: static assertion failed */ (expr): \
  |  |  ------------------
  |  |  |  Branch (68:9): [True: 0, False: 35.4k]
  |  |  ------------------
  |  |   69|  35.4k|        ; \
  |  |   70|  35.4k|    } \
  |  |   71|  35.4k|} while(0)
  |  |  ------------------
  |  |  |  Branch (71:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  953|  35.4k|    memcpy(&s, buf, 64);
  954|  35.4k|    secp256k1_ge_from_storage(r, &s);
  955|  35.4k|}
secp256k1.c:secp256k1_ge_from_storage:
  852|  1.71M|static void secp256k1_ge_from_storage(secp256k1_ge *r, const secp256k1_ge_storage *a) {
  853|  1.71M|    secp256k1_fe_from_storage(&r->x, &a->x);
  ------------------
  |  |   97|  1.71M|#  define secp256k1_fe_from_storage secp256k1_fe_impl_from_storage
  ------------------
  854|  1.71M|    secp256k1_fe_from_storage(&r->y, &a->y);
  ------------------
  |  |   97|  1.71M|#  define secp256k1_fe_from_storage secp256k1_fe_impl_from_storage
  ------------------
  855|  1.71M|    r->infinity = 0;
  856|       |
  857|  1.71M|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  206|  1.71M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  858|  1.71M|}
secp256k1.c:secp256k1_gej_eq_x_var:
  379|  11.8k|static int secp256k1_gej_eq_x_var(const secp256k1_fe *x, const secp256k1_gej *a) {
  380|  11.8k|    secp256k1_fe r;
  381|  11.8k|    SECP256K1_FE_VERIFY(x);
  ------------------
  |  |  344|  11.8k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  382|  11.8k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|  11.8k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  383|  11.8k|    VERIFY_CHECK(!a->infinity);
  384|       |
  385|  11.8k|    secp256k1_fe_sqr(&r, &a->z); secp256k1_fe_mul(&r, &r, x);
  ------------------
  |  |   94|  11.8k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
                  secp256k1_fe_sqr(&r, &a->z); secp256k1_fe_mul(&r, &r, x);
  ------------------
  |  |   93|  11.8k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  386|  11.8k|    return secp256k1_fe_equal(&r, &a->x);
  387|  11.8k|}
secp256k1.c:secp256k1_gej_verify:
   87|  14.3M|static void secp256k1_gej_verify(const secp256k1_gej *a) {
   88|  14.3M|    SECP256K1_FE_VERIFY(&a->x);
  ------------------
  |  |  344|  14.3M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   89|  14.3M|    SECP256K1_FE_VERIFY(&a->y);
  ------------------
  |  |  344|  14.3M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   90|  14.3M|    SECP256K1_FE_VERIFY(&a->z);
  ------------------
  |  |  344|  14.3M|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
   91|  14.3M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->x, SECP256K1_GEJ_X_MAGNITUDE_MAX);
  ------------------
  |  |  348|  14.3M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   92|  14.3M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->y, SECP256K1_GEJ_Y_MAGNITUDE_MAX);
  ------------------
  |  |  348|  14.3M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   93|  14.3M|    SECP256K1_FE_VERIFY_MAGNITUDE(&a->z, SECP256K1_GEJ_Z_MAGNITUDE_MAX);
  ------------------
  |  |  348|  14.3M|#define SECP256K1_FE_VERIFY_MAGNITUDE(a, m) secp256k1_fe_verify_magnitude(a, m)
  ------------------
   94|  14.3M|    VERIFY_CHECK(a->infinity == 0 || a->infinity == 1);
   95|  14.3M|    (void)a;
   96|  14.3M|}
secp256k1.c:secp256k1_ge_storage_cmov:
  872|  44.1M|static SECP256K1_INLINE void secp256k1_ge_storage_cmov(secp256k1_ge_storage *r, const secp256k1_ge_storage *a, int flag) {
  873|  44.1M|    secp256k1_fe_storage_cmov(&r->x, &a->x, flag);
  874|  44.1M|    secp256k1_fe_storage_cmov(&r->y, &a->y, flag);
  875|  44.1M|}
secp256k1.c:secp256k1_gej_rescale:
  823|  32.0k|static void secp256k1_gej_rescale(secp256k1_gej *r, const secp256k1_fe *s) {
  824|       |    /* Operations: 4 mul, 1 sqr */
  825|  32.0k|    secp256k1_fe zz;
  826|  32.0k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|  32.0k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  827|  32.0k|    SECP256K1_FE_VERIFY(s);
  ------------------
  |  |  344|  32.0k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  828|  32.0k|    VERIFY_CHECK(!secp256k1_fe_normalizes_to_zero_var(s));
  829|       |
  830|  32.0k|    secp256k1_fe_sqr(&zz, s);
  ------------------
  |  |   94|  32.0k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  831|  32.0k|    secp256k1_fe_mul(&r->x, &r->x, &zz);                /* r->x *= s^2 */
  ------------------
  |  |   93|  32.0k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  832|  32.0k|    secp256k1_fe_mul(&r->y, &r->y, &zz);
  ------------------
  |  |   93|  32.0k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  833|  32.0k|    secp256k1_fe_mul(&r->y, &r->y, s);                  /* r->y *= s^3 */
  ------------------
  |  |   93|  32.0k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  834|  32.0k|    secp256k1_fe_mul(&r->z, &r->z, s);                  /* r->z *= s   */
  ------------------
  |  |   93|  32.0k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  835|       |
  836|  32.0k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|  32.0k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  837|  32.0k|}
secp256k1.c:secp256k1_gej_double:
  422|  2.25M|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|  2.25M|    secp256k1_fe l, s, t;
  425|  2.25M|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|  2.25M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  426|       |
  427|  2.25M|    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|  2.25M|    secp256k1_fe_mul(&r->z, &a->z, &a->y); /* Z3 = Y1*Z1 (1) */
  ------------------
  |  |   93|  2.25M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  439|  2.25M|    secp256k1_fe_sqr(&s, &a->y);           /* S = Y1^2 (1) */
  ------------------
  |  |   94|  2.25M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  440|  2.25M|    secp256k1_fe_sqr(&l, &a->x);           /* L = X1^2 (1) */
  ------------------
  |  |   94|  2.25M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  441|  2.25M|    secp256k1_fe_mul_int(&l, 3);           /* L = 3*X1^2 (3) */
  ------------------
  |  |  233|  2.25M|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   77|  2.25M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  2.25M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 2.25M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  2.25M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 2.25M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  2.25M|    } \
  |  |  |  |   84|  2.25M|    stmt; \
  |  |  |  |   85|  2.25M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  442|  2.25M|    secp256k1_fe_half(&l);                 /* L = 3/2*X1^2 (2) */
  ------------------
  |  |  101|  2.25M|#  define secp256k1_fe_half secp256k1_fe_impl_half
  ------------------
  443|  2.25M|    secp256k1_fe_negate(&t, &s, 1);        /* T = -S (2) */
  ------------------
  |  |  211|  2.25M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  2.25M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  2.25M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 2.25M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  2.25M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 2.25M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  2.25M|    } \
  |  |  |  |   84|  2.25M|    stmt; \
  |  |  |  |   85|  2.25M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  444|  2.25M|    secp256k1_fe_mul(&t, &t, &a->x);       /* T = -X1*S (1) */
  ------------------
  |  |   93|  2.25M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  445|  2.25M|    secp256k1_fe_sqr(&r->x, &l);           /* X3 = L^2 (1) */
  ------------------
  |  |   94|  2.25M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  446|  2.25M|    secp256k1_fe_add(&r->x, &t);           /* X3 = L^2 + T (2) */
  ------------------
  |  |   92|  2.25M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  447|  2.25M|    secp256k1_fe_add(&r->x, &t);           /* X3 = L^2 + 2*T (3) */
  ------------------
  |  |   92|  2.25M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  448|  2.25M|    secp256k1_fe_sqr(&s, &s);              /* S' = S^2 (1) */
  ------------------
  |  |   94|  2.25M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  449|  2.25M|    secp256k1_fe_add(&t, &r->x);           /* T' = X3 + T (4) */
  ------------------
  |  |   92|  2.25M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  450|  2.25M|    secp256k1_fe_mul(&r->y, &t, &l);       /* Y3 = L*(X3 + T) (1) */
  ------------------
  |  |   93|  2.25M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  451|  2.25M|    secp256k1_fe_add(&r->y, &s);           /* Y3 = L*(X3 + T) + S^2 (2) */
  ------------------
  |  |   92|  2.25M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  452|  2.25M|    secp256k1_fe_negate(&r->y, &r->y, 2);  /* Y3 = -(L*(X3 + T) + S^2) (3) */
  ------------------
  |  |  211|  2.25M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  2.25M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  2.25M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 2.25M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  2.25M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 2.25M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  2.25M|    } \
  |  |  |  |   84|  2.25M|    stmt; \
  |  |  |  |   85|  2.25M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  453|       |
  454|  2.25M|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|  2.25M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  455|  2.25M|}
secp256k1.c:secp256k1_gej_clear:
  301|  32.0k|static void secp256k1_gej_clear(secp256k1_gej *r) {
  302|  32.0k|    secp256k1_memclear(r, sizeof(secp256k1_gej));
  303|  32.0k|}
secp256k1.c:secp256k1_gej_set_infinity:
  284|  35.4k|static void secp256k1_gej_set_infinity(secp256k1_gej *r) {
  285|  35.4k|    r->infinity = 1;
  286|  35.4k|    secp256k1_fe_set_int(&r->x, 0);
  ------------------
  |  |   83|  35.4k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  287|  35.4k|    secp256k1_fe_set_int(&r->y, 0);
  ------------------
  |  |   83|  35.4k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  288|  35.4k|    secp256k1_fe_set_int(&r->z, 0);
  ------------------
  |  |   83|  35.4k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  289|       |
  290|  35.4k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|  35.4k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  291|  35.4k|}
secp256k1.c:secp256k1_gej_add_ge:
  686|  1.37M|static void secp256k1_gej_add_ge(secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_ge *b) {
  687|       |    /* Operations: 7 mul, 5 sqr, 21 add/cmov/half/mul_int/negate/normalizes_to_zero */
  688|  1.37M|    secp256k1_fe zz, u1, u2, s1, s2, t, tt, m, n, q, rr;
  689|  1.37M|    secp256k1_fe m_alt, rr_alt;
  690|  1.37M|    int degenerate;
  691|  1.37M|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|  1.37M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  692|  1.37M|    SECP256K1_GE_VERIFY(b);
  ------------------
  |  |  206|  1.37M|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  693|  1.37M|    VERIFY_CHECK(!b->infinity);
  694|       |
  695|       |    /*  In:
  696|       |     *    Eric Brier and Marc Joye, Weierstrass Elliptic Curves and Side-Channel Attacks.
  697|       |     *    In D. Naccache and P. Paillier, Eds., Public Key Cryptography, vol. 2274 of Lecture Notes in Computer Science, pages 335-345. Springer-Verlag, 2002.
  698|       |     *  we find as solution for a unified addition/doubling formula:
  699|       |     *    lambda = ((x1 + x2)^2 - x1 * x2 + a) / (y1 + y2), with a = 0 for secp256k1's curve equation.
  700|       |     *    x3 = lambda^2 - (x1 + x2)
  701|       |     *    2*y3 = lambda * (x1 + x2 - 2 * x3) - (y1 + y2).
  702|       |     *
  703|       |     *  Substituting x_i = Xi / Zi^2 and yi = Yi / Zi^3, for i=1,2,3, gives:
  704|       |     *    U1 = X1*Z2^2, U2 = X2*Z1^2
  705|       |     *    S1 = Y1*Z2^3, S2 = Y2*Z1^3
  706|       |     *    Z = Z1*Z2
  707|       |     *    T = U1+U2
  708|       |     *    M = S1+S2
  709|       |     *    Q = -T*M^2
  710|       |     *    R = T^2-U1*U2
  711|       |     *    X3 = R^2+Q
  712|       |     *    Y3 = -(R*(2*X3+Q)+M^4)/2
  713|       |     *    Z3 = M*Z
  714|       |     *  (Note that the paper uses xi = Xi / Zi and yi = Yi / Zi instead.)
  715|       |     *
  716|       |     *  This formula has the benefit of being the same for both addition
  717|       |     *  of distinct points and doubling. However, it breaks down in the
  718|       |     *  case that either point is infinity, or that y1 = -y2. We handle
  719|       |     *  these cases in the following ways:
  720|       |     *
  721|       |     *    - If b is infinity we simply bail by means of a VERIFY_CHECK.
  722|       |     *
  723|       |     *    - If a is infinity, we detect this, and at the end of the
  724|       |     *      computation replace the result (which will be meaningless,
  725|       |     *      but we compute to be constant-time) with b.x : b.y : 1.
  726|       |     *
  727|       |     *    - If a = -b, we have y1 = -y2, which is a degenerate case.
  728|       |     *      But here the answer is infinity, so we simply set the
  729|       |     *      infinity flag of the result, overriding the computed values
  730|       |     *      without even needing to cmov.
  731|       |     *
  732|       |     *    - If y1 = -y2 but x1 != x2, which does occur thanks to certain
  733|       |     *      properties of our curve (specifically, 1 has nontrivial cube
  734|       |     *      roots in our field, and the curve equation has no x coefficient)
  735|       |     *      then the answer is not infinity but also not given by the above
  736|       |     *      equation. In this case, we cmov in place an alternate expression
  737|       |     *      for lambda. Specifically (y1 - y2)/(x1 - x2). Where both these
  738|       |     *      expressions for lambda are defined, they are equal, and can be
  739|       |     *      obtained from each other by multiplication by (y1 + y2)/(y1 + y2)
  740|       |     *      then substitution of x^3 + 7 for y^2 (using the curve equation).
  741|       |     *      For all pairs of nonzero points (a, b) at least one is defined,
  742|       |     *      so this covers everything.
  743|       |     */
  744|       |
  745|  1.37M|    secp256k1_fe_sqr(&zz, &a->z);                       /* z = Z1^2 */
  ------------------
  |  |   94|  1.37M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  746|  1.37M|    u1 = a->x;                                          /* u1 = U1 = X1*Z2^2 (GEJ_X_M) */
  747|  1.37M|    secp256k1_fe_mul(&u2, &b->x, &zz);                  /* u2 = U2 = X2*Z1^2 (1) */
  ------------------
  |  |   93|  1.37M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  748|  1.37M|    s1 = a->y;                                          /* s1 = S1 = Y1*Z2^3 (GEJ_Y_M) */
  749|  1.37M|    secp256k1_fe_mul(&s2, &b->y, &zz);                  /* s2 = Y2*Z1^2 (1) */
  ------------------
  |  |   93|  1.37M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  750|  1.37M|    secp256k1_fe_mul(&s2, &s2, &a->z);                  /* s2 = S2 = Y2*Z1^3 (1) */
  ------------------
  |  |   93|  1.37M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  751|  1.37M|    t = u1; secp256k1_fe_add(&t, &u2);                  /* t = T = U1+U2 (GEJ_X_M+1) */
  ------------------
  |  |   92|  1.37M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  752|  1.37M|    m = s1; secp256k1_fe_add(&m, &s2);                  /* m = M = S1+S2 (GEJ_Y_M+1) */
  ------------------
  |  |   92|  1.37M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  753|  1.37M|    secp256k1_fe_sqr(&rr, &t);                          /* rr = T^2 (1) */
  ------------------
  |  |   94|  1.37M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  754|  1.37M|    secp256k1_fe_negate(&m_alt, &u2, 1);                /* Malt = -X2*Z1^2 (2) */
  ------------------
  |  |  211|  1.37M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  1.37M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  1.37M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 1.37M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  1.37M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 1.37M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  1.37M|    } \
  |  |  |  |   84|  1.37M|    stmt; \
  |  |  |  |   85|  1.37M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  755|  1.37M|    secp256k1_fe_mul(&tt, &u1, &m_alt);                 /* tt = -U1*U2 (1) */
  ------------------
  |  |   93|  1.37M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  756|  1.37M|    secp256k1_fe_add(&rr, &tt);                         /* rr = R = T^2-U1*U2 (2) */
  ------------------
  |  |   92|  1.37M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  757|       |    /* If lambda = R/M = R/0 we have a problem (except in the "trivial"
  758|       |     * case that Z = z1z2 = 0, and this is special-cased later on). */
  759|  1.37M|    degenerate = secp256k1_fe_normalizes_to_zero(&m);
  ------------------
  |  |   81|  1.37M|#  define secp256k1_fe_normalizes_to_zero secp256k1_fe_impl_normalizes_to_zero
  ------------------
  760|       |    /* This only occurs when y1 == -y2 and x1^3 == x2^3, but x1 != x2.
  761|       |     * This means either x1 == beta*x2 or beta*x1 == x2, where beta is
  762|       |     * a nontrivial cube root of one. In either case, an alternate
  763|       |     * non-indeterminate expression for lambda is (y1 - y2)/(x1 - x2),
  764|       |     * so we set R/M equal to this. */
  765|  1.37M|    rr_alt = s1;
  766|  1.37M|    secp256k1_fe_mul_int(&rr_alt, 2);       /* rr_alt = Y1*Z2^3 - Y2*Z1^3 (GEJ_Y_M*2) */
  ------------------
  |  |  233|  1.37M|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   77|  1.37M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  1.37M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 1.37M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  1.37M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 1.37M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  1.37M|    } \
  |  |  |  |   84|  1.37M|    stmt; \
  |  |  |  |   85|  1.37M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  767|  1.37M|    secp256k1_fe_add(&m_alt, &u1);          /* Malt = X1*Z2^2 - X2*Z1^2 (GEJ_X_M+2) */
  ------------------
  |  |   92|  1.37M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  768|       |
  769|  1.37M|    secp256k1_fe_cmov(&rr_alt, &rr, !degenerate);       /* rr_alt (GEJ_Y_M*2) */
  ------------------
  |  |   95|  1.37M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  770|  1.37M|    secp256k1_fe_cmov(&m_alt, &m, !degenerate);         /* m_alt (GEJ_X_M+2) */
  ------------------
  |  |   95|  1.37M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  771|       |    /* Now Ralt / Malt = lambda and is guaranteed not to be Ralt / 0.
  772|       |     * From here on out Ralt and Malt represent the numerator
  773|       |     * and denominator of lambda; R and M represent the explicit
  774|       |     * expressions x1^2 + x2^2 + x1x2 and y1 + y2. */
  775|  1.37M|    secp256k1_fe_sqr(&n, &m_alt);                       /* n = Malt^2 (1) */
  ------------------
  |  |   94|  1.37M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  776|  1.37M|    secp256k1_fe_negate(&q, &t,
  ------------------
  |  |  211|  1.37M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  1.37M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  1.37M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 1.37M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  1.37M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 1.37M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  1.37M|    } \
  |  |  |  |   84|  1.37M|    stmt; \
  |  |  |  |   85|  1.37M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  777|  1.37M|        SECP256K1_GEJ_X_MAGNITUDE_MAX + 1);             /* q = -T (GEJ_X_M+2) */
  778|  1.37M|    secp256k1_fe_mul(&q, &q, &n);                       /* q = Q = -T*Malt^2 (1) */
  ------------------
  |  |   93|  1.37M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  779|       |    /* These two lines use the observation that either M == Malt or M == 0,
  780|       |     * so M^3 * Malt is either Malt^4 (which is computed by squaring), or
  781|       |     * zero (which is "computed" by cmov). So the cost is one squaring
  782|       |     * versus two multiplications. */
  783|  1.37M|    secp256k1_fe_sqr(&n, &n);                           /* n = Malt^4 (1) */
  ------------------
  |  |   94|  1.37M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  784|  1.37M|    secp256k1_fe_cmov(&n, &m, degenerate);              /* n = M^3 * Malt (GEJ_Y_M+1) */
  ------------------
  |  |   95|  1.37M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  785|  1.37M|    secp256k1_fe_sqr(&t, &rr_alt);                      /* t = Ralt^2 (1) */
  ------------------
  |  |   94|  1.37M|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  786|  1.37M|    secp256k1_fe_mul(&r->z, &a->z, &m_alt);             /* r->z = Z3 = Malt*Z (1) */
  ------------------
  |  |   93|  1.37M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  787|  1.37M|    secp256k1_fe_add(&t, &q);                           /* t = Ralt^2 + Q (2) */
  ------------------
  |  |   92|  1.37M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  788|  1.37M|    r->x = t;                                           /* r->x = X3 = Ralt^2 + Q (2) */
  789|  1.37M|    secp256k1_fe_mul_int(&t, 2);                        /* t = 2*X3 (4) */
  ------------------
  |  |  233|  1.37M|#define secp256k1_fe_mul_int(r, a) ASSERT_INT_CONST_AND_DO(a, secp256k1_fe_mul_int_unchecked(r, a))
  |  |  ------------------
  |  |  |  |   77|  1.37M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  1.37M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 1.37M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  1.37M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 1.37M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  1.37M|    } \
  |  |  |  |   84|  1.37M|    stmt; \
  |  |  |  |   85|  1.37M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  790|  1.37M|    secp256k1_fe_add(&t, &q);                           /* t = 2*X3 + Q (5) */
  ------------------
  |  |   92|  1.37M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  791|  1.37M|    secp256k1_fe_mul(&t, &t, &rr_alt);                  /* t = Ralt*(2*X3 + Q) (1) */
  ------------------
  |  |   93|  1.37M|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  792|  1.37M|    secp256k1_fe_add(&t, &n);                           /* t = Ralt*(2*X3 + Q) + M^3*Malt (GEJ_Y_M+2) */
  ------------------
  |  |   92|  1.37M|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  793|  1.37M|    secp256k1_fe_negate(&r->y, &t,
  ------------------
  |  |  211|  1.37M|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  1.37M|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  1.37M|    switch(42) { \
  |  |  |  |   79|      0|        /* C allows only integer constant expressions as case labels. */ \
  |  |  |  |   80|      0|        case /* ERROR: integer argument is not constant */ (expr): \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:9): [True: 0, False: 1.37M]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  1.37M|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 1.37M, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  1.37M|    } \
  |  |  |  |   84|  1.37M|    stmt; \
  |  |  |  |   85|  1.37M|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  794|  1.37M|        SECP256K1_GEJ_Y_MAGNITUDE_MAX + 2);             /* r->y = -(Ralt*(2*X3 + Q) + M^3*Malt) (GEJ_Y_M+3) */
  795|  1.37M|    secp256k1_fe_half(&r->y);                           /* r->y = Y3 = -(Ralt*(2*X3 + Q) + M^3*Malt)/2 ((GEJ_Y_M+3)/2 + 1) */
  ------------------
  |  |  101|  1.37M|#  define secp256k1_fe_half secp256k1_fe_impl_half
  ------------------
  796|       |
  797|       |    /* In case a->infinity == 1, replace r with (b->x, b->y, 1). */
  798|  1.37M|    secp256k1_fe_cmov(&r->x, &b->x, a->infinity);
  ------------------
  |  |   95|  1.37M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  799|  1.37M|    secp256k1_fe_cmov(&r->y, &b->y, a->infinity);
  ------------------
  |  |   95|  1.37M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  800|  1.37M|    secp256k1_fe_cmov(&r->z, &secp256k1_fe_one, a->infinity);
  ------------------
  |  |   95|  1.37M|#  define secp256k1_fe_cmov secp256k1_fe_impl_cmov
  ------------------
  801|       |
  802|       |    /* Set r->infinity if r->z is 0.
  803|       |     *
  804|       |     * If a->infinity is set, then r->infinity = (r->z == 0) = (1 == 0) = false,
  805|       |     * which is correct because the function assumes that b is not infinity.
  806|       |     *
  807|       |     * Now assume !a->infinity. This implies Z = Z1 != 0.
  808|       |     *
  809|       |     * Case y1 = -y2:
  810|       |     * In this case we could have a = -b, namely if x1 = x2.
  811|       |     * We have degenerate = true, r->z = (x1 - x2) * Z.
  812|       |     * Then r->infinity = ((x1 - x2)Z == 0) = (x1 == x2) = (a == -b).
  813|       |     *
  814|       |     * Case y1 != -y2:
  815|       |     * In this case, we can't have a = -b.
  816|       |     * We have degenerate = false, r->z = (y1 + y2) * Z.
  817|       |     * Then r->infinity = ((y1 + y2)Z == 0) = (y1 == -y2) = false. */
  818|  1.37M|    r->infinity = secp256k1_fe_normalizes_to_zero(&r->z);
  ------------------
  |  |   81|  1.37M|#  define secp256k1_fe_normalizes_to_zero secp256k1_fe_impl_normalizes_to_zero
  ------------------
  819|       |
  820|  1.37M|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|  1.37M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  821|  1.37M|}
secp256k1.c:secp256k1_gej_is_infinity:
  402|  39.4k|static int secp256k1_gej_is_infinity(const secp256k1_gej *a) {
  403|  39.4k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|  39.4k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  404|       |
  405|  39.4k|    return a->infinity;
  406|  39.4k|}
secp256k1.c:secp256k1_ge_set_gej:
  159|  34.0k|static void secp256k1_ge_set_gej(secp256k1_ge *r, secp256k1_gej *a) {
  160|  34.0k|    secp256k1_fe z2, z3;
  161|  34.0k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|  34.0k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  162|       |
  163|  34.0k|    r->infinity = a->infinity;
  164|  34.0k|    secp256k1_fe_inv(&a->z, &a->z);
  ------------------
  |  |   98|  34.0k|#  define secp256k1_fe_inv secp256k1_fe_impl_inv
  ------------------
  165|  34.0k|    secp256k1_fe_sqr(&z2, &a->z);
  ------------------
  |  |   94|  34.0k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  166|  34.0k|    secp256k1_fe_mul(&z3, &a->z, &z2);
  ------------------
  |  |   93|  34.0k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  167|  34.0k|    secp256k1_fe_mul(&a->x, &a->x, &z2);
  ------------------
  |  |   93|  34.0k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  168|  34.0k|    secp256k1_fe_mul(&a->y, &a->y, &z3);
  ------------------
  |  |   93|  34.0k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  169|  34.0k|    secp256k1_fe_set_int(&a->z, 1);
  ------------------
  |  |   83|  34.0k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  170|  34.0k|    r->x = a->x;
  171|  34.0k|    r->y = a->y;
  172|       |
  173|  34.0k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|  34.0k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  174|  34.0k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  206|  34.0k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  175|  34.0k|}
secp256k1.c:secp256k1_ge_set_xo_var:
  309|  23.6k|static int secp256k1_ge_set_xo_var(secp256k1_ge *r, const secp256k1_fe *x, int odd) {
  310|  23.6k|    secp256k1_fe x2, x3;
  311|  23.6k|    int ret;
  312|  23.6k|    SECP256K1_FE_VERIFY(x);
  ------------------
  |  |  344|  23.6k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  313|       |
  314|  23.6k|    r->x = *x;
  315|  23.6k|    secp256k1_fe_sqr(&x2, x);
  ------------------
  |  |   94|  23.6k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  316|  23.6k|    secp256k1_fe_mul(&x3, x, &x2);
  ------------------
  |  |   93|  23.6k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  317|  23.6k|    r->infinity = 0;
  318|  23.6k|    secp256k1_fe_add_int(&x3, SECP256K1_B);
  ------------------
  |  |  102|  23.6k|#  define secp256k1_fe_add_int secp256k1_fe_impl_add_int
  ------------------
                  secp256k1_fe_add_int(&x3, SECP256K1_B);
  ------------------
  |  |   73|  23.6k|#define SECP256K1_B 7
  ------------------
  319|  23.6k|    ret = secp256k1_fe_sqrt(&r->y, &x3);
  320|  23.6k|    secp256k1_fe_normalize_var(&r->y);
  ------------------
  |  |   80|  23.6k|#  define secp256k1_fe_normalize_var secp256k1_fe_impl_normalize_var
  ------------------
  321|  23.6k|    if (secp256k1_fe_is_odd(&r->y) != odd) {
  ------------------
  |  |   85|  23.6k|#  define secp256k1_fe_is_odd secp256k1_fe_impl_is_odd
  ------------------
  |  Branch (321:9): [True: 11.6k, False: 11.9k]
  ------------------
  322|  11.6k|        secp256k1_fe_negate(&r->y, &r->y, 1);
  ------------------
  |  |  211|  11.6k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|  11.6k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|  11.6k|    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: 11.6k]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|  11.6k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 11.6k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|  11.6k|    } \
  |  |  |  |   84|  11.6k|    stmt; \
  |  |  |  |   85|  11.6k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  323|  11.6k|    }
  324|       |
  325|  23.6k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  206|  23.6k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  326|  23.6k|    return ret;
  327|  23.6k|}
secp256k1.c:secp256k1_gej_set_ge:
  329|  76.9k|static void secp256k1_gej_set_ge(secp256k1_gej *r, const secp256k1_ge *a) {
  330|  76.9k|   SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  206|  76.9k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  331|       |
  332|  76.9k|   r->infinity = a->infinity;
  333|  76.9k|   r->x = a->x;
  334|  76.9k|   r->y = a->y;
  335|  76.9k|   secp256k1_fe_set_int(&r->z, 1);
  ------------------
  |  |   83|  76.9k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  336|       |
  337|  76.9k|   SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|  76.9k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  338|  76.9k|}
secp256k1.c:secp256k1_ge_set_gej_zinv:
   99|  17.7k|static void secp256k1_ge_set_gej_zinv(secp256k1_ge *r, const secp256k1_gej *a, const secp256k1_fe *zi) {
  100|  17.7k|    secp256k1_fe zi2;
  101|  17.7k|    secp256k1_fe zi3;
  102|  17.7k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|  17.7k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  103|  17.7k|    SECP256K1_FE_VERIFY(zi);
  ------------------
  |  |  344|  17.7k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  104|  17.7k|    VERIFY_CHECK(!a->infinity);
  105|       |
  106|  17.7k|    secp256k1_fe_sqr(&zi2, zi);
  ------------------
  |  |   94|  17.7k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  107|  17.7k|    secp256k1_fe_mul(&zi3, &zi2, zi);
  ------------------
  |  |   93|  17.7k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  108|  17.7k|    secp256k1_fe_mul(&r->x, &a->x, &zi2);
  ------------------
  |  |   93|  17.7k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  109|  17.7k|    secp256k1_fe_mul(&r->y, &a->y, &zi3);
  ------------------
  |  |   93|  17.7k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  110|  17.7k|    r->infinity = a->infinity;
  111|       |
  112|  17.7k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  206|  17.7k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  113|  17.7k|}
secp256k1.c:secp256k1_ge_table_set_globalz:
  251|  17.7k|static void secp256k1_ge_table_set_globalz(size_t len, secp256k1_ge *a, const secp256k1_fe *zr) {
  252|  17.7k|    size_t i;
  253|  17.7k|    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|  17.7k|    if (len > 0) {
  ------------------
  |  Branch (261:9): [True: 17.7k, False: 0]
  ------------------
  262|  17.7k|        i = len - 1;
  263|       |        /* Ensure all y values are in weak normal form for fast negation of points */
  264|  17.7k|        secp256k1_fe_normalize_weak(&a[i].y);
  ------------------
  |  |   79|  17.7k|#  define secp256k1_fe_normalize_weak secp256k1_fe_impl_normalize_weak
  ------------------
  265|  17.7k|        zs = zr[i];
  266|       |
  267|       |        /* Work our way backwards, using the z-ratios to scale the x/y values. */
  268|   141k|        while (i > 0) {
  ------------------
  |  Branch (268:16): [True: 124k, False: 17.7k]
  ------------------
  269|   124k|            if (i != len - 1) {
  ------------------
  |  Branch (269:17): [True: 106k, False: 17.7k]
  ------------------
  270|   106k|                secp256k1_fe_mul(&zs, &zs, &zr[i]);
  ------------------
  |  |   93|   106k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  271|   106k|            }
  272|   124k|            i--;
  273|   124k|            secp256k1_ge_set_ge_zinv(&a[i], &a[i], &zs);
  274|   124k|        }
  275|  17.7k|    }
  276|       |
  277|       |#ifdef VERIFY
  278|       |    for (i = 0; i < len; i++) {
  279|       |        SECP256K1_GE_VERIFY(&a[i]);
  280|       |    }
  281|       |#endif
  282|  17.7k|}
secp256k1.c:secp256k1_ge_set_ge_zinv:
  116|   124k|static void secp256k1_ge_set_ge_zinv(secp256k1_ge *r, const secp256k1_ge *a, const secp256k1_fe *zi) {
  117|   124k|    secp256k1_fe zi2;
  118|   124k|    secp256k1_fe zi3;
  119|   124k|    SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  206|   124k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  120|   124k|    SECP256K1_FE_VERIFY(zi);
  ------------------
  |  |  344|   124k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  121|   124k|    VERIFY_CHECK(!a->infinity);
  122|       |
  123|   124k|    secp256k1_fe_sqr(&zi2, zi);
  ------------------
  |  |   94|   124k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  124|   124k|    secp256k1_fe_mul(&zi3, &zi2, zi);
  ------------------
  |  |   93|   124k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  125|   124k|    secp256k1_fe_mul(&r->x, &a->x, &zi2);
  ------------------
  |  |   93|   124k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  126|   124k|    secp256k1_fe_mul(&r->y, &a->y, &zi3);
  ------------------
  |  |   93|   124k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  127|   124k|    r->infinity = a->infinity;
  128|       |
  129|   124k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  206|   124k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  130|   124k|}
secp256k1.c:secp256k1_gej_double_var:
  457|  2.27M|static void secp256k1_gej_double_var(secp256k1_gej *r, const secp256k1_gej *a, secp256k1_fe *rzr) {
  458|  2.27M|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|  2.27M|#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|  2.27M|    if (a->infinity) {
  ------------------
  |  Branch (470:9): [True: 17.7k, False: 2.25M]
  ------------------
  471|  17.7k|        secp256k1_gej_set_infinity(r);
  472|  17.7k|        if (rzr != NULL) {
  ------------------
  |  Branch (472:13): [True: 0, False: 17.7k]
  ------------------
  473|      0|            secp256k1_fe_set_int(rzr, 1);
  ------------------
  |  |   83|      0|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  474|      0|        }
  475|  17.7k|        return;
  476|  17.7k|    }
  477|       |
  478|  2.25M|    if (rzr != NULL) {
  ------------------
  |  Branch (478:9): [True: 0, False: 2.25M]
  ------------------
  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|  2.25M|    secp256k1_gej_double(r, a);
  484|       |
  485|  2.25M|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|  2.25M|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  486|  2.25M|}
secp256k1.c:secp256k1_gej_add_ge_var:
  552|   806k|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|   806k|    secp256k1_fe z12, u1, u2, s1, s2, h, i, h2, h3, t;
  555|   806k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|   806k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  556|   806k|    SECP256K1_GE_VERIFY(b);
  ------------------
  |  |  206|   806k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  557|       |
  558|   806k|    if (a->infinity) {
  ------------------
  |  Branch (558:9): [True: 9.42k, False: 797k]
  ------------------
  559|  9.42k|        VERIFY_CHECK(rzr == NULL);
  560|  9.42k|        secp256k1_gej_set_ge(r, b);
  561|  9.42k|        return;
  562|  9.42k|    }
  563|   797k|    if (b->infinity) {
  ------------------
  |  Branch (563:9): [True: 0, False: 797k]
  ------------------
  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|   797k|    secp256k1_fe_sqr(&z12, &a->z);
  ------------------
  |  |   94|   797k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  572|   797k|    u1 = a->x;
  573|   797k|    secp256k1_fe_mul(&u2, &b->x, &z12);
  ------------------
  |  |   93|   797k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  574|   797k|    s1 = a->y;
  575|   797k|    secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &a->z);
  ------------------
  |  |   93|   797k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
                  secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &a->z);
  ------------------
  |  |   93|   797k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  576|   797k|    secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |  211|   797k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|   797k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|   797k|    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: 797k]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|   797k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 797k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|   797k|    } \
  |  |  |  |   84|   797k|    stmt; \
  |  |  |  |   85|   797k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |   92|   797k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  577|   797k|    secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |  211|   797k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|   797k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|   797k|    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: 797k]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|   797k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 797k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|   797k|    } \
  |  |  |  |   84|   797k|    stmt; \
  |  |  |  |   85|   797k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |   92|   797k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  578|   797k|    if (secp256k1_fe_normalizes_to_zero_var(&h)) {
  ------------------
  |  |   82|   797k|#  define secp256k1_fe_normalizes_to_zero_var secp256k1_fe_impl_normalizes_to_zero_var
  ------------------
  |  Branch (578:9): [True: 0, False: 797k]
  ------------------
  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|   797k|    r->infinity = 0;
  591|   797k|    if (rzr != NULL) {
  ------------------
  |  Branch (591:9): [True: 124k, False: 673k]
  ------------------
  592|   124k|        *rzr = h;
  593|   124k|    }
  594|   797k|    secp256k1_fe_mul(&r->z, &a->z, &h);
  ------------------
  |  |   93|   797k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  595|       |
  596|   797k|    secp256k1_fe_sqr(&h2, &h);
  ------------------
  |  |   94|   797k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  597|   797k|    secp256k1_fe_negate(&h2, &h2, 1);
  ------------------
  |  |  211|   797k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|   797k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|   797k|    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: 797k]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|   797k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 797k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|   797k|    } \
  |  |  |  |   84|   797k|    stmt; \
  |  |  |  |   85|   797k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  598|   797k|    secp256k1_fe_mul(&h3, &h2, &h);
  ------------------
  |  |   93|   797k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  599|   797k|    secp256k1_fe_mul(&t, &u1, &h2);
  ------------------
  |  |   93|   797k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  600|       |
  601|   797k|    secp256k1_fe_sqr(&r->x, &i);
  ------------------
  |  |   94|   797k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  602|   797k|    secp256k1_fe_add(&r->x, &h3);
  ------------------
  |  |   92|   797k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  603|   797k|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|   797k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  604|   797k|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|   797k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  605|       |
  606|   797k|    secp256k1_fe_add(&t, &r->x);
  ------------------
  |  |   92|   797k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  607|   797k|    secp256k1_fe_mul(&r->y, &t, &i);
  ------------------
  |  |   93|   797k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  608|   797k|    secp256k1_fe_mul(&h3, &h3, &s1);
  ------------------
  |  |   93|   797k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  609|   797k|    secp256k1_fe_add(&r->y, &h3);
  ------------------
  |  |   92|   797k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  610|       |
  611|   797k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|   797k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  612|   797k|    if (rzr != NULL) SECP256K1_FE_VERIFY(rzr);
  ------------------
  |  |  344|   124k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  |  Branch (612:9): [True: 124k, False: 673k]
  ------------------
  613|   797k|}
secp256k1.c:secp256k1_gej_add_zinv_var:
  615|   301k|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|   301k|    secp256k1_fe az, z12, u1, u2, s1, s2, h, i, h2, h3, t;
  618|   301k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|   301k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  619|   301k|    SECP256K1_GE_VERIFY(b);
  ------------------
  |  |  206|   301k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  620|   301k|    SECP256K1_FE_VERIFY(bzinv);
  ------------------
  |  |  344|   301k|#define SECP256K1_FE_VERIFY(a) secp256k1_fe_verify(a)
  ------------------
  621|       |
  622|   301k|    if (a->infinity) {
  ------------------
  |  Branch (622:9): [True: 8.31k, False: 293k]
  ------------------
  623|  8.31k|        secp256k1_fe bzinv2, bzinv3;
  624|  8.31k|        r->infinity = b->infinity;
  625|  8.31k|        secp256k1_fe_sqr(&bzinv2, bzinv);
  ------------------
  |  |   94|  8.31k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  626|  8.31k|        secp256k1_fe_mul(&bzinv3, &bzinv2, bzinv);
  ------------------
  |  |   93|  8.31k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  627|  8.31k|        secp256k1_fe_mul(&r->x, &b->x, &bzinv2);
  ------------------
  |  |   93|  8.31k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  628|  8.31k|        secp256k1_fe_mul(&r->y, &b->y, &bzinv3);
  ------------------
  |  |   93|  8.31k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  629|  8.31k|        secp256k1_fe_set_int(&r->z, 1);
  ------------------
  |  |   83|  8.31k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  630|  8.31k|        SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|  8.31k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  631|  8.31k|        return;
  632|  8.31k|    }
  633|   293k|    if (b->infinity) {
  ------------------
  |  Branch (633:9): [True: 0, False: 293k]
  ------------------
  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|   293k|    secp256k1_fe_mul(&az, &a->z, bzinv);
  ------------------
  |  |   93|   293k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  647|       |
  648|   293k|    secp256k1_fe_sqr(&z12, &az);
  ------------------
  |  |   94|   293k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  649|   293k|    u1 = a->x;
  650|   293k|    secp256k1_fe_mul(&u2, &b->x, &z12);
  ------------------
  |  |   93|   293k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  651|   293k|    s1 = a->y;
  652|   293k|    secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &az);
  ------------------
  |  |   93|   293k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
                  secp256k1_fe_mul(&s2, &b->y, &z12); secp256k1_fe_mul(&s2, &s2, &az);
  ------------------
  |  |   93|   293k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  653|   293k|    secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |  211|   293k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|   293k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|   293k|    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: 293k]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|   293k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 293k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|   293k|    } \
  |  |  |  |   84|   293k|    stmt; \
  |  |  |  |   85|   293k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&h, &u1, SECP256K1_GEJ_X_MAGNITUDE_MAX); secp256k1_fe_add(&h, &u2);
  ------------------
  |  |   92|   293k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  654|   293k|    secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |  211|   293k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|   293k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|   293k|    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: 293k]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|   293k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 293k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|   293k|    } \
  |  |  |  |   84|   293k|    stmt; \
  |  |  |  |   85|   293k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  secp256k1_fe_negate(&i, &s2, 1); secp256k1_fe_add(&i, &s1);
  ------------------
  |  |   92|   293k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  655|   293k|    if (secp256k1_fe_normalizes_to_zero_var(&h)) {
  ------------------
  |  |   82|   293k|#  define secp256k1_fe_normalizes_to_zero_var secp256k1_fe_impl_normalizes_to_zero_var
  ------------------
  |  Branch (655:9): [True: 2, False: 293k]
  ------------------
  656|      2|        if (secp256k1_fe_normalizes_to_zero_var(&i)) {
  ------------------
  |  |   82|      2|#  define secp256k1_fe_normalizes_to_zero_var secp256k1_fe_impl_normalizes_to_zero_var
  ------------------
  |  Branch (656:13): [True: 2, False: 0]
  ------------------
  657|      2|            secp256k1_gej_double_var(r, a, NULL);
  658|      2|        } else {
  659|      0|            secp256k1_gej_set_infinity(r);
  660|      0|        }
  661|      2|        return;
  662|      2|    }
  663|       |
  664|   293k|    r->infinity = 0;
  665|   293k|    secp256k1_fe_mul(&r->z, &a->z, &h);
  ------------------
  |  |   93|   293k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  666|       |
  667|   293k|    secp256k1_fe_sqr(&h2, &h);
  ------------------
  |  |   94|   293k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  668|   293k|    secp256k1_fe_negate(&h2, &h2, 1);
  ------------------
  |  |  211|   293k|#define secp256k1_fe_negate(r, a, m) ASSERT_INT_CONST_AND_DO(m, secp256k1_fe_negate_unchecked(r, a, m))
  |  |  ------------------
  |  |  |  |   77|   293k|#define ASSERT_INT_CONST_AND_DO(expr, stmt) do { \
  |  |  |  |   78|   293k|    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: 293k]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|            break; \
  |  |  |  |   82|   293k|        default: ; \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (82:9): [True: 293k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   83|   293k|    } \
  |  |  |  |   84|   293k|    stmt; \
  |  |  |  |   85|   293k|} while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (85:9): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  669|   293k|    secp256k1_fe_mul(&h3, &h2, &h);
  ------------------
  |  |   93|   293k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  670|   293k|    secp256k1_fe_mul(&t, &u1, &h2);
  ------------------
  |  |   93|   293k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  671|       |
  672|   293k|    secp256k1_fe_sqr(&r->x, &i);
  ------------------
  |  |   94|   293k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  673|   293k|    secp256k1_fe_add(&r->x, &h3);
  ------------------
  |  |   92|   293k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  674|   293k|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|   293k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  675|   293k|    secp256k1_fe_add(&r->x, &t);
  ------------------
  |  |   92|   293k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  676|       |
  677|   293k|    secp256k1_fe_add(&t, &r->x);
  ------------------
  |  |   92|   293k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  678|   293k|    secp256k1_fe_mul(&r->y, &t, &i);
  ------------------
  |  |   93|   293k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  679|   293k|    secp256k1_fe_mul(&h3, &h3, &s1);
  ------------------
  |  |   93|   293k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  680|   293k|    secp256k1_fe_add(&r->y, &h3);
  ------------------
  |  |   92|   293k|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  681|       |
  682|   293k|    SECP256K1_GEJ_VERIFY(r);
  ------------------
  |  |  210|   293k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  683|   293k|}
secp256k1.c:secp256k1_ge_set_gej_var:
  177|  3.94k|static void secp256k1_ge_set_gej_var(secp256k1_ge *r, secp256k1_gej *a) {
  178|  3.94k|    secp256k1_fe z2, z3;
  179|  3.94k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|  3.94k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  180|       |
  181|  3.94k|    if (secp256k1_gej_is_infinity(a)) {
  ------------------
  |  Branch (181:9): [True: 0, False: 3.94k]
  ------------------
  182|      0|        secp256k1_ge_set_infinity(r);
  183|      0|        return;
  184|      0|    }
  185|  3.94k|    r->infinity = 0;
  186|  3.94k|    secp256k1_fe_inv_var(&a->z, &a->z);
  ------------------
  |  |   99|  3.94k|#  define secp256k1_fe_inv_var secp256k1_fe_impl_inv_var
  ------------------
  187|  3.94k|    secp256k1_fe_sqr(&z2, &a->z);
  ------------------
  |  |   94|  3.94k|#  define secp256k1_fe_sqr secp256k1_fe_impl_sqr
  ------------------
  188|  3.94k|    secp256k1_fe_mul(&z3, &a->z, &z2);
  ------------------
  |  |   93|  3.94k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  189|  3.94k|    secp256k1_fe_mul(&a->x, &a->x, &z2);
  ------------------
  |  |   93|  3.94k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  190|  3.94k|    secp256k1_fe_mul(&a->y, &a->y, &z3);
  ------------------
  |  |   93|  3.94k|#  define secp256k1_fe_mul secp256k1_fe_impl_mul
  ------------------
  191|  3.94k|    secp256k1_fe_set_int(&a->z, 1);
  ------------------
  |  |   83|  3.94k|#  define secp256k1_fe_set_int secp256k1_fe_impl_set_int
  ------------------
  192|  3.94k|    secp256k1_ge_set_xy(r, &a->x, &a->y);
  193|       |
  194|  3.94k|    SECP256K1_GEJ_VERIFY(a);
  ------------------
  |  |  210|  3.94k|#define SECP256K1_GEJ_VERIFY(a) secp256k1_gej_verify(a)
  ------------------
  195|  3.94k|    SECP256K1_GE_VERIFY(r);
  ------------------
  |  |  206|  3.94k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  196|  3.94k|}
secp256k1.c:secp256k1_ge_is_infinity:
  143|  21.6k|static int secp256k1_ge_is_infinity(const secp256k1_ge *a) {
  144|  21.6k|    SECP256K1_GE_VERIFY(a);
  ------------------
  |  |  206|  21.6k|#define SECP256K1_GE_VERIFY(a) secp256k1_ge_verify(a)
  ------------------
  145|       |
  146|  21.6k|    return a->infinity;
  147|  21.6k|}

secp256k1.c:secp256k1_sha256_initialize:
   31|   123k|static void secp256k1_sha256_initialize(secp256k1_sha256 *hash) {
   32|   123k|    hash->s[0] = 0x6a09e667ul;
   33|   123k|    hash->s[1] = 0xbb67ae85ul;
   34|   123k|    hash->s[2] = 0x3c6ef372ul;
   35|   123k|    hash->s[3] = 0xa54ff53aul;
   36|   123k|    hash->s[4] = 0x510e527ful;
   37|   123k|    hash->s[5] = 0x9b05688cul;
   38|   123k|    hash->s[6] = 0x1f83d9abul;
   39|   123k|    hash->s[7] = 0x5be0cd19ul;
   40|   123k|    hash->bytes = 0;
   41|   123k|}
secp256k1.c:secp256k1_rfc6979_hmac_sha256_initialize:
  222|  12.3k|static void secp256k1_rfc6979_hmac_sha256_initialize(secp256k1_rfc6979_hmac_sha256 *rng, const unsigned char *key, size_t keylen) {
  223|  12.3k|    secp256k1_hmac_sha256 hmac;
  224|  12.3k|    static const unsigned char zero[1] = {0x00};
  225|  12.3k|    static const unsigned char one[1] = {0x01};
  226|       |
  227|  12.3k|    memset(rng->v, 0x01, 32); /* RFC6979 3.2.b. */
  228|  12.3k|    memset(rng->k, 0x00, 32); /* RFC6979 3.2.c. */
  229|       |
  230|       |    /* RFC6979 3.2.d. */
  231|  12.3k|    secp256k1_hmac_sha256_initialize(&hmac, rng->k, 32);
  232|  12.3k|    secp256k1_hmac_sha256_write(&hmac, rng->v, 32);
  233|  12.3k|    secp256k1_hmac_sha256_write(&hmac, zero, 1);
  234|  12.3k|    secp256k1_hmac_sha256_write(&hmac, key, keylen);
  235|  12.3k|    secp256k1_hmac_sha256_finalize(&hmac, rng->k);
  236|  12.3k|    secp256k1_hmac_sha256_initialize(&hmac, rng->k, 32);
  237|  12.3k|    secp256k1_hmac_sha256_write(&hmac, rng->v, 32);
  238|  12.3k|    secp256k1_hmac_sha256_finalize(&hmac, rng->v);
  239|       |
  240|       |    /* RFC6979 3.2.f. */
  241|  12.3k|    secp256k1_hmac_sha256_initialize(&hmac, rng->k, 32);
  242|  12.3k|    secp256k1_hmac_sha256_write(&hmac, rng->v, 32);
  243|  12.3k|    secp256k1_hmac_sha256_write(&hmac, one, 1);
  244|  12.3k|    secp256k1_hmac_sha256_write(&hmac, key, keylen);
  245|  12.3k|    secp256k1_hmac_sha256_finalize(&hmac, rng->k);
  246|  12.3k|    secp256k1_hmac_sha256_initialize(&hmac, rng->k, 32);
  247|  12.3k|    secp256k1_hmac_sha256_write(&hmac, rng->v, 32);
  248|  12.3k|    secp256k1_hmac_sha256_finalize(&hmac, rng->v);
  249|  12.3k|    rng->retry = 0;
  250|  12.3k|}
secp256k1.c:secp256k1_hmac_sha256_initialize:
  178|  61.8k|static void secp256k1_hmac_sha256_initialize(secp256k1_hmac_sha256 *hash, const unsigned char *key, size_t keylen) {
  179|  61.8k|    size_t n;
  180|  61.8k|    unsigned char rkey[64];
  181|  61.8k|    if (keylen <= sizeof(rkey)) {
  ------------------
  |  Branch (181:9): [True: 61.8k, False: 0]
  ------------------
  182|  61.8k|        memcpy(rkey, key, keylen);
  183|  61.8k|        memset(rkey + keylen, 0, sizeof(rkey) - keylen);
  184|  61.8k|    } else {
  185|      0|        secp256k1_sha256 sha256;
  186|      0|        secp256k1_sha256_initialize(&sha256);
  187|      0|        secp256k1_sha256_write(&sha256, key, keylen);
  188|      0|        secp256k1_sha256_finalize(&sha256, rkey);
  189|      0|        memset(rkey + 32, 0, 32);
  190|      0|    }
  191|       |
  192|  61.8k|    secp256k1_sha256_initialize(&hash->outer);
  193|  4.02M|    for (n = 0; n < sizeof(rkey); n++) {
  ------------------
  |  Branch (193:17): [True: 3.95M, False: 61.8k]
  ------------------
  194|  3.95M|        rkey[n] ^= 0x5c;
  195|  3.95M|    }
  196|  61.8k|    secp256k1_sha256_write(&hash->outer, rkey, sizeof(rkey));
  197|       |
  198|  61.8k|    secp256k1_sha256_initialize(&hash->inner);
  199|  4.02M|    for (n = 0; n < sizeof(rkey); n++) {
  ------------------
  |  Branch (199:17): [True: 3.95M, False: 61.8k]
  ------------------
  200|  3.95M|        rkey[n] ^= 0x5c ^ 0x36;
  201|  3.95M|    }
  202|  61.8k|    secp256k1_sha256_write(&hash->inner, rkey, sizeof(rkey));
  203|  61.8k|    secp256k1_memclear(rkey, sizeof(rkey));
  204|  61.8k|}
secp256k1.c:secp256k1_hmac_sha256_write:
  206|   111k|static void secp256k1_hmac_sha256_write(secp256k1_hmac_sha256 *hash, const unsigned char *data, size_t size) {
  207|   111k|    secp256k1_sha256_write(&hash->inner, data, size);
  208|   111k|}
secp256k1.c:secp256k1_hmac_sha256_finalize:
  210|  61.8k|static void secp256k1_hmac_sha256_finalize(secp256k1_hmac_sha256 *hash, unsigned char *out32) {
  211|  61.8k|    unsigned char temp[32];
  212|  61.8k|    secp256k1_sha256_finalize(&hash->inner, temp);
  213|  61.8k|    secp256k1_sha256_write(&hash->outer, temp, 32);
  214|  61.8k|    secp256k1_memclear(temp, sizeof(temp));
  215|  61.8k|    secp256k1_sha256_finalize(&hash->outer, out32);
  216|  61.8k|}
secp256k1.c:secp256k1_rfc6979_hmac_sha256_generate:
  252|  12.3k|static void secp256k1_rfc6979_hmac_sha256_generate(secp256k1_rfc6979_hmac_sha256 *rng, unsigned char *out, size_t outlen) {
  253|       |    /* RFC6979 3.2.h. */
  254|  12.3k|    static const unsigned char zero[1] = {0x00};
  255|  12.3k|    if (rng->retry) {
  ------------------
  |  Branch (255:9): [True: 0, False: 12.3k]
  ------------------
  256|      0|        secp256k1_hmac_sha256 hmac;
  257|      0|        secp256k1_hmac_sha256_initialize(&hmac, rng->k, 32);
  258|      0|        secp256k1_hmac_sha256_write(&hmac, rng->v, 32);
  259|      0|        secp256k1_hmac_sha256_write(&hmac, zero, 1);
  260|      0|        secp256k1_hmac_sha256_finalize(&hmac, rng->k);
  261|      0|        secp256k1_hmac_sha256_initialize(&hmac, rng->k, 32);
  262|      0|        secp256k1_hmac_sha256_write(&hmac, rng->v, 32);
  263|      0|        secp256k1_hmac_sha256_finalize(&hmac, rng->v);
  264|      0|    }
  265|       |
  266|  24.7k|    while (outlen > 0) {
  ------------------
  |  Branch (266:12): [True: 12.3k, False: 12.3k]
  ------------------
  267|  12.3k|        secp256k1_hmac_sha256 hmac;
  268|  12.3k|        int now = outlen;
  269|  12.3k|        secp256k1_hmac_sha256_initialize(&hmac, rng->k, 32);
  270|  12.3k|        secp256k1_hmac_sha256_write(&hmac, rng->v, 32);
  271|  12.3k|        secp256k1_hmac_sha256_finalize(&hmac, rng->v);
  272|  12.3k|        if (now > 32) {
  ------------------
  |  Branch (272:13): [True: 0, False: 12.3k]
  ------------------
  273|      0|            now = 32;
  274|      0|        }
  275|  12.3k|        memcpy(out, rng->v, now);
  276|  12.3k|        out += now;
  277|  12.3k|        outlen -= now;
  278|  12.3k|    }
  279|       |
  280|  12.3k|    rng->retry = 1;
  281|  12.3k|}
secp256k1.c:secp256k1_rfc6979_hmac_sha256_finalize:
  283|  12.3k|static void secp256k1_rfc6979_hmac_sha256_finalize(secp256k1_rfc6979_hmac_sha256 *rng) {
  284|  12.3k|    (void) rng;
  285|  12.3k|}
secp256k1.c:secp256k1_rfc6979_hmac_sha256_clear:
  287|  12.3k|static void secp256k1_rfc6979_hmac_sha256_clear(secp256k1_rfc6979_hmac_sha256 *rng) {
  288|  12.3k|    secp256k1_memclear(rng, sizeof(*rng));
  289|  12.3k|}
secp256k1.c:secp256k1_sha256_write:
  126|   544k|static void secp256k1_sha256_write(secp256k1_sha256 *hash, const unsigned char *data, size_t len) {
  127|   544k|    size_t bufsize = hash->bytes & 0x3F;
  128|   544k|    hash->bytes += len;
  129|   544k|    VERIFY_CHECK(hash->bytes >= len);
  130|   825k|    while (len >= 64 - bufsize) {
  ------------------
  |  Branch (130:12): [True: 281k, False: 544k]
  ------------------
  131|       |        /* Fill the buffer, and process it. */
  132|   281k|        size_t chunk_len = 64 - bufsize;
  133|   281k|        memcpy(hash->buf + bufsize, data, chunk_len);
  134|   281k|        data += chunk_len;
  135|   281k|        len -= chunk_len;
  136|   281k|        secp256k1_sha256_transform(hash->s, hash->buf);
  137|   281k|        bufsize = 0;
  138|   281k|    }
  139|   544k|    if (len) {
  ------------------
  |  Branch (139:9): [True: 296k, False: 247k]
  ------------------
  140|       |        /* Fill the buffer with what remains. */
  141|   296k|        memcpy(hash->buf + bufsize, data, len);
  142|   296k|    }
  143|   544k|}
secp256k1.c:secp256k1_sha256_transform:
   44|   281k|static void secp256k1_sha256_transform(uint32_t* s, const unsigned char* buf) {
   45|   281k|    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];
   46|   281k|    uint32_t w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15;
   47|       |
   48|   281k|    Round(a, b, c, d, e, f, g, h, 0x428a2f98,  w0 = secp256k1_read_be32(&buf[0]));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   49|   281k|    Round(h, a, b, c, d, e, f, g, 0x71374491,  w1 = secp256k1_read_be32(&buf[4]));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   50|   281k|    Round(g, h, a, b, c, d, e, f, 0xb5c0fbcf,  w2 = secp256k1_read_be32(&buf[8]));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   51|   281k|    Round(f, g, h, a, b, c, d, e, 0xe9b5dba5,  w3 = secp256k1_read_be32(&buf[12]));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   52|   281k|    Round(e, f, g, h, a, b, c, d, 0x3956c25b,  w4 = secp256k1_read_be32(&buf[16]));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   53|   281k|    Round(d, e, f, g, h, a, b, c, 0x59f111f1,  w5 = secp256k1_read_be32(&buf[20]));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   54|   281k|    Round(c, d, e, f, g, h, a, b, 0x923f82a4,  w6 = secp256k1_read_be32(&buf[24]));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   55|   281k|    Round(b, c, d, e, f, g, h, a, 0xab1c5ed5,  w7 = secp256k1_read_be32(&buf[28]));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   56|   281k|    Round(a, b, c, d, e, f, g, h, 0xd807aa98,  w8 = secp256k1_read_be32(&buf[32]));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   57|   281k|    Round(h, a, b, c, d, e, f, g, 0x12835b01,  w9 = secp256k1_read_be32(&buf[36]));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   58|   281k|    Round(g, h, a, b, c, d, e, f, 0x243185be, w10 = secp256k1_read_be32(&buf[40]));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   59|   281k|    Round(f, g, h, a, b, c, d, e, 0x550c7dc3, w11 = secp256k1_read_be32(&buf[44]));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   60|   281k|    Round(e, f, g, h, a, b, c, d, 0x72be5d74, w12 = secp256k1_read_be32(&buf[48]));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   61|   281k|    Round(d, e, f, g, h, a, b, c, 0x80deb1fe, w13 = secp256k1_read_be32(&buf[52]));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   62|   281k|    Round(c, d, e, f, g, h, a, b, 0x9bdc06a7, w14 = secp256k1_read_be32(&buf[56]));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   63|   281k|    Round(b, c, d, e, f, g, h, a, 0xc19bf174, w15 = secp256k1_read_be32(&buf[60]));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   64|       |
   65|   281k|    Round(a, b, c, d, e, f, g, h, 0xe49b69c1, w0 += sigma1(w14) + w9 + sigma0(w1));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   66|   281k|    Round(h, a, b, c, d, e, f, g, 0xefbe4786, w1 += sigma1(w15) + w10 + sigma0(w2));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   67|   281k|    Round(g, h, a, b, c, d, e, f, 0x0fc19dc6, w2 += sigma1(w0) + w11 + sigma0(w3));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   68|   281k|    Round(f, g, h, a, b, c, d, e, 0x240ca1cc, w3 += sigma1(w1) + w12 + sigma0(w4));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   69|   281k|    Round(e, f, g, h, a, b, c, d, 0x2de92c6f, w4 += sigma1(w2) + w13 + sigma0(w5));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   70|   281k|    Round(d, e, f, g, h, a, b, c, 0x4a7484aa, w5 += sigma1(w3) + w14 + sigma0(w6));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   71|   281k|    Round(c, d, e, f, g, h, a, b, 0x5cb0a9dc, w6 += sigma1(w4) + w15 + sigma0(w7));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   72|   281k|    Round(b, c, d, e, f, g, h, a, 0x76f988da, w7 += sigma1(w5) + w0 + sigma0(w8));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   73|   281k|    Round(a, b, c, d, e, f, g, h, 0x983e5152, w8 += sigma1(w6) + w1 + sigma0(w9));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   74|   281k|    Round(h, a, b, c, d, e, f, g, 0xa831c66d, w9 += sigma1(w7) + w2 + sigma0(w10));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   75|   281k|    Round(g, h, a, b, c, d, e, f, 0xb00327c8, w10 += sigma1(w8) + w3 + sigma0(w11));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   76|   281k|    Round(f, g, h, a, b, c, d, e, 0xbf597fc7, w11 += sigma1(w9) + w4 + sigma0(w12));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   77|   281k|    Round(e, f, g, h, a, b, c, d, 0xc6e00bf3, w12 += sigma1(w10) + w5 + sigma0(w13));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   78|   281k|    Round(d, e, f, g, h, a, b, c, 0xd5a79147, w13 += sigma1(w11) + w6 + sigma0(w14));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   79|   281k|    Round(c, d, e, f, g, h, a, b, 0x06ca6351, w14 += sigma1(w12) + w7 + sigma0(w15));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   80|   281k|    Round(b, c, d, e, f, g, h, a, 0x14292967, w15 += sigma1(w13) + w8 + sigma0(w0));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   81|       |
   82|   281k|    Round(a, b, c, d, e, f, g, h, 0x27b70a85, w0 += sigma1(w14) + w9 + sigma0(w1));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   83|   281k|    Round(h, a, b, c, d, e, f, g, 0x2e1b2138, w1 += sigma1(w15) + w10 + sigma0(w2));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   84|   281k|    Round(g, h, a, b, c, d, e, f, 0x4d2c6dfc, w2 += sigma1(w0) + w11 + sigma0(w3));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   85|   281k|    Round(f, g, h, a, b, c, d, e, 0x53380d13, w3 += sigma1(w1) + w12 + sigma0(w4));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   86|   281k|    Round(e, f, g, h, a, b, c, d, 0x650a7354, w4 += sigma1(w2) + w13 + sigma0(w5));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   87|   281k|    Round(d, e, f, g, h, a, b, c, 0x766a0abb, w5 += sigma1(w3) + w14 + sigma0(w6));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   88|   281k|    Round(c, d, e, f, g, h, a, b, 0x81c2c92e, w6 += sigma1(w4) + w15 + sigma0(w7));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   89|   281k|    Round(b, c, d, e, f, g, h, a, 0x92722c85, w7 += sigma1(w5) + w0 + sigma0(w8));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   90|   281k|    Round(a, b, c, d, e, f, g, h, 0xa2bfe8a1, w8 += sigma1(w6) + w1 + sigma0(w9));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   91|   281k|    Round(h, a, b, c, d, e, f, g, 0xa81a664b, w9 += sigma1(w7) + w2 + sigma0(w10));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   92|   281k|    Round(g, h, a, b, c, d, e, f, 0xc24b8b70, w10 += sigma1(w8) + w3 + sigma0(w11));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   93|   281k|    Round(f, g, h, a, b, c, d, e, 0xc76c51a3, w11 += sigma1(w9) + w4 + sigma0(w12));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   94|   281k|    Round(e, f, g, h, a, b, c, d, 0xd192e819, w12 += sigma1(w10) + w5 + sigma0(w13));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   95|   281k|    Round(d, e, f, g, h, a, b, c, 0xd6990624, w13 += sigma1(w11) + w6 + sigma0(w14));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   96|   281k|    Round(c, d, e, f, g, h, a, b, 0xf40e3585, w14 += sigma1(w12) + w7 + sigma0(w15));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   97|   281k|    Round(b, c, d, e, f, g, h, a, 0x106aa070, w15 += sigma1(w13) + w8 + sigma0(w0));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   98|       |
   99|   281k|    Round(a, b, c, d, e, f, g, h, 0x19a4c116, w0 += sigma1(w14) + w9 + sigma0(w1));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  100|   281k|    Round(h, a, b, c, d, e, f, g, 0x1e376c08, w1 += sigma1(w15) + w10 + sigma0(w2));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  101|   281k|    Round(g, h, a, b, c, d, e, f, 0x2748774c, w2 += sigma1(w0) + w11 + sigma0(w3));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  102|   281k|    Round(f, g, h, a, b, c, d, e, 0x34b0bcb5, w3 += sigma1(w1) + w12 + sigma0(w4));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  103|   281k|    Round(e, f, g, h, a, b, c, d, 0x391c0cb3, w4 += sigma1(w2) + w13 + sigma0(w5));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  104|   281k|    Round(d, e, f, g, h, a, b, c, 0x4ed8aa4a, w5 += sigma1(w3) + w14 + sigma0(w6));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  105|   281k|    Round(c, d, e, f, g, h, a, b, 0x5b9cca4f, w6 += sigma1(w4) + w15 + sigma0(w7));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  106|   281k|    Round(b, c, d, e, f, g, h, a, 0x682e6ff3, w7 += sigma1(w5) + w0 + sigma0(w8));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  107|   281k|    Round(a, b, c, d, e, f, g, h, 0x748f82ee, w8 += sigma1(w6) + w1 + sigma0(w9));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  108|   281k|    Round(h, a, b, c, d, e, f, g, 0x78a5636f, w9 += sigma1(w7) + w2 + sigma0(w10));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  109|   281k|    Round(g, h, a, b, c, d, e, f, 0x84c87814, w10 += sigma1(w8) + w3 + sigma0(w11));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  110|   281k|    Round(f, g, h, a, b, c, d, e, 0x8cc70208, w11 += sigma1(w9) + w4 + sigma0(w12));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  111|   281k|    Round(e, f, g, h, a, b, c, d, 0x90befffa, w12 += sigma1(w10) + w5 + sigma0(w13));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  112|   281k|    Round(d, e, f, g, h, a, b, c, 0xa4506ceb, w13 += sigma1(w11) + w6 + sigma0(w14));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  113|   281k|    Round(c, d, e, f, g, h, a, b, 0xbef9a3f7, w14 + sigma1(w12) + w7 + sigma0(w15));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  114|   281k|    Round(b, c, d, e, f, g, h, a, 0xc67178f2, w15 + sigma1(w13) + w8 + sigma0(w0));
  ------------------
  |  |   24|   281k|#define Round(a,b,c,d,e,f,g,h,k,w) do { \
  |  |   25|   281k|    uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   20|   281k|#define Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))
  |  |  ------------------
  |  |                   uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
  |  |  ------------------
  |  |  |  |   17|   281k|#define Ch(x,y,z) ((z) ^ ((x) & ((y) ^ (z))))
  |  |  ------------------
  |  |   26|   281k|    uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   19|   281k|#define Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))
  |  |  ------------------
  |  |                   uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
  |  |  ------------------
  |  |  |  |   18|   281k|#define Maj(x,y,z) (((x) & (y)) | ((z) & ((x) | (y))))
  |  |  ------------------
  |  |   27|   281k|    (d) += t1; \
  |  |   28|   281k|    (h) = t1 + t2; \
  |  |   29|   281k|} while(0)
  |  |  ------------------
  |  |  |  Branch (29:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  115|       |
  116|   281k|    s[0] += a;
  117|   281k|    s[1] += b;
  118|   281k|    s[2] += c;
  119|   281k|    s[3] += d;
  120|   281k|    s[4] += e;
  121|   281k|    s[5] += f;
  122|   281k|    s[6] += g;
  123|   281k|    s[7] += h;
  124|   281k|}
secp256k1.c:secp256k1_sha256_finalize:
  145|   123k|static void secp256k1_sha256_finalize(secp256k1_sha256 *hash, unsigned char *out32) {
  146|   123k|    static const unsigned char pad[64] = {0x80};
  147|   123k|    unsigned char sizedesc[8];
  148|   123k|    int i;
  149|       |    /* The maximum message size of SHA256 is 2^64-1 bits. */
  150|   123k|    VERIFY_CHECK(hash->bytes < ((uint64_t)1 << 61));
  151|   123k|    secp256k1_write_be32(&sizedesc[0], hash->bytes >> 29);
  152|   123k|    secp256k1_write_be32(&sizedesc[4], hash->bytes << 3);
  153|   123k|    secp256k1_sha256_write(hash, pad, 1 + ((119 - (hash->bytes % 64)) % 64));
  154|   123k|    secp256k1_sha256_write(hash, sizedesc, 8);
  155|  1.11M|    for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (155:17): [True: 989k, False: 123k]
  ------------------
  156|   989k|        secp256k1_write_be32(&out32[4*i], hash->s[i]);
  157|   989k|        hash->s[i] = 0;
  158|   989k|    }
  159|   123k|}

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

secp256k1.c:secp256k1_modinv64_var:
  637|  19.7k|static void secp256k1_modinv64_var(secp256k1_modinv64_signed62 *x, const secp256k1_modinv64_modinfo *modinfo) {
  638|       |    /* Start with d=0, e=1, f=modulus, g=x, eta=-1. */
  639|  19.7k|    secp256k1_modinv64_signed62 d = {{0, 0, 0, 0, 0}};
  640|  19.7k|    secp256k1_modinv64_signed62 e = {{1, 0, 0, 0, 0}};
  641|  19.7k|    secp256k1_modinv64_signed62 f = modinfo->modulus;
  642|  19.7k|    secp256k1_modinv64_signed62 g = *x;
  643|       |#ifdef VERIFY
  644|       |    int i = 0;
  645|       |#endif
  646|  19.7k|    int j, len = 5;
  647|  19.7k|    int64_t eta = -1; /* eta = -delta; delta is initially 1 */
  648|  19.7k|    int64_t cond, fn, gn;
  649|       |
  650|       |    /* Do iterations of 62 divsteps each until g=0. */
  651|   177k|    while (1) {
  ------------------
  |  Branch (651:12): [Folded - Ignored]
  ------------------
  652|       |        /* Compute transition matrix and new eta after 62 divsteps. */
  653|   177k|        secp256k1_modinv64_trans2x2 t;
  654|   177k|        eta = secp256k1_modinv64_divsteps_62_var(eta, f.v[0], g.v[0], &t);
  655|       |        /* Update d,e using that transition matrix. */
  656|   177k|        secp256k1_modinv64_update_de_62(&d, &e, &t, modinfo);
  657|       |        /* Update f,g using that transition matrix. */
  658|   177k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, len, &modinfo->modulus, -1) > 0); /* f > -modulus */
  659|   177k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, len, &modinfo->modulus, 1) <= 0); /* f <= modulus */
  660|   177k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, len, &modinfo->modulus, -1) > 0); /* g > -modulus */
  661|   177k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, len, &modinfo->modulus, 1) < 0);  /* g <  modulus */
  662|       |
  663|   177k|        secp256k1_modinv64_update_fg_62_var(len, &f, &g, &t);
  664|       |        /* If the bottom limb of g is zero, there is a chance that g=0. */
  665|   177k|        if (g.v[0] == 0) {
  ------------------
  |  Branch (665:13): [True: 19.7k, False: 157k]
  ------------------
  666|  19.7k|            cond = 0;
  667|       |            /* Check if the other limbs are also 0. */
  668|  19.7k|            for (j = 1; j < len; ++j) {
  ------------------
  |  Branch (668:25): [True: 0, False: 19.7k]
  ------------------
  669|      0|                cond |= g.v[j];
  670|      0|            }
  671|       |            /* If so, we're done. */
  672|  19.7k|            if (cond == 0) break;
  ------------------
  |  Branch (672:17): [True: 19.7k, False: 0]
  ------------------
  673|  19.7k|        }
  674|       |
  675|       |        /* Determine if len>1 and limb (len-1) of both f and g is 0 or -1. */
  676|   157k|        fn = f.v[len - 1];
  677|   157k|        gn = g.v[len - 1];
  678|   157k|        cond = ((int64_t)len - 2) >> 63;
  679|   157k|        cond |= fn ^ (fn >> 63);
  680|   157k|        cond |= gn ^ (gn >> 63);
  681|       |        /* If so, reduce length, propagating the sign of f and g's top limb into the one below. */
  682|   157k|        if (cond == 0) {
  ------------------
  |  Branch (682:13): [True: 78.8k, False: 78.8k]
  ------------------
  683|  78.8k|            f.v[len - 2] |= (uint64_t)fn << 62;
  684|  78.8k|            g.v[len - 2] |= (uint64_t)gn << 62;
  685|  78.8k|            --len;
  686|  78.8k|        }
  687|       |
  688|   157k|        VERIFY_CHECK(++i < 12); /* We should never need more than 12*62 = 744 divsteps */
  689|   157k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, len, &modinfo->modulus, -1) > 0); /* f > -modulus */
  690|   157k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, len, &modinfo->modulus, 1) <= 0); /* f <= modulus */
  691|   157k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, len, &modinfo->modulus, -1) > 0); /* g > -modulus */
  692|   157k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, len, &modinfo->modulus, 1) < 0);  /* g <  modulus */
  693|   157k|    }
  694|       |
  695|       |    /* At this point g is 0 and (if g was not originally 0) f must now equal +/- GCD of
  696|       |     * the initial f, g values i.e. +/- 1, and d now contains +/- the modular inverse. */
  697|       |
  698|       |    /* g == 0 */
  699|  19.7k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, len, &SECP256K1_SIGNED62_ONE, 0) == 0);
  700|       |    /* |f| == 1, or (x == 0 and d == 0 and f == modulus) */
  701|  19.7k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, len, &SECP256K1_SIGNED62_ONE, -1) == 0 ||
  702|  19.7k|                 secp256k1_modinv64_mul_cmp_62(&f, len, &SECP256K1_SIGNED62_ONE, 1) == 0 ||
  703|  19.7k|                 (secp256k1_modinv64_mul_cmp_62(x, 5, &SECP256K1_SIGNED62_ONE, 0) == 0 &&
  704|  19.7k|                  secp256k1_modinv64_mul_cmp_62(&d, 5, &SECP256K1_SIGNED62_ONE, 0) == 0 &&
  705|  19.7k|                  secp256k1_modinv64_mul_cmp_62(&f, len, &modinfo->modulus, 1) == 0));
  706|       |
  707|       |    /* Optionally negate d, normalize to [0,modulus), and return it. */
  708|  19.7k|    secp256k1_modinv64_normalize_62(&d, f.v[len - 1], modinfo);
  709|  19.7k|    *x = d;
  710|  19.7k|}
secp256k1.c:secp256k1_modinv64_divsteps_62_var:
  239|   177k|static int64_t secp256k1_modinv64_divsteps_62_var(int64_t eta, uint64_t f0, uint64_t g0, secp256k1_modinv64_trans2x2 *t) {
  240|       |    /* Transformation matrix; see comments in secp256k1_modinv64_divsteps_62. */
  241|   177k|    uint64_t u = 1, v = 0, q = 0, r = 1;
  242|   177k|    uint64_t f = f0, g = g0, m;
  243|   177k|    uint32_t w;
  244|   177k|    int i = 62, limit, zeros;
  245|       |
  246|  2.90M|    for (;;) {
  247|       |        /* Use a sentinel bit to count zeros only up to i. */
  248|  2.90M|        zeros = secp256k1_ctz64_var(g | (UINT64_MAX << i));
  249|       |        /* Perform zeros divsteps at once; they all just divide g by two. */
  250|  2.90M|        g >>= zeros;
  251|  2.90M|        u <<= zeros;
  252|  2.90M|        v <<= zeros;
  253|  2.90M|        eta -= zeros;
  254|  2.90M|        i -= zeros;
  255|       |        /* We're done once we've done 62 divsteps. */
  256|  2.90M|        if (i == 0) break;
  ------------------
  |  Branch (256:13): [True: 177k, False: 2.72M]
  ------------------
  257|  2.72M|        VERIFY_CHECK((f & 1) == 1);
  258|  2.72M|        VERIFY_CHECK((g & 1) == 1);
  259|  2.72M|        VERIFY_CHECK((u * f0 + v * g0) == f << (62 - i));
  260|  2.72M|        VERIFY_CHECK((q * f0 + r * g0) == g << (62 - i));
  261|       |        /* Bounds on eta that follow from the bounds on iteration count (max 12*62 divsteps). */
  262|  2.72M|        VERIFY_CHECK(eta >= -745 && eta <= 745);
  263|       |        /* If eta is negative, negate it and replace f,g with g,-f. */
  264|  2.72M|        if (eta < 0) {
  ------------------
  |  Branch (264:13): [True: 2.62M, False: 94.5k]
  ------------------
  265|  2.62M|            uint64_t tmp;
  266|  2.62M|            eta = -eta;
  267|  2.62M|            tmp = f; f = g; g = -tmp;
  268|  2.62M|            tmp = u; u = q; q = -tmp;
  269|  2.62M|            tmp = v; v = r; r = -tmp;
  270|       |            /* Use a formula to cancel out up to 6 bits of g. Also, no more than i can be cancelled
  271|       |             * out (as we'd be done before that point), and no more than eta+1 can be done as its
  272|       |             * sign will flip again once that happens. */
  273|  2.62M|            limit = ((int)eta + 1) > i ? i : ((int)eta + 1);
  ------------------
  |  Branch (273:21): [True: 52.3k, False: 2.57M]
  ------------------
  274|  2.62M|            VERIFY_CHECK(limit > 0 && limit <= 62);
  275|       |            /* m is a mask for the bottom min(limit, 6) bits. */
  276|  2.62M|            m = (UINT64_MAX >> (64 - limit)) & 63U;
  277|       |            /* Find what multiple of f must be added to g to cancel its bottom min(limit, 6)
  278|       |             * bits. */
  279|  2.62M|            w = (f * g * (f * f - 2)) & m;
  280|  2.62M|        } else {
  281|       |            /* In this branch, use a simpler formula that only lets us cancel up to 4 bits of g, as
  282|       |             * eta tends to be smaller here. */
  283|  94.5k|            limit = ((int)eta + 1) > i ? i : ((int)eta + 1);
  ------------------
  |  Branch (283:21): [True: 644, False: 93.8k]
  ------------------
  284|  94.5k|            VERIFY_CHECK(limit > 0 && limit <= 62);
  285|       |            /* m is a mask for the bottom min(limit, 4) bits. */
  286|  94.5k|            m = (UINT64_MAX >> (64 - limit)) & 15U;
  287|       |            /* Find what multiple of f must be added to g to cancel its bottom min(limit, 4)
  288|       |             * bits. */
  289|  94.5k|            w = f + (((f + 1) & 4) << 1);
  290|  94.5k|            w = (-w * g) & m;
  291|  94.5k|        }
  292|  2.72M|        g += f * w;
  293|  2.72M|        q += u * w;
  294|  2.72M|        r += v * w;
  295|  2.72M|        VERIFY_CHECK((g & m) == 0);
  296|  2.72M|    }
  297|       |    /* Return data in t and return value. */
  298|   177k|    t->u = (int64_t)u;
  299|   177k|    t->v = (int64_t)v;
  300|   177k|    t->q = (int64_t)q;
  301|   177k|    t->r = (int64_t)r;
  302|       |
  303|       |    /* The determinant of t must be a power of two. This guarantees that multiplication with t
  304|       |     * does not change the gcd of f and g, apart from adding a power-of-2 factor to it (which
  305|       |     * will be divided out again). As each divstep's individual matrix has determinant 2, the
  306|       |     * aggregate of 62 of them will have determinant 2^62. */
  307|   177k|    VERIFY_CHECK(secp256k1_modinv64_det_check_pow2(t, 62, 0));
  308|       |
  309|   177k|    return eta;
  310|   177k|}
secp256k1.c:secp256k1_modinv64_update_de_62:
  411|   641k|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|   641k|    const uint64_t M62 = UINT64_MAX >> 2;
  413|   641k|    const int64_t d0 = d->v[0], d1 = d->v[1], d2 = d->v[2], d3 = d->v[3], d4 = d->v[4];
  414|   641k|    const int64_t e0 = e->v[0], e1 = e->v[1], e2 = e->v[2], e3 = e->v[3], e4 = e->v[4];
  415|   641k|    const int64_t u = t->u, v = t->v, q = t->q, r = t->r;
  416|   641k|    int64_t md, me, sd, se;
  417|   641k|    secp256k1_int128 cd, ce;
  418|   641k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(d, 5, &modinfo->modulus, -2) > 0); /* d > -2*modulus */
  419|   641k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(d, 5, &modinfo->modulus, 1) < 0);  /* d <    modulus */
  420|   641k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(e, 5, &modinfo->modulus, -2) > 0); /* e > -2*modulus */
  421|   641k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(e, 5, &modinfo->modulus, 1) < 0);  /* e <    modulus */
  422|   641k|    VERIFY_CHECK(secp256k1_modinv64_abs(u) <= (((int64_t)1 << 62) - secp256k1_modinv64_abs(v))); /* |u|+|v| <= 2^62 */
  423|   641k|    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|   641k|    sd = d4 >> 63;
  427|   641k|    se = e4 >> 63;
  428|   641k|    md = (u & sd) + (v & se);
  429|   641k|    me = (q & sd) + (r & se);
  430|       |    /* Begin computing t*[d,e]. */
  431|   641k|    secp256k1_i128_mul(&cd, u, d0);
  432|   641k|    secp256k1_i128_accum_mul(&cd, v, e0);
  433|   641k|    secp256k1_i128_mul(&ce, q, d0);
  434|   641k|    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|   641k|    md -= (modinfo->modulus_inv62 * secp256k1_i128_to_u64(&cd) + md) & M62;
  437|   641k|    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|   641k|    secp256k1_i128_accum_mul(&cd, modinfo->modulus.v[0], md);
  440|   641k|    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|   641k|    VERIFY_CHECK((secp256k1_i128_to_u64(&cd) & M62) == 0); secp256k1_i128_rshift(&cd, 62);
  443|   641k|    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|   641k|    secp256k1_i128_accum_mul(&cd, u, d1);
  446|   641k|    secp256k1_i128_accum_mul(&cd, v, e1);
  447|   641k|    secp256k1_i128_accum_mul(&ce, q, d1);
  448|   641k|    secp256k1_i128_accum_mul(&ce, r, e1);
  449|   641k|    if (modinfo->modulus.v[1]) { /* Optimize for the case where limb of modulus is zero. */
  ------------------
  |  Branch (449:9): [True: 265k, False: 376k]
  ------------------
  450|   265k|        secp256k1_i128_accum_mul(&cd, modinfo->modulus.v[1], md);
  451|   265k|        secp256k1_i128_accum_mul(&ce, modinfo->modulus.v[1], me);
  452|   265k|    }
  453|   641k|    d->v[0] = secp256k1_i128_to_u64(&cd) & M62; secp256k1_i128_rshift(&cd, 62);
  454|   641k|    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|   641k|    secp256k1_i128_accum_mul(&cd, u, d2);
  457|   641k|    secp256k1_i128_accum_mul(&cd, v, e2);
  458|   641k|    secp256k1_i128_accum_mul(&ce, q, d2);
  459|   641k|    secp256k1_i128_accum_mul(&ce, r, e2);
  460|   641k|    if (modinfo->modulus.v[2]) { /* Optimize for the case where limb of modulus is zero. */
  ------------------
  |  Branch (460:9): [True: 265k, False: 376k]
  ------------------
  461|   265k|        secp256k1_i128_accum_mul(&cd, modinfo->modulus.v[2], md);
  462|   265k|        secp256k1_i128_accum_mul(&ce, modinfo->modulus.v[2], me);
  463|   265k|    }
  464|   641k|    d->v[1] = secp256k1_i128_to_u64(&cd) & M62; secp256k1_i128_rshift(&cd, 62);
  465|   641k|    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|   641k|    secp256k1_i128_accum_mul(&cd, u, d3);
  468|   641k|    secp256k1_i128_accum_mul(&cd, v, e3);
  469|   641k|    secp256k1_i128_accum_mul(&ce, q, d3);
  470|   641k|    secp256k1_i128_accum_mul(&ce, r, e3);
  471|   641k|    if (modinfo->modulus.v[3]) { /* Optimize for the case where limb of modulus is zero. */
  ------------------
  |  Branch (471:9): [True: 0, False: 641k]
  ------------------
  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|   641k|    d->v[2] = secp256k1_i128_to_u64(&cd) & M62; secp256k1_i128_rshift(&cd, 62);
  476|   641k|    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|   641k|    secp256k1_i128_accum_mul(&cd, u, d4);
  479|   641k|    secp256k1_i128_accum_mul(&cd, v, e4);
  480|   641k|    secp256k1_i128_accum_mul(&ce, q, d4);
  481|   641k|    secp256k1_i128_accum_mul(&ce, r, e4);
  482|   641k|    secp256k1_i128_accum_mul(&cd, modinfo->modulus.v[4], md);
  483|   641k|    secp256k1_i128_accum_mul(&ce, modinfo->modulus.v[4], me);
  484|   641k|    d->v[3] = secp256k1_i128_to_u64(&cd) & M62; secp256k1_i128_rshift(&cd, 62);
  485|   641k|    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|   641k|    d->v[4] = secp256k1_i128_to_i64(&cd);
  488|   641k|    e->v[4] = secp256k1_i128_to_i64(&ce);
  489|       |
  490|   641k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(d, 5, &modinfo->modulus, -2) > 0); /* d > -2*modulus */
  491|   641k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(d, 5, &modinfo->modulus, 1) < 0);  /* d <    modulus */
  492|   641k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(e, 5, &modinfo->modulus, -2) > 0); /* e > -2*modulus */
  493|   641k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(e, 5, &modinfo->modulus, 1) < 0);  /* e <    modulus */
  494|   641k|}
secp256k1.c:secp256k1_modinv64_update_fg_62_var:
  553|   177k|static void secp256k1_modinv64_update_fg_62_var(int len, secp256k1_modinv64_signed62 *f, secp256k1_modinv64_signed62 *g, const secp256k1_modinv64_trans2x2 *t) {
  554|   177k|    const uint64_t M62 = UINT64_MAX >> 2;
  555|   177k|    const int64_t u = t->u, v = t->v, q = t->q, r = t->r;
  556|   177k|    int64_t fi, gi;
  557|   177k|    secp256k1_int128 cf, cg;
  558|   177k|    int i;
  559|   177k|    VERIFY_CHECK(len > 0);
  560|       |    /* Start computing t*[f,g]. */
  561|   177k|    fi = f->v[0];
  562|   177k|    gi = g->v[0];
  563|   177k|    secp256k1_i128_mul(&cf, u, fi);
  564|   177k|    secp256k1_i128_accum_mul(&cf, v, gi);
  565|   177k|    secp256k1_i128_mul(&cg, q, fi);
  566|   177k|    secp256k1_i128_accum_mul(&cg, r, gi);
  567|       |    /* Verify that the bottom 62 bits of the result are zero, and then throw them away. */
  568|   177k|    VERIFY_CHECK((secp256k1_i128_to_u64(&cf) & M62) == 0); secp256k1_i128_rshift(&cf, 62);
  569|   177k|    VERIFY_CHECK((secp256k1_i128_to_u64(&cg) & M62) == 0); secp256k1_i128_rshift(&cg, 62);
  570|       |    /* Now iteratively compute limb i=1..len of t*[f,g], and store them in output limb i-1 (shifting
  571|       |     * down by 62 bits). */
  572|   492k|    for (i = 1; i < len; ++i) {
  ------------------
  |  Branch (572:17): [True: 315k, False: 177k]
  ------------------
  573|   315k|        fi = f->v[i];
  574|   315k|        gi = g->v[i];
  575|   315k|        secp256k1_i128_accum_mul(&cf, u, fi);
  576|   315k|        secp256k1_i128_accum_mul(&cf, v, gi);
  577|   315k|        secp256k1_i128_accum_mul(&cg, q, fi);
  578|   315k|        secp256k1_i128_accum_mul(&cg, r, gi);
  579|   315k|        f->v[i - 1] = secp256k1_i128_to_u64(&cf) & M62; secp256k1_i128_rshift(&cf, 62);
  580|   315k|        g->v[i - 1] = secp256k1_i128_to_u64(&cg) & M62; secp256k1_i128_rshift(&cg, 62);
  581|   315k|    }
  582|       |    /* What remains is limb (len) of t*[f,g]; store it as output limb (len-1). */
  583|   177k|    f->v[len - 1] = secp256k1_i128_to_i64(&cf);
  584|   177k|    g->v[len - 1] = secp256k1_i128_to_i64(&cg);
  585|   177k|}
secp256k1.c:secp256k1_modinv64_normalize_62:
   88|  66.1k|static void secp256k1_modinv64_normalize_62(secp256k1_modinv64_signed62 *r, int64_t sign, const secp256k1_modinv64_modinfo *modinfo) {
   89|  66.1k|    const int64_t M62 = (int64_t)(UINT64_MAX >> 2);
   90|  66.1k|    int64_t r0 = r->v[0], r1 = r->v[1], r2 = r->v[2], r3 = r->v[3], r4 = r->v[4];
   91|  66.1k|    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|  66.1k|    cond_add = r4 >> 63;
  110|  66.1k|    r0 += modinfo->modulus.v[0] & cond_add;
  111|  66.1k|    r1 += modinfo->modulus.v[1] & cond_add;
  112|  66.1k|    r2 += modinfo->modulus.v[2] & cond_add;
  113|  66.1k|    r3 += modinfo->modulus.v[3] & cond_add;
  114|  66.1k|    r4 += modinfo->modulus.v[4] & cond_add;
  115|  66.1k|    cond_negate = sign >> 63;
  116|  66.1k|    r0 = (r0 ^ cond_negate) - cond_negate;
  117|  66.1k|    r1 = (r1 ^ cond_negate) - cond_negate;
  118|  66.1k|    r2 = (r2 ^ cond_negate) - cond_negate;
  119|  66.1k|    r3 = (r3 ^ cond_negate) - cond_negate;
  120|  66.1k|    r4 = (r4 ^ cond_negate) - cond_negate;
  121|       |    /* Propagate the top bits, to bring limbs back to range (-2^62,2^62). */
  122|  66.1k|    r1 += r0 >> 62; r0 &= M62;
  123|  66.1k|    r2 += r1 >> 62; r1 &= M62;
  124|  66.1k|    r3 += r2 >> 62; r2 &= M62;
  125|  66.1k|    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|  66.1k|    cond_add = r4 >> 63;
  130|  66.1k|    r0 += modinfo->modulus.v[0] & cond_add;
  131|  66.1k|    r1 += modinfo->modulus.v[1] & cond_add;
  132|  66.1k|    r2 += modinfo->modulus.v[2] & cond_add;
  133|  66.1k|    r3 += modinfo->modulus.v[3] & cond_add;
  134|  66.1k|    r4 += modinfo->modulus.v[4] & cond_add;
  135|       |    /* And propagate again. */
  136|  66.1k|    r1 += r0 >> 62; r0 &= M62;
  137|  66.1k|    r2 += r1 >> 62; r1 &= M62;
  138|  66.1k|    r3 += r2 >> 62; r2 &= M62;
  139|  66.1k|    r4 += r3 >> 62; r3 &= M62;
  140|       |
  141|  66.1k|    r->v[0] = r0;
  142|  66.1k|    r->v[1] = r1;
  143|  66.1k|    r->v[2] = r2;
  144|  66.1k|    r->v[3] = r3;
  145|  66.1k|    r->v[4] = r4;
  146|       |
  147|  66.1k|    VERIFY_CHECK(r0 >> 62 == 0);
  148|  66.1k|    VERIFY_CHECK(r1 >> 62 == 0);
  149|  66.1k|    VERIFY_CHECK(r2 >> 62 == 0);
  150|  66.1k|    VERIFY_CHECK(r3 >> 62 == 0);
  151|  66.1k|    VERIFY_CHECK(r4 >> 62 == 0);
  152|  66.1k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(r, 5, &modinfo->modulus, 0) >= 0); /* r >= 0 */
  153|  66.1k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(r, 5, &modinfo->modulus, 1) < 0); /* r < modulus */
  154|  66.1k|}
secp256k1.c:secp256k1_modinv64:
  588|  46.4k|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|  46.4k|    secp256k1_modinv64_signed62 d = {{0, 0, 0, 0, 0}};
  591|  46.4k|    secp256k1_modinv64_signed62 e = {{1, 0, 0, 0, 0}};
  592|  46.4k|    secp256k1_modinv64_signed62 f = modinfo->modulus;
  593|  46.4k|    secp256k1_modinv64_signed62 g = *x;
  594|  46.4k|    int i;
  595|  46.4k|    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|   510k|    for (i = 0; i < 10; ++i) {
  ------------------
  |  Branch (598:17): [True: 464k, False: 46.4k]
  ------------------
  599|       |        /* Compute transition matrix and new zeta after 59 divsteps. */
  600|   464k|        secp256k1_modinv64_trans2x2 t;
  601|   464k|        zeta = secp256k1_modinv64_divsteps_59(zeta, f.v[0], g.v[0], &t);
  602|       |        /* Update d,e using that transition matrix. */
  603|   464k|        secp256k1_modinv64_update_de_62(&d, &e, &t, modinfo);
  604|       |        /* Update f,g using that transition matrix. */
  605|   464k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, 5, &modinfo->modulus, -1) > 0); /* f > -modulus */
  606|   464k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, 5, &modinfo->modulus, 1) <= 0); /* f <= modulus */
  607|   464k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, 5, &modinfo->modulus, -1) > 0); /* g > -modulus */
  608|   464k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, 5, &modinfo->modulus, 1) < 0);  /* g <  modulus */
  609|       |
  610|   464k|        secp256k1_modinv64_update_fg_62(&f, &g, &t);
  611|       |
  612|   464k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, 5, &modinfo->modulus, -1) > 0); /* f > -modulus */
  613|   464k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, 5, &modinfo->modulus, 1) <= 0); /* f <= modulus */
  614|   464k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, 5, &modinfo->modulus, -1) > 0); /* g > -modulus */
  615|   464k|        VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&g, 5, &modinfo->modulus, 1) < 0);  /* g <  modulus */
  616|   464k|    }
  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|  46.4k|    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|  46.4k|    VERIFY_CHECK(secp256k1_modinv64_mul_cmp_62(&f, 5, &SECP256K1_SIGNED62_ONE, -1) == 0 ||
  626|  46.4k|                 secp256k1_modinv64_mul_cmp_62(&f, 5, &SECP256K1_SIGNED62_ONE, 1) == 0 ||
  627|  46.4k|                 (secp256k1_modinv64_mul_cmp_62(x, 5, &SECP256K1_SIGNED62_ONE, 0) == 0 &&
  628|  46.4k|                  secp256k1_modinv64_mul_cmp_62(&d, 5, &SECP256K1_SIGNED62_ONE, 0) == 0 &&
  629|  46.4k|                  secp256k1_modinv64_mul_cmp_62(&f, 5, &modinfo->modulus, 1) == 0));
  630|       |
  631|       |    /* Optionally negate d, normalize to [0,modulus), and return it. */
  632|  46.4k|    secp256k1_modinv64_normalize_62(&d, f.v[4], modinfo);
  633|  46.4k|    *x = d;
  634|  46.4k|}
secp256k1.c:secp256k1_modinv64_divsteps_59:
  167|   464k|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|   464k|    uint64_t u = 8, v = 0, q = 0, r = 8;
  176|   464k|    volatile uint64_t c1, c2;
  177|   464k|    uint64_t mask1, mask2, f = f0, g = g0, x, y, z;
  178|   464k|    int i;
  179|       |
  180|  27.8M|    for (i = 3; i < 62; ++i) {
  ------------------
  |  Branch (180:17): [True: 27.3M, False: 464k]
  ------------------
  181|  27.3M|        VERIFY_CHECK((f & 1) == 1); /* f must always be odd */
  182|  27.3M|        VERIFY_CHECK((u * f0 + v * g0) == f << i);
  183|  27.3M|        VERIFY_CHECK((q * f0 + r * g0) == g << i);
  184|       |        /* Compute conditional masks for (zeta < 0) and for (g & 1). */
  185|  27.3M|        c1 = zeta >> 63;
  186|  27.3M|        mask1 = c1;
  187|  27.3M|        c2 = g & 1;
  188|  27.3M|        mask2 = -c2;
  189|       |        /* Compute x,y,z, conditionally negated versions of f,u,v. */
  190|  27.3M|        x = (f ^ mask1) - mask1;
  191|  27.3M|        y = (u ^ mask1) - mask1;
  192|  27.3M|        z = (v ^ mask1) - mask1;
  193|       |        /* Conditionally add x,y,z to g,q,r. */
  194|  27.3M|        g += x & mask2;
  195|  27.3M|        q += y & mask2;
  196|  27.3M|        r += z & mask2;
  197|       |        /* In what follows, c1 is a condition mask for (zeta < 0) and (g & 1). */
  198|  27.3M|        mask1 &= mask2;
  199|       |        /* Conditionally change zeta into -zeta-2 or zeta-1. */
  200|  27.3M|        zeta = (zeta ^ mask1) - 1;
  201|       |        /* Conditionally add g,q,r to f,u,v. */
  202|  27.3M|        f += g & mask1;
  203|  27.3M|        u += q & mask1;
  204|  27.3M|        v += r & mask1;
  205|       |        /* Shifts */
  206|  27.3M|        g >>= 1;
  207|  27.3M|        u <<= 1;
  208|  27.3M|        v <<= 1;
  209|       |        /* Bounds on zeta that follow from the bounds on iteration count (max 10*59 divsteps). */
  210|  27.3M|        VERIFY_CHECK(zeta >= -591 && zeta <= 591);
  211|  27.3M|    }
  212|       |    /* Return data in t and return value. */
  213|   464k|    t->u = (int64_t)u;
  214|   464k|    t->v = (int64_t)v;
  215|   464k|    t->q = (int64_t)q;
  216|   464k|    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|   464k|    VERIFY_CHECK(secp256k1_modinv64_det_check_pow2(t, 65, 0));
  225|       |
  226|   464k|    return zeta;
  227|   464k|}
secp256k1.c:secp256k1_modinv64_update_fg_62:
  500|   464k|static void secp256k1_modinv64_update_fg_62(secp256k1_modinv64_signed62 *f, secp256k1_modinv64_signed62 *g, const secp256k1_modinv64_trans2x2 *t) {
  501|   464k|    const uint64_t M62 = UINT64_MAX >> 2;
  502|   464k|    const int64_t f0 = f->v[0], f1 = f->v[1], f2 = f->v[2], f3 = f->v[3], f4 = f->v[4];
  503|   464k|    const int64_t g0 = g->v[0], g1 = g->v[1], g2 = g->v[2], g3 = g->v[3], g4 = g->v[4];
  504|   464k|    const int64_t u = t->u, v = t->v, q = t->q, r = t->r;
  505|   464k|    secp256k1_int128 cf, cg;
  506|       |    /* Start computing t*[f,g]. */
  507|   464k|    secp256k1_i128_mul(&cf, u, f0);
  508|   464k|    secp256k1_i128_accum_mul(&cf, v, g0);
  509|   464k|    secp256k1_i128_mul(&cg, q, f0);
  510|   464k|    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|   464k|    VERIFY_CHECK((secp256k1_i128_to_u64(&cf) & M62) == 0); secp256k1_i128_rshift(&cf, 62);
  513|   464k|    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|   464k|    secp256k1_i128_accum_mul(&cf, u, f1);
  516|   464k|    secp256k1_i128_accum_mul(&cf, v, g1);
  517|   464k|    secp256k1_i128_accum_mul(&cg, q, f1);
  518|   464k|    secp256k1_i128_accum_mul(&cg, r, g1);
  519|   464k|    f->v[0] = secp256k1_i128_to_u64(&cf) & M62; secp256k1_i128_rshift(&cf, 62);
  520|   464k|    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|   464k|    secp256k1_i128_accum_mul(&cf, u, f2);
  523|   464k|    secp256k1_i128_accum_mul(&cf, v, g2);
  524|   464k|    secp256k1_i128_accum_mul(&cg, q, f2);
  525|   464k|    secp256k1_i128_accum_mul(&cg, r, g2);
  526|   464k|    f->v[1] = secp256k1_i128_to_u64(&cf) & M62; secp256k1_i128_rshift(&cf, 62);
  527|   464k|    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|   464k|    secp256k1_i128_accum_mul(&cf, u, f3);
  530|   464k|    secp256k1_i128_accum_mul(&cf, v, g3);
  531|   464k|    secp256k1_i128_accum_mul(&cg, q, f3);
  532|   464k|    secp256k1_i128_accum_mul(&cg, r, g3);
  533|   464k|    f->v[2] = secp256k1_i128_to_u64(&cf) & M62; secp256k1_i128_rshift(&cf, 62);
  534|   464k|    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|   464k|    secp256k1_i128_accum_mul(&cf, u, f4);
  537|   464k|    secp256k1_i128_accum_mul(&cf, v, g4);
  538|   464k|    secp256k1_i128_accum_mul(&cg, q, f4);
  539|   464k|    secp256k1_i128_accum_mul(&cg, r, g4);
  540|   464k|    f->v[3] = secp256k1_i128_to_u64(&cf) & M62; secp256k1_i128_rshift(&cf, 62);
  541|   464k|    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|   464k|    f->v[4] = secp256k1_i128_to_i64(&cf);
  544|   464k|    g->v[4] = secp256k1_i128_to_i64(&cg);
  545|   464k|}

secp256k1_ecdsa_recoverable_signature_parse_compact:
   38|  1.97k|int secp256k1_ecdsa_recoverable_signature_parse_compact(const secp256k1_context* ctx, secp256k1_ecdsa_recoverable_signature* sig, const unsigned char *input64, int recid) {
   39|  1.97k|    secp256k1_scalar r, s;
   40|  1.97k|    int ret = 1;
   41|  1.97k|    int overflow = 0;
   42|       |
   43|  1.97k|    VERIFY_CHECK(ctx != NULL);
   44|  1.97k|    ARG_CHECK(sig != NULL);
  ------------------
  |  |   45|  1.97k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.97k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  1.97k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.97k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.97k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   45|  1.97k|    ARG_CHECK(input64 != NULL);
  ------------------
  |  |   45|  1.97k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.97k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  1.97k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.97k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.97k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   46|  1.97k|    ARG_CHECK(recid >= 0 && recid <= 3);
  ------------------
  |  |   45|  1.97k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.97k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  3.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.97k]
  |  |  |  |  |  Branch (136:39): [True: 1.97k, False: 0]
  |  |  |  |  |  Branch (136:39): [True: 1.97k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.97k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   47|       |
   48|  1.97k|    secp256k1_scalar_set_b32(&r, &input64[0], &overflow);
   49|  1.97k|    ret &= !overflow;
   50|  1.97k|    secp256k1_scalar_set_b32(&s, &input64[32], &overflow);
   51|  1.97k|    ret &= !overflow;
   52|  1.97k|    if (ret) {
  ------------------
  |  Branch (52:9): [True: 1.97k, False: 0]
  ------------------
   53|  1.97k|        secp256k1_ecdsa_recoverable_signature_save(sig, &r, &s, recid);
   54|  1.97k|    } else {
   55|      0|        memset(sig, 0, sizeof(*sig));
   56|      0|    }
   57|  1.97k|    return ret;
   58|  1.97k|}
secp256k1_ecdsa_recoverable_signature_serialize_compact:
   60|  1.97k|int secp256k1_ecdsa_recoverable_signature_serialize_compact(const secp256k1_context* ctx, unsigned char *output64, int *recid, const secp256k1_ecdsa_recoverable_signature* sig) {
   61|  1.97k|    secp256k1_scalar r, s;
   62|       |
   63|  1.97k|    VERIFY_CHECK(ctx != NULL);
   64|  1.97k|    ARG_CHECK(output64 != NULL);
  ------------------
  |  |   45|  1.97k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.97k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  1.97k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.97k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.97k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   65|  1.97k|    ARG_CHECK(sig != NULL);
  ------------------
  |  |   45|  1.97k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.97k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  1.97k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.97k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.97k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   66|  1.97k|    ARG_CHECK(recid != NULL);
  ------------------
  |  |   45|  1.97k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.97k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  1.97k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.97k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.97k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
   67|       |
   68|  1.97k|    secp256k1_ecdsa_recoverable_signature_load(ctx, &r, &s, recid, sig);
   69|  1.97k|    secp256k1_scalar_get_b32(&output64[0], &r);
   70|  1.97k|    secp256k1_scalar_get_b32(&output64[32], &s);
   71|  1.97k|    return 1;
   72|  1.97k|}
secp256k1_ecdsa_sign_recoverable:
  123|  1.97k|int secp256k1_ecdsa_sign_recoverable(const secp256k1_context* ctx, secp256k1_ecdsa_recoverable_signature *signature, const unsigned char *msghash32, const unsigned char *seckey, secp256k1_nonce_function noncefp, const void* noncedata) {
  124|  1.97k|    secp256k1_scalar r, s;
  125|  1.97k|    int ret, recid;
  126|  1.97k|    VERIFY_CHECK(ctx != NULL);
  127|  1.97k|    ARG_CHECK(secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx));
  ------------------
  |  |   45|  1.97k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.97k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  1.97k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.97k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.97k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  128|  1.97k|    ARG_CHECK(msghash32 != NULL);
  ------------------
  |  |   45|  1.97k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.97k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  1.97k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.97k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.97k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  129|  1.97k|    ARG_CHECK(signature != NULL);
  ------------------
  |  |   45|  1.97k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.97k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  1.97k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.97k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.97k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  130|  1.97k|    ARG_CHECK(seckey != NULL);
  ------------------
  |  |   45|  1.97k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.97k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  1.97k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.97k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.97k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  131|       |
  132|  1.97k|    ret = secp256k1_ecdsa_sign_inner(ctx, &r, &s, &recid, msghash32, seckey, noncefp, noncedata);
  133|  1.97k|    secp256k1_ecdsa_recoverable_signature_save(signature, &r, &s, recid);
  134|  1.97k|    return ret;
  135|  1.97k|}
secp256k1_ecdsa_recover:
  137|  3.94k|int secp256k1_ecdsa_recover(const secp256k1_context* ctx, secp256k1_pubkey *pubkey, const secp256k1_ecdsa_recoverable_signature *signature, const unsigned char *msghash32) {
  138|  3.94k|    secp256k1_ge q;
  139|  3.94k|    secp256k1_scalar r, s;
  140|  3.94k|    secp256k1_scalar m;
  141|  3.94k|    int recid;
  142|  3.94k|    VERIFY_CHECK(ctx != NULL);
  143|  3.94k|    ARG_CHECK(msghash32 != NULL);
  ------------------
  |  |   45|  3.94k|#define ARG_CHECK(cond) do { \
  |  |   46|  3.94k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  3.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 3.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  3.94k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  144|  3.94k|    ARG_CHECK(signature != NULL);
  ------------------
  |  |   45|  3.94k|#define ARG_CHECK(cond) do { \
  |  |   46|  3.94k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  3.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 3.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  3.94k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  145|  3.94k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  3.94k|#define ARG_CHECK(cond) do { \
  |  |   46|  3.94k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  3.94k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 3.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  3.94k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  146|       |
  147|  3.94k|    secp256k1_ecdsa_recoverable_signature_load(ctx, &r, &s, &recid, signature);
  148|  3.94k|    VERIFY_CHECK(recid >= 0 && recid < 4);  /* should have been caught in parse_compact */
  149|  3.94k|    secp256k1_scalar_set_b32(&m, msghash32, NULL);
  150|  3.94k|    if (secp256k1_ecdsa_sig_recover(&r, &s, &q, &m, recid)) {
  ------------------
  |  Branch (150:9): [True: 3.94k, False: 0]
  ------------------
  151|  3.94k|        secp256k1_pubkey_save(pubkey, &q);
  152|  3.94k|        return 1;
  153|  3.94k|    } else {
  154|      0|        memset(pubkey, 0, sizeof(*pubkey));
  155|      0|        return 0;
  156|      0|    }
  157|  3.94k|}
secp256k1.c:secp256k1_ecdsa_recoverable_signature_save:
   27|  3.94k|static void secp256k1_ecdsa_recoverable_signature_save(secp256k1_ecdsa_recoverable_signature* sig, const secp256k1_scalar* r, const secp256k1_scalar* s, int recid) {
   28|  3.94k|    if (sizeof(secp256k1_scalar) == 32) {
  ------------------
  |  Branch (28:9): [Folded - Ignored]
  ------------------
   29|  3.94k|        memcpy(&sig->data[0], r, 32);
   30|  3.94k|        memcpy(&sig->data[32], s, 32);
   31|  3.94k|    } else {
   32|      0|        secp256k1_scalar_get_b32(&sig->data[0], r);
   33|      0|        secp256k1_scalar_get_b32(&sig->data[32], s);
   34|      0|    }
   35|  3.94k|    sig->data[64] = recid;
   36|  3.94k|}
secp256k1.c:secp256k1_ecdsa_recoverable_signature_load:
   12|  5.91k|static void secp256k1_ecdsa_recoverable_signature_load(const secp256k1_context* ctx, secp256k1_scalar* r, secp256k1_scalar* s, int* recid, const secp256k1_ecdsa_recoverable_signature* sig) {
   13|  5.91k|    (void)ctx;
   14|  5.91k|    if (sizeof(secp256k1_scalar) == 32) {
  ------------------
  |  Branch (14:9): [Folded - Ignored]
  ------------------
   15|       |        /* When the secp256k1_scalar type is exactly 32 byte, use its
   16|       |         * representation inside secp256k1_ecdsa_signature, as conversion is very fast.
   17|       |         * Note that secp256k1_ecdsa_signature_save must use the same representation. */
   18|  5.91k|        memcpy(r, &sig->data[0], 32);
   19|  5.91k|        memcpy(s, &sig->data[32], 32);
   20|  5.91k|    } else {
   21|      0|        secp256k1_scalar_set_b32(r, &sig->data[0], NULL);
   22|      0|        secp256k1_scalar_set_b32(s, &sig->data[32], NULL);
   23|      0|    }
   24|  5.91k|    *recid = sig->data[64];
   25|  5.91k|}
secp256k1.c:secp256k1_ecdsa_sig_recover:
   87|  3.94k|static int secp256k1_ecdsa_sig_recover(const secp256k1_scalar *sigr, const secp256k1_scalar* sigs, secp256k1_ge *pubkey, const secp256k1_scalar *message, int recid) {
   88|  3.94k|    unsigned char brx[32];
   89|  3.94k|    secp256k1_fe fx;
   90|  3.94k|    secp256k1_ge x;
   91|  3.94k|    secp256k1_gej xj;
   92|  3.94k|    secp256k1_scalar rn, u1, u2;
   93|  3.94k|    secp256k1_gej qj;
   94|  3.94k|    int r;
   95|       |
   96|  3.94k|    if (secp256k1_scalar_is_zero(sigr) || secp256k1_scalar_is_zero(sigs)) {
  ------------------
  |  Branch (96:9): [True: 0, False: 3.94k]
  |  Branch (96:43): [True: 0, False: 3.94k]
  ------------------
   97|      0|        return 0;
   98|      0|    }
   99|       |
  100|  3.94k|    secp256k1_scalar_get_b32(brx, sigr);
  101|  3.94k|    r = secp256k1_fe_set_b32_limit(&fx, brx);
  ------------------
  |  |   88|  3.94k|#  define secp256k1_fe_set_b32_limit secp256k1_fe_impl_set_b32_limit
  ------------------
  102|  3.94k|    (void)r;
  103|  3.94k|    VERIFY_CHECK(r); /* brx comes from a scalar, so is less than the order; certainly less than p */
  104|  3.94k|    if (recid & 2) {
  ------------------
  |  Branch (104:9): [True: 0, False: 3.94k]
  ------------------
  105|      0|        if (secp256k1_fe_cmp_var(&fx, &secp256k1_ecdsa_const_p_minus_order) >= 0) {
  ------------------
  |  |   86|      0|#  define secp256k1_fe_cmp_var secp256k1_fe_impl_cmp_var
  ------------------
  |  Branch (105:13): [True: 0, False: 0]
  ------------------
  106|      0|            return 0;
  107|      0|        }
  108|      0|        secp256k1_fe_add(&fx, &secp256k1_ecdsa_const_order_as_fe);
  ------------------
  |  |   92|      0|#  define secp256k1_fe_add secp256k1_fe_impl_add
  ------------------
  109|      0|    }
  110|  3.94k|    if (!secp256k1_ge_set_xo_var(&x, &fx, recid & 1)) {
  ------------------
  |  Branch (110:9): [True: 0, False: 3.94k]
  ------------------
  111|      0|        return 0;
  112|      0|    }
  113|  3.94k|    secp256k1_gej_set_ge(&xj, &x);
  114|  3.94k|    secp256k1_scalar_inverse_var(&rn, sigr);
  115|  3.94k|    secp256k1_scalar_mul(&u1, &rn, message);
  116|  3.94k|    secp256k1_scalar_negate(&u1, &u1);
  117|  3.94k|    secp256k1_scalar_mul(&u2, &rn, sigs);
  118|  3.94k|    secp256k1_ecmult(&qj, &xj, &u2, &u1);
  119|  3.94k|    secp256k1_ge_set_gej_var(pubkey, &qj);
  120|  3.94k|    return !secp256k1_gej_is_infinity(&qj);
  121|  3.94k|}

secp256k1.c:secp256k1_scalar_set_b32:
  144|   160k|static void secp256k1_scalar_set_b32(secp256k1_scalar *r, const unsigned char *b32, int *overflow) {
  145|   160k|    int over;
  146|   160k|    r->d[0] = secp256k1_read_be64(&b32[24]);
  147|   160k|    r->d[1] = secp256k1_read_be64(&b32[16]);
  148|   160k|    r->d[2] = secp256k1_read_be64(&b32[8]);
  149|   160k|    r->d[3] = secp256k1_read_be64(&b32[0]);
  150|   160k|    over = secp256k1_scalar_reduce(r, secp256k1_scalar_check_overflow(r));
  151|   160k|    if (overflow) {
  ------------------
  |  Branch (151:9): [True: 119k, False: 40.5k]
  ------------------
  152|   119k|        *overflow = over;
  153|   119k|    }
  154|       |
  155|   160k|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|   160k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  156|   160k|}
secp256k1.c:secp256k1_scalar_reduce:
   74|   351k|SECP256K1_INLINE static int secp256k1_scalar_reduce(secp256k1_scalar *r, unsigned int overflow) {
   75|   351k|    secp256k1_uint128 t;
   76|   351k|    VERIFY_CHECK(overflow <= 1);
   77|       |
   78|   351k|    secp256k1_u128_from_u64(&t, r->d[0]);
   79|   351k|    secp256k1_u128_accum_u64(&t, overflow * SECP256K1_N_C_0);
  ------------------
  |  |   22|   351k|#define SECP256K1_N_C_0 (~SECP256K1_N_0 + 1)
  |  |  ------------------
  |  |  |  |   16|   351k|#define SECP256K1_N_0 ((uint64_t)0xBFD25E8CD0364141ULL)
  |  |  ------------------
  ------------------
   80|   351k|    r->d[0] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
   81|   351k|    secp256k1_u128_accum_u64(&t, r->d[1]);
   82|   351k|    secp256k1_u128_accum_u64(&t, overflow * SECP256K1_N_C_1);
  ------------------
  |  |   23|   351k|#define SECP256K1_N_C_1 (~SECP256K1_N_1)
  |  |  ------------------
  |  |  |  |   17|   351k|#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL)
  |  |  ------------------
  ------------------
   83|   351k|    r->d[1] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
   84|   351k|    secp256k1_u128_accum_u64(&t, r->d[2]);
   85|   351k|    secp256k1_u128_accum_u64(&t, overflow * SECP256K1_N_C_2);
  ------------------
  |  |   24|   351k|#define SECP256K1_N_C_2 (1)
  ------------------
   86|   351k|    r->d[2] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
   87|   351k|    secp256k1_u128_accum_u64(&t, r->d[3]);
   88|   351k|    r->d[3] = secp256k1_u128_to_u64(&t);
   89|       |
   90|   351k|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|   351k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
   91|   351k|    return overflow;
   92|   351k|}
secp256k1.c:secp256k1_scalar_check_overflow:
   62|   351k|SECP256K1_INLINE static int secp256k1_scalar_check_overflow(const secp256k1_scalar *a) {
   63|   351k|    int yes = 0;
   64|   351k|    int no = 0;
   65|   351k|    no |= (a->d[3] < SECP256K1_N_3); /* No need for a > check. */
  ------------------
  |  |   19|   351k|#define SECP256K1_N_3 ((uint64_t)0xFFFFFFFFFFFFFFFFULL)
  ------------------
   66|   351k|    no |= (a->d[2] < SECP256K1_N_2);
  ------------------
  |  |   18|   351k|#define SECP256K1_N_2 ((uint64_t)0xFFFFFFFFFFFFFFFEULL)
  ------------------
   67|   351k|    yes |= (a->d[2] > SECP256K1_N_2) & ~no;
  ------------------
  |  |   18|   351k|#define SECP256K1_N_2 ((uint64_t)0xFFFFFFFFFFFFFFFEULL)
  ------------------
   68|   351k|    no |= (a->d[1] < SECP256K1_N_1);
  ------------------
  |  |   17|   351k|#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL)
  ------------------
   69|   351k|    yes |= (a->d[1] > SECP256K1_N_1) & ~no;
  ------------------
  |  |   17|   351k|#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL)
  ------------------
   70|   351k|    yes |= (a->d[0] >= SECP256K1_N_0) & ~no;
  ------------------
  |  |   16|   351k|#define SECP256K1_N_0 ((uint64_t)0xBFD25E8CD0364141ULL)
  ------------------
   71|   351k|    return yes;
   72|   351k|}
secp256k1.c:secp256k1_scalar_get_b32:
  158|  66.6k|static void secp256k1_scalar_get_b32(unsigned char *bin, const secp256k1_scalar* a) {
  159|  66.6k|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|  66.6k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  160|       |
  161|  66.6k|    secp256k1_write_be64(&bin[0],  a->d[3]);
  162|  66.6k|    secp256k1_write_be64(&bin[8],  a->d[2]);
  163|  66.6k|    secp256k1_write_be64(&bin[16], a->d[1]);
  164|  66.6k|    secp256k1_write_be64(&bin[24], a->d[0]);
  165|  66.6k|}
secp256k1.c:secp256k1_scalar_is_high:
  241|  32.0k|static int secp256k1_scalar_is_high(const secp256k1_scalar *a) {
  242|  32.0k|    int yes = 0;
  243|  32.0k|    int no = 0;
  244|  32.0k|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|  32.0k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  245|       |
  246|  32.0k|    no |= (a->d[3] < SECP256K1_N_H_3);
  ------------------
  |  |   30|  32.0k|#define SECP256K1_N_H_3 ((uint64_t)0x7FFFFFFFFFFFFFFFULL)
  ------------------
  247|  32.0k|    yes |= (a->d[3] > SECP256K1_N_H_3) & ~no;
  ------------------
  |  |   30|  32.0k|#define SECP256K1_N_H_3 ((uint64_t)0x7FFFFFFFFFFFFFFFULL)
  ------------------
  248|  32.0k|    no |= (a->d[2] < SECP256K1_N_H_2) & ~yes; /* No need for a > check. */
  ------------------
  |  |   29|  32.0k|#define SECP256K1_N_H_2 ((uint64_t)0xFFFFFFFFFFFFFFFFULL)
  ------------------
  249|  32.0k|    no |= (a->d[1] < SECP256K1_N_H_1) & ~yes;
  ------------------
  |  |   28|  32.0k|#define SECP256K1_N_H_1 ((uint64_t)0x5D576E7357A4501DULL)
  ------------------
  250|  32.0k|    yes |= (a->d[1] > SECP256K1_N_H_1) & ~no;
  ------------------
  |  |   28|  32.0k|#define SECP256K1_N_H_1 ((uint64_t)0x5D576E7357A4501DULL)
  ------------------
  251|  32.0k|    yes |= (a->d[0] > SECP256K1_N_H_0) & ~no;
  ------------------
  |  |   27|  32.0k|#define SECP256K1_N_H_0 ((uint64_t)0xDFE92F46681B20A0ULL)
  ------------------
  252|  32.0k|    return yes;
  253|  32.0k|}
secp256k1.c:secp256k1_scalar_negate:
  173|  37.6k|static void secp256k1_scalar_negate(secp256k1_scalar *r, const secp256k1_scalar *a) {
  174|  37.6k|    uint64_t nonzero = 0xFFFFFFFFFFFFFFFFULL * (secp256k1_scalar_is_zero(a) == 0);
  175|  37.6k|    secp256k1_uint128 t;
  176|  37.6k|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|  37.6k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  177|       |
  178|  37.6k|    secp256k1_u128_from_u64(&t, ~a->d[0]);
  179|  37.6k|    secp256k1_u128_accum_u64(&t, SECP256K1_N_0 + 1);
  ------------------
  |  |   16|  37.6k|#define SECP256K1_N_0 ((uint64_t)0xBFD25E8CD0364141ULL)
  ------------------
  180|  37.6k|    r->d[0] = secp256k1_u128_to_u64(&t) & nonzero; secp256k1_u128_rshift(&t, 64);
  181|  37.6k|    secp256k1_u128_accum_u64(&t, ~a->d[1]);
  182|  37.6k|    secp256k1_u128_accum_u64(&t, SECP256K1_N_1);
  ------------------
  |  |   17|  37.6k|#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL)
  ------------------
  183|  37.6k|    r->d[1] = secp256k1_u128_to_u64(&t) & nonzero; secp256k1_u128_rshift(&t, 64);
  184|  37.6k|    secp256k1_u128_accum_u64(&t, ~a->d[2]);
  185|  37.6k|    secp256k1_u128_accum_u64(&t, SECP256K1_N_2);
  ------------------
  |  |   18|  37.6k|#define SECP256K1_N_2 ((uint64_t)0xFFFFFFFFFFFFFFFEULL)
  ------------------
  186|  37.6k|    r->d[2] = secp256k1_u128_to_u64(&t) & nonzero; secp256k1_u128_rshift(&t, 64);
  187|  37.6k|    secp256k1_u128_accum_u64(&t, ~a->d[3]);
  188|  37.6k|    secp256k1_u128_accum_u64(&t, SECP256K1_N_3);
  ------------------
  |  |   19|  37.6k|#define SECP256K1_N_3 ((uint64_t)0xFFFFFFFFFFFFFFFFULL)
  ------------------
  189|  37.6k|    r->d[3] = secp256k1_u128_to_u64(&t) & nonzero;
  190|       |
  191|  37.6k|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  37.6k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  192|  37.6k|}
secp256k1.c:secp256k1_scalar_inverse_var:
  979|  15.7k|static void secp256k1_scalar_inverse_var(secp256k1_scalar *r, const secp256k1_scalar *x) {
  980|  15.7k|    secp256k1_modinv64_signed62 s;
  981|       |#ifdef VERIFY
  982|       |    int zero_in = secp256k1_scalar_is_zero(x);
  983|       |#endif
  984|  15.7k|    SECP256K1_SCALAR_VERIFY(x);
  ------------------
  |  |  103|  15.7k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  985|       |
  986|  15.7k|    secp256k1_scalar_to_signed62(&s, x);
  987|  15.7k|    secp256k1_modinv64_var(&s, &secp256k1_const_modinfo_scalar);
  988|  15.7k|    secp256k1_scalar_from_signed62(r, &s);
  989|       |
  990|  15.7k|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  15.7k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  991|  15.7k|    VERIFY_CHECK(secp256k1_scalar_is_zero(r) == zero_in);
  992|  15.7k|}
secp256k1.c:secp256k1_scalar_to_signed62:
  947|  28.1k|static void secp256k1_scalar_to_signed62(secp256k1_modinv64_signed62 *r, const secp256k1_scalar *a) {
  948|  28.1k|    const uint64_t M62 = UINT64_MAX >> 2;
  949|  28.1k|    const uint64_t a0 = a->d[0], a1 = a->d[1], a2 = a->d[2], a3 = a->d[3];
  950|  28.1k|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|  28.1k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  951|       |
  952|  28.1k|    r->v[0] =  a0                   & M62;
  953|  28.1k|    r->v[1] = (a0 >> 62 | a1 <<  2) & M62;
  954|  28.1k|    r->v[2] = (a1 >> 60 | a2 <<  4) & M62;
  955|  28.1k|    r->v[3] = (a2 >> 58 | a3 <<  6) & M62;
  956|  28.1k|    r->v[4] =  a3 >> 56;
  957|  28.1k|}
secp256k1.c:secp256k1_scalar_from_signed62:
  927|  28.1k|static void secp256k1_scalar_from_signed62(secp256k1_scalar *r, const secp256k1_modinv64_signed62 *a) {
  928|  28.1k|    const uint64_t a0 = a->v[0], a1 = a->v[1], a2 = a->v[2], a3 = a->v[3], a4 = a->v[4];
  929|       |
  930|       |    /* The output from secp256k1_modinv64{_var} should be normalized to range [0,modulus), and
  931|       |     * have limbs in [0,2^62). The modulus is < 2^256, so the top limb must be below 2^(256-62*4).
  932|       |     */
  933|  28.1k|    VERIFY_CHECK(a0 >> 62 == 0);
  934|  28.1k|    VERIFY_CHECK(a1 >> 62 == 0);
  935|  28.1k|    VERIFY_CHECK(a2 >> 62 == 0);
  936|  28.1k|    VERIFY_CHECK(a3 >> 62 == 0);
  937|  28.1k|    VERIFY_CHECK(a4 >> 8 == 0);
  938|       |
  939|  28.1k|    r->d[0] = a0      | a1 << 62;
  940|  28.1k|    r->d[1] = a1 >> 2 | a2 << 60;
  941|  28.1k|    r->d[2] = a2 >> 4 | a3 << 58;
  942|  28.1k|    r->d[3] = a3 >> 6 | a4 << 56;
  943|       |
  944|  28.1k|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  28.1k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  945|  28.1k|}
secp256k1.c:secp256k1_scalar_mul:
  855|   109k|static void secp256k1_scalar_mul(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b) {
  856|   109k|    uint64_t l[8];
  857|   109k|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|   109k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  858|   109k|    SECP256K1_SCALAR_VERIFY(b);
  ------------------
  |  |  103|   109k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  859|       |
  860|   109k|    secp256k1_scalar_mul_512(l, a, b);
  861|   109k|    secp256k1_scalar_reduce_512(r, l);
  862|       |
  863|   109k|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|   109k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  864|   109k|}
secp256k1.c:secp256k1_scalar_mul_512:
  678|   144k|static void secp256k1_scalar_mul_512(uint64_t *l8, const secp256k1_scalar *a, const secp256k1_scalar *b) {
  679|   144k|#ifdef USE_ASM_X86_64
  680|   144k|    const uint64_t *pb = b->d;
  681|   144k|    __asm__ __volatile__(
  682|       |    /* Preload */
  683|   144k|    "movq 0(%%rdi), %%r15\n"
  684|   144k|    "movq 8(%%rdi), %%rbx\n"
  685|   144k|    "movq 16(%%rdi), %%rcx\n"
  686|   144k|    "movq 0(%%rdx), %%r11\n"
  687|   144k|    "movq 8(%%rdx), %%r12\n"
  688|   144k|    "movq 16(%%rdx), %%r13\n"
  689|   144k|    "movq 24(%%rdx), %%r14\n"
  690|       |    /* (rax,rdx) = a0 * b0 */
  691|   144k|    "movq %%r15, %%rax\n"
  692|   144k|    "mulq %%r11\n"
  693|       |    /* Extract l8[0] */
  694|   144k|    "movq %%rax, 0(%%rsi)\n"
  695|       |    /* (r8,r9,r10) = (rdx) */
  696|   144k|    "movq %%rdx, %%r8\n"
  697|   144k|    "xorq %%r9, %%r9\n"
  698|   144k|    "xorq %%r10, %%r10\n"
  699|       |    /* (r8,r9,r10) += a0 * b1 */
  700|   144k|    "movq %%r15, %%rax\n"
  701|   144k|    "mulq %%r12\n"
  702|   144k|    "addq %%rax, %%r8\n"
  703|   144k|    "adcq %%rdx, %%r9\n"
  704|   144k|    "adcq $0, %%r10\n"
  705|       |    /* (r8,r9,r10) += a1 * b0 */
  706|   144k|    "movq %%rbx, %%rax\n"
  707|   144k|    "mulq %%r11\n"
  708|   144k|    "addq %%rax, %%r8\n"
  709|   144k|    "adcq %%rdx, %%r9\n"
  710|   144k|    "adcq $0, %%r10\n"
  711|       |    /* Extract l8[1] */
  712|   144k|    "movq %%r8, 8(%%rsi)\n"
  713|   144k|    "xorq %%r8, %%r8\n"
  714|       |    /* (r9,r10,r8) += a0 * b2 */
  715|   144k|    "movq %%r15, %%rax\n"
  716|   144k|    "mulq %%r13\n"
  717|   144k|    "addq %%rax, %%r9\n"
  718|   144k|    "adcq %%rdx, %%r10\n"
  719|   144k|    "adcq $0, %%r8\n"
  720|       |    /* (r9,r10,r8) += a1 * b1 */
  721|   144k|    "movq %%rbx, %%rax\n"
  722|   144k|    "mulq %%r12\n"
  723|   144k|    "addq %%rax, %%r9\n"
  724|   144k|    "adcq %%rdx, %%r10\n"
  725|   144k|    "adcq $0, %%r8\n"
  726|       |    /* (r9,r10,r8) += a2 * b0 */
  727|   144k|    "movq %%rcx, %%rax\n"
  728|   144k|    "mulq %%r11\n"
  729|   144k|    "addq %%rax, %%r9\n"
  730|   144k|    "adcq %%rdx, %%r10\n"
  731|   144k|    "adcq $0, %%r8\n"
  732|       |    /* Extract l8[2] */
  733|   144k|    "movq %%r9, 16(%%rsi)\n"
  734|   144k|    "xorq %%r9, %%r9\n"
  735|       |    /* (r10,r8,r9) += a0 * b3 */
  736|   144k|    "movq %%r15, %%rax\n"
  737|   144k|    "mulq %%r14\n"
  738|   144k|    "addq %%rax, %%r10\n"
  739|   144k|    "adcq %%rdx, %%r8\n"
  740|   144k|    "adcq $0, %%r9\n"
  741|       |    /* Preload a3 */
  742|   144k|    "movq 24(%%rdi), %%r15\n"
  743|       |    /* (r10,r8,r9) += a1 * b2 */
  744|   144k|    "movq %%rbx, %%rax\n"
  745|   144k|    "mulq %%r13\n"
  746|   144k|    "addq %%rax, %%r10\n"
  747|   144k|    "adcq %%rdx, %%r8\n"
  748|   144k|    "adcq $0, %%r9\n"
  749|       |    /* (r10,r8,r9) += a2 * b1 */
  750|   144k|    "movq %%rcx, %%rax\n"
  751|   144k|    "mulq %%r12\n"
  752|   144k|    "addq %%rax, %%r10\n"
  753|   144k|    "adcq %%rdx, %%r8\n"
  754|   144k|    "adcq $0, %%r9\n"
  755|       |    /* (r10,r8,r9) += a3 * b0 */
  756|   144k|    "movq %%r15, %%rax\n"
  757|   144k|    "mulq %%r11\n"
  758|   144k|    "addq %%rax, %%r10\n"
  759|   144k|    "adcq %%rdx, %%r8\n"
  760|   144k|    "adcq $0, %%r9\n"
  761|       |    /* Extract l8[3] */
  762|   144k|    "movq %%r10, 24(%%rsi)\n"
  763|   144k|    "xorq %%r10, %%r10\n"
  764|       |    /* (r8,r9,r10) += a1 * b3 */
  765|   144k|    "movq %%rbx, %%rax\n"
  766|   144k|    "mulq %%r14\n"
  767|   144k|    "addq %%rax, %%r8\n"
  768|   144k|    "adcq %%rdx, %%r9\n"
  769|   144k|    "adcq $0, %%r10\n"
  770|       |    /* (r8,r9,r10) += a2 * b2 */
  771|   144k|    "movq %%rcx, %%rax\n"
  772|   144k|    "mulq %%r13\n"
  773|   144k|    "addq %%rax, %%r8\n"
  774|   144k|    "adcq %%rdx, %%r9\n"
  775|   144k|    "adcq $0, %%r10\n"
  776|       |    /* (r8,r9,r10) += a3 * b1 */
  777|   144k|    "movq %%r15, %%rax\n"
  778|   144k|    "mulq %%r12\n"
  779|   144k|    "addq %%rax, %%r8\n"
  780|   144k|    "adcq %%rdx, %%r9\n"
  781|   144k|    "adcq $0, %%r10\n"
  782|       |    /* Extract l8[4] */
  783|   144k|    "movq %%r8, 32(%%rsi)\n"
  784|   144k|    "xorq %%r8, %%r8\n"
  785|       |    /* (r9,r10,r8) += a2 * b3 */
  786|   144k|    "movq %%rcx, %%rax\n"
  787|   144k|    "mulq %%r14\n"
  788|   144k|    "addq %%rax, %%r9\n"
  789|   144k|    "adcq %%rdx, %%r10\n"
  790|   144k|    "adcq $0, %%r8\n"
  791|       |    /* (r9,r10,r8) += a3 * b2 */
  792|   144k|    "movq %%r15, %%rax\n"
  793|   144k|    "mulq %%r13\n"
  794|   144k|    "addq %%rax, %%r9\n"
  795|   144k|    "adcq %%rdx, %%r10\n"
  796|   144k|    "adcq $0, %%r8\n"
  797|       |    /* Extract l8[5] */
  798|   144k|    "movq %%r9, 40(%%rsi)\n"
  799|       |    /* (r10,r8) += a3 * b3 */
  800|   144k|    "movq %%r15, %%rax\n"
  801|   144k|    "mulq %%r14\n"
  802|   144k|    "addq %%rax, %%r10\n"
  803|   144k|    "adcq %%rdx, %%r8\n"
  804|       |    /* Extract l8[6] */
  805|   144k|    "movq %%r10, 48(%%rsi)\n"
  806|       |    /* Extract l8[7] */
  807|   144k|    "movq %%r8, 56(%%rsi)\n"
  808|   144k|    : "+d"(pb)
  809|   144k|    : "S"(l8), "D"(a->d)
  810|   144k|    : "rax", "rbx", "rcx", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", "cc", "memory");
  811|       |
  812|   144k|    SECP256K1_CHECKMEM_MSAN_DEFINE(l8, sizeof(*l8) * 8);
  ------------------
  |  |   60|   144k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|   144k|#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|   144k|}
secp256k1.c:secp256k1_scalar_reduce_512:
  347|   109k|static void secp256k1_scalar_reduce_512(secp256k1_scalar *r, const uint64_t *l) {
  348|   109k|#ifdef USE_ASM_X86_64
  349|       |    /* Reduce 512 bits into 385. */
  350|   109k|    uint64_t m0, m1, m2, m3, m4, m5, m6;
  351|   109k|    uint64_t p0, p1, p2, p3, p4;
  352|   109k|    uint64_t c;
  353|       |
  354|   109k|    __asm__ __volatile__(
  355|       |    /* Preload. */
  356|   109k|    "movq 32(%%rsi), %%r11\n"
  357|   109k|    "movq 40(%%rsi), %%r12\n"
  358|   109k|    "movq 48(%%rsi), %%r13\n"
  359|   109k|    "movq 56(%%rsi), %%r14\n"
  360|       |    /* Initialize r8,r9,r10 */
  361|   109k|    "movq 0(%%rsi), %%r8\n"
  362|   109k|    "xorq %%r9, %%r9\n"
  363|   109k|    "xorq %%r10, %%r10\n"
  364|       |    /* (r8,r9) += n0 * c0 */
  365|   109k|    "movq %8, %%rax\n"
  366|   109k|    "mulq %%r11\n"
  367|   109k|    "addq %%rax, %%r8\n"
  368|   109k|    "adcq %%rdx, %%r9\n"
  369|       |    /* extract m0 */
  370|   109k|    "movq %%r8, %q0\n"
  371|   109k|    "xorq %%r8, %%r8\n"
  372|       |    /* (r9,r10) += l1 */
  373|   109k|    "addq 8(%%rsi), %%r9\n"
  374|   109k|    "adcq $0, %%r10\n"
  375|       |    /* (r9,r10,r8) += n1 * c0 */
  376|   109k|    "movq %8, %%rax\n"
  377|   109k|    "mulq %%r12\n"
  378|   109k|    "addq %%rax, %%r9\n"
  379|   109k|    "adcq %%rdx, %%r10\n"
  380|   109k|    "adcq $0, %%r8\n"
  381|       |    /* (r9,r10,r8) += n0 * c1 */
  382|   109k|    "movq %9, %%rax\n"
  383|   109k|    "mulq %%r11\n"
  384|   109k|    "addq %%rax, %%r9\n"
  385|   109k|    "adcq %%rdx, %%r10\n"
  386|   109k|    "adcq $0, %%r8\n"
  387|       |    /* extract m1 */
  388|   109k|    "movq %%r9, %q1\n"
  389|   109k|    "xorq %%r9, %%r9\n"
  390|       |    /* (r10,r8,r9) += l2 */
  391|   109k|    "addq 16(%%rsi), %%r10\n"
  392|   109k|    "adcq $0, %%r8\n"
  393|   109k|    "adcq $0, %%r9\n"
  394|       |    /* (r10,r8,r9) += n2 * c0 */
  395|   109k|    "movq %8, %%rax\n"
  396|   109k|    "mulq %%r13\n"
  397|   109k|    "addq %%rax, %%r10\n"
  398|   109k|    "adcq %%rdx, %%r8\n"
  399|   109k|    "adcq $0, %%r9\n"
  400|       |    /* (r10,r8,r9) += n1 * c1 */
  401|   109k|    "movq %9, %%rax\n"
  402|   109k|    "mulq %%r12\n"
  403|   109k|    "addq %%rax, %%r10\n"
  404|   109k|    "adcq %%rdx, %%r8\n"
  405|   109k|    "adcq $0, %%r9\n"
  406|       |    /* (r10,r8,r9) += n0 */
  407|   109k|    "addq %%r11, %%r10\n"
  408|   109k|    "adcq $0, %%r8\n"
  409|   109k|    "adcq $0, %%r9\n"
  410|       |    /* extract m2 */
  411|   109k|    "movq %%r10, %q2\n"
  412|   109k|    "xorq %%r10, %%r10\n"
  413|       |    /* (r8,r9,r10) += l3 */
  414|   109k|    "addq 24(%%rsi), %%r8\n"
  415|   109k|    "adcq $0, %%r9\n"
  416|   109k|    "adcq $0, %%r10\n"
  417|       |    /* (r8,r9,r10) += n3 * c0 */
  418|   109k|    "movq %8, %%rax\n"
  419|   109k|    "mulq %%r14\n"
  420|   109k|    "addq %%rax, %%r8\n"
  421|   109k|    "adcq %%rdx, %%r9\n"
  422|   109k|    "adcq $0, %%r10\n"
  423|       |    /* (r8,r9,r10) += n2 * c1 */
  424|   109k|    "movq %9, %%rax\n"
  425|   109k|    "mulq %%r13\n"
  426|   109k|    "addq %%rax, %%r8\n"
  427|   109k|    "adcq %%rdx, %%r9\n"
  428|   109k|    "adcq $0, %%r10\n"
  429|       |    /* (r8,r9,r10) += n1 */
  430|   109k|    "addq %%r12, %%r8\n"
  431|   109k|    "adcq $0, %%r9\n"
  432|   109k|    "adcq $0, %%r10\n"
  433|       |    /* extract m3 */
  434|   109k|    "movq %%r8, %q3\n"
  435|   109k|    "xorq %%r8, %%r8\n"
  436|       |    /* (r9,r10,r8) += n3 * c1 */
  437|   109k|    "movq %9, %%rax\n"
  438|   109k|    "mulq %%r14\n"
  439|   109k|    "addq %%rax, %%r9\n"
  440|   109k|    "adcq %%rdx, %%r10\n"
  441|   109k|    "adcq $0, %%r8\n"
  442|       |    /* (r9,r10,r8) += n2 */
  443|   109k|    "addq %%r13, %%r9\n"
  444|   109k|    "adcq $0, %%r10\n"
  445|   109k|    "adcq $0, %%r8\n"
  446|       |    /* extract m4 */
  447|   109k|    "movq %%r9, %q4\n"
  448|       |    /* (r10,r8) += n3 */
  449|   109k|    "addq %%r14, %%r10\n"
  450|   109k|    "adcq $0, %%r8\n"
  451|       |    /* extract m5 */
  452|   109k|    "movq %%r10, %q5\n"
  453|       |    /* extract m6 */
  454|   109k|    "movq %%r8, %q6\n"
  455|   109k|    : "=&g"(m0), "=&g"(m1), "=&g"(m2), "=g"(m3), "=g"(m4), "=g"(m5), "=g"(m6)
  456|   109k|    : "S"(l), "i"(SECP256K1_N_C_0), "i"(SECP256K1_N_C_1)
  ------------------
  |  |   22|   109k|#define SECP256K1_N_C_0 (~SECP256K1_N_0 + 1)
  |  |  ------------------
  |  |  |  |   16|   109k|#define SECP256K1_N_0 ((uint64_t)0xBFD25E8CD0364141ULL)
  |  |  ------------------
  ------------------
                  : "S"(l), "i"(SECP256K1_N_C_0), "i"(SECP256K1_N_C_1)
  ------------------
  |  |   23|   109k|#define SECP256K1_N_C_1 (~SECP256K1_N_1)
  |  |  ------------------
  |  |  |  |   17|   109k|#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL)
  |  |  ------------------
  ------------------
  457|   109k|    : "rax", "rdx", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "cc");
  458|       |
  459|   109k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&m0, sizeof(m0));
  ------------------
  |  |   60|   109k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|   109k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  460|   109k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&m1, sizeof(m1));
  ------------------
  |  |   60|   109k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|   109k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  461|   109k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&m2, sizeof(m2));
  ------------------
  |  |   60|   109k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|   109k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  462|   109k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&m3, sizeof(m3));
  ------------------
  |  |   60|   109k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|   109k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  463|   109k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&m4, sizeof(m4));
  ------------------
  |  |   60|   109k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|   109k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  464|   109k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&m5, sizeof(m5));
  ------------------
  |  |   60|   109k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|   109k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  465|   109k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&m6, sizeof(m6));
  ------------------
  |  |   60|   109k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|   109k|#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|   109k|    __asm__ __volatile__(
  469|       |    /* Preload */
  470|   109k|    "movq %q9, %%r11\n"
  471|   109k|    "movq %q10, %%r12\n"
  472|   109k|    "movq %q11, %%r13\n"
  473|       |    /* Initialize (r8,r9,r10) */
  474|   109k|    "movq %q5, %%r8\n"
  475|   109k|    "xorq %%r9, %%r9\n"
  476|   109k|    "xorq %%r10, %%r10\n"
  477|       |    /* (r8,r9) += m4 * c0 */
  478|   109k|    "movq %12, %%rax\n"
  479|   109k|    "mulq %%r11\n"
  480|   109k|    "addq %%rax, %%r8\n"
  481|   109k|    "adcq %%rdx, %%r9\n"
  482|       |    /* extract p0 */
  483|   109k|    "movq %%r8, %q0\n"
  484|   109k|    "xorq %%r8, %%r8\n"
  485|       |    /* (r9,r10) += m1 */
  486|   109k|    "addq %q6, %%r9\n"
  487|   109k|    "adcq $0, %%r10\n"
  488|       |    /* (r9,r10,r8) += m5 * c0 */
  489|   109k|    "movq %12, %%rax\n"
  490|   109k|    "mulq %%r12\n"
  491|   109k|    "addq %%rax, %%r9\n"
  492|   109k|    "adcq %%rdx, %%r10\n"
  493|   109k|    "adcq $0, %%r8\n"
  494|       |    /* (r9,r10,r8) += m4 * c1 */
  495|   109k|    "movq %13, %%rax\n"
  496|   109k|    "mulq %%r11\n"
  497|   109k|    "addq %%rax, %%r9\n"
  498|   109k|    "adcq %%rdx, %%r10\n"
  499|   109k|    "adcq $0, %%r8\n"
  500|       |    /* extract p1 */
  501|   109k|    "movq %%r9, %q1\n"
  502|   109k|    "xorq %%r9, %%r9\n"
  503|       |    /* (r10,r8,r9) += m2 */
  504|   109k|    "addq %q7, %%r10\n"
  505|   109k|    "adcq $0, %%r8\n"
  506|   109k|    "adcq $0, %%r9\n"
  507|       |    /* (r10,r8,r9) += m6 * c0 */
  508|   109k|    "movq %12, %%rax\n"
  509|   109k|    "mulq %%r13\n"
  510|   109k|    "addq %%rax, %%r10\n"
  511|   109k|    "adcq %%rdx, %%r8\n"
  512|   109k|    "adcq $0, %%r9\n"
  513|       |    /* (r10,r8,r9) += m5 * c1 */
  514|   109k|    "movq %13, %%rax\n"
  515|   109k|    "mulq %%r12\n"
  516|   109k|    "addq %%rax, %%r10\n"
  517|   109k|    "adcq %%rdx, %%r8\n"
  518|   109k|    "adcq $0, %%r9\n"
  519|       |    /* (r10,r8,r9) += m4 */
  520|   109k|    "addq %%r11, %%r10\n"
  521|   109k|    "adcq $0, %%r8\n"
  522|   109k|    "adcq $0, %%r9\n"
  523|       |    /* extract p2 */
  524|   109k|    "movq %%r10, %q2\n"
  525|       |    /* (r8,r9) += m3 */
  526|   109k|    "addq %q8, %%r8\n"
  527|   109k|    "adcq $0, %%r9\n"
  528|       |    /* (r8,r9) += m6 * c1 */
  529|   109k|    "movq %13, %%rax\n"
  530|   109k|    "mulq %%r13\n"
  531|   109k|    "addq %%rax, %%r8\n"
  532|   109k|    "adcq %%rdx, %%r9\n"
  533|       |    /* (r8,r9) += m5 */
  534|   109k|    "addq %%r12, %%r8\n"
  535|   109k|    "adcq $0, %%r9\n"
  536|       |    /* extract p3 */
  537|   109k|    "movq %%r8, %q3\n"
  538|       |    /* (r9) += m6 */
  539|   109k|    "addq %%r13, %%r9\n"
  540|       |    /* extract p4 */
  541|   109k|    "movq %%r9, %q4\n"
  542|   109k|    : "=&g"(p0), "=&g"(p1), "=&g"(p2), "=g"(p3), "=g"(p4)
  543|   109k|    : "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|   109k|#define SECP256K1_N_C_0 (~SECP256K1_N_0 + 1)
  |  |  ------------------
  |  |  |  |   16|   109k|#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|   109k|#define SECP256K1_N_C_1 (~SECP256K1_N_1)
  |  |  ------------------
  |  |  |  |   17|   109k|#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL)
  |  |  ------------------
  ------------------
  544|   109k|    : "rax", "rdx", "r8", "r9", "r10", "r11", "r12", "r13", "cc");
  545|       |
  546|   109k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&p0, sizeof(p0));
  ------------------
  |  |   60|   109k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|   109k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  547|   109k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&p1, sizeof(p1));
  ------------------
  |  |   60|   109k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|   109k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  548|   109k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&p2, sizeof(p2));
  ------------------
  |  |   60|   109k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|   109k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  549|   109k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&p3, sizeof(p3));
  ------------------
  |  |   60|   109k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|   109k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  550|   109k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&p4, sizeof(p4));
  ------------------
  |  |   60|   109k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|   109k|#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|   109k|    __asm__ __volatile__(
  554|       |    /* Preload */
  555|   109k|    "movq %q5, %%r10\n"
  556|       |    /* (rax,rdx) = p4 * c0 */
  557|   109k|    "movq %7, %%rax\n"
  558|   109k|    "mulq %%r10\n"
  559|       |    /* (rax,rdx) += p0 */
  560|   109k|    "addq %q1, %%rax\n"
  561|   109k|    "adcq $0, %%rdx\n"
  562|       |    /* extract r0 */
  563|   109k|    "movq %%rax, 0(%q6)\n"
  564|       |    /* Move to (r8,r9) */
  565|   109k|    "movq %%rdx, %%r8\n"
  566|   109k|    "xorq %%r9, %%r9\n"
  567|       |    /* (r8,r9) += p1 */
  568|   109k|    "addq %q2, %%r8\n"
  569|   109k|    "adcq $0, %%r9\n"
  570|       |    /* (r8,r9) += p4 * c1 */
  571|   109k|    "movq %8, %%rax\n"
  572|   109k|    "mulq %%r10\n"
  573|   109k|    "addq %%rax, %%r8\n"
  574|   109k|    "adcq %%rdx, %%r9\n"
  575|       |    /* Extract r1 */
  576|   109k|    "movq %%r8, 8(%q6)\n"
  577|   109k|    "xorq %%r8, %%r8\n"
  578|       |    /* (r9,r8) += p4 */
  579|   109k|    "addq %%r10, %%r9\n"
  580|   109k|    "adcq $0, %%r8\n"
  581|       |    /* (r9,r8) += p2 */
  582|   109k|    "addq %q3, %%r9\n"
  583|   109k|    "adcq $0, %%r8\n"
  584|       |    /* Extract r2 */
  585|   109k|    "movq %%r9, 16(%q6)\n"
  586|   109k|    "xorq %%r9, %%r9\n"
  587|       |    /* (r8,r9) += p3 */
  588|   109k|    "addq %q4, %%r8\n"
  589|   109k|    "adcq $0, %%r9\n"
  590|       |    /* Extract r3 */
  591|   109k|    "movq %%r8, 24(%q6)\n"
  592|       |    /* Extract c */
  593|   109k|    "movq %%r9, %q0\n"
  594|   109k|    : "=g"(c)
  595|   109k|    : "g"(p0), "g"(p1), "g"(p2), "g"(p3), "g"(p4), "D"(r), "i"(SECP256K1_N_C_0), "i"(SECP256K1_N_C_1)
  ------------------
  |  |   22|   109k|#define SECP256K1_N_C_0 (~SECP256K1_N_0 + 1)
  |  |  ------------------
  |  |  |  |   16|   109k|#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|   109k|#define SECP256K1_N_C_1 (~SECP256K1_N_1)
  |  |  ------------------
  |  |  |  |   17|   109k|#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL)
  |  |  ------------------
  ------------------
  596|   109k|    : "rax", "rdx", "r8", "r9", "r10", "cc", "memory");
  597|       |
  598|   109k|    SECP256K1_CHECKMEM_MSAN_DEFINE(r, sizeof(*r));
  ------------------
  |  |   60|   109k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|   109k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  599|   109k|    SECP256K1_CHECKMEM_MSAN_DEFINE(&c, sizeof(c));
  ------------------
  |  |   60|   109k|#  define SECP256K1_CHECKMEM_MSAN_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|   109k|#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|   109k|    secp256k1_scalar_reduce(r, c + secp256k1_scalar_check_overflow(r));
  676|   109k|}
secp256k1.c:secp256k1_scalar_get_bits_limb32:
   41|  3.69M|SECP256K1_INLINE static uint32_t secp256k1_scalar_get_bits_limb32(const secp256k1_scalar *a, unsigned int offset, unsigned int count) {
   42|  3.69M|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|  3.69M|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
   43|  3.69M|    VERIFY_CHECK(count > 0 && count <= 32);
   44|  3.69M|    VERIFY_CHECK((offset + count - 1) >> 6 == offset >> 6);
   45|       |
   46|  3.69M|    return (a->d[offset >> 6] >> (offset & 0x3F)) & (0xFFFFFFFF >> (32 - count));
   47|  3.69M|}
secp256k1.c:secp256k1_scalar_add:
   94|  81.9k|static int secp256k1_scalar_add(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b) {
   95|  81.9k|    int overflow;
   96|  81.9k|    secp256k1_uint128 t;
   97|  81.9k|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|  81.9k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
   98|  81.9k|    SECP256K1_SCALAR_VERIFY(b);
  ------------------
  |  |  103|  81.9k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
   99|       |
  100|  81.9k|    secp256k1_u128_from_u64(&t, a->d[0]);
  101|  81.9k|    secp256k1_u128_accum_u64(&t, b->d[0]);
  102|  81.9k|    r->d[0] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
  103|  81.9k|    secp256k1_u128_accum_u64(&t, a->d[1]);
  104|  81.9k|    secp256k1_u128_accum_u64(&t, b->d[1]);
  105|  81.9k|    r->d[1] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
  106|  81.9k|    secp256k1_u128_accum_u64(&t, a->d[2]);
  107|  81.9k|    secp256k1_u128_accum_u64(&t, b->d[2]);
  108|  81.9k|    r->d[2] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
  109|  81.9k|    secp256k1_u128_accum_u64(&t, a->d[3]);
  110|  81.9k|    secp256k1_u128_accum_u64(&t, b->d[3]);
  111|  81.9k|    r->d[3] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
  112|  81.9k|    overflow = secp256k1_u128_to_u64(&t) + secp256k1_scalar_check_overflow(r);
  113|  81.9k|    VERIFY_CHECK(overflow == 0 || overflow == 1);
  114|  81.9k|    secp256k1_scalar_reduce(r, overflow);
  115|       |
  116|  81.9k|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  81.9k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  117|  81.9k|    return overflow;
  118|  81.9k|}
secp256k1.c:secp256k1_scalar_inverse:
  964|  12.3k|static void secp256k1_scalar_inverse(secp256k1_scalar *r, const secp256k1_scalar *x) {
  965|  12.3k|    secp256k1_modinv64_signed62 s;
  966|       |#ifdef VERIFY
  967|       |    int zero_in = secp256k1_scalar_is_zero(x);
  968|       |#endif
  969|  12.3k|    SECP256K1_SCALAR_VERIFY(x);
  ------------------
  |  |  103|  12.3k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  970|       |
  971|  12.3k|    secp256k1_scalar_to_signed62(&s, x);
  972|  12.3k|    secp256k1_modinv64(&s, &secp256k1_const_modinfo_scalar);
  973|  12.3k|    secp256k1_scalar_from_signed62(r, &s);
  974|       |
  975|  12.3k|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  12.3k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  976|  12.3k|    VERIFY_CHECK(secp256k1_scalar_is_zero(r) == zero_in);
  977|  12.3k|}
secp256k1.c:secp256k1_scalar_cond_negate:
  255|  12.3k|static int secp256k1_scalar_cond_negate(secp256k1_scalar *r, int flag) {
  256|       |    /* If we are flag = 0, mask = 00...00 and this is a no-op;
  257|       |     * if we are flag = 1, mask = 11...11 and this is identical to secp256k1_scalar_negate */
  258|  12.3k|    volatile int vflag = flag;
  259|  12.3k|    uint64_t mask = -vflag;
  260|  12.3k|    uint64_t nonzero = (secp256k1_scalar_is_zero(r) != 0) - 1;
  261|  12.3k|    secp256k1_uint128 t;
  262|  12.3k|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  12.3k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  263|       |
  264|  12.3k|    secp256k1_u128_from_u64(&t, r->d[0] ^ mask);
  265|  12.3k|    secp256k1_u128_accum_u64(&t, (SECP256K1_N_0 + 1) & mask);
  ------------------
  |  |   16|  12.3k|#define SECP256K1_N_0 ((uint64_t)0xBFD25E8CD0364141ULL)
  ------------------
  266|  12.3k|    r->d[0] = secp256k1_u128_to_u64(&t) & nonzero; secp256k1_u128_rshift(&t, 64);
  267|  12.3k|    secp256k1_u128_accum_u64(&t, r->d[1] ^ mask);
  268|  12.3k|    secp256k1_u128_accum_u64(&t, SECP256K1_N_1 & mask);
  ------------------
  |  |   17|  12.3k|#define SECP256K1_N_1 ((uint64_t)0xBAAEDCE6AF48A03BULL)
  ------------------
  269|  12.3k|    r->d[1] = secp256k1_u128_to_u64(&t) & nonzero; secp256k1_u128_rshift(&t, 64);
  270|  12.3k|    secp256k1_u128_accum_u64(&t, r->d[2] ^ mask);
  271|  12.3k|    secp256k1_u128_accum_u64(&t, SECP256K1_N_2 & mask);
  ------------------
  |  |   18|  12.3k|#define SECP256K1_N_2 ((uint64_t)0xFFFFFFFFFFFFFFFEULL)
  ------------------
  272|  12.3k|    r->d[2] = secp256k1_u128_to_u64(&t) & nonzero; secp256k1_u128_rshift(&t, 64);
  273|  12.3k|    secp256k1_u128_accum_u64(&t, r->d[3] ^ mask);
  274|  12.3k|    secp256k1_u128_accum_u64(&t, SECP256K1_N_3 & mask);
  ------------------
  |  |   19|  12.3k|#define SECP256K1_N_3 ((uint64_t)0xFFFFFFFFFFFFFFFFULL)
  ------------------
  275|  12.3k|    r->d[3] = secp256k1_u128_to_u64(&t) & nonzero;
  276|       |
  277|  12.3k|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  12.3k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  278|  12.3k|    return 2 * (mask == 0) - 1;
  279|  12.3k|}
secp256k1.c:secp256k1_scalar_cmov:
  911|  58.7k|static SECP256K1_INLINE void secp256k1_scalar_cmov(secp256k1_scalar *r, const secp256k1_scalar *a, int flag) {
  912|  58.7k|    uint64_t mask0, mask1;
  913|  58.7k|    volatile int vflag = flag;
  914|  58.7k|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|  58.7k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  915|  58.7k|    SECP256K1_CHECKMEM_CHECK_VERIFY(r->d, sizeof(r->d));
  ------------------
  |  |   99|  58.7k|#define SECP256K1_CHECKMEM_CHECK_VERIFY(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|  58.7k|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  916|       |
  917|  58.7k|    mask0 = vflag + ~((uint64_t)0);
  918|  58.7k|    mask1 = ~mask0;
  919|  58.7k|    r->d[0] = (r->d[0] & mask0) | (a->d[0] & mask1);
  920|  58.7k|    r->d[1] = (r->d[1] & mask0) | (a->d[1] & mask1);
  921|  58.7k|    r->d[2] = (r->d[2] & mask0) | (a->d[2] & mask1);
  922|  58.7k|    r->d[3] = (r->d[3] & mask0) | (a->d[3] & mask1);
  923|       |
  924|  58.7k|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  58.7k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  925|  58.7k|}
secp256k1.c:secp256k1_scalar_mul_shift_var:
  889|  35.4k|SECP256K1_INLINE static void secp256k1_scalar_mul_shift_var(secp256k1_scalar *r, const secp256k1_scalar *a, const secp256k1_scalar *b, unsigned int shift) {
  890|  35.4k|    uint64_t l[8];
  891|  35.4k|    unsigned int shiftlimbs;
  892|  35.4k|    unsigned int shiftlow;
  893|  35.4k|    unsigned int shifthigh;
  894|  35.4k|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|  35.4k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  895|  35.4k|    SECP256K1_SCALAR_VERIFY(b);
  ------------------
  |  |  103|  35.4k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  896|  35.4k|    VERIFY_CHECK(shift >= 256);
  897|       |
  898|  35.4k|    secp256k1_scalar_mul_512(l, a, b);
  899|  35.4k|    shiftlimbs = shift >> 6;
  900|  35.4k|    shiftlow = shift & 0x3F;
  901|  35.4k|    shifthigh = 64 - shiftlow;
  902|  35.4k|    r->d[0] = shift < 512 ? (l[0 + shiftlimbs] >> shiftlow | (shift < 448 && shiftlow ? (l[1 + shiftlimbs] << shifthigh) : 0)) : 0;
  ------------------
  |  Branch (902:15): [True: 35.4k, False: 0]
  |  Branch (902:63): [True: 35.4k, False: 0]
  |  Branch (902:78): [True: 0, False: 35.4k]
  ------------------
  903|  35.4k|    r->d[1] = shift < 448 ? (l[1 + shiftlimbs] >> shiftlow | (shift < 384 && shiftlow ? (l[2 + shiftlimbs] << shifthigh) : 0)) : 0;
  ------------------
  |  Branch (903:15): [True: 35.4k, False: 0]
  |  Branch (903:63): [True: 0, False: 35.4k]
  |  Branch (903:78): [True: 0, False: 0]
  ------------------
  904|  35.4k|    r->d[2] = shift < 384 ? (l[2 + shiftlimbs] >> shiftlow | (shift < 320 && shiftlow ? (l[3 + shiftlimbs] << shifthigh) : 0)) : 0;
  ------------------
  |  Branch (904:15): [True: 0, False: 35.4k]
  |  Branch (904:63): [True: 0, False: 0]
  |  Branch (904:78): [True: 0, False: 0]
  ------------------
  905|  35.4k|    r->d[3] = shift < 320 ? (l[3 + shiftlimbs] >> shiftlow) : 0;
  ------------------
  |  Branch (905:15): [True: 0, False: 35.4k]
  ------------------
  906|  35.4k|    secp256k1_scalar_cadd_bit(r, 0, (l[(shift - 1) >> 6] >> ((shift - 1) & 0x3f)) & 1);
  907|       |
  908|  35.4k|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  35.4k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  909|  35.4k|}
secp256k1.c:secp256k1_scalar_cadd_bit:
  120|  35.4k|static void secp256k1_scalar_cadd_bit(secp256k1_scalar *r, unsigned int bit, int flag) {
  121|  35.4k|    secp256k1_uint128 t;
  122|  35.4k|    volatile int vflag = flag;
  123|  35.4k|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  35.4k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  124|  35.4k|    VERIFY_CHECK(bit < 256);
  125|       |
  126|  35.4k|    bit += ((uint32_t) vflag - 1) & 0x100;  /* forcing (bit >> 6) > 3 makes this a noop */
  127|  35.4k|    secp256k1_u128_from_u64(&t, r->d[0]);
  128|  35.4k|    secp256k1_u128_accum_u64(&t, ((uint64_t)((bit >> 6) == 0)) << (bit & 0x3F));
  129|  35.4k|    r->d[0] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
  130|  35.4k|    secp256k1_u128_accum_u64(&t, r->d[1]);
  131|  35.4k|    secp256k1_u128_accum_u64(&t, ((uint64_t)((bit >> 6) == 1)) << (bit & 0x3F));
  132|  35.4k|    r->d[1] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
  133|  35.4k|    secp256k1_u128_accum_u64(&t, r->d[2]);
  134|  35.4k|    secp256k1_u128_accum_u64(&t, ((uint64_t)((bit >> 6) == 2)) << (bit & 0x3F));
  135|  35.4k|    r->d[2] = secp256k1_u128_to_u64(&t); secp256k1_u128_rshift(&t, 64);
  136|  35.4k|    secp256k1_u128_accum_u64(&t, r->d[3]);
  137|  35.4k|    secp256k1_u128_accum_u64(&t, ((uint64_t)((bit >> 6) == 3)) << (bit & 0x3F));
  138|  35.4k|    r->d[3] = secp256k1_u128_to_u64(&t);
  139|       |
  140|  35.4k|    SECP256K1_SCALAR_VERIFY(r);
  ------------------
  |  |  103|  35.4k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  141|  35.4k|    VERIFY_CHECK(secp256k1_u128_hi_u64(&t) == 0);
  142|  35.4k|}
secp256k1.c:secp256k1_scalar_get_bits_var:
   49|   984k|SECP256K1_INLINE static uint32_t secp256k1_scalar_get_bits_var(const secp256k1_scalar *a, unsigned int offset, unsigned int count) {
   50|   984k|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|   984k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
   51|   984k|    VERIFY_CHECK(count > 0 && count <= 32);
   52|   984k|    VERIFY_CHECK(offset + count <= 256);
   53|       |
   54|   984k|    if ((offset + count - 1) >> 6 == offset >> 6) {
  ------------------
  |  Branch (54:9): [True: 888k, False: 95.9k]
  ------------------
   55|   888k|        return secp256k1_scalar_get_bits_limb32(a, offset, count);
   56|   888k|    } else {
   57|  95.9k|        VERIFY_CHECK((offset >> 6) + 1 < 4);
   58|  95.9k|        return ((a->d[offset >> 6] >> (offset & 0x3F)) | (a->d[(offset >> 6) + 1] << (64 - (offset & 0x3F)))) & (0xFFFFFFFF >> (32 - count));
   59|  95.9k|    }
   60|   984k|}
secp256k1.c:secp256k1_scalar_split_128:
  866|  17.7k|static void secp256k1_scalar_split_128(secp256k1_scalar *r1, secp256k1_scalar *r2, const secp256k1_scalar *k) {
  867|  17.7k|    SECP256K1_SCALAR_VERIFY(k);
  ------------------
  |  |  103|  17.7k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  868|       |
  869|  17.7k|    r1->d[0] = k->d[0];
  870|  17.7k|    r1->d[1] = k->d[1];
  871|  17.7k|    r1->d[2] = 0;
  872|  17.7k|    r1->d[3] = 0;
  873|  17.7k|    r2->d[0] = k->d[2];
  874|  17.7k|    r2->d[1] = k->d[3];
  875|  17.7k|    r2->d[2] = 0;
  876|  17.7k|    r2->d[3] = 0;
  877|       |
  878|  17.7k|    SECP256K1_SCALAR_VERIFY(r1);
  ------------------
  |  |  103|  17.7k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  879|  17.7k|    SECP256K1_SCALAR_VERIFY(r2);
  ------------------
  |  |  103|  17.7k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  880|  17.7k|}
secp256k1.c:secp256k1_scalar_is_zero:
  167|   186k|SECP256K1_INLINE static int secp256k1_scalar_is_zero(const secp256k1_scalar *a) {
  168|   186k|    SECP256K1_SCALAR_VERIFY(a);
  ------------------
  |  |  103|   186k|#define SECP256K1_SCALAR_VERIFY(r) secp256k1_scalar_verify(r)
  ------------------
  169|       |
  170|   186k|    return (a->d[0] | a->d[1] | a->d[2] | a->d[3]) == 0;
  171|   186k|}

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

secp256k1_context_preallocated_destroy:
  176|      2|void secp256k1_context_preallocated_destroy(secp256k1_context* ctx) {
  177|      2|    ARG_CHECK_VOID(ctx == NULL || secp256k1_context_is_proper(ctx));
  ------------------
  |  |   52|      2|#define ARG_CHECK_VOID(cond) do { \
  |  |   53|      2|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|      4|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 2]
  |  |  |  |  |  Branch (136:39): [True: 0, False: 2]
  |  |  |  |  |  Branch (136:39): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   55|      0|        return; \
  |  |   56|      0|    } \
  |  |   57|      2|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  178|       |
  179|       |    /* Defined as noop */
  180|      2|    if (ctx == NULL) {
  ------------------
  |  Branch (180:9): [True: 0, False: 2]
  ------------------
  181|      0|        return;
  182|      0|    }
  183|       |
  184|      2|    secp256k1_ecmult_gen_context_clear(&ctx->ecmult_gen_ctx);
  185|      2|}
secp256k1_context_destroy:
  187|      2|void secp256k1_context_destroy(secp256k1_context* ctx) {
  188|      2|    ARG_CHECK_VOID(ctx == NULL || secp256k1_context_is_proper(ctx));
  ------------------
  |  |   52|      2|#define ARG_CHECK_VOID(cond) do { \
  |  |   53|      2|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|      4|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 2]
  |  |  |  |  |  Branch (136:39): [True: 0, False: 2]
  |  |  |  |  |  Branch (136:39): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   54|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   55|      0|        return; \
  |  |   56|      0|    } \
  |  |   57|      2|} while(0)
  |  |  ------------------
  |  |  |  Branch (57:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  189|       |
  190|       |    /* Defined as noop */
  191|      2|    if (ctx == NULL) {
  ------------------
  |  Branch (191:9): [True: 0, False: 2]
  ------------------
  192|      0|        return;
  193|      0|    }
  194|       |
  195|      2|    secp256k1_context_preallocated_destroy(ctx);
  196|      2|    free(ctx);
  197|      2|}
secp256k1_ec_pubkey_parse:
  250|  19.7k|int secp256k1_ec_pubkey_parse(const secp256k1_context* ctx, secp256k1_pubkey* pubkey, const unsigned char *input, size_t inputlen) {
  251|  19.7k|    secp256k1_ge Q;
  252|       |
  253|  19.7k|    VERIFY_CHECK(ctx != NULL);
  254|  19.7k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  19.7k|#define ARG_CHECK(cond) do { \
  |  |   46|  19.7k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  19.7k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 19.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  19.7k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  255|  19.7k|    memset(pubkey, 0, sizeof(*pubkey));
  256|  19.7k|    ARG_CHECK(input != NULL);
  ------------------
  |  |   45|  19.7k|#define ARG_CHECK(cond) do { \
  |  |   46|  19.7k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  19.7k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 19.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  19.7k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  257|  19.7k|    if (!secp256k1_eckey_pubkey_parse(&Q, input, inputlen)) {
  ------------------
  |  Branch (257:9): [True: 0, False: 19.7k]
  ------------------
  258|      0|        return 0;
  259|      0|    }
  260|  19.7k|    if (!secp256k1_ge_is_in_correct_subgroup(&Q)) {
  ------------------
  |  Branch (260:9): [True: 0, False: 19.7k]
  ------------------
  261|      0|        return 0;
  262|      0|    }
  263|  19.7k|    secp256k1_pubkey_save(pubkey, &Q);
  264|  19.7k|    secp256k1_ge_clear(&Q);
  265|  19.7k|    return 1;
  266|  19.7k|}
secp256k1_ec_pubkey_serialize:
  268|  21.6k|int secp256k1_ec_pubkey_serialize(const secp256k1_context* ctx, unsigned char *output, size_t *outputlen, const secp256k1_pubkey* pubkey, unsigned int flags) {
  269|  21.6k|    secp256k1_ge Q;
  270|  21.6k|    size_t len;
  271|  21.6k|    int ret = 0;
  272|       |
  273|  21.6k|    VERIFY_CHECK(ctx != NULL);
  274|  21.6k|    ARG_CHECK(outputlen != NULL);
  ------------------
  |  |   45|  21.6k|#define ARG_CHECK(cond) do { \
  |  |   46|  21.6k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  21.6k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 21.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  21.6k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  275|  21.6k|    ARG_CHECK(*outputlen >= ((flags & SECP256K1_FLAGS_BIT_COMPRESSION) ? 33u : 65u));
  ------------------
  |  |   45|  21.6k|#define ARG_CHECK(cond) do { \
  |  |   46|  21.6k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  43.3k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 21.6k]
  |  |  |  |  |  Branch (136:39): [True: 19.7k, False: 1.97k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  21.6k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  276|  21.6k|    len = *outputlen;
  277|  21.6k|    *outputlen = 0;
  278|  21.6k|    ARG_CHECK(output != NULL);
  ------------------
  |  |   45|  21.6k|#define ARG_CHECK(cond) do { \
  |  |   46|  21.6k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  21.6k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 21.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  21.6k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  279|  21.6k|    memset(output, 0, len);
  280|  21.6k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  21.6k|#define ARG_CHECK(cond) do { \
  |  |   46|  21.6k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  21.6k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 21.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  21.6k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  281|  21.6k|    ARG_CHECK((flags & SECP256K1_FLAGS_TYPE_MASK) == SECP256K1_FLAGS_TYPE_COMPRESSION);
  ------------------
  |  |   45|  21.6k|#define ARG_CHECK(cond) do { \
  |  |   46|  21.6k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  21.6k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 21.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  21.6k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  282|  21.6k|    if (secp256k1_pubkey_load(ctx, &Q, pubkey)) {
  ------------------
  |  Branch (282:9): [True: 21.6k, False: 0]
  ------------------
  283|  21.6k|        ret = secp256k1_eckey_pubkey_serialize(&Q, output, &len, flags & SECP256K1_FLAGS_BIT_COMPRESSION);
  ------------------
  |  |  198|  21.6k|#define SECP256K1_FLAGS_BIT_COMPRESSION (1 << 8)
  ------------------
  284|  21.6k|        if (ret) {
  ------------------
  |  Branch (284:13): [True: 21.6k, False: 0]
  ------------------
  285|  21.6k|            *outputlen = len;
  286|  21.6k|        }
  287|  21.6k|    }
  288|  21.6k|    return ret;
  289|  21.6k|}
secp256k1_ec_pubkey_cmp:
  291|  1.97k|int secp256k1_ec_pubkey_cmp(const secp256k1_context* ctx, const secp256k1_pubkey* pubkey0, const secp256k1_pubkey* pubkey1) {
  292|  1.97k|    unsigned char out[2][33];
  293|  1.97k|    const secp256k1_pubkey* pk[2];
  294|  1.97k|    int i;
  295|       |
  296|  1.97k|    VERIFY_CHECK(ctx != NULL);
  297|  1.97k|    pk[0] = pubkey0; pk[1] = pubkey1;
  298|  5.91k|    for (i = 0; i < 2; i++) {
  ------------------
  |  Branch (298:17): [True: 3.94k, False: 1.97k]
  ------------------
  299|  3.94k|        size_t out_size = sizeof(out[i]);
  300|       |        /* If the public key is NULL or invalid, ec_pubkey_serialize will call
  301|       |         * the illegal_callback and return 0. In that case we will serialize the
  302|       |         * key as all zeros which is less than any valid public key. This
  303|       |         * results in consistent comparisons even if NULL or invalid pubkeys are
  304|       |         * involved and prevents edge cases such as sorting algorithms that use
  305|       |         * this function and do not terminate as a result. */
  306|  3.94k|        if (!secp256k1_ec_pubkey_serialize(ctx, out[i], &out_size, pk[i], SECP256K1_EC_COMPRESSED)) {
  ------------------
  |  |  212|  3.94k|#define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  193|  3.94k|#define SECP256K1_FLAGS_TYPE_COMPRESSION (1 << 1)
  |  |  ------------------
  |  |               #define SECP256K1_EC_COMPRESSED (SECP256K1_FLAGS_TYPE_COMPRESSION | SECP256K1_FLAGS_BIT_COMPRESSION)
  |  |  ------------------
  |  |  |  |  198|  3.94k|#define SECP256K1_FLAGS_BIT_COMPRESSION (1 << 8)
  |  |  ------------------
  ------------------
  |  Branch (306:13): [True: 0, False: 3.94k]
  ------------------
  307|       |            /* Note that ec_pubkey_serialize should already set the output to
  308|       |             * zero in that case, but it's not guaranteed by the API, we can't
  309|       |             * test it and writing a VERIFY_CHECK is more complex than
  310|       |             * explicitly memsetting (again). */
  311|      0|            memset(out[i], 0, sizeof(out[i]));
  312|      0|        }
  313|  3.94k|    }
  314|  1.97k|    return secp256k1_memcmp_var(out[0], out[1], sizeof(out[0]));
  315|  1.97k|}
secp256k1_ecdsa_signature_parse_compact:
  385|  19.7k|int secp256k1_ecdsa_signature_parse_compact(const secp256k1_context* ctx, secp256k1_ecdsa_signature* sig, const unsigned char *input64) {
  386|  19.7k|    secp256k1_scalar r, s;
  387|  19.7k|    int ret = 1;
  388|  19.7k|    int overflow = 0;
  389|       |
  390|  19.7k|    VERIFY_CHECK(ctx != NULL);
  391|  19.7k|    ARG_CHECK(sig != NULL);
  ------------------
  |  |   45|  19.7k|#define ARG_CHECK(cond) do { \
  |  |   46|  19.7k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  19.7k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 19.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  19.7k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  392|  19.7k|    ARG_CHECK(input64 != NULL);
  ------------------
  |  |   45|  19.7k|#define ARG_CHECK(cond) do { \
  |  |   46|  19.7k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  19.7k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 19.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  19.7k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  393|       |
  394|  19.7k|    secp256k1_scalar_set_b32(&r, &input64[0], &overflow);
  395|  19.7k|    ret &= !overflow;
  396|  19.7k|    secp256k1_scalar_set_b32(&s, &input64[32], &overflow);
  397|  19.7k|    ret &= !overflow;
  398|  19.7k|    if (ret) {
  ------------------
  |  Branch (398:9): [True: 19.7k, False: 0]
  ------------------
  399|  19.7k|        secp256k1_ecdsa_signature_save(sig, &r, &s);
  400|  19.7k|    } else {
  401|      0|        memset(sig, 0, sizeof(*sig));
  402|      0|    }
  403|  19.7k|    return ret;
  404|  19.7k|}
secp256k1_ecdsa_signature_serialize_der:
  406|  5.91k|int secp256k1_ecdsa_signature_serialize_der(const secp256k1_context* ctx, unsigned char *output, size_t *outputlen, const secp256k1_ecdsa_signature* sig) {
  407|  5.91k|    secp256k1_scalar r, s;
  408|       |
  409|  5.91k|    VERIFY_CHECK(ctx != NULL);
  410|  5.91k|    ARG_CHECK(output != NULL);
  ------------------
  |  |   45|  5.91k|#define ARG_CHECK(cond) do { \
  |  |   46|  5.91k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  5.91k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 5.91k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  5.91k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  411|  5.91k|    ARG_CHECK(outputlen != NULL);
  ------------------
  |  |   45|  5.91k|#define ARG_CHECK(cond) do { \
  |  |   46|  5.91k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  5.91k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 5.91k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  5.91k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  412|  5.91k|    ARG_CHECK(sig != NULL);
  ------------------
  |  |   45|  5.91k|#define ARG_CHECK(cond) do { \
  |  |   46|  5.91k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  5.91k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 5.91k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  5.91k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  413|       |
  414|  5.91k|    secp256k1_ecdsa_signature_load(ctx, &r, &s, sig);
  415|  5.91k|    return secp256k1_ecdsa_sig_serialize(output, outputlen, &r, &s);
  416|  5.91k|}
secp256k1_ecdsa_signature_serialize_compact:
  418|  10.4k|int secp256k1_ecdsa_signature_serialize_compact(const secp256k1_context* ctx, unsigned char *output64, const secp256k1_ecdsa_signature* sig) {
  419|  10.4k|    secp256k1_scalar r, s;
  420|       |
  421|  10.4k|    VERIFY_CHECK(ctx != NULL);
  422|  10.4k|    ARG_CHECK(output64 != NULL);
  ------------------
  |  |   45|  10.4k|#define ARG_CHECK(cond) do { \
  |  |   46|  10.4k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  10.4k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 10.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  10.4k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  423|  10.4k|    ARG_CHECK(sig != NULL);
  ------------------
  |  |   45|  10.4k|#define ARG_CHECK(cond) do { \
  |  |   46|  10.4k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  10.4k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 10.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  10.4k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  424|       |
  425|  10.4k|    secp256k1_ecdsa_signature_load(ctx, &r, &s, sig);
  426|  10.4k|    secp256k1_scalar_get_b32(&output64[0], &r);
  427|  10.4k|    secp256k1_scalar_get_b32(&output64[32], &s);
  428|  10.4k|    return 1;
  429|  10.4k|}
secp256k1_ecdsa_signature_normalize:
  431|  7.88k|int secp256k1_ecdsa_signature_normalize(const secp256k1_context* ctx, secp256k1_ecdsa_signature *sigout, const secp256k1_ecdsa_signature *sigin) {
  432|  7.88k|    secp256k1_scalar r, s;
  433|  7.88k|    int ret = 0;
  434|       |
  435|  7.88k|    VERIFY_CHECK(ctx != NULL);
  436|  7.88k|    ARG_CHECK(sigin != NULL);
  ------------------
  |  |   45|  7.88k|#define ARG_CHECK(cond) do { \
  |  |   46|  7.88k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  7.88k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 7.88k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  7.88k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  437|       |
  438|  7.88k|    secp256k1_ecdsa_signature_load(ctx, &r, &s, sigin);
  439|  7.88k|    ret = secp256k1_scalar_is_high(&s);
  440|  7.88k|    if (sigout != NULL) {
  ------------------
  |  Branch (440:9): [True: 5.91k, False: 1.97k]
  ------------------
  441|  5.91k|        if (ret) {
  ------------------
  |  Branch (441:13): [True: 0, False: 5.91k]
  ------------------
  442|      0|            secp256k1_scalar_negate(&s, &s);
  443|      0|        }
  444|  5.91k|        secp256k1_ecdsa_signature_save(sigout, &r, &s);
  445|  5.91k|    }
  446|       |
  447|  7.88k|    return ret;
  448|  7.88k|}
secp256k1_ecdsa_verify:
  450|  11.8k|int secp256k1_ecdsa_verify(const secp256k1_context* ctx, const secp256k1_ecdsa_signature *sig, const unsigned char *msghash32, const secp256k1_pubkey *pubkey) {
  451|  11.8k|    secp256k1_ge q;
  452|  11.8k|    secp256k1_scalar r, s;
  453|  11.8k|    secp256k1_scalar m;
  454|  11.8k|    VERIFY_CHECK(ctx != NULL);
  455|  11.8k|    ARG_CHECK(msghash32 != NULL);
  ------------------
  |  |   45|  11.8k|#define ARG_CHECK(cond) do { \
  |  |   46|  11.8k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  11.8k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 11.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  11.8k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  456|  11.8k|    ARG_CHECK(sig != NULL);
  ------------------
  |  |   45|  11.8k|#define ARG_CHECK(cond) do { \
  |  |   46|  11.8k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  11.8k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 11.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  11.8k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  457|  11.8k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  11.8k|#define ARG_CHECK(cond) do { \
  |  |   46|  11.8k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  11.8k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 11.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  11.8k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  458|       |
  459|  11.8k|    secp256k1_scalar_set_b32(&m, msghash32, NULL);
  460|  11.8k|    secp256k1_ecdsa_signature_load(ctx, &r, &s, sig);
  461|  11.8k|    return (!secp256k1_scalar_is_high(&s) &&
  ------------------
  |  Branch (461:13): [True: 11.8k, False: 0]
  ------------------
  462|  11.8k|            secp256k1_pubkey_load(ctx, &q, pubkey) &&
  ------------------
  |  Branch (462:13): [True: 11.8k, False: 0]
  ------------------
  463|  11.8k|            secp256k1_ecdsa_sig_verify(&r, &s, &q, &m));
  ------------------
  |  Branch (463:13): [True: 11.8k, False: 0]
  ------------------
  464|  11.8k|}
secp256k1_ecdsa_sign:
  566|  10.4k|int secp256k1_ecdsa_sign(const secp256k1_context* ctx, secp256k1_ecdsa_signature *signature, const unsigned char *msghash32, const unsigned char *seckey, secp256k1_nonce_function noncefp, const void* noncedata) {
  567|  10.4k|    secp256k1_scalar r, s;
  568|  10.4k|    int ret;
  569|  10.4k|    VERIFY_CHECK(ctx != NULL);
  570|  10.4k|    ARG_CHECK(secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx));
  ------------------
  |  |   45|  10.4k|#define ARG_CHECK(cond) do { \
  |  |   46|  10.4k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  10.4k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 10.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  10.4k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  571|  10.4k|    ARG_CHECK(msghash32 != NULL);
  ------------------
  |  |   45|  10.4k|#define ARG_CHECK(cond) do { \
  |  |   46|  10.4k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  10.4k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 10.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  10.4k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  572|  10.4k|    ARG_CHECK(signature != NULL);
  ------------------
  |  |   45|  10.4k|#define ARG_CHECK(cond) do { \
  |  |   46|  10.4k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  10.4k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 10.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  10.4k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  573|  10.4k|    ARG_CHECK(seckey != NULL);
  ------------------
  |  |   45|  10.4k|#define ARG_CHECK(cond) do { \
  |  |   46|  10.4k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  10.4k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 10.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  10.4k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  574|       |
  575|  10.4k|    ret = secp256k1_ecdsa_sign_inner(ctx, &r, &s, NULL, msghash32, seckey, noncefp, noncedata);
  576|  10.4k|    secp256k1_ecdsa_signature_save(signature, &r, &s);
  577|  10.4k|    return ret;
  578|  10.4k|}
secp256k1_ec_seckey_verify:
  580|  13.8k|int secp256k1_ec_seckey_verify(const secp256k1_context* ctx, const unsigned char *seckey) {
  581|  13.8k|    secp256k1_scalar sec;
  582|  13.8k|    int ret;
  583|  13.8k|    VERIFY_CHECK(ctx != NULL);
  584|  13.8k|    ARG_CHECK(seckey != NULL);
  ------------------
  |  |   45|  13.8k|#define ARG_CHECK(cond) do { \
  |  |   46|  13.8k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  13.8k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 13.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  13.8k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  585|       |
  586|  13.8k|    ret = secp256k1_scalar_set_b32_seckey(&sec, seckey);
  587|  13.8k|    secp256k1_scalar_clear(&sec);
  588|  13.8k|    return ret;
  589|  13.8k|}
secp256k1_ec_pubkey_create:
  604|  19.7k|int secp256k1_ec_pubkey_create(const secp256k1_context* ctx, secp256k1_pubkey *pubkey, const unsigned char *seckey) {
  605|  19.7k|    secp256k1_ge p;
  606|  19.7k|    secp256k1_scalar seckey_scalar;
  607|  19.7k|    int ret = 0;
  608|  19.7k|    VERIFY_CHECK(ctx != NULL);
  609|  19.7k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  19.7k|#define ARG_CHECK(cond) do { \
  |  |   46|  19.7k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  19.7k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 19.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  19.7k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  610|  19.7k|    memset(pubkey, 0, sizeof(*pubkey));
  611|  19.7k|    ARG_CHECK(secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx));
  ------------------
  |  |   45|  19.7k|#define ARG_CHECK(cond) do { \
  |  |   46|  19.7k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  19.7k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 19.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  19.7k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  612|  19.7k|    ARG_CHECK(seckey != NULL);
  ------------------
  |  |   45|  19.7k|#define ARG_CHECK(cond) do { \
  |  |   46|  19.7k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  19.7k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 19.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  19.7k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  613|       |
  614|  19.7k|    ret = secp256k1_ec_pubkey_create_helper(&ctx->ecmult_gen_ctx, &seckey_scalar, &p, seckey);
  615|  19.7k|    secp256k1_pubkey_save(pubkey, &p);
  616|  19.7k|    secp256k1_memczero(pubkey, sizeof(*pubkey), !ret);
  617|       |
  618|  19.7k|    secp256k1_scalar_clear(&seckey_scalar);
  619|  19.7k|    return ret;
  620|  19.7k|}
secp256k1_ec_seckey_tweak_add:
  668|  1.97k|int secp256k1_ec_seckey_tweak_add(const secp256k1_context* ctx, unsigned char *seckey, const unsigned char *tweak32) {
  669|  1.97k|    secp256k1_scalar sec;
  670|  1.97k|    int ret = 0;
  671|  1.97k|    VERIFY_CHECK(ctx != NULL);
  672|  1.97k|    ARG_CHECK(seckey != NULL);
  ------------------
  |  |   45|  1.97k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.97k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  1.97k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.97k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.97k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  673|  1.97k|    ARG_CHECK(tweak32 != NULL);
  ------------------
  |  |   45|  1.97k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.97k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  1.97k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.97k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.97k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  674|       |
  675|  1.97k|    ret = secp256k1_scalar_set_b32_seckey(&sec, seckey);
  676|  1.97k|    ret &= secp256k1_ec_seckey_tweak_add_helper(&sec, tweak32);
  677|  1.97k|    secp256k1_scalar_cmov(&sec, &secp256k1_scalar_zero, !ret);
  678|  1.97k|    secp256k1_scalar_get_b32(seckey, &sec);
  679|       |
  680|  1.97k|    secp256k1_scalar_clear(&sec);
  681|  1.97k|    return ret;
  682|  1.97k|}
secp256k1_ec_pubkey_tweak_add:
  695|  1.97k|int secp256k1_ec_pubkey_tweak_add(const secp256k1_context* ctx, secp256k1_pubkey *pubkey, const unsigned char *tweak32) {
  696|  1.97k|    secp256k1_ge p;
  697|  1.97k|    int ret = 0;
  698|  1.97k|    VERIFY_CHECK(ctx != NULL);
  699|  1.97k|    ARG_CHECK(pubkey != NULL);
  ------------------
  |  |   45|  1.97k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.97k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  1.97k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.97k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.97k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  700|  1.97k|    ARG_CHECK(tweak32 != NULL);
  ------------------
  |  |   45|  1.97k|#define ARG_CHECK(cond) do { \
  |  |   46|  1.97k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  1.97k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 1.97k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  1.97k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  701|       |
  702|  1.97k|    ret = secp256k1_pubkey_load(ctx, &p, pubkey);
  703|  1.97k|    memset(pubkey, 0, sizeof(*pubkey));
  704|  1.97k|    ret = ret && secp256k1_ec_pubkey_tweak_add_helper(&p, tweak32);
  ------------------
  |  Branch (704:11): [True: 1.97k, False: 0]
  |  Branch (704:18): [True: 1.97k, False: 0]
  ------------------
  705|  1.97k|    if (ret) {
  ------------------
  |  Branch (705:9): [True: 1.97k, False: 0]
  ------------------
  706|  1.97k|        secp256k1_pubkey_save(pubkey, &p);
  707|  1.97k|    }
  708|       |
  709|  1.97k|    return ret;
  710|  1.97k|}
secp256k1.c:secp256k1_context_is_proper:
   82|      4|static int secp256k1_context_is_proper(const secp256k1_context* ctx) {
   83|      4|    return secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx);
   84|      4|}
secp256k1.c:secp256k1_pubkey_save:
  246|  45.3k|static void secp256k1_pubkey_save(secp256k1_pubkey* pubkey, secp256k1_ge* ge) {
  247|  45.3k|    secp256k1_ge_to_bytes(pubkey->data, ge);
  248|  45.3k|}
secp256k1.c:secp256k1_pubkey_load:
  240|  35.4k|static int secp256k1_pubkey_load(const secp256k1_context* ctx, secp256k1_ge* ge, const secp256k1_pubkey* pubkey) {
  241|  35.4k|    secp256k1_ge_from_bytes(ge, pubkey->data);
  242|  35.4k|    ARG_CHECK(!secp256k1_fe_is_zero(&ge->x));
  ------------------
  |  |   45|  35.4k|#define ARG_CHECK(cond) do { \
  |  |   46|  35.4k|    if (EXPECT(!(cond), 0)) { \
  |  |  ------------------
  |  |  |  |  136|  35.4k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:21): [True: 0, False: 35.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   47|      0|        secp256k1_callback_call(&ctx->illegal_callback, #cond); \
  |  |   48|      0|        return 0; \
  |  |   49|      0|    } \
  |  |   50|  35.4k|} while(0)
  |  |  ------------------
  |  |  |  Branch (50:9): [Folded - Ignored]
  |  |  ------------------
  ------------------
  243|  35.4k|    return 1;
  244|  35.4k|}
secp256k1.c:secp256k1_ecdsa_signature_save:
  359|  36.0k|static void secp256k1_ecdsa_signature_save(secp256k1_ecdsa_signature* sig, const secp256k1_scalar* r, const secp256k1_scalar* s) {
  360|  36.0k|    if (sizeof(secp256k1_scalar) == 32) {
  ------------------
  |  Branch (360:9): [Folded - Ignored]
  ------------------
  361|  36.0k|        memcpy(&sig->data[0], r, 32);
  362|  36.0k|        memcpy(&sig->data[32], s, 32);
  363|  36.0k|    } else {
  364|      0|        secp256k1_scalar_get_b32(&sig->data[0], r);
  365|      0|        secp256k1_scalar_get_b32(&sig->data[32], s);
  366|      0|    }
  367|  36.0k|}
secp256k1.c:secp256k1_ecdsa_signature_load:
  345|  36.0k|static void secp256k1_ecdsa_signature_load(const secp256k1_context* ctx, secp256k1_scalar* r, secp256k1_scalar* s, const secp256k1_ecdsa_signature* sig) {
  346|  36.0k|    (void)ctx;
  347|  36.0k|    if (sizeof(secp256k1_scalar) == 32) {
  ------------------
  |  Branch (347:9): [Folded - Ignored]
  ------------------
  348|       |        /* When the secp256k1_scalar type is exactly 32 byte, use its
  349|       |         * representation inside secp256k1_ecdsa_signature, as conversion is very fast.
  350|       |         * Note that secp256k1_ecdsa_signature_save must use the same representation. */
  351|  36.0k|        memcpy(r, &sig->data[0], 32);
  352|  36.0k|        memcpy(s, &sig->data[32], 32);
  353|  36.0k|    } else {
  354|      0|        secp256k1_scalar_set_b32(r, &sig->data[0], NULL);
  355|      0|        secp256k1_scalar_set_b32(s, &sig->data[32], NULL);
  356|      0|    }
  357|  36.0k|}
secp256k1.c:nonce_function_rfc6979:
  471|  12.3k|static int nonce_function_rfc6979(unsigned char *nonce32, const unsigned char *msg32, const unsigned char *key32, const unsigned char *algo16, void *data, unsigned int counter) {
  472|  12.3k|   unsigned char keydata[112];
  473|  12.3k|   unsigned int offset = 0;
  474|  12.3k|   secp256k1_rfc6979_hmac_sha256 rng;
  475|  12.3k|   unsigned int i;
  476|  12.3k|   secp256k1_scalar msg;
  477|  12.3k|   unsigned char msgmod32[32];
  478|  12.3k|   secp256k1_scalar_set_b32(&msg, msg32, NULL);
  479|  12.3k|   secp256k1_scalar_get_b32(msgmod32, &msg);
  480|       |   /* We feed a byte array to the PRNG as input, consisting of:
  481|       |    * - the private key (32 bytes) and reduced message (32 bytes), see RFC 6979 3.2d.
  482|       |    * - optionally 32 extra bytes of data, see RFC 6979 3.6 Additional Data.
  483|       |    * - optionally 16 extra bytes with the algorithm name.
  484|       |    * Because the arguments have distinct fixed lengths it is not possible for
  485|       |    *  different argument mixtures to emulate each other and result in the same
  486|       |    *  nonces.
  487|       |    */
  488|  12.3k|   buffer_append(keydata, &offset, key32, 32);
  489|  12.3k|   buffer_append(keydata, &offset, msgmod32, 32);
  490|  12.3k|   if (data != NULL) {
  ------------------
  |  Branch (490:8): [True: 4.48k, False: 7.88k]
  ------------------
  491|  4.48k|       buffer_append(keydata, &offset, data, 32);
  492|  4.48k|   }
  493|  12.3k|   if (algo16 != NULL) {
  ------------------
  |  Branch (493:8): [True: 0, False: 12.3k]
  ------------------
  494|      0|       buffer_append(keydata, &offset, algo16, 16);
  495|      0|   }
  496|  12.3k|   secp256k1_rfc6979_hmac_sha256_initialize(&rng, keydata, offset);
  497|  24.7k|   for (i = 0; i <= counter; i++) {
  ------------------
  |  Branch (497:16): [True: 12.3k, False: 12.3k]
  ------------------
  498|  12.3k|       secp256k1_rfc6979_hmac_sha256_generate(&rng, nonce32, 32);
  499|  12.3k|   }
  500|  12.3k|   secp256k1_rfc6979_hmac_sha256_finalize(&rng);
  501|       |
  502|  12.3k|   secp256k1_memclear(keydata, sizeof(keydata));
  503|  12.3k|   secp256k1_rfc6979_hmac_sha256_clear(&rng);
  504|  12.3k|   return 1;
  505|  12.3k|}
secp256k1.c:buffer_append:
  466|  29.2k|static SECP256K1_INLINE void buffer_append(unsigned char *buf, unsigned int *offset, const void *data, unsigned int len) {
  467|  29.2k|    memcpy(buf + *offset, data, len);
  468|  29.2k|    *offset += len;
  469|  29.2k|}
secp256k1.c:secp256k1_ecdsa_sign_inner:
  510|  12.3k|static int secp256k1_ecdsa_sign_inner(const secp256k1_context* ctx, secp256k1_scalar* r, secp256k1_scalar* s, int* recid, const unsigned char *msg32, const unsigned char *seckey, secp256k1_nonce_function noncefp, const void* noncedata) {
  511|  12.3k|    secp256k1_scalar sec, non, msg;
  512|  12.3k|    int ret = 0;
  513|  12.3k|    int is_sec_valid;
  514|  12.3k|    unsigned char nonce32[32];
  515|  12.3k|    unsigned int count = 0;
  516|       |    /* Default initialization here is important so we won't pass uninit values to the cmov in the end */
  517|  12.3k|    *r = secp256k1_scalar_zero;
  518|  12.3k|    *s = secp256k1_scalar_zero;
  519|  12.3k|    if (recid) {
  ------------------
  |  Branch (519:9): [True: 1.97k, False: 10.4k]
  ------------------
  520|  1.97k|        *recid = 0;
  521|  1.97k|    }
  522|  12.3k|    if (noncefp == NULL) {
  ------------------
  |  Branch (522:9): [True: 0, False: 12.3k]
  ------------------
  523|      0|        noncefp = secp256k1_nonce_function_default;
  524|      0|    }
  525|       |
  526|       |    /* Fail if the secret key is invalid. */
  527|  12.3k|    is_sec_valid = secp256k1_scalar_set_b32_seckey(&sec, seckey);
  528|  12.3k|    secp256k1_scalar_cmov(&sec, &secp256k1_scalar_one, !is_sec_valid);
  529|  12.3k|    secp256k1_scalar_set_b32(&msg, msg32, NULL);
  530|  12.3k|    while (1) {
  ------------------
  |  Branch (530:12): [Folded - Ignored]
  ------------------
  531|  12.3k|        int is_nonce_valid;
  532|  12.3k|        ret = !!noncefp(nonce32, msg32, seckey, NULL, (void*)noncedata, count);
  533|  12.3k|        if (!ret) {
  ------------------
  |  Branch (533:13): [True: 0, False: 12.3k]
  ------------------
  534|      0|            break;
  535|      0|        }
  536|  12.3k|        is_nonce_valid = secp256k1_scalar_set_b32_seckey(&non, nonce32);
  537|       |        /* The nonce is still secret here, but it being invalid is less likely than 1:2^255. */
  538|  12.3k|        secp256k1_declassify(ctx, &is_nonce_valid, sizeof(is_nonce_valid));
  539|  12.3k|        if (is_nonce_valid) {
  ------------------
  |  Branch (539:13): [True: 12.3k, False: 0]
  ------------------
  540|  12.3k|            ret = secp256k1_ecdsa_sig_sign(&ctx->ecmult_gen_ctx, r, s, &sec, &msg, &non, recid);
  541|       |            /* The final signature is no longer a secret, nor is the fact that we were successful or not. */
  542|  12.3k|            secp256k1_declassify(ctx, &ret, sizeof(ret));
  543|  12.3k|            if (ret) {
  ------------------
  |  Branch (543:17): [True: 12.3k, False: 0]
  ------------------
  544|  12.3k|                break;
  545|  12.3k|            }
  546|  12.3k|        }
  547|      0|        count++;
  548|      0|    }
  549|       |    /* We don't want to declassify is_sec_valid and therefore the range of
  550|       |     * seckey. As a result is_sec_valid is included in ret only after ret was
  551|       |     * used as a branching variable. */
  552|  12.3k|    ret &= is_sec_valid;
  553|  12.3k|    secp256k1_memclear(nonce32, sizeof(nonce32));
  554|  12.3k|    secp256k1_scalar_clear(&msg);
  555|  12.3k|    secp256k1_scalar_clear(&non);
  556|  12.3k|    secp256k1_scalar_clear(&sec);
  557|  12.3k|    secp256k1_scalar_cmov(r, &secp256k1_scalar_zero, !ret);
  558|  12.3k|    secp256k1_scalar_cmov(s, &secp256k1_scalar_zero, !ret);
  559|  12.3k|    if (recid) {
  ------------------
  |  Branch (559:9): [True: 1.97k, False: 10.4k]
  ------------------
  560|  1.97k|        const int zero = 0;
  561|  1.97k|        secp256k1_int_cmov(recid, &zero, !ret);
  562|  1.97k|    }
  563|  12.3k|    return ret;
  564|  12.3k|}
secp256k1.c:secp256k1_ec_pubkey_create_helper:
  591|  19.7k|static int secp256k1_ec_pubkey_create_helper(const secp256k1_ecmult_gen_context *ecmult_gen_ctx, secp256k1_scalar *seckey_scalar, secp256k1_ge *p, const unsigned char *seckey) {
  592|  19.7k|    secp256k1_gej pj;
  593|  19.7k|    int ret;
  594|       |
  595|  19.7k|    ret = secp256k1_scalar_set_b32_seckey(seckey_scalar, seckey);
  596|  19.7k|    secp256k1_scalar_cmov(seckey_scalar, &secp256k1_scalar_one, !ret);
  597|       |
  598|  19.7k|    secp256k1_ecmult_gen(ecmult_gen_ctx, &pj, seckey_scalar);
  599|  19.7k|    secp256k1_ge_set_gej(p, &pj);
  600|  19.7k|    secp256k1_gej_clear(&pj);
  601|  19.7k|    return ret;
  602|  19.7k|}
secp256k1.c:secp256k1_ec_seckey_tweak_add_helper:
  657|  1.97k|static int secp256k1_ec_seckey_tweak_add_helper(secp256k1_scalar *sec, const unsigned char *tweak32) {
  658|  1.97k|    secp256k1_scalar term;
  659|  1.97k|    int overflow = 0;
  660|  1.97k|    int ret = 0;
  661|       |
  662|  1.97k|    secp256k1_scalar_set_b32(&term, tweak32, &overflow);
  663|  1.97k|    ret = (!overflow) & secp256k1_eckey_privkey_tweak_add(sec, &term);
  664|  1.97k|    secp256k1_scalar_clear(&term);
  665|  1.97k|    return ret;
  666|  1.97k|}
secp256k1.c:secp256k1_ec_pubkey_tweak_add_helper:
  688|  1.97k|static int secp256k1_ec_pubkey_tweak_add_helper(secp256k1_ge *p, const unsigned char *tweak32) {
  689|  1.97k|    secp256k1_scalar term;
  690|  1.97k|    int overflow = 0;
  691|  1.97k|    secp256k1_scalar_set_b32(&term, tweak32, &overflow);
  692|  1.97k|    return !overflow && secp256k1_eckey_pubkey_tweak_add(p, &term);
  ------------------
  |  Branch (692:12): [True: 1.97k, False: 0]
  |  Branch (692:25): [True: 1.97k, False: 0]
  ------------------
  693|  1.97k|}
secp256k1.c:secp256k1_declassify:
  236|  24.7k|static SECP256K1_INLINE void secp256k1_declassify(const secp256k1_context* ctx, const void *p, size_t len) {
  237|  24.7k|    if (EXPECT(ctx->declassify, 0)) SECP256K1_CHECKMEM_DEFINE(p, len);
  ------------------
  |  |  136|  24.7k|#define EXPECT(x,c) __builtin_expect((x),(c))
  |  |  ------------------
  |  |  |  Branch (136:21): [True: 0, False: 24.7k]
  |  |  ------------------
  ------------------
                  if (EXPECT(ctx->declassify, 0)) SECP256K1_CHECKMEM_DEFINE(p, len);
  ------------------
  |  |   91|      0|#  define SECP256K1_CHECKMEM_DEFINE(p, len) SECP256K1_CHECKMEM_NOOP((p), (len))
  |  |  ------------------
  |  |  |  |   42|      0|#define SECP256K1_CHECKMEM_NOOP(p, len) do { (void)(p); (void)(len); } while(0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (42:78): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  238|  24.7k|}

secp256k1.c:secp256k1_memcmp_var:
  255|  1.97k|static SECP256K1_INLINE int secp256k1_memcmp_var(const void *s1, const void *s2, size_t n) {
  256|  1.97k|    const unsigned char *p1 = s1, *p2 = s2;
  257|  1.97k|    size_t i;
  258|       |
  259|  67.0k|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (259:17): [True: 65.0k, False: 1.97k]
  ------------------
  260|  65.0k|        int diff = p1[i] - p2[i];
  261|  65.0k|        if (diff != 0) {
  ------------------
  |  Branch (261:13): [True: 0, False: 65.0k]
  ------------------
  262|      0|            return diff;
  263|      0|        }
  264|  65.0k|    }
  265|  1.97k|    return 0;
  266|  1.97k|}
secp256k1.c:secp256k1_read_be64:
  416|   641k|SECP256K1_INLINE static uint64_t secp256k1_read_be64(const unsigned char* p) {
  417|   641k|    return (uint64_t)p[0] << 56 |
  418|   641k|           (uint64_t)p[1] << 48 |
  419|   641k|           (uint64_t)p[2] << 40 |
  420|   641k|           (uint64_t)p[3] << 32 |
  421|   641k|           (uint64_t)p[4] << 24 |
  422|   641k|           (uint64_t)p[5] << 16 |
  423|   641k|           (uint64_t)p[6] << 8  |
  424|   641k|           (uint64_t)p[7];
  425|   641k|}
secp256k1.c:secp256k1_write_be64:
  428|   266k|SECP256K1_INLINE static void secp256k1_write_be64(unsigned char* p, uint64_t x) {
  429|   266k|    p[7] = x;
  430|   266k|    p[6] = x >>  8;
  431|   266k|    p[5] = x >> 16;
  432|   266k|    p[4] = x >> 24;
  433|   266k|    p[3] = x >> 32;
  434|   266k|    p[2] = x >> 40;
  435|   266k|    p[1] = x >> 48;
  436|   266k|    p[0] = x >> 56;
  437|   266k|}
secp256k1.c:secp256k1_ctz64_var:
  382|  2.90M|static SECP256K1_INLINE int secp256k1_ctz64_var(uint64_t x) {
  383|  2.90M|    VERIFY_CHECK(x != 0);
  384|  2.90M|#if (__has_builtin(__builtin_ctzl) || SECP256K1_GNUC_PREREQ(3,4))
  385|       |    /* If the unsigned long type is sufficient to represent the largest uint64_t, consider __builtin_ctzl. */
  386|  2.90M|    if (((unsigned long)UINT64_MAX) == UINT64_MAX) {
  ------------------
  |  Branch (386:9): [Folded - Ignored]
  ------------------
  387|  2.90M|        return __builtin_ctzl(x);
  388|  2.90M|    }
  389|      0|#endif
  390|      0|#if (__has_builtin(__builtin_ctzll) || SECP256K1_GNUC_PREREQ(3,4))
  391|       |    /* Otherwise consider __builtin_ctzll (the unsigned long long type is always at least 64 bits). */
  392|      0|    return __builtin_ctzll(x);
  393|       |#else
  394|       |    /* If no suitable CTZ builtin is available, use a (variable time) software emulation. */
  395|       |    return secp256k1_ctz64_var_debruijn(x);
  396|       |#endif
  397|  2.90M|}
secp256k1.c:secp256k1_rotr32:
  440|  8.27M|SECP256K1_INLINE static uint32_t secp256k1_rotr32(const uint32_t x, const unsigned int by) {
  441|       |#if defined(_MSC_VER)
  442|       |    return _rotr(x, by);  /* needs <stdlib.h> */
  443|       |#else
  444|       |    /* Reduce rotation amount to avoid UB when shifting. */
  445|  8.27M|    const unsigned int mask = CHAR_BIT * sizeof(x) - 1;
  446|       |    /* Turned into a rot instruction by GCC and clang. */
  447|  8.27M|    return (x >> (by & mask)) | (x << ((-by) & mask));
  448|  8.27M|#endif
  449|  8.27M|}
secp256k1.c:secp256k1_int_cmov:
  285|  1.97k|static SECP256K1_INLINE void secp256k1_int_cmov(int *r, const int *a, int flag) {
  286|  1.97k|    unsigned int mask0, mask1, r_masked, a_masked;
  287|       |    /* Access flag with a volatile-qualified lvalue.
  288|       |       This prevents clang from figuring out (after inlining) that flag can
  289|       |       take only be 0 or 1, which leads to variable time code. */
  290|  1.97k|    volatile int vflag = flag;
  291|       |
  292|       |    /* Casting a negative int to unsigned and back to int is implementation defined behavior */
  293|  1.97k|    VERIFY_CHECK(*r >= 0 && *a >= 0);
  294|       |
  295|  1.97k|    mask0 = (unsigned int)vflag + ~0u;
  296|  1.97k|    mask1 = ~mask0;
  297|  1.97k|    r_masked = ((unsigned int)*r & mask0);
  298|  1.97k|    a_masked = ((unsigned int)*a & mask1);
  299|       |
  300|  1.97k|    *r = (int)(r_masked | a_masked);
  301|  1.97k|}
secp256k1.c:secp256k1_memczero:
  208|  19.7k|static SECP256K1_INLINE void secp256k1_memczero(void *s, size_t len, int flag) {
  209|  19.7k|    unsigned char *p = (unsigned char *)s;
  210|       |    /* Access flag with a volatile-qualified lvalue.
  211|       |       This prevents clang from figuring out (after inlining) that flag can
  212|       |       take only be 0 or 1, which leads to variable time code. */
  213|  19.7k|    volatile int vflag = flag;
  214|  19.7k|    unsigned char mask = -(unsigned char) vflag;
  215|  1.28M|    while (len) {
  ------------------
  |  Branch (215:12): [True: 1.26M, False: 19.7k]
  ------------------
  216|  1.26M|        *p &= ~mask;
  217|  1.26M|        p++;
  218|  1.26M|        len--;
  219|  1.26M|    }
  220|  19.7k|}
secp256k1.c:secp256k1_read_be32:
  400|  4.49M|SECP256K1_INLINE static uint32_t secp256k1_read_be32(const unsigned char* p) {
  401|  4.49M|    return (uint32_t)p[0] << 24 |
  402|  4.49M|           (uint32_t)p[1] << 16 |
  403|  4.49M|           (uint32_t)p[2] << 8  |
  404|  4.49M|           (uint32_t)p[3];
  405|  4.49M|}
secp256k1.c:secp256k1_write_be32:
  408|  1.23M|SECP256K1_INLINE static void secp256k1_write_be32(unsigned char* p, uint32_t x) {
  409|  1.23M|    p[3] = x;
  410|  1.23M|    p[2] = x >>  8;
  411|  1.23M|    p[1] = x >> 16;
  412|  1.23M|    p[0] = x >> 24;
  413|  1.23M|}
secp256k1.c:secp256k1_memclear:
  223|   472k|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|   472k|    memset(ptr, 0, len);
  240|   472k|    __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|   472k|}

_Z15ReadCompactSizeI10DataStreamEmRT_b:
  340|  1.97k|{
  341|  1.97k|    uint8_t chSize = ser_readdata8(is);
  342|  1.97k|    uint64_t nSizeRet = 0;
  343|  1.97k|    if (chSize < 253)
  ------------------
  |  Branch (343:9): [True: 1.97k, False: 0]
  ------------------
  344|  1.97k|    {
  345|  1.97k|        nSizeRet = chSize;
  346|  1.97k|    }
  347|      0|    else if (chSize == 253)
  ------------------
  |  Branch (347:14): [True: 0, False: 0]
  ------------------
  348|      0|    {
  349|      0|        nSizeRet = ser_readdata16(is);
  350|      0|        if (nSizeRet < 253)
  ------------------
  |  Branch (350:13): [True: 0, False: 0]
  ------------------
  351|      0|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  352|      0|    }
  353|      0|    else if (chSize == 254)
  ------------------
  |  Branch (353:14): [True: 0, False: 0]
  ------------------
  354|      0|    {
  355|      0|        nSizeRet = ser_readdata32(is);
  356|      0|        if (nSizeRet < 0x10000u)
  ------------------
  |  Branch (356:13): [True: 0, False: 0]
  ------------------
  357|      0|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  358|      0|    }
  359|      0|    else
  360|      0|    {
  361|      0|        nSizeRet = ser_readdata64(is);
  362|      0|        if (nSizeRet < 0x100000000ULL)
  ------------------
  |  Branch (362:13): [True: 0, False: 0]
  ------------------
  363|      0|            throw std::ios_base::failure("non-canonical ReadCompactSize()");
  364|      0|    }
  365|  1.97k|    if (range_check && nSizeRet > MAX_SIZE) {
  ------------------
  |  Branch (365:9): [True: 1.97k, False: 0]
  |  Branch (365:24): [True: 0, False: 1.97k]
  ------------------
  366|      0|        throw std::ios_base::failure("ReadCompactSize(): size too large");
  367|      0|    }
  368|  1.97k|    return nSizeRet;
  369|  1.97k|}
_Z13ser_readdata8I10DataStreamEhRT_:
   84|  1.97k|{
   85|  1.97k|    uint8_t obj;
   86|  1.97k|    s.read(AsWritableBytes(Span{&obj, 1}));
   87|  1.97k|    return obj;
   88|  1.97k|}
_Z11UnserializeI10DataStreamTk9BasicBytehEvRT_4SpanIT0_E:
  283|  1.97k|template <typename Stream, BasicByte B> void Unserialize(Stream& s, Span<B> span) { s.read(AsWritableBytes(span)); }
_Z14ser_writedata8I10DataStreamEvRT_h:
   55|  1.97k|{
   56|  1.97k|    s.write(AsBytes(Span{&obj, 1}));
   57|  1.97k|}
_Z9SerializeI10DataStreamTk9BasicByteKhEvRT_4SpanIT0_E:
  268|  1.97k|template <typename Stream, BasicByte B> void Serialize(Stream& s, Span<B> span) { s.write(AsBytes(span)); }
_Z16WriteCompactSizeI10DataStreamEvRT_m:
  309|  1.97k|{
  310|  1.97k|    if (nSize < 253)
  ------------------
  |  Branch (310:9): [True: 1.97k, False: 0]
  ------------------
  311|  1.97k|    {
  312|  1.97k|        ser_writedata8(os, nSize);
  313|  1.97k|    }
  314|      0|    else if (nSize <= std::numeric_limits<uint16_t>::max())
  ------------------
  |  Branch (314:14): [True: 0, False: 0]
  ------------------
  315|      0|    {
  316|      0|        ser_writedata8(os, 253);
  317|      0|        ser_writedata16(os, nSize);
  318|      0|    }
  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.97k|    return;
  330|  1.97k|}

_Z9UCharCastPh:
  281|  7.88k|inline unsigned char* UCharCast(unsigned char* c) { return c; }
_Z9UCharCastPKc:
  284|  3.94k|inline const unsigned char* UCharCast(const char* c) { return reinterpret_cast<const unsigned char*>(c); }
_Z9UCharCastPKh:
  285|  45.3k|inline const unsigned char* UCharCast(const unsigned char* c) { return c; }
_Z9UCharCastPKSt4byte:
  287|  39.9k|inline const unsigned char* UCharCast(const std::byte* c) { return reinterpret_cast<const unsigned char*>(c); }
_ZNK4SpanIKSt4byteE4sizeEv:
  187|  2.02k|    constexpr std::size_t size() const noexcept { return m_size; }
_ZNK4SpanIKcE4dataEv:
  174|  3.94k|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIKcE4sizeEv:
  187|  3.94k|    constexpr std::size_t size() const noexcept { return m_size; }
_Z13UCharSpanCastIKcE4SpanINSt3__114remove_pointerIDTcl9UCharCastcldtfp_4dataEEEE4typeEES1_IT_E:
  293|  3.94k|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()}; }
_ZNK4SpanIKSt4byteE4dataEv:
  174|  16.2k|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIKhE4sizeEv:
  187|   236k|    constexpr std::size_t size() const noexcept { return m_size; }
_ZNK4SpanIKhE5beginEv:
  175|  15.8k|    constexpr C* begin() const noexcept { return m_data; }
_ZNK4SpanIKhE3endEv:
  176|  15.8k|    constexpr C* end() const noexcept { return m_data + m_size; }
_ZNK4SpanIhE4sizeEv:
  187|  57.1k|    constexpr std::size_t size() const noexcept { return m_size; }
_ZNK4SpanIhE4dataEv:
  174|  67.0k|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIKhE4dataEv:
  174|  96.6k|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIKhE5firstEm:
  206|  25.6k|    {
  207|  25.6k|        ASSERT_IF_DEBUG(size() >= count);
  208|  25.6k|        return Span<C>(m_data, count);
  209|  25.6k|    }
_ZNK4SpanISt4byteE4sizeEv:
  187|  33.5k|    constexpr std::size_t size() const noexcept { return m_size; }
_ZNK4SpanISt4byteE4dataEv:
  174|  5.91k|    constexpr C* data() const noexcept { return m_data; }
_ZNK4SpanIKhE7subspanEm:
  196|   124k|    {
  197|   124k|        ASSERT_IF_DEBUG(size() >= offset);
  198|   124k|        return Span<C>(m_data + offset, m_size - offset);
  199|   124k|    }
_ZNK4SpanIKSt4byteE5beginEv:
  175|  3.94k|    constexpr C* begin() const noexcept { return m_data; }
_ZNK4SpanIKSt4byteE3endEv:
  176|  3.94k|    constexpr C* end() const noexcept { return m_data + m_size; }
_ZNK4SpanISt4byteE7subspanEm:
  196|  1.97k|    {
  197|  1.97k|        ASSERT_IF_DEBUG(size() >= offset);
  198|  1.97k|        return Span<C>(m_data + offset, m_size - offset);
  199|  1.97k|    }
_Z13UCharSpanCastIKhE4SpanINSt3__114remove_pointerIDTcl9UCharCastcldtfp_4dataEEEE4typeEES1_IT_E:
  293|  41.3k|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|  25.6k|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|  3.99k|    constexpr std::size_t size_bytes() const noexcept { return sizeof(C) * m_size; }
_Z7AsBytesIKhE4SpanIKSt4byteES1_IT_E:
  259|  3.99k|{
  260|  3.99k|    return {reinterpret_cast<const std::byte*>(s.data()), s.size_bytes()};
  261|  3.99k|}
_ZN4SpanIKhEC2INSt3__16vectorIhNS3_9allocatorIhEEEEEERKT_NS3_9enable_ifIXaaaantsr7is_SpanIS8_EE5valuesr3std14is_convertibleIPA_NS3_14remove_pointerIDTcldtclsr3stdE7declvalISA_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalISA_EE4sizeEEmEE5valueEDnE4typeE:
  172|  7.88k|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIKSt4byteEC2IS1_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S1_EE5valueEiE4typeELi0EEEPS6_m:
  119|  5.96k|    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|  7.88k|        : m_data(other.data()), m_size(other.size()){}
_ZNK4SpanIhE10size_bytesEv:
  188|  9.85k|    constexpr std::size_t size_bytes() const noexcept { return sizeof(C) * m_size; }
_Z7AsBytesIhE4SpanIKSt4byteES0_IT_E:
  259|  1.97k|{
  260|  1.97k|    return {reinterpret_cast<const std::byte*>(s.data()), s.size_bytes()};
  261|  1.97k|}
_ZN4SpanIKhEC2IS0_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S0_EE5valueEiE4typeELi0EEEPS5_m:
  119|   197k|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_ZN4SpanISt4byteEC2IS0_TnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S0_EE5valueEiE4typeELi0EEEPS5_m:
  119|  9.85k|    constexpr Span(T* begin, std::size_t size) noexcept : m_data(begin), m_size(size) {}
_Z15AsWritableBytesIhE4SpanISt4byteES0_IT_E:
  264|  7.88k|{
  265|  7.88k|    return {reinterpret_cast<std::byte*>(s.data()), s.size_bytes()};
  266|  7.88k|}
_ZN4SpanIhEC2IhTnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_hEE5valueEiE4typeELi0EEEPS4_m:
  119|  21.6k|    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|  3.94k|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIKhEC2I7uint256EERKT_NSt3__19enable_ifIXaaaantsr7is_SpanIS4_EE5valuesr3std14is_convertibleIPA_NS7_14remove_pointerIDTcldtclsr3stdE7declvalIS6_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS6_EE4sizeEEmEE5valueEDnE4typeE:
  172|  2.02k|        : m_data(other.data()), m_size(other.size()){}
_Z13MakeUCharSpanIRKNSt3__16vectorIhNS0_9allocatorIhEEEEEDTcl13UCharSpanCasttl4Spanclsr3stdE7forwardIT_Efp_EEEEOS8_:
  296|  3.94k|template <typename V> constexpr auto MakeUCharSpan(V&& v) -> decltype(UCharSpanCast(Span{std::forward<V>(v)})) { return UCharSpanCast(Span{std::forward<V>(v)}); }
_ZN4SpanIhEC2I7uint256EERT_NSt3__19enable_ifIXaaaantsr7is_SpanIS3_EE5valuesr3std14is_convertibleIPA_NS5_14remove_pointerIDTcldtclsr3stdE7declvalIS4_EE4dataEEE4typeEPA_hEE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS4_EE4sizeEEmEE5valueEDnE4typeE:
  165|  17.7k|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIhEC2I7uint160EERT_NSt3__19enable_ifIXaaaantsr7is_SpanIS3_EE5valuesr3std14is_convertibleIPA_NS5_14remove_pointerIDTcldtclsr3stdE7declvalIS4_EE4dataEEE4typeEPA_hEE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS4_EE4sizeEEmEE5valueEDnE4typeE:
  165|  29.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|  5.91k|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIKhEC2ILi65EEERAT__S0_:
  151|  25.6k|    constexpr Span(C (&a)[N]) noexcept : m_data(a), m_size(N) {}
_ZN4SpanIKhEC2IhTnNSt3__19enable_ifIXsr3std14is_convertibleIPA_T_PA_S0_EE5valueEiE4typeELi0EEERKS_IS5_E:
  141|  5.91k|    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|  1.97k|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIKhEC2I7CScriptEERKT_NSt3__19enable_ifIXaaaantsr7is_SpanIS4_EE5valuesr3std14is_convertibleIPA_NS7_14remove_pointerIDTcldtclsr3stdE7declvalIS6_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS6_EE4sizeEEmEE5valueEDnE4typeE:
  172|  5.91k|        : m_data(other.data()), m_size(other.size()){}
_Z13MakeUCharSpanIRKNSt3__14spanIKhLm18446744073709551615EEEEDTcl13UCharSpanCasttl4Spanclsr3stdE7forwardIT_Efp_EEEEOS7_:
  296|  1.97k|template <typename V> constexpr auto MakeUCharSpan(V&& v) -> decltype(UCharSpanCast(Span{std::forward<V>(v)})) { return UCharSpanCast(Span{std::forward<V>(v)}); }
_ZN4SpanIKhEC2INSt3__14spanIS0_Lm18446744073709551615EEEEERKT_NS3_9enable_ifIXaaaantsr7is_SpanIS6_EE5valuesr3std14is_convertibleIPA_NS3_14remove_pointerIDTcldtclsr3stdE7declvalIS8_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS8_EE4sizeEEmEE5valueEDnE4typeE:
  172|  1.97k|        : m_data(other.data()), m_size(other.size()){}
_ZN4SpanIKhEC2ILi32EEERAT__S0_:
  151|  2.02k|    constexpr Span(C (&a)[N]) noexcept : m_data(a), m_size(N) {}
_ZNK4SpanIhE5firstEm:
  206|  5.91k|    {
  207|  5.91k|        ASSERT_IF_DEBUG(size() >= count);
  208|  5.91k|        return Span<C>(m_data, count);
  209|  5.91k|    }
_ZNK4SpanISt4byteE5beginEv:
  175|  3.94k|    constexpr C* begin() const noexcept { return m_data; }
_ZN4SpanIKhEC2I6PKHashEERKT_NSt3__19enable_ifIXaaaantsr7is_SpanIS4_EE5valuesr3std14is_convertibleIPA_NS7_14remove_pointerIDTcldtclsr3stdE7declvalIS6_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS6_EE4sizeEEmEE5valueEDnE4typeE:
  172|  3.94k|        : m_data(other.data()), m_size(other.size()){}
_Z13MakeUCharSpanIRK7CScriptEDTcl13UCharSpanCasttl4Spanclsr3stdE7forwardIT_Efp_EEEEOS4_:
  296|  5.91k|template <typename V> constexpr auto MakeUCharSpan(V&& v) -> decltype(UCharSpanCast(Span{std::forward<V>(v)})) { return UCharSpanCast(Span{std::forward<V>(v)}); }
_ZNK4SpanIKhEixEm:
  191|   128k|    {
  192|   128k|        ASSERT_IF_DEBUG(size() > pos);
  193|   128k|        return m_data[pos];
  194|   128k|    }
_Z13MakeUCharSpanIRK4SpanIhEEDTcl13UCharSpanCasttlS0_clsr3stdE7forwardIT_Efp_EEEEOS4_:
  296|  5.91k|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|  5.91k|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()}; }
_ZN4SpanIhEC2ILi8EEERAT__h:
  151|  3.94k|    constexpr Span(C (&a)[N]) noexcept : m_data(a), m_size(N) {}
_Z13MakeUCharSpanIRKNSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEEDTcl13UCharSpanCasttl4Spanclsr3stdE7forwardIT_Efp_EEEEOSA_:
  296|  3.94k|template <typename V> constexpr auto MakeUCharSpan(V&& v) -> decltype(UCharSpanCast(Span{std::forward<V>(v)})) { return UCharSpanCast(Span{std::forward<V>(v)}); }
_Z13MakeUCharSpanIRA8_KhEDTcl13UCharSpanCasttl4Spanclsr3stdE7forwardIT_Efp_EEEEOS4_:
  296|  3.94k|template <typename V> constexpr auto MakeUCharSpan(V&& v) -> decltype(UCharSpanCast(Span{std::forward<V>(v)})) { return UCharSpanCast(Span{std::forward<V>(v)}); }
_ZN4SpanIKhEC2ILi8EEERAT__S0_:
  151|  3.94k|    constexpr Span(C (&a)[N]) noexcept : m_data(a), m_size(N) {}
_Z12MakeByteSpanIRK7uint256E4SpanIKSt4byteEOT_:
  270|  2.02k|{
  271|  2.02k|    return AsBytes(Span{std::forward<V>(v)});
  272|  2.02k|}
_ZNK4SpanISt4byteE5emptyEv:
  189|  7.88k|    constexpr bool empty() const noexcept { return size() == 0; }
_ZN4SpanISt4byteEC2INSt3__15arrayIS0_Lm64EEEEERT_NS3_9enable_ifIXaaaantsr7is_SpanIS6_EE5valuesr3std14is_convertibleIPA_NS3_14remove_pointerIDTcldtclsr3stdE7declvalIS7_EE4dataEEE4typeEPA_S0_EE5valuesr3std14is_convertibleIDTcldtclsr3stdE7declvalIS7_EE4sizeEEmEE5valueEDnE4typeE:
  165|  1.97k|        : m_data(other.data()), m_size(other.size()){}

_ZN10DataStream4readE4SpanISt4byteE:
  219|  3.94k|    {
  220|  3.94k|        if (dst.size() == 0) return;
  ------------------
  |  Branch (220:13): [True: 0, False: 3.94k]
  ------------------
  221|       |
  222|       |        // Read from the beginning of the buffer
  223|  3.94k|        auto next_read_pos{CheckedAdd(m_read_pos, dst.size())};
  224|  3.94k|        if (!next_read_pos.has_value() || next_read_pos.value() > vch.size()) {
  ------------------
  |  Branch (224:13): [True: 0, False: 3.94k]
  |  Branch (224:43): [True: 0, False: 3.94k]
  ------------------
  225|      0|            throw std::ios_base::failure("DataStream::read(): end of data");
  226|      0|        }
  227|  3.94k|        memcpy(dst.data(), &vch[m_read_pos], dst.size());
  228|  3.94k|        if (next_read_pos.value() == vch.size()) {
  ------------------
  |  Branch (228:13): [True: 1.97k, False: 1.97k]
  ------------------
  229|  1.97k|            m_read_pos = 0;
  230|  1.97k|            vch.clear();
  231|  1.97k|            return;
  232|  1.97k|        }
  233|  1.97k|        m_read_pos = next_read_pos.value();
  234|  1.97k|    }
_ZN10DataStream5writeE4SpanIKSt4byteE:
  252|  3.94k|    {
  253|       |        // Write to the end of the buffer
  254|  3.94k|        vch.insert(vch.end(), src.begin(), src.end());
  255|  3.94k|    }
_ZN10DataStreamC2Ev:
  164|  1.97k|    explicit DataStream() = default;
_ZN10DataStreamrsI4SpanIhEEERS_OT_:
  266|  1.97k|    {
  267|  1.97k|        ::Unserialize(*this, obj);
  268|  1.97k|        return (*this);
  269|  1.97k|    }
_ZN10DataStreamlsI4SpanIKhEEERS_RKT_:
  259|  1.97k|    {
  260|  1.97k|        ::Serialize(*this, obj);
  261|  1.97k|        return (*this);
  262|  1.97k|    }

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

_ZN25zero_after_free_allocatorISt4byteE10deallocateEPS0_m:
   30|  3.94k|    {
   31|  3.94k|        if (p != nullptr)
  ------------------
  |  Branch (31:13): [True: 3.94k, False: 0]
  ------------------
   32|  3.94k|            memory_cleanse(p, sizeof(T) * n);
   33|  3.94k|        std::allocator<T>{}.deallocate(p, n);
   34|  3.94k|    }
_ZN25zero_after_free_allocatorISt4byteE8allocateEm:
   25|  3.94k|    {
   26|  3.94k|        return std::allocator<T>{}.allocate(n);
   27|  3.94k|    }

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

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

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

_Z17MaybeCheckNotHeldR14AnnotatedMixinINSt3__15mutexEE:
  247|  5.96k|inline Mutex& MaybeCheckNotHeld(Mutex& cs) EXCLUSIVE_LOCKS_REQUIRED(!cs) LOCK_RETURNED(cs) { return cs; }
_ZN10UniqueLockI14AnnotatedMixinINSt3__15mutexEEEC2ERS3_PKcS7_ib:
  177|  5.96k|    UniqueLock(MutexType& mutexIn, const char* pszName, const char* pszFile, int nLine, bool fTry = false) EXCLUSIVE_LOCK_FUNCTION(mutexIn) : Base(mutexIn, std::defer_lock)
  178|  5.96k|    {
  179|  5.96k|        if (fTry)
  ------------------
  |  Branch (179:13): [True: 0, False: 5.96k]
  ------------------
  180|      0|            TryEnter(pszName, pszFile, nLine);
  181|  5.96k|        else
  182|  5.96k|            Enter(pszName, pszFile, nLine);
  183|  5.96k|    }
_Z13EnterCriticalINSt3__15mutexEEvPKcS3_iPT_b:
   75|  5.96k|inline void EnterCritical(const char* pszName, const char* pszFile, int nLine, MutexType* cs, bool fTry = false) {}
_Z13LeaveCriticalv:
   76|  29.6k|inline void LeaveCritical() {}
_ZN10UniqueLockI14AnnotatedMixinINSt3__15mutexEEE5EnterEPKcS6_i:
  157|  5.96k|    {
  158|  5.96k|        EnterCritical(pszName, pszFile, nLine, Base::mutex());
  159|       |#ifdef DEBUG_LOCKCONTENTION
  160|       |        if (Base::try_lock()) return;
  161|       |        LOG_TIME_MICROS_WITH_CATEGORY(strprintf("lock contention %s, %s:%d", pszName, pszFile, nLine), BCLog::LOCK);
  162|       |#endif
  163|  5.96k|        Base::lock();
  164|  5.96k|    }
_ZN10UniqueLockI14AnnotatedMixinINSt3__15mutexEEED2Ev:
  197|  5.96k|    {
  198|  5.96k|        if (Base::owns_lock())
  ------------------
  |  Branch (198:13): [True: 5.96k, False: 0]
  ------------------
  199|  5.96k|            LeaveCritical();
  200|  5.96k|    }
_Z10DeleteLockPv:
   82|  3.94k|inline void DeleteLock(void* cs) {}
_Z17MaybeCheckNotHeldI14AnnotatedMixinINSt3__115recursive_mutexEEERT_S5_:
  253|  23.6k|inline MutexType& MaybeCheckNotHeld(MutexType& m) LOCKS_EXCLUDED(m) LOCK_RETURNED(m) { return m; }
_Z13EnterCriticalINSt3__115recursive_mutexEEvPKcS3_iPT_b:
   75|  23.6k|inline void EnterCritical(const char* pszName, const char* pszFile, int nLine, MutexType* cs, bool fTry = false) {}
_ZN10UniqueLockI14AnnotatedMixinINSt3__115recursive_mutexEEE5EnterEPKcS6_i:
  157|  23.6k|    {
  158|  23.6k|        EnterCritical(pszName, pszFile, nLine, Base::mutex());
  159|       |#ifdef DEBUG_LOCKCONTENTION
  160|       |        if (Base::try_lock()) return;
  161|       |        LOG_TIME_MICROS_WITH_CATEGORY(strprintf("lock contention %s, %s:%d", pszName, pszFile, nLine), BCLog::LOCK);
  162|       |#endif
  163|  23.6k|        Base::lock();
  164|  23.6k|    }
_Z22AssertLockHeldInternalI14AnnotatedMixinINSt3__115recursive_mutexEEEvPKcS5_iPT_:
   79|  3.94k|inline void AssertLockHeldInternal(const char* pszName, const char* pszFile, int nLine, MutexType* cs) EXCLUSIVE_LOCKS_REQUIRED(cs) {}
_ZN10UniqueLockI14AnnotatedMixinINSt3__115recursive_mutexEEEC2ERS3_PKcS7_ib:
  177|  23.6k|    UniqueLock(MutexType& mutexIn, const char* pszName, const char* pszFile, int nLine, bool fTry = false) EXCLUSIVE_LOCK_FUNCTION(mutexIn) : Base(mutexIn, std::defer_lock)
  178|  23.6k|    {
  179|  23.6k|        if (fTry)
  ------------------
  |  Branch (179:13): [True: 0, False: 23.6k]
  ------------------
  180|      0|            TryEnter(pszName, pszFile, nLine);
  181|  23.6k|        else
  182|  23.6k|            Enter(pszName, pszFile, nLine);
  183|  23.6k|    }
_ZN10UniqueLockI14AnnotatedMixinINSt3__115recursive_mutexEEED2Ev:
  197|  23.6k|    {
  198|  23.6k|        if (Base::owns_lock())
  ------------------
  |  Branch (198:13): [True: 23.6k, False: 0]
  ------------------
  199|  23.6k|            LeaveCritical();
  200|  23.6k|    }
_ZN14AnnotatedMixinINSt3__115recursive_mutexEED2Ev:
   94|  3.94k|    ~AnnotatedMixin() {
   95|  3.94k|        DeleteLock((void*)this);
   96|  3.94k|    }

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

_Z15key_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEE:
   41|  2.02k|{
   42|  2.02k|    SeedRandomStateForTest(SeedRand::ZEROS);
   43|  2.02k|    const CKey key = [&] {
   44|  2.02k|        CKey k;
   45|  2.02k|        k.Set(buffer.begin(), buffer.end(), true);
   46|  2.02k|        return k;
   47|  2.02k|    }();
   48|  2.02k|    if (!key.IsValid()) {
  ------------------
  |  Branch (48:9): [True: 56, False: 1.97k]
  ------------------
   49|     56|        return;
   50|     56|    }
   51|       |
   52|  1.97k|    {
   53|  1.97k|        assert(key.begin() + key.size() == key.end());
   54|  1.97k|        assert(key.IsCompressed());
   55|  1.97k|        assert(key.size() == 32);
   56|  1.97k|        assert(DecodeSecret(EncodeSecret(key)) == key);
   57|  1.97k|    }
   58|       |
   59|  1.97k|    {
   60|  1.97k|        CKey invalid_key;
   61|  1.97k|        assert(!(invalid_key == key));
   62|  1.97k|        assert(!invalid_key.IsCompressed());
   63|  1.97k|        assert(!invalid_key.IsValid());
   64|  1.97k|        assert(invalid_key.size() == 0);
   65|  1.97k|    }
   66|       |
   67|  1.97k|    {
   68|  1.97k|        CKey uncompressed_key;
   69|  1.97k|        uncompressed_key.Set(buffer.begin(), buffer.end(), false);
   70|  1.97k|        assert(!(uncompressed_key == key));
   71|  1.97k|        assert(!uncompressed_key.IsCompressed());
   72|  1.97k|        assert(key.size() == 32);
   73|  1.97k|        assert(uncompressed_key.begin() + uncompressed_key.size() == uncompressed_key.end());
   74|  1.97k|        assert(uncompressed_key.IsValid());
   75|  1.97k|    }
   76|       |
   77|  1.97k|    {
   78|  1.97k|        CKey copied_key;
   79|  1.97k|        copied_key.Set(key.begin(), key.end(), key.IsCompressed());
   80|  1.97k|        assert(copied_key == key);
   81|  1.97k|    }
   82|       |
   83|  1.97k|    const uint256 random_uint256 = Hash(buffer);
   84|       |
   85|  1.97k|    {
   86|  1.97k|        CKey child_key;
   87|  1.97k|        ChainCode child_chaincode;
   88|  1.97k|        const bool ok = key.Derive(child_key, child_chaincode, 0, random_uint256);
   89|  1.97k|        assert(ok);
   90|  1.97k|        assert(child_key.IsValid());
   91|  1.97k|        assert(!(child_key == key));
   92|  1.97k|        assert(child_chaincode != random_uint256);
   93|  1.97k|    }
   94|       |
   95|  1.97k|    const CPubKey pubkey = key.GetPubKey();
   96|       |
   97|  1.97k|    {
   98|  1.97k|        assert(pubkey.size() == 33);
   99|  1.97k|        assert(key.VerifyPubKey(pubkey));
  100|  1.97k|        assert(pubkey.GetHash() != random_uint256);
  101|  1.97k|        assert(pubkey.begin() + pubkey.size() == pubkey.end());
  102|  1.97k|        assert(pubkey.data() == pubkey.begin());
  103|  1.97k|        assert(pubkey.IsCompressed());
  104|  1.97k|        assert(pubkey.IsValid());
  105|  1.97k|        assert(pubkey.IsFullyValid());
  106|  1.97k|        assert(HexToPubKey(HexStr(pubkey)) == pubkey);
  107|  1.97k|        assert(GetAllDestinationsForKey(pubkey).size() == 3);
  108|  1.97k|    }
  109|       |
  110|  1.97k|    {
  111|  1.97k|        DataStream data_stream{};
  112|  1.97k|        pubkey.Serialize(data_stream);
  113|       |
  114|  1.97k|        CPubKey pubkey_deserialized;
  115|  1.97k|        pubkey_deserialized.Unserialize(data_stream);
  116|  1.97k|        assert(pubkey_deserialized == pubkey);
  117|  1.97k|    }
  118|       |
  119|  1.97k|    {
  120|  1.97k|        const CScript tx_pubkey_script = GetScriptForRawPubKey(pubkey);
  121|  1.97k|        assert(!tx_pubkey_script.IsPayToScriptHash());
  122|  1.97k|        assert(!tx_pubkey_script.IsPayToWitnessScriptHash());
  123|  1.97k|        assert(!tx_pubkey_script.IsPushOnly());
  124|  1.97k|        assert(!tx_pubkey_script.IsUnspendable());
  125|  1.97k|        assert(tx_pubkey_script.HasValidOps());
  126|  1.97k|        assert(tx_pubkey_script.size() == 35);
  127|       |
  128|  1.97k|        const CScript tx_multisig_script = GetScriptForMultisig(1, {pubkey});
  129|  1.97k|        assert(!tx_multisig_script.IsPayToScriptHash());
  130|  1.97k|        assert(!tx_multisig_script.IsPayToWitnessScriptHash());
  131|  1.97k|        assert(!tx_multisig_script.IsPushOnly());
  132|  1.97k|        assert(!tx_multisig_script.IsUnspendable());
  133|  1.97k|        assert(tx_multisig_script.HasValidOps());
  134|  1.97k|        assert(tx_multisig_script.size() == 37);
  135|       |
  136|  1.97k|        FillableSigningProvider fillable_signing_provider;
  137|  1.97k|        assert(!IsSegWitOutput(fillable_signing_provider, tx_pubkey_script));
  138|  1.97k|        assert(!IsSegWitOutput(fillable_signing_provider, tx_multisig_script));
  139|  1.97k|        assert(fillable_signing_provider.GetKeys().size() == 0);
  140|  1.97k|        assert(!fillable_signing_provider.HaveKey(pubkey.GetID()));
  141|       |
  142|  1.97k|        const bool ok_add_key = fillable_signing_provider.AddKey(key);
  143|  1.97k|        assert(ok_add_key);
  144|  1.97k|        assert(fillable_signing_provider.HaveKey(pubkey.GetID()));
  145|       |
  146|  1.97k|        FillableSigningProvider fillable_signing_provider_pub;
  147|  1.97k|        assert(!fillable_signing_provider_pub.HaveKey(pubkey.GetID()));
  148|       |
  149|  1.97k|        const bool ok_add_key_pubkey = fillable_signing_provider_pub.AddKeyPubKey(key, pubkey);
  150|  1.97k|        assert(ok_add_key_pubkey);
  151|  1.97k|        assert(fillable_signing_provider_pub.HaveKey(pubkey.GetID()));
  152|       |
  153|  1.97k|        TxoutType which_type_tx_pubkey;
  154|  1.97k|        const bool is_standard_tx_pubkey = IsStandard(tx_pubkey_script, std::nullopt, which_type_tx_pubkey);
  155|  1.97k|        assert(is_standard_tx_pubkey);
  156|  1.97k|        assert(which_type_tx_pubkey == TxoutType::PUBKEY);
  157|       |
  158|  1.97k|        TxoutType which_type_tx_multisig;
  159|  1.97k|        const bool is_standard_tx_multisig = IsStandard(tx_multisig_script, std::nullopt, which_type_tx_multisig);
  160|  1.97k|        assert(is_standard_tx_multisig);
  161|  1.97k|        assert(which_type_tx_multisig == TxoutType::MULTISIG);
  162|       |
  163|  1.97k|        std::vector<std::vector<unsigned char>> v_solutions_ret_tx_pubkey;
  164|  1.97k|        const TxoutType outtype_tx_pubkey = Solver(tx_pubkey_script, v_solutions_ret_tx_pubkey);
  165|  1.97k|        assert(outtype_tx_pubkey == TxoutType::PUBKEY);
  166|  1.97k|        assert(v_solutions_ret_tx_pubkey.size() == 1);
  167|  1.97k|        assert(v_solutions_ret_tx_pubkey[0].size() == 33);
  168|       |
  169|  1.97k|        std::vector<std::vector<unsigned char>> v_solutions_ret_tx_multisig;
  170|  1.97k|        const TxoutType outtype_tx_multisig = Solver(tx_multisig_script, v_solutions_ret_tx_multisig);
  171|  1.97k|        assert(outtype_tx_multisig == TxoutType::MULTISIG);
  172|  1.97k|        assert(v_solutions_ret_tx_multisig.size() == 3);
  173|  1.97k|        assert(v_solutions_ret_tx_multisig[0].size() == 1);
  174|  1.97k|        assert(v_solutions_ret_tx_multisig[1].size() == 33);
  175|  1.97k|        assert(v_solutions_ret_tx_multisig[2].size() == 1);
  176|       |
  177|  1.97k|        OutputType output_type{};
  178|  1.97k|        const CTxDestination tx_destination = GetDestinationForKey(pubkey, output_type);
  179|  1.97k|        assert(output_type == OutputType::LEGACY);
  180|  1.97k|        assert(IsValidDestination(tx_destination));
  181|  1.97k|        assert(PKHash{pubkey} == *std::get_if<PKHash>(&tx_destination));
  182|       |
  183|  1.97k|        const CScript script_for_destination = GetScriptForDestination(tx_destination);
  184|  1.97k|        assert(script_for_destination.size() == 25);
  185|       |
  186|  1.97k|        const std::string destination_address = EncodeDestination(tx_destination);
  187|  1.97k|        assert(DecodeDestination(destination_address) == tx_destination);
  188|       |
  189|  1.97k|        const CPubKey pubkey_from_address_string = AddrToPubKey(fillable_signing_provider, destination_address);
  190|  1.97k|        assert(pubkey_from_address_string == pubkey);
  191|       |
  192|  1.97k|        CKeyID key_id = pubkey.GetID();
  193|  1.97k|        assert(!key_id.IsNull());
  194|  1.97k|        assert(key_id == CKeyID{key_id});
  195|  1.97k|        assert(key_id == GetKeyForDestination(fillable_signing_provider, tx_destination));
  196|       |
  197|  1.97k|        CPubKey pubkey_out;
  198|  1.97k|        const bool ok_get_pubkey = fillable_signing_provider.GetPubKey(key_id, pubkey_out);
  199|  1.97k|        assert(ok_get_pubkey);
  200|       |
  201|  1.97k|        CKey key_out;
  202|  1.97k|        const bool ok_get_key = fillable_signing_provider.GetKey(key_id, key_out);
  203|  1.97k|        assert(ok_get_key);
  204|  1.97k|        assert(fillable_signing_provider.GetKeys().size() == 1);
  205|  1.97k|        assert(fillable_signing_provider.HaveKey(key_id));
  206|       |
  207|  1.97k|        KeyOriginInfo key_origin_info;
  208|  1.97k|        const bool ok_get_key_origin = fillable_signing_provider.GetKeyOrigin(key_id, key_origin_info);
  209|  1.97k|        assert(!ok_get_key_origin);
  210|  1.97k|    }
  211|       |
  212|  1.97k|    {
  213|  1.97k|        const std::vector<unsigned char> vch_pubkey{pubkey.begin(), pubkey.end()};
  214|  1.97k|        assert(CPubKey::ValidSize(vch_pubkey));
  215|  1.97k|        assert(!CPubKey::ValidSize({pubkey.begin(), pubkey.begin() + pubkey.size() - 1}));
  216|       |
  217|  1.97k|        const CPubKey pubkey_ctor_1{vch_pubkey};
  218|  1.97k|        assert(pubkey == pubkey_ctor_1);
  219|       |
  220|  1.97k|        const CPubKey pubkey_ctor_2{vch_pubkey.begin(), vch_pubkey.end()};
  221|  1.97k|        assert(pubkey == pubkey_ctor_2);
  222|       |
  223|  1.97k|        CPubKey pubkey_set;
  224|  1.97k|        pubkey_set.Set(vch_pubkey.begin(), vch_pubkey.end());
  225|  1.97k|        assert(pubkey == pubkey_set);
  226|  1.97k|    }
  227|       |
  228|  1.97k|    {
  229|  1.97k|        const CPubKey invalid_pubkey{};
  230|  1.97k|        assert(!invalid_pubkey.IsValid());
  231|  1.97k|        assert(!invalid_pubkey.IsFullyValid());
  232|  1.97k|        assert(!(pubkey == invalid_pubkey));
  233|  1.97k|        assert(pubkey != invalid_pubkey);
  234|  1.97k|        assert(pubkey < invalid_pubkey);
  235|  1.97k|    }
  236|       |
  237|  1.97k|    {
  238|       |        // Cover CPubKey's operator[](unsigned int pos)
  239|  1.97k|        unsigned int sum = 0;
  240|  67.0k|        for (size_t i = 0; i < pubkey.size(); ++i) {
  ------------------
  |  Branch (240:28): [True: 65.0k, False: 1.97k]
  ------------------
  241|  65.0k|            sum += pubkey[i];
  242|  65.0k|        }
  243|  1.97k|        assert(std::accumulate(pubkey.begin(), pubkey.end(), 0U) == sum);
  244|  1.97k|    }
  245|       |
  246|  1.97k|    {
  247|  1.97k|        CPubKey decompressed_pubkey = pubkey;
  248|  1.97k|        assert(decompressed_pubkey.IsCompressed());
  249|       |
  250|  1.97k|        const bool ok = decompressed_pubkey.Decompress();
  251|  1.97k|        assert(ok);
  252|  1.97k|        assert(!decompressed_pubkey.IsCompressed());
  253|  1.97k|        assert(decompressed_pubkey.size() == 65);
  254|  1.97k|    }
  255|       |
  256|  1.97k|    {
  257|  1.97k|        std::vector<unsigned char> vch_sig;
  258|  1.97k|        const bool ok = key.Sign(random_uint256, vch_sig, false);
  259|  1.97k|        assert(ok);
  260|  1.97k|        assert(pubkey.Verify(random_uint256, vch_sig));
  261|  1.97k|        assert(CPubKey::CheckLowS(vch_sig));
  262|       |
  263|  1.97k|        const std::vector<unsigned char> vch_invalid_sig{vch_sig.begin(), vch_sig.begin() + vch_sig.size() - 1};
  264|  1.97k|        assert(!pubkey.Verify(random_uint256, vch_invalid_sig));
  265|  1.97k|        assert(!CPubKey::CheckLowS(vch_invalid_sig));
  266|  1.97k|    }
  267|       |
  268|  1.97k|    {
  269|  1.97k|        std::vector<unsigned char> vch_compact_sig;
  270|  1.97k|        const bool ok_sign_compact = key.SignCompact(random_uint256, vch_compact_sig);
  271|  1.97k|        assert(ok_sign_compact);
  272|       |
  273|  1.97k|        CPubKey recover_pubkey;
  274|  1.97k|        const bool ok_recover_compact = recover_pubkey.RecoverCompact(random_uint256, vch_compact_sig);
  275|  1.97k|        assert(ok_recover_compact);
  276|  1.97k|        assert(recover_pubkey == pubkey);
  277|  1.97k|    }
  278|       |
  279|  1.97k|    {
  280|  1.97k|        CPubKey child_pubkey;
  281|  1.97k|        ChainCode child_chaincode;
  282|  1.97k|        const bool ok = pubkey.Derive(child_pubkey, child_chaincode, 0, random_uint256);
  283|  1.97k|        assert(ok);
  284|  1.97k|        assert(child_pubkey != pubkey);
  285|  1.97k|        assert(child_pubkey.IsCompressed());
  286|  1.97k|        assert(child_pubkey.IsFullyValid());
  287|  1.97k|        assert(child_pubkey.IsValid());
  288|  1.97k|        assert(child_pubkey.size() == 33);
  289|  1.97k|        assert(child_chaincode != random_uint256);
  290|  1.97k|    }
  291|       |
  292|  1.97k|    const CPrivKey priv_key = key.GetPrivKey();
  293|       |
  294|  1.97k|    {
  295|  3.94k|        for (const bool skip_check : {true, false}) {
  ------------------
  |  Branch (295:36): [True: 3.94k, False: 1.97k]
  ------------------
  296|  3.94k|            CKey loaded_key;
  297|  3.94k|            const bool ok = loaded_key.Load(priv_key, pubkey, skip_check);
  298|  3.94k|            assert(ok);
  299|  3.94k|            assert(key == loaded_key);
  300|  3.94k|        }
  301|  1.97k|    }
  302|  1.97k|}
key.cpp:_ZZ15key_fuzz_targetNSt3__14spanIKhLm18446744073709551615EEEENK3$_0clEv:
   43|  2.02k|    const CKey key = [&] {
   44|  2.02k|        CKey k;
   45|  2.02k|        k.Set(buffer.begin(), buffer.end(), true);
   46|  2.02k|        return k;
   47|  2.02k|    }();

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

_Z22SeedRandomStateForTest8SeedRand:
   20|  2.02k|{
   21|  2.02k|    constexpr auto RANDOM_CTX_SEED{"RANDOM_CTX_SEED"};
   22|       |
   23|       |    // Do this once, on the first call, regardless of seedtype, because once
   24|       |    // MakeRandDeterministicDANGEROUS is called, the output of GetRandHash is
   25|       |    // no longer truly random. It should be enough to get the seed once for the
   26|       |    // process.
   27|  2.02k|    static const auto g_ctx_seed = []() -> std::optional<uint256> {
   28|  2.02k|        if constexpr (G_FUZZING) return {};
   29|       |        // If RANDOM_CTX_SEED is set, use that as seed.
   30|  2.02k|        if (const char* num{std::getenv(RANDOM_CTX_SEED)}) {
   31|  2.02k|            if (auto num_parsed{uint256::FromUserHex(num)}) {
   32|  2.02k|                return *num_parsed;
   33|  2.02k|            } else {
   34|  2.02k|                std::cerr << RANDOM_CTX_SEED << " must consist of up to " << uint256::size() * 2 << " hex digits (\"0x\" prefix allowed), it was set to: '" << num << "'.\n";
   35|  2.02k|                std::abort();
   36|  2.02k|            }
   37|  2.02k|        }
   38|       |        // Otherwise use a (truly) random value.
   39|  2.02k|        return GetRandHash();
   40|  2.02k|    }();
   41|       |
   42|  2.02k|    g_seeded_g_prng_zero = seedtype == SeedRand::ZEROS;
   43|  2.02k|    if constexpr (G_FUZZING) {
   44|  2.02k|        Assert(g_seeded_g_prng_zero); // Only SeedRandomStateForTest(SeedRand::ZEROS) is allowed in fuzz tests
  ------------------
  |  |   85|  2.02k|#define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
   45|  2.02k|        Assert(!g_used_g_prng);       // The global PRNG must not have been used before SeedRandomStateForTest(SeedRand::ZEROS)
  ------------------
  |  |   85|  2.02k|#define Assert(val) inline_assertion_check<true>(val, __FILE__, __LINE__, __func__, #val)
  ------------------
   46|  2.02k|    }
   47|  2.02k|    const uint256& seed{seedtype == SeedRand::FIXED_SEED ? g_ctx_seed.value() : uint256::ZERO};
  ------------------
  |  Branch (47:25): [True: 0, False: 2.02k]
  ------------------
   48|  2.02k|    LogInfo("Setting random seed for current tests to %s=%s\n", RANDOM_CTX_SEED, seed.GetHex());
  ------------------
  |  |  261|  2.02k|#define LogInfo(...) LogPrintLevel_(BCLog::LogFlags::ALL, BCLog::Level::Info, __VA_ARGS__)
  |  |  ------------------
  |  |  |  |  255|  2.02k|#define LogPrintLevel_(category, level, ...) LogPrintFormatInternal(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__)
  |  |  ------------------
  ------------------
   49|  2.02k|    MakeRandDeterministicDANGEROUS(seed);
   50|  2.02k|}

_ZN12StdLockGuardC2ER8StdMutex:
   73|  4.05k|    explicit StdLockGuard(StdMutex& cs) EXCLUSIVE_LOCK_FUNCTION(cs) : std::lock_guard<StdMutex>(cs) {}

_ZNK10tinyformat6detail9FormatArg6formatERNSt3__113basic_ostreamIcNS2_11char_traitsIcEEEEPKcS9_i:
  541|  4.05k|        {
  542|  4.05k|            TINYFORMAT_ASSERT(m_value);
  ------------------
  |  |  153|  4.05k|#   define TINYFORMAT_ASSERT(cond) assert(cond)
  ------------------
  543|  4.05k|            TINYFORMAT_ASSERT(m_formatImpl);
  ------------------
  |  |  153|  4.05k|#   define TINYFORMAT_ASSERT(cond) assert(cond)
  ------------------
  544|  4.05k|            m_formatImpl(out, fmtBegin, fmtEnd, ntrunc, m_value);
  545|  4.05k|        }
_ZN10tinyformat10FormatListC2EPNS_6detail9FormatArgEi:
  966|  2.02k|            : m_args(args), m_N(N) { }
_ZN10tinyformat6detail21parseWidthOrPrecisionERiRPKcbPKNS0_9FormatArgES1_i:
  593|  4.05k|{
  594|  4.05k|    if (*c >= '0' && *c <= '9') {
  ------------------
  |  Branch (594:9): [True: 4.05k, False: 0]
  |  Branch (594:22): [True: 0, False: 4.05k]
  ------------------
  595|      0|        n = parseIntAndAdvance(c);
  596|      0|    }
  597|  4.05k|    else if (*c == '*') {
  ------------------
  |  Branch (597:14): [True: 0, False: 4.05k]
  ------------------
  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|  4.05k|    else {
  618|  4.05k|        return false;
  619|  4.05k|    }
  620|      0|    return true;
  621|  4.05k|}
_ZN10tinyformat6detail24printFormatStringLiteralERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKc:
  629|  6.08k|{
  630|  6.08k|    const char* c = fmt;
  631|  93.2k|    for (;; ++c) {
  632|  93.2k|        if (*c == '\0') {
  ------------------
  |  Branch (632:13): [True: 2.02k, False: 91.2k]
  ------------------
  633|  2.02k|            out.write(fmt, c - fmt);
  634|  2.02k|            return c;
  635|  2.02k|        }
  636|  91.2k|        else if (*c == '%') {
  ------------------
  |  Branch (636:18): [True: 4.05k, False: 87.1k]
  ------------------
  637|  4.05k|            out.write(fmt, c - fmt);
  638|  4.05k|            if (*(c+1) != '%')
  ------------------
  |  Branch (638:17): [True: 4.05k, False: 0]
  ------------------
  639|  4.05k|                return c;
  640|       |            // for "%%", tack trailing % onto next literal section.
  641|      0|            fmt = ++c;
  642|      0|        }
  643|  93.2k|    }
  644|  6.08k|}
_ZN10tinyformat6detail21streamStateFromFormatERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEERbS7_RiPKcPKNS0_9FormatArgES8_i:
  685|  4.05k|{
  686|  4.05k|    TINYFORMAT_ASSERT(*fmtStart == '%');
  ------------------
  |  |  153|  4.05k|#   define TINYFORMAT_ASSERT(cond) assert(cond)
  ------------------
  687|       |    // Reset stream state to defaults.
  688|  4.05k|    out.width(0);
  689|  4.05k|    out.precision(6);
  690|  4.05k|    out.fill(' ');
  691|       |    // Reset most flags; ignore irrelevant unitbuf & skipws.
  692|  4.05k|    out.unsetf(std::ios::adjustfield | std::ios::basefield |
  693|  4.05k|               std::ios::floatfield | std::ios::showbase | std::ios::boolalpha |
  694|  4.05k|               std::ios::showpoint | std::ios::showpos | std::ios::uppercase);
  695|  4.05k|    bool precisionSet = false;
  696|  4.05k|    bool widthSet = false;
  697|  4.05k|    int widthExtra = 0;
  698|  4.05k|    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|  4.05k|    if (*c >= '0' && *c <= '9') {
  ------------------
  |  Branch (702:9): [True: 4.05k, False: 0]
  |  Branch (702:22): [True: 0, False: 4.05k]
  ------------------
  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|  4.05k|    else if (positionalMode) {
  ------------------
  |  Branch (731:14): [True: 0, False: 4.05k]
  ------------------
  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|  4.05k|    if (!widthSet) {
  ------------------
  |  Branch (735:9): [True: 4.05k, False: 0]
  ------------------
  736|       |        // Parse flags
  737|  4.05k|        for (;; ++c) {
  738|  4.05k|            switch (*c) {
  739|      0|                case '#':
  ------------------
  |  Branch (739:17): [True: 0, False: 4.05k]
  ------------------
  740|      0|                    out.setf(std::ios::showpoint | std::ios::showbase);
  741|      0|                    continue;
  742|      0|                case '0':
  ------------------
  |  Branch (742:17): [True: 0, False: 4.05k]
  ------------------
  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: 4.05k]
  ------------------
  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: 4.05k]
  ------------------
  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: 4.05k]
  ------------------
  761|      0|                    out.setf(std::ios::showpos);
  762|      0|                    spacePadPositive = false;
  763|      0|                    widthExtra = 1;
  764|      0|                    continue;
  765|  4.05k|                default:
  ------------------
  |  Branch (765:17): [True: 4.05k, False: 0]
  ------------------
  766|  4.05k|                    break;
  767|  4.05k|            }
  768|  4.05k|            break;
  769|  4.05k|        }
  770|       |        // Parse width
  771|  4.05k|        int width = 0;
  772|  4.05k|        widthSet = parseWidthOrPrecision(width, c, positionalMode,
  773|  4.05k|                                         args, argIndex, numArgs);
  774|  4.05k|        if (widthSet) {
  ------------------
  |  Branch (774:13): [True: 0, False: 4.05k]
  ------------------
  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|  4.05k|    }
  784|       |    // 3) Parse precision
  785|  4.05k|    if (*c == '.') {
  ------------------
  |  Branch (785:9): [True: 0, False: 4.05k]
  ------------------
  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|  4.05k|    while (*c == 'l' || *c == 'h' || *c == 'L' ||
  ------------------
  |  Branch (797:12): [True: 0, False: 4.05k]
  |  Branch (797:25): [True: 0, False: 4.05k]
  |  Branch (797:38): [True: 0, False: 4.05k]
  ------------------
  798|  4.05k|           *c == 'j' || *c == 'z' || *c == 't') {
  ------------------
  |  Branch (798:12): [True: 0, False: 4.05k]
  |  Branch (798:25): [True: 0, False: 4.05k]
  |  Branch (798:38): [True: 0, False: 4.05k]
  ------------------
  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|  4.05k|    bool intConversion = false;
  805|  4.05k|    switch (*c) {
  806|      0|        case 'u': case 'd': case 'i':
  ------------------
  |  Branch (806:9): [True: 0, False: 4.05k]
  |  Branch (806:19): [True: 0, False: 4.05k]
  |  Branch (806:29): [True: 0, False: 4.05k]
  ------------------
  807|      0|            out.setf(std::ios::dec, std::ios::basefield);
  808|      0|            intConversion = true;
  809|      0|            break;
  810|      0|        case 'o':
  ------------------
  |  Branch (810:9): [True: 0, False: 4.05k]
  ------------------
  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: 4.05k]
  ------------------
  815|      0|            out.setf(std::ios::uppercase);
  816|      0|            [[fallthrough]];
  817|      0|        case 'x': case 'p':
  ------------------
  |  Branch (817:9): [True: 0, False: 4.05k]
  |  Branch (817:19): [True: 0, False: 4.05k]
  ------------------
  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: 4.05k]
  ------------------
  822|      0|            out.setf(std::ios::uppercase);
  823|      0|            [[fallthrough]];
  824|      0|        case 'e':
  ------------------
  |  Branch (824:9): [True: 0, False: 4.05k]
  ------------------
  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: 4.05k]
  ------------------
  829|      0|            out.setf(std::ios::uppercase);
  830|      0|            [[fallthrough]];
  831|      0|        case 'f':
  ------------------
  |  Branch (831:9): [True: 0, False: 4.05k]
  ------------------
  832|      0|            out.setf(std::ios::fixed, std::ios::floatfield);
  833|      0|            break;
  834|      0|        case 'A':
  ------------------
  |  Branch (834:9): [True: 0, False: 4.05k]
  ------------------
  835|      0|            out.setf(std::ios::uppercase);
  836|      0|            [[fallthrough]];
  837|      0|        case 'a':
  ------------------
  |  Branch (837:9): [True: 0, False: 4.05k]
  ------------------
  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: 4.05k]
  ------------------
  847|      0|            out.setf(std::ios::uppercase);
  848|      0|            [[fallthrough]];
  849|      0|        case 'g':
  ------------------
  |  Branch (849:9): [True: 0, False: 4.05k]
  ------------------
  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|      0|        case 'c':
  ------------------
  |  Branch (854:9): [True: 0, False: 4.05k]
  ------------------
  855|       |            // Handled as special case inside formatValue()
  856|      0|            break;
  857|  4.05k|        case 's':
  ------------------
  |  Branch (857:9): [True: 4.05k, False: 0]
  ------------------
  858|  4.05k|            if (precisionSet)
  ------------------
  |  Branch (858:17): [True: 0, False: 4.05k]
  ------------------
  859|      0|                ntrunc = static_cast<int>(out.precision());
  860|       |            // Make %s print Booleans as "true" and "false"
  861|  4.05k|            out.setf(std::ios::boolalpha);
  862|  4.05k|            break;
  863|      0|        case 'n':
  ------------------
  |  Branch (863:9): [True: 0, False: 4.05k]
  ------------------
  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: 4.05k]
  ------------------
  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: 4.05k]
  ------------------
  872|      0|            break;
  873|  4.05k|    }
  874|  4.05k|    if (intConversion && precisionSet && !widthSet) {
  ------------------
  |  Branch (874:9): [True: 0, False: 4.05k]
  |  Branch (874:26): [True: 0, False: 0]
  |  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|  4.05k|    return c+1;
  884|  4.05k|}
_ZN10tinyformat6detail10formatImplERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPKcPKNS0_9FormatArgEi:
  891|  2.02k|{
  892|       |    // Saved stream state
  893|  2.02k|    std::streamsize origWidth = out.width();
  894|  2.02k|    std::streamsize origPrecision = out.precision();
  895|  2.02k|    std::ios::fmtflags origFlags = out.flags();
  896|  2.02k|    char origFill = out.fill();
  897|       |
  898|       |    // "Positional mode" means all format specs should be of the form "%n$..."
  899|       |    // with `n` an integer. We detect this in `streamStateFromFormat`.
  900|  2.02k|    bool positionalMode = false;
  901|  2.02k|    int argIndex = 0;
  902|  6.08k|    while (true) {
  ------------------
  |  Branch (902:12): [Folded - Ignored]
  ------------------
  903|  6.08k|        fmt = printFormatStringLiteral(out, fmt);
  904|  6.08k|        if (*fmt == '\0') {
  ------------------
  |  Branch (904:13): [True: 2.02k, False: 4.05k]
  ------------------
  905|  2.02k|            if (!positionalMode && argIndex < numArgs) {
  ------------------
  |  Branch (905:17): [True: 2.02k, False: 0]
  |  Branch (905:36): [True: 0, False: 2.02k]
  ------------------
  906|      0|                TINYFORMAT_ERROR("tinyformat: Not enough conversion specifiers in format string");
  ------------------
  |  |  135|      0|#define TINYFORMAT_ERROR(reasonString) throw tinyformat::format_error(reasonString)
  ------------------
  907|      0|            }
  908|  2.02k|            break;
  909|  2.02k|        }
  910|  4.05k|        bool spacePadPositive = false;
  911|  4.05k|        int ntrunc = -1;
  912|  4.05k|        const char* fmtEnd = streamStateFromFormat(out, positionalMode, spacePadPositive, ntrunc, fmt,
  913|  4.05k|                                                   args, argIndex, numArgs);
  914|       |        // NB: argIndex may be incremented by reading variable width/precision
  915|       |        // in `streamStateFromFormat`, so do the bounds check here.
  916|  4.05k|        if (argIndex >= numArgs) {
  ------------------
  |  Branch (916:13): [True: 0, False: 4.05k]
  ------------------
  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|  4.05k|        const FormatArg& arg = args[argIndex];
  921|       |        // Format the arg into the stream.
  922|  4.05k|        if (!spacePadPositive) {
  ------------------
  |  Branch (922:13): [True: 4.05k, False: 0]
  ------------------
  923|  4.05k|            arg.format(out, fmt, fmtEnd, ntrunc);
  924|  4.05k|        }
  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|  4.05k|        if (!positionalMode)
  ------------------
  |  Branch (941:13): [True: 4.05k, False: 0]
  ------------------
  942|  4.05k|            ++argIndex;
  943|  4.05k|        fmt = fmtEnd;
  944|  4.05k|    }
  945|       |
  946|       |    // Restore stream state
  947|  2.02k|    out.width(origWidth);
  948|  2.02k|    out.precision(origPrecision);
  949|  2.02k|    out.flags(origFlags);
  950|  2.02k|    out.fill(origFill);
  951|  2.02k|}
_ZN10tinyformat7vformatERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEPKcRKNS_10FormatListE:
 1070|  2.02k|{
 1071|  2.02k|    detail::formatImpl(out, fmt, list.m_args, list.m_N);
 1072|  2.02k|}
_ZN10tinyformat17FormatStringCheckILj2EEcvPKcEv:
  197|  2.02k|    operator const char*() { return fmt; }
_ZN10tinyformat6detail9FormatArgC2INSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEERKT_:
  534|  2.02k|            : m_value(static_cast<const void*>(&value)),
  535|  2.02k|            m_formatImpl(&formatImpl<T>),
  536|  2.02k|            m_toIntImpl(&toIntImpl<T>)
  537|  2.02k|        { }
_ZN10tinyformat6detail9FormatArg10formatImplINSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEvRNS3_13basic_ostreamIcS6_EEPKcSE_iPKv:
  558|  2.02k|        {
  559|  2.02k|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|  2.02k|        }
_ZN10tinyformat11formatValueINSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEEEvRNS1_13basic_ostreamIcS4_EEPKcSC_iRKT_:
  351|  2.02k|{
  352|  2.02k|#ifndef TINYFORMAT_ALLOW_WCHAR_STRINGS
  353|       |    // Since we don't support printing of wchar_t using "%ls", make it fail at
  354|       |    // compile time in preference to printing as a void* at runtime.
  355|  2.02k|    typedef typename detail::is_wchar<T>::tinyformat_wchar_is_not_supported DummyType;
  356|  2.02k|    (void) DummyType(); // avoid unused type warning with gcc-4.8
  357|  2.02k|#endif
  358|       |    // The mess here is to support the %c and %p conversions: if these
  359|       |    // conversions are active we try to convert the type to a char or const
  360|       |    // void* respectively and format that instead of the value itself.  For the
  361|       |    // %p conversion it's important to avoid dereferencing the pointer, which
  362|       |    // could otherwise lead to a crash when printing a dangling (const char*).
  363|  2.02k|    const bool canConvertToChar = detail::is_convertible<T,char>::value;
  364|  2.02k|    const bool canConvertToVoidPtr = detail::is_convertible<T, const void*>::value;
  365|  2.02k|    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|  2.02k|    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|  2.02k|    else if (ntrunc >= 0) {
  ------------------
  |  Branch (372:14): [True: 0, False: 2.02k]
  ------------------
  373|       |        // Take care not to overread C strings in truncating conversions like
  374|       |        // "%.4s" where at most 4 characters may be read.
  375|      0|        detail::formatTruncated(out, value, ntrunc);
  376|      0|    }
  377|  2.02k|    else
  378|  2.02k|        out << value;
  379|  2.02k|}
_ZN10tinyformat6detail9FormatArgC2IPKcEERKT_:
  534|  2.02k|            : m_value(static_cast<const void*>(&value)),
  535|  2.02k|            m_formatImpl(&formatImpl<T>),
  536|  2.02k|            m_toIntImpl(&toIntImpl<T>)
  537|  2.02k|        { }
_ZN10tinyformat6detail9FormatArg10formatImplIPKcEEvRNSt3__113basic_ostreamIcNS5_11char_traitsIcEEEES4_S4_iPKv:
  558|  2.02k|        {
  559|  2.02k|            formatValue(out, fmtBegin, fmtEnd, ntrunc, *static_cast<const T*>(value));
  560|  2.02k|        }
_ZN10tinyformat11formatValueIPKcEEvRNSt3__113basic_ostreamIcNS3_11char_traitsIcEEEES2_S2_iRKT_:
  351|  2.02k|{
  352|  2.02k|#ifndef TINYFORMAT_ALLOW_WCHAR_STRINGS
  353|       |    // Since we don't support printing of wchar_t using "%ls", make it fail at
  354|       |    // compile time in preference to printing as a void* at runtime.
  355|  2.02k|    typedef typename detail::is_wchar<T>::tinyformat_wchar_is_not_supported DummyType;
  356|  2.02k|    (void) DummyType(); // avoid unused type warning with gcc-4.8
  357|  2.02k|#endif
  358|       |    // The mess here is to support the %c and %p conversions: if these
  359|       |    // conversions are active we try to convert the type to a char or const
  360|       |    // void* respectively and format that instead of the value itself.  For the
  361|       |    // %p conversion it's important to avoid dereferencing the pointer, which
  362|       |    // could otherwise lead to a crash when printing a dangling (const char*).
  363|  2.02k|    const bool canConvertToChar = detail::is_convertible<T,char>::value;
  364|  2.02k|    const bool canConvertToVoidPtr = detail::is_convertible<T, const void*>::value;
  365|  2.02k|    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|  2.02k|    else if (canConvertToVoidPtr && *(fmtEnd-1) == 'p')
  ------------------
  |  Branch (367:14): [Folded - Ignored]
  |  Branch (367:37): [True: 0, False: 2.02k]
  ------------------
  368|      0|        detail::formatValueAsType<T, const void*>::invoke(out, value);
  369|       |#ifdef TINYFORMAT_OLD_LIBSTDCPLUSPLUS_WORKAROUND
  370|       |    else if (detail::formatZeroIntegerWorkaround<T>::invoke(out, value)) /**/;
  371|       |#endif
  372|  2.02k|    else if (ntrunc >= 0) {
  ------------------
  |  Branch (372:14): [True: 0, False: 2.02k]
  ------------------
  373|       |        // Take care not to overread C strings in truncating conversions like
  374|       |        // "%.4s" where at most 4 characters may be read.
  375|      0|        detail::formatTruncated(out, value, ntrunc);
  376|      0|    }
  377|  2.02k|    else
  378|  2.02k|        out << value;
  379|  2.02k|}
_ZN10tinyformat17FormatStringCheckILj2EEC2EN4util21ConstevalFormatStringILj2EEE:
  196|  2.02k|    FormatStringCheck(util::ConstevalFormatString<num_params> str) : fmt{str.fmt} {}
_ZN10tinyformat6formatIJPKcNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEES9_NS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1088|  2.02k|{
 1089|  2.02k|    std::ostringstream oss;
 1090|  2.02k|    format(oss, fmt, args...);
 1091|  2.02k|    return oss.str();
 1092|  2.02k|}
_ZN10tinyformat6formatIJPKcNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEEvRNS3_13basic_ostreamIcS6_EENS_17FormatStringCheckIXsZT_EEEDpRKT_:
 1080|  2.02k|{
 1081|  2.02k|    vformat(out, fmt, makeFormatList(args...));
 1082|  2.02k|}
_ZN10tinyformat14makeFormatListIJPKcNSt3__112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEEEEENS_6detail11FormatListNIXsZT_EEEDpRKT_:
 1044|  2.02k|{
 1045|  2.02k|    return detail::FormatListN<sizeof...(args)>(args...);
 1046|  2.02k|}
_ZN10tinyformat6detail11FormatListNILi2EEC2IJPKcNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEEEEDpRKT_:
  990|  2.02k|            : FormatList(&m_formatterStore[0], N),
  991|  2.02k|            m_formatterStore { FormatArg(args)... }
  992|  2.02k|        { static_assert(sizeof...(args) == N, "Number of args must be N"); }

_ZNK9base_blobILj256EE6GetHexEv:
   12|  2.02k|{
   13|  2.02k|    uint8_t m_data_rev[WIDTH];
   14|  66.8k|    for (int i = 0; i < WIDTH; ++i) {
  ------------------
  |  Branch (14:21): [True: 64.8k, False: 2.02k]
  ------------------
   15|  64.8k|        m_data_rev[i] = m_data[WIDTH - 1 - i];
   16|  64.8k|    }
   17|  2.02k|    return HexStr(m_data_rev);
   18|  2.02k|}

_ZN7uint160C2E4SpanIKhE:
  193|  3.94k|    constexpr explicit uint160(Span<const unsigned char> vch) : base_blob<160>(vch) {}
_ZN9base_blobILj256EE5beginEv:
  115|  3.94k|    constexpr unsigned char* begin() { return m_data.data(); }
_ZN9base_blobILj160EE5beginEv:
  115|  3.94k|    constexpr unsigned char* begin() { return m_data.data(); }
_ZNK9base_blobILj256EE5beginEv:
  118|  32.0k|    constexpr const unsigned char* begin() const { return m_data.data(); }
_ZN9base_blobILj256EE4sizeEv:
  121|  23.7k|    static constexpr unsigned int size() { return WIDTH; }
_ZNK9base_blobILj256EE7CompareERKS0_:
   64|  5.91k|    constexpr int Compare(const base_blob& other) const { return std::memcmp(m_data.data(), other.m_data.data(), WIDTH); }
_ZneRK9base_blobILj256EES2_:
   67|  5.91k|    friend constexpr bool operator!=(const base_blob& a, const base_blob& b) { return a.Compare(b) != 0; }
_ZNK9base_blobILj256EE4dataEv:
  112|  2.02k|    constexpr const unsigned char* data() const { return m_data.data(); }
_ZN9base_blobILj160EE4sizeEv:
  121|  37.4k|    static constexpr unsigned int size() { return WIDTH; }
_ZN9base_blobILj160EE4dataEv:
  113|  29.5k|    constexpr unsigned char* data() { return m_data.data(); }
_ZN9base_blobILj256EE4dataEv:
  113|  25.6k|    constexpr unsigned char* data() { return m_data.data(); }
_ZN7uint256C2Ev:
  205|  21.6k|    constexpr uint256() = default;
_ZN9base_blobILj256EEC2Ev:
   35|  21.6k|    constexpr base_blob() : m_data() {}
_ZNK9base_blobILj160EE4dataEv:
  112|  3.94k|    constexpr const unsigned char* data() const { return m_data.data(); }
_ZNK9base_blobILj160EE7CompareERKS0_:
   64|  31.5k|    constexpr int Compare(const base_blob& other) const { return std::memcmp(m_data.data(), other.m_data.data(), WIDTH); }
_ZltRK9base_blobILj160EES2_:
   68|  23.6k|    friend constexpr bool operator<(const base_blob& a, const base_blob& b) { return a.Compare(b) < 0; }
_ZN7uint160C2Ev:
  192|  33.5k|    constexpr uint160() = default;
_ZN9base_blobILj160EEC2Ev:
   35|  33.5k|    constexpr base_blob() : m_data() {}
_ZN9base_blobILj160EEC2E4SpanIKhE:
   41|  3.94k|    {
   42|  3.94k|        assert(vch.size() == WIDTH);
   43|  3.94k|        std::copy(vch.begin(), vch.end(), m_data.begin());
   44|  3.94k|    }
_ZeqRK9base_blobILj160EES2_:
   66|  7.88k|    friend constexpr bool operator==(const base_blob& a, const base_blob& b) { return a.Compare(b) == 0; }
_ZNK9base_blobILj160EE6IsNullEv:
   49|  3.94k|    {
   50|  3.94k|        return std::all_of(m_data.begin(), m_data.end(), [](uint8_t val) {
   51|  3.94k|            return val == 0;
   52|  3.94k|        });
   53|  3.94k|    }
_ZZNK9base_blobILj160EE6IsNullEvENKUlhE_clEh:
   50|  3.99k|        return std::all_of(m_data.begin(), m_data.end(), [](uint8_t val) {
   51|  3.99k|            return val == 0;
   52|  3.99k|        });
_ZNK9base_blobILj160EE5beginEv:
  118|  9.85k|    constexpr const unsigned char* begin() const { return m_data.data(); }
_ZNK9base_blobILj160EE3endEv:
  119|  9.85k|    constexpr const unsigned char* end() const { return m_data.data() + WIDTH; }

_Z22inline_assertion_checkILb1EbEOT0_S1_PKciS3_S3_:
   52|  4.05k|{
   53|  4.05k|    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|  4.05k|    ) {
   58|  4.05k|        if (!val) {
  ------------------
  |  Branch (58:13): [True: 0, False: 4.05k]
  ------------------
   59|      0|            assertion_fail(file, line, func, assertion);
   60|      0|        }
   61|  4.05k|    }
   62|  4.05k|    return std::forward<T>(val);
   63|  4.05k|}
_Z22inline_assertion_checkILb1ERPKNSt3__18functionIFvNS0_4spanIKhLm18446744073709551615EEEEEEEOT0_SB_PKciSD_SD_:
   52|  2.02k|{
   53|  2.02k|    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|  2.02k|    ) {
   58|  2.02k|        if (!val) {
  ------------------
  |  Branch (58:13): [True: 0, False: 2.02k]
  ------------------
   59|      0|            assertion_fail(file, line, func, assertion);
   60|      0|        }
   61|  2.02k|    }
   62|  2.02k|    return std::forward<T>(val);
   63|  2.02k|}
_Z22inline_assertion_checkILb1ERNSt3__16atomicIbEEEOT0_S5_PKciS7_S7_:
   52|  2.02k|{
   53|  2.02k|    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|  2.02k|    ) {
   58|  2.02k|        if (!val) {
  ------------------
  |  Branch (58:13): [True: 0, False: 2.02k]
  ------------------
   59|      0|            assertion_fail(file, line, func, assertion);
   60|      0|        }
   61|  2.02k|    }
   62|  2.02k|    return std::forward<T>(val);
   63|  2.02k|}

_ZN8BaseHashI7uint160EC2ERKS0_:
   16|  19.7k|    explicit BaseHash(const HashType& in) : m_hash(in) {}
_ZNK8BaseHashI7uint160EeqERKS1_:
   49|  3.94k|    {
   50|  3.94k|        return m_hash == other.m_hash;
   51|  3.94k|    }
_ZNK8BaseHashI7uint160E4dataEv:
   69|  3.94k|    const unsigned char* data() const { return m_hash.data(); }
_ZNK8BaseHashI7uint160E4sizeEv:
   64|  3.94k|    {
   65|  3.94k|        return m_hash.size();
   66|  3.94k|    }
_ZNK8BaseHashI7uint160E5beginEv:
   24|  9.85k|    {
   25|  9.85k|        return m_hash.begin();
   26|  9.85k|    }
_ZNK8BaseHashI7uint160E3endEv:
   34|  9.85k|    {
   35|  9.85k|        return m_hash.end();
   36|  9.85k|    }

_Z16AdditionOverflowImEbT_S0_:
   16|  3.94k|{
   17|  3.94k|    static_assert(std::is_integral<T>::value, "Integral required.");
   18|       |    if constexpr (std::numeric_limits<T>::is_signed) {
   19|       |        return (i > 0 && j > std::numeric_limits<T>::max() - i) ||
   20|       |               (i < 0 && j < std::numeric_limits<T>::min() - i);
   21|       |    }
   22|  3.94k|    return std::numeric_limits<T>::max() - i < j;
   23|  3.94k|}
_Z10CheckedAddImENSt3__18optionalIT_EES2_S2_:
   27|  3.94k|{
   28|  3.94k|    if (AdditionOverflow(i, j)) {
  ------------------
  |  Branch (28:9): [True: 0, False: 3.94k]
  ------------------
   29|      0|        return std::nullopt;
   30|      0|    }
   31|  3.94k|    return i + j;
   32|  3.94k|}

_Z5IsHexNSt3__117basic_string_viewIcNS_11char_traitsIcEEEE:
   42|  1.97k|{
   43|   130k|    for (char c : str) {
  ------------------
  |  Branch (43:17): [True: 130k, False: 1.97k]
  ------------------
   44|   130k|        if (HexDigit(c) < 0) return false;
  ------------------
  |  Branch (44:13): [True: 0, False: 130k]
  ------------------
   45|   130k|    }
   46|  1.97k|    return (str.size() > 0) && (str.size()%2 == 0);
  ------------------
  |  Branch (46:12): [True: 1.97k, False: 0]
  |  Branch (46:32): [True: 1.97k, False: 0]
  ------------------
   47|  1.97k|}
_Z11TryParseHexIhENSt3__18optionalINS0_6vectorIT_NS0_9allocatorIS3_EEEEEENS0_17basic_string_viewIcNS0_11char_traitsIcEEEE:
   51|  1.97k|{
   52|  1.97k|    std::vector<Byte> vch;
   53|  1.97k|    vch.reserve(str.size() / 2); // two hex characters form a single byte
   54|       |
   55|  1.97k|    auto it = str.begin();
   56|  67.0k|    while (it != str.end()) {
  ------------------
  |  Branch (56:12): [True: 65.0k, False: 1.97k]
  ------------------
   57|  65.0k|        if (IsSpace(*it)) {
  ------------------
  |  Branch (57:13): [True: 0, False: 65.0k]
  ------------------
   58|      0|            ++it;
   59|      0|            continue;
   60|      0|        }
   61|  65.0k|        auto c1 = HexDigit(*(it++));
   62|  65.0k|        if (it == str.end()) return std::nullopt;
  ------------------
  |  Branch (62:13): [True: 0, False: 65.0k]
  ------------------
   63|  65.0k|        auto c2 = HexDigit(*(it++));
   64|  65.0k|        if (c1 < 0 || c2 < 0) return std::nullopt;
  ------------------
  |  Branch (64:13): [True: 0, False: 65.0k]
  |  Branch (64:23): [True: 0, False: 65.0k]
  ------------------
   65|  65.0k|        vch.push_back(Byte(c1 << 4) | Byte(c2));
   66|  65.0k|    }
   67|  1.97k|    return vch;
   68|  1.97k|}
_Z7ToLowerNSt3__117basic_string_viewIcNS_11char_traitsIcEEEE:
  416|  3.94k|{
  417|  3.94k|    std::string r;
  418|  3.94k|    r.reserve(str.size());
  419|  15.7k|    for (auto ch : str) r += ToLower(ch);
  ------------------
  |  Branch (419:18): [True: 15.7k, False: 3.94k]
  ------------------
  420|  3.94k|    return r;
  421|  3.94k|}

_Z7IsSpacec:
  166|   313k|constexpr inline bool IsSpace(char c) noexcept {
  167|   313k|    return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v';
  ------------------
  |  Branch (167:12): [True: 0, False: 313k]
  |  Branch (167:24): [True: 0, False: 313k]
  |  Branch (167:37): [True: 0, False: 313k]
  |  Branch (167:50): [True: 0, False: 313k]
  |  Branch (167:63): [True: 0, False: 313k]
  |  Branch (167:76): [True: 0, False: 313k]
  ------------------
  168|   313k|}
_Z7ToLowerc:
  305|  15.7k|{
  306|  15.7k|    return (c >= 'A' && c <= 'Z' ? (c - 'A') + 'a' : c);
  ------------------
  |  Branch (306:13): [True: 13.9k, False: 1.80k]
  |  Branch (306:25): [True: 3.23k, False: 10.7k]
  ------------------
  307|  15.7k|}
_Z8ParseHexIhENSt3__16vectorIT_NS0_9allocatorIS2_EEEENS0_17basic_string_viewIcNS0_11char_traitsIcEEEE:
   69|  1.97k|{
   70|  1.97k|    return TryParseHex<Byte>(hex_str).value_or(std::vector<Byte>{});
   71|  1.97k|}

_ZN4util13ContainsNoNULENSt3__117basic_string_viewIcNS0_11char_traitsIcEEEE:
  222|  5.91k|{
  223|   236k|    for (auto c : str) {
  ------------------
  |  Branch (223:17): [True: 236k, False: 5.91k]
  ------------------
  224|   236k|        if (c == 0) return false;
  ------------------
  |  Branch (224:13): [True: 0, False: 236k]
  ------------------
  225|   236k|    }
  226|  5.91k|    return true;
  227|  5.91k|}

_ZN4util21ThreadGetInternalNameEv:
   47|  2.02k|std::string util::ThreadGetInternalName() { return g_thread_name; }

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

_Z6VectorIJNSt3__17variantIJ14CNoDestination17PubKeyDestination6PKHash10ScriptHash19WitnessV0ScriptHash16WitnessV0KeyHash16WitnessV1Taproot11PayToAnchor14WitnessUnknownEEESB_SB_EENS0_6vectorINS0_11common_typeIJDpT_EE4typeENS0_9allocatorISH_EEEEDpOSE_:
   24|  1.97k|{
   25|  1.97k|    std::vector<typename std::common_type<Args...>::type> ret;
   26|  1.97k|    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.97k|    (void)std::initializer_list<int>{(ret.emplace_back(std::forward<Args>(args)), 0)...};
   29|  1.97k|    return ret;
   30|  1.97k|}

